/* ============================================================
   MemHarmBench project page.
   Visual system adapted from the CUA-Lite landing page (https://cua-lite.github.io/),
   used with its author's permission: ivory canvas, soft taupe ink, ONE terracotta
   accent; Fraunces display with an italic accent, Urbanist body, Geist Mono for
   everything the machine says.
   ============================================================ */

@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/Fraunces.woff2') format('woff2'); font-weight: 300 700; font-style: normal; font-display: swap; }
@font-face { font-family: 'Fraunces'; src: url('../assets/fonts/Fraunces-Italic.woff2') format('woff2'); font-weight: 300 700; font-style: italic; font-display: swap; }
@font-face { font-family: 'Urbanist'; src: url('../assets/fonts/Urbanist.woff2') format('woff2'); font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('../assets/fonts/GeistMono.woff2') format('woff2'); font-weight: 400 600; font-style: normal; font-display: swap; }

:root {
  --ease: cubic-bezier(.33, 0, .15, 1);
  --bg:      #faf4e8;
  --panel:   #f2eadb;
  --panel-2: #ece2d1;
  --line:    rgba(60,48,36,.11);
  --line-2:  rgba(60,48,36,.18);
  --text:    #453d33;
  --muted:   #6f665a;
  --dim:     #a89e8c;
  --accent:  #bd5a38;
  --accent-dim: rgba(189,90,56,.5);
  --accent-wash: rgba(189,90,56,.08);
  /* data-only colours: the attacker's value vs the verified value (never used on chrome) */
  --bad:  #a8492b;
  --good: #3f8a6c;

  --serif: 'Fraunces', Georgia, serif;
  --sans:  'Urbanist', -apple-system, system-ui, sans-serif;
  --mono:  'Geist Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* type scale — pick a role, never a number (CUA-Lite's ladder) */
  --fs-2xs: 10px;
  --fs-xs:  11px;
  --fs-sm:  12.5px;
  --fs-md:  14px;
  --fs-lg:  15px;
  --fs-xl:  16.5px;
  --fs-2xl: 17.5px;

  --panel-fill: #fefaf0;
  --panel-edge: #e7ddc9;

  --term-bg:    #16140e;
  --term-fill:  #1b1912;
  --term-edge:  #322e22;
  --term-text:  #ece6d4;
  --term-muted: #a49c88;
  --term-dim:   #6f6a58;
  --term-accent: #ef9d62;

  /* the depicted workspace window — light app chrome, like CUA-Lite's browser mockup */
  --win:     #fbfaf6;
  --win-bar: #e3e1da;
  --win-side: #f0eee7;
  --win-edge: #dcd9cf;
  --win-ink: #2a2e27;
  --win-sub: #8a8f86;

  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { overflow-x: clip; scroll-behavior: smooth; scroll-padding-top: 84px; scrollbar-gutter: stable; }
body {
  margin: 0; color: var(--text);
  background:
    radial-gradient(72% 55% at 86% 0%, rgba(240,206,190,.55), transparent 60%),
    radial-gradient(66% 52% at 4% 6%, rgba(238,210,197,.45), transparent 62%),
    var(--bg);
  background-attachment: fixed;
  font-family: var(--sans); font-size: 16px; line-height: 1.65; font-weight: 450;
  overflow-x: clip; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent); color: #fff7f0; }
a { color: var(--text); text-decoration: none; }
a:focus-visible, button:focus-visible, .plat:focus-visible, .stat:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 28px; }
.nb { white-space: nowrap; }
.sep { color: var(--dim); }
code { font-family: var(--mono); font-size: .9em; }

/* ---------- type roles ---------- */
.eyebrow { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 2.5px; text-transform: uppercase; color: var(--dim); margin: 0 0 22px; }
h1 { font-family: var(--serif); font-weight: 350; font-variation-settings: 'opsz' 144, 'wght' 350, 'SOFT' 0, 'WONK' 0; font-size: clamp(46px, 5.6vw, 80px); line-height: 1.0; letter-spacing: -0.025em; margin: 0 0 18px; }
h2 { font-family: var(--serif); font-weight: 370; font-variation-settings: 'opsz' 144, 'wght' 370, 'SOFT' 0, 'WONK' 0; font-size: clamp(34px, 4.6vw, 60px); line-height: 1.04; letter-spacing: -0.02em; margin: 0 0 26px; text-wrap: balance; }
h1 em, h2 em { font-style: italic; color: var(--accent); font-variation-settings: 'opsz' 144, 'wght' 400, 'SOFT' 0, 'WONK' 0; }
.h1-hinge { color: var(--muted); }

@keyframes blink { 50% { opacity: 0; } }

/* ---------- buttons ---------- */
.btn-solid {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: var(--fs-lg);
  background: var(--accent); color: #f6f2e8; padding: 12px 26px; border-radius: 999px; border: 0;
  box-shadow: 0 8px 20px -12px rgba(189,90,56,.65);
  transition: transform .14s var(--ease), filter .14s ease, box-shadow .2s var(--ease);
}
.btn-solid:hover { filter: brightness(1.04); transform: translateY(-2px); box-shadow: 0 12px 26px -12px rgba(189,90,56,.7); }
.btn-solid:active { transform: translateY(0); }
.btn-solid.sm { padding: 8px 18px; font-size: var(--fs-md); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-weight: 600; font-size: var(--fs-lg);
  color: var(--text); padding: 12px 26px; border-radius: 999px;
  border: 1px solid var(--panel-edge); background: var(--panel-fill);
  transition: border-color .14s ease, background .14s ease, transform .14s var(--ease);
}
.btn-ghost:hover { border-color: var(--accent-dim); background: #fff; transform: translateY(-1px); }
.btn-ghost.sm { padding: 7px 17px; font-size: var(--fs-md); font-weight: 600; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }
.cta-row .btn-solid, .cta-row .btn-ghost { min-width: 112px; justify-content: center; }
.cta-row.center { justify-content: center; margin-top: 36px; }
.closing { text-align: center; padding-top: 40px; }
.closing-line { font-family: var(--serif); font-weight: 400; font-size: clamp(28px, 3.2vw, 42px); letter-spacing: -0.01em; color: var(--text); margin: 0; text-wrap: balance; }
.closing-line em { font-style: italic; color: var(--accent); }
.closing-line .h1-hinge { color: var(--muted); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; background: rgba(250,244,232,.72); backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15); border-bottom: 1px solid var(--line); }
.nav-inner { max-width: var(--maxw); margin: 0 auto; padding: 14px 28px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark { width: 28px; height: 28px; flex: none; background: url('../assets/logo-128.png') center/contain no-repeat; }
.brand-name { font-family: var(--sans); font-weight: 700; font-size: var(--fs-xl); letter-spacing: -0.01em; white-space: nowrap; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { color: var(--muted); font-size: var(--fs-md); font-weight: 500; transition: color .12s ease; }
.nav-links a:hover { color: var(--text); }
.nav-links .btn-solid { color: #f6f2e8; }
.nav-links .btn-ghost { color: var(--text); background: transparent; border-color: var(--line-2); }
.nav-links .btn-ghost:hover { background: #fff; }
.nav-links .btn-ghost.sm, .nav-links .btn-solid.sm { min-width: 74px; justify-content: center; }
.nav-cta { display: flex; align-items: center; gap: 10px; }
.nav-sep { width: 1px; height: 15px; background: var(--line-2); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 36px; position: relative; overflow: visible; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background:
    radial-gradient(48% 54% at 80% 22%, rgba(243,198,179,.45), transparent 62%),
    radial-gradient(44% 52% at 58% 62%, rgba(238,212,197,.34), transparent 66%);
  filter: blur(26px);
  animation: heroDrift 26s var(--ease) infinite alternate;
}
@keyframes heroDrift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(-2.5%, 1.8%, 0) scale(1.07); } }
.hero-grid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 0.96fr) minmax(0, 1.04fr); gap: 52px; align-items: start; }
.hero-head { max-width: 560px; padding-top: 6px; }
.hero-demo { position: relative; display: flex; flex-direction: column; gap: 14px; }
.hero-demo > * { min-width: 0; }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-head > * { animation: heroIn .6s var(--ease) both; }
.hero-head > *:nth-child(1) { animation-delay: .02s; }
.hero-head > *:nth-child(2) { animation-delay: .1s; }
.hero-head > *:nth-child(3) { animation-delay: .18s; }
.hero-head > *:nth-child(4) { animation-delay: .26s; }
.hero-head > *:nth-child(5) { animation-delay: .34s; }
.hero-head > *:nth-child(6) { animation-delay: .4s; }
.hero-demo { animation: heroIn .68s var(--ease) .46s both; }

.hero-sub { font-family: var(--serif); font-weight: 400; font-variation-settings: 'opsz' 48; font-size: clamp(20px, 1.85vw, 25px); line-height: 1.28; letter-spacing: -0.01em; color: var(--text); margin: 0 0 22px; text-wrap: balance; }
.hero-people { margin: 0 0 30px; }
.authors { margin: 0; font-size: var(--fs-lg); line-height: 1.6; color: var(--text); font-weight: 500; }
.authors a { color: var(--text); box-shadow: inset 0 -1px 0 var(--line-2); transition: color .14s ease, box-shadow .14s ease; }
.authors a:hover { color: var(--accent); box-shadow: inset 0 -1px 0 var(--accent-dim); }
.authors sup, .affils sup { font-family: var(--mono); font-size: 9.5px; color: var(--accent); margin-left: 1px; }
.affils { margin: 8px 0 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--muted); }
.affils .sep { margin: 0 3px; }

.lead-claims { list-style: none; margin: 0 0 34px; padding: 0; display: grid; gap: 12px; max-width: 520px; }
.lead-claims li { display: grid; grid-template-columns: 16px 1fr; align-items: start; }
.lead-claims li::before { content: ""; width: 7px; height: 7px; background: var(--accent); margin-top: 10px; }
.claim-t { color: var(--muted); font-size: var(--fs-xl); line-height: 1.6; text-wrap: pretty; }
.lead-claims b { color: var(--text); font-weight: 650; }
/* the victim words in the lead ARE the control — hover to switch the case */
.plat { color: var(--text); cursor: pointer; padding-bottom: 1px; white-space: nowrap;
  box-shadow: inset 0 -1.5px 0 var(--line-2); transition: color .25s ease, box-shadow .25s ease; }
.plat:hover, .plat.on { color: var(--accent); box-shadow: inset 0 -2px 0 var(--accent); }

