/* Layout: full-bleed bands that switch ground (black-green, paper, lime).
   A 3D replay chart carries the hero; dot-matrix type for names and numbers,
   mono for everything else. One deliberate look, dark first. */
:root {
  --void: #070a08;
  --void-2: #0b100d;
  --panel: #101713;
  --panel-2: #172019;
  --line: #27332b;
  --line-soft: #19221c;
  --fg: #eef2e8;
  --fg-soft: #a6b0a2;
  --fg-dim: #879284;

  --lime: #c3f53c;
  --lime-soft: #dcfb8e;
  --lime-ink: #0b1206;
  --down: #ff8d7b;
  --down-ink: #2a0b06;

  --paper: #eef0e6;
  --paper-ink: #0e140f;
  --paper-soft: #5b6559;
  --paper-rule: #c2c8b7;
  --paper-shadow: rgba(0, 0, 0, 0.55);

  --logo-bg: #c3f53c;
  --logo-paper: #0b1206;
  --logo-slot: #0b1206;
  --logo-line: #c3f53c;

  --font-pixel: "Bitcount Grid Double", "Doto", ui-monospace, monospace;
  --font-pixel-sm: "Bitcount Prop Single", "Doto", ui-monospace, monospace;
  --font-mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --gutter: clamp(16px, 3.2vw, 40px);
  --r: 2px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--void);
  color: var(--fg);
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  line-height: 1.6;
}

h1, h2, h3, p { margin: 0; }
h1, h2 { font-family: var(--font-pixel); font-weight: 300; line-height: 0.98; letter-spacing: -0.01em; text-wrap: balance; }
h2 { font-size: clamp(2.75rem, 7vw, 5.5rem); }
h3 { font-size: 1rem; font-weight: 600; }

a { color: inherit; text-underline-offset: 0.22em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }
.on-light :focus-visible, .on-lime :focus-visible { outline-color: var(--paper-ink); }

.wrap {
  max-width: 1320px; margin-inline: auto;
  padding-left: max(var(--gutter), env(safe-area-inset-left, 0px));
  padding-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 30; background: var(--lime); color: var(--lime-ink); padding: 8px 14px; }
.skip:focus { top: 12px; }

/* ---------- shared pieces ---------- */

.label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-soft);
}
.pip { display: inline-block; width: 7px; height: 7px; background: var(--lime); flex: none; }
.on-light .label, .on-lime .label { color: var(--paper-soft); }
.on-light .pip, .on-lime .pip { background: var(--paper-ink); }

/* The lime block that closes every heading: a cursor sitting in the slot. */
.cursor { display: inline-block; width: 0.34em; height: 0.34em; margin-left: 0.08em; background: var(--lime); vertical-align: baseline; }
.on-light .cursor, .on-lime .cursor { background: var(--paper-ink); }

.logo { display: block; flex: none; }
.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.125rem; letter-spacing: 0.02em; text-transform: uppercase; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6em;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--fg-dim); border-radius: var(--r);
  background: transparent; color: var(--fg);
  font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; text-decoration: none;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--fg); background: rgba(255, 255, 255, 0.06); }
.btn-lime { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
.btn-lime:hover { background: var(--lime-soft); border-color: var(--lime-soft); }
.btn-small { min-height: 36px; padding: 0 12px; font-size: 0.75rem; }
.on-light .btn, .on-lime .btn { border-color: var(--paper-ink); color: var(--paper-ink); }
.on-light .btn:hover, .on-lime .btn:hover { background: var(--paper-ink); color: var(--paper); }
.btn-group { display: inline-flex; }
.btn-group .btn + .btn { margin-left: -1px; }

.badge { display: inline-block; padding: 2px 9px; border: 1px solid var(--line); border-radius: 99px; font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-soft); white-space: nowrap; }

