/* ReGAIN project page: aesthetic follows the visual_invariance page (white, warm ink, DM Serif/DM Sans, teal accent) */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #ffffff;
  --bg-soft:   #fafaf9;
  --paper:     #ffffff;
  --ink:       #1a1714;
  --ink-2:     #4a4540;
  --ink-3:     #7a746e;
  --accent:    #0e8a6d;
  --sea-glass: #3fb39a;
  --accent-lt: #dcf3ec;
  --hook-paint-deep:  #d4f5ea;
  --hook-paint-mid:   #e6faf3;
  --hook-paint-light: #f3fdf9;
  --rule:   rgba(26,23,20,.10);
  --rule-2: rgba(26,23,20,.22);

  /* the three acts, toned to the teal palette */
  --seen:      #2f6fd6;
  --seen-lt:   #e8f0fd;
  --forgot:    #e0533f;
  --forgot-lt: #fdebe8;
  --regain:    #0e8a6d;
  --regain-lt: #dcf3ec;
  --sand:      #f0a23b;

  --serif: 'DM Serif Display', Georgia, serif;
  --sans:  'DM Sans', system-ui, sans-serif;
  --mono:  ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  --r: 6px;
  --r-lg: 10px;
}

html { scroll-behavior: smooth; scroll-padding-top: 64px; font-size: 112.5%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent-lt); }
strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; }

.wrap      { max-width: 860px; margin: 0 auto; padding: 0 2rem; }
.wrap-wide { max-width: 1060px; margin: 0 auto; padding: 0 2rem; }
.center { text-align: center; }
.muted { color: var(--ink-3); }
.c-seen { color: var(--seen); } .c-forgot { color: var(--forgot); } .c-regain { color: var(--regain); }

/* ---------- hand-highlighter (from reference) ---------- */
.hl {
  display: inline;
  padding: 0.12em 0.38em 0.16em 0.28em;
  margin-inline: -0.12em;
  border-radius: 0.55em 0.14em 0.48em 0.22em / 0.28em 0.52em 0.2em 0.36em;
  background:
    linear-gradient(104deg, rgba(255,255,255,.55) 0%, transparent 42%),
    linear-gradient(196deg, transparent 0%, rgba(63,179,154,.04) 88%),
    linear-gradient(12deg, rgba(150,228,205,.28) 0%, transparent 55%),
    linear-gradient(168deg, var(--hook-paint-deep) 0%, var(--hook-paint-mid) 48%, var(--hook-paint-light) 100%);
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
  box-shadow: 0.04em 0.07em 0 0 rgba(63,179,154,.06), -0.06em 0.03em 0 0 rgba(255,255,255,.85),
              0.09em -0.04em 0 -0.03em rgba(160,232,210,.25), inset 0 -0.06em 0 0 rgba(63,179,154,.04);
}

/* ---------- top nav ---------- */
.topnav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  background: rgba(255,255,255,.9);
  backdrop-filter: saturate(1.3) blur(10px); -webkit-backdrop-filter: saturate(1.3) blur(10px);
  border-bottom: 1px solid var(--rule);
  transform: translateY(-100%); transition: transform .35s ease;
}
.topnav.show { transform: none; }
.topnav-inner { max-width: 1060px; margin: 0 auto; padding: .5rem 2rem; display: flex; align-items: center; gap: 1.5rem; }
.topnav-brand { font-family: var(--serif); font-size: 1.15rem; text-decoration: none; }
.topnav-brand b { font-weight: 400; font-style: italic; color: var(--accent); }
.topnav-links { display: flex; gap: .15rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topnav-links::-webkit-scrollbar { display: none; }
.topnav-links a { font-size: .74rem; font-weight: 500; color: var(--ink-3); text-decoration: none; padding: .28rem .65rem; border-radius: var(--r); white-space: nowrap; transition: all .18s; }
.topnav-links a:hover { color: var(--accent); background: var(--accent-lt); }
.topnav-links a.active { color: var(--accent); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--sea-glass); }

