/* Page-specific styles; the shared look (fonts, slide and paper bands, controls) comes from kit/kit.css. */

/* ------------------------------------------------------------------ model colours (categorical, local to this page) */
:root { --m-gpt2m: var(--h-theory-d); --m-gpt2xl: var(--h-env-d); --m-mistral: var(--h-bio-d); --m-qwen2: var(--h-llm-d); --brain: var(--h-brain-d); --local-bg: var(--paper); }
.dark, .stage { --m-gpt2m: var(--h-theory); --m-gpt2xl: var(--h-env); --m-mistral: var(--h-bio); --m-qwen2: var(--h-llm); --brain: var(--h-brain); --local-bg: var(--slide); }
.m-gpt2m { --mc: var(--m-gpt2m); } .m-gpt2xl { --mc: var(--m-gpt2xl); } .m-mistral { --mc: var(--m-mistral); } .m-qwen2 { --mc: var(--m-qwen2); }
.sw { display: inline-block; width: .62em; height: .62em; border-radius: 50%; background: var(--mc); margin-right: .55em; vertical-align: .02em; }
.seg button i { background: var(--c); }
.band.alt { background: var(--paper-2); }
.in.prose { max-width: 860px; }
.band h2 { margin-bottom: .6em; }
.band h3 { margin: 0 0 .5em; }
.band h3.spaced { margin-top: 2.4em; }
.after { max-width: 72ch; margin-top: 1.4em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font: 400 .86em ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper-2); padding: .08em .35em; border-radius: 4px; }
.band.dark code, .band.alt code { background: color-mix(in srgb, currentColor 10%, transparent); }
.top a { white-space: nowrap; }
.top nav a { padding: 4px 0; }

/* ------------------------------------------------------------------ the stage */
.stage .panel { display: flex; flex-direction: column; gap: 16px; }
.stage .panel > * { margin: 0; }
.stage .panel h1 { margin: 0; }
.stage h1 .t1 { display: block; font-size: clamp(1.7rem, 2.4vw, 2.2rem); line-height: 1.02; }
.stage h1 .t2 { display: block; margin-top: .6em; font: 500 1.02rem/1.32 var(--display); letter-spacing: 0; color: var(--slide-mute); font-stretch: 100%; }
.stage .meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.stage .chip { --c: var(--slide-mute); }
.stage .chip[data-a="brain"] { --c: var(--h-brain); } .stage .chip[data-a="llm"] { --c: var(--h-llm); }
.stage .st { color: var(--slide-ink); }
.stage .ctl { margin: 0; }
.stage .ctl > span { font-weight: 500; }
.stage .seg button { padding: 7px 11px; }
.check { display: flex; align-items: center; gap: .6em; font: 500 .85rem var(--display); color: var(--slide-mute); cursor: pointer; }
.check input { accent-color: var(--h-llm); width: 1.05em; height: 1.05em; margin: 0; }
.stage .legend { margin-top: 4px; }
.legend .bar { display: inline-block; width: 120px; height: 10px; border-radius: 5px; flex: none; }
.stage .legend { flex-wrap: wrap; }

.verdict { margin: 0; display: grid; gap: 12px; }
.verdict .vrow { display: grid; grid-template-columns: 5.2rem 1fr; gap: 10px; align-items: baseline; }
.verdict dt { font: 600 .82rem var(--display); color: var(--slide-mute); }
.verdict dd { margin: 0; font: 400 .92rem/1.4 var(--text); color: var(--slide-ink); }
.verdict dd b { font: 650 1.02rem var(--display); }
.vbar { position: relative; display: block; height: 5px; margin-top: 7px; border-radius: 3px; background: var(--slide-3); }
.vbar i { display: block; height: 100%; border-radius: 3px; background: var(--slide-ink); }
.vbar u { position: absolute; top: -3px; width: 1px; height: 11px; background: var(--slide-mute); }