mark.hi { padding: 0.08em 0.4em; border-radius: 2px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
mark.hi.up { background: var(--lime); color: var(--lime-ink); }
mark.hi.down { background: var(--down); color: var(--down-ink); }
.unscored { color: var(--fg-dim); font-size: 0.8125rem; white-space: nowrap; }

.avatar { display: inline-grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; color: #0e140f; font-weight: 700; font-size: 0.875rem; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 99px; background: transparent; color: var(--fg-soft); cursor: pointer; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.chip:hover { border-color: var(--fg-soft); color: var(--fg); }
.chip[aria-pressed="true"] { background: var(--lime); border-color: var(--lime); color: var(--lime-ink); font-weight: 600; }
.chip span { opacity: 0.7; margin-left: 6px; }

.spark { display: block; }
.spark path { fill: none; stroke-width: 1.6; stroke-linejoin: round; }
.spark.up path { stroke: var(--lime); }
.spark.down path { stroke: var(--down); }

/* ---------- the receipt: paper on a dark ground ---------- */

.receipt {
  --s: 7px;
  --logo-bg: var(--paper-ink); --logo-paper: var(--paper); --logo-slot: var(--paper-soft); --logo-line: #9bcf1f;
  position: relative;
  background: var(--paper); color: var(--paper-ink);
  padding: 22px 20px 26px;
  font-family: var(--font-mono); font-size: 0.75rem; line-height: 1.55; font-variant-numeric: tabular-nums;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--s)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--s)) 100%;
}
.receipt a { color: inherit; }
.receipt .logo { margin-bottom: 6px; }
.receipt :focus-visible { outline-color: var(--paper-ink); }
.r-head { display: grid; justify-items: center; text-align: center; gap: 1px; }
.r-head strong { font-family: var(--font-pixel-sm); font-size: 1.625rem; font-weight: 500; line-height: 1; text-transform: uppercase; }
.r-head span { color: var(--paper-soft); }
.r-rule { border: 0; border-top: 1px dashed var(--paper-rule); margin: 12px 0; }
.r-post { display: grid; gap: 4px; }
.r-post p { font-size: 0.8125rem; line-height: 1.5; }
.r-post span { color: var(--paper-soft); }
.r-post .r-handle { color: var(--paper-ink); font-weight: 700; }
.r-post a { justify-self: start; text-decoration: underline; font-weight: 600; }
.r-post p { white-space: pre-line; }
.r-note { line-height: 1.5; }
.r-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 1.5px 0; }
.r-row span:last-child { text-align: right; white-space: nowrap; }
.r-row.r-sub { color: var(--paper-soft); padding-left: 12px; }
.r-row.r-pair { font-weight: 700; }
.r-row.r-total { font-size: 1.0625rem; font-weight: 700; padding: 3px 0; }
.r-note { margin-top: 8px; padding: 6px 8px; border: 1px dashed var(--paper-ink); }
.r-void { display: grid; gap: 6px; padding: 10px 0; }
.r-void strong { font-size: 1.0625rem; }
.r-void p { font-size: 0.8125rem; line-height: 1.5; }

.chart svg { display: block; width: 100%; height: auto; margin-top: 6px; }
.c-label { font-family: var(--font-mono); font-size: 9.5px; fill: var(--paper-soft); }
.c-base { stroke: var(--paper-soft); stroke-width: 1; stroke-dasharray: 2 4; }
.c-ghost { stroke: var(--paper-rule); stroke-width: 1.5; }
.c-ink { stroke: var(--paper-ink); stroke-width: 2; stroke-linejoin: round; }
.c-cursor { stroke: var(--paper-ink); stroke-width: 1; opacity: 0.35; }
.c-dot { fill: var(--lime); stroke: var(--paper-ink); stroke-width: 2; }

.r-scrub, .scrub { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; }
.r-scrub { margin-top: 4px; }
.r-play { min-width: 58px; min-height: 30px; padding: 0 8px; border: 1.5px solid var(--paper-ink); border-radius: 2px; background: transparent; color: var(--paper-ink); font-family: var(--font-mono); font-size: 0.6875rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; cursor: pointer; }
.r-play:hover { background: var(--paper-ink); color: var(--paper); }
.r-scrub input[type="range"] { width: 100%; min-width: 0; accent-color: var(--paper-ink); }
.r-scrub output { min-width: 11ch; text-align: right; white-space: pre; font-weight: 700; }
.r-foot { display: grid; justify-items: center; gap: 6px; color: var(--paper-soft); text-align: center; }
.r-barcode { display: flex; height: 26px; }
.r-barcode i { display: block; height: 100%; background: var(--paper-ink); }

