/* ==========================================================================
   Spectrum Piano — Laser Diode Component Portal Stylesheet
   ========================================================================== */

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-page);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* Accessibility: High-contrast focus ring (never rely on color alone) */
:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   Top Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: rgba(11, 17, 32, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-dark);
}

.nav-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-on-dark);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-logo:hover {
  text-decoration: none;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b5cff 0%, #22c55e 45%, #ff2d2d 75%, #f59e0b 100%);
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 0 16px rgba(59, 92, 255, 0.4);
}

.brand-sub {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-on-dark-muted);
  display: block;
  line-height: 1.1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  white-space: nowrap;
}

.nav-links a {
  color: #cbd5e1;
  font-size: 0.88rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.15s;
}

.nav-links a:hover {
  color: #ffffff;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid transparent;
  position: relative;
  transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.1s ease, border-color 0.15s ease;
}

.btn:active {
  transform: translateY(2px);
}

.btn-primary {
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 65%, #1d4ed8 100%);
  color: #ffffff;
  border-color: #60a5fa;
  box-shadow: 0 4px 0 #1e3a8a, 0 6px 14px rgba(37, 99, 235, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(180deg, #60a5fa 0%, #2563eb 70%, #1e40af 100%);
  text-decoration: none;
  box-shadow: 0 4px 0 #1e3a8a, 0 8px 18px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-primary:active {
  box-shadow: 0 1px 0 #1e3a8a, 0 2px 6px rgba(37, 99, 235, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.25);
}

.btn-gold {
  background: linear-gradient(180deg, #fcd34d 0%, #f59e0b 65%, #d97706 100%);
  color: #0b1120;
  border-color: #fde68a;
  box-shadow: 0 4px 0 #92400e, 0 6px 14px rgba(245, 158, 11, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.btn-gold:hover {
  filter: brightness(1.05);
  text-decoration: none;
}

.btn-gold:active {
  box-shadow: 0 1px 0 #92400e, 0 2px 6px rgba(245, 158, 11, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-ghost-dark {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.05) 100%);
  color: #e2e8f0;
  border-color: rgba(148, 163, 184, 0.32);
  box-shadow: 0 3px 0 rgba(2, 6, 23, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-ghost-dark:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18) 0%, rgba(255, 255, 255, 0.08) 100%);
  text-decoration: none;
}

.btn-ghost-dark:active {
  box-shadow: 0 1px 0 rgba(2, 6, 23, 0.75), inset 0 2px 4px rgba(0, 0, 0, 0.35);
}

.btn-outline {
  background: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);
  color: var(--text-primary);
  border-color: #cbd5e1;
  box-shadow: 0 3px 0 #cbd5e1, 0 4px 8px rgba(15, 23, 42, 0.06), inset 0 1px 0 #ffffff;
}

.btn-outline:hover {
  background: linear-gradient(180deg, #ffffff 0%, #e2e8f0 100%);
  text-decoration: none;
}

.btn-outline:active {
  box-shadow: 0 1px 0 #cbd5e1, inset 0 2px 4px rgba(15, 23, 42, 0.12);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.8rem;
  border-radius: 6px;
}

/* ==========================================================================
   Hero Section — Spectrum Piano Keyboard
   ========================================================================== */
.hero-section {
  background: radial-gradient(ellipse 80% 55% at 50% 0%, rgba(59, 92, 255, 0.16), transparent 70%),
              linear-gradient(180deg, var(--bg-hero) 0%, var(--bg-hero-grad-end) 100%);
  color: var(--text-on-dark);
  padding: 36px 0 44px;
  border-bottom: 1px solid var(--border-dark);
  position: relative;
  overflow: hidden;
}

.hero-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(59, 92, 255, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: #93c5fd;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-h1 {
  margin: 0 0 8px;
  font-size: clamp(1.55rem, 2.7vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: #ffffff;
}

.hero-subtitle {
  margin: 0;
  font-size: 0.98rem;
  color: var(--text-on-dark-muted);
  max-width: 720px;
}

.hero-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.audio-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-dark);
  color: #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.audio-toggle[aria-pressed="true"] {
  background: rgba(34, 197, 94, 0.18);
  border-color: rgba(34, 197, 94, 0.55);
  color: #86efac;
}

.hero-stats-pill {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid var(--border-dark);
  font-size: 0.82rem;
  color: #cbd5e1;
}

.hero-stats-pill strong {
  color: #ffffff;
  font-family: var(--font-mono);
}

/* Spectrum Band Bar (Legend + Mobile Quick Filter Tabs) */
.spectrum-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.spectrum-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  font-size: 0.78rem;
  color: var(--text-on-dark-muted);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.band-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.band-tab {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--border-dark);
  background: rgba(255, 255, 255, 0.04);
  color: #cbd5e1;
  font-size: 0.78rem;
  font-weight: 600;
  transition: all 0.15s;
}

.band-tab:hover,
.band-tab.active {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(96, 165, 250, 0.6);
  color: #ffffff;
}

