/* HAL — night train / network latency. Tokens first; everything else reads them. */
:root {
  --bg: #0B0F14;
  --bg-2: #0E131A;
  --surface: #121821;
  --surface-2: #18202B;
  --line: #222C39;
  --line-2: #2E3A4A;
  --text: #E8EEF4;
  --muted: #8A97A6;
  --faint: #5A6676;
  --cyan: #4FD1E8;
  --cyan-dim: rgba(79, 209, 232, 0.14);
  --cyan-glow: 0 0 6px rgba(79, 209, 232, 0.8), 0 0 18px rgba(79, 209, 232, 0.35);
  --chrome: linear-gradient(180deg, #F6F8FA 0%, #C9D1D9 38%, #7D8794 50%, #E3E8ED 53%, #9AA4AF 78%, #D7DDE3 100%);
  --dot: rgba(79, 209, 232, 0.10);
  --shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
  --grain-opacity: 0.07;
  --f-led: "Doto", "JetBrains Mono", monospace;
  --f-body: "Instrument Sans", "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1320px;
  --delay: 300ms;
  color-scheme: dark;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #F2F4F7; --bg-2: #E9EDF2; --surface: #FFFFFF; --surface-2: #F6F8FA;
    --line: #D9DFE6; --line-2: #C3CCD6; --text: #0B0F14; --muted: #4F5B69; --faint: #7D8896;
    --cyan: #0B9DB8; --cyan-dim: rgba(11, 157, 184, 0.10);
    --cyan-glow: 0 0 5px rgba(11, 157, 184, 0.55);
    --chrome: linear-gradient(180deg, #2A323C 0%, #5B6672 45%, #11161C 52%, #3B4550 100%);
    --dot: rgba(11, 15, 20, 0.07); --shadow: 0 30px 60px -34px rgba(11, 15, 20, 0.35);
    --grain-opacity: 0.05; color-scheme: light;
  }
}
:root[data-theme="light"] {
  --bg: #F2F4F7; --bg-2: #E9EDF2; --surface: #FFFFFF; --surface-2: #F6F8FA;
  --line: #D9DFE6; --line-2: #C3CCD6; --text: #0B0F14; --muted: #4F5B69; --faint: #7D8896;
  --cyan: #0B9DB8; --cyan-dim: rgba(11, 157, 184, 0.10);
  --cyan-glow: 0 0 5px rgba(11, 157, 184, 0.55);
  --chrome: linear-gradient(180deg, #2A323C 0%, #5B6672 45%, #11161C 52%, #3B4550 100%);
  --dot: rgba(11, 15, 20, 0.07); --shadow: 0 30px 60px -34px rgba(11, 15, 20, 0.35);
  --grain-opacity: 0.05; color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 17px/1.6 var(--f-body); overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { /* film grain */
  content: ""; position: fixed; inset: -50%; z-index: 100; pointer-events: none;
  opacity: var(--grain-opacity);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain { 0%{transform:translate(0,0)} 33%{transform:translate(-3%,2%)} 66%{transform:translate(2%,-3%)} 100%{transform:translate(0,0)} }

a { color: inherit; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--cyan); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
::selection { background: var(--cyan); color: #04121A; }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 200; background: var(--cyan); color: #04121A; padding: 8px 12px; }
.skip:focus { left: 8px; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.mono { font-family: var(--f-mono); }
.led { font-family: var(--f-led); font-weight: 700; letter-spacing: 0.02em; }
.muted { color: var(--muted); }
.cyan { color: var(--cyan); }

/* ── header: the rail ─────────────────────────────── */
.rail {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.rail .wrap { display: flex; align-items: center; gap: 20px; height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .led { font-size: 26px; font-weight: 900; line-height: 1; }
.lamp {
  width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: var(--cyan-glow);
  animation: lamp 2.4s ease-in-out infinite; flex: none;
}
@keyframes lamp { 0%,100%{opacity:1} 50%{opacity:.35} }
.stations { display: flex; align-items: center; gap: 0; margin-left: auto; font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; }
.stations a { display: flex; align-items: center; text-decoration: none; color: var(--muted); padding: 8px 0; }
.stations a::before { content: ""; width: 22px; height: 1px; background: var(--line-2); margin: 0 8px; }
.stations a:first-child::before { display: none; }
.stations a span { display: inline-flex; align-items: center; gap: 7px; }
.stations a span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1px solid var(--line-2); }
.stations a:hover, .stations a[aria-current="page"] { color: var(--text); }
.stations a[aria-current="page"] span::before { background: var(--cyan); border-color: var(--cyan); box-shadow: var(--cyan-glow); }
.ping { font: 500 12px/1 var(--f-mono); color: var(--muted); white-space: nowrap; }
.ping b { color: var(--cyan); font-weight: 500; }
.theme-btn {
  background: none; border: 1px solid var(--line-2); color: var(--muted); border-radius: 999px;
  font: 500 11px/1 var(--f-mono); padding: 7px 10px; cursor: pointer; letter-spacing: .06em;
}
.theme-btn:hover { color: var(--text); border-color: var(--cyan); }
.menu-btn { display: none; }

@media (max-width: 980px) {
  .ping { display: none; }
  .menu-btn { display: inline-block; margin-left: auto; }
  .stations {
    position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px var(--gutter) 16px; display: none;
  }
  .stations.open { display: flex; }
  .stations a { padding: 12px 0; border-bottom: 1px dashed var(--line); }
  .stations a::before { display: none; }
}

/* ── echo: every big title has a ghost that arrives 300 ms late ── */
.echo { position: relative; display: inline-block; }
.echo > .t {
  background: var(--chrome); -webkit-background-clip: text; background-clip: text; color: transparent;
  position: relative; z-index: 1;
}
.echo::after {
  content: attr(data-text); position: absolute; inset: 0; z-index: 0; white-space: inherit;
  color: var(--cyan); opacity: 0; transform: translate(0.05em, 0.03em);
  animation: echo-in .6s var(--delay) cubic-bezier(.2,.7,.2,1) forwards;
}
.echo > .t { animation: title-in .6s cubic-bezier(.2,.7,.2,1) both; }
@keyframes title-in { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes echo-in { from { opacity: 0; transform: translate(0.12em, 0.08em); } to { opacity: .28; transform: translate(0.05em, 0.03em); } }
.echo:hover::after { transition: transform .3s var(--delay); transform: translate(0.09em, 0.05em); }

/* ── hero ─────────────────────────────────────────── */
.hero { padding: clamp(28px, 6vw, 72px) 0 40px; position: relative; }
.board {
  position: relative; overflow: hidden; border: 1px solid var(--line-2); border-radius: 6px;
  background-color: #05080B;
  background-image: radial-gradient(circle at center, rgba(79,209,232,.10) 1px, transparent 1.6px);
  background-size: 6px 6px; box-shadow: inset 0 0 40px rgba(0,0,0,.8), var(--shadow);
  padding: 14px 0;
}
:root[data-theme="light"] .board { background-color: #0B0F14; }
.board .row { display: flex; white-space: nowrap; font: 800 clamp(18px, 2.6vw, 26px)/1.2 var(--f-led); color: #4FD1E8; text-shadow: 0 0 8px rgba(79,209,232,.7); }
.board .row > span { padding-right: 3em; animation: marquee 32s linear infinite; }
.board .meta { display: flex; justify-content: space-between; gap: 12px; padding: 0 16px 8px; font: 500 11px/1 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; color: #6E8090; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: end; margin-top: clamp(28px, 5vw, 56px); }
.hero h1 { margin: 0; font: 900 clamp(110px, 21vw, 300px)/0.8 var(--f-led); letter-spacing: -0.02em; }
.hero .lede { font-size: clamp(19px, 2vw, 24px); line-height: 1.4; margin: 28px 0 0; max-width: 34ch; }
.hero .lede em { font-style: normal; color: var(--cyan); }
.hero .about { color: var(--muted); max-width: 58ch; margin: 18px 0 28px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  border: 1px solid var(--line-2); border-radius: 999px; padding: 11px 18px;
  font: 600 13px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; transition: border-color .2s, background .2s;
}
.btn:hover { border-color: var(--cyan); background: var(--cyan-dim); }
.btn.primary { background: var(--text); color: var(--bg); border-color: var(--text); }
.btn.primary:hover { background: var(--cyan); border-color: var(--cyan); color: #04121A; }

/* ── frames: images and placeholders ──────────────── */
.faces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.faces .frame:first-child { grid-column: span 2; grid-row: span 2; }
.frame {
  position: relative; display: block; overflow: hidden; border-radius: 4px; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line); aspect-ratio: 4 / 5;
}
.frame img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.03); transition: opacity .7s, transform 1.4s cubic-bezier(.2,.7,.2,1); }
.frame.arrived img { opacity: 1; transform: none; }
.frame:hover img { transform: scale(1.025); }
.frame .tags { position: absolute; left: 8px; right: 8px; bottom: 8px; display: flex; justify-content: space-between; gap: 6px; pointer-events: none; }
.tag {
  font: 500 11px/1 var(--f-mono); padding: 5px 7px; border-radius: 3px; white-space: nowrap;
  background: rgba(5, 8, 11, .72); color: #DCE4EC; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.tag b { color: #4FD1E8; font-weight: 500; }
@media (max-width: 640px) {
  .faces .frame:not(:first-child) .tags .tag:first-child, .faces .frame:not(:first-child) .cap { display: none; }
  .faces .frame:not(:first-child) .tags { justify-content: flex-end; }
  .nosignal small { display: none; }
}
.frame .cap { position: absolute; left: 10px; top: 10px; font: 500 11px/1.2 var(--f-mono); color: #DCE4EC; text-shadow: 0 1px 4px #000; letter-spacing: .04em; }

.nosignal {
  position: absolute; inset: 0; display: grid; place-items: center; text-align: center;
  background-color: #070A0E;
  background-image: radial-gradient(circle at center, rgba(79,209,232,.08) 1px, transparent 1.6px);
  background-size: 6px 6px; color: #6E8090;
}
.nosignal .led { font-size: clamp(14px, 1.6vw, 20px); color: #9FB0C0; }
.nosignal small { display: block; font: 500 10px/1.4 var(--f-mono); letter-spacing: .12em; text-transform: uppercase; margin-top: 8px; }
.ring { width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%; border: 2px solid rgba(79,209,232,.18); border-top-color: #4FD1E8; animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── sections ─────────────────────────────────────── */
section.block { padding: clamp(56px, 8vw, 110px) 0; border-top: 1px solid var(--line); position: relative; }
.kicker { display: flex; align-items: center; gap: 12px; font: 500 12px/1 var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.kicker::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: var(--cyan-glow); }
h2 { font: 900 clamp(40px, 6.4vw, 84px)/0.95 var(--f-led); margin: 0 0 24px; letter-spacing: -0.01em; }
h3 { font: 700 22px/1.2 var(--f-body); margin: 0 0 8px; }
.intro { color: var(--muted); max-width: 62ch; font-size: 18px; margin: 0 0 40px; }

/* constants */
.constants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.constant { display: grid; grid-template-columns: 56px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.constant:nth-child(odd) { padding-right: 32px; border-right: 1px solid var(--line); }
.constant:nth-child(even) { padding-left: 32px; }
.constant .n { font: 800 28px/1 var(--f-led); color: var(--cyan); }
.constant h3 { font-size: 17px; text-transform: uppercase; letter-spacing: .06em; font-family: var(--f-mono); font-weight: 600; }
.constant p { margin: 0; color: var(--muted); font-size: 16px; }

/* copy blocks */
.copy {
  position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 6px;
  margin: 16px 0 28px; overflow: hidden;
}
.copy .head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.copy pre { margin: 0; padding: 16px 18px 18px; font: 400 14px/1.65 var(--f-mono); white-space: pre-wrap; word-break: break-word; color: var(--text); }
.copy-btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: none; border: 1px solid var(--line-2); color: var(--text); border-radius: 999px;
  font: 600 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 7px 11px;
}
.copy-btn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--faint); transition: background .15s, box-shadow .15s; }
.copy-btn:hover { border-color: var(--cyan); }
.copy-btn.done::before { background: var(--cyan); box-shadow: var(--cyan-glow); }

/* departures: the film list */
.departures { border-top: 1px solid var(--line-2); }
.dep {
  display: grid; grid-template-columns: 92px minmax(0, 1.1fr) minmax(0, 1.4fr) 150px; gap: 24px; align-items: start;
  padding: 28px 0; border-bottom: 1px solid var(--line); text-decoration: none; position: relative;
}
.dep:hover { background: linear-gradient(90deg, var(--cyan-dim), transparent 70%); }
.dep .no { font: 800 15px/1.3 var(--f-led); color: var(--muted); }
.dep .no b { display: block; font-size: 34px; color: var(--text); }
.dep .ttl { font: 900 clamp(30px, 4vw, 52px)/0.95 var(--f-led); margin: 0 0 10px; }
.dep .tagline { font-style: italic; color: var(--cyan); margin: 0; }
.dep .premise { color: var(--muted); margin: 0 0 14px; font-size: 16px; }
.stats { display: grid; grid-template-columns: 64px 1fr; gap: 4px 12px; font: 400 12.5px/1.45 var(--f-mono); color: var(--muted); margin: 0; }
.stats dt { color: var(--text); text-transform: uppercase; letter-spacing: .06em; font-size: 11px; padding-top: 1px; }
.stats dd { margin: 0; }
.todo { color: var(--faint); border-bottom: 1px dotted var(--faint); }
.dep .side { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.delay { font: 800 26px/1 var(--f-led); color: var(--cyan); text-shadow: var(--cyan-glow); }
.status { font: 500 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; border: 1px solid var(--line-2); padding: 6px 8px; border-radius: 3px; color: var(--muted); }
.enter { font: 600 12px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 980px) {
  .dep { grid-template-columns: 1fr; gap: 12px; }
  .dep .side { text-align: left; align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* looks */
.looks { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.look { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.look .frame { border: 0; border-radius: 0; border-bottom: 1px solid var(--line); }
.look .body { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.look .film { font: 600 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.look h3 { font-size: 19px; margin: 0; }
.look p { margin: 0; font-size: 14px; color: var(--muted); }
.look .wardrobe { font: 400 12.5px/1.55 var(--f-mono); color: var(--text); background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 4px; padding: 10px; margin-top: auto; }
.look .copy-btn { align-self: flex-start; }
@media (max-width: 1100px) { .looks { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .looks { grid-template-columns: 1fr; } }

/* cards */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.card { background: var(--bg); padding: 22px 20px 24px; text-decoration: none; display: flex; flex-direction: column; gap: 10px; min-height: 210px; transition: background .2s; }
.card:hover { background: var(--surface); }
.card .n { font: 800 22px/1 var(--f-led); color: var(--cyan); }
.card h3 { font-size: 19px; margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.card .go { margin-top: auto; font: 600 11px/1 var(--f-mono); text-transform: uppercase; letter-spacing: .1em; display: flex; justify-content: space-between; }
.card .go [data-ping] { color: var(--faint); }
@media (max-width: 1100px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cards { grid-template-columns: 1fr; } }

/* agents terminal */
.terminal { background: #05080B; color: #CFE3EE; border: 1px solid var(--line-2); border-radius: 6px; overflow: hidden; box-shadow: var(--shadow); }
.terminal .bar { display: flex; gap: 6px; padding: 10px 12px; border-bottom: 1px solid #1B2430; }
.terminal .bar i { width: 9px; height: 9px; border-radius: 50%; background: #243040; }
.terminal .bar i:first-child { background: #4FD1E8; box-shadow: 0 0 8px rgba(79,209,232,.7); }
.terminal pre { margin: 0; padding: 18px; font: 400 13.5px/1.7 var(--f-mono); white-space: pre-wrap; word-break: break-all; }
.terminal .c { color: #5F7385; }
.endpoints { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.endpoint { border: 1px solid var(--line); border-radius: 6px; padding: 14px; text-decoration: none; background: var(--surface); }
.endpoint b { display: block; font: 700 14px/1.2 var(--f-mono); margin-bottom: 6px; }
.endpoint span { color: var(--muted); font-size: 14px; }
.endpoint:hover { border-color: var(--cyan); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .two, .hero-grid { grid-template-columns: 1fr; } .endpoints { grid-template-columns: 1fr; } }

/* shop */
.shop { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.shirt { text-decoration: none; display: flex; flex-direction: column; gap: 8px; }
.tee {
  aspect-ratio: 1; border-radius: 6px; display: grid; place-items: center; position: relative; overflow: hidden;
  background: radial-gradient(120% 90% at 50% 20%, #2A2F36, #15181C);
  border: 1px solid var(--line);
}
.tee.white { background: radial-gradient(120% 90% at 50% 20%, #FFFFFF, #DADFE4); }
.tee::before { /* a shirt silhouette */
  content: ""; position: absolute; inset: 14% 10% 6%;
  background: rgba(255,255,255,.035);
  clip-path: polygon(30% 0, 40% 6%, 60% 6%, 70% 0, 100% 16%, 90% 36%, 80% 30%, 80% 100%, 20% 100%, 20% 30%, 10% 36%, 0 16%);
}
.tee.white::before { background: rgba(0,0,0,.04); }
.tee pre { position: relative; margin: 0; font: 800 clamp(9px, 1vw, 12px)/1.25 var(--f-led); color: #4FD1E8; text-shadow: 0 0 6px rgba(79,209,232,.6); text-align: left; }
.tee.white pre { color: #0B0F14; text-shadow: none; }
.shirt b { font-size: 15px; }
.shirt span { font: 400 12px/1.3 var(--f-mono); color: var(--muted); }
@media (max-width: 1100px) { .shop { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 560px) { .shop { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ── article pages (wiki, film, character) ───────── */
.page-head { padding: clamp(36px, 6vw, 80px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.crumbs { font: 500 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 26px; }
.crumbs a { text-decoration: none; }
.crumbs i { width: 18px; height: 1px; background: var(--line-2); display: inline-block; }
.page-head h1 { margin: 0; font: 900 clamp(56px, 11vw, 150px)/0.85 var(--f-led); letter-spacing: -0.015em; }
.page-head .sub { font-size: clamp(18px, 2vw, 22px); color: var(--muted); max-width: 60ch; margin: 22px 0 0; }

.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding-top: clamp(36px, 5vw, 64px); padding-bottom: 96px; }
.toc { position: sticky; top: 84px; align-self: start; font: 500 13px/1.4 var(--f-mono); }
.toc a { display: block; padding: 7px 0 7px 14px; border-left: 1px solid var(--line); text-decoration: none; color: var(--muted); }
.toc a:hover, .toc a[aria-current="page"] { color: var(--text); border-left-color: var(--cyan); }
@media (max-width: 900px) { .layout { grid-template-columns: 1fr; } .toc { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; } .toc a { border-left: 0; padding: 4px 0; } }

.prose { max-width: 78ch; }
.layout section + section { margin-top: 64px; }
.prose h2 { font: 800 clamp(28px, 3.4vw, 40px)/1.05 var(--f-led); margin: 56px 0 16px; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 32px 0 8px; }
.prose p, .prose li { color: color-mix(in srgb, var(--text) 86%, var(--muted)); }
.prose li { margin: 6px 0; }
.prose ul { padding-left: 20px; }
.prose ul li::marker { color: var(--cyan); }
.prose ol { padding-left: 24px; }
.prose ol li::marker { font-family: var(--f-mono); color: var(--cyan); }
.prose code { font: 400 0.86em var(--f-mono); background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 3px; }
.prose strong { color: var(--text); }
.table-wrap { overflow-x: auto; margin: 20px 0 28px; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; vertical-align: top; padding: 11px 14px; border-bottom: 1px solid var(--line); }
th { font: 600 11px/1.2 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface); }
tr:last-child td { border-bottom: 0; }
td:first-child { white-space: nowrap; font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

.lyric { font: 400 15px/1.75 var(--f-mono); white-space: pre-wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 22px; }
.lyric .sec { color: var(--cyan); }
.pitch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; margin: 8px 0 32px; }
.pitch div { background: var(--bg); padding: 18px 20px; }
.pitch dt { font: 600 11px/1 var(--f-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); margin-bottom: 8px; }
.pitch dd { margin: 0; color: var(--text); }
@media (max-width: 700px) { .pitch { grid-template-columns: 1fr; } }

.player {
  aspect-ratio: 16 / 9; border: 1px solid var(--line-2); border-radius: 6px; position: relative; overflow: hidden; margin-top: 32px;
}
.player .nosignal .led { font-size: clamp(22px, 3vw, 40px); }

.image-page { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); padding: 40px 0 96px; align-items: start; }
.image-page .frame { aspect-ratio: auto; }
.image-page .frame img { height: auto; }
@media (max-width: 900px) { .image-page { grid-template-columns: 1fr; } }

.never { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 40px; }
.never li { break-inside: avoid; padding: 10px 0 10px 28px; border-bottom: 1px solid var(--line); position: relative; color: var(--muted); }
.never li::before { content: "×"; position: absolute; left: 4px; top: 8px; color: var(--cyan); font: 700 16px/1.2 var(--f-mono); }
@media (max-width: 700px) { .never { columns: 1; } .constants { grid-template-columns: 1fr; } .constant:nth-child(odd) { border-right: 0; padding-right: 0; } .constant:nth-child(even) { padding-left: 0; } }

.change { width: 100%; }
.change td { white-space: normal !important; font-family: var(--f-body) !important; font-size: 15px !important; color: var(--text) !important; }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; font: 400 13px/1.6 var(--f-mono); color: var(--muted); }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--text); }

/* reveal on scroll */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--delay), transform .7s var(--delay) cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .frame img { opacity: 1 !important; transform: none !important; }
  .echo::after { opacity: .28; }
}

/* reference sheets */
.sheets { display: grid; grid-template-columns: 1.6fr 1fr; gap: 18px; margin-top: 18px; }
.sheet { margin: 0; display: flex; flex-direction: column; gap: 10px; }
.sheet > a { display: block; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: var(--surface); }
.sheet img { display: block; width: 100%; height: auto; }
.sheet .frame { aspect-ratio: 16 / 9; }
.sheet figcaption { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
.sheet figcaption b { color: var(--text); margin-right: 4px; }
.sheet figcaption a { font: 600 12px/1 var(--f-mono); letter-spacing: .06em; margin-left: 4px; }
@media (max-width: 900px) { .sheets { grid-template-columns: 1fr; } }

/* gallery: search the prompts, filter by film */
.gallery-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.gallery-search {
  flex: 1 1 280px; min-width: 0; font: 500 15px/1 var(--f-mono); color: var(--text);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 6px; padding: 13px 14px;
}
.gallery-search:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 3px var(--cyan-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: 600 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
  color: var(--muted); background: transparent; border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 12px;
}
.chip:hover { color: var(--text); border-color: var(--cyan); }
.chip[aria-pressed="true"] { color: var(--bg); background: var(--text); border-color: var(--text); }
.gallery-count { font-size: 12px; letter-spacing: .06em; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.g-item[hidden] { display: none; }
@media (max-width: 640px) { .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