/* ---------- hero ---------- */

.pass-stage { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 50% 40%, #0e1711 0%, var(--void) 70%); }
.hero-grid { position: absolute; inset: 0 0 auto 0; width: 100%; height: min(100%, 100svh); pointer-events: none; }
.pass-glow { position: absolute; inset: auto 0 0 0; height: 60%; pointer-events: none; opacity: 0; background: radial-gradient(60% 70% at 50% 100%, rgba(120, 190, 60, 0.22), transparent 70%); }
.mast-wrap, .hero-layer, .wall-layer { position: relative; }
.mast-wrap { z-index: 30; }

.masthead { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding-block: 20px; }
.masthead nav { display: flex; align-items: center; gap: 26px; margin-left: auto; }
.masthead nav a:not(.btn) { font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; text-decoration: none; color: var(--fg-soft); }
.masthead nav a:not(.btn):hover { color: var(--fg); text-decoration: underline; }

.hero-body {
  display: grid; grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: clamp(20px, 3vw, 48px); align-items: center;
  padding-block: clamp(20px, 4vw, 48px) clamp(28px, 4vw, 56px);
}
.hero-copy { display: grid; gap: 22px; justify-items: start; min-width: 0; }
.hero-copy h1 { font-size: clamp(3rem, 6.6vw, 6.25rem); }
.lede { max-width: 31em; color: var(--fg-soft); font-size: 1rem; }
.lede strong { color: var(--lime); font-weight: 500; }

.lookup { display: grid; gap: 8px; width: 100%; max-width: 30rem; }
.lookup-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
.lookup input {
  min-width: 0; min-height: 48px; padding: 0 14px;
  border: 1px solid var(--fg-dim); border-right: 0; border-radius: var(--r) 0 0 var(--r);
  background: rgba(7, 10, 8, 0.7); color: var(--fg);
  font-family: var(--font-mono); font-size: 0.875rem;
}
.lookup input::placeholder { color: var(--fg-dim); }
.lookup input:focus-visible { outline-offset: -2px; }
.lookup .btn { min-height: 48px; border-radius: 0 var(--r) var(--r) 0; }
.lookup-msg { min-height: 1.6em; font-size: 0.8125rem; color: var(--fg-soft); }
.lookup-msg button { border: 0; padding: 0; background: none; color: var(--lime); text-decoration: underline; text-underline-offset: 0.22em; cursor: pointer; }

.stage { min-width: 0; display: grid; gap: 10px; }
.stage-head { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 0; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-soft); }
.stage-head span + span { margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--line); }
.stage-head span:first-child { color: var(--lime); }
.stage canvas { display: block; width: 100%; aspect-ratio: 16 / 11; max-width: 100%; touch-action: pan-y; cursor: ew-resize; }
.stage-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px 14px; }
.scrub { flex: 1 1 260px; max-width: 420px; padding: 8px 12px; border: 1px solid var(--line); background: rgba(7, 10, 8, 0.75); }
.scrub button { min-width: 62px; min-height: 30px; border: 0; background: transparent; color: var(--lime); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; cursor: pointer; text-align: left; }
.scrub input[type="range"] { width: 100%; min-width: 0; accent-color: var(--lime); }
.scrub output { min-width: 12ch; text-align: right; white-space: pre; font-variant-numeric: tabular-nums; font-size: 0.8125rem; }

.hero-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 20px; padding-block: 16px 22px; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-soft); }
.hero-foot a { text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.hero-foot a:hover { color: var(--fg); }

/* ---------- bands ---------- */

.band > .wrap { padding-block: clamp(56px, 8vw, 112px); }
.band-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin-bottom: clamp(24px, 4vw, 44px); }
.band-head > div { display: grid; gap: 14px; }
.band-head .count { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-soft); }

/* ---------- call wall: a coverflow of posts ---------- */

