/* Style sampled from the fragment atlas: pale grey field, thin Manrope numerals, IBM Plex Mono labels,
   floating pill controls, 1px lines, soft shadows. Variants A-D are set with <html data-style="a|b|c|d">. */
:root {
  --bg: #f6f7f8;
  --ink: #1c1f25;
  --ink-2: #5a606a;
  --ink-3: #8d929b;
  --grid: rgba(28, 31, 37, 0.05);
  --pill: rgba(255, 255, 255, 0.86);
  --line: rgba(28, 31, 37, 0.09);
  --shadow: 0 8px 28px rgba(28, 31, 37, 0.09);
  --card: #ffffff;
  --tile-lo: #e7e9ec; --tile-hi: #353941;
  --mark: #e2dcfb;
  --o0: #5442c2;   /* next byte: the atlas violet */
  --o1: #eb6834;   /* fingerprint: atlas "open" orange */
  --o2: #2a78d6;   /* descriptors: atlas "named" blue */
  --o3: #1baf7a;   /* masked fragments: atlas "closed" green */
  --warn: #d6336c;
  --display: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* figures, tables and their captions */
  --fig: "Kode Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* their text colour, "warm paper", and its two dimmer steps (68% and 46% towards the page) */
  --fig-ink: #e9dfc9; --fig-ink-2: #a39d8e; --fig-ink-3: #736f66;
  /* knobs the variants turn */
  --body-size: 17.5px; --body-lh: 1.68; --body-w: 400;
  --h1-w: 200; --h2-w: 300; --h2-size: 30px;
  --col: 660px; --wide: 1000px;
  --frame-bg: var(--card); --frame-line: var(--line); --frame-shadow: var(--shadow); --frame-r: 14px;
  --page-grid: none;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1012; --ink: #eceef1; --ink-2: #a6abb4; --ink-3: #737882;
    --grid: rgba(236, 238, 241, 0.045); --pill: rgba(24, 26, 30, 0.86); --line: rgba(236, 238, 241, 0.1);
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.45); --card: #17191d;
    --tile-lo: #1d1f24; --tile-hi: #cdd1d8; --mark: #3a3168;
    --o0: #b7aafa; --o1: #f08a5d; --o2: #5b9df0; --o3: #4fd0a0; --warn: #f277a6;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1012; --ink: #eceef1; --ink-2: #a6abb4; --ink-3: #737882;
  --grid: rgba(236, 238, 241, 0.045); --pill: rgba(24, 26, 30, 0.86); --line: rgba(236, 238, 241, 0.1);
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.45); --card: #17191d;
  --tile-lo: #1d1f24; --tile-hi: #cdd1d8; --mark: #3a3168;
  --o0: #b7aafa; --o1: #f08a5d; --o2: #5b9df0; --o3: #4fd0a0; --warn: #f277a6;
  color-scheme: dark;
}

/* ---- variants ---- */
/* B: everything in mono, like the notes in the corners of the atlas; figures sit bare on the page */
:root[data-style="b"] {
  --body: var(--mono); --body-size: 15px; --body-lh: 1.75; --col: 720px; --wide: 720px;
  --h2-w: 500; --h2-size: 15px;
  --frame-bg: transparent; --frame-line: transparent; --frame-shadow: none; --frame-r: 0px;
}
/* C: the atlas field itself: cell grid across the page, grey tiles, colour only in small markers */
:root[data-style="c"] {
  --page-grid: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  --frame-shadow: none; --frame-r: 12px; --h2-w: 500; --h2-size: 22px;
}
/* D: big and centred, like the atlas header; light body weight */
:root[data-style="d"] {
  --body-size: 19px; --body-w: 300; --h2-size: 38px; --h2-w: 200; --col: 700px;
  --frame-bg: transparent; --frame-line: transparent; --frame-shadow: none;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); background-image: var(--page-grid); background-size: 22px 22px; color: var(--ink);
  font: var(--body-w) var(--body-size)/var(--body-lh) var(--body); -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: var(--o0); }
a:hover { color: var(--o0); }
:focus-visible { outline: 2px solid var(--o2); outline-offset: 2px; }
button { font: inherit; color: inherit; }
::selection { background: var(--mark); }
[hidden] { display: none !important; }

.wrap { max-width: calc(var(--col) + 40px); margin: 0 auto; padding: 0 20px; }

.wide { max-width: calc(var(--wide) + 40px); margin-left: auto; margin-right: auto; padding: 0 20px; }

/* top bar */
/* the bar stays at the top of the screen; it slides away while reading down and comes back on the way up (assets/nav.js) */
.top { position: sticky; top: 0; z-index: 18; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px max(20px, calc((100% - var(--wide)) / 2)); background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); transition: transform .25s ease, box-shadow .25s; }
.top.stuck { box-shadow: 0 1px 0 var(--line); }
.top.away { transform: translateY(-100%); }
.top-nav { display: flex; gap: 26px; }
.top-nav a, .toc-site a { font: 500 11px/1 var(--fig); letter-spacing: .12em; text-transform: uppercase; color: var(--fig-ink-3, var(--ink-3)); text-decoration: none; padding: 7px 0; transition: color .2s, box-shadow .2s; }
.top-nav a:hover, .top-nav a:focus-visible, .toc-site a:hover, .toc-site a:focus-visible { color: var(--fig-ink, var(--ink)); box-shadow: 0 1.5px 0 var(--o0); }
/* on a wide screen the bar scrolls away with the page, and the same two links come in above the contents at the side */
.toc-site { display: none; }
@media (min-width: 1240px) {
  .top { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top.stuck { box-shadow: none; } .top.away { transform: none; }
  nav.toc { top: 96px; max-height: calc(100vh - 144px); }
  .toc-site { display: flex; gap: 22px; height: 36px; align-items: flex-start; opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity .3s ease, transform .3s ease; }
  .toc.past .toc-site { opacity: 1; transform: none; pointer-events: auto; }
  .toc .toc-site a { display: inline-block; padding: 4px 0 6px; border: 0; }
}
.top-btn { display: none; }
main h2[id], main h3[id] { scroll-margin-top: 72px; }
@media (max-width: 760px) {
  .top { padding-top: 12px; padding-bottom: 12px; }
  .top-btn { all: unset; box-sizing: border-box; display: grid; align-content: center; gap: 5px; width: 44px; height: 44px; margin: -8px -11px -8px 0; padding: 0 11px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .top-btn i { display: block; height: 1.5px; background: var(--ink); transition: transform .2s, opacity .2s; }
  .top-btn:focus-visible { outline: 1px solid var(--o0); outline-offset: -4px; }
  .top-btn[aria-expanded="true"] i:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
  .top-btn[aria-expanded="true"] i:nth-child(2) { opacity: 0; }
  .top-btn[aria-expanded="true"] i:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
  .top-nav { position: absolute; left: 0; right: 0; top: 100%; display: none; flex-direction: column; gap: 0; padding: 4px 20px 10px; background: var(--bg); border-bottom: 1px solid var(--line); font-size: 15px; }
  .top.open .top-nav { display: flex; }
  .top.open { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .top-nav a { padding: 18px 0; font-size: 12px; color: var(--fig-ink, var(--ink)); border-top: 1px solid var(--line); box-shadow: none !important; }
}
@media (prefers-reduced-motion: reduce) { .top, .top-btn i, .toc-site { transition: none; } }
.brand { display: inline-flex; align-items: center; gap: 9px; font: 500 13px/1 var(--mono); text-decoration: none; letter-spacing: 0.01em; }
.brand::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--o0); }
.brand canvas, .foot canvas { display: none; }
.theme { font: 500 12px/1 var(--mono); padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--pill); color: var(--ink-2); cursor: pointer; box-shadow: var(--shadow); }
.theme::after { content: "light / dark"; }
.theme:hover { color: var(--ink); }

/* reading progress: one segment per section */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; display: flex; gap: 3px; z-index: 20; pointer-events: none; }
.progress i { flex: 1; background: var(--line); position: relative; overflow: hidden; }
.progress i::after { content: ""; position: absolute; inset: 0; background: var(--o0); transform: scaleX(var(--p, 0)); transform-origin: left; }

/* type */
h1 { font: var(--h1-w) clamp(40px, 6.4vw, 76px)/1.02 var(--display); letter-spacing: -0.035em; margin: 0; text-wrap: balance; }
h2 { font: var(--h2-w) var(--h2-size)/1.2 var(--display); letter-spacing: -0.02em; margin: 76px 0 16px; text-wrap: balance; }
p { margin: 0 0 18px; }
b, strong { font-weight: 500; }
.lede { font: 300 clamp(19px, 2.2vw, 23px)/1.5 var(--display); color: var(--ink-2); }
.meta { font: 400 12px/1.5 var(--mono); color: var(--ink-3); }
code, .smi { font: 500 0.82em var(--mono); background: var(--mark); padding: 1px 5px; border-radius: 3px; white-space: nowrap; }
.note { font: 400 12.5px/1.65 var(--mono); color: var(--ink-2); border-left: 1px solid var(--line); padding: 2px 0 2px 16px; margin: 30px 0; }
ul.plain { padding-left: 20px; margin: 0 0 18px; }
ul.plain li { margin-bottom: 8px; }
ul.plain li::marker { color: var(--ink-3); }
:root[data-style="b"] h2 { letter-spacing: 0; font-family: var(--mono); }
:root[data-style="b"] h2::before { content: "# "; color: var(--ink-3); }
:root[data-style="d"] .hero, :root[data-style="d"] h2 { text-align: center; }
:root[data-style="d"] .hero h1, :root[data-style="d"] .hero .lede { margin-left: auto; margin-right: auto; }

/* figures */
figure { margin: 40px auto; }
.frame {
  background-color: var(--frame-bg); border: 1px solid var(--frame-line); border-radius: var(--frame-r); position: relative;
  box-shadow: var(--frame-shadow); overflow: hidden;
}
.frame-pad { padding: 22px; }
figcaption { font: 400 12px/1.6 var(--mono); color: var(--ink-2); margin-top: 14px; text-wrap: pretty; }
figcaption b { color: var(--ink); }
:root[data-style="d"] figcaption { margin-left: auto; margin-right: auto; text-align: center; }

