/* ============================================================================
   ORRERY — instruments for the invisible
   ----------------------------------------------------------------------------
   No inline styles anywhere: the origin serves style-src 'self' with no
   'unsafe-inline'. Everything dynamic goes through CSSOM, which CSP permits.

   Motion contract
   ---------------
   Three speeds and two curves, used everywhere, so the whole page feels like
   one mechanism rather than a pile of effects:
     --t-fast  120ms   state you caused (hover, press)
     --t-mid   420ms   state that follows you (chrome, chips)
     --t-slow  900ms   state that arrives (reveals, chapter changes)
     --ease       overshoot-free deceleration, for anything entering
     --ease-soft  symmetric, for anything looping or reversing
   ========================================================================= */

/* ------------------------------------------------------------------ fonts */
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-latin.woff2") format("woff2");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Instrument Serif";
  src: url("/assets/fonts/instrument-serif-italic-latin.woff2") format("woff2");
  font-weight: 400; font-style: italic; font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("/assets/fonts/inter-var-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/assets/fonts/jetbrains-mono-var-latin.woff2") format("woff2");
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* ----------------------------------------------------------------- tokens */
:root {
  --ink:        #05060a;
  --ink-raised: #0b0e18;
  --line:       rgba(242, 237, 228, 0.14);
  --line-soft:  rgba(242, 237, 228, 0.07);

  --paper:    #f2ede4;
  --paper-70: rgba(242, 237, 228, 0.74);
  --paper-45: rgba(242, 237, 228, 0.58);
  --paper-28: rgba(242, 237, 228, 0.42);

  --accent: #4ce3ff;

  --display: "Instrument Serif", "Iowan Old Style", Palatino, Georgia, serif;
  --sans:    "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:    "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --gut: clamp(1.25rem, 4.6vw, 6rem);
  --measure: 46ch;

  --t-fast: 120ms;
  --t-mid:  420ms;
  --t-slow: 900ms;
  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.65, 0, 0.35, 1);

  --sk: 0deg;   /* scroll-velocity shear, written per frame by JS */

  --z-field: 0;
  --z-page: 10;
  --z-chrome: 40;
  --z-cursor: 90;
  --z-boot: 100;
}

/* ------------------------------------------------------------------ reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }

html, body { margin: 0; padding: 0; background: var(--ink); color: var(--paper); }

body {
  font-family: var(--sans);
  font-size: clamp(1rem, 0.94rem + 0.28vw, 1.09rem);
  line-height: 1.64;
  font-weight: 370;
  letter-spacing: -0.004em;
  overflow-x: hidden;
  min-height: 100%;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
body.is-booting { overflow: hidden; }

img, svg, canvas { display: block; max-width: 100%; }
h1, h2, h3, p, dl, dd, dt, figure, figcaption { margin: 0; }
dl { padding: 0; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
b, strong { font-weight: 560; }

::selection { background: var(--accent); color: var(--ink); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

.skip {
  position: fixed; top: 0; left: 50%;
  transform: translate(-50%, -140%);
  z-index: 200;
  padding: 0.7rem 1.2rem;
  background: var(--paper); color: var(--ink);
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.08em; text-transform: uppercase;
  transition: transform var(--t-mid) var(--ease);
}
.skip:focus { transform: translate(-50%, 0); }

/* ═══════════════════════════════════════════════════════ RENDER LAYERS ══ */
.field {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  z-index: var(--z-field);
  opacity: 0;
  transform: scale(1.06);
  transition: opacity 1.8s var(--ease-soft), transform 2.6s var(--ease);
}
body.field-live .field { opacity: 1; transform: none; }

.fallback-sky {
  position: fixed; inset: 0;
  z-index: var(--z-field);
  opacity: 0;
  transition: opacity 1.2s var(--ease-soft);
  background:
    radial-gradient(64rem 42rem at 22% 12%, rgba(76,227,255,0.20), transparent 62%),
    radial-gradient(52rem 40rem at 80% 30%, rgba(157,123,255,0.20), transparent 60%),
    radial-gradient(60rem 46rem at 55% 96%, rgba(255,77,141,0.16), transparent 64%),
    var(--ink);
}
body.no-webgl .fallback-sky { opacity: 1; }
body.no-webgl .field { display: none; }

