

/* ---------- Theme tokens ---------- */
:root{
  /* Brand — single accent, tints only (no 2nd/3rd hue) */
  --accent:        #3F6FA6;   /* poster green ("paws") — links, active nav, .hl */
  --accent-strong: #2B5383;   /* darker green — hover / emphasis text */
  --accent-soft:   #DCEAF6;   /* restrained green tint for highlights */
  --accent-warm:   #8EBADE;   /* poster mustard ("tiny") — title wordmark only */
  --on-accent:     #FFFFFF;

  /* Status — severity only; normal states stay grey */
  --success: #3F6FA6;         /* confirmation (copy) */
  --up:      #3F6FA6;         /* improvement / up trend */
  --down:    #B04A3C;         /* regression / down trend */

  /* Motion — Silk seed (one easing, three durations) */
  --ease:       cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast:   120ms;
  --dur-normal: 220ms;
  --dur-slow:   360ms;
  --motion:     var(--dur-normal) var(--ease);

  /* Neutrals (no pure #000; darkest text = #1D2733) */
  --bg:          #F4F8FC;     /* page background (green-tinted near-white) */
  --surface:     #FFFFFF;     /* cards / inset blocks */
  --surface-muted: #EEF2F7;   /* comparison rows */
  --surface-2:   #F1F6FB;     /* second-level inset */
  --media-bg:    #FFFFFF;     /* published figures remain on white */
  --text:        #1D2733;     /* strong */
  --text-soft:   #4A5868;     /* body / labels */
  --text-mute:   #64748A;     /* captions (WCAG AA on near-white) */
  --border:      #D3DFEB;
  --border-soft: #E4ECF4;

  /* Overlay — green-black neutrals, isolated from the page surfaces */
  --overlay-bg:      rgba(20, 40, 70, 0.92);
  --overlay-control: rgba(20, 40, 19, 0.72);
  --overlay-border:  rgba(255, 255, 255, 0.25);
  --overlay-shadow:  rgba(6, 14, 6, 0.50);

  /* Typography */
  --font:        'Pretendard Variable', system-ui, sans-serif;
  --font-serif:  'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  --font-display:'Manrope', 'Pretendard Variable', system-ui, sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  /* Layout */
  --sidebar-w:   230px;
  --content-max: 1180px;
  --content-px:  clamp(20px, 3.5vw, 48px);

  /* Hero column widths — two deliberate tiers, not ad-hoc per-block values */
  --hero-prose-w: 760px;   /* single-column reading text (title block, lead) */

  /* Radius — soft personality (one scale everywhere) */
  --radius-sm: 8px;    /* badges, code, chips, small buttons */
  --radius:    10px;   /* controls / buttons */
  --radius-lg: 14px;   /* cards */

  /* Shadows — one language, <=8% opacity */
  --shadow-control: 0 1px 2px rgba(43, 83, 131, 0.05);
  --shadow-1: 0 4px 18px rgba(43, 83, 131, 0.05);
  --shadow-2: 0 12px 40px rgba(43, 83, 131, 0.07);
}

/* ---------- Base ---------- */
/* Cat paw cursor across the page (hotspot at the tip of the toes) */
*, *::before, *::after{ cursor:url("assets/paw-cursor.png") 24 2, auto !important; }
/* While the mouse button is down the toes curl in (hotspot stays on the same screen point) */
.paw-press, .paw-press *, .paw-press *::before, .paw-press *::after{
  cursor:url("assets/paw-cursor-press.png") 24 2, auto !important;
}
/* Paw prints left behind the cursor; each one fades out on its own */
.paw-print{
  position:absolute; width:22px; height:22px; margin:-11px 0 0 -11px;
  pointer-events:none; z-index:9998; background:var(--accent);
  -webkit-mask:url("assets/paw-print.svg") center / contain no-repeat;
  mask:url("assets/paw-print.svg") center / contain no-repeat;
  animation:paw-fade 1.6s var(--ease) forwards;
}
@keyframes paw-fade{ from{ opacity:0.55; } to{ opacity:0; } }
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
body{
  margin:0;
  font-family:var(--font);
  font-size:16px;                 /* desktop body floor */
  background:var(--bg);
  color:var(--text);
  line-height:1.65;
  overflow-x:clip;                /* horizontal-overflow safety (keeps sticky working) */
  -webkit-font-smoothing:antialiased;
}
a{ color:var(--accent); text-decoration:none; }
a:hover{ text-decoration:underline; }
img{ max-width:100%; }

code{
  font-family:var(--font-mono); font-size:0.92em;
  background:var(--surface-2); padding:0.05em 0.4em; border-radius:var(--radius-sm);
}
.hl{ color:var(--accent); font-weight:700; }

/* ---------- Reading-progress bar ---------- */
#progress-bar{
  position:fixed; top:0; left:0; height:3px; width:0;
  background:var(--accent);
  z-index:9999;
  transition:width 0.08s linear;
}

/* ---------- Layout ---------- */
.layout{
  display:flex;
  align-items:flex-start;
  min-height:100vh;
}

/* ---------- Sidebar (desktop: pinned left rail) ---------- */
.sidebar{
  position:sticky; top:0;
  flex:0 0 var(--sidebar-w); width:var(--sidebar-w);
  height:100vh; padding:32px 18px 28px 28px;
  display:flex; flex-direction:column;
  border-right:1px solid var(--border);
  background:var(--surface-2);
}
.sidebar-brand{ display:flex; align-items:center; gap:10px; margin-bottom:36px; }
.brand-mark{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:34px; height:34px; padding:0 9px; border-radius:var(--radius);
  background:var(--accent);
  color:var(--on-accent); font-weight:800; font-size:0.82rem; letter-spacing:0.03em;
  box-shadow:var(--shadow-1);
}

.sidebar-nav{ display:flex; flex-direction:column; gap:2px; flex:1; }
.nav-link{
  display:block; padding:8px 12px;
  font-size:0.9rem; font-weight:500;
  color:var(--text-soft);
  border-left:2px solid transparent;
  border-radius:0 var(--radius-sm) var(--radius-sm) 0;
  transition:color var(--motion), background-color var(--motion), border-color var(--motion);
}
.nav-link:hover{ color:var(--accent); text-decoration:none; background:var(--surface); }
.nav-link.active{
  color:var(--accent);
  border-left-color:var(--accent);
  background:var(--accent-soft);
  font-weight:600;
}
.nav-link:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* ---------- Content column ---------- */
.content{
  flex:1; min-width:0;
  max-width:calc(var(--content-max) + 2 * var(--content-px));
  padding:64px var(--content-px) 96px;
  margin:0 auto;
}

