/* Tau Chess viewer — colours as tokens (light and dark scheme), one embedded font with tabular digits.
   S36/E33 §3: the font is served by this site (fonts/, SIL OFL 1.1, see fonts/OFL.txt) — no CDN, CSP font-src 'self'.
   Text colours meet a contrast of at least 4.5 : 1 on --bg, --surface and --surface-2 (checked by hand in the sheet). */

@font-face {
  font-family: "Tau Sans";
  src: url("fonts/tau-sans-400.woff2") format("woff2");
  font-weight: 300 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Tau Sans";
  src: url("fonts/tau-sans-700.woff2") format("woff2");
  font-weight: 600 800;
  font-style: normal;
  font-display: swap;
}


:root {
  --bg: #eceef0;
  --bg-2: #e3e6e9;
  --surface: #fbfbfc;
  --surface-2: #f2f4f5;
  --line: #d6dbdf;
  --ink: #14191e;
  --ink-2: #46505a;
  --ink-3: #5c6670;
  --accent: #0b6e6a;
  --accent-soft: rgb(11 110 106 / 0.11);
  --accent-ink: #ffffff;
  --gold: #8a5a12;
  --check: #c53b33;
  --sq-light: #e7eaed;
  --sq-dark: #8496a7;
  --coord-light: #6e8193;
  --coord-dark: #edf0f2;
  --move-mark: rgb(234 179 58 / 0.48);
  --pc-w: #fdfdfb;
  --pc-w-line: #1a1e22;
  --pc-w-detail: #1a1e22;
  --pc-b: #252b31;
  --pc-b-line: #0c0e10;
  --pc-b-detail: #dfe4e8;
  --pc-b-small: #0c0e10;
  --shadow: 0 1px 2px rgb(20 25 30 / 0.06), 0 8px 24px -12px rgb(20 25 30 / 0.18);
  --board-shadow: 0 2px 4px rgb(20 25 30 / 0.08), 0 24px 48px -24px rgb(20 25 30 / 0.35);
  --font: "Tau Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --font-title: var(--font);
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", "DejaVu Sans Mono", Menlo, Consolas, monospace;
  --radius: 14px;
  --radius-sm: 8px;
  --move-duration: 260ms;
  --fresh-duration: 1600ms;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1114;
    --bg-2: #13171b;
    --surface: #171b20;
    --surface-2: #1d2228;
    --line: #2a3138;
    --ink: #e8ebee;
    --ink-2: #aeb7bf;
    --ink-3: #7f8a94;
    --accent: #55b8ad;
    --accent-soft: rgb(85 184 173 / 0.14);
    --accent-ink: #0b1413;
    --gold: #e0a94a;
    --check: #ef6b61;
    --sq-light: #b4bfc9;
    --sq-dark: #5b6e81;
    --coord-light: #4f6274;
    --coord-dark: #d4dbe1;
    --move-mark: rgb(240 190 70 / 0.5);
    --pc-b-small: #9aa4ad;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -14px rgb(0 0 0 / 0.6);
    --board-shadow: 0 2px 6px rgb(0 0 0 / 0.35), 0 30px 60px -28px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0e1114;
  --bg-2: #13171b;
  --surface: #171b20;
  --surface-2: #1d2228;
  --line: #2a3138;
  --ink: #e8ebee;
  --ink-2: #aeb7bf;
  --ink-3: #7f8a94;
  --accent: #55b8ad;
  --accent-soft: rgb(85 184 173 / 0.14);
  --accent-ink: #0b1413;
  --gold: #e0a94a;
  --check: #ef6b61;
  --sq-light: #b4bfc9;
  --sq-dark: #5b6e81;
  --coord-light: #4f6274;
  --coord-dark: #d4dbe1;
  --move-mark: rgb(240 190 70 / 0.5);
  --pc-b-small: #9aa4ad;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 10px 30px -14px rgb(0 0 0 / 0.6);
  --board-shadow: 0 2px 6px rgb(0 0 0 / 0.35), 0 30px 60px -28px rgb(0 0 0 / 0.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-variant-numeric: tabular-nums lining-nums;
  font-synthesis-weight: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }

h1, h2 { margin: 0; font-weight: 600; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ------------------------------------------------------------------ Layout */
.page {
  max-width: 1720px;
  margin: 0 auto;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 16px max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  gap: 14px;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-block: 4px;
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; flex: none; }
.bm-bg { fill: var(--ink); }
.bm-tau { fill: none; stroke: var(--bg); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 600 19px/1.1 var(--font-title); letter-spacing: 0.01em; white-space: nowrap; }
.brand-sub { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-right { display: flex; align-items: center; gap: 10px; }

.live {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-2);
}
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); }
.live[data-state="live"] .live-dot { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.live[data-state="stale"] .live-dot { background: var(--gold); }

.switcher {
  display: inline-flex; padding: 3px; gap: 2px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px;
}
.switcher button {
  border: 0; background: transparent; cursor: pointer;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; color: var(--ink-3);
  white-space: nowrap;
}
.switcher button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }

