/* ==========================================================================
   VLAs Execute, Code Recovers — Standalone Project Page Stylesheet
   Editorial split-canvas aesthetic inspired by NVIDIA GEAR ASPIRE:
   - Full-bleed dark obsidian architectural cover hero (#0A0D11)
   - Warm editorial paper body (#F2ECE6) with crisp Newsreader serif headings,
     Inter body copy, IBM Plex Mono accents, and fixed minimalist left TOC.
   ========================================================================== */

:root {
  /* Warm paper editorial palette (ASPIRE x Jiajie Cream Editorial) */
  --paper: #f2ece6;
  --paper-soft: #eae3db;
  --surface: #faf8f4;
  --card: #ffffff;
  --ink: #1b1e23;
  --ink-2: #464b54;
  --muted: #6f747e;
  --line: rgba(27, 30, 35, 0.11);
  --line-strong: rgba(27, 30, 35, 0.2);

  /* Dark architectural hero canvas */
  --dark-bg: #0a0d11;
  --dark-surface: #12171e;
  --dark-line: rgba(255, 255, 255, 0.12);

  /* Semantic accents (paper-consistent) */
  --accent: #5a8729;
  --accent-bright: #84cc3f;
  --accent-soft: #eaf2e0;
  --c-good: #527a2d;
  --c-good-soft: #edf4e5;
  --c-body: #2f6db3;
  --c-body-soft: #e9f1fa;
  --c-world: #c65633;
  --c-world-soft: #faeae4;
  --c-view: #7b60a8;
  --c-view-soft: #f1edf8;
  --c-warn: #a86a12;
  --c-warn-soft: #fbf3e2;
  --c-crit: #b8382a;
  --c-fail: #68645c;
  --c-neutral: #b7b1a4;

  /* Typography */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "Newsreader", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout & motion */
  --toc-w: 196px;
  --max-text: 840px;
  --max-wide: 1080px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
}

code {
  font-family: var(--font-mono);
  font-size: 0.87em;
  background: rgba(27, 30, 35, 0.06);
  padding: 0.12em 0.38em;
  border-radius: 5px;
  color: var(--ink);
}

.num {
  font-variant-numeric: lining-nums tabular-nums;
}

.t-good {
  color: var(--c-good);
}
.t-body {
  color: var(--c-body);
}
.t-world {
  color: var(--c-world);
}
.t-view {
  color: var(--c-view);
}
.t-warn {
  color: var(--c-warn);
}
.t-crit {
  color: var(--c-crit);
}
.t-muted {
  color: var(--muted);
}

/* ---------- Top Thin Progress Bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  z-index: 200;
  pointer-events: none;
  transition: width 0.08s linear;
}

/* ---------- Top Minimal Navbar (over dark hero, adapts on mobile) ---------- */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  z-index: 120;
  background: rgba(10, 13, 17, 0.45);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #f3f6f8;
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease),
    background 0.3s,
    color 0.3s;
}

.top-nav.past-hero {
  background: rgba(242, 236, 230, 0.88);
  border-bottom-color: var(--line);
  color: var(--ink);
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.nav-brand-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--accent-bright);
  box-shadow: 0 0 10px rgba(132, 204, 63, 0.65);
}

.top-nav.past-hero .nav-brand-dot {
  background: var(--accent);
  box-shadow: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  font-size: 0.84rem;
  font-weight: 500;
}

.nav-actions a {
  opacity: 0.82;
  transition:
    opacity 0.2s,
    color 0.2s;
}

.nav-actions a:hover {
  opacity: 1;
  color: var(--accent-bright);
}

.top-nav.past-hero .nav-actions a:hover {
  color: var(--accent);
}

.nav-pill {
  padding: 5px 13px;
  border-radius: 999px;
  border: 1px solid rgba(132, 204, 63, 0.42);
  background: rgba(132, 204, 63, 0.12);
  color: #c2f088 !important;
  opacity: 1 !important;
  font-weight: 600;
}