/* pills: objective buttons, chips, segmented switches */
.objs, .pick, .seg {
  display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; max-width: 100%;
  background: var(--pill); border: 1px solid var(--line); box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.obj, .chip, .seg button {
  font: 500 13px/1 var(--mono); letter-spacing: 0.01em; padding: 8px 13px; border: 0; border-radius: 9px;
  background: transparent; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, transform .15s cubic-bezier(.2,.9,.2,1);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.chip { font-size: 12px; padding: 7px 11px; }
.obj:hover, .chip:hover, .seg button:hover { color: var(--ink); }
.obj:active, .chip:active, .seg button:active, .btn:active { transform: scale(.95); }
.obj::before { transition: transform .25s cubic-bezier(.2,.9,.2,1); }
.obj[aria-pressed="true"]::before { transform: scale(1.25) rotate(45deg); }
.obj[aria-pressed="true"], .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.obj { position: relative; }
.objs.auto .obj[aria-pressed="true"]::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 3px; height: 1.5px; border-radius: 1px; background: currentColor; opacity: .55; transform-origin: left; animation: tick 2.6s linear both; }
@keyframes tick { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.obj::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: var(--k); flex: none; }
.btn { font: 500 13px/1 var(--mono); padding: 10px 14px; border-radius: 9px; border: 0; background: var(--ink); color: var(--bg); cursor: pointer; text-decoration: none; }
.btn:hover { opacity: .85; }
[data-o="0"] { --k: var(--o0); --c: var(--o0); }
[data-o="1"] { --k: var(--o1); --c: var(--o1); }
[data-o="2"] { --k: var(--o2); --c: var(--o2); }
[data-o="3"] { --k: var(--o3); --c: var(--o3); }
:root[data-style="c"] [data-o] { --c: var(--tile-hi); }
:root[data-style="d"] .objs, :root[data-style="d"] .pick, :root[data-style="d"] .seg { justify-content: center; }

/* byte tiles: one line, a piece is a tinted run with rounded ends; cuts slide with transforms */
.bytes { font: 500 var(--fs, 13px)/1 var(--mono); user-select: none; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 2px 0; }
.bytes::-webkit-scrollbar { display: none; }
.bytes .row { display: flex; flex-wrap: nowrap; }
.bytes .b {
  flex: none; width: 1.12em; height: 1.85em; display: grid; place-items: center; color: var(--ink);
  background: color-mix(in srgb, var(--c) 15%, transparent); will-change: transform;
  transition: transform .62s cubic-bezier(.22,1,.36,1), background-color .35s, color .35s, border-radius .35s;
}
.bytes .b.odd { background: color-mix(in srgb, var(--c) 40%, transparent); }
.bytes .b.st { border-radius: 4px 0 0 4px; }
.bytes .b.en { border-top-right-radius: 4px; border-bottom-right-radius: 4px; }
.bytes .b.hl { background: var(--c); color: var(--bg); }
.bytes.fixed .b { background: var(--tile-lo); color: var(--ink-2); }
.bytes.fixed .b.odd { background: color-mix(in srgb, var(--tile-hi) 28%, var(--tile-lo)); }
@media (prefers-reduced-motion: reduce) { .bytes .b { transition: none; } }

/* hero */
.hero { padding-top: 24px; padding-bottom: 4px; }
.hero h1 { max-width: none; }
.hero .lede { margin-top: 18px; max-width: 30em; }
.hero-stage { margin-top: 18px; }
.hero-stage .frame-pad { padding: 28px 24px 20px; }
.hero-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.hero-say { font: 400 12px/1.5 var(--mono); color: var(--ink-2); min-height: 1.5em; }
.hero-say b { color: var(--k); }
:root[data-style="b"] .hero-stage .frame-pad, :root[data-style="d"] .hero-stage .frame-pad { padding: 8px 0; }
:root[data-style="d"] .hero-row, :root[data-style="d"] .bytes { justify-content: center; }

/* fixed tokenizer vs H-Net */
.rows { display: grid; gap: 22px; }
.rowlab { font: 400 12px/1.5 var(--mono); margin-bottom: 8px; display: flex; justify-content: space-between; color: var(--ink-3); }
.rowlab b { color: var(--ink); }
.shake { animation: shake .3s ease; }
@keyframes shake { 25% { transform: translateX(-3px);} 50% { transform: translateX(3px);} 75% { transform: translateX(-2px);} }

/* four panels */
.pick { margin-bottom: 18px; }
.ctl { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
:root[data-style="d"] .ctl { justify-content: center; }
:root[data-style="d"] #four .frame-pad { text-align: center; }
.panels { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); }
.panel { padding: 16px 16px 18px; border-bottom: 1px solid var(--line); min-width: 0; }
.panel:nth-child(odd) { border-right: 1px solid var(--line); }
.panel:nth-last-child(-n+2) { border-bottom: 0; }
.panel header { display: flex; justify-content: space-between; align-items: baseline; font: 500 13px/1.4 var(--mono); }
.panel header span:first-child::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--k); margin-right: 8px; }
.panel header .st { color: var(--ink-3); font-weight: 400; font-size: 11.5px; }
.panel header .st em { font-style: normal; color: var(--warn); }
.panel svg { display: block; width: 100%; height: auto; margin: 4px 0 8px; }
#hero-mol { display: block; width: 100%; height: auto; max-height: min(300px, 34vh); margin: 0 0 16px; }
#hero .a, #hero .b, #four .a, #four .b { cursor: default; }
.panel .bytes { --fs: 11.5px; row-gap: 4px; }
.mol { overflow: visible; touch-action: pan-y; }
.mol .bond { stroke: var(--c); stroke-width: var(--bw); stroke-linecap: round; transition: stroke .4s, stroke-width .4s, opacity .4s; }
.mol .bond.x { stroke: var(--ink-3); stroke-width: calc(var(--bw) * .42); stroke-dasharray: 1 4; opacity: .8; }
.mol .bond2 { stroke: var(--frame-fill, var(--card)); stroke-width: var(--bw); transition: opacity .3s; pointer-events: none; }
.mol .bond2.x { opacity: 0; }
.mol .a { fill: color-mix(in srgb, var(--c) 22%, var(--card)); stroke: var(--c); stroke-width: 1; rx: 3px; transition: fill .3s, stroke .3s; }
.mol .a.odd { fill: var(--c); }
.mol .a.split { stroke: var(--warn); stroke-width: 2; stroke-dasharray: 3 2; }
.mol .a.hl { fill: var(--ink); stroke: var(--ink); }
.mol text { font: 500 9.5px var(--mono); fill: var(--ink); text-anchor: middle; pointer-events: none; }
.mol .odd + text, .mol .hl + text { fill: var(--card); }
@media (max-width: 720px) { .panels { grid-template-columns: 1fr; } .panel:nth-child(odd) { border-right: 0; } .panel:nth-last-child(2) { border-bottom: 1px solid var(--line); } }

/* atlas */
#atlas { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; }
.atlas-top { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 18px 16px 4px; text-align: center; }
.atlas-n { font: 400 clamp(15px, 1.6vw, 19px)/1 var(--display); color: var(--ink-2); }
.atlas-n b { font: 200 clamp(40px, 7vw, 72px)/1 var(--display); letter-spacing: -0.03em; color: var(--ink); margin-right: 8px; font-variant-numeric: tabular-nums; }
.atlas-cv { display: block; width: 100%; aspect-ratio: 16 / 9; cursor: crosshair; }
.atlas-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px 16px; font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); }
.tip { position: absolute; pointer-events: none; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 14px; font: 500 18px/1.2 var(--mono); z-index: 5; min-width: 190px; }
.tip .tr { display: grid; grid-template-columns: 9px 1fr auto; gap: 8px; align-items: center; font: 400 11px/1.4 var(--mono); color: var(--ink-2); padding-top: 4px; margin-top: 4px; border-top: 1px solid var(--line); }
.tip .tr:first-of-type { margin-top: 10px; }
.tip .tr i { width: 9px; height: 9px; border-radius: 2px; background: var(--k); }
.atlas-fig { margin: 48px 0; }
.atlas-fig iframe { display: block; width: 100%; height: min(92vh, 920px); border: 0; background: var(--bg); }
.atlas-fig figcaption { margin-top: 6px; }

/* heat grid */
.heat { display: grid; grid-template-columns: max-content repeat(10, minmax(0, 1fr)); gap: 8px; align-items: center; font: 400 11.5px/1.3 var(--mono); }
.heat .col { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--ink-3); justify-self: center; padding-top: 4px; white-space: nowrap; }
.heat .rw { padding-right: 10px; white-space: nowrap; font-weight: 500; }
.heat .rw::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--k); margin-right: 8px; }
.cell { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5px; aspect-ratio: 1; position: relative; max-width: 56px; cursor: default; }
.cell i { background: var(--tile-lo); border-radius: 1.5px; }
.cell i.on { background: var(--c); }
.cell::after { content: attr(data-v); position: absolute; inset: -2px; display: grid; place-items: center; font: 500 12px var(--mono); background: var(--ink); color: var(--bg); border-radius: 6px; opacity: 0; transition: opacity .12s; }
.cell:hover::after, .cell:focus::after { opacity: 1; }
@media (max-width: 720px) { .heat { gap: 4px; font-size: 10px; } .heat .rw { font-size: 0; padding: 0; } .heat .rw::before { margin: 0; } }

/* bars */
.bars { display: grid; grid-template-columns: max-content 1fr max-content; gap: 9px 14px; align-items: center; font: 400 12px/1 var(--mono); }
.bars .bar { height: 10px; border-radius: 2px; background: var(--c); width: calc(var(--v) * 1%); }
.bars .lab { color: var(--ink-2); }
.bars .lab b { color: var(--ink); background: var(--mark); padding: 2px 5px; border-radius: 3px; }
.bars .val { color: var(--ink-3); font-variant-numeric: tabular-nums; }
.barwrap { position: relative; }
.barwrap .mark { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--ink-3); left: calc(var(--m) * 1%); }

/* readout switch */
.headgrid { display: grid; gap: 20px; margin-top: 20px; }
.headrow .t { display: flex; justify-content: space-between; font: 500 12.5px/1.5 var(--mono); margin-bottom: 7px; gap: 12px; flex-wrap: wrap; }
.headrow .t span:last-child { color: var(--ink-3); font-weight: 400; }
.strip { display: grid; grid-template-columns: repeat(50, 1fr); gap: 2px; }
.strip i { aspect-ratio: 1; background: var(--tile-lo); border-radius: 2px; }
.strip i.on { background: var(--c); }
.strip i.rnd { outline: 1.5px solid var(--ink); outline-offset: 1px; z-index: 1; }

/* rankings */
.scroll-x { overflow-x: auto; }
.bump { width: 100%; min-width: 640px; height: auto; display: block; }
.bump text { font: 400 11px var(--mono); fill: var(--ink-3); }
.bump .hd { fill: var(--ink); font-weight: 500; font-size: 12px; }
.bump path { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.bump rect { stroke: var(--card); stroke-width: 2; rx: 3px; }

/* masking demo */
.maskline { display: flex; flex-wrap: wrap; gap: 5px 2px; font: 500 16px/1 var(--mono); }
.maskline span { width: 1.2em; height: 1.9em; display: grid; place-items: center; border-radius: 3px; background: color-mix(in srgb, var(--o3) 16%, transparent); transition: background-color .2s, color .2s; }
.maskline span.m { background: var(--tile-hi); color: transparent; }

/* footer, toast */
.foot { margin-top: 110px; padding: 28px 20px 90px; border-top: 1px solid var(--line); font: 400 11.5px/1.5 var(--mono); color: var(--ink-3); }
.foot .in { max-width: var(--wide); margin: 0 auto; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.toast { position: fixed; left: 50%; bottom: 70px; transform: translate(-50%, 12px); background: var(--ink); color: var(--bg); font: 500 12.5px/1.4 var(--mono); padding: 10px 14px; border-radius: 9px; opacity: 0; transition: opacity .2s, transform .2s; z-index: 30; pointer-events: none; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* style switcher (temporary, for choosing a direction) */
.styles { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 40; display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: 12px; background: var(--pill); border: 1px solid var(--line); box-shadow: var(--shadow); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.styles span { font: 400 11px/1 var(--mono); color: var(--ink-3); padding: 0 8px 0 10px; }
.styles button { font: 500 12px/1 var(--mono); padding: 7px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.styles button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* front page */
.home { padding-top: 48px; }
.home h1 { font-size: clamp(38px, 6vw, 64px); max-width: 14ch; }
.home .lede { margin: 20px 0 48px; max-width: 28em; }
.card { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; transition: transform .25s cubic-bezier(.2,.9,.2,1), box-shadow .25s; }
.card:hover { color: inherit; transform: translateY(-3px); box-shadow: 0 16px 40px rgba(28, 31, 37, 0.14); }
.card-art { border-bottom: 1px solid var(--line); padding: 34px 24px; display: grid; gap: 10px; overflow: hidden; background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 22px 22px; }
.card-art .bytes { --fs: clamp(7px, 1.72vw, 13px); flex-wrap: nowrap; }
.card-body { padding: 22px 24px 22px; }
.card-body h2 { margin: 0 0 8px; font: 300 28px/1.15 var(--display); letter-spacing: -0.02em; }
.card-body p { margin: 0 0 14px; color: var(--ink-2); font-size: 16px; line-height: 1.55; }
:root[data-style="b"] .card-body h2 { font: 500 16px/1.4 var(--mono); letter-spacing: 0; }
:root[data-style="b"] .card-body h2::before { content: none; }
:root[data-style="b"] .card-body p { font-size: 13px; }
:root[data-style="d"] .home { text-align: center; }
:root[data-style="d"] .home h1, :root[data-style="d"] .home .lede { margin-left: auto; margin-right: auto; }
:root[data-style="d"] .card { text-align: left; }

:root[data-style="d"] #fixed, :root[data-style="d"] #mask, :root[data-style="d"] #head { text-align: center; }
:root[data-style="d"] .maskline { justify-content: center; }

/* charts draw themselves once, when first scrolled into view (class "rv" is set by script) */
.rv .cell i.on { background: var(--tile-lo); transition: background-color .4s; transition-delay: calc(var(--d, 0) * 1ms); }
.rv figure.in .cell i.on { background: var(--c); }
.rv .bars .bar { width: 0; transition: width 1s cubic-bezier(.2,.9,.2,1); transition-delay: calc(var(--d, 0) * 1ms); }
.rv figure.in .bars .bar { width: calc(var(--v) * 1%); }
.rv .bump path { stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.5s cubic-bezier(.5,0,.2,1); transition-delay: calc(var(--d, 0) * 1ms); }
.rv figure.in .bump path { stroke-dashoffset: 0; }
.rv .bump rect { opacity: 0; transition: opacity .5s .9s; }
.rv figure.in .bump rect { opacity: 1; }

:root[data-style="d"] .card h2 { text-align: left; }

/* mono layout: panels keep their outer edges on the column */

/* results table */
.scores { overflow-x: auto; }
.sc-row { display: grid; grid-template-columns: minmax(150px, 1.5fr) repeat(6, minmax(84px, 1fr)); align-items: center; min-width: 700px; border-bottom: 1px solid var(--line); font: 400 12.5px/1.3 var(--mono); background: var(--bg); }
.sc-row > * { padding: 11px 8px; }
.sc-row > :first-child { padding-left: 0; }
.sc-head { border-bottom-color: var(--ink-3); align-items: end; }
.sc-head > span { color: var(--ink-3); font-size: 11px; }
.sc-head button { all: unset; cursor: pointer; padding: 10px 8px; text-align: right; display: grid; gap: 3px; border-radius: 6px; transition: background .2s; }
.sc-head button b { font: 500 12.5px/1.2 var(--mono); color: var(--ink); }
.sc-head button small { font: 400 10.5px/1.2 var(--mono); color: var(--ink-3); }
.sc-head button:hover { background: var(--tile-lo); }
.sc-head button[aria-pressed="true"] { background: var(--ink); }
.sc-head button[aria-pressed="true"] b, .sc-head button[aria-pressed="true"] small { color: var(--bg); }
.sc-head button:focus-visible { outline: 2px solid var(--o2); outline-offset: 2px; }
.sc-row .nm { font-weight: 500; white-space: nowrap; }
.sc-row[data-o] .nm::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--k); margin-right: 9px; }
.sc-row.ref .nm { color: var(--ink-2); font-weight: 400; padding-left: 19px; }
.sc-row .num { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2); transition: background .3s, color .3s; }
.sc-row .num.col { color: var(--ink); background: color-mix(in srgb, var(--tile-lo) 60%, transparent); }
.sc-row .num.best { color: var(--ink); font-weight: 500; }
.sc-row .num.best::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--o3); margin-right: 7px; vertical-align: 1px; }
.sc-body .sc-row:hover .num, .sc-body .sc-row:hover .nm { color: var(--ink); }
table.plain { border-collapse: collapse; width: 100%; font: 400 12.5px/1.4 var(--mono); font-variant-numeric: tabular-nums; }
table.plain th { text-align: left; font-weight: 400; color: var(--ink-3); font-size: 11px; padding: 0 12px 8px 0; border-bottom: 1px solid var(--ink-3); }
table.plain td { padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
table.plain td:first-child, table.plain td.us { color: var(--ink); font-weight: 500; }
ol.refs { padding-left: 22px; margin: 0; font: 400 12.5px/1.7 var(--mono); color: var(--ink-2); }
ol.refs li { margin-bottom: 6px; padding-left: 4px; }
ol.refs li::marker { color: var(--ink-3); }
h3 { font: 500 13px/1.4 var(--mono); margin: 34px 0 12px; color: var(--ink); }
.four-rows { display: grid; gap: 7px; padding: 18px 0 6px; border-top: 1px solid var(--line); }
.panel svg { margin-bottom: 0; }

/* functional-group explorer */
.groups { display: grid; grid-template-columns: minmax(0, 1fr) 230px; gap: 34px; align-items: center; }
.g-grid { display: grid; grid-template-columns: max-content repeat(10, minmax(0, 1fr)); gap: 7px; align-items: center; font: 400 11px/1.3 var(--mono); }
.g-grid .col { writing-mode: vertical-rl; transform: rotate(180deg); color: var(--ink-3); justify-self: center; padding-top: 4px; white-space: nowrap; transition: color .2s; }
.g-grid .col.cur { color: var(--ink); }
.g-grid .rw { padding-right: 10px; white-space: nowrap; font-weight: 500; font-size: 12px; }
.g-grid .rw::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--k); margin-right: 8px; }
.g-grid .cell { all: unset; display: grid; grid-template-columns: repeat(5, 1fr); gap: 1.5px; aspect-ratio: 1; cursor: pointer; padding: 3px; margin: -3px; border-radius: 6px; transition: background .2s, transform .25s cubic-bezier(.22,1,.36,1), opacity .25s; }
.g-grid .cell::after { content: none; }
.g-grid .cell i { background: var(--tile-lo); border-radius: 50%; }
.g-grid .cell i.on { background: var(--c); }
.g-grid:hover .cell:not(.incol) { opacity: .45; }
.g-grid .cell:hover { transform: scale(1.12); }
.g-grid .cell.sel { background: var(--tile-lo); box-shadow: 0 0 0 1px var(--ink-3); }
.g-grid .cell:focus-visible { outline: 2px solid var(--o2); outline-offset: 2px; }
.g-side { --k: var(--ink); }
.g-big { font: 200 68px/1 var(--display); letter-spacing: -0.04em; color: var(--k); font-variant-numeric: tabular-nums; transition: color .3s; }
.g-line { font: 400 12.5px/1.55 var(--mono); color: var(--ink-2); margin: 8px 0 10px; }
.g-line b { color: var(--ink); }
.g-mini { display: grid; gap: 7px; margin-top: 18px; }
.g-bar { display: grid; grid-template-columns: 1fr 34px; gap: 2px 8px; font: 400 10.5px/1.2 var(--mono); color: var(--ink-3); align-items: center; }
.g-bar span { grid-column: 1 / -1; transition: color .2s; }
.g-bar.cur span, .g-bar.cur b { color: var(--ink); }
.g-bar b { font-weight: 400; text-align: right; font-variant-numeric: tabular-nums; }
.tr { height: 4px; border-radius: 2px; background: var(--tile-lo); position: relative; overflow: hidden; }
.tr i { position: absolute; inset: 0; background: var(--k); transform-origin: left; transform: scaleX(0); transition: transform .6s cubic-bezier(.22,1,.36,1); border-radius: 2px; }
@media (max-width: 760px) { .groups { grid-template-columns: 1fr; gap: 22px; } .g-grid { gap: 4px; font-size: 9.5px; } .g-grid .rw { font-size: 0; padding: 0; } .g-grid .rw::before { margin: 0 4px 0 0; } .g-big { font-size: 54px; } }

