:root {
  --text: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --soft: #f1f5f9;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --accent-green: #047857;
  --accent-green-soft: #ecfdf5;
  --surface: #ffffff;
  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #f8fafc 0%, var(--surface) 18%, var(--surface) 100%);
  color: var(--text);
  font-family: var(--font-sans);
  font-optical-sizing: auto;
}

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

footer {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
}

.human-agent-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: 52px 0;
  padding: 54px 0;
  align-items: start;
}

.human-agent-pair .build-section {
  padding: 0;
}

@media (max-width: 900px) {
  .human-agent-pair {
    gap: 40px 0;
    padding: 40px 0;
  }
}

.hero {
  position: relative;
  padding: 0 0 8px;
  text-align: center;
  margin: 8px auto;
  scroll-margin-top: 24px;
}

.hero-inner {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(48px, 8vw, 88px) clamp(24px, 5vw, 40px) clamp(40px, 6vw, 64px);
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background:
    radial-gradient(100% 80% at 50% -10%, rgba(219, 234, 254, 0.55) 0%, transparent 55%),
    linear-gradient(165deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 24px 64px rgba(15, 23, 42, 0.07);
}

.hero-inner .cover-paper-h1,
.landing-cover .cover-hero-block .cover-paper-h1 {
  font-size: clamp(26px, 5vw, 42px);
  line-height: 1.08;
  max-width: 18em;
  margin-left: auto;
  margin-right: auto;
}


.cover-authors {
  margin: 4px auto 8px;
  max-width: 46rem;
  padding: 0 clamp(12px, 4vw, 28px);
  font-size: 13.5px;
  line-height: 1.55;
  color: #475569;
}

.cover-authors sup {
  font-size: 0.68em;
  font-weight: 700;
  color: var(--accent);
  margin-left: 1px;
  vertical-align: super;
}

.cover-authors strong {
  color: inherit;
  font-weight: 400;
}

.landing-cover .cover-affiliations {
  margin: 0 auto;
  padding: 0 clamp(12px, 4vw, 28px) 8px;
  max-width: 46rem;
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.65;
  letter-spacing: 0.01em;
  color: #64748b;
  text-align: center;
}

.landing-cover .cover-affil-sep {
  margin-right: 0.35em;
}

.landing-cover .cover-affil-item sup {
  font-size: 0.72em;
  font-weight: 700;
  color: var(--accent);
  margin-right: 2px;
}

.landing-cover {
  scroll-margin-top: 24px;
  padding: 0 clamp(12px, 3vw, 20px) clamp(40px, 8vw, 80px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.75);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 15%, #f8fafc 100%);
}

.landing-cover .cover-panel--unified {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 2.8vw, 22px);
  max-width: min(1180px, 100%);
  margin: clamp(16px, 4vw, 36px) auto 0;
  padding: clamp(22px, 4vw, 36px);
  padding-bottom: clamp(24px, 5vw, 40px);
  border-radius: 24px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: linear-gradient(168deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 20px 56px rgba(15, 23, 42, 0.07);
}

.landing-cover .cover-hero-block {
  scroll-margin-top: 24px;
  text-align: center;
}

.landing-cover .cover-paradigm {
  max-width: min(44rem, 100%);
  margin: 0 auto;
  padding: 0 clamp(4px, 2vw, 12px);
  text-align: center;
  font-size: clamp(16px, 1.95vw, 18.5px);
  line-height: 1.55;
  color: var(--muted);
}

.landing-cover .cover-paradigm#summary-teaser {
  scroll-margin-top: 96px;
}

.landing-cover .cover-paradigm strong {
  color: var(--text);
  font-weight: 700;
}

.landing-cover .cover-panel-stats.cover-panel-stats--keys {
  margin: 0;
  padding: 0;
  gap: clamp(6px, 1.4vw, 12px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: auto;
}

.landing-cover .cover-panel-stats--keys .paper-stat-card {
  padding: clamp(12px, 2.2vw, 18px) clamp(8px, 1.4vw, 12px);
  min-height: 100%;
  min-width: 0;
  align-items: center;
  text-align: center;
}

.landing-cover .cover-panel-stats--keys .paper-stat-desc {
  font-size: 11px;
  line-height: 1.35;
}

.landing-cover .cover-panel-stats--keys .paper-stat-label {
  text-wrap: balance;
}

.landing-cover .cover-panel-figure {
  scroll-margin-top: 24px;
  margin: 0;
}

.landing-cover .cover-tagline-metrics {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.6vw, 14px);
}

.landing-cover .cover-panel-figure .paper-figure {
  padding: clamp(10px, 2vw, 16px);
  margin: 0;
}

.landing-cover .cover-panel-stats.cover-panel-stats--keys#contributions {
  scroll-margin-top: 24px;
}

.landing-cover .cover-panel-actions {
  justify-content: center;
  flex-wrap: wrap;
  margin: clamp(4px, 1.2vw, 10px) 0 clamp(2px, 0.8vw, 6px);
}