.top-nav.past-hero .nav-pill {
  border-color: rgba(82, 122, 45, 0.35);
  background: var(--c-good-soft);
  color: var(--c-good) !important;
}

/* ==========================================================================
   FULL-BLEED CINEMATIC DARK HERO (ASPIRE-Inspired Cover)
   ========================================================================== */
.hero-cover {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 96px 32px 84px;
  background: var(--dark-bg);
  color: #ffffff;
  overflow: hidden;
}

/* Subtle dark mosaic of our real robot & 3D Skill Envelope renders */
.hero-mosaic {
  position: absolute;
  inset: -12px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  opacity: 0.44;
  filter: saturate(0.95) contrast(1.06) brightness(0.86);
  pointer-events: none;
}

.hero-mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-scrim {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 72% 65% at 28% 46%, rgba(10, 13, 17, 0.56) 0%, rgba(10, 13, 17, 0.8) 70%, rgba(10, 13, 17, 0.92) 100%),
    linear-gradient(180deg, rgba(10, 13, 17, 0.58) 0%, rgba(10, 13, 17, 0.28) 50%, rgba(10, 13, 17, 0.9) 100%);
  pointer-events: none;
}

.hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 18% 30%, rgba(132, 204, 63, 0.14), transparent 36%),
    radial-gradient(circle at 82% 72%, rgba(63, 123, 191, 0.12), transparent 34%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1060px;
  width: 100%;
  margin: 0 auto;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(233, 238, 245, 0.76);
  padding: 6px 14px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 26px;
}

.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-bright);
}

.hero-title {
  font-family: var(--font-sans);
  font-size: clamp(2.75rem, 6.4vw, 5.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.036em;
  color: #ffffff;
  max-width: 15ch;
}

.hero-title .accent-slash {
  display: block;
  font-family: var(--font-mono);
  color: var(--accent-bright);
  font-weight: 600;
  letter-spacing: -0.03em;
  margin-top: 6px;
  text-shadow: 0 12px 44px rgba(132, 204, 63, 0.28);
}

.hero-subtitle {
  margin-top: 24px;
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 2.2vw, 1.65rem);
  font-weight: 400;
  line-height: 1.42;
  color: rgba(242, 236, 230, 0.88);
  max-width: 38ch;
}

.hero-stats {
  margin-top: 38px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 860px;
}

.hero-stat {
  padding: 15px 18px;
  background: rgba(16, 21, 28, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-top: 2px solid var(--accent-bright);
  border-radius: 6px;
  backdrop-filter: blur(10px);
}

.hero-stat.blue {
  border-top-color: #62a3ef;
}
.hero-stat.clay {
  border-top-color: #e68262;
}

.hero-stat .k {
  font-family: var(--font-mono);
  font-size: clamp(1.45rem, 2.3vw, 1.9rem);
  font-weight: 600;
  line-height: 1.1;
  color: #ffffff;
}

.hero-stat .l {
  margin-top: 5px;
  font-size: 0.78rem;
  color: rgba(233, 238, 245, 0.72);
  line-height: 1.35;
}

.hero-scroll {
  position: absolute;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  transition: color 0.2s;
}

.hero-scroll:hover {
  color: #ffffff;
}

.hero-scroll-chev {
  width: 10px;
  height: 10px;
  border-right: 1.8px solid currentColor;
  border-bottom: 1.8px solid currentColor;
  transform: rotate(45deg);
  animation: scrollBounce 2.1s ease-in-out infinite;
}

@keyframes scrollBounce {
  0%,
  100% {
    transform: translateY(0) rotate(45deg);
  }
  50% {
    transform: translateY(5px) rotate(45deg);
  }
}

/* ==========================================================================
   EDITORIAL SHELL + LEFT FIXED MINIMALIST TOC SIDEBAR (ASPIRE Signature)
   ========================================================================== */
.toc-sidebar {
  position: fixed;
  top: 84px;
  left: 26px;
  bottom: 28px;
  width: var(--toc-w);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition:
    opacity 0.35s var(--ease),
    transform 0.35s var(--ease);
}

.toc-sidebar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.toc-list {
  list-style: none;
  border-left: 1.5px solid var(--line);
  padding-left: 0;
}

.toc-list a {
  display: block;
  padding: 7px 0 7px 14px;
  margin-left: -1.5px;
  border-left: 2.5px solid transparent;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--muted);
  transition:
    color 0.2s,
    border-color 0.2s;
}