.wall-layer { border-top: 1px solid var(--line-soft); --dock: 1; }
.wall-layer > .wrap { padding-block: clamp(48px, 7vw, 88px); }
.flow { position: relative; height: 332px; perspective: 1500px; margin-inline: calc(-1 * var(--gutter)); }
.flow-track { position: absolute; inset: 0; transform-style: preserve-3d; list-style: none; margin: 0; padding: 0; }
.flow-card {
  --w: min(440px, calc(100vw - 56px));
  position: absolute; left: 50%; top: 14px; width: var(--w); height: 304px; margin-left: calc(var(--w) / -2);
  transition: transform 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.4s, filter 0.4s;
}
@media (prefers-reduced-motion: reduce) { .flow-card { transition: none; } }
.post {
  display: grid; grid-template-rows: auto 1fr auto; gap: 14px;
  width: 100%; height: 100%; padding: 18px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel);
  color: var(--fg); text-align: left; cursor: pointer;
}
.flow-card.is-active .post { border-color: var(--lime); background: var(--panel-2); }
.post-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.post-who div { display: grid; min-width: 0; line-height: 1.3; }
.post-who strong { font-size: 0.875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-who span { font-size: 0.75rem; color: var(--fg-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-text { font-size: 1rem; line-height: 1.5; overflow: hidden; }
.post-replay { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--void); font-size: 0.75rem; }
.post-replay .pair { display: grid; line-height: 1.35; }
.post-replay .pair span { color: var(--fg-dim); }
.post-replay .spark { width: 100%; height: 34px; }
.post-replay .why { grid-column: 2 / -1; color: var(--fg-soft); line-height: 1.4; }

/* Corner brackets around the post in focus. */
.flow-frame { position: absolute; left: 50%; top: 4px; width: calc(min(440px, 100vw - 56px) + 20px); height: 324px; transform: translateX(-50%); pointer-events: none; z-index: 20; }
.flow-frame::before, .flow-frame::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--lime); }
.flow-frame::before { clip-path: polygon(0 0, 14px 0, 14px 14px, 0 14px, 0 calc(100% - 14px), 14px calc(100% - 14px), 14px 100%, 0 100%); }
.flow-frame::after { clip-path: polygon(100% 0, calc(100% - 14px) 0, calc(100% - 14px) 14px, 100% 14px, 100% calc(100% - 14px), calc(100% - 14px) calc(100% - 14px), calc(100% - 14px) 100%, 100% 100%); }

.flow-caption { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 18px 28px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.flow-now { display: grid; gap: 6px; min-width: 0; }
.flow-now .state { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime); }
.flow-now .state.down { color: var(--down); }
.flow-now .state.unscored { color: var(--fg-soft); }
.flow-now strong { font-family: var(--font-pixel-sm); font-size: 2.5rem; font-weight: 500; line-height: 1; }
.flow-now span { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-soft); }
.flow-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.flow-scrub { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 16px; margin-top: 22px; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-soft); }
.ticks { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: repeating-linear-gradient(90deg, var(--fg-dim) 0 1px, transparent 1px calc(100% / max(var(--n, 24) - 1, 1))) 0 100% / 100% 9px no-repeat, linear-gradient(var(--line), var(--line)) 0 100% / 100% 1px no-repeat; cursor: pointer; }
.ticks::-webkit-slider-thumb { -webkit-appearance: none; width: 8px; height: 20px; background: var(--lime); border: 0; border-radius: 0; }
.ticks::-moz-range-thumb { width: 8px; height: 20px; background: var(--lime); border: 0; border-radius: 0; }
.ticks::-moz-range-track { background: transparent; }
.wall-filters { margin-bottom: 22px; }

/* ---------- replay index: paper ground ---------- */

.index { background: var(--paper); color: var(--paper-ink); }
.index-stage > .wrap { padding-block: clamp(56px, 8vw, 112px); }
.plates { position: relative; min-width: 0; }
.plates .plate:not(.is-picked) { display: none; }
.index-grid { display: grid; grid-template-columns: minmax(0, 0.7fr) minmax(0, 1.6fr) minmax(0, 0.7fr); gap: clamp(20px, 4vw, 56px); align-items: center; }
.index-nav { display: grid; gap: 18px; align-content: center; }
.index-nav h2 { font-size: clamp(2rem, 3.4vw, 3rem); }
.index-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.index-list button { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; width: 100%; padding: 10px 0; border: 0; background: none; color: var(--paper-soft); text-align: left; cursor: pointer; font-size: 0.8125rem; letter-spacing: 0.08em; text-transform: uppercase; }
.index-list button i { font-style: normal; }
.index-list button small { grid-column: 2; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: none; }
.index-list button:hover, .index-list button[aria-pressed="true"] { color: var(--paper-ink); }
.index-list button[aria-pressed="true"] { font-weight: 700; }
.index-list button[aria-pressed="true"] i::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 8px; background: var(--paper-ink); }

