/* ============================================================
   ARTS — project page
   Aesthetic: clean, scientific, premium (abc.bot-inspired).
   Serif display (Newsreader) + Inter UI + JetBrains Mono.
   ============================================================ */

:root {
  /* ink + paper */
  --bg:        #fbfaf7;   /* warm off-white */
  --bg-card:   #ffffff;
  --bg-alt:    #f4f1ea;   /* warm band */
  --ink:       #1b1a17;   /* near-black text */
  --muted:     #6c675e;   /* secondary text */
  --faint:     #97918596; /* hairlines, captions */
  --border:    #e7e2d7;

  /* brand */
  --accent:      #6d4ac0; /* ARTS purple */
  --accent-deep: #543597;
  --accent-soft: #efe9fb;

  /* paper pastels (method palette: Linear=brown, AIRA=green, MLEvo=amber, ARTS=purple) */
  --coral:   #d98a73;
  --green:   #4ea585;
  --blue:    #6286cf;
  --pink:    #d96aa0;
  --amber:   #d9923f;
  --brown:   #b08868;

  --coral-soft: #fbe7e0;
  --green-soft: #e2f1ea;
  --blue-soft:  #e7ecfb;
  --pink-soft:  #fbe6f0;
  --amber-soft: #fbeedd;

  /* soft section bands */
  --band-lav:   #f4effb;
  --band-mint:  #ecf5f0;
  --band-blush: #fbeff4;
  --band-sky:   #eef3fc;

  /* type — ONE typeface everywhere: STIX Two Text (Times-metric, the NeurIPS paper font) */
  --paper: 'STIX Two Text', 'Times New Roman', Times, serif;
  --serif: var(--paper);
  --sans:  var(--paper);
  --mono:  var(--paper);

  /* shape */
  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 1px 2px rgba(27,26,23,.04), 0 8px 28px rgba(27,26,23,.06);
  --shadow-lg: 0 2px 6px rgba(27,26,23,.05), 0 18px 48px rgba(84,53,151,.12);
  --maxw: 1080px;
  --readw: 720px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: var(--accent-soft); color: var(--accent-deep); }

.mono { font-family: var(--mono); letter-spacing: -0.02em; }
.accent { color: var(--accent); }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
}
.container.narrow { max-width: var(--readw); }

/* ---------- SIDE TOC ---------- */
:root { --toc-w: 240px; }

.toc {
  position: fixed;
  left: 0; top: 0;
  width: var(--toc-w);
  height: 100vh;
  padding: 40px 30px;
  display: flex;
  flex-direction: column;
  gap: 26px;
  border-right: 1px solid var(--border);
  background: var(--bg);
  z-index: 60;
}
.toc-brand {
  font-weight: 600;
  font-size: 21px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.toc-brand:hover { text-decoration: none; }
.toc-brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.toc-links { display: flex; flex-direction: column; gap: 2px; }
.toc-links a {
  position: relative;
  color: var(--muted);
  font-size: 16px;
  padding: 5px 0 5px 14px;
  border-left: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.toc-links a:hover { color: var(--ink); text-decoration: none; }
.toc-links a.active {
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--ink);
}
.toc-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 14.5px;
}
.toc-foot a { color: var(--muted); }
.toc-foot a:hover { color: var(--accent); text-decoration: none; }

/* content sits to the right of the fixed TOC */
.page { margin-left: var(--toc-w); }