.theme-button {
  width: 34px; height: 34px; display: grid; place-items: center; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 50%;
}
.theme-button svg { width: 18px; height: 18px; }
.theme-button circle { fill: none; stroke: var(--ink-2); stroke-width: 1.8; }
.theme-button path { fill: var(--ink-2); }

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

/* S36/E33 §1 Layout: the board stays the middle. Phone: one column (board with both players, then the two ways of
   thinking, then moves, score and evidence). Desk (>= 900 px): two columns, board left. Wide (>= 1360 px): three
   columns — two ways of thinking · board · moves, score and evidence. */
.stage {
  --board: min(calc(100vw - 32px), 760px);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "board" "think" "side";
  align-items: start;
}
.col-board { grid-area: board; display: grid; gap: 10px; width: 100%; max-width: var(--board); justify-self: center; min-width: 0; }
.col-think { grid-area: think; min-width: 0; }
.col-side { grid-area: side; display: grid; gap: 14px; min-width: 0; }

@media (min-width: 900px) {
  .stage {
    --board: max(340px, min(calc(100dvh - 300px), calc(100vw - 32px - 340px - 24px), 860px));
    grid-template-columns: var(--board) minmax(320px, 1fr);
    grid-template-areas: "board think" "board side";
    grid-template-rows: auto 1fr;
    column-gap: 24px;
  }
  .col-board { position: sticky; top: 12px; }
}

@media (min-width: 1360px) {
  .stage {
    --board: max(420px, min(calc(100dvh - 300px), calc(100vw - 32px - 2 * 340px - 2 * 24px), 900px));
    grid-template-columns: minmax(300px, 1fr) var(--board) minmax(300px, 1fr);
    grid-template-areas: "think board side";
    grid-template-rows: auto;
  }
}

/* ------------------------------------------------------------------ Board */
.game-title {
  font: 500 13px/1.2 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 10px 2px;
}

.board-frame {
  padding: clamp(6px, 1.1vmin, 12px);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--board-shadow);
  border: 1px solid var(--line);
}

.board {
  position: relative;
  aspect-ratio: 1;
  width: 100%;
  border-radius: 6px;
  overflow: hidden;
  container-type: inline-size;
}

.squares { position: absolute; inset: 0; display: grid; grid-template: repeat(8, 1fr) / repeat(8, 1fr); }
.square { position: relative; background: var(--sq-light); }
.square.dark { background: var(--sq-dark); }
.square.marked::after { content: ""; position: absolute; inset: 0; background: var(--move-mark); }
.square.check::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: radial-gradient(circle, color-mix(in srgb, var(--check) 70%, transparent) 0 32%, transparent 72%);
}
.square .coord {
  position: absolute; font: 600 clamp(8px, 2.1cqi, 15px)/1 var(--font); z-index: 1;
  color: var(--coord-light); user-select: none; pointer-events: none;
}
.square.dark .coord { color: var(--coord-dark); }
.square.light .coord { color: var(--coord-light); }
.coord.rank { top: 5%; left: 6%; }
.coord.file { bottom: 5%; right: 7%; }