.inspect { position: absolute; z-index: 3; right: 0; top: 0; width: 248px; padding: 20px 20px 16px 0; }
.stage .h4 { font: 620 .95rem/1.25 var(--display); margin: 0 0 4px; }
.stage .mini { font: 400 .9rem/1.5 var(--text); color: var(--slide-mute); margin: 0 0 12px; max-width: none; }
.pick { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.pick label { display: flex; align-items: center; gap: 8px; font: 500 .82rem var(--display); color: var(--slide-mute); }
.pick input { width: 4.2em; font: 500 .85rem var(--display); color: var(--slide-ink); background: var(--slide-3); border: 1px solid var(--slide-line); border-radius: 8px; padding: 5px 7px; }

.stage { height: clamp(620px, calc(100svh - 56px), 940px); min-height: 0; }
.stage .viewer { min-height: 0; height: 100%; }
.view3d { position: absolute; inset: 0; overflow: hidden; }
.stage .panel { overflow-y: auto; }
.stage canvas.gl { z-index: 0; }
.stage .still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.hint { position: absolute; z-index: 2; right: 18px; bottom: 14px; max-width: 250px; margin: 0; text-align: right; font: 500 .8rem/1.4 var(--display); color: var(--slide-mute); pointer-events: none; }
.ruler { position: absolute; z-index: 2; left: 10px; top: 14px; bottom: 14px; width: 168px; }
.ruler svg { display: block; width: 100%; height: 100%; cursor: ns-resize; overflow: visible; }
.ruler .lanebg { fill: color-mix(in srgb, var(--slide-ink) 6%, transparent); }
.ruler .laneref { stroke: var(--slide-mute); stroke-width: 1; stroke-dasharray: 2 3; opacity: .7; }
.ruler .lanepath { stroke-width: 1.7; stroke-linejoin: round; }
.ruler text { font: 500 11px var(--display); }
.ruler .lanelab { fill: var(--slide-mute); font: 500 11px var(--display); }
.ruler .t.mute { fill: var(--slide-mute); opacity: 1; }
.ruler .cursorline { stroke: var(--slide-ink); stroke-width: 1; opacity: .75; }
.ruler .cursormark { fill: var(--slide-ink); }
.ruler.nogl { position: static; width: auto; height: 280px; margin: 16px; }
.stage .tip { z-index: 4; }

/* ------------------------------------------------------------------ layout helpers */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: clamp(28px, 4vw, 60px); align-items: start; margin-top: 2.2rem; }
.two.split { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 3rem; padding-top: 2.4rem; border-top: 1px solid var(--paper-line); }
.chart { position: relative; width: 100%; }
.chart svg { display: block; max-width: 100%; overflow: hidden; }
.controls { display: flex; flex-wrap: wrap; gap: 14px 32px; margin: 1.6rem 0 1.8rem; }
.controls .ctl { margin: 0; }
.row2 { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: 2.2rem 0 .4rem; }
.row2 h3 { margin: 0; }
.brainrow { display: grid; grid-template-columns: minmax(250px, 340px) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.glasswrap { position: sticky; top: 76px; }
.glass { position: relative; width: 100%; aspect-ratio: 1 / 1; background: var(--slide-2); border: 1px solid var(--slide-line); border-radius: 12px; overflow: hidden; }
.glass canvas.gl { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.glass.nogl::after { content: "WebGL is not available here; use the region buttons."; position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; text-align: center; color: var(--slide-mute); font: 500 .85rem var(--display); }
.glasswrap .legend { margin-top: 10px; }
.glasswrap figcaption { font-size: .88rem; }
.band.dark .tip, .glass .tip { z-index: 4; }

/* ------------------------------------------------------------------ chart parts (colour follows the band through currentColor) */
.chart .t { fill: currentColor; font: 500 12px var(--display); }
.chart .t.mute, .chart .mute { opacity: .66; }
.chart .t.small { font-size: 11px; }
.chart .t.lab { font-weight: 650; font-size: 13px; }
.chart .grid { stroke: currentColor; stroke-opacity: .13; stroke-width: 1; }
.chart .zero { stroke: currentColor; stroke-opacity: .5; stroke-width: 1; }
.chart .ref { stroke: currentColor; stroke-opacity: .5; stroke-dasharray: 4 4; }
.chart .ref2 { stroke: currentColor; stroke-opacity: .85; stroke-dasharray: 1 4; stroke-width: 1.6; stroke-linecap: round; }
.chart .cursor { stroke: currentColor; stroke-opacity: .5; }
.chart .ln { stroke: var(--mc); stroke-width: 1.7; opacity: .55; stroke-linejoin: round; }
.chart .ln.on { stroke-width: 3; opacity: 1; }
.chart .ln.dash { stroke-dasharray: 6 4; }
.chart .pk, .chart .dot { fill: var(--mc); stroke: var(--local-bg); stroke-width: 1.5; }
.chart .band { fill: var(--brain); fill-opacity: .3; }
.chart .band.soft { fill-opacity: .13; }
.chart .bandline { stroke: var(--brain); stroke-width: 2; stroke-dasharray: 5 3; }
.chart .row { cursor: pointer; outline-offset: -2px; }
.chart .rowbg { fill: transparent; }
.chart .row:hover .rowbg { fill: currentColor; fill-opacity: .05; }
.chart .row.sel .rowbg { fill: currentColor; fill-opacity: .09; }
.chart .pt { fill: var(--mc); stroke: var(--local-bg); stroke-width: 1.5; opacity: .85; }
.chart .pt.on { opacity: 1; }
.chart .ci { stroke: currentColor; stroke-width: 2; stroke-opacity: .75; }
.chart .ci.cap { stroke-width: 1.5; }
.chart .link { stroke: currentColor; stroke-opacity: .45; stroke-width: 1.5; stroke-dasharray: 2 3; }
.chart .dotA, .chart .dotB { transition: transform .55s var(--ease), opacity .3s var(--ease); }
.chart .dotA { fill: var(--local-bg); stroke: currentColor; stroke-width: 2.2; }
.chart .dotB { fill: var(--brain); stroke: var(--local-bg); stroke-width: 1.5; }
.chart .off { opacity: 0; }
.chart .msg { margin: 8px 0 0; max-width: 60ch; }
.chart .tip { z-index: 5; }
.chart .tip b { font-weight: 650; }
.tip .sw { margin-right: .45em; }
.chart svg:focus-visible { outline: 2px solid var(--h-brain); outline-offset: 2px; }

/* readouts under the charts */
ul.scrub { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 20px; font: 500 .85rem/1.4 var(--display); }
ul.scrub li { display: flex; align-items: baseline; gap: .4em; flex-wrap: wrap; }
ul.scrub b { font-weight: 650; margin-left: auto; font-variant-numeric: tabular-nums; }
ul.scrub small, td small { color: inherit; opacity: .62; font: 500 .78rem var(--display); }

/* ------------------------------------------------------------------ tables with bars */
table.data th[scope="row"] { font-weight: 600; color: inherit; white-space: nowrap; }
table.data thead th { vertical-align: bottom; }
.band.dark table.data th, .band.dark table.data td { border-bottom-color: var(--slide-line); }
.band.dark table.data th { color: var(--slide-mute); }
.band.dark table.data th[scope="row"] { color: var(--slide-ink); }
table.data td { vertical-align: top; }
table.data td b { font-weight: 650; }
table.data td small { display: block; }
table#ablTable td:nth-child(3), table#ablTable td:nth-child(4), table#ablTable td:nth-child(6) { min-width: 108px; }
table.bars td { min-width: 72px; }
table.bars th, table.bars td { padding-left: 8px; padding-right: 8px; }
table.bars th:first-child { padding-left: 0; }
table.data th small { margin-left: .35em; opacity: .62; font: 500 .72rem var(--display); }
.chart + .note, ul.scrub + .note { margin-top: 14px; }
.track { position: relative; display: block; height: 6px; border-radius: 3px; background: color-mix(in srgb, currentColor 14%, transparent); margin-bottom: 6px; }
.track i { display: block; height: 100%; border-radius: 3px; background: var(--brain); }
.track u { position: absolute; top: -3px; left: 50%; width: 0; height: 12px; border-left: 1px dashed currentColor; opacity: .7; }
table#ablTable td:nth-child(3) .track i, table#ablTable td:nth-child(4) .track i { background: var(--m-qwen2); }
.band:not(.dark) table#ablTable .track i { background: var(--h-llm-d); }
.band:not(.dark) .track i { background: var(--h-llm-d); }
.band.dark .track i { background: var(--h-brain); }
table.bars .track i { background: var(--slide-ink); }
table.data .btn { white-space: nowrap; padding: 6px 12px; }
.spark { display: inline-flex; align-items: flex-end; gap: 2px; height: 20px; vertical-align: -3px; margin-right: 8px; }
.spark i { width: 5px; background: color-mix(in srgb, currentColor 35%, transparent); border-radius: 1px; }
.spark i.used { background: var(--brain); }

/* ------------------------------------------------------------------ waffle and sliders */
.waffle { display: grid; grid-template-columns: repeat(36, 1fr); gap: 2px; margin: 16px 0 10px; max-width: 560px; }
.waffle i { aspect-ratio: 1; border-radius: 1.5px; background: color-mix(in srgb, var(--ink) 13%, transparent); transition: background-color .6s var(--ease); }
.waffle i.a { background: var(--h-brain-d); } .waffle i.b { background: color-mix(in srgb, var(--h-brain-d) 55%, var(--paper)); }
.waffle[data-view="fdr"] i.a, .waffle[data-view="fdr"] i.b { background: color-mix(in srgb, var(--ink) 13%, transparent); }
.lv { display: flex; justify-content: space-between; align-items: baseline; font: 500 .85rem var(--display); color: var(--ink-mute); }
.lv b { color: var(--ink); font-weight: 650; }
.seg + .chart, .ctl + .chart { margin-top: 12px; }
#selSeg, #wafSeg { margin: 6px 0 12px; }
#selChart { margin: 8px 0 0; }
:root[data-theme="dark"] .waffle i.b, :root:not([data-theme="light"]) .waffle i.b { }

/* ------------------------------------------------------------------ verdict */
.verdict2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 1.4rem; }
.verdict2 > div { padding-right: clamp(20px, 4vw, 56px); }
.verdict2 > div + div { padding-right: 0; padding-left: clamp(20px, 4vw, 56px); border-left: 1px solid var(--paper-line); }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: .8em 0; border-top: 1px solid var(--paper-line); max-width: 56ch; }
ul.plain li:first-child { border-top: 0; padding-top: 0; }
.cite pre { white-space: pre; }
.authors { margin-top: 1.4em; }