.grain {
  position: fixed; inset: -50%;
  z-index: 4; pointer-events: none;
  opacity: 0.19; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='180' height='180' filter='url(%23n)' opacity='0.55'/></svg>");
  animation: grain-shift 7s steps(6) infinite;
}
@keyframes grain-shift {
  0%   { transform: translate(0, 0); }
  16%  { transform: translate(-3%, 2%); }
  33%  { transform: translate(2%, -4%); }
  50%  { transform: translate(-2%, -2%); }
  66%  { transform: translate(3%, 3%); }
  83%  { transform: translate(-4%, 1%); }
  100% { transform: translate(0, 0); }
}

.vignette {
  position: fixed; inset: 0; z-index: 5; pointer-events: none;
  background:
    radial-gradient(132% 96% at 50% 42%, transparent 40%, rgba(5,6,10,0.55) 78%, rgba(5,6,10,0.92) 100%),
    linear-gradient(to bottom, rgba(5,6,10,0.62), transparent 20%, transparent 72%, rgba(5,6,10,0.8));
}

/* A single lit filament crosses the frame when the instrument changes. It is
   the only cut in the whole page, so it gets to be obvious. */
.sweep { position: fixed; inset: 0; z-index: 6; pointer-events: none; overflow: hidden; }
.sweep::before {
  content: ""; position: absolute; left: -10%; right: -10%; top: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent) 25%, #fff 50%, var(--accent) 75%, transparent);
  box-shadow: 0 0 22px 2px var(--accent);
  opacity: 0; transform: translateY(-6vh);
}
.sweep.is-on::before { animation: sweep-run 1.15s var(--ease-soft); }
@keyframes sweep-run {
  0%   { opacity: 0; transform: translateY(-6vh) scaleX(0.4); }
  12%  { opacity: 0.9; }
  55%  { opacity: 0.55; transform: translateY(52vh) scaleX(1); }
  100% { opacity: 0; transform: translateY(108vh) scaleX(0.6); }
}

/* --------------------------------------------------------------- cursor */
.cursor {
  position: fixed; top: 0; left: 0; z-index: var(--z-cursor);
  pointer-events: none;
  width: 38px; height: 38px; margin: -19px 0 0 -19px;
  opacity: 0; transition: opacity var(--t-mid) var(--ease);
  will-change: transform;
}
body.cursor-live .cursor { opacity: 1; }
.cursor span {
  display: block; width: 100%; height: 100%;
  border: 1px solid var(--paper-45); border-radius: 50%;
  transition: transform var(--t-mid) var(--ease),
              border-color var(--t-mid) var(--ease),
              background-color var(--t-mid) var(--ease);
}
.cursor::after {
  content: ""; position: absolute; inset: 50% auto auto 50%;
  width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px;
  border-radius: 50%; background: var(--paper);
  transition: opacity var(--t-mid) var(--ease);
}
body.cursor-hot .cursor span {
  transform: scale(2);
  border-color: var(--accent);
  background: rgba(76, 227, 255, 0.09);
}
body.cursor-hot .cursor::after { opacity: 0; }
body.cursor-drag .cursor span { transform: scale(0.55); background: var(--accent); border-color: var(--accent); }

/* ═════════════════════════════════════════════════════════════════ BOOT ══ */
.boot {
  position: fixed; inset: 0; z-index: var(--z-boot);
  display: grid; place-items: center;
  background: var(--ink);
  transition: opacity 1s var(--ease-soft), visibility 1s;
}
body.booted .boot { opacity: 0; visibility: hidden; pointer-events: none; }

.boot__inner { display: grid; justify-items: center; gap: 1.7rem; width: min(78vw, 22rem); }