/* type a molecule */
.smi-in { flex: 1 1 260px; min-width: 0; font: 500 14px/1 var(--mono); color: var(--ink); background: var(--pill); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; box-shadow: var(--shadow); transition: border-color .2s; }
.smi-in:focus { outline: none; border-color: var(--o0); }
#typer .pick { margin-bottom: 0; }
.ty-plot { --n: 20; display: flex; align-items: flex-end; height: 132px; margin-top: 14px; position: relative; font: 500 min(15px, calc((100vw - 60px) / var(--n) / 1.25)) / 1 var(--mono); }
.ty-plot::before { content: ""; position: absolute; left: 0; right: 0; bottom: calc(1.9em + 6px + 90px / 2.8); border-top: 1px dashed var(--ink-3); opacity: .6; }
.ty-col { flex: 0 1 1.25em; min-width: 0; display: grid; justify-items: center; gap: 6px; }
.ty-col i { width: 62%; height: 90px; border-radius: 3px 3px 0 0; background: var(--c); transform-origin: bottom; transform: scaleY(.03); opacity: .55; transition: transform .55s cubic-bezier(.22,1,.36,1), opacity .3s, background-color .3s; }
.ty-col.hot i { opacity: 1; }
.ty-col.na i { background: var(--tile-hi); opacity: .25; }
.ty-col span { width: 100%; height: 1.9em; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, transparent); }
.ty-col.hot span { background: color-mix(in srgb, var(--c) 42%, transparent); }
.ty-col.na span { background: var(--tile-lo); color: var(--ink-3); }
.ty-col:first-child span { border-radius: 4px 0 0 4px; } .ty-col:last-of-type span { border-radius: 0 4px 4px 0; }

/* masking */
#mask-mol { display: block; width: 100%; height: auto; max-height: 260px; margin: 4px 0 14px; }
.bytes .b.m { background: color-mix(in srgb, var(--ink) 16%, transparent); color: transparent; border-radius: 0; }
.mol .gone { opacity: .12; }
.mol .a, .mol text { transition: fill .3s, stroke .3s, opacity .4s; }

/* CLS readout */
.cls-svg { display: block; width: 100%; height: auto; margin: 6px 0 10px; }
.cls-svg .wire { fill: none; stroke: var(--ink-3); stroke-width: 1; opacity: .7; transition: opacity .5s, stroke .5s, stroke-width .5s; }
.cls-svg .tok { fill: var(--tile-lo); rx: 3px; transition: fill .4s, opacity .4s; }
.cls-svg .tok.first { fill: var(--tile-hi); opacity: .35; }
.cls-svg.one .wire { opacity: 0; }
.cls-svg.one .wire.first { opacity: 1; stroke: var(--o0); stroke-width: 2; }
.cls-svg.one .tok { opacity: .45; }
.cls-svg.one .tok.first { fill: var(--o0); opacity: 1; }
.cls-svg .lab { font: 400 10.5px var(--mono); fill: var(--ink-3); }
.cls-svg .out { fill: var(--ink); rx: 8px; }
.cls-svg .outl { font: 500 12px var(--mono); fill: var(--bg); }
.cls-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 8px; }
.cls-stat { display: grid; gap: 6px; }
.cls-stat .nm { font: 500 12.5px/1.3 var(--mono); }
.cls-stat .nm::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--k); margin-right: 8px; }
.cls-stat .sub, .cls-stat .acc { font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); }
.cls-stat .tr { overflow: visible; margin: 8px 0 20px; }
.cls-stat .tr u { position: absolute; left: 45%; top: -4px; bottom: -4px; width: 1px; background: var(--ink); }
.cls-stat .tr u::after { content: "random"; position: absolute; top: 11px; left: -18px; font: 400 9.5px var(--mono); color: var(--ink-3); text-decoration: none; }
@media (max-width: 560px) { .cls-stats { grid-template-columns: 1fr; } }

/* embedding map */
#emb .ctl { margin-bottom: 10px; }
.emb-pick { margin-bottom: 6px; }
.emb-wrap { position: relative; }
.emb-cv { display: block; width: 100%; aspect-ratio: 16 / 10; cursor: crosshair; }
.emb-say { margin-top: 10px; min-height: 3em; }
.tip .tsm { font: 500 12px/1.3 var(--mono); word-break: break-all; }
.tip .tr2 { font: 400 10.5px/1.4 var(--mono); color: var(--ink-3); margin-top: 6px; }
@media (max-width: 640px) { .emb-cv { aspect-ratio: 1; } }

/* ---------- page life ---------- */
@property --kk { syntax: "<color>"; inherits: true; initial-value: #5442c2; }
html { background: var(--bg); }
body { background: transparent; position: relative; }
.drift { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: -1; pointer-events: none; }

/* switches: the dark indicator slides to the pressed option */
.slid { position: relative; }
.slid > .ind { position: absolute; left: 0; top: 0; border-radius: 9px; background: var(--ink); pointer-events: none; opacity: 0; z-index: 0; box-shadow: 0 2px 10px color-mix(in srgb, var(--ink) 25%, transparent); }
.slid.ready > .ind { transition: transform .5s cubic-bezier(.3,1.35,.5,1), width .5s cubic-bezier(.3,1.35,.5,1), height .3s, opacity .2s; }
.slid > button { position: relative; z-index: 1; }
.slid > button[aria-pressed="true"], .slid .obj[aria-pressed="true"], .slid .chip[aria-pressed="true"], .seg.slid button[aria-pressed="true"] { background: transparent; }
.obj, .chip, .seg button { transition: color .3s, transform .15s cubic-bezier(.2,.9,.2,1); }

/* opening */
.crumb { font: 400 12px/1 var(--mono); color: var(--ink-3); margin: 0 0 26px; display: flex; gap: 10px; align-items: center; }
.crumb a { text-decoration: none; } .crumb i { font-style: normal; opacity: .6; } .crumb b { color: var(--o0); font-weight: 500; }
.hero h1 { font-weight: 300; font-size: clamp(38px, 6.2vw, 68px); letter-spacing: -0.04em; }
.hero h1#title { font: 500 clamp(26px, 4.4vw, 40px)/1.2 var(--fig); letter-spacing: -0.01em; color: var(--fig-ink); text-wrap: wrap; }   /* not balance: the title is built from one inline block per word, and Safari then breaks after every word */
.hero .lede { font: 400 15px/1.5 var(--fig); letter-spacing: 0; color: var(--fig-ink); max-width: none; margin-top: 26px; text-wrap: pretty; }
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin: 44px 0 8px; }
.tri h3 { font: 500 13.5px/1.4 var(--mono); margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.tri h3::before { content: ""; width: 11px; height: 11px; border-radius: 50%; background: var(--o1); flex: none; }
.tri > div:nth-child(2) h3::before { background: var(--o0); } .tri > div:nth-child(3) h3::before { background: var(--o3); }
.tri p { font: 400 12.5px/1.7 var(--mono); color: var(--ink-2); margin: 0; padding-left: 21px; }
@media (max-width: 720px) { .tri { grid-template-columns: 1fr; gap: 22px; } }

/* the band: a full-width block in the current objective's colour, ruled into cells */
.band { --kk: var(--k); transition: --kk .7s; margin: 44px 0 56px; padding: 26px 20px; background: color-mix(in srgb, var(--kk) 13%, var(--bg)); }
.band-in { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); border: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); }
.band .stage { display: grid; grid-template-rows: 1fr auto; min-height: 460px; border-right: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); }
#hero-cv { display: block; width: 100%; height: 100%; min-height: 360px; cursor: crosshair; touch-action: pan-y; }
.band .stage .bytes { padding: 14px 18px 18px; border-top: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); }
.band .side { display: flex; flex-direction: column; }
.olist { display: grid; }
.olist > .ind { background: color-mix(in srgb, var(--kk) 30%, transparent); border-radius: 0; box-shadow: none; }
.orow { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 54px 1fr auto; align-items: center; font: 400 13.5px/1 var(--mono); color: var(--ink-2); border-bottom: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); transition: color .3s; }
.orow > span { padding: 17px 16px; }
.orow .no { font-style: italic; border-right: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); text-align: center; color: var(--ink-3); }
.orow .nm { font-style: italic; } .orow .ct { font-size: 11.5px; color: var(--ink-3); }
.orow:hover { color: var(--ink); }
.orow[aria-pressed="true"] { color: var(--ink); } .orow[aria-pressed="true"] .nm { font-style: normal; font-weight: 500; }
.orow:focus-visible { outline: 2px solid var(--kk); outline-offset: -2px; }
.olist.auto .orow[aria-pressed="true"]::after { content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: var(--kk); transform-origin: left; animation: tick 3.2s linear both; }
.orow { position: relative; }
.cellx { padding: 18px 20px; border-bottom: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); }
.cellx:last-child { border-bottom: 0; }
.cellx.grow { flex: 1; display: flex; align-items: flex-end; }
.cellx .hero-say { margin: 0; font: italic 400 13px/1.6 var(--mono); color: var(--ink-2); }
.cellx .hero-say b { color: var(--ink); font-style: normal; }
.shout { margin: 0; font: 500 clamp(20px, 2.3vw, 27px)/1.22 var(--display); letter-spacing: -0.02em; text-transform: uppercase; }
.cellx.split { display: flex; justify-content: space-between; gap: 12px; font: 400 11.5px/1.4 var(--mono); color: var(--ink-2); }
.cellx.split span:last-child { font-style: italic; }
@media (max-width: 860px) { .band-in { grid-template-columns: 1fr; } .band .stage { border-right: 0; border-bottom: 1px solid color-mix(in srgb, var(--kk) 45%, transparent); min-height: 380px; } }