.plate {
  --paper-soft: #33400f; --paper-rule: rgba(11, 18, 6, 0.22); --paper-ink: #0b1206;
  position: relative; display: grid; gap: 14px; min-width: 0;
  padding: clamp(18px, 3vw, 34px);
  background: radial-gradient(rgba(11, 18, 6, 0.16) 1px, transparent 1.4px) 0 0 / 7px 7px, var(--lime);
  color: var(--lime-ink);
  clip-path: polygon(0 18px, 18px 0, calc(50% - 60px) 0, calc(50% - 48px) 10px, calc(50% + 48px) 10px, calc(50% + 60px) 0, calc(100% - 18px) 0, 100% 18px, 100% calc(100% - 18px), calc(100% - 18px) 100%, 18px 100%, 0 calc(100% - 18px));
}
.plate.down { background: radial-gradient(rgba(42, 11, 6, 0.16) 1px, transparent 1.4px) 0 0 / 7px 7px, var(--down); --paper-soft: #5a1d12; }
.plate-top, .plate-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; }
.plate-top { padding-top: 8px; }
.plate-name { justify-self: start; padding: 4px 14px 8px; background: var(--lime-ink); color: var(--lime); font-family: var(--font-pixel); font-size: clamp(2.5rem, 6vw, 5rem); font-weight: 400; line-height: 1; }
.plate.down .plate-name { color: var(--down); }
.plate .chart svg { margin: 0; }
.plate .c-ink { stroke-width: 2.4; }
.plate .c-dot { fill: var(--lime-ink); }
.plate-chip { padding: 4px 10px; background: var(--lime-ink); color: var(--paper); }
.plate .btn { background: var(--paper); border-color: var(--lime-ink); color: var(--lime-ink); border-radius: 99px; }
.plate .btn:hover { background: var(--lime-ink); color: var(--paper); }

.index-stats { display: grid; gap: 22px; align-content: center; }
.index-stats div { display: grid; gap: 2px; }
.index-stats dt { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--paper-soft); }
.index-stats dd { margin: 0; font-size: 0.875rem; }
.index-stats dl { margin: 0; display: grid; gap: 22px; }
.index-stats .big { font-family: var(--font-mono); font-size: clamp(2rem, 3.4vw, 2.75rem); font-weight: 500; line-height: 1.1; letter-spacing: -0.03em; }

/* ---------- method ---------- */

.method { background: var(--void); }
.method-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.method-left { display: grid; gap: 26px; }
.timeline { width: 100%; height: auto; border: 1px solid var(--line-soft); background: linear-gradient(var(--line-soft) 1px, transparent 1px) 0 0 / 100% 25%, linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 12.5% 100%; }
.timeline text { font-family: var(--font-mono); font-size: 10px; fill: var(--fg-soft); letter-spacing: 0.06em; }
.timeline .tl { opacity: 0.42; transition: opacity 0.3s; }
.timeline[data-step="1"] .s1, .timeline[data-step="2"] .s2, .timeline[data-step="3"] .s3 { opacity: 1; }
.timeline .ln { stroke: var(--fg-soft); stroke-width: 1; fill: none; }
.timeline .lime { stroke: var(--lime); stroke-width: 1.8; fill: none; }
.timeline .node { fill: var(--void); stroke: var(--lime); stroke-width: 1.5; }
.timeline .tag { fill: var(--lime); }

