/* Layout: one reading column (~66ch) with figures that break out to a wider
   measure; a quiet sticky chapter bar; the hero pairs the title with the
   100-task score mosaic. Cobalt is the only loud color; the other three hues are
   reserved for data series. */
:root {
  --paper: #ffffff;
  --card: #ffffff;
  --ink: #111318;
  --ink-2: #474c56;
  --ink-3: #6b7079;
  --rule: #e6e7eb;
  --wash: #f3f4f6;
  --cobalt: #2f56d9;
  --cobalt-ink: #2446b8;
  --coral: #e8553a;
  --teal: #0f9d84;
  --amber: #a87400;
  --met: #2f8f46;
  --bad: #b8205a;
  --luna-lt: #f0a48f;
  --luna-dk: #9a2d18;
  --na: #8d95a3;
  --shadow: 0 2px 10px rgba(11, 13, 18, .06);
  --f-display: "Inter Tight", "Inter", "Helvetica Neue", "Segoe UI", system-ui, sans-serif;
  --f-body: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --measure: 40rem;
  --wide: 66rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0a0b0f; --card: #0a0b0f; --ink: #f3f4f7; --ink-2: #b9bec9; --ink-3: #8a909c;
    --rule: #242833; --wash: #161922; --cobalt: #6f8cff; --cobalt-ink: #93a8ff;
    --coral: #e5603f; --teal: #1fa98b; --amber: #b8871a; --met: #4cc46a; --bad: #ff5f86; --na: #7d8493; --luna-lt: #8f3b27; --luna-dk: #ffb7a3;
    --shadow: 0 2px 10px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0a0b0f; --card: #0a0b0f; --ink: #f3f4f7; --ink-2: #b9bec9; --ink-3: #8a909c;
  --rule: #242833; --wash: #161922; --cobalt: #6f8cff; --cobalt-ink: #93a8ff;
  --coral: #e5603f; --teal: #1fa98b; --amber: #b8871a; --met: #4cc46a; --bad: #ff5f86; --na: #7d8493; --luna-lt: #8f3b27; --luna-dk: #ffb7a3;
  --shadow: 0 2px 10px rgba(0, 0, 0, .4);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 4rem; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 1.125rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
  padding-inline: 1rem;
  padding-block: 0;
}
a { color: var(--cobalt-ink); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--f-display); text-wrap: balance; letter-spacing: -0.02em; margin: 0; }
p { margin: 0; }
.mono { font-family: var(--f-mono); font-size: .82em; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- top bar ---------- */
.bar {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  margin-inline: -1rem; padding-inline: 1rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.bar-in { max-width: var(--wide); margin: 0 auto; display: flex; align-items: center; gap: 1.25rem; height: 3.25rem; }
.brand { font-family: var(--f-display); font-weight: 600; font-size: 1rem; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; white-space: nowrap; }
.brand b { color: var(--cobalt); font-weight: 600; }
.chapters { display: flex; gap: .15rem; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.chapters::-webkit-scrollbar { display: none; }
.chapters a {
  font-family: var(--f-display); font-size: .86rem; font-weight: 500; color: var(--ink-3);
  text-decoration: none; padding: .3rem .6rem; border-radius: 999px; white-space: nowrap; transition: color .2s, background .2s;
}
.chapters a:hover { color: var(--ink); background: var(--wash); }
.chapters a.on { color: var(--ink); background: var(--wash); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; background: var(--cobalt); width: 0; transition: width .1s linear; }

/* ---------- hero ---------- */
.hero { max-width: var(--wide); margin: 0 auto; padding-block: 2.5rem 2.5rem; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 3rem; align-items: start; }
.eyebrow { font-family: var(--f-mono); font-size: .76rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.eyebrow .pill { color: var(--ink-2); border: 1px solid var(--rule); padding: .1rem .5rem; border-radius: 999px; }
.title { margin-top: 1rem; }
.title .big { display: block; font-size: clamp(3rem, 7.5vw, 5.4rem); font-weight: 600; line-height: .95; letter-spacing: -0.04em; }
.title .big b { color: var(--cobalt); font-weight: 600; }
.title .sub { display: block; margin-top: .9rem; font-size: clamp(1.3rem, 2.4vw, 1.75rem); font-weight: 400; line-height: 1.15; letter-spacing: -0.02em; color: var(--ink-2); }
.lede + .lede { margin-top: .9rem; }
.lede { margin-top: 1.5rem; font-size: 1.2rem; line-height: 1.58; max-width: 34rem; }
.byline { margin-top: 1.25rem; font-family: var(--f-display); font-size: .92rem; line-height: 1.5; color: var(--ink-2); }
.byline sup { font-size: .68em; color: var(--ink-3); margin-left: 1px; }
.byline .aff { display: block; margin-top: .2rem; font-size: .84rem; color: var(--ink-3); }
.facts { margin-top: 1.6rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; font-family: var(--f-mono); font-size: .8rem; color: var(--ink-2); }
.facts small { display: block; font-size: .7rem; color: var(--ink-3); }
.facts b { display: block; font-family: var(--f-display); font-size: 1.35rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; margin-right: .35rem; }

.mosaic-wrap { margin: 0; min-width: 0; width: 100%; max-width: 27rem; justify-self: end; }
.mosaic { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 5px; }
.tile {
  aspect-ratio: 1; max-width: 100%; border: 0; padding: 0; border-radius: 3px; cursor: pointer;
  background: color-mix(in oklab, var(--cobalt) calc(var(--v) * 1%), var(--wash));
  transition: transform .18s ease, box-shadow .18s ease, background .5s ease;
  position: relative;
}
.mosaic.cat .tile { background: var(--cc); }
.tile { transition: transform .18s ease, box-shadow .18s ease, background .45s ease calc(var(--w, 0) * 1ms); }
.tile.na { background: repeating-linear-gradient(135deg, var(--rule) 0 2px, transparent 2px 5px); }
.tile.z::after { content: ""; position: absolute; top: 3px; right: 3px; width: 28%; height: 28%; max-width: 9px; max-height: 9px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 1.5px var(--card); }
.mm-row { display: flex; align-items: center; gap: .5rem; min-width: 0; max-width: 100%; }
.seg.scroll { overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.seg.scroll::-webkit-scrollbar { display: none; }
@media (max-width: 620px) {
  .chapters, .seg.scroll { -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 24px), transparent); }
  .chapters a, .seg button { padding-top: .55rem; padding-bottom: .55rem; }
}
.tour { flex: none; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--rule); background: var(--card); cursor: pointer; display: grid; place-items: center; color: var(--ink); }
.tour svg { width: .85rem; height: .85rem; fill: currentColor; }
.tour[aria-pressed="true"] { border-color: var(--cobalt); color: var(--cobalt-ink); }
.zkey { display: inline-flex; align-items: center; gap: .3rem; margin-left: .6rem; }
.zkey::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--bad); }
.tile:hover, .tile.hot { transform: scale(1.18); box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--ink); z-index: 2; }
.tile.dim { opacity: .25; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.mosaic.intro .tile { animation: pop .5s cubic-bezier(.2, .8, .2, 1.2) backwards; animation-delay: calc(var(--i) * 9ms); }
.mosaic-cap { margin-top: .9rem; min-height: 4.4rem; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .15rem .7rem; align-items: baseline; }
.mosaic-cap .id { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-3); }
.mosaic-cap .t { font-family: var(--f-display); font-weight: 600; font-size: 1.05rem; line-height: 1.25; }
.mosaic-cap .m { grid-column: 2; font-family: var(--f-display); font-size: .85rem; color: var(--ink-3); }
.mosaic-foot { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-top: .4rem; }
.ramp { display: flex; align-items: center; gap: .5rem; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); }
.ramp i { width: 80px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--wash), var(--cobalt)); }
.catkey { display: flex; flex-wrap: wrap; gap: .25rem .8rem; font-family: var(--f-display); font-size: .78rem; color: var(--ink-2); }
.dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--cc); margin-right: .35rem; vertical-align: .02em; }

