/* MIMESIS project page. Hand-written, no framework.
 * Color tokens were validated with the data-viz palette checks:
 *  - agent conditions use a one-hue ordinal ramp at the logo's hue (261°),
 *    darker = more in light mode, lighter = more in dark mode;
 *  - emphasis charts use the brand blue against a recessive gray, and every
 *    gray bar carries a visible value label (contrast relief);
 *  - all text tokens clear WCAG AA (4.5:1) on both surfaces.
 */

:root {
  color-scheme: light;
  --page: #f7f7f5;
  --surface: #ffffff;
  --surface-2: #f1f1ee;
  --ink: #0b0b0b;
  --secondary: #52514e;
  --muted: #6b6a65;
  --hairline: rgba(11, 11, 11, 0.1);
  --grid: #e6e5df;
  --axis: #c3c2b7;
  --accent: #0062fc;
  --accent-strong: #0050d0;
  --accent-soft: #eaf1ff;
  --on-accent: #ffffff;
  --accent-mark: #0062fc;
  --gray-mark: #a9a8a1;
  --ord-1: #8ab3f9;
  --ord-2: #2a70ee;
  --ord-3: #1549a7;
  --base-1: #b3b2ab;
  --base-2: #6f6e68;
  --win: #0062fc;
  --tie: #d6d5cf;
  --loss: #d84a4a;
  --good: #006300;
  --private: #a8400c;
  --private-soft: #fff5ee;
  --private-line: #e3a07c;
  --focus: #0062fc;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.04);
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --math: "Cambria Math", "STIX Two Math", "Latin Modern Math", "Times New Roman", serif;
  --header-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0f1011;
    --surface: #17181a;
    --surface-2: #202124;
    --ink: #f3f3f1;
    --secondary: #c3c2b7;
    --muted: #9a9890;
    --hairline: rgba(255, 255, 255, 0.1);
    --grid: #2a2b2d;
    --axis: #45464a;
    --accent: #73a3f8;
    --accent-strong: #a2c3fa;
    --accent-soft: #142440;
    --on-accent: #08142b;
    --accent-mark: #4081f6;
    --gray-mark: #6e6d68;
    --ord-1: #1549a7;
    --ord-2: #4081f6;
    --ord-3: #a2c3fa;
    --base-1: #5c5b57;
    --base-2: #9a9890;
    --win: #4081f6;
    --tie: #4a4a47;
    --loss: #e06666;
    --good: #0ca30c;
    --private: #ffb088;
    --private-soft: #251a14;
    --private-line: #8a5236;
    --focus: #73a3f8;
    --shadow: none;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f1011;
  --surface: #17181a;
  --surface-2: #202124;
  --ink: #f3f3f1;
  --secondary: #c3c2b7;
  --muted: #9a9890;
  --hairline: rgba(255, 255, 255, 0.1);
  --grid: #2a2b2d;
  --axis: #45464a;
  --accent: #73a3f8;
  --accent-strong: #a2c3fa;
  --accent-soft: #142440;
  --on-accent: #08142b;
  --accent-mark: #4081f6;
  --gray-mark: #6e6d68;
  --ord-1: #1549a7;
  --ord-2: #4081f6;
  --ord-3: #a2c3fa;
  --base-1: #5c5b57;
  --base-2: #9a9890;
  --win: #4081f6;
  --tie: #4a4a47;
  --loss: #e06666;
  --good: #0ca30c;
  --private: #ffb088;
  --private-soft: #251a14;
  --private-line: #8a5236;
  --focus: #73a3f8;
  --shadow: none;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
sup { font-size: 0.68em; line-height: 0; }
.muted { color: var(--muted); }
.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }
.center { text-align: center; }
section[id], [id].section { scroll-margin-top: calc(var(--header-h) + 12px); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; }
.skip:focus { left: 12px; background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 8px; }
.noscript { text-align: center; color: var(--secondary); padding: 0 24px 40px; }

