/* Memryoshka project page. Plain CSS, no build step.
   Colors are tokens on :root; dark mode redefines them (OS setting, or the theme button). */

:root {
  color-scheme: light;
  --page: #ffffff;
  --card: #ffffff;
  --soft: #f6f6f3;
  --soft-2: #efefeb;
  --ink: #14181f;
  --ink-2: #4a505b;
  --ink-3: #7d838d;
  --line: #e6e6e1;
  --line-2: #d6d6cf;
  --axis: #c3c2b7;
  --grid: #ececE6;
  --link: #1f65b9;
  --brand: #b83228;          /* the dolls' red, used for the logo and small accents only */
  --brand-soft: #fbeceb;
  --ours: #2a78d6;           /* Memryoshka (categorical slot 1) */
  --ours4: #eb6834;          /* Memryoshka + 4 recent frames (categorical slot 2) */
  --base: #8d8b83;           /* bounded visual-memory baselines (neutral) */
  --ref: #4a505b;            /* full-memory reference tick */
  --dropped: rgba(20, 24, 31, 0.62);
  --dropped-key: #3d424a;
  --future: #f3f3ef;
  /* code length 128 -> 4,096 bits (ordinal ramp, validated) */
  --b128: #88b5f2; --b256: #609ae7; --b512: #3b7fd6; --b1024: #1f65b9; --b2048: #124d93; --b4096: #0d376a;
  --shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 8px 24px rgba(20, 24, 31, 0.06);
  --radius: 14px;
  --serif: "Newsreader", "Iowan Old Style", "Georgia", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --prose: 700px;
  --wide: 1080px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #111418; --card: #171b20; --soft: #1b2026; --soft-2: #222830;
    --ink: #e9edf2; --ink-2: #b7bec8; --ink-3: #8a929d; --line: #262c34; --line-2: #333a44;
    --axis: #3b424c; --grid: #232930; --link: #79aef5; --brand: #e0645a; --brand-soft: #2a1a19;
    --ours: #3987e5; --ours4: #d95926; --base: #8b8a84; --ref: #c3c9d2;
    --dropped: rgba(8, 10, 13, 0.70); --dropped-key: #6b7280; --future: #1a1f25;
    --b128: #184c8d; --b256: #2166bb; --b512: #3983e1; --b1024: #67a2f0; --b2048: #93c1fe; --b4096: #c7e0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #111418; --card: #171b20; --soft: #1b2026; --soft-2: #222830;
  --ink: #e9edf2; --ink-2: #b7bec8; --ink-3: #8a929d; --line: #262c34; --line-2: #333a44;
  --axis: #3b424c; --grid: #232930; --link: #79aef5; --brand: #e0645a; --brand-soft: #2a1a19;
  --ours: #3987e5; --ours4: #d95926; --base: #8b8a84; --ref: #c3c9d2;
  --dropped: rgba(8, 10, 13, 0.70); --dropped-key: #6b7280; --future: #1a1f25;
  --b128: #184c8d; --b256: #2166bb; --b512: #3983e1; --b1024: #67a2f0; --b2048: #93c1fe; --b4096: #c7e0ff;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 17.5px/1.68 var(--sans); font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
p { margin: 0 0 1.05em; }
strong { font-weight: 600; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--ours); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- navigation ---------- */
.nav {
  position: sticky; top: 0; z-index: 50; height: 60px;
  background: color-mix(in srgb, var(--page) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: 1180px; margin: 0 auto; height: 100%; padding: 0 20px; display: flex; align-items: center; gap: 20px; }
.wordmark { display: flex; align-items: center; gap: 9px; font: 600 19px/1 var(--serif); color: var(--ink); letter-spacing: 0.01em; }
.wordmark:hover { text-decoration: none; }
.wordmark img { height: 24px; width: auto; }
.nav-links { display: flex; gap: 22px; margin: 0 auto; }
.nav-links a { color: var(--ink-2); font-size: 14.5px; padding: 18px 0 16px; border-bottom: 2px solid transparent; white-space: nowrap; }
.nav-links a:hover { color: var(--ink); text-decoration: none; }
.nav-links a.active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ours); }
.nav-actions { display: flex; align-items: center; gap: 6px; }
.nav-actions a, .icon-btn {
  display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink-2);
  padding: 7px 10px; border-radius: 8px; border: 0; background: none; cursor: pointer;
}
.nav-actions a:hover, .icon-btn:hover { background: var(--soft); color: var(--ink); text-decoration: none; }
.nav-actions .soon { opacity: 0.55; pointer-events: none; }
.progress { position: absolute; left: 0; bottom: -1px; height: 3px; width: 0; background: var(--ours); }
/* narrow screens: the section links move to a second row that scrolls sideways */
@media (max-width: 860px) {
  html { scroll-padding-top: 104px; }
  .nav { height: auto; }
  .nav-inner { flex-wrap: wrap; height: auto; padding: 8px 16px 0; gap: 4px 12px; }
  .nav-actions { margin-left: auto; }
  .nav-links {
    order: 3; width: 100%; margin: 0; gap: 20px; overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 8px 0 9px; font-size: 14px; }
  .nav-links a:last-child { padding-right: 28px; }
}
@media (max-width: 480px) { .nav-actions .label { display: none; } }