.method-intro { font-size: clamp(1.0625rem, 1.7vw, 1.3125rem); line-height: 1.5; margin-bottom: 30px; }
.method-intro strong { color: var(--lime); font-weight: 500; }
.steps { border-top: 1px solid var(--line); }
.steps details { border-bottom: 1px solid var(--line); }
.steps summary { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 20px 4px; cursor: pointer; list-style: none; font-size: 1rem; }
.steps summary::-webkit-details-marker { display: none; }
.steps summary i { font-style: normal; font-size: 0.75rem; color: var(--fg-dim); }
.steps summary::after { content: "+"; color: var(--lime); font-size: 1.25rem; line-height: 1; }
.steps details[open] summary::after { content: "\2212"; }
.steps details p { padding: 0 4px 22px 38px; color: var(--fg-soft); max-width: 44em; }
.method-notes { display: grid; gap: 10px; margin-top: 28px; color: var(--fg-soft); font-size: 0.875rem; max-width: 46em; }
.method-notes strong { color: var(--fg); font-weight: 500; }

/* ---------- commands: lime ground ---------- */

.commands { background: radial-gradient(rgba(11, 18, 6, 0.14) 1px, transparent 1.4px) 0 0 / 6px 6px, #cdf06a; color: var(--lime-ink); --paper-soft: #33400f; --paper-ink: #0b1206; }
.commands-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.commands-left { display: grid; gap: 22px; }
.commands-left p:not(.label) { max-width: 30em; font-size: 1rem; }
.console { display: grid; gap: 22px; padding: clamp(20px, 3vw, 40px); background: var(--void); color: var(--fg); box-shadow: 8px 8px 0 rgba(11, 18, 6, 0.22); }
.console :focus-visible { outline-color: var(--lime); }
.console .label { color: var(--fg-soft); }
.console .pip { background: var(--lime); }
.console .btn { border-color: var(--fg-dim); color: var(--fg); }
.console .btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--fg); color: var(--fg); }
.console-tabs { display: flex; flex-wrap: wrap; gap: 4px 22px; border-bottom: 1px solid var(--line); }
.console-tabs button { padding: 8px 0 10px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; color: var(--fg-dim); cursor: pointer; font-size: 0.875rem; }
.console-tabs button:hover { color: var(--fg); }
.console-tabs button[aria-pressed="true"] { color: var(--lime); border-bottom-color: var(--lime); }
.console code { display: block; font-family: var(--font-pixel-sm); font-size: clamp(1.375rem, 2.6vw, 2rem); font-weight: 500; line-height: 1.15; color: var(--lime); overflow-wrap: anywhere; }
.console-what { color: var(--fg-soft); max-width: 36em; }
.reply { display: grid; gap: 6px; padding: 14px 16px; border-left: 2px solid var(--lime); background: var(--panel); font-size: 0.8125rem; }
.reply span { font-size: 0.6875rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); }
.console-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.console-foot p { font-size: 0.8125rem; color: var(--fg-soft); }

/* ---------- token ---------- */

.token { background: var(--void-2); border-top: 1px solid var(--line-soft); }
.token-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 22px; }
.token-row code { font-family: var(--font-mono); font-size: 0.875rem; overflow-wrap: anywhere; padding: 11px 14px; border: 1px solid var(--line); background: var(--panel); }

/* ---------- footer ---------- */

.site-foot { background: var(--void); border-top: 1px solid var(--line-soft); }
.site-foot > .wrap { display: grid; gap: clamp(28px, 5vw, 56px); padding-block: clamp(40px, 6vw, 72px) 36px; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.6fr)); gap: 28px; }
.foot-cta { display: grid; gap: 14px; justify-items: start; align-content: start; }
.foot-cta a.big { font-size: clamp(1.375rem, 2.6vw, 2rem); font-weight: 600; letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 12px; }
.foot-cta a.big:hover { color: var(--lime); }
.foot-cta a.big i { display: inline-grid; place-items: center; padding: 0.3em 0.45em; background: var(--lime); color: var(--lime-ink); font-style: normal; font-size: 0.6em; line-height: 1; letter-spacing: 0; border-radius: 3px; }
.foot-cta p { color: var(--fg-soft); max-width: 30em; }
.foot-col { display: grid; gap: 10px; align-content: start; }
.foot-col h3 { font-size: 0.75rem; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-dim); margin-bottom: 4px; }
.foot-col a { text-decoration: none; color: var(--fg-soft); }
.foot-col a:hover { color: var(--fg); text-decoration: underline; }
.foot-mark .cursor { margin-left: -0.04em; }
.foot-mark { font-family: var(--font-pixel); font-weight: 300; font-size: clamp(3.5rem, 15.5vw, 13.5rem); line-height: 0.9; letter-spacing: -0.02em; white-space: nowrap; }
.foot-legal { display: grid; gap: 6px; padding-top: 18px; border-top: 1px solid var(--line-soft); font-size: 0.75rem; color: var(--fg-dim); max-width: 70em; }