/* ---------- segmented control ---------- */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 999px; background: var(--wash); border: 1px solid var(--rule); }
.seg button { border: 0; background: transparent; padding: .32rem .8rem; border-radius: 999px; font-family: var(--f-display); font-size: .84rem; font-weight: 500; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--rule); background: var(--card);
  padding: .45rem .9rem; border-radius: 999px; font-family: var(--f-display); font-size: .88rem; font-weight: 600; cursor: pointer;
  transition: border-color .2s, transform .1s;
}
.btn:hover { border-color: var(--ink-3); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--cobalt); border-color: var(--cobalt); color: #fff; }
:root[data-theme="dark"] .btn.primary { color: #0a0b0f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary { color: #0a0b0f; } }
.btn svg { width: 1em; height: 1em; }

/* ---------- article ---------- */
main { padding-bottom: 4rem; }
section.chapter { max-width: var(--wide); margin: 0 auto; padding-block: 3.5rem 1rem; border-top: 1px solid var(--rule); }
.prose { max-width: var(--measure); margin: 0 auto; display: grid; gap: 1.15rem; }
.kicker { font-family: var(--f-mono); font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2); }
h2 { font-size: clamp(1.6rem, 3.1vw, 2.15rem); font-weight: 600; line-height: 1.12; margin-top: -.4rem; }
h3 { font-size: 1.25rem; font-weight: 650; line-height: 1.25; }
.prose ul { margin: 0; padding-left: 1.2rem; display: grid; gap: .55rem; }
.prose li::marker { color: var(--cobalt); }
.aside { font-size: 1rem; color: var(--ink-2); border-left: 2px solid var(--rule); padding-left: 1rem; }

figure { margin: 2.25rem auto; max-width: var(--wide); }
figure.narrow { max-width: 50rem; }
.panel { background: var(--card); border: 1px solid var(--rule); border-radius: 16px; padding: 1.5rem; min-width: 0; }
figcaption { max-width: var(--measure); margin: .85rem auto 0; font-family: var(--f-display); font-size: .86rem; line-height: 1.5; color: var(--ink-3); }
figcaption b { color: var(--ink-2); font-weight: 600; }
.fig-head { display: flex; justify-content: space-between; align-items: center; gap: .75rem 1rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.fig-title { font-family: var(--f-display); font-weight: 650; font-size: 1.02rem; letter-spacing: -0.01em; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; font-family: var(--f-display); font-size: .82rem; color: var(--ink-2); }
.sw { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; margin-right: .35rem; vertical-align: -.05em; }
.chart { position: relative; width: 100%; min-width: 0; }
.chart svg { display: block; overflow: visible; }
.chart text { font-family: var(--f-display); fill: var(--ink-3); font-size: 12px; }
.chart .gl { stroke: var(--rule); stroke-width: 1; }
.chart .ax { stroke: var(--ink-3); stroke-width: 1; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; background: var(--ink); color: var(--paper);
  font-family: var(--f-display); font-size: .8rem; line-height: 1.4; padding: .5rem .65rem; border-radius: 8px;
  max-width: 260px; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s;
}
.tip.on { opacity: 1; transform: none; }
.tip b { font-weight: 650; }
.tip .r { display: flex; justify-content: space-between; gap: 1rem; font-variant-numeric: tabular-nums; }
details.table { margin-top: 1rem; font-family: var(--f-display); font-size: .85rem; }
details.table summary { cursor: pointer; color: var(--ink-2); }
.tscroll { overflow-x: auto; margin-top: .6rem; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: right; padding: .35rem .6rem; border-bottom: 1px solid var(--rule); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-weight: 600; color: var(--ink-2); }
table.cmp { font-family: var(--f-display); font-size: .86rem; line-height: 1.4; }
table.cmp th, table.cmp td { text-align: left; white-space: normal; vertical-align: top; padding: .55rem .7rem; }
table.cmp thead th { color: var(--ink); border-bottom: 1.5px solid var(--ink-3); }
table.cmp tbody th { width: 22%; color: var(--ink-2); font-weight: 500; }
table.cmp td { width: 39%; color: var(--ink); }
@media (max-width: 620px) {
  table.cmp, table.cmp tbody, table.cmp tr, table.cmp th, table.cmp td { display: block; width: auto; }
  table.cmp thead { display: none; }
  table.cmp tr { padding: .5rem 0; border-bottom: 1px solid var(--rule); }
  table.cmp th, table.cmp td { border: 0; padding: .15rem 0; }
  table.cmp tbody th { font-weight: 600; color: var(--ink); width: auto; }
  table.cmp td { width: auto; }
  table.cmp td:nth-of-type(1)::before { content: "Odysseys: "; color: var(--ink-3); }
  table.cmp td:nth-of-type(2)::before { content: "Odysseys2: "; color: var(--ink-3); }
  table.cmp-j td:nth-of-type(1)::before { content: "Old judge: "; }
  table.cmp-j td:nth-of-type(2)::before { content: "New judge: "; }
}

/* ---------- then vs now ---------- */
.then-now { display: grid; gap: 1.1rem; }
.tn-row { display: grid; grid-template-columns: 13rem minmax(0, 1fr); gap: 1rem; align-items: center; }
.tn-row .lab { font-family: var(--f-display); font-size: .92rem; line-height: 1.3; }
.tn-row .lab small { display: block; color: var(--ink-3); font-size: .8rem; }
.track { position: relative; height: 1.6rem; margin-right: 3.6rem; }
.track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--wash); }
.fill { position: absolute; left: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--ink-3); }
.fill span { position: absolute; left: 100%; top: 50%; transform: translateY(-50%); margin-left: .6rem; font-family: var(--f-display); font-weight: 600; font-size: .95rem; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.fill.now { background: var(--ink); }
.play .fill { animation: grow 1.1s cubic-bezier(.2, .8, .2, 1) backwards; }
.play .tn-row:nth-child(2) .fill { animation-delay: .25s; }
.play .tn-row:nth-child(3) .fill { animation-delay: .5s; }
@keyframes grow { from { width: 0; } }
.axis-note .axt { text-align: center; }
@media (max-width: 620px) { .axis-note { flex-wrap: wrap; margin-left: 0 !important; } .axis-note .axt { order: 3; width: 100%; } }
.axis-note { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); margin-left: 14rem; margin-right: 3.6rem; }

