/* antimemes.is: ops console for memetics. Tokens first. */
@font-face { font-family: "Anton"; src: url("../fonts/Anton-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Cond"; src: url("../fonts/IBMPlexSansCondensed-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Cond"; src: url("../fonts/IBMPlexSansCondensed-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Cond"; src: url("../fonts/IBMPlexSansCondensed-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/Newsreader.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Newsreader"; src: url("../fonts/Newsreader-Italic.woff2") format("woff2"); font-weight: 200 800; font-style: italic; font-display: swap; }

:root {
  /* ground: Gotham slate, not black */
  --ground: #121820;
  --ground-2: #19212b;
  --panel: rgba(17, 23, 31, 0.84);
  --panel-solid: #161d26;
  --rule: #2b3644;
  --rule-2: #3a4757;
  --ink: #dde4eb;
  --ink-2: #9aa7b6;
  --ink-3: #6f7c8c;
  /* two signals: mimetic heat vs recognition */
  --heat: #ff5468;
  --recog: #8fb0ff;
  --green: #8aad3c;           /* greentext, nudged up from #789922 for contrast */
  /* schools (data encoding) */
  --s1: #e2b14a; --s2: #4cc2ae; --s3: #c08cf0; --s4: #e6dfcf; --s0: #6e7b8b;

  --f-serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-ui: "Plex Cond", "Arial Narrow", "Roboto Condensed", sans-serif;
  --f-macro: "Anton", Impact, "Haettenschweiler", sans-serif;

  --gutter: clamp(16px, 4vw, 48px);
  --plate-w: 460px;
  --wide-w: 1080px;
  --top-h: 60px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--top-h) + 12px); }
body {
  margin: 0; background: var(--ground); color: var(--ink);
  font: 400 18px/1.56 var(--f-serif);
  font-optical-sizing: auto;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
img { max-width: 100%; display: block; }
a { color: var(--recog); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: #b8ccff; }
:focus-visible { outline: 2px solid var(--recog); outline-offset: 3px; border-radius: 2px; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0 0 0.9em; }
button { font: inherit; color: inherit; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--recog); color: var(--ground); padding: 8px 12px; font: 600 15px var(--f-ui); }
.skip:focus { top: 12px; }

/* ---------- field + HUD ---------- */
/* the canvas is sized in js/site.js from a stable stage height (see resize()); these are only the
   pre-script defaults. lvh keeps it covering the screen when a phone's address bar hides. */
#field { position: fixed; left: 0; top: 0; width: 100%; height: 100vh; height: 100lvh; z-index: 0; touch-action: pan-y; display: block; }
.hud { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.hud-corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--rule-2); }
.hud-corner.tl { left: 10px; top: calc(var(--top-h) + 6px); border-left-width: 1px; border-top-width: 1px; }
.hud-corner.tr { right: 10px; top: calc(var(--top-h) + 6px); border-right-width: 1px; border-top-width: 1px; }
.hud-corner.bl { left: 10px; bottom: 10px; border-left-width: 1px; border-bottom-width: 1px; }
.hud-corner.br { right: 10px; bottom: 10px; border-right-width: 1px; border-bottom-width: 1px; }
.hud-readout {
  position: absolute; right: 36px; bottom: 26px; display: grid; grid-template-columns: auto auto; gap: 1px 12px;
  font: 400 12px/1.4 var(--f-ui); color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right;
}
.ro-v { color: var(--ink-2); min-width: 9ch; }
.macro {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  font: 400 clamp(40px, 7.5vw, 104px)/0.95 var(--f-macro); text-transform: uppercase; color: #fff;
  -webkit-text-stroke: 2px #000; paint-order: stroke fill;
  text-shadow: 0 0 1px #000, 3px 3px 0 #000;
  opacity: 0; will-change: opacity; white-space: nowrap; text-align: center;
}

/* ---------- top bar ---------- */
.top {
  position: fixed; top: 0; left: 0; right: 0; height: var(--top-h); z-index: 20;
  display: flex; align-items: center; gap: 28px; padding: 0 var(--gutter);
  background: linear-gradient(to bottom, rgba(18,24,32,0.95), rgba(18,24,32,0.72));
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.mark { display: inline-flex; align-items: baseline; gap: 0; text-decoration: none; color: var(--ink); font: 400 26px/1 var(--f-macro); letter-spacing: 0.01em; }
.mark:hover { color: var(--ink); }
/* the wordmark: plain "antimemes" in Anton. Same lockup on debate.antimemes.is. */
.mark:hover .mark-a, .mark:hover .mark-b { text-shadow: 2px 0 var(--heat), -2px 0 var(--recog); }
.top-nav { display: flex; gap: 22px; margin-left: auto; }
.top-nav a { font: 500 15px var(--f-ui); color: var(--ink-2); text-decoration: none; padding: 8px 0; }
.top-nav a:hover { color: var(--ink); }
/* the first release: the bar's main destination */
.top-debate {
  font: 600 15px var(--f-ui); color: var(--ink); text-decoration: none; white-space: nowrap;
  padding: 8px 0 8px 22px; border-left: 1px solid var(--rule-2); display: inline-flex; align-items: center; gap: 8px; min-height: 40px;
}
.top-debate::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--recog); flex: none; }
.top-debate:hover { color: #fff; }
.top-debate:hover .top-debate-full, .top-debate:hover .top-debate-short { text-decoration: underline; text-underline-offset: 4px; }
.top-debate-short { display: none; }
.top-cta {
  font: 600 15px var(--f-ui); color: var(--ground); background: var(--ink); text-decoration: none;
  padding: 9px 14px; border-radius: 2px; white-space: nowrap;
}
.top-cta:hover { background: #fff; color: var(--ground); }

/* ---------- story rail ---------- */
.rail { position: fixed; right: 22px; top: 50%; transform: translateY(-50%); z-index: 15; display: none; }
.rail ol { list-style: none; margin: 0; padding: 0; counter-reset: r; display: grid; gap: 2px; }
.rail li { counter-increment: r; }
.rail a {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; text-decoration: none;
  font: 400 12px/1 var(--f-ui); color: var(--ink-2); padding: 5px 0;
}
.rail a::after { content: counter(r, decimal-leading-zero); font-variant-numeric: tabular-nums; width: 2ch; }
.rail a::before { content: ""; order: 2; width: 10px; height: 1px; background: var(--rule-2); transition: width .25s, background .25s; }
.rail a span { opacity: 0; }
.rail a:hover, .rail a.on { color: var(--ink); }
.rail a.on::before { width: 26px; background: var(--recog); }
.rail a:not(.on):not(:hover) { color: transparent; }
.rail a:not(.on):not(:hover)::after { color: var(--ink-2); }
@media (min-width: 1180px) { .rail { display: block; } }

/* ---------- scenes ---------- */
main { position: relative; z-index: 5; pointer-events: none; }
.scene { position: relative; padding: 0 var(--gutter); }
.scene .plate, .scene a, .scene button, .scene [tabindex] { pointer-events: auto; }

.plate {
  position: sticky; top: calc(var(--top-h) + 14vh);
  max-width: var(--plate-w); padding: 26px 28px 22px;
  background: var(--panel); border: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
/* selection brackets, Gotham style */
.plate::before, .plate::after {
  content: ""; position: absolute; width: 12px; height: 12px; border: 0 solid var(--recog); pointer-events: none;
}
.plate::before { left: -1px; top: -1px; border-left-width: 2px; border-top-width: 2px; }
.plate::after { right: -1px; bottom: -1px; border-right-width: 2px; border-bottom-width: 2px; }

#contagion, #schism, #scapegoat, #turn { min-height: 210vh; }
#contagion .plate::before, #contagion .plate::after,
#schism .plate::before, #schism .plate::after,
#scapegoat .plate::before, #scapegoat .plate::after { border-color: var(--heat); }

.scene h2 { font: 400 clamp(30px, 3.6vw, 46px)/1.08 var(--f-serif); letter-spacing: -0.012em; margin-bottom: 16px; text-wrap: balance; }
.scene h3 { font: 600 18px/1.25 var(--f-ui); letter-spacing: 0.005em; }
.kicker { font: 500 15px/1.3 var(--f-ui); color: var(--ink-2); margin-bottom: 14px; }
.lede, .lede-sm { color: var(--ink); }
.lede-sm { font-size: 19px; max-width: 62ch; }
.fine { font: 400 14px/1.45 var(--f-ui); color: var(--ink-2); }
.fig-note { font: 400 14px/1.45 var(--f-ui); color: var(--ink-2); border-left: 2px solid var(--rule-2); padding-left: 10px; margin: 14px 0 0; }

/* hero */
.hero { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 9vh; padding-top: calc(var(--top-h) + 24px); }
.plate-hero { position: relative; top: auto; max-width: 640px; background: rgba(17,23,31,0.66); }
.hero h1 {
  font: 350 clamp(40px, 4.9vw, 72px)/0.98 var(--f-serif); letter-spacing: -0.022em; margin-bottom: 20px;
  text-shadow: 1.5px 0 rgba(255,84,104,0.45), -1.5px 0 rgba(143,176,255,0.45);
}
.h-line { display: block; }
.hero .lede { font-size: 20px; max-width: 46ch; }
.hero-tools { display: flex; flex-wrap: wrap; gap: 14px 18px; align-items: center; margin-top: 18px; }
.hint { font: 400 14px/1.4 var(--f-ui); color: var(--ink-2); margin: 0; flex: 1 1 260px; }
.hint-fine { display: block; color: var(--ink-2); }
.scroll-cue { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); margin: 0; font: 400 13px var(--f-ui); color: var(--ink-2); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.scroll-cue span { width: 1px; height: 28px; background: linear-gradient(var(--recog), transparent); animation: cue 2.4s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: scaleY(0.4); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } }

.btn-ghost, .btn, .step {
  font: 600 15px/1 var(--f-ui); border: 1px solid var(--rule-2); background: transparent; color: var(--ink);
  padding: 13px 16px 12px; border-radius: 2px; cursor: pointer; text-decoration: none; display: inline-block; line-height: 19px; min-height: 44px;
}
.btn-ghost:hover, .step:hover { border-color: var(--recog); color: #fff; }
.btn { background: var(--ink); color: var(--ground); border-color: var(--ink); }
.btn:hover { background: #fff; color: var(--ground); }
.btn-alt { background: transparent; color: var(--ink); border-color: var(--recog); }
.btn-alt:hover { background: rgba(143,176,255,0.12); color: #fff; }

/* greentext */
.greentext { margin: 16px 0 0; padding: 12px 14px; background: rgba(0,0,0,0.28); border-left: 2px solid var(--green); font: 400 15px/1.5 var(--f-ui); color: var(--green); }
.greentext p { margin: 0; }

/* sorter */
.sorter { margin-top: 16px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sorter-q { font: italic 400 18px/1.35 var(--f-serif); color: var(--ink); }
.sorter-counts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0; font-family: var(--f-ui); }
.sorter-counts div { display: flex; flex-direction: column-reverse; }
.sorter-counts dt { font-size: 13px; color: var(--ink-2); }
.sorter-counts dd { margin: 0; font: 600 30px/1 var(--f-ui); font-variant-numeric: tabular-nums; }
.sorter-counts div:first-child dd { color: var(--heat); }
.sorter-counts div:nth-child(2) dd { color: var(--heat); opacity: 0.75; }
.sorter-counts .off { grid-column: 1 / -1; }
.sorter-counts .off dd { color: var(--ink-3); font-size: 22px; }

/* wide plates */
.plate-wide { position: relative; top: auto; max-width: var(--wide-w); margin: 0 auto; padding: clamp(24px, 4vw, 48px); background: rgba(17,23,31,0.9); }
.scene-fixes, .scene-turn, .scene-instruments, .scene-debate, .scene-rules, .scene-join { padding-top: 16vh; padding-bottom: 6vh; }
.scene-join { padding-bottom: 18vh; }

/* expanding brain */
.brain { list-style: none; margin: 28px 0 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--rule); }
.brain li { display: grid; grid-template-columns: 120px 1fr; gap: 20px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.brain li p { margin: 4px 0 0; color: var(--ink-2); }
.brain h3 { font: 400 clamp(26px, 3.2vw, 40px)/1 var(--f-macro); text-transform: none; letter-spacing: 0.005em; }
.glow { width: 100%; height: 64px; position: relative; }
.glow::before { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.g1::before { width: 16px; height: 16px; background: radial-gradient(circle, #ffb3bc, var(--heat) 50%, transparent 72%); }
.g2::before { width: 30px; height: 30px; background: radial-gradient(circle, #ffd0d6, var(--heat) 45%, transparent 72%); box-shadow: 0 0 18px rgba(255,84,104,.35); }
.g3::before { width: 46px; height: 46px; background: radial-gradient(circle, #fff, #ff8f9c 30%, var(--heat) 55%, transparent 74%); box-shadow: 0 0 34px rgba(255,84,104,.5); }
.g4::before { width: 64px; height: 64px; background: radial-gradient(circle, #fff, #ffc2c9 25%, var(--heat) 52%, transparent 74%); box-shadow: 0 0 60px 6px rgba(255,84,104,.6); }
.g0::before { width: 52px; height: 52px; background: transparent; border: 1px dashed var(--recog); box-shadow: inset 0 0 0 8px var(--ground), inset 0 0 0 9px rgba(143,176,255,.5); }
.brain-out h3 { font-family: var(--f-serif); font-size: clamp(24px, 2.8vw, 34px); color: var(--recog); }

/* the turn */
.pair-first { margin-top: 0 !important; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 30px 0; border: 1px solid var(--rule); }
.pair-card { padding: 22px 24px; }
.pair-card + .pair-card { border-left: 1px solid var(--rule); }
.pair-card h3 { margin-bottom: 10px; }
.pair-card:first-child h3 { color: var(--heat); }
.pair-card:last-child h3 { color: var(--recog); }
.pair-card p { margin: 0; font-size: 17px; }
.measure h3 { font: 600 15px var(--f-ui); color: var(--ink-2); margin-bottom: 8px; }
.measure-def { font: 400 clamp(22px, 2.6vw, 30px)/1.25 var(--f-serif); max-width: 34ch; }
.measure-def strong { font-weight: 500; }
.signit { margin-top: 22px; border: 1px solid var(--rule-2); background: rgba(0,0,0,0.18); }
.signit-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid var(--rule-2); }
.signit-tabs button {
  flex: 1 1 auto; background: transparent; border: 0; border-right: 1px solid var(--rule); cursor: pointer;
  font: 500 14px/1.2 var(--f-ui); color: var(--ink-2); padding: 12px 14px; text-align: left; min-height: 44px;
  display: flex; align-items: center; gap: 8px;
}
.signit-tabs button:last-child { border-right: 0; }
.signit-tabs button[aria-selected="true"] { color: var(--ink); background: rgba(143,176,255,0.08); box-shadow: inset 0 -2px 0 var(--sw, var(--recog)); }
.swatch { width: 9px; height: 9px; border-radius: 50%; background: var(--sw); flex: none; }
.signit-body { padding: 20px 22px; }
.signit-label { font: 400 13px var(--f-ui); color: var(--ink-2); margin-bottom: 6px; }
.signit-note { font: italic 400 20px/1.4 var(--f-serif); max-width: 60ch; }
.signit-meters { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin: 16px 0 10px; font-family: var(--f-ui); }
.signit-meters dt { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.signit-meters dd { margin: 0; font-size: 14px; color: var(--ink); display: grid; gap: 6px; }
.meter { display: block; height: 6px; background: repeating-linear-gradient(90deg, var(--rule-2) 0 6px, transparent 6px 8px); }
.meter span { display: block; height: 100%; background: var(--recog); }
.signit-foot { font: 400 14px/1.4 var(--f-ui); color: var(--ink-2); margin: 0; }

/* instruments */
.inst { display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 0; margin-top: 30px; border: 1px solid var(--rule); }
.inst-mod { padding: 24px 22px; display: flex; flex-direction: column; }
.inst-mod + .inst-mod { border-left: 1px solid var(--rule); }
.inst-mod header { margin-bottom: 14px; }
.inst-status { font: 500 13px/1.3 var(--f-ui); color: var(--ink-2); margin: 0 0 8px; }
.inst-status.live { color: var(--ink-2); }
.inst-status.live::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--recog); margin-right: 7px; transform: translateY(-1px); }
.inst-key { display: block; font: 400 52px/0.9 var(--f-macro); color: var(--ink); margin-bottom: 10px; }
.inst-see .inst-key { color: var(--s1); }
.inst-meet .inst-key { color: var(--s2); }
.inst-move .inst-key { color: var(--recog); }
.inst-mod p { font-size: 17px; }
.layers { list-style: none; margin: auto 0 0; padding: 0; display: grid; gap: 3px; }
.layers li { font: 500 13px var(--f-ui); color: var(--ink-2); border: 1px solid var(--rule-2); padding: 6px 10px; background: linear-gradient(90deg, rgba(226,177,74,0.10), transparent); }
.layers li:nth-child(2) { margin-left: 10px; } .layers li:nth-child(3) { margin-left: 20px; } .layers li:nth-child(4) { margin-left: 30px; } .layers li:nth-child(5) { margin-left: 40px; }
.steps { margin: 0 0 14px; padding-left: 22px; font: 400 16px/1.45 var(--f-ui); }
.steps li { padding: 3px 0; }
.steps li::marker { color: var(--s2); font-weight: 600; }
.boards { margin-top: auto; display: grid; gap: 6px; }
.board { display: grid; grid-template-columns: 70px 1fr; gap: 10px; border: 1px solid var(--rule-2); padding: 10px 12px; font: 400 14px/1.35 var(--f-ui); }
.board-k { font-weight: 600; color: var(--ink); }
.board-v { color: var(--ink-2); }
.board-agent { border-style: dashed; }

/* split board */
.split { margin-top: 28px; border: 1px solid var(--rule-2); }
.split-head { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 14px; border-bottom: 1px solid var(--rule-2); }
.step { width: 44px; height: 44px; text-align: center; font-size: 24px; line-height: 40px; padding: 0; }
.split-meta { font: 400 13px var(--f-ui); color: var(--ink-2); margin: 0 0 4px; }
.split-q { font: 400 clamp(19px, 2vw, 24px)/1.3 var(--f-serif); margin: 0; min-height: 2.6em; }
.split-cols { display: grid; grid-template-columns: 1fr 1fr; }
.split-col { padding: 14px; }
.split-col + .split-col { border-left: 1px solid var(--rule-2); }
.split-col h3 { font: 600 14px var(--f-ui); color: var(--ink-2); margin-bottom: 10px; }
.split-col h3 span { color: var(--ink); font-variant-numeric: tabular-nums; }
.faces { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.faces button {
  width: 44px; height: 44px; border-radius: 50%; padding: 0; border: 2px solid var(--sw, var(--s0)); background: var(--ground-2) center/cover no-repeat;
  cursor: pointer; font: 600 13px var(--f-ui); color: var(--ink-2); filter: grayscale(0.85) contrast(1.05);
  transition: filter .15s, transform .15s;
}
.faces button:hover, .faces button:focus-visible, .faces button[aria-pressed="true"] { filter: none; transform: scale(1.08); }
.faces button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ground), 0 0 0 4px var(--recog); }
.split-quote { border-top: 1px solid var(--rule-2); padding: 16px 18px; min-height: 120px; }
.split-quote blockquote { margin: 0 0 8px; font: italic 400 19px/1.45 var(--f-serif); max-width: 70ch; }
.split-quote .who { font: 600 14px var(--f-ui); margin: 0 0 6px; }
.split-quote .who em { font-style: normal; font-weight: 400; color: var(--ink-2); }

.schools { margin-top: 30px; }
.schools > h3 { font: 600 15px var(--f-ui); color: var(--ink-2); margin-bottom: 12px; }
.school-list { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0; border: 1px solid var(--rule); }
.school-list li { padding: 16px 18px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin: 0 -1px -1px 0; }
.school-list h4 { margin: 0 0 6px; font: 600 16px/1.25 var(--f-ui); display: flex; gap: 8px; align-items: baseline; }
.school-list h4 .swatch { transform: translateY(-1px); }
.school-list .n { font: 400 13px var(--f-ui); color: var(--ink-2); display: block; margin-bottom: 8px; }
.school-list p { font-size: 15px; line-height: 1.45; color: var(--ink-2); margin: 0; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.debate-link { font: 500 15px/1.4 var(--f-ui); margin: 0; }
.debate-link .fine { color: var(--ink-2); }

/* the loop: see -> meet -> move -> meta-consensus */
#loop { min-height: 340vh; }
#loop .plate { top: calc(var(--top-h) + 4vh); }
.plate-loop h2 { font-size: clamp(28px, 2.8vw, 38px); margin-bottom: 12px; }
#loop .plate::before, #loop .plate::after { border-color: var(--recog); }
.loop-steps { list-style: none; margin: 4px 0 0; padding: 0; counter-reset: lp; }
.loop-steps li { position: relative; padding: 12px 0 12px 16px; border-left: 2px solid var(--rule-2); transition: border-color .3s, opacity .3s; opacity: 0.55; }
.loop-steps li.done { opacity: 0.72; }
.loop-steps li.on { opacity: 1; border-left-color: var(--recog); }
.loop-steps h3 { margin: 2px 0 4px; }
.loop-steps li p:last-child { margin: 0; font-size: 16px; line-height: 1.45; }
.loop-k { display: flex; gap: 10px; align-items: baseline; margin: 0; font: 400 22px/1 var(--f-macro); color: var(--ink); }
.loop-k em { font: 500 13px var(--f-ui); font-style: normal; color: var(--ink-2); }
.loop-k em.live { color: var(--recog); }
.loop-steps li:nth-child(1) .loop-k span { color: var(--s1); }
.loop-steps li:nth-child(2) .loop-k span { color: var(--s2); }
.loop-steps li:nth-child(3) .loop-k span { color: var(--recog); }
.loop-steps b { font-weight: 600; }
/* shorter desktop screens: only the current step shows its sentence */
@media (min-width: 761px) and (max-height: 880px) {
  .loop-steps li:not(.on) p:last-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

/* rules */
.rules { list-style: none; margin: 26px 0 18px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.rules li { padding: 18px 20px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.rules h3 { margin-bottom: 6px; }
.rules li p { font-size: 16px; color: var(--ink-2); margin: 0; }
.honest { border-left: 2px solid var(--heat); padding-left: 10px; }

.plate-join { text-align: left; }
.plate-join h2 { font-size: clamp(36px, 5vw, 68px); }

/* footer */
.foot { position: relative; z-index: 5; background: var(--ground); border-top: 1px solid var(--rule); padding: 40px var(--gutter) 48px; }
.foot-grid { max-width: var(--wide-w); margin: 0 auto; display: grid; grid-template-columns: 1fr 1.4fr 1.2fr; gap: 32px; }
.foot-mark { font: 400 26px var(--f-macro); margin-bottom: 6px; }
.foot-links { list-style: none; margin: 4px 0 14px; padding: 0; display: grid; gap: 2px; font: 500 15px/1.3 var(--f-ui); }
.foot-links a { display: inline-block; padding: 5px 0; }
.foot-h { font: 600 14px var(--f-ui); color: var(--ink-2); margin-bottom: 10px; }
.foot p { font-size: 16px; }
.notes { margin: 0; padding-left: 18px; }
.notes li { margin-bottom: 4px; }
.credits summary { cursor: pointer; font: 500 14px var(--f-ui); color: var(--ink); min-height: 32px; }
.credits ul { list-style: none; padding: 0; margin: 10px 0; max-height: 320px; overflow: auto; }
.credits li { padding: 3px 0; border-bottom: 1px solid var(--rule); }

/* dossier: Gotham entity panel */
.dossier {
  position: fixed; z-index: 30; right: 20px; top: calc(var(--top-h) + 18px); width: min(380px, calc(100vw - 32px));
  max-height: calc(100vh - var(--top-h) - 40px); overflow: auto;
  background: var(--panel-solid); border: 1px solid var(--rule-2); box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: 18px 18px 14px;
}
.dossier::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--sw, var(--recog)); }
.dz-close { position: absolute; right: 6px; top: 6px; width: 40px; height: 40px; background: transparent; border: 0; color: var(--ink-2); font-size: 24px; cursor: pointer; }
.dz-close:hover { color: #fff; }
.dz-head { display: grid; grid-template-columns: 72px 1fr; gap: 14px; align-items: center; margin-bottom: 14px; padding-right: 30px; }
.dz-face { width: 72px; height: 72px; border-radius: 2px; background: var(--ground-2) center/cover; border: 1px solid var(--rule-2); display: grid; place-items: center; font: 600 22px var(--f-ui); color: var(--ink-2); }
.dz-class { font: 400 12px var(--f-ui); color: var(--ink-2); margin: 0 0 2px; }
.dossier h2 { font: 400 24px/1.1 var(--f-serif); margin-bottom: 4px; }
.dz-school { font: 500 14px/1.3 var(--f-ui); color: var(--sw, var(--ink-2)); margin: 0; }
.dz-body { border-top: 1px solid var(--rule); }
.dz-item { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.dz-item .pos { font: 500 14px/1.35 var(--f-ui); color: var(--ink-2); margin: 0 0 6px; }
.dz-item blockquote { margin: 0 0 6px; font: italic 400 16px/1.45 var(--f-serif); }
.dz-item a { font: 400 13px var(--f-ui); }
.dz-foot { margin: 10px 0 0; }

/* index dialog */
.index { width: min(720px, calc(100vw - 32px)); max-height: 80vh; padding: 0; background: var(--panel-solid); color: var(--ink); border: 1px solid var(--rule-2); }
.index::backdrop { background: rgba(8, 11, 15, 0.7); }
.ix-head { position: sticky; top: 0; background: var(--panel-solid); padding: 16px 18px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.ix-head h2 { font: 400 22px var(--f-serif); }
.ix-head .dz-close { position: static; }
.ix-list { list-style: none; margin: 0; padding: 8px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px; }
.ix-list button { width: 100%; display: flex; align-items: center; gap: 10px; background: transparent; border: 1px solid transparent; padding: 6px 8px; cursor: pointer; text-align: left; font: 500 15px var(--f-ui); min-height: 44px; }
.ix-list button:hover { border-color: var(--rule-2); background: rgba(255,255,255,0.03); }
.ix-list .swatch { width: 8px; height: 8px; }

.noscript { position: relative; z-index: 6; margin: 0 var(--gutter); font: 400 15px var(--f-ui); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .inst { grid-template-columns: 1fr; }
  .inst-mod + .inst-mod { border-left: 0; border-top: 1px solid var(--rule); }
  .rules { grid-template-columns: 1fr 1fr; }
  .top-nav { display: none; }
  .top-debate { margin-left: auto; }
}
@media (max-width: 760px) {
  :root { --top-h: 54px; --panel: rgba(18, 24, 32, 0.95); }
  body { font-size: 17px; }

  /* performance: blurring the backdrop of a canvas that redraws every frame is the costliest thing
     a phone can be asked to do while scrolling. Phones get near-solid panels instead. */
  .top, .plate { -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top { background: rgba(18, 24, 32, 0.97); }
  .plate-wide, .plate-hero { background: rgba(18, 24, 32, 0.95); }

  .mark { font-size: 22px; min-height: 44px; }
  .top { gap: 12px; }
  .top-cta { padding: 0 12px; font-size: 15px; min-height: 44px; display: inline-flex; align-items: center; }
  .top-debate { font-size: 15px; padding-left: 12px; gap: 6px; min-height: 44px; }
  .top-debate::before { display: none; }
  .hud-readout { display: none; }
  .hud-corner.bl, .hud-corner.br { display: none; }
  .macro { font-size: 34px; -webkit-text-stroke-width: 1.5px; text-shadow: 0 0 1px #000, 2px 2px 0 #000; }

  /* hero: the live graph owns the top of the first screen (js/site.js targetRegion "map" uses the
     same 46svh), the headline starts right under it and the rest scrolls in. */
  .hero { min-height: 0; justify-content: flex-start; padding-top: calc(var(--top-h) + 46vh); padding-top: calc(var(--top-h) + 46svh); padding-bottom: 12vh; }
  .plate-hero { padding: 20px 18px; }
  .hero .lede { font-size: 18px; }
  .scroll-cue { display: none; }
  .plate { padding: 18px 18px 16px; }

  /* story scenes on phones: the plate is never pinned. It scrolls past like a card, then a long
     clear runway lets the graph above play the scene out. Plates sit more than a screen apart, so
     two can never share the screen, and nothing ever covers the graph while it is animating. */
  #contagion, #schism, #scapegoat, #turn { min-height: 0; padding-top: 52vh; padding-bottom: 72vh; }
  #contagion .plate, #schism .plate, #scapegoat .plate, #turn .plate { position: relative; top: auto; }

  /* the loop's text follows the scroll (one step at a time), so its plate stays pinned to the
     bottom; the graph takes the space above it. The lead space keeps it from rising into view
     while the previous section is still on screen. */
  #loop { min-height: 0; height: 330vh; display: flex; flex-direction: column; padding-top: 90vh; }
  #loop .plate { position: sticky; top: auto; bottom: 10px; margin-top: auto; margin-bottom: 10px; }
  /* only the current loop step shows its sentence; the others keep their name */
  .loop-steps li { padding: 5px 0 5px 12px; }
  .loop-steps li:not(.on) p:last-child, .loop-steps li:not(.on) h3 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .loop-steps li.on { padding: 8px 0 8px 12px; }
  .loop-steps h3 { font-size: 17px; }
  .loop-steps li p:last-child { font-size: 16px; }
  .loop-k { font-size: 20px; }
  .loop-k em { font-size: 14px; }
  .plate-loop h2 { font-size: 24px; margin-bottom: 8px; }
  .plate-loop .kicker { display: none; }

  .scene h2 { font-size: 28px; }
  .scene-fixes, .scene-turn, .scene-instruments, .scene-debate, .scene-rules, .scene-join { padding-top: 12vh; }

  /* legibility: nothing a visitor has to read is under 15px on a phone */
  .fine, .fig-note, .hint, .signit-foot, .board, .debate-link { font-size: 15px; }
  .greentext { font-size: 16px; }
  .kicker, .inst-status, .split-meta, .signit-label, .sorter-counts dt, .split-col h3, .school-list .n, .dz-class { font-size: 14px; }
  .layers li { font-size: 14px; }
  .dz-item a { font-size: 15px; }

  /* tap targets */
  .foot-links a { display: inline-flex; align-items: center; min-height: 44px; }
  .credits summary { min-height: 44px; display: flex; align-items: center; }
  .dz-close { width: 44px; height: 44px; right: 4px; top: 4px; }

  .pair { grid-template-columns: 1fr; }
  .pair-card + .pair-card { border-left: 0; border-top: 1px solid var(--rule); }
  .signit-meters { grid-template-columns: 1fr; }
  .brain li { grid-template-columns: 64px 1fr; gap: 14px; }
  .glow { height: 52px; }
  .g4::before { width: 52px; height: 52px; }
  .split-head { padding: 12px 10px; gap: 8px; }
  .split-cols { grid-template-columns: 1fr; }
  .split-col + .split-col { border-left: 0; border-top: 1px solid var(--rule-2); }
  .rules { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .dossier { right: 8px; left: 8px; width: auto; top: auto; bottom: 8px; max-height: 62vh; max-height: 62svh; }
  .plate-wide { padding: 22px 18px; }
  .inst-key { font-size: 44px; }
}

@media (max-width: 420px) {
  .top-debate-full { display: none; }
  .top-debate-short { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-cue span { animation: none; }
  .faces button, .rail a::before, .loop-steps li { transition: none; }
}