.toc-list a:hover {
  color: var(--ink);
}

.toc-list a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

.toc-footer {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.5;
}

.toc-footer a {
  display: inline-block;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 4px;
}

.toc-footer a:hover {
  color: var(--accent);
}

/* Main reading surface: full-bleed alternating bands with reading column offset cleanly from left TOC */
.paper-main {
  position: relative;
  background: var(--paper);
}

.section {
  padding: 84px 28px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 58px;
}

@media (min-width: 1280px) {
  .section,
  .site-footer {
    padding-left: calc(var(--toc-w) + 52px);
    padding-right: 48px;
  }
}

.section:first-of-type {
  border-top: none;
  padding-top: 68px;
}

.section-soft {
  background: var(--paper-soft);
}

.wrap {
  max-width: var(--max-text);
  margin: 0 auto;
}

.wrap-wide {
  max-width: var(--max-wide);
  margin: 0 auto;
}

/* Editorial typography */
.sec-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--c-world);
  margin-bottom: 10px;
}

.sec-title {
  font-family: var(--font-serif);
  font-size: clamp(1.85rem, 3.2vw, 2.45rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 16px;
}

.sec-subhead {
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  font-weight: 500;
  line-height: 1.28;
  color: var(--ink);
  margin-bottom: 10px;
}

.lead {
  font-size: 1.05rem;
  color: var(--ink-2);
  line-height: 1.72;
  max-width: 72ch;
}

.lead strong {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   PAPER META HEADER (Authors, Affiliations, Dark Pill CTAs — ASPIRE Style)
   ========================================================================== */
.paper-meta {
  text-align: center;
  max-width: 820px;
  margin: 0 auto 42px;
}

.paper-meta-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.1vw, 2.45rem);
  font-weight: 500;
  line-height: 1.22;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-bottom: 18px;
}

.authors-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  font-size: 1.04rem;
  font-weight: 500;
  color: var(--ink);
}

.authors-row a {
  border-bottom: 1px solid transparent;
  transition:
    border-color 0.2s,
    color 0.2s;
}

.authors-row a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.authors-row sup {
  font-size: 0.72em;
  color: var(--accent);
  margin-left: 1px;
}

.affils-row {
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--ink-2);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 20px;
}

.affil-notes {
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--muted);
}

.cta-row {
  margin-top: 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  background: #1d232b;
  color: #ffffff;
  border: 1px solid #1d232b;
  transition:
    transform 0.18s var(--ease),
    background 0.18s,
    box-shadow 0.18s;
}

.cta-btn:hover {
  background: #2f3845;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -10px rgba(27, 30, 35, 0.5);
  color: #ffffff;
}

.cta-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.cta-btn.primary:hover {
  background: #486e20;
}

.cta-btn.ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line-strong);
}

.cta-btn.ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--card);
}

.cta-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.abstract-box {
  max-width: 780px;
  margin: 0 auto 48px;
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--ink-2);
}

.abstract-box p + p {
  margin-top: 14px;
}

.abstract-box strong {
  color: var(--ink);
  font-weight: 600;
}

/* ==========================================================================
   CARDS, GRIDS, PULL-QUOTES & SEGMENTED CONTROLS
   ========================================================================== */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 22px;
  box-shadow: 0 12px 30px -22px rgba(45, 35, 20, 0.25);
}

