/* ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
   ADLIB project page. Built on the paper-template by Seemandhar Jain (CC BY-SA 4.0, see LICENSE), restyled: a white
   page in Inter with serif prose, the pipeline HUD's actor colours (LA violet, DM teal, Execute amber) and a touch of
   Sprout's yellow.
   ════════════════════════════════════════════════════════════════════════════════════════════════════════════════ */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f3;            /* a warm off-white, the colour of Sprout's shell */
  --surface: #ffffff;
  --ink: #15171a;
  --ink-2: #3a3f46;
  --muted: #6a7079;
  --faint: #9aa0a8;
  --hair: #e8e8e2;
  --hair-2: #d9d9d0;

  --sprout: #f2cd18;             /* Sprout's yellow: marks, never fills */
  --sprout-soft: #fbf0b4;

  /* the HUD's actors (light theme) */
  --llm: #a78bfa;  --llm-ink: #7c3aed;  --llm-soft: #f4f0ff;
  --dm: #2dd4bf;   --dm-ink: #0f766e;   --dm-soft: #e9f8f5;
  --eng: #f59e0b;  --eng-ink: #b45309;  --eng-soft: #fff6e6;
  --mem: #94a3b8;  --mem-ink: #475569;
  --ok: #34d399;   --ok-ink: #047857;
  --fail: #f87171; --fail-ink: #dc2626;

  --accent: var(--dm-ink);

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --radius: 16px;
  --shadow: 0 1px 2px rgba(21, 23, 26, .04), 0 12px 32px -16px rgba(21, 23, 26, .16);
  --shadow-lg: 0 1px 2px rgba(21, 23, 26, .05), 0 24px 60px -28px rgba(21, 23, 26, .28);
  --topbar: 56px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--topbar) + 12px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, video, canvas, svg { display: block; max-width: 100%; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
.mono { font-family: var(--mono); }
[hidden] { display: none !important; }

.wrap { width: min(980px, 100% - 40px); margin: 0 auto; }
.wrap-wide { width: min(1240px, 100% - 40px); }
.wrap-xwide { width: min(1560px, 100% - 40px); }


/* ════════ top bar ════════ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar);
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease;
}
.topbar.scrolled { border-bottom-color: var(--hair); }
.topbar-inner {
  width: min(1240px, 100% - 40px); height: 100%; margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .02em; }
.brand:hover { text-decoration: none; }
.brand-mark { display: inline-grid; grid-template-columns: repeat(3, 7px); gap: 3px; }
.brand-mark i { width: 7px; height: 7px; border-radius: 50%; }
.brand-mark i:nth-child(1) { background: var(--llm); }
.brand-mark i:nth-child(2) { background: var(--dm); }
.brand-mark i:nth-child(3) { background: var(--eng); }
.brand-name { font-size: 15px; }
.toplinks { margin-left: auto; display: flex; gap: 4px; }
.toplinks a {
  color: var(--muted); font-size: 14px; font-weight: 500; padding: 6px 12px; border-radius: 999px;
  transition: color .2s ease, background-color .2s ease;
}
.toplinks a:hover { color: var(--ink); background: var(--bg-soft); text-decoration: none; }
.toplinks a.active { color: var(--ink); background: var(--bg-soft); }


/* ════════ hero ════════ */
.hero { padding: 52px 0 26px; text-align: center; }
.title {
  margin: 0 auto 22px; max-width: 980px;
  font-weight: 500; font-size: clamp(28px, 4vw, 44px); line-height: 1.12; letter-spacing: -.025em;
}
/* the name and the letters it is made of (A, D, L, I, B) are bold, the rest of the title lighter */
.title-name, .title-colon, .title b { font-weight: 800; }
.title-name {
  position: relative; display: inline-block;
  background: linear-gradient(transparent 64%, var(--sprout-soft) 64%, var(--sprout-soft) 92%, transparent 92%);
  padding: 0 .02em 0 .06em;
}
.title-colon { margin-right: 0; }
.title-line { display: block; text-wrap: balance; }   /* three lines: the name, "for ...", "with ..." */
.authors {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px;
  font-size: 17.5px; font-weight: 500; color: var(--ink);
}
.author sup { margin-left: 1px; font-size: .62em; font-weight: 500; line-height: 0; color: var(--muted); }
/* an author's own page: the name keeps the ink colour, a faint underline says it is a link */
.author a { color: inherit; text-decoration: underline; text-decoration-color: var(--hair-2); text-decoration-thickness: 1.5px;
  text-underline-offset: 4px; transition: text-decoration-color .15s ease; }
.author a:hover { text-decoration-color: currentColor; }
.affiliation, .author-notes { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 20px; }
.affiliation { margin-top: 8px; font-size: 15px; color: var(--muted); }
.author-notes { margin-top: 3px; font-size: 13px; color: var(--faint); }
.affiliation sup, .author-notes sup { margin-right: 2px; font-size: .72em; line-height: 0; }
.links { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink);
  font-size: 15px; font-weight: 600;
  transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}
.pill:hover { text-decoration: none; border-color: var(--ink-2); transform: translateY(-1px); box-shadow: var(--shadow); }
.pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pill em { font-style: normal; font-size: 12px; font-weight: 500; color: var(--muted); }
.pill-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.pill-dark em { color: rgba(255, 255, 255, .6); }
.pill-soon { cursor: default; }
.pill-soon:hover { transform: none; box-shadow: none; border-color: var(--hair-2); }
.pill-dark.pill-soon:hover { border-color: var(--ink); }