/* ---------- hero ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.anim { opacity: 0; animation: fadeUp .7s ease forwards; }
.anim-d1 { animation-delay: .10s; } .anim-d2 { animation-delay: .22s; } .anim-d3 { animation-delay: .34s; } .anim-d4 { animation-delay: .46s; }

.hero { padding: 5rem 2rem 3.5rem; text-align: center; }
h1.paper-title {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.18;
  max-width: 760px; margin: 0 auto 1.15rem; color: var(--ink);
}
h1.paper-title em { font-style: italic; color: var(--accent); }
.venue-banner {
  display: inline-flex; align-items: center; gap: 1.35rem; margin: 0 auto 1.85rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2);
}
.venue-banner::before, .venue-banner::after { content: ''; width: 4.25rem; height: 1.5px; flex-shrink: 0; }
.venue-banner::before { background: linear-gradient(90deg, transparent, var(--rule)); }
.venue-banner::after  { background: linear-gradient(90deg, var(--rule), transparent); }

.authors { font-size: .93rem; color: var(--ink-2); font-weight: 300; margin-bottom: .5rem; line-height: 2; max-width: 760px; margin-left: auto; margin-right: auto; }
.authors a { color: inherit; text-decoration: underline; text-decoration-color: rgba(0,0,0,.2); text-underline-offset: 3px; }
.authors .a { white-space: nowrap; }
.authors sup { font-size: .65em; color: var(--accent); }
.affil { font-size: .82rem; color: var(--ink-3); font-weight: 300; letter-spacing: .01em; margin-bottom: 2rem; }
.affil sup { font-size: .65em; }

.hero-links { display: flex; gap: .75rem; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1.25rem; border-radius: var(--r);
  font-family: var(--sans); font-size: .84rem; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: all .18s; border: 1px solid transparent;
}
.btn-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-outline:hover { background: var(--accent-lt); border-color: var(--accent); color: var(--accent); }
.btn-soon { background: transparent; color: var(--ink-3); border: 1px dashed var(--rule-2); cursor: default; }
.btn-soon small { font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; }
.ico { width: 15px; height: 15px; flex-shrink: 0; display: block; }

hr.divider { border: none; border-top: 1px solid var(--rule); margin: 0; }

/* ---------- video ---------- */
.video-frame { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: #000; aspect-ratio: 16/9; }
.video-frame video { width: 100%; height: 100%; object-fit: contain; }

/* ---------- section heads ---------- */
section { padding: 4.25rem 0; }
.kicker { font-size: .74rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: .6rem; text-align: center; }
.kicker.seen { color: var(--seen); } .kicker.forgot { color: var(--forgot); } .kicker.regain { color: var(--accent); }
h2.sec-title {
  font-family: var(--serif); font-weight: 400; font-size: 2.15rem; line-height: 1.2; letter-spacing: -.02em;
  color: var(--ink); text-align: center; margin-bottom: 1rem;
}
h2.sec-title em { font-style: italic; color: var(--accent); }
h2.sec-title::after { content: ''; display: block; width: 2.75rem; height: 2px; margin: .9rem auto 0; background: var(--sea-glass); opacity: .5; }
h2.sec-title.sm { font-size: 1.7rem; }
.sec-lede { max-width: 580px; margin: 0 auto 2.5rem; text-align: center; color: var(--ink-3); font-weight: 300; font-size: .96rem; }
.sec-lede strong { font-weight: 600; color: var(--ink-2); }
h3 { font-size: .95rem; font-weight: 600; letter-spacing: -.01em; margin-bottom: .35rem; color: var(--ink); }

/* ---------- TL;DR + stats ---------- */
.tldr {
  font-family: var(--serif); font-weight: 400; font-size: clamp(1.45rem, 3.2vw, 1.95rem); line-height: 1.45;
  letter-spacing: -.02em; max-width: 24em; margin: 0 auto; text-align: center; color: var(--ink);
}
.tldr em { font-style: italic; }
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin-top: 2.75rem;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
}
.stat { background: var(--paper); padding: 1.5rem 1.35rem; transition: background .18s; }
.stat:hover { background: #fafafa; }
.stat-num { font-family: var(--serif); font-size: 2.4rem; line-height: 1; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-num small { font-size: .55em; margin-left: .05em; }
.stat-label { font-size: .84rem; font-weight: 300; color: var(--ink-3); margin-top: .65rem; line-height: 1.55; }
.stat-label b { color: var(--ink); font-weight: 600; }

/* ---------- three acts ---------- */
.acts { display: grid; grid-template-columns: 1fr 1.08fr; gap: 2.25rem; align-items: start; }
.clip-card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.clip-card video { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #111; }
.clip-body { padding: 1.1rem 1.25rem 1.25rem; }
.q { font-size: .92rem; font-weight: 500; line-height: 1.5; }
.q .tag { font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); display: block; margin-bottom: .25rem; }
.opts { display: grid; gap: .45rem; margin-top: .85rem; }
.opt { display: flex; gap: .65rem; align-items: center; font-size: .86rem; font-weight: 300; padding: .5rem .75rem; border: 1px solid var(--rule); border-radius: var(--r); transition: all .35s; }
.opt b { font-size: .74rem; font-weight: 600; width: 1.45rem; height: 1.45rem; border-radius: 4px; display: grid; place-items: center; background: var(--bg-soft); border: 1px solid var(--rule); flex-shrink: 0; }
.opt .verdict { margin-left: auto; font-size: .72rem; font-weight: 600; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.opt.pick-wrong { border-color: rgba(224,83,63,.45); background: var(--forgot-lt); }
.opt.pick-wrong .verdict { opacity: 1; color: var(--forgot); }
.opt.pick-right { border-color: var(--accent); background: var(--accent-lt); }
.opt.pick-right .verdict { opacity: 1; color: var(--accent); }
.gt-note { font-size: .76rem; font-weight: 300; color: var(--ink-3); margin-top: .7rem; line-height: 1.55; }
.frames-strip { display: grid; grid-template-columns: repeat(8, 1fr); gap: 3px; margin-top: .9rem; }
.frames-strip img { border-radius: 3px; aspect-ratio: 16/10; object-fit: cover; width: 100%; outline: 2px solid transparent; outline-offset: 1px; transition: outline-color .2s; }
.frames-strip figcaption { font-size: .6rem; color: var(--ink-3); text-align: center; margin-top: 2px; font-variant-numeric: tabular-nums; }
.frames-strip figure.hl-f img { outline-color: var(--accent); }

.stepper { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: 1.1rem; }
.step { appearance: none; border: 1px solid var(--rule); background: var(--paper); border-radius: var(--r-lg); padding: .65rem .8rem .7rem; text-align: left; cursor: pointer; font: inherit; transition: all .22s; position: relative; overflow: hidden; }
.step .n { font-size: .64rem; font-weight: 600; letter-spacing: .1em; color: var(--ink-3); }
.step .t { display: block; font-family: var(--serif); font-size: 1.35rem; line-height: 1.15; margin-top: .05rem; }
.step .s { display: block; font-size: .7rem; font-weight: 300; color: var(--ink-3); line-height: 1.3; margin-top: .15rem; }
.step:hover { border-color: var(--rule-2); }
.step[data-k="seen"] .t { color: var(--seen); }
.step[data-k="forgot"] .t { color: var(--forgot); font-style: italic; }
.step[data-k="regain"] .t { color: var(--regain); }
.step[data-k="seen"].on { border-color: var(--seen); background: var(--seen-lt); }
.step[data-k="forgot"].on { border-color: var(--forgot); background: var(--forgot-lt); }
.step[data-k="regain"].on { border-color: var(--regain); background: var(--regain-lt); }
.step .bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 0; opacity: .5; }
.step[data-k="seen"] .bar { background: var(--seen); } .step[data-k="forgot"] .bar { background: var(--forgot); } .step[data-k="regain"] .bar { background: var(--regain); }

.gram-panel { display: grid; grid-template-columns: 1fr 200px; gap: 1.25rem; align-items: start; }
.gram-wrap { position: relative; aspect-ratio: 1; border-radius: 4px; overflow: hidden; border: 1px solid var(--rule-2); background: #fff; cursor: crosshair; }
.gram-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; transition: opacity .5s ease; }
.gram-wrap img:not(.on) { opacity: 0; }
.gram-cross { position: absolute; pointer-events: none; border: 2px solid var(--ink); display: none; box-shadow: 0 0 0 2px rgba(255,255,255,.85); }
.gram-row, .gram-col { position: absolute; pointer-events: none; background: rgba(26,23,20,.07); display: none; }
.gram-axis { display: flex; justify-content: space-between; font-size: .64rem; color: var(--ink-3); padding: .3rem .1rem 0; }
.colorbar { margin-top: .45rem; }
.colorbar img { width: 100%; height: 8px; border-radius: 2px; object-fit: fill; }
.colorbar div { display: flex; justify-content: space-between; font-size: .62rem; color: var(--ink-3); margin-top: 2px; }
.gram-side h4 { font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.gram-where { font-family: var(--serif); font-size: 1.3rem; line-height: 1.2; margin: .2rem 0 1rem; min-height: 2.5em; }
.meter { margin-bottom: 1rem; }
.meter-top { font-size: .74rem; font-weight: 300; color: var(--ink-3); }
.meter-val { font-family: var(--serif); font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.meter-track { height: 6px; border-radius: 99px; background: rgba(26,23,20,.06); margin-top: .35rem; overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; width: 0; transition: width .8s cubic-bezier(.2,.7,.2,1), background .4s; }
.gram-desc { font-size: .84rem; font-weight: 300; color: var(--ink-2); line-height: 1.6; }
.gram-desc b { font-weight: 600; }
.hover-pair { display: none; margin-top: 1rem; padding-top: .9rem; border-top: 1px dashed var(--rule-2); }
.hover-pair.show { display: block; }
.hover-pair .imgs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: .4rem; }
.hover-pair img { border-radius: 3px; aspect-ratio: 16/10; object-fit: cover; }
.hover-pair .lbl { font-size: .68rem; color: var(--ink-3); }
.hint { font-size: .74rem; font-weight: 300; color: var(--ink-3); margin-top: .7rem; display: flex; gap: .4rem; align-items: center; }

/* ---------- abstract ---------- */
.abstract-body { max-width: 660px; margin: 0 auto; font-size: 1rem; line-height: 1.85; font-weight: 300; color: var(--ink-2); text-align: justify; hyphens: auto; }
.abstract-body p + p { margin-top: 1.1em; }
.abstract-body strong { font-weight: 600; color: var(--ink-2); }

/* ---------- figures ---------- */
.figure-wrap { margin: 2rem auto 0; }
.figure-wrap img { width: 100%; border-radius: var(--r-lg); }
.figure-cap { margin-top: 1rem; padding: 1rem 1.5rem; font-size: .82rem; color: var(--ink-3); border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); line-height: 1.6; font-weight: 300; text-align: left; }
.figure-cap strong { color: var(--ink-2); }
.fig-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.1rem; background: var(--paper); }
.zoomable { cursor: zoom-in; }

/* ---------- CKA pipeline ---------- */
.pipeline {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; counter-reset: pip;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
}
.pip { background: var(--paper); padding: 1.4rem 1.25rem; }
.pip-ico { height: 74px; display: flex; align-items: center; justify-content: center; margin-bottom: .8rem; }
.pip-ico svg { height: 66px; width: auto; }
.pip-num { font-family: var(--serif); font-size: 1.6rem; color: var(--accent); opacity: .35; line-height: 1; margin-bottom: .35rem; }
.pip h3 { font-size: .9rem; }
.pip p { font-size: .84rem; font-weight: 300; color: var(--ink-3); line-height: 1.6; }
.eq { margin: 1.5rem auto 0; padding: 1rem 1.25rem; background: var(--bg-soft); border: 1px solid var(--rule); border-radius: var(--r-lg); text-align: center; overflow-x: auto; max-width: 620px; }

.tabs { display: inline-flex; gap: .2rem; padding: .2rem; background: var(--bg-soft); border: 1px solid var(--rule); border-radius: 8px; flex-wrap: wrap; }
.tab { appearance: none; border: 0; background: transparent; font: inherit; font-size: .78rem; font-weight: 500; color: var(--ink-3); padding: .38rem .85rem; border-radius: var(--r); cursor: pointer; transition: all .18s; }
.tab:hover { color: var(--accent); }
.tab.on { background: var(--paper); color: var(--accent); box-shadow: 0 0 0 1px var(--rule); }
.tab-panel { display: none; }
.tab-panel.on { display: block; animation: fadeUp .45s ease both; }

.finding-row { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2.25rem; align-items: center; margin-top: 2.75rem; }
.callouts { display: grid; gap: 1rem; }
.callout { border-left: 2px solid var(--rule-2); padding: .15rem 0 .15rem 1rem; }
.callout .big { font-family: var(--serif); font-size: 1.55rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.callout p { font-size: .86rem; font-weight: 300; color: var(--ink-3); line-height: 1.6; }
.callout p strong { color: var(--ink-2); }
.callout.forgot { border-color: var(--forgot); } .callout.forgot .big { color: var(--forgot); }
.callout.seen { border-color: var(--seen); } .callout.seen .big { color: var(--seen); }
.callout-sum { font-size: .9rem; font-weight: 300; color: var(--ink-3); }

/* ---------- method ---------- */
.method { display: grid; grid-template-columns: .95fr 1.05fr; gap: 2.5rem; align-items: start; }
.method-fig { position: sticky; top: 80px; }
.obj { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.35rem 1.4rem; margin-bottom: 1rem; transition: border-color .2s; }
.obj:hover { border-color: var(--rule-2); }
.obj-head { display: flex; align-items: center; gap: .7rem; margin-bottom: .45rem; }
.obj-badge { font-size: .72rem; font-weight: 600; padding: .18rem .55rem; border-radius: 4px; }
.obj.align .obj-badge { background: var(--seen-lt); color: var(--seen); }
.obj.order .obj-badge { background: var(--accent-lt); color: var(--accent); }
.obj.kl .obj-badge { background: #f1ede6; color: #7a6248; }
.obj h3 { margin: 0; }
.obj p { font-size: .88rem; font-weight: 300; color: var(--ink-2); line-height: 1.65; }
.obj .eq { margin: .9rem 0 0; max-width: none; font-size: .9rem; padding: .75rem; }
.obj .src { display: flex; gap: .4rem; flex-wrap: wrap; margin-top: .85rem; }
.chip { font-size: .72rem; padding: .22rem .7rem; border-radius: 999px; background: var(--bg-soft); border: 1px solid var(--rule); color: var(--ink-2); white-space: nowrap; }
.chip.ok { background: var(--accent-lt); border-color: #a6e3d2; color: var(--accent); font-weight: 500; }
.views { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: .9rem; }
.view { border: 1px solid var(--rule); border-radius: var(--r); padding: .5rem .5rem; font-size: .72rem; text-align: center; }
.view .seq { font-family: var(--mono); font-size: .76rem; letter-spacing: .04em; margin-bottom: .1rem; color: var(--ink); }
.view .lbl { color: var(--ink-3); font-weight: 300; }
.view.pos { border-color: #a6e3d2; background: var(--accent-lt); }
.view.neg { border-color: #f6c2b9; background: var(--forgot-lt); }
.impl { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; margin-top: 1rem; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.impl div { background: var(--paper); font-size: .8rem; font-weight: 300; padding: .8rem 1rem; color: var(--ink-3); }
.impl b { display: block; font-family: var(--serif); font-weight: 400; font-size: 1.2rem; color: var(--accent); }

/* ---------- results chart ---------- */
.res-controls { display: flex; flex-wrap: wrap; gap: .8rem 1.4rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.legend { display: flex; gap: 1.1rem; font-size: .76rem; font-weight: 300; color: var(--ink-2); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.lg-dash { width: 18px; border-top: 2px dashed var(--ink-3); display: inline-block; opacity: .6; }
.chart-card { border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); }
.chart-body { padding: 1.25rem 1.5rem .9rem; }
.chart-toolbar { display: flex; justify-content: space-between; align-items: center; padding: .65rem 1rem; background: var(--bg-soft); border-bottom: 1px solid var(--rule); gap: 1rem; flex-wrap: wrap; }
.db-group { font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding: .9rem 0 .3rem; border-top: 1px solid var(--rule); margin-top: .4rem; }
.db-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.db-row { display: grid; grid-template-columns: 220px 1fr 64px; align-items: center; gap: 1rem; height: 36px; }
.db-name { font-size: .84rem; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-name small { font-weight: 300; color: var(--ink-3); }
.db-name sup { color: var(--forgot); }
.db-track { position: relative; height: 100%; }
.db-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(26,23,20,.06); }
.db-chance { position: absolute; top: 4px; bottom: 4px; border-left: 1.5px dashed rgba(26,23,20,.22); }
.db-line { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; border-radius: 3px; transition: left .7s cubic-bezier(.2,.7,.2,1), width .7s cubic-bezier(.2,.7,.2,1); }
.db-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(26,23,20,.15); transition: left .7s cubic-bezier(.2,.7,.2,1); }
.db-dot.base { background: #c9c3bb; }
.db-dot.ours { background: var(--accent); width: 14px; height: 14px; margin: -7px 0 0 -7px; }
.db-dot.ours.neg { background: var(--forgot); }
.db-dot:hover::after { content: attr(data-v); position: absolute; bottom: 150%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: .7rem; padding: .12rem .45rem; border-radius: 4px; white-space: nowrap; }
.db-delta { font-size: .82rem; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.db-delta.pos { color: var(--accent); } .db-delta.neg { color: var(--forgot); } .db-delta.zero { color: var(--ink-3); font-weight: 400; }
.db-axis { display: grid; grid-template-columns: 220px 1fr 64px; gap: 1rem; margin-top: .3rem; }
.db-axis-track { position: relative; height: 1.2rem; font-size: .66rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.db-axis-track span { position: absolute; transform: translateX(-50%); }
.db-refs { padding: .7rem 1.5rem; border-top: 1px solid var(--rule); background: var(--bg-soft); font-size: .76rem; font-weight: 300; color: var(--ink-3); display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; }
.db-refs b { font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

details.full-table { margin-top: 1.5rem; text-align: center; }
details.full-table summary { cursor: pointer; list-style: none; }
details.full-table summary::-webkit-details-marker { display: none; }
details.full-table summary::after { content: ' +'; }
details.full-table[open] summary::after { content: ' –'; }
.table-scroll { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--rule); border-radius: var(--r-lg); background: var(--paper); text-align: left; }
table.rt { width: 100%; border-collapse: collapse; font-size: .78rem; font-variant-numeric: tabular-nums; }
.rt th, .rt td { padding: .5rem .6rem; text-align: center; white-space: nowrap; }
.rt thead th { background: var(--bg-soft); font-weight: 500; color: var(--ink-2); border-bottom: 1px solid var(--rule); }
.rt td:first-child, .rt th:first-child { text-align: left; position: sticky; left: 0; background: var(--paper); }
.rt thead th:first-child { background: var(--bg-soft); }
.rt tbody tr { border-bottom: 1px solid rgba(26,23,20,.05); }
.rt tr.ours td, .rt tr.ours td:first-child { background: #eefaf5; font-weight: 600; color: #0b6b55; }
.rt tr.grp td { font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); padding-top: 1rem; background: var(--paper); }
.rt tr.chance td { color: var(--ink-3); font-style: italic; background: rgba(26,23,20,.015); }
.rt .g { display: block; font-size: .64rem; font-weight: 500; }
.rt .g.pos { color: var(--accent); } .rt .g.neg { color: var(--forgot); } .rt .g.zero { color: var(--ink-3); }
.rt .bl { border-left: 1px solid var(--rule); }
.rt sup { color: var(--forgot); }
.small-note { font-size: .78rem; font-weight: 300; color: var(--ink-3); margin-top: .8rem; }

/* ---------- analysis ---------- */
.ana-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.card { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.5rem; }
.card.span2 { grid-column: span 2; }
.card .q-head { font-family: var(--serif); font-size: 1.3rem; line-height: 1.25; margin-bottom: .5rem; font-weight: 400; }
.card .q-head em { font-style: italic; color: var(--accent); }
.card p { font-size: .87rem; font-weight: 300; color: var(--ink-3); line-height: 1.65; }
.card p strong { color: var(--ink-2); }
.card img { margin-top: 1rem; border-radius: var(--r); }
.ab-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; }
.bars { margin-top: 1.4rem; display: grid; gap: .9rem; }
.bar-row { display: grid; grid-template-columns: 190px 1fr; gap: 1rem; align-items: center; }
.bar-label { font-size: .84rem; font-weight: 500; line-height: 1.3; }
.bar-label small { display: block; font-weight: 300; font-size: .72rem; color: var(--ink-3); }
.bar-pair { display: grid; gap: 4px; }
.bar-line { display: grid; grid-template-columns: 1fr 60px; align-items: center; gap: .6rem; }
.bar-track { position: relative; height: 11px; }
.bar-zero { position: absolute; top: -3px; bottom: -3px; width: 1px; background: var(--rule-2); }
.bar-fill { position: absolute; top: 0; bottom: 0; border-radius: 3px; transition: all .7s cubic-bezier(.2,.7,.2,1); }
.bar-fill.tb { background: var(--accent); } .bar-fill.vg { background: var(--sand); }
.bar-fill.neg { opacity: .65; background: var(--forgot) !important; }
.bar-row.hero-row .bar-label { color: var(--accent); }
.bar-val { font-size: .76rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.bar-legend { display: flex; gap: 1rem; font-size: .74rem; font-weight: 300; color: var(--ink-3); }
.bar-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: .35rem; vertical-align: -1px; }
.ab-note { font-size: .82rem; margin-top: 1.2rem; padding-top: .9rem; border-top: 1px dashed var(--rule-2); }

.keep { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-top: 1.1rem; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.keep > div { background: var(--paper); padding: .9rem; text-align: center; }
.keep .bm { font-size: .68rem; font-weight: 600; color: var(--ink-3); letter-spacing: .1em; text-transform: uppercase; }
.keep .vals { font-family: var(--serif); font-size: 1.3rem; margin-top: .2rem; font-variant-numeric: tabular-nums; }
.keep .vals .arrow { color: var(--ink-3); margin: 0 .3rem; font-family: var(--sans); font-size: .9rem; }
.keep .d { font-size: .74rem; color: var(--ink-3); }

/* ---------- grounding ---------- */
.ground { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.5rem; margin-top: 1.25rem; }
.ground-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.ground-q { font-family: var(--serif); font-size: 1.3rem; line-height: 1.3; max-width: 34ch; }
.ground-meta { font-size: .74rem; font-weight: 300; color: var(--ink-3); text-align: right; }
.ground-meta b { color: var(--ink-2); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; font-size: .66rem; }
.tl { margin-top: 1.3rem; --tl-l: 100px; --tl-r: 200px; }
.tl-frames, .tl-axis { margin-left: calc(var(--tl-l) + .75rem); margin-right: calc(var(--tl-r) + .75rem); }
.tl-frames { display: grid; grid-template-columns: repeat(16, 1fr); gap: 2px; }
.tl-frames img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 2px; transition: transform .2s, opacity .3s; cursor: zoom-in; }
.tl-frames img:hover { transform: scale(1.08); position: relative; z-index: 2; }
.tl-frames.dim img { opacity: .3; }
.tl-frames.dim img.in { opacity: 1; }
.tl-tracks { margin-top: .6rem; display: grid; gap: .35rem; }
.tl-track { display: grid; grid-template-columns: var(--tl-l) 1fr var(--tl-r); gap: .75rem; align-items: center; height: 30px; cursor: pointer; }
.tl-bar { position: relative; height: 100%; border-radius: var(--r); background: var(--bg-soft); border: 1px solid rgba(26,23,20,.05); }
.tl-track:hover .tl-bar { background: #f2f1ee; }
.tl-span { position: absolute; top: 5px; bottom: 5px; border-radius: 3px; min-width: 4px; }
.tl-track.gt .tl-span { background: repeating-linear-gradient(-45deg, #8a837b, #8a837b 4px, #a59e96 4px, #a59e96 8px); }
.tl-track.base .tl-span { background: var(--forgot); }
.tl-track.ours .tl-span { background: var(--accent); }
.tl-label { font-size: .76rem; font-weight: 600; white-space: nowrap; text-align: right; }
.tl-ans { font-size: .76rem; font-weight: 300; white-space: nowrap; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; }
.tl-ans b { font-weight: 600; font-variant-numeric: tabular-nums; }
.tl-track.base .tl-label, .tl-track.base .tl-ans b { color: var(--forgot); }
.tl-track.ours .tl-label, .tl-track.ours .tl-ans b { color: var(--accent); }
.tl-axis { position: relative; height: 1.1rem; font-size: .64rem; color: var(--ink-3); margin-top: .25rem; font-variant-numeric: tabular-nums; }
.tl-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-axis span:first-child { transform: none; } .tl-axis span:last-child { transform: translateX(-100%); }
.ground-foot { display: grid; grid-template-columns: 1fr auto; gap: 1.25rem; align-items: center; margin-top: 1rem; }
.ground-foot p { font-size: .86rem; font-weight: 300; color: var(--ink-2); }
.gt-media { display: flex; gap: .4rem; }
.gt-media video, .gt-media img { height: 140px; width: auto; border-radius: var(--r); border: 1px solid var(--rule); }
.gt-media figcaption { font-size: .66rem; color: var(--ink-3); margin-top: .2rem; text-align: center; }

/* ---------- limitations (finding-card grid from reference) ---------- */
.findings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.finding-card { background: var(--paper); padding: 1.6rem 1.4rem; }
.finding-card:hover { background: #fafafa; }
.finding-num { font-family: var(--serif); font-size: 2rem; color: var(--forgot); opacity: .4; line-height: 1; margin-bottom: .5rem; }
.finding-title { font-size: .92rem; font-weight: 600; margin-bottom: .45rem; letter-spacing: -.01em; }
.finding-body { font-size: .86rem; font-weight: 300; color: var(--ink-3); line-height: 1.65; }

/* ---------- citation (reference) ---------- */
.citation-box { background: var(--paper); border: 1px solid var(--rule); border-radius: 12px; max-width: 42rem; margin: 0 auto; text-align: left; overflow: hidden; }
.citation-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem 1rem; background: var(--bg-soft); border-bottom: 1px solid var(--rule); }
.citation-label { font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.citation-pre { margin: 0; padding: 1rem 1.15rem 1.15rem; font-family: var(--mono); font-size: .74rem; line-height: 1.55; color: var(--ink-2); background: #f4f3f1; white-space: pre-wrap; overflow-wrap: break-word; }
.copy { flex-shrink: 0; font-family: var(--sans); font-size: .76rem; font-weight: 500; padding: .32rem .9rem; border-radius: var(--r); border: 1px solid var(--rule); background: #fff; color: var(--ink-2); cursor: pointer; transition: all .18s; }
.copy:hover { background: var(--accent-lt); border-color: var(--accent); color: var(--accent); }

footer { padding: 2.5rem 2rem; text-align: center; font-size: .8rem; color: var(--ink-3); font-weight: 300; border-top: 1px solid var(--rule); }
footer a { color: inherit; }

/* ---------- lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(26,23,20,.82); display: none; align-items: center; justify-content: center; padding: 2rem; cursor: zoom-out; }
.lightbox.on { display: flex; animation: fadeUp .25s ease both; }
.lightbox img { max-width: 96vw; max-height: 92vh; border-radius: 8px; background: #fff; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .acts, .method, .finding-row { grid-template-columns: 1fr; }
  .method-fig { position: static; max-width: 520px; margin: 0 auto; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .ana-grid, .findings-grid { grid-template-columns: 1fr; }
  .card.span2 { grid-column: auto; }
  .db-row, .db-axis { grid-template-columns: 150px 1fr 54px; gap: .6rem; }
  .db-name small { display: none; }
}
@media (max-width: 640px) {
  html { font-size: 100%; }
  .wrap, .wrap-wide { padding: 0 1.25rem; }
  .hero { padding: 3.5rem 1.25rem 2.5rem; }
  section { padding: 3.25rem 0; }
  h2.sec-title { font-size: 1.75rem; }
  .pipeline { grid-template-columns: 1fr 1fr; }
  .gram-panel { grid-template-columns: 1fr; }
  .gram-box { width: 100%; max-width: 360px; margin: 0 auto; }
  .bar-row { grid-template-columns: 1fr; gap: .35rem; }
  .views { grid-template-columns: repeat(2, 1fr); }
  .keep { grid-template-columns: 1fr; }
  .tl { --tl-l: 64px; --tl-r: 0px; }
  .tl-track { grid-template-columns: var(--tl-l) 1fr; height: auto; row-gap: .15rem; }
  .tl-ans { grid-column: 2; font-size: .7rem; }
  .tl-label { font-size: .7rem; }
  .tl-bar { height: 26px; }
  .tl-frames { grid-template-columns: repeat(8, 1fr); }
  .tl-frames img:nth-child(odd) { display: none; }
  .ground-foot { grid-template-columns: 1fr; }
  .db-row, .db-axis { grid-template-columns: 104px 1fr 46px; }
  .db-name { font-size: .74rem; }
  .step .s { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal, .anim { opacity: 1; transform: none; }
}

/* =====================================================================
   ReGAIN signature: frames, Gram matrices, and the seen → forgotten → regained arc
   ===================================================================== */

/* acronym banner: highlight the letters that spell ReGAIN */
.venue-banner { font-weight: 400; letter-spacing: .14em; color: var(--ink-3); }
.venue-banner b { font-weight: 700; color: var(--accent); }

/* section numbers on kickers, like chapter / frame indices */
body { counter-reset: sec; }
.kicker::before {
  counter-increment: sec; content: counter(sec, decimal-leading-zero);
  font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; text-transform: none;
  font-size: 1.05rem; color: var(--sea-glass); margin-right: .55rem; vertical-align: -1px;
}

/* tri-colour underline under section titles: seen / forgotten / regained */
h2.sec-title::after {
  width: 3.6rem; height: 2px; opacity: 1;
  background: linear-gradient(90deg, var(--seen) 0 33.3%, var(--forgot) 33.3% 66.6%, var(--regain) 66.6% 100%);
  opacity: .7;
}

/* film-strip dividers: a hairline with eight frames; the frame for this section is filled */
.frame-div { position: relative; height: 1px; background: var(--rule); margin: 0; }
.frame-div .strip {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; gap: 5px; padding: 0 14px; background: var(--bg);
}
.frame-div .strip i {
  width: 9px; height: 7px; border-radius: 1.5px; border: 1px solid rgba(26,23,20,.2); background: var(--bg);
  transition: background .5s ease, border-color .5s ease;
}
.frame-div .strip i.past { background: rgba(14,138,109,.18); border-color: rgba(14,138,109,.3); }
.frame-div .strip i.now { background: var(--accent); border-color: var(--accent); }
.frame-div.in .strip i.now { animation: framePulse 1.6s ease 1; }
@keyframes framePulse { 0% { transform: scale(1); } 30% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* progress bar as a scrubber with frame ticks */
.progress { height: 3px; background:
  repeating-linear-gradient(90deg, transparent 0 22px, rgba(255,255,255,.9) 22px 24px),
  linear-gradient(90deg, var(--seen), var(--forgot) 50%, var(--regain)); }

@media (max-width: 640px) {
  .frame-div .strip { gap: 4px; padding: 0 10px; }
  .frame-div .strip i { width: 7px; height: 6px; }
}

/* ---------- CKA pipeline figures (section 03) ---------- */
.pip { display: flex; flex-direction: column; padding: 1.4rem 1.25rem 1.5rem; }
.pfig { height: 200px; margin-bottom: 1.1rem; position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pf-tag { font-size: .66rem; font-weight: 500; letter-spacing: .06em; color: var(--ink-3); margin-top: .6rem; text-align: center; }

/* 01 fanned frame stack */
.pf-frames { justify-content: flex-end; padding-bottom: .2rem; }
.pf-frames img {
  position: absolute; width: 58%; aspect-ratio: 16/10; object-fit: cover; border-radius: 4px;
  border: 2px solid #fff; box-shadow: 0 4px 16px rgba(26,23,20,.16); transition: transform .35s ease;
}
.pf-frames img { top: 44%; left: 50%; }
.pf-frames img:nth-child(1) { transform: translate(calc(-50% - 42px), calc(-50% - 26px)) rotate(-8deg); }
.pf-frames img:nth-child(2) { transform: translate(calc(-50% - 14px), calc(-50% - 9px)) rotate(-2.5deg); }
.pf-frames img:nth-child(3) { transform: translate(calc(-50% + 14px), calc(-50% + 8px)) rotate(2.5deg); }
.pf-frames img:nth-child(4) { transform: translate(calc(-50% + 42px), calc(-50% + 25px)) rotate(8deg); }
.pip:hover .pf-frames img:nth-child(1) { transform: translate(calc(-50% - 56px), calc(-50% - 30px)) rotate(-11deg); }
.pip:hover .pf-frames img:nth-child(4) { transform: translate(calc(-50% + 56px), calc(-50% + 29px)) rotate(11deg); }
.pf-frames .pf-tag { position: absolute; bottom: 0; }

/* 02 frame -> vectors */
.pf-vec-rows { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.pf-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pf-col img { width: 100%; aspect-ratio: 16/11; object-fit: cover; border-radius: 3px; border: 1px solid var(--rule); }
.pf-col .arr { font-size: .7rem; color: var(--ink-3); line-height: 1; }
.pf-col .vecs { display: flex; gap: 5px; }
.pf-col .vec { display: grid; gap: 2px; }
.pf-col .vec i { display: block; width: 13px; height: 10px; border-radius: 2px; }
.pf-col .dots { font-size: .6rem; color: var(--ink-3); letter-spacing: .1em; }
.pf-legend { display: flex; gap: .8rem; margin-top: .65rem; font-size: .66rem; color: var(--ink-3); }
.pf-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.sw { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.sw.seen { background: var(--seen); } .sw.llm { background: var(--accent); }

/* 03 Gram with frame axes */
.pf-gram-grid { display: grid; grid-template-columns: 26px 150px; grid-template-rows: 17px 150px; gap: 3px; }
.pf-axis { display: grid; gap: 1px; }
.pf-axis.top { grid-template-columns: repeat(4, 1fr); }
.pf-axis.left { grid-template-rows: repeat(4, 1fr); }
.pf-axis img { width: 100%; height: 100%; object-fit: cover; border-radius: 2px; }
.pf-mat { position: relative; border: 1px solid var(--rule-2); border-radius: 3px; overflow: hidden; }
.pf-mat img { width: 100%; height: 100%; }
.pf-cell { position: absolute; left: calc(100% * 13 / 16); top: calc(100% * 12 / 16); width: calc(100% / 16); height: calc(100% / 16);
  outline: 2px solid var(--ink); outline-offset: 0; box-shadow: 0 0 0 4px rgba(255,255,255,.7); animation: cellBlink 2.6s ease-in-out infinite; }
@keyframes cellBlink { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* 04 two Grams compared, CKA meter */
.pf-pair { display: flex; align-items: center; gap: .45rem; }
.pf-pair figure { text-align: center; }
.pf-pair img { width: 86px; height: 86px; border: 1px solid var(--rule-2); border-radius: 3px; }
.pf-pair figcaption { font-size: .64rem; color: var(--ink-3); margin-top: .3rem; white-space: nowrap; }
.pf-vs { font-family: var(--serif); font-style: italic; color: var(--ink-3); font-size: 1rem; margin-top: -1rem; }
.pf-score { width: 100%; margin-top: .9rem; }
.pf-score-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .7rem; font-weight: 600; letter-spacing: .1em; color: var(--ink-3); }
.pf-score-top b { font-family: var(--serif); font-weight: 400; font-size: 1.6rem; letter-spacing: 0; color: var(--forgot); line-height: 1; }
.pf-score-track { position: relative; height: 6px; border-radius: 99px; background: rgba(26,23,20,.07); margin-top: .35rem; }
.pf-score-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 99px; background: var(--forgot); transition: width 1.2s cubic-bezier(.2,.7,.2,1) .3s; }
.pipeline.in .pf-score-fill { width: 27%; }
.pf-score-ends { display: flex; justify-content: space-between; font-size: .6rem; color: var(--ink-3); margin-top: .25rem; }

@media (max-width: 960px) {
  .pipeline { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 520px) {
  .pipeline { grid-template-columns: 1fr; }
  .pfig { height: 190px; }
}

/* section 03: 2 x 2 layout, figure beside text */
.pipeline { grid-template-columns: 1fr 1fr; }
.pip { display: grid; grid-template-columns: 250px 1fr; grid-template-rows: auto auto 1fr; column-gap: 1.6rem; align-items: start; padding: 1.6rem 1.6rem; }
.pip .pfig { grid-row: 1 / 4; margin-bottom: 0; height: 210px; }
.pip .pip-num { margin-top: .4rem; }
@media (max-width: 960px) {
  .pipeline { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .pip { grid-template-columns: 1fr; }
  .pip .pfig { grid-row: auto; margin-bottom: 1rem; }
}

/* section 02: question + viewer as one outlined split panel */
.acts {
  gap: 1px; align-items: stretch;
  background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden;
}
.acts > * { background: var(--paper); }
.acts .clip-card { border: 0; border-radius: 0; background: var(--bg-soft); }
.acts .clip-body { padding: 1.25rem 1.4rem 1.5rem; }
.acts > .reveal:last-child { padding: 1.5rem 1.6rem; }
.acts .opt { background: var(--paper); }
.acts .opt.pick-wrong { background: var(--forgot-lt); }
.acts .opt.pick-right { background: var(--accent-lt); }

/* ---------- hero wordmark: same as the top-bar brand, larger ---------- */
.logo-word { font-family: var(--serif); font-size: 1.7rem; line-height: 1; color: var(--ink); margin: 0 auto 1.1rem; letter-spacing: .01em; }
.logo-word b { font-weight: 400; font-style: italic; color: var(--accent); }

/* ---------- section 02: quiz ---------- */
button.opt { font: inherit; font-size: .86rem; font-weight: 300; color: var(--ink); text-align: left; width: 100%; cursor: default; }
.opts.quiz button.opt { cursor: pointer; }
.opts.quiz button.opt:hover { border-color: var(--accent); background: var(--accent-lt); }
.opt .you { display: none; font-size: .62rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: .1rem .45rem; border-radius: 99px; background: var(--ink); color: #fff; margin-left: .4rem; }
.opt.yours .you { display: inline-block; }
.opt .verdict { margin-left: auto; }
.gt-note b { font-weight: 600; color: var(--ink-2); }
.gt-note .ok { color: var(--accent); font-weight: 600; } .gt-note .no { color: var(--forgot); font-weight: 600; }
.opts.quiz + .gt-note { color: var(--ink-2); font-weight: 400; }

/* frame-order toggle */
.order-bar { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: 1rem; flex-wrap: wrap; }
.order-lbl { font-size: .64rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.tabs.sm { padding: .15rem; } .tabs.sm .tab { font-size: .7rem; padding: .25rem .6rem; }
.frames-strip { margin-top: .6rem; }
.frames-strip figure { transition: transform .55s cubic-bezier(.2,.7,.2,1); }
.order-note { font-size: .76rem; font-weight: 300; color: var(--ink-3); margin-top: .55rem; min-height: 2.4em; line-height: 1.55; }
.order-note b { font-weight: 600; color: var(--ink-2); }

/* before / after slider on the Regained step */
.cmp-before { position: absolute; inset: 0; display: none; clip-path: inset(0 50% 0 0); }
.cmp-before img { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 1 !important; }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 28px; margin-left: -14px; display: none; cursor: ew-resize; touch-action: none; z-index: 3; }
.cmp-handle::before { content: ''; position: absolute; left: 13px; top: 0; bottom: 0; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(26,23,20,.25); }
.cmp-handle span { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(26,23,20,.25); display: grid; place-items: center; font-size: .8rem; font-weight: 600; color: var(--ink-2); letter-spacing: -.1em; }
.cmp-lbl { position: absolute; top: 8px; z-index: 2; display: none; font-size: .6rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; padding: .12rem .45rem; border-radius: 4px; background: rgba(255,255,255,.88); }
.cmp-lbl.l { left: 8px; color: var(--forgot); } .cmp-lbl.r { right: 8px; color: var(--accent); }
.gram-wrap.cmp .cmp-before, .gram-wrap.cmp .cmp-handle, .gram-wrap.cmp .cmp-lbl { display: block; }

/* ---------- results: how strict is I-Acc ---------- */
.strict { display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.2rem 1.5rem; margin-bottom: 1.25rem; background: var(--bg-soft); }
.strict-k { font-family: var(--serif); font-size: 1.2rem; margin-bottom: .3rem; }
.strict-text p:not(.strict-k) { font-size: .86rem; font-weight: 300; color: var(--ink-3); line-height: 1.6; }
.strict-text strong { color: var(--ink-2); }
.strict-grids { display: flex; gap: 1.25rem; }
.sg { text-align: center; }
.sg-grid { display: grid; grid-template-columns: auto 26px 26px; gap: 3px; align-items: center; }
.sg-grid .h { font-size: .62rem; color: var(--ink-3); white-space: nowrap; text-align: right; padding-right: .3rem; }
.sg-grid span.h:nth-child(2), .sg-grid span.h:nth-child(3) { text-align: center; padding: 0; }
.sg-grid i { font-style: normal; display: grid; place-items: center; width: 26px; height: 22px; border-radius: 4px; font-size: .78rem; font-weight: 600; background: var(--accent-lt); color: var(--accent); }
.sg-grid i.x { background: var(--forgot-lt); color: var(--forgot); }
.sg-cap { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin-top: .4rem; }
.sg.ok .sg-cap { color: var(--accent); } .sg.no .sg-cap { color: var(--forgot); }
@media (max-width: 760px) { .strict { grid-template-columns: 1fr; } .strict-grids { justify-content: center; } }

#metricNote:empty, .gt-note:empty, .figure-cap:empty { display: none; }
.strict-text p:not(.strict-k) { font-family: var(--serif); font-size: 1rem; color: var(--ink-3); }

/* ---------- section 03: Gram moments instead of math ---------- */
.pf-ph { position: absolute; left: calc(100% * var(--a) / 16); top: calc(100% * var(--a) / 16);
  width: calc(100% * (var(--b) - var(--a)) / 16); height: calc(100% * (var(--b) - var(--a)) / 16);
  border: 1.5px solid var(--ink); border-radius: 2px; box-shadow: 0 0 0 1.5px rgba(255,255,255,.7); opacity: .75; }

/* ---------- method: visual, no math ---------- */
.m-where { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 2.3rem 1.5rem 1rem; margin-bottom: 1.25rem; position: relative; }
.m-where-lbl { position: absolute; left: 1.5rem; top: .8rem; font-size: .66rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.m-bars { position: relative; display: grid; grid-template-columns: repeat(36, 1fr); gap: 3px; height: 46px; margin-top: 1.1rem; }
.m-bars i { background: #e9eef3; border-radius: 2px; }
.m-bars i.a { background: var(--seen); }
.m-bars i.o { background: var(--forgot); }
.m-flag { position: absolute; top: -1.45rem; transform: translateX(-50%); font-size: .66rem; font-weight: 600; color: #fff; padding: .1rem .5rem; border-radius: 99px; white-space: nowrap; }
.m-flag.a { background: var(--seen); } .m-flag.o { background: var(--forgot); transform: translateX(-85%); }
.m-ends { display: flex; justify-content: space-between; font-size: .66rem; color: var(--ink-3); margin-top: .35rem; }
.m-ends span:nth-child(2) { color: var(--seen); font-weight: 600; margin-left: 12%; }

.m-grid { display: grid; grid-template-columns: 1fr 1.25fr; grid-template-areas: "a o" "k o"; gap: 1.25rem; }
.m-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.3rem 1.4rem 1.2rem; background: var(--paper); }
.m-card.align { grid-area: a; } .m-card.order { grid-area: o; } .m-card.m-keep { grid-area: k; }
.m-head { display: flex; align-items: center; gap: .55rem; margin-bottom: 1rem; flex-wrap: wrap; }
.m-head h3 { margin: 0; font-size: 1rem; }
.m-num { font-family: var(--serif); font-size: 1.3rem; color: var(--sea-glass); line-height: 1; }
.m-badge { margin-left: auto; font-size: .64rem; font-weight: 600; letter-spacing: .04em; padding: .18rem .6rem; border-radius: 99px; color: #fff; }
.m-badge.a { background: var(--seen); } .m-badge.o { background: var(--forgot); } .m-badge.k { background: var(--accent); }
.m-cap { font-size: .8rem; font-weight: 300; color: var(--ink-3); margin-top: .8rem; line-height: 1.5; }

.m-grams { display: flex; align-items: center; justify-content: space-between; gap: .35rem; }
.m-grams figure { text-align: center; flex: 1; }
.m-grams img { width: 100%; aspect-ratio: 1; border: 1px solid var(--rule-2); border-radius: 3px; }
.m-grams figcaption { font-size: .64rem; color: var(--ink-3); margin-top: .3rem; line-height: 1.35; }
.m-grams figcaption b { font-weight: 600; color: var(--ink-2); }
.m-eq, .m-arrow { font-family: var(--serif); font-size: 1.1rem; color: var(--ink-3); margin-top: -1.6rem; }
.m-arrow { color: var(--accent); font-size: 1.4rem; }

.ord { display: grid; gap: 1rem; }
.ord-row { display: grid; grid-template-columns: 112px 1fr 14px; align-items: center; gap: .6rem; margin-bottom: .45rem; }
.ord-name { font-size: .74rem; font-weight: 500; line-height: 1.25; }
.ord-name em { display: block; font-style: normal; font-size: .64rem; font-weight: 600; }
.ord-name em.pos { color: var(--accent); } .ord-name em.neg { color: var(--forgot); }
.ord-frames { display: grid; grid-template-columns: repeat(6, 1fr); gap: 2px; }
.ord-frames img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 2px; }
.ord-frames .gap { border: 1.5px dashed var(--rule-2); border-radius: 2px; }
.ord-row.neg .ord-frames { outline: 1.5px solid rgba(224,83,63,.35); outline-offset: 2px; border-radius: 3px; }
.ord-dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink-3); background: #fff; }
.ord-dot.pos { border-color: var(--accent); } .ord-dot.neg { border-color: var(--forgot); }
.ord-space { text-align: center; }
.ord-space svg { width: 100%; max-width: 420px; margin: .6rem auto 0; display: block; overflow: visible; }
.tk circle { fill: #fff; stroke-width: 2.5; }
.tk text { font-family: var(--sans); font-size: 11px; fill: var(--ink-2); text-anchor: middle; }
.tk text.v { font-weight: 600; font-size: 11px; }
.tk.o circle { fill: var(--ink); stroke: var(--ink); }
.tk.pos circle { stroke: var(--accent); } .tk.pos text.v { fill: var(--accent); }
.tk.rev circle, .tk.shuf circle { stroke: var(--forgot); } .tk.rev text.v, .tk.shuf text.v { fill: var(--forgot); }
.ln { stroke-width: 1.5; stroke-dasharray: 3 3; }
.ln.pos { stroke: var(--accent); } .ln.rev, .ln.shuf { stroke: var(--forgot); }
.ord-verdict { font-family: var(--sans); font-size: 12px; font-weight: 600; }

.m-need { list-style: none; display: grid; gap: .45rem; }
.m-need li { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--rule); border-radius: var(--r); padding: .5rem .8rem; font-size: .9rem; }
.m-need s { color: var(--ink-3); text-decoration-color: var(--ink-2); text-decoration-thickness: 1.5px; }
.m-need span { font-size: .72rem; font-weight: 600; color: var(--forgot); }
.impl { grid-template-columns: repeat(4, 1fr); margin-top: 1.25rem; }

@media (max-width: 960px) {
  .m-grid { grid-template-columns: 1fr; grid-template-areas: "a" "o" "k"; }
}
@media (max-width: 560px) {
  .ord-row { grid-template-columns: 78px 1fr 12px; }
  .impl { grid-template-columns: repeat(2, 1fr); }
  .m-flag { font-size: .58rem; }
}
#ordSvg .tk:not(.o) text { transition: opacity .4s; }
#ordSvg:not(.after) .tk:not(.o) text { opacity: 0; }
#ordSvg .tk.o text { text-anchor: end; }

/* ---------- method polish (v2) ---------- */
.m-grid { align-items: stretch; }
.m-card { padding: 1.5rem 1.6rem 1.4rem; display: flex; flex-direction: column; }
.m-card .m-cap { margin-top: auto; padding-top: 1rem; }
.m-head { margin-bottom: 1.2rem; }
.m-head h3 { font-family: var(--serif); font-weight: 400; font-size: 1.25rem; letter-spacing: -.01em; }
.m-num { font-size: 1.5rem; }
.m-badge { font-size: .62rem; letter-spacing: .06em; text-transform: uppercase; padding: .22rem .65rem; }

.m-grams { display: grid; grid-template-columns: 1fr 2.15fr; gap: 1rem; align-items: start; }
.m-grams figure { text-align: center; margin: 0; }
.m-grams img { width: 100%; aspect-ratio: 1; border-radius: 4px; border: 1px solid var(--rule-2); box-shadow: 0 2px 10px -4px rgba(26,23,20,.18); }
.m-grams figcaption { font-size: .68rem; color: var(--ink-3); margin-top: .45rem; line-height: 1.3; }
.m-grams figcaption b { display: block; font-weight: 600; font-size: .72rem; color: var(--ink-2); }
.m-grams .ref { padding-right: 1rem; border-right: 1px dashed var(--rule-2); }
.m-ba { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; }
.m-ba .m-arrow { color: var(--accent); margin: 0 0 1.9rem; display: grid; place-items: center; }
.m-ba .m-arrow svg { width: 26px; height: 12px; }

.ord-space svg { max-width: 360px; }
.ord-row { margin-bottom: .5rem; }
.ord-frames img { border-radius: 3px; }

.m-need li { padding: .6rem .9rem; font-size: .88rem; }
.m-head { flex-wrap: nowrap; }

/* ---------- ③ keep its language: next-word guesses before vs after ---------- */
.no-need { display: flex; justify-content: center; align-items: center; gap: .5rem; flex-wrap: wrap; margin: -1.5rem auto 2.25rem; font-size: .8rem; }
.no-need s { color: var(--ink-3); padding: .2rem .7rem; border: 1px solid var(--rule); border-radius: 99px; text-decoration-color: var(--forgot); text-decoration-thickness: 1.5px; }
.no-need span { font-weight: 600; color: var(--accent); margin-left: .2rem; }

.nw-cap { font-family: var(--serif); font-size: 1.15rem; line-height: 1.4; color: var(--ink); }
.nw-tag { display: block; font-family: var(--sans); font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .2rem; }
.nw-blank { display: inline-block; min-width: 2.4em; text-align: center; border-bottom: 2px solid var(--accent); color: var(--accent); font-family: var(--sans); font-weight: 600; font-size: .9rem; }
.nw-list { display: grid; gap: .5rem; margin-top: 1rem; }
.nw-row { display: grid; grid-template-columns: 62px 1fr; align-items: center; gap: .7rem; }
.nw-w { font-size: .8rem; font-weight: 500; text-align: right; color: var(--ink-2); }
.nw-bars { display: grid; gap: 3px; }
.nw-bars i { display: block; height: 8px; border-radius: 3px; transition: width .9s cubic-bezier(.2,.7,.2,1); }
.nw-bars i.b, .nw-legend i.b { background: #cfc9c1; }
.nw-bars i.r, .nw-legend i.r { background: var(--accent); }
.m-keep:not(.in) .nw-bars i { width: 0 !important; }
.nw-legend { display: flex; gap: 1rem; align-items: center; margin-top: .9rem; font-size: .68rem; color: var(--ink-3); }
.nw-legend span { display: inline-flex; align-items: center; gap: .35rem; }
.nw-legend i { width: 10px; height: 8px; border-radius: 2px; display: inline-block; }
.nw-legend .nw-ill { margin-left: auto; font-style: italic; }

/* ② frame numbers */
.ord-frames .fr { position: relative; display: block; }
.ord-frames .fr img { display: block; }
.ord-frames .fr::after, .ord-frames .gap::after {
  content: attr(data-n); position: absolute; left: 3px; top: 3px;
  font-size: .56rem; font-weight: 600; line-height: 1; color: var(--ink);
  background: rgba(255,255,255,.88); border-radius: 3px; padding: 2px 3px; font-variant-numeric: tabular-nums;
}
.ord-frames .gap { position: relative; }
.ord-frames .gap::after { background: none; color: var(--ink-3); text-decoration: line-through; }

/* ---------- 03: videos vs images context + annotated plot ---------- */
.iv-set { display: grid; grid-template-columns: 1fr auto 1fr; gap: .7rem; align-items: stretch; margin-top: 1rem; }
.iv-card { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: .75rem .85rem .8rem; background: var(--paper); }
.iv-card.vid { border-top: 3px solid var(--seen); }
.iv-card.img { border-top: 3px solid var(--sea-glass); }
.iv-k { font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.iv-th { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; margin: .45rem 0 .5rem; }
.iv-th img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 3px; }
.iv-th.loose img:nth-child(odd) { transform: rotate(-3deg); } .iv-th.loose img:nth-child(even) { transform: rotate(3deg) translateY(2px); }
.iv-th.loose { gap: 6px; }
.iv-card p { font-size: .74rem; font-weight: 300; color: var(--ink-3); line-height: 1.4; }
.iv-card p b { font-weight: 600; color: var(--ink-2); }
.iv-vs { align-self: center; font-family: var(--serif); font-style: italic; color: var(--ink-3); }
.iv-plot { position: relative; }
.iv-plot img { display: block; width: 100%; }
.iv-ann { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.figure-cap em { font-style: italic; color: var(--ink-2); }
@media (max-width: 560px) { .iv-set { grid-template-columns: 1fr; } .iv-vs { justify-self: center; } }

/* ---------- brighter palette: soft colour glow behind the header ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; }
.hero::before {
  content: ''; position: absolute; inset: -30% -10% 10% -10%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(38% 46% at 18% 38%, rgba(47,111,214,.13), transparent 70%),
    radial-gradient(30% 40% at 52% 22%, rgba(224,83,63,.09), transparent 70%),
    radial-gradient(40% 50% at 84% 42%, rgba(14,138,109,.14), transparent 70%);
  filter: blur(8px);
}
.kicker::before { color: var(--accent); }
h2.sec-title::after { opacity: 1; height: 3px; border-radius: 2px; }
.stat-num { color: var(--accent); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }

.m-link { color: inherit; text-decoration: underline; text-decoration-color: rgba(26,23,20,.25); text-underline-offset: 3px; transition: color .15s, text-decoration-color .15s; }
.m-link:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* plain white header (glow removed) */
.hero::before { display: none; }

/* neutral underlines only */
h2.sec-title::after { background: var(--rule-2) !important; height: 1.5px; width: 2.75rem; opacity: 1; }
.m-link:hover { color: inherit; text-decoration-color: var(--ink-2); }

/* ---------- section 02, calmer: quiz row, then the viewer ---------- */
.quiz-row {
  display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch;
  border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--paper);
  max-width: 940px; margin: 0 auto;
}
.quiz-row video { width: 100%; height: 100%; aspect-ratio: 16/9; object-fit: cover; background: #111; display: block; }
.quiz-body { padding: 1.4rem 1.5rem; display: flex; flex-direction: column; justify-content: center; }
.quiz-body .q { font-size: .98rem; }
.quiz-body .opts { margin-top: 1rem; }
.quiz-body .opt { background: var(--paper); }

.viewer-k {
  text-align: center; margin: 2.6rem 0 1rem;
  font-size: .66rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3);
  display: flex; align-items: center; justify-content: center; gap: .9rem;
}
.viewer-k::before, .viewer-k::after { content: ''; width: 3rem; height: 1px; background: var(--rule-2); }
.viewer { max-width: 760px; margin: 0 auto; }
.viewer .stepper { margin-bottom: 1.4rem; }
.viewer .gram-panel { grid-template-columns: 340px 1fr; gap: 2rem; align-items: center; }
.viewer .gram-where { min-height: 0; }

@media (max-width: 860px) {
  .quiz-row { grid-template-columns: 1fr; }
  .viewer .gram-panel { grid-template-columns: 1fr; }
  .viewer .gram-box { max-width: 360px; margin: 0 auto; width: 100%; }
}

.impl { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 560px) { .impl { grid-template-columns: 1fr; } }

/* ---------- section 02: side by side again, decluttered ---------- */
.split {
  display: grid; grid-template-columns: 1fr 1.15fr; align-items: stretch;
  border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; background: var(--paper);
}
.split .quiz-row { display: flex; flex-direction: column; border: 0; border-radius: 0; max-width: none; margin: 0; background: var(--bg-soft); border-right: 1px solid var(--rule); }
.split .quiz-row video { height: auto; }
.split .quiz-body { justify-content: flex-start; padding: 1.3rem 1.4rem 1.5rem; }
.split .viewer { max-width: none; margin: 0; padding: 1.5rem 1.6rem; display: flex; flex-direction: column; justify-content: center; }
.split .viewer .gram-panel { grid-template-columns: 1fr 190px; gap: 1.3rem; align-items: start; }
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .split .quiz-row { border-right: 0; border-bottom: 1px solid var(--rule); }
}
@media (max-width: 640px) {
  .split .viewer .gram-panel { grid-template-columns: 1fr; }
}

/* permanent model picks on the question options */
.opt .pick-tag { margin-left: auto; flex-shrink: 0; font-size: .64rem; font-weight: 600; letter-spacing: .04em; padding: .18rem .55rem; border-radius: 99px; color: #fff; white-space: nowrap; }
.opt .pick-tag.r { background: var(--accent); }
.opt .pick-tag.w { background: var(--forgot); }

/* ---------- 05 results: grouped bar plots ---------- */
.bc { --area: 270px; --top: 1.9rem; position: relative; padding-left: 2rem; }
.bc-layer { position: absolute; left: 2rem; right: 0; top: var(--top); height: var(--area); pointer-events: none; }
.bc-gridlines div { position: absolute; left: 0; right: 0; height: 0; border-top: 1px solid rgba(26,23,20,.06); }
.bc-gridlines div:first-child { border-top-color: rgba(26,23,20,.22); }
.bc-gridlines span { position: absolute; left: -2rem; width: 1.6rem; text-align: right; transform: translateY(-50%); font-size: .64rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.bc-chance { position: absolute; left: 0; right: 0; height: 0; border-top: 1.5px dashed rgba(26,23,20,.28); transition: bottom .6s cubic-bezier(.2,.7,.2,1); }
.bc-chance span { position: absolute; right: 0; top: -1.05rem; font-size: .6rem; letter-spacing: .06em; color: var(--ink-3); background: var(--paper); padding: 0 .3rem; }
.bc-secs { display: flex; gap: 2.2rem; position: relative; }
.bc-sec + .bc-sec { border-left: 1px dashed var(--rule-2); padding-left: 2.2rem; margin-left: -1.1rem; }
.bc-sec-t { height: var(--top); font-size: .62rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); white-space: nowrap; }
.bc-cols { display: grid; gap: .4rem; }
.bc-area { position: relative; height: var(--area); display: flex; align-items: flex-end; justify-content: center; }
.bc-pair { display: flex; align-items: flex-end; gap: 4px; height: 100%; width: 100%; max-width: 64px; }
.bc-b { position: relative; flex: 1; height: 0; border-radius: 5px 5px 1px 1px; transition: height .7s cubic-bezier(.2,.7,.2,1), background .3s; }
.bc-b.base { background: #d9d4cc; }
.bc-b.ours { background: linear-gradient(180deg, #14a07f, var(--accent)); box-shadow: 0 6px 16px -8px rgba(14,138,109,.55); }
.bc-b.ours.neg { background: linear-gradient(180deg, #ee6b58, var(--forgot)); box-shadow: none; }
.bc-b em { position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, -4px); font-style: normal; font-size: .62rem; font-weight: 500; color: var(--ink-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bc-b.ours em { color: var(--ink); font-weight: 600; }
.bc-gain { position: absolute; left: 50%; transform: translateX(-50%); font-size: .66rem; font-weight: 700; padding: .12rem .45rem; border-radius: 99px; white-space: nowrap; font-variant-numeric: tabular-nums; transition: bottom .7s cubic-bezier(.2,.7,.2,1); }
.bc-gain.pos { color: var(--accent); background: var(--accent-lt); }
.bc-gain.neg { color: var(--forgot); background: var(--forgot-lt); }
.bc-gain.zero { color: var(--ink-3); background: var(--bg-soft); }
.bc-name { margin-top: .6rem; text-align: center; font-size: .74rem; font-weight: 500; line-height: 1.25; color: var(--ink); }
.bc-name small { display: block; font-size: .62rem; font-weight: 300; color: var(--ink-3); margin-top: .1rem; }
.bc-name sup { color: var(--forgot); }
.lg-sq { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.chart-body { padding: 1.6rem 1.6rem 1.2rem; }
@media (max-width: 900px) {
  .chart-body { overflow-x: auto; }
  .bc { min-width: 820px; }
}

.bc-chance span { display: none; }

/* ---------- analysis: supervised vs ReGAIN on the same video ---------- */
.sft .q-head { margin-bottom: 1rem; }
.sft-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sft-p { border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1rem 1.1rem 1.1rem; display: flex; flex-direction: column; gap: .9rem; }
.sft-p.ours { border-color: #a6e3d2; background: linear-gradient(180deg, #f3fcf8, #fff 60%); }
.sft-k { display: flex; align-items: center; gap: .5rem; font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.sft-k i { width: 9px; height: 9px; border-radius: 50%; background: #bdb6ad; }
.sft-p.ours .sft-k i { background: var(--accent); }
.sft-p.ours .sft-k { color: var(--accent); }
.sft-only { font-size: .64rem; font-weight: 600; color: var(--accent); background: var(--accent-lt); padding: .1rem .5rem; border-radius: 99px; }
.sft-row { display: grid; grid-template-columns: 104px 1fr; gap: 1rem; align-items: start; }
.sft-vid video { width: 100%; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; background: #111; display: block; }
.sft-vid span { display: block; text-align: center; font-size: .62rem; color: var(--ink-3); margin-top: .3rem; }
.sft-qa { border: 1px solid var(--rule); border-radius: var(--r); padding: .75rem .85rem; background: var(--paper); }
.sft-tag { display: block; font-size: .58rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .25rem; }
.sft-tag.lab { margin-top: .7rem; color: #c58a1e; }
.sft-qt { font-size: .86rem; font-weight: 600; line-height: 1.35; margin-bottom: .35rem; }
.sft-o { font-size: .76rem; font-weight: 300; color: var(--ink-2); line-height: 1.5; }
.sft-ans { display: inline-flex; gap: .4rem; align-items: center; font-family: var(--serif); font-size: 1rem; padding: .3rem .7rem; border: 1.5px solid #f0c77a; background: #fff8ea; border-radius: var(--r); }
.sft-ans b { color: var(--accent); font-family: var(--sans); }
.sft-qa.struck { color: var(--ink-3); }
.sft-qa.struck s { text-decoration-color: var(--forgot); text-decoration-thickness: 1.5px; color: #b9b3ab; }
.sft-qa.struck .sft-qt, .sft-qa.struck .sft-o { color: #b9b3ab; }
.sft-qa.struck .sft-ans { border-color: var(--rule); background: var(--bg-soft); }
.sft-none { margin-top: .55rem; font-size: .7rem; font-weight: 600; color: var(--forgot); }
.sft-gain { display: flex; align-items: center; gap: 1.4rem; margin-top: auto; padding-top: .8rem; border-top: 1px dashed var(--rule-2); }
.sft-gain div { display: flex; flex-direction: column; }
.sft-gain b { font-family: var(--serif); font-weight: 400; font-size: 1.7rem; line-height: 1; color: #9c958c; font-variant-numeric: tabular-nums; }
.sft-p.ours .sft-gain b { color: var(--accent); }
.sft-gain span { font-size: .64rem; color: var(--ink-3); margin-top: .2rem; }
.sft-x { margin-left: auto; font-style: normal; font-size: .8rem; font-weight: 700; color: #fff; background: var(--accent); padding: .3rem .7rem; border-radius: 99px; }
@media (max-width: 760px) { .sft-grid { grid-template-columns: 1fr; } }

/* ---------- chiral pair (opening vs closing) in the probe card ---------- */
.chiral { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: .8rem; margin: .4rem 0 1rem; }
.chiral figure { margin: 0; text-align: center; }
.chiral video { width: 100%; max-width: 150px; aspect-ratio: 9/16; object-fit: cover; border-radius: 8px; background: #111; display: block; margin: 0 auto; border: 3px solid transparent; }
.chiral .ch-a video { border-color: #f0a23b; }
.chiral .ch-b video { border-color: #8b6fd6; }
.chiral figcaption { margin-top: .4rem; font-size: .76rem; font-weight: 600; }
.chiral .ch-a figcaption { color: #c97f10; } .chiral .ch-b figcaption { color: #6d52c0; }
.ch-x { display: flex; flex-direction: column; align-items: center; color: var(--ink-3); }
.ch-x svg { width: 40px; height: 14px; }
.ch-x small { font-size: .6rem; line-height: 1.25; text-align: center; margin-top: .25rem; }

/* chiral pair selector + per-pair video shape */
.ch-tabs { display: flex; flex-wrap: wrap; gap: .35rem; margin: .2rem 0 .8rem; }
.ch-tabs button { appearance: none; font: inherit; font-size: .72rem; font-weight: 500; color: var(--ink-3); background: var(--paper); border: 1px solid var(--rule); border-radius: 99px; padding: .22rem .75rem; cursor: pointer; transition: all .15s; }
.ch-tabs button:hover { color: var(--ink); border-color: var(--rule-2); }
.ch-tabs button.on { color: #fff; background: var(--ink); border-color: var(--ink); }
.chiral[data-shape="tall"] video { aspect-ratio: 9/16; max-width: 150px; }
.chiral[data-shape="wide"] video { aspect-ratio: 16/9; max-width: none; object-fit: cover; }
.ch-src { font-size: .66rem !important; color: var(--ink-3); text-align: center; margin: -.4rem 0 .8rem; }

/* ---------- probe card: all four chiral pairs at once ---------- */
.probe-sub { margin-top: -.2rem; }
.probe-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 2rem; align-items: center; margin-top: 1rem; }
.ch-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.ch-pair { position: relative; display: grid; grid-template-columns: 1fr 26px 1fr; align-items: center; gap: .3rem; border: 1px solid var(--rule); border-radius: var(--r-lg); padding: 1.4rem .6rem .6rem; }
.ch-pair figure { margin: 0; text-align: center; }
.ch-pair video { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #111; display: block; border: 2.5px solid transparent; }
.ch-pair .ch-a video { border-color: #f0a23b; }
.ch-pair .ch-b video { border-color: #8b6fd6; }
.ch-pair figcaption { margin-top: .35rem; font-size: .66rem; font-weight: 600; line-height: 1.25; }
.ch-pair .ch-a figcaption { color: #c97f10; } .ch-pair .ch-b figcaption { color: #6d52c0; }
.ch-pair .ch-x { margin-top: -1.1rem; }
.ch-pair .ch-x svg { width: 24px; height: 10px; }
.ch-ds { position: absolute; top: .35rem; left: .6rem; font-size: .56rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.probe-nums { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--r-lg); overflow: hidden; }
.probe-nums div { background: var(--paper); padding: .7rem .9rem; }
.probe-nums span { display: block; font-size: .6rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.probe-nums b { font-family: var(--serif); font-weight: 400; font-size: 1.35rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.probe-cap { font-size: .72rem !important; margin: .45rem 0 0; }
.probe-res img { margin-top: .8rem; }
.card.vi img { max-width: 760px; margin-left: auto; margin-right: auto; display: block; }
@media (max-width: 960px) { .probe-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .ch-grid { grid-template-columns: 1fr; } }

/* =====================================================================
   Stick-figure artwork: header margins, scrolling companion, film strip
   ===================================================================== */
/* 1. header margins (only where there is real empty space) */
.art-hero-wrap { display: none; position: absolute; inset: 0; pointer-events: none; }
.art-hero { position: absolute; top: 84px; width: 210px; height: auto; overflow: visible; }
.art-hero.l { left: calc(50% - 660px); }
.art-hero.r { right: calc(50% - 660px); }
@media (min-width: 1400px) { .art-hero-wrap { display: block; } }
@media (min-width: 1400px) and (prefers-reduced-motion: no-preference) {
  .art-hero { opacity: 0; animation: fadeUp .9s ease .5s forwards; }
  .art-hero.r { animation-delay: .8s; }
}

/* 2. companion: one small figure in the left margin, mood follows the section */
.buddy { display: none; position: fixed; z-index: 20; bottom: 7vh; left: calc(50% - 530px - 150px); width: 110px; height: 170px; pointer-events: none;
  opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.buddy.on { opacity: 1; transform: none; }
.buddy-s { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transform: scale(.92); transition: opacity .45s ease, transform .45s ease; overflow: visible; }
.buddy[data-s="seen"] .buddy-s[data-s="seen"],
.buddy[data-s="forgot"] .buddy-s[data-s="forgot"],
.buddy[data-s="regain"] .buddy-s[data-s="regain"] { opacity: 1; transform: none; }
@media (min-width: 1400px) { .buddy { display: block; } }

/* 3. film strip under the one-sentence summary */
.art-strip { max-width: 480px; margin: 2.4rem auto 0; }
.art-strip svg { width: 100%; height: auto; display: block; overflow: visible; }

.art-hero { top: 96px; width: 230px; }
.art-hero.l { left: calc(50% - 680px); } .art-hero.r { right: calc(50% - 680px); }

.art-hero { top: 40px; width: 240px; }
.art-hero.l { left: calc(50% - 700px); } .art-hero.r { right: calc(50% - 700px); }

/* Paper button: light emerald instead of black */
.btn-primary { background: var(--accent-lt); color: var(--accent); border-color: #a6e3d2; }
.btn-primary:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Paper button: plain, same as the other outline buttons */
.btn-primary { background: transparent; color: var(--ink); border-color: var(--rule-2); }
.btn-primary:hover { background: var(--bg-soft); color: var(--ink); border-color: var(--ink-3); }

/* slightly larger authors + affiliations */
.authors { font-size: 1.02rem; }
.affil { font-size: .9rem; }

/* 04: "original" point in the final-token space is hollow, not filled black */
.tk.o circle { fill: #fff; stroke: var(--ink); stroke-width: 2.5; }

/* =====================================================================
   Phone-only fixes (≤ 640px). Nothing here applies on laptop/desktop.
   ===================================================================== */
@media (max-width: 640px) {
  /* 07 · grounding timelines use the full width */
  .ground { padding: 1.1rem 1rem; }
  .ground-head { flex-direction: column; gap: .4rem; }
  .ground-meta { text-align: left; }
  .ground .tl { --tl-l: 0px; --tl-r: 0px; }
  .ground .tl-frames, .ground .tl-axis { margin-left: 0; margin-right: 0; }
  .ground .tl-frames { grid-template-columns: repeat(8, 1fr); }
  .ground .tl-frames img:nth-child(odd) { display: none; }
  .ground .tl-track { grid-template-columns: 1fr; row-gap: .2rem; height: auto; margin-top: .35rem; }
  .ground .tl-label { text-align: left; grid-column: 1; }
  .ground .tl-bar { grid-column: 1; height: 24px; }
  .ground .tl-ans { grid-column: 1; }
  .ground-foot { grid-template-columns: 1fr; }
  .gt-media { justify-content: flex-start; }
  .gt-media video, .gt-media img { height: auto; width: 46%; max-width: 180px; }

  /* 02 · step titles fit, model picks sit under the answer text */
  .stepper { gap: .35rem; }
  .step { padding: .55rem .55rem .6rem; }
  .step .t { font-size: 1.02rem; }
  .opt { flex-wrap: wrap; row-gap: .35rem; }
  .opt .pick-tag { margin-left: 2.1rem; }
}

@media (max-width: 640px) {
  /* 06 · keep every analysis card within the screen (no page widening / re-zoom on scroll) */
  .ana-grid { grid-template-columns: minmax(0, 1fr); }
  .ana-grid > .card, .ana-grid > .card.span2 { grid-column: 1 / -1; min-width: 0; }
  .sft-grid, .probe-grid, .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .sft-row { grid-template-columns: 88px minmax(0, 1fr); gap: .8rem; }
  .ch-pair { grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr); }
  .ab-head .tabs { width: 100%; }
  .bar-legend { flex-wrap: wrap; }
  .keep { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) { .card.vi img { max-width: 100%; width: 100%; } }

/* hover vs tap wording (touch screens say "tap"; laptops unchanged) */
.on-touch { display: none; }
@media (hover: none) { .on-hover { display: none; } .on-touch { display: inline; } }

@media (max-width: 640px) {
  /* 07 · Vinoground figure: readable size, swipe sideways inside its card */
  .qual-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: .6rem; }
  .qual-scroll img { width: 720px; max-width: none; }
  /* 07 · ground-truth clips: caption sits under its own image */
  .gt-media figure { width: 46%; max-width: 180px; margin: 0; text-align: center; }
  .gt-media figure video, .gt-media figure img { width: 100%; max-width: none; }
}
