/* RGB Engine: a star-atlas plate printed for a dark room. The only colour
   on the page is emitted light from a real palette, and it spills: --lit is
   the live average of the scene on the chart, set from main.js. */

@font-face {
  font-family: "Archivo";
  src: url("fonts/archivo-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  /* chart ink ramp: the only tonal tokens */
  --ink-0: #050608;
  --ink-1: #0c0e13;
  --ink-2: #161a22;
  --ink-3: #272c38;
  --ink-4: #8b91a1;
  --paper: #eef0f5;
  --paper-dim: #b8bdca;
  --lit: 150 70 255;

  --hair: 1px solid var(--ink-3);
  --font: "Archivo", system-ui, sans-serif;
  --gutter: clamp(16px, 3.4vw, 48px);
  --nav-h: 56px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ink-0);
  color: var(--paper);
  font: 400 17px/1.55 var(--font);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  caret-color: var(--paper);
  scrollbar-color: var(--ink-3) var(--ink-0);
}

::selection { background: var(--paper); color: var(--ink-0); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--ink-0); }
::-webkit-scrollbar-thumb { background: var(--ink-3); }

a { color: inherit; text-underline-offset: 0.25em; text-decoration-thickness: 1px; }
:focus-visible { outline: 1px solid var(--paper); outline-offset: 3px; }

h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }

/* display voice: wide and heavy. Condensed is kept for chart lettering. */
h1, h2 { font-weight: 800; font-stretch: 118%; letter-spacing: -0.025em; line-height: 1.02; }
h3 { font-weight: 700; font-stretch: 108%; letter-spacing: -0.01em; }

.label {
  font-size: 12px; font-weight: 650; font-stretch: 75%; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-4);
}

/* --- buttons ---------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 48px; padding: 0 22px;
  border: 1px solid var(--paper); border-radius: 0;
  background: var(--paper); color: var(--ink-0);
  font: 650 15px/1 var(--font); font-stretch: 100%; letter-spacing: 0.01em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background 0.2s ease-out, color 0.2s ease-out, transform 0.1s ease-out;
}
.btn:hover { background: transparent; color: var(--paper); border-color: rgb(var(--lit)); }
.btn:active { transform: translateY(1px); }
.btn-small { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-ghost { background: transparent; color: var(--paper); border-color: var(--ink-3); }
.btn-ghost:hover { border-color: var(--paper); }
/* selection rides line density: a pressed control is hatched, never tinted */
.btn-ghost[aria-pressed="true"], .key[aria-pressed="true"] {
  color: var(--paper); border-color: rgb(var(--lit));
  background: repeating-linear-gradient(135deg, rgb(var(--lit) / 0.42) 0 1px, transparent 1px 5px);
}

/* --- nav -------------------------------------------------------------- */

.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 32px;
  height: var(--nav-h); padding: 0 var(--gutter);
  background: rgb(5 6 8 / 0.9);
  border-bottom: var(--hair);
}
.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-stretch: 118%; font-size: 17px; letter-spacing: -0.02em;
  text-decoration: none; white-space: nowrap;
}
.wordmark img { display: block; }
.nav nav { display: flex; gap: 26px; margin-left: auto; }
.nav nav a { font-size: 14px; text-decoration: none; color: var(--paper-dim); }
.nav nav a:hover { color: var(--paper); text-decoration: underline; }

/* --- the plate (first viewport) --------------------------------------- */

.plate {
  position: relative;
  display: grid;
  grid-template-columns: minmax(360px, 460px) 1fr;
  gap: 36px;
  min-height: clamp(760px, calc(100dvh - var(--nav-h)), 1000px);
  padding: 46px 46px 46px 46px;
  overflow: hidden;
}
.plate-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.plate-side { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 24px; }

.cartouche, .legend {
  position: relative;
  background: var(--ink-0);
  border: var(--hair);
  outline: 1px solid var(--ink-3); outline-offset: 4px;
}
.cartouche { padding: 28px 28px 24px; }
.cartouche h1 { font-size: clamp(2rem, 2.65vw, 2.45rem); }
.lede { margin-top: 14px; color: var(--paper-dim); max-width: 38ch; }

.chart-slot { position: relative; min-height: 560px; }
.chart-note {
  position: absolute; left: 0; right: 0; bottom: 0;
  text-align: center; font-size: 13px; color: var(--ink-4);
}