/* mobile: TOC collapses to a sticky top bar */
.toc-toggle { display: none; }
@media (max-width: 900px) {
  :root { --toc-w: 0px; }
  .toc {
    position: sticky;
    flex-direction: row;
    align-items: center;
    width: 100%;
    height: auto;
    padding: 12px 20px;
    gap: 18px;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    background: rgba(251,250,247,.85);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
  .toc-brand { font-size: 18px; }
  .toc-links { flex-direction: row; gap: 16px; }
  .toc-links a { padding: 2px 0; border-left: none; white-space: nowrap; }
  .toc-links a.active { border-left: none; color: var(--accent); }
  .toc-foot { display: none; }
  .page { margin-left: 0; }
}

/* ---------- HERO ---------- */
.hero {
  position: relative;
  text-align: center;
  padding: 76px 0 44px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(680px 320px at 50% -80px, var(--accent-soft), transparent 70%),
    radial-gradient(520px 280px at 12% 8%,  var(--pink-soft),  transparent 72%),
    radial-gradient(520px 280px at 88% 4%,  var(--blue-soft),  transparent 72%);
  opacity: .9;
  pointer-events: none;
}
.hero > .container { position: relative; }

/* Results & Findings use the same gradient wash as the hero */
#results, #findings { position: relative; overflow: hidden; }
#results::before, #findings::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(680px 320px at 50% -80px, var(--accent-soft), transparent 70%),
    radial-gradient(520px 280px at 12% 8%,  var(--pink-soft),  transparent 72%),
    radial-gradient(520px 280px at 88% 4%,  var(--blue-soft),  transparent 72%);
  opacity: .9;
  pointer-events: none;
}
#results > .container, #findings > .container { position: relative; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent-deep);
  background: rgba(255,255,255,.7);
  border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.eyebrow .sparkle { color: var(--accent); }

.title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(34px, 5.6vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
}
.title .arts {
  font-family: var(--mono);
  font-weight: 600;
  letter-spacing: -0.04em;
  color: var(--accent);
}
.title-sub {
  font-size: clamp(15px, 2vw, 18px);
  color: var(--muted);
  font-weight: 450;
  margin: 0 auto 26px;
  max-width: 560px;
}

.authors {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 6px;
  line-height: 1.9;
}
.authors .author { color: var(--ink); }
.authors .author:hover { color: var(--accent); }
.authors sup, .affil sup { color: var(--accent); font-weight: 600; font-size: .72em; }
.eq { color: var(--muted); font-weight: 400; }
.affil { font-size: 14.5px; color: var(--muted); margin: 0 0 30px; }

.btn-row {
  display: flex; flex-wrap: wrap; gap: 11px; justify-content: center;
  margin-bottom: 30px;
}
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--bg-card);
  color: var(--ink);
  border: 1px solid var(--border);
  padding: 11px 19px;
  border-radius: 999px;
  font-weight: 600; font-size: 15px;
  box-shadow: var(--shadow);
  transition: transform .14s ease, box-shadow .14s ease, background .14s ease, color .14s ease, border-color .14s ease;
}
.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: #d7cdf0;
}
.btn.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
.btn .ico { width: 17px; height: 17px; fill: currentColor; flex: none; }

.tldr {
  max-width: 700px;
  margin: 6px auto 0;
  font-size: 17px;
  color: var(--ink);
}
.tldr strong { color: var(--accent-deep); font-weight: 650; }

/* ---------- SECTIONS ---------- */
.section { padding: 72px 0; }
.section.band {
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section.alt   { background: var(--bg-alt); }
.tint-lav      { background: var(--band-lav); }
.tint-mint     { background: var(--band-mint); }
.tint-blush    { background: var(--band-blush); }
.tint-sky      { background: var(--band-sky); }
.section.tight { padding-top: 26px; }

.sec-head { text-align: center; margin: 0 auto 40px; max-width: 640px; }
.sec-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.h2 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(28px, 3.6vw, 40px);
  letter-spacing: -0.02em;
  line-height: 1.12;
  margin: 0;
}
.sec-head p { color: var(--muted); margin: 12px 0 0; font-size: 16.5px; }