/* side navigation on wide screens */
.toc { display: none; }
@media (min-width: 1420px) {
  .toc {
    display: block; position: fixed; z-index: 40; top: 92px; width: 160px;
    left: max(12px, calc((100vw - var(--wide)) / 2 - 184px));
    max-height: calc(100vh - 120px); overflow-y: auto; font-size: 13px; line-height: 1.35;
    opacity: 0; transform: translateX(-6px); pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease;
  }
  .toc.shown { opacity: 1; transform: none; pointer-events: auto; }
}
.toc-title { font: 600 11px/1 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px 14px; }
.toc-list { border-left: 1px solid var(--line-2); }
.toc a { display: block; margin-left: -1px; padding: 4px 0 4px 13px; border-left: 2px solid transparent; color: var(--ink-3); }
.toc a.top { margin-top: 7px; color: var(--ink-2); font-weight: 500; }
.toc a.top:first-child { margin-top: 0; }
.toc a.sub { padding-left: 24px; font-size: 12.5px; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.in { color: var(--ink); }
.toc a.active { color: var(--ours); border-left-color: var(--ours); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .toc { transition: none; } }
.skip { position: absolute; left: 12px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--ink); color: var(--page); }
.skip:focus { top: 10px; text-decoration: none; }

/* ---------- layout ---------- */
main { overflow-x: clip; }
.section { padding: 84px 20px 16px; }
.prose { max-width: var(--prose); margin: 0 auto; }
.wide { max-width: var(--wide); margin-left: auto; margin-right: auto; }
.section h2 {
  font: 500 clamp(30px, 4.2vw, 40px)/1.15 var(--serif); letter-spacing: -0.01em; margin: 0 0 22px; color: var(--ink);
}
.section h3 { font: 600 22px/1.3 var(--serif); margin: 44px 0 12px; }
.kicker { font: 600 12px/1 var(--sans); letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 14px; }
.lead { font-size: 19px; color: var(--ink-2); }
.muted { color: var(--ink-3); }
hr.rule { border: 0; border-top: 1px solid var(--line); max-width: var(--prose); margin: 64px auto 0; }