.boot__rings { width: 88px; height: 88px; overflow: visible; }
.boot__rings circle { fill: none; stroke: var(--line); stroke-width: 1; transform-origin: 50% 50%; }
.boot__rings circle:nth-child(1) { stroke: #4ce3ff; stroke-dasharray: 46 300; animation: spin 9s linear infinite; }
.boot__rings circle:nth-child(2) { stroke: #9d7bff; stroke-dasharray: 30 200; animation: spin 6s linear infinite reverse; }
.boot__rings circle:nth-child(3) { stroke: #ff4d8d; stroke-dasharray: 16 120; animation: spin 3.6s linear infinite; }
.boot__core { fill: var(--paper); stroke: none; animation: pulse 1.9s var(--ease-soft) infinite; }
@keyframes spin  { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { opacity: 0.3; } 50% { opacity: 1; } }

.boot__label {
  font: 400 0.72rem/1 var(--mono);
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--paper-45);
}
.boot__bar { width: 100%; height: 1px; background: var(--line); overflow: hidden; }
.boot__bar span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, #4ce3ff, #9d7bff, #ff4d8d);
  transition: width var(--t-mid) var(--ease);
}
.boot__pct { font: 400 0.72rem/1 var(--mono); letter-spacing: 0.2em; color: var(--paper-45); }
.boot__pct i { font-style: normal; opacity: 0.5; }

/* ═══════════════════════════════════════════════════════════════ CHROME ══ */
.topbar {
  position: fixed; inset: 0 0 auto 0; z-index: var(--z-chrome);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: clamp(1rem, 2.2vw, 1.9rem) var(--gut);
  opacity: 0; transform: translateY(-14px);
  transition: transform var(--t-slow) var(--ease), opacity var(--t-slow) var(--ease);
}
body.booted .topbar { opacity: 1; transform: none; transition-delay: 0.55s; }
body.booted.chrome-hidden .topbar { opacity: 0; transform: translateY(-110%); transition-delay: 0s; }

.topbar::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, rgba(5,6,10,0.72), transparent);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent);
          mask-image: linear-gradient(to bottom, #000 40%, transparent);
}

.mark { display: inline-flex; align-items: center; gap: 0.62rem; }
.mark__glyph { width: 22px; height: 22px; overflow: visible; }
.mark__glyph circle, .mark__glyph ellipse {
  fill: none; stroke: var(--paper-70); stroke-width: 1.1; transform-origin: 50% 50%;
}
.mark__glyph ellipse { animation: mark-tilt 16s var(--ease-soft) infinite; }
.mark__core { fill: var(--accent) !important; stroke: none !important; }
@keyframes mark-tilt {
  0%, 100% { transform: rotate(0deg) scaleY(1); }
  50%      { transform: rotate(180deg) scaleY(0.34); }
}
.mark__word { font: 400 1.2rem/1 var(--display); letter-spacing: 0.02em; }

.nav { display: flex; gap: clamp(0.9rem, 2vw, 2rem); }
.nav a {
  position: relative;
  display: inline-flex; align-items: baseline; gap: 0.4rem;
  font: 420 0.72rem/1 var(--mono);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-45); padding: 0.35rem 0;
  transition: color var(--t-mid) var(--ease);
}
.nav a b { font-weight: 400; opacity: 0.45; font-size: 0.66rem; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--accent); transition: right var(--t-slow) var(--ease);
}
.nav a:hover, .nav a.is-current { color: var(--paper); }
.nav a:hover b, .nav a.is-current b { opacity: 1; color: var(--accent); }
.nav a:hover::after, .nav a.is-current::after { right: 0; }