/* ---------- task anatomy ---------- */
.anat-tabs { display: flex; gap: .4rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: .35rem .75rem; font-family: var(--f-display); font-size: .84rem; cursor: pointer; transition: border-color .2s, background .2s; white-space: nowrap; }
.chip:hover { border-color: var(--ink-3); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.anat { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 1.5rem; margin-top: 1.2rem; }
.req { background: var(--wash); border-radius: 12px; padding: 1.1rem 1.2rem; min-width: 0; display: flex; flex-direction: column; }
.req-meta { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); margin-bottom: .6rem; }
.req h3 { margin-bottom: .6rem; }
.req-text { font-size: .98rem; line-height: 1.6; flex: 1 1 0; min-height: 12rem; overflow-y: auto; padding-right: .4rem; -webkit-mask-image: linear-gradient(#000 calc(100% - 2rem), transparent); mask-image: linear-gradient(#000 calc(100% - 2rem), transparent); }
@media (max-width: 880px) { .req-text { flex: none; max-height: 22rem; } }
.rubric { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; align-content: start; min-width: 0; }
.rubric li button {
  width: 100%; text-align: left; border: 1px solid var(--rule); background: var(--card); border-radius: 10px; padding: .55rem .7rem;
  display: grid; grid-template-columns: 2.2rem minmax(0, 1fr) 1rem; gap: .5rem; align-items: baseline; cursor: pointer; transition: border-color .2s;
}
.rubric li button:hover { border-color: var(--ink-3); }
.rubric .rid { font-family: var(--f-mono); font-size: .76rem; color: var(--cobalt-ink); }
.rubric .rn { font-family: var(--f-display); font-size: .92rem; font-weight: 600; line-height: 1.3; }
.rubric .rq { grid-column: 2 / 4; font-size: .9rem; line-height: 1.5; color: var(--ink-2); }
.rubric .chev { font-family: var(--f-mono); color: var(--ink-3); transition: transform .2s; }
.rubric button[aria-expanded="true"] .chev { transform: rotate(45deg); }
.rubric-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; font-family: var(--f-display); font-size: .85rem; color: var(--ink-3); }
.cats { margin-top: 1.5rem; max-width: 46rem; font-family: var(--f-display); }
.cats h3 { font-size: 1rem; margin-bottom: 1rem; }
.cat-b { display: grid; grid-template-columns: 9rem minmax(0, 1fr) 3rem; align-items: center; gap: .7rem; margin: .6rem 0; font-size: .85rem; }
.cat-b .n { text-align: right; font-family: var(--f-mono); font-size: .8rem; }
.cat-b .bar-s { height: 20px; background: var(--wash); overflow: hidden; }
.cat-b .bar-s i { display: block; height: 100%; background: var(--cc); }
.cat-axis { position: relative; height: 1rem; margin: .5rem 3.7rem 0 9.7rem; color: var(--ink-3); font: .65rem var(--f-mono); }
.paper-plot-scroll { overflow-x: auto; border-radius: 6px; background: white; }
.paper-plot { display: block; width: 100%; min-width: 900px; height: auto; }
@media (max-width: 620px) {
  .cat-b { grid-template-columns: 7rem minmax(0, 1fr) 2.5rem; gap: .4rem; font-size: .75rem; }
  .cat-axis { margin-left: 7.4rem; margin-right: 2.9rem; }
}

/* ---------- grading demo ---------- */
.verdicts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.verdict { border: 1px solid var(--rule); border-radius: 12px; padding: .9rem 1rem; background: var(--card); font-size: .95rem; line-height: 1.5; min-width: 0; }
.verdict h3 { font-size: 1rem; display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.vmark { width: 1.1rem; height: 1.1rem; border-radius: 50%; display: inline-grid; place-items: center; color: var(--card); font-size: .7rem; font-weight: 650; flex: none; }
.vmark.met { background: var(--met); }
.vmark.bad { background: var(--bad); }
.vmark.na { background: transparent; border: 2px dashed var(--na); }

.grade { display: grid; grid-template-columns: minmax(0, 1fr) 13rem; gap: 1.5rem; align-items: start; }
.pips { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); gap: 6px; margin: .9rem 0 .5rem; }
.pip { min-height: 3rem; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem; font: 500 .78rem/1.2 var(--f-display); border-radius: 6px; background: var(--wash); border: 1.5px solid var(--rule); }
.pip.met { background: var(--met); border-color: var(--met); color: white; }
.item-result { font: 400 .95rem/1.5 var(--f-display); margin: 1.1rem 0 .5rem; }
.item-result b { color: var(--bad); }
.quote { margin-top: 1rem; font-size: .95rem; line-height: 1.55; color: var(--ink-2); border-left: 2px solid var(--cobalt); padding-left: .9rem; }
.quote cite { display: block; font-style: normal; font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); margin-top: .35rem; }
.score-card { text-align: center; border: 1px solid var(--rule); border-radius: 12px; padding: 1rem; background: var(--wash); }
.score-card .lbl { font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); }
.score-card .val { font-family: var(--f-display); font-weight: 600; font-size: 3.4rem; letter-spacing: -0.04em; line-height: 1; margin: .3rem 0 .2rem; transition: color .3s; }
.score-card .val.zero { color: var(--bad); }
.score-card .why { font-family: var(--f-display); font-size: .82rem; color: var(--ink-2); min-height: 2.5em; }
.switch { display: flex; align-items: center; gap: .6rem; margin-top: .9rem; font-family: var(--f-display); font-size: .88rem; cursor: pointer; justify-content: center; }
.switch input { appearance: none; width: 2.4rem; height: 1.35rem; border-radius: 999px; background: var(--rule); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: calc(1.35rem - 6px); height: calc(1.35rem - 6px); border-radius: 50%; background: var(--card); transition: transform .2s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.switch input:checked { background: var(--bad); }
.switch input:checked::after { transform: translateX(1.05rem); }

/* raw vs final */
.rf { display: grid; gap: .8rem; }
.rf-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) 7.5rem; gap: .9rem; align-items: center; }
.rf-name { font-family: var(--f-display); font-weight: 600; font-size: .92rem; }
.rf-track { position: relative; height: 1.5rem; }
.rf-track::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; background: var(--wash); }
.rf-raw, .rf-fin { position: absolute; left: 0; top: 50%; height: 10px; margin-top: -5px; border-radius: 5px; transition: width .7s cubic-bezier(.2, .8, .2, 1); }
.rf-raw { background: repeating-linear-gradient(135deg, var(--cc) 0 1.5px, transparent 1.5px 5px); opacity: .5; }
.rf-fin { background: var(--cc); }
.rf-num { font-family: var(--f-display); font-size: .85rem; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.rf-num b { color: var(--ink); font-size: 1rem; }

/* case */
.case { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.shot { margin: 0; min-width: 0; }
.shot img { display: block; width: 100%; border-radius: 10px; border: 1px solid var(--rule); }
.shot .who { display: flex; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: .6rem; font-family: var(--f-display); font-size: .9rem; font-weight: 600; }
.shot .stats { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .25rem; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }
.shot p { font-size: .92rem; color: var(--ink-2); margin-top: .4rem; line-height: 1.5; }
.tag { font-family: var(--f-display); font-size: .78rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px; white-space: nowrap; }
.tag.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.tag.ok { color: var(--met); background: color-mix(in srgb, var(--met) 14%, transparent); }

/* judges dumbbell */
.db { position: relative; }
.db-axis { position: relative; height: 1.4rem; margin-left: var(--lw); margin-right: 2.4rem; border-bottom: 1px solid var(--rule); }
.db-axt { margin-left: var(--lw); margin-right: 2.4rem; text-align: center; font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); padding-top: .2rem; }
.db-axis span { position: absolute; transform: translateX(-50%); font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); }
.db-rows { position: relative; }
.db-row { position: absolute; left: 0; right: 0; height: 2rem; display: grid; grid-template-columns: var(--lw) minmax(0, 1fr); align-items: center; transition: transform .7s cubic-bezier(.3, .7, .2, 1); }
.db-name { font-family: var(--f-display); font-size: .88rem; font-weight: 500; padding-right: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-name small { color: var(--ink-3); font-weight: 400; }
.db-plot { position: relative; height: 100%; margin-right: 2.4rem; background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: 25% 100%; }
.db-line { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: color-mix(in srgb, var(--ink-3) 45%, transparent); transition: left .7s cubic-bezier(.3, .7, .2, 1), width .7s cubic-bezier(.3, .7, .2, 1), opacity .4s; }
.db-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; transition: left .7s cubic-bezier(.3, .7, .2, 1), opacity .4s; box-shadow: 0 0 0 2px var(--card); }
.db-dot.old { background: var(--card); border: 2px solid var(--ink-3); }
.db-dot.new { background: var(--ink); }
.db-val { position: absolute; top: 50%; transform: translate(10px, -50%); font-family: var(--f-display); font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; transition: left .7s cubic-bezier(.3, .7, .2, 1), opacity .4s; white-space: nowrap; }
.db-val.l { transform: translate(calc(-100% - 10px), -50%); }
.db-val.up { transform: translate(7px, -118%); }
.db.narrow .db-row { height: 38px; }
.db.narrow .db-name { white-space: normal; line-height: 1.1; font-size: .8rem; }
.db[data-mode="old"] .new, .db[data-mode="old"] .db-line, .db[data-mode="old"] .v-new { opacity: 0; }
.db[data-mode="new"] .old, .db[data-mode="new"] .db-line, .db[data-mode="new"] .v-old { opacity: 0; }
.db-row:hover .db-name { color: var(--cobalt-ink); }
.spread { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.spread div { border-radius: 10px; background: var(--wash); padding: .7rem .9rem; font-family: var(--f-display); font-size: .85rem; color: var(--ink-2); }
.spread b { display: block; font-size: 1.3rem; color: var(--ink); letter-spacing: -0.02em; }

/* time slider */
.slider-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; font-family: var(--f-display); }
.slider-row label { font-size: .9rem; color: var(--ink-2); }
.slider-row output { font-weight: 600; font-size: 1.4rem; letter-spacing: -0.02em; min-width: 5.5ch; font-variant-numeric: tabular-nums; }
input[type="range"] { flex: 1; min-width: 10rem; accent-color: var(--cobalt); height: 1.5rem; }
.readout { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; margin-top: 1rem; }
.ro { border-radius: 10px; padding: .55rem .75rem; background: transparent; font-family: var(--f-display); min-width: 0; border: 1px solid var(--rule); }
.ro .n::before { content: ""; display: inline-block; width: .5rem; height: .5rem; border-radius: 50%; background: var(--cc); margin-right: .4rem; vertical-align: .05em; }
.ro .n { font-size: .8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ro .v { font-size: 1.45rem; font-weight: 600; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.ro .s { font-size: .74rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.btn.small { padding: .32rem .75rem; font-size: .82rem; }
.btn.small svg { width: .75em; height: .75em; fill: currentColor; }
.scrub { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-top: .9rem; }
.scrub-stat { font-family: var(--f-display); font-size: .88rem; color: var(--ink-2); }
.scrub-stat b { color: var(--coral); font-size: 1.05rem; }
.readout.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ro { transition: box-shadow .25s, transform .25s; }
.ro.lead { border-color: var(--ink); }
.lead-line { margin-top: .8rem; font-family: var(--f-display); font-size: .92rem; color: var(--ink-2); min-height: 1.4em; }
.lead-line b { color: var(--ink); }
@keyframes dropin { from { transform: translateY(-14px); opacity: 0; } }
.ex-right { display: flex; gap: .5rem; align-items: center; }
.dr-nav { display: flex; gap: .4rem; flex: none; }
#drPrev, #drNext { font-size: 1.3rem; }

/* ---------- explorer ---------- */
.ex-tools { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .8rem; align-items: center; }
.search { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: .5rem .9rem; min-width: 0; }
.search:focus-within { border-color: var(--cobalt); }
.search input { border: 0; outline: 0; background: transparent; flex: 1; min-width: 0; font-family: var(--f-display); font-size: .95rem; color: var(--ink); }
.search svg { width: 1rem; height: 1rem; color: var(--ink-3); flex: none; }
select { font-family: var(--f-display); font-size: .88rem; border: 1px solid var(--rule); background: var(--card); color: var(--ink); border-radius: 999px; padding: .5rem .8rem; }
.ex-cats { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .8rem; }
.ex-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-top: 1.1rem; padding-top: .9rem; border-top: 1px solid var(--rule); font-family: var(--f-display); font-size: .88rem; color: var(--ink-3); }
.ex-dl { display: flex; gap: .5rem; flex-wrap: wrap; }
.ex-list { list-style: none; padding: 0; margin: .8rem 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.ex-item button {
  width: 100%; height: 100%; text-align: left; border: 1px solid var(--rule); border-radius: 12px; background: var(--card); padding: .8rem .9rem;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .8rem; cursor: pointer; transition: border-color .2s, transform .2s, box-shadow .2s;
}
.ex-item button:hover { border-color: var(--ink-3); transform: translateY(-1px); box-shadow: var(--shadow); }
.ex-top { grid-column: 1 / -1; display: flex; gap: .6rem; align-items: center; font-family: var(--f-mono); font-size: .72rem; color: var(--ink-3); }
.ex-top .c { font-family: var(--f-display); font-size: .78rem; color: var(--ink-2); }
.ex-t { font-family: var(--f-display); font-weight: 600; font-size: 1rem; line-height: 1.3; }
.minibars { display: grid; grid-template-columns: repeat(4, 6px); gap: 3px; align-items: end; height: 1.6rem; align-self: end; }
.minibars i { display: block; background: var(--cc); border-radius: 2px; min-height: 2px; }
.minibars i.miss { background: transparent; border: 1px dashed var(--ink-3); height: 100%; }
.ex-more { text-align: center; margin-top: 1rem; }
.empty { text-align: center; padding: 2rem 1rem; color: var(--ink-3); font-family: var(--f-display); }

/* drawer */
.scrim { position: fixed; inset: 0; background: rgba(10, 12, 18, .45); z-index: 40; opacity: 0; transition: opacity .2s; }
.scrim.on { opacity: 1; }
.drawer[hidden], .scrim[hidden] { display: none; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(46rem, 100%); z-index: 41; background: var(--card); border-left: 1px solid var(--rule);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
  padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
}
.drawer.on { transform: none; }
.dr-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.4rem .9rem; border-bottom: 1px solid var(--rule); }
.dr-head h3 { font-size: 1.35rem; line-height: 1.2; }
.dr-head .meta { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); margin-bottom: .3rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.x { border: 1px solid var(--rule); background: var(--card); width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer; flex: none; font-size: 1.1rem; line-height: 1; }
.dr-body { overflow-y: auto; padding: 1.2rem 1.4rem 2rem; display: grid; gap: 1.5rem; align-content: start; }
.dr-body h4 { margin: 0 0 .6rem; font-family: var(--f-display); font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; }
.dr-instr { font-size: 1rem; line-height: 1.65; }
.dr-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.res { display: grid; gap: .45rem; }
.res-row { display: grid; grid-template-columns: 8.5rem minmax(0, 1fr) 6.5rem; gap: .7rem; align-items: center; font-family: var(--f-display); font-size: .86rem; }
.res-row .tr { position: relative; height: .9rem; background: var(--wash); border-radius: 4px; overflow: hidden; }
.res-row .tr i { position: absolute; inset: 0 auto 0 0; border-radius: 4px; }
.res-row .tr i.raw { background: repeating-linear-gradient(135deg, var(--cc) 0 2px, transparent 2px 5px); opacity: .5; }
.res-row .tr i.fin { background: var(--cc); }
.res-row .v { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.reps { display: flex; gap: .4rem; flex-wrap: wrap; }
.reps span { font-family: var(--f-display); font-size: .84rem; font-variant-numeric: tabular-nums; border: 1px solid var(--rule); border-radius: 8px; padding: .25rem .55rem; }
.toast { position: fixed; left: 50%; bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 1rem); z-index: 60; background: var(--ink); color: var(--paper); font-family: var(--f-display); font-size: .88rem; padding: .6rem 1rem; border-radius: 10px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 2rem); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- next + footer ---------- */
.found { margin: 1.4rem 0 0; padding: 0; list-style: none; display: grid; gap: .55rem; }
.found li { padding-left: 1.1rem; position: relative; }
.found li::before { content: ""; position: absolute; left: 0; top: .62em; width: .45rem; height: .45rem; border-radius: 50%; background: var(--cobalt); }
.readme { margin-top: 1.6rem; padding: .9rem 1.1rem; border-left: 3px solid var(--rule); background: var(--wash); border-radius: 0 8px 8px 0; font-size: .92em; }
.readme b { font-family: var(--f-display); }
.hero-note { font-family: var(--f-display); font-size: .82rem; line-height: 1.45; color: var(--ink-3); margin-top: .7rem; max-width: 40rem; }
.prose p.cite-p { margin: 0 0 -.6rem; font-size: .95rem; color: var(--ink-2); }
.cited { margin: 0; padding: .2rem 0 .2rem 1rem; border-left: 3px solid var(--rule); color: var(--ink-2); font-size: .95rem; }
.cite-h { font-family: var(--f-display); font-size: 1.05rem; font-weight: 600; margin: 2.2rem 0 .6rem; }
.cite { font-family: var(--f-mono); font-size: .76rem; line-height: 1.5; background: var(--wash); border: 1px solid var(--rule); border-radius: 8px; padding: .9rem 1rem; overflow-x: auto; white-space: pre; margin: 0; }
.todo { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.todo li { display: grid; grid-template-columns: 1.4rem minmax(0, 1fr); gap: .6rem; align-items: start; }
.todo li::before { content: ""; width: .95rem; height: .95rem; margin-top: .35rem; border-radius: 4px; border: 2px solid var(--ink-3); }
.todo b { font-family: var(--f-display); font-weight: 650; }
footer { max-width: var(--wide); margin: 0 auto; border-top: 1px solid var(--rule); padding-block: 2rem 3rem; font-family: var(--f-display); font-size: .86rem; color: var(--ink-3); display: grid; gap: .5rem; }
footer pre { font-family: var(--f-mono); font-size: .76rem; background: var(--wash); border-radius: 8px; padding: .8rem 1rem; overflow-x: auto; color: var(--ink-2); margin: .5rem 0 0; }


/* ---------- chapter numbers ---------- */
main { counter-reset: ch; }
section.chapter { counter-increment: ch; }
section.chapter.sub { counter-increment: none; border-top: 0; padding-top: 1.5rem; }
.kicker { display: flex; align-items: baseline; gap: .7rem; }
.kicker::before { content: counter(ch, decimal-leading-zero); color: var(--ink-3); }

/* ---------- hero extras ---------- */
.stage { border-bottom: 1px solid var(--rule); margin-inline: -1rem; padding-inline: 1rem; }
.tile { transform: scale(var(--s, 1)); }
.tile.p { background: var(--ink); }
.tile.on-race { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3.5px var(--ink); z-index: 3; }
.mosaic-cap { min-height: 1.6rem; display: block; font-family: var(--f-display); font-size: .86rem; line-height: 1.45; color: var(--ink-3); margin-top: .8rem; }
.mosaic-cap b { color: var(--ink); font-weight: 600; }

/* ---------- task replay ---------- */
.race-wrap { max-width: var(--wide); margin: 0 auto; padding-bottom: 3.5rem; }
.race { border: 1px solid var(--rule); border-radius: 14px; background: var(--card); padding: 1.3rem 1.5rem 1.1rem; }
.race-top { display: flex; justify-content: space-between; align-items: center; gap: .6rem 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.race-label { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
.race-btns { display: flex; gap: .45rem; flex-wrap: wrap; }
.race-task { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .1rem .8rem; align-items: baseline; }
.race-task .id { font-family: var(--f-mono); font-size: .8rem; color: var(--ink-3); }
.race-task .t { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.1rem, 2.1vw, 1.35rem); line-height: 1.25; letter-spacing: -0.015em; }
.race-req { overflow-wrap: anywhere; white-space: pre-line; grid-column: 2; margin-top: .35rem; font-size: .98rem; line-height: 1.55; color: var(--ink-2); min-height: 3.1em; }
.race-req .caret { display: inline-block; width: 1px; height: 1.05em; vertical-align: -.15em; background: var(--ink); margin-left: 2px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.lanes { display: grid; grid-template-columns: 7.8rem minmax(0, 1fr) 4.7rem; gap: .6rem .65rem; align-items: center; margin-top: 1.2rem; }
.ln { font-family: var(--f-display); font-weight: 500; font-size: .8rem; display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.ln::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--cc); flex: none; }
.lt { position: relative; height: 1.6rem; background-image: linear-gradient(90deg, var(--rule) 1px, transparent 1px); background-size: calc(100% / 6) 100%; border-right: 1px solid var(--rule); }
.lt::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--rule); }
.lt .trail { position: absolute; left: 0; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 2px; background: var(--cc); width: 0; }
.lt .runner { position: absolute; top: 50%; left: 0; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: var(--cc); box-shadow: 0 0 0 2.5px var(--card); }
.lt.zero .runner { background: var(--bad); }
.lt.none { background-image: repeating-linear-gradient(135deg, var(--rule) 0 1px, transparent 1px 7px); }
.lt.none .runner, .lt.none .trail { display: none; }
.ls { font-family: var(--f-display); text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ls b { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; }
.ls small { display: block; font-size: .74rem; color: var(--ink-3); line-height: 1.15; }
.ls.zero b { color: var(--bad); }
.ls s { color: var(--ink-3); font-size: .9rem; margin-right: .3rem; }
.ls.pop b { animation: popn .35s ease-out; display: inline-block; }
@keyframes popn { from { transform: translateY(4px); opacity: 0; } }
.laxis { grid-column: 2; position: relative; height: 2.5rem; font-family: var(--f-mono); font-size: .68rem; color: var(--ink-3); }
.laxis span { position: absolute; transform: translateX(-50%); }
.laxis span:last-child { transform: translateX(-100%); }
.clock { grid-column: 3; justify-self: end; align-self: start; font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1; }
.clock small { font-size: .8rem; font-weight: 400; color: var(--ink-3); margin-left: .25rem; letter-spacing: 0; }
.playhead { position: absolute; width: 0; border-left: 1px dashed var(--ink-3); pointer-events: none; }
.lanes-wrap { position: relative; }
.race-sum { margin-top: 1rem; padding-top: .85rem; border-top: 1px solid var(--rule); font-family: var(--f-display); font-size: .9rem; color: var(--ink-2); min-height: 2.2rem; }
.race-sum b { color: var(--ink); font-weight: 600; }
.race-note { margin-top: .6rem; font-family: var(--f-display); font-size: .8rem; color: var(--ink-3); }


/* ---------- gomoku replay ---------- */
.gm-lede { font-size: .95rem; color: var(--ink-2); margin: -.3rem 0 1.1rem; max-width: 48rem; }
.gm-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .4rem; margin-bottom: 1.1rem; }
.gm-steps button { position: relative; text-align: left; border: 0; background: none; padding: .55rem 0 .5rem; cursor: pointer; font-family: var(--f-display); font-size: .88rem; font-weight: 500; color: var(--ink-3); border-top: 2px solid var(--rule); transition: color .2s; }
.gm-steps button span { font-family: var(--f-mono); font-size: .74rem; margin-right: .45rem; }
.gm-steps button::before { content: ""; position: absolute; left: 0; top: -2px; height: 2px; width: 0; background: var(--ink); }
.gm-steps button.done { color: var(--ink-2); }
.gm-steps button.done::before { width: 100%; }
.gm-steps button[aria-selected="true"] { color: var(--ink); }
.gm-steps button[aria-selected="true"]::before { width: var(--p, 100%); transition: width .1s linear; }
.gm-runs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.gm-run { min-width: 0; }
.gm-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; margin-bottom: .5rem; font-family: var(--f-display); }
.gm-head b { font-weight: 600; }
.gm-head span { font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }
.gm-win { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--wash); }
.gm-chrome { display: flex; align-items: center; gap: .35rem; padding: .45rem .7rem; border-bottom: 1px solid var(--rule); background: var(--card); font-family: var(--f-mono); font-size: .7rem; color: var(--ink-3); }
.gm-chrome i { width: 7px; height: 7px; border-radius: 50%; background: var(--rule); }
.gm-url { margin-left: .4rem; padding: .1rem .55rem; border-radius: 999px; background: var(--wash); }
.gm-at { margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-view { position: relative; aspect-ratio: 760 / 548; background: var(--card); }
.gm-view > div > .gm-note, .gm-view > div > .gm-flow, .gm-view > div > .gm-grade { height: 100%; }
.gm-view > * { position: absolute; inset: 0; opacity: 0; transition: opacity .5s ease; }
.gm-view > .on { opacity: 1; }
.gm-view img { width: 100%; height: 100%; object-fit: cover; object-position: top center; display: block; }
.gm-view img.fit { object-fit: contain; background: #fff; }
.gm-note { display: grid; place-items: center; text-align: center; padding: 1.5rem; font-family: var(--f-display); font-size: .92rem; color: var(--ink-3); background: repeating-linear-gradient(135deg, var(--wash) 0 2px, var(--card) 2px 9px); }
.gm-flow { background: var(--card); padding: 1rem 1.3rem; display: grid; align-content: center; gap: .5rem; font-family: var(--f-display); font-size: .9rem; color: var(--ink); }
.gm-flow .st { display: grid; grid-template-columns: 1.3rem minmax(0, 1fr); gap: .5rem; align-items: baseline; opacity: 0; transform: translateY(4px); transition: opacity .35s, transform .35s; }
.gm-flow .st.in { opacity: 1; transform: none; }
.gm-flow .st em { font-style: normal; font-family: var(--f-mono); font-size: .74rem; color: var(--ink-3); }
.gm-flow .st.bad em { color: var(--bad); }
.gm-flow .st.ok em { color: var(--met); }
.gm-files { display: flex; flex-wrap: wrap; gap: 5px; margin-top: .4rem; }
.gm-files i { width: 30px; height: 38px; border-radius: 3px; display: grid; place-items: end center; font-style: normal; font-family: var(--f-mono); font-size: 7px; padding-bottom: 2px; opacity: 0; transform: scale(.6); transition: opacity .2s, transform .2s; }
.gm-files i.in { opacity: 1; transform: none; }
.gm-files.drawn i { border: 1px dashed var(--bad); color: var(--bad); background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--bad) 14%, transparent) 0 2px, transparent 2px 5px); }
.gm-files.png i { border: 1px solid var(--met); color: var(--met); background: color-mix(in srgb, var(--met) 10%, transparent); }
.gm-grade { background: var(--card); padding: 1rem 1.1rem; display: grid; align-content: center; gap: .9rem; font-family: var(--f-display); }
.gm-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 3.2rem; gap: .7rem; align-items: center; font-size: .86rem; color: var(--ink-2); }
.gm-row b { text-align: right; font-size: 1.25rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.gm-row b.zero { color: var(--bad); }
.gm-pips { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.gm-pips i { height: 12px; border-radius: 3px; background: var(--wash); border: 1px solid var(--rule); transition: background .25s, border-color .25s; }
.gm-pips i.met { background: var(--met); border-color: var(--met); }
.gm-pips.zeroed i.met { background: transparent; border: 1px dashed var(--bad); }
.gm-say { margin-top: .7rem; font-size: .95rem; line-height: 1.55; color: var(--ink-2); min-height: 6.2em; }
.gm-time { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) 4.5rem; gap: .4rem .8rem; align-items: center; margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--rule); font-family: var(--f-display); font-size: .85rem; color: var(--ink-2); }
.gm-tt { position: relative; height: 8px; border-radius: 4px; background: var(--wash); }
.gm-tt i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; background: var(--coral); width: 0; transition: width 2.2s cubic-bezier(.3, .7, .2, 1); }
.gm-time.on .gm-tt i { width: var(--to); }
.gm-tv { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); font-weight: 500; }
@media (max-width: 720px) {
  .gm-runs { grid-template-columns: minmax(0, 1fr); }
  .gm-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-say { min-height: 0; }
}