/* ---------- hero ---------- */
.hero { padding: 52px 20px 4px; text-align: center; }
.hero-brand { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 10px; }
.hero-brand img { height: clamp(64px, 11vw, 112px); width: auto; }
.hero h1 { font: 500 clamp(46px, 9vw, 88px)/1 var(--serif); letter-spacing: -0.02em; margin: 0; }
.hero .subtitle { font: italic 400 clamp(21px, 3vw, 29px)/1.3 var(--serif); color: var(--ink-2); margin: 18px auto 0; max-width: 820px; }
.summary { padding: 30px 20px 0; text-align: center; }
.lede { max-width: 690px; margin: 0 auto; font-size: 18.5px; color: var(--ink-2); }
.buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 26px 0 0; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 17px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--card); color: var(--ink); font-size: 15px; font-weight: 500;
}
.btn:hover { text-decoration: none; border-color: var(--ink-3); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--page); }
.btn.primary:hover { opacity: 0.9; }
.btn.soon { color: var(--ink-3); cursor: default; }
.btn.soon:hover { border-color: var(--line-2); }
.btn .tag { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.btn svg { width: 17px; height: 17px; }
.authors { margin: 26px auto 0; max-width: 860px; font: 400 19px/1.7 var(--serif); text-wrap: balance; }
.authors .a { display: inline-block; margin: 0 11px; white-space: nowrap; color: var(--ink); }
.authors sup { font: 500 11px var(--sans); color: var(--ink-3); margin-left: 2px; }
.affils { margin: 10px auto 0; max-width: 1000px; color: var(--ink-3); font-size: 15px; text-wrap: balance; }
.affils span { display: inline-block; margin: 0 10px; }
.author-note { margin-top: 6px; color: var(--ink-3); font-size: 13.5px; }
/* institution logos: on white in both themes, since some logo files have a white background */
.logos { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 30px; width: fit-content; max-width: 100%; margin: 20px auto 0; padding: 10px 22px; border-radius: 12px; background: #ffffff; }
.logos img { width: auto; max-width: 100%; }
.draft-note {
  display: inline-block; margin-top: 18px; padding: 6px 12px; border-radius: 8px; font-size: 13px;
  background: var(--brand-soft); color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}
.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); max-width: 980px; margin: 40px auto 0;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 24px 18px 22px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat .label { font: 600 11.5px/1.2 var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.stat .value { font: 600 40px/1.15 var(--sans); letter-spacing: -0.02em; margin: 8px 0 6px; color: var(--ink); }
.stat .desc { font-size: 14.5px; line-height: 1.5; color: var(--ink-2); max-width: 280px; margin: 0 auto; }
@media (max-width: 720px) {
  .stats { grid-template-columns: 1fr; }
  .stat + .stat { border-left: 0; border-top: 1px solid var(--line); }
}

/* ---------- figures ---------- */
.fig { margin: 44px auto 8px; padding: 0 20px; }
.fig-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.fig-label { font: 600 12px/1.2 var(--sans); letter-spacing: 0.13em; text-transform: uppercase; color: var(--ours); }
.fig-label .n { color: var(--ink-3); margin-right: 4px; }
.fig-source { font-size: 12.5px; color: var(--ink-3); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
/* a figure's one-line explanation goes above it, never below */
.fig-lead { max-width: 820px; margin: -2px 0 14px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.fig-lead strong, .panel-lead strong, .findings strong, .vs strong, .lead strong, .lede strong { color: var(--ink); }
.findings { margin: -2px 0 16px; padding-left: 20px; font-size: 15.5px; line-height: 1.55; color: var(--ink-2); }
.findings li { margin-bottom: 4px; }
.findings li b { color: var(--ink); font-weight: 600; }
.panel-lead { font-size: 14.5px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; }
.table-note { font-size: 13px; color: var(--ink-3); margin: 0 0 4px; }
.table-note b { color: var(--ink-2); font-weight: 600; }
.paper-fig { background: #ffffff; border-radius: 10px; padding: 10px; }
.paper-fig img { width: 100%; height: auto; }
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
@media (max-width: 820px) { .two-up { grid-template-columns: 1fr; } }
.two-up h4 { font: 600 15px/1.4 var(--sans); margin: 0 0 8px; }
.two-up p { font-size: 14.5px; color: var(--ink-2); margin: 10px 0 0; line-height: 1.55; }

/* ---------- controls (shared by the figures) ---------- */
.controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ctl-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 34px; padding: 0 11px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); cursor: pointer; font-size: 14px; color: var(--ink);
}
.ctl-btn:hover { border-color: var(--ink-3); }
.ctl-btn svg { width: 15px; height: 15px; }
.range { flex: 1; min-width: 140px; accent-color: var(--ours); height: 24px; }
.time { font: 500 13.5px var(--sans); font-variant-numeric: tabular-nums; color: var(--ink-2); min-width: 104px; text-align: right; }
select.ctl-btn { padding-right: 8px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 9px; padding: 2px; background: var(--soft); }
.seg button { border: 0; background: none; padding: 5px 12px; border-radius: 7px; cursor: pointer; font-size: 14px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); font-weight: 500; }
.toggle-link { border: 0; background: none; color: var(--link); cursor: pointer; font-size: 14px; padding: 4px 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 13.5px; color: var(--ink-2); }
.legend .key { display: inline-flex; align-items: center; gap: 7px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; }
.tick-key { display: inline-block; width: 2px; height: 14px; background: var(--ref); border-radius: 1px; }
.line-key { display: inline-block; width: 16px; height: 2px; border-radius: 1px; }
.ramp-legend { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); flex-wrap: wrap; }
.ramp-legend .cells { display: inline-flex; gap: 2px; }
.ramp-legend .cells span { width: 26px; height: 10px; border-radius: 2px; }
.ramp-legend .ticks { display: inline-flex; gap: 2px; font-size: 11px; color: var(--ink-3); }
.ramp-legend .ticks span { width: 26px; text-align: center; }

/* tooltip */
.tip {
  position: fixed; z-index: 80; pointer-events: none; background: var(--card); color: var(--ink);
  border: 1px solid var(--line-2); border-radius: 10px; box-shadow: var(--shadow); padding: 10px 12px; font-size: 13px; line-height: 1.45;
  max-width: 360px; opacity: 0; transition: opacity 0.08s;
}
.tip.show { opacity: 1; }
.tip .t-title { font-weight: 600; margin-bottom: 4px; }
.tip .t-row { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .t-row .k { color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; }
.tip .t-row .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; }
.tip .t-row .k { flex: none; }
.tip canvas { display: block; border-radius: 6px; margin-bottom: 6px; }

/* ---------- figure 01: the stream ---------- */
.stream-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; flex-wrap: wrap; margin-bottom: 16px; }
.stream-intro { max-width: 600px; font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.strip { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; margin: 4px 0 14px; }
.strip .slot { position: relative; aspect-ratio: 16 / 9; border-radius: 6px; background: var(--future); overflow: hidden; }
.strip .slot canvas { width: 100%; height: 100%; display: block; }
.strip .slot .ts { position: absolute; left: 4px; bottom: 3px; font: 600 10px var(--sans); color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); }
.strip .slot.gone canvas { filter: grayscale(1) brightness(0.55); }
.strip .slot.future::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--line); border-radius: 6px; }
@media (max-width: 640px) { .strip { grid-template-columns: repeat(6, 1fr); } .strip .slot:nth-child(odd) { display: none; } }
.lanes { display: grid; grid-template-columns: 176px 1fr; gap: 6px 14px; align-items: stretch; }
.lane-label { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); padding-top: 4px; }
.lane-label b { display: block; color: var(--ink); font-weight: 600; font-size: 14px; }
.lane-label .stat-line { display: block; font-variant-numeric: tabular-nums; margin-top: 3px; }
.lane { position: relative; }
.lane canvas { width: 100%; display: block; }
.lane.main canvas { height: 150px; }
.lane.small canvas { height: 64px; }
.axis-row { grid-column: 2; position: relative; height: 16px; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; margin-top: -2px; }
.axis-row .tick { position: absolute; top: 0; transform: translateX(-50%); white-space: nowrap; }
.axis-row .tick:first-child { transform: none; }
.seg-row { grid-column: 2; position: relative; height: 22px; font-size: 12.5px; color: var(--ink-2); }
.seg-row span { position: absolute; top: 2px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 1px solid var(--line-2); padding: 0 4px; }
.seg-row span:first-child { border-left: 0; }
@media (max-width: 720px) {
  .lanes { grid-template-columns: 1fr; }
  .axis-row, .seg-row { grid-column: 1; }
  .seg-row { font-size: 10.5px; }
  .lane-label { padding-top: 10px; }
}
.stream-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 18px; border-top: 1px solid var(--line); }
.stream-stats > div { padding: 12px 14px 0 0; }
.stream-stats .k { font-size: 12px; color: var(--ink-3); letter-spacing: 0.02em; }
.stream-stats .v { font: 600 21px/1.3 var(--sans); }
.stream-stats .s { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.meter { height: 6px; background: var(--soft-2); border-radius: 3px; margin-top: 6px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--ours); border-radius: 3px; }
.segbar { display: flex; gap: 2px; height: 8px; margin-top: 7px; }
.segbar i { display: block; height: 100%; border-radius: 4px; }
@media (max-width: 720px) { .stream-stats { grid-template-columns: 1fr 1fr; } }
.stream-foot { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 16px; }