@media (max-width: 1180px) {
  .stage .viewer { display: flex; flex-direction: column; }
  .view3d { position: relative; inset: auto; flex: 1 1 auto; min-height: 0; }
  .inspect { position: static; flex: none; width: 100%; padding: 10px 20px 16px 190px; border-top: 1px solid var(--slide-line); }
  .hint { display: none; }
}
@media (max-width: 1000px) {
  .brainrow { grid-template-columns: minmax(0, 1fr); } .glasswrap { position: static; max-width: 420px; }
}
@media (max-width: 860px) {
  .two, .two.split, .verdict2 { grid-template-columns: minmax(0, 1fr); }
  .verdict2 > div + div { padding-left: 0; border-left: 0; border-top: 1px solid var(--paper-line); margin-top: 2rem; padding-top: 2rem; }
  .verdict2 > div { padding-right: 0; }
  .stage { height: auto; }
  .stage .viewer { height: auto; }
  .view3d { flex: none; height: 500px; }
  .ruler { width: 132px; }
  .inspect { padding: 14px 20px 20px; }
  .top nav { display: none; }
}
@media (max-width: 520px) {
  body { font-size: 17px; }
  .ruler { width: 112px; }
  .view3d { height: 460px; }
}

/* ------------------------------------------------------------------ embed and thumbnail modes */
.embedcap { display: none; }
html.embed .stage { height: 100svh; min-height: 0; grid-template-columns: minmax(0, 1fr) minmax(280px, 380px); }
html.embed .stage .viewer { display: block; height: 100%; }
html.embed .view3d { position: absolute; inset: 0; height: auto; }
html.embed .inspect, html.embed .hint { display: none; }
html.embed .embedcap { display: block; position: absolute; z-index: 2; left: 0; right: 0; bottom: 10px; margin: 0; text-align: center; font: 600 .85rem var(--display); color: var(--slide-mute); pointer-events: none; }
@media (max-width: 760px) { html.embed .stage { grid-template-columns: minmax(0, 1fr); } html.embed .stage .panel { display: none; } }
html.thumb .top, html.thumb .stage .panel, html.thumb .hint, html.thumb .sitefoot, html.thumb main > section:not(.stage) { display: none; }
html.thumb .stage { grid-template-columns: 1fr; height: 100svh; }
html.thumb .stage .viewer { height: 100%; }
html.thumb .inspect { display: none; }
html.thumb .loading { display: none; }

.prose .tablewrap { margin: 1.6rem 0 1.8rem; }

.tablewrap { position: relative; }

.marklist { list-style: none; margin: -4px 0 0; padding: 0; display: grid; gap: 5px; }
.marklist[hidden] { display: none; }
.markbtn { width: 100%; text-align: left; font: 500 .8rem/1.35 var(--display); color: var(--slide-ink); background: var(--slide-3); border: 1px solid var(--slide-line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.markbtn:hover { border-color: var(--slide-mute); }
.markbtn b { font-weight: 650; }
.stage .note.small { font-size: .8rem; line-height: 1.45; margin: 0; }
.inspect .marklist { margin: 14px 0 0; }
.inspect .note.small { margin-top: 14px; }