/* ---------- field bubbles + attempt scatter ---------- */
.fh-ctl { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.logo-legend { margin-bottom: .6rem; }
.logo-legend button { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--rule); background: var(--card); border-radius: 999px; padding: .2rem .65rem .2rem .3rem; font-family: var(--f-display); font-size: .82rem; color: var(--ink); cursor: pointer; transition: opacity .2s, border-color .2s; }
.logo-legend button[aria-pressed="false"] { opacity: .4; }
.logo-legend span.lg { display: inline-flex; align-items: center; gap: .4rem; font-family: var(--f-display); font-size: .82rem; color: var(--ink-2); }
.lmark { width: 1.3rem; height: 1.3rem; border-radius: 50%; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--cc) 14%, var(--card)); border: 1px solid color-mix(in srgb, var(--cc) 60%, transparent); flex: none; }
.lmark svg { width: .75rem; height: .75rem; fill: var(--cc); }
.fb { transition: transform .95s cubic-bezier(.3, .7, .2, 1), opacity .4s; cursor: pointer; }
.fb circle.b { stroke-width: 1.2; }
.fb .ci { stroke-width: 1.5; transition: opacity .4s; }
.fb text { font-family: var(--f-display); font-size: 11.5px; fill: var(--ink-2); paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; transition: opacity .3s; }
.fb:hover circle.b, .fb.hot circle.b { stroke-width: 2.4; }
#field[data-y="old"] .ci { opacity: 0; }
.att { transition: opacity .25s; }
.att.off { opacity: 0 !important; pointer-events: none; }
.attp { transition: opacity .3s, transform .3s; }