.sound {
  display: inline-flex; align-items: center; gap: 0.55rem;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 0.42rem 0.9rem; cursor: pointer;
  font: 420 0.68rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--paper-45);
  transition: color var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease);
}
.sound:hover { color: var(--paper); border-color: var(--paper-28); }
.sound__bars { display: flex; align-items: flex-end; gap: 2px; height: 11px; }
.sound__bars i { display: block; width: 2px; height: 3px; background: currentColor; transition: height var(--t-mid) var(--ease); }
.sound[aria-pressed="true"] { color: var(--accent); border-color: rgba(76,227,255,0.4); }
.sound[aria-pressed="true"] .sound__bars i { animation: eq 1.1s var(--ease-soft) infinite; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(2) { animation-delay: 0.18s; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(3) { animation-delay: 0.36s; }
.sound[aria-pressed="true"] .sound__bars i:nth-child(4) { animation-delay: 0.54s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 11px; } }

/* ------------------------------------------------------------- side rail */
.rail {
  position: fixed; right: clamp(0.9rem, 2vw, 1.9rem); top: 50%;
  transform: translateY(-50%); z-index: var(--z-chrome);
  display: grid; justify-items: center; gap: 0.85rem;
  font: 400 0.66rem/1 var(--mono); letter-spacing: 0.18em; color: var(--paper-28);
  opacity: 0; transition: opacity var(--t-slow) var(--ease);
}
body.booted .rail { opacity: 1; transition-delay: 0.75s; }
.rail__now { color: var(--paper); font-variant-numeric: tabular-nums; }
.rail__track { position: relative; display: block; width: 1px; height: clamp(6rem, 16vh, 11rem); background: var(--line); }
.rail__track i {
  position: absolute; inset: 0 0 auto 0; display: block; height: 0%;
  background: linear-gradient(to bottom, var(--accent), #ff4d8d);
  transition: height 90ms linear;
}

/* ---------------------------------------------------- fixed museum plate */
.plate {
  position: fixed; left: var(--gut); bottom: clamp(0.9rem, 2.4vw, 1.9rem);
  z-index: var(--z-chrome);
  display: grid; grid-template-columns: auto auto; gap: 0.15rem 0.7rem;
  align-items: baseline;
  font-family: var(--mono);
  opacity: 0; transition: opacity var(--t-slow) var(--ease);
}
body.booted .plate { opacity: 1; transition-delay: 0.9s; }
body.at-end .plate, body.at-end .rail { opacity: 0; transition-delay: 0s; }
.plate__no {
  grid-row: 1 / span 2;
  font: 400 1.5rem/1 var(--display);
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.plate__name, .plate__meta { display: block; overflow: hidden; }
.plate__name { font-size: 0.74rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper); }
.plate__meta { font-size: 0.64rem; letter-spacing: 0.14em; color: var(--paper-28); }
.plate.is-turning .plate__no   { animation: plate-in var(--t-slow) var(--ease); }
.plate.is-turning .plate__name { animation: plate-in var(--t-slow) var(--ease) 40ms both; }
.plate.is-turning .plate__meta { animation: plate-in var(--t-slow) var(--ease) 90ms both; }
@keyframes plate-in {
  0%   { opacity: 0; transform: translateY(0.85em); }
  100% { opacity: 1; transform: none; }
}

/* ═══════════════════════════════════════════════════════════════ LAYOUT ══ */
/* #scroll is created by JS for inertial scrolling. Without JS everything below
   simply flows normally, which is why nothing here depends on it existing. */
#scroll { position: relative; z-index: var(--z-page); will-change: transform; }
body.lerp-scroll #scroll { position: fixed; top: 0; left: 0; width: 100%; }
#scroll-spacer { width: 1px; pointer-events: none; }

main { position: relative; }

.scene {
  position: relative;
  min-height: 100svh;
  padding: clamp(6rem, 14vh, 10rem) var(--gut) clamp(5rem, 12vh, 8rem);
  display: grid;
  align-content: center;
  transform: skewY(var(--sk));   /* scroll shear; JS writes --sk per frame */
}
.scene__in { position: relative; }

.eyebrow {
  display: flex; align-items: center; gap: 0.85rem;
  font: 420 0.7rem/1 var(--mono);
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--paper-45);
  margin-bottom: 1.7rem;
}
.eyebrow i { font-style: normal; color: var(--accent); position: relative; padding-right: 0.9rem; }
.eyebrow i::after { content: ""; position: absolute; right: 0; top: 50%; width: 0.55rem; height: 1px; background: var(--line); }

.h2 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.3rem, 1.05rem + 4.9vw, 5rem);
  line-height: 0.99; letter-spacing: -0.022em;
  margin-bottom: 1.7rem; text-wrap: balance;
}
.h2 em, .hero__lede em, .coda__h em {
  font-style: italic;
  background: linear-gradient(102deg, #4ce3ff, #9d7bff 45%, #ff4d8d);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

.scene p:not(.eyebrow) { max-width: var(--measure); color: var(--paper-70); }
.scene p + p { margin-top: 1.05rem; }

/* -------------------------------------------------------- museum tag list */
.tag {
  display: grid; gap: 0;
  margin-top: clamp(1.8rem, 4vh, 3rem);
  border-top: 1px solid var(--line-soft);
  max-width: 30rem;
  font-family: var(--mono);
}
.tag > div {
  display: grid; grid-template-columns: 5.5rem 1fr; gap: 1rem;
  padding: 0.6rem 0; border-bottom: 1px solid var(--line-soft);
}
.tag dt { font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--paper-28); }
.tag dd { font-size: 0.72rem; letter-spacing: 0.04em; color: var(--paper-70); }
.tag--inline { max-width: 26rem; }

/* ═════════════════════════════════════════════════════════ 00 · ORRERY ══ */
.hero { align-content: center; justify-items: start; }
.hero .tag { margin-top: clamp(2.2rem, 6vh, 4rem); }

.hero__title {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(4.2rem, 0.6rem + 17.5vw, 17rem);
  line-height: 0.8; letter-spacing: -0.045em;
  margin: 0 0 clamp(1rem, 3vh, 2.2rem);
}
.hero__lede {
  font-family: var(--display);
  font-size: clamp(1.55rem, 0.85rem + 2.6vw, 3.3rem);
  line-height: 1.1; letter-spacing: -0.018em;
  color: var(--paper) !important; max-width: 22ch !important;
  margin-bottom: 1.9rem;
}
.hero__prose { max-width: 45ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2.4rem; }

/* Hero entrance is a scored sequence rather than one fade. */
.hero .eyebrow      { transition-delay: 0.30s; }
.hero__title .reveal{ transition-delay: 0.38s; }
.hero__lede         { transition-delay: 0.62s; }
.hero__prose .reveal:nth-child(1) { transition-delay: 0.80s; }
.hero__prose .reveal:nth-child(2) { transition-delay: 0.90s; }
.hero__cta          { transition-delay: 1.02s; }
.hero .tag          { transition-delay: 1.14s; }

.scrollcue {
  position: absolute; left: 50%; bottom: clamp(1.6rem, 5vh, 3rem);
  transform: translateX(-50%);
  width: 1px; height: clamp(2.4rem, 6vh, 4rem);
  background: var(--line); overflow: hidden;
}
.scrollcue span {
  position: absolute; inset: 0 0 auto 0; display: block; height: 45%;
  background: linear-gradient(to bottom, transparent, var(--accent));
  animation: cue 2.4s var(--ease-soft) infinite;
}
@keyframes cue {
  0%   { transform: translateY(-100%); opacity: 0; }
  35%  { opacity: 1; }
  100% { transform: translateY(240%); opacity: 0; }
}

/* --------------------------------------------------------------- buttons */
.btn {
  position: relative; isolation: isolate;
  display: inline-flex; align-items: center; gap: 0.6rem;
  padding: 0.84rem 1.55rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(242, 237, 228, 0.03);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font: 500 0.76rem/1 var(--mono); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--paper-70); cursor: pointer; overflow: hidden;
  transition: color var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease),
              transform var(--t-fast) linear;
  will-change: transform;
}
.btn svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.4; transition: transform var(--t-mid) var(--ease); }
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(102deg, #4ce3ff, #9d7bff 55%, #ff4d8d);
  transform: translateY(101%);
  transition: transform var(--t-slow) var(--ease);
}
.btn:hover { color: var(--ink); border-color: transparent; }
.btn:hover::before { transform: translateY(0); }
.btn:hover svg { transform: translateY(2px); }
.btn:active { transform: scale(0.97); }
.btn--primary { color: var(--paper); border-color: var(--paper-28); }
.btn--ghost { padding: 0.62rem 1.15rem; font-size: 0.7rem; }