.sec{ margin-bottom:80px; scroll-margin-top:24px; }
.sec-label{
  display:inline-block;
  font-size:1rem; font-weight:700; letter-spacing:0.16em; text-transform:uppercase;
  color:var(--accent);
  padding:4px 0; border-bottom:2px solid var(--accent);
  margin-bottom:14px;
}
.sec-heading{
  font-family:var(--font-display);
  font-size:clamp(1.6rem, 3.1vw, 2.15rem);
  font-weight:700; line-height:1.18; margin:0 0 12px;
  letter-spacing:-0.028em;
}
.sub-heading{
  font-size:1.2rem; font-weight:600;
  margin:48px 0 16px;
  padding-left:12px; border-left:3px solid var(--accent);
}
.sec-lead{
  font-size:1.02rem; color:var(--text-soft);
  margin-top:0; margin-bottom:28px;
}
.cap{ font-size:0.875rem; color:var(--text-mute); margin-top:14px; }

/* =============== HERO =============== */
.hero{ padding-top:24px; }
.hero-head{ text-align:center; max-width:var(--hero-prose-w); margin:0 auto 28px; }
.hero-title{
  font-family:var(--font-display);
  font-weight:800; letter-spacing:-0.035em; line-height:1.3;
  margin:0 0 32px;
  font-size:clamp(1.9rem, 6vw, 3.3rem);
  text-align:center;
  text-wrap:balance;              /* graceful multi-line balancing */
  overflow-wrap:break-word;       /* never overflow the viewport */
}
@media (min-width:900px){
  /* Give the title block and author rows the full content width on desktop:
     the viewport minus the sidebar and the content padding. */
  .hero-head{
    max-width:min(1180px, calc(100vw - var(--sidebar-w) - 2 * var(--content-px) - 24px));
  }
}
.hero-accent{ color:var(--accent); }   /* the one distinctive focal accent */
.hero-warm{ color:var(--accent-warm); }
/* Wordmark in a soft retro serif, after the poster lettering */
.hero-warm, .hero-accent{
  font-family:'Fraunces', Georgia, serif; font-weight:700;
  font-variation-settings:'SOFT' 100; font-optical-sizing:auto;
  font-size:1.18em; letter-spacing:-0.02em;
}
.hero-paw{ height:1.5em; width:auto; vertical-align:-0.42em; margin-left:0.08em; }
.hero-sub{
  display:inline-block;
  font-family:var(--font-display); font-weight:700; color:var(--text);
  font-size:0.52em; letter-spacing:-0.02em; line-height:1.2;
  margin-top:12px;
}

.authors-grid{
  display:flex; flex-wrap:wrap; gap:2px 28px;
  margin:8px 0 6px; justify-content:center;
}
.author-card{ font-size:0.95rem; color:var(--text); }
.authors-break{ flex-basis:100%; height:0; }   /* forced line break in the author row */
.author-name{ font-weight:500; }
a.author-name{ color:inherit; text-decoration:none; transition:color .15s ease; }
a.author-name:hover{ color:var(--accent); text-decoration:underline; text-underline-offset:3px; }
.author-card sup{ color:var(--accent); font-weight:600; margin-left:1px; font-size:0.75em; }
.affil-legend{ font-size:0.875rem; color:var(--text-mute); margin:4px 0 15px; text-align:center; }
.affil-legend sup{ color:var(--accent); margin-right:2px; }
.affil-foot{ display:inline-block; white-space:nowrap; color:var(--text-mute); }

.links-row{
  display:flex; gap:10px; flex-wrap:wrap;
  margin:0 0 8px; justify-content:center;
}
.link-btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:10px 18px;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:var(--radius);
  font-weight:500; font-size:0.92rem; text-decoration:none;
  box-shadow:var(--shadow-control);
  transition:background-color var(--motion), border-color var(--motion),
             color var(--motion), transform var(--motion), box-shadow var(--motion);
}
.link-btn:hover{
  background:var(--accent-soft); border-color:var(--accent); color:var(--accent-strong);
  text-decoration:none; transform:translateY(-1px); box-shadow:var(--shadow-1);
}
.link-btn svg{ width:16px; height:16px; stroke:currentColor; }
.link-btn svg.link-btn-fill{ stroke:none; fill:currentColor; width:18px; height:18px; }
.link-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }
/* Not released yet: looks like the other buttons but is not a link */
.link-btn--soon{ opacity:0.6; border-style:dashed; box-shadow:none; }
.link-btn--soon:hover{ transform:none; box-shadow:none; }
.link-btn--soon small{ font-size:0.82em; font-weight:500; }

/* Teaser video */
.teaser-video video{ display:block; width:100%; height:auto; }
/* Overview media sits at two thirds of the content width on desktop */
.hero .teaser-video, .hero .video-chapters, .hero .video-scrub, .hero > .figure-wide, .hero > .sub-heading{
  max-width:calc(100% * 2 / 3); margin-left:auto; margin-right:auto;
}
.video-chapters{
  display:grid; grid-template-columns:repeat(8, minmax(0, 1fr)); gap:6px;
  margin:12px 0 0;
}
.video-chapter{
  display:flex; flex-direction:column; gap:1px; padding:0 0 6px;
  font:inherit; text-align:left; cursor:pointer; overflow:hidden;
  background:var(--surface); color:var(--text);
  border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow-control);
  transition:border-color var(--motion), box-shadow var(--motion), transform var(--motion);
}
.video-chapter img{ display:block; width:100%; height:auto; border-bottom:1px solid var(--border-soft); }
.video-chapter-time{
  padding:5px 6px 0; font-family:var(--font-mono); font-size:0.68rem; font-weight:500; color:var(--accent);
}
.video-chapter-title{ padding:0 6px; font-size:0.68rem; font-weight:600; line-height:1.25; }
.video-chapter:hover{ transform:translateY(-2px); box-shadow:var(--shadow-1); border-color:var(--accent); }
.video-chapter:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.video-chapter.is-active{ border-color:var(--accent); background:var(--accent-soft); }

