@font-face { font-family: "Leon Sans"; src: url("fonts/LeonSans-VF.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "OpenMono"; src: url("fonts/OpenMono-Regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "OpenMono"; src: url("fonts/OpenMono-Medium.woff2") format("woff2"); font-weight: 500; font-display: swap; }

/* Palette: paper/graphite neutrals with indigo, coral and amber series (validated light + dark). */
:root {
  color-scheme: light;
  --paper: #f3f1ec;
  --hover: #ebe9e3;
  --ink: #1f1e1c;
  --ink-2: #46443f;
  --ink-3: #64625d;
  --rule: #d9d7d2;
  --rule-strong: #bfbdb9;
  --bar: #1f1e1c;
  --accent: #3a4fd1;
  --heat: #3a4fd1;
  --s1: #3a4fd1;
  --s2: #e2664b;
  --s3: #906102;
  --muted-line: #c9c7c2;
  --critical: #c23b3b;
  --sans: "Leon Sans", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: "OpenMono", ui-monospace, "SF Mono", Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #1f1e1c;
    --hover: #292826;
    --ink: #f3f1ec;
    --ink-2: #bfbdb9;
    --ink-3: #a3a19f;
    --rule: #3b3a38;
    --rule-strong: #535250;
    --bar: #e7e5e0;
    --accent: #7e9aff;
    --heat: #5b78fa;
    --s1: #5b78fa;
    --s2: #b1432c;
    --s3: #c8901e;
    --muted-line: #4a4946;
    --critical: #f17771;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #1f1e1c;
  --hover: #292826;
  --ink: #f3f1ec;
  --ink-2: #bfbdb9;
  --ink-3: #a3a19f;
  --rule: #3b3a38;
  --rule-strong: #535250;
  --bar: #e7e5e0;
  --accent: #7e9aff;
  --heat: #5b78fa;
  --s1: #5b78fa;
  --s2: #b1432c;
  --s3: #c8901e;
  --muted-line: #4a4946;
  --critical: #f17771;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 430 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
}
.page { max-width: 1040px; margin: 0 auto; padding: 0 24px 64px; }
@media (max-width: 640px) { .page { padding: 0 16px 48px; } }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 560; }
strong, b { font-weight: 620; }
p { margin: 0 0 1em; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* masthead */
.masthead { border-bottom: 1px solid var(--rule); }
.mast-row { display: flex; align-items: center; gap: 10px; min-height: 52px; }
.mast-title { font: 600 14px/1 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.mast-title { color: inherit; text-decoration: none; }
.mast-link { margin-left: auto; font: 430 14px/1 var(--sans); color: var(--ink-3); text-decoration: none; }
.mast-title:hover, .mast-link:hover { text-decoration: underline; }
.mast-meta { margin-left: auto; font: 400 12px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
.theme-btn { margin-left: auto; border: 0; background: transparent; width: 32px; height: 32px; display: grid; place-items: center; cursor: pointer; color: var(--ink-3); }
.theme-btn:hover { color: var(--ink); }

/* hero */
.hero { padding: 56px 0 8px; }
.kicker { margin: 0 0 12px; font-size: 14px; color: var(--ink-3); }
.kicker-link { color: inherit; text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.kicker-link:hover { color: var(--ink); border-bottom-color: var(--ink); }
.hero h1 { font: 600 clamp(28px, 3.4vw, 34px)/1.2 var(--sans); letter-spacing: -0.02em; max-width: 30ch; margin-bottom: 20px; }
.lede { font-size: 18px; line-height: 1.6; max-width: 64ch; }
.lede-2 { font-size: 16px; max-width: 64ch; color: var(--ink-2); }

/* blocks */
.block { padding: 56px 0 8px; }
.block-head { margin-bottom: 20px; }
.block-head h2 { font: 600 22px/1.3 var(--sans); letter-spacing: -0.01em; }
.block-sub { margin: 10px 0 0; max-width: 68ch; color: var(--ink-2); }
.block-sub strong { color: var(--ink); font-weight: 620; }
.prose { max-width: 68ch; }
.note { font-size: 13px; color: var(--ink-3); max-width: 80ch; margin: 12px 0 0; }
.note a { color: inherit; text-decoration: underline; text-decoration-color: var(--rule-strong); }
.note a:hover { color: var(--ink); text-decoration-color: var(--ink); }
.mt { margin-top: 40px; }

/* controls: plain text tabs */
.controls { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin-bottom: 12px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px 16px; }
.seg button { border: 0; border-bottom: 1.5px solid transparent; background: transparent; padding: 4px 0; font-size: 14px; color: var(--ink-3); cursor: pointer; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.hint { font-size: 13px; color: var(--ink-3); margin-left: auto; }

/* tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.board { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 680px; }
.board th { text-align: left; font: 560 13px/1.25 var(--sans); color: var(--ink-2); padding: 0 10px 10px; border-bottom: 1px solid var(--ink); vertical-align: bottom; white-space: nowrap; }
.board th[data-sort] { cursor: pointer; user-select: none; }
.board th[data-sort]:hover { color: var(--ink); }
.board th[aria-sort]::after { content: " ↓"; color: var(--ink-3); }
.board th[aria-sort="ascending"]::after { content: " ↑"; }
.board td { padding: 11px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
.board tr.row { cursor: pointer; }
.board tr.row:hover td { background: var(--hover); }
.board tr.row[aria-expanded="true"] td { border-bottom-color: transparent; }
.board td.c-model, .board th.c-model { padding-left: 0; min-width: 200px; }
.m-name { font-weight: 600; display: block; }
.m-meta { font: 400 12px var(--mono); color: var(--ink-3); }
.c-pass { width: 36%; min-width: 220px; }
.c-num { text-align: right !important; white-space: nowrap; }
.board td.c-num { font: 400 13px var(--mono); }
.passcell { display: flex; align-items: center; gap: 12px; }
.passnum { font: 500 13px var(--mono); min-width: 2ch; text-align: right; }
.bar { position: relative; flex: 1; height: 20px; }
.bar .fill { position: absolute; left: 0; top: 3px; height: 10px; background: var(--bar); }
.harm-n { color: var(--critical); font-weight: 500; }
.zero { color: var(--ink-3); }

#leaderboard .added-model .m-name { color: var(--accent); }
#leaderboard .added-model .bar .fill { background: var(--accent); }

.detail td { padding: 2px 10px 24px 0; }
.detail-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; padding-top: 14px; border-top: 1px solid var(--rule); }
@media (max-width: 720px) { .detail-grid { grid-template-columns: 1fr; } }
.d-h { font: 600 13px/1 var(--sans); color: var(--ink-2); margin-bottom: 12px; }
.catrow { display: grid; grid-template-columns: 150px 1fr 40px; align-items: center; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.catrow .lab { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catrow .val { font: 12px var(--mono); text-align: right; color: var(--ink-2); }
.track { height: 6px; background: var(--rule); }
.track i { display: block; height: 100%; background: var(--bar); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font: 12px/1.6 var(--mono); word-break: break-all; }
.ctxrow { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-bottom: 16px; }
.ctxrow b { display: block; font: 500 13px var(--mono); }
.ctxrow span { font: 11px var(--mono); color: var(--ink-3); }

.plain { border-collapse: collapse; width: 100%; font-size: 14px; }
.plain th { text-align: left; font: 560 13px/1.2 var(--sans); color: var(--ink-2); padding: 8px 10px; border-bottom: 1px solid var(--ink); }
.plain td { padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.plain th:first-child, .plain td:first-child { padding-left: 0; }
.plain .r { text-align: right; font-family: var(--mono); }
.cats td:first-child { white-space: nowrap; font-weight: 600; }
.cats td:last-child { color: var(--ink-2); }

/* heatmap: square cells, one hue */
.heat { display: grid; grid-template-columns: minmax(170px, 1.6fr) repeat(9, minmax(52px, 1fr)); gap: 2px; min-width: 700px; font-size: 13px; }
.heat .hh { font: 560 12px/1.25 var(--sans); color: var(--ink-2); padding: 0 2px 8px; display: flex; align-items: flex-end; justify-content: center; text-align: center; }
.heat .hh small { display: block; font: 400 11px var(--mono); color: var(--ink-3); }
.heat .hm { padding: 6px 8px 6px 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heat .hc { display: grid; place-items: center; font: 500 12px var(--mono); min-height: 32px; cursor: default; }
.heat .hc.lt { color: var(--ink); }
.heat .hc.dk { color: #fff; }

/* charts: no card, title above, axes recessive */
.chart-card { margin: 0; min-width: 0; }
.chart-card figcaption { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
.fig-t { font-weight: 600; font-size: 15px; }
.fig-s { font-size: 13px; color: var(--ink-3); }
.chart { width: 100%; position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis text, .lbl { font: 11px var(--mono); fill: var(--ink-3); }
.lbl-strong { font: 500 12px var(--sans); fill: var(--ink); }
.grid line { stroke: var(--rule); stroke-width: 1; }
.baseline { stroke: var(--ink-3); stroke-width: 1; }
.ref line { stroke: var(--ink-3); stroke-dasharray: 2 4; stroke-width: 1; }
.ref text { font: 11px var(--mono); fill: var(--ink-3); }
.two-col { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; margin-bottom: 28px; align-items: start; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; gap: 28px; } }

/* line-chart toggles */
.chips { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-bottom: 12px; }
.chip { border: 0; background: transparent; padding: 3px 0; font-size: 13px; color: var(--ink-3); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; }
.chip i { width: 10px; height: 3px; background: var(--muted-line); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { color: var(--ink); }
.data-view { margin-top: 14px; }
.data-view summary { cursor: pointer; font-size: 13px; color: var(--ink-2); }
.data-view[open] summary { margin-bottom: 10px; }

.method-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
@media (max-width: 800px) { .method-grid { grid-template-columns: 1fr; } }
.method-grid h3, #method h3.mt { font: 600 17px/1.3 var(--sans); margin-bottom: 10px; }
.method-grid p, .method-grid li { font-size: 14px; color: var(--ink-2); }
.method-grid ul { padding-left: 18px; margin: 0; }
.learned, .next { max-width: 76ch; padding-left: 18px; }
.learned li, .next li { margin-bottom: 10px; color: var(--ink-2); }
.learned strong { color: var(--ink); font-weight: 620; }

/* changelog */
.changelog { list-style: none; margin: 0; padding: 0; max-width: 76ch; border-top: 1px solid var(--rule); }
.changelog > li { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 24px; padding: 14px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.changelog .cl-date { font: 400 13px/1.6 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.changelog .cl-summary { margin: 0; color: var(--ink); }
.changelog .cl-items { margin: 6px 0 0; padding-left: 16px; color: var(--ink-2); }
.changelog .cl-items li { margin-bottom: 3px; }
.changelog .cl-items li:last-child { margin-bottom: 0; }
.changelog-older { border-top: 0; }

.summary { margin-top: 28px; max-width: 68ch; }
.summary p { margin-bottom: 0.8em; }
.summary strong { font-weight: 620; }
.chart-card + .prose, .two-col + .prose { margin-top: 20px; }

/* tooltip */
.tip { position: fixed; z-index: 10; pointer-events: none; background: var(--ink); color: var(--paper); font: 12px/1.45 var(--sans); padding: 7px 9px; border-radius: 2px; max-width: 240px; }
.tip b { font-weight: 600; }
.tip .t-m { font-family: var(--mono); }

@media (forced-colors: active) { .seg button[aria-pressed="true"] { outline: 2px solid CanvasText; } }
@media print { .controls, .theme-btn, .chips { display: none; } }

@media (max-width: 640px) {
  .board th.c-model, .board td.c-model, .heat .sticky { position: sticky; left: 0; z-index: 1; background: var(--paper); }
  .board tr.row:hover td.c-model { background: var(--hover); }
  .board td.c-model, .board th.c-model { min-width: 150px; }
  .c-pass { min-width: 170px; }
  .heat { grid-template-columns: 124px repeat(9, minmax(52px, 1fr)); }
  .cats td:first-child { white-space: normal; }
  .cats th:nth-child(2), .cats td:nth-child(2) { width: 40px; }
  .hint { margin-left: 0; width: 100%; }
  .changelog > li { grid-template-columns: 1fr; gap: 4px; }
}
.heat .hh.sticky { z-index: 2; }

/* export mode */
body.card-mode .masthead, body.card-mode .hero, body.card-mode .block:not(.card-on), body.card-mode .controls, body.card-mode .data-view { display: none; }
body.card-mode .page { padding-top: 8px; padding-bottom: 28px; }
body.card-mode .block.card-on { padding-top: 32px; }
body.card-mode .card-on > .prose, body.card-mode .card-on > .note { display: none; }
body.card-mode .card-on::after { content: "Three-run results · MacLocalBench · Dec 2026"; display: block; margin-top: 18px; font: 12px var(--mono); color: var(--ink-3); }
body.og-mode .theme-btn { display: none; }

body.og-mode .page { max-width: 1200px; padding: 0 72px; }
body.og-mode .block, body.og-mode .lede-2 { display: none; }
body.og-mode .masthead { border-bottom: 0; }
body.og-mode .mast-row { min-height: 72px; }
body.og-mode .hero { padding-top: 92px; }
body.og-mode .kicker { font-size: 20px; margin-bottom: 18px; }
body.og-mode .hero h1 { font-size: 64px; max-width: 18ch; margin-bottom: 28px; }
body.og-mode .lede { font-size: 23px; max-width: 54ch; color: var(--ink-2); }
.mast-link + .theme-btn { margin-left: 8px; }
body.og-mode .mast-link { display: none; }
body.og-mode .lede + .lede { display: none; }
body.og-mode #updatedWrap { display: none; }

/* ---------- pipeline diagram ---------- */
.flow-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.flow { display: block; width: 100%; height: auto; min-width: 720px; }
.flow .node { fill: var(--paper); stroke: var(--rule-strong); stroke-width: 1; }
.flow .hl { fill: none; stroke: var(--accent); stroke-width: 1.5; }
.flow .t { font: 560 13.5px var(--sans); fill: var(--ink); }
.flow .s { font: 430 12px var(--sans); fill: var(--ink-3); }
.flow .lab { font: 430 12px var(--sans); fill: var(--ink-3); }
.flow .big { font: 600 32px var(--sans); fill: var(--ink); letter-spacing: -0.01em; }
.flow .k { font: 600 14px var(--sans); fill: var(--ink); }
.flow .edge { fill: none; stroke: var(--ink-3); stroke-width: 1.2; }
.flow .dash { stroke-dasharray: 4 3; }
.flow .ahp { fill: var(--ink-3); }
.flow .dot { fill: var(--accent); }
@media (prefers-reduced-motion: reduce) { .flow .dot, .flow .hl { display: none; } }
.flow-hint { margin: 0 0 8px; font-size: 13px; color: var(--ink-3); }
.flow .fn { cursor: pointer; outline: none; }
.flow .fn, .flow .edge, .flow .lab { transition: opacity .15s; }
.flow .fn:focus-visible .node { stroke: var(--accent); stroke-width: 2; }
.flow.tracing .fn:not(.on), .flow.tracing .edge:not(.on), .flow.tracing .lab:not(.on) { opacity: .2; }
.flow.tracing .fn.on .node { stroke: var(--ink-2); }
.flow.tracing .fn.sel .node { stroke: var(--accent); stroke-width: 1.5; }
.flow.tracing .edge.on { stroke: var(--ink); }
.flow.tracing .dot, .flow.tracing .hl { visibility: hidden; }
body.card-mode .flow-hint { display: none; }
.flow .edge.link { stroke: none; }