/* scoreboard */
.rk-body { display: grid; gap: 4px; margin-top: 6px; }
.rk-row { display: grid; grid-template-columns: 22px 150px 1fr 52px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); font: 400 12.5px/1 var(--mono); background: var(--bg); }
.rk-row .pos { color: var(--ink-3); font-style: italic; }
.rk-row .nm { font-weight: 500; white-space: nowrap; }
.rk-row .nm::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; background: var(--k); margin-right: 9px; }
.rk-row b { text-align: right; font-weight: 400; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.rk-row.lead b { color: var(--ink); font-weight: 500; }
.rk-dots { display: grid; grid-template-columns: repeat(48, 1fr); gap: 2px; }
.rk-dots i { aspect-ratio: 1; border-radius: 50%; background: var(--tile-lo); transition: background-color .35s, transform .35s cubic-bezier(.3,1.5,.5,1); transition-delay: calc(var(--i) * 9ms); }
.rk-dots i.on { background: var(--c); transform: scale(1.15); }
@media (max-width: 620px) { .rk-row { grid-template-columns: 16px 1fr 44px; } .rk-dots { grid-column: 1 / -1; grid-row: 2; } }

/* =====================================================================================
   ONE SYSTEM. Every figure is a ruled panel in the language of the opening band:
   a tinted block, 1px rules, a label row, a control row, a body, a readout row.
   One switch component (ruled cells, a tint slides to the selection). Actions look
   different from switches: underlined text.
   ===================================================================================== */
.frame {
  --kk: var(--k, var(--ink-3)); --rule: color-mix(in srgb, var(--kk) 40%, transparent); --fill: color-mix(in srgb, var(--kk) 8%, var(--bg)); --frame-fill: var(--fill);
  transition: --kk .7s; background: var(--fill); border: 1px solid var(--rule); border-radius: 0; box-shadow: none; overflow: hidden;
}
.frame.frame-pad, .frame > .frame-pad { padding: 20px; }
.frame[data-fig]::before { content: attr(data-fig); display: block; font: italic 400 11.5px/1 var(--mono); color: var(--ink-2); padding: 12px 20px; border-bottom: 1px solid var(--rule); }
.frame.frame-pad[data-fig]::before { margin: -20px -20px 20px; }
figure { margin: 36px auto 40px; }
figcaption { margin-top: 12px; }

/* control row: sits flush under the label, full width, ruled */
.ctl { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; margin: -20px -20px 20px; border-bottom: 1px solid var(--rule); overflow: hidden; }
#four > .ctl { margin: 0; }
.ctl + .ctl { margin-top: -20px; }

/* the switch */
.objs, .seg, .pick { display: flex; flex-wrap: wrap; gap: 0; padding: 0; border: 0; border-radius: 0; background: none; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; max-width: none; margin: 0; }
.obj, .chip, .seg button {
  font: italic 400 12.5px/1 var(--mono); letter-spacing: 0; padding: 13px 16px; border: 0; border-radius: 0; background: none; color: var(--ink-2);
  box-shadow: 1px 0 0 var(--rule), 0 1px 0 var(--rule); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px;
}
.obj:hover, .chip:hover, .seg button:hover { color: var(--ink); }
.obj[aria-pressed="true"], .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { color: var(--ink); font-style: normal; font-weight: 500; background: none; }
.obj:active, .chip:active, .seg button:active { transform: none; }
.obj::before { width: 9px; height: 9px; border-radius: 50%; }
.obj[aria-pressed="true"]::before { transform: scale(1.3); }
.slid > .ind { border-radius: 0; box-shadow: none; background: color-mix(in srgb, var(--kk) 30%, transparent); }
.slid.ready > .ind { transition: transform .5s cubic-bezier(.3,1.3,.5,1), width .5s cubic-bezier(.3,1.3,.5,1), height .3s, opacity .2s, background-color .5s; }
.pick.vert { flex-direction: column; flex-wrap: nowrap; }
.pick.vert .chip { box-shadow: 0 1px 0 var(--rule); }

/* actions: not a choice, so not a cell */
.act { all: unset; cursor: pointer; font: 400 12.5px/1 var(--mono); color: var(--ink-2); border-bottom: 1px dashed var(--ink-3); padding-bottom: 2px; transition: color .2s, border-color .2s; }
.act:hover { color: var(--ink); border-bottom-color: var(--ink); }
.act:focus-visible { outline: 2px solid var(--kk); outline-offset: 3px; }
.ctl > .act { align-self: center; margin: 0 16px 0 auto; }
.acts { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; font: italic 400 12px/1 var(--mono); color: var(--ink-3); margin-top: 16px; }

/* readout row: closes the panel */
.frame .hero-say { margin: 20px -20px -20px; padding: 13px 20px; border-top: 1px solid var(--rule); font: italic 400 12.5px/1.6 var(--mono); color: var(--ink-2); min-height: 0; }
.frame .hero-say b { color: var(--ink); font-style: normal; font-weight: 500; }

/* shared rows of dots (groups, readout, scoreboard) */
.rk-row { background: none; border-bottom: 1px solid var(--rule); padding: 13px 0; }
.rk-body .rk-row:last-child { border-bottom: 0; padding-bottom: 2px; }
.rk-row .pos:empty { display: none; }
.rk-row:has(.pos:empty) { grid-template-columns: 150px 1fr 52px; }
.rk-dots i { background: color-mix(in srgb, var(--kk) 22%, transparent); }
.rk-dots.mark45 { position: relative; }
.rk-dots.mark45::after { content: ""; position: absolute; left: 45%; top: -5px; bottom: -5px; width: 1px; background: var(--ink); }

/* figure-specific layout, same parts */
#fixed .rows { gap: 18px; }
.panels { border-top: 0; }
.panel, .panel:nth-child(odd), .panel:nth-last-child(2) { border-color: var(--rule); }
.four-rows { border-top: 1px solid var(--rule); padding: 18px 20px 20px; }
.groups { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 0; margin: -20px; align-items: stretch; }
.groups .pick.vert { border-right: 1px solid var(--rule); }
.groups .pick.vert .chip { padding: 11px 16px; }
.g-main { padding: 18px 20px 14px; }
.g-line { margin: 0 0 8px; font: 400 12.5px/1.6 var(--mono); color: var(--ink-2); }
@media (max-width: 640px) { .groups { grid-template-columns: 1fr; } .groups .pick.vert { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--rule); } .groups .pick.vert .chip { box-shadow: 1px 0 0 var(--rule), 0 1px 0 var(--rule); } }
.smi-in { flex: 1 1 100%; border: 0; border-radius: 0; box-shadow: none; background: none; padding: 14px 20px; font-size: 14px; }
.smi-in:focus { background: color-mix(in srgb, var(--kk) 14%, transparent); }
.cls-svg .out { rx: 0; }
.cls-svg .tok { rx: 0; fill: color-mix(in srgb, var(--kk) 30%, transparent); }
.emb-cv { margin: 0; }
.tip { border-radius: 0; box-shadow: none; border-color: var(--rule); background: var(--bg); }
.sc-row { background: none; border-bottom-color: var(--rule); }
.sc-head { border-bottom-color: var(--rule); }
.sc-head button { border-radius: 0; }
.sc-row .num.col { background: color-mix(in srgb, var(--kk) 16%, transparent); }
table.plain td { border-bottom-color: var(--line); }
.theme { border-radius: 0; box-shadow: none; background: none; font-style: italic; }
.toast { border-radius: 0; box-shadow: none; }
.card { border-radius: 0; box-shadow: none; border-color: color-mix(in srgb, var(--o0) 40%, transparent); background: color-mix(in srgb, var(--o0) 8%, var(--bg)); }
.card:hover { box-shadow: none; transform: none; background: color-mix(in srgb, var(--o0) 14%, var(--bg)); }
.card-art { background-image: none; border-bottom-color: color-mix(in srgb, var(--o0) 40%, transparent); }
.card-body h2::before { content: none; }
code, .smi { border-radius: 0; }
.bytes .b.st, .bytes .b.en { border-radius: 0; }
.mol .a { rx: 1px; }
.pick.vert .chip { justify-content: flex-start; width: 100%; box-sizing: border-box; }
.groups .pick.vert .chip:last-child { box-shadow: none; }
.sc-row { grid-template-columns: minmax(128px, 1.4fr) repeat(6, minmax(66px, 1fr)); min-width: 600px; }
.sc-row > * { padding-left: 4px; padding-right: 4px; }
@media (max-width: 640px) { .groups .pick.vert .chip { width: auto; } .groups .pick.vert .chip:last-child { box-shadow: 1px 0 0 var(--rule), 0 1px 0 var(--rule); } }

/* =====================================================================================
   BORDERLESS. The post now follows the Cloud / Ink drawings: no boxes, no rules, no tints.
   Mono type, thin numerals, ink for everything, a model's colour only as an accent.
   Space separates things; a thin underline marks what is selected.
   ===================================================================================== */
.frame, .frame.frame-pad, .frame > .frame-pad { border: 0; background: none; padding: 0; overflow: visible; --rule: transparent; --fill: var(--bg); --frame-fill: var(--bg); }
.frame[data-fig]::before, .frame.frame-pad[data-fig]::before { display: block; margin: 0 0 14px; padding: 0; border: 0; font: italic 400 11.5px/1.4 var(--mono); color: var(--ink-3); }
figure { margin: 44px auto 48px; }
figcaption, p.cap { font: 400 12px/1.6 var(--mono); color: var(--ink-2); margin-top: 16px; }

/* control rows and switches: plain words, the chosen one is ink with a line under it */
.ctl, #four > .ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 26px; margin: 0 0 20px; border: 0; overflow: visible; }
.ctl + .ctl { margin-top: -8px; }
.objs, .seg, .pick { display: flex; flex-wrap: wrap; gap: 4px 22px; }
.obj, .chip, .seg button { font: 400 12.5px/1 var(--mono); padding: 5px 0 8px; color: var(--ink-3); box-shadow: none; }
.obj[aria-pressed="true"], .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { color: var(--ink); font-weight: 400; font-style: normal; }
.obj::before { width: 8px; height: 8px; }
.slid > .ind { background: linear-gradient(to top, var(--ink) 1.5px, transparent 1.5px); border-radius: 0; box-shadow: none; }
.ctl > .act { margin: 0; align-self: center; }
.pick.vert { gap: 0; }
.pick.vert .chip, .groups .pick.vert .chip { padding: 7px 0; box-shadow: none; width: auto; }