/* ══════════════════════════════════════════════════════ 01 · SCHLIEREN ══ */
.split {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.readout {
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, rgba(11,14,24,0.74), rgba(5,6,10,0.6));
  -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2);
  padding: clamp(1.1rem, 2.4vw, 1.9rem);
  font-family: var(--mono);
  box-shadow: 0 34px 100px -46px rgba(0,0,0,0.95);
}
.readout__head, .readout__foot {
  font-size: 0.63rem; letter-spacing: 0.24em; text-transform: uppercase; color: var(--paper-28);
}
.readout__head { display: flex; align-items: center; gap: 0.5rem; }
.readout__head::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--accent);
  animation: blip 2s var(--ease-soft) infinite;
}
@keyframes blip {
  0%   { box-shadow: 0 0 0 0 rgba(76,227,255,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(76,227,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(76,227,255,0); }
}
.readout dl { margin: 1.15rem 0 0.5rem; display: grid; }
.readout dl > div {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 0.54rem 0; border-bottom: 1px dashed var(--line-soft);
}
.readout dt { flex: none; font-size: 0.67rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-45); }
.readout dd {
  font-size: 0.77rem; font-weight: 500; color: var(--paper);
  text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ═══════════════════════════════════════════════════ 02 · HARMONOGRAPH ══ */
.plateau {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.harmo { position: relative; }
.harmo__frame {
  position: relative;
  border: 1px solid var(--line); border-radius: 3px;
  background: radial-gradient(closest-side, rgba(11,14,24,0.86), rgba(5,6,10,0.96));
  box-shadow: 0 48px 130px -56px rgba(0,0,0,1);
  overflow: hidden;
  /* The plate irises open once, then stays open. */
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.4s var(--ease);
}
.harmo.is-in .harmo__frame { clip-path: inset(0 0 0 0); }
.harmo__frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(closest-side, transparent 55%, rgba(5,6,10,0.72));
}
.harmo canvas { width: 100%; height: auto; aspect-ratio: 1 / 1; }

/* Registration marks — the instrument is a plate, so it gets plate furniture. */
.harmo__cross { position: absolute; inset: 10px; pointer-events: none; }
.harmo__cross::before, .harmo__cross::after {
  content: ""; position: absolute; width: 9px; height: 9px;
  border: 1px solid var(--line);
}
.harmo__cross::before { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.harmo__cross::after  { bottom: 0; right: 0; border-left: 0; border-top: 0; }

.harmo figcaption {
  display: flex; justify-content: space-between; gap: 1rem; margin-top: 0.9rem;
  font: 400 0.65rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--paper-28);
}
.harmo figcaption b { color: var(--accent); font-weight: 500; }
.plateau__copy .btn { margin-top: 1.9rem; }

/* ═══════════════════════════════════════════════════ 03 · SPECTROSCOPE ══ */
.deck {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(2rem, 6vw, 6rem);
  align-items: center;
}

.console {
  border: 1px solid var(--line); border-radius: 4px;
  background: linear-gradient(180deg, rgba(11,14,24,0.8), rgba(5,6,10,0.66));
  -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2);
  padding: clamp(1.2rem, 2.6vw, 2rem);
  box-shadow: 0 34px 100px -46px rgba(0,0,0,0.95);
}
.console__head {
  display: flex; justify-content: space-between; align-items: center;
  padding-bottom: 1rem; margin-bottom: clamp(1rem, 2.2vw, 1.5rem);
  border-bottom: 1px solid var(--line-soft);
  font: 420 0.64rem/1 var(--mono); letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--paper-28);
}
.console__live { color: var(--accent); display: flex; align-items: center; gap: 0.45rem; }
.console__live::before {
  content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor;
  animation: blip 2s var(--ease-soft) infinite;
}

