/* ════════════════════════════════════════════════════════════════════════
   core.css — tokens, base, HUD, cursor, shared components, overlays,
   station (page) transitions. Section-specific styles live in home.css
   and stations.css.
   ════════════════════════════════════════════════════════════════════════ */

:root {
  /* Palette */
  --void: #000;
  --ink: #f3f0e8;            /* hull white */
  --ink-2: #a9aeb9;
  --ink-3: #626975;
  --thermal: #ff5a1f;        /* hero accent: exhaust, Kapton, heat */
  --thermal-hot: #ffb056;
  --lox: #a9e4ff;            /* cold accent: LOX frost */
  --bp-navy: #0a1d3d;        /* blueprint */
  --bp-cyan: #6fd6ff;
  --gold: #d9a545;           /* MLI foil */

  /* Type */
  --font-display: "Archivo", "Arial Black", "Helvetica Neue", Arial, sans-serif;
  --font-text: "Archivo", "Helvetica Neue", Arial, system-ui, sans-serif;
  --font-serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-mono: "Martian Mono", ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  /* Layout */
  --gutter: clamp(20px, 6vw, 96px);
  --hud-h: 64px;
  --radius: 18px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  /* Crinkled gold MLI foil: an SVG turbulence field lit from the top-left. */
  --foil: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='f' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.035 .06' numOctaves='3' seed='4' stitchTiles='stitch'/%3E%3CfeSpecularLighting surfaceScale='5' specularConstant='1.15' specularExponent='22' lighting-color='%23ffe2a0'%3E%3CfeDistantLight azimuth='225' elevation='48'/%3E%3C/feSpecularLighting%3E%3C/filter%3E%3Crect width='240' height='240' fill='%23a8741f'/%3E%3Crect width='240' height='240' filter='url(%23f)'/%3E%3C/svg%3E");
}

/* ── Reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-width: thin;
  scrollbar-color: #2b2f36 #000;
}
body { margin: 0; min-height: 100vh; background: var(--void); overflow-x: clip; }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; padding: 0; }
ol, ul { list-style: none; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
canvas, svg, img { display: block; }
img { max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--thermal); color: #000; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--thermal); outline-offset: 4px; border-radius: 4px; }

/* Lenis smooth scroll (its stylesheet, inlined) */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

.skip-link {
  position: fixed; left: 12px; top: -80px; z-index: 300;
  padding: 12px 16px; background: var(--ink); color: #000; border-radius: 8px;
  font: 600 .85rem/1 var(--font-text);
}
.skip-link:focus { top: 12px; }

.vh {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* ── Background layers ─────────────────────────────────────────────── */
#sky { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
/* Launch-site haze: the only "atmosphere". Fades out with altitude (JS sets --haze). */
#haze {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  opacity: var(--haze, 1);
  background:
    radial-gradient(90% 34% at 50% 108%, rgba(255, 106, 40, .42), rgba(255, 120, 50, .12) 45%, transparent 72%),
    radial-gradient(60% 22% at 50% 104%, rgba(255, 196, 120, .30), transparent 70%);
}
html:not([data-world="engineering"]) #haze { opacity: 0; }

#hero-gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
html:not([data-world="engineering"]) #hero-gl { display: none; }

#app { position: relative; }
.world { display: block; position: relative; }
.world:focus, .world:focus-visible { outline: none; }

/* ── Type ──────────────────────────────────────────────────────────── */
.sec-title {
  font-family: var(--font-display);
  font-weight: 650;
  font-stretch: 112%;
  font-size: clamp(2.6rem, 7.2vw, 6.4rem);
  line-height: .94;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.sec-title--xl { font-size: clamp(3.4rem, 11vw, 10rem); font-weight: 750; font-stretch: 120%; }
.aside {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 380;
  font-size: clamp(1.08rem, 1.55vw, 1.4rem);
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 36ch;
}
.mono {
  font-family: var(--font-mono); font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
}

.sec { position: relative; z-index: 3; padding: clamp(110px, 18vh, 200px) var(--gutter); }
.sec-head { display: grid; gap: 18px; margin-bottom: clamp(40px, 7vh, 88px); max-width: 1100px; }

/* ── Glass panel: the "clean room", rebuilt as light on black ──────── */
.panel {
  position: relative;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .13);
  background: linear-gradient(180deg, rgba(255, 255, 255, .085), rgba(255, 255, 255, .028));
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  backdrop-filter: blur(22px) saturate(1.35);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), inset 0 0 0 1px rgba(255, 255, 255, .02), 0 44px 90px -34px rgba(0, 0, 0, .95);
}
/* Drawing-sheet crop marks on two corners */
.panel::before, .panel::after {
  content: ""; position: absolute; width: 13px; height: 13px; pointer-events: none;
  border: 0 solid var(--ink-3);
}
.panel::before { left: -8px; top: -8px; border-left-width: 1px; border-top-width: 1px; }
.panel::after { right: -8px; bottom: -8px; border-right-width: 1px; border-bottom-width: 1px; }