/* readouts and rows */
.frame .hero-say { margin: 18px 0 0; padding: 0; border: 0; font: italic 400 12.5px/1.6 var(--mono); color: var(--ink-2); }
.rk-row, .rk-body .rk-row:last-child { border: 0; padding: 9px 0; }
.rk-dots i { background: var(--tile-lo); }
.rk-dots i.on { background: var(--ink); transform: none; }
.rk-row.lead .rk-dots i.on { background: var(--k); }
.rk-dots.mark45::after { background: var(--ink-3); }
.groups { grid-template-columns: 130px minmax(0, 1fr); margin: 0; gap: 0 28px; align-items: start; }
.groups .pick.vert { border: 0; }
.g-main { padding: 0; }
.smi-in { padding: 9px 0; border-bottom: 1px solid var(--line); flex: 1 1 100%; }
.smi-in:focus { background: none; border-bottom-color: var(--ink); }
.sc-row { border-bottom: 0; }
.sc-head { border-bottom: 1px solid var(--line); }
.sc-row .num.col { background: none; color: var(--ink); }
.sc-head button[aria-pressed="true"] { background: none; box-shadow: inset 0 -1.5px 0 var(--ink); }
.sc-head button[aria-pressed="true"] b, .sc-head button[aria-pressed="true"] small { color: var(--ink); }
.sc-head button:hover { background: none; }
table.plain th { border-bottom: 1px solid var(--line); }
table.plain td { border-bottom: 0; }
.note { border-left: 0; padding-left: 0; }
.cls-svg .tok { fill: var(--tile-lo); }
.cls-svg.one .tok.first, .cls-svg.one .wire.first { fill: var(--ink); stroke: var(--ink); }
.cls-svg.one .wire.first { fill: none; }
.cls-svg .tok.first { fill: var(--ink-3); opacity: 1; }
.tip { background: var(--ink); color: var(--bg); border: 0; }
.tip .tr2 { color: color-mix(in srgb, var(--bg) 70%, transparent); }
.theme { border: 0; padding: 6px 0; color: var(--ink-3); }
.foot { border-top: 0; }
.ty-col span, .ty-col.hot span { background: none; }
.ty-col.hot span { color: var(--ink); font-weight: 500; } .ty-col span { color: var(--ink-2); }
.ty-col i { background: var(--ink); opacity: .35; border-radius: 1px; width: 46%; }
.ty-col.hot i { opacity: 1; background: var(--o0); }
.maskline span, .bytes .b.m { background: none; }
.bytes .b.m { box-shadow: inset 0 -1.5px 0 var(--ink-3); color: transparent; }

/* the molecule rows inside the post */
.cl-wide { max-width: 1288px; margin: 40px auto 30px; padding: 0; }
.cl-wide .v.bare { padding: 0 24px; }
.cl-wide .v.bare .sample { margin-top: 0; }
#hero-row { margin-top: 56px; }
.mask-cv { display: block; width: 100%; height: 300px; cursor: crosshair; touch-action: pan-y; margin: 0 0 10px; }

/* the atlas, in ink */
.atlas2 { padding: 0 24px; margin-top: 30px; }
.a2-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.a2-n { display: inline-flex; align-items: baseline; gap: 10px; font: 400 12px/1 var(--mono); color: var(--ink-3); }
.a2-n b { font: 200 clamp(40px, 6vw, 64px)/1 var(--display); letter-spacing: -0.04em; color: var(--ink); font-variant-numeric: tabular-nums; }
#a2-cv { display: block; width: 100%; aspect-ratio: 16 / 8.5; cursor: crosshair; margin: 6px 0; }
.a2-foot { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; flex-wrap: wrap; min-height: 2.4em; }
.a2-foot .hero-say { margin: 0; font: italic 400 12.5px/1.6 var(--mono); color: var(--ink-2); }
.a2-foot .hero-say b { color: var(--ink); font-style: normal; font-weight: 500; }
@media (max-width: 640px) { #a2-cv { aspect-ratio: 1; } .groups { grid-template-columns: 1fr; } .groups .pick.vert { flex-direction: row; flex-wrap: wrap; gap: 2px 18px; margin-bottom: 12px; } }
.pick.vert { align-items: flex-start; }
@media (max-width: 900px) { .cl-wide .v.bare { padding: 0 16px; } .atlas2 { padding: 0 16px; } }


/* =====================================================================================
   ONE LOOK, taken from the Cloud / Ink rows.
   - A choice among options: plain words; a soft pill slides behind the chosen one.
   - An action (sample another, another one, load aspirin): a soft pill by itself.
   - Molecule text: plain characters; a thin line under them marks each piece.
   ===================================================================================== */
.ctl, #four > .ctl { gap: 8px 14px; margin: 0 0 22px -12px; }
.objs, .seg, .pick { gap: 2px 2px; }
.obj, .chip, .seg button { padding: 8px 13px; border-radius: 999px; font: 400 12.5px/1 var(--mono); color: var(--ink-2); box-shadow: none; }
.obj:hover, .chip:hover, .seg button:hover { color: var(--ink); background: color-mix(in srgb, var(--ink) 6%, transparent); }
.obj[aria-pressed="true"], .chip[aria-pressed="true"], .seg button[aria-pressed="true"] { color: var(--ink); font-weight: 500; background: none; }
.slid > .ind { background: color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 999px; }
.pick.vert { margin-left: -13px; gap: 1px; }
.pick.vert .chip, .groups .pick.vert .chip { padding: 7px 13px; }
.obj:active, .chip:active, .seg button:active { transform: scale(.96); }
.act { border: 0; padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); color: var(--ink); font: 500 12.5px/1 var(--mono); transition: background-color .2s, transform .2s cubic-bezier(.3,1.6,.5,1); }
.act:hover { background: color-mix(in srgb, var(--ink) 17%, transparent); border: 0; }
.act:active { transform: scale(.95); }
a.act { text-decoration: none; display: inline-block; }
.acts { gap: 6px 8px; align-items: center; }
.acts > span { margin-right: 4px; }
.sc-head button[aria-pressed="true"] { background: color-mix(in srgb, var(--ink) 12%, transparent); border-radius: 10px; box-shadow: none; }
.sc-head button:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); border-radius: 10px; }
.theme { padding: 7px 12px; border-radius: 999px; font-style: normal; color: var(--ink-2); }
.theme:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }

/* molecule text: no boxes; each piece is underlined, alternating two strengths so neighbours read apart */
.bytes { padding: 2px 0 4px; }
.bytes .b, .bytes.fixed .b { background: none; border-radius: 0; color: var(--ink); height: 1.9em; box-shadow: inset 0 -2px 0 var(--c, var(--ink));
  transition: transform .62s cubic-bezier(.22,1,.36,1), box-shadow .3s, color .3s, opacity .3s; }
.bytes .b.odd, .bytes.fixed .b.odd { background: none; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--c, var(--ink)) 42%, transparent); }
.bytes .b.st, .bytes .b.en { border-radius: 0; }
.bytes.fixed .b { color: var(--ink-2); box-shadow: inset 0 -2px 0 var(--ink-3); }
.bytes.fixed .b.odd { box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--ink-3) 45%, transparent); }
.bytes .b.hl, .bytes.fixed .b.hl { background: none; color: var(--ink); font-weight: 500; box-shadow: inset 0 -4px 0 var(--c, var(--ink)); }
.bytes .b.dim { opacity: .32; }
.bytes .b.m { color: transparent; box-shadow: inset 0 -2px 0 color-mix(in srgb, var(--ink-3) 55%, transparent); }
.lines { display: grid; gap: 16px; }
.line { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 4px 18px; align-items: center; }
.l-lab { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font: 500 12.5px/1.3 var(--mono); }
.l-nm { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.line[data-o] .l-nm::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--k); }
.l-ct { font: italic 400 11.5px/1 var(--mono); color: var(--ink-3); white-space: nowrap; }
@media (max-width: 700px) { .line { grid-template-columns: 1fr; } .l-lab { justify-content: flex-start; } }
.card-art .bytes .b { box-shadow: inset 0 -2px 0 var(--c); }

/* fixed-vs-learned lines: name and count sit above each line so the text keeps its full width */
.line { grid-template-columns: 1fr; gap: 7px; }
.l-lab { justify-content: flex-start; gap: 12px; }
/* front page: the post is its own molecule text, no box around it */
.card, .card:hover { border: 0; background: none; border-radius: 0; box-shadow: none; transform: none; }
.card-art { border: 0; padding: 0 0 26px; gap: 14px; background: none; }
.card-art .bytes { --fs: 15px; }
.card-body { padding: 0; }
.card-body h2 { transition: color .2s; }
.card:hover .card-body h2 { color: var(--o0); }
.card .meta { font: italic 400 11.5px/1 var(--mono); color: var(--ink-3); }
.card:focus-visible { outline: 2px solid var(--o2); outline-offset: 8px; }
/* an action next to a switch sits at the far end, so it never reads as one of the options */
.seg + .act, .objs + .act, .pick + .act { margin-left: auto; }

/* ---- long-form post: side contents, hover notes, placeholders, plain tables ---- */
.toc { position: fixed; top: 132px; left: calc(50% + var(--col) / 2 + 56px); width: 208px; max-height: calc(100vh - 180px); overflow: auto; z-index: 6; font: 400 12px/1.45 var(--mono); transition: opacity .25s; scrollbar-width: none; }
.toc.away { opacity: 0; pointer-events: none; }
.toc h4, .toc-m summary { font: 500 11px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink); margin: 0 0 14px; }
.toc a, .toc-m a { display: block; padding: 5px 0 5px 13px; color: var(--ink-3); text-decoration: none; border-left: 1px solid var(--line); transition: color .2s, border-color .2s; text-wrap: balance; }
.toc a:hover, .toc-m a:hover { color: var(--ink); }
.toc a.on { color: var(--ink); border-left-color: var(--o0); }
@media (min-width: 1560px) { .toc { left: calc(50% + var(--wide) / 2 + 44px); } }
@media (max-width: 1239px) { .toc { display: none; } }
.toc-m { margin: 26px 0 0; font: 400 12.5px/1.45 var(--mono); }
.toc-m summary { cursor: pointer; margin: 0; list-style: none; display: inline-flex; gap: 8px; align-items: center; }
.toc-m summary::-webkit-details-marker { display: none; }
.toc-m summary::after { content: "+"; color: var(--ink-3); }
.toc-m[open] summary::after { content: "−"; }
.toc-m .toc-list { margin-top: 14px; }
@media (min-width: 1240px) { .toc-m { display: none; } }

.gloss { cursor: help; border-bottom: 1px dotted var(--ink-3); outline: none; transition: border-color .2s; }
.gloss:hover, .gloss:focus { border-bottom: 1px solid var(--ink); }
.gloss-pop { position: fixed; left: 0; top: 0; z-index: 60; max-width: min(300px, calc(100vw - 24px)); padding: 11px 13px; background: var(--ink); color: var(--bg); font: 400 12px/1.55 var(--mono); pointer-events: none; opacity: 0; transform: translateY(-3px); transition: opacity .16s, transform .16s; }
.gloss-pop.show { opacity: 1; transform: none; }
ul.objs-list { list-style: none; padding-left: 0; display: flex; flex-wrap: wrap; gap: 8px 26px; font: 400 14px/1.5 var(--mono); }
ul.objs-list li { margin: 0; display: flex; align-items: center; gap: 9px; }
ul.objs-list li::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--o0); flex: none; }
ul.objs-list li:nth-child(2)::before { background: var(--o1); } ul.objs-list li:nth-child(3)::before { background: var(--o2); } ul.objs-list li:nth-child(4)::before { background: var(--o3); }

.ph { aspect-ratio: 16 / 5; min-height: 170px; display: grid; place-items: center; text-align: center; padding: 22px; border: 1px dashed var(--ink-3); color: var(--ink-3); font: 400 12px/1.6 var(--mono); background: repeating-linear-gradient(135deg, transparent 0 11px, var(--grid) 11px 12px); }
.ph span { max-width: 46ch; } .ph b { display: block; font-weight: 500; color: var(--ink-2); letter-spacing: .1em; text-transform: uppercase; font-size: 11px; margin-bottom: 8px; }