.pieces { position: absolute; inset: 0; pointer-events: none; }
.piece {
  position: absolute;
  width: 12.5%; height: 12.5%;
  left: calc(var(--x) * 12.5%);
  top: calc(var(--y) * 12.5%);
  display: grid; place-items: center;
  will-change: transform;
}
.piece.moving { transition: transform var(--move-duration) cubic-bezier(0.2, 0.7, 0.2, 1); }
.piece .pc { width: 88%; height: 88%; }

.pc g { stroke-width: 3.2; stroke-linejoin: round; stroke-linecap: round; }
.pc.pw g { fill: var(--pc-w); stroke: var(--pc-w-line); }
.pc.pb g { fill: var(--pc-b); stroke: var(--pc-b-line); }
.pc .d { fill: none; stroke-width: 3; }
.pc.pw .d { stroke: var(--pc-w-detail); }
.pc.pb .d { stroke: var(--pc-b-detail); }
.pc.pw .f { fill: var(--pc-w-detail); stroke: none; }
.pc.pb .f { fill: var(--pc-b-detail); stroke: none; }
.player-icon .pc.pb g, .captured .pc.pb g { stroke: var(--pc-b-small); }
.pieces .pc { filter: drop-shadow(0 1.5px 1px rgb(0 0 0 / 0.22)); }