.card-soft {
  background: var(--surface);
  box-shadow: none;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.split-row {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 34px;
  align-items: center;
}

.split-row.reverse {
  grid-template-columns: 0.92fr 1.08fr;
}

.pull-quote {
  margin-top: 32px;
  padding: 20px 26px;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.52;
  color: var(--ink);
}

.seg {
  display: inline-flex;
  flex-wrap: wrap;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  overflow: hidden;
  background: var(--card);
}

.seg button {
  font-size: 0.8rem;
  font-weight: 500;
  background: transparent;
  color: var(--ink-2);
  border: 0;
  padding: 6px 14px;
  transition:
    background 0.18s,
    color 0.18s;
  white-space: nowrap;
}

.seg button:hover {
  color: var(--ink);
}

.seg button[aria-pressed="true"] {
  background: var(--ink);
  color: #ffffff;
}

.fig-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 14px;
}

.fig-note {
  font-size: 0.92rem;
  color: var(--ink-2);
  line-height: 1.48;
  flex: 1 1 360px;
}

.fig-note b,
.fig-note strong {
  color: var(--ink);
}

/* ==========================================================================
   LIVING ANIMATED DIAGRAMS (Fig. 1, DAgger Manifold, Fig. 3)
   ========================================================================== */
.anim-stage {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px 10px;
  box-shadow: 0 18px 42px -28px rgba(45, 35, 20, 0.34);
}

.anim-svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font-sans);
}

.anim-svg .a-grp {
  transition: opacity 0.42s var(--ease);
}

.anim-svg .a-dim {
  opacity: 0.19;
}

.anim-svg .flow-fast {
  stroke-dasharray: 6 6;
  animation: flowFast 1.05s linear infinite;
}

.anim-svg .flow-slow {
  stroke-dasharray: 5 7;
  animation: flowSlow 2.1s linear infinite;
}

@keyframes flowFast {
  to {
    stroke-dashoffset: -24;
  }
}

@keyframes flowSlow {
  to {
    stroke-dashoffset: -24;
  }
}

.anim-svg .a-pulse,
.ds-svg .pulse-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: dsPulse 2.1s ease-out infinite;
}

@keyframes dsPulse {
  0% {
    transform: scale(0.7);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.9);
    opacity: 0;
  }
}

.anim-svg .a-gate-glow {
  animation: gateGlow 2.4s ease-in-out infinite;
}

@keyframes gateGlow {
  0%,
  100% {
    stroke-opacity: 0.78;
    filter: drop-shadow(0 0 0 rgba(201, 130, 30, 0));
  }
  50% {
    stroke-opacity: 1;
    filter: drop-shadow(0 0 8px rgba(201, 130, 30, 0.38));
  }
}

.anim-svg .a-bead,
.ds-bead {
  offset-rotate: 0deg;
  animation: dsBead var(--dur, 2.8s) linear infinite;
  animation-delay: var(--del, 0s);
}

@keyframes dsBead {
  0% {
    offset-distance: 0%;
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    offset-distance: 100%;
    opacity: 0;
  }
}

/* Fig. 1 bead paths */
.f1-b-exp {
  offset-path: path("M 46 160 C 96 158, 146 132, 194 58");
}
.f1-b-lin {
  offset-path: path("M 46 161 L 194 161");
}
.f1-b-cmd1 {
  offset-path: path("M 328 42 L 328 60");
}
.f1-b-cmd2 {
  offset-path: path("M 552 42 L 552 60");
}
.f1-b-seam {
  offset-path: path("M 439 128 V 212 H 164 V 224");
}
.f1-b-c2e {
  offset-path: path("M 320 349 H 354");
}
.f1-b-e2t {
  offset-path: path("M 700 349 H 734");
}
.f1-b-roll {
  offset-path: path("M 436 392 Q 496 382 556 396");
}
.f1-b-fb {
  offset-path: path("M 1068 349 H 1094 V 25 H 1068");
}

