/* --- d5, "the page is the scale" (docs/DESIGN-RULES.md; charts.js draws these) --- */
/* a scale: a full-bleed SVG whose height is its measure's axis; every mark is currentColor (ink or paper by zone) */
svg.scale { display: block; width: 100%; overflow: hidden; }
svg.scale text { font-family: var(--f); }
svg.scale .zn { font-weight: 900; letter-spacing: -.04em; }
svg.scale .big { font-weight: 800; letter-spacing: -.03em; }
svg.scale .nm, svg.scale .tt { font-weight: 700; }
svg.scale .kn { font-weight: 800; }
svg.scale .sm { font-weight: 400; }
svg.scale a { cursor: pointer; }
svg.scale a:focus-visible { outline: none; }
/* a keyboard focus: the focused link and its other copy (kf, charts.js mountScale), so it shows on the dark zones too;
   the link's hit target (a lane, a phone column, a run dot) is ringed, its words underlined */
svg.scale a:is(:focus-visible, .kf) text, svg.scale a:hover text { text-decoration: underline; }
svg.scale a:is(:focus-visible, .kf) .dot { stroke: currentColor; stroke-width: 3; }
svg.scale a:is(:focus-visible, .kf) > :is(rect, circle):first-child { stroke: currentColor; stroke-width: 2; }
@media (forced-colors: active) { svg.scale { forced-color-adjust: none; } }

/* a scale's section head: the kicker and heading on the left, what it shows and how to read it on the right */
.shead { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; padding-top: 72px; padding-bottom: 28px; align-items: end; }
.shead p { margin: 0; color: var(--ink-2); max-width: 46em; }
.shead p + p { margin-top: 10px; }
.shead .k { display: block; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--ink-2); margin-bottom: 6px; }
.shead .how, .scale-head .how { font-size: 15px; }
/* a scale page's head: the lede as h1 beside the page's own description */
.scale-head { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; padding-top: 44px; padding-bottom: 36px; align-items: end; }
.scale-head h1 { max-width: 15em; }
/* the headline's second line: who the runs can't order (it stays beside the board's places, rules 6) */
.scale-head .crowd { margin: 14px 0 0; font-size: 19px; line-height: 1.35; color: var(--ink); max-width: 30em; }
.scale-head .crowd:empty { display: none; }
/* the long how-to-read paragraphs fold under one plain line each (Q3-04) */
.howto { margin-top: 10px; }
.howto summary { cursor: pointer; min-height: 24px; color: var(--ink); font-size: 15px; text-decoration: underline dotted; text-underline-offset: 3px; }
.howto[open] summary { margin-bottom: 8px; }
.howto > p + p { margin-top: 10px; }
/* what the site is and how to take part, over the headline in plain words (Q3-01); what "· pi" means under it (Q3-03) */
.scale-head .intro { margin: 0 0 18px; font-size: 19px; line-height: 1.4; color: var(--ink); max-width: 34em; }
.scale-head .intro a { color: var(--ink); font-weight: 700; }
.scale-head .clients { margin-top: 12px; font-size: 14px; max-width: 46em; }
.scale-head .clients[hidden] { display: none; }
.scale-head p { margin: 0; color: var(--ink-2); max-width: 46em; }
.scale-head p + p { margin-top: 10px; }
/* the numbers table after a scale: on a phone only (the desktop labels carry the numbers); tables in its <details> stay */
.readout.phone-only > .wrap > table { display: none; }
/* and at any width where the scale's labels leave the small lines out: its stacks' heads only or its phone columns
   (the page's script sets .show-table from charts.js labelTier) */