.console__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: clamp(1rem, 2.4vw, 1.7rem); }

.dial { display: grid; grid-template-columns: 1fr auto; gap: 0.5rem 0.75rem; align-items: center; }
.dial__k { grid-column: 1; font: 420 0.66rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-45); }
.dial output { grid-column: 2; font: 500 0.7rem/1 var(--mono); color: var(--accent); font-variant-numeric: tabular-nums; }
.dial input[type="range"] { grid-column: 1 / -1; }

input[type="range"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 22px; background: transparent; cursor: ew-resize; margin: 0;
}
input[type="range"]::-webkit-slider-runnable-track { height: 1px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 11px; height: 11px; margin-top: -5px; border-radius: 50%;
  background: var(--paper);
  transition: box-shadow var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}
input[type="range"]:hover::-webkit-slider-thumb,
input[type="range"]:focus-visible::-webkit-slider-thumb {
  background: var(--accent); box-shadow: 0 0 0 6px rgba(76,227,255,0.16);
}
input[type="range"]::-moz-range-track { height: 1px; background: var(--line); }
input[type="range"]::-moz-range-thumb {
  width: 11px; height: 11px; border: none; border-radius: 50%; background: var(--paper);
  transition: box-shadow var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}
input[type="range"]:hover::-moz-range-thumb { background: var(--accent); box-shadow: 0 0 0 6px rgba(76,227,255,0.16); }