/* ════════ highlights: the one-minute reel under the title ════════ */
.section-reel { padding: 6px 0 18px; }
.reel-video {
  position: relative; border-radius: var(--radius); overflow: hidden; background: #0e0f11; aspect-ratio: 16 / 9;
  box-shadow: var(--shadow-lg);
}
.reel-video video { width: 100%; height: 100%; object-fit: cover; cursor: pointer; }
.reel-toggle {
  position: absolute; left: 16px; bottom: 16px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  display: grid; place-items: center; cursor: pointer; color: #fff; background: rgba(21, 23, 26, .58);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: .8; transition: opacity .2s ease, background-color .2s ease;
}
.reel-toggle:hover, .reel-toggle:focus-visible { opacity: 1; background: rgba(21, 23, 26, .78); }
.reel-toggle svg { width: 15px; height: 15px; fill: currentColor; }
.reel-toggle .i-play, .reel.is-paused .reel-toggle .i-pause { display: none; }
.reel.is-paused .reel-toggle .i-play { display: block; }
.reel-bar { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 16px; margin-top: 14px; }
.reel-bar:empty { display: none; }
.reel-ch {
  display: block; min-width: 0; padding: 4px 0; border: 0; background: none; cursor: pointer; text-align: left;
  color: var(--muted); transition: color .2s ease;
}
.reel-ch:hover { color: var(--ink-2); }
.reel-ch[aria-current="true"] { color: var(--ink); }
.reel-track { display: block; height: 3px; border-radius: 3px; background: var(--hair-2); overflow: hidden; }
.reel-track i { display: block; height: 100%; width: calc(var(--p, 0) * 100%); background: var(--ink); border-radius: inherit; }
.reel-ch-label { display: flex; align-items: baseline; gap: 8px; margin-top: 9px; font-size: 14.5px; font-weight: 600; line-height: 1.3; }
.reel-ch-num { font: 500 12px var(--mono); color: var(--faint); }
.reel-ch[aria-current="true"] .reel-ch-num { color: var(--ink-2); }
/* the speed of the cut on screen: on the real-robot reel for phones only (see the 760px rule; elsewhere the badge burned
   into the video is enough), always on the sim reel, which has none burned in */
.reel-speed {
  display: none; position: absolute; top: 8px; right: 8px; align-items: center; gap: 5px; padding: 1px 9px 1px 8px;
  border-radius: 999px; background: rgba(21, 23, 26, .72); color: #fff; font: 600 12px/1.6 var(--mono); pointer-events: none;
}
.reel-speed svg { width: 9px; height: 9px; fill: currentColor; flex: none; }
.reel-speed.is-fast svg { width: 13px; }
.reel-speed.is-fast { background: var(--sprout); color: var(--ink); }
/* the sim reel under the section's heading: the task on screen, top left, and its speed, top right, as large as the real
   reel's badges */
.reel-sim { max-width: 1240px; margin: 30px auto 0; }
.reel-sim + .sub-center { margin-top: 30px; }
.reel-sim .eyebrow { margin-bottom: 12px; }
.reel-sim .reel-speed {
  display: inline-flex; top: 16px; right: 16px; gap: 8px; padding: 6px 15px 6px 13px; font: 600 19px/1.2 var(--mono);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.reel-sim .reel-speed svg { width: 13px; height: 13px; }
.reel-sim .reel-speed.is-fast svg { width: 19px; }
.reel-task {
  position: absolute; left: 16px; top: 16px; display: inline-flex; align-items: center; gap: 9px; max-width: calc(100% - 150px);
  padding: 5px 15px 5px 6px; border-radius: 999px; background: rgba(10, 12, 14, .58); color: #fff;
  font: 600 16px/1.3 var(--sans); white-space: nowrap; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); opacity: 0; transition: opacity .25s ease;
}
.reel-task.on { opacity: 1; }
.reel-task .code { flex: none; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--ink); font: 600 13px/1.5 var(--mono); }