/* ---------- receipt dialog ---------- */

.receipt-dialog { width: min(410px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: 0; border: 0; background: transparent; color: var(--fg); overflow: visible; }
.receipt-dialog::backdrop { background: rgba(4, 6, 5, 0.82); }
.dialog-scroll { max-height: calc(100dvh - 24px); overflow-y: auto; padding-bottom: 20px; }
.dialog-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 10px; }
.dialog-bar .btn { background: var(--void); }

/* ---------- small screens ---------- */

@media (max-width: 980px) {
  .hero-body { grid-template-columns: minmax(0, 1fr); }
  .index-grid { grid-template-columns: minmax(0, 1fr); }
  .method-grid, .commands-grid { grid-template-columns: minmax(0, 1fr); }
  .foot-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-cta { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .masthead nav a:not(.btn) { display: none; }
  .masthead .badge { order: 3; }
  .flow-caption { align-items: start; }
  .stage canvas { aspect-ratio: 4 / 3.4; }
  .steps details p { padding-left: 4px; }
}

/* ============================================================
   Motion
   ============================================================ */

.flight-cap { display: none; }
.shuttle { display: inline-block; width: 9px; height: 14px; background: repeating-linear-gradient(to bottom, var(--lime) 0 1px, transparent 1px 4px); }

@keyframes scan-in { from { clip-path: inset(-10px 100% -10px -10px); } to { clip-path: inset(-10px); } }
@keyframes lock-in { from { clip-path: inset(-10px 100% -10px -10px); filter: blur(2px); } to { clip-path: inset(-10px); filter: blur(0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes bob { 50% { transform: translateY(3px); opacity: 0.55; } }
@keyframes print { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 -40px 0); } }
@keyframes unprint { from { clip-path: inset(0 0 -40px 0); opacity: 1; } to { clip-path: inset(0 0 100% 0); opacity: 0.4; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes swap { from { opacity: 0.15; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: no-preference) {
  /* Hero: each piece locks in from the left, in order; the headline scans in like a dot display. */
  .lock { animation: lock-in 0.8s cubic-bezier(0.18, 0.66, 0.17, 1) backwards; animation-delay: calc(var(--i, 0) * 80ms + 80ms); }
  .lock.scan { animation: scan-in 0.9s steps(22, end) backwards; animation-delay: 160ms; }
  .hero-copy h1 .cursor { animation: blink 0.5s steps(1) 1.1s 4; }
  .shuttle { animation: bob 1.8s ease-in-out infinite; }

  /* Later sections: headings scan in, the rest rises, once, when they come into view. */
  .js .reveal h2 { clip-path: inset(-10px 100% -10px -10px); }
  .js .reveal.in-view h2 { animation: scan-in 0.8s steps(18, end) both; }
  .js .reveal.in-view h2 .cursor { animation: blink 0.5s steps(1) 0.85s 3; }
  .js .reveal .rise { opacity: 0.2; transform: translateY(30px); transition: opacity 0.8s cubic-bezier(0.16, 0.75, 0.25, 1), transform 0.8s cubic-bezier(0.16, 0.75, 0.25, 1); transition-delay: calc(var(--i, 0) * 90ms); }
  .js .reveal.in-view .rise { opacity: 1; transform: none; }

  /* The receipt prints out of the top of the dialog. */
  .receipt-dialog[open] #dialog-receipt { animation: print 0.5s steps(14, end) both; }
  .receipt-dialog[open] .dialog-bar { animation: fade 0.3s 0.15s both; }
  .receipt-dialog[open]::backdrop { animation: fade 0.25s both; }
  .receipt-dialog.closing #dialog-receipt { animation: unprint 0.2s steps(8, end) both; }
  .receipt-dialog.closing .dialog-bar { animation: fade 0.15s reverse both; }

  .index-stats.swap dl > div { animation: swap 0.45s cubic-bezier(0.16, 0.75, 0.25, 1) both; }
  .index-stats.swap dl > div:nth-child(2) { animation-delay: 50ms; }
  .index-stats.swap dl > div:nth-child(3) { animation-delay: 100ms; }
  .index-stats.swap dl > div:nth-child(4) { animation-delay: 150ms; }

  .flow-card.is-active .spark path { stroke-dasharray: 1; animation: draw 0.9s 0.15s ease-out both; }
  .console code.typed { animation: scan-in 0.45s steps(16, end) both; }
  .timeline .pulse { filter: drop-shadow(0 0 5px var(--lime)); }
}
.timeline .pulse { fill: var(--lime); }
.timeline .lime.dim { opacity: 0.3; }
.flow.is-scrolling .flow-card { transition: none; }

/* ---------- the scroll scene (wide screens, motion allowed) ---------- */

html.cinema .pass { height: 440svh; }
html.cinema .pass-stage { position: sticky; top: 0; height: 100svh; }
html.cinema .hero-grid { height: 100%; }
html.cinema .mast-wrap { position: absolute; inset: 0 0 auto 0; }
html.cinema .hero-layer, html.cinema .wall-layer { position: absolute; inset: 0; display: flex; flex-direction: column; padding-top: 76px; }
html.cinema .hero-layer .hero-body { flex: 1; align-content: center; padding-block: 0; width: 100%; }
html.cinema .hero-layer .hero-foot { width: 100%; }
html.cinema #hero-figure { transform-origin: 50% 60%; will-change: transform, opacity; }
html.cinema .wall-layer { justify-content: center; border-top: 0; pointer-events: none; }
html.cinema .wall-layer.is-docked { pointer-events: auto; }
html.cinema .wall-layer > .wrap { width: 100%; padding-block: 0 18px; }
html.cinema .wall-layer .band-head { margin-bottom: 14px; }
html.cinema .wall-layer h2 { font-size: clamp(2.5rem, 4.6vw, 4.25rem); }
html.cinema .wall-filters { margin-bottom: 8px; }
html.cinema .flow-caption { margin-top: 12px; padding-top: 16px; }
html.cinema .flow-scrub { margin-top: 12px; }
html.cinema .wall-chrome { opacity: var(--dock); transform: translateY(calc((1 - var(--dock)) * 26px)); }
html.cinema .flow-frame.wall-chrome { transform: translateX(-50%) scale(calc(1.12 - var(--dock) * 0.12)); }
html.cinema .flow-card { will-change: transform, opacity; }

html.cinema .flight-cap {
  display: grid; gap: 8px; justify-items: start; position: absolute; top: 50%; z-index: 5; opacity: 0;
  transform: translateY(-50%); pointer-events: none; max-width: 22vw;
}
html.cinema .flight-cap.left { left: max(var(--gutter), env(safe-area-inset-left, 0px)); }
html.cinema .flight-cap.right { right: max(var(--gutter), env(safe-area-inset-right, 0px)); justify-items: end; text-align: right; }
.flight-cap .state { font-size: 0.75rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--lime); }
.flight-cap .state.down { color: var(--down); }
.flight-cap .state.unscored { color: var(--fg-soft); }
.flight-cap strong { font-family: var(--font-pixel-sm); font-size: clamp(2.5rem, 4.4vw, 4rem); font-weight: 500; line-height: 1; }
.flight-cap span { font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--fg-soft); }
.flight-cap mark.hi { font-size: 1.125rem; }

/* ---------- the plate drum ---------- */

html.cinema .index { height: 300svh; }
html.cinema .index-stage { position: sticky; top: 0; height: 100svh; display: grid; align-items: center; overflow: hidden; }
html.cinema .index-stage > .wrap { width: 100%; padding-block: 0; }
html.cinema .plates { height: min(66svh, 540px); perspective: 1300px; }
html.cinema .plates .plate, html.cinema .plates .plate:not(.is-picked) { display: grid; grid-template-rows: auto auto minmax(0, 1fr) auto; position: absolute; inset: 0; will-change: transform, opacity; backface-visibility: hidden; }
html.cinema .plate-chart { min-height: 0; display: grid; align-items: center; }
html.cinema .plate .chart, html.cinema .plate .chart svg { height: 100%; max-height: 100%; }