.readout.phone-only.show-table > .wrap > table { display: table; }
/* a readout's collapsed numbers: the summary in paper on the dark band */
.readout details { margin-top: 18px; }
.readout summary { cursor: pointer; color: var(--paper); font-size: 14px; min-height: 24px; }
.readout details table { margin-top: 8px; }
.readout details p { margin-top: 12px; }
.readout p:empty { display: none; }
/* the home readout's middle half: its own column where the table has room, under the 95% range at phone width */
.readout .half-in { display: none; font-size: 12px; color: var(--paper-2); }
@media (max-width: 760px) {
  .shead, .scale-head { grid-template-columns: 1fr; gap: 14px; padding-top: 26px; padding-bottom: 22px; }
  .shead { padding-top: 44px; }
  .shead .how, .scale-head .how { font-size: 14px; }
  .scale-head .crowd { font-size: 16px; }
  .scale-head .intro { font-size: 17px; margin-bottom: 14px; }
  .readout.phone-only > .wrap > table { display: table; }
  .readout table { font-size: 13px; }
  .readout th, .readout td { padding-right: 7px; }
  .readout td { white-space: normal; }
  .readout td.rg { white-space: nowrap; }
  /* the home's runs count ("11 of 15") stays whole: the table squeezes the model names instead */
  .readout td.count { white-space: nowrap; }
}
@media (max-width: 520px) {
  .readout .half { display: none; }
  .readout .half-in:not([hidden]) { display: block; }
}
/* the narrowest phones: 1 px less padding a column (a tight table's is on its left, below) */
@media (max-width: 380px) {
  .readout th, .readout td { padding-right: 6px; }
}
/* a row head's model key stays on the line of the name's first word (rules 2): a key is an atomic inline, so a line
   could break after it, and on a squeezed table one did, leaving the key alone above a first word as wide as the
   column ("DeepSeek" on the home's, the arena's and compare's tables at 320-390 px). As a flex row the name wraps
   beside the key, each line under the first word; the key sits 1 px under the baseline, as its vertical-align does */
.readout tbody th > :first-child:has(> .key:first-child) { display: inline-flex; align-items: baseline; }
.readout tbody th > :first-child > .key:first-child { position: relative; top: 1px; }
/* a tight table (the home's, the arena's ratings, compare's pair): with its ranges, counts and each key's first word
   whole it is wider than a phone under 380 px (the home's 336 px in 328 at 360, the arena's 293 in 288 at 320), so
   there Could be goes under each ranked model's name, with "could be" under the Model header. Every readout's interval
   column (the arena's interval, compare's range, /play's interval: /play's widest table is 308 px with it at 320) goes
   under its value there, with its header under the value's, as the middle half goes under the 95% range */
.readout .cb-in, .readout .iv-in { display: none; font-size: 12px; font-weight: 400; color: var(--paper-2); white-space: nowrap; }
/* /play's "1 run: no interval" is words, not a range: they wrap */
.readout .iv-in.wr { white-space: normal; }
@media (max-width: 379px) {
  .readout.tight .cb, .readout .iv { display: none; }
  .readout.tight .cb-in:not([hidden]), .readout .iv-in { display: block; }
}
/* and on a phone its columns are spaced on their left, the first flush, so its last column ends at the page's edge
   instead of 6-7 px short of it: the arena's ratings need that room at 380 px (350 px in 348 without it) */
@media (max-width: 760px) {
  .readout.tight > .wrap > table th, .readout.tight > .wrap > table td { padding-right: 0; padding-left: 7px; }
  .readout.tight > .wrap > table th:first-child, .readout.tight > .wrap > table td:first-child { padding-left: 0; }
}
@media (max-width: 380px) {
  .readout.tight > .wrap > table th, .readout.tight > .wrap > table td { padding-left: 6px; }
}

/* the head-to-head grid (arena): the 50% grey ground; a cell is filled only when its interval leaves out 50% */
.h2h { background: var(--zmid); color: var(--ink); padding-bottom: 56px; }
.h2h .shead p, .h2h .shead .k { color: var(--ink); }
.h2h-grid { border-collapse: separate; border-spacing: 3px; width: 100%; table-layout: fixed; }
.h2h-grid th { font-size: 13px; font-weight: 700; text-align: left; vertical-align: bottom; padding: 4px 6px; }
.h2h-grid thead th { padding-bottom: 8px; }
.h2h-grid thead th:first-child { width: 168px; font-weight: 400; font-size: 12px; }
.h2h-grid tbody th { font-size: 15px; vertical-align: middle; }
.h2h-grid td { padding: 0; height: 88px; vertical-align: top; }
.h2h-grid td a, .h2h-grid td .self { display: flex; flex-direction: column; justify-content: space-between; height: 100%; padding: 8px 10px 7px;
  text-decoration: none; color: inherit; }