/* ── Chips, buttons ────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: .7em;
  padding: .78em 1.15em; border-radius: 999px;
  font: 500 .68rem/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink); background: rgba(8, 8, 8, .72);
  border: 1px solid rgba(255, 255, 255, .2);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  white-space: nowrap;
}
.chip__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--thermal); box-shadow: 0 0 0 0 rgba(255, 90, 31, .7); animation: beacon 2.4s infinite; }
@keyframes beacon { 0% { box-shadow: 0 0 0 0 rgba(255, 90, 31, .7); } 70%, 100% { box-shadow: 0 0 0 9px rgba(255, 90, 31, 0); } }
.chip--status { transition: border-color .3s, transform .5s var(--ease-out); }
.chip--status:hover { border-color: var(--thermal); }

.tag {
  display: inline-block; padding: .5em .8em; border-radius: 6px;
  font: 400 .64rem/1 var(--font-mono); letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-2); border: 1px solid rgba(255, 255, 255, .16);
}
.tag--sample { color: #000; background: var(--gold); border-color: transparent; font-weight: 600; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .8em;
  min-height: 52px; padding: 0 1.8em; border-radius: 999px;
  font: 650 .92rem/1 var(--font-text); font-stretch: 110%; letter-spacing: .01em;
  border: 1px solid rgba(255, 255, 255, .28); color: var(--ink);
  transition: transform .5s var(--ease-out), border-color .3s, background-color .3s;
  will-change: transform;
}
.btn:hover { border-color: var(--ink); }
.btn--primary {
  color: #100a00; border: 0;
  background: var(--foil) center / 240px 240px, var(--gold);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), inset 0 -8px 16px rgba(80, 44, 0, .35), 0 12px 36px -10px rgba(217, 165, 69, .55);
}
.btn--primary > span { position: relative; }
.btn--ghost { background: rgba(255, 255, 255, .04); }

.round-btn {
  display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .24); background: rgba(10, 10, 10, .6);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .5s var(--ease-out), border-color .3s, background-color .3s;
}
.round-btn:hover { border-color: var(--ink); background: rgba(255, 255, 255, .1); }
.round-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Segmented toggle */
.seg { display: inline-flex; padding: 4px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(8, 8, 8, .7); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.seg button { padding: .7em 1.2em; border-radius: 999px; font: 500 .68rem/1 var(--font-mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-2); transition: color .3s, background-color .3s; }
.seg button[aria-pressed="true"] { background: var(--ink); color: #000; }

/* Dimension line: |———— label ————| */
.dim {
  display: flex; align-items: center; gap: 1em;
  font: 400 .64rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
}
.dim::before, .dim::after {
  content: ""; flex: 1; height: 9px;
  background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat;
}
.dim::before { border-left: 1px solid currentColor; }
.dim::after { border-right: 1px solid currentColor; }

/* ── HUD ───────────────────────────────────────────────────────────── */
.hud-top {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--hud-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  pointer-events: none;
  view-transition-name: hud-top;
}
.hud-top > * { pointer-events: auto; }
.brand { display: inline-flex; align-items: center; gap: 10px; transition: transform .5s var(--ease-out); }
.brand__patch { width: 34px; height: 34px; display: block; }
.brand__patch svg { width: 100%; height: 100%; }
.brand__id { font: 600 .72rem/1 var(--font-mono); letter-spacing: .12em; }

.stations {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px;
  background: rgba(6, 6, 6, .62); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.stations a {
  position: relative; padding: .72em 1.1em; border-radius: 999px;
  font: 500 .66rem/1 var(--font-mono); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2);
  transition: color .3s, background-color .3s;
}
.stations a:hover { color: var(--ink); }
.stations a[aria-current="page"] { color: #000; background: var(--ink); }

/* Left rail: altitude as a drawing scale */
.hud-rail {
  position: fixed; left: 18px; top: 50%; z-index: 50; width: 30px; height: 46vh; transform: translateY(-50%);
  pointer-events: none; view-transition-name: hud-rail;
  transition: opacity .5s;
}
.hud-rail__scale {
  position: absolute; left: 0; top: 0; bottom: 0; width: 9px;
  border-left: 1px solid rgba(255, 255, 255, .28);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .5) 0 1px, transparent 1px 10%) left / 9px 100% no-repeat,
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .22) 0 1px, transparent 1px 2%) left / 5px 100% no-repeat;
}
.hud-rail__marker {
  position: absolute; left: -3px; bottom: calc(var(--rail, 0) * 100%); height: 1px; width: 16px; background: var(--thermal);
  box-shadow: 0 0 10px var(--thermal);
}
.hud-rail__marker span {
  position: absolute; left: 22px; top: -4px; white-space: nowrap;
  font: 500 .56rem/1 var(--font-mono); letter-spacing: .12em; color: var(--thermal);
  writing-mode: vertical-rl; transform: translateY(-100%) rotate(180deg); transform-origin: center;
}
html:not([data-world="engineering"]) .hud-rail { opacity: 0; }