/* DAgger Manifold paths & states */
.ds-svg .ds-layer {
  transition:
    opacity 0.45s var(--ease),
    transform 0.55s var(--ease);
}
.ds-svg .ds-dim {
  opacity: 0.2;
}
.ds-svg .ds-hide {
  opacity: 0;
  pointer-events: none;
}
.ds-svg .ds-obs-lifted {
  transform: translateY(-108px);
}
.ds-bead-1 {
  offset-path: path("M 96 258 C 210 212, 330 206, 455 224 C 545 236, 610 236, 666 234");
}
.ds-bead-2 {
  offset-path: path("M 96 276 C 210 234, 330 228, 455 242 C 545 250, 610 250, 666 248");
}
.ds-bead-3 {
  offset-path: path("M 96 294 C 210 258, 330 252, 455 260 C 545 264, 610 264, 666 262");
}
.ds-bead-ood {
  offset-path: path("M 96 92 C 165 90, 232 78, 326 56");
}

/* Fig. 3 bead paths & animated sweeping arm */
.f3-b-p1 {
  offset-path: path("M 132 106 V 132");
}
.f3-b-p2 {
  offset-path: path("M 132 296 V 322");
}
.f3-b-lib2plan {
  offset-path: path("M 242 376 H 268 V 78 H 298");
}
.f3-b-lib2chk {
  offset-path: path("M 242 376 H 492 V 298");
}
.f3-b-g2p {
  offset-path: path("M 398 78 H 424");
}
.f3-b-p2h {
  offset-path: path("M 377 104 V 140");
}
.f3-b-h2r {
  offset-path: path("M 377 182 V 208");
}
.f3-b-r2c {
  offset-path: path("M 442 248 H 470");
}
.f3-b-clear {
  offset-path: path("M 602 224 C 624 224, 624 182, 648 182");
}
.f3-b-block {
  offset-path: path("M 602 272 C 624 272, 624 287, 648 287");
}
.f3-b-recheck {
  offset-path: path("M 717 328 V 354 H 304 V 161 H 312");
}
.f3-b-vla2end {
  offset-path: path("M 786 182 H 795 V 384");
}
.f3-b-t1 {
  offset-path: path("M 816 142 H 846");
}
.f3-b-t2 {
  offset-path: path("M 816 320 H 846");
}
.f3-b-chkarc {
  offset-path: path("M 976 148 Q 992 122 1008 134");
}
.f3-b-freearc {
  offset-path: path("M 956 364 Q 922 332 894 378");
}
.f3-arm-sweep {
  transform-origin: 68px 236px;
  animation: armSweep 3.8s ease-in-out infinite;
}
@keyframes armSweep {
  0%,
  100% {
    transform: rotate(-16deg);
  }
  50% {
    transform: rotate(18deg);
  }
}
.f3-vox {
  animation: voxLit 3.8s ease-in-out infinite;
  animation-delay: var(--vd, 0s);
}
@keyframes voxLit {
  0%,
  100% {
    fill-opacity: 0.36;
  }
  45%,
  65% {
    fill-opacity: 0.92;
  }
}

/* ==========================================================================
   COUNTERFACTUAL TRIPLET & MEDIA FRAMES
   ========================================================================== */
.photo-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 28px -22px rgba(45, 35, 20, 0.28);
}

.photo-frame {
  position: relative;
  overflow: hidden;
  background: #17191d;
}

.photo-frame img {
  width: 100%;
  height: auto;
}

.photo-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(250, 248, 244, 0.94);
  backdrop-filter: blur(4px);
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.photo-inset {
  position: absolute;
  right: 10px;
  top: 10px;
  width: 34%;
  border-radius: 7px;
  border: 2px solid var(--c-view);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.38);
  overflow: hidden;
  background: #111;
}

.photo-inset span {
  position: absolute;
  left: 4px;
  top: 4px;
  font-size: 0.62rem;
  font-weight: 600;
  background: rgba(123, 96, 168, 0.94);
  color: #ffffff;
  padding: 1px 6px;
  border-radius: 4px;
}

.photo-meta {
  padding: 14px 16px;
}

.photo-meta .score-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.photo-meta h4 {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--ink);
}