/* ---------- figure: nested code ---------- */
.code-wrap { display: grid; grid-template-columns: 1fr; gap: 18px; }
.code-grid { position: relative; }
.code-grid canvas { width: 100%; height: 132px; display: block; }
.code-axes { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); margin-top: 6px; }
.code-row { display: grid; grid-template-columns: 1.1fr 1fr; gap: 26px; align-items: center; }
@media (max-width: 820px) { .code-row { grid-template-columns: 1fr; } }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.readout .k { font-size: 12.5px; color: var(--ink-3); }
.readout .v { font: 600 26px/1.2 var(--sans); }
.readout .s { font-size: 13px; color: var(--ink-2); }
.len-picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.len-picker button { border: 1px solid var(--line-2); background: var(--card); border-radius: 8px; padding: 5px 10px; font-size: 13.5px; cursor: pointer; font-variant-numeric: tabular-nums; color: var(--ink-2); }
.len-picker button[aria-pressed="true"] { border-color: var(--ours); color: var(--ink); box-shadow: inset 0 0 0 1px var(--ours); font-weight: 600; }
.len-picker button.below { color: var(--ink-3); }
svg.chart text { font-family: var(--sans); }

/* ---------- figure: one price per bit ---------- */
.price-wrap { display: grid; grid-template-columns: 1.35fr 1fr; gap: 24px; align-items: start; }
@media (max-width: 900px) { .price-wrap { grid-template-columns: 1fr; } }
.frame-view { position: relative; border-radius: 10px; overflow: hidden; background: #000; aspect-ratio: 16 / 9; }
.frame-view img, .frame-view canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.frame-view .badge {
  position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 7px; font-size: 12.5px; font-weight: 600;
  background: rgba(10, 12, 15, 0.72); color: #fff;
}
.frame-view .gone-msg {
  position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 20px;
  color: #fff; font-size: 15px; background: rgba(10, 12, 15, 0.55);
}
.frame-view.dropped .gone-msg { display: flex; }
.frame-tabs { display: flex; gap: 8px; margin-top: 10px; }
.frame-tabs button { padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; flex: 1 1 0; max-width: 96px; min-width: 0; }
.frame-tabs button[aria-pressed="true"] { border-color: var(--ours); }
.frame-tabs img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.price-side h4 { font: 600 15px var(--sans); margin: 0 0 6px; }
.price-side .big { font: 600 26px/1.25 var(--sans); }
.marks { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.marks button { border: 1px solid var(--line-2); background: var(--card); border-radius: 999px; padding: 4px 11px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.marks button[aria-pressed="true"] { border-color: var(--ours); color: var(--ink); font-weight: 600; }
.rule-box { background: var(--soft); border-radius: 10px; padding: 12px 14px; font-size: 14px; line-height: 1.55; color: var(--ink-2); margin-top: 14px; }
.rule-box b { color: var(--ink); font-weight: 600; }
.mini-hist { display: grid; grid-template-columns: auto 1fr auto; gap: 4px 10px; align-items: center; font-size: 13px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.mini-hist .bar { height: 10px; border-radius: 0 4px 4px 0; min-width: 0; }
.mini-hist .lbl { color: var(--ink-2); }
.mini-hist .cnt { color: var(--ink-3); text-align: right; }

/* ---------- results ---------- */
.chart-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.dotplot svg, .smalls svg { width: 100%; height: auto; display: block; overflow: visible; }
.table-wrap { overflow-x: auto; margin-top: 14px; }
table.data { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
table.data th:first-child, table.data td:first-child { text-align: left; white-space: normal; }
table.data thead th { font-weight: 600; color: var(--ink-2); font-size: 13px; border-bottom: 1px solid var(--line-2); }
table.data tr.ours td { background: color-mix(in srgb, var(--ours) 9%, transparent); }
table.data tr.ours td:first-child { font-weight: 600; }
table.data tr.ref td { color: var(--ink-3); }
table.data td .sub { display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.table-wrap.flush { margin-top: 0; }
table.data tr.group td { font-size: 12.5px; color: var(--ink-3); font-weight: 600; letter-spacing: 0.03em; padding-top: 14px; }
table.data td { color: var(--ink-2); }
table.data td:first-child { color: var(--ink); }
table.data td.best { font-weight: 700; color: var(--ink); }
details.more { margin-top: 18px; }
details.more summary { cursor: pointer; color: var(--link); font-size: 15px; }
.smalls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 760px) { .smalls { grid-template-columns: 1fr; } }
.smalls h5 { margin: 0 0 4px; font: 600 14px var(--sans); }

/* ---------- lists, citation, footer ---------- */
.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 26px 0 8px; }
@media (max-width: 760px) { .cards3 { grid-template-columns: 1fr; } }
.cards3 .c { border-top: 1px solid var(--line-2); padding-top: 14px; }
.cards3 .c .n { font: italic 500 22px var(--serif); color: var(--ours); }
.cards3 .c h4 { font: 600 17px/1.3 var(--serif); margin: 2px 0 6px; }
.cards3 .c p { font-size: 15px; color: var(--ink-2); line-height: 1.55; margin: 0; }
.cards3 .c.hl { border-top: 2px solid var(--ours); padding-top: 13px; }
.cards3 .c.hl h4 { color: var(--ours); }
.quote { font: italic 400 20px/1.55 var(--serif); color: var(--ink-2); border-left: 2px solid var(--line-2); padding: 2px 0 2px 18px; margin: 0 0 28px; }
.quote cite { display: block; font: normal 400 13.5px var(--sans); color: var(--ink-3); margin-top: 6px; }
.takeaways { padding-left: 22px; }
.takeaways li { margin-bottom: 14px; padding-left: 4px; }
.takeaways li::marker { color: var(--ours); font-weight: 600; }
.takeaways li b { font-weight: 600; color: var(--ink); }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 6px; margin-top: 46px; }
.step .no { font: italic 500 26px/1.2 var(--serif); color: var(--ours); }
.step h3 { margin: 0 0 10px; }
pre.bib {
  background: var(--soft); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; overflow-x: auto;
  font: 13.5px/1.6 var(--mono); color: var(--ink); margin: 0;
}
.bib-wrap { position: relative; }
.bib-wrap .copy { position: absolute; top: 10px; right: 10px; }
.cmp-table td:nth-child(2), .cmp-table td:nth-child(3), .cmp-table td:nth-child(4) { text-align: right; }
footer { border-top: 1px solid var(--line); margin-top: 90px; padding: 30px 20px 50px; color: var(--ink-3); font-size: 14px; }
footer .inner { max-width: var(--wide); margin: 0 auto; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
@media (max-width: 560px) {
  body { font-size: 16.5px; }
  .section { padding: 64px 16px 8px; }
  .fig { padding: 0 12px; }
  .card { padding: 14px; }
  .hero { padding: 54px 16px 20px; }
}
@media print { .nav, .controls, .tip { display: none !important; } .card { box-shadow: none; } }

/* ---------- savings, higher-with-less, beyond cards ---------- */
.beyond-cards h4 { margin-bottom: 4px; }
.beyond-cards .big { font: 600 30px/1.2 var(--sans); margin-top: 6px; color: var(--ink); }
.two-up p.vs { font-size: 14.5px; color: var(--ink-2); margin: 6px 0 14px; }

/* ---------- videos ---------- */
.fig.video-intro { max-width: 1000px; margin-top: 36px; }
.video-card { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #0d0f12; border: 1px solid var(--line); box-shadow: var(--shadow); }
.video-card video { position: absolute; inset: 0; width: 100%; height: 100%; display: block; object-fit: contain; background: #0d0f12; }
.video-card .play {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; width: 100%; padding: 0; border: 0; border-radius: 0;
  cursor: pointer; color: #ffffff; background: transparent; transition: background 0.15s ease;
}
.video-card .play:hover { background: rgba(10, 12, 15, 0.04); }
.video-card .play:focus-visible { outline: 3px solid var(--ours); outline-offset: -3px; }
.video-card .play .disc {
  display: flex; align-items: center; justify-content: center; width: 76px; height: 76px; border-radius: 50%;
  background: rgba(20, 24, 31, 0.88); box-shadow: 0 6px 24px rgba(10, 12, 15, 0.22); transition: transform 0.15s ease;
}
.video-card .play:hover .disc, .video-card .play:focus-visible .disc { transform: scale(1.06); }
.video-card .play svg { width: 28px; height: 28px; margin-left: 4px; fill: #ffffff; }
.video-card .play .label { position: absolute; left: 16px; bottom: 16px; display: flex; align-items: baseline; gap: 10px; padding: 7px 13px; border-radius: 9px; background: rgba(20, 24, 31, 0.84); font: 600 15.5px/1.3 var(--sans); }
.video-card .play .dur { font-weight: 500; font-size: 14px; opacity: 0.78; font-variant-numeric: tabular-nums; }
.video-card.playing .play { display: none; }
@media (prefers-reduced-motion: reduce) { .video-card .play, .video-card .play .disc { transition: none; } }
@media (max-width: 560px) {
  .video-card .play .disc { width: 48px; height: 48px; }
  .video-card .play svg { width: 18px; height: 18px; margin-left: 3px; }
  .video-card .play .label { left: 10px; bottom: 10px; padding: 5px 10px; font-size: 13.5px; }
  .video-card .play .dur { font-size: 12.5px; }
}