/* Piano Keyboard Chassis — 3D Optical Instrument Stage */
.piano-stage {
  position: relative;
  border-radius: var(--radius-lg);
  background: radial-gradient(ellipse 90% 60% at 50% 10%, rgba(59, 92, 255, 0.14), transparent 65%),
              linear-gradient(180deg, #111a30 0%, #070c18 100%);
  border: 1px solid rgba(148, 163, 184, 0.32);
  padding: 20px 18px 22px;
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.6),
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    inset 0 -10px 24px rgba(0, 0, 0, 0.45);
  overflow: visible;
}

.spectrum-bar-glow {
  height: 7px;
  border-radius: 999px;
  margin-bottom: 18px;
  background: linear-gradient(90deg,
    var(--wl-405) 0%,
    var(--wl-450) 14%,
    var(--wl-462) 22%,
    var(--wl-520) 32%,
    var(--wl-638) 44%,
    var(--wl-650) 50%,
    var(--wl-780) 58%,
    var(--wl-808) 65%,
    var(--wl-850) 72%,
    var(--wl-905) 80%,
    var(--wl-980) 88%,
    var(--wl-1064) 93%,
    var(--wl-1535-1550-border) 100%
  );
  box-shadow: 0 0 24px rgba(59, 92, 255, 0.5), 0 0 12px rgba(245, 158, 11, 0.35);
}

.piano-scroll-wrap {
  position: relative;
  overflow: visible;
  padding: 22px 8px 34px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

@media (max-width: 960px) {
  .piano-scroll-wrap {
    overflow-x: auto;
    overflow-y: hidden;
  }
}

/* Piano Keys Layout:
   Photorealistic Grand Piano Keybed — fallboard overhang + crimson felt strip physically overlapping top of all keys! */
.piano-keyboard {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  min-width: 820px;
  height: 280px;
  margin: 0 auto;
  padding: 6px 12px 26px;
  border-radius: 12px;
  background: linear-gradient(180deg, #02040a 0%, #060913 100%);
  box-shadow:
    inset 0 14px 24px rgba(0, 0, 0, 0.95),
    inset 0 -6px 14px rgba(0, 0, 0, 0.85),
    0 3px 0 rgba(255, 255, 255, 0.08);
  user-select: none;
  perspective: 1100px;
}

/* Physical Grand-Piano Fallboard + Crimson Felt Damper Bar sitting OVER the top edge of all keys (z-index 15) */
.piano-keyboard::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 11px;
  border-radius: 12px 12px 2px 2px;
  background: linear-gradient(180deg, #0f172a 0%, #050811 55%, #881337 72%, #be123c 88%, #4c0519 100%);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  z-index: 15;
  pointer-events: none;
}

.piano-key {
  position: relative;
  border: 0;
  padding: 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  transform-origin: 50% 0%;
  transition: transform 0.11s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.11s ease,
              filter 0.14s ease,
              border-color 0.14s ease,
              opacity 0.18s ease;
  will-change: transform;
}

/* White Keys — Photorealistic Weighted Ivory Key Block (20px thick sculpted front skirt!) */
.piano-key.key-white {
  flex: 1 0 104px;
  max-width: 158px;
  height: 242px;
  margin: 0 2.5px;
  border-radius: 3px 3px 9px 9px;
  background:
    linear-gradient(90deg,
      rgba(255, 255, 255, 0.78) 0%,
      rgba(255, 255, 255, 0.15) 6%,
      transparent 10%,
      transparent 90%,
      rgba(15, 23, 42, 0.12) 95%,
      rgba(15, 23, 42, 0.28) 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--key-color) 86%, #ffffff 14%) 0%,
      color-mix(in srgb, var(--key-color) 42%, #ffffff 58%) 24%,
      color-mix(in srgb, var(--key-color) 11%, #ffffff 89%) 52%,
      #ffffff 82%,
      #edf2f7 96%,
      #dce4ee 100%);
  color: #0f172a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(0, 0, 0, 0.45);
  border-left: 1.5px solid rgba(255, 255, 255, 0.92);
  border-right: 1.5px solid rgba(71, 85, 105, 0.42);
  border-bottom: 2.5px solid #ffffff;
  /* 20px solid sculpted physical ivory front wall + grounded keybed shadow */
  box-shadow:
    0 2px 0 #f8fafc,
    0 5px 0 #e2e8f0,
    0 8px 0 #cbd5e1,
    0 12px 0 #94a3b8,
    0 16px 0 color-mix(in srgb, var(--key-color) 32%, #475569 68%),
    0 19px 0 #1e293b,
    0 21px 0 #020617,
    0 28px 34px rgba(0, 0, 0, 0.8),
    inset 0 8px 12px rgba(0, 0, 0, 0.18),
    inset 0 -4px 6px rgba(15, 23, 42, 0.08);
  padding: 12px 6px 14px;
  z-index: 1;
}

.piano-key.key-white::before {
  content: "";
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 7px;
  height: 5px;
  border-radius: 999px;
  background: var(--key-color);
  box-shadow: 0 0 12px var(--key-color);
}

/* Specular reflection on ivory white keys */
.piano-key.key-white::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 4px;
  right: 4px;
  height: 28%;
  border-radius: 2px 2px 35% 35%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34) 0%, rgba(255, 255, 255, 0.02) 100%);
  pointer-events: none;
}

/* Black Keys — Photorealistic Trapezoidal Grand-Piano Ebony Key Block */
.piano-key.key-black {
  width: 72px;
  height: 150px;
  margin-left: -36px;
  margin-right: -36px;
  border-radius: 3px 3px 8px 8px;
  /* Visible sloped glossy ebony side chamfers + deep piano black body */
  background:
    linear-gradient(90deg,
      #334155 0%,
      #1e293b 8%,
      rgba(255, 255, 255, 0.16) 11%,
      transparent 16%,
      transparent 84%,
      rgba(0, 0, 0, 0.72) 89%,
      #02040a 100%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--key-color) 84%, #000000 16%) 0%,
      color-mix(in srgb, var(--key-color) 28%, #111827 72%) 32%,
      #0f172a 60%,
      #070b14 88%,
      #1e293b 95%,
      #03050a 100%);
  color: #f8fafc;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.95);
  border-top: 1px solid rgba(0, 0, 0, 0.85);
  border-left: 2px solid rgba(148, 163, 184, 0.32);
  border-right: 2px solid #02040a;
  border-bottom: 2px solid rgba(148, 163, 184, 0.38);
  /* 16px sculpted ebony prism extrusion + realistic right-bottom cast shadow onto white keys */
  box-shadow:
    0 3px 0 #273449,
    0 6px 0 #172033,
    0 10px 0 #0b101c,
    0 14px 0 #03050a,
    0 16px 0 #000000,
    5px 14px 16px rgba(0, 0, 0, 0.72),
    -2px 12px 12px rgba(0, 0, 0, 0.52),
    0 22px 28px rgba(0, 0, 0, 0.9),
    inset 0 6px 10px rgba(0, 0, 0, 0.55),
    inset 0 -10px 10px rgba(0, 0, 0, 0.45);
  padding: 8px 5px 13px;
  z-index: 6;
}

/* Raised narrower flat ebony playing surface bevel on black keys */
.piano-key.key-black::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 7px;
  right: 7px;
  bottom: 16px;
  border-radius: 3px 3px 5px 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.24);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-right: 1px solid rgba(0, 0, 0, 0.65);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, transparent 45%, rgba(255, 255, 255, 0.04) 100%);
  pointer-events: none;
}

.piano-key.key-black::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 5px;
  border-radius: 999px;
  background: var(--key-color);
  box-shadow: 0 0 14px var(--key-color), 0 0 5px rgba(255, 255, 255, 0.65);
}