/* Timeline bar under the chapter row */
.video-scrub{ position:relative; margin-top:10px; padding:10px 0; cursor:pointer; }
.video-scrub-track{
  position:relative; height:6px; border-radius:3px; background:var(--border); overflow:hidden;
}
.video-scrub-fill{ height:100%; width:0; background:var(--accent); }
.video-scrub-tick{
  position:absolute; top:10px; width:2px; height:6px; margin-left:-1px; background:var(--bg);
}
.video-scrub-preview{
  position:absolute; bottom:100%; width:160px; transform:translateX(-50%);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  box-shadow:var(--shadow-2); overflow:hidden; pointer-events:none; z-index:5;
}
.video-scrub-frame{
  width:160px; height:101px;
  background-image:url("assets/teaser_sprite.jpg"); background-size:1600px 1212px;
}
.video-scrub-label{
  display:block; padding:4px 6px; font-size:0.7rem; font-weight:600; line-height:1.25;
  color:var(--text); text-align:center;
}

/* Promoted motivation lead — readable body size (replaces caption-grey hero-gap) */
.hero-lead{
  max-width:var(--hero-prose-w); margin:6px auto 0;
  text-align:justify; font-size:1.02rem; color:var(--text-soft); line-height:1.6;
}
.hero-lead em{ font-style:italic; }

/* Hero teaser / qual figures — sit centered within the hero rhythm */
.hero .figure-wide, .hero .figure-medium{ margin:26px auto 8px; }

/* =============== PIPELINE COMPARISON + STAGE CARDS =============== */
.compare-grid{
  display:grid; grid-template-columns:repeat(2, minmax(0, 1fr)); gap:16px;
  padding:16px; background:var(--media-bg);
}
.compare-panel{ display:flex; flex-direction:column; gap:10px; min-width:0; }
.compare-panel img{ margin:auto 0; }
.compare-label{
  align-self:flex-start; padding:4px 10px; border-radius:var(--radius-sm);
  font-size:0.75rem; font-weight:700; letter-spacing:0.08em; text-transform:uppercase;
  background:var(--surface-muted); color:var(--text-soft);
}
.compare-label--ours{ background:var(--accent-soft); color:var(--accent-strong); }

/* Pipeline comparison: one card per pipeline, with its figure inside the card */
.pipeline-rows{ display:grid; gap:16px; max-width:760px; margin:8px auto 0; }
.pipeline-rows .stage-tag{ margin-bottom:6px; }
.pipeline-rows .figure-medium{ max-width:none; margin:12px 0 0; box-shadow:none; }

.stage-grid{
  display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px; margin:16px 0 0;
}
.stage-card{
  background:var(--surface);
  border:1px solid var(--border); border-top:4px solid var(--accent);
  border-radius:var(--radius-lg);
  padding:18px 20px; box-shadow:var(--shadow-1);
}
.stage-card--key{ background:var(--accent-soft); }
.stage-tag{
  display:block; font-size:0.72rem; font-weight:700; letter-spacing:0.14em; text-transform:uppercase;
  color:var(--accent);
}
.stage-title{
  font-family:var(--font-display); font-size:1.15rem; font-weight:700; color:var(--accent-strong);
  margin:2px 0 8px;
}
.stage-card p{ margin:0 0 10px; font-size:0.95rem; line-height:1.55; }
.stage-card p:last-child{ margin-bottom:0; }
.stage-keys{ margin:0; }
.stage-keys dt{ margin-top:10px; }
.stage-keys dt code{ font-weight:500; color:var(--accent-strong); background:var(--accent-soft); }
.stage-keys dd{ margin:4px 0 0; font-size:0.9rem; line-height:1.5; color:var(--text-soft); }
.stage-eg{ display:block; margin-top:2px; color:var(--text-mute); }
.stage-card--key code{ background:var(--surface); }
.stage-card .stage-key{ display:inline-block; margin-bottom:6px; font-weight:500; color:var(--accent-strong); }
@media (max-width:900px){
  .compare-grid, .stage-grid{ grid-template-columns:1fr; }
  .video-chapters{ grid-template-columns:repeat(4, minmax(0, 1fr)); }
  .hero .teaser-video, .hero .video-chapters, .hero .video-scrub, .hero > .figure-wide, .hero > .sub-heading{ max-width:none; }
}

/* =============== SLIDER (dot-driven horizontal slides) =============== */
.slider-window{ overflow:hidden; background:var(--media-bg); }
.slider-track{ display:flex; transition:transform var(--dur-slow) var(--ease); }
.slider-track{ align-items:flex-start; }
.slider-track > *{ flex:0 0 100%; min-width:0; }
.slider .slide-question{ display:block; width:min(100%, 445px); height:auto; margin:16px auto 0; }
.slide .compare-panel img{ margin:0; }
.slider-dots{
  display:flex; flex-wrap:wrap; justify-content:center; gap:8px;
  padding:12px 16px; border-top:1px solid var(--border-soft); background:var(--surface-2);
}
.slider-dot{
  min-height:44px; padding:8px 14px; cursor:pointer;
  font:inherit; font-size:0.85rem; font-weight:600; color:var(--text-soft);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  transition:color var(--motion), background-color var(--motion), border-color var(--motion);
}
.slider-dot::before{
  content:""; display:inline-block; width:8px; height:8px; margin-right:8px;
  border-radius:50%; background:var(--border);
}
.slider-dot:hover{ border-color:var(--accent); }
.slider-dot.is-active{ color:var(--accent-strong); background:var(--accent-soft); border-color:var(--accent); }
.slider-dot.is-active::before{ background:var(--accent); }
.slider-dot:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* Playback speed picker under the trace replay */
.speed-chips{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:center; gap:6px;
  padding:8px 16px; border-top:1px solid var(--border-soft); background:var(--surface-2);
}
.speed-label{ font-size:0.78rem; font-weight:600; color:var(--text-soft); margin-right:4px; }
.speed-chip{
  min-width:40px; min-height:30px; padding:4px 10px; cursor:pointer;
  font:inherit; font-size:0.78rem; font-weight:600; color:var(--text-soft);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  transition:color var(--motion), background-color var(--motion), border-color var(--motion);
}
.speed-chip:hover{ border-color:var(--accent); }
.speed-chip.is-active{ color:var(--accent-strong); background:var(--accent-soft); border-color:var(--accent); }
.speed-chip:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
@media (prefers-reduced-motion: reduce){ .slider-track{ transition:none; } }

.paw-list{ margin:0 0 20px; padding-left:22px; }
.paw-list li{ margin:10px 0; line-height:1.6; }
.paw-list strong{ color:var(--accent-strong); }