/* ---------- human review ---------- */
.hr-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.6rem; margin: .2rem 0 1.1rem; font-family: var(--f-display); font-size: .85rem; color: var(--ink-3); }
.hr-stats b { display: block; font-size: 1.5rem; font-weight: 600; color: var(--ink); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.hr-stats .bad b { color: var(--bad); }
.hr-grid { display: grid; gap: 5px; }
.hr-row { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr) minmax(7rem, 30%); gap: .8rem; align-items: center; }
.hr-who { font-family: var(--f-display); font-size: .84rem; line-height: 1.2; min-width: 0; }
.hr-who small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; color: var(--ink-3); font-size: .74rem; line-height: 1.25; overflow: hidden; }
.hr-row.hr-void .hr-cells, .hr-row.hr-void .hr-who { opacity: .45; }
.hr-cells { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); gap: 3px; }
.hr-cell { height: 1.55rem; border-radius: 4px; border: 0; padding: 0; cursor: pointer; background: var(--wash); transition: transform .15s, opacity .3s; opacity: 0; }
.play .hr-cell, .hr-cell.in { opacity: 1; }
.hr-cell.met { background: var(--met); }
.hr-cell.ins { background: repeating-linear-gradient(135deg, var(--ink-3) 0 1.5px, transparent 1.5px 5px); box-shadow: inset 0 0 0 1px var(--ink-3); }
.hr-cell.na { background: transparent; box-shadow: inset 0 0 0 1px var(--rule); cursor: default; }
.hr-cell.no { background: var(--bad); }
.hr-opus .hr-who { color: var(--cobalt); }
.hr-opus .hr-time i { background: var(--cobalt); }
.hr-srow { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.6rem; width: 100%; }
.hr-sw { font-size: .78rem; font-weight: 600; color: var(--ink-2); width: 3.4rem; }
.hr-srow + .hr-srow { padding-top: .5rem; border-top: 1px solid var(--rule); }
.hr-srow + .hr-srow .hr-sw { color: var(--cobalt); }
.hr-cell.flag { box-shadow: 0 0 0 2px var(--card), 0 0 0 3.5px var(--bad); }
.hr-cell:hover { transform: translateY(-2px); }
.hr-none { grid-column: 1 / -1; height: 1.55rem; border-radius: 4px; border: 1px dashed var(--rule); font-family: var(--f-display); font-size: .76rem; color: var(--ink-3); display: grid; place-items: center; }
.hr-time { position: relative; height: 1.55rem; }
.hr-time i { position: absolute; left: 0; top: 50%; height: 8px; margin-top: -4px; border-radius: 4px; background: var(--ink-3); width: calc((100% - 3.4rem) * var(--f, 0)); transition: width 1s cubic-bezier(.3, .7, .2, 1); }
.hr-time span { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-family: var(--f-display); font-size: .78rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.hr-time b { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1.5px dashed var(--coral); }
.hr-head { font-family: var(--f-mono); font-size: .68rem; color: var(--ink-3); }
.hr-head .hr-cells span { text-align: center; }
.case2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 1.5rem; align-items: start; }
.rows { display: grid; grid-template-columns: repeat(22, minmax(0, 1fr)); gap: 2px; }
#atts .stem { display: none; }
#atts.one .stem { display: inline; }
.rows i { box-shadow: inset 0 0 0 1px var(--rule); aspect-ratio: 1; border-radius: 2px; background: var(--wash); transition: background .2s, box-shadow .2s; }
.rows i.f { box-shadow: none; background: color-mix(in srgb, var(--ink-3) 55%, var(--wash)); }
.rows i.e { box-shadow: none; background: var(--bad); }
.rows i.m { box-shadow: none; background: var(--amber); }
.rows i.scan { box-shadow: 0 0 0 1.5px var(--ink); }
.rows i.e.hit { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--bad); }
.rows-key { display: flex; flex-wrap: wrap; gap: .3rem 1rem; margin-top: .7rem; font-family: var(--f-display); font-size: .8rem; color: var(--ink-2); }
.rows-key .k { display: inline-block; width: .7rem; height: .7rem; border-radius: 2px; margin-right: .35rem; vertical-align: -.05em; }
.verdicts2 { display: grid; gap: .6rem; font-size: .92rem; line-height: 1.5; }
.verdicts2 .req { font-size: .92rem; background: var(--wash); border-radius: 10px; padding: .75rem .9rem; color: var(--ink); }
.vd { display: grid; grid-template-columns: 7.2rem minmax(0, 1fr); gap: .7rem; align-items: start; padding-top: .55rem; border-top: 1px solid var(--rule); opacity: .25; transition: opacity .4s; }
.vd.in { opacity: 1; }
.vd .who { font-family: var(--f-display); font-size: .84rem; font-weight: 600; }
.vd .who .tag { display: inline-block; margin-top: .25rem; }
.vd q { color: var(--ink-2); quotes: "\201C" "\201D"; font-size: .9rem; }
.tr-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; margin: .9rem 0 .8rem; font-family: var(--f-display); font-size: .85rem; color: var(--ink-3); }
.tr-meta b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.tr-strip { display: flex; align-items: flex-end; gap: 1px; height: 84px; border-bottom: 1px solid var(--rule); position: relative; cursor: pointer; }
.tr-strip i { flex: 1 1 0; min-width: 1px; border-radius: 2px 2px 0 0; background: var(--cc); opacity: .55; transition: opacity .15s; position: relative; }
.tr-strip i.clip { background: repeating-linear-gradient(135deg, var(--cc) 0 2px, transparent 2px 4px); }
.tr-strip i.on { opacity: 1; }
.tr-strip i.past { opacity: .85; }
.tr-strip i.flag::after { content: ""; position: absolute; left: 50%; top: -9px; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--bad); }
.tr-key { margin-top: .6rem; }
.tr-step { margin-top: .9rem; display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: .3rem 1rem; align-items: start; min-height: 7.5rem; }
.tr-step .n { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; letter-spacing: -0.02em; }
.tr-step .n small { display: block; font-size: .74rem; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.tr-step .body { min-width: 0; }
.tr-step .kind { font-family: var(--f-display); font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: .4rem; margin-bottom: .3rem; }
.tr-step .kind::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--cc); }
.tr-step .say { overflow-wrap: anywhere; font-size: .98rem; line-height: 1.55; color: var(--ink); }
.tr-step code { display: block; font-family: var(--f-mono); font-size: .78rem; line-height: 1.5; color: var(--ink-2); background: var(--wash); border-radius: 8px; padding: .55rem .7rem; white-space: pre-wrap; word-break: break-all; }
.tr-step .note { margin-top: .35rem; font-family: var(--f-display); font-size: .78rem; color: var(--ink-3); }
.tr-step .note.bad { color: var(--bad); }
@media (max-width: 720px) {
  .hr-row { grid-template-columns: minmax(0, 1fr) 6.5rem; gap: .25rem .6rem; }
  .hr-srow { gap: .3rem 1rem; }
  .hr-sw { width: 100%; }
  .hr-stats b { font-size: 1.15rem; }
  .hr-who { grid-column: 1 / -1; display: flex; gap: .5rem; align-items: baseline; }
  .hr-who small { display: inline; }
  .hr-head > span:first-child { display: none; }
  .hr-head > span:last-child { font-size: .62rem; }
  .hr-head .hr-cells span { font-size: .62rem; }
  .case2 { grid-template-columns: minmax(0, 1fr); }
  .rows { grid-template-columns: repeat(17, minmax(0, 1fr)); }
  .tr-step { grid-template-columns: minmax(0, 1fr); }
  .tr-strip { height: 64px; }
}