.tbl { overflow-x: auto; margin: 28px 0 34px; }
.tbl table.plain { width: 100%; min-width: 520px; border-collapse: collapse; font: 400 13px/1.45 var(--mono); font-variant-numeric: tabular-nums; }
.tbl table.plain th { font: 500 10.5px/1.3 var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); text-align: right; vertical-align: bottom; white-space: nowrap; padding: 0 0 11px 18px; border-bottom: 1px solid color-mix(in srgb, var(--ink) 34%, transparent); }
.tbl table.plain th { white-space: normal; }
.tbl table.plain td { position: relative; text-align: right; white-space: nowrap; padding: 11px 0 11px 18px; color: var(--ink); font-weight: 400; border-bottom: 1px solid var(--line); transition: background-color .2s, color .2s; }
.tbl table.plain th:first-child, .tbl table.plain td:first-child { text-align: left; padding-left: 8px; }
.tbl table.plain th:last-child, .tbl table.plain td:last-child { padding-right: 8px; }
.tbl table.plain td:first-child { color: var(--ink); font-weight: 500; }
.tbl table.plain tbody tr { cursor: default; }
.tbl table.plain tbody tr:not([data-o]) { --k: var(--ink-3); }
.tbl table.plain td:first-child::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--k); margin-right: 9px; vertical-align: 1px; }
.tbl table.plain tbody tr:hover td { background: color-mix(in srgb, var(--k) 14%, transparent); }
.tbl table.plain tbody tr[data-o]:hover td:first-child { color: var(--k); }
.tbl table.plain td.us { font-weight: 500; text-decoration: underline; text-decoration-color: var(--k); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.tbl table.plain tbody tr:last-child td { border-bottom: 0; }
.tbl .rnd { color: var(--ink-3); margin-left: 5px; }
.tbl table.plain.text th, .tbl table.plain.text td { text-align: left; white-space: normal; padding: 10px 18px 10px 0; vertical-align: top; }
.tbl table.plain.text th { padding-top: 0; }
.tbl table.plain.text td:first-child::before { content: none; }
.tbl table.plain.text td:first-child, .tbl table.plain.text th:first-child { padding-left: 8px; }
.tblfig .tbl { margin: 0; }
table.plain tr.mine.first td { border-top: 1px solid color-mix(in srgb, var(--ink) 34%, transparent); }
pre.cuts { font: 400 12.5px/1.9 var(--mono); color: var(--ink); overflow-x: auto; margin: 22px 0 26px; padding: 0; }
pre.cuts span { color: var(--ink-3); } pre.cuts span[data-o="0"] { color: var(--o0); } pre.cuts span[data-o="1"] { color: var(--o1); } pre.cuts span[data-o="2"] { color: var(--o2); } pre.cuts span[data-o="3"] { color: var(--o3); }
.appx p, .appx ul.plain { font-size: 15.5px; }
section > .wrap > p.cap, section.wrap > p.cap { margin-top: 0; }

/* ---- figures: slim bars with numerals, plots with an axis ---- */
.groups { grid-template-columns: 1fr; gap: 0; }
.groups .pick.vert { flex-direction: row; flex-wrap: wrap; gap: 2px; margin: 0 0 16px -13px; }
.obj:hover, .chip:hover, .seg button:hover { background: none; }
.g-line { margin-bottom: 14px; }
.rk-row, .rk-row:has(.pos:empty), .rk-body .rk-row:last-child { display: grid; grid-template-columns: 158px minmax(0, 1fr) 62px; gap: 18px; align-items: center; padding: 9px 0; border: 0; }
.rk-row:not(:has(.pos:empty)) { grid-template-columns: 14px 158px minmax(0, 1fr) 62px; }
.rk-row .nm { font: 400 12.5px/1 var(--mono); color: var(--ink-2); }
.rk-row.lead .nm { color: var(--ink); }
.rk-row .nm::before { width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; }
.rk-row b, .rk-row.lead b { font: 300 21px/1 var(--display); letter-spacing: -0.02em; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }
.rk-row.lead b { color: var(--ink); font-weight: 400; }
.meter { position: relative; height: 16px; }
.meter::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: color-mix(in srgb, var(--ink) 16%, transparent); }
.meter u { position: absolute; left: 0; top: calc(50% - 2.5px); height: 5px; width: 0; background: var(--k); text-decoration: none; transition: width .7s cubic-bezier(.22,1,.36,1); }
.meter u::after { content: ""; position: absolute; right: -1px; top: -4px; bottom: -4px; width: 1px; background: var(--k); }
.meter s { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: color-mix(in srgb, var(--ink) 11%, transparent); text-decoration: none; transition: width .7s cubic-bezier(.22,1,.36,1); }
.m-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 14px 0 0; font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); }
.m-key span { display: inline-flex; align-items: center; gap: 8px; }
.m-key i.k-bar { width: 18px; height: 5px; background: var(--ink-2); }
.m-key i.k-band { width: 18px; height: 14px; background: color-mix(in srgb, var(--ink) 13%, transparent); }
@media (max-width: 620px) {
  .rk-row, .rk-row:has(.pos:empty), .rk-body .rk-row:last-child { grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; }
  .rk-row:not(:has(.pos:empty)) { grid-template-columns: 14px minmax(0, 1fr) auto; }
  .meter { grid-column: 1 / -1; grid-row: 2; }
}
.cls-svg .tok { fill: color-mix(in srgb, var(--ink) 15%, transparent); }

.rt-wrap { --n: 40; --h: 116px; --mid: 50%; --pad: 6px; container-type: inline-size; display: grid; grid-template-columns: 32px minmax(0, 1fr); margin-top: 10px; }
.rt-wrap.lines { --pad: 22px; }
.rt-wrap > * { --fs: clamp(10px, calc((100cqw - 58px) / var(--n) / 1.3), 15px); --base: calc(1.9 * var(--fs) + var(--pad)); }
.rt-axis { position: relative; font: 400 10.5px/1 var(--mono); color: var(--ink-3); }
.rt-axis span { position: absolute; right: 9px; bottom: calc(var(--base) + var(--h) * var(--p) / 100 - 5px); }
.rt-plot { display: flex; align-items: flex-end; overflow-x: auto; scrollbar-width: thin; font: 500 var(--fs) / 1 var(--mono); }
.rt-col { flex: 0 0 1.3em; min-width: 0; display: grid; justify-items: center; gap: 6px; cursor: default; }
.rt-box { width: 100%; height: var(--h); display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat,
    linear-gradient(90deg, var(--ink-3) 50%, transparent 50%) 0 calc(100% - var(--mid)) / 6px 1px repeat-x,
    linear-gradient(color-mix(in srgb, var(--ink) 34%, transparent), color-mix(in srgb, var(--ink) 34%, transparent)) 0 100% / 100% 1px no-repeat; }
.rt-box i { width: 5px; height: 100%; background: var(--k); opacity: .32; transform-origin: bottom; transform: scaleY(.02); transition: transform .55s cubic-bezier(.22,1,.36,1), opacity .3s, background-color .3s; }
.rt-col.cut .rt-box i { opacity: 1; }
.rt-col.na .rt-box i { opacity: .1; }
.rt-col span { width: 100%; height: 1.9em; display: grid; place-items: center; color: var(--ink-3); transition: color .2s; }
.rt-col.cut span { color: var(--ink); }
.rt-col.na span { color: color-mix(in srgb, var(--ink-3) 60%, transparent); }
.rt-col:hover span { color: var(--ink); background: color-mix(in srgb, var(--k) 18%, transparent); }
.rt-col u, .rt-col em { display: block; width: 100%; height: 2px; background: var(--k); text-decoration: none; justify-self: end; }
.rt-col.odd u { opacity: .4; }
.rt-col.st u { width: calc(100% - 3px); }
.rt-col em { background: var(--ink-3); }
.rt-col.gst em { width: calc(100% - 3px); }
.rt-key { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 16px 0 0 32px; font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); }
.rt-key span { display: inline-flex; align-items: center; gap: 8px; }
.rt-key i { display: inline-block; width: 16px; height: 2px; background: var(--k); }
.rt-key i.k1 { width: 5px; height: 13px; } .rt-key i.k3 { background: var(--ink-3); }
#typer .acts { margin-left: 32px; }

/* ---- router figure: a panel, thick bars that rise in order, pieces that pull apart, a draggable threshold ---- */
figure:has(> .frame.panel) { margin: 64px auto 60px; }
.frame.frame-pad.panel { background: var(--card); border: 1px solid var(--line); padding: 22px 20px 20px; }
.frame.frame-pad.panel[data-fig]::before { font: 500 10.5px/1 var(--mono); font-style: normal; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 20px; }
.frame.panel .hero-say { margin-top: 20px; min-height: 3.2em; }
.rx-c { container-type: inline-size; margin-top: 4px; }
.rx { --n: 40; --g: 12; --h: 136px; --t: .5; --gap: 4px; --gut: 82px; --fs: clamp(9px, calc((100cqw - var(--gut) - 8px - var(--g) * var(--gap)) / var(--n) / 1.15), 15px); --base: calc(1.9 * var(--fs) + 34px);
  position: relative; display: grid; grid-template-columns: var(--gut) minmax(0, 1fr); }
.rx-y { position: relative; font: 400 10.5px/1 var(--mono); color: var(--ink-3); }
.rx-y .tk { position: absolute; right: 12px; bottom: calc(var(--base) + var(--h) * var(--p) - 5px); }
.rx-y .rw { position: absolute; right: 12px; } .rx-y .r1 { bottom: 12px; } .rx-y .r2 { bottom: -4px; transition: opacity .3s; }
.rx-y em { position: absolute; left: 0; bottom: var(--base); height: var(--h); writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; font-style: normal; letter-spacing: .08em; text-transform: uppercase; font-size: 9.5px; }
.rx-scroll { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding-top: 26px; }
.rx-scroll::-webkit-scrollbar { display: none; }
.rx-plot { position: relative; width: max-content; min-width: 100%; font: 500 var(--fs) / 1 var(--mono); }
.rx-cols { display: flex; align-items: flex-end; }
.rx-col { flex: 0 0 1.15em; min-width: 0; display: grid; justify-items: center; cursor: default; transition: margin-left .55s cubic-bezier(.3,1.5,.5,1), opacity .25s; }
.rx-col.st { margin-left: var(--gap); }
.rx-box { width: 100%; height: var(--h); display: flex; align-items: flex-end; justify-content: center;
  background: linear-gradient(var(--line), var(--line)) 0 0 / 100% 1px no-repeat, linear-gradient(color-mix(in srgb, var(--ink) 30%, transparent), color-mix(in srgb, var(--ink) 30%, transparent)) 0 100% / 100% 1px no-repeat; }
.rx-box i { width: min(9px, 64%); height: 100%; border-radius: 2px 2px 0 0; background: var(--k); opacity: .28; transform-origin: bottom; transform: scaleY(.015);
  transition: transform .6s cubic-bezier(.22,1,.36,1) calc(var(--i) * 13ms), opacity .25s, filter .2s; }
.rx-col.cut .rx-box i { opacity: 1; }
.rx-col:hover .rx-box i { opacity: 1; filter: brightness(1.12) saturate(1.1); }
.rx-col span { width: 100%; height: 1.9em; margin-top: 8px; display: grid; place-items: center; color: var(--ink-3); transition: color .2s, background-color .2s, transform .3s cubic-bezier(.3,1.5,.5,1); }
.rx-col.cut span { color: var(--ink); }
.rx-col u, .rx-col em { display: block; width: 100%; height: 3px; text-decoration: none; }
.rx-col u { margin-top: 8px; background: var(--k); transition: opacity .2s; }
.rx-col.odd u { opacity: .4; }
.rx-col em { margin-top: 12px; background: var(--ink-3); transition: opacity .3s; }
.rx-col.st:not(.gst) em { width: calc(100% + var(--gap)); margin-left: calc(-1 * var(--gap)); }
.rx.whatif .rx-col em, .rx.whatif .rx-y .r2 { opacity: .18; }
.rx.hov .rx-col:not(.in) { opacity: .36; }
.rx-col.in span { color: var(--ink); background: color-mix(in srgb, var(--k) 18%, transparent); }
.rx-col.in u { opacity: 1; }
.rx-col.at span { transform: translateY(-3px); }
.rx-tip { position: absolute; left: var(--x, 0); bottom: calc(var(--base) + var(--p, 0) * var(--h) + 7px); transform: translateX(-50%); padding: 4px 6px; font: 500 11px/1 var(--mono); background: var(--k); color: var(--bg); border-radius: 3px; opacity: 0; pointer-events: none; z-index: 4; transition: opacity .15s, left .16s cubic-bezier(.22,1,.36,1), bottom .16s cubic-bezier(.22,1,.36,1); }
.rx.hov .rx-tip { opacity: 1; }
.rx-thr { position: absolute; left: 0; right: 0; bottom: calc(var(--base) + var(--t) * var(--h) - 10px); height: 20px; cursor: ns-resize; touch-action: none; z-index: 3; outline: none; }
.rx-thr::before { content: ""; position: absolute; left: var(--gut); right: 0; top: 50%; border-top: 1px dashed var(--ink-2); transition: border-color .2s; }
.rx-thr b { position: absolute; right: calc(100% - var(--gut) + 8px); top: 50%; transform: translateY(-50%); padding: 5px 8px; font: 500 10.5px/1 var(--mono); white-space: nowrap; border-radius: 999px; background: var(--ink); color: var(--bg); transition: transform .2s cubic-bezier(.3,1.5,.5,1); }
.rx-thr:hover::before, .rx-thr.drag::before, .rx-thr:focus-visible::before { border-top-color: var(--ink); }
.rx-thr:hover b, .rx-thr.drag b, .rx-thr:focus-visible b { transform: translateY(-50%) scale(1.08); }
@media (max-width: 620px) { .rx { --gut: 62px; } .rx-y em { display: none; } .frame.frame-pad.panel { padding: 18px 16px 16px; } }
@media (prefers-reduced-motion: reduce) { .rx-box i, .rx-col { transition: none; } }
.frame.panel .ctl { margin-left: -8px; gap: 8px 10px; }
.frame.panel .hero-say .act { font-style: normal; margin-left: 4px; }

/* ---- dithered bars: a canvas laid over the columns of a bar plot ---- */
canvas.dz { position: absolute; left: 0; pointer-events: none; z-index: 1; }
.dz-on .rx-box i, .dz-on .rt-box i { visibility: hidden; }
.rt-plot.dz-on { position: relative; padding-top: 14px; }
.rx-col.in span { transform: translateY(-4px); }
.rx-col.at span { transform: translateY(-6px); }
.rx.hov .rx-tip { margin-bottom: 10px; }