.photo-meta .stat {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

.photo-meta p {
  font-size: 0.86rem;
  color: var(--ink-2);
  line-height: 1.5;
}

/* ==========================================================================
   PURE-VECTOR LATEX EQUATION CARDS (Eq. 1, Eq. 2, Interactive Eq. 3)
   ========================================================================== */
.eq-box {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 12px;
}

.eq-box img {
  height: 44px;
  width: auto;
}

.eq-box .eq-num {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
}

.eq3-stage {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 16px;
  box-shadow: 0 16px 36px -24px rgba(45, 35, 20, 0.28);
}

.eq3-tag {
  position: absolute;
  right: 20px;
  top: 14px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.eq3-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.eq3-svg {
  display: block;
  height: 98px;
  width: auto;
  user-select: none;
}

.eq3-term {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 6px 6px;
  border-radius: 12px;
  transition: background 0.22s var(--ease);
  cursor: pointer;
}

.eq3-term.body {
  width: 306px;
}

.eq3-term.world {
  width: 256px;
}

.eq3-term.body:hover {
  background: rgba(47, 109, 179, 0.07);
}

.eq3-term.world:hover {
  background: rgba(198, 86, 51, 0.07);
}

.eq3-pill {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
}

.eq3-pill.body {
  background: var(--c-body-soft);
  color: var(--c-body);
  border: 1px solid rgba(47, 109, 179, 0.3);
}

.eq3-pill.world {
  background: var(--c-world-soft);
  color: var(--c-world);
  border: 1px solid rgba(198, 86, 51, 0.3);
}

.eq3-pill .sub-p {
  font-weight: 400;
  font-size: 0.76rem;
  opacity: 0.88;
}

.eq3-sim {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.eq3-calc {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 0.92rem;
  color: var(--ink-2);
}

.eq3-badge {
  display: inline-block;
  min-width: 52px;
  text-align: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.92rem;
}

.eq3-badge.ok {
  background: var(--c-good-soft);
  color: var(--c-good);
}
.eq3-badge.mid {
  background: var(--c-warn-soft);
  color: var(--c-warn);
}
.eq3-badge.bad {
  background: var(--c-world-soft);
  color: var(--c-crit);
}

.eq3-card {
  transition:
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.eq3-card.lit {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px -18px rgba(45, 35, 20, 0.38);
}

.eq3-inline {
  display: inline-block;
  height: 1.15em;
  width: auto;
  vertical-align: -0.22em;
  margin: 0 2px;
}

/* ==========================================================================
   ASPIRE-STYLE VIDEO GALLERY
   ========================================================================== */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  margin: 22px 0 26px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.filter-tab {
  background: transparent;
  border: 0;
  padding: 4px 2px 10px;
  margin-bottom: -11px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  transition:
    color 0.2s,
    border-color 0.2s;
}

.filter-tab:hover {
  color: var(--ink);
}

.filter-tab[aria-pressed="true"] {
  color: var(--ink);
  font-weight: 600;
  border-bottom-color: var(--accent);
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.video-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 32px -24px rgba(45, 35, 20, 0.32);
  display: flex;
  flex-direction: column;
}

.video-card.hidden-by-filter {
  display: none;
}

.video-frame {
  position: relative;
  background: #12151a;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-tag {
  display: inline-block;
  align-self: flex-start;
  padding: 2px 9px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--line);
  letter-spacing: 0.02em;
}

.rq1-grid {
  display: grid;
  grid-template-columns: 1.48fr 0.52fr;
  gap: 20px;
  align-items: stretch;
}

.rq1-kpis {
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: space-between;
}

.video-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.video-body h4 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.3;
}

.video-body p {
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.56;
}

.video-metrics {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-chip {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 5px;
  background: var(--c-good-soft);
  color: var(--c-good);
}

.metric-chip.blue {
  background: var(--c-body-soft);
  color: var(--c-body);
}

.metric-chip.clay {
  background: var(--c-world-soft);
  color: var(--c-world);
}

/* ==========================================================================
   BENCHMARK / EXPERIMENT CHARTS (D3 Warm-Paper Cards)
   ========================================================================== */
.exp-block {
  margin-top: 44px;
  padding-top: 38px;
  border-top: 1px solid var(--line);
}

.exp-block:first-of-type {
  margin-top: 28px;
  padding-top: 0;
  border-top: none;
}

.exp-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 14px;
}

.rq-tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 9px;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px 14px;
  box-shadow: 0 12px 28px -22px rgba(45, 35, 20, 0.24);
}

.chart-caption {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
}

.chart-box {
  width: 100%;
}

.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
  font-family: var(--font-sans);
  overflow: visible;
  font-variant-numeric: lining-nums tabular-nums;
}