/* =============== TOGGLE (collapsible explanation) =============== */
.toggle{
  background:var(--surface);
  border:1px solid var(--border); border-left:4px solid var(--accent);
  border-radius:var(--radius-lg);
  margin:16px 0 0; box-shadow:var(--shadow-1);
}
.toggle summary{
  display:flex; align-items:center; gap:10px;
  min-height:44px; padding:12px 20px; cursor:pointer; list-style:none;
  font-family:var(--font-display); font-weight:700; font-size:1.08rem; color:var(--text);
}
.toggle summary .toggle-key{ color:var(--up); font-weight:800; }
.toggle summary::-webkit-details-marker{ display:none; }
.toggle summary::before{
  content:""; flex:0 0 auto; width:8px; height:8px;
  border-right:2px solid var(--accent); border-bottom:2px solid var(--accent);
  transform:rotate(-45deg); transition:transform var(--motion);
}
.toggle[open] summary::before{ transform:rotate(45deg); }
.toggle summary:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.toggle-body{ padding:0 20px 16px 38px; }
.toggle-body p{ margin:0 0 8px; }
.toggle-body ul{ margin:0; padding-left:20px; }
.toggle-body li{ margin:6px 0; }

/* =============== FIGURES =============== */
.figure-wide, .figure-medium{
  margin:8px 0 14px;
  background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-lg);
  overflow:hidden; box-shadow:var(--shadow-1);
  transition:box-shadow var(--motion), transform var(--motion);
}
.figure-medium{ max-width:760px; margin-left:auto; margin-right:auto; }
/* Outside the overview, wide figures share the medium figure width */
.sec:not(.hero) .figure-wide{ max-width:760px; margin-left:auto; margin-right:auto; }
.sec:not(.hero) .figure-wide.figure-full{ max-width:none; }   /* dense figures that need the full content width */
.figure-wide img, .figure-medium img{ display:block; width:100%; height:auto; background:var(--media-bg); }
.figure-wide figcaption.caption-center{ text-align:center; }
/* Architecture figure: hovering a stage card keeps that stage in colour and greys out the rest */
.arch-dots{ display:none; }
.sec:not(.hero) .figure-wide.arch{ max-width:80%; }
.arch-stack{ position:relative; }
.arch-stack img{ display:block; width:100%; height:auto; }
.arch-base{ transition:filter var(--motion), opacity var(--motion); }
.arch-hi{ position:absolute; inset:0; opacity:0; pointer-events:none; transition:opacity var(--motion);
  -webkit-mask-repeat:no-repeat; mask-repeat:no-repeat; }
.arch.is-focus .arch-base{ filter:grayscale(1); opacity:0.38; }
.arch.is-focus .arch-hi{ opacity:1; }
.stage-card[data-stage]{ transition:border-color var(--motion), box-shadow var(--motion); }
.stage-card[data-stage]:hover, .stage-card[data-stage]:focus-visible{ border-color:var(--accent); outline:none; box-shadow:var(--shadow-2); }
@media (prefers-reduced-motion: reduce){ .arch-base, .arch-hi, .arch .arch-stack img{ transition:none; } }

/* Analysis bar charts (inline SVG built by tools/build_analysis_charts.py) */
:root{ --chart-1:#A9C6E3; --chart-2:var(--accent); --chart-3:#8A97A8; }
.ch-row{ display:grid; grid-template-columns:minmax(0, 300px) minmax(0, 1fr); gap:8px 28px; align-items:center; padding:14px 0; border-top:1px solid var(--border-soft); }
.ch-row-solo{ grid-template-columns:minmax(0, 440px); justify-content:center; }
.ch-trio{ display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); gap:16px 28px; padding:14px 0 6px; border-top:1px solid var(--border-soft); }
.ch-trio .ch-panel{ width:80%; margin-left:auto; margin-right:auto; }
.ch-cell{ min-width:0; display:grid; grid-template-rows:subgrid; grid-row:span 3; row-gap:0; }
.ch-cell .ch-title{ margin:8px 0 4px; }
.ch-dots{ display:none; }
.ch-cell .ch-note{ margin:0; font-size:0.9rem; color:var(--text-soft); }
.sec:not(.hero) .figure-wide.ch-quals{ max-width:none; margin:18px 0 4px; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); }
.ch-qual{ min-width:0; display:flex; flex-direction:column; gap:8px; padding:14px; background:var(--media-bg); }
.ch-qual + .ch-qual{ border-left:1px solid var(--border-soft); }
.ch-qual img{ cursor:zoom-in; }
.ch-quals figcaption{ grid-column:1 / -1; }
.ch-text p{ margin:0; }
.ch-text .ch-title{ margin-bottom:6px; }
.ch-panel{ min-width:0; display:flex; flex-direction:column; }
.ch-panel svg{ display:block; width:100%; height:auto; overflow:visible; margin-top:auto; }
.ch-title{ margin:0; font-family:var(--font-display); font-size:1rem; font-weight:700; color:var(--text); line-height:1.25; font-variant-ligatures:none; font-feature-settings:"liga" 0, "dlig" 0, "calt" 0; }
.ch-title b{ color:var(--accent); font-weight:800; }
.ch-panel .ch-sub{ margin:0; font-size:0.78rem; color:var(--text-mute); }
.ch-panel .ch-legend{ margin:4px 0 6px; display:flex; flex-wrap:wrap; gap:2px 12px; font-size:0.76rem; color:var(--text-soft); }
.ch-legend span{ display:inline-flex; align-items:center; gap:4px; white-space:nowrap; }
.ch-legend i{ width:9px; height:9px; border-radius:2px; }
.ch-c1{ fill:var(--chart-1); background:var(--chart-1); }
.ch-c2{ fill:var(--chart-2); background:var(--chart-2); }
.ch-c3{ fill:var(--chart-3); background:var(--chart-3); }
.ch-grid{ stroke:var(--border-soft); stroke-width:1; }
.ch-base{ stroke:var(--text-mute); }
.ch-cut{ stroke:var(--surface); stroke-width:2.5; }
.ch-gap{ stroke:var(--media-bg); stroke-width:1.5; }
.ch-sep{ stroke:var(--border); stroke-width:1; stroke-dasharray:3 3; }
.ch-tick, .ch-x, .ch-val, .ch-ratio, .ch-group{ font-family:var(--font); font-size:9px; fill:var(--text-mute); }
.ch-x{ fill:var(--text-soft); }
.ch-val{ fill:var(--text); font-size:8.5px; font-weight:600; font-variant-numeric:tabular-nums; }
.ch-ratio{ fill:var(--text-soft); font-size:8.5px; font-weight:700; }
.ch-ours{ fill:var(--accent); font-weight:800; }
@media (max-width:760px){
  .ch-trio .ch-panel{ width:100%; }
  .sec:not(.hero) .figure-wide.arch{ max-width:none; }
  .ch-row{ grid-template-columns:minmax(0, 1fr); }
  /* The three small-model charts become cards to swipe through; the next one peeks in from the right */
  .ch-trio{
    display:flex; gap:12px; overflow-x:auto; scroll-snap-type:x mandatory; -webkit-overflow-scrolling:touch;
    scrollbar-width:none; padding:14px 2px 6px; margin:0 -2px; border-top:1px solid var(--border-soft);
  }
  .ch-trio::-webkit-scrollbar{ display:none; }
  .ch-cell{
    display:flex; flex-direction:column; flex:0 0 86%; scroll-snap-align:center;
    padding:12px 14px 14px; border:1px solid var(--border); border-radius:var(--radius-lg); background:var(--surface);
  }
  .ch-cell .ch-panel{ flex:0 0 auto; }
  .ch-cell .ch-panel svg{ margin-top:6px; }
  .ch-dots{ display:flex; justify-content:center; gap:4px; padding:4px 0 2px; }
  .ch-dots button{ width:28px; height:22px; padding:0; border:0; background:none; cursor:pointer; position:relative; }
  .ch-dots button::after{ content:""; position:absolute; left:50%; top:50%; width:8px; height:8px; margin:-4px 0 0 -4px; border-radius:50%; background:var(--border); transition:background-color var(--motion), transform var(--motion); }
  .ch-dots button.is-current::after{ background:var(--accent); transform:scale(1.25); }
  .ch-qual + .ch-qual{ border-left:0; border-top:1px solid var(--border-soft); }
}
/* Live trace replay (same-origin iframe, height set from its content by script.js) */
.hero > .figure-wide.trace-figure{ max-width:none; }
/* The replay is laid out at a fixed design width and scaled to the figure, so it looks the same at every size */
.trace-frame-box{ position:relative; overflow:hidden; height:500px; background:var(--media-bg); }
.trace-frame{ display:block; width:1720px; height:836px; border:0; transform-origin:0 0; }
.figure-wide figcaption, .figure-medium figcaption{
  padding:14px 22px 18px;
  font-size:0.92rem; color:var(--text-soft);
  border-top:1px solid var(--border-soft);
  background:var(--surface-2);
}
.figure-wide:hover, .figure-medium:hover{ box-shadow:var(--shadow-2); }