/* ---- one button language: pills. Options are quiet until chosen; a chosen model fills with its own colour. No dots, no italics. ---- */
.obj::before { display: none; }
.objs, .seg, .pick { gap: 4px; }
.obj, .chip, .seg button { padding: 8px 14px; border-radius: 999px; font: 500 12.5px/1 var(--mono); color: var(--ink-2); background: none; transition: color .2s, background-color .25s, transform .15s cubic-bezier(.2,.9,.2,1); }
.obj:hover { color: var(--k); background: none; }
.chip:hover, .seg button:hover { color: var(--ink); background: none; }
.objs.slid > .ind { display: none; }
.obj[aria-pressed="true"] { background: var(--k); color: var(--bg); font-weight: 500; }
.chip[aria-pressed="true"], .seg button[aria-pressed="true"] { color: var(--ink); font-weight: 500; }
.slid > .ind { background: color-mix(in srgb, var(--ink) 10%, transparent); border-radius: 999px; }
.frame.panel .obj[aria-pressed="true"] { color: var(--card); }
.obj:focus-visible, .chip:focus-visible, .seg button:focus-visible, .act:focus-visible { outline: 1.5px solid var(--ink-2); outline-offset: 2px; }
main :is(.hero-say, .acts, .pos, .pnote, .g-line, figcaption), .frame[data-fig]::before, .frame.frame-pad[data-fig]::before { font-style: normal !important; }
.frame[data-fig]::before, .frame.frame-pad[data-fig]::before { font: 500 10.5px/1 var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 18px; }
.frame .hero-say, .hero-say { color: var(--ink-2); font: 400 12.5px/1.6 var(--mono); }
.frame .hero-say b { color: var(--ink); font-weight: 500; }
.acts { font: 400 12px/1 var(--mono); }
.objs .obj[aria-pressed="true"], .slid .obj[aria-pressed="true"] { background: var(--k) !important; color: var(--bg); }
.frame.panel .objs .obj[aria-pressed="true"] { color: var(--card); }
main i, main em, main .tight { font-style: normal; }
main .l-ct { font-style: normal; }

/* ---- figures without a box: a hairline above, the label under it, and room around ---- */
figure:has(> .frame[data-fig]) { margin: 60px auto 56px; }
.frame[data-fig], .frame.frame-pad[data-fig], .frame.frame-pad.panel { background: none; border: 0; border-top: 1px solid color-mix(in srgb, var(--ink) 24%, transparent); padding: 14px 0 0; }
.frame[data-fig]::before, .frame.frame-pad[data-fig]::before, .frame.frame-pad.panel[data-fig]::before { margin: 0 0 20px; color: var(--ink-3); }
.frame.panel .ctl { margin-left: -14px; }
.frame.panel .objs .obj[aria-pressed="true"] { color: var(--bg); }
@media (max-width: 620px) { .frame.frame-pad.panel { padding: 14px 0 0; } }

/* the drawings' "sample another" is the same soft pill as every other action button */
.cl-wide .v.bare .sbtn, .cl-wide .v.bare .sbtn.under, .cl-wide .v.bare .sbtn.dot { padding: 8px 14px; border-radius: 999px; background: color-mix(in srgb, var(--ink) 10%, transparent); transition: background-color .2s, transform .2s cubic-bezier(.3,1.6,.5,1); }
.cl-wide .v.bare .sbtn:hover { background: color-mix(in srgb, var(--ink) 17%, transparent); }
.cl-wide .v.bare .sbtn canvas { display: none; }

/* dense tables: ten narrow columns of percentages */
.tbl table.plain.dense { min-width: 640px; }
.tbl table.plain.dense th, .tbl table.plain.dense td { padding-left: 10px; }
.tbl table.plain.dense th:first-child, .tbl table.plain.dense td:first-child { padding-left: 8px; }
.tbl table.plain.dense th { white-space: nowrap; letter-spacing: .04em; }
.tbl table.plain.dense th .gloss { border-bottom: 0; }
.tbl table.plain.dense th .gloss:hover, .tbl table.plain.dense th .gloss:focus { color: var(--ink); }
.tbl table.plain.dense td { vertical-align: top; }
.tbl .rnd2 { display: block; margin-top: 3px; font-size: 11px; color: var(--ink-3); }
.frame > .tbl { margin: 0; }

/* notation table: long strings wrap inside their cell */
.tbl table.plain.notes td:first-child { min-width: 0; white-space: nowrap; }
.tbl table.plain.notes td:nth-child(2) { width: 44%; }
.tbl table.plain.notes code { word-break: break-all; font-size: 12px; background: none; padding: 0; color: var(--ink); }
.tbl table.plain.notes td:nth-child(3) { color: var(--ink-2); }
.tbl table.plain.notes { table-layout: fixed; min-width: 560px; }
.tbl table.plain.notes th:first-child { width: 84px; }
.tbl table.plain.notes th:nth-child(2) { width: 46%; }
.tbl table.plain.notes code { display: inline; white-space: normal; overflow-wrap: anywhere; }

/* ---- router figure: four models stacked, one compact plot each ---- */
.rx-stack { display: grid; gap: 26px; margin-top: 14px; }
.rx-stack .rx { --h: 62px; }
.rx-stack .rx-scroll { padding-top: 18px; }
.rx-head { margin: 0 0 2px; display: flex; align-items: center; gap: 9px; font: 500 12.5px/1 var(--mono); color: var(--ink); }
.rx-head i { width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.rx-head span { font-weight: 400; color: var(--ink-3); }
.ctl > .rx-mol { background: none; padding: 0; margin-left: 8px; font: 400 12.5px/1.4 var(--mono); color: var(--ink-2); word-break: break-all; }
.rx-mol + .act { margin-left: auto; }
/* same column positions in all four plots, so a byte sits at the same x in each; pieces are separated by a notch in the line */
.rx-stack .rx { --gap: 0px; }
.rx-stack .rx-col.st u, .rx-stack .rx-col.gst em { width: calc(100% - 3px); justify-self: end; }

/* ---- router figure as one matrix: characters once, one short row of bars per model ---- */
.rm { --n: 40; --lab: 168px; --bh: 44px; container-type: inline-size; display: grid; gap: 14px; margin-top: 18px; }
.rm-row { display: grid; grid-template-columns: var(--lab) minmax(0, 1fr); align-items: end; }
.rm-cols { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); }
.rm-nm { display: flex; align-items: center; flex-wrap: wrap; gap: 3px 8px; padding-bottom: 1px; font: 500 12.5px/1.2 var(--mono); color: var(--ink); }
.rm-nm i { width: 7px; height: 7px; border-radius: 50%; background: var(--k); }
.rm-nm b { font-weight: 500; }
.rm-nm small { flex-basis: 100%; padding-left: 15px; font: 400 11px/1 var(--mono); color: var(--ink-3); }
.rm-chars { margin-bottom: -4px; }
.rm-chars .rm-cols span { text-align: center; padding: 5px 0; border-radius: 3px; font: 500 clamp(8px, calc((100cqw - var(--lab)) / var(--n) / .78), 14px)/1 var(--mono); color: var(--ink-2); cursor: default; transition: color .15s, background-color .15s; }
.rm-chars .rm-cols span.at { color: var(--ink); background: color-mix(in srgb, var(--ink) 14%, transparent); }
.rm-c { cursor: default; }
.rm-box { position: relative; height: var(--bh); display: flex; align-items: flex-end; justify-content: center; border-radius: 3px 3px 0 0; transition: background-color .15s; }
.rm-box::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed color-mix(in srgb, var(--ink) 22%, transparent); }
.rm-box i { position: relative; width: min(9px, 62%); height: 2%; border-radius: 2px 2px 0 0; background: var(--ink-3); opacity: .55; transition: height .6s cubic-bezier(.22,1,.36,1), opacity .2s; }
.rm-c.cut .rm-box i { background: var(--k); opacity: 1; }
.rm-c u { display: block; height: 3px; margin-top: 5px; background: var(--k); text-decoration: none; transition: opacity .2s; }
.rm-c.odd u { opacity: .38; }
.rm-c.cut u { margin-left: 3px; }
.rm-c.at .rm-box { background: color-mix(in srgb, var(--ink) 9%, transparent); }
.rm.hov .rm-c:not(.in) u { opacity: .16; } .rm.hov .rm-c.in u { opacity: 1; }
.hero-say .rm-v { display: inline-block; margin-left: 14px; color: var(--ink-3); white-space: nowrap; }
.hero-say .rm-v.cut { color: var(--k); font-weight: 500; }
@media (max-width: 620px) { .rm { --lab: 0px; --bh: 34px; } .rm-row { grid-template-columns: minmax(0, 1fr); } .rm-nm { margin-bottom: 4px; } .rm-nm small { flex-basis: auto; padding-left: 0; } .rm-chars .rm-nm { display: none; } }
@media (prefers-reduced-motion: reduce) { .rm-box i { transition: none; } }
/* hovering a column: everything else steps back */
.rm-c, .rm-chars .rm-cols span { transition: opacity .2s, color .15s, background-color .15s; }
.rm.hov .rm-c:not(.at) .rm-box { opacity: .22; }
.rm.hov .rm-chars .rm-cols span:not(.at) { opacity: .3; }
.rm.hov .rm-c:not(.in) u { opacity: .1; }
.rm-box { transition: background-color .15s, opacity .2s; }