/* First key 405nm is a black key at the left edge */
.piano-key.key-black.key-edge-left {
  margin-left: 0;
  margin-right: -30px;
}

/* Special Core Wavelength Styling: 905nm & 1535/1550nm (20px thick physical grand-piano white key!) */
.piano-key.is-core {
  z-index: 2;
}

.piano-key.is-core.key-905 {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.72) 0%, transparent 8%, transparent 92%, rgba(154, 52, 18, 0.22) 100%),
    linear-gradient(180deg, #ea580c 0%, #fb923c 24%, #ffedd5 52%, #ffffff 84%, #f5e6d8 100%);
  color: #431407;
  border: 2px solid #ea580c;
  box-shadow:
    0 2px 0 #ffedd5,
    0 5px 0 #fed7aa,
    0 9px 0 #fb923c,
    0 13px 0 #c2410c,
    0 17px 0 #7c2d12,
    0 20px 0 #431407,
    0 0 32px rgba(234, 88, 12, 0.62),
    0 28px 34px rgba(0, 0, 0, 0.75),
    inset 0 8px 12px rgba(154, 52, 18, 0.16);
  animation: corePulse905 2.8s ease-in-out infinite;
}

.piano-key.is-core.key-1535 {
  background:
    linear-gradient(90deg, rgba(254, 240, 138, 0.52) 0%, transparent 8%, transparent 92%, rgba(120, 53, 15, 0.24) 100%),
    linear-gradient(180deg, #1e1e2e 0%, #3b3355 24%, #fef3c7 56%, #ffffff 85%, #ede9e0 100%);
  color: #0f172a;
  border: 2px solid #f59e0b;
  box-shadow:
    0 2px 0 #fef3c7,
    0 5px 0 #fde68a,
    0 9px 0 #fbbf24,
    0 13px 0 #d97706,
    0 17px 0 #92400e,
    0 20px 0 #451a03,
    0 0 34px rgba(245, 158, 11, 0.6),
    0 28px 36px rgba(0, 0, 0, 0.78),
    inset 0 8px 12px rgba(15, 23, 42, 0.18);
  animation: corePulse1535 2.8s ease-in-out infinite;
}

.piano-key.is-core.key-1535::before {
  background: linear-gradient(90deg, #d97706, #fbbf24, #d97706);
  box-shadow: 0 0 16px #f59e0b;
}

@keyframes corePulse905 {
  0%, 100% {
    box-shadow: 0 2px 0 #ffedd5, 0 5px 0 #fed7aa, 0 9px 0 #fb923c, 0 13px 0 #c2410c, 0 17px 0 #7c2d12, 0 20px 0 #431407, 0 0 22px rgba(234, 88, 12, 0.5), 0 28px 32px rgba(0, 0, 0, 0.72), inset 0 8px 12px rgba(154, 52, 18, 0.16);
  }
  50% {
    box-shadow: 0 2px 0 #ffedd5, 0 5px 0 #fed7aa, 0 9px 0 #fb923c, 0 13px 0 #c2410c, 0 17px 0 #7c2d12, 0 20px 0 #431407, 0 0 42px rgba(251, 146, 60, 0.9), 0 28px 36px rgba(0, 0, 0, 0.78), inset 0 8px 12px rgba(154, 52, 18, 0.16);
  }
}

@keyframes corePulse1535 {
  0%, 100% {
    box-shadow: 0 2px 0 #fef3c7, 0 5px 0 #fde68a, 0 9px 0 #fbbf24, 0 13px 0 #d97706, 0 17px 0 #92400e, 0 20px 0 #451a03, 0 0 22px rgba(245, 158, 11, 0.48), 0 28px 34px rgba(0, 0, 0, 0.74), inset 0 8px 12px rgba(15, 23, 42, 0.18);
  }
  50% {
    box-shadow: 0 2px 0 #fef3c7, 0 5px 0 #fde68a, 0 9px 0 #fbbf24, 0 13px 0 #d97706, 0 17px 0 #92400e, 0 20px 0 #451a03, 0 0 44px rgba(251, 191, 36, 0.92), 0 28px 38px rgba(0, 0, 0, 0.8), inset 0 8px 12px rgba(15, 23, 42, 0.18);
  }
}

/* Hover / Active / Bidirectional Linked / Pressed States
   Top edge stays 100% locked under the crimson felt fallboard (NO top gap!),
   while the front of the key pivots downward into the keybed and compresses its 3D vertical wall! */
.piano-key.key-white:hover,
.piano-key.key-white.is-active,
.piano-key.key-white.is-linked {
  transform: translateY(3px) rotateX(-5.5deg) scaleY(1.028);
  filter: brightness(1.03) saturate(1.14);
  box-shadow:
    0 2px 0 #e2e8f0,
    0 4px 0 #94a3b8,
    0 7px 0 color-mix(in srgb, var(--key-color) 40%, #334155 60%),
    0 9px 0 #0f172a,
    0 12px 20px rgba(0, 0, 0, 0.85),
    0 0 32px var(--key-glow, var(--key-color)),
    inset 0 14px 18px rgba(15, 23, 42, 0.28),
    inset 6px 0 12px rgba(0, 0, 0, 0.28),
    inset -6px 0 12px rgba(0, 0, 0, 0.28);
  border-color: var(--key-glow, var(--key-color));
  z-index: 3;
}

.piano-key.key-black:hover,
.piano-key.key-black.is-active,
.piano-key.key-black.is-linked {
  transform: translateY(2px) rotateX(-6.5deg) scaleY(1.045);
  filter: brightness(1.12) saturate(1.22);
  box-shadow:
    0 2px 0 #1e293b,
    0 4px 0 #0b101c,
    0 6px 0 #000000,
    2px 6px 10px rgba(0, 0, 0, 0.82),
    0 12px 20px rgba(0, 0, 0, 0.92),
    0 0 34px var(--key-glow, var(--key-color)),
    inset 0 10px 14px rgba(0, 0, 0, 0.68),
    inset 4px 0 8px rgba(0, 0, 0, 0.6),
    inset -4px 0 8px rgba(0, 0, 0, 0.6);
  border-color: #ffffff;
  z-index: 10;
}

.piano-key.is-neighbor {
  transform: translateY(0);
}

/* Deep Full-Travel Grand-Piano Strike on Click — top stays sealed under fallboard, front bottoms out! */
.piano-key.key-white.is-pressed {
  transform: translateY(4px) rotateX(-8deg) scaleY(1.045) !important;
  filter: brightness(1.08) saturate(1.24) !important;
  box-shadow:
    0 1px 0 #94a3b8,
    0 3px 0 color-mix(in srgb, var(--key-color) 48%, #1e293b 52%),
    0 4px 0 #020617,
    0 6px 12px rgba(0, 0, 0, 0.88),
    0 0 46px var(--key-glow, var(--key-color)),
    inset 0 16px 22px rgba(15, 23, 42, 0.38),
    inset 7px 0 14px rgba(0, 0, 0, 0.34),
    inset -7px 0 14px rgba(0, 0, 0, 0.34) !important;
}

.piano-key.key-black.is-pressed {
  transform: translateY(3px) rotateX(-9deg) scaleY(1.065) !important;
  filter: brightness(1.2) saturate(1.32) !important;
  box-shadow:
    0 1px 0 #0f172a,
    0 2px 0 #000000,
    0 5px 12px rgba(0, 0, 0, 0.95),
    0 0 46px var(--key-glow, var(--key-color)),
    inset 0 12px 18px rgba(0, 0, 0, 0.82) !important;
}

.piano-key.is-dimmed {
  opacity: 0.32;
  filter: saturate(0.45);
}

.key-core-badge {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  z-index: 2;
}

.key-905 .key-core-badge {
  background: #ffffff;
  color: #9a3412;
}

.key-1535 .key-core-badge {
  background: linear-gradient(135deg, #fde047, #f59e0b);
  color: #0b1120;
}

.key-invisible-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(15, 23, 42, 0.1);
  color: #334155;
  margin-bottom: 4px;
}

.key-black .key-invisible-tag {
  background: rgba(255, 255, 255, 0.14);
  color: #e2e8f0;
}

.key-nm {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 1.02rem;
  line-height: 1.1;
}

.key-black .key-nm {
  font-size: 0.85rem;
}

.key-unit {
  font-size: 0.66rem;
  font-weight: 700;
  opacity: 0.88;
}

.key-meta {
  font-size: 0.68rem;
  font-weight: 600;
  opacity: 0.86;
  margin-top: 3px;
  margin-bottom: 12px;
  white-space: nowrap;
}

.key-black .key-meta {
  font-size: 0.61rem;
  margin-bottom: 9px;
}

.key-count-chip {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--key-color) 16%, #ffffff 84%);
  border: 1px solid color-mix(in srgb, var(--key-color) 45%, transparent 55%);
  color: #0f172a;
  margin-top: 3px;
}

.key-black .key-count-chip {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* ==========================================================================
   Continuous Downward Luminous Waterfall (悬浮持续向下瀑布流光)
   + Acoustic Soundwave (声波) + Optical Lightwave (光波) FX
   ========================================================================== */

/* Persistent continuous waterfall beam while hovering any key */
.key-waterfall-live {
  position: absolute;
  top: 97%;
  left: 50%;
  width: 96%;
  height: 155px;
  border-radius: 4px 4px 28px 28px;
  pointer-events: none;
  z-index: 26;
  opacity: 0;
  transform: translateX(-50%) scaleY(0.08);
  transform-origin: top center;
  transition: opacity 0.22s ease, transform 0.28s cubic-bezier(0.16, 0.85, 0.3, 1);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.28) 0px,
      rgba(255, 255, 255, 0.04) 18px,
      transparent 36px,
      rgba(255, 255, 255, 0.22) 54px
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.22) 0px,
      transparent 4px,
      transparent 11px,
      rgba(255, 255, 255, 0.12) 13px
    ),
    linear-gradient(
      180deg,
      #ffffff 0%,
      var(--key-glow, var(--key-color)) 14%,
      color-mix(in srgb, var(--key-glow, var(--key-color)) 84%, transparent 16%) 55%,
      color-mix(in srgb, var(--key-glow, var(--key-color)) 26%, transparent 74%) 85%,
      transparent 100%
    );
  background-size: 100% 54px, 100% 100%, 100% 100%;
  box-shadow:
    0 14px 36px color-mix(in srgb, var(--key-glow, var(--key-color)) 65%, transparent 35%),
    inset 0 4px 10px rgba(255, 255, 255, 0.72);
}

.piano-key:hover .key-waterfall-live,
.piano-key:focus-visible .key-waterfall-live {
  opacity: 0.96;
  transform: translateX(-50%) scaleY(1);
  animation: waterfallFlowLoop 0.75s linear infinite;
}

.piano-key.is-pressed .key-waterfall-live {
  opacity: 1;
  transform: translateX(-50%) scaleY(1.25);
}

@keyframes waterfallFlowLoop {
  0%   { background-position: 0 0, 0 0, 0 0; }
  100% { background-position: 0 54px, 0 0, 0 0; }
}

/* Steady mist pool at the bottom of the live waterfall while hovering */
.key-waterfall-mist-live {
  position: absolute;
  top: calc(97% + 132px);
  left: 50%;
  width: 140%;
  height: 28px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 25;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--key-glow, var(--key-color)) 85%, #ffffff 15%) 0%, transparent 72%);
  filter: blur(6px);
  opacity: 0;
  transform: translateX(-50%) scale(0.4);
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.piano-key:hover .key-waterfall-mist-live,
.piano-key:focus-visible .key-waterfall-mist-live {
  opacity: 0.85;
  transform: translateX(-50%) scale(1.1);
}

/* 2. Concentric Acoustic Soundwave Ripples (声波涟漪) */
.sound-wave-ring {
  position: absolute;
  top: 40%;
  left: 50%;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--fx-color, #ffffff);
  box-shadow: 0 0 14px var(--fx-color, #ffffff), inset 0 0 8px var(--fx-color, #ffffff);
  pointer-events: none;
  z-index: 28;
  opacity: 0;
  animation: soundWaveRipple var(--dur, 0.85s) cubic-bezier(0.16, 0.85, 0.32, 1) var(--delay, 0s) forwards;
}

@keyframes soundWaveRipple {
  0%   { opacity: 0.92; transform: translate(-50%, -50%) scale(0.45); }
  55%  { opacity: 0.48; }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(var(--max-scale, 5.2)); }
}

/* 3. Oscillating Sinusoidal Soundwave Ribbon (正弦声波波形) */
.sound-sine-svg {
  position: absolute;
  top: -36px;
  left: 50%;
  width: 150px;
  height: 44px;
  pointer-events: none;
  z-index: 33;
  overflow: visible;
  filter: drop-shadow(0 0 8px var(--fx-color, #fff)) drop-shadow(0 0 3px #ffffff);
  animation: sineWavePulse 0.82s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sineWavePulse {
  0%   { opacity: 0;   transform: translate(-50%, 16px) scaleX(0.35) scaleY(0.4); }
  20%  { opacity: 1;   transform: translate(-50%, 0px) scaleX(1.05) scaleY(1.25); }
  55%  { opacity: 0.85; transform: translate(-50%, -14px) scaleX(1.28) scaleY(0.75); }
  100% { opacity: 0;   transform: translate(-50%, -32px) scaleX(1.55) scaleY(0.2); }
}

/* 4. Optical Lightwave Fan & Wavefronts (光学扇形光波) */
.light-wave-fan {
  position: absolute;
  bottom: 72%;
  left: 50%;
  width: 130px;
  height: 170px;
  pointer-events: none;
  z-index: 24;
  transform-origin: bottom center;
  background: conic-gradient(
    from -28deg at 50% 100%,
    transparent 0deg,
    color-mix(in srgb, var(--fx-color, #fff) 32%, transparent 68%) 12deg,
    color-mix(in srgb, var(--fx-color, #fff) 75%, #ffffff 25%) 28deg,
    color-mix(in srgb, var(--fx-color, #fff) 32%, transparent 68%) 44deg,
    transparent 56deg
  );
  filter: blur(4px);
  mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.65) 55%, transparent 100%);
  -webkit-mask-image: linear-gradient(to top, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.65) 55%, transparent 100%);
  animation: lightFanBloom 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes lightFanBloom {
  0%   { opacity: 0;   transform: translateX(-50%) scaleY(0.15) scaleX(0.4); }
  22%  { opacity: 0.95; transform: translateX(-50%) scaleY(1.05) scaleX(1.05); }
  100% { opacity: 0;   transform: translateX(-50%) scaleY(1.38) scaleX(1.35); }
}

/* Traveling optical wavefront arcs shooting upward */
.light-wave-arc {
  position: absolute;
  bottom: 78%;
  left: 50%;
  width: 64px;
  height: 22px;
  border-top: 3px solid var(--fx-color, #fff);
  border-radius: 50% 50% 0 0 / 100% 100% 0 0;
  box-shadow: 0 -4px 16px var(--fx-color, #fff), 0 -1px 5px #ffffff;
  pointer-events: none;
  z-index: 29;
  opacity: 0;
  animation: lightArcRise 0.75s cubic-bezier(0.14, 0.85, 0.3, 1) var(--delay, 0s) forwards;
}

@keyframes lightArcRise {
  0%   { opacity: 0.95; transform: translate(-50%, 8px) scaleX(0.65); }
  60%  { opacity: 0.65; }
  100% { opacity: 0;    transform: translate(-50%, -115px) scaleX(2.15); }
}

/* ==========================================================================
   Downward Luminous Color Waterfall Projection (向下瀑布式光色投射)
   ========================================================================== */
.waterfall-curtain {
  position: absolute;
  top: 97%;
  left: 50%;
  width: 96%;
  height: var(--wf-h, 155px);
  border-radius: 4px 4px 28px 28px;
  pointer-events: none;
  z-index: 26;
  transform-origin: top center;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.24) 0px,
      transparent 4px,
      transparent 10px,
      rgba(255, 255, 255, 0.14) 12px
    ),
    linear-gradient(
      180deg,
      #ffffff 0%,
      var(--fx-color, #3b5cff) 16%,
      color-mix(in srgb, var(--fx-color, #3b5cff) 82%, transparent 18%) 52%,
      color-mix(in srgb, var(--fx-color, #3b5cff) 28%, transparent 72%) 82%,
      transparent 100%
    );
  box-shadow:
    0 12px 32px color-mix(in srgb, var(--fx-color, #3b5cff) 65%, transparent 35%),
    inset 0 4px 10px rgba(255, 255, 255, 0.75);
  filter: blur(0.6px);
  animation: waterfallPour var(--wf-dur, 0.92s) cubic-bezier(0.16, 0.85, 0.3, 1) forwards;
}

@keyframes waterfallPour {
  0%   { opacity: 0.98; transform: translateX(-50%) scaleY(0.05) scaleX(0.92); }
  28%  { opacity: 0.95; transform: translateX(-50%) scaleY(1.0) scaleX(1.04); }
  68%  { opacity: 0.78; transform: translateX(-50%) translateY(12px) scaleY(1.08) scaleX(1.12); }
  100% { opacity: 0;    transform: translateX(-50%) translateY(34px) scaleY(1.15) scaleX(1.22); }
}

.waterfall-stream {
  position: absolute;
  top: 96%;
  left: var(--sx, 50%);
  width: var(--sw, 4px);
  height: var(--sh, 64px);
  border-radius: 999px;
  pointer-events: none;
  z-index: 29;
  background: linear-gradient(180deg, transparent 0%, var(--fx-color, #fff) 45%, #ffffff 100%);
  box-shadow: 0 0 10px var(--fx-color, #fff), 0 0 4px #ffffff;
  opacity: 0;
  animation: streamFall var(--sdur, 0.72s) cubic-bezier(0.25, 0.46, 0.45, 0.94) var(--sdelay, 0s) forwards;
}

@keyframes streamFall {
  0%   { opacity: 0.95; transform: translate(-50%, 0px) scaleY(0.45); }
  45%  { opacity: 0.9;  transform: translate(-50%, 58px) scaleY(1.25); }
  100% { opacity: 0;    transform: translate(-50%, var(--sdist, 155px)) scaleY(0.7); }
}

.waterfall-mist {
  position: absolute;
  top: calc(97% + var(--wf-h, 140px) - 24px);
  left: 50%;
  width: 135%;
  height: 26px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 27;
  background: radial-gradient(ellipse at center, color-mix(in srgb, var(--fx-color, #fff) 85%, #ffffff 15%) 0%, transparent 72%);
  filter: blur(5px);
  opacity: 0;
  animation: waterfallMistBloom 0.85s ease-out 0.14s forwards;
}

@keyframes waterfallMistBloom {
  0%   { opacity: 0;   transform: translateX(-50%) scale(0.35); }
  35%  { opacity: 0.85; transform: translateX(-50%) scale(1.1); }
  100% { opacity: 0;   transform: translateX(-50%) scale(1.75); }
}

.burst-ring {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 3px solid var(--fx-color, #ffffff);
  box-shadow: 0 0 22px var(--fx-color, #ffffff), inset 0 0 12px var(--fx-color, #ffffff);
  pointer-events: none;
  z-index: 30;
  animation: burstRingExpand 0.58s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.burst-ring.is-big {
  border-width: 4px;
  animation: burstRingBig 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes burstRingExpand {
  0%   { opacity: 0.95; transform: translate(-50%, -50%) scale(0.4); }
  100% { opacity: 0;    transform: translate(-50%, -50%) scale(4.2); }
}

@keyframes burstRingBig {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.35); }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(6.4); }
}

.burst-beam {
  position: absolute;
  bottom: 65%;
  left: 50%;
  width: 14px;
  height: 150px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent 0%, var(--fx-color, #fff) 55%, #ffffff 100%);
  box-shadow: 0 0 28px var(--fx-color, #fff), 0 0 10px #ffffff;
  pointer-events: none;
  z-index: 25;
  transform-origin: bottom center;
  animation: burstBeamShoot 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes burstBeamShoot {
  0%   { opacity: 0.98; transform: translateX(-50%) scaleY(0.15) scaleX(1.6); }
  35%  { opacity: 0.92; transform: translateX(-50%) scaleY(1.15) scaleX(1.0); }
  100% { opacity: 0;    transform: translateX(-50%) scaleY(1.45) scaleX(0.2); }
}

.burst-spark {
  position: absolute;
  top: 42%;
  left: 50%;
  width: var(--sz, 7px);
  height: var(--sz, 7px);
  border-radius: 50%;
  background: radial-gradient(circle, #ffffff 15%, var(--fx-color, #fff) 70%);
  box-shadow: 0 0 12px var(--fx-color, #fff), 0 0 5px #ffffff;
  pointer-events: none;
  z-index: 32;
  animation: burstSparkFly var(--dur, 0.62s) cubic-bezier(0.12, 0.9, 0.25, 1) forwards;
}

@keyframes burstSparkFly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1.25); }
  70%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--tx)), calc(-50% + var(--ty))) scale(0.1); }
}

/* Note particle animation */
.note-particle {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1rem;
  font-weight: 800;
  text-shadow: 0 0 12px currentColor, 0 2px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  animation: noteFloat 0.78s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  z-index: 35;
}

@keyframes noteFloat {
  0%   { opacity: 1; transform: translate(-50%, 0) scale(0.95); }
  100% { opacity: 0; transform: translate(-50%, -48px) scale(1.38); }
}

/* ==========================================================================
   Wavelength Live Inspector Panel (Linked to Piano)
   ========================================================================== */
.wl-inspector {
  margin-top: 18px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
  padding: 18px 22px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  transition: border-color 0.2s ease;
}

.wl-swatch {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  box-shadow: 0 0 24px rgba(59, 92, 255, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.25);
}

.wl-info-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.wl-info-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
}

.wl-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  color: #e2e8f0;
}

.wl-badge.core {
  background: rgba(245, 158, 11, 0.22);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.wl-info-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 0.86rem;
  color: #cbd5e1;
}

.wl-info-metrics strong {
  color: #ffffff;
}

.wl-info-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ==========================================================================
   Generic Sections
   ========================================================================== */
.section {
  padding: 56px 0;
}

.section-alt {
  background: #ffffff;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.section-title {
  margin: 0 0 6px;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.section-desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

/* ==========================================================================
   Downstream Applications (Bidirectional Link with Piano)
   ========================================================================== */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(265px, 1fr));
  gap: 16px;
}

.app-card {
  background: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  cursor: pointer;
}

.app-card:hover,
.app-card.is-highlighted {
  transform: translateY(-3px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.12);
}

.app-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--bg-surface-subtle);
  display: grid;
  place-items: center;
  color: var(--accent-primary);
  flex-shrink: 0;
}

.app-card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 700;
}

.app-card p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.app-wl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
}

.wl-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg-surface-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.wl-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* ==========================================================================
   Interactive 2,154-Product Explorer + Static SEO Matrix
   ========================================================================== */
.filter-bar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px;
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr) auto;
  gap: 10px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.filter-input,
.filter-select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #ffffff;
}

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.table-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table-scroll {
  overflow-x: auto;
}

.product-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.product-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  text-align: left;
  padding: 10px 10px;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.product-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.product-table tbody tr:hover {
  background: #f8fafc;
}

.model-cell {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-primary);
  max-width: 210px;
  word-break: break-word;
}

.tag-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  background: #eff6ff;
  color: #1d4ed8;
  white-space: nowrap;
}

.tag-pill.pulsed {
  background: #fff7ed;
  color: #c2410c;
}

.tag-pill.detector {
  background: #f3e8ff;
  color: #7e22ce;
}

/* Unified Wavelength Color Theme across ALL 9 columns of each Product Table Row */
.product-table tbody tr.wl-themed-row {
  border-left: 4px solid var(--row-wl-color, #cbd5e1);
  color: var(--row-wl-text, var(--text-primary));
  transition: background-color 0.14s ease;
}

.product-table tbody tr.wl-themed-row:hover {
  background: color-mix(in srgb, var(--row-wl-color, #3b82f6) 8%, #ffffff 92%);
}

.product-table tbody tr.wl-themed-row td,
.product-table tbody tr.wl-themed-row .model-cell,
.product-table tbody tr.wl-themed-row .wl-sync-text,
.product-table tbody tr.wl-themed-row .wl-sync-muted {
  color: var(--row-wl-text, var(--text-primary));
}

.product-table tbody tr.wl-themed-row input[type="checkbox"] {
  accent-color: var(--row-wl-color, #2563eb);
}

.product-table tbody tr.wl-themed-row .tag-pill {
  color: var(--row-wl-text, #1d4ed8);
  background: color-mix(in srgb, var(--row-wl-color, #3b82f6) 11%, #ffffff 89%);
  border: 1px solid color-mix(in srgb, var(--row-wl-color, #3b82f6) 35%, transparent 65%);
}

.product-table tbody tr.wl-themed-row .btn-outline {
  color: var(--row-wl-text, var(--text-primary));
  border-color: color-mix(in srgb, var(--row-wl-color, #cbd5e1) 45%, #cbd5e1 55%);
  box-shadow: 0 2px 0 color-mix(in srgb, var(--row-wl-color, #cbd5e1) 40%, #cbd5e1 60%), inset 0 1px 0 #ffffff;
}

.product-table tbody tr.wl-themed-row .btn-outline:hover {
  background: color-mix(in srgb, var(--row-wl-color, #3b82f6) 12%, #ffffff 88%);
}

/* Wavelength cell badge matching the Spectrum Piano key color */
.wl-table-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.82rem;
  white-space: nowrap;
  color: var(--row-wl-text, #0f172a);
  background: color-mix(in srgb, var(--row-wl-color, #64748b) 11%, #ffffff 89%);
  border: 1px solid color-mix(in srgb, var(--row-wl-color, #64748b) 38%, transparent 62%);
}

.wl-table-badge.is-swir {
  background: #1e1e2e;
  color: #fbbf24;
  border: 1.5px solid #f59e0b;
}

.wl-table-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--row-wl-dot, var(--row-wl-color, #64748b));
  box-shadow: 0 0 6px var(--row-wl-dot, var(--row-wl-color, #64748b));
  flex-shrink: 0;
}

.pagination-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #f8fafc;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
}

/* Static SEO Matrix Cards (Always readable without JS, anchor-linked #wl-xxx) */
.seo-matrix-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.seo-wl-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-top: 4px solid var(--card-color, var(--accent-primary));
  border-radius: var(--radius-md);
  padding: 16px;
  scroll-margin-top: 84px;
}

.seo-wl-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.seo-wl-meta {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin: 0 0 10px;
}

.seo-wl-models {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Selection Guide, Trust & Footer
   ========================================================================== */
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

.guide-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
}

.guide-card h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
}

.guide-card p {
  margin: 0 0 12px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.trust-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
}

.trust-num {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--accent-primary);
  line-height: 1.1;
  margin-bottom: 6px;
}

.trust-label {
  font-size: 0.86rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.site-footer {
  background: var(--bg-hero);
  color: var(--text-on-dark-muted);
  padding: 44px 0 32px;
  font-size: 0.85rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.4fr;
  gap: 28px;
  margin-bottom: 28px;
}

.footer-title {
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  margin: 0 0 12px;
}

.footer-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-list a {
  color: var(--text-on-dark-muted);
}

.footer-list a:hover {
  color: #ffffff;
}

.footer-bottom {
  border-top: 1px solid var(--border-dark);
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.8rem;
}

/* ==========================================================================
   Compare Floating Bar & Modal
   ========================================================================== */
.compare-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  background: #0f172a;
  color: #ffffff;
  border: 1px solid rgba(96, 165, 250, 0.5);
  border-radius: 999px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.35);
}

.compare-bar.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 820px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.modal-close {
  border: 0;
  background: var(--bg-surface-subtle);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  font-size: 1.1rem;
  color: var(--text-primary);
}

/* ==========================================================================
   Responsive & Reduced Motion
   ========================================================================== */
@media (max-width: 1024px) {
  .filter-bar {
    grid-template-columns: 1fr 1fr 1fr;
  }
  .wl-inspector {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  /* Disable breathing animations on mobile for performance */
  .piano-key.is-core.key-905,
  .piano-key.is-core.key-1535 {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