/* Result over the board */
.result {
  position: absolute; inset: 0; z-index: 3;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--bg) 42%, transparent);
  backdrop-filter: blur(2px) saturate(0.85);
}
.result[hidden] { display: none; }
.result-card {
  min-width: min(78%, 420px);
  padding: clamp(16px, 4cqi, 34px) clamp(20px, 5cqi, 44px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}
.result-score { font: 600 clamp(34px, 9cqi, 76px)/1 var(--font-title); letter-spacing: 0.02em; }
.result-text { margin-top: 10px; font-size: clamp(16px, 2.8cqi, 22px); font-weight: 600; }
.result-reason { margin-top: 4px; color: var(--ink-2); }
.result-next { margin-top: 14px; font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.notice { margin: 10px 2px 0; color: var(--ink-3); font-size: 13px; }

/* ------------------------------------------------------------------ Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px;
  min-width: 0;
}
.card h2 {
  font: 600 12px/1.2 var(--font);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.player {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  grid-template-areas: "icon name clock" "icon info info" "captured captured captured";
  column-gap: 12px;
  row-gap: 2px;
  align-items: center;
  position: relative;
  transition: border-color 200ms ease, box-shadow 200ms ease;
}
.player[data-active="true"] { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); box-shadow: var(--shadow), 0 0 0 3px var(--accent-soft); }
.player-icon {
  grid-area: icon; width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line);
}
.player-icon .pc { width: 34px; height: 34px; }
.player-name { grid-area: name; font: 600 17px/1.2 var(--font-title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.player-info { grid-area: info; font-size: 13px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 20px; }
.player-clock { grid-area: clock; font: 600 15px/1 var(--font); color: var(--ink-3); }
.player[data-active="true"] .player-clock { color: var(--ink); }
.state { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); font-weight: 600; }
.state .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: 0.25; transform: scale(0.7); } }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 7px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line);
}
.progress { grid-column: 1 / -1; height: 3px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 400ms ease; }
/* U1: label of the bar, the thinking row, the model's thought (§82, §83) */
.progress-caption { grid-column: 1 / -1; margin-top: 4px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.think-line { grid-column: 1 / -1; margin: 4px 0 0; min-height: 1.35em; font-size: 12.5px; line-height: 1.35; color: var(--ink-2); }
.think-line.done { color: var(--ink-3); }
.model-thought {
  grid-column: 1 / -1; display: flex; flex-direction: column; gap: 3px; margin-top: 8px; padding: 8px 10px;
  border-radius: 8px; background: var(--surface-2); border: 1px dashed var(--line); font-size: 12.5px; line-height: 1.4; color: var(--ink-2);
}
.model-thought-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.model-thought-excerpt { color: var(--ink-3); font-style: italic; }
.captured { grid-area: captured; display: flex; align-items: center; gap: 0; min-height: 22px; margin-top: 6px; }
.captured .pc { width: 22px; height: 22px; margin-right: -5px; }
.captured .plus { margin-left: 10px; font: 600 13px/1 var(--font); color: var(--ink-2); }

/* Move list */
.moves { display: flex; flex-direction: column; gap: 8px; }
.move-list {
  list-style: none; margin: 0; padding: 0;
  max-height: min(42vh, 360px); overflow-y: auto; overscroll-behavior: contain;
  font: 400 14px/1.2 var(--font);
  scrollbar-width: thin;
}
.move-list li {
  display: grid; grid-template-columns: 2.6em minmax(0, 1fr) minmax(0, 1fr);
  align-items: baseline; padding: 5px 4px; border-radius: 6px;
}
.move-list li:nth-child(odd) { background: var(--surface-2); }
.move-list .no { color: var(--ink-3); }
.move-list .move { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.move-list .san { font-weight: 600; color: var(--ink); }
.move-list .time { font-size: 11.5px; color: var(--ink-3); }
.move-list .new .san { color: var(--accent); }
.move-list .rej { font-size: 11px; color: var(--gold); font-weight: 600; }
.move-list .empty { display: block; font-family: var(--font); color: var(--ink-3); background: none; }

/* Score */
.score { display: flex; flex-direction: column; gap: 10px; }
.score-head { display: flex; justify-content: space-between; align-items: baseline; }
.score-count { font-size: 12px; color: var(--ink-3); }
.score-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.value { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.value b { font: 600 28px/1 var(--font-title); }
.value span { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.value.mid { text-align: center; }
.value.right { text-align: right; }
.score-split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.score-split .split {
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
  padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line);
}
.score-split .split b { font: 600 22px/1 var(--font-title); }
.score-split .split span { font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.score-split .won-on-board { border-left: 3px solid var(--accent); }
.score-split .won-by-attempts { border-left: 3px dashed var(--gold); }
.score-recent li.attempts { border-style: dashed; }
.score-bar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--surface-2); gap: 2px; }
.score-bar i { display: block; height: 100%; }
.score-bar .e { background: var(--accent); }
.score-bar .r { background: var(--ink-3); opacity: 0.45; }
.score-bar .m { background: var(--gold); }
.score-recent { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.score-recent li {
  font: 600 11px/1 var(--font); padding: 5px 7px; border-radius: 6px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.score-recent li.e { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent); }
.score-recent li.m { border-color: color-mix(in srgb, var(--gold) 50%, var(--line)); color: var(--gold); }

/* About Tau Chess — a calm introduction below the stage */

/* U1: evidence (§81) */
.proofs { display: grid; gap: 4px; }
.proofs h2 { margin: 0 0 2px; }
.proofs-lead { margin: 0 0 12px; font-size: 13px; color: var(--ink-3); }
.proofs-body { display: grid; gap: 6px; font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.proofs-body p { margin: 0; }
.proofs-body ul { margin: 2px 0 4px; padding-left: 18px; }
.proofs-body code { font: 500 12px/1.3 var(--font-mono); color: var(--ink); }
.proofs-body a { color: var(--accent); }
.proofs-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.proofs-actions button {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--ink); font: inherit; cursor: pointer;
}
.proofs-rule { font-size: 12px; color: var(--ink-3); }
.about { margin: 28px 0 8px; padding: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 14px; }
.about-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.about-title { font-family: var(--font-title); font-weight: 600; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.12;
  letter-spacing: -.01em; color: var(--ink); text-wrap: balance; }
.about-lead { margin: 0; max-width: 68ch; font-size: clamp(15.5px, 1.3vw, 18px); line-height: 1.6; color: var(--ink-2); }
.about-points { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin-top: 6px; }
.about-point { padding: 16px 18px; background: var(--surface-2); border-radius: var(--radius-sm); border-top: 3px solid var(--accent); }
.about-point h3 { margin: 0 0 6px; font-size: 15.5px; font-weight: 650; color: var(--ink); text-wrap: balance; }
.about-point p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.about-closing { margin: 4px 0 0; font-family: var(--font-title); font-style: italic; font-size: clamp(16px, 1.4vw, 19px); color: var(--ink); }

.footer { color: var(--ink-3); font-size: 12.5px; padding: 4px 2px 0; }
.footer p { margin: 0; max-width: 120ch; }
.footer .rights { margin-top: 4px; }
.footer .legal { margin-top: 6px; }

/* Large 16:9 screens: a little more air and larger type */
@media (min-width: 1600px) and (min-height: 860px) {
  body { font-size: 16px; }
  .player-name { font-size: 20px; }
  .move-list { font-size: 15.5px; }
  .value b { font-size: 34px; }
}

/* Small phones */
@media (max-width: 420px) {
  .brand-sub { display: none; }
  .header-right { gap: 6px; }
  .live[data-state="off"] { display: none; }
  .switcher button { padding: 4px 7px; letter-spacing: 0; }
  .brand { gap: 8px; }
  .live #live-text { display: none; }
  .card { padding: 12px 13px; }
}

@media (prefers-reduced-motion: reduce) {
  .piece.moving { transition: none; }
  .state .dot { animation: none; }
  .progress i, .player { transition: none; }
}

/* Premiere: countdown over the board */
.premiere-kicker { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .75; }
.premiere-in { font-size: 14px; margin-top: 6px; opacity: .85; }
.premiere-count { font-variant-numeric: tabular-nums; }
/* Premiere: board and side cards strongly darkened — only the countdown is readable */
.result.premiere { background: rgb(6 8 10 / 0.87); }
body[data-premiere] .squares, body[data-premiere] .pieces { filter: blur(7px) brightness(0.3); }
body[data-premiere] .card { opacity: 0.06; filter: blur(5px); }
/* End of a presentation: the thanks line may wrap into two lines */
#premiere-when { white-space: pre-line; }
/* Earlier series (e.g. without thinking) as one quiet line */
.score-before { margin: 0; font-size: 12px; line-height: 1.4; color: var(--ink-3); }
/* End card with two series side by side */
.premiere-count:has(.series) { display: flex; justify-content: center; gap: clamp(20px, 6cqi, 56px); margin: 8px 0 6px; }
.series { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.series-score { font: 600 clamp(30px, 7cqi, 64px)/1 var(--font-title); }
.series-label { font: 600 13px/1.2 var(--font); color: var(--ink); letter-spacing: 0.02em; }
.series-range { font: 400 12px/1.2 var(--font); color: var(--ink-3); }

/* S35/E31 §14: two ways of thinking (new section; the existing parts are unchanged) */
.ways-section { container-type: inline-size; margin: 0; padding: clamp(14px, 2vw, 22px); box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.ways-kicker { margin: 0 0 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent); }
.ways-section h2 { margin: 0 0 4px; font: 600 17px/1.2 var(--font-title); }
.ways-lead { margin: 0; font-size: 13.5px; color: var(--ink-2); max-width: 90ch; }
.ways { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@container (min-width: 640px) { .ways { grid-template-columns: 1fr 1fr; } }
.way { display: grid; gap: 6px; align-content: start; padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); font-size: 13px; color: var(--ink-2); overflow-wrap: anywhere; }
.way h3 { margin: 0; font: 600 15px/1.25 var(--font-title); color: var(--ink); }
.way p, .way ul { margin: 0; }
.way ul { padding-left: 18px; display: grid; gap: 3px; }
.way-tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.way-engine .way-tag { color: var(--accent); }
.way-excerpt { font-style: italic; color: var(--ink-3); }
.way-count { color: var(--ink); font-weight: 600; }
.way-short-title { margin-top: 4px; color: var(--ink-3); }
.way-short { color: var(--ink-3); }
.way code { font: 500 12px/1.3 var(--font-mono); color: var(--ink); }

/* S36/E33 §3: motion only where it means something; with reduced motion nothing moves or fades. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* S36/E33 §2: the stream of decided statements (the main event) and the model's words opposite */
.way-engine { border-top: 3px solid var(--accent); }
.way-model { border-top: 3px dashed var(--gold); }
.way-tag-model { color: var(--gold); }
.stream-total { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 6px 0 2px; }
.stream-total b { font: 700 clamp(26px, 3.2vw, 36px)/1 var(--font); color: var(--ink); letter-spacing: -0.01em; }
.stream-total span { font-size: 12.5px; color: var(--ink-2); }
.stream-now { display: grid; gap: 4px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--accent-soft); }
.stream-now[hidden] { display: none; }
.stream-now-head, .model-now { margin: 0; display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; color: var(--accent); }
.model-now { color: var(--gold); }
.stream-now-head .dot, .model-now .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: breathe 1.6s ease-in-out infinite; }
.stream-now .think-line { margin: 0; color: var(--ink); font-size: 13px; }
.stream-now .progress { margin-top: 2px; }
.stream-now .progress-caption { margin: 0; }
.stream { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.stmt { display: grid; grid-template-columns: minmax(4.6em, auto) minmax(0, 1fr); column-gap: 10px; row-gap: 1px; padding: 6px 8px; border-radius: 6px; }
.stmt:nth-child(odd) { background: var(--surface); }
.stmt-move { grid-row: span 2; font-weight: 700; color: var(--ink); white-space: nowrap; }
.stmt-text { color: var(--ink); }
.stmt-meta { font-size: 12px; color: var(--ink-3); overflow-wrap: anywhere; }
.stmt-meta code { font: 500 11.5px/1.3 var(--font-mono); color: var(--ink-2); }
.stmt.empty { display: block; color: var(--ink-3); }
.stmt.fresh { animation: fresh var(--fresh-duration) ease-out 1; }
@keyframes fresh { from { background: color-mix(in srgb, var(--accent) 22%, transparent); } }
.stream-more { margin: 0; font-size: 12px; color: var(--ink-3); }
.way-move { color: var(--ink); font-weight: 700; }
.way-comment { color: var(--ink); }
.model-earlier { list-style: none; padding: 0 !important; color: var(--ink-3); }
.model-earlier .stmt-move { margin-right: 4px; font-weight: 700; color: var(--ink-2); }
.way-note { font-size: 12px; color: var(--ink-3); }

/* S36/E33 §4: "What you have seen" — the end of the story, below the stage */
.recap { margin: 8px 0 0; padding: clamp(20px, 3vw, 36px); background: var(--surface); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 12px; }
.recap[hidden] { display: none; }
.recap:focus { outline: none; }
.recap-title { font: 700 clamp(24px, 3vw, 36px)/1.15 var(--font-title); letter-spacing: -0.01em; text-wrap: balance; }
.recap-lead { margin: 0; color: var(--ink-2); font-size: 15px; }
.recap-points { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: recap; }
.recap-points li { counter-increment: recap; padding: 14px 16px; background: var(--surface-2); border-radius: var(--radius-sm); }
.recap-points li::before { content: counter(recap); display: block; font: 700 22px/1 var(--font); color: var(--accent); margin-bottom: 6px; }
.recap-points h3 { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--ink); text-wrap: balance; }
.recap-points p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.recap-papers-title { margin: 6px 0 0; font-weight: 700; color: var(--ink); }
.recap-papers { margin: 0; padding-left: 18px; display: grid; gap: 4px; color: var(--ink-2); overflow-wrap: anywhere; }
.recap-papers a, .recap-link { color: var(--accent); text-underline-offset: 3px; }
.recap-link { display: inline-block; margin-top: 12px; font-size: 14px; font-weight: 700; }
.recap-link[hidden] { display: none; }

/* S36/E33 §5: keyboard and screen readers — skip links, visible focus, time of the state */
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; padding: 8px 14px; border-radius: 999px; background: var(--ink); color: var(--bg); font-weight: 700; text-decoration: none; }
.skip:focus { top: 12px; }
a:focus-visible, [tabindex]:focus-visible, .switcher button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.board:focus { outline: none; }
.stamp { margin: 0 2px; font-size: 12px; color: var(--ink-3); }
.stamp:empty { display: none; }