/* stats — concise by default, the full list on hover */
.stats { position: relative; list-style: none; display: flex; flex-wrap: nowrap; align-items: baseline; padding: 0; margin: 40px 0 0;
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.stat { position: static; cursor: default; display: inline-flex; align-items: baseline; gap: 5px; }
.stat:not(:last-child)::after { content: "·"; margin: 0 11px; color: var(--dim); }
.stat-n { color: var(--accent); font-weight: 700; font-size: var(--fs-xl); letter-spacing: 0; }
.stat-pop { position: absolute; top: 100%; left: 0; margin-top: 18px; z-index: 30; width: max-content; max-width: min(500px, calc(100vw - 40px)); white-space: normal;
  background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 14px;
  box-shadow: 0 28px 52px -28px rgba(40,30,15,.46), 0 3px 8px -4px rgba(40,30,15,.16);
  padding: 17px 19px 16px; text-transform: none; text-align: left;
  opacity: 0; transform: translateY(-6px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.stat.pop-open .stat-pop, .stat:focus-within .stat-pop { opacity: 1; transform: none; pointer-events: auto; }
.pop-grp { display: block; margin-top: 13px; }
.pop-grp:first-of-type { margin-top: 0; }
.pop-cat { display: block; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-dim); margin-bottom: 6px; }
.pop-list { display: flex; flex-wrap: wrap; gap: 3px 20px; }
.pop-item { display: inline-flex; align-items: baseline; gap: 6px; font-family: var(--sans); font-size: var(--fs-md); font-weight: 500; letter-spacing: 0; color: var(--text); padding: 2px 0; }
.pop-item i { font-style: normal; font-family: var(--mono); font-size: var(--fs-2xs); color: var(--dim); letter-spacing: .5px; }

/* ---------- terminal — stays dark on the cream page ---------- */
.term { position: relative; background: var(--term-fill); color: var(--term-text); border: 1px solid var(--term-edge); border-radius: 8px; overflow: hidden;
  box-shadow: 0 20px 44px -26px rgba(40,30,15,.5);
  --accent: var(--term-accent); }
.term::after { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.022) 0 1px, transparent 1px 3px); }
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--term-edge); }
.term-bar .d { width: 10px; height: 10px; border-radius: 50%; background: #3a352a; }
.term-title { margin-left: 10px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--term-dim); }
.term-copy { position: relative; z-index: 2; margin-left: auto; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--term-dim); background: transparent; border: 0; cursor: pointer; padding: 3px 4px; transition: color .12s ease; }
.term-copy:hover { color: var(--term-text); }
.term-copy.done { color: var(--term-accent); }
.term-body { margin: 0; padding: 20px 24px; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.8; color: var(--term-text); white-space: pre-wrap; word-break: break-word; }
.t-dim { color: var(--term-dim); }
.t-kw  { color: #9ecbff; }
.t-str { color: var(--term-accent); }

/* ============================================================
   the hero device — an agent workspace walked through one case:
   session 1 (exposure) → retention check → session 2 (trigger) → judge.
   ============================================================ */
.stage { position: relative; }
.stage::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 92%; height: 40px; transform: translateX(-50%);
  z-index: -1; pointer-events: none; filter: blur(16px);
  background: radial-gradient(50% 50% at 50% 50%, rgba(40,30,15,.32), rgba(40,30,15,.12) 50%, transparent 74%); }
.ws { position: relative; background: var(--win); border-radius: 11px; overflow: hidden;
  box-shadow: 0 24px 50px -30px rgba(40,30,15,.5), 0 0 0 1px rgba(0,0,0,.09); }