.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.kpi-tile {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 16px;
}

.kpi-tile .v {
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.15;
}

.kpi-tile .d {
  margin-top: 4px;
  font-size: 0.83rem;
  color: var(--ink-2);
  line-height: 1.42;
}

/* Hover tooltip for D3 charts */
.chart-tip {
  position: fixed;
  z-index: 999;
  pointer-events: none;
  background: #1b1e23;
  color: #f4f6f8;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 9px 13px;
  font-size: 0.8rem;
  line-height: 1.5;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32);
  max-width: 310px;
  opacity: 0;
  transition: opacity 0.12s;
}

.chart-tip .tip-m {
  color: #a9b2bf;
  font-size: 0.74rem;
}

/* ==========================================================================
   BIBTEX & FOOTER
   ========================================================================== */
.bibtex-wrap {
  position: relative;
  background: #14181f;
  color: #e6ecf2;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-top: 18px;
}

.bibtex-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: #9ba5b4;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(132, 204, 63, 0.14);
  border: 1px solid rgba(132, 204, 63, 0.4);
  color: #c2f088;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 5px;
  transition: background 0.18s;
}

.copy-btn:hover {
  background: rgba(132, 204, 63, 0.25);
}

.bibtex-code {
  padding: 18px 20px;
  font-family: var(--font-mono);
  font-size: 0.81rem;
  line-height: 1.65;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.site-footer {
  padding: 40px 28px 54px;
  border-top: 1px solid var(--line);
  font-size: 0.84rem;
  color: var(--muted);
}

.footer-inner {
  max-width: var(--max-wide);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a:hover {
  color: var(--accent);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 1279px) {
  .toc-sidebar {
    display: none;
  }
}

@media (max-width: 920px) {
  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-2,
  .grid-3,
  .split-row,
  .split-row.reverse,
  .video-grid,
  .kpi-strip,
  .rq1-grid {
    grid-template-columns: 1fr;
  }
  .eq3-svg {
    height: 76px;
  }
  .eq3-term.body,
  .eq3-term.world {
    width: auto;
  }
}

@media (max-width: 600px) {
  .top-nav {
    padding: 0 16px;
  }
  .nav-actions .hide-sm {
    display: none;
  }
  .hero-cover {
    padding: 84px 20px 64px;
    min-height: 100svh;
  }
  .hero-mosaic {
    grid-template-columns: repeat(2, 1fr);
    grid-template-rows: repeat(4, 1fr);
  }
  .section {
    padding: 54px 18px;
  }
  .anim-stage {
    padding: 8px;
  }
  .eq-box img {
    height: 32px;
  }
  .eq3-stage {
    padding: 16px 12px 14px;
  }
  .eq3-row {
    flex-wrap: nowrap;
    justify-content: center;
    gap: 2px;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .eq3-term {
    padding: 2px;
  }
  .eq3-svg {
    height: 44px;
  }
  .eq3-pill {
    display: none;
  }
  .seg {
    border-radius: 10px;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
  }
  .seg button {
    flex: 1 1 auto;
    font-size: 0.75rem;
    padding: 6px 10px;
    border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .anim-svg .a-pulse,
  .ds-svg .pulse-ring,
  .anim-svg .a-bead,
  .ds-bead,
  .anim-svg .flow-fast,
  .anim-svg .flow-slow,
  .anim-svg .a-gate-glow,
  .f3-arm-sweep,
  .f3-vox,
  .hero-scroll-chev {
    animation: none !important;
  }
  .anim-svg .a-bead,
  .ds-bead {
    opacity: 0;
  }
}
