/* Layout concept: a signal chain. Sound enters top-left (the hero's live spectrum), flows through a pinned
   routing diagram and an equalizer, and exits at the download. Dark studio ground, one spectrum gradient. */
:root {
  color-scheme: dark;
  --ink: #070b14;          /* page ground, blue-biased near-black */
  --panel: #0d1322;        /* raised surfaces */
  --panel-2: #131b2e;
  --line: #1f2a40;         /* 1px strokes */
  --fg: #eef2f8;
  --muted: #9aa7bd;
  --dim: #66738b;
  --s1: #3d6bff;           /* spectrum: low → high frequencies */
  --s2: #22d3ee;
  --s3: #5eead4;
  --s4: #fbbf24;
  --spectrum: linear-gradient(90deg, var(--s1), var(--s2) 45%, var(--s3) 72%, var(--s4));
  --focus: #5eead4;

  --display: "Bricolage Grotesque", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;

  --r: 14px;
  --gutter: max(20px, env(safe-area-inset-left, 0px));
  --gutter-r: max(20px, env(safe-area-inset-right, 0px));
}

@font-face { font-family: "Bricolage Grotesque"; src: url("fonts/BricolageGrotesque-400-800.woff2") format("woff2"); font-weight: 400 800; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-400-700.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("fonts/JetBrainsMono-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--ink);
  color: var(--fg);
  font: 400 17px/1.62 var(--body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--s3); text-underline-offset: 3px; }
a:hover { color: var(--fg); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
code { font: 500 0.86em/1.4 var(--mono); background: var(--panel-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; overflow-wrap: anywhere; }
h1, h2, h3 { font-family: var(--display); text-wrap: balance; margin: 0; }
h2 { font-size: clamp(30px, 4.2vw, 48px); line-height: 1.06; font-weight: 700; letter-spacing: -0.02em; }
h3 { font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -0.005em; }
p { margin: 0; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter-r); }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; z-index: 50; background: var(--panel); padding: 8px 12px; border-radius: 8px; }
.eyebrow { font: 600 12px/1 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--s3); margin-bottom: 14px; }
.section-head { display: grid; gap: 4px; max-width: 760px; margin-bottom: 40px; }
.section-lead { color: var(--muted); font-size: 18px; max-width: 60ch; margin-top: 10px; }
section { position: relative; padding-block: clamp(72px, 10vw, 128px); }

/* Level meter: page scroll progress, drawn as a signal bar */
.meter { position: fixed; inset: 0 0 auto; height: 3px; z-index: 40; pointer-events: none; }
.meter span { display: block; height: 100%; width: 100%; background: var(--spectrum); transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); }