.ws-bar { display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 12px; background: var(--win-bar); box-shadow: inset 0 -1px 0 var(--win-edge); }
.bw-lights { display: inline-flex; gap: 6px; flex: none; }
.bw-lights i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.bw-lights i:nth-child(1) { background: #ff5f57; } .bw-lights i:nth-child(2) { background: #febc2e; } .bw-lights i:nth-child(3) { background: #28c840; }
.ws-title { min-width: 0; font-family: var(--sans); font-weight: 600; font-size: 11.5px; color: var(--win-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-session { margin-left: auto; flex: none; font-family: var(--mono); font-size: 9.5px; letter-spacing: 1.1px; text-transform: uppercase; color: var(--accent);
  background: rgba(189,90,56,.1); box-shadow: inset 0 0 0 1px rgba(189,90,56,.28); border-radius: 999px; padding: 3px 10px; transition: background .3s ease, color .3s ease; }
.ws-session.flash { animation: sessFlash .7s var(--ease); }
@keyframes sessFlash { 0%, 30% { background: var(--accent); color: #fff7f0; } 100% { background: rgba(189,90,56,.1); color: var(--accent); } }
.ws-body { display: grid; grid-template-columns: 158px minmax(0, 1fr); height: 292px; }
.ws-side { background: var(--win-side); box-shadow: inset -1px 0 0 var(--win-edge); padding: 11px 8px; min-width: 0; }
.ws-label { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--win-sub); margin: 0 0 7px 4px; }
.ws-files { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.ws-dir { font-family: var(--mono); font-size: 9.5px; color: var(--win-sub); padding: 6px 4px 1px; }
.ws-f { position: relative; display: flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 10.5px; line-height: 1.25; color: var(--win-ink);
  padding: 5px 6px 5px 10px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 30px;
  transition: background .2s ease, box-shadow .2s ease, opacity .45s ease, max-height .45s var(--ease), padding .45s var(--ease); }
.ws-f::before { content: ""; flex: none; width: 8px; height: 10px; border-radius: 1.5px; background: #c9c5ba; clip-path: polygon(0 0, 62% 0, 100% 30%, 100% 100%, 0 100%); }
.ws-f.carrier::before { background: var(--accent); }
.ws-f span { overflow: hidden; text-overflow: ellipsis; }
.ws-f.open { background: #fff; box-shadow: 0 0 0 1px var(--win-edge), 0 2px 5px -2px rgba(40,30,15,.18); }
.ws-f.press { background: #fff; }
.ws-f.gone { opacity: .35; text-decoration: line-through; }
.ws-f.gone.collapse { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
.ws-main { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; min-width: 0; min-height: 0; }
.ws-msg { flex: none; background: #fff; border: 1px solid #e6e3da; border-radius: 9px; padding: 6px 10px 7px; transition: opacity .3s ease, transform .35s var(--ease); }
.ws-msg.swap { opacity: 0; transform: translateY(5px); }
.ws-who { display: block; font-family: var(--mono); font-size: 9px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--win-sub); margin-bottom: 2px; }
.ws-msg-text { margin: 0; font-family: var(--sans); font-size: 11.5px; line-height: 1.42; color: var(--win-ink); font-weight: 500; }
.ws-file { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: #fff; border: 1px solid #e6e3da; border-radius: 9px; overflow: hidden;
  transition: opacity .3s ease, transform .35s var(--ease); }
.ws-file.empty { opacity: 0; transform: translateY(6px); }
.ws-file-tab { flex: none; font-family: var(--mono); font-size: 10px; color: #565a50; background: #f6f5f0; padding: 5px 10px; box-shadow: inset 0 -1px 0 #eceae3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-file-body { flex: 1; min-height: 0; margin: 0; padding: 7px 10px; font-family: var(--mono); font-size: 10px; line-height: 1.55; color: var(--win-ink);
  white-space: pre-wrap; word-break: break-word; overflow: hidden; scroll-behavior: smooth; }
.ws-file-body mark { color: inherit; border-radius: 2px; padding: 0 1px; }
.ws-file-body mark.bad { background: rgba(189,90,56,.15); box-shadow: inset 0 -1.5px 0 rgba(189,90,56,.6); }
.ws-file-body mark.bad b { color: var(--bad); font-weight: 600; }
.ws-file-body mark.good { background: rgba(63,138,108,.13); box-shadow: inset 0 -1.5px 0 rgba(63,138,108,.55); }
.ws-chips { flex: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0 10px 8px; }
.ws-chips:empty { display: none; }
.chip { display: inline-flex; align-items: center; gap: 5px; font-family: var(--mono); font-size: 9.5px; border-radius: 999px; padding: 2px 8px; white-space: nowrap; animation: chipIn .35s var(--ease) both; }
.chip-bad { color: var(--bad); background: rgba(189,90,56,.1); box-shadow: inset 0 0 0 1px rgba(189,90,56,.28); }
.chip-good { color: var(--good); background: rgba(63,138,108,.1); box-shadow: inset 0 0 0 1px rgba(63,138,108,.3); }
@keyframes chipIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
/* the verdict card — the case's own scoring conditions, judged on the trigger episode */
.ws-judge { position: absolute; inset: 10px 12px; z-index: 3; display: flex; flex-direction: column; gap: 7px; background: #fffdf8; border: 1px solid var(--panel-edge); border-radius: 10px;
  padding: 10px 12px; box-shadow: 0 18px 34px -22px rgba(40,30,15,.45);
  opacity: 0; transform: translateY(10px); pointer-events: none; transition: opacity .35s ease, transform .45s var(--ease); }
.ws-judge.show { opacity: 1; transform: none; pointer-events: auto; }
.wj-k { font-family: var(--mono); font-size: 9px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--win-sub); }
.wj-row { display: grid; grid-template-columns: 38px 1fr; gap: 8px; align-items: baseline; }
.wj-id { font-family: var(--mono); font-size: 10px; font-weight: 600; color: var(--accent); }
.wj-t { font-family: var(--sans); font-size: 11px; line-height: 1.38; color: var(--win-ink); }
.wj-t b { font-family: var(--mono); font-weight: 600; font-size: 10px; color: var(--bad); }
.wj-rate { margin-top: auto; padding-top: 7px; border-top: 1px solid var(--line); font-family: var(--mono); font-size: 10px; color: var(--muted); line-height: 1.5; }
.wj-rate b { color: var(--accent); font-weight: 600; }
.ws-mem { position: relative; background: #f7f2e7; box-shadow: inset 0 1px 0 var(--win-edge); padding: 8px 12px 10px; height: 78px; overflow: hidden; }
.ws-mem-head { display: flex; align-items: baseline; gap: 10px; }
.ws-mem-head .ws-label { margin: 0; }
.ws-mem-tag { font-family: var(--mono); font-size: 9px; letter-spacing: .4px; color: var(--accent-dim); }
.ws-mem-text { margin: 4px 0 0; font-family: var(--mono); font-size: 10.5px; line-height: 1.5; color: var(--win-ink); min-height: 2.9em; }
.ws-mem.kept { box-shadow: inset 0 1px 0 var(--win-edge), inset 3px 0 0 var(--accent); }
.typed.caret::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 1px; background: var(--accent); vertical-align: -0.15em; animation: blink 1s steps(1) infinite; }
/* the agent's pointer + a ring pulse on click (CUA-Lite's engine) */
.mouse-cur { position: absolute; left: 0; top: 0; margin: -1px 0 0 -2px; width: 21px; height: 32px; background: url('../assets/cursor.png') top left/contain no-repeat; image-rendering: pixelated; filter: drop-shadow(0 2px 3px rgba(0,0,0,.45)); transform: translate3d(0,0,0); transition: transform .42s var(--ease); will-change: transform; z-index: 8; pointer-events: none; }
.spark { position: absolute; width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(189,90,56,.65);
  transform: translate(-50%,-50%) scale(.3); opacity: 0; z-index: 7; pointer-events: none; }
.spark.go { animation: tap .52s ease-out 1; }
@keyframes tap { 0% { opacity: .7; transform: translate(-50%,-50%) scale(.3); } 100% { opacity: 0; transform: translate(-50%,-50%) scale(1.2); } }

/* the walkthrough streams as a log under the window */
.rollout { font-family: var(--mono); font-size: var(--fs-sm); min-height: 262px;
  --accent: var(--term-accent);
  background: var(--term-fill); color: var(--term-text); border: 1px solid var(--term-edge); border-radius: 8px;
  padding: 15px 18px 14px; box-shadow: 0 20px 44px -26px rgba(40,30,15,.5); }
.rl-cmd { font-size: var(--fs-sm); line-height: 1.55; color: var(--term-muted); padding-bottom: 11px; border-bottom: 1px solid var(--term-edge); word-break: break-all; }
.rl-cmd .c-p { color: var(--term-accent); } .rl-cmd .c-val { color: var(--term-text); }
.rl-log { margin-top: 11px; display: flex; flex-direction: column; gap: 7px; }
.rl-line { display: flex; align-items: baseline; color: var(--term-text); line-height: 1.45; opacity: 0; transform: translateY(3px); animation: rlIn .22s ease forwards; }
.rl-mark { color: var(--term-dim); margin-right: 10px; flex-shrink: 0; }
.rl-text { min-width: 0; word-break: break-word; }
.rl-text .q { color: var(--term-muted); }
.rl-lat { margin-left: auto; padding-left: 14px; color: var(--term-dim); flex-shrink: 0; font-size: var(--fs-2xs); letter-spacing: 1px; text-transform: uppercase; }
.rl-line.think { color: var(--term-muted); }
.rl-line.done { color: var(--term-accent); font-weight: 500; }
.rl-line.done .rl-mark { color: var(--term-accent); }
.rl-line.live .caret { display: inline-block; width: 6px; height: 1.05em; margin-left: 3px; background: var(--term-accent); vertical-align: -0.15em; animation: blink 1s steps(1) infinite; }
@keyframes rlIn { to { opacity: 1; transform: none; } }
.demo-note { margin: 0; font-family: var(--mono); font-size: var(--fs-xs); color: var(--dim); text-align: right; }
.demo-note a { color: var(--muted); box-shadow: inset 0 -1px 0 var(--line-2); }
.demo-note a:hover { color: var(--accent); }

/* ---------- divider ---------- */
.divider { position: relative; display: flex; align-items: center; justify-content: center; padding: 22px 0; }
.flightline { width: 52px; height: 1px; background: var(--line-2); }
.js-reveal .flightline { transform: scaleX(0); }
.js-reveal .divider.in .flightline { transform: scaleX(1); transition: transform .9s var(--ease) .1s; }

/* scroll reveal — content settles up as you reach it (only when JS is on) */
.js-reveal .reveal { opacity: 0; transform: translateY(20px); transition: opacity .5s ease, transform .58s var(--ease); }
.js-reveal .reveal.in { opacity: 1; transform: none; transition-delay: var(--rev-delay, 0s); }

/* ---------- sections ---------- */
.section { padding: 120px 0 24px; }
.section-lead { max-width: 640px; margin: 0 0 52px; color: var(--muted); font-size: var(--fs-xl); line-height: 1.62; text-wrap: pretty; }
.section-lead a { color: var(--accent); }
.section.centered .eyebrow, .section.centered h2, .section.centered .section-lead { text-align: center; }
.section.centered .section-lead { margin-left: auto; margin-right: auto; }
.src-k { font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-dim); }
.src-h { margin: 0; font-family: var(--sans); font-weight: 700; font-size: var(--fs-2xl); color: var(--text); letter-spacing: -0.01em; line-height: 1.3; }
.src-contrib { max-width: 760px; font-family: var(--mono); font-size: var(--fs-sm); line-height: 1.7; color: var(--muted); margin: 0 auto 30px; text-align: center; }
.src-contrib a { color: var(--accent); }
.src-contrib a:hover { text-decoration: underline; }
.src-contrib code { color: var(--text); }

/* 01 · victims — three quiet cards, one per victim category */
.victims { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; max-width: 1000px; margin: 0 auto 30px; text-align: left; }
.victim { display: flex; flex-direction: column; gap: 6px; padding: 21px 22px 19px; border-radius: 14px;
  background: var(--panel-fill); border: 1px solid var(--panel-edge);
  box-shadow: 0 20px 38px -28px rgba(40,30,15,.32); transition: transform .18s var(--ease), box-shadow .22s var(--ease), border-color .18s ease; }
.victim:hover { transform: translateY(-3px); box-shadow: 0 26px 44px -26px rgba(40,30,15,.4); border-color: var(--accent-dim); }
.victim-ico { width: 40px; height: 40px; margin-bottom: 6px; }
.victim-risk { margin: 0 0 8px; font-size: var(--fs-md); line-height: 1.45; color: var(--muted); }
.obj-list { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.obj-list li { display: grid; grid-template-columns: 30px 1fr; align-items: baseline; font-size: var(--fs-md); line-height: 1.4; color: var(--text); }
.obj-id { font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; color: var(--accent); }
.threat { font-family: var(--sans); font-size: var(--fs-md); }
.threat b { color: var(--text); font-weight: 650; }


/* 02 · protocol — four steps, one rule */
.steps { list-style: none; padding: 0; margin: 0 auto; max-width: 1000px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; text-align: left; counter-reset: step; }
.step { position: relative; display: flex; flex-direction: column; gap: 5px; padding: 18px 18px 17px; border-radius: 14px; background: var(--panel-fill); border: 1px solid var(--panel-edge); }
.step:nth-of-type(-n+3)::after { content: ""; position: absolute; right: -10px; top: 32px; width: 8px; height: 8px; border-top: 1.5px solid var(--dim); border-right: 1.5px solid var(--dim); transform: rotate(45deg); z-index: 2; }
.step-ico { width: 28px; height: 28px; margin-bottom: 4px; }
.step-n { display: inline-flex; align-items: center; justify-content: center; height: 28px; min-width: 28px; padding: 0 7px; margin-bottom: 4px; align-self: flex-start;
  font-family: var(--mono); font-size: var(--fs-2xs); font-weight: 600; letter-spacing: .5px; color: var(--accent); background: var(--accent-wash); border: 1px solid rgba(189,90,56,.25); border-radius: 7px; }
.step-k { font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-dim); }
.step-h { font-weight: 700; font-size: var(--fs-xl); color: var(--text); }
.step-d { font-size: var(--fs-md); line-height: 1.5; color: var(--muted); }

/* shared mono overline used by card headers */
.lb-title { font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.r-name { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); }
.r-desc { font-family: var(--sans); font-size: var(--fs-sm); color: var(--dim); line-height: 1.35; }

/* 03 · metrics */
.metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; max-width: 900px; margin: 0 auto; text-align: left; }
.metric { display: flex; flex-direction: column; gap: 4px; padding: 20px 22px 19px; border-radius: 14px; background: var(--panel-fill); border: 1px solid var(--panel-edge);
  box-shadow: 0 20px 38px -28px rgba(40,30,15,.32); }
.metric[data-stage="exposure"] { box-shadow: 0 20px 38px -28px rgba(40,30,15,.32), inset 3px 0 0 var(--dim); }
.metric[data-stage="trigger"] { box-shadow: 0 20px 38px -28px rgba(40,30,15,.32), inset 3px 0 0 var(--accent); }
.metric-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.metric-id { font-family: var(--serif); font-style: italic; font-size: 30px; line-height: 1.1; color: var(--accent); font-variation-settings: 'opsz' 144, 'wght' 420; }
.metric-stage { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); }
.metric-stage img { width: 16px; height: 16px; }
.metric-name { font-weight: 650; font-size: var(--fs-lg); color: var(--text); }
.metric-d { margin: 4px 0 0; font-size: var(--fs-md); line-height: 1.55; color: var(--muted); }
.metric-d b { color: var(--text); font-weight: 650; }
.joint-d { margin: 0; font-size: var(--fs-lg); line-height: 1.6; color: var(--text); }
.joint-d b { color: var(--accent); font-weight: 700; }

/* 04 · results — the leaderboard card (CUA-Lite's), one bar series: ASR */
.lb { max-width: 820px; margin: 0 auto; position: relative; text-align: left; }
.lb-card { background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 14px; overflow: hidden;
  box-shadow: 0 26px 50px -30px rgba(40,30,15,.4), 0 3px 8px -4px rgba(40,30,15,.16); }
.lb-bar { display: flex; align-items: center; gap: 14px; padding: 11px 18px; background: var(--panel-2); border-bottom: 1px solid var(--panel-edge); }
.lb-tabs { display: inline-flex; flex-wrap: wrap; gap: 2px; }
.lb-tab { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px; text-transform: uppercase; color: var(--muted);
  background: transparent; border: 0; border-radius: 999px; padding: 4px 12px; cursor: pointer;
  transition: color .16s ease, background .22s var(--ease), box-shadow .22s var(--ease); }
.lb-tab:hover { color: var(--text); }
.lb-tab.on { color: var(--accent); background: var(--panel-fill); box-shadow: 0 1px 3px rgba(40,30,15,.14); }
.lb-open { margin-left: auto; font-family: var(--mono); font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; }
.lb-open:hover { text-decoration: underline; }
.lb-head, .lb-row { display: grid; grid-template-columns: 40px minmax(170px, 256px) minmax(0, 1fr) 58px 54px 54px; align-items: center; gap: 0 12px; }
.lb-head { padding: 10px 20px 2px; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.lb-head span:nth-child(n+4) { text-align: right; }
.lb-body { padding: 4px 14px 8px; }
.lb-row { padding: 7px 6px; border-radius: 8px; transition: background .14s ease; }
.lb-row:hover { background: rgba(60,48,36,.05); }
.lb-grp { padding: 10px 6px 2px; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent-dim); }
.lb-ico { display: inline-flex; align-items: center; gap: 3px; }
.lb-ico img { width: 16px; height: 16px; object-fit: contain; }
.lb-ico img + img { margin-left: -2px; }
.lb-model { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-model .lb-org { color: var(--dim); }
.lb-track { position: relative; height: 10px; border-radius: 2px 4px 4px 2px; background: rgba(60,48,36,.06); }
.lb-fill { position: absolute; top: 0; bottom: 0; left: 0; width: calc(var(--w, 0) * 100%); background: linear-gradient(90deg, #c96a45, var(--accent)); border-radius: 2px 4px 4px 2px; transition: width .8s var(--ease); }
.lb-val { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.lb-val.sub { color: var(--muted); }
.lb-row.avg { background: rgba(60,48,36,.035); }
.lb-row.avg .lb-model { color: var(--muted); }
.js-reveal .lb .lb-row { opacity: 0; }
.js-reveal .lb.in .lb-row { animation: lbIn .4s var(--ease) forwards; animation-delay: calc(.035s * var(--i)); }
@keyframes lbIn { to { opacity: 1; transform: none; } }
.lb-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 11px 18px 12px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .3px; line-height: 1.6; color: var(--dim); }
.lb-foot b { color: var(--accent); font-weight: 600; }
.lb-foot span + span::before { content: "·"; margin-right: 10px; }

/* figure tabs (CUA-Lite's segmented control) */
.figtabs { max-width: 900px; margin: 56px auto 0; text-align: center; }
.cov-tabs { display: inline-flex; gap: 2px; margin: 0 0 20px; padding: 4px; background: var(--panel-2); border: 1px solid var(--panel-edge); border-radius: 999px; }
.cov-tab { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px;
  text-transform: uppercase; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 8px 15px; cursor: pointer;
  transition: color .16s ease, background .22s var(--ease), box-shadow .22s var(--ease); }
.cov-tab:hover { color: var(--text); }
.cov-tab.on { color: var(--accent); background: var(--panel-fill); box-shadow: 0 1px 3px rgba(40,30,15,.14); }
.figpanel { display: none; text-align: left; }
.figpanel.on { display: block; animation: covIn .44s var(--ease) both; }
@keyframes covIn { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
.facts { list-style: none; max-width: 860px; margin: 18px auto 0; padding: 0; display: grid; gap: 9px; }
.facts li { position: relative; padding-left: 18px; font-size: var(--fs-md); line-height: 1.55; color: var(--muted); }
.facts li::before { content: ""; position: absolute; left: 2px; top: 8px; width: 6px; height: 6px; background: var(--accent); }
.facts b { color: var(--text); font-weight: 650; }
.vtable { max-width: 860px; margin: 18px auto 0; background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 14px; overflow: hidden; }
.vrow { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(4, minmax(0, 1fr)); gap: 10px; padding: 9px 18px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); }
.vrow span:not(:first-child) { text-align: right; font-variant-numeric: tabular-nums; }
.vrow + .vrow { border-top: 1px solid var(--line); }
.vhead { background: var(--panel-2); font-size: var(--fs-2xs); letter-spacing: 1.2px; text-transform: uppercase; color: var(--dim); }
.vrow.hl { background: var(--accent-wash); }
.vrow.hl span:first-child { color: var(--accent); }
.vnote { margin: 0; padding: 10px 18px 12px; border-top: 1px solid var(--line); font-family: var(--sans); font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); }

/* ---------- 05 · live HF dataset viewer ---------- */
.hf-embed { margin: 0 auto 40px; max-width: 1000px; text-align: left; }
.hf-ds { position: relative; display: inline-block; }
.hf-ds-tok { font-family: var(--mono); font-size: inherit; color: var(--accent); background: rgba(189,90,56,.08);
  border: 0; border-bottom: 1px dashed var(--accent-dim); padding: 1px 7px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px; transition: background .14s var(--ease), border-color .14s var(--ease); }
.hf-ds-tok:hover, .hf-ds.open .hf-ds-tok { background: rgba(189,90,56,.15); border-bottom-color: var(--accent); }
.hf-ds.open .hf-ds-tok { border-bottom-style: solid; }
.hf-caret { width: 6px; height: 6px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  transform: translateY(-2px) rotate(45deg); transition: transform .22s var(--ease); }
.hf-ds.open .hf-caret { transform: translateY(1px) rotate(-135deg); }
.hf-menu { position: absolute; top: calc(100% + 10px); left: 0; z-index: 30; min-width: 260px; max-width: min(320px, 82vw);
  background: var(--panel-fill); border: 2px solid var(--panel-edge); padding: 6px; box-shadow: 0 26px 60px -24px rgba(40,30,15,.6);
  opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.99); transform-origin: top left;
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s .2s; }
.hf-ds.open .hf-menu { opacity: 1; visibility: visible; transform: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.hf-opt { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; font-family: var(--mono);
  font-size: var(--fs-sm); color: var(--muted); background: transparent; border: 0; padding: 9px 12px; cursor: pointer; text-align: left;
  transition: background .12s ease, color .12s ease; }
.hf-opt:hover { background: var(--panel-2); color: var(--text); }
.hf-opt i { font-style: normal; color: var(--dim); }
.hf-opt.active { color: var(--accent); }
.hf-window { border: 1px solid var(--panel-edge); background: var(--panel-fill); border-radius: 12px; overflow: hidden; box-shadow: 0 30px 60px -40px rgba(40,30,15,.4); }
.hf-bar { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; padding: 11px 16px; background: var(--panel-2); border-bottom: 1px solid var(--panel-edge); overflow: visible; }
.hf-window { overflow: visible; }
.hf-bar { border-radius: 12px 12px 0 0; }
.hf-url { flex: 1; min-width: 0; font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; }
.hf-open { font-family: var(--mono); font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; transition: opacity .12s ease; }
.hf-open:hover { opacity: .7; }
.hf-frame { position: relative; height: 560px; background: var(--panel-fill); border-radius: 0 0 12px 12px; overflow: hidden; }
.hf-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; z-index: 1; opacity: 0; transition: opacity .45s ease; }
.hf-frame.loaded iframe { opacity: 1; }
.hf-skeleton { position: absolute; inset: 0; z-index: 2; display: flex; flex-direction: column; gap: 14px; padding: 46px 28px 28px; background: var(--panel-fill); }
.hf-frame.loaded .hf-skeleton { opacity: 0; visibility: hidden; transition: opacity .45s ease, visibility 0s .45s; }
.hf-skeleton::before { content: "Loading the viewer from Hugging Face…"; position: absolute; top: 16px; left: 28px; font-family: var(--mono); font-size: var(--fs-sm); color: var(--dim); letter-spacing: .3px; }
.hf-skeleton span { height: 30px; background: linear-gradient(90deg, var(--panel-2) 25%, #fff 50%, var(--panel-2) 75%); background-size: 200% 100%; animation: hfShimmer 1.5s ease-in-out infinite; }
.hf-skeleton span:nth-child(2) { width: 82%; } .hf-skeleton span:nth-child(3) { width: 64%; }
@keyframes hfShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* quickstart tabs (CUA-Lite's SFT | RL pill toggle) */
.train-tabs { display: flex; width: fit-content; gap: 2px; margin: 0 auto 18px; padding: 4px; background: var(--panel-2); border: 1px solid var(--panel-edge); border-radius: 999px; }
.train-tab { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px; text-transform: uppercase; color: var(--muted); background: transparent; border: 0; border-radius: 999px; padding: 8px 18px; cursor: pointer;
  transition: color .16s ease, background .22s var(--ease), box-shadow .22s var(--ease); }
.train-tab:hover { color: var(--text); }
.train-tab.on { color: var(--accent); background: var(--panel-fill); box-shadow: 0 1px 3px rgba(40,30,15,.14); }
.start-term { max-width: 760px; margin: 0 auto 26px; text-align: left; }
.cb-hidden { display: none; }

/* citation */
.cite-sec { padding: 48px 0 0; }
.cite-line { max-width: 640px; margin: 0 auto; text-align: center; }
.cite-eyebrow { display: block; font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 2.5px; text-transform: uppercase; color: var(--dim); margin-bottom: 13px; }
.cite-title { margin: 0; font-family: var(--serif); font-size: var(--fs-xl); font-style: italic; color: var(--muted); }
.cite-authors { margin: 7px 0 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--dim); }
.cite-meta { margin: 9px 0 0; font-family: var(--mono); font-size: var(--fs-xs); color: var(--dim); }
.bib { max-width: 760px; margin: 26px auto 0; text-align: left; }
.bib .term-body { white-space: pre; overflow-x: auto; font-size: 12px; line-height: 1.7; }

/* footer */
.footer { border-top: 1px solid var(--line); padding: 52px 0 44px; margin-top: 56px; }
.footer-inner { display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.foot-brand { max-width: 420px; }
.foot-tag { color: var(--dim); font-size: var(--fs-md); margin: 14px 0 0; line-height: 1.7; }
.foot-affil { display: flex; align-items: center; gap: 18px; margin-top: 22px; flex-wrap: wrap; }
.foot-affil-label { font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.foot-affil a, .foot-logo-wrap { display: inline-flex; align-items: center; opacity: .5; filter: grayscale(1); transition: opacity .16s var(--ease), filter .16s var(--ease); }
.foot-affil a:hover, .foot-logo-wrap:hover { opacity: .9; filter: grayscale(0); }
.foot-logo { display: block; height: 22px; width: auto; }
.footer-links { display: flex; flex-direction: column; gap: 11px; }
.footer-links a { color: var(--muted); font-size: var(--fs-md); font-weight: 500; transition: color .12s ease; }
.footer-links a:hover { color: var(--accent); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 42px; padding-top: 22px; border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .2px; line-height: 1.7; color: var(--dim); }
.foot-copy a { color: var(--muted); box-shadow: inset 0 -1px 0 var(--line-2); }
.foot-copy a:hover { color: var(--accent); }
.foot-top { color: var(--dim); transition: color .12s ease; }
.foot-top:hover { color: var(--accent); }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .nav-links { gap: 20px; }
}
@media (max-width: 940px) {
  .nav-links a:not(.btn-solid):not(.btn-ghost), .nav-sep { display: none; }
  .nav-cta { gap: 8px; }
  .hero { padding: 44px 0 36px; }
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-head { max-width: none; }
  .divider { padding: 14px 0; }
  .section { padding: 64px 0 12px; }
  .victims { grid-template-columns: 1fr; max-width: 560px; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(2)::after { display: none; }
  .metrics { grid-template-columns: 1fr; max-width: 560px; }
}
@media (max-width: 640px) {
  html { overflow-x: hidden; }
  .container { padding: 0 18px; }
  .nav-inner { padding: 12px 18px; gap: 12px; }
  .nav-cta { gap: 6px; }
  .nav-links .btn-ghost.sm, .nav-links .btn-solid.sm { min-width: 0; padding: 6px 11px; font-size: 13px; }
  .brand { gap: 8px; }
  .brand-mark { width: 24px; height: 24px; }
  .brand-name { font-size: var(--fs-lg); }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .cta-row { gap: 10px; flex-wrap: nowrap; }
  .cta-row .btn-solid, .cta-row .btn-ghost { flex: 1 1 0; min-width: 0; padding: 11px 12px; }
  .stats { flex-wrap: wrap; white-space: normal; row-gap: 7px; }
  .stat-pop { display: none; }
  .hero-demo { zoom: 0.72; }
  .ws-body { grid-template-columns: 122px minmax(0, 1fr); }
  .demo-note { text-align: left; }
  .steps { grid-template-columns: 1fr; }
  .step::after { display: none; }
  .lb-head, .lb-row { grid-template-columns: 34px minmax(0, 1fr) 50px 46px 46px; gap: 0 8px; }
  .lb-head span:nth-child(3), .lb-track { display: none; }
  .lb-bar { flex-wrap: wrap; gap: 8px 12px; }
  .hf-url-host { display: none; }
  .hf-bar { gap: 10px; padding: 10px 12px; }
  .hf-ds { position: static; }
  .hf-menu { left: 12px; right: 12px; width: auto; min-width: 0; max-width: none; }
  .hf-frame { height: 520px; }
  .vrow { grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr)); padding: 9px 12px; font-size: var(--fs-xs); gap: 6px; }
  .section-lead { font-size: var(--fs-lg); }
  .term-body { padding: 16px; }
}
@media (max-width: 379px) {
  .nav-cta a:last-child { display: none; }   /* the dataset stays one tap away in the hero */
}
@media (prefers-reduced-motion: reduce) {
  .typed.caret::after, .spark, .hero::before, .hero-head > *, .hero-demo, .rl-line, .rl-line .caret, .chip, .figpanel.on, .ws-session.flash { animation: none; }
  .rl-line { opacity: 1; transform: none; }
  .ws, .ws * { transition: none !important; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ============================================================
   Motion: the paper's figures as live components, plus page-wide
   counters, spotlights, belts and a scroll meter.
   Victim hues follow the paper's taxonomy figure (amber / violet / teal);
   they appear on data only, never on chrome.
   ============================================================ */
:root {
  --c-user: #e09b33; --c-owner: #9576cf; --c-ext: #2f9e94;
  --c-user-l: #f4d39a; --c-owner-l: #d3c5f1; --c-ext-l: #a6dcd4;
  --g-leak: #ee9184; --g-decision: #f2c062; --g-integrity: #b8a1e6; --g-disrupt: #8bb5e8; --g-imperson: #70c6b5;
  --s2: #c98d68;
}
.v-user { --vc: var(--c-user); } .v-owner { --vc: var(--c-owner); } .v-external { --vc: var(--c-ext); }

/* scroll meter */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #f0a46c, var(--accent)); transform-origin: 0 50%; transform: scaleX(0); }

/* the italic accent words catch a slow light */
h1 em, h2 em { background: linear-gradient(100deg, var(--accent) 0%, var(--accent) 40%, #f0a26a 50%, var(--accent) 60%, var(--accent) 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .08em; margin-right: -.08em; -webkit-box-decoration-break: clone; box-decoration-break: clone; animation: shimmer 8s ease-in-out infinite; }
h1 em { animation-delay: 1.2s; }
@keyframes shimmer { 0%, 35% { background-position: 100% 0; } 75%, 100% { background-position: 0% 0; } }

/* spotlight cards: a warm light follows the pointer */
.fx-card { position: relative; isolation: isolate; transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .2s ease; }
.fx-card::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 0;
  background: radial-gradient(380px circle at var(--mx, 50%) var(--my, 0%), rgba(240,162,106,.18), transparent 45%); opacity: 0; transition: opacity .3s ease; }
.fx-card:hover::after { opacity: 1; }
.fx-card > * { position: relative; z-index: 1; }
.fx-card:hover { box-shadow: 0 30px 54px -30px rgba(40,30,15,.45); }

/* divider: the logo glides onto the hairline */
.flightline { position: relative; width: 180px; }
.glider { position: absolute; top: 50%; left: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; background: url('../assets/logo-128.png') center/contain no-repeat; }
.js-reveal .glider { left: 0; opacity: 0; }
.js-reveal .divider.in .glider { animation: glide 1.8s var(--ease) .25s forwards, bob 3.2s ease-in-out 2.1s infinite; }
@keyframes glide { 0% { left: 0; opacity: 0; transform: rotate(-25deg) scale(.6); } 30% { opacity: 1; } 100% { left: 50%; opacity: 1; transform: none; } }
@keyframes bob { 0%, 100% { margin-top: -10px; } 50% { margin-top: -14px; } }

/* 01 · victim cards */
.victim::before { content: ""; position: absolute; top: -1px; left: 22px; right: 22px; height: 3px; border-radius: 0 0 4px 4px; background: var(--vc); z-index: 2; }
.victim[data-victim="user"] { --vc: var(--c-user); } .victim[data-victim="owner"] { --vc: var(--c-owner); } .victim[data-victim="external"] { --vc: var(--c-ext); }
.obj-list li { transition: color .2s ease, transform .25s var(--ease); }
.obj-list li.hot { color: var(--accent); transform: translateX(4px); }
.obj-list li.hot .obj-id { text-decoration: underline; text-underline-offset: 3px; }
.v-rate { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); display: grid; gap: 7px; }
.v-rate-k { font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--dim); }
.v-bar { display: grid; grid-template-columns: 82px minmax(0, 1fr) 62px; align-items: center; gap: 8px; }
.v-bar-l { font-size: var(--fs-sm); color: var(--muted); }
.v-bar-t { height: 8px; border-radius: 4px; background: rgba(60,48,36,.07); overflow: hidden; }
.v-bar-t i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: 4px; background: linear-gradient(90deg, color-mix(in srgb, var(--vc) 45%, #fff), var(--vc)); transform-origin: 0 50%; }
.v-bar-n { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.js-reveal .victims .v-bar-t i { transform: scaleX(0); }
.js-reveal .victims.in .v-bar-t i { transform: scaleX(1); transition: transform 1.2s var(--ease) .35s; }
.js-reveal .victims.in .v-bar + .v-bar .v-bar-t i { transition-delay: .5s; }

/* 01 · taxonomy rings */
.taxo { max-width: 1000px; margin: 38px auto 0; display: grid; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); gap: 36px; align-items: center; text-align: left; }
.taxo-chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.tx-seg path { stroke: var(--bg); stroke-width: 1.5; transition: transform .4s var(--ease), filter .3s ease, opacity .3s ease; }
.tx-seg { transition: opacity .35s ease; }
.tx-victim.v-user path { fill: var(--c-user); } .tx-victim.v-owner path { fill: var(--c-owner); } .tx-victim.v-external path { fill: var(--c-ext); }
.tx-group.g-leak path { fill: var(--g-leak); } .tx-group.g-decision path { fill: var(--g-decision); } .tx-group.g-integrity path { fill: var(--g-integrity); }
.tx-group.g-disrupt path { fill: var(--g-disrupt); } .tx-group.g-imperson path { fill: var(--g-imperson); }
.tx-obj.v-user path { fill: var(--c-user-l); } .tx-obj.v-owner path { fill: var(--c-owner-l); } .tx-obj.v-external path { fill: var(--c-ext-l); }
.tx-vlabel { font-family: var(--sans); font-weight: 700; font-size: 15px; fill: #fff; text-anchor: middle; pointer-events: none; }
.tx-olabel { font-family: var(--mono); font-weight: 600; font-size: 13px; fill: var(--text); text-anchor: middle; pointer-events: none; transition: transform .4s var(--ease), fill .3s ease; }
.tx-obj { cursor: pointer; outline: none; }
.tx-obj.on path { transform: translate(var(--ox), var(--oy)); filter: drop-shadow(0 6px 10px rgba(40,30,15,.28)) saturate(1.25); }
.tx-obj.on .tx-olabel { transform: translate(var(--ox), var(--oy)); fill: var(--accent); }
.tx-obj:focus-visible path { stroke: var(--accent); stroke-width: 2.5; }
.tx-group.on path, .tx-victim.on path { filter: saturate(1.2) brightness(1.04); }
.taxo-chart svg[data-focus="user"] .tx-seg:not(.v-user),
.taxo-chart svg[data-focus="owner"] .tx-seg:not(.v-owner),
.taxo-chart svg[data-focus="external"] .tx-seg:not(.v-external) { opacity: .18; }
.tx-sweep { transform-origin: 260px 260px; animation: txSpin 10s linear infinite; pointer-events: none; }
@keyframes txSpin { to { transform: rotate(360deg); } }
.taxo.paused .tx-sweep { animation-play-state: paused; }
.tx-core { fill: var(--panel-fill); stroke: var(--panel-edge); stroke-width: 1.5; }
.tx-core-big { font-family: var(--serif); font-style: italic; font-size: 40px; fill: var(--accent); text-anchor: middle; }
.tx-core-small { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; fill: var(--dim); text-anchor: middle; }
.js-reveal .taxo .tx-seg { opacity: 0; transform: scale(.8) rotate(-14deg); transform-origin: 260px 260px; }
.js-reveal .taxo.drawn .tx-seg { opacity: 1; transform: none; transition: opacity .5s ease calc(var(--i) * 45ms), transform .9s var(--ease) calc(var(--i) * 45ms); }
.taxo-info { background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 14px; padding: 22px 24px 20px; box-shadow: 0 26px 50px -32px rgba(40,30,15,.36); min-height: 318px; }
.taxo-info.fresh > * { animation: tiIn .45s var(--ease) both; }
.taxo-info.fresh > *:nth-child(2) { animation-delay: .04s; } .taxo-info.fresh > *:nth-child(3) { animation-delay: .08s; }
@keyframes tiIn { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.ti-code { display: inline-flex; font-family: var(--mono); font-weight: 600; font-size: var(--fs-sm); padding: 2px 11px; border-radius: 999px; color: #fff; background: var(--vc); }
.ti-name { margin: 12px 0 4px; font-family: var(--serif); font-weight: 400; font-variation-settings: 'opsz' 72; font-size: 27px; line-height: 1.15; color: var(--text); }
.ti-meta { margin: 0 0 14px; font-size: var(--fs-md); color: var(--muted); }
.ti-meta b { color: var(--text); font-weight: 650; }
.ti-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 66px; align-items: center; gap: 10px; margin-top: 9px; }
.ti-k { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: 1px; color: var(--muted); }
.ti-bar { height: 9px; border-radius: 5px; background: rgba(60,48,36,.07); overflow: hidden; }
.ti-bar i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: 5px; background: var(--accent); transform-origin: 0 50%; animation: tiBar .9s var(--ease) both; }
.ti-bar.u i { background: #d1a873; } .ti-bar.t i { background: #a89a86; } .ti-bar.j i { background: linear-gradient(90deg, #f0a26a, var(--accent)); }
@keyframes tiBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.ti-v { font-family: var(--mono); font-size: var(--fs-sm); text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }
.ti-foot { margin: 14px 0 0; font-size: var(--fs-xs); line-height: 1.5; color: var(--dim); }
.fig-note { max-width: 780px; margin: 16px auto 0; font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.7; color: var(--dim); text-align: center; }
.fig-note a { color: var(--muted); box-shadow: inset 0 -1px 0 var(--line-2); white-space: nowrap; }
.fig-note a:hover { color: var(--accent); }

/* 02 · steps: a pulse travels the protocol */
.steps { position: relative; }
.steps-track { position: absolute; left: 7%; right: 7%; top: -16px; height: 2px; list-style: none; background: repeating-linear-gradient(90deg, var(--line-2) 0 6px, transparent 6px 12px); }
.steps-dot { position: absolute; top: 50%; left: 0; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(189,90,56,.16), 0 0 18px rgba(189,90,56,.55); }
.js-reveal .steps.in .steps-dot { animation: stepTravel 8s linear infinite; }
@keyframes stepTravel { from { left: 0; } to { left: 100%; } }
.js-reveal .steps.in .step { animation: stepLit 8s ease-in-out infinite; animation-delay: calc(var(--k) * 2s); }
@keyframes stepLit { 0%, 26%, 100% { border-color: var(--panel-edge); box-shadow: none; } 6%, 18% { border-color: var(--accent-dim); box-shadow: 0 18px 36px -24px rgba(189,90,56,.6), 0 0 0 3px rgba(189,90,56,.08); } }
.steps.paused .steps-dot, .steps.paused .step { animation-play-state: paused; }

/* 02 · Figure 1, told as it happens */
.story { max-width: 640px; margin: 50px auto 0; text-align: left; background: #fff; border: 1px solid var(--panel-edge); border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -36px rgba(40,30,15,.42); }
.story-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--panel-2); border-bottom: 1px solid var(--panel-edge); }
.story-title { font-family: var(--mono); font-size: var(--fs-xs); color: var(--muted); }
.story-replay { margin-left: auto; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: 1.5px; text-transform: uppercase; color: var(--accent); background: transparent; border: 1px solid var(--accent-dim); border-radius: 999px; padding: 4px 11px; cursor: pointer; transition: background .15s ease; }
.story-replay:hover { background: var(--accent-wash); }
.story-stage { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 10px; min-height: 650px; transition: opacity .4s ease; }
.story-stage.fading { opacity: 0; }
.story-stage [data-s] { opacity: 0; transform: translateY(10px); transition: opacity .45s ease, transform .55s var(--ease); }
.story-stage [data-s].on { opacity: 1; transform: none; }
.st-sess { font-weight: 700; font-size: 15px; color: var(--accent); background: rgba(189,90,56,.08); border-radius: 8px; padding: 6px 12px; }
.st-sess-2 { color: #1f7d74; background: rgba(47,158,148,.1); }
.st-row { display: flex; align-items: center; gap: 10px; }
.st-agent { justify-content: flex-end; }
.st-ava { width: 34px; height: 34px; flex: none; border-radius: 50%; background: #eef1f8; }
.st-bubble { position: relative; font-size: var(--fs-md); color: transparent; background: #f4f6fb; border: 1px solid #d9e2f1; border-radius: 14px 14px 14px 4px; padding: 8px 14px; }
.st-bubble::before { content: ""; position: absolute; left: 14px; top: 50%; width: 30px; height: 8px; margin-top: -4px; opacity: 0;
  background: radial-gradient(circle, #9aa6bd 3px, transparent 3.5px) 0 0 / 10px 8px repeat-x; }
.on .st-bubble { animation: typeText .01s linear .6s forwards; }
.on .st-bubble::before { animation: typingDots .6s steps(1) forwards; }
@keyframes typeText { to { color: var(--win-ink); } }
@keyframes typingDots { 0%, 99% { opacity: 1; } 100% { opacity: 0; } }
.st-card { display: flex; align-items: center; gap: 12px; border-radius: 10px; padding: 9px 14px; border: 1.5px solid; margin-left: 44px; }
.st-card img { width: 30px; height: 30px; flex: none; }
.st-card b { display: block; font-size: var(--fs-md); }
.st-card span { display: block; font-size: var(--fs-sm); color: var(--muted); }
.st-trusted { border-color: #b9cdec; background: #f3f7fd; } .st-trusted b { color: #1d5fa8; }
.st-note { border-color: #efcf86; background: #fffaf0; } .st-note b { color: #a5701a; }
.story-stage .st-note { transition: opacity .6s ease, filter .6s ease, transform .55s var(--ease); }
.story-stage .st-note.on.struck { opacity: .36; filter: grayscale(.7); }
.st-note.struck span { text-decoration: line-through; text-decoration-color: #c0392b; }
.st-ok { font-style: normal; font-weight: 650; color: #1d5fa8; }
.st-bad { font-style: normal; font-weight: 700; color: #c0392b; }
.st-retained, .st-summary { margin-left: 0; flex-direction: column; align-items: flex-start; gap: 3px; }
.st-retained { border-color: #c9b8ec; background: #f8f5ff; } .st-retained b { color: #6c4fb5; }
.st-summary { border-color: #9fd3c8; background: #f1faf7; } .st-summary b { color: #11806f; }
.st-val { font-style: normal; font-family: var(--mono); font-weight: 600; font-size: var(--fs-sm); color: #c0392b; background: #fdeceb; border: 1.5px solid #e9a39b; border-radius: 6px; padding: 1px 10px; }
.on .st-val { animation: valPulse 1.4s ease-in-out .5s 2; }
@keyframes valPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(192,57,43,0); } 50% { box-shadow: 0 0 0 6px rgba(192,57,43,.16); } }
.st-card .st-fields { display: flex; gap: 14px; color: var(--text); }
.st-fields i { font-style: normal; display: inline-flex; align-items: center; gap: 6px; }
.st-fields i::after { content: ""; width: 5px; height: 9px; border: solid #1f9d55; border-width: 0 2px 2px 0; transform: rotate(45deg) translateY(-2px); }
.story-stage .st-fields i:nth-child(2) { transition-delay: .25s; } .story-stage .st-fields i:nth-child(3) { transition-delay: .5s; }
.st-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-sm); font-weight: 600; }
.st-divider::before, .st-divider::after { content: ""; flex: 1; border-top: 1.5px dashed var(--line-2); transform: scaleX(0); transition: transform .9s var(--ease) .1s; }
.st-divider.on::before, .st-divider.on::after { transform: scaleX(1); }
.st-divider span { border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 12px; background: var(--panel-fill); }
.st-badges { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.st-badge { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; font-size: var(--fs-sm); border-radius: 999px; padding: 4px 14px; border: 1.5px solid; }
.st-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.st-badge.ok { color: #11806f; border-color: #9fd3c8; background: #f1faf7; }
.st-badge.bad { color: #c0392b; border-color: #e9a39b; background: #fdeceb; }
.st-badges.on .st-badge { animation: badgePop .5s var(--ease) both; } .st-badges.on .st-badge.bad { animation-delay: .3s; }
@keyframes badgePop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
.story figcaption { padding: 12px 18px 16px; font-size: var(--fs-sm); line-height: 1.55; color: var(--muted); border-top: 1px solid var(--line); }
.story figcaption b { color: var(--text); font-weight: 650; }
.story figcaption a, .lanes figcaption a { color: var(--accent); white-space: nowrap; }

/* 02 · the 288-case catalog */
.matrix { position: relative; max-width: 1000px; margin: 46px auto 0; text-align: left; background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 14px;
  box-shadow: 0 26px 50px -30px rgba(40,30,15,.4), 0 3px 8px -4px rgba(40,30,15,.16); }
.mx-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 12px 18px; background: var(--panel-2); border-bottom: 1px solid var(--panel-edge); border-radius: 14px 14px 0 0; }
.mx-sum { font-family: var(--mono); font-size: var(--fs-sm); color: var(--muted); }
.mx-sum b { color: var(--accent); font-weight: 600; }
.mx-legend { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.mx-key { display: inline-flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: .5px; color: var(--muted); background: transparent; border: 1px solid transparent; border-radius: 999px; padding: 3px 9px; cursor: pointer; transition: border-color .15s, color .15s, background .15s; }
.mx-key:hover { border-color: var(--line-2); color: var(--text); }
.mx-key.on { border-color: var(--accent-dim); color: var(--accent); background: var(--panel-fill); }
.sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.sw.user { background: var(--c-user); } .sw.owner { background: var(--c-owner); } .sw.external { background: var(--c-ext); }
.sw.dpi { background: repeating-linear-gradient(135deg, var(--muted) 0 2px, transparent 2px 4px); box-shadow: inset 0 0 0 1px var(--muted); }
.sw.ipi { background: var(--muted); }
.mx-sep { width: 1px; height: 14px; background: var(--line-2); margin: 0 4px; }
.mx-scroll { overflow-x: auto; padding: 14px 16px 6px; }
.mx-grid { display: grid; grid-template-columns: 178px repeat(12, minmax(30px, 1fr)); gap: 4px; min-width: 660px; }
.mx-col { font-family: var(--mono); font-size: 10px; color: var(--muted); text-align: center; padding-bottom: 4px; white-space: nowrap; transition: color .2s; cursor: help; }
.mx-col.hl { color: var(--accent); font-weight: 600; }
.mx-row { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.mx-row b { width: 22px; flex: none; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--vc); }
.mx-row span { font-family: var(--mono); font-size: 10px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; }
.mx-row.first { margin-top: 3px; }
.mx-row.hl span { color: var(--accent); }
.mx-cell { height: 16px; border-radius: 4px; background: var(--vc); transition: transform .2s var(--ease), opacity .3s ease, box-shadow .2s ease; }
.mx-cell.dpi { background: repeating-linear-gradient(135deg, var(--vc) 0 3px, color-mix(in srgb, var(--vc) 40%, #fff) 3px 6px); }
.mx-cell:hover, .mx-cell:focus-visible { transform: scale(1.4); box-shadow: 0 4px 10px -3px rgba(40,30,15,.45); position: relative; z-index: 2; outline: none; }
.mx-cell.mx-hero { cursor: pointer; box-shadow: 0 0 0 2px var(--panel-fill), 0 0 0 3.5px var(--accent); }
.js-reveal .matrix:not(.drawn) .mx-cell { opacity: 0; }
.js-reveal .matrix.drawn .mx-cell { animation: cellIn .5s var(--ease) var(--d) backwards; }
.js-reveal .matrix.drawn .mx-cell.mx-hero { animation: cellIn .5s var(--ease) var(--d) backwards, heroRing 2.4s ease-in-out 1.4s infinite; }
@keyframes cellIn { from { opacity: 0; transform: scale(.3); } }
@keyframes heroRing { 50% { box-shadow: 0 0 0 2px var(--panel-fill), 0 0 0 6px rgba(189,90,56,.4); } }
.mx-grid[data-filter="user"] .mx-cell:not(.v-user), .mx-grid[data-filter="owner"] .mx-cell:not(.v-owner), .mx-grid[data-filter="external"] .mx-cell:not(.v-external),
.mx-grid[data-filter="dpi"] .mx-cell:not(.dpi), .mx-grid[data-filter="ipi"] .mx-cell:not(.ipi) { opacity: .12; }
.mx-foot { padding: 6px 18px 14px; font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.6; color: var(--dim); }
.mx-tip, .chart-tip { position: absolute; z-index: 20; transform: translate(-50%, calc(-100% - 12px)); display: flex; flex-direction: column; gap: 2px; max-width: 340px; min-width: 210px;
  background: var(--term-fill); color: var(--term-text); border-radius: 10px; padding: 10px 12px; font-size: var(--fs-xs); line-height: 1.5;
  pointer-events: none; opacity: 0; transition: opacity .15s ease; box-shadow: 0 14px 30px -14px rgba(0,0,0,.6); }
.mx-tip.on, .chart-tip.on { opacity: 1; }
.mx-tip code { font-family: var(--mono); color: var(--term-accent); font-size: 11px; word-break: break-all; }
.mx-tip span, .chart-tip span { color: var(--term-muted); }
.mx-tip b { color: var(--term-text); }
.mx-tip em { font-style: normal; color: var(--term-accent); }

/* belts: the twelve contexts, and every case ID */
.belt { max-width: 1120px; margin: 24px auto 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.belt-track { display: flex; width: max-content; padding: 6px 0 16px; animation: beltScroll 70s linear infinite; }
.belt:hover .belt-track, .belt.paused .belt-track { animation-play-state: paused; }
@keyframes beltScroll { to { transform: translateX(-50%); } }
.ctx-card { flex: none; position: relative; width: 236px; margin-right: 12px; display: flex; flex-direction: column; gap: 3px; padding: 14px 66px 14px 16px; text-align: left;
  background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 12px; box-shadow: 0 14px 26px -22px rgba(40,30,15,.4); transition: transform .2s var(--ease), border-color .2s; }
.ctx-card:hover { transform: translateY(-3px); border-color: var(--accent-dim); }
.r-name { font-family: var(--mono); font-size: var(--fs-sm); color: var(--text); }
.r-desc { font-family: var(--sans); font-size: var(--fs-sm); color: var(--dim); line-height: 1.35; }
.ctx-fmt { position: absolute; top: 13px; right: 12px; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: .5px; color: var(--accent); background: var(--accent-wash); border: 1px solid rgba(189,90,56,.22); border-radius: 5px; padding: 1px 6px; }
.ticker { margin: 4px 0 42px; display: grid; gap: 10px; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.tk-row { overflow: hidden; }
.tk-track { display: flex; width: max-content; animation: beltScroll 900s linear infinite; }
.tk-row.rev .tk-track { animation-direction: reverse; }
.ticker:hover .tk-track, .ticker.paused .tk-track { animation-play-state: paused; }
.tk-chip { flex: none; display: inline-flex; align-items: center; gap: 7px; margin-right: 8px; font-family: var(--mono); font-size: 11px; color: var(--muted);
  background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 999px; padding: 4px 11px 4px 9px; }
.tk-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--vc); }

/* 03 · metric cards carry their four configuration values */
.mbars { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); display: grid; gap: 6px; }
.mb { display: grid; grid-template-columns: 52px minmax(0, 1fr) 50px; align-items: center; gap: 10px; }
.mb-l { font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: .4px; color: var(--muted); }
.mb-t { height: 7px; border-radius: 4px; background: rgba(60,48,36,.07); overflow: hidden; }
.mb-t i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: 4px; background: linear-gradient(90deg, #f0a26a, var(--accent)); transform-origin: 0 50%; }
.metric[data-stage="exposure"] .mb-t i { background: linear-gradient(90deg, #d6cab3, #9d8f78); }
.mb-v { font-family: var(--mono); font-size: var(--fs-xs); color: var(--text); text-align: right; font-variant-numeric: tabular-nums; }
.js-reveal .metrics .mb-t i { transform: scaleX(0); }
.js-reveal .metrics.in .mb-t i { transform: scaleX(1); transition: transform 1.1s var(--ease) .35s; }
.js-reveal .metrics.in .mb:nth-child(2) .mb-t i { transition-delay: .45s; } .js-reveal .metrics.in .mb:nth-child(3) .mb-t i { transition-delay: .55s; } .js-reveal .metrics.in .mb:nth-child(4) .mb-t i { transition-delay: .65s; }

/* 03 · the joint frequency, as a ring */
.joint { position: relative; overflow: hidden; max-width: 900px; margin: 22px auto 0; display: flex; align-items: center; gap: 26px; padding: 20px 26px; border-radius: 16px; text-align: left;
  background: linear-gradient(120deg, rgba(189,90,56,.1), rgba(240,162,106,.05)); border: 1px solid rgba(189,90,56,.28); }
.joint::before { content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-100%);
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); }
.js-reveal .joint.in::before { animation: sweep 6s ease-in-out 1.6s infinite; }
@keyframes sweep { 0% { transform: translateX(-100%); } 35%, 100% { transform: translateX(100%); } }
.donut { position: relative; width: 124px; height: 124px; flex: none; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.d-track { fill: none; stroke: rgba(189,90,56,.14); stroke-width: 12; }
.d-fill { fill: none; stroke: var(--accent); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 55.71 100; }
.js-reveal .joint .d-fill { stroke-dasharray: 0 100; transition: stroke-dasharray 1.8s var(--ease) .2s; }
.js-reveal .joint.in .d-fill { stroke-dasharray: 55.71 100; }
.d-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-style: italic; font-size: 30px; color: var(--accent); }
.d-num i { font-style: normal; font-family: var(--sans); font-size: 15px; margin: 6px 0 0 1px; }
.joint-body { position: relative; display: flex; flex-direction: column; gap: 10px; }
.joint-eq { display: flex; flex-wrap: wrap; gap: 6px; }
.joint-eq span { font-family: var(--mono); font-size: var(--fs-sm); color: var(--accent); background: var(--panel-fill); border: 1px solid rgba(189,90,56,.25); border-radius: 999px; padding: 2px 12px; }
.js-reveal .joint.in .joint-eq span { animation: chipLit 3.6s ease-in-out infinite; }
.js-reveal .joint.in .joint-eq span:nth-child(2) { animation-delay: .4s; } .js-reveal .joint.in .joint-eq span:nth-child(3) { animation-delay: .8s; }
@keyframes chipLit { 0%, 30%, 100% { background: var(--panel-fill); color: var(--accent); } 10%, 20% { background: var(--accent); color: #fff7f0; } }
.joint-d { margin: 0; font-size: var(--fs-lg); line-height: 1.6; color: var(--text); }
.joint-d b { color: var(--accent); font-weight: 700; }
.joint.paused::before, .joint.paused .joint-eq span { animation-play-state: paused; }

/* 03 · authority, retention, adoption — three lanes */
.lanes { max-width: 920px; margin: 40px auto 0; text-align: left; display: grid; gap: 12px; }
.lanes figcaption { margin: 6px 4px 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--muted); }
.lanes figcaption b { color: var(--text); font-weight: 650; }
.lane { --lc: #3f7fc0; --ld: 0s; background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 14px; padding: 14px 18px; display: grid; grid-template-columns: 250px minmax(0, 1fr); align-items: center; gap: 18px; }
.lane[data-lane="b"] { --lc: #8b6cc7; --ld: .6s; } .lane[data-lane="c"] { --lc: #c9503a; --ld: 1.2s; }
.lane-head { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 10px; align-items: center; }
.lane-head .lane-k { grid-column: 1; grid-row: 1 / span 2; } .lane-k { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; color: #fff; background: var(--lc); }
.lane-head b { font-size: var(--fs-md); color: var(--text); }
.lane-head span { grid-column: 2; font-size: var(--fs-sm); line-height: 1.4; color: var(--muted); }
.lane-flow { display: grid; grid-template-columns: minmax(0, 1.3fr) 46px auto 46px minmax(0, 1fr); align-items: center; }
.lane-node { display: flex; align-items: center; gap: 10px; border-radius: 10px; padding: 8px 12px; border: 1.5px solid var(--line-2); background: #fff; font-size: var(--fs-sm); color: var(--muted); min-width: 0; }
.lane-node img { flex: none; }
.lane-node b { display: block; font-size: var(--fs-sm); color: var(--text); }
.lane-node.src { border-color: #a9c5e8; }
.lane-node.src.ext { border-color: #ebc57c; }
.lane-node.mem { flex-direction: column; gap: 0; text-align: center; border: 0; background: transparent; padding: 0; }
.lane-node.mem b { color: var(--muted); font-weight: 500; font-size: var(--fs-xs); }
.lane-node.mem span { color: #6c4fb5; font-weight: 650; }
.lane-node.out { justify-content: center; text-align: center; }
.lane-node.out span { font-weight: 650; }
.lane-node.out.ok, .lane-node.out.held { border-color: #93cdbb; background: #f1faf7; } .lane-node.out.ok span, .lane-node.out.held span { color: #11806f; }
.lane-node.out.bad { border: 1.5px dashed #d9553f; background: #fdeeeb; } .lane-node.out.bad span { color: #c0392b; }
.lane-node.out b { font-weight: 500; color: var(--muted); font-size: var(--fs-xs); }
.lane-arrow { position: relative; height: 2px; margin: 0 6px; background: var(--line-2); }
.lane-arrow::after { content: ""; position: absolute; right: -2px; top: -4px; border-left: 7px solid var(--line-2); border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.lane-dot { position: absolute; top: -4px; left: 0; width: 10px; height: 10px; border-radius: 50%; background: var(--lc); box-shadow: 0 0 10px var(--lc); opacity: 0; }
.js-reveal .lanes.in .lane-arrow:nth-of-type(1) .lane-dot { animation: dot1 6s linear var(--ld) infinite; }
.js-reveal .lanes.in .lane-arrow:nth-of-type(2) .lane-dot { animation: dot2 6s linear var(--ld) infinite; }
.js-reveal .lanes.in .lane-node.mem img { animation: memPulse 6s ease-in-out var(--ld) infinite; }
.js-reveal .lanes.in .lane-node.out { animation: outPop 6s var(--ease) var(--ld) infinite; }
.js-reveal .lanes.in .lane-node.out.bad { animation: outPop 6s var(--ease) var(--ld) infinite, badGlow 6s ease-in-out var(--ld) infinite; }
@keyframes dot1 { 0% { left: 0; opacity: 0; } 3% { opacity: 1; } 16% { left: calc(100% - 10px); opacity: 1; } 19%, 100% { left: calc(100% - 10px); opacity: 0; } }
@keyframes dot2 { 0%, 24% { left: 0; opacity: 0; } 27% { opacity: 1; } 41% { left: calc(100% - 10px); opacity: 1; } 44%, 100% { left: calc(100% - 10px); opacity: 0; } }
@keyframes memPulse { 0%, 15%, 28%, 100% { transform: none; } 20% { transform: scale(1.12) rotate(-4deg); } }
@keyframes outPop { 0%, 40% { opacity: .3; transform: scale(.94); } 46% { opacity: 1; transform: scale(1.05); } 52%, 92% { opacity: 1; transform: none; } 100% { opacity: .3; transform: scale(.94); } }
@keyframes badGlow { 0%, 44%, 100% { box-shadow: none; } 55%, 75% { box-shadow: 0 0 0 5px rgba(217,85,63,.14), 0 10px 22px -12px rgba(217,85,63,.6); } }
.lanes.paused * { animation-play-state: paused !important; }

/* 04 · results card: values glide between views */
.lb-model, .lb-ico { transition: opacity .17s ease; }
.lb-model.swap, .lb-ico.swap { opacity: 0; }
.vdot { display: inline-block; width: 9px; height: 9px; margin-right: 3px; border-radius: 50%; background: var(--vc); }

/* 04 · charts */
.chart-card { max-width: 860px; margin: 0 auto; padding: 18px 20px 16px; text-align: left; background: #fffdf8; border: 1px solid var(--panel-edge); border-radius: 14px; box-shadow: 0 26px 50px -32px rgba(40,30,15,.36); }
.chart-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin-bottom: 6px; }
.chart-head b { font-size: var(--fs-lg); color: var(--text); }
.chart-head span { font-family: var(--mono); font-size: var(--fs-xs); color: var(--dim); }
.chart-head.sub { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.scatter { position: relative; }
.scatter svg { display: block; width: 100%; height: auto; overflow: visible; }
.sc-grid { stroke: rgba(60,48,36,.08); stroke-width: 1; }
.sc-tick { font-family: var(--mono); font-size: 11px; fill: var(--dim); text-anchor: middle; }
.sc-tick.y { text-anchor: end; }
.sc-label { font-family: var(--sans); font-size: 13px; fill: var(--muted); text-anchor: middle; }
.sc-mean { stroke: var(--accent-dim); stroke-width: 1.4; stroke-dasharray: 5 5; }
.sc-mean-t { font-family: var(--mono); font-size: 10.5px; fill: var(--accent); }
.sc-dot { transform: translate(var(--mx0), var(--my0)) scale(.1); opacity: 0; cursor: pointer; outline: none;
  transition: transform 1.1s var(--ease) calc(.2s + var(--i) * 70ms), opacity .4s ease calc(.2s + var(--i) * 70ms); }
.scatter.drawn .sc-dot { transform: translate(var(--x), var(--y)); opacity: 1; }
.sc-bubble { fill: var(--vc); fill-opacity: .8; stroke: #fff; stroke-width: 1.5; transition: transform .25s var(--ease), fill-opacity .2s ease; }
.sc-dot:hover .sc-bubble, .sc-dot:focus .sc-bubble { transform: scale(1.2); fill-opacity: 1; }
.sc-name { font-family: var(--mono); font-size: 12px; font-weight: 600; fill: var(--text); text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.chart-tip b { font-family: var(--mono); color: var(--term-accent); }
.jbars { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 28px; }
.jb { display: grid; grid-template-columns: 26px minmax(0, 1fr) 58px; align-items: center; gap: 10px; }
.jb-id { font-family: var(--mono); font-size: var(--fs-xs); font-weight: 600; color: var(--vc); }
.jb-t { height: 10px; border-radius: 5px; background: rgba(60,48,36,.06); overflow: hidden; }
.jb-t i { display: block; height: 100%; width: calc(var(--v) * 1%); border-radius: 5px; background: linear-gradient(90deg, color-mix(in srgb, var(--vc) 45%, #fff), var(--vc)); transform: scaleX(0); transform-origin: 0 50%; transition: transform 1s var(--ease) calc(.3s + var(--i) * 60ms); }
.jbars.drawn .jb-t i { transform: scaleX(1); }
.jb-v { font-family: var(--mono); font-size: var(--fs-xs); text-align: right; color: var(--text); font-variant-numeric: tabular-nums; }

/* 04 · controlled factors */
.factors { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 1000px; margin: 0 auto; text-align: left; }
.fx-panel { background: #fffdf8; border: 1px solid var(--panel-edge); border-radius: 14px; padding: 12px 12px 10px; }
.fp-head { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 0 8px; align-items: center; margin-bottom: 4px; }
.fp-head .fp-k { grid-column: 1; grid-row: 1 / span 2; } .fp-k { width: 20px; height: 20px; border-radius: 6px; display: grid; place-items: center; font-family: var(--mono); font-size: 11px; font-weight: 600; color: var(--accent); background: var(--accent-wash); }
.fp-head b { font-size: var(--fs-md); color: var(--text); }
.fp-head span { grid-column: 2; font-family: var(--mono); font-size: 10px; line-height: 1.4; color: var(--dim); }
.fp-svg { display: block; width: 100%; height: auto; overflow: visible; }
.fp-grid { stroke: rgba(60,48,36,.08); }
.fp-zero { stroke: var(--line-2); stroke-width: 1.2; }
.fp-tick { font-family: var(--mono); font-size: 10px; fill: var(--dim); text-anchor: middle; }
.fp-tick.y { text-anchor: end; }
.fp-bar { transform-box: fill-box; transform-origin: 50% 100%; transform: scaleY(0); transition: transform .9s var(--ease) calc(.15s + var(--i) * 70ms); }
.fp-bar.s1 { fill: var(--accent); } .fp-bar.s2 { fill: var(--s2); }
.fp-val { font-family: var(--mono); font-size: 10px; fill: var(--text); text-anchor: middle; opacity: 0; transition: opacity .4s ease calc(.7s + var(--i) * 70ms); }
.fp-ret { fill: #fff; stroke-width: 2.2; opacity: 0; transform-box: fill-box; transform-origin: center; transform: scale(0); transition: transform .5s var(--ease) calc(.85s + var(--i) * 70ms), opacity .3s ease calc(.85s + var(--i) * 70ms); }
.fp-ret.s1 { stroke: var(--accent); } .fp-ret.s2 { stroke: var(--s2); }
.fp-line { fill: none; stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.fp-line.s1 { stroke: var(--accent); } .fp-line.s2 { stroke: var(--s2); }
.fp-line.adopt { stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset 1.4s var(--ease) .2s; }
.fp-line.ret { stroke-width: 1.8; stroke-dasharray: 4 4; opacity: 0; transition: opacity .8s ease .9s; }
.fp-pt { opacity: 0; transition: opacity .3s ease calc(.4s + var(--i) * 220ms); }
.fp-pt.adopt.s1 { fill: var(--accent); } .fp-pt.adopt.s2 { fill: var(--s2); }
.fp-pt.ret { fill: #fff; stroke-width: 1.8; } .fp-pt.ret.s1 { stroke: var(--accent); } .fp-pt.ret.s2 { stroke: var(--s2); }
.fp-end { font-family: var(--mono); font-size: 9.5px; opacity: 0; transition: opacity .4s ease 1.4s; } .fp-end.s1 { fill: var(--accent); } .fp-end.s2 { fill: #a87452; }
.fp-loss, .fp-gain { transform-box: fill-box; transform: scaleX(0); transition: transform .8s var(--ease) calc(.2s + var(--i) * 140ms); }
.fp-loss { fill: #e48b7c; transform-origin: 100% 50%; } .fp-gain { fill: #5fb3a3; transform-origin: 0 50%; }
.fp-rowname { font-family: var(--mono); font-size: 11px; font-weight: 600; fill: var(--text); }
.fp-net { font-family: var(--mono); font-size: 11px; font-weight: 600; text-anchor: end; opacity: 0; transition: opacity .4s ease 1s; }
.fp-net.pos { fill: #2f8f7f; } .fp-net.neg { fill: #c0503a; }
.factors.drawn .fp-bar, .factors.drawn .fp-loss, .factors.drawn .fp-gain { transform: none; }
.factors.drawn .fp-val, .factors.drawn .fp-pt, .factors.drawn .fp-end, .factors.drawn .fp-net { opacity: 1; }
.factors.drawn .fp-ret { opacity: 1; transform: none; }
.factors.drawn .fp-line.adopt { stroke-dashoffset: 0; }
.factors.drawn .fp-line.ret { opacity: .9; }
.fp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 2px 4px 0; font-family: var(--mono); font-size: 10px; color: var(--muted); }
.fk { display: inline-block; width: 10px; height: 10px; margin-right: 5px; border-radius: 3px; vertical-align: -1px; }
.fk.s1 { background: var(--accent); } .fk.s2 { background: var(--s2); }
.fk.ret { background: #fff; box-shadow: inset 0 0 0 2px var(--muted); border-radius: 50%; }
.fk.loss { background: #e48b7c; } .fk.gain { background: #5fb3a3; }

/* 04 · visual IPI: drag to compare */
.vis-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; max-width: 1000px; margin: 0 auto; text-align: left; }
.vslider { --x: 50%; position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--panel-edge); background: #fff; cursor: ew-resize; user-select: none; touch-action: pan-y;
  box-shadow: 0 26px 50px -30px rgba(40,30,15,.45); }
.vslider img { display: block; width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.vs-top { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--x)); }
.vs-handle { position: absolute; top: 0; bottom: 0; left: var(--x); width: 0; z-index: 3; outline: none; }
.vs-handle::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(189,90,56,.55), 0 0 18px rgba(189,90,56,.5); }
.vs-handle span { position: absolute; top: 50%; left: 0; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: var(--accent); box-shadow: 0 6px 16px -4px rgba(189,90,56,.75), 0 0 0 4px rgba(255,255,255,.75); }
.vs-handle span::before, .vs-handle span::after { content: ""; position: absolute; top: 50%; margin-top: -5px; border-top: 5px solid transparent; border-bottom: 5px solid transparent; }
.vs-handle span::before { left: 8px; border-right: 6px solid #fff; }
.vs-handle span::after { right: 8px; border-left: 6px solid #fff; }
.vs-handle:focus-visible span { box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--accent); }
.vs-tag { position: absolute; top: 10px; z-index: 2; font-family: var(--mono); font-size: var(--fs-2xs); letter-spacing: .4px; color: #fff; background: rgba(27,25,18,.78); border-radius: 999px; padding: 3px 9px; pointer-events: none; }
.vs-tag.l { left: 10px; } .vs-tag.r { right: 10px; background: var(--accent); }
.vflow { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.vflow li { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; text-align: center; font-size: var(--fs-xs); font-weight: 600; line-height: 1.3; color: var(--text);
  background: var(--panel-fill); border: 1px solid var(--panel-edge); border-radius: 12px; animation: vLit 6s ease-in-out infinite; animation-delay: calc(var(--k, 0) * 1.5s); }
.vflow li img { width: 40px; height: 40px; }
.vflow li small { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; color: var(--dim); }
.vflow li:nth-child(-n+3)::after { content: ""; position: absolute; right: -8px; top: 28px; width: 6px; height: 6px; border-top: 1.5px solid var(--dim); border-right: 1.5px solid var(--dim); transform: rotate(45deg); }
.vflow li:nth-child(2) { --k: 1; } .vflow li:nth-child(3) { --k: 2; } .vflow li:nth-child(4) { --k: 3; }
@keyframes vLit { 0%, 30%, 100% { border-color: var(--panel-edge); transform: none; box-shadow: none; } 8%, 20% { border-color: var(--accent-dim); transform: translateY(-3px); box-shadow: 0 14px 26px -18px rgba(189,90,56,.6); } }
.vflow.paused li { animation-play-state: paused; }
.vis-side .vtable { max-width: none; margin: 0; }
.vis-side .vnote { margin: 12px 0 0; padding: 0; border: 0; font-size: var(--fs-sm); line-height: 1.55; color: var(--muted); }
.vis-side .vnote b { color: var(--accent); }

@media (max-width: 940px) {
  .taxo { grid-template-columns: 1fr; gap: 22px; }
  .taxo-chart { max-width: 440px; width: 100%; margin: 0 auto; }
  .steps-track { display: none; }
  .lane { grid-template-columns: 1fr; gap: 12px; }
  .factors { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vis-wrap { grid-template-columns: 1fr; }
  .joint { flex-direction: column; text-align: center; max-width: 560px; }
  .joint-eq { justify-content: center; }
}
@media (max-width: 640px) {
  .story-stage { min-height: 0; padding: 14px; }
  .st-card { margin-left: 0; }
  .st-card .st-fields { gap: 10px; }
  .mx-grid { grid-template-columns: 136px repeat(12, 26px); min-width: 0; }
  .mx-col { writing-mode: vertical-rl; transform: rotate(180deg); height: 62px; text-align: left; padding: 0; justify-self: center; }
  .lane-flow { grid-template-columns: minmax(0, 1.2fr) 22px auto 22px minmax(0, 1fr); }
  .lane-node { padding: 6px 8px; gap: 6px; font-size: 11px; }
  .lane-node.src img { width: 22px; height: 22px; }
  .lane-node.mem img { width: 28px; height: 28px; }
  .factors { grid-template-columns: 1fr; }
  .jbars { grid-template-columns: 1fr; }
  .vflow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vflow li:nth-child(2)::after { display: none; }
  .ctx-card { width: 204px; }
  .taxo-info { min-height: 0; }
}
@media (prefers-reduced-motion: reduce) {
  h1 em, h2 em { animation: none; }
  .tx-sweep, .steps-dot, .step, .belt-track, .tk-track, .vflow li, .mx-cell, .joint::before, .joint-eq span { animation: none !important; }
  .lanes * { animation: none !important; }
  .lane-dot { display: none; }
  .story-stage [data-s] { opacity: 1; transform: none; }
  .st-bubble { color: var(--win-ink) !important; }
  .st-bubble::before { display: none; }
  .fx-card, .sc-dot, .fp-bar, .fp-ret, .fp-loss, .fp-gain, .jb-t i { transition: none !important; }
}