.legend { padding: 18px 20px 20px; display: grid; gap: 14px; }
.legend fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.legend legend, .waitlist label {
  padding: 0; margin-bottom: 6px;
  font-size: 12px; font-weight: 650; font-stretch: 75%; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-4);
}
.keys { display: grid; gap: 2px; }
.keys-scenes { grid-template-columns: repeat(3, 1fr); column-gap: 6px; }
.keys-palettes { grid-template-columns: repeat(3, 1fr); column-gap: 6px; }
.key {
  display: flex; align-items: center; gap: 8px;
  width: 100%; min-height: 30px; padding: 4px 7px;
  border: 1px solid transparent; background: none; color: var(--paper-dim);
  font: 450 14px/1.2 var(--font); text-align: left; cursor: pointer;
}
.key:hover { color: var(--paper); border-color: var(--ink-3); }
.lamps { display: inline-flex; gap: 3px; flex: none; }
.lamps span { width: 6px; height: 6px; border-radius: 50%; }
.legend-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.magnitude { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ink-4); }
.mag-dots { display: inline-flex; align-items: center; gap: 5px; }
.mag-dots i { display: block; border-radius: 50%; background: var(--paper); }
.mag-dots i:nth-child(1) { width: 2px; height: 2px; opacity: 0.5; }
.mag-dots i:nth-child(2) { width: 3px; height: 3px; opacity: 0.65; }
.mag-dots i:nth-child(3) { width: 4px; height: 4px; opacity: 0.8; }
.mag-dots i:nth-child(4) { width: 6px; height: 6px; opacity: 0.9; }
.mag-dots i:nth-child(5) { width: 8px; height: 8px; }
.preset { font-size: 13px; color: var(--ink-4); }
.preset b { color: var(--paper); font-weight: 600; }
.btn-beat { width: 100%; }

/* --- waitlist form ----------------------------------------------------- */