/* Image error / empty state — friendly fallback instead of a blank box */
.figure-error{
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:10px; min-height:180px; padding:32px;
  background:var(--surface-2); color:var(--text-mute); text-align:center;
}
.figure-error svg{ width:32px; height:32px; stroke:var(--text-mute); }
.figure-error span{ font-size:0.92rem; }
/* Reserve space for a missing src rather than collapsing */
.figure-wide img:not([src]), .figure-wide img[src=""],
.figure-medium img:not([src]), .figure-medium img[src=""]{
  min-height:180px; background:var(--surface-2);
}

/* =============== LIGHTBOX (click figure to enlarge) =============== */
.lightbox-trigger{ cursor:zoom-in; transition:opacity var(--motion), transform var(--motion); }
.lightbox-trigger:hover{ opacity:0.93; }
.lightbox-trigger:focus-visible{ outline:2px solid var(--accent); outline-offset:3px; }

.lightbox-overlay{
  position:fixed; inset:0;
  background:var(--overlay-bg);
  display:flex; align-items:center; justify-content:center;
  padding:4vh 4vw; z-index:10000;
  opacity:0; pointer-events:none;
  transition:opacity var(--motion);
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px);
  cursor:zoom-out;
}
.lightbox-overlay.visible{ opacity:1; pointer-events:auto; }
.lightbox-overlay img{
  display:block;
  max-width:100%; max-height:100%; width:auto; height:auto;
  object-fit:contain; border-radius:var(--radius);
  box-shadow:0 24px 80px var(--overlay-shadow);
  background:var(--media-bg); cursor:default;
  animation:lbZoomIn var(--dur-normal) var(--ease) both;
}
.lightbox-overlay--table{
  display:block; overflow:auto; overscroll-behavior:contain;
}
.lightbox-overlay--table img{
  width:var(--lightbox-table-width); max-width:none; max-height:none;
  margin:0 auto;
}
.lightbox-overlay--table .lightbox-close{ position:fixed; }
@keyframes lbZoomIn{ from{ transform:scale(0.94); opacity:0; } to{ transform:scale(1); opacity:1; } }
.lightbox-close{
  position:absolute; top:18px; right:22px;
  width:44px; height:44px; border-radius:50%;
  border:1px solid var(--overlay-border);
  background:var(--overlay-control);
  color:var(--on-accent); font-size:1.6rem; line-height:1; font-weight:400;
  cursor:pointer;
  transition:background-color var(--motion), border-color var(--motion), transform var(--motion);
}
.lightbox-close:hover{ background:var(--accent); border-color:var(--accent-strong); transform:scale(1.05); }
.lightbox-close:focus-visible{ outline:2px solid var(--on-accent); outline-offset:2px; }

/* =============== TABLE =============== */
.table-wrap{
  overflow-x:auto; margin:18px 0 10px;
  border-radius:var(--radius-lg); border:1px solid var(--border);
  background:var(--surface); box-shadow:var(--shadow-1);
  -webkit-overflow-scrolling:touch;
}

.table-wrap--data{ margin-top:4px; box-shadow:none; }
.results-table{
  width:100%; border-collapse:collapse;
  font-size:0.92rem; min-width:700px;
}