.console__row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem 1.1rem;
  margin-top: clamp(1.2rem, 2.6vw, 1.9rem);
  padding-top: clamp(1.2rem, 2.6vw, 1.9rem);
  border-top: 1px dashed var(--line-soft);
}
.console__k { font: 420 0.66rem/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--paper-45); }
.swatches { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-right: auto; }
.sw {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.4rem 0.72rem; border: 1px solid var(--line); border-radius: 999px;
  background: none; cursor: pointer;
  font: 420 0.64rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--paper-45);
  transition: color var(--t-mid) var(--ease), border-color var(--t-mid) var(--ease), background-color var(--t-mid) var(--ease);
}
.sw span { width: 22px; height: 5px; border-radius: 3px; }
.sw--aurora span { background: linear-gradient(90deg, #4ce3ff, #9d7bff, #ff4d8d); }
.sw--ember  span { background: linear-gradient(90deg, #ffcf6b, #ff7a3d, #ff2d55); }
.sw--abyss  span { background: linear-gradient(90deg, #0affc2, #2f7bff, #7b2dff); }
.sw--bone   span { background: linear-gradient(90deg, #fffaf0, #d8cbb4, #8a7f6d); }
.sw:hover { color: var(--paper); border-color: var(--paper-28); }
.sw.is-on { color: var(--paper); border-color: var(--paper-45); background: rgba(242,237,228,0.05); }

/* ═══════════════════════════════════════════════════════════ 04 · CODA ══ */
.coda { justify-items: center; text-align: center; align-content: center; }
.coda .eyebrow { justify-content: center; }
.coda__h {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.2rem, 0.8rem + 5.6vw, 5.6rem);
  line-height: 1.0; letter-spacing: -0.028em; margin-bottom: 1.7rem;
}
.coda__p { max-width: 48ch; }

/* ════════════════════════════════════════════════════════════ MARQUEE ══ */
.marquee {
  position: relative; z-index: var(--z-page);
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: clamp(0.9rem, 2vh, 1.4rem) 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.marquee__track { display: flex; gap: 3.5rem; width: max-content; will-change: transform; }
.marquee__track span {
  display: inline-flex; align-items: baseline; gap: 0.7rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 0.9rem + 1.9vw, 2.6rem);
  color: var(--paper-28); white-space: nowrap;
}
.marquee__track i {
  font: 400 0.68rem/1 var(--mono); font-style: normal;
  letter-spacing: 0.2em; color: var(--accent); opacity: 0.7;
}

/* ═══════════════════════════════════════════════════════════ COLOPHON ══ */
.colophon {
  position: relative; z-index: var(--z-page);
  padding: clamp(3rem, 8vh, 6rem) var(--gut) clamp(2rem, 5vh, 3rem);
  background: linear-gradient(to bottom, transparent, rgba(5,6,10,0.88) 26%, var(--ink));
}
.colophon__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: clamp(1.6rem, 4vw, 3rem); }
.colophon__k {
  font: 420 0.63rem/1 var(--mono); letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.9rem;
}
.colophon p:not(.colophon__k) { font-size: 0.84rem; line-height: 1.85; color: var(--paper-45); }
.colophon i { font-style: italic; color: var(--paper-70); }
.colophon__rule { display: block; height: 1px; margin: clamp(2rem, 5vh, 3.4rem) 0 1.2rem; background: linear-gradient(90deg, var(--line), transparent); }
.colophon__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.6rem 1rem;
  font: 400 0.65rem/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--paper-28);
}

.noscript {
  position: relative; z-index: var(--z-page);
  margin: 0 var(--gut) 3rem; padding: 1rem 1.3rem;
  border: 1px solid var(--line); border-radius: 3px;
  background: rgba(11,14,24,0.85); font-size: 0.88rem;
}

/* ════════════════════════════════════════════════════════════ REVEALS ══ */
.reveal { opacity: 0; transform: translateY(20px); }
.reveal.is-in {
  opacity: 1; transform: none;
  transition: opacity var(--t-slow) var(--ease), transform var(--t-slow) var(--ease);
}

.split-line { display: block; overflow: hidden; padding-bottom: 0.04em; }
.split-line > i {
  display: block; font-style: inherit;
  transform: translateY(110%);
  transition: transform 1.05s var(--ease);
}
.reveal.is-in .split-line > i { transform: none; }
.reveal.is-in .split-line:nth-child(2) > i { transition-delay: 0.1s; }
.reveal.is-in .split-line:nth-child(3) > i { transition-delay: 0.2s; }
.reveal.is-in .split-line:nth-child(4) > i { transition-delay: 0.3s; }

.split-char {
  display: inline-block;
  transform: translateY(0.5em) rotate(4deg);
  opacity: 0;
  transition: transform 1.05s var(--ease), opacity 0.7s var(--ease);
}
.reveal.is-in .split-char { transform: none; opacity: 1; }

/* ═════════════════════════════════════════════════════════ RESPONSIVE ══ */
@media (max-width: 960px) {
  .split, .plateau, .deck { grid-template-columns: minmax(0, 1fr); }
  .plateau .harmo { order: 2; margin-top: 2.5rem; }
  .plateau__copy { order: 1; }
  .rail, .nav { display: none; }
  .readout, .console { margin-top: 2.2rem; }
}

@media (max-width: 600px) {
  .plate { display: none; }
  .scene { min-height: auto; padding-top: clamp(5rem, 18vh, 8rem); padding-bottom: clamp(4rem, 12vh, 6rem); }
  .hero { min-height: 100svh; }
  .console__row { flex-direction: column; align-items: flex-start; }
  .swatches { margin-right: 0; }
  .tag > div { grid-template-columns: 4.5rem 1fr; }
}

@media (hover: none), (pointer: coarse) {
  .cursor { display: none; }
  .scene { transform: none; }   /* no shear where scroll is native momentum */
}

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .split-line > i { transform: none; }
  .split-char { opacity: 1; transform: none; }
  .harmo__frame { clip-path: none; }
  .scene { transform: none; }
  .scrollcue, .grain, .sweep { display: none; }
  .field { transform: none; }
}

/* ------------------------------------------------------------ print-safe */
@media print {
  .field, .grain, .vignette, .sweep, .cursor, .boot, .topbar, .rail, .plate, .marquee { display: none !important; }
  html, body { background: #fff; color: #000; }
  body.lerp-scroll #scroll { position: static; }
  .scene { min-height: auto; page-break-inside: avoid; transform: none; }
  .h2 em, .hero__lede em, .coda__h em { -webkit-text-fill-color: #000; color: #000; }
}