/* ---------------------------------------------------------------- header */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hairline);
}
.header-inner { display: flex; align-items: center; gap: 16px; min-height: var(--header-h); }
.brand { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: 0.06em; }
.brand:hover { color: var(--ink); }
.site-nav { flex: 1; display: flex; justify-content: center; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a {
  padding: 6px 11px; border-radius: 999px; color: var(--secondary);
  text-decoration: none; font-size: 14px; font-weight: 560; white-space: nowrap;
}
.site-nav a:hover { color: var(--ink); background: var(--surface-2); }
.site-nav a[aria-current] { color: var(--accent); background: var(--accent-soft); }
.theme-toggle {
  flex: none; width: 36px; height: 36px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  display: grid; place-items: center; cursor: pointer;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-sun { display: none; }
:root[data-theme="dark"] .icon-sun { display: block; }
:root[data-theme="dark"] .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .icon-sun { display: block; }
  :root:where(:not([data-theme="light"])) .icon-moon { display: none; }
}

/* ------------------------------------------------------------------ hero */
.hero { padding: 64px 0 72px; }
.eyebrow { margin: 0 0 18px; font: 600 13px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.title {
  margin: 0; font-size: clamp(56px, 10vw, 104px); line-height: 1; font-weight: 800;
  letter-spacing: 0.035em; color: var(--ink);
}
.title-mark { height: 0.725em; width: auto; vertical-align: baseline; margin-right: 0.03em; }
.subtitle { margin: 18px auto 0; max-width: 720px; font-size: clamp(19px, 2.5vw, 26px); line-height: 1.3; font-weight: 520; color: var(--secondary); }
.authors { list-style: none; padding: 0; margin: 28px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; font-size: 16.5px; font-weight: 560; }
.authors a { color: inherit; text-decoration-color: var(--axis); }
.authors a:hover { color: var(--accent); text-decoration-color: currentColor; }
.affiliations { margin: 10px auto 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; font-size: 14.5px; color: var(--secondary); }
.links { margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 9px 17px; border-radius: 999px;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--ink);
  font-weight: 620; font-size: 15px; text-decoration: none; box-shadow: var(--shadow);
}
.btn:hover { color: var(--ink); border-color: var(--axis); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn svg.fill { fill: currentColor; stroke: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }
.hero-lede { margin: 32px auto 0; }
.lede { font-size: 18px; line-height: 1.6; color: var(--secondary); max-width: 780px; }

.stats { list-style: none; padding: 0; margin: 44px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.stat {
  display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 4px; align-content: start; padding: 18px 20px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow);
}
.stat-label { font-size: 13.5px; color: var(--secondary); }
.stat-value { font-size: 46px; font-weight: 660; line-height: 1.05; letter-spacing: -0.02em; color: var(--ink); }
.stat-delta { font-size: 13.5px; font-weight: 600; color: var(--good); }
.stat .nw { white-space: nowrap; }
.stats-note { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); text-align: center; }
.stats-fn { color: var(--good); font-weight: 600; }

/* -------------------------------------------------------------- sections */
.section { padding: 88px 0; border-top: 1px solid var(--hairline); }
.section-head { margin-bottom: 28px; }
.kicker { margin: 0 0 10px; font: 600 13px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); }
.section h2 { margin: 0; font-size: clamp(27px, 3.4vw, 38px); line-height: 1.18; letter-spacing: -0.012em; font-weight: 720; max-width: 900px; }
.section-head .lede { margin: 16px 0 0; }