/* ════════ sections ════════ */
.section { padding: 84px 0; }
.section-tight { padding-top: 22px; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.section h2 { margin: 0; font-size: clamp(26px, 3vw, 34px); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.h-center { text-align: center; }
.sub-center { margin: 12px auto 0; max-width: 780px; text-align: center; color: var(--ink-2); font-size: 17px; }
.sub-one-line { max-width: none; white-space: nowrap; }   /* kept on one line where it fits (see the narrow screens) */
.eyebrow {
  margin-bottom: 14px; font-size: 12.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted);
}
.eyebrow-left { text-align: left; }
.lede {
  margin: 20px auto 0; max-width: 800px;
  font: 400 20px/1.62 var(--serif); color: var(--ink-2); text-align: center;
}
.lede em { font-style: italic; color: var(--ink); }
.prose { font: 400 18px/1.65 var(--serif); color: var(--ink-2); margin: 16px 0 0; }
.small-note { margin: 18px 0 0; font-size: 13.5px; color: var(--muted); }
.inline-link { white-space: nowrap; font-weight: 500; }
.tok { font-weight: 650; }
.tok-llm { color: var(--llm-ink); }
.tok-dm { color: var(--dm-ink); }
.tok-eng { color: var(--eng-ink); }

/* ════════ overview: the three blocks of the figure, one line each, in their colours ════════ */
.roles { list-style: none; margin: 30px auto 0; padding: 0; max-width: 840px; display: grid; gap: 10px; }
.role {
  --c: var(--dm); --c-ink: var(--dm-ink); --c-soft: var(--dm-soft);
  display: grid; grid-template-columns: 78px minmax(0, 1fr); gap: 6px 14px; align-items: baseline;
  padding: 14px 20px 14px 16px; border-radius: 14px; background: var(--c-soft);
  border: 1px solid color-mix(in srgb, var(--c) 34%, transparent);
}
.role-llm { --c: var(--llm); --c-ink: var(--llm-ink); --c-soft: var(--llm-soft); }
.role-eng { --c: var(--eng); --c-ink: var(--eng-ink); --c-soft: var(--eng-soft); }
.role-tag {
  justify-self: start; padding: 1px 10px; border-radius: 999px; background: var(--c-ink); color: #fff;
  font: 700 13px/1.6 var(--sans); letter-spacing: .02em; white-space: nowrap;
}
.role p { margin: 0; font: 400 16.5px/1.55 var(--sans); color: var(--ink-2); }
/* two columns in every card: the lead ("decides what.") and the terms' keys on the left, the sentences on the right */
.role-body { --key: 140px; }
.role-lead { display: grid; grid-template-columns: var(--key) minmax(0, 1fr); gap: 4px 14px; align-items: baseline; }
.role-what { font-weight: 750; color: var(--c-ink); }
.role mark {
  padding: 0 .12em; color: var(--ink); font-weight: 600; white-space: nowrap;
  background: linear-gradient(transparent 56%, color-mix(in srgb, var(--c) 40%, transparent) 56%,
              color-mix(in srgb, var(--c) 40%, transparent) 94%, transparent 94%);
}
/* the figure's own terms and marks, one block at a time: a key on the left, its meaning on the right */
.role-body { min-width: 0; }
.role-terms {
  list-style: none; margin: 10px 0 0; padding: 10px 0 0; display: grid; gap: 7px;
  border-top: 1px dashed color-mix(in srgb, var(--c) 45%, transparent);
}
.role-terms li { display: grid; grid-template-columns: var(--key) minmax(0, 1fr); gap: 14px; align-items: baseline; font: 400 14.5px/1.5 var(--sans); color: var(--ink-2); }
.role-terms b { font-weight: 650; color: var(--ink); }
.role-terms i { font-family: var(--serif); font-size: 1.06em; }
.role-terms sub { font-size: .7em; line-height: 0; }
.role-terms .mono { font-size: 12.5px; color: var(--ok-ink); white-space: nowrap; }
.rt-k { font-weight: 650; color: var(--c-ink); white-space: nowrap; }
.rt-k i { color: var(--c-ink); font-weight: 400; }
.rt-arrow { display: inline-block; width: 24px; height: 10px; margin-right: 6px; vertical-align: 0; }
.role-terms .lg { vertical-align: middle; margin: 0 2px 0 1px; }
.mk { display: inline-block; vertical-align: -1px; margin: 0 4px 0 2px; }
.mk-carry { width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid var(--dm-ink); background: #fff; }
.mk-reedit { width: 8px; height: 8px; background: var(--dm); transform: rotate(45deg); }
svg.mk-rethink { width: 12px; height: 12px; vertical-align: -2px; }
.role-terms .nw { white-space: nowrap; }
.fpill { display: inline-block; padding: 0 6px; border-radius: 5px; font: 500 12px/1.55 var(--mono); }
.fpill-kept { border: 1.5px solid var(--ok); color: var(--ok-ink); background: #fff; }
.fpill-run { background: var(--eng); color: #fff; }

/* fade in on scroll (from the template) */
.fade-in { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s ease; }
.fade-in.visible { opacity: 1; transform: none; }


/* ════════ real-robot showcase (AgP-style: a list of tasks beside a large video) ════════ */
.showcase {
  display: grid; grid-template-columns: 268px minmax(0, 1fr);
  border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.sc-rail { display: flex; flex-direction: column; background: var(--bg-soft); border-right: 1px solid var(--hair); }
.sc-item {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 20px 22px 20px 24px; border: 0; border-bottom: 1px solid var(--hair); background: transparent;
  transition: background-color .2s ease;
}
.sc-item:last-child { border-bottom: 0; }
.sc-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: transparent;
  transition: background-color .2s ease;
}
.sc-item:hover { background: rgba(255, 255, 255, .7); }
.sc-item[aria-selected="true"] { background: var(--surface); }
.sc-item[aria-selected="true"]::before { background: var(--sprout); }
.sc-num { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.sc-item[aria-selected="true"] .sc-num { color: var(--ink-2); }
.sc-name { display: block; margin-top: 6px; font-size: 18px; font-weight: 650; color: var(--ink-2); line-height: 1.25; }
.sc-item[aria-selected="true"] .sc-name { color: var(--ink); }
.sc-sub { display: block; margin-top: 4px; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.sc-stage { padding: 26px 30px 22px; min-width: 0; }
.sc-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.sc-title { margin: 6px 0 0 !important; font-size: clamp(22px, 2.4vw, 28px) !important; }
.sc-desc { margin: 8px 0 0; max-width: 760px; font: 400 17px/1.55 var(--serif); color: var(--ink-2); }
.sc-tools { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; flex-wrap: wrap; }
.sc-tools-gap { flex: 1; }
.seg { display: inline-flex; padding: 3px; gap: 2px; border: 1px solid var(--hair); border-radius: 10px; background: var(--bg-soft); }
.seg:empty { display: none; }
.seg button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; cursor: pointer;
  font-size: 13px; font-weight: 600; color: var(--muted);
}
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg-speed button { font-family: var(--mono); font-weight: 500; }
.sc-video { position: relative; border-radius: 12px; overflow: hidden; background: #0e0f11; aspect-ratio: 16 / 9; }
.sc-video video { width: 100%; height: 100%; object-fit: contain; background: #0e0f11; }
/* the playback speed, large in the corner: dark glass at 1x, Sprout's yellow when faster (as the reel's badges) */
.vbadge {
  position: absolute; top: 14px; left: 14px; pointer-events: none;
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 15px 6px 13px; border-radius: 999px;
  background: rgba(21, 23, 26, .76); color: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.vbadge svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.vbadge.is-fast { background: var(--sprout); color: var(--ink); }
.vbadge.is-fast svg { width: 21px; }
.vb-speed { font: 800 22px/1.15 var(--sans); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.vb-len { margin-left: 2px; font: 500 13px/1 var(--mono); opacity: .75; }
.sc-note { margin: 10px 2px 0; font-size: 13px; color: var(--muted); }


/* ════════ method: the animated figure ════════ */
.figure-card {
  margin: 34px 0 0; padding: 22px 22px 16px; border: 1px solid var(--hair); border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow-lg);
}
.method-fig { position: relative; }
.method-fig svg { width: 100%; height: auto; overflow: visible; }
.method-fig .method-fallback { width: 100%; }
.method-player { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.play-btn, .ed-toggle {
  flex: none; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--hair-2); background: var(--surface);
  display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.play-btn:hover, .ed-toggle:hover { border-color: var(--ink-2); }
.play-btn svg, .ed-toggle svg { width: 14px; height: 14px; fill: currentColor; }
.play-btn .i-play, .paused .play-btn .i-pause, .ed-toggle .i-play, .paused .ed-toggle .i-pause { display: none; }
.paused .play-btn .i-play, .paused .ed-toggle .i-play { display: block; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex: 1; min-width: 0; }
.steps li { flex: 1 1 0; min-width: 0; }
.steps button {
  position: relative; display: block; width: 100%; text-align: left; cursor: pointer; overflow: hidden;
  border: 0; background: transparent; padding: 10px 2px 2px;
  font-size: 12.5px; font-weight: 600; color: var(--faint); white-space: nowrap; text-overflow: ellipsis;
}
.steps button::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; border-radius: 4px; background: var(--hair);
}
.steps button::after {
  content: ""; position: absolute; left: 0; top: 0; height: 4px; border-radius: 4px;
  width: calc(var(--p, 0) * 100%); background: var(--c, var(--ink-2));
}
.steps button.done { color: var(--ink-2); }
.steps button.active { color: var(--ink); }
.steps .n { font-family: var(--mono); font-weight: 500; margin-right: 5px; color: var(--faint); }
.method-caption {
  display: flex; align-items: flex-start; gap: 12px; margin: 14px 0 0; min-height: 3.2em;
  padding: 12px 14px; border-radius: 12px; background: var(--bg-soft);
}
.mc-num {
  flex: none; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center;
  background: var(--c, var(--ink)); color: #fff; font: 600 12px var(--mono);
  transition: background-color .3s ease;
}
.mc-text { margin: 0; font: 400 17px/1.5 var(--serif); color: var(--ink); transition: opacity .25s ease; }
.mc-text b { font-family: var(--sans); font-weight: 650; font-size: 15.5px; }
.fig-note { margin: 12px 2px 0; font-size: 13px; color: var(--muted); }

/* the switch: the animation (on, the default) or the figure as in the paper (off) */
.anim-switch {
  flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 13px 0 9px; border-radius: 999px; border: 1px solid var(--hair-2); background: var(--surface);
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer; white-space: nowrap;
}
.anim-switch:hover { border-color: var(--ink-2); color: var(--ink); }
.anim-switch .sw {
  position: relative; width: 28px; height: 16px; border-radius: 999px; background: var(--hair-2);
  transition: background-color .2s ease;
}
.anim-switch .sw i {
  position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .2s ease;
}
.anim-switch[aria-checked="true"] .sw { background: var(--accent); }
.anim-switch[aria-checked="true"] .sw i { transform: translateX(12px); }
.figure-card.static .play-btn, .figure-card.static .steps, .figure-card.static .method-caption { display: none; }

/* the figure's parts while the animation runs (method.js toggles the classes; ids are the figure's own). Without
   .animated (the switch off) none of it applies: the figure is as in the paper. */
#method-svg .fx { transition: opacity .45s ease, filter .45s ease; }
#method-svg.still .fx, #method-svg.still .tl-future { transition: none; }
#method-svg.animated .fx.dim { opacity: .26; }
#method-svg.animated .fx.half { opacity: .55; }
#method-svg.animated .fx.lit-llm { filter: drop-shadow(0 0 3px rgba(167, 139, 250, .85)); }
#method-svg.animated .fx.lit-dm { filter: drop-shadow(0 0 3px rgba(45, 212, 191, .9)); }
#method-svg.animated .fx.lit-eng { filter: drop-shadow(0 0 3px rgba(245, 158, 11, .85)); }
#method-svg.animated .fx.lit-mem { filter: drop-shadow(0 0 2.5px rgba(100, 116, 139, .7)); }
#method-svg.animated .fx.lit-ok { filter: drop-shadow(0 0 3px rgba(52, 211, 153, .95)); }
#method-svg.animated .fx.lit-fail { filter: drop-shadow(0 0 2.5px rgba(248, 113, 113, .95)); }
#method-svg .pulse-dot { pointer-events: none; }
#method-svg .playhead { pointer-events: none; }
#method-svg:not(.animated) .playhead, #method-svg:not(.animated) .anim-layer { display: none; }
#method-svg.animated .tl-future { opacity: .28; transition: opacity .3s ease; }
#method-svg .pop { transform-box: fill-box; transform-origin: center; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
#method-svg .label-pill text { font-family: var(--mono); }
@keyframes pop { 0% { transform: scale(.2); } 60% { transform: scale(1.6); } 100% { transform: scale(1); } }


/* ════════ edit: the demo and its text ════════ */
.edit-grid { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.edit-demo-card { min-width: 0; }
.edit-demo {
  position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--hair); background: radial-gradient(120% 90% at 50% 0%, #ffffff 0%, #f6f7f3 100%);
  box-shadow: var(--shadow-lg);
}
.edit-demo canvas { width: 100%; height: 100%; cursor: pointer; }
.ed-hud { position: absolute; pointer-events: none; font-size: 12.5px; color: var(--muted); }
.ed-tl { top: 14px; left: 16px; display: flex; gap: 10px; align-items: baseline; }
.ed-clock { color: var(--ink); font-weight: 500; font-size: 13px; }
.ed-rt { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.ed-tr { top: 13px; right: 16px; text-align: right; line-height: 1.55; }
.ed-tr b { color: var(--dm-ink); font-weight: 600; }
.ed-tr .zero { color: var(--llm-ink); font-weight: 600; }
.ed-toggle { position: absolute; left: 14px; bottom: 16px; width: 30px; height: 30px; background: rgba(255, 255, 255, .9); }
.ed-progress { position: absolute; left: 56px; right: 16px; bottom: 29px; height: 3px; border-radius: 3px; background: var(--hair); }
.ed-progress i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--dm-ink); }
.ed-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 12px 4px 0; font-size: 13px; color: var(--muted); }
.ed-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg { display: inline-block; }
.lg-stored { width: 18px; height: 0; border-top: 2px dashed #8a93a3; }
.lg-edited { width: 18px; height: 3px; border-radius: 2px; background: var(--dm); }
.lg-cp { width: 9px; height: 9px; border-radius: 50%; background: #fff; border: 2px solid var(--dm-ink); }
.lg-reedit { width: 9px; height: 9px; transform: rotate(45deg); background: var(--dm); border: 1.5px solid #fff; box-shadow: 0 0 0 1px var(--dm-ink); }
.edit-text h2 { margin-top: 2px; }
/* where the demo sits in the figure: a small copy of it, all but the DM's two panels veiled, and a zoom to the demo */
.edit-demo-card { position: relative; }
.ed-where {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 58%) minmax(0, 1fr); gap: 18px;
  align-items: center; margin-bottom: 34px; color: var(--muted); text-decoration: none;
}
.ed-where:hover { text-decoration: none; }
.ed-where-fig {
  display: block; padding: 6px 8px; border: 1px solid var(--hair); border-radius: 10px; background: var(--surface);
  box-shadow: var(--shadow); transition: border-color .2s ease;
}
.ed-where:hover .ed-where-fig { border-color: var(--dm); }
.ed-where-fig svg { display: block; width: 100%; height: auto; }
.ed-where-fig .ew-veil { fill: #ffffff; fill-opacity: .7; }
.ed-where-fig .ew-hl { fill: none; stroke: var(--dm-ink); stroke-width: 1.3; }
.ed-where-note { font-size: 13.5px; line-height: 1.45; }
.ed-where-note b { color: var(--ink-2); font-weight: 650; }
.ed-zoom { position: absolute; left: 0; top: 0; z-index: 2; overflow: visible; pointer-events: none; }
.ed-zoom .ez-fill { fill: var(--dm); fill-opacity: .07; }
.ed-zoom .ez-line { fill: none; stroke: var(--dm-ink); stroke-width: 1.2; stroke-dasharray: 4 4; stroke-linecap: round; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 26px; }
.fact { padding: 14px 14px 12px; border-radius: 12px; border: 1px solid var(--hair); background: var(--bg-soft); }
.fact b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.fact span { display: block; margin-top: 2px; font-size: 13px; line-height: 1.35; color: var(--muted); }
.fact:nth-child(1) b { color: var(--dm-ink); }
.fact:nth-child(3) b { color: var(--llm-ink); }


/* ════════ simulation: the HUD, embedded ════════ */
.hud-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 18px; margin-top: 34px; align-items: start; }
.hud-rail {
  position: sticky; top: calc(var(--topbar) + 16px);
  border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  padding: 10px; max-height: calc(100vh - var(--topbar) - 32px); overflow: auto;
}
.hud-group + .hud-group { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--hair); }
.hud-group-h { display: flex; align-items: baseline; gap: 8px; padding: 6px 8px 4px; }
.hud-group-h b { font-size: 12px; font-weight: 700; letter-spacing: .12em; color: var(--ink); }
.hud-group-h span { font-size: 11.5px; color: var(--muted); line-height: 1.3; }
.hud-task {
  display: flex; align-items: baseline; gap: 9px; width: 100%; text-align: left; cursor: pointer;
  padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2);
  transition: background-color .15s ease, color .15s ease;
}
.hud-task:hover { background: var(--bg-soft); color: var(--ink); }
.hud-task .code { flex: none; width: 22px; font: 500 12px var(--mono); color: var(--faint); }
.hud-task .nm { font-size: 14px; font-weight: 550; line-height: 1.3; }
.hud-task[aria-current="true"] { background: var(--dm-soft); color: var(--ink); }
.hud-task[aria-current="true"] .code { color: var(--dm-ink); }
.hud-shell {
  min-width: 0; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--hair-2); background: #f6f7f9; box-shadow: var(--shadow-lg);
}
.hud-bar {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 7px 10px 7px 16px;
  background: var(--surface); border-bottom: 1px solid var(--hair);
}
.hud-dots { display: inline-flex; gap: 6px; flex: none; }
.hud-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--hair-2); }
.hud-meta { display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 1; overflow: hidden; }
.hud-code { flex: none; font-size: 12.5px; color: var(--dm-ink); font-weight: 500; }
.hud-name { flex: none; font-size: 15px; font-weight: 650; }
.hud-what { min-width: 0; font-size: 13.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-btn {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; cursor: pointer;
  border: 1px solid var(--hair-2); border-radius: 8px; background: var(--surface); color: var(--ink-2);
  font-size: 13px; font-weight: 550;
}
.hud-btn:hover { color: var(--ink); border-color: var(--ink-2); text-decoration: none; }
.hud-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.hud-view { position: relative; width: 100%; overflow: hidden; background: #f6f7f9 center top / cover no-repeat; }
.hud-scaler { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
.hud-scaler iframe { display: block; border: 0; background: #f6f7f9; }
.hud-loading {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(246, 247, 249, .55); color: var(--ink-2); font-size: 14px; font-weight: 550;
  transition: opacity .4s ease;
}
.hud-loading.gone { opacity: 0; pointer-events: none; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--hair-2); border-top-color: var(--dm-ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hud-cover {
  position: absolute; inset: 0; border: 0; padding: 0; cursor: pointer; background: transparent;
  display: flex; align-items: flex-end; justify-content: center;
}
.hud-cover-pill {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18%;
  padding: 9px 16px; border-radius: 999px; background: rgba(21, 23, 26, .78); color: #fff;
  font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px -10px rgba(0, 0, 0, .45);
  opacity: 0; transform: translateY(6px); transition: opacity .25s ease, transform .25s ease;
}
.hud-cover-pill svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linejoin: round; }
.hud-cover:hover .hud-cover-pill, .hud-cover:focus-visible .hud-cover-pill { opacity: 1; transform: none; }
.hud-cover.gone { display: none; }
.hud-small { display: none; }
/* full screen: the HUD at its own size, the page's bar on top */
.hud-shell:fullscreen { display: flex; flex-direction: column; border-radius: 0; border: 0; }
.hud-shell:fullscreen .hud-view { flex: 1; height: auto !important; }
.hud-shell:fullscreen .hud-scaler { position: absolute; inset: 0; transform: none !important; }
.hud-shell:fullscreen .hud-scaler iframe { width: 100% !important; height: 100% !important; }


/* ════════ footer ════════ */
.footer { padding: 40px 0 48px; border-top: 1px solid var(--hair); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.footer-brand { display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.footer-legal { margin: 0; font-size: 13px; color: var(--muted); }
.footer-legal a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }


/* ════════ PDF viewer (from the template) ════════ */
.pdf-overlay { position: fixed; inset: 0; z-index: 100; display: none; flex-direction: column; background: rgba(15, 17, 20, .78); opacity: 0; transition: opacity .25s ease; }
.pdf-overlay.active { display: flex; }
.pdf-overlay.show { opacity: 1; }
.pdf-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; background: #15171a; color: #fff; }
.pdf-title { font-weight: 600; }
.pdf-toolbar-actions { display: flex; gap: 8px; }
.pdf-toolbar-btn { color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18); border-radius: 8px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.pdf-viewer-frame { flex: 1; width: 100%; border: 0; background: #fff; }


/* ════════ the three task groups (above the HUD), like the episodes of a game ════════ */
.groups { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; max-width: 1240px; margin: 34px auto 0; }
.gcard {
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.gcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gc-art { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: #e9e9e4; }
.gc-art video { width: 100%; height: 100%; object-fit: cover; cursor: pointer; transition: transform .6s ease; }
.gcard:hover .gc-art video { transform: scale(1.03); }
/* the task on screen in the card's clip (static/js/groups.js) */
.gc-now {
  position: absolute; right: 12px; bottom: 14px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  max-width: calc(100% - 150px); padding: 3px 10px 3px 4px; border-radius: 999px; background: rgba(10, 12, 14, .5);
  color: #fff; font: 600 12px/1.4 var(--sans); white-space: nowrap; pointer-events: none;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  opacity: 0; transform: translateY(3px); transition: opacity .25s ease, transform .25s ease;
}
.gc-now.on { opacity: 1; transform: none; }
.gc-now .code { flex: none; padding: 0 6px; border-radius: 999px; background: #fff; color: var(--ink); font: 600 11px/1.5 var(--mono); }
.gc-now .x { margin-left: 1px; font: 600 11px var(--mono); color: var(--sprout); }
.gc-art::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 12, 14, 0) 46%, rgba(10, 12, 14, .64) 100%);
}
.gc-name {
  position: absolute; left: 18px; bottom: 15px; z-index: 1; color: #fff;
  font: 800 30px/1 var(--sans); letter-spacing: .05em; text-shadow: 0 2px 14px rgba(0, 0, 0, .3);
}
.gc-stats { position: absolute; top: 12px; right: 12px; z-index: 1; display: flex; gap: 6px; }
.gc-stats span {
  padding: 3px 9px; border-radius: 999px; background: rgba(255, 255, 255, .9); color: var(--ink);
  font: 600 11.5px/1.4 var(--sans);
}
.gc-body { display: flex; flex-direction: column; gap: 10px; flex: 1; padding: 18px 20px 20px; }
.gc-tag { margin: 0; font: 700 16.5px/1.35 var(--sans); color: var(--ink); }
.gc-text { margin: 0; font: 400 15.5px/1.6 var(--serif); color: var(--ink-2); }
.gc-change { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); }
.gc-change b {
  display: inline-block; margin-right: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted);
}
.gc-tasks { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.gc-task {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 5px; cursor: pointer;
  border: 1px solid var(--hair-2); border-radius: 999px; background: var(--surface);
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: border-color .15s ease, color .15s ease;
}
.gc-task .code { padding: 1px 6px; border-radius: 999px; background: var(--bg-soft); font: 600 11px/1.5 var(--mono); color: var(--ink); transition: background-color .15s ease; }
.gc-task:hover { border-color: var(--ink-2); color: var(--ink); }
.gc-task:hover .code { background: var(--sprout-soft); }
.gc-task.is-on { border-color: var(--ink-2); color: var(--ink); }
.gc-task.is-on .code { background: var(--sprout-soft); }
.gc-task.is-off, .gc-task.is-off:hover { cursor: default; border-style: dashed; border-color: var(--hair-2); color: var(--faint); }
.gc-task.is-off .code { background: var(--bg-soft); color: var(--faint); }
.hud-intro { margin-top: 46px !important; }

/* no privileged information: the line under the task-group cards */
.no-priv {
  display: flex; align-items: flex-start; gap: 12px; max-width: 1240px; margin: 22px auto 0; padding: 14px 18px;
  border: 1px solid #bfe8df; border-radius: 12px; background: var(--dm-soft); color: #0b5d55;
  font-size: 15px; line-height: 1.55;
}
.no-priv svg { flex: none; width: 22px; height: 22px; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.no-priv b { color: #064e47; }


/* ════════ results: each finding is a takeaway, its chart, then a short explanation (charts by static/js/results.js) ════════ */
.r-block { margin: 58px 0 0; }
.r-kicker { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
.r-h { margin: 8px 0 0; font: 700 clamp(20px, 2.1vw, 24px)/1.3 var(--sans); letter-spacing: -.01em; color: var(--ink); }
.r-p { margin: 12px 0 0; font: 400 18px/1.65 var(--serif); color: var(--ink-2); }
.r-p em { font-style: italic; color: var(--ink); }
/* the key sentences of a takeaway: darker, on Sprout's yellow, as if marked with a highlighter */
.r-p b {
  font-weight: 600; color: var(--ink); padding: 0 .06em;
  background: linear-gradient(transparent 60%, var(--sprout-soft) 60%, var(--sprout-soft) 94%, transparent 94%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.r-nodata .r-card { display: none; }
.r-block .r-card { margin-top: 20px; }
.r-card + .r-p { margin-top: 22px; }

.r-card {
  position: relative; margin: 26px 0 0; padding: 20px 22px 16px;
  border: 1px solid var(--hair); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow);
}
.cc-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 18px; }
.cc-title { min-width: 0; flex: 1 1 320px; }
.cc-title h4 { margin: 0; font: 700 16px/1.3 var(--sans); color: var(--ink); }
.cc-sub { margin: 3px 0 0; font-size: 13px; line-height: 1.5; color: var(--muted); }
.cc-ctrl { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cc-tablebtn {
  padding: 5px 11px; border: 1px solid var(--hair-2); border-radius: 8px; background: var(--surface); cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
}
.cc-tablebtn:hover { border-color: var(--ink-2); color: var(--ink); }
.cc-tablebtn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 12px 0 2px; font-size: 12.5px; color: var(--ink-2); }
.legend-row:empty { display: none; }
.legend-row span { display: inline-flex; align-items: center; gap: 6px; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
.legend-row i.line { width: 14px; height: 3px; border-radius: 2px; }
.legend-row.spacer { visibility: hidden; }
.cc-body { position: relative; margin-top: 8px; }
.cc-body svg { display: block; overflow: visible; }
.cc-cap { margin-top: 12px; font-size: 13px; line-height: 1.55; color: var(--muted); }
.cc-cap:empty { display: none; }
.cc-table { margin-top: 12px; overflow-x: auto; }
.cc-table > div + div { margin-top: 14px; }
.cc-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cc-table th, .cc-table td { padding: 6px 10px; border-bottom: 1px solid var(--hair); text-align: left; }
.cc-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cc-table thead th { font-weight: 650; color: var(--ink); border-bottom-color: var(--hair-2); }
.cc-table tr.grp td { font-weight: 650; color: var(--ink); background: var(--bg-soft); }
.cc-table tr.sum td { font-weight: 600; color: var(--ink); }
.cc-table tr.all td { border-top: 1px solid var(--hair-2); }

.r-panels { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 26px 40px; margin-top: 6px; }
.r-panels .r-panel.wide { grid-column: 1 / -1; }
.r-panels.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-t { font-size: 13px; font-weight: 650; color: var(--ink); }
.r-panel .legend-row { margin: 6px 0 10px; }
.rp-svg { min-width: 0; }

.r-card svg text { font-family: var(--sans); }
.r-card .ax { font-size: 11.5px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.r-card .ax-t { font-size: 12px; fill: var(--muted); }
.r-card .hd {
  font-size: 10.5px; font-weight: 700; letter-spacing: .1em; fill: var(--faint);
  paint-order: stroke; stroke: #fff; stroke-width: 5px; stroke-linejoin: round;   /* a halo over the gridlines */
}
.r-card .lb { font-size: 13.5px; font-weight: 600; fill: var(--ink-2); }
.r-card .lb.strong { font-weight: 700; fill: var(--ink); }
.r-card .lb-sub { font-size: 11.5px; fill: var(--muted); }
.r-card .lb-end { font-size: 12px; font-weight: 600; fill: var(--ink-2); }
.r-card .vl { font-size: 14px; font-weight: 650; fill: var(--ink-2); }
.r-card .vl.strong { font-weight: 750; fill: var(--ink); }
.r-card .vl-sub { font-size: 12px; fill: var(--muted); }
.r-card .vl-col { font-size: 12px; font-weight: 700; fill: var(--ink); }
.r-card .vl-s { font-size: 11.5px; fill: var(--ink-2); font-variant-numeric: tabular-nums; }
.r-card .vl-s.strong { font-weight: 700; fill: var(--ink); }
.r-card .in-bar { font-size: 12px; font-weight: 700; fill: #fff; }
.r-card .grid { stroke: #ecebe4; stroke-width: 1; }
.r-card .base { stroke: #cfcec6; stroke-width: 1; }
.r-card .whisker line { stroke: var(--ink); stroke-width: 1.25; stroke-opacity: .5; }
.r-card .band { fill: rgba(204, 120, 20, .08); }
.r-card .band-l { font-size: 11px; font-weight: 600; fill: #9a5a0e; }
.r-card .cross { stroke: var(--ink-2); stroke-width: 1; opacity: 0; transition: opacity .12s ease; }
.r-card .cross.on { opacity: .45; }
.r-card .hit { cursor: default; outline: none; }
.r-card .hit .bar { transition: filter .15s ease; }
.r-card .hit.hot .bar { filter: brightness(1.12) saturate(1.06); }
.r-card .hit:focus-visible .bar { stroke: var(--ink); stroke-width: 1.5; }

.tip {
  position: absolute; z-index: 5; min-width: 130px; max-width: 290px; padding: 8px 11px; pointer-events: none;
  border: 1px solid var(--hair); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(21, 23, 26, .14);
  font-size: 12.5px; line-height: 1.45; color: var(--ink-2); opacity: 0; transform: translateY(2px);
  transition: opacity .12s ease, transform .12s ease;
}
.tip.on { opacity: 1; transform: none; }
.tip .tt-h { margin-bottom: 3px; font-weight: 650; color: var(--ink); }
.tip .tt-r { display: flex; align-items: center; gap: 7px; }
.tip .tt-r i { flex: none; width: 12px; height: 3px; border-radius: 2px; }
.tip .tt-r b { font: 700 14.5px/1.35 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }

/* the reveal (as on MeMoREval's page): marks wait until the chart is in view, then grow from the baseline */
.r-card .mk { transform-box: fill-box; }
.r-card .mk.gx { transform-origin: 0% 50%; }
.r-card .mk.gy { transform-origin: 50% 100%; }
.r-card .mk.pop { transform-origin: 50% 50%; }
.r-wait .mk, .r-wait .vl { opacity: 0; }
.r-play .mk.gx { animation: r-gx .8s cubic-bezier(.2, .8, .2, 1) both; }
.r-play .mk.gy { animation: r-gy .8s cubic-bezier(.2, .8, .2, 1) both; }
.r-play .mk.pop { animation: r-pop .45s cubic-bezier(.2, .9, .3, 1.3) both; }
.r-play .mk.fade { animation: r-fade .45s ease-out both; }
.r-play .mk.draw { animation: r-draw 1.1s cubic-bezier(.45, 0, .2, 1) both; }
.r-still .mk { animation: none !important; }
@keyframes r-gx { from { transform: scaleX(0); } to { transform: none; } }
@keyframes r-gy { from { transform: scaleY(0); } to { transform: none; } }
@keyframes r-pop { from { opacity: 0; transform: scale(.2); } to { opacity: 1; transform: none; } }
@keyframes r-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes r-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }

/* citation */
.cite-card {
  max-width: 760px; margin: 22px auto 0; padding: 26px 24px; text-align: center;
  border: 1px dashed var(--hair-2); border-radius: var(--radius); background: var(--surface);
}
.cite-soon { display: inline-block; padding: 6px 15px; border-radius: 999px; background: var(--sprout-soft); color: var(--ink); font: 700 15px/1.3 var(--sans); }
.cite-card p { margin: 10px 0 0; font-size: 14px; color: var(--muted); }


/* ════════ narrow screens ════════ */
@media (max-width: 1100px) {
  .sub-one-line { white-space: normal; max-width: 780px; }
  .groups { grid-template-columns: minmax(0, 1fr); max-width: 640px; }
  .edit-grid { grid-template-columns: minmax(0, 1fr); gap: 34px; }
  .hud-layout { grid-template-columns: minmax(0, 1fr); }
  .hud-rail { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 8px; }
  .hud-group { display: flex; gap: 4px; align-items: center; flex: none; }
  .hud-group + .hud-group { margin: 0; padding: 0 0 0 8px; border-top: 0; border-left: 1px solid var(--hair); }
  .hud-group-h span { display: none; }
  .hud-task { width: auto; white-space: nowrap; }
}
@media (max-width: 760px) {
  .r-panels, .r-panels.two { grid-template-columns: minmax(0, 1fr); }
  .r-card { padding: 16px 14px 14px; }
  .reel-video { border-radius: 12px; }
  .reel-bar { gap: 6px 14px; }
  .reel:not(.reel-sim) .reel-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .reel-sim { margin-top: 22px; }
  .reel-sim .reel-speed { top: 10px; right: 10px; gap: 5px; padding: 2px 10px 2px 9px; font-size: 13px; }
  .reel-sim .reel-speed svg { width: 9px; height: 9px; }
  .reel-sim .reel-speed.is-fast svg { width: 13px; }
  .reel-task { left: 10px; top: 10px; gap: 6px; padding: 2px 10px 2px 3px; font-size: 12.5px; max-width: calc(100% - 96px); }
  .reel-task .code { padding: 0 6px; font-size: 11px; }
  .reel-ch-label { font-size: 13.5px; }
  .reel-toggle { left: 10px; bottom: 10px; width: 34px; height: 34px; }
  .reel-speed { display: inline-flex; }
  .role { grid-template-columns: minmax(0, 1fr); padding: 12px 14px; }
  .role p { font-size: 15.5px; }
  .role-terms li { grid-template-columns: minmax(0, 1fr); gap: 1px; }
  .role-lead { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .role-what br { display: none; }
  .ed-where { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 30px; }
  .ed-where-fig { width: 78%; }
  .ed-where-note { order: -1; }   /* above the small figure, so that the zoom does not cross it */
}
@media (max-width: 860px) {
  .toplinks { display: none; }
  .showcase { grid-template-columns: minmax(0, 1fr); }
  .sc-rail { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--hair); }
  .sc-item { flex: none; width: 200px; border-bottom: 0; border-right: 1px solid var(--hair); padding: 14px 16px; }
  .sc-item::before { left: 0; right: 0; top: auto; bottom: 0; width: auto; height: 3px; }
  .sc-stage { padding: 18px 16px; }
  .vbadge { top: 10px; left: 10px; gap: 6px; padding: 4px 11px 4px 10px; }
  .vbadge svg { width: 11px; height: 11px; }
  .vbadge.is-fast svg { width: 16px; }
  .vb-speed { font-size: 17px; }
  .vb-len { font-size: 11.5px; }
  .steps button { font-size: 0; }
  .steps .n { font-size: 12px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .hud-view .hud-scaler, .hud-view .hud-cover, .hud-view .hud-loading { display: none; }
  .hud-small {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    position: absolute; inset: 0; padding: 20px; text-align: center; background: rgba(246, 247, 249, .82);
  }
  .hud-small p { margin: 0; font-weight: 600; color: var(--ink-2); }
  .hud-btn span { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fade-in { opacity: 1; transform: none; transition: none; }
}