/* Compact results tables (about two thirds of the default scale) */
#section3 .table-wrap{ max-width:800px; margin-left:auto; margin-right:auto; }
#section3 .results-table{ font-size:0.76rem; min-width:620px; }
#section3 .results-table th, #section3 .results-table td{ padding:5px 7px; }
#section3 .results-table .th-left{ padding-left:12px; }
#section3 .row-section td{ padding-top:5px; padding-bottom:5px; }
:is(#accuracy-table, #backbone-table){ table-layout:fixed; }
:is(#accuracy-table, #backbone-table) .col-method{ width:17%; }
:is(#accuracy-table, #backbone-table) tbody td:not([colspan]){ font-size:0.88rem; font-variant-numeric:tabular-nums; }
:is(#accuracy-table, #backbone-table) tbody tr > td:nth-child(2):nth-last-child(9), :is(#accuracy-table, #backbone-table) tbody td[rowspan]{ line-height:1.25; overflow-wrap:anywhere; }
:is(#accuracy-table, #backbone-table) .col-backbone{ width:14%; }
:is(#accuracy-table, #backbone-table) th.bench-name{ font-size:0.72rem; line-height:1.2; white-space:normal; vertical-align:middle; text-align:center; overflow-wrap:normal; }
:is(#accuracy-table, #backbone-table) .row-picker td{ padding:10px 12px; background:var(--surface-2); }
/* Top three per column among the rows shown: dark, medium, light green (set by script.js) */
:root{ --rank-1:var(--accent); --rank-2:#8EBADE; --rank-3:#DCEAF6; }
:is(#accuracy-table, #backbone-table) td.rank-1{ background:var(--rank-1); color:var(--on-accent); font-weight:700; }
:is(#accuracy-table, #backbone-table) td.rank-2{ background:var(--rank-2); color:var(--text); font-weight:600; }
:is(#accuracy-table, #backbone-table) td.rank-3{ background:var(--rank-3); color:var(--text); }
:is(#accuracy-table, #backbone-table) td.rank-1 .delta{ color:var(--on-accent); opacity:0.85; }
:is(#accuracy-table, #backbone-table) td.rank-2 .delta{ color:var(--accent-strong); }
.rank-key{ display:inline-flex; align-items:center; gap:5px; margin-right:10px; white-space:nowrap; }
.rank-key i{ width:11px; height:11px; border-radius:3px; }
.rank-key .rank-1{ background:var(--rank-1); } .rank-key .rank-2{ background:var(--rank-2); } .rank-key .rank-3{ background:var(--rank-3); }
.backbone-picker-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:8px; }
.backbone-compare{
  min-height:32px; padding:4px 10px; cursor:pointer;
  font:inherit; font-size:0.74rem; font-weight:600; color:var(--on-accent);
  background:var(--accent); border:1px solid var(--accent); border-radius:var(--radius-sm);
  transition:color var(--motion), background-color var(--motion), box-shadow var(--motion);
}
.backbone-compare::before{ content:"+ "; }
.backbone-compare:hover{ background:var(--accent-strong); }
.backbone-compare.is-active{ background:var(--accent-strong); border-color:var(--accent-strong); box-shadow:0 0 0 3px var(--accent-soft); }
.backbone-compare.is-active::before{ content:"\2713\00a0"; }
.backbone-compare:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.backbone-group:not([hidden]) ~ .backbone-group:not([hidden]){ border-top:2px solid var(--border); }
.backbone-picker{ display:flex; flex-wrap:wrap; gap:6px; }
.backbone-chip{
  min-height:32px; padding:4px 10px; cursor:pointer;
  font:inherit; font-size:0.74rem; font-weight:600; color:var(--text-soft);
  background:var(--surface); border:1px solid var(--border); border-radius:var(--radius-sm);
  transition:color var(--motion), background-color var(--motion), border-color var(--motion);
}
.backbone-chip:hover{ border-color:var(--accent); color:var(--accent-strong); }
.backbone-chip.is-active{ color:var(--on-accent); background:var(--accent); border-color:var(--accent); }
.backbone-chip:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }
.results-table th, .results-table td{ padding:11px 14px; text-align:center; }
.results-table thead th{
  font-weight:600; font-size:0.84rem;
  color:var(--text-soft); background:var(--surface-2);
  border-bottom:1px solid var(--border); letter-spacing:0.02em;
}
.results-table tbody tr{ transition:background-color var(--motion); }
.results-table tbody tr:hover{ background:var(--surface-2); }

.results-table .th-left{ text-align:left; padding-left:22px; }

/* "Our method" rows — the single focal highlight (flat accent tint, not gradient) */
.row-ours{ background:var(--accent-soft); border-left:3px solid var(--accent); }
.row-ours td{ color:var(--accent-strong); font-weight:600; }

.row-section td{
  text-align:left; font-size:0.82rem; font-weight:600;
  color:var(--text-soft); background:var(--surface-2);
  padding-top:9px; padding-bottom:9px;
}
.row-section em{ font-style:italic; color:var(--text); }
/* Inline deltas — green = improvement, red = regression (severity only) */
.delta{ font-size:0.78em; font-weight:600; white-space:nowrap; }
.delta.imp{ color:var(--up); }

.delta.reg{ color:var(--down); }
:is(#accuracy-table, #backbone-table) .delta{ display:block; }

.results-table thead th.grp{
  border-left:1px solid var(--border); border-bottom:1px solid var(--border); font-size:0.8rem;
}

.results-table thead th.grp-sub{ border-left:1px solid var(--border); font-weight:600; }

/* =============== BIBTEX =============== */
.bib-wrap{
  position:relative;
  background:var(--surface);
  border:1px solid var(--border); border-radius:var(--radius-lg);
  box-shadow:var(--shadow-1); margin-top:16px;
}
.bib{
  margin:0; padding:18px 20px;
  font-family:var(--font-mono); font-size:0.85rem; line-height:1.5;
  overflow-x:auto; color:var(--text);
}
.bib code{ background:none; padding:0; border-radius:0; font-size:inherit; }
.copy-btn{
  position:absolute; top:12px; right:12px;
  background:var(--surface-2); color:var(--accent-strong);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  padding:7px 14px; font-size:0.78rem; font-weight:600; cursor:pointer;
  transition:background-color var(--motion), color var(--motion), border-color var(--motion);
}
.copy-btn:hover{ background:var(--accent); color:var(--on-accent); border-color:var(--accent); }
.copy-btn.copied{ background:var(--success); color:var(--on-accent); border-color:var(--success); }
.copy-btn:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

/* =============== FOOTER =============== */
.footer{
  margin-top:56px; padding-top:24px;
  border-top:1px solid var(--border-soft);
  color:var(--text-mute); font-size:0.875rem;
}

/* =============== Scroll-in fade (JS opt-in via .fade-in) =============== */
.fade-in{ animation:fadeUp var(--dur-slow) var(--ease) both; }
@keyframes fadeUp{ from{ opacity:0; transform:translateY(8px); } to{ opacity:1; transform:none; } }

/* =============================================================================
   RESPONSIVE — standard breakpoints around the real content
   ============================================================================= */

/* Small laptops — narrow the rail */
@media (max-width:1024px){
  :root{ --sidebar-w:200px; }

}

/* Tablet & below — sidebar becomes a top bar, single column */
@media (max-width:768px){
  .layout{ flex-direction:column; }
  .sidebar{
    position:static; height:auto; width:100%; flex:0 0 auto;
    border-right:none; border-bottom:1px solid var(--border);
    padding:16px 20px;
    padding-left:max(20px, env(safe-area-inset-left));
    padding-right:max(20px, env(safe-area-inset-right));
  }
  .sidebar-brand{ margin-bottom:12px; }
  .sidebar-nav{
    flex-direction:row; flex-wrap:nowrap; gap:4px;
    overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch;
  }
  .sidebar-nav::-webkit-scrollbar{ display:none; }

  .nav-link{
    flex:0 0 auto; white-space:nowrap;
    min-height:44px; display:flex; align-items:center;    /* >=44px touch target */
    padding:8px 14px; border-left:none; border-radius:var(--radius-sm);
  }
  .nav-link.active{ border-left:none; background:var(--accent-soft); }

  /* In the column layout, margin:auto would disable flex-stretch and let the
     column balloon to its max-width (pushing content off-screen) — pin it full-width. */
  .content{ width:100%; max-width:100%; margin:0; padding:32px var(--content-px) 64px; }
  .sec{ margin-bottom:56px; }

  .link-btn{ min-height:44px; }
  .copy-btn{ min-height:44px; padding:10px 16px; }

}

/* PawPrints examples: each one shows the question (frames, question, options) with one toggle per method.
   Desktop lays the three side by side; phones show one at a time, picked with the buttons below. */
.paw-m{ padding:12px; }
.paw-m img{ display:block; width:100%; height:auto; }
.paw-ans{ margin-top:10px; border:1px solid var(--border); border-radius:var(--radius); background:var(--surface); overflow:hidden; }
.paw-ans summary{
  display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:44px; padding:8px 12px; cursor:pointer; list-style:none;
  font-family:var(--font-display); font-weight:700; font-size:0.9rem; color:var(--text);
}
.paw-ans summary::-webkit-details-marker{ display:none; }
.paw-ans summary > span:first-child::before{ content:"\203A"; display:inline-block; width:14px; margin-right:4px; color:var(--text-mute); transition:transform var(--motion); }
.paw-ans[open] summary > span:first-child::before{ transform:rotate(90deg); }
.paw-ans summary:hover{ background:var(--surface-2); }
.paw-ans summary:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
.paw-verdict{ flex:0 0 auto; padding:2px 9px; border-radius:999px; font-family:var(--font); font-size:0.74rem; font-weight:600; }
.paw-ans--wrong .paw-verdict{ background:#F6E3DF; color:var(--down); }
.paw-ans--right .paw-verdict{ background:var(--accent-soft); color:var(--up); }
.paw-ans > img{ padding:4px 8px 10px; cursor:zoom-in; }
.paw-ans--right{ border-color:var(--accent); }
@media (min-width:769px){
  .paw-examples .slider-track{ transform:none !important; display:grid; grid-template-columns:repeat(3, minmax(0, 1fr)); align-items:start; }
  .paw-examples .slide + .slide{ border-left:1px solid var(--border-soft); }
  .paw-examples .slider-dots{ display:none; }
}

/* ---------- Phones: section bar on top and a compact author list ---------- */
.mnav-toggle{ display:none; }
@media (max-width:768px){
  /* One thin sticky bar shows the current section; tapping it opens the list. The brand block is dropped. */
  .sidebar-brand{ display:none; }
  .sec{ scroll-margin-top:60px; }
  .sidebar{
    position:sticky; top:0; z-index:40; padding:0; background:var(--surface);
    border-bottom:none; box-shadow:0 1px 0 var(--border);
  }
  .mnav-toggle{
    display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:48px;
    padding:10px max(20px, env(safe-area-inset-right)) 10px max(20px, env(safe-area-inset-left));
    font:inherit; font-family:var(--font-display); font-weight:700; font-size:0.95rem; color:var(--accent-strong);
    background:none; border:0; cursor:pointer; text-align:left;
  }
  .mnav-toggle svg{ transition:transform var(--motion); flex:0 0 auto; }
  .sidebar.is-open .mnav-toggle svg{ transform:rotate(180deg); }
  .mnav-toggle:focus-visible{ outline:2px solid var(--accent); outline-offset:-2px; }
  .sidebar-nav{
    display:none; position:absolute; left:0; right:0; top:100%; flex-direction:column; gap:0; overflow:visible;
    padding:6px 12px 12px; background:var(--surface); border-bottom:1px solid var(--border); box-shadow:var(--shadow-2);
  }
  .sidebar.is-open .sidebar-nav{ display:flex; }
  .nav-link{ white-space:normal; padding:10px 12px; }

  /* Method: the diagram stays under the section bar while the stage cards scroll past it,
     and script.js keeps the stage being read in colour */
  .sec:not(.hero) .figure-wide.arch{
    position:sticky; top:54px; z-index:30; max-width:none; box-shadow:0 8px 18px rgba(20, 40, 70, 0.14);
  }
  /* The pinned frame is taller than the diagram, and script.js zooms the diagram into the stage being read */
  .arch .arch-stack{ aspect-ratio:100 / 58; overflow:hidden; background:var(--media-bg); }
  .arch .arch-stack img{ position:absolute; left:0; top:0; width:100%; height:auto; transform-origin:0 0;
    transition:transform var(--dur-slow) var(--ease), filter var(--motion), opacity var(--motion); }
  .arch .arch-hi{ inset:auto; }
  /* Swipe the pinned diagram sideways (or tap a dot) to move between stages; the page scrolls to match */
  .sec:not(.hero) .figure-wide.arch{ touch-action:pan-y; }
  .arch-dots{ display:flex; justify-content:center; gap:4px; padding:2px 0 4px; background:var(--media-bg); }
  .arch-dots button{ width:28px; height:22px; padding:0; border:0; background:none; cursor:pointer; position:relative; }
  .arch-dots button::after{ content:""; position:absolute; left:50%; top:50%; width:8px; height:8px; margin:-4px 0 0 -4px; border-radius:50%; background:var(--border); transition:background-color var(--motion), transform var(--motion); }
  .arch-dots button.is-current::after{ background:var(--accent); transform:scale(1.25); }
  #latency-table .row-section td{ font-size:0.72rem; }
  .stage-card.is-current{ border-color:var(--accent); box-shadow:var(--shadow-2); }

  /* PawPrints examples: one at a time; inactive ones must not hold the height open */
  .slider .slide:not(.is-active){ height:0; overflow:hidden; }

  /* Twelve authors: smaller type and tighter gaps keep the list to about four lines */
  .authors-grid{ gap:2px 10px; margin:6px 0 4px; }
  .author-card{ font-size:0.74rem; line-height:1.5; white-space:nowrap; }
  .authors-break{ display:none; }
  .affil-legend{ font-size:0.74rem; margin:2px 0 12px; }
}

/* Phones — reflow the hero, compact the tables */
@media (max-width:480px){
  .hero-title br{ display:none; }                 /* let the title reflow to the viewport */
  .hero-title{ font-size:clamp(1.75rem, 8vw, 2.6rem); }
  .content{ padding:28px 18px 56px; }
  .sub-heading{ font-size:1.08rem; }
  .results-table{ font-size:0.84rem; }
  .results-table th, .results-table td{ padding:8px 10px; }

}

/* =============== Reduced-motion — honour the OS preference =============== */
@media (prefers-reduced-motion: reduce){
  *, *::before, *::after{
    transition-duration:0.01ms !important;
    animation-duration:0.01ms !important;
    animation-iteration-count:1 !important;
    scroll-behavior:auto !important;
  }
}


/* =============== SNOW THEME =============== */
/* The photo is a fixed backdrop, the first screen shows it bare, and every later section sits on a frosted panel
   so text never runs over the tree. Paw prints are pressed into the snow instead of drawn on top of it. */
html{ background:#EAF2FA; }
body{ background:none; }
body::before{
  content:""; position:fixed; inset:0; z-index:-1; pointer-events:none;
  background:url("assets/snow_bg2.jpg") 0% 50% / cover no-repeat;   /* left-aligned, so the tree sits in the right margin */
}
:root{
  --surface:rgba(255, 255, 255, 0.90);
  --surface-2:rgba(241, 246, 251, 0.86);
  --media-bg:#FFFFFF;
}
.sidebar{ background:rgba(244, 248, 252, 0.72); -webkit-backdrop-filter:blur(10px); backdrop-filter:blur(10px); }
.sec:not(.hero){
  padding:28px clamp(16px, 2.4vw, 32px) 30px; border-radius:20px;
  background:rgba(250, 252, 254, 0.80); -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  border:1px solid rgba(255, 255, 255, 0.85); box-shadow:0 10px 40px rgba(43, 83, 131, 0.10);
}
.hero-warm{ color:#8EBADE; }
.hero-accent{ color:#3F6FA6; }
.hero-title, .hero-sub{ text-shadow:0 1px 14px rgba(255, 255, 255, 0.9); }
.link-btn{ background:rgba(255, 255, 255, 0.82); -webkit-backdrop-filter:blur(6px); backdrop-filter:blur(6px); }

/* Paw prints are a real print cut out of a snow photo; they stay a little before the snow fills them in */
.paw-print{
  width:22px; height:22px; margin:-11px 0 0 -11px;
  background:url("assets/snow-paw.png") center / contain no-repeat;
  -webkit-mask:none; mask:none; filter:blur(0.3px);
  mix-blend-mode:multiply;                       /* darkens the snow under it instead of sitting on top */
  animation:paw-fade 3.2s var(--ease) forwards;
}
.hero-cat{ width:auto; height:1.5em; margin-left:0.12em; vertical-align:-0.3em; }
@keyframes paw-fade{ 0%{ opacity:0; } 8%{ opacity:0.7; } 60%{ opacity:0.55; } 100%{ opacity:0; } }
@media (max-width:768px){
  .sec:not(.hero){ padding:20px 14px 22px; border-radius:16px; }
  .sidebar{ background:rgba(255, 255, 255, 0.9); }
}

/* Backdrop crops of the wide snow photo (pick with <html data-bg="...">, or ?bg=... while comparing).
   The photo is 16:9 with the horizon at about 62% of its height and the tree at about 82% of its width. */
html[data-bg="center"] body::before{ background-size:160% auto; background-position:50% 50%; }   /* middle of the photo, tree just out of frame */
html[data-bg="snow"] body::before{ background-size:220% auto; background-position:50% 100%; }    /* mostly snow, horizon high */
html[data-bg="sky"] body::before{ background-size:130% auto; background-position:50% 0%; }       /* mostly sky, horizon low */
html[data-bg="tree"] body::before{ background-size:130% auto; background-position:45% 62%; }     /* a little closer, tree in the right margin */
@media (max-width:768px){
  html[data-bg] body::before{ background-size:auto 130vh; background-position:86% 60%; }
  html[data-bg="snow"] body::before{ background-size:auto 210vh; background-position:88% 100%; }
  html[data-bg="center"] body::before{ background-position:50% 60%; }
}

/* Falling snow: two layers of one seamless tile drift down over the backdrop, behind the page content, at different sizes and speeds.
   Each flake is white with a soft blue rim, so it shows on the sky, on the snow and on the white panels. */
.snowfall{ position:fixed; inset:0; z-index:-1; pointer-events:none; overflow:hidden; }
.snowfall i{ position:absolute; left:-40px; right:-40px; background:url("assets/snowfall.png") repeat; will-change:transform; }
.snowfall .near{ top:-1024px; height:calc(100% + 1024px); background-size:1024px 1024px; opacity:0.8; animation:snow-near 30s linear infinite, snow-sway 9s ease-in-out infinite alternate; animation-composition:add; }
.snowfall .far{ top:-600px; height:calc(100% + 600px); background-size:600px 600px; opacity:0.5; animation:snow-far 52s linear infinite; }
@keyframes snow-near{ to{ transform:translate3d(0, 1024px, 0); } }
@keyframes snow-far{ to{ transform:translate3d(0, 600px, 0); } }
@keyframes snow-sway{ from{ translate:-18px 0; } to{ translate:18px 0; } }
/* Phones: smaller flakes and a denser fall, so the snow reads on a narrow screen */
@media (max-width:768px){
  .snowfall .near{ top:-560px; height:calc(100% + 560px); background-size:560px 560px; opacity:0.9; animation:snow-near-m 20s linear infinite, snow-sway 9s ease-in-out infinite alternate; animation-composition:add; }
  .snowfall .far{ top:-340px; height:calc(100% + 340px); background-size:340px 340px; opacity:0.6; animation:snow-far-m 34s linear infinite; }
}
@keyframes snow-near-m{ to{ transform:translate3d(0, 560px, 0); } }
@keyframes snow-far-m{ to{ transform:translate3d(0, 340px, 0); } }
@media (prefers-reduced-motion: reduce){ .snowfall{ display:none; } }

/* Text graph construction animation (same-origin iframe; it reports its own height) */
.tg-frame{ display:block; width:100%; height:660px; border:0; background:var(--media-bg); }
