/* MeMoREval project site. Palette follows dexmate_report.cls:
   DexmateBlack #0A0A0A, Mint #0B4B3F, Green (lime) #C7F466, Sage #E8ECDE,
   Beige #F7F2E8, Gray #626262. Headings in Inter, body prose in a serif. */

:root {
  --black: #0a0a0a;
  --mint: #0b4b3f;
  --lime: #c7f466;
  --sage: #e8ecde;
  --beige: #f7f2e8;
  --gray: #626262;

  --bg: #ffffff;
  --surface: #ffffff;
  --ink: var(--black);
  --ink-2: #333331;
  --muted: var(--gray);
  --hair: #e4e4dc;
  --hair-2: #cdcdc3;
  --track: #dcdcd3;

  --exp: var(--mint);
  --exp-fill: var(--sage);
  --req-fill: var(--beige);
  --act: var(--black);
  --write: var(--mint);
  --write-fill: #dcebe5;
  --read-line: var(--black);
  --read-fill: #f0fad6;
  --ok: var(--mint);
  --no: var(--gray);
  --miss-fill: #fcebe7; --miss-line: #cf5a45; --miss-ink: #8f2a1a;
  --accent: var(--mint);

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

  --shadow: 0 1px 2px rgba(10, 10, 10, .04), 0 8px 28px rgba(10, 10, 10, .06);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1110; --surface: #161917; --ink: #eceee8; --ink-2: #c9ccc4; --muted: #9a9d96;
    --hair: #2a2e2b; --hair-2: #3a3f3b; --track: #333834;
    --sage: #1e2620; --beige: #25221c;
    --exp: #7fcbb4; --exp-fill: var(--sage); --req-fill: var(--beige);
    --act: #eceee8; --write: #7fcbb4; --write-fill: #17302a;
    --read-line: var(--lime); --read-fill: #2a3317; --ok: #9fe0c9; --no: #9a9d96; --accent: #9fe0c9;
    --miss-fill: #3a211c; --miss-line: #e27a64; --miss-ink: #f3b1a2;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1110; --surface: #161917; --ink: #eceee8; --ink-2: #c9ccc4; --muted: #9a9d96;
  --hair: #2a2e2b; --hair-2: #3a3f3b; --track: #333834;
  --sage: #1e2620; --beige: #25221c;
  --exp: #7fcbb4; --exp-fill: var(--sage); --req-fill: var(--beige);
  --act: #eceee8; --write: #7fcbb4; --write-fill: #17302a;
  --read-line: var(--lime); --read-fill: #2a3317; --ok: #9fe0c9; --no: #9a9d96; --accent: #9fe0c9;
  --miss-fill: #3a211c; --miss-line: #e27a64; --miss-ink: #f3b1a2;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.6 var(--sans); -webkit-font-smoothing: antialiased; }
img, video { display: block; max-width: 100%; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
q { quotes: "\201C" "\201D"; }

.wrap { width: min(1200px, 100% - 32px); margin: 0 auto; }
.prose { max-width: 760px; font: 18px/1.62 var(--serif); color: var(--ink-2); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--hair);
}
.topbar .wrap { display: flex; align-items: center; gap: 24px; height: 54px; }
.wordmark { font: 800 18px/1 var(--sans); letter-spacing: -.01em; text-decoration: none; color: var(--ink); }
.wordmark .c { color: var(--accent); }
.topnav { display: flex; gap: 20px; margin-left: auto; font-size: 14px; }
.topnav a { text-decoration: none; color: var(--ink-2); }
.topnav a:hover { color: var(--accent); }
.topnav a { white-space: nowrap; }

/* ---------- hero (mirrors the report's title panel) ---------- */
.hero { padding: 28px 0 0; }
.title-panel {
  /* same width as the reading column, so the panel's edges line up with the text below */
  max-width: 1060px; margin: 0 auto; container-type: inline-size;
  background: var(--sage); border-radius: 14px;
  padding: clamp(18px, 2.4vw, 30px) clamp(18px, 2.6vw, 32px) clamp(18px, 2.2vw, 26px);
}
.title-panel h1 { font: 800 clamp(28px, 4.1vw, 48px)/1.08 var(--sans); letter-spacing: -.02em; margin: 0 0 12px; }
/* the question gets a line of its own, as on the report's title page, sized to span the panel exactly */
.title-panel h1 .q { display: block; }
@media (min-width: 761px) {
  .title-panel h1 .q { white-space: nowrap; }
  @supports (container-type: inline-size) { .title-panel h1 { font-size: calc(100cqi / 20.76); } }
}
.authors { display: flex; flex-wrap: wrap; gap: 2px 16px; font-weight: 700; font-size: 15px; }
.authors sup { font-weight: 600; font-size: 10px; margin-left: 1px; }
.authors a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
.authors a:hover, .authors a:focus-visible { text-decoration: underline; }
.affil { margin-top: 6px; font-size: 13px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 2px 14px; }
.affil sup { font-size: 9px; }
.tldr { font: 18px/1.55 var(--serif); margin: 16px 0 0; color: var(--ink-2); }
.panel-foot { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-top: 18px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 15px; border-radius: 999px;
  border: 1.5px solid var(--ink); font-size: 14px; font-weight: 600; text-decoration: none; color: var(--ink);
}
.btn.soon { border-style: dashed; color: var(--muted); border-color: var(--hair-2); cursor: default; }
.dex { height: 26px; width: auto; }

/* ---------- walkthrough ---------- */
.wt-section { padding: 18px 0 8px; }
.wt {
  --stage: clamp(300px, min(calc(100svh - 318px), 44vw), 530px);
  position: relative; margin: 0; scroll-margin-top: 62px;
  padding: 14px 16px 14px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 16px; box-shadow: var(--shadow);
  outline: none;
}
.wt:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wt-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 20px; margin-bottom: 10px; }
.wt-title { font: 700 17px/1.3 var(--sans); margin: 0; letter-spacing: -.005em; }
.wt-illus { display: flex; align-items: center; gap: 8px; font-size: 12.5px; line-height: 1.35; color: var(--muted); white-space: nowrap; }
.pill {
  display: inline-block; flex: none; padding: 1px 8px; border-radius: 999px;
  font: 700 10px/1.6 var(--sans); letter-spacing: .07em; text-transform: uppercase; border: 1px solid currentColor;
}
.wt-illus .pill { background: var(--lime); border-color: var(--lime); color: #0a0a0a; }

.wt-main { display: grid; grid-template-columns: var(--stage) minmax(0, 1fr); gap: 14px; }

/* the square screen */
.wt-screen { position: relative; width: var(--stage); height: var(--stage); container-type: size; }
.wt-video { position: absolute; inset: 0; overflow: hidden; border-radius: 10px; background: #0d0d0d; }
.wt-video video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .35s, filter .45s; }
.wt-video video.off { opacity: 0; }
.wt-video.dim video { filter: brightness(.35) saturate(.5); }
.wt-tag {
  position: absolute; right: 10px; top: 10px; z-index: 3; padding: 4px 10px; border-radius: 999px;
  font: 700 10.5px/1.4 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: #fff; background: #0b4b3f;
}
.wt-tag[data-phase="req"], .wt-tag[data-phase="out"] { background: #0a0a0a; }
.wt-tag[data-phase="text"], .wt-tag[data-phase="desc"], .wt-tag[data-phase="image"] { background: #c7f466; color: #0a0a0a; }

.bubble {
  position: absolute; z-index: 3; left: 6%; top: 6%; max-width: 74%;
  padding: 9px 14px 10px; border-radius: 12px; background: #fff; color: #0a0a0a;
  font: italic 500 clamp(13px, 3.1cqw, 17px)/1.35 var(--serif);
  box-shadow: 0 4px 18px rgba(0, 0, 0, .28);
  opacity: 0; transform: translateY(6px) scale(.97); transform-origin: 10% 100%;
  transition: opacity .35s, transform .35s; pointer-events: none;
}
.bubble::after { content: ""; position: absolute; left: 16px; bottom: -9px; border: 9px solid transparent; border-bottom: 0; border-left: 0; border-top-color: #fff; }
.bubble.on { opacity: 1; transform: none; }
.bubble .who { display: block; font: 700 10px/1.4 var(--sans); letter-spacing: .07em; text-transform: uppercase; color: #626262; font-style: normal; margin-bottom: 2px; }

/* evidence overlay: what the agent is reading */
.evidence { position: absolute; inset: 0; z-index: 2; display: flex; justify-content: center; pointer-events: none; }
.ev-card {
  position: absolute; top: 12cqh; width: 90cqw; max-height: 80cqh;
  background: var(--surface); color: var(--ink); border: 2px solid var(--lime); border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .45); display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; transform: translateY(14px) scale(.98); transition: opacity .4s, transform .45s cubic-bezier(.2, .8, .2, 1);
}
.ev-card.on { opacity: 1; transform: none; }
.ev-card.image { top: 14cqh; }
.ev-h { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--hair); font: 700 12px/1.4 var(--sans); color: #0a0a0a; background: var(--lime); }
.ev-h svg { width: 14px; height: 14px; flex: none; }
.ev-h .src { margin-left: auto; min-width: 0; font: 500 11px/1.4 var(--mono); color: #2f3a12; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-body { padding: 10px 12px; overflow: hidden; }
.ev-lines { margin: 0; padding: 0; list-style: none; font: clamp(10px, 2.05cqw, 12px)/1.5 var(--mono); color: var(--ink-2); }
.ev-lines li { display: grid; grid-template-columns: 50px 1fr; gap: 6px; padding: 2px 0; }
.ev-lines .st, .ev-desc .st { color: var(--muted); font: 500 11px/1.5 var(--mono); }
.ev-desc { margin: 0 0 8px; font: italic clamp(12.5px, 2.75cqw, 15px)/1.45 var(--serif); color: var(--ink-2); }
.ev-desc .st { display: block; font-style: normal; }
.ev-more { font-size: 12px; color: var(--muted); }
mark { background: var(--read-fill); color: inherit; border-radius: 3px; padding: 0 2px; box-shadow: inset 0 -2px 0 var(--lime); }
.ev-img { position: relative; line-height: 0; }
.ev-img svg { display: block; width: 100%; height: 100%; }
.ev-verdict { display: flex; gap: 8px; align-items: baseline; padding: 8px 12px; border-top: 1px solid var(--hair); font-size: 13px; line-height: 1.4; opacity: 0; transition: opacity .35s; }
.ev-verdict.on { opacity: 1; }
.ev-verdict .mk { font-weight: 800; flex: none; }
/* a modality that lacks the answer: red-tinted verdict */
.ev-verdict.no { background: var(--miss-fill); color: var(--miss-ink); box-shadow: inset 3px 0 0 var(--miss-line); }
.ev-verdict.no .mk { color: var(--miss-line); }
.ev-verdict.ok { background: var(--read-fill); }
.ev-verdict.ok .mk { color: var(--ok); }

/* memory table: steps run left to right, one row per modality */
.mem {
  position: relative; height: var(--stage); min-width: 0;
  display: grid;
  grid-template-columns: 78px repeat(5, minmax(0, 1fr));
  grid-template-rows: auto 14px repeat(4, minmax(0, 1fr));
  column-gap: 6px; row-gap: 6px;
  background: var(--sage); border-radius: 10px; padding: 8px;
}
.mh { font: 700 11px/1.25 var(--sans); color: var(--ink); min-width: 0; }
.mh.act { align-self: center; }
.mh small { display: block; font-weight: 500; font-size: 10px; line-height: 1.3; color: var(--muted); margin-top: 2px; }
.mh.call small { color: var(--write); font-weight: 700; }
.mh.rl { align-self: stretch; display: flex; flex-direction: column; justify-content: center; padding: 4px 6px 4px 4px; border-radius: 7px; transition: background .3s, box-shadow .3s; }
.mh.rl .nm { display: block; margin-top: 4px; }
.mh.rl.read { background: var(--lime); box-shadow: 0 0 0 2px var(--lime); color: #0a0a0a; }
.mh.rl.read small { color: #2f3a12; }
.mh.rl.read .ic { background: #fff; color: #0a0a0a; border-color: rgba(0, 0, 0, .25); }
.mh .ic { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 4px; border: 1px solid var(--hair-2); background: var(--surface); color: var(--ink-2); }
.mh .ic svg { width: 11px; height: 11px; }

.chip {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 7px; border-radius: 7px; border: 1.5px solid var(--act); background: var(--surface);
  font: 500 11px/1.3 var(--mono); color: var(--ink); min-width: 0;
}
.chip .n { flex: none; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font: 800 10px/1 var(--sans); background: var(--act); color: var(--bg); }
.chip .t { min-width: 0; }
.chip .prog { position: absolute; left: 0; bottom: 0; height: 3px; width: 0; background: var(--exp); }
.chip.future { border-style: dashed; border-color: var(--hair-2); color: var(--muted); background: transparent; }
.chip.future .n { background: var(--hair-2); color: var(--surface); }
.chip.active { border-color: var(--exp); box-shadow: 0 0 0 2px color-mix(in srgb, var(--exp) 25%, transparent); }
.chip.active .n { background: var(--exp); }
.mem .chip { align-self: stretch; width: 100%; padding: 4px 5px; gap: 5px; font-size: 10.5px; line-height: 1.25; }
.mem .chip .n { width: 16px; height: 16px; font-size: 9.5px; }

.wr { display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .3s; color: var(--write); }
.wr svg { width: 14px; height: 12px; transform: rotate(90deg); }
.wr.on { opacity: 1; }

.cell {
  position: relative; min-width: 0; min-height: 0; overflow: hidden;
  border: 1px dashed var(--hair-2); border-radius: 7px; padding: 5px 6px;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.cell > .in { height: 100%; opacity: 0; transform: translateY(-6px); transition: opacity .35s, transform .35s; }
.cell.stored { border-style: solid; border-color: var(--hair); background: var(--surface); }
.cell.stored > .in { opacity: 1; transform: none; }
.cell.fresh { border-color: var(--write); box-shadow: 0 0 0 3px color-mix(in srgb, var(--write) 22%, transparent); }
.cell.read { border-color: var(--lime); border-width: 1.5px; box-shadow: 0 0 0 3px var(--lime); background: var(--read-fill); }
.cell.used { border-color: var(--ink); border-width: 1.5px; box-shadow: 0 0 0 4px var(--lime); }
.cell > .in.c-text, .cell > .in.c-desc { height: auto; }
.c-text { font: 9.8px/1.4 var(--mono); color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 5); }
.c-desc { font: italic 11.3px/1.3 var(--serif); color: var(--ink-2); overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: var(--lines, 5); }
.cell.img { padding: 3px; display: flex; align-items: center; }
.cell.img .in { display: flex; align-items: center; width: 100%; }
.cell.img img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 4px; }
.cell .use { display: none; position: absolute; left: 6px; top: 6px; font: 700 9.5px/1.4 var(--sans); color: #0a0a0a; background: var(--lime); border-radius: 4px; padding: 0 4px; z-index: 1; }
.cell.used .use { display: block; }
.cell.graph { padding: 3px; display: flex; align-items: center; }
.cell.graph .in { display: flex; align-items: center; width: 100%; }
.cell.graph svg { width: 100%; height: auto; max-height: 100%; display: block; }
.g-node rect { fill: var(--surface); stroke: var(--hair-2); }
.g-node text { font: 500 9px var(--mono); fill: var(--ink-2); }
.g-node.parent rect { fill: var(--sage); stroke: var(--mint); }
.g-edge { stroke: var(--hair-2); stroke-width: 1; fill: none; }
.g-rel { font: italic 9px var(--serif); fill: var(--muted); }

/* controls: play + chapter bar (also the scrubber) */
.wt-controls { display: flex; align-items: center; gap: 12px; margin: 10px 0 8px; }
.play { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 0; background: var(--ink); color: var(--bg); display: grid; place-items: center; cursor: pointer; }
.play:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.play svg { width: 15px; height: 15px; }
.play .i-pause { display: none; }
.wt.playing .play .i-pause { display: block; }
.wt.playing .play .i-play { display: none; }
.chapters { display: flex; flex: 1; gap: 4px; min-width: 0; touch-action: none; cursor: pointer; padding: 8px 0 4px; margin: -4px 0; }
.chapters button { flex: 1 1 0; min-width: 0; cursor: pointer; border: 0; background: none; padding: 0; text-align: left; }
.chapters .bar { display: block; height: 6px; border-radius: 3px; background: var(--track); position: relative; overflow: hidden; }
.chapters .bar i { position: absolute; inset: 0 auto 0 0; width: 0; background: var(--c, var(--ink)); }
.chapters .nm { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chapters button[data-ph="exp"] { --c: var(--exp); }
.chapters button[data-ph="req"], .chapters button[data-ph="out"] { --c: var(--ink); }
.chapters button[data-ph="text"], .chapters button[data-ph="desc"], .chapters button[data-ph="image"] { --c: var(--c-frames, #6c9a1e); }
.chapters button.cur .nm { color: var(--ink); font-weight: 700; }
.chapters button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 3px; }
.ch-now { display: none; font-size: 12.5px; font-weight: 700; white-space: nowrap; }

/* agent strip: what happens at the request */
.agent {
  display: grid; grid-template-columns: minmax(200px, 1.25fr) minmax(0, 2.4fr) minmax(190px, 1.2fr); gap: 12px; align-items: stretch;
  background: var(--req-fill); border-radius: 10px; padding: 10px 12px;
}
.ag-h { display: flex; align-items: center; gap: 8px; font: 700 11px/1.4 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--ink); margin-bottom: 4px; }
.ag-h .pill { font-size: 9px; color: var(--ink-2); }
.ag-h .sub { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); }
.ag-wait { margin: 0; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.ag-q { display: block; font: italic 500 14.5px/1.35 var(--serif); }
/* waiting line and request share one cell, so the strip keeps its height when the request arrives */
.ag-req { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; }
.ag-wait, .ag-q { grid-row: 2; grid-column: 1; }
.agent:not(.asked) .ag-q { visibility: hidden; }
.agent.asked .ag-wait { visibility: hidden; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; align-items: stretch; }
.check {
  display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px;
  padding: 5px 8px; border-radius: 8px; border: 1px solid var(--hair); background: var(--surface);
  font-size: 12.5px; line-height: 1.3; transition: border-color .3s, background .3s, opacity .3s; opacity: .5;
}
.check .ic { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; border: 1px solid var(--hair-2); color: var(--ink-2); }
.check .ic svg { width: 14px; height: 14px; }
.check .lbl { min-width: 0; }
.check .lbl b { font-weight: 700; }
.check .lbl span { display: block; font-size: 11px; color: var(--muted); }
.check .st { font: 800 14px/1 var(--sans); }
.check.active { opacity: 1; border-color: var(--lime); background: var(--read-fill); box-shadow: 0 0 0 2px var(--lime); }
.check.done { opacity: 1; }
.check.done.no { border-color: var(--miss-line); background: var(--miss-fill); }
.check.done.no .st { color: var(--miss-line); }
.check.done.no .lbl span { color: var(--miss-ink); }
.check.done.ok { border-color: var(--ok); }
.check.done.ok .st { color: var(--ok); }
.ag-plan .plan-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.ag-plan .chip { width: 100%; font-size: 10.5px; padding: 3px 6px; gap: 5px; opacity: 0; transform: translateY(3px); transition: opacity .35s, transform .35s; }
.ag-plan .chip .n { width: 15px; height: 15px; font-size: 9px; }
.agent.planned .ag-plan .chip { opacity: 1; transform: none; }
.ag-plan .chip.active { border-color: var(--ink); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ink) 18%, transparent); }
.ag-plan .chip .prog { background: var(--ink); }
.ag-plan .chip.active .n { background: var(--ink); }

/* arcs from memory to the screen */
.wt-arcs { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 4; overflow: visible; }
.wt-arcs path.halo { fill: none; stroke: var(--lime); stroke-width: 3.5; opacity: .6; }
.wt-arcs path.line { fill: none; stroke: var(--read-line); stroke-width: 1.1; stroke-dasharray: 4 4; opacity: .8; animation: dash 1.1s linear infinite; }
.wt-arcs circle { fill: var(--lime); stroke: var(--read-line); stroke-width: 1.2; }
@keyframes dash { to { stroke-dashoffset: -18; } }

/* second real-robot task */
.demo2 { margin: 18px 0 0; }
.demo2-h { font: 700 14px/1.4 var(--sans); margin-bottom: 8px; }
.demo2-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.demo2 .clip video { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: #0d0d0d; }
.demo2 .clip p { margin: 6px 2px 0; font: 14px/1.45 var(--serif); color: var(--ink-2); }
.demo2 .clip p b { font-family: var(--sans); font-size: 12.5px; color: var(--ink); }
.demo2 .clip q { font-style: italic; }

/* ---------- sections ---------- */
section.block { padding: 52px 0; border-top: 1px solid var(--hair); margin-top: 40px; }
section.block + section.block { margin-top: 0; }
section.block h2 { font: 800 28px/1.15 var(--sans); margin: 0 0 14px; letter-spacing: -.015em; }
.todo { color: var(--muted); font-style: italic; }
footer { padding: 32px 0 56px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--hair); }

/* ---------- responsive ---------- */
@media (max-width: 1120px) {
  .wt { --stage: min(560px, calc(100vw - 66px)); }
  .wt-main { grid-template-columns: 1fr; justify-items: center; }
  .mem { width: 100%; height: auto; grid-template-rows: auto 14px repeat(4, minmax(96px, auto)); }
  .agent { grid-template-columns: 1fr; }
  .wt-arcs { display: none; }
}
@media (max-width: 760px) {
  .topnav { display: none; }
  .wt { padding: 12px; border-radius: 12px; }
  .wt-screen { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .ev-card { top: 42px; width: 95cqw; max-height: calc(100cqh - 50px); }
  .ev-card .ev-body { overflow: auto; }
  .ev-h { padding: 5px 10px; }
  .ev-body { padding: 8px 10px; }
  .ev-verdict { padding: 6px 10px; font-size: 12.5px; }
  .wt-main { justify-items: stretch; }
  .mem { overflow-x: auto; grid-template-columns: 72px repeat(5, minmax(104px, 1fr)); grid-template-rows: auto 14px repeat(4, minmax(110px, auto)); }
  .checks { grid-template-columns: 1fr; }
  .agent:not(.planned) .ag-plan { display: none; }
  .chapters .nm { display: none; }
  .ch-now { display: block; }
  .demo2-grid { grid-template-columns: 1fr; }
}
.wt.still *, .wt.still *::before, .wt.still *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- review fixes ---------- */
:root { --surface-2: #f5f5f1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --surface-2: #1d201e; } :root:not([data-theme="light"]) .dex { filter: invert(1) brightness(1.6); } }
:root[data-theme="dark"] { --surface-2: #1d201e; }
:root[data-theme="dark"] .dex { filter: invert(1) brightness(1.6); }
section.block { scroll-margin-top: 64px; }
.wt-speed {
  position: absolute; left: 10px; bottom: 10px; z-index: 3; padding: 2px 8px; border-radius: 999px;
  font: 600 11px/1.5 var(--sans); color: #fff; background: rgba(10, 10, 10, .62); opacity: 0; transition: opacity .25s;
}
.wt-speed.on { opacity: 1; }
.bubble { top: 48px; }
.wt-cap { margin: 8px 2px 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); }
.wt.failed .wt-main, .wt.failed .wt-controls, .wt.failed .agent { display: none; }
.clip-note { margin: 8px 2px 0; font-size: 12.5px; color: var(--muted); }
.demo2-h { font-size: 16px; }
.check:not(.active):not(.done) { opacity: 1; color: var(--muted); }
.check:not(.active):not(.done) .lbl b { color: var(--muted); }
.wt-illus span:last-child { overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1120px) { .wt-illus { white-space: normal; } }
@media (max-width: 760px) {
  .topnav { display: flex; margin-left: auto; min-width: 0; overflow-x: auto; gap: 14px; font-size: 13px; max-width: 62vw; padding-right: 28px; scrollbar-width: none;
    /* fade at the right edge signals that the links scroll sideways */
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
  .topnav::-webkit-scrollbar { display: none; }
  .agent:not(.planned) .ag-plan { display: block; visibility: hidden; }
  .mem .mh.rl { position: sticky; left: 0; z-index: 2; background: var(--sage); }
  .mem { -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
}

.ev-card.on { pointer-events: auto; }
@media (max-width: 1260px) and (min-width: 1121px) {
  .mem .chip { font-size: 10px; }
  .mem .chip .t { overflow-wrap: anywhere; }
}
@media (max-width: 760px) {
  .topnav { align-items: center; align-self: center; }
  .mem .mh.rl { margin-left: -8px; padding-left: 12px; }
  .mem .mh.rl.read { background: var(--lime); }
  .mem.end { -webkit-mask-image: none; mask-image: none; }
  .chapters { padding: 12px 0 8px; margin: -8px 0; }
}