.waitlist { margin-top: 22px; display: grid; gap: 8px; }
.waitlist label { margin: 0; }
.field-row { display: flex; }
.waitlist input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px;
  border: 1px solid var(--ink-4); border-right: 0; border-radius: 0;
  background: var(--ink-1); color: var(--paper);
  font: 400 16px var(--font);
}
.waitlist input::placeholder { color: var(--ink-4); opacity: 1; }
.waitlist input:focus-visible { outline: 1px solid rgb(var(--lit)); outline-offset: 0; border-color: rgb(var(--lit)); }
.waitlist[data-state="error"] input { border-color: #ff9d8a; }
.help { font-size: 13px; color: var(--ink-4); }
.waitlist[data-state="error"] .help { color: #ffb4a6; }
.waitlist[data-state="done"] .field-row, .waitlist[data-state="done"] label { display: none; }
.waitlist[data-state="done"] .help { font-size: 16px; color: var(--paper); }

/* --- sections ---------------------------------------------------------- */

.section {
  padding: clamp(80px, 10vw, 140px) var(--gutter) 0;
  max-width: 1400px; margin: 0 auto;
}
.section-head { display: grid; gap: 16px; max-width: 820px; margin-bottom: clamp(36px, 4.5vw, 56px); }
.section h2 { font-size: clamp(2rem, 3.7vw, 3.3rem); }
.section-head p { color: var(--paper-dim); max-width: 62ch; }

/* an inset plate: the sheet's double rule and tick border, carried down the page */
.inset {
  position: relative; margin: 0;
  border: var(--hair);
  padding: clamp(22px, 3.2vw, 44px);
}
.inset::before, .inset::after {
  content: ""; position: absolute; left: 0; right: 0; height: 5px; pointer-events: none;
  background: linear-gradient(90deg, var(--ink-3) 1px, transparent 1px) 0 0 / 16px 100% repeat-x;
}
.inset::before { top: 0; }
.inset::after { bottom: 0; }

/* index of pairings */
.index-inset { padding: clamp(16px, 2.4vw, 32px); }
.index-wrap { position: relative; }
.index-canvas { display: block; width: 100%; height: 360px; }
.index-hits { position: absolute; inset: 0; }
.index-hits button {
  position: absolute; padding: 0; border: 0; background: none; cursor: pointer;
}
.index-hits button:focus-visible { outline: 1px solid var(--paper); outline-offset: -4px; }

/* receipts */
.receipts { display: grid; grid-template-columns: 1.6fr 1fr; gap: 48px; align-items: center; }
.magnitudes { width: 100%; height: auto; overflow: visible; }
.disc { fill: none; stroke: var(--ink-4); stroke-width: 1; stroke-dasharray: 2 4; }
.disc-lit { stroke: rgb(var(--lit)); stroke-dasharray: none; fill: rgb(var(--lit) / 0.22); }
.proc { fill: var(--paper); }
.mag-label { fill: var(--paper-dim); font: 650 18px var(--font); font-stretch: 75%; letter-spacing: 0.14em; }
.mag-key { display: grid; gap: 34px; }
.mag-key h3 { font-size: 22px; margin-bottom: 10px; }
.mag-key dl { margin: 0; display: grid; }
.mag-key dl div { display: flex; justify-content: space-between; gap: 24px; padding: 8px 0; border-top: var(--hair); }
.mag-key dt { color: var(--paper-dim); }
.mag-key dd { margin: 0; font-weight: 700; font-stretch: 108%; font-size: 20px; }

/* spectrum */
.spectrum svg { width: 100%; height: auto; overflow: visible; display: block; }
.spectrum-tall { display: none !important; }
.svg-defs pattern line { stroke: rgb(var(--lit)); stroke-width: 1.2; }
.ruler line { stroke: var(--ink-4); }
.ruler text, .eq text { fill: var(--paper-dim); font: 500 13px var(--font); }
.bands text { fill: var(--paper); font: 700 16px var(--font); font-stretch: 108%; }
.bands text.sub { fill: var(--paper-dim); font-weight: 450; font-size: 14px; font-stretch: 100%; }
.band { stroke: rgb(var(--lit)); stroke-width: 1; }
.band-bass { fill: url(#hatch-1); }
.band-mid { fill: url(#hatch-2); }
.band-high { fill: url(#hatch-3); }
.eq rect { fill: none; stroke: var(--ink-4); }

/* setup: the wizard, charted */
.setup { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.setup-canvas { display: block; width: 100%; aspect-ratio: 1 / 0.92; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 30px; }
.steps li { padding-left: 22px; border-left: 1px solid var(--ink-3); transition: border-color 0.3s ease-out; }
.steps li h3 { font-size: 22px; margin-bottom: 8px; color: var(--paper-dim); transition: color 0.3s ease-out; }
.steps li p { color: var(--ink-4); max-width: 40ch; transition: color 0.3s ease-out; }
.steps li.is-on { border-color: rgb(var(--lit)); }
.steps li.is-on h3 { color: var(--paper); }
.steps li.is-on p { color: var(--paper-dim); }

/* close */
/* full bleed so the glow has no hard edge; content keeps the section's measure */
.close { position: relative; padding-bottom: clamp(90px, 11vw, 150px); isolation: isolate; max-width: none; padding-inline: max(var(--gutter), calc((100% - 1400px) / 2 + var(--gutter))); overflow: clip; }
.close::before {
  content: ""; position: absolute; z-index: -1; pointer-events: none;
  inset: 0;
  background: radial-gradient(60% 55% at 22% 55%, rgb(var(--lit) / 0.22), transparent 70%);
}
.close h2 { font-size: clamp(2.8rem, 6.4vw, 5.6rem); }
.close > p { margin-top: 14px; color: var(--paper-dim); }
.close .waitlist { max-width: 520px; margin-top: 30px; }

.footer {
  display: flex; flex-wrap: wrap; gap: 12px 32px; align-items: baseline;
  padding: 26px var(--gutter); border-top: var(--hair);
  font-size: 14px; color: var(--ink-4);
}
.footer .wordmark { color: var(--paper); margin-right: auto; }

/* --- responsive -------------------------------------------------------- */

@media (max-width: 1100px) {
  .plate { grid-template-columns: minmax(330px, 400px) 1fr; padding: 40px 36px; }
  .keys-palettes { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
  body { font-size: 16px; }
  .nav nav { display: none; }
  .nav { justify-content: space-between; }
  .plate { grid-template-columns: 1fr; gap: 24px; padding: 28px 24px 32px; min-height: 0; }
  .plate-side { display: contents; }
  .cartouche { order: 1; padding: 22px 20px; }
  .chart-slot { order: 2; min-height: 0; aspect-ratio: 1 / 1.22; }
  .legend { order: 3; }
  .keys-palettes { grid-template-columns: repeat(2, 1fr); }
  .field-row { flex-direction: column; gap: 8px; }
  .waitlist input { flex: none; border-right: 1px solid var(--ink-4); }
  .receipts { grid-template-columns: 1fr; gap: 28px; }
  .spectrum-wide { display: none !important; }
  .spectrum-tall { display: block !important; max-width: 340px; margin: 0 auto; }
  .setup { grid-template-columns: 1fr; }
}
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* --- build your own: real app screenshots ------------------------------- */

/* one screenshot per row, big enough to read */
.shots { display: grid; grid-template-columns: 1fr; gap: clamp(12px, 1.6vw, 20px); padding: clamp(12px, 1.6vw, 20px); }
.shots img { display: block; width: 100%; max-width: 1280px; height: auto; margin-inline: auto; }

/* --- questions ------------------------------------------------------------ */

.faq { max-width: 820px; border-top: var(--hair); }
.faq details { border-bottom: var(--hair); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 0; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
/* a drawn plus that folds to a minus */
.faq summary::after {
  content: ""; flex: none; width: 14px; height: 14px;
  background: linear-gradient(var(--paper-dim) 0 0) center / 14px 1.5px no-repeat, linear-gradient(var(--paper-dim) 0 0) center / 1.5px 14px no-repeat;
  transition: background-size 0.2s ease-out;
}
.faq details[open] summary::after { background-size: 14px 1.5px, 1.5px 0; }
.beat-icon { display: block; }
.faq summary h3 { font-size: 18px; font-weight: 650; }
.faq summary:hover h3 { text-decoration: underline; text-underline-offset: 0.2em; }
.faq details p { padding: 0 0 22px; color: var(--paper-dim); max-width: 68ch; }

/* a field people never see: bots fill it in */
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.waitlist { position: relative; }
.waitlist[data-state="sending"] .btn { opacity: 0.6; cursor: progress; }

/* 404 */
.lost { min-height: 70vh; display: grid; align-content: center; justify-items: start; gap: 20px; }
.lost p { color: var(--paper-dim); max-width: 46ch; }