.h2h-grid td a:hover { outline: 2px solid currentColor; outline-offset: -2px; }
.h2h-grid .self { justify-content: center; align-items: center; font-size: 13px; }
.h2h td.won, .h2h li.won, .h2h-legend .won i { background: var(--paper); color: var(--ink); }
.h2h td.lost, .h2h li.lost, .h2h-legend .lost i { background: var(--z1); color: var(--paper); }
.h2h td.open, .h2h li.open, .h2h-legend .open i { box-shadow: inset 0 0 0 1px var(--ink-2); }
.h2h-grid td.self { box-shadow: none; }
.h2h .v { font-weight: 800; font-size: 24px; letter-spacing: -.02em; line-height: 1; }
.h2h .s { font-size: 12px; }
.h2h .s1 { font-size: 13px; font-weight: 700; }
.h2h svg.ci { display: block; width: 100%; height: 12px; overflow: visible; }
.h2h-list { list-style: none; margin: 0; padding: 0; display: none; }
.h2h-list li { margin-top: 3px; }
.h2h-list a { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 12px; text-decoration: none; color: inherit; min-height: 24px; }
.h2h-list .who { font-weight: 700; font-size: 15px; }
.h2h-list .who span { font-weight: 400; }
.h2h-list svg.ci, .h2h-list .s { grid-column: 1 / -1; }
.h2h-legend { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 18px 0 0; font-size: 13px; }
.h2h-legend i { display: inline-block; width: 22px; height: 14px; vertical-align: -2px; margin-right: 7px; }
@media (max-width: 760px) {
  .h2h-grid { display: none; }
  .h2h-list { display: block; }
}

/* How they play (play.js): the groups' contents, the verdict legend, each fact's head, its readout and rare lists */
.play-head { align-items: start; }
.play-head .toc { margin: 18px 0 0; padding: 0; list-style: none; counter-reset: g; columns: 2; column-gap: 32px; font-size: 15px; }
.play-head .toc li { counter-increment: g; break-inside: avoid; padding: 3px 0; }
.play-head .toc li::before { content: counter(g, decimal-leading-zero); font-weight: 800; margin-right: 10px; }
.vchips { margin: 22px 0 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 14px; font-size: 14px; color: var(--ink-2); align-items: baseline; }
.vchips .chip { justify-self: start; }
.ghead { padding-top: 88px; padding-bottom: 4px; display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; align-items: end; border-bottom: 1.5px solid var(--ink); }
.ghead .gid { display: block; font-weight: 800; font-size: 28px; letter-spacing: -.02em; }
.ghead h2 { font-size: 44px; line-height: 1.02; letter-spacing: -.025em; margin: 0 0 18px; }
.ghead p { margin: 0 0 18px; color: var(--ink-2); max-width: 46em; }
.fhead { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: 56px; padding-top: 40px; padding-bottom: 0; align-items: start; }
.fhead h3 { margin: 0 0 10px; font-size: 22px; font-weight: 800; letter-spacing: -.015em; line-height: 1.15; }
.fhead .verdict { margin: 0; font-size: 15px; max-width: 40em; }
.fhead .verdict .chip { margin-right: 8px; }
.fhead .def { margin: 0; display: grid; grid-template-columns: 12.5em minmax(0, 1fr); gap: 5px 16px; font-size: 14px; }
.fhead .def dt { font-weight: 700; }
.fhead .def dd { margin: 0; color: var(--ink-2); }
.fhead .def .src { font-size: 13px; overflow-wrap: anywhere; }
.fhead .def .src code { font: 12.5px var(--mono); }
.fruns { padding: 0; }
.fruns .wrap { padding-top: 14px; padding-bottom: 26px; }
.fruns p { margin: 0; font-size: 14px; }
.fruns p a { color: var(--paper); margin-right: 14px; white-space: nowrap; }
.fruns p b { color: var(--paper); font-weight: 700; margin-right: 10px; }
.fruns > .wrap > table { margin-bottom: 14px; }
.rare { padding-top: 18px; padding-bottom: 30px; }
.rare ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.rare li { padding: 9px 0; border-top: 1px solid var(--z3); }
.rare li:last-child { border-bottom: 1px solid var(--z3); }
.rare .who { font-weight: 700; margin-right: 10px; }
.rare .none { color: var(--ink-2); }
@media (max-width: 760px) {
  .play-head .toc { columns: 1; font-size: 14px; }
  .ghead, .fhead { grid-template-columns: 1fr; gap: 12px; }
  .ghead { padding-top: 56px; }
  .ghead h2 { font-size: 30px; margin-bottom: 4px; }
  .fhead { padding-top: 28px; }
  .fhead h3 { font-size: 19px; }
  .fhead .verdict { font-size: 14px; }
  .fhead .def { font-size: 13px; grid-template-columns: 7em minmax(0, 1fr); }
  .fhead .def .src, .fhead .def .src code { font-size: 12px; }
  .rare ul { font-size: 14px; }
}

/* the compare page (compare.js): the two pickers over the head's paired line; a watch link never breaks inside */
.scale-head .fg { margin-bottom: 18px; }
.readout .cmp-w a { white-space: nowrap; }