@media (max-width: 720px) {
  .landing-cover .cover-panel-stats.cover-panel-stats--keys {
    gap: 6px;
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-card {
    padding: 11px 5px;
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-val {
    font-size: clamp(17px, 4.8vw, 28px);
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-val--usd {
    font-size: clamp(14px, 4.2vw, 24px);
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-label {
    font-size: 9px;
    letter-spacing: 0.1em;
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-desc {
    font-size: 9.75px;
  }
}

@media (max-width: 480px) {
  .landing-cover .cover-panel-stats--keys .paper-stat-desc {
    display: none;
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-val {
    font-size: clamp(15px, 5.2vw, 22px);
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-val--usd {
    font-size: clamp(13px, 4vw, 20px);
  }

  .landing-cover .cover-panel-stats--keys .paper-stat-card {
    padding: 10px 4px;
  }
}

.hero-badge {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 216, 0.2);
  background: rgba(239, 246, 255, 0.8);
  color: var(--accent);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.kicker {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-family: var(--font-sans);
  font-size: clamp(40px, 6.8vw, 68px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--text);
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

h3 {
  margin-bottom: 8px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

p {
  color: var(--muted);
  line-height: 1.68;
}

.lede {
  max-width: 720px;
  margin: 0 auto;
  font-size: clamp(17px, 2.2vw, 20px);
  line-height: 1.62;
}

.lede strong {
  color: var(--text);
  font-weight: 700;
}

.hero-pi-wrap {
  margin: 14px 0 0;
  display: flex;
  justify-content: center;
}

.hero-pi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #f1f5f9;
  color: #64748b;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.hero-pi code {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 1.15rem;
  font-weight: 600;
  color: inherit;
}


/* Headline metrics under hero */
.paper-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 0 8px;
  margin-bottom: 8px;
}

.paper-stat-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 10px 40px rgba(15, 23, 42, 0.045);
}

.paper-stat-card--accent {
  border-color: rgba(29, 78, 216, 0.22);
  background: linear-gradient(160deg, #eff6ff 0%, #fff 72%);
}

.paper-stat-card--dark {
  border-color: #1e293b;
  background: linear-gradient(160deg, #1e293b 0%, #0f172a 100%);
  color: #e2e8f0;
}

.paper-stat-card--dark .paper-stat-label,
.paper-stat-card--dark .paper-stat-desc {
  color: #94a3b8;
}

.paper-stat-val {
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--text);
}

.paper-stat-card--dark .paper-stat-val {
  color: #fff;
}

.paper-stat-val--usd {
  font-size: clamp(22px, 3.5vw, 30px);
}

.paper-stat-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.paper-stat-desc {
  font-size: 12px;
  line-height: 1.48;
  color: var(--muted);
}

.hero-spine {
  max-width: 620px;
  margin: 20px auto 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.55;
  color: #64748b;
  letter-spacing: 0.01em;
}

.hero-spine code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--soft);
  font-size: 0.92em;
  border: 1px solid var(--line);
}

.actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-weight: 650;
  background: var(--surface);
  cursor: pointer;
  transition:
    transform 0.14s ease,
    box-shadow 0.14s ease,
    border-color 0.14s ease;
}

.button:hover {
  transform: translateY(-1px);
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.button.primary {
  border-color: var(--accent);
  background: linear-gradient(180deg, #2563eb 0%, var(--accent) 100%);
  color: #fff;
  box-shadow: 0 5px 16px rgba(29, 78, 216, 0.28);
}

.button.primary:hover {
  box-shadow: 0 8px 24px rgba(29, 78, 216, 0.36);
}

.overview-section {
  scroll-margin-top: 24px;
  position: relative;
  padding: clamp(44px, 6vw, 66px) clamp(20px, 5vw, 40px) clamp(40px, 5vw, 56px);
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(219, 234, 254, 0.45), transparent 52%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border-bottom: 1px solid rgba(203, 213, 225, 0.55);
}

.overview-kicker {
  margin: 0 auto;
  color: var(--accent);
  letter-spacing: 0.16em;
  font-size: 12px;
}

.overview-prose {
  max-width: min(50rem, calc(100% - 32px));
  margin: clamp(16px, 2.4vw, 24px) auto 0;
  text-align: left;
}

.overview-prose p {
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 1.7vw, 18px);
  line-height: 1.72;
  text-wrap: pretty;
}

.overview-prose p + p {
  margin-top: 14px;
}

.overview-prose strong {
  color: var(--text);
  font-weight: 700;
}

.overview-prose em {
  color: var(--text);
  font-style: italic;
}

.problem-setup-section {
  scroll-margin-top: 24px;
  padding: clamp(48px, 6vw, 72px) clamp(32px, 9vw, 140px) clamp(44px, 6vw, 64px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.75);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
}

.problem-setup-echo {
  margin: -8px auto clamp(20px, 3vw, 28px);
  max-width: 42rem;
  text-align: center;
  font-size: clamp(15px, 1.55vw, 17px);
  font-weight: 650;
  letter-spacing: -0.015em;
  color: var(--text);
}

.problem-setup-body {
  max-width: min(52rem, 100%);
  margin: 0 auto;
}

.problem-setup-lede {
  margin: 0 0 clamp(22px, 3vw, 30px);
  color: var(--muted);
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 1.72;
  text-wrap: pretty;
}

.problem-setup-lede strong {
  color: var(--text);
  font-weight: 700;
}

.problem-setup-blocks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.problem-setup-card {
  padding: 16px 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

.problem-setup-card--wide {
  grid-column: 1 / -1;
}

.problem-setup-card h3 {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.problem-setup-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.problem-setup-actions {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.58;
}

.problem-setup-actions li + li {
  margin-top: 6px;
}

.problem-setup-actions code {
  font-weight: 700;
  color: var(--text);
}

.problem-setup-objective {
  margin-top: 12px !important;
}

.problem-setup-formula {
  display: block;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(248, 250, 252, 0.96);
  font-family: ui-serif, Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0.01em;
  color: var(--text);
  text-align: center;
}

.problem-setup-footer {
  margin: clamp(24px, 3vw, 32px) 0 0;
  padding-top: clamp(18px, 2vw, 24px);
  border-top: 1px solid rgba(226, 232, 240, 0.95);
  color: var(--muted);
  font-size: 14.5px;
  line-height: 1.65;
}

.problem-setup-footer strong {
  color: var(--text);
}

.problem-setup-footer a {
  color: var(--accent);
  font-weight: 700;
}

@media (max-width: 720px) {
  .problem-setup-blocks {
    grid-template-columns: 1fr;
  }
}

.motivation-section {
  scroll-margin-top: 24px;
  padding: clamp(44px, 6vw, 66px) clamp(32px, 9vw, 140px) clamp(48px, 7vw, 72px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.75);
  background: linear-gradient(180deg, #f1f5f9 0%, #ffffff 38%, #f8fafc 100%);
}

.motivation-head {
  margin: 0 auto clamp(28px, 4vw, 42px);
  max-width: 56rem;
  text-align: center;
}

.motivation-head .kicker {
  margin-bottom: 10px;
}

.motivation-title-line {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 600;
  font-style: normal;
  font-size: clamp(26px, 3.9vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.motivation-lede {
  margin: clamp(14px, 2.5vw, 22px) auto 0;
  max-width: min(44rem, calc(100% - 24px));
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
  text-wrap: pretty;
}

.motivation-lede strong {
  color: var(--text);
  font-weight: 650;
}

.motivation-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(40px, 6vw, 80px);
  align-items: center;
  width: 100%;
  max-width: min(60rem, 100%);
  margin: 0 auto;
}

.motivation-text {
  min-width: 0;
}

.motivation-kicker {
  margin: 0 auto clamp(20px, 3vw, 28px);
  color: var(--accent);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-align: center;
}

.method-section {
  scroll-margin-top: 24px;
}

.method-section-head {
  padding: clamp(48px, 6vw, 72px) clamp(32px, 9vw, 140px) clamp(28px, 4vw, 40px);
  border-bottom: 1px solid rgba(203, 213, 225, 0.75);
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 52%, #f1f5f9 100%);
}

.method-section-head .motivation-kicker {
  margin-top: 0;
  margin-bottom: clamp(12px, 2vw, 18px);
}

.method-section-head .story-continuity-lede {
  margin: clamp(8px, 1.5vw, 14px) auto 0;
  max-width: min(44rem, calc(100% - 24px));
  text-align: left;
}

.motivation-section-heading {
  max-width: min(52rem, 100%);
  margin: 0 auto clamp(22px, 3vw, 28px);
  padding: 0 12px;
}

.motivation-section-heading .motivation-kicker {
  margin: 0 auto clamp(10px, 1.5vw, 14px);
}

.motivation-section-heading .section-prereq {
  margin-top: clamp(14px, 2vw, 18px);
  text-align: left;
}

.build-section .motivation-section-heading {
  margin-bottom: 14px;
}

.motivation-text .motivation-title-line {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
  text-align: left;
}

.motivation-prose {
  margin: clamp(16px, 2vw, 22px) 0 0;
  color: var(--muted);
  font-size: clamp(15px, 1.55vw, 17px);
  line-height: 1.72;
  text-wrap: pretty;
}

.motivation-prose strong {
  color: var(--text);
  font-weight: 700;
}

.motivation-split .motivation-figure-hero {
  margin: 0;
  max-width: 100%;
  justify-self: stretch;
}

@media (max-width: 820px) {
  .motivation-split {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .motivation-text .motivation-title-line,
  .motivation-prose {
    text-align: left;
  }

  .motivation-text {
    text-align: left;
  }
}

.motivation-stage {
  display: grid;
  gap: clamp(20px, 2.6vw, 30px);
  width: 100%;
  max-width: min(56rem, calc(100% - 32px));
  margin: 0 auto;
  justify-items: center;
}

.motivation-figure-hero {
  margin: 0;
  width: 100%;
  max-width: 720px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 22px;
  background:
    linear-gradient(180deg, #ffffff, #f8fafc);
  box-shadow:
    0 26px 56px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.motivation-figure-hero img {
  display: block;
  width: 100%;
  height: auto;
}

.motivation-figure-hero figcaption {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: center;
}

.motivation-figure-hero figcaption strong {
  color: var(--text);
}

.motivation-stats {
  display: inline-flex;
  align-items: center;
  gap: clamp(18px, 2.8vw, 32px);
  margin: 0;
  padding: 14px 22px;
  list-style: none;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96));
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.05);
}

.motivation-stats li {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.motivation-stats strong {
  color: var(--accent);
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 750;
  letter-spacing: -0.02em;
  line-height: 1;
}

.motivation-stats span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.motivation-stats-divider {
  width: 1px;
  height: 28px;
  background: rgba(148, 163, 184, 0.45);
  align-self: center;
}

.motivation-pattern {
  margin: 0;
  max-width: 46rem;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--muted);
  text-align: center;
}

.motivation-col-label,
.motivation-bullets {
  display: none;
}

.motivation-bullets li {
  margin-bottom: 16px;
  padding-left: 2px;
}

.motivation-bullets li:last-child {
  margin-bottom: 0;
}

.motivation-bullets strong {
  color: var(--text);
}

.motivation-figure-col {
  min-width: 0;
  justify-self: end;
}

.motivation-figure figcaption {
  margin-top: 12px;
  font-size: 12px;
  line-height: 1.58;
  color: var(--muted);
  text-align: center;
}

.motivation-insight {
  box-sizing: border-box;
  max-width: min(52rem, calc(100% - 32px));
  margin: clamp(36px, 5vw, 52px) auto 0;
  padding: clamp(20px, 3.2vw, 28px) clamp(22px, 4vw, 32px);
  border-radius: 18px;
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(239, 246, 255, 0.58) 45%,
    rgba(255, 255, 255, 0.96) 100%
  );
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 14px 40px rgba(15, 23, 42, 0.07);
}

.motivation-insight--banner {
  position: relative;
  padding-left: clamp(28px, 4vw, 40px);
  text-align: left;
  background:
    radial-gradient(ellipse at 0% 0%, rgba(219, 234, 254, 0.5), transparent 38%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.6));
}

.motivation-insight--banner::before {
  content: "";
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: var(--accent);
}

.motivation-insight-label {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.motivation-insight > p:not(.motivation-insight-label) {
  margin: 0;
  font-size: clamp(15px, 1.85vw, 17px);
  line-height: 1.68;
  color: #1e293b;
  text-wrap: pretty;
}

.motivation-insight > p:not(.motivation-insight-label) + p {
  margin-top: 12px;
}

.motivation-insight-headline {
  font-size: clamp(18px, 2.2vw, 22px) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  color: var(--text) !important;
  line-height: 1.35 !important;
}

.motivation-insight-body {
  color: var(--muted) !important;
}

.motivation-insight strong {
  font-weight: 750;
  color: var(--text);
}

.motivation-insight code {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  font-size: 0.9em;
}

@media (max-width: 560px) {
  .motivation-stats {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 22px;
  }

  .motivation-stats-divider {
    display: none;
  }

  .motivation-figure-hero {
    padding: 14px 12px 10px;
  }
}

@media (max-width: 640px) {
  .motivation-layout {
    grid-template-columns: 1fr;
  }

  .motivation-figure-col {
    justify-self: center;
    max-width: min(320px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
}

.motivation-section-title {
  margin-bottom: clamp(14px, 2.5vw, 22px);
}

.motivation-section-title h2 {
  margin-bottom: 14px;
  line-height: 1.22;
}

.motivation-core-q {
  max-width: 46rem;
  margin: 0 auto 20px;
  padding: 0 10px;
  text-align: center;
  font-size: clamp(16px, 2.1vw, 19px);
  font-weight: 650;
  line-height: 1.54;
  color: var(--text);
}

.motivation-core-q-label {
  display: block;
  margin-bottom: 12px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.motivation-core-q strong {
  font-weight: 750;
  color: #0f172a;
}

.motivation-principle {
  max-width: 40rem;
  margin: 0 auto clamp(18px, 3vw, 26px);
  padding: 14px 18px;
  text-align: center;
  font-size: 15px;
  line-height: 1.58;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 14px;
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.06);
}

.motivation-principle-label {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.motivation-checks {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.motivation-checks li {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: start;
  margin: 0;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.48;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 10px;
}

.motivation-checks-k {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 2px;
}

.motivation-checks-v {
  color: #475569;
}

.motivation-checks-v code {
  font-size: 0.92em;
}

@media (max-width: 520px) {
  .motivation-checks li {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .motivation-checks-k {
    padding-top: 0;
  }
}

.motivation-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(200px, min(34%, 360px));
  gap: clamp(20px, 3.5vw, 32px);
  align-items: start;
  max-width: 1040px;
  margin: 0 auto;
}

.motivation-split__text {
  min-width: 0;
}

.motivation-split__figure {
  min-width: 0;
}

@media (max-width: 820px) {
  .motivation-split {
    grid-template-columns: 1fr;
    max-width: 640px;
  }

  .motivation-split__figure {
    max-width: min(360px, 100%);
    margin-left: auto;
    margin-right: auto;
  }
}

.motivation-figure-wrap {
  margin-top: 0;
  width: 100%;
}

.motivation-figure {
  max-width: 100%;
  margin: 0;
  padding: 10px 10px 12px;
}

.paper-figure.motivation-figure {
  padding: 10px 10px 12px;
  border-radius: 16px;
  box-shadow: 0 12px 36px rgba(17, 24, 39, 0.07);
}

.motivation-figure img {
  width: 100%;
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

.motivation-split__figure .motivation-figure figcaption {
  font-size: 11px;
  line-height: 1.45;
  margin-top: 8px;
  text-align: left;
}

.figure-section,
.simple-grid,
.text-section,
.contributions,
.build-section {
  padding: 54px 0;
}

.contributions.contributions--lead {
  scroll-margin-top: 24px;
  padding: clamp(40px, 6vw, 64px) 0 clamp(48px, 7vw, 72px);
  margin: 0;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0) 0%, rgba(239, 246, 255, 0.55) 28%, rgba(248, 250, 252, 0) 100%);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.contributions.contributions--lead .section-title {
  margin-bottom: clamp(20px, 4vw, 32px);
}

.contributions.contributions--lead .section-title h2 {
  margin-bottom: 0;
  font-size: clamp(22px, 3.2vw, 32px);
}

.contributions.contributions--lead .contrib-card {
  position: relative;
  padding: 22px 20px 22px 24px;
  border: 1px solid rgba(29, 78, 216, 0.14);
  border-radius: 18px;
  background: linear-gradient(175deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 14px 48px rgba(15, 23, 42, 0.06);
}

.contributions.contributions--lead .contrib-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--accent) 0%, #60a5fa 100%);
}

.contrib-card-num {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--accent);
}

.contributions.contributions--lead .contrib-card h3 {
  margin-bottom: 10px;
  font-size: 17px;
}

.contributions.contributions--lead .contrib-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.58;
}

.section-title {
  max-width: 720px;
  margin: 0 auto 24px;
  text-align: center;
}

.build-section .section-prereq {
  margin: 10px auto 0;
  max-width: min(42rem, calc(100% - 24px));
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.story-continuity-lede {
  margin: 12px auto 0;
  max-width: min(44rem, calc(100% - 24px));
  font-size: 15px;
  line-height: 1.68;
  color: var(--muted);
  text-wrap: pretty;
  text-align: left;
}

.story-continuity-lede code {
  font-size: 0.92em;
}

.story-continuity a {
  color: var(--accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.paper-figure,
.text-section,
.replay-card,
.build-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.08);
}

.figure-paper-teaser .paper-figure {
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.paper-figure {
  margin: 0;
  padding: 18px;
}

.paper-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px;
}

.paper-figure figcaption {
  padding: 8px 8px 0;
  color: var(--muted);
  font-size: 14px;
  text-align: center;
}

/* —— Top-of-page main manuscript figure —— */
.figure-section.figure-paper-teaser--hero {
  scroll-margin-top: 24px;
  padding: clamp(24px, 5vw, 40px) 0 clamp(40px, 6vw, 56px);
  background:
    radial-gradient(ellipse 120% 100% at 50% -25%, rgba(147, 197, 253, 0.45) 0%, transparent 58%),
    linear-gradient(180deg, #e4eaf5 0%, #f8fafc 42%, var(--surface) 100%);
  border-bottom: 1px solid rgba(203, 213, 225, 0.75);
}

.figure-paper-teaser--hero .paper-figure--spotlight {
  max-width: min(1180px, 100%);
  padding: clamp(12px, 2vw, 22px);
  border-radius: 28px;
  border: 1px solid rgba(29, 78, 216, 0.2);
  background: linear-gradient(168deg, #ffffff 0%, #f9fafb 100%);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, 0.75) inset,
    0 32px 100px rgba(15, 23, 42, 0.13),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.figure-paper-teaser--hero .paper-figure--spotlight img {
  border-radius: 18px;
  border: 1px solid rgba(226, 232, 240, 0.95);
}


.fig-bg {
  fill: #fbfdff;
  stroke: var(--line);
}

.fig-box {
  fill: #fff;
  stroke: #cbd5e1;
  stroke-width: 2;
}

.fig-box.accent {
  fill: var(--accent-soft);
  stroke: #93c5fd;
}

.fig-label,
.fig-small {
  fill: var(--muted);
  font-size: 22px;
}

.fig-title-text {
  fill: var(--text);
  font-size: 28px;
  font-weight: 700;
}

.fig-arrow {
  fill: none;
  stroke: var(--text);
  stroke-width: 3;
  marker-end: url("#arrow");
}

.build-card {
  display: grid;
  grid-template-columns: minmax(0, 0.55fr) minmax(0, 1.45fr);
  gap: 24px;
  padding: 26px;
  min-width: 0;
}

.build-steps,
.build-aside {
  min-width: 0;
}

.build-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0;
}

.build-step {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 16px;
  padding: 18px 16px;
  border-left: 3px solid var(--line);
  transition:
    background 200ms ease,
    border-color 200ms ease;
}

.build-step:last-child {
  padding-bottom: 0;
}

.build-step h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.build-step p {
  margin: 0;
  font-size: 14px;
}

.build-step code {
  padding: 0 4px;
  border-radius: 4px;
  background: #e2e8f0;
  font-size: 0.92em;
}

.build-step .step-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.build-step.is-active {
  border-left-color: var(--accent);
  background: var(--accent-soft);
}

.build-step.is-active .step-num {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.build-aside {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

.build-aside-note {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
}

.build-aside-note strong {
  color: var(--text);
}

.build-phase-caption {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--text);
  min-height: 3.1em;
}

.build-phase-rail {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.build-phase-rail li {
  margin: 0;
}

.build-phase-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  cursor: default;
  transition:
    border-color 0.35s ease,
    background 0.35s ease,
    color 0.35s ease,
    transform 0.35s ease;
}

.build-phase-dot.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  transform: scale(1.06);
}

.build-phase-rail.is-complete .build-phase-dot {
  border-color: #34d399;
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
  color: #047857;
}

.build-visual {
  max-width: 100%;
  padding: 14px 14px 18px;
  border-radius: 16px;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 55%, #fff 100%);
  border: 1px solid #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.build-pipeline {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.build-p-row {
  display: grid;
  grid-template-columns:
    minmax(76px, 1fr)
    auto
    minmax(120px, 1.35fr)
    minmax(52px, auto);
  grid-template-rows: auto auto;
  align-items: end;
  gap: 12px 10px;
}

.build-p-row > .build-p-spec {
  grid-column: 1;
  grid-row: 1;
}

.build-p-row > .build-p-join {
  grid-column: 2;
  grid-row: 1;
}

.build-p-row > .build-p-llm {
  grid-column: 3;
  grid-row: 1;
}

.build-p-row > .build-p-bridge {
  grid-column: 4;
  grid-row: 1;
}

.build-p-row > .build-p-delta {
  grid-column: 1 / -1;
  grid-row: 2;
  align-self: stretch;
  margin-top: 2px;
}

.build-p-stage {
  padding: 10px 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  transition:
    border-color 0.35s ease,
    box-shadow 0.35s ease,
    transform 0.35s ease;
}

.build-p-cap {
  display: block;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.3;
}

.build-p-cap em {
  font-style: normal;
  color: var(--accent);
}

.build-p-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.build-p-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  font-size: 12px;
  font-weight: 700;
  font-feature-settings: "tnum" 1;
  color: #3730a3;
}

.build-p-chip sub {
  font-size: 9px;
}

.build-p-muted.build-p-chip {
  background: var(--soft);
  border-color: var(--line);
  color: var(--muted);
  font-weight: 650;
}

.build-p-join {
  width: 18px;
  height: 2px;
  align-self: center;
  margin-bottom: 18px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #94a3b8 30%, #94a3b8 70%, transparent);
  position: relative;
}

.build-p-join::after {
  content: "";
  position: absolute;
  right: -2px;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: #64748b;
}

.build-p-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  align-self: center;
  margin-bottom: 18px;
  max-width: 76px;
  text-align: center;
}

.build-p-bridge .build-p-join {
  flex-shrink: 0;
}

.build-p-bridge-kicker {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.25;
}

.build-p-bridge-kicker-sub {
  font-size: 7px;
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 750;
  color: #64748b;
  line-height: 1.35;
}

.build-p-bridge-kicker-sub strong {
  color: var(--accent);
  font-weight: 800;
}

.build-p-llm-note {
  margin: 10px 0 0;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.45;
  color: var(--muted);
}

.build-p-llm-note strong {
  color: var(--text);
  font-weight: 800;
}

.build-p-delta-lede {
  margin: 0 0 10px;
  font-size: 11px;
  line-height: 1.48;
  color: var(--text);
  font-weight: 550;
}

.build-p-delta-lede code {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--soft);
  border: 1px solid var(--line);
}

.build-p-delta-lede em {
  font-style: normal;
  font-weight: 800;
  color: var(--accent);
}

.build-p-probe-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed #c7d2fe;
  background: #eef2ff;
  font-size: 10px;
  line-height: 1.45;
  font-weight: 600;
  color: #3730a3;
}

.build-p-probe-legend-k {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.07em;
  background: linear-gradient(180deg, #4f46e5, #4338ca);
  color: #fff;
  border: 1px solid #312e81;
  vertical-align: middle;
}

.build-p-probe-legend-mid em {
  font-style: normal;
  font-weight: 800;
  color: #4338ca;
}

.build-p-probe-legend-flow {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #c7d2fe;
  font-size: 9px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  color: #312e81;
  letter-spacing: 0.02em;
}

.build-p-delta-matrix {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.build-p-delta-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.build-p-delta-idx {
  font-size: 11px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  color: var(--muted);
  white-space: nowrap;
}

.build-p-delta-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.build-p-seg {
  flex: 1 1 min(100%, 280px);
  min-width: 0;
  padding: 6px 7px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: linear-gradient(165deg, #fff 0%, #f8fafc 100%);
}

.build-p-seg-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 5px;
}

.build-p-seg-prefix {
  font-size: 9px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  padding: 2px 5px;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  color: #92400e;
  white-space: nowrap;
}

.build-p-seg-prefix sub {
  font-size: 8px;
}

.build-p-seg-prefix-cat {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 3px;
  max-width: 100%;
}

.build-p-seg-concat {
  font-weight: 900;
  font-size: 9px;
  color: #78716c;
  line-height: 1;
  padding: 0 1px;
}

.build-p-prefcat {
  font-weight: 800;
}

.build-p-delta-lede .build-p-prefcat {
  color: #92400e;
}

.build-p-micro .build-p-prefcat {
  color: var(--text);
}

.build-p-seg-dot {
  color: #cbd5e1;
  font-weight: 900;
  font-size: 13px;
  line-height: 1;
}

.build-p-seg-probe-call {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 3px 7px;
  border-radius: 6px;
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  border: 1px solid #312e81;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.35);
  white-space: nowrap;
  transition:
    box-shadow 0.25s ease,
    transform 0.25s ease;
}

.build-p-seg-yields {
  font-size: 12px;
  font-weight: 800;
  color: #64748b;
  line-height: 1;
}

.build-p-seg-omega {
  font-size: 9px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  padding: 2px 6px;
  border-radius: 6px;
  background: #ecfdf5;
  border: 1px solid #6ee7b7;
  color: #065f46;
  white-space: nowrap;
}

.build-p-seg-omega sub {
  font-size: 8px;
}

.build-p-seg-arrow {
  font-size: 12px;
  font-weight: 800;
  color: #94a3b8;
  line-height: 1;
}

.build-p-seg-chunk {
  flex: 1 1 48px;
  min-width: 36px;
  height: 11px;
  border-radius: 4px;
  border: 1px solid #cbd5e1;
  background: linear-gradient(90deg, #fff, #f1f5f9);
  opacity: 0.42;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}

.build-p-seg-cost {
  font-size: 8px;
  font-weight: 800;
  font-feature-settings: "tnum" 1;
  padding: 2px 5px;
  border-radius: 5px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #64748b;
  white-space: nowrap;
  transition:
    border-color 0.25s ease,
    background 0.25s ease,
    color 0.25s ease;
}

.build-p-seg-cost sub {
  font-size: 7px;
}

.build-p-meter {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.build-p-meter-fill {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #64748b, #334155 42%, #475569);
  transition: width 0.6s ease-out;
}

.build-p-traces {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 5px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.build-p-traces li {
  flex: 1 1 18%;
  max-width: calc(12.5% - 5px);
}

.build-p-traces li span {
  display: block;
  height: 4px;
  border-radius: 999px;
  background: #cbd5e1;
  transform-origin: left center;
  transform: scaleX(0.65);
  opacity: 0.55;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease;
}

.build-p-micro {
  display: block;
  margin-top: 8px;
  font-size: 10px;
  line-height: 1.4;
  color: var(--muted);
  font-weight: 650;
}

.build-p-micro em {
  font-style: normal;
  font-weight: 800;
  color: var(--accent);
}

.build-p-micro-sub {
  font-size: 8px;
  vertical-align: sub;
}

.build-p-mini {
  font-family: var(--font-sans);
  font-style: italic;
}

.build-p-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.build-p-branch-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--accent);
}

.build-p-stream {
  display: flex;
  gap: 5px;
  height: 14px;
  align-items: flex-end;
}

.build-p-stream span {
  width: 10px;
  border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #93c5fd, var(--accent));
  opacity: 0.2;
  transform: scaleY(0.35);
  transform-origin: bottom;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.build-p-stream span:nth-child(1) {
  height: 40%;
}

.build-p-stream span:nth-child(2) {
  height: 70%;
}

.build-p-stream span:nth-child(3) {
  height: 100%;
}

.build-p-stream span:nth-child(4) {
  height: 85%;
}

.build-p-stream span:nth-child(5) {
  height: 55%;
}

.build-p-stream span:nth-child(6) {
  height: 30%;
}

.build-p-store.build-p-stage {
  width: 100%;
  max-width: 420px;
}

.build-p-locked-badge {
  display: block;
  margin: 0 0 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #059669;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.build-visual[data-phase="4"] .build-p-locked-badge,
.build-visual.is-complete .build-p-locked-badge {
  opacity: 1;
}

.build-p-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.build-p-slot {
  display: grid;
  place-items: center;
  min-height: 36px;
  padding: 6px 4px;
  border-radius: 10px;
  border: 1px dashed #93c5fd;
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 750;
  color: #1e3a8a;
  transition:
    border-style 0.35s ease,
    background 0.35s ease,
    box-shadow 0.35s ease;
}

.build-p-slot sub {
  font-size: 9px;
}

/* Walk phases: sequential emphasis */
.build-visual[data-phase="1"] .build-p-spec {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 12px 28px rgba(29, 78, 216, 0.12);
  transform: translateY(-2px);
}

.build-visual[data-phase="2"] .build-p-meter-fill {
  width: 92%;
}

.build-visual[data-phase="2"] .build-p-llm {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 12px 28px rgba(29, 78, 216, 0.1);
  transform: translateY(-2px);
}

.build-visual[data-phase="2"] .build-p-traces li span {
  transform: scaleX(1);
  opacity: 1;
  background: linear-gradient(90deg, #818cf8, #4f46e5);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.build-visual[data-phase="3"] .build-p-meter-fill,
.build-visual[data-phase="4"] .build-p-meter-fill {
  width: 100%;
}

.build-visual[data-phase="3"] .build-p-delta,
.build-visual[data-phase="4"] .build-p-delta {
  border-color: #10b981;
  box-shadow:
    0 0 0 3px rgba(16, 185, 129, 0.12),
    0 12px 28px rgba(16, 185, 129, 0.08);
}

.build-visual[data-phase="3"] .build-p-delta {
  transform: translateY(-2px);
}

.build-visual[data-phase="3"] .build-p-traces li span,
.build-visual[data-phase="4"] .build-p-traces li span {
  transform: scaleX(1);
  opacity: 1;
  background: linear-gradient(90deg, #818cf8, #4f46e5);
  box-shadow: 0 0 0 1px rgba(79, 70, 229, 0.2);
}

.build-visual[data-phase="3"] .build-p-bridge-kicker,
.build-visual[data-phase="3"] .build-p-bridge-kicker-sub {
  color: var(--accent);
}

.build-visual[data-phase="3"] .build-p-seg-prefix,
.build-visual[data-phase="4"] .build-p-seg-prefix {
  border-color: #f59e0b;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.22);
}

.build-visual[data-phase="3"] .build-p-seg-probe-call,
.build-visual[data-phase="4"] .build-p-seg-probe-call {
  box-shadow: 0 2px 12px rgba(67, 56, 202, 0.42);
  transform: translateY(-1px);
}

.build-visual[data-phase="3"] .build-p-seg-omega,
.build-visual[data-phase="4"] .build-p-seg-omega {
  border-color: #34d399;
  background: #d1fae5;
}

.build-visual[data-phase="3"] .build-p-seg-chunk,
.build-visual[data-phase="4"] .build-p-seg-chunk {
  opacity: 1;
  border-color: #34d399;
  box-shadow: 0 2px 0 rgba(52, 211, 153, 0.35);
}

.build-visual[data-phase="3"] .build-p-seg-cost,
.build-visual[data-phase="4"] .build-p-seg-cost {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.build-visual[data-phase="3"] .build-p-stream span,
.build-visual[data-phase="4"] .build-p-stream span {
  opacity: 1;
  transform: scaleY(1);
}

.build-visual[data-phase="4"] .build-p-store {
  border-color: var(--accent);
  box-shadow:
    0 0 0 3px var(--accent-soft),
    0 14px 32px rgba(29, 78, 216, 0.12);
}

.build-visual[data-phase="4"] .build-p-slot {
  border-style: solid;
  border-color: var(--accent);
  background: #dbeafe;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.15);
}

@media (prefers-reduced-motion: reduce) {
  .build-p-traces li span,
  .build-p-seg-chunk,
  .build-p-seg-cost,
  .build-p-seg-probe-call,
  .build-p-stream span {
    transition-duration: 0.01ms;
  }
}

/* Finished walk: “frozen” productive state */
.build-visual.is-complete .build-p-meter-fill {
  width: 100%;
  background: linear-gradient(90deg, #22c55e, #15803d);
}

.build-visual.is-complete .build-p-traces li span {
  transform: scaleX(1);
  opacity: 1;
  background: linear-gradient(90deg, #86efac, #22c55e);
}

.build-visual.is-complete .build-p-seg {
  border-color: #bbf7d0;
}

.build-visual.is-complete .build-p-seg-chunk {
  opacity: 1;
  border-color: #6ee7b7;
  background: linear-gradient(145deg, #ecfdf5, #d1fae5);
}

.build-visual.is-complete .build-p-seg-prefix {
  border-color: #fcd34d;
}

.build-visual.is-complete .build-p-seg-probe-call {
  background: linear-gradient(180deg, #3730a3 0%, #312e81 100%);
  border-color: #1e1b4b;
  box-shadow: 0 2px 10px rgba(30, 27, 75, 0.35);
}

.build-visual.is-complete .build-p-seg-omega {
  border-color: #22c55e;
  background: #bbf7d0;
}

.build-visual.is-complete .build-p-seg-cost {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.build-visual.is-complete .build-p-stream span {
  opacity: 0.95;
  transform: scaleY(1);
}

.build-visual.is-complete .build-p-slot {
  border-style: solid;
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.build-visual.is-complete .build-p-slot sub {
  color: rgba(255, 255, 255, 0.92);
}

.build-play {
  align-self: flex-start;
}

@media (max-width: 900px) {
  .build-card {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 22px;
  }

  .build-p-row {
    grid-template-columns: 1fr;
    grid-template-rows: none;
  }

  .build-p-row > .build-p-spec,
  .build-p-row > .build-p-join,
  .build-p-row > .build-p-llm,
  .build-p-row > .build-p-bridge,
  .build-p-row > .build-p-delta {
    grid-column: auto;
    grid-row: auto;
  }

  .build-p-row > .build-p-delta {
    margin-top: 0;
  }

  .build-p-bridge {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    max-width: none;
    width: 100%;
    margin-bottom: 10px;
    gap: 10px 14px;
  }

  .build-p-bridge-kicker-sub {
    max-width: none;
    flex-basis: 100%;
    text-align: center;
  }

  .build-p-join {
    width: 2px;
    height: 16px;
    margin: 0 auto;
    align-self: stretch;
    background: linear-gradient(180deg, transparent, #94a3b8 25%, #94a3b8 75%, transparent);
  }

  .build-p-join::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -4px;
    transform: translateX(-50%) rotate(90deg);
  }
}


.replay-card {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 20px;
  padding: 22px;
}

.code-panel,
.environment-panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  padding: 20px;
}

.panel-label {
  margin-bottom: 14px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.panel-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 16px;
  margin-bottom: 14px;
}

.panel-label-row > span:first-child {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0.04em;
}

@media (max-width: 640px) {
  .panel-label-row {
    flex-direction: column;
    align-items: stretch;
  }

  .loop-ticker {
    white-space: normal;
    flex-wrap: wrap;
  }

  .env-phase-rail {
    max-width: none;
    width: 100%;
    margin-left: 0;
  }
}

.env-panel-heading .env-phase-rail {
  align-self: center;
}

.loop-ticker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(29, 78, 216, 0.2);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 650;
  color: #475569;
  white-space: nowrap;
}

.loop-ticker em {
  font-style: normal;
  font-weight: 850;
  color: var(--accent);
}

.loop-ticker-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(29, 78, 216, 0.12);
  animation: replayDotPulse 1.6s ease-in-out infinite;
}

@keyframes replayDotPulse {
  0%,
  100% {
    opacity: 0.98;
    transform: scale(1);
    box-shadow: 0 0 0 6px rgba(29, 78, 216, 0.12);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
    box-shadow: 0 0 0 10px rgba(29, 78, 216, 0.08);
  }
}

@keyframes replayIdleScan {
  0%,
  18% {
    color: #f8fafc;
    background: rgba(59, 130, 246, 0.22);
    border-left-color: #93c5fd;
    box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.35);
  }
  24%,
  100% {
    color: #dbeafe;
    background: transparent;
    border-left-color: transparent;
    box-shadow: none;
  }
}

@keyframes replayLoopHeader {
  0%,
  100% {
    color: #93c5fd;
  }
  50% {
    color: #e0edff;
  }
}

@keyframes envPhaseShuttle {
  0%,
  17% {
    left: 0%;
  }
  25%,
  42% {
    left: 25%;
  }
  50%,
  67% {
    left: 50%;
  }
  75%,
  92% {
    left: 75%;
  }
  100% {
    left: 0%;
  }
}

.replay-pre {
  margin: 0 0 18px;
}

.code-panel pre {
  margin: 0 0 18px;
  overflow-x: auto;
  border-radius: 14px;
  background: #0f172a;
}

.code-panel code.replay-code,
.replay-pre code {
  white-space: normal;
}

.replay-line {
  display: block;
}

.replay-line-comment {
  color: #94a3b8;
}

.replay-line-while {
  margin-top: 2px;
  color: #93c5fd;
  animation: replayLoopHeader 4.8s ease-in-out infinite;
}

.replay-line-while .kw {
  color: #fcd34d;
  font-weight: 700;
}

.replay-line-body {
  padding-left: 12px;
  margin-left: 9px;
  border-radius: 6px;
  border-left: 3px solid transparent;
}

.replay-scan-line {
  animation: replayIdleScan 4.8s ease-in-out infinite;
}

.replay-scan-line[data-phase="propose"] {
  animation-delay: 1.2s;
}

.replay-scan-line[data-phase="step"] {
  animation-delay: 2.4s;
}

.replay-scan-line[data-phase="append"] {
  animation-delay: 3.6s;
}

.env-phase-rail {
  position: relative;
  flex: 1 1 120px;
  max-width: min(210px, 46vw);
  height: 6px;
  margin-left: auto;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.env-phase-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 25%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #3b82f6, var(--accent));
  animation: envPhaseShuttle 4.8s ease-in-out infinite;
}

.replay-card.is-replaying .replay-scan-line,
.replay-card.is-replaying .replay-line-while,
.replay-card.is-replaying .env-phase-fill,
.replay-card.is-replaying .loop-ticker-dot {
  animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
  .replay-scan-line,
  .replay-line-while,
  .env-phase-fill,
  .loop-ticker-dot {
    animation: none !important;
    animation-duration: 0ms !important;
    animation-delay: 0ms !important;
  }

  .replay-scan-line[data-phase="observe"] {
    color: #f8fafc;
    background: rgba(59, 130, 246, 0.18);
    border-left-color: #93c5fd;
  }
}

.code-panel code {
  display: block;
  min-width: 340px;
  padding: 18px;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre;
}

.no-call-badge {
  display: inline-flex;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--accent-soft);
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 750;
}

.grid-header {
  display: grid;
  grid-template-columns: 32px repeat(6, minmax(34px, 1fr));
  gap: 10px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.replay-grid {
  display: grid;
  grid-template-columns: 32px repeat(6, minmax(34px, 1fr));
  gap: 10px;
  align-items: center;
}

.branch-name {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.cell {
  position: relative;
  display: block;
  aspect-ratio: 1;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    transform 180ms ease,
    opacity 180ms ease;
}

.cell::after {
  position: absolute;
  inset: 50% auto auto 50%;
  width: 8px;
  height: 8px;
  content: "";
  border-radius: 999px;
  background: #cbd5e1;
  transform: translate(-50%, -50%);
}

.cell.visited {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.cell.active {
  border-color: var(--accent);
  background: var(--accent);
  transform: scale(1.08);
}

.cell.active::after {
  background: #fff;
}

.cell.pruned {
  border-color: #fecaca;
  background: #fee2e2;
  opacity: 0.55;
}

.cell.pruned::before {
  position: absolute;
  inset: 50% auto auto 50%;
  content: "×";
  color: #dc2626;
  font-weight: 800;
  transform: translate(-50%, -54%);
}

.cell.pruned::after {
  display: none;
}

.cell.final {
  border-color: #22c55e;
  background: #dcfce7;
}

.cell.final::after {
  background: #22c55e;
}

.replay-status {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.replay-status strong {
  color: var(--text);
}

.replay-status span {
  color: var(--muted);
  font-size: 14px;
}

.case-demo-section {
  scroll-margin-top: 24px;
  padding: 54px 0;
}

.case-demo-intro {
  margin-bottom: 28px;
}

.case-demo-lede {
  margin: 8px auto 0;
  max-width: 54rem;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.case-demo-shell {
  padding: clamp(18px, 3vw, 26px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 0%, rgba(219, 234, 254, 0.8), transparent 28%),
    linear-gradient(160deg, #ffffff 0%, #f8fafc 100%);
  box-shadow: 0 22px 56px rgba(15, 23, 42, 0.07);
}

.case-demo-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.case-demo-topline h3 {
  margin: 4px 0 8px;
  font-size: clamp(20px, 2.6vw, 28px);
  letter-spacing: -0.03em;
}

.case-demo-topline p {
  max-width: 54rem;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.case-demo-eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-demo-eyebrow strong {
  color: var(--accent-green);
}

.case-demo-headlede {
  margin: 8px 0 0;
  max-width: 64rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.case-demo-stage-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 18px;
  padding: 10px;
  list-style: none;
  border: 1px solid rgba(203, 213, 225, 0.7);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.92));
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.05);
  counter-reset: case-stage;
}

.case-demo-stage-bar li {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    color 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease;
}

.case-demo-stage-bar li b {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.case-demo-stage-bar li code {
  padding: 1px 5px;
  border-radius: 6px;
  background: rgba(148, 163, 184, 0.14);
  font-size: 10.5px;
}

.case-demo-stage-bar li.is-active {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  color: var(--accent);
  box-shadow:
    0 14px 28px rgba(37, 99, 235, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.case-demo-stage-bar li.is-active b {
  background: var(--accent);
  color: #fff;
}

@media (max-width: 720px) {
  .case-demo-stage-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.case-demo-loop {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.82fr 1.05fr 0.88fr;
  grid-template-rows: auto auto;
  grid-template-areas:
    "env loop propose result"
    "feedback loop history result";
  gap: 18px 20px;
  align-items: center;
  margin: 0 0 18px;
  padding: 22px;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 22px;
  background:
    radial-gradient(circle at center, rgba(219, 234, 254, 0.55) 0 16%, transparent 34%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.84), rgba(248, 250, 252, 0.92));
}

.case-loop-node--propose {
  grid-area: propose;
}

.case-loop-node--execute {
  grid-area: env;
}

.case-loop-node--history {
  grid-area: history;
}

.case-loop-node--feedback {
  grid-area: feedback;
}

.case-loop-center {
  position: relative;
  grid-area: loop;
  z-index: 2;
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(190px, 100%);
  min-height: 138px;
  padding: 20px;
  border: 1px solid #bfdbfe;
  border-radius: 50%;
  background: #fff;
  text-align: center;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.1);
}

.case-loop-center::before,
.case-loop-center::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.case-loop-center::before {
  inset: -16px;
  border: 2px solid rgba(37, 99, 235, 0.22);
  border-radius: 50%;
}

.case-loop-center::after {
  right: -19px;
  bottom: 18px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.12);
}

.case-loop-center span {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-loop-center strong {
  max-width: 10rem;
  font-size: 15px;
  line-height: 1.25;
}

.case-loop-node {
  position: relative;
  z-index: 3;
  min-height: 112px;
  width: 100%;
  padding: 14px;
  overflow: hidden;
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease,
    box-shadow 180ms ease;
}

.case-loop-node i {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: #eff6ff;
  color: var(--accent);
  font-size: 14px;
  font-style: normal;
  font-weight: 900;
}

.case-loop-node::after {
  position: absolute;
  inset: auto 14px 12px auto;
  width: 22px;
  height: 22px;
  content: "→";
  border-radius: 999px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 14px;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
}

.case-loop-node--execute::after,
.case-loop-node--feedback::after {
  content: "→";
}

.case-loop-node--propose::after {
  content: "↙";
}

.case-loop-node--history::after {
  content: "↖";
}

.case-loop-node.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}

.case-loop-node span {
  display: block;
  margin-bottom: 5px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-loop-node strong {
  display: block;
  max-width: 15rem;
  font-size: 13px;
  line-height: 1.35;
}

.case-loop-node small {
  display: block;
  margin-top: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
}

.case-loop-node code {
  font-size: 0.92em;
}

.case-loop-result {
  grid-area: result;
  z-index: 3;
  align-self: stretch;
  display: grid;
  align-content: center;
  width: 100%;
  min-height: 130px;
  padding: 14px;
  border: 1px solid #bbf7d0;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 14px 36px rgba(4, 120, 87, 0.09);
}

.case-loop-result span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent-green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-loop-result strong {
  display: block;
  color: #065f46;
  font-size: 14px;
  line-height: 1.3;
}

.case-loop-result small {
  display: block;
  margin-top: 6px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.35;
}

.case-demo-architecture {
  position: relative;
  isolation: isolate;
  display: block;
  margin: 0;
  padding: 18px 14px 16px;
  min-height: 340px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(254, 215, 170, 0.32), transparent 30%),
    radial-gradient(ellipse at 100% 100%, rgba(191, 219, 254, 0.32), transparent 38%),
    linear-gradient(180deg, #ffffff, #f8fafc);
}

.case-demo-architecture::before {
  display: none;
}

.case-demo-architecture::after {
  display: none;
}

.case-demo-repo {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  padding: 14px 14px 12px;
  min-height: 220px;
  width: 100%;
  margin: 96px auto 0;
  border: 1px solid rgba(203, 213, 225, 0.85);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.96));
  color: var(--text);
  overflow: hidden;
  box-shadow:
    0 18px 36px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.case-demo-repo::before {
  position: absolute;
  inset: 0 0 auto 0;
  height: 28px;
  pointer-events: none;
  content: "";
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  background:
    radial-gradient(circle at 12px 14px, #fca5a5 0 4px, transparent 5px),
    radial-gradient(circle at 28px 14px, #fde68a 0 4px, transparent 5px),
    radial-gradient(circle at 44px 14px, #86efac 0 4px, transparent 5px),
    linear-gradient(180deg, #f1f5f9, #e2e8f0);
}

.case-demo-repo-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 0 4px;
}

.case-demo-repo-title span {
  display: block;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.case-demo-repo-title strong {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.35;
}

.case-demo-repo-modules {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.case-repo-module {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 12px;
  background: #ffffff;
  color: var(--text);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.case-repo-module::after {
  display: none;
}

.case-repo-module--history {
  width: 100%;
}

.case-repo-module i {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: center;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.14);
  color: var(--muted);
  font-style: normal;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.case-repo-module--env i {
  background: rgba(34, 197, 94, 0.14);
  color: #166534;
}

.case-repo-module--controller i {
  background: rgba(59, 130, 246, 0.16);
  color: var(--accent);
}

.case-repo-module--history i {
  background: rgba(244, 114, 182, 0.16);
  color: #be185d;
}

.case-repo-module > div,
.case-repo-module > span,
.case-repo-module > strong {
  grid-column: 2;
}

.case-repo-module span {
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.case-repo-module strong {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.35;
}

.case-demo-shell.is-playing .case-repo-module.is-active,
.case-demo-shell.is-playing .case-repo-module.is-read-active {
  border-color: #93c5fd;
  background: linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.14),
    0 10px 22px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.case-demo-shell.is-playing .case-repo-module.is-active i,
.case-demo-shell.is-playing .case-repo-module.is-read-active i {
  background: var(--accent);
  color: #fff;
}

.case-demo-repo .case-demo-history {
  display: none;
}

.case-demo-repo .panel-label {
  color: var(--accent);
}

.case-demo-repo .case-demo-history li,
.case-demo-repo .case-demo-metrics article {
  border-color: rgba(226, 232, 240, 0.9);
  background: rgba(255, 255, 255, 0.92);
}

.case-demo-repo .case-demo-history li strong,
.case-demo-repo .case-demo-metrics strong {
  color: var(--text);
}

.case-demo-repo .case-demo-history li span,
.case-demo-repo .case-demo-metrics span {
  color: var(--muted);
}

.case-demo-agent-core {
  position: absolute;
  top: 28px;
  left: 50%;
  z-index: 6;
  display: inline-grid;
  align-content: center;
  min-height: 58px;
  padding: 9px 14px 9px 66px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  transform: translateX(-50%);
}

.case-demo-agent-core::after {
  position: absolute;
  left: 50%;
  bottom: -22px;
  width: 132px;
  height: 28px;
  content: "";
  pointer-events: none;
  background: radial-gradient(ellipse, rgba(249, 115, 22, 0.2), transparent 68%);
  transform: translateX(-50%);
}

.case-agent-heading {
  padding-left: 0;
}

.case-demo-agent-core span {
  color: #0f5670;
}

.case-demo-agent-core strong {
  color: var(--text);
  font-size: 14px;
  max-width: 19rem;
}

.case-agent-mark {
  position: absolute;
  top: 50%;
  left: 10px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #fff7ed;
  color: #dc5b3f;
  font-size: 30px;
  line-height: 1;
  box-shadow:
    0 12px 30px rgba(220, 91, 63, 0.14),
    0 0 0 8px rgba(254, 215, 170, 0.34);
  transform: translateY(-50%);
  animation: caseAgentBreath 2.8s ease-in-out infinite;
}

.case-agent-links {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
  display: none;
}

.case-agent-flow {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

.case-demo-shell.is-playing .case-agent-flow {
  display: block;
}

.case-agent-flow-path {
  fill: none;
  stroke: rgba(249, 115, 22, 0.72);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-dasharray: 9 9;
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.42));
  animation: caseAgentPathFlow 1.4s linear infinite;
}

.case-agent-flow-dot {
  fill: #fff7ed;
  stroke: rgba(249, 115, 22, 0.82);
  stroke-width: 2;
  filter: drop-shadow(0 0 8px rgba(249, 115, 22, 0.36));
}

.case-agent-link {
  position: absolute;
  display: none;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 5px 9px;
  border: 1px solid rgba(251, 191, 36, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f5670;
  font-size: 9.5px;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.08),
    0 0 0 4px rgba(255, 255, 255, 0.5);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  transition:
    opacity 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.case-agent-link::before {
  display: none;
}

.case-agent-link::after {
  display: none;
}

.case-demo-shell.is-playing .case-agent-link.is-active {
  display: inline-flex;
  border-color: #fbbf24;
  background: rgba(255, 255, 255, 0.96);
  color: #0f5670;
  opacity: 1;
  transform: translate(-50%, -50%);
}

.case-agent-link--env {
  top: 54%;
  left: 50%;
  --flow-line: 88px;
  --beam-from-x: 50%;
  --beam-width: 332%;
  --beam-start: 100%;
  --beam-end: 0%;
  --beam-dot-x: 100%;
}

.case-agent-link--controller {
  top: 68%;
  left: 50%;
  --flow-line: 88px;
  --beam-from-x: 50%;
  --beam-width: 128%;
  --beam-start: 100%;
  --beam-end: 0%;
  --beam-dot-x: 100%;
}

.case-agent-link--history-read {
  top: 82%;
  left: 50%;
  --flow-line: 88px;
  --beam-from-x: 50%;
  --beam-width: 28%;
  --beam-start: 100%;
  --beam-end: 0%;
  --beam-dot-x: 100%;
}

.case-agent-link--history-write {
  top: 82%;
  left: 50%;
  --flow-line: 88px;
  --beam-from-x: 50%;
  --beam-width: 28%;
  --beam-start: 100%;
  --beam-end: 0%;
  --beam-dot-x: 100%;
}

.case-agent-link--feedback {
  top: 68%;
  left: 62%;
  --flow-line: 88px;
  --beam-from-x: 50%;
  --beam-width: 72%;
  --beam-start: 100%;
  --beam-end: 0%;
  --beam-dot-x: 100%;
}

.case-loop-steps {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-loop-steps li {
  position: relative;
  padding: 7px 10px;
  border: 1px solid #dbe3ee;
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.88));
  color: #475569;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  transition:
    border-color 180ms ease,
    background 180ms ease,
    color 180ms ease,
    transform 180ms ease;
}

.case-loop-steps li.is-active {
  border-color: #93c5fd;
  background:
    linear-gradient(135deg, rgba(239, 246, 255, 0.98), rgba(219, 234, 254, 0.86));
  color: #1d4ed8;
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.11);
  transform: translateX(3px);
}

.case-loop-steps code {
  color: #0f5670;
  font-weight: 850;
}

.case-demo-agent-core .case-loop-result {
  grid-area: auto;
  width: auto;
  min-height: auto;
  align-self: auto;
  padding: 10px 12px;
  border-color: rgba(134, 239, 172, 0.72);
  background:
    radial-gradient(circle at 12% 18%, rgba(134, 239, 172, 0.2), transparent 35%),
    linear-gradient(180deg, rgba(236, 253, 245, 0.96), rgba(255, 255, 255, 0.96));
  box-shadow: 0 16px 34px rgba(4, 120, 87, 0.11);
}

.case-demo-agent-core .case-loop-steps,
.case-demo-agent-core .case-loop-result {
  display: none;
}

.case-demo-state-head {
  display: none;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
}

.case-demo-state-head .kicker {
  margin-bottom: 4px;
}

.case-demo-state-head h3 {
  margin: 0;
  max-width: 58rem;
  font-size: clamp(15px, 1.5vw, 18px);
  letter-spacing: -0.02em;
}

.case-demo-workbench {
  display: grid;
  grid-template-columns: clamp(320px, 38%, 440px) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  grid-template-areas:
    "control execution"
    "code execution";
  gap: 18px;
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
}

.case-demo-control-column,
.case-demo-detail-column {
  min-width: 0;
}

.case-demo-control-column {
  grid-area: control;
  display: block;
}

.case-demo-detail-column {
  grid-area: execution;
  display: grid;
  gap: 12px;
  align-self: stretch;
}

.case-demo-detail-column .case-demo-layout,
.case-demo-detail-column .case-demo-grid-card {
  height: 100%;
}

.case-demo-detail-column .case-demo-grid-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.case-demo-layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 10px;
  border: 1px solid rgba(203, 213, 225, 0.58);
  border-radius: 28px;
  background:
    radial-gradient(circle at 24% 8%, rgba(191, 219, 254, 0.52), transparent 24%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(248, 250, 252, 0.84));
}

.case-demo-agent,
.case-demo-grid-card,
.case-demo-history {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    0 20px 48px rgba(15, 23, 42, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
}

.case-demo-workbench > .case-demo-agent {
  grid-area: code;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  width: 100%;
  max-width: none;
  inline-size: 100%;
  justify-self: stretch;
  align-self: start;
}

.case-demo-code-details {
  margin: 0;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.7);
  overflow: hidden;
}

.case-demo-code-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
  padding: 9px 12px;
  cursor: pointer;
  list-style: none;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.case-demo-code-summary-label {
  flex: 0 0 auto;
}

.case-demo-code-summary-headline {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-demo-code-summary::-webkit-details-marker {
  display: none;
}

.case-demo-code-summary::after {
  content: "▸";
  display: inline-block;
  margin-left: auto;
  color: var(--accent);
  font-size: 12px;
  transform: rotate(0deg);
  transition: transform 160ms ease;
}

.case-demo-code-details[open] .case-demo-code-summary::after {
  transform: rotate(90deg);
}

.case-demo-code-summary-hint {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
}

.case-demo-code-details[open] .case-demo-code-summary-hint::before {
  content: "click to collapse";
}

.case-demo-code-details[open] .case-demo-code-summary-hint {
  font-size: 0;
}

.case-demo-code-details[open] .case-demo-code-summary-hint::before {
  font-size: 9.5px;
}

.case-demo-workbench > .case-demo-agent .case-demo-code {
  height: auto;
  max-height: 320px;
  min-height: 0;
  border-radius: 0;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
}

.case-demo-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0.01em;
}

.case-demo-agent .panel-label,
.case-demo-agent .panel-label-row > span:first-child {
  font-size: 10.5px;
}

.case-demo-turns {
  display: none;
  grid-template-columns: repeat(5, minmax(44px, 1fr));
  gap: 8px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.case-demo-turns li {
  position: relative;
  display: grid;
  gap: 2px;
  padding: 8px 9px;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  background:
    linear-gradient(135deg, #ffffff, #f8fafc);
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition:
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.case-demo-turns li:hover,
.case-demo-turns li.is-active {
  border-color: #93c5fd;
  background:
    linear-gradient(135deg, #eff6ff, #dbeafe);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.case-demo-turns strong {
  color: var(--text);
  font-size: 11.5px;
}

.case-demo-turns span {
  color: var(--muted);
  font-size: 10.5px;
}

.case-demo-code {
  width: 100%;
  max-height: 300px;
  min-height: 210px;
  margin: 0;
  padding: 42px 16px 16px;
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18px 18px, #f87171 0 5px, transparent 6px),
    radial-gradient(circle at 38px 18px, #fbbf24 0 5px, transparent 6px),
    radial-gradient(circle at 58px 18px, #22c55e 0 5px, transparent 6px),
    linear-gradient(180deg, rgba(30, 41, 59, 0.72) 0 32px, transparent 33px),
    linear-gradient(145deg, #0f172a, #020617);
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 10.5px;
  line-height: 1.5;
  scrollbar-color: rgba(147, 197, 253, 0.7) rgba(15, 23, 42, 0.4);
  box-shadow:
    0 18px 42px rgba(2, 6, 23, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.case-demo-feedback {
  display: grid;
  gap: 4px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 16%, rgba(59, 130, 246, 0.12), transparent 28%),
    linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
}

.case-demo-feedback span,
.case-demo-question span,
.case-demo-runner span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.case-demo-feedback span,
.case-demo-question span {
  font-size: 9.5px;
}

.case-demo-feedback p,
.case-demo-question p,
.case-demo-runner p {
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
}

.case-demo-feedback p,
.case-demo-question p {
  font-size: 11.5px;
  line-height: 1.45;
}

.case-demo-grid-card {
  display: grid;
  gap: 14px;
  background:
    radial-gradient(circle at 92% 8%, rgba(34, 197, 94, 0.1), transparent 22%),
    rgba(255, 255, 255, 0.9);
}

.case-demo-question {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background:
    linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.case-demo-stats {
  display: none;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.case-demo-stats article {
  padding: 12px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: 16px;
  background:
    linear-gradient(135deg, #ffffff, #f8fafc);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
}

.case-demo-stats span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.case-demo-stats strong {
  color: var(--text);
  font-size: 14px;
}

.case-demo-runner {
  display: none;
  gap: 8px;
  padding: 12px;
  border: 1px solid #bfdbfe;
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 12%, rgba(37, 99, 235, 0.15), transparent 28%),
    linear-gradient(135deg, #eff6ff, #ffffff);
  box-shadow:
    0 14px 32px rgba(37, 99, 235, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.case-demo-runner strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 15px;
}

.case-demo-runtime {
  display: grid;
  gap: 5px;
  max-height: 138px;
  margin: 2px 0 0;
  padding: 10px 10px 10px 26px;
  overflow: auto;
  border: 1px solid rgba(191, 219, 254, 0.9);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(248, 250, 252, 0.78));
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 11px;
  line-height: 1.35;
}

.case-demo-runtime li::marker {
  color: var(--accent);
}

.case-demo-grid-wrap {
  overflow: auto;
  padding: 12px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(226, 232, 240, 0.42) 1px, transparent 1px),
    linear-gradient(rgba(226, 232, 240, 0.42) 1px, transparent 1px),
    #fff;
  background-size: 28px 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.9),
    0 18px 38px rgba(15, 23, 42, 0.06);
}

.case-demo-grid {
  display: grid;
  grid-template-columns: 46px repeat(32, minmax(46px, 1fr));
  gap: 6px;
  min-width: 1660px;
  align-items: center;
}

.case-grid-head,
.case-grid-branch {
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 800;
  text-align: center;
}

.case-grid-head {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 4px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.86));
  backdrop-filter: blur(6px);
}

.case-grid-branch {
  position: sticky;
  left: 0;
  z-index: 4;
  padding: 4px 6px 4px 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96) 78%, rgba(255, 255, 255, 0));
  text-align: left;
}

.case-grid-branch.is-pruned {
  color: #b91c1c;
  text-decoration: line-through;
}

.case-grid-branch.is-inactive {
  color: #94a3b8;
  opacity: 0.62;
}

.case-grid-branch.is-stopped {
  color: #166534;
  font-weight: 900;
}

.case-grid-cell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 4px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  text-overflow: ellipsis;
  opacity: 0.18;
  transform: scale(0.98);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease;
}

.case-grid-cell.is-revealed {
  opacity: 1;
  transform: scale(1);
}

.case-grid-cell.is-current {
  border-color: #2563eb !important;
  background-image: linear-gradient(135deg, rgba(37, 99, 235, 0.18), rgba(255, 255, 255, 0));
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.26),
    0 8px 18px rgba(37, 99, 235, 0.18);
  transform: scale(1.07);
  z-index: 3;
}

.case-grid-cell.is-inactive {
  filter: grayscale(0.88);
  opacity: 0.34;
  box-shadow: inset 0 0 0 999px rgba(148, 163, 184, 0.18);
}

.case-grid-cell.is-pruned {
  border-color: #dc2626 !important;
  background: repeating-linear-gradient(
      135deg,
      rgba(220, 38, 38, 0.12) 0,
      rgba(220, 38, 38, 0.12) 5px,
      rgba(254, 226, 226, 0.92) 5px,
      rgba(254, 226, 226, 0.92) 10px
    ),
    #fee2e2;
  color: #991b1b;
  opacity: 0.88;
  filter: none;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.2);
}

.case-grid-cell.is-pruned::after {
  content: "×";
  position: absolute;
  inset: -7px -5px auto auto;
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.case-grid-cell.is-stop-answer {
  border-color: #15803d !important;
  background: linear-gradient(135deg, #86efac, #dcfce7);
  color: #14532d;
  opacity: 1;
  filter: none;
  box-shadow:
    0 0 0 3px rgba(34, 197, 94, 0.34),
    0 10px 22px rgba(22, 163, 74, 0.22);
  z-index: 4;
}

.case-grid-cell.is-vote::before {
  content: "VOTE";
  position: absolute;
  inset: -9px auto auto -6px;
  display: inline-grid;
  place-items: center;
  min-width: 26px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.case-grid-cell.is-good {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
}

.case-grid-cell.is-trap {
  border-color: #fdba74;
  background: #ffedd5;
  color: #9a3412;
}

.case-grid-cell.is-err {
  border-color: #fecaca;
  background: #fee2e2;
  color: #b91c1c;
}

.case-grid-cell.is-other {
  border-color: #dbe3ee;
  background: #f8fafc;
  color: #475569;
}

.case-grid-cell:not(.is-revealed) {
  color: transparent;
}

.case-demo-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.case-demo-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.case-demo-legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.legend-good {
  background: #22c55e;
}

.legend-trap {
  background: #f97316;
}

.legend-err {
  background: #ef4444;
}

.legend-other {
  background: #94a3b8;
}

.legend-active {
  border: 2px solid #2563eb;
  background: #dbeafe;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
}

.legend-inactive {
  background: #cbd5e1;
  opacity: 0.45;
  filter: grayscale(1);
}

.legend-pruned {
  position: relative;
  border: 1px solid #dc2626;
  background: #fee2e2;
}

.legend-pruned::after {
  content: "×";
  position: absolute;
  inset: -8px -6px auto auto;
  color: #dc2626;
  font-size: 13px;
  font-weight: 900;
}

.legend-vote {
  position: relative;
  border: 2px solid #15803d;
  background: #bbf7d0;
}

.legend-vote::after {
  content: "V";
  position: absolute;
  inset: -7px auto auto -5px;
  display: inline-grid;
  place-items: center;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #16a34a;
  color: #fff;
  font-size: 8px;
  font-weight: 900;
}

.case-demo-shell.is-playing .case-demo-pill {
  animation: caseDemoPulse 1.2s ease-in-out infinite;
}

.case-demo-history {
  display: flex;
  flex-direction: column;
}

.case-demo-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.case-demo-metrics article {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.case-demo-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-demo-metrics strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-demo-history ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-demo-history li {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  opacity: 0.45;
  transition:
    opacity 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    transform 180ms ease;
}

.case-demo-history li.is-committed {
  border-color: #bbf7d0;
  background: #f0fdf4;
  opacity: 1;
}

.case-demo-history li.is-active {
  border-color: #93c5fd;
  background: #eff6ff;
  opacity: 1;
  transform: translateX(2px);
}

.case-demo-history strong {
  color: var(--text);
  font-size: 12px;
}

.case-demo-history li span {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.4;
}

@keyframes caseDemoPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.2);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.08);
  }
}

@keyframes caseFlowDot {
  0%,
  100% {
    opacity: 0.72;
    transform: translate(0, -50%) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translate(clamp(86px, 13vw, 142px), -50%) scale(1.05);
  }
}

@keyframes caseFlowDotVertical {
  0%,
  100% {
    opacity: 0.72;
    transform: translate(-50%, 0) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, 46px) scale(1.05);
  }
}

@keyframes caseAgentLinkDot {
  0%,
  100% {
    opacity: 0.65;
    transform: translate(0, -50%) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translate(52px, -50%) scale(1.05);
  }
}

@keyframes caseFlowLine {
  0% {
    background-position: 50% 0, 0 0;
    opacity: 0.62;
  }
  50% {
    background-position: 50% 100%, 0 0;
    opacity: 1;
  }
  100% {
    background-position: 50% 0, 0 0;
    opacity: 0.62;
  }
}

@keyframes caseAgentPathFlow {
  from {
    stroke-dashoffset: 18;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes caseMonitorBeam {
  0%,
  100% {
    opacity: 0.58;
    transform: translateX(-50%) scaleY(0.94);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scaleY(1.04);
  }
}

@keyframes caseAgentBreath {
  0%,
  100% {
    transform: translateY(-50%) scale(1);
  }
  50% {
    transform: translateY(-50%) scale(1.04);
  }
}

@media (max-width: 980px) {
  .case-demo-topline,
  .case-demo-layout {
    grid-template-columns: 1fr;
  }

  .case-demo-workbench {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    grid-template-areas:
      "control"
      "code"
      "execution";
  }

  .case-demo-detail-column .case-demo-layout,
  .case-demo-detail-column .case-demo-grid-card {
    height: auto;
  }

  .case-demo-topline {
    display: grid;
  }

  .case-demo-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .case-demo-architecture {
    min-height: 258px;
    padding-inline: 10px;
  }

  .case-demo-repo {
    width: min(86%, 760px);
  }

  .case-demo-repo-modules {
    grid-template-columns: 1fr;
  }

  .case-repo-module--history {
    width: 100%;
  }

  .case-demo-loop {
    grid-template-columns: 1fr;
    grid-template-areas:
      "propose"
      "env"
      "feedback"
      "history"
      "loop"
      "result";
    gap: 10px;
    padding: 14px;
  }

  .case-loop-center {
    border-radius: 18px;
  }

  .case-loop-center::before,
  .case-loop-center::after {
    display: none;
  }
}

@media (max-width: 560px) {
  .case-demo-stats,
  .case-demo-metrics {
    grid-template-columns: 1fr;
  }
}

.text-section {
  margin: 54px 0;
  padding: 34px;
}

.text-section h2 {
  max-width: 860px;
}

.text-section p {
  max-width: 900px;
  margin-bottom: 0;
  font-size: 17px;
}

.text-section.bibtex > .kicker {
  font-size: 12px;
}

.simple-grid article {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
}

.simple-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.simple-grid.compact {
  padding: 0;
}

.bibtex pre + pre {
  margin-top: 28px;
}

.bibtex pre {
  margin: 18px 0 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--soft);
}

.bibtex code {
  display: block;
  min-width: 760px;
  padding: 18px;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre;
}

footer {
  padding: 32px 0 48px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 520px;
}

.footer-name {
  font-weight: 800;
  color: var(--text);
  font-size: 16px;
  letter-spacing: -0.03em;
}

.footer-tag {
  line-height: 1.48;
}

/* Results band */
.results-showcase-section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, var(--surface) 0%, #f8fafc 100%);
}

.results-showcase-intro {
  margin-bottom: 22px;
}

.results-search-tag {
  display: inline-block;
  padding: 0.1em 0.45em;
  border-radius: 4px;
  background: rgba(255, 237, 199, 0.95);
  border: 1px solid rgba(234, 179, 8, 0.35);
  font-size: 0.88em;
  font-weight: 650;
}

.results-subheading {
  margin: 0 0 10px;
  font-size: clamp(18px, 2.2vw, 22px);
  letter-spacing: -0.03em;
}

.results-table-block {
  margin-top: 20px;
  scroll-margin-top: 24px;
}

.results-table-note,
.results-figure-lede {
  margin: 0 0 18px;
  max-width: 52rem;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.results-table-note-list {
  margin: 0 0 18px;
  padding-left: 1.35em;
  max-width: 52rem;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
  text-wrap: pretty;
}

.results-table-note-list li {
  margin-bottom: 0.65em;
}

.results-table-note-list li:last-child {
  margin-bottom: 0;
}

.results-table-note-list strong {
  color: var(--text);
  font-weight: 650;
}

.results-table-note-list code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: rgba(226, 232, 240, 0.85);
  font-size: 0.92em;
}

.results-table-scroll {
  margin: 12px 0 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.results-main-table {
  width: 100%;
  min-width: min(1100px, 100%);
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.35;
}

.results-main-table th,
.results-main-table td {
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
}

.results-main-table th {
  background: #f8fafc;
  font-weight: 700;
  font-size: 11.5px;
  letter-spacing: 0.03em;
}

.results-main-table td:first-child {
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.results-main-table td:nth-child(2) {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}

.results-main-table tbody tr:last-child td {
  border-bottom: none;
}

.results-main-table tbody + tbody tr:first-child td {
  border-top: 1px solid var(--line);
}

.results-col-search {
  background: rgba(255, 237, 199, 0.52);
}

.results-main-table thead .results-col-search {
  background: rgba(255, 224, 159, 0.75);
}

.results-model-row td {
  padding: 14px 14px 10px;
  text-align: left;
  font-weight: 650;
  font-size: 13px;
  color: var(--text);
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}

.results-scaling-block,
.results-self-block,
.results-discovered-block {
  margin-top: 52px;
  scroll-margin-top: 24px;
}

.results-mechanisms {
  max-width: 52rem;
  margin: 4px 0 0;
  display: grid;
  gap: 14px;
}

.results-mechanisms p {
  margin: 0;
  font-size: 15px;
  line-height: 1.62;
  color: var(--text);
}

.results-mechanisms strong {
  font-weight: 750;
}

.results-mechanisms code {
  padding: 0.12em 0.38em;
  border-radius: 4px;
  background: #e2e8f0;
  font-size: 0.92em;
}

.results-mechanisms-outro {
  margin: 18px 0 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.58;
}

.results-turn5-details {
  margin-top: 22px;
  max-width: min(52rem, 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  overflow: hidden;
}

.results-turn5-summary {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 12px 14px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  color: var(--text);
}

.results-turn5-summary::-webkit-details-marker {
  display: none;
}

.results-turn5-summary::after {
  content: "▸";
  margin-left: auto;
  color: var(--accent);
  font-size: 13px;
  transition: transform 160ms ease;
}

.results-turn5-details[open] .results-turn5-summary::after {
  transform: rotate(90deg);
}

.results-turn5-summary-label {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent);
}

.results-turn5-filename {
  padding: 0.15em 0.42em;
  border-radius: 6px;
  background: rgba(226, 232, 240, 0.9);
  font-size: 12px;
  font-weight: 650;
}

.results-turn5-summary-hint {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.results-turn5-details[open] .results-turn5-summary-hint {
  font-size: 0;
}

.results-turn5-details[open] .results-turn5-summary-hint::before {
  content: "click to collapse";
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.results-turn5-pre {
  margin: 0;
  padding: 0 14px 14px;
  max-height: min(70vh, 560px);
  overflow: auto;
  border-top: 1px solid var(--line);
  background: #f8fafc;
}

.results-turn5-pre code {
  display: block;
  padding-top: 12px;
  font-family:
    ui-monospace,
    SFMono-Regular,
    Menlo,
    Monaco,
    Consolas,
    "Liberation Mono",
    monospace;
  font-size: 11.5px;
  line-height: 1.48;
  white-space: pre;
}

.results-scaling-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 18px);
  max-width: min(880px, 100%);
  margin-left: auto;
  margin-right: auto;
}

.results-figure-card {
  margin: 0;
  padding: 16px 14px 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.055);
}

.results-figure-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

.results-figure-card figcaption {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
}

.results-figure-card--wide {
  max-width: min(880px, 100%);
  margin-left: auto;
  margin-right: auto;
}

/* Discovery design strip */
.paper-design-section {
  scroll-margin-top: 24px;
  padding: 54px 0;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
  background: linear-gradient(180deg, #fafbfc 0%, var(--surface) 55%);
}

.paper-design-intro {
  margin-bottom: 28px;
}

.paper-design-lede {
  margin: 8px auto 0;
  max-width: 52rem;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

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

.paper-design-card {
  padding: 26px 22px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 14px 42px rgba(15, 23, 42, 0.055);
}

.paper-design-card h3 {
  margin-bottom: 12px;
  font-size: 18px;
  letter-spacing: -0.02em;
}

.paper-design-card p {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--text);
}

.paper-design-card p code {
  font-size: 0.92em;
}

/* —— Interactive process timeline (#process) —— */
.process-section {
  padding: 48px 0 56px;
  border-bottom: 1px solid var(--line);
}

.process-header {
  max-width: 860px;
  margin-bottom: 28px;
}

.process-section .kicker {
  margin-bottom: 10px;
}

.process-section h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.045em;
  line-height: 1.12;
}

.process-lede {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.process-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.process-status {
  flex: 1 1 200px;
  margin: 0;
  padding: 8px 0;
  font-size: 14px;
  color: var(--muted);
}

.process-progress {
  height: 4px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  max-width: 520px;
}

.process-progress-bar {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #22c55e, var(--accent));
  transition: width 0.45s ease-out;
}

.process-insight {
  margin-top: 20px;
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: #fff;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.06);
}

.process-insight-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.process-insight-list {
  margin: 0;
  padding-left: 1.25rem;
  color: #475569;
  font-size: 14px;
  line-height: 1.6;
}

.process-insight-list li {
  margin-bottom: 8px;
}

.process-insight-list li:last-child {
  margin-bottom: 0;
}

.process-strip .process-card {
  scroll-margin-top: 96px;
}

.process-card {
  padding: 16px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--soft);
  opacity: 0.38;
  filter: saturate(0.88);
  transform: translateY(2px);
  transition:
    opacity 0.38s ease,
    border-color 0.38s ease,
    background 0.38s ease,
    filter 0.38s ease,
    transform 0.38s ease;
}

.process-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.process-card.is-lit {
  opacity: 1;
  filter: none;
  border-color: #93c5fd;
  background: #fff;
  transform: translateY(0);
  box-shadow: 0 12px 42px rgba(37, 99, 235, 0.1);
}

.process-card-kicker {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.process-card h3 {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: -0.025em;
}

.process-formula {
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  font-family:
    ui-serif,
    "Times New Roman",
    serif;
  font-size: 15px;
  line-height: 1.5;
  background: #fafafa;
  letter-spacing: 0;
}

.process-formula .formula-accent {
  color: #0369a1;
  font-weight: 650;
}

.process-bullets {
  margin: 0;
  padding-left: 1.05rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.formula-item[hidden] {
  display: none !important;
}

.process-build-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.build-line-process {
  transition: color 0.25s ease, font-weight 0.25s ease;
}

.build-line-process.lit {
  color: #0f172a;
  font-weight: 700;
}

.process-card-caption {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--muted);
}

.data-matrix {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 28px));
  gap: 5px;
  margin-bottom: 8px;
}

.data-cell-process {
  display: block;
  aspect-ratio: 1;
  border-radius: 6px;
  border: 1px dashed #cbd5e1;
  background: #fff;
  transition:
    transform 0.18s ease,
    background 0.25s ease,
    border-color 0.25s ease,
    opacity 0.25s ease;
}

.data-cell-process.filled {
  border-style: solid;
  border-color: #34d399;
  background: linear-gradient(165deg, #d1fae5, #a7f3d0);
  transform: scale(1.06);
}

.data-labels-row {
  display: flex;
  justify-content: space-between;
  padding: 2px 0 0;
  font-size: 11px;
  color: var(--muted);
  font-weight: 650;
}

.walk-method-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 12px;
  max-width: min(100%, 420px);
}

.walk-method-secondary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.walk-demo-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--muted);
}

.walk-method-label {
  margin: 0;
  font-size: 11px;
  font-weight: 650;
  color: var(--muted);
  line-height: 1.45;
}

.walk-method-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.walk-method-btn {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.02em;
  color: #334155;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.walk-method-btn:hover {
  border-color: #cbd5e1;
  background: #f8fafc;
}

.walk-method-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.walk-method-btn.is-selected {
  border-color: var(--accent);
  background: #eff6ff;
  color: #1e3a8a;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.12);
}

.walk-method-note {
  margin: 0 0 8px;
  max-width: min(100%, 420px);
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: #f8fafc;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 650;
  white-space: pre-wrap;
}

.walk-flat {
  display: grid;
  grid-template-columns: 52px repeat(4, minmax(38px, 46px));
  grid-template-rows: auto repeat(4, minmax(40px, 46px));
  gap: 5px;
  align-items: center;
  justify-items: center;
  padding: 6px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #fafafa;
  max-width: min(100%, 340px);
}

.walk-corner {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 3px;
  width: 100%;
  padding: 4px 2px 2px 0;
  justify-self: stretch;
  box-sizing: border-box;
}

.walk-corner-branch,
.walk-corner-depth {
  display: block;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
  line-height: 1.15;
  text-transform: uppercase;
}

.walk-corner-branch {
  text-transform: none;
  letter-spacing: 0.04em;
  font-size: 10px;
}

.walk-flat .walk-col-head {
  font-size: 10px;
  justify-self: center;
  text-transform: none;
}

.walk-flat .walk-row-head {
  justify-self: end;
  padding-right: 4px;
  letter-spacing: 0.03em;
  text-transform: none;
}

.walk-flat .walk-h {
  font-size: 10px;
  font-weight: 800;
  color: var(--muted);
}

.walk-cell-process {
  position: relative;
  display: block;
  width: 100%;
  min-width: 36px;
  max-width: 44px;
  aspect-ratio: 1;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease,
    background 0.2s ease;
}

.walk-cell-process.visited {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.walk-flat[data-walk-style="sc"] .walk-cell-process.visited {
  background: #eff6ff;
  border-color: #93c5fd;
}

.walk-flat[data-walk-style="asc"] .walk-cell-process.visited {
  background: #f5f3ff;
  border-color: #c4b5fd;
}

.walk-flat[data-walk-style="probe"] .walk-cell-process.visited {
  background: #ecfdf5;
  border-color: #6ee7b7;
}

.walk-flat[data-walk-style="autotts"] .walk-cell-process.visited {
  background: #fff7ed;
  border-color: #fdba74;
}

.walk-flat[data-walk-style="demo"] .walk-cell-process.visited {
  background: #eff6ff;
  border-color: #7dd3fc;
}

.walk-cell-process[data-order]::after {
  content: attr(data-order);
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 999px;
  background: #1e293b;
  color: #fff;
  font-size: 8.5px;
  font-weight: 800;
  line-height: 15px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
  z-index: 3;
}

.walk-cell-process.current {
  z-index: 2;
  background: var(--accent);
  border-color: #1e40af;
  box-shadow:
    0 0 0 3px #fff,
    0 8px 20px rgba(37, 99, 235, 0.42);
  transform: scale(1.12);
}

.walk-cell-process.pruned {
  opacity: 0.42;
  background: #fecaca !important;
  border-color: #f87171 !important;
}

.walk-step-readout {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.walk-step-readout code {
  display: inline-block;
  width: 100%;
  overflow-wrap: anywhere;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: #0f172a;
  font-size: 11.5px;
  line-height: 1.52;
}

@media (max-width: 1024px) {
  .paper-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .paper-design-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .hero {
    padding-top: 20px;
  }

  .hero-inner {
    border-radius: 20px;
    padding: 40px 20px 36px;
    text-align: left;
  }

  .section-title {
    text-align: left;
  }

  .actions {
    justify-content: flex-start;
  }

  .simple-grid,
  .replay-card,
  .build-card {
    grid-template-columns: 1fr;
  }

  .paper-stats {
    grid-template-columns: 1fr;
  }

  footer {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .results-scaling-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
  }
}