/* Bottom telemetry strip */
.hud-tm {
  position: fixed; left: var(--gutter); bottom: 18px; z-index: 50;
  display: flex; align-items: stretch; gap: 0;
  border-radius: 12px; overflow: hidden;
  background: rgba(6, 6, 6, .62); border: 1px solid rgba(255, 255, 255, .12);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  view-transition-name: hud-tm;
}
.tm {
  display: grid; gap: 6px; padding: 10px 14px; min-width: 86px; text-align: left;
  border-left: 1px solid rgba(255, 255, 255, .1);
  font-family: var(--font-mono);
}
.tm:first-child { border-left: 0; }
.tm__k { font-size: .52rem; letter-spacing: .14em; color: var(--ink-3); }
.tm__v { font-size: .72rem; letter-spacing: .04em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tm--clock { transition: background-color .2s; }
.tm--clock:hover { background: rgba(255, 255, 255, .06); }
.tm--clock:active { background: rgba(255, 90, 31, .25); }
.tm--phase .tm__v { color: var(--thermal); }
.tm--phase { min-width: 118px; }
.tm--meteors .tm__v { color: var(--lox); }

/* ── Custom cursor (fine pointers only) ────────────────────────────── */
.cursor { position: fixed; left: 0; top: 0; z-index: 200; pointer-events: none; display: none; view-transition-name: cursor; }
@media (hover: hover) and (pointer: fine) {
  html.has-cursor, html.has-cursor * { cursor: none !important; }
  html.has-cursor input, html.has-cursor textarea { cursor: text !important; }
  html.has-cursor .cursor { display: block; }
}
.cursor__dot, .cursor__ring, .cursor__label { position: absolute; left: 0; top: 0; will-change: transform; }
.cursor__dot {
  width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--ink);
  transform: translate3d(var(--cx, -100px), var(--cy, -100px), 0);
  transition: opacity .2s, background-color .2s;
}
.cursor__ring {
  --size: 38px;
  width: var(--size); height: var(--size); margin: calc(var(--size) / -2) 0 0 calc(var(--size) / -2);
  transform: translate3d(var(--rx, -100px), var(--ry, -100px), 0) scale(var(--rs, 1));
  border-radius: 50%; border: 1px solid rgba(243, 240, 232, .55);
  display: grid; place-items: center;
  transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), background-color .25s, border-color .25s, opacity .25s;
}
.cursor__ticks { position: absolute; inset: -1px; width: calc(100% + 2px); height: calc(100% + 2px); fill: none; stroke: var(--bp-cyan); stroke-width: .6; opacity: 0; vector-effect: non-scaling-stroke; }
.cursor__ticks circle { stroke-dasharray: 1.2 3; }
.cursor__icon { position: absolute; width: 20px; height: 20px; opacity: 0; fill: none; stroke: #000; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; transition: opacity .2s; }
.cursor__icon--play { fill: #000; stroke: none; }
.cursor__label {
  transform: translate3d(calc(var(--cx, -100px) + 16px), calc(var(--cy, -100px) + 14px), 0);
  font: 400 .56rem/1.3 var(--font-mono); letter-spacing: .08em; color: var(--bp-cyan); white-space: pre; opacity: 0; transition: opacity .2s;
}
/* modes */
.cursor[data-mode="link"] .cursor__ring { --size: 58px; background: rgba(243, 240, 232, .1); border-color: var(--ink); }
.cursor[data-mode="link"] .cursor__dot { opacity: 0; }
.cursor[data-mode="text"] .cursor__ring, .cursor[data-mode="text"] .cursor__dot { opacity: 0; }
.cursor[data-mode="lens"] .cursor__ring { --size: var(--lens-d, 300px); border-color: transparent; transition: none; }
.cursor[data-mode="lens"] .cursor__ticks { opacity: .9; }
.cursor[data-mode="lens"] .cursor__label { opacity: .9; }
.cursor[data-mode="lens"] .cursor__dot { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; background: var(--bp-cyan); }
.cursor[data-mode="play"] .cursor__ring { --size: 64px; background: var(--thermal); border-color: transparent; }
.cursor[data-mode="play"] .cursor__icon--play { opacity: 1; }
.cursor[data-mode="play"] .cursor__dot { opacity: 0; }
.cursor[data-mode="drag"] .cursor__ring { --size: 64px; background: var(--ink); border-color: transparent; }
.cursor[data-mode="drag"] .cursor__icon--drag { opacity: 1; }
.cursor[data-mode="drag"] .cursor__dot { opacity: 0; }
.cursor[data-mode="eyepiece"] .cursor__ring { --size: 74px; border-color: rgba(169, 228, 255, .7); box-shadow: inset 0 0 0 5px rgba(0, 0, 0, .55), 0 0 0 1px rgba(0, 0, 0, .8); }
.cursor[data-mode="eyepiece"] .cursor__ticks { opacity: .8; stroke: var(--lox); }
.cursor[data-mode="eyedropper"] .cursor__ring { --size: 54px; background: var(--swatch, #fff); border: 3px solid var(--ink); box-shadow: 0 0 0 1px rgba(0, 0, 0, .6); }
.cursor[data-mode="eyedropper"] .cursor__label { opacity: 1; color: var(--ink); transform: translate3d(calc(var(--cx, -100px) + 36px), calc(var(--cy, -100px) + 22px), 0); }
.cursor.is-down .cursor__ring { --rs: .86; }
.cursor[data-mode="tune"] .cursor__ring { --size: 30px; border-color: rgba(169, 228, 255, .8); }
.cursor[data-mode="tune"] .cursor__ticks { opacity: .9; stroke: var(--lox); }
.cursor[data-mode="tune"] .cursor__dot { width: 3px; height: 3px; margin: -1.5px 0 0 -1.5px; background: var(--lox); }
.cursor[data-mode="tune"] .cursor__label { opacity: .95; color: var(--lox); transform: translate3d(calc(var(--cx, -100px) + 22px), calc(var(--cy, -100px) + 14px), 0); }

/* Magnetic elements get their offset from JS */
[data-magnetic] { transform: translate3d(var(--mx, 0px), var(--my, 0px), 0); }

/* ── Overlays (dialogs) ────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  background: rgba(0, 0, 0, .78);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  opacity: 0; transition: opacity .45s var(--ease-out);
  overflow: hidden;
}
.overlay.is-open { opacity: 1; }
.overlay__close { position: absolute; right: var(--gutter); top: 18px; z-index: 5; }

/* ── Toast ─────────────────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 84px; z-index: 90;
  transform: translate(-50%, 24px); opacity: 0; pointer-events: none;
  padding: 14px 18px 14px 20px; border-radius: 10px; max-width: min(92vw, 560px);
  background: rgba(8, 8, 8, .86); border: 1px solid rgba(255, 255, 255, .16); border-left: 3px solid var(--thermal);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  font: 500 .68rem/1.5 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink);
  transition: opacity .4s, transform .6s var(--ease-out);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ── Preloader ─────────────────────────────────────────────────────── */
.preloader {
  position: fixed; inset: 0; z-index: 150; background: #000;
  display: grid; place-items: center; align-content: center; gap: 24px;
  transition: opacity .7s var(--ease-out), clip-path .9s var(--ease-out);
  clip-path: inset(0 0 0 0);
}
.preloader.is-done { clip-path: inset(0 0 100% 0); }
.preloader__count {
  font-family: var(--font-display); font-weight: 850; font-stretch: 125%;
  font-size: clamp(5rem, 24vw, 22rem); line-height: .8; letter-spacing: -.04em;
  color: transparent; -webkit-text-stroke: 1.5px var(--ink);
  font-variant-numeric: tabular-nums;
}
.preloader__count.is-ignition { color: var(--thermal); -webkit-text-stroke: 0; text-shadow: 0 0 80px rgba(255, 90, 31, .8); font-size: clamp(3rem, 15vw, 13rem); }
.preloader__line { font: 400 .7rem/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.preloader__skip {
  position: absolute; bottom: 28px; left: 50%; transform: translateX(-50%);
  padding: 12px 16px; font: 400 .66rem/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3);
  border-bottom: 1px solid transparent; transition: color .2s;
}
.preloader__skip:hover { color: var(--ink); }

/* ── Mini-player ───────────────────────────────────────────────────── */
.player {
  position: fixed; right: var(--gutter); bottom: 18px; z-index: 60;
  display: flex; align-items: center; gap: 10px; padding: 7px 10px 7px 7px; border-radius: 999px;
  background: rgba(6, 6, 6, .74); border: 1px solid rgba(217, 165, 69, .5);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: 0 16px 40px -14px rgba(217, 165, 69, .4);
  view-transition-name: player;
  animation: player-in .7s var(--ease-out);
}
@keyframes player-in { from { opacity: 0; transform: translateY(20px); } }
.player__btn { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--foil) center / 160px, var(--gold); color: #120b00; }
.player__btn svg { width: 18px; height: 18px; fill: currentColor; }
.player__btn--sm { width: 30px; height: 30px; background: none; color: var(--ink-2); }
.player__btn--sm:hover { color: var(--ink); }
.player__btn--sm svg { width: 15px; height: 15px; }
.player__meta { display: grid; gap: 4px; min-width: 0; max-width: 150px; }
.player__k { font: 400 .5rem/1 var(--font-mono); letter-spacing: .14em; color: var(--gold); }
.player__title { font: 600 .82rem/1.1 var(--font-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player__wave { width: 96px; height: 24px; }
.i-pause { display: none; }
.is-playing .i-play { display: none; }
.is-playing .i-pause { display: block; }

/* ── Easter egg: full-screen launch ────────────────────────────────── */
.egg-launch { position: fixed; inset: 0; z-index: 140; pointer-events: none; }
.egg-launch canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.egg-launch__text {
  position: absolute; left: 0; right: 0; top: 38%; text-align: center;
  font-family: var(--font-display); font-weight: 850; font-stretch: 125%;
  font-size: clamp(3rem, 16vw, 15rem); letter-spacing: -.04em; line-height: .8;
  color: var(--ink); mix-blend-mode: difference; opacity: 0;
}
.egg-launch.is-on .egg-launch__text { animation: egg-text 3.8s var(--ease-out) forwards; }
@keyframes egg-text { 0% { opacity: 0; transform: scale(1.4); letter-spacing: .2em; } 18% { opacity: 1; transform: none; letter-spacing: -.04em; } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-12vh); } }
.is-shaking { animation: shake .09s linear infinite; }
@keyframes shake { 0% { translate: 2px -1px; } 25% { translate: -2px 2px; } 50% { translate: 1px 2px; } 75% { translate: -1px -2px; } 100% { translate: 2px 1px; } }

/* ── Flight log ────────────────────────────────────────────────────── */
.overlay--log { display: grid; place-items: center; padding: 24px; }
.log { width: min(680px, 100%); max-height: min(80vh, 760px); padding: clamp(24px, 4vw, 44px); display: grid; grid-template-rows: auto auto auto 1fr; gap: 14px; }
.log .overlay__close { right: 16px; top: 16px; }
.log__title { font: 700 clamp(1.8rem, 4vw, 2.8rem)/1 var(--font-display); font-stretch: 115%; letter-spacing: -.03em; }
.log__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .12); border-radius: 10px; overflow: hidden; margin-top: 8px; }
.log__stats > div { background: #070707; padding: 12px 14px; display: grid; gap: 6px; }
.log__stats dt { font: 400 .52rem/1 var(--font-mono); letter-spacing: .14em; color: var(--ink-3); text-transform: uppercase; }
.log__stats dd { font: 500 .9rem/1 var(--font-mono); color: var(--ink); }
.log__list { overflow: auto; min-height: 120px; display: grid; align-content: start; gap: 0; font: 400 .68rem/1.5 var(--font-mono); letter-spacing: .03em; color: var(--ink-2); border-top: 1px solid rgba(255, 255, 255, .12); }
.log__list li { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px dashed rgba(255, 255, 255, .1); }
.log__list time { color: var(--thermal); }

.noscript { position: relative; z-index: 400; padding: 20vh var(--gutter); max-width: 60ch; background: #000; min-height: 100vh; }
.noscript h1 { font: 800 clamp(2rem, 8vw, 5rem)/1 var(--font-display); margin-bottom: .5em; }
.noscript p { margin-bottom: 1em; color: var(--ink-2); }

/* ── Station transitions ("warp") ──────────────────────────────────── */
@keyframes warp-out { to { opacity: 0; transform: scale(1.7); filter: blur(14px); } }
@keyframes warp-in { from { opacity: 0; transform: scale(.66); filter: blur(12px); } }
::view-transition-old(root) { animation: warp-out .5s cubic-bezier(.55, 0, .9, .35) both; }
::view-transition-new(root) { animation: warp-in .85s cubic-bezier(.12, .8, .2, 1) both; }
::view-transition-group(hud-top), ::view-transition-group(hud-rail), ::view-transition-group(hud-tm),
::view-transition-group(player), ::view-transition-group(cursor) { animation-duration: .01s; }
/* Fallback for browsers without the View Transitions API */
#app.is-warp-out { animation: warp-out .45s cubic-bezier(.55, 0, .9, .35) both; transform-origin: 50% 50vh; }
#app.is-warp-in { animation: warp-in .8s cubic-bezier(.12, .8, .2, 1) both; transform-origin: 50% 50vh; }

/* Reveal helper used by JS (single, restrained entrance) */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s var(--ease-out), transform 1.1s var(--ease-out); }
.reveal.is-in { opacity: 1; transform: none; }

/* ── Small screens ─────────────────────────────────────────────────── */
@media (max-width: 860px) {
  :root { --hud-h: 56px; }
  .hud-top__status { display: none; }
  .brand__id { display: none; }
  .hud-rail { display: none; }
  .hud-tm { left: 12px; right: auto; bottom: 12px; border-radius: 10px; }
  .tm { padding: 8px 10px; min-width: 0; gap: 5px; }
  .tm--vel { display: none; }
  .tm--phase { min-width: 92px; }
  .tm__v { font-size: .64rem; }
  .player { right: 12px; bottom: 64px; }
  .player__wave { display: none; }
  .toast { bottom: 124px; }
  .stations a { padding: .72em .85em; font-size: .6rem; }
}

/* ── Reduced motion: calm, still beautiful ─────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .chip__dot { animation: none; }
  .reveal { opacity: 1; transform: none; transition: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .is-shaking { animation: none; }
}


/* ═════════════ NERD EASTER EGGS (nerd.js) ═════════════ */
/* Pale Blue Dot */
.pbd { position: relative; z-index: 3; height: 280px; display: grid; place-items: center; overflow: hidden; }
.pbd__beam { position: absolute; left: 50%; top: -40%; width: 70px; height: 180%; transform: translateX(-30%) rotate(18deg); pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 210, 170, .035) 30%, rgba(255, 220, 190, .06) 50%, rgba(255, 210, 170, .035) 70%, transparent);
  -webkit-mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); mask-image: linear-gradient(transparent, #000 35%, #000 65%, transparent); }
.pbd__dot { position: relative; width: 3px; height: 3px; padding: 0; border: 0; border-radius: 50%; background: #7fb2ff; box-shadow: 0 0 3px rgba(127, 178, 255, .9); cursor: pointer; }
.pbd__dot::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; }
.pbd__dot:hover { box-shadow: 0 0 6px #9cc4ff, 0 0 14px rgba(127, 178, 255, .6); }
.pbd__note { position: absolute; top: calc(50% + 18px); left: 50%; transform: translate(-50%, 6px); white-space: nowrap; font: 400 .62rem/1 var(--font-mono); letter-spacing: .12em; color: var(--ink-2); opacity: 0; transition: opacity 1.2s, transform 1.2s; }
.pbd__note.is-on { opacity: 1; transform: translate(-50%, 0); }

/* UFO */
.ufo { position: fixed; left: 0; top: 0; z-index: 90; width: 64px; height: 34px; padding: 0; border: 0; background: none; cursor: pointer; filter: drop-shadow(0 0 8px rgba(169, 228, 255, .5)); }
.ufo svg { width: 100%; height: 100%; display: block; }
.ufo .ufo__l { fill: #ffd27a; animation: ufoBlink 1s steps(2) infinite; }
.ufo .ufo__l:nth-of-type(2n) { animation-delay: .5s; }
@keyframes ufoBlink { 50% { fill: #a9e4ff; } }
.ufo::after { content: ""; position: absolute; left: 50%; top: 26px; width: 0; height: var(--beam, 120px); transform: translateX(-50%); opacity: 0; pointer-events: none;
  background: linear-gradient(rgba(169, 255, 200, .55), rgba(169, 255, 200, .08)); clip-path: polygon(40% 0, 60% 0, 100% 100%, 0 100%); transition: opacity .4s, width .4s; }
.ufo.is-beam::after { opacity: 1; width: 70px; }
.ufo__bubble { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -6px); white-space: nowrap; padding: 6px 10px; border-radius: 10px; background: #f3f0e8; color: #000; font: 600 .68rem/1 var(--font-text); }
.abducted { display: inline-block; transition: transform 1.4s cubic-bezier(.5, 0, .3, 1), opacity 1.4s, filter 1.4s; }
.abducted.is-taken { transform: translateY(-130px) scale(.3) rotate(200deg); opacity: 0; filter: blur(2px) drop-shadow(0 0 8px #a9ffc8); }

/* Escape velocity */
.patch-fly { position: fixed; left: 0; top: 0; z-index: 95; width: 34px; height: 34px; pointer-events: none; will-change: transform; filter: drop-shadow(0 0 10px rgba(255, 140, 60, .6)); }
.patch-fly.is-home { transition: transform .6s var(--ease-out); }

/* Deep field */
.deepfield { position: fixed; z-index: 92; width: var(--d); transform: translate(-50%, -50%); pointer-events: none; display: grid; justify-items: center; gap: 12px; }
.deepfield__glass { width: var(--d); height: var(--d); border-radius: 50%; overflow: hidden; clip-path: circle(0% at 50% 50%); transition: clip-path 1s var(--ease-out);
  box-shadow: 0 0 0 1px rgba(169, 228, 255, .4), 0 0 60px rgba(120, 160, 255, .25); }
.deepfield__glass canvas { width: 100%; height: 100%; display: block; transform: scale(2.4); transition: transform 2.6s var(--ease-out); }
.deepfield.is-on .deepfield__glass { clip-path: circle(50% at 50% 50%); }
.deepfield.is-on .deepfield__glass canvas { transform: scale(1); }
.deepfield__cap { max-width: 34ch; text-align: center; font: 400 .62rem/1.5 var(--font-mono); letter-spacing: .08em; color: var(--ink-2); opacity: 0; transition: opacity .8s .6s; text-shadow: 0 1px 6px #000; }
.deepfield.is-on .deepfield__cap { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .deepfield__glass, .deepfield__glass canvas { transition: none; } }