.hero-links { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.4rem; }
.hero-links a { text-decoration: none; }
.hero-demo { min-width: 0; }
.race { scroll-margin-top: 5rem; }
.race-controls { display: flex; align-items: center; gap: .65rem; flex-wrap: wrap; margin-bottom: 1rem; font-family: var(--f-display); font-size: .85rem; }
.race-controls select { flex: 1; min-width: 0; max-width: 18rem; padding: .45rem; color: var(--ink); background: var(--card); border: 1px solid var(--rule); border-radius: 5px; font: inherit; }
.task-picker { margin-top: 1rem; }
.task-picker > summary { cursor: pointer; font: 500 .9rem var(--f-display); padding: .6rem 0; }
.lanes [hidden] { display: none !important; }
@media (min-width: 881px) { .hero-demo .race-req { grid-column: 1 / -1; } }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2rem; padding-block: 2.2rem 1.5rem; }
  .anat, .grade { grid-template-columns: minmax(0, 1fr); }
  .ex-list { grid-template-columns: minmax(0, 1fr); }
  .readout { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  body { font-size: 1.06rem; }
  .verdicts, .case, .spread { grid-template-columns: minmax(0, 1fr); }
  .tn-row { grid-template-columns: minmax(0, 1fr); gap: .4rem; }
  .axis-note { margin-left: 0; }
  .rf-row { grid-template-columns: minmax(0, 1fr) 6.8rem; }
  .rf-track { grid-column: 1 / -1; grid-row: 2; }
  .res-row { grid-template-columns: 7rem minmax(0, 1fr) 5.6rem; }
  .panel { padding: 1rem; border-radius: 12px; }
  .ex-tools { grid-template-columns: minmax(0, 1fr); }
  .ex-right select { flex: 1; min-width: 0; }
  .readout.three { grid-template-columns: minmax(0, 1fr); }
  .brand span { display: none; }
  .lanes { grid-template-columns: 6.5rem minmax(0, 1fr) 4rem; gap: .5rem .5rem; }
  .lanes .ln { font-size: .75rem; white-space: normal; line-height: 1.25; }
  .lanes .laxis { grid-column: 2; }
  .lanes .clock { grid-column: 3; justify-self: end; align-self: start; font-size: 1.1rem; }
  .lanes > span:last-child { display: block; }
  .laxis span:nth-child(even) { display: none; }
  .race { padding: 1rem; }
  .race-req { grid-column: 1 / -1; }
  .mosaic { gap: 3px; }
  .pips { gap: 4px; }
  .pip { min-height: 3rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}

.time-axis-label { display: block; position: absolute; top: 1.2rem; right: 0; white-space: nowrap; font-size: .7rem; }

.cat-axis span { position: absolute; transform: translateX(-50%); }
.cat-axis span:first-child { left: 0; transform: none; }
.cat-axis span:nth-child(2) { left: 33.333%; }
.cat-axis span:nth-child(3) { left: 66.667%; }
.cat-axis span:last-child { right: 0; transform: none; }
