/* ==========================================================================
   Unbundling Multimodal Vision Encoding: project page.
   Palatino (bundled TeX Gyre Pagella where Palatino isn't installed), the paper's palette, one accent (teal).
   Figures are framed as title, finding, legend, chart and caption; anim.js draws the teaser and the protocol grid.
   ========================================================================== */

@font-face { font-family: "Pagella"; src: url("../fonts/pagella-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Pagella"; src: url("../fonts/pagella-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Pagella"; src: url("../fonts/pagella-bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Pagella"; src: url("../fonts/pagella-bolditalic.woff2") format("woff2"); font-weight: 700; font-style: italic; font-display: swap; }

:root {
  --serif: "Palatino", "Palatino Linotype", "Book Antiqua", "Pagella", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ink: #1c2b33;
  --ink-2: #3d4651;
  --muted: #5e6773;
  --faint: #8a929c;
  --rule: #e1e4e8;
  --rule-2: #eceef1;
  --panel: #f5f6f7;
  --panel-border: #e3e6ea;

  /* recipe colors (paper palette); the -d shades are for text */
  --enc: #2f70ff;  --enc-d: #1d4fc4;
  --pre: #eb6200;  --pre-d: #a84600;
  --ef: #ea9600;   --ef-d: #8a5a00;
  --inf: #d72090;  --inf-d: #a8126c;
  --mot: #a169da;  --mot-d: #7340b8;

  /* the one accent: teal, as in the paper's Figure 1 */
  --accent: #008681;
  --accent-d: #006b67;
  --accent-light: #e6f3f2;
  --link-line: rgba(0, 134, 129, .38);

  --col: 720px;
  --wide: 980px;
  --tabs-h: 0px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--tabs-h) + 20px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
html.static *, html.static *::before, html.static *::after { transition: none !important; }
/* reduced motion: no hover or state fades either, as with ?static */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
body {
  margin: 0; background: #fff; color: var(--ink);
  font-family: var(--serif); font-size: 19px; line-height: 1.6;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-kerning: normal;
}
/* links: ink text over a quiet teal rule that fills in on hover */
a { color: var(--ink); text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)), linear-gradient(var(--link-line), var(--link-line)); background-size: 0 2px, 100% 1px; background-position: 0 100%, 0 100%; background-repeat: no-repeat; transition: background-size .28s cubic-bezier(.2, .7, .3, 1), color .15s; }
a:hover { background-size: 100% 2px, 100% 1px; }
a.plain, .btn, .toc a, .tabs a, .hanchor, .foot a, .au a { background-image: none; }
b, strong { font-weight: 700; }
sup { line-height: 0; }
p { text-wrap: pretty; }
/* keeps a hyphenated term (in-fusion) from breaking across lines in a heading */
.nw { white-space: nowrap; }

.page { max-width: calc(var(--col) + 48px); margin: 0 auto; padding: 0 24px; }
.wide { width: min(var(--wide), calc(100vw - 40px)); position: relative; left: 50%; transform: translateX(-50%); }
.wide.narrowish { width: min(820px, calc(100vw - 40px)); }

/* recipe-colored words */
.c-enc { color: var(--enc-d); }
.c-pre { color: var(--pre-d); }
.c-ef { color: var(--ef-d); }
.c-inf { color: var(--inf-d); }
.c-mot { color: var(--mot-d); }

/* ------------------------------------------------------------------ header */
.hero { text-align: center; padding: 50px 0 4px; }
.hero h1 { font-size: clamp(34px, 5.4vw, 52px); line-height: 1.1; letter-spacing: -0.012em; margin: 0 auto 20px; font-weight: 700; max-width: 15em; }
.authors { font-size: 19.5px; line-height: 1.75; width: min(1000px, calc(100vw - 36px)); position: relative; left: 50%; transform: translateX(-50%); }
.au-row { text-wrap: balance; }
.au-row + .au-row { margin-top: 1px; }
.au { white-space: nowrap; margin: 0 .4em; }
.au a { color: var(--ink); border-bottom: 1px solid transparent; transition: border-color .15s; }
.au a:hover { border-bottom-color: var(--link-line); }
.au sup { font-size: 0.72em; margin-left: 1px; color: var(--ink-2); }
.mk { display: inline-block; vertical-align: 0.42em; margin-left: 2px; }
.mk.m { height: 0.5em; }
.mk.n { height: 0.74em; vertical-align: 0.3em; margin-left: 1px; }
.logos { display: flex; justify-content: center; align-items: center; gap: 30px; margin: 16px 0 6px; }
.logos .logo-meta { height: 26px; }
.logos .logo-nyu { height: 38px; }
.notes { font-size: 16px; color: var(--muted); margin: 4px 0 18px; }
.notes sup { font-size: .8em; }
/* two footnotes side by side, centered, each kept on one line */
.notes span { white-space: nowrap; display: inline-block; margin: 0 .4em; }

.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 19px 8px 15px; border-radius: 999px;
  border: 1px solid #d9dde2; background: #f4f5f7; color: var(--ink); font-size: 17.5px;
  transition: background .15s, border-color .15s;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { background: #eceef1; border-color: #c9ced4; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-d); border-color: var(--accent-d); }

/* ------------------------------------------------------------------ teaser: the three questions, answered in turn */
.teaser { margin: 34px 0 0; }
.teaser svg.anim { display: block; width: 100%; height: auto; background: #fff; border: 1px solid var(--panel-border); border-radius: 14px; }
/* the tall layout (phones): no taller than the screen allows */
.teaser.tall svg.anim { max-width: max(320px, calc((100vh - 110px) * 0.55)); margin-inline: auto; }
@supports (height: 100svh) { .teaser.tall svg.anim { max-width: max(320px, calc((100svh - 110px) * 0.55)); } }
.teaser .replay { display: flex; margin: 8px 0 0 auto; }
/* each question links to its section */
.teaser .q-hit { fill: transparent; }
.teaser .q-link:hover .q-hit { fill: #f4f9f9; }
.teaser .q-link:focus { outline: none; }
.teaser .q-link:focus-visible .q-hit { stroke: var(--accent); stroke-width: 2; }
/* protocol icons: the accent parts */
.t-acc { fill: var(--accent); }
.t-acc-s { stroke: var(--accent); }

/* replay control for the animated figures */
.replay { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 4px 2px; font: inherit; font-size: 15px; color: var(--faint); cursor: pointer; }
.replay svg { width: 12px; height: 12px; }
.replay:hover { color: var(--ink); }
.replay[hidden] { display: none; }

/* ------------------------------------------------------------------ summary + key message */
.summary { margin: 34px 0 0; }
.summary ul { list-style: none; padding: 0; margin: 0; }
.summary li { position: relative; padding-left: 24px; margin: 0 0 14px; text-wrap: pretty; }
.summary li::before { content: ""; position: absolute; left: 5px; top: .72em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
/* section links at the end of each summary point: teal text over the page's link rule, which fills in on hover */
.jump { font-size: 16.5px; color: var(--accent-d); white-space: nowrap; }
.jump:hover { color: var(--accent); }
.key {
  margin: 26px 0 8px; background: var(--accent); color: #fff; border-radius: 14px; padding: 20px 28px 21px;
  text-align: center; font-size: 23px; line-height: 1.38; box-shadow: 0 1px 0 rgba(0, 0, 0, .04);
}
.key p { margin: 0; }
.key b { font-weight: 700; }
.key .key-2 { font-style: italic; margin-top: 4px; opacity: .93; }

/* ------------------------------------------------------------------ sections */
section { margin-top: 72px; }
section.summary { margin-top: 34px; }
.kicker { font-size: 14.5px; letter-spacing: .12em; text-transform: uppercase; color: #737b85; margin: 0 0 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
/* the section number, set apart by space (no separator) */
.kicker .sec { margin-right: .7em; }
/* §3–§5 kickers ask the section's question, styled like the teaser's question lines: teal number, dark semibold text */
.kicker.kq { font-size: 19px; line-height: 1.35; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.kicker.kq .sec { color: var(--accent-d); margin-right: .45em; }
.kicker > span:first-child { min-width: 0; }
.kicker .swap { flex: none; display: inline-flex; align-items: center; gap: 7px; letter-spacing: 0; text-transform: none; color: var(--faint); font-size: 16px; }
.kicker .swap .g { line-height: 0; }
.kicker .swap .g.from { opacity: .45; }
h2 { font-size: 34px; line-height: 1.18; margin: 0 0 10px; font-weight: 700; letter-spacing: -0.005em; text-wrap: balance; }
h2 .hanchor { margin-left: 10px; font-size: .6em; font-weight: 400; color: var(--faint); opacity: 0; transition: opacity .15s, color .15s; vertical-align: 3px; }
h2:hover .hanchor, h2 .hanchor:focus-visible { opacity: 1; }
h2 .hanchor:hover { color: var(--accent-d); }
h3 { font-size: 24px; margin: 40px 0 8px; font-weight: 700; text-wrap: balance; }
h4 { font-size: 18.5px; margin: 0 0 5px; font-weight: 700; text-wrap: balance; }
p { margin: 0 0 16px; hyphens: manual; }
.metrics { font-size: 17px; color: var(--ink-2); margin: 16px 0 0; }
/* a term that lists its benchmarks (main.js: benchmark terms) */
.bench { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted; text-decoration-color: var(--faint); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.bench:hover, .bench[aria-expanded="true"] { text-decoration-color: currentColor; }
.bench:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }

/* ------------------------------------------------------------------ figures: title, finding, legend, chart, caption */
figure { margin: 34px 0 38px; }
.viz .vh { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px 22px; }
.viz .vh h4 { font-size: 20px; line-height: 1.3; margin: 0 0 12px; text-wrap: balance; }
.viz .ytitle { font-size: 15.5px; color: var(--ink); margin: 10px 0 0; }
/* a caption opens with the figure's point in bold, then the details (the paper's caption style) */
figcaption { font-size: 16px; line-height: 1.52; color: var(--muted); margin: 14px 0 0; max-width: var(--col); text-wrap: pretty; }
figcaption b { color: var(--ink); font-weight: 700; }
.chart { width: 100%; }
.chart svg { display: block; overflow: visible; }
.chart text, .bundle text, .schematic text, .glyph text, .anim text { font-family: var(--serif); }
.viz .vh-tools { flex: none; display: flex; align-items: center; gap: 14px; }
.viz svg.anim { display: block; width: 100%; height: auto; }
/* figure builds (main.js): a chart's marks stay hidden until its build starts, then land in order */
.pre-build [data-b] { opacity: 0; }
.chart [data-b="pt"] { transform-box: fill-box; transform-origin: center; }
.chart [data-b="bar"], .chart [data-b="add"], .chart [data-b="fill"] { transform-box: fill-box; transform-origin: 0 50%; }
.tnum { font-variant-numeric: tabular-nums; }
.hit-row { cursor: default; }
.hit-row.on { fill: rgba(28, 43, 51, .035); }
.sub-title { font-weight: 700; font-size: 17.5px; line-height: 1.3; text-wrap: balance; }
/* side-by-side charts: titles, legends, axis titles and charts share rows, so the two charts start at the same height */
.two-up { display: grid; grid-template-columns: 1fr 1fr; column-gap: 34px; }
.two-up .sub { min-width: 0; display: grid; grid-row: span 4; grid-template-rows: subgrid; }

.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 16px; color: var(--ink-2); align-items: center; margin: 0 0 4px; }
.legend.center { justify-content: center; margin-top: 10px; }
.legend.tight { font-size: 15.5px; gap: 2px 14px; margin: 0 0 2px; }
.legend .li { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend .li svg { display: block; }
.legend .sw { width: 13px; height: 13px; border-radius: 2px; background: var(--c); }
.legend[hidden] { display: none; }
.sw { display: inline-block; width: 18px; height: 13px; border-radius: 4px; border: 1.5px solid; }
.sw.sw-shared { background: #eceef0; border-color: #a9afb7; }
.sw.sw-text { background: #e6f2df; border-color: #6fb35f; }
.sw.sw-vis { background: #e3ecff; border-color: #2f70ff; }
.sw-n { display: inline-grid; place-items: center; width: 17px; height: 17px; border: 1.4px solid #6d7580; border-radius: 5px; font-size: 11.5px; line-height: 1; color: #3d4651; }

.seg { flex: none; display: inline-flex; border: 1px solid #d5d9de; border-radius: 999px; padding: 2px; background: #f4f5f7; }
.seg button { border: 0; background: transparent; font: inherit; font-size: 15.5px; color: var(--muted); padding: 4px 14px 3px; border-radius: 999px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(28, 43, 51, .14); }

/* schematics */
/* main.js sets the columns (and, stacked, each schematic's width) from the drawings' widths, so both draw at one scale */
.schematics { display: grid; grid-template-columns: var(--sch-cols, 1.27fr 1fr); gap: 30px; align-items: start; }
.sch-t { font-size: 17px; color: var(--ink-2); margin: 0 0 6px; }
.sch svg { width: 100%; height: auto; display: block; }
/* pointing at a part explains it (main.js); pointing at a token dims what that token skips */
.schematic [data-tip] { cursor: help; }
.schematic .tip-on > rect:not(.hit), .schematic .tip-on > circle { stroke-width: 2.6px; }
.schematic [data-tip="stream"].tip-on > rect { fill: #e6e9ec; }
.schematic [data-tip="tstream"].tip-on > rect { fill: #e0eed8; }
.schematic [data-tip="vstream"].tip-on > rect { fill: #dbe6ff; }
.schematic .vis-only, .schematic .tstream, .schematic .vstream { transition: opacity .2s; }
.schematic.follow-text .vis-only, .schematic.follow-text .vstream, .schematic.follow-vision .tstream { opacity: .15; }
.schematic.follow-vision .vis-only rect { stroke-width: 2.8px; }

.video video { width: 100%; border-radius: 14px; border: 1px solid var(--panel-border); display: block; }

/* takeaways: the paper's takeaway box (thin teal frame, Teal100 at 15% fill, 4pt corners) */
.takeaway {
  margin: 30px 0 0; border: 1px solid var(--accent); background: #f3fbfa; border-radius: 5px;
  padding: 13px 20px 14px; font-size: 18.5px; line-height: 1.55; text-wrap: pretty;
}
.takeaway > b { display: block; margin-bottom: 2px; }

/* ------------------------------------------------------------------ bundle diagram + recipe table */
.bundle-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 26px; align-items: center; }
.bundle-grid > * { min-width: 0; }
.bundle svg { width: 100%; height: auto; display: block; overflow: visible; }
.b-call { transition: opacity .45s; }
.b-call.dropped { opacity: .38; }
.b-call.dropped .ld { opacity: 0; }
.b-call .mk { font-weight: 700; }
.b-call:not(.dropped) .mk { fill: var(--accent); }
.b-call.dropped .mk { fill: #b23a3a; }
.recipes { border-collapse: separate; border-spacing: 0; font-size: 17px; width: 100%; }
.recipes th { font-size: 15px; font-weight: 400; color: var(--muted); text-align: center; padding: 0 6px 8px; white-space: nowrap; }
.recipes th:first-child { text-align: left; padding-left: 10px; }
.recipes td { padding: 9px 6px; text-align: center; border-top: 1px solid var(--rule); }
.recipes td:first-child { text-align: left; white-space: nowrap; padding-left: 10px; font-weight: 700; }
.recipes td:first-child .g { display: inline-block; vertical-align: middle; width: 78px; margin-right: 9px; line-height: 0; }
.recipes td:first-child .g svg { width: 100%; height: auto; }
.recipes td.y { color: var(--ink); font-size: 19px; }
.recipes td.n { color: #c3c8ce; font-size: 19px; }
.recipes tr[data-recipe] { cursor: pointer; transition: background .25s; }
.recipes tr[data-recipe]:hover td { background: #f6f7f8; }
.recipes tr.sel td { background: var(--accent-light) !important; }
.recipes tr.sel td:first-child { border-radius: 10px 0 0 10px; }
.recipes tr.sel td:last-child { border-radius: 0 10px 10px 0; }
.recipes tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

/* FAQ: collapsible questions between rules, as in the recipe table; the chevron turns when an answer opens */
.faq { margin: 18px 0 0; border-bottom: 1px solid var(--rule); }
.faq details { border-top: 1px solid var(--rule); }
.faq summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 2px; cursor: pointer; list-style: none; font-weight: 700; line-height: 1.4; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border-right: 1.8px solid var(--faint); border-bottom: 1.8px solid var(--faint); transform: translateY(-3px) rotate(45deg); transition: transform .2s, border-color .15s; }
.faq details[open] > summary::after { transform: translateY(2px) rotate(-135deg); }
.faq summary:hover::after { border-color: var(--accent); }
.faq summary:focus { outline: none; }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.faq details > p { margin: -3px 0 17px; padding-right: 30px; font-size: 18px; line-height: 1.55; color: var(--ink-2); }

/* citation */
.bib { position: relative; }
.bib pre { background: var(--panel); border: 1px solid var(--panel-border); border-radius: 12px; padding: 16px 18px; font-size: 14.5px; line-height: 1.55; overflow-x: auto; margin: 0; font-family: var(--mono); color: var(--ink-2); }
.copy { position: absolute; top: 9px; right: 9px; border: 1px solid #d5d9de; background: #fff; border-radius: 8px; font: inherit; font-size: 14.5px; padding: 2px 10px; cursor: pointer; color: var(--muted); opacity: 0; transition: opacity .15s, color .15s; }
.bib:hover .copy, .copy:focus-visible { opacity: 1; }
.copy:hover { color: var(--ink); }
@media (hover: none) { .copy { opacity: 1; } }

/* footer */
.foot { max-width: calc(var(--col) + 48px); margin: 80px auto 0; padding: 22px 24px 40px; border-top: 1px solid var(--rule); display: flex; justify-content: space-between; gap: 16px; font-size: 16px; color: var(--faint); }
.foot a { color: var(--faint); }
.foot a:hover { color: var(--ink-2); }

/* tooltip */
.tip {
  position: fixed; top: 0; left: 0; z-index: 30; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: #fff; border: 1px solid #dfe2e6; border-radius: 9px; box-shadow: 0 8px 28px rgba(28, 43, 51, .14);
  padding: 9px 13px 8px; font-size: 15.5px; line-height: 1.45; max-width: 360px;
}
.tip.on { opacity: 1; }
.tip-title { color: var(--muted); font-size: 14.5px; margin-bottom: 3px; }
.tip-row { display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tip-row b { font-variant-numeric: tabular-nums; min-width: 2.6em; }
.tip-row span:last-child { color: var(--ink-2); }
.tip-key { display: inline-flex; }
.tip-title.tip-name { color: var(--ink); font-weight: 700; font-size: 15.5px; }
.tip-text { max-width: 300px; color: var(--ink-2); }
/* a benchmark list takes the pointer while it is open, so its links can be clicked (main.js sets .live) */
.tip.pin, .tip.live { pointer-events: auto; }
/* links drawn inside an SVG figure (viz.js rich: [label](url)), underlined like the page's links */
.anim a.cite { background: none; text-decoration: underline; text-decoration-thickness: 1px; cursor: pointer; }
.anim a.cite:hover { fill: var(--accent-d); }
.tip-group { margin-top: 6px; }
.tip-cat { font-size: 13.5px; color: var(--muted); }
.tip-list { color: var(--ink-2); }
.tip-list a { color: inherit; white-space: nowrap; }
.tip-list a:hover { color: var(--ink); }
.tip-list a:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 2px; }
.tip-foot { margin-top: 7px; font-size: 13.5px; color: var(--faint); }
/* training-data examples (§2 metrics): a strip of images, the picked image's caption, then text excerpts */
.tip.wide { max-width: min(500px, calc(100vw - 16px)); }
.tip-data .tip-cat { margin-top: 10px; }
.tip-data .tip-cat + .ex-txt { margin-top: 2px; }
.ex-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 5px; margin: 5px 0 8px; }
.ex-sel { display: grid; grid-template-columns: 124px 1fr; gap: 11px; align-items: start; }
.ex-sel img { width: 124px; height: 124px; border-radius: 5px; display: block; }
@media (max-width: 600px) { .ex-sel { grid-template-columns: 96px 1fr; } .ex-sel img { width: 96px; height: 96px; } }
.ex-thumb { padding: 0; border: 2px solid transparent; border-radius: 6px; background: none; cursor: pointer; line-height: 0; }
.ex-thumb img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 4px; display: block; }
.ex-thumb[aria-pressed="true"] { border-color: var(--accent); }
.ex-thumb:focus-visible, .ex-next:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.ex-cap { margin: 0; font-size: 14px; line-height: 1.45; color: var(--ink-2); height: 124px; overflow-y: auto; }
.ex-txt { height: 7.4em; margin-top: 2px; }
.ex-tier { margin-top: 3px; }
.ex-next { font: inherit; font-size: 13.5px; color: var(--muted); background: none; border: 0; padding: 2px 0 0; cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.ex-next:hover { color: var(--ink); }

/* ------------------------------------------------------------------ contents: side list on wide screens, tab bar below */
.toc .sec, .tabs .sec { color: var(--faint); font-variant-numeric: tabular-nums; margin-right: .45em; }
.toc a.on .sec, .tabs a.on .sec { color: var(--accent-d); }
.toc { display: none; }
.tabs { position: sticky; top: 0; z-index: 20; background: rgba(255, 255, 255, .96); backdrop-filter: blur(6px); border-bottom: 1px solid var(--rule); margin: 0 -24px; padding: 0 24px; }
.tabs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 22px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
.tabs ol::-webkit-scrollbar { display: none; }
/* the right-edge fade hints at more tabs, so it goes once the bar is scrolled to its end (main.js sets .at-end) */
.tabs ol.at-end { -webkit-mask-image: none; mask-image: none; }
.tabs li { flex: none; }
.tabs a { display: block; white-space: nowrap; padding: 12px 0 10px; border-bottom: 2px solid transparent; font-size: 16px; color: var(--ink-2); }
.tabs a:hover { color: var(--ink); }
.tabs a.on { color: var(--ink); border-bottom-color: var(--accent); }
:root { --tabs-h: 48px; }
@media (min-width: 1320px) {
  :root { --wide: min(980px, calc(100vw - 460px)); --tabs-h: 0px; }
  .tabs { display: none; }
  .toc {
    display: block; position: fixed; top: 96px; width: 196px;
    left: max(20px, calc(50% - var(--wide) / 2 - 232px)); font-size: 15.5px; line-height: 1.38;
  }
  .toc .toc-label { font-size: 13.5px; letter-spacing: .12em; text-transform: uppercase; color: #737b85; margin: 0 0 10px; }
  .toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--rule-2); }
  .toc a { display: block; color: var(--muted); padding: 5px 0 5px 14px; margin-left: -2px; border-left: 2px solid transparent; transition: color .15s, border-color .15s; }
  .toc .sec { display: inline-block; min-width: 2.35em; margin-right: 0; }
  /* a label that wraps (Beyond lifetime compute) continues under its first word, not under the § number */
  .toc a:not(.sub) { padding-left: calc(14px + 2.35em); text-indent: -2.35em; }
  .toc .sec { text-indent: 0; }
  .toc ol ol { border-left: 0; }
  .toc a.sub { padding-left: calc(14px + 2.35em); padding-top: 2px; font-size: 14.5px; }
  /* a hooked arrow (down, then right) marks the one nested entry */
  .toc a.sub::before {
    content: ""; display: inline-block; width: 13px; height: 11px; margin-right: 6px; vertical-align: 0;
    background-color: var(--faint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 .8v4.7q0 3 3 3H11'/%3E%3Cpath d='M8.6 6.2l2.6 2.3-2.6 2.3'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 13 11'%3E%3Cg fill='none' stroke='%23000' stroke-width='1.3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.5 .8v4.7q0 3 3 3H11'/%3E%3Cpath d='M8.6 6.2l2.6 2.3-2.6 2.3'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain;
  }
  .toc a.sub.on::before { background-color: var(--accent); }
  .toc a:hover { color: var(--ink); }
  .toc a.on { color: var(--ink); border-left-color: var(--accent); }
}

/* ------------------------------------------------------------------ narrower screens */
@media (max-width: 900px) {
  .two-up { grid-template-columns: 1fr; gap: 26px; }
  .two-up .sub { display: block; grid-row: auto; }
  .ytitle.spacer { display: none; }
  .bundle-grid { grid-template-columns: 1fr; }
  .schematics { grid-template-columns: 1fr; }
  .sch svg { width: calc(100% * var(--sch-w, 1)); }
}
@media (max-width: 600px) {
  body { font-size: 17.5px; }
  .page { padding: 0 18px; }
  .tabs { margin: 0 -18px; padding: 0 18px; }
  .hero { padding-top: 40px; }
  .authors { font-size: 16.5px; }
  .notes { font-size: 15px; }
  .buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 148px)); justify-content: center; gap: 9px; }
  .btn { justify-content: center; font-size: 16.5px; }
  h2 { font-size: 28px; }
  .kicker { font-size: 13.5px; }
  .kicker.kq { font-size: 17px; }
  /* recipe glyphs are wider than tall; drawn a little smaller, the pair stays on the kicker's line */
  .kicker .swap { gap: 5px; }
  .kicker .swap svg { height: 17px; width: auto; }
  .viz .vh { flex-wrap: wrap; }
  .viz .vh h4 { font-size: 18.5px; }
  figcaption { font-size: 15px; }
  .legend { font-size: 15px; }
  .key { font-size: 19px; padding: 16px 18px; }
  .takeaway { font-size: 16.5px; padding: 11px 14px 12px; }
  .faq details > p { font-size: 16.5px; padding-right: 0; }
  .recipes { font-size: 14px; }
  .recipes th { padding: 0 3px 6px; font-size: 12.5px; }
  .recipes td { padding: 7px 3px; }
  .recipes td:first-child { padding-left: 6px; }
  .recipes td:first-child .g { width: 56px; margin-right: 5px; }
}
/* the recipe table's glyphs share one width, so the B's line up; the smallest phones get narrower ones to keep the table on screen */
@media (max-width: 370px) {
  .recipes td:first-child .g { width: 46px; }
}