/* --------------------------------------------------------------- figures */
.figure-card { margin: 0; }
.figure-card .paper { background: #ffffff; border: 1px solid var(--hairline); border-radius: var(--radius); padding: 16px; }
.figure-card .paper img { display: block; width: 100%; height: auto; }
.figure-card.wide { margin-top: 28px; }
figcaption { margin-top: 10px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }

/* ---------------------------------------------------------------- charts */
.chart-card {
  margin: 0; padding: 20px 22px 16px; background: var(--surface);
  border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
}
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 10px; }
.chart-title { margin: 0; font-size: 16px; font-weight: 660; }
.chart-sub { margin: 3px 0 0; font-size: 13.5px; color: var(--muted); }
.table-toggle {
  flex: none; font: 600 13px var(--font); padding: 5px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--secondary);
}
.table-toggle[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.chart { position: relative; width: 100%; min-height: 40px; }
.chart svg { display: block; overflow: visible; }
.chart svg text { font-family: var(--font); }
.axis-notes { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.axis-notes span:last-child { text-align: right; }

.tick { fill: var(--muted); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.lbl { fill: var(--secondary); font-size: 13px; }
.lbl.hl { fill: var(--ink); font-weight: 680; }
.val { fill: var(--secondary); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.val.hl { fill: var(--ink); font-weight: 680; }
.grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.axis-line { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.ref-line { stroke: var(--secondary); stroke-width: 1; shape-rendering: crispEdges; }
.ref-lbl { fill: var(--secondary); font-size: 11.5px; }
.row-bg { fill: transparent; }
.row:hover .row-bg, .row.is-sel .row-bg, .row:focus-within .row-bg { fill: var(--surface-2); }
.bar, .dot, .col { transition: filter 0.12s ease; }
.row:hover .bar, .row:focus-within .bar, .mini:hover .col, .mini:focus .col { filter: brightness(1.15) saturate(1.05); }
.mini:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hit { fill: transparent; cursor: pointer; outline: none; }
.hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.m-accent { fill: var(--accent-mark); }
.m-gray { fill: var(--gray-mark); }
.m-ord1 { fill: var(--ord-1); }
.m-ord2 { fill: var(--ord-2); }
.m-ord3 { fill: var(--ord-3); }
.m-base1 { fill: var(--base-1); }
.m-base2 { fill: var(--base-2); }
.m-win { fill: var(--win); }
.m-tie { fill: var(--tie); }
.m-loss { fill: var(--loss); }
.panel-title { fill: var(--ink); font-size: 12.5px; font-weight: 650; }
.val.on-tie { fill: var(--ink); font-size: 11.5px; }
.dot { stroke: var(--surface); stroke-width: 2; }
.dot-hollow { fill: var(--surface); stroke-width: 2; }
.dot-hollow.m-base1 { stroke: var(--base-1); }
.dot-hollow.m-base2 { stroke: var(--base-2); }
.conn { stroke: var(--axis); stroke-width: 2; stroke-linecap: round; }
.sep { stroke: var(--hairline); stroke-width: 1; }
.empty-note { fill: var(--muted); font-size: 12px; }
.grp-head { fill: var(--muted); font-size: 11px; letter-spacing: 0.04em; paint-order: stroke; stroke: var(--surface); stroke-width: 5px; stroke-linejoin: round; }

.legend { list-style: none; padding: 0; margin: 2px 0 12px; display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 13.5px; color: var(--secondary); }
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; }
.key.bar-key { border-radius: 3px; width: 12px; height: 12px; }
.key.hollow { background: var(--surface) !important; border: 2px solid; }
.key.diamond { border-radius: 2px; transform: rotate(45deg) scale(0.86); }
.k-accent { background: var(--accent-mark); }
.k-gray { background: var(--gray-mark); }
.k-ord1 { background: var(--ord-1); }
.k-ord2 { background: var(--ord-2); }
.k-ord3 { background: var(--ord-3); }
.k-base1 { background: var(--base-1); border-color: var(--base-1); }
.k-base2 { background: var(--base-2); border-color: var(--base-2); }
.k-win { background: var(--win); }
.k-tie { background: var(--tie); }
.k-loss { background: var(--loss); }

.chart-table { margin-top: 6px; overflow-x: auto; }

/* CSD versus GRPO training curves */
.curve-panels { display: grid; gap: 20px 24px; }
.ln { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ln-csd { stroke: var(--ord-3); stroke-width: 2; }
.ln-grpo { stroke: var(--ord-2); stroke-width: 2; stroke-dasharray: 6 4; }
.pt { stroke: var(--surface); stroke-width: 2; }
.pt-csd { fill: var(--ord-3); }
.pt-grpo { fill: var(--ord-2); }
.xhair { stroke: var(--axis); stroke-width: 1; shape-rendering: crispEdges; }
.end-lbl { fill: var(--ink); font-size: 12px; font-weight: 650; }
.leader { fill: none; stroke: var(--muted); stroke-width: 1; }
.axis-title { fill: var(--muted); font-size: 11.5px; }
.plot-hit { fill: transparent; cursor: crosshair; outline: none; }
.plot-hit:focus-visible { stroke: var(--focus); stroke-width: 2; }
.line-key { display: block; flex: none; }
.chart-table table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chart-table caption { text-align: left; font-size: 13px; color: var(--muted); padding: 0 0 6px; }
.chart-table th, .chart-table td { padding: 7px 10px; border-bottom: 1px solid var(--hairline); text-align: right; white-space: nowrap; }
.chart-table th:first-child, .chart-table td:first-child { text-align: left; }
.chart-table thead th { color: var(--muted); font-weight: 600; font-size: 12.5px; }
.chart-table tbody th { font-weight: 520; color: var(--ink); }
.chart-table tr.hl td, .chart-table tr.hl th { color: var(--ink); font-weight: 700; }
.chart-table td.dim { color: var(--muted); }
.chart-table td.txt { text-align: left; color: var(--secondary); }
.chart-table .hl-col { color: var(--ink); font-weight: 650; background: var(--accent-soft); }
.chart-table tr.group th { padding-top: 14px; text-align: left; font: 600 11px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.subtable { margin-top: 22px; overflow-x: auto; }

/* tooltip */
.viz-tip {
  position: fixed; z-index: 60; pointer-events: none; min-width: 150px; max-width: 300px;
  padding: 9px 11px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  background: var(--surface); color: var(--ink); border: 1px solid var(--hairline);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.viz-tip-title { font-weight: 650; font-size: 12.5px; color: var(--secondary); margin-bottom: 4px; }
.viz-tip-row { display: grid; grid-template-columns: 14px auto minmax(0, 1fr); align-items: center; column-gap: 8px; }
.viz-tip-row strong { font-weight: 720; font-variant-numeric: tabular-nums; }
.viz-tip-row .l { color: var(--secondary); }
.viz-tip-key { width: 12px; height: 3px; border-radius: 2px; }
.viz-tip-note { margin-top: 4px; color: var(--muted); font-size: 12px; }

/* ------------------------------------------------------------- controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 0 0 14px; }
.segmented { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); }
.segmented label { position: relative; padding: 6px 15px; border-radius: 999px; font-size: 14px; font-weight: 620; color: var(--secondary); cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label:has(input:checked) { background: var(--accent-soft); color: var(--accent); }
.segmented label:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 1px; }
.select-wrap { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--secondary); }
.select-wrap[hidden] { display: none; }
.select-wrap select {
  font: inherit; color: var(--ink); background: var(--surface); padding: 6px 12px; border-radius: 10px;
  border: 1px solid var(--hairline);
}
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--secondary); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.chart-card.spaced { margin-top: 18px; }
.pair-stack { display: grid; gap: 14px; }
.multiples { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.mini { min-width: 0; padding: 10px 10px 6px; border: 1px solid var(--hairline); border-radius: 10px; background: var(--surface); }
.mini h4 { margin: 0 0 2px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 13.5px; font-weight: 660; }
.tag { font: 600 10.5px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }

/* ------------------------------------------------------------- method */
.stages { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stage { padding: 22px 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.stage h3 { margin: 0 0 12px; font-size: 19px; display: flex; align-items: center; gap: 10px; }
.stage-tag { font: 600 12px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 3px 9px; border-radius: 999px; }
.stage-lede { margin: -4px 0 12px; font-size: 14.5px; color: var(--muted); }
.steps { margin: 0; padding-left: 22px; display: grid; gap: 10px; color: var(--secondary); }
.steps strong { color: var(--ink); }
.steps li::marker { color: var(--accent); font-weight: 700; }

/* ---------------------------------------------------------- behaviors */
.behavior-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.behavior-card {
  position: sticky; top: calc(var(--header-h) + 16px); padding: 22px 24px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow);
}
.beh-id { font: 600 13px var(--mono); letter-spacing: 0.04em; color: var(--accent); }
.behavior-card h3 { margin: 4px 0 4px; font-size: 21px; line-height: 1.25; }
.beh-count { margin: 0; font-size: 14px; color: var(--muted); }
.beh-desc { margin: 12px 0 0; color: var(--secondary); }
.quotes { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 10px; }
.quote { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 15px; line-height: 1.5; }
.quote.thought { background: transparent; border: 1px dashed var(--axis); color: var(--secondary); font-style: italic; }
.quote-tag { display: block; margin-bottom: 2px; font: 600 10.5px var(--mono); font-style: normal; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.beh-foot { margin: 14px 0 0; font-size: 12.5px; color: var(--muted); }

/* ---------------------------------------------------------------- tabs */
.tablist { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
[role="tab"], .pill {
  font: 620 14px var(--font); padding: 8px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--hairline); background: var(--surface); color: var(--secondary);
}
[role="tab"]:hover, .pill:hover { color: var(--ink); }
[role="tab"][aria-selected="true"], .pill[aria-checked="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.panel { padding: 22px 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-intro { margin: 0 0 14px; color: var(--secondary); max-width: 800px; }

/* --------------------------------------------------------------- bubbles */
.bubble { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.55; color: var(--ink); }
.bubble-agent { background: var(--surface-2); }
.bubble-user { background: var(--accent-soft); }
.bubble-thought { background: transparent; color: var(--secondary); font-style: italic; border-left: 3px solid var(--private-line); border-radius: 0 12px 12px 0; }
.bubble-coach { background: var(--surface); border: 1px solid var(--private-line); }
.context p { margin: 0 0 6px; }
.context p:last-child { margin-bottom: 0; }
.context .who { display: block; margin-bottom: 4px; font: 600 10.5px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------- guess */
.guess-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.guess {
  display: flex; gap: 12px; text-align: left; font: inherit; font-size: 14.5px; line-height: 1.5;
  padding: 12px 14px; border-radius: 12px; cursor: pointer; color: var(--ink);
  border: 1px solid var(--hairline); background: var(--surface);
}
.guess:hover:not([disabled]) { border-color: var(--accent); }
.guess[disabled] { cursor: default; }
.guess-letter { flex: none; font: 700 13px var(--mono); color: var(--accent); padding-top: 1px; }
.guess-who { display: block; margin-top: 6px; font: 600 11.5px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.guess.is-real { border-color: var(--good); box-shadow: inset 0 0 0 1px var(--good); }
.guess.is-real .guess-who { color: var(--good); }
.guess.is-ours .guess-who { color: var(--accent); }
.guess.is-chosen { background: var(--surface-2); }
.guess-result { margin-top: 14px; font-size: 15px; color: var(--secondary); }
.guess-result strong { color: var(--ink); }
.guess-reset { margin-left: 8px; font: 600 13px var(--font); padding: 4px 12px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--secondary); cursor: pointer; }

/* ---------------------------------------------------------- transcript */
.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.pill { font-size: 13.5px; padding: 6px 13px; }
.transcript ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.turn { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; }
.turn-n { padding-top: 9px; font: 600 12px var(--mono); color: var(--muted); }
.turn-thought { margin: 0 0 6px; padding: 2px 0 2px 10px; border-left: 3px solid var(--private-line); font-size: 14px; font-style: italic; color: var(--secondary); }
.turn-thought .lab { display: block; font: 600 10.5px var(--mono); font-style: normal; letter-spacing: 0.05em; text-transform: uppercase; color: var(--private); }
.turn-say { padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); font-size: 14.5px; }
.transcript-more { margin: 10px 0 0 42px; font-size: 13px; color: var(--muted); }
.transcript-note { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 14px; color: var(--secondary); }

/* ----------------------------------------------------- chat excerpts */
.sim-example { margin-top: 18px; padding: 22px 24px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.sim-example h3 { margin: 0; font-size: 18px; line-height: 1.3; }
.sim-example h3 .beh-id { margin-right: 8px; }
.sim-note { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); max-width: 860px; }
.sim-instruction { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13.5px; color: var(--secondary); }
.sim-instruction strong { color: var(--ink); }
.chat { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; max-width: 860px; }
.chat-turn { margin: 0; }
.chat-who { display: block; margin: 0 0 4px; font: 600 10.5px var(--mono); letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.chat-say { margin: 0; padding: 10px 14px; border-radius: 12px; font-size: 14.5px; line-height: 1.55; overflow-wrap: anywhere; }
.chat-agent .chat-say { background: var(--surface-2); }
.chat-user .chat-say { background: var(--accent-soft); }
.chat-thought { margin: 0 0 6px; padding: 2px 0 2px 10px; border-left: 3px solid var(--private-line); font-size: 14px; font-style: italic; color: var(--secondary); }
.chat-thought .lab { display: block; font: 600 10.5px var(--mono); font-style: normal; letter-spacing: 0.05em; text-transform: uppercase; color: var(--private); }
.chat-thought .para { display: block; }
.chat-thought .para + .para { margin-top: 4px; }
.chat-gap { text-align: center; font-size: 13px; color: var(--muted); letter-spacing: 0.2em; }
.chat-toggle { margin: 14px 0 0; font: 600 13.5px var(--font); padding: 6px 14px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--secondary); cursor: pointer; }
.chat-toggle:hover { color: var(--ink); border-color: var(--axis); }
.chat-toggle[disabled] { cursor: progress; opacity: 0.7; }

/* ------------------------------------------------------------------ CSD */
.csd-layout { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.flow { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
.flow-step { position: relative; padding: 16px 18px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); }
.flow-step + .flow-step::before { content: ""; position: absolute; left: 29px; top: -17px; width: 2px; height: 16px; background: var(--axis); }
.flow-step.is-private { background: var(--private-soft); border: 1px dashed var(--private-line); }
.flow-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.flow-num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--page); font: 700 12.5px var(--font); }
.flow-what { font-weight: 660; }
.flow-what i { font-family: var(--math); font-size: 1.05em; }
.badge { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--hairline); font: 600 11px var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.badge-private { color: var(--private); border-color: var(--private-line); }
.flow-task { margin: 0 0 8px; font-size: 13.5px; color: var(--muted); }
.flow-gloss { margin: 8px 0 0; font-size: 13.5px; color: var(--secondary); }
.csd-side { display: grid; gap: 18px; }
.math-card { padding: 18px 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.math-card h3 { margin: 0 0 6px; font-size: 16px; }
.math-card > p { margin: 0 0 8px; font-size: 14.5px; color: var(--secondary); }
.math {
  display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 8px; row-gap: 2px; margin: 10px 0; padding: 10px 12px; overflow-x: auto;
  border-radius: 10px; background: var(--surface-2); font: 16px/1.5 var(--math); color: var(--ink);
}
.m-lhs { font-style: italic; }
.math > span:last-child { flex: 1 1 14em; min-width: 0; }
.m-eq { color: var(--muted); }
.m-note { color: var(--private); font-weight: 700; font-style: italic; }
.ovl { text-decoration: overline; text-decoration-thickness: 1px; }
.math sub, .math sup, .math .nw { white-space: nowrap; }
.csd-side, .flow, .math-card, .flow-step { min-width: 0; }
.math-foot { margin: 10px 0 0 !important; font-size: 13.5px !important; color: var(--muted) !important; }

/* --------------------------------------------------------------- bibtex */
.bibtex { position: relative; padding: 18px 20px; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); box-shadow: var(--shadow); }
.bibtex pre { margin: 0; padding-right: 64px; white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.65 var(--mono); color: var(--ink); }
.copy { position: absolute; top: 12px; right: 12px; font: 600 13px var(--font); padding: 5px 13px; border-radius: 999px; border: 1px solid var(--hairline); background: var(--surface); color: var(--secondary); cursor: pointer; }
.copy:hover { color: var(--ink); }
.copy-status { position: absolute; top: 17px; right: 88px; font-size: 13px; color: var(--good); }

/* --------------------------------------------------------------- footer */
.site-footer { padding: 36px 0 48px; border-top: 1px solid var(--hairline); text-align: center; font-size: 14px; color: var(--secondary); }
.site-footer p { margin: 4px 0; }

/* ----------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .stages, .behavior-grid, .csd-layout { grid-template-columns: minmax(0, 1fr); }
  .behavior-card { position: static; }
  .multiples { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .header-inner { flex-wrap: wrap; gap: 4px 12px; padding: 8px 0; min-height: 0; }
  .site-nav { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 0 -6px; }
  .theme-toggle { margin-left: auto; }
  .hero { padding: 40px 0 56px; }
  .section { padding: 64px 0; }
  .container { padding: 0 18px; }
  .stat-value { font-size: 36px; }
  .guess-grid { grid-template-columns: 1fr; }
  .chart-card, .panel, .stage, .behavior-card, .sim-example { padding: 16px; }
}
@media (max-width: 460px) {
  .stats { grid-template-columns: 1fr; }
  .multiples { grid-template-columns: 1fr; }
}

@media print {
  .site-header, .theme-toggle, .table-toggle, .controls, .copy { display: none !important; }
  .section { padding: 32px 0; break-inside: avoid; }
  body { background: #fff; }
}