/* fixed-vs-learned lines, compact: name and count in a narrow column on the left, the text beside it */
#fixed-lines { gap: 6px; }
#fixed-lines .line { grid-template-columns: 118px minmax(0, 1fr); gap: 0 12px; align-items: center; }
#fixed-lines .l-lab { display: grid; gap: 3px; justify-content: start; }
#fixed-lines .l-nm { font: 500 11.5px/1.2 var(--mono); gap: 6px; }
#fixed-lines .line[data-o] .l-nm::before { width: 6px; height: 6px; }
#fixed-lines .l-ct { font-size: 10.5px; padding-left: 12px; }
#fixed-lines .line:not([data-o]) .l-ct { padding-left: 0; }
#fixed-lines .bytes { padding: 0 0 3px; }
#fixed-lines .line:not([data-o]) { margin-bottom: 8px; }
@media (max-width: 700px) { #fixed-lines { gap: 12px; } #fixed-lines .line { grid-template-columns: 1fr; gap: 3px; } #fixed-lines .l-lab { display: flex; gap: 10px; align-items: baseline; } #fixed-lines .l-ct { padding-left: 0; } }

/* router matrix as line plots: one line per model, dots where it cuts, ticks at 0, 0.5 and 1 */
.rm { --bh: 58px; --lab: 178px; gap: 18px; }
.rm-cols { position: relative; }
.rm-line { position: absolute; left: 0; top: 0; width: 100%; height: var(--bh); overflow: visible; pointer-events: none; transition: opacity .2s; }
.rm-line polyline { fill: none; stroke: var(--k); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rm-box { display: block; border-top: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--ink) 9%, transparent); border-radius: 0; }
.rm-box i, .rm-c.cut .rm-box i { position: absolute; left: 50%; bottom: calc(var(--p) * 100%); width: 7px; height: 7px; margin: 0 0 -3.5px -3.5px; border-radius: 50%; background: var(--k); opacity: 0; transition: opacity .2s, transform .2s; }
.rm-c.cut .rm-box i { opacity: 1; }
.rm-c.at .rm-box i { opacity: 1; transform: scale(1.25); }
.rm-c.at:not(.cut) .rm-box i { background: var(--bg); box-shadow: inset 0 0 0 1.6px var(--k); }
.rm-tk { position: absolute; right: 100%; margin-right: 8px; top: calc((1 - var(--p)) * var(--bh) - 5px); font: 400 9.5px/1 var(--mono); color: var(--ink-3); pointer-events: none; }
.rm.hov .rm-c:not(.at) .rm-box { opacity: 1; }
.rm.hov .rm-c:not(.at) .rm-box i { opacity: .25; }
.rm.hov .rm-c:not(.at):not(.cut) .rm-box i { opacity: 0; }
.rm.hov .rm-line { opacity: .4; }
@media (max-width: 620px) { .rm { --lab: 0px; --bh: 46px; } .rm-cols { margin-left: 24px; } }
.rm .rm-cols svg.rm-line { height: var(--bh) !important; max-width: none; }
.rm .rm-cols svg.rm-line { margin: 0; }
/* smooth lines, small cut marks */
.rm-line path { fill: none; stroke: var(--k); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.rm-box i, .rm-c.cut .rm-box i { width: 4px; height: 4px; margin: 0 0 -2px -2px; }
.rm-c.at .rm-box i { transform: scale(1.6); }
.rm-c.at:not(.cut) .rm-box i { box-shadow: inset 0 0 0 1px var(--k); }
/* hover: the stretch of each line that belongs to the hovered piece stays bright */
.rm-line.hi { opacity: 0; }
.rm.hov .rm-line.hi { opacity: 1; }
.rm.hov .rm-line:not(.hi) { opacity: .28; }
.rm-line.hi path { stroke-width: 2.2; }
.rm.hov .rm-c.in .rm-box i { opacity: 1; }
.rm.hov .rm-c.in:not(.cut):not(.at) .rm-box i { opacity: 0; }

/* ---- tables: their own typeface, tighter rows, and a legend under each ---- */
:root { --tab: "IBM Plex Sans Condensed", "IBM Plex Sans", system-ui, sans-serif; }
.tbl { margin: 22px 0 0; }
.tbl table.plain, .tbl table.plain.dense { font: 400 14px/1.3 var(--tab); font-variant-numeric: tabular-nums; }
.tbl table.plain th { font: 600 11px/1.25 var(--tab); letter-spacing: .08em; padding-bottom: 7px; }
.tbl table.plain td { padding-top: 6px; padding-bottom: 6px; }
.tbl table.plain td:first-child { font-weight: 500; }
.tbl table.plain td.us { font-weight: 600; text-underline-offset: 4px; }
.tbl table.plain.text th, .tbl table.plain.text td { padding-top: 6px; padding-bottom: 6px; }
.tbl table.plain.text th { padding-top: 0; }
.tbl .rnd2 { margin-top: 1px; font-size: 11.5px; }
.tbl table.plain.notes code { font-family: var(--mono); }
p.tcap, figure:has(.tbl) > figcaption { font: 400 13px/1.45 var(--tab); color: var(--ink-3); letter-spacing: .01em; }
p.tcap { margin: 9px 0 30px; padding-left: 8px; max-width: 68ch; }
figure:has(.tbl) > figcaption { margin-top: 10px; padding-left: 8px; }
.tblfig p.tcap { margin-bottom: 0; }
.frame > .tbl { margin: 0; }
p.tcap, figure:has(.tbl) > figcaption { color: var(--ink-2); }

/* tables in a code typeface, labels in capitals */
:root { --tab: var(--fig); }
/* everything inside a figure that asks for the code typeface gets the figure typeface */
figure, .frame, .tbl, p.tcap, section.v, p.cap, ol.refs, .toc, .toc-m { --mono: var(--fig); --ink: var(--fig-ink); --ink-2: var(--fig-ink-2); --ink-3: var(--fig-ink-3); }
:where(figure, .frame, .tbl, section.v) { color: var(--ink); }
.tbl table.plain, .tbl table.plain.dense { font: 400 12.5px/1.3 var(--tab); }
.tbl table.plain th { font: 500 10.5px/1.25 var(--tab); letter-spacing: .06em; }
.tbl table.plain td:first-child { text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; font-weight: 500; }
.tbl table.plain.dense { font-size: 12px; }
.tbl table.plain.dense th { font-size: 10px; letter-spacing: .02em; }
.tbl table.plain.dense td:first-child { font-size: 11px; }
.tbl table.plain.text td { text-transform: none; }
.tbl table.plain.text td:first-child { text-transform: uppercase; }
.tbl .rnd2 { font-size: 10.5px; }
p.tcap, figure:has(.tbl) > figcaption { font: 400 11.5px/1.55 var(--tab); letter-spacing: 0; }
/* the best-number underline stops at the number; the bracketed random value stays plain */
.tbl .rnd { display: inline-block; font-weight: 400; text-decoration: none; }

/* the type-a-molecule figure reuses the router's line plot: one row, dashed line at the average (a third of the way up) */
.rm.one { --lab: 34px; --bh: 96px; gap: 6px; margin-top: 22px; }
.rm.one .rm-box::before { top: 66.667%; }
.rm.one .rm-chars { order: 2; margin: 2px 0 0; }
.rm.one .rm-chars .rm-cols span { font-size: clamp(9px, calc((100cqw - var(--lab)) / var(--n) / .78), 15px); }
.rm.one .rm-chars .rm-cols span.na { color: var(--ink-3); }
.rm.one.hov .rm-line { opacity: 1; }
.rm.one.hov .rm-c:not(.at) .rm-box i { opacity: .5; }
.rm.one.hov .rm-c:not(.at):not(.cut) .rm-box i { opacity: 0; }
@media (max-width: 620px) { .rm.one { --lab: 30px; } .rm.one .rm-row { grid-template-columns: var(--lab) minmax(0, 1fr); } .rm.one .rm-cols { margin-left: 0; } .rm.one .rm-chars .rm-nm { display: block; } }
.tbl table.plain th .rnd2 { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 10px; margin-top: 2px; }
.tbl table.plain.notes td:first-child { text-transform: none; }

/* tighter tables: every table spans the full column, so all share the same edges; less space between rows */
.tbl table.plain th, .tbl table.plain td { padding-left: 14px; }
.tbl table.plain.dense th, .tbl table.plain.dense td { padding-left: 9px; }
.tbl table.plain th:first-child, .tbl table.plain td:first-child, .tbl table.plain.dense th:first-child, .tbl table.plain.dense td:first-child { padding-left: 8px; }
.tbl table.plain td { padding-top: 3px; padding-bottom: 3px; }
.tbl table.plain th { padding-bottom: 5px; }
.tbl table.plain.text th, .tbl table.plain.text td { padding: 4px 14px 4px 0; }
.tbl table.plain.text th { padding-top: 0; padding-bottom: 5px; }
.tbl table.plain.text td:first-child, .tbl table.plain.text th:first-child { padding-left: 8px; }
.tbl { margin-top: 16px; }
p.tcap { margin: 7px 0 24px; max-width: none; padding-right: 8px; }   /* as wide as the table above it */

/* ---- one way to write a model name in a figure: capitals in the table typeface ---- */
#fixed-lines .l-nm, .rm-nm b, .q-cap .nm, .hero-say .rm-v, ul.objs-list li b { font-family: var(--tab); text-transform: uppercase; letter-spacing: .04em; font-size: 11.5px; font-weight: 500; }
#fixed-lines .l-ct, .rm-nm small { font-family: var(--tab); }
#fixed-lines .line { grid-template-columns: 138px minmax(0, 1fr); }
.rm { --lab: 172px; }
/* type-a-molecule figure: input, plot, buttons and note share one left edge */
#typer .ctl { margin-left: 0; }
#typer .acts { margin-left: 0; }
.rm.one .rm-chars .rm-cols span.na { opacity: .45; }
/* type-a-molecule: bright above the average, dim below */
.rm.one .rm-line:not(.above) { opacity: .32; }
.rm.one.hov .rm-line:not(.above) { opacity: .32; }
.rm.one .rm-line.above { clip-path: inset(-6px 0 33.333% 0); }
.rm.one .rm-line.above path.ar { stroke: none; fill: var(--k); opacity: .16; }
/* type-a-molecule, on hover: everything above average stays lit, the rest goes dim */
.rm.one.hov .rm-chars .rm-cols span.up { opacity: 1; color: var(--ink); }
.rm.one.hov .rm-chars .rm-cols span:not(.up):not(.at) { opacity: .22; }
.rm.one.hov .rm-line:not(.above) { opacity: .14; }
.rm.one.hov .rm-line.above path.ar { opacity: .26; }
.rm.one.hov .rm-c.cut .rm-box i { opacity: 1; }
.hero .lede b { font-weight: 500; color: var(--ink); letter-spacing: .04em; margin-right: 6px; }

/* ---- drop cap: the opening B, a ball-and-stick letter you can cut (dropcap.js) ---- */
.cap.on { float: left; margin: 2px 10px 0 -14px; line-height: 0; cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.cap.on canvas { display: block; }
.cap .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 760px) { .cap.on { margin-left: -8px; } }
.home .card + .card { margin-top: 64px; }

/* intro tokenizer figure: one sentence, cut by words, by characters, then merged back by byte-pair encoding */
.tokfig { --gap: 4px; display: grid; gap: 12px; }
.tk-head { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.tk-n { font: 400 12px/1 var(--mono); color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-n b { font: 500 22px/1 var(--mono); color: var(--ink); margin-right: 6px; }
.tk-text { display: flex; flex-wrap: wrap; row-gap: 12px; padding: 12px 0 8px; font: 500 clamp(14px, 2.2vw, 19px)/1 var(--mono); user-select: none; }
.tk-w { display: inline-flex; white-space: nowrap; margin-right: .62em; }
.tk-c {
  --g: var(--gap); position: relative; padding: .5em .03em; color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent);
  transition: margin-left .5s cubic-bezier(.22,1,.36,1) var(--d, 0ms), background-color .4s var(--d, 0ms), border-radius .4s var(--d, 0ms);
}
.tk-c.ws { --g: .62em; }
.tk-c.odd { background: color-mix(in srgb, var(--ink) 21%, transparent); }
.tk-c.st { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.tk-c.st:not(.ws) { margin-left: var(--gap); }
.tk-c.en { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
.tk-text.raw .tk-c { background: transparent; }
.tk-c.hot { background: color-mix(in srgb, var(--o0) 42%, transparent); }
/* the cut: a thin line drops between two letters, then the pieces slide apart */
.tk-c::before { content: ""; position: absolute; left: calc(var(--g) / -2 - .75px); top: -32%; height: 164%; width: 1.5px; border-radius: 1px; background: var(--o0); transform: scaleY(0); transform-origin: top; opacity: 0; pointer-events: none; }
.tk-c.cutnow::before { animation: tkcut .75s cubic-bezier(.3,.9,.3,1) var(--d, 0ms) both; }
@keyframes tkcut { 0% { transform: scaleY(0); opacity: 1; } 40% { transform: scaleY(1); opacity: 1; } 100% { transform: scaleY(1); opacity: 0; } }
.tk-ids { display: flex; gap: 12px; align-items: baseline; font: 400 11.5px/1.4 var(--mono); color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.tk-ids span { flex: none; }
.tk-ids b { font-weight: 400; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.tk-say { font: 400 12.5px/1.55 var(--mono); color: var(--ink-2); min-height: 3.1em; text-wrap: pretty; }
.tk-say b { color: var(--ink); font-weight: 500; }
@media (max-width: 560px) { .tokfig { --gap: 3px; } .tk-say { min-height: 4.7em; } }
@media (prefers-reduced-motion: reduce) { .tk-c { transition: none; } }

/* ---- every post on a touch screen: the name, breadcrumb and folded contents get a finger-sized target (padding taken
   back by a negative margin, so nothing moves), glossary words do not flash grey when tapped, a table row a finger
   touched (to scroll the table, say) does not stay highlighted, and readers who ask for less motion get instant jumps
   to a heading ---- */
.gloss { -webkit-tap-highlight-color: transparent; }
@media (pointer: coarse) {
  .brand, .crumb a, .toc-m summary { padding-top: 15px; padding-bottom: 15px; margin-top: -15px; margin-bottom: -15px; }
  .toc-m a { padding-top: 11px; padding-bottom: 11px; }
}
@media (hover: none) {
  .tbl table.plain tbody tr:hover td { background: none; }
  .tbl table.plain tbody tr[data-o]:hover td:first-child { color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---- Share and Copy as Markdown, at the right end of the breadcrumb row, and the citation at the end of the post (assets/share.js) ---- */
.crumb .share-row { margin-left: auto; display: flex; gap: 8px; }
.share-btn { font: 500 11.5px/1 var(--fig); letter-spacing: .06em; text-transform: uppercase; color: var(--fig-ink); background: none; border: 1px solid color-mix(in srgb, var(--fig-ink) 30%, transparent); border-radius: 0; padding: 8px 12px; margin: -8px 0; cursor: pointer; white-space: nowrap; -webkit-tap-highlight-color: transparent; transition: background-color .2s, color .2s; }
.share-btn.done { background: var(--fig-ink); color: var(--bg); }
.share-btn:focus-visible { outline: 1px solid var(--fig-ink); outline-offset: 2px; }
@media (hover: hover) { .share-btn:hover { background: var(--fig-ink); color: var(--bg); } }
@media (hover: none) { .share-btn { padding: 14px; margin: -14px 0; } .share-btn:active { background: var(--fig-ink); color: var(--bg); } }
@media (max-width: 520px) { .crumb { flex-wrap: wrap; row-gap: 26px; } .crumb .share-row { margin-left: 0; flex-basis: 100%; } }
.cite { margin-top: 56px; }
.cite-box { border: 1px solid color-mix(in srgb, var(--fig-ink) 22%, transparent); margin: 18px 0 0; }
.cite-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 10px 10px 16px; font: 500 11.5px/1 var(--fig); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid color-mix(in srgb, var(--fig-ink) 12%, transparent); }
.cite-head .share-btn { margin: 0; }
.cite-box pre { margin: 0; padding: 16px; font: 400 13px/1.7 var(--mono); color: var(--ink); overflow-x: auto; white-space: pre; }
.cite-box pre.wrapped { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---- the row of link buttons under a post's title (the same rules as in posts/icecube/ice.css, for posts that don't load it) ---- */
.ice-links { display: flex; flex-wrap: wrap; gap: 8px 10px; margin: 22px 0 6px; padding: 0; list-style: none; font: 500 11.5px/1 var(--fig); letter-spacing: .06em; text-transform: uppercase; }
.ice-links a { display: inline-block; padding: 8px 12px; border: 1px solid color-mix(in srgb, var(--fig-ink) 30%, transparent); color: var(--fig-ink); text-decoration: none; transition: background-color .2s, color .2s; }
@media (hover: hover) { .ice-links a:hover { background: var(--fig-ink); color: var(--bg); } }
@media (hover: none) { .ice-links a { padding: 14px; } }