/* ---------- Header ---------- */
header.site {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
  background: color-mix(in srgb, var(--ink) 72%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.bar { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font: 700 19px/1 var(--display); letter-spacing: -0.01em; }
nav.top { display: flex; gap: 26px; margin-left: auto; font-size: 15px; }
nav.top a { color: var(--muted); text-decoration: none; }
nav.top a:hover { color: var(--fg); }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--panel-2);
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 24px; border-radius: 999px;
  font: 650 16px/1 var(--body); color: var(--fg); text-decoration: none;
  background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--spectrum) border-box;
  border: 1.5px solid transparent;
  transition: transform .2s ease, box-shadow .3s ease;
}
.btn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn:hover { color: var(--fg); transform: translateY(-1px); box-shadow: 0 10px 40px -12px color-mix(in srgb, var(--s2) 70%, transparent); }
.btn-primary { --bg: #0b1628; }
.btn-primary::after {
  content: ""; position: absolute; inset: -1.5px; border-radius: inherit; z-index: -1;
  background: var(--spectrum); filter: blur(18px); opacity: .35; transition: opacity .3s ease;
}
.btn-primary:hover::after { opacity: .6; }
.btn-small { padding: 9px 16px; font-size: 14px; }

/* ---------- Hero ---------- */
.hero { padding-block: clamp(56px, 8vw, 104px) 56px; overflow: hidden; }
.hero::before { /* ambient glow, low-frequency blue to high-frequency amber */
  content: ""; position: absolute; inset: -20% -10% auto; height: 120%; z-index: 0; pointer-events: none;
  background:
    radial-gradient(40% 50% at 18% 30%, color-mix(in srgb, var(--s1) 32%, transparent), transparent 70%),
    radial-gradient(35% 45% at 78% 20%, color-mix(in srgb, var(--s2) 22%, transparent), transparent 70%),
    radial-gradient(30% 40% at 90% 85%, color-mix(in srgb, var(--s4) 14%, transparent), transparent 70%);
}
.spectrum { position: absolute; inset: auto 0 0; width: 100%; height: 46%; z-index: 0; opacity: .42; pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 10%, transparent 95%); mask-image: linear-gradient(to top, #000 10%, transparent 95%); }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: clamp(32px, 5vw, 64px); align-items: center; }
.hero-copy { min-width: 0; }
h1 { font-size: clamp(42px, 6.4vw, 80px); line-height: 1; font-weight: 800; letter-spacing: -0.028em; font-variation-settings: "opsz" 96; }
h1 .hl { background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: .06em; }
.lead { color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); margin: 24px 0 32px; max-width: 54ch; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.meta { color: var(--dim); font: 500 13px/1.4 var(--mono); }
.meta a { color: var(--muted); }

.hero-shot { margin: 0; border-radius: var(--r); padding: 1px; background: linear-gradient(140deg, color-mix(in srgb, var(--s2) 60%, transparent), var(--line) 40%, color-mix(in srgb, var(--s4) 40%, transparent));
  box-shadow: 0 40px 120px -40px color-mix(in srgb, var(--s1) 60%, transparent), 0 0 0 1px var(--line); }
.hero-shot img { border-radius: calc(var(--r) - 1px); }

.tilt { transform: perspective(1400px) rotateX(calc(var(--tilt, 0) * 14deg)) translateY(calc(var(--tilt, 0) * 24px)) scale(calc(1 - var(--tilt, 0) * 0.04)); transform-origin: 50% 100%; will-change: transform; }

.specs { position: relative; z-index: 1; list-style: none; margin: 72px 0 0; padding: 0 22px 18px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line); border-radius: 18px;
  background: color-mix(in srgb, var(--ink) 78%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.specs li { padding: 22px 20px 4px 0; display: grid; gap: 6px; min-width: 0; }
.specs li + li { padding-left: 20px; border-left: 1px solid var(--line); }
.specs b { font: 700 clamp(30px, 3.4vw, 40px)/1 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.specs small { font: 600 .42em/1 var(--mono); color: var(--s3); margin-left: 4px; letter-spacing: 0; }
.specs span { color: var(--muted); font-size: 14px; }

/* ---------- Routing (pinned diagram) ---------- */
.flow::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(50% 40% at 10% 40%, color-mix(in srgb, var(--s1) 10%, transparent), transparent 70%); }
.flow-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.flow-stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 120px); min-width: 0; }
.flow-diagram { width: 100%; height: auto; display: block; border-radius: 20px; background: linear-gradient(180deg, var(--panel), var(--ink)); border: 1px solid var(--line); padding: 12px; overflow: visible; }
.wires path { fill: none; stroke: var(--line); stroke-width: 2; transition: stroke .5s ease, opacity .5s ease, stroke-width .5s ease; }
.wires path.on { stroke: url(#sig); stroke-width: 3.2; stroke-dasharray: 10 10; animation: flow 1.1s linear infinite; }
@keyframes flow { to { stroke-dashoffset: -20; } }
.node rect { fill: var(--panel-2); stroke: var(--line); stroke-width: 1.5; transition: stroke .4s ease, fill .4s ease; }
.node text, .hub-tag { fill: var(--muted); font: 600 14px var(--body); text-anchor: middle; transition: fill .4s ease; }
.node.on rect { stroke: var(--s2); fill: #0f2033; }
.node.on text { fill: var(--fg); }
.hub circle { fill: #0b1628; stroke: url(#sig); stroke-width: 2.5; }
.hub rect { fill: var(--fg); }
.hub-tag { fill: var(--s4); font: 600 13px var(--mono); opacity: 0; transition: opacity .4s ease; }
.flow[data-step="4"] .hub-tag { opacity: 1; }

.flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; min-width: 0; }
.flow-steps li { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-block: 24px; transition: opacity .45s ease; }
.js .flow-steps li:not(.active) { opacity: .38; }
.flow-steps li:first-child { min-height: 52vh; justify-content: flex-start; padding-top: 8px; }
.flow-steps h3 { font-size: clamp(24px, 2.6vw, 32px); }
.flow-steps p { color: var(--muted); max-width: 52ch; }
.mini { margin: 6px 0 0; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); max-width: 520px; }

/* ---------- Enhance (equalizer) ---------- */
.eq-section { background: linear-gradient(180deg, transparent, color-mix(in srgb, var(--panel) 70%, transparent) 20%, transparent); }
.eq-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.eq-stage { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 120px); min-width: 0; }
.eq { border-radius: 20px; border: 1px solid var(--line); background: linear-gradient(180deg, var(--panel), var(--ink)); padding: 28px 24px 20px 56px; position: relative; }
.eq-scale { position: absolute; left: 14px; top: 28px; bottom: 76px; display: flex; flex-direction: column; justify-content: space-between; font: 500 11px var(--mono); color: var(--dim); }
.eq-bands { --h: 260px; height: var(--h); display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: clamp(6px, 1.4vw, 16px); position: relative; margin-bottom: 30px; }
.eq-bands::before { /* the 0 dB line */ content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed color-mix(in srgb, var(--muted) 35%, transparent); }
.band { position: relative; display: flex; justify-content: center; }
.band::before { /* fader track */ content: ""; position: absolute; top: 0; bottom: 0; width: 4px; border-radius: 4px; background: var(--line); }
.band i { /* the level bar from 0 dB to the band's gain */
  position: absolute; width: 4px; border-radius: 4px; left: 50%; translate: -50% 0;
  top: calc(50% - max(var(--g), 0) / 12 * 50%);
  height: calc(max(var(--g), -1 * var(--g)) / 12 * 50%);
  background: linear-gradient(180deg, var(--s4), var(--s2));
  transition: top .7s cubic-bezier(.2,.8,.2,1), height .7s cubic-bezier(.2,.8,.2,1);
}
.band::after { /* fader knob, sitting at the band's gain on a ±12 dB scale */
  content: ""; position: absolute; left: 50%; translate: -50% -50%; width: 22px; height: 22px; border-radius: 50%;
  top: calc(50% - var(--g) / 12 * 50%); background: var(--fg);
  box-shadow: 0 0 0 4px #0b1628, 0 0 18px color-mix(in srgb, var(--s2) 60%, transparent);
  transition: top .7s cubic-bezier(.2,.8,.2,1);
}
.band em { position: absolute; bottom: -28px; font: 500 11px var(--mono); color: var(--dim); font-style: normal; }
.eq-readout { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 14px; font: 600 13px var(--mono); }
.eq-name { color: var(--s3); }
.eq-vol { color: var(--muted); font-variant-numeric: tabular-nums; }

.presets { list-style: none; margin: 0; padding: 0; min-width: 0; }
.presets li { min-height: 56vh; display: flex; flex-direction: column; justify-content: center; gap: 10px; transition: opacity .45s ease; }
.presets li:first-child { min-height: 40vh; justify-content: flex-start; padding-top: 8px; }
.js .presets li:not(.active) { opacity: .38; }
.presets h3 { font-size: clamp(24px, 2.6vw, 32px); }
.presets p { color: var(--muted); max-width: 46ch; }
.how { margin-top: 56px; padding: 28px 32px; border-radius: 20px; border: 1px solid var(--line); background: var(--panel); max-width: 900px; display: grid; gap: 10px; }
.how p { color: var(--muted); }

/* ---------- Tray ---------- */
.tray-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.tray h2 { margin-bottom: 4px; }
.flyout { margin: 0; justify-self: center; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); width: min(100%, 425px);
  box-shadow: 0 40px 100px -40px color-mix(in srgb, var(--s2) 50%, transparent); }
.keys { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; gap: 10px 26px; color: var(--muted); font-size: 15px; }
.keys li { display: flex; align-items: center; gap: 4px; }
.keys span { margin-left: 8px; }
kbd { font: 600 12px/1 var(--mono); color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 5px 7px; }

/* ---------- Install ---------- */
.steps { list-style: none; counter-reset: s; margin: 0 0 32px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.steps li { counter-increment: s; position: relative; padding: 56px 20px 22px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 8px; align-content: start; min-width: 0; }
.steps li::before { content: counter(s, decimal-leading-zero); position: absolute; top: 18px; left: 20px; font: 600 13px var(--mono); background: var(--spectrum); -webkit-background-clip: text; background-clip: text; color: transparent; letter-spacing: .08em; }
.steps h3 { font-size: 18px; }
.steps p { color: var(--muted); font-size: 15px; }
.install-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
.panel { border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); padding: 22px 22px 24px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.panel h3 { font-size: 17px; }
.panel p { color: var(--muted); font-size: 15px; }
.hash-row { display: flex; gap: 8px; align-items: stretch; min-width: 0; }
.hash { flex: 1; min-width: 0; padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.copy { font: 600 13px var(--body); color: var(--fg); background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 14px; cursor: pointer; }
.copy:hover { border-color: var(--s2); }
.req { margin: 0; display: grid; gap: 10px; }
.req div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; font-size: 15px; }
.req dt { color: var(--dim); }
.req dd { margin: 0; color: var(--muted); }

/* ---------- Limits, privacy, FAQ ---------- */
.limits-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: start; }
.limits h2 { margin-bottom: 24px; }
ul.plain { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
ul.plain li { color: var(--muted); padding-left: 22px; position: relative; }
ul.plain li::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 2px; background: var(--spectrum); }
ul.plain b { color: var(--fg); font-weight: 600; }
.privacy { position: sticky; top: 110px; padding: 26px; }
.privacy h2 { font-size: 26px; margin: 0; }
.faq-list { display: grid; gap: 10px; max-width: 860px; }
details { border-radius: var(--r); background: var(--panel); border: 1px solid var(--line); padding: 4px 22px; transition: border-color .3s ease; }
details[open] { border-color: color-mix(in srgb, var(--s2) 45%, var(--line)); }
summary { cursor: pointer; list-style: none; padding: 16px 0; font: 600 17px var(--body); display: flex; justify-content: space-between; gap: 16px; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; font: 400 22px/1 var(--mono); color: var(--s3); transition: rotate .3s ease; }
details[open] summary::after { rotate: 45deg; }
details p { color: var(--muted); padding-bottom: 18px; max-width: 70ch; }

/* ---------- Final call ---------- */
.final { text-align: center; overflow: hidden; }
.final::before { content: ""; position: absolute; inset: 10% -20% -30%; pointer-events: none;
  background: radial-gradient(45% 55% at 50% 70%, color-mix(in srgb, var(--s1) 34%, transparent), transparent 70%),
              radial-gradient(30% 40% at 30% 80%, color-mix(in srgb, var(--s3) 18%, transparent), transparent 70%),
              radial-gradient(30% 40% at 72% 80%, color-mix(in srgb, var(--s4) 14%, transparent), transparent 70%); }
.final-inner { position: relative; display: grid; justify-items: center; gap: 26px; }
.final h2 { font-size: clamp(34px, 5.4vw, 64px); max-width: 16ch; }

footer.site { border-top: 1px solid var(--line); padding-block: 28px max(40px, env(safe-area-inset-bottom, 0px)); color: var(--dim); font-size: 13px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 32px; }
.foot a { color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .install-grid { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  nav.top { display: none; }
  .bar { justify-content: space-between; }
  .hero-grid, .flow-grid, .eq-grid, .tray-grid, .limits-grid { grid-template-columns: minmax(0, 1fr); }
  .specs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .specs li:nth-child(3) { padding-left: 0; border-left: 0; }
  .specs li:nth-child(n+3) { border-top: 1px solid var(--line); }
  /* Keep the diagram and EQ in view while their steps scroll beneath them. */
  .flow-stage, .eq-stage { top: calc(env(safe-area-inset-top, 0px) + 64px); z-index: 2; padding-block: 10px 14px; background: linear-gradient(var(--ink) 88%, transparent); }
  .flow-diagram, .eq { box-shadow: 0 18px 40px -18px #000; }
  .flow-steps li, .presets li { min-height: 46vh; }
  .flow-steps .mini { display: none; } /* the pinned diagram carries this on phones */
  .flow-steps li:first-child, .presets li:first-child { min-height: 0; padding-top: 28px; }
  .eq-bands { --h: 170px; }
  .eq { padding: 20px 14px 14px 44px; }
  .eq-scale { left: 8px; top: 20px; bottom: 66px; }
  .band::after { width: 16px; height: 16px; }
  .privacy { position: static; }
}
@media (max-width: 520px) {
  .steps { grid-template-columns: minmax(0, 1fr); }
  .specs { grid-template-columns: minmax(0, 1fr); }
  .specs li, .specs li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .specs li:first-child { border-top: 0; }
  .hash-row { flex-direction: column; }
  .copy { padding: 10px 14px; }
  .req div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
}

/* Motion is decoration here; with reduced motion everything sits at its resting state. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .tilt { transform: none !important; }
  .js .flow-steps li:not(.active), .js .presets li:not(.active) { opacity: 1; }
  .spectrum { display: none; }
}