/* ---------- FIGURES ---------- */
.figcard {
  margin: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.figcard:hover { box-shadow: var(--shadow-lg); }
.figcard img { display: block; width: 100%; height: auto; background: #fff; }
.figcard figcaption {
  padding: 15px 20px;
  font-size: 14px; line-height: 1.6;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.figcard figcaption strong { color: var(--ink); }

.hero-fig { max-width: 1000px; margin: 0 auto; }
.hero-fig img { padding: 10px 10px 0; }

.gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
  align-items: start;
}
.gallery .span2 { grid-column: 1 / -1; }
.gallery .span2 img { display: block; width: 100%; height: auto; }
/* smaller taskgrid: card hugs a narrower image (no letterbox whitespace) */
.gallery .span2.mid { max-width: 880px; margin-left: auto; margin-right: auto; }
/* keep stat row + callout the same width as the figures (one aligned column) */
#results .stats, #results .callout { max-width: 880px; margin-left: auto; margin-right: auto; }

/* ---------- ABSTRACT ---------- */
.abstract {
  font-size: 18.5px;
  line-height: 1.78;
  color: #2c2a25;
}
.abstract strong { color: var(--accent-deep); font-weight: 600; }
.lead-cap::first-letter {
  font-family: var(--serif);
  font-size: 3.1em;
  font-weight: 500;
  float: left;
  line-height: .82;
  padding: 6px 12px 0 0;
  color: var(--accent);
}

/* ---------- METHOD STEPS ---------- */
.steps { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.step {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 26px 24px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .18s ease, box-shadow .18s ease;
}
.step:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.step::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--c, var(--accent));
}
.step .step-top { display: flex; align-items: center; gap: 13px; margin-bottom: 12px; }
.step .step-ico {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  font-size: 21px;
  border-radius: 12px;
  background: var(--c-soft, var(--accent-soft));
}
.step .step-n {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 13px; font-weight: 600;
  color: var(--faint);
}
.step h3 {
  font-family: var(--sans);
  font-size: 18px; font-weight: 700;
  margin: 0; letter-spacing: -0.01em;
  color: var(--ink);
}
.step p { margin: 0; font-size: 15.5px; line-height: 1.65; color: var(--muted); }
.step p strong { color: var(--ink); }

/* ---------- STATS ---------- */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 44px;
}
.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .18s ease, box-shadow .18s ease;
}
.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.stat-num {
  font-family: var(--serif);
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--accent);
}
.stat-label { font-size: 13.5px; color: var(--muted); margin-top: 10px; line-height: 1.45; }
/* paper method palette across the four stats */
.stat:nth-child(1) { background: linear-gradient(180deg, var(--accent-soft), var(--bg-card) 70%); }
.stat:nth-child(2) { background: linear-gradient(180deg, var(--blue-soft),   var(--bg-card) 70%); }
.stat:nth-child(3) { background: linear-gradient(180deg, var(--green-soft),  var(--bg-card) 70%); }
.stat:nth-child(4) { background: linear-gradient(180deg, var(--amber-soft),  var(--bg-card) 70%); }
.stat:nth-child(1) .stat-num { color: var(--accent); }
.stat:nth-child(2) .stat-num { color: var(--blue); }
.stat:nth-child(3) .stat-num { color: var(--green); }
.stat:nth-child(4) .stat-num { color: var(--amber); }

/* ---------- CALLOUT ---------- */
.callout {
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
  background: linear-gradient(120deg, var(--green-soft), var(--bg-card) 60%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 30px;
  box-shadow: var(--shadow);
}
.callout .c-ico { font-size: 34px; }
.callout h3 { margin: 0 0 4px; font-size: 18px; font-weight: 700; }
.callout p { margin: 0; color: var(--muted); font-size: 15.5px; }

/* ---------- FINDINGS ---------- */
.findings { display: grid; gap: 14px; max-width: var(--readw); margin: 0 auto; }
.finding {
  display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  box-shadow: var(--shadow);
}
.finding .f-tag {
  font-family: var(--mono); font-size: 12px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
  margin-top: 2px;
}
.finding p { margin: 0; font-size: 15.5px; color: var(--ink); }
.finding p strong { color: var(--accent-deep); }

/* ---------- BIBTEX ---------- */
.bibtex-wrap { position: relative; max-width: var(--readw); margin: 0 auto; }
.bibtex {
  background: #211d2c;
  color: #ece7f7;
  border-radius: var(--radius);
  padding: 24px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.8;
  margin: 0;
  box-shadow: var(--shadow-lg);
}
.bibtex .tok-key { color: #c9a6ff; }
.bibtex .tok-field { color: #9fd6c0; }
.copy-btn {
  position: absolute; top: 14px; right: 14px;
  background: rgba(255,255,255,.12);
  color: #fff; border: 1px solid rgba(255,255,255,.18);
  padding: 7px 14px; border-radius: 9px;
  font-family: var(--sans); font-weight: 600; font-size: 13px;
  cursor: pointer; transition: background .14s ease;
  backdrop-filter: blur(4px);
}
.copy-btn:hover { background: rgba(255,255,255,.22); }
.copy-btn.copied { background: var(--green); border-color: var(--green); }

/* ---------- FOOTER ---------- */
.footer {
  padding: 46px 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}
.footer p { margin: 6px 0; }
.footer a { color: var(--accent-deep); }
.footer .credit { font-size: 12.5px; opacity: .8; margin-top: 14px; }

/* ---------- SCROLL REVEAL ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .6s cubic-bezier(.2,.7,.2,1), transform .6s cubic-bezier(.2,.7,.2,1);
}
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 860px) {
  .gallery { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .container { padding: 0 20px; }
  .nav-inner { padding: 0 20px; }
  .section { padding: 52px 0; }
  .hero { padding: 56px 0 32px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .callout { grid-template-columns: 1fr; text-align: center; }
  .finding { grid-template-columns: 1fr; }
  .lead-cap::first-letter { font-size: 2.6em; }
}

/* ============================================================
   INTERACTIVE WALKTHROUGH (animated Figure 1)
   ============================================================ */
.walk {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 26px;
  align-items: stretch;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.walk-stage {
  position: relative;
  padding: 22px;
  background:
    radial-gradient(520px 260px at 50% -40px, var(--accent-soft), transparent 70%),
    var(--bg);
  border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
}
.walk-stage svg { width: 100%; height: auto; max-width: 440px; display: block; }

/* tree elements */
.wedge { stroke: #c9c2d6; stroke-width: 2; transition: opacity .5s ease; }
.wedge.hidden { opacity: 0; }
.wnode { transition: opacity .5s ease, transform .5s cubic-bezier(.2,.8,.2,1); transform-box: fill-box; transform-origin: center; }
.wnode.hidden { opacity: 0; transform: scale(.4); }
.wnode circle {
  transition: fill .45s ease, stroke .45s ease, r .35s ease;
  stroke-width: 2.5;
}
.wnode text { font-weight: 600; font-size: 15px; fill: var(--ink); }
.wnode.cand circle     { fill: var(--coral-soft); stroke: var(--coral); }
.wnode.selected circle { fill: var(--green-soft); stroke: var(--green); }
.wnode.new circle      { fill: var(--blue-soft);  stroke: var(--blue);  }
.wnode.root circle     { fill: #efece6; stroke: #b9b2a6; }
.wnode.dim { opacity: .32; }
.wnode.focus circle { filter: drop-shadow(0 4px 10px rgba(109,74,192,.28)); }
.wnode.focus { transform: scale(1.12); }

/* panel */
.walk-panel { padding: 26px 26px 22px; display: flex; flex-direction: column; min-height: 320px; }
.walk-eyebrow {
  font-size: 13px; font-weight: 700; letter-spacing: .04em;
  color: var(--accent); margin: 0 0 8px;
  display: inline-flex; align-items: center; gap: 8px;
}
.walk-title { font-size: 21px; font-weight: 600; margin: 0 0 12px; line-height: 1.25; }
.walk-body { color: var(--muted); font-size: 16px; line-height: 1.6; margin: 0; }
.walk-body strong { color: var(--ink); }
.walk-body .wlist { list-style: none; padding: 0; margin: 6px 0 0; }
.walk-body .wlist li { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.walk-body .wscore {
  font-weight: 600; font-size: 13px; color: var(--coral);
  background: var(--coral-soft); border-radius: 6px; padding: 2px 8px; min-width: 42px; text-align: center;
}
.walk-body .wbar { margin-top: 10px; }
.walk-body .wbar-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin: 7px 0; }
.walk-body .wbar-track { grid-column: 1 / -1; height: 7px; border-radius: 99px; background: var(--pink-soft); overflow: hidden; }
.walk-body .wbar-fill { height: 100%; background: var(--pink); border-radius: 99px; transition: width .6s ease; }
.walk-body .wbar-val { font-weight: 600; color: var(--ink); font-size: 14px; }

/* controls */
.walk-controls { margin-top: auto; padding-top: 20px; display: flex; align-items: center; gap: 12px; }
.walk-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border: 1px solid var(--border); background: var(--bg-card); color: var(--ink);
  border-radius: 999px; padding: 9px 16px; font-family: var(--paper); font-size: 15px;
  font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
}
.walk-btn:hover { border-color: #d7cdf0; background: var(--accent-soft); }
.walk-btn:active { transform: translateY(1px); }
.walk-btn.play { background: var(--ink); color: #fff; border-color: var(--ink); }
.walk-btn.play:hover { background: var(--accent); border-color: var(--accent); }
.walk-btn[disabled] { opacity: .4; cursor: default; }
.walk-dots { display: flex; gap: 7px; margin-left: auto; }
.walk-dots button {
  width: 9px; height: 9px; border-radius: 50%; padding: 0; cursor: pointer;
  border: none; background: var(--border); transition: background .2s, transform .2s;
}
.walk-dots button.on { background: var(--accent); transform: scale(1.25); }
.walk-hint { text-align: center; color: var(--faint); font-size: 13.5px; margin: 14px 0 0; }

@media (max-width: 820px) {
  .walk { grid-template-columns: 1fr; }
  .walk-stage { border-right: none; border-bottom: 1px solid var(--border); }
  .walk-panel { min-height: 0; }
}

/* video-style controls for the autoplaying walkthrough */
.walk { position: relative; }
.walk-stage { cursor: pointer; }
.walk-playpause {
  position: absolute; left: 16px; top: 16px; z-index: 3;
  width: 46px; height: 46px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(27,26,23,.82); color: #fff;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: grid; place-items: center; box-shadow: var(--shadow);
  transition: background .15s ease, transform .1s ease;
}
.walk-playpause:hover { background: var(--accent); }
.walk-playpause:active { transform: scale(.94); }
.walk-playpause svg { width: 20px; height: 20px; fill: currentColor; }
.walk[data-playing="true"]  .i-play  { display: none; }
.walk[data-playing="false"] .i-pause { display: none; }
.walk-bar { grid-column: 1 / -1; height: 4px; background: var(--border); }
.walk-bar-fill { display: block; height: 100%; width: 0; background: var(--accent); }
.walk-caption {
  text-align: center; color: var(--muted);
  font-size: 15px; line-height: 1.6; margin: 16px auto 0; max-width: 880px;
}
.walk-caption strong { color: var(--ink); }

/* ============================================================
   CINEMATIC FIGURE ASSEMBLY
   ============================================================ */
.fig {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fig-stage {
  position: relative;
  width: 100%;
  overflow: hidden;
  background:
    radial-gradient(640px 320px at 50% -8%, var(--accent-soft), transparent 70%),
    radial-gradient(420px 240px at 100% 100%, var(--blue-soft), transparent 72%),
    var(--bg);
}
.fig-scale { position: absolute; top: 0; left: 0; transform-origin: top left; }
.fig-inner { position: relative; width: 980px; height: 600px; }

/* step header — no box, same as the background */
.fig-grouptitle {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 32px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink);
}
/* individual Inspect / Reason / Propose / Execute cards */
.fig-card {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--c, var(--accent));
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
}
.fig-sub-h { font-weight: 700; font-size: 31px; margin-bottom: 4px; color: var(--c, var(--accent)); }
.fig-sub-b { font-size: 29px; line-height: 1.3; color: var(--ink); }
.fig-sub-b strong { color: var(--c, var(--accent)); }
.fig-sub-b em { font-style: italic; color: var(--muted); }
.fig-pp { font-size: 28px; line-height: 1.28; color: var(--ink); margin-bottom: 5px; }

/* the animation gets more width than the text column */
.fig-wrap { max-width: 1360px; padding-left: 14px; padding-right: 14px; }

.fig-comp { position: absolute; opacity: 0; will-change: transform, opacity; }
.fig-comp.in { opacity: 1; }
.fig-tree { width: 100%; height: 100%; }
.fig-tree svg { width: 100%; height: 100%; display: block; }
.fig-arrows { width: 100%; height: 100%; display: block; }

.fig-panel {
  width: 100%; height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px 16px;
  display: flex; flex-direction: column;
}
.fig-panel-h { font-weight: 700; font-size: 14px; letter-spacing: .06em; color: var(--ink); margin-bottom: 10px; }
.fig-subs { display: flex; gap: 12px; flex: 1; }
.fig-sub {
  flex: 1; border-left: 3px solid var(--c, var(--accent));
  background: var(--bg); border-radius: 11px; padding: 10px 12px;
}
.fig-sub-h { font-weight: 700; font-size: 14px; margin-bottom: 5px; color: var(--c, var(--accent)); }
.fig-sub p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

.fig-scrim {
  position: absolute; inset: 0; z-index: 4;
  background: var(--bg); opacity: 0;
  transition: opacity .5s ease; pointer-events: none;
}
.fig-scrim.on { opacity: .82; }

.fig-cap {
  margin: 14px auto 2px; text-align: center; max-width: 90%;
  font-size: clamp(14px, 1.55vw, 17px); line-height: 1.45; color: var(--ink);
  min-height: 2.7em;                /* reserve space so the layout doesn't jump */
  opacity: 0; transition: opacity .4s ease;
}
.fig-cap.show { opacity: 1; }
.fig-cap strong { color: var(--accent-deep); }
.fig .walk-playpause { z-index: 8; }

@media (max-width: 640px) {
  .fig-cap { bottom: 12px; font-size: 14px; }
  .fig-sub p { font-size: 11px; }
}

/* play/pause icon toggling (applies to any [data-playing] container) */
[data-playing="true"]  .i-play  { display: none; }
[data-playing="false"] .i-pause { display: none; }

/* crispness: pieces author large, scale down (never upscaled) */
.fig-comp { transform-origin: 0 0; }

/* Inspect rows with training-curve sparklines */
.fig-irow { display: grid; grid-template-columns: auto 92px 1fr; align-items: center; gap: 13px; margin: 6px 0; }
.fig-chip { font-weight: 700; font-size: 26px; color: var(--coral); background: var(--coral-soft);
  border-radius: 6px; padding: 2px 9px; text-align: center; }
.fig-spark { width: 92px; height: 38px; display: block; }
.fig-il { font-size: 26px; color: var(--muted); white-space: nowrap; }

/* Propose probability bars */
.fig-pp { margin-bottom: 9px; }
.fig-bar { margin: 5px 0; }
.fig-bar-top { display: flex; justify-content: space-between; font-size: 28px; }
.fig-bar-val { font-weight: 700; color: var(--ink); }
.fig-bar-track { height: 7px; border-radius: 99px; background: var(--pink-soft); margin-top: 3px; overflow: hidden; }
.fig-bar-fill { height: 100%; background: var(--pink); border-radius: 99px; }

/* Execute chips + new-node line */
.fig-rwrs { display: flex; gap: 6px; margin: 6px 0 4px; }
.fig-rwrs span { font-size: 22px; font-weight: 600; color: var(--green);
  border: 1px solid var(--green); border-radius: 6px; padding: 2px 8px; }
.fig-newnode { font-size: 28px; font-weight: 600; color: var(--blue); }
.fig-newnode strong { color: var(--blue); }

/* ---------- SEARCH TREES (task selector) ---------- */
.tree-tabs { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 0 0 26px; }
.tree-tab {
  font-family: var(--paper); font-size: 16px; font-weight: 600;
  padding: 10px 22px; border-radius: 999px; cursor: pointer;
  background: var(--bg-card); color: var(--muted); border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: color .15s ease, background .15s ease, border-color .15s ease, transform .1s ease;
}
.tree-tab:hover { color: var(--ink); border-color: #d7cdf0; }
.tree-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.tree-fig { max-width: 940px; margin: 0 auto; }
.tree-fig a { display: block; }
.tree-fig img { display: block; width: 100%; height: auto; background: #fff; }
.tree-hint { text-align: center; color: var(--faint); font-size: 13.5px; margin: 14px 0 0; }

/* ---------- self-drawn search trees ---------- */
.tree-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; align-items: start; }
.tree-col { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px 24px; overflow-x: auto; }
.tree-col-h { font-weight: 700; font-size: 16px; margin: 0 0 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.tree-col-h .who { color: var(--accent); }
.tree-col-h.aira .who { color: var(--coral); }
.tree-col-h .best { float: right; font-weight: 600; color: var(--muted); }

.ttree { position: relative; }
.tn {
  position: relative; width: max-content; max-width: 100%;
  margin: 8px 0 0 calc(var(--d) * 23px);
  display: flex; align-items: center; gap: 9px;
  padding: 6px 12px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--bg-card);
  font-size: 15px; line-height: 1.2; color: var(--ink);
}
.tn:first-child { margin-top: 0; }
.tn-sc { font-weight: 700; font-size: 12.5px; padding: 2px 8px; border-radius: 7px; white-space: nowrap; background: #ece7df; color: #6b6557; }
.tn-lb { white-space: nowrap; }
/* connectors */
.tn::before { content: ''; position: absolute; left: -17px; top: 50%; width: 15px; height: 2px; background: #cdc7d8; }
.tn::after  { content: ''; position: absolute; left: -17px; bottom: 50%; width: 2px; height: calc(var(--g) * 41px - 20px); background: #cdc7d8; }
.tn[data-d="0"]::before, .tn[data-d="0"]::after { display: none; }
/* kinds */
.k-root  { border-color: #b9b2a6; }
.k-mid   { border-color: var(--blue); }   .k-mid .tn-sc   { background: var(--blue-soft);  color: var(--blue); }
.k-good  { border-color: var(--green); }  .k-good .tn-sc  { background: var(--green-soft); color: var(--green); }
.k-best  { border-color: var(--green); border-width: 2.5px; background: var(--green-soft); font-weight: 600; }
.k-best .tn-sc { background: var(--green); color: #fff; }
.k-fail  { border-style: dashed; border-color: var(--coral); }  .k-fail .tn-sc { background: var(--coral-soft); color: var(--coral); }
.tree-cap { max-width: var(--readw); margin: 24px auto 0; text-align: center; color: var(--muted); font-size: 16px; line-height: 1.55; }
.tree-cap strong { color: var(--ink); }

@media (max-width: 820px) {
  .tree-pair { grid-template-columns: 1fr; }
  .tn { font-size: 13.5px; }
}

/* qualities line + disclaimer for trees */
.tree-tags { font-size: 13px; font-style: italic; color: var(--accent); margin: -6px 0 14px; }
.tree-tags.aira { color: var(--coral); }
.tree-note { max-width: var(--readw); margin: 14px auto 0; text-align: center; font-size: 13.5px; color: var(--faint); }
.tree-note a { color: var(--accent-deep); }

/* slightly smaller stat number so "ARTS* 4B ≈ o3" fits on one line */
.stat-num.s-sm { font-size: clamp(22px, 2.9vw, 29px); white-space: nowrap; }

/* BibTeX section: soft hero-style gradient instead of a flat band */
#bibtex {
  background:
    radial-gradient(640px 320px at 50% 0%,   var(--accent-soft), transparent 70%),
    radial-gradient(520px 280px at 10% 100%, var(--pink-soft),   transparent 72%),
    radial-gradient(520px 280px at 90% 100%, var(--blue-soft),   transparent 72%),
    var(--bg);
}
