/* ==========================================================================
   GPT with Taste v2.0 — Editorial Broadsheet x Polarity Curtains (M09 x M08)
   Self-hosted OFL typography · APCA 0.0.98G-4g verified · Zero external CDNs
   ========================================================================== */

@font-face {
  font-family: 'Inter Tight';
  src: url('../fonts/InterTight-var.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Sans';
  src: url('../fonts/IBMPlexSans-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Newsreader Italic';
  src: url('../fonts/Newsreader-Italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-500.woff2') format('woff2');
  font-weight: 300 550;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../fonts/IBMPlexMono-600.woff2') format('woff2');
  font-weight: 551 900;
  font-style: normal;
  font-display: swap;
}

:root {
  font-synthesis: none;

  /* Verified cross-platform font stacks (Windows DirectWrite + macOS CoreText + Linux) */
  --font-display: 'Inter Tight', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --font-sans: 'IBM Plex Sans', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
  --font-italic: 'Newsreader Italic', Georgia, serif;
  --font-mono: 'IBM Plex Mono', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei UI', 'Microsoft YaHei', monospace;

  /* Paper Palette (Act I & Act III) — APCA verified on #FBF9F5 */
  --paper-bg: #FBF9F5;
  --paper-well: #F3EFE6;
  --paper-ink: #1C1E21;         /* Lc +100.1 */
  --paper-muted: #4A505D;       /* Lc +84.5 */
  --paper-vermilion: #C84824;   /* Strokes, display >= 24px, stamps */
  --paper-accent-ink: #A33213;  /* Small links/kickers 12-16px: Lc +79.4 */
  --paper-caution: #7A3E2B;     /* Lc +83.1 Burnt Umber */
  --paper-caution-bg: rgba(130, 71, 52, 0.11);
  --paper-positive: #155A41;    /* Lc +83.2 Forest Pine */
  --paper-positive-bg: rgba(29, 107, 79, 0.11);
  --paper-rule: #DAD3C5;
  --paper-rule-strong: #1C1E21;

  /* Deep Carbon Palette (Act II & Act IV) — APCA verified on #111317 */
  --carbon-bg: #111317;
  --carbon-elev: #181B22;
  --carbon-ink: #F4F1EA;        /* Lc -98.1 */
  --carbon-muted: #BEC4D0;      /* Lc -69.2 */
  --carbon-mega: #FF6B42;       /* STRICTLY >= 48px/800 display figures: Lc -47.8 */
  --carbon-accent: #FF997A;     /* 12-16px/600 accent labels & links: Lc -61.3 */
  --carbon-positive: #6EE7B7;   /* Lc -81.4 */
  --carbon-caution: #FFAB91;    /* Lc -68.9 */
  --carbon-stroke: #C84824;     /* Non-text graphical vector strokes/dots ONLY */
  --carbon-rule: rgba(244, 241, 234, 0.16);
  --carbon-rule-strong: rgba(244, 241, 234, 0.44);

  /* Warm Stone Palette (Act V) — APCA verified on #F3EFE6 */
  --stone-bg: #F3EFE6;
  --stone-well: #EAE4D7;
  --stone-ink: #1C1E21;         /* Lc +94.3 */
  --stone-muted: #464C59;       /* Lc +80.6 */
  --stone-accent-ink: #9B2E10;  /* Lc +77.1 */
  --stone-rule: #CFC7B6;

  /* Calibrated motion curves (zero ease-in, zero transition:all) */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-snap: cubic-bezier(0.2, 0, 0, 1);
  --ease-gallery: cubic-bezier(0.22, 1, 0.36, 1);

  --max-w: 1280px;
  --pad-x: clamp(16px, 3.2vw, 44px);
}

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

html {
  scroll-behavior: auto;
  background: var(--paper-bg);
  color: var(--paper-ink);
  -webkit-text-size-adjust: 100%;
}

html[lang^="zh"] {
  font-feature-settings: "halt" 1, "chws" 1;
  line-break: strict;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

body {
  margin: 0;
  background: var(--paper-bg);
  color: var(--paper-ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.66;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

html[lang^="zh"] body {
  line-height: 1.74;
}

/* Explicit tabular & lining numerals everywhere comparative numbers appear */
.num,
table td,
table th,
.stat-figure,
.proof-ribbon,
.stage-timer,
.receipt-badge,
.faq-idx,
.headroom-readout {
  font-variant-numeric: tabular-nums lining-nums !important;
}

/* Latin italic accent strictly isolated to lang="en" spans */
.latin-italic,
html[lang="en"] h1 em,
.wordmark em[lang="en"],
.cite-title[lang="en"] {
  font-family: var(--font-italic);
  font-style: italic;
  font-weight: 400;
}

/* Upright Chinese emphasis — ZERO synthetic browser oblique */
html[lang^="zh"] em {
  font-style: normal;
}

code, pre, kbd {
  font-family: var(--font-mono);
}

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

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
}

:focus-visible {
  outline: 2px solid var(--paper-vermilion);
  outline-offset: 2px;
}

.act-carbon :focus-visible {
  outline-color: var(--carbon-accent);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  background: var(--paper-ink);
  color: var(--paper-bg);
  padding: 10px 16px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
}

.skip-link:focus {
  left: var(--pad-x);
}

.shell {
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

/* Inline vector icon helper */
.ico {
  width: 13px;
  height: 13px;
  flex: 0 0 auto;
  vertical-align: -1.5px;
}

/* ==========================================================================
   MASTHEAD — Broadsheet 3px + 3px gap + 1px Double Top Rule
   ========================================================================== */

.masthead-wrap {
  background: var(--paper-bg);
  padding-top: 10px;
}

.masthead {
  border-top: 3px solid var(--paper-rule-strong);
  box-shadow: inset 0 3px 0 var(--paper-bg), inset 0 4px 0 var(--paper-rule-strong);
  border-bottom: 1px solid var(--paper-rule);
  padding: 12px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
}

.brand-lockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}

.brand-home {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--paper-ink);
}

.wordmark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.wordmark em[lang="en"] {
  color: var(--paper-vermilion);
  font-size: 1.08em;
  letter-spacing: -0.01em;
}

.ver-stamp {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--paper-muted);
  border: 1px solid var(--paper-rule-strong);
  padding: 2px 6px;
  line-height: 1.2;
}

.masthead-nav {
  display: flex;
  align-items: center;
  gap: 4px 6px;
  flex-wrap: wrap;
}

.nav-link,
.lang-link,
.gh-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 10px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--paper-muted);
  transition: color 140ms var(--ease-out), border-color 140ms var(--ease-out), background-color 140ms var(--ease-out);
}

.nav-link:hover {
  color: var(--paper-ink);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 2px;
}

.lang-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--paper-ink);
  border: 1px solid var(--paper-rule-strong);
  padding: 0 11px;
  margin-left: 4px;
}

.lang-link:hover {
  background: var(--paper-ink);
  color: var(--paper-bg);
}

.gh-link {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--paper-ink);
  color: var(--paper-bg);
  padding: 0 12px;
}

.gh-link:hover {
  background: var(--paper-vermilion);
}

/* ==========================================================================
   ACT I · WARM XUAN PAPER (#FBF9F5) — SPLIT-STUDIO HERO & WAAPI CUT STAGE
   ========================================================================== */

.act-paper {
  background: var(--paper-bg);
  color: var(--paper-ink);
}

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 5.2fr) minmax(0, 6.8fr);
  border-bottom: 2px solid var(--paper-rule-strong);
}

.hero-left {
  padding: clamp(18px, 2.4vw, 30px) clamp(20px, 3vw, 40px) clamp(18px, 2.2vw, 28px) 0;
  border-right: 1px solid var(--paper-rule);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.rubric-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.hero-instrument {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

.rubric-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--paper-accent-ink);
}

html[lang^="zh"] .rubric-kicker {
  letter-spacing: 0.06em;
}

.hero-left h1 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.15rem, 3.5vw, 3.8rem); /* Ratio 1.77 <= 2.4; keeps 2-line lockup on 1440x900 */
  line-height: 1.05;
  letter-spacing: -0.028em;
  color: var(--paper-ink);
}

html[lang="en"] .hero-left h1 em {
  color: var(--paper-vermilion);
  font-size: 1.05em;
  white-space: nowrap;
}

html[lang^="zh"] .hero-left h1 {
  font-size: clamp(2.15rem, 3.7vw, 4.1rem); /* Ratio 1.91 <= 2.4 */
  line-height: 1.2;
  letter-spacing: 0;
}

html[lang^="zh"] .hero-left h1 em {
  color: var(--paper-vermilion);
  text-decoration: underline 3px var(--paper-vermilion);
  text-underline-offset: 8px;
  white-space: nowrap;
}

.hero-left h1 .dot {
  color: var(--paper-vermilion);
}

.hero-lead {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--paper-muted);
  max-width: 54ch;
}

html[lang^="zh"] .hero-lead {
  max-width: 36ic;
  line-height: 1.7;
}

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

/* 1-Click Quick-Install Bar (unboxed broadsheet ledger) */
.quick-install {
  border-top: 2px solid var(--paper-rule-strong);
  border-bottom: 1px solid var(--paper-rule);
  padding: 10px 0 11px;
}

.install-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 8px;
}

.install-label,
.kbd-hint {
  white-space: nowrap;
}

.install-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.kbd-hint {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--paper-muted);
}

.kbd-hint kbd {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 5px;
  border: 1px solid var(--paper-rule);
  background: var(--paper-well);
  color: var(--paper-ink);
}

.install-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.inst-tab {
  min-height: 44px;
  min-width: 44px;
  padding: 0 11px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--paper-muted);
  border: 1px solid var(--paper-rule);
  background: var(--paper-bg);
  transition: color 120ms var(--ease-out), background-color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}

.inst-tab:hover {
  border-color: var(--paper-ink);
  color: var(--paper-ink);
}

.inst-tab[aria-selected="true"] {
  background: var(--paper-ink);
  border-color: var(--paper-ink);
  color: var(--paper-bg);
}

.cmd-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--paper-well);
  border-left: 3px solid var(--paper-vermilion);
  padding: 10px 10px 10px 14px;
}

.cmd-code {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--paper-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.copy-trigger {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 76px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--paper-bg);
  color: var(--paper-ink);
  border: 1px solid var(--paper-rule-strong);
  transition: background-color 120ms var(--ease-snap), color 120ms var(--ease-snap), transform 90ms var(--ease-snap);
}

.copy-trigger:hover {
  background: var(--paper-ink);
  color: var(--paper-bg);
}

.copy-trigger:active {
  transform: translateY(1px);
}

.copy-trigger.is-copied {
  background: var(--paper-positive);
  border-color: var(--paper-positive);
  color: var(--paper-bg);
}

.install-note-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 14px;
  flex-wrap: wrap;
  margin-top: 8px;
  font-size: 13px;
  color: var(--paper-muted);
}

.text-action-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--paper-accent-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.text-action-link:hover {
  color: var(--paper-ink);
}

.proof-ribbon {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--paper-muted);
}

.proof-ribbon strong {
  color: var(--paper-ink);
}

.proof-sep {
  color: var(--paper-vermilion);
}

/* Right Half — Dual-Polarity Editorial Scalpel Plate ("朱笔剖稿台") */
.hero-right {
  padding: clamp(16px, 2vw, 24px) 0 clamp(14px, 1.8vw, 22px) clamp(18px, 2.6vw, 34px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.stage-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--paper-rule-strong);
}

.stage-flag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper-ink);
  white-space: nowrap;
}

.live-dot {
  width: 7px;
  height: 7px;
  background: var(--paper-vermilion);
  display: inline-block;
  flex: 0 0 auto;
}

.stage-top-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.stage-case-switch {
  display: inline-flex;
  gap: 4px;
  flex-wrap: wrap;
}

.stage-case-btn {
  min-height: 40px;
  min-width: 44px;
  padding: 0 9px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--paper-muted);
  border: 1px solid var(--paper-rule);
  background: var(--paper-bg);
  white-space: nowrap;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}

.stage-case-btn:hover {
  border-color: var(--paper-ink);
  color: var(--paper-ink);
}

.stage-case-btn[aria-pressed="true"] {
  background: var(--paper-ink);
  border-color: var(--paper-ink);
  color: var(--paper-bg);
}

.replay-btn {
  min-height: 40px;
  min-width: 44px;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--paper-bg);
  background: var(--paper-vermilion);
  border: 1px solid var(--paper-vermilion);
  white-space: nowrap;
  transition: background-color 120ms var(--ease-out);
}

.replay-btn:hover {
  background: var(--paper-accent-ink);
  border-color: var(--paper-accent-ink);
}

/* Prompt strip shared above the Two-Chamber Scalpel Plate */
.stage-prompt-bar {
  padding: 8px 0;
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.prompt-sigil {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--paper-accent-ink);
  flex: 0 0 auto;
}

.prompt-line {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.48;
  color: var(--paper-ink);
}

/* Scalpel Plate Viewport — overflow: visible to prevent DOM_TEXT_CLIPPED / clipped-midway */
.ceremony-viewport {
  position: relative;
  padding: 2px 0 6px;
  overflow: visible;
}

.ceremony-mount {
  position: relative;
  width: 100%;
  overflow: visible;
}

.scalpel-plate {
  position: relative;
  width: 100%;
  border: 1px solid var(--paper-rule-strong);
  background: var(--paper-bg);
  overflow: visible;
}

/* Engraved lithographic corner registration marks */
.reg-tick {
  position: absolute;
  width: 7px;
  height: 7px;
  pointer-events: none;
  z-index: 6;
}

.reg-tl { top: -4px; left: -4px; border-top: 1.5px solid var(--paper-vermilion); border-left: 1.5px solid var(--paper-vermilion); }
.reg-tr { top: -4px; right: -4px; border-top: 1.5px solid var(--paper-vermilion); border-right: 1.5px solid var(--paper-vermilion); }
.reg-bl { bottom: -4px; left: -4px; border-bottom: 1.5px solid var(--paper-vermilion); border-left: 1.5px solid var(--paper-vermilion); }
.reg-br { bottom: -4px; right: -4px; border-bottom: 1.5px solid var(--paper-vermilion); border-right: 1.5px solid var(--paper-vermilion); }

/* Row 1: Upper Chamber — Deep Carbon Raw Specimen Well (Permanently Visible) */
.chamber-raw {
  position: relative;
  background: var(--carbon-bg);
  color: var(--carbon-ink);
  padding: 11px 16px 13px;
  overflow: visible;
  outline-offset: -2px;
}

.chamber-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 10px;
  flex-wrap: wrap;
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chamber-head-raw {
  border-bottom: 1px solid var(--carbon-rule);
}

.chamber-kicker-raw {
  color: var(--carbon-caution); /* #FFAB91 -> Lc -68.9 on #111317 */
}

.chamber-defect-pill {
  color: #FFAB91;
  background: #1B171A;
  border: 1px solid rgba(255, 171, 145, 0.52);
  padding: 1px 7px;
  font-size: 10.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.specimen-transcript {
  position: relative;
  overflow: visible;
}

.specimen-prose {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.specimen-p {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.64;
  color: var(--carbon-ink);
  overflow-wrap: anywhere;
}

html[lang^="zh"] .specimen-p {
  line-height: 1.7;
}

.slop-clause {
  position: relative;
  color: var(--carbon-ink);
  border-bottom: 1px dashed rgba(255, 153, 122, 0.38);
  padding-bottom: 1px;
  transition: color 150ms var(--ease-out);
}

.slop-inline {
  display: inline-block;
  white-space: nowrap;
}

.slop-tail-line {
  display: inline-block;
}

.slop-chip {
  display: inline-block;
  vertical-align: baseline;
  position: relative;
  top: -0.5px;
  margin-left: 5px;
  margin-right: 2px;
  padding: 0 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.02em;
  color: #FFAB91 !important;
  background: #1B171A;
  border: 1px solid rgba(255, 171, 145, 0.54);
  white-space: nowrap;
}

.slash-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 3;
  opacity: 1;
  transition: opacity 160ms var(--ease-out);
}

/* Hover & Focus X-Ray ("悬停红线可透视原句" / "Hover redlines to X-ray") */
.chamber-raw:hover .slash-layer,
.chamber-raw:focus-visible .slash-layer,
.chamber-raw:focus-within .slash-layer {
  opacity: 0.2 !important;
}

.chamber-raw:hover .slop-clause,
.chamber-raw:focus-visible .slop-clause,
.chamber-raw:focus-within .slop-clause {
  color: #F4F1EA !important;
}

/* Row 2: The Guillotine Seam (Bi-Polar Carbon/Paper Cleave + Excision Stamp) */
.guillotine-seam {
  position: relative;
  min-height: 26px;
  background: linear-gradient(to bottom, var(--carbon-bg) 0%, var(--carbon-bg) 50%, var(--paper-bg) 50%, var(--paper-bg) 100%);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 2px 12px;
  overflow: visible;
  z-index: 4;
}

.seam-hairline {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -0.5px;
  background: rgba(200, 72, 36, 0.4);
  pointer-events: none;
}

#vermilion-blade-rig {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 10px;
  margin-top: -5px;
  pointer-events: none;
  visibility: hidden;
  overflow: visible;
  z-index: 1;
}

#vermilion-blade {
  position: absolute;
  left: 0;
  right: 0;
  top: 4px;
  height: 2.5px;
  background: var(--paper-vermilion);
  transform-origin: left center;
  transform: scaleX(0);
}

#vermilion-spark {
  position: absolute;
  left: 0;
  top: 0.5px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #FF6B42;
  box-shadow: 0 0 0 4px rgba(255, 107, 66, 0.34);
  transform: translateX(0);
  visibility: hidden;
}

.excision-stamp {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  background: var(--paper-bg);
  border: 1.5px solid var(--paper-vermilion);
  color: var(--paper-accent-ink); /* #A33213 -> Lc +79.4 on #FBF9F5 */
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  visibility: hidden;
}

.ico-scalpel {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  color: var(--paper-vermilion);
}

/* Row 3: Lower Chamber — Warm Paper Taste v2.0 Distilled Broadsheet Plate */
.chamber-taste {
  position: relative;
  display: grid;
  background: var(--paper-bg);
  color: var(--paper-ink);
  padding: 8px 16px 13px;
  overflow: visible;
}

.chamber-await-reticle {
  grid-area: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  overflow: visible;
}

.chamber-await-reticle svg {
  width: 100%;
  height: 64px;
}

.chamber-taste-inner {
  grid-area: 1 / 1;
  visibility: hidden;
  opacity: 0;
  overflow: visible;
}

.chamber-head-taste {
  border-bottom: 1px solid var(--paper-rule);
}

.chamber-kicker-taste {
  color: var(--paper-positive); /* #155A41 -> Lc +83.2 on #FBF9F5 */
}

.chamber-meta-taste {
  color: var(--paper-muted);
}

.taste-reveal-card {
  display: grid;
  grid-template-columns: 4px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
  padding: 2px 0;
}

#taste-lead-bar {
  width: 4px;
  background: var(--paper-vermilion);
  transform-origin: top center;
}

.taste-output-body {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.taste-headline {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(0.98rem, 1.25vw, 1.12rem);
  line-height: 1.38;
  color: var(--paper-ink);
}

.taste-prose {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.58;
  color: var(--paper-ink);
}

.taste-prose code,
.taste-headline code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--paper-well);
  padding: 1px 5px;
  border: 1px solid var(--paper-rule);
  white-space: nowrap;
}

.receipt-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 8px;
  padding: 4px 9px;
  background: var(--paper-positive-bg);
  border: 1px solid var(--paper-positive);
  color: var(--paper-positive);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
}

/* Settled static override (?settled=1 or prefers-reduced-motion) */
html[data-settled="true"] .slop-clause {
  color: #C5CBD6;
}

html[data-settled="true"] #vermilion-blade-rig {
  visibility: visible !important;
  opacity: 1 !important;
}

html[data-settled="true"] #vermilion-blade {
  transform: scaleX(1) !important;
}

html[data-settled="true"] #excision-stamp {
  visibility: visible !important;
  opacity: 1 !important;
  transform: scale(1) !important;
}

html[data-settled="true"] #chamber-await-reticle {
  visibility: hidden !important;
}

html[data-settled="true"] #cut-stage-after {
  visibility: visible !important;
  opacity: 1 !important;
  clip-path: inset(0% 0% 0% 0%) !important;
  transform: translateY(0px) !important;
}

html[data-settled="true"] #taste-lead-bar {
  transform: scaleY(1) !important;
}

html[data-settled="true"] #taste-receipt-badge {
  opacity: 1 !important;
  transform: translateY(0px) !important;
}

/* Sleek 3-Stop Hairline Phase Scrubber (WCAG 2.2 SC 2.5.7) */
.stage-phase-bar {
  border-top: 1px solid var(--paper-rule);
  padding-top: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 14px;
  flex-wrap: wrap;
}

.phase-buttons {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 14px;
}

.phase-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 2px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--paper-muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out);
}

.phase-btn:hover {
  color: var(--paper-ink);
  border-bottom-color: var(--paper-rule-strong);
}

.phase-btn[aria-pressed="true"] {
  color: var(--paper-accent-ink);
  border-bottom-color: var(--paper-vermilion);
}

.stage-status {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--paper-muted);
}

/* ==========================================================================
   SHARED SECTION HEADERS (Broadsheet Chapter Rubrics)
   ========================================================================== */

.act-section {
  padding-block: clamp(48px, 6.5vw, 88px);
}

.act-header {
  border-top: 2px solid currentColor;
  padding-top: 14px;
  margin-bottom: clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 16px 36px;
  align-items: end;
}

.act-eyebrow {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.act-paper .act-eyebrow {
  color: var(--paper-accent-ink);
}

.act-carbon .act-eyebrow {
  color: var(--carbon-accent);
}

.act-stone .act-eyebrow {
  color: var(--stone-accent-ink);
}

.act-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.8rem, 3.1vw, 3.1rem); /* Ratio 1.72 <= 2.4 */
  line-height: 1.1;
  letter-spacing: -0.022em;
}

html[lang^="zh"] .act-title {
  line-height: 1.24;
  letter-spacing: 0;
}

.act-dek {
  margin: 0;
  font-size: 15.5px;
  line-height: 1.64;
}

.act-paper .act-dek {
  color: var(--paper-muted);
}

.act-carbon .act-dek {
  color: var(--carbon-muted);
}

.act-stone .act-dek {
  color: var(--stone-muted);
}

/* ==========================================================================
   ACT II · DEEP CARBON (#111317) — MONUMENTAL TRIPTYCH & SMOKING-GUN DIFF
   ========================================================================== */

.act-carbon {
  background: var(--carbon-bg);
  color: var(--carbon-ink);
}

.act-carbon .act-header {
  border-top-color: var(--carbon-rule-strong);
}

.metric-triptych {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--carbon-rule);
  border-bottom: 1px solid var(--carbon-rule-strong);
  margin-bottom: clamp(36px, 5vw, 56px);
}

.metric-col {
  padding: 26px 28px 28px 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.metric-col + .metric-col {
  border-left: 1px solid var(--carbon-rule);
  padding-left: 28px;
}

.metric-col:last-child {
  padding-right: 0;
}

.metric-cite-top {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cite-title {
  font-size: 15px;
  color: var(--carbon-muted);
}

.cite-id {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--carbon-accent);
}

/* Strictly >= 48px bold display for #FF6B42 on #111317 (APCA pass!) */
.stat-figure {
  margin: 4px 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3.1rem, 5.5vw, 5.6rem); /* 49.6px min -> 89.6px max, ratio 1.81 <= 2.4 */
  line-height: 0.96;
  letter-spacing: -0.03em;
  color: var(--carbon-mega);
}

.stat-delta-strip {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--carbon-ink);
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--carbon-rule);
}

.stat-strike {
  color: var(--carbon-muted);
  text-decoration: line-through;
  text-decoration-color: var(--carbon-stroke);
  text-decoration-thickness: 2px;
}

.stat-body {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--carbon-muted);
}

.stat-body strong {
  color: var(--carbon-ink);
  font-weight: 600;
}

.carbon-link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  align-self: flex-start;
  color: var(--carbon-accent);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.carbon-link:hover {
  color: var(--carbon-ink);
}

/* Interactive codex-cli 0.172.0 base_instructions Smoking-Gun Inspector */
.forensic-inspector {
  background: var(--carbon-elev);
  border-top: 2px solid var(--carbon-stroke);
  border-bottom: 1px solid var(--carbon-rule);
  padding: clamp(20px, 3vw, 32px);
}

.inspector-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--carbon-rule);
  margin-bottom: 22px;
}

.inspector-title {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--carbon-ink);
}

.inspector-title span {
  color: var(--carbon-accent);
}

.pin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pin-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--carbon-muted);
  border: 1px solid var(--carbon-rule);
  background: var(--carbon-bg);
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}

.pin-btn:hover {
  border-color: var(--carbon-accent);
  color: var(--carbon-ink);
}

.pin-btn[aria-selected="true"] {
  background: var(--carbon-ink);
  border-color: var(--carbon-ink);
  color: var(--carbon-bg);
}

.gun-panel[hidden] {
  display: none;
}

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

.gun-col {
  padding-right: 22px;
  min-width: 0;
}

.gun-col + .gun-col {
  border-left: 1px solid var(--carbon-rule);
  padding-left: 22px;
}

.gun-col:last-child {
  padding-right: 0;
}

.gun-col-kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker-source {
  color: var(--carbon-accent);
}

.kicker-symptom {
  color: var(--carbon-caution);
}

.kicker-steer {
  color: var(--carbon-positive);
}

.gun-quote {
  margin: 0 0 10px;
  padding: 12px 14px;
  background: var(--carbon-bg);
  border-left: 3px solid var(--carbon-stroke);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.58;
  color: var(--carbon-ink);
}

.gun-quote.steer-quote {
  border-left-color: var(--carbon-positive);
}

.gun-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--carbon-muted);
}

.gun-desc code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--carbon-ink);
}

/* ==========================================================================
   ACT III · WARM XUAN PAPER (#FBF9F5) — DUMBBELL SVG, TABLE & 5-CASE LEDGER
   ========================================================================== */

.dumbbell-figure {
  margin: 0 0 36px;
  padding: 18px 0 20px;
  border-top: 1px solid var(--paper-rule-strong);
  border-bottom: 1px solid var(--paper-rule);
}

.dumbbell-caption-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dumbbell-heading {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  color: var(--paper-ink);
}

.dumbbell-key {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-muted);
}

.dumbbell-svg-wrap {
  width: 100%;
  overflow-x: auto;
}

.dumbbell-svg {
  width: 100%;
  min-width: 660px;
  height: auto;
  display: block;
}

.dumbbell-row-hit {
  cursor: pointer;
}

.dumbbell-row-hit rect.row-hover-bg {
  fill: transparent;
  transition: fill 120ms var(--ease-out);
}

.dumbbell-row-hit:hover rect.row-hover-bg,
.dumbbell-row-hit:focus-visible rect.row-hover-bg {
  fill: rgba(200, 72, 36, 0.06);
}

/* Crawl-Visible Broadsheet Tables (Rung 2 horizontal hairlines only, zero outer box) */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 42px;
}

.broadsheet-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 2px solid currentColor;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  text-align: left;
}

.broadsheet-table th {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 11px 12px;
  border-bottom: 1px solid currentColor;
  white-space: nowrap;
}

.act-paper .broadsheet-table th {
  color: var(--paper-muted);
  border-bottom-color: var(--paper-rule-strong);
}

.act-carbon .broadsheet-table {
  border-top-color: var(--carbon-rule-strong);
  border-bottom-color: var(--carbon-rule-strong);
}

.act-carbon .broadsheet-table th {
  color: var(--carbon-muted);
  border-bottom-color: var(--carbon-rule-strong);
}

.broadsheet-table td {
  padding: 12px 12px;
  vertical-align: top;
  line-height: 1.5;
}

.act-paper .broadsheet-table tbody tr + tr td {
  border-top: 1px solid var(--paper-rule);
}

.act-carbon .broadsheet-table tbody tr + tr td {
  border-top: 1px solid var(--carbon-rule);
}

.broadsheet-table th.num-col,
.broadsheet-table td.num-col {
  text-align: right;
  white-space: nowrap;
}

.broadsheet-table code {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.act-paper .broadsheet-table code {
  background: var(--paper-well);
  padding: 1px 5px;
}

.act-carbon .broadsheet-table code {
  background: var(--carbon-elev);
  color: var(--carbon-ink);
  padding: 1px 5px;
}

.verdict-win {
  color: var(--paper-positive);
  font-weight: 700;
}

.verdict-tie-badge {
  color: var(--paper-ink);
  font-weight: 700;
}

.counter-datum {
  color: var(--paper-caution);
  font-weight: 600;
}

/* Interactive clickable rows in 12-Harness table */
.harness-row {
  cursor: pointer;
  transition: background-color 120ms var(--ease-out);
}

.harness-row:hover {
  background: rgba(244, 241, 234, 0.05);
}

.harness-row.is-active {
  background: rgba(255, 153, 122, 0.10);
}

/* 5-Case Verbatim Side-by-Side Reader */
.case-reader-shell {
  border-top: 2px solid var(--paper-rule-strong);
  padding-top: 20px;
}

.reader-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--paper-rule);
}

.case-tablist {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.case-pill {
  min-height: 44px;
  min-width: 44px;
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper-muted);
  border: 1px solid var(--paper-rule);
  background: var(--paper-bg);
  transition: color 120ms var(--ease-out), border-color 120ms var(--ease-out), background-color 120ms var(--ease-out);
}

.case-pill:hover {
  border-color: var(--paper-ink);
  color: var(--paper-ink);
}

.case-pill[aria-selected="true"] {
  background: var(--paper-ink);
  border-color: var(--paper-ink);
  color: var(--paper-bg);
}

.case-pill-tag {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 1px 5px;
  border: 1px solid currentColor;
}

.redline-switch {
  display: inline-flex;
  border: 1px solid var(--paper-rule-strong);
}

.redline-btn {
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--paper-muted);
  background: var(--paper-bg);
}

.redline-btn + .redline-btn {
  border-left: 1px solid var(--paper-rule-strong);
}

.redline-btn[aria-pressed="true"] {
  background: var(--paper-ink);
  color: var(--paper-bg);
}

.case-panel[hidden] {
  display: none;
}

.case-head-title {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.2vw, 1.95rem);
  line-height: 1.24;
  color: var(--paper-ink);
}

.case-head-title code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  font-weight: 600;
  color: var(--paper-muted);
}

.case-prompt-quote {
  margin: 0 0 12px;
  padding: 8px 0 8px 16px;
  border-left: 3px solid var(--paper-vermilion);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--paper-ink);
  background: var(--paper-well);
  padding-right: 14px;
}

.case-run-meta {
  margin: 0 0 22px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--paper-muted);
}

.case-sublabel {
  margin: 24px 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--paper-muted);
}

.verbatim-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--paper-rule-strong);
  border-bottom: 1px solid var(--paper-rule);
}

.v-col {
  padding: 18px 24px 20px 0;
  min-width: 0;
}

.v-col + .v-col {
  border-left: 1px solid var(--paper-rule);
  padding: 18px 0 20px 24px;
}

.v-lane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.v-lane-builtin {
  color: var(--paper-caution);
}

.v-lane-taste {
  color: var(--paper-positive);
}

.v-col p,
.v-col ul,
.v-col ol {
  margin: 0 0 11px;
  font-size: 15px;
  line-height: 1.68;
}

.v-col ul,
.v-col ol {
  padding-left: 20px;
}

.v-col li {
  margin-bottom: 6px;
}

.v-col code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--paper-well);
  border: 1px solid var(--paper-rule);
  padding: 1px 4px;
  word-break: break-word;
}

.v-doc-heading {
  font-family: var(--font-mono);
  font-size: 13px !important;
  font-weight: 600;
  color: var(--paper-muted);
}

.v-group-reply {
  margin: 8px 0 10px;
  padding: 10px 14px;
  background: var(--paper-well);
  border-left: 2.5px solid var(--paper-rule-strong);
  font-size: 14.5px;
  line-height: 1.65;
}

/* Forensic Redline vs Clean Read Toggle */
.hl-c {
  background: var(--paper-caution-bg);
  color: var(--paper-caution);
  font-weight: 600;
  padding: 1px 3px;
}

.hl-t {
  background: var(--paper-positive-bg);
  color: var(--paper-positive);
  font-weight: 600;
  padding: 1px 3px;
}

.case-reader-shell[data-redline="off"] .hl-c,
.case-reader-shell[data-redline="off"] .hl-t {
  background: transparent;
  color: inherit;
  font-weight: inherit;
  padding: 0;
}

.v-margin-note {
  margin: 14px 0 0 !important;
  padding-top: 10px;
  border-top: 1px dashed var(--paper-rule);
  font-size: 13.5px !important;
  line-height: 1.56 !important;
  color: var(--paper-muted);
}

.diff-ledger {
  margin: 0 0 20px;
  padding: 14px 16px;
  background: var(--paper-well);
  border-top: 1px solid var(--paper-rule-strong);
  border-bottom: 1px solid var(--paper-rule);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.58;
  overflow-x: auto;
  white-space: pre;
}

.diff-del,
.diff-add,
.diff-ctx {
  display: block;
  padding: 0 4px;
}

.diff-del {
  background: var(--paper-caution-bg);
  color: var(--paper-caution);
}

.diff-add {
  background: var(--paper-positive-bg);
  color: var(--paper-positive);
}

.diff-ctx {
  color: var(--paper-muted);
}

.verbatim-policy {
  margin: 18px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--paper-muted);
}

/* ==========================================================================
   ACT IV · DEEP CARBON (#111317) — 12-HARNESS RADIAL BLUEPRINT & STEER RAIL
   ========================================================================== */

.blueprint-split {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 6fr);
  gap: 0;
  border-top: 1px solid var(--carbon-rule-strong);
  border-bottom: 1px solid var(--carbon-rule-strong);
  margin-bottom: clamp(40px, 5.5vw, 64px);
}

.blueprint-stage {
  padding: 24px 28px 24px 0;
  border-right: 1px solid var(--carbon-rule);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.blueprint-svg {
  width: 100%;
  max-width: 540px;
  height: auto;
  margin-inline: auto;
  display: block;
}

.bp-node {
  cursor: pointer;
}

.bp-node rect.bp-pill {
  fill: #181B22;
  stroke: rgba(244, 241, 234, 0.28);
  stroke-width: 1.2;
  transition: fill 140ms var(--ease-out), stroke 140ms var(--ease-out);
}

.bp-node text {
  fill: #F4F1EA;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  pointer-events: none;
}

.bp-node:hover rect.bp-pill,
.bp-node:focus-visible rect.bp-pill {
  stroke: #FF997A;
}

.bp-node.is-selected rect.bp-pill {
  fill: #F4F1EA;
  stroke: #F4F1EA;
}

.bp-node.is-selected text {
  fill: #111317;
}

.bp-spoke {
  stroke: rgba(200, 72, 36, 0.34);
  stroke-width: 1.3;
  transition: stroke 140ms var(--ease-out), stroke-width 140ms var(--ease-out);
}

.bp-spoke.is-selected {
  stroke: #C84824;
  stroke-width: 2.6;
}

.blueprint-caption {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--carbon-muted);
  text-align: center;
}

/* Right: Live Target Compiler Inspector */
.compiler-inspector {
  padding: 24px 0 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  min-width: 0;
}

.ci-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--carbon-rule);
}

.ci-name {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.5rem, 2.4vw, 2.1rem);
  color: var(--carbon-ink);
}

.ci-steer-badge {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--carbon-positive);
  border: 1px solid var(--carbon-positive);
  padding: 3px 8px;
}

.ci-meta-dl {
  margin: 0;
  display: grid;
  gap: 14px;
}

.ci-meta-row dt {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carbon-accent);
  margin-bottom: 4px;
}

.ci-meta-row dd {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.58;
  color: var(--carbon-ink);
}

.ci-meta-row dd code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--carbon-elev);
  padding: 2px 6px;
  border: 1px solid var(--carbon-rule);
}

.ci-cmd-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--carbon-elev);
  border-left: 3px solid var(--carbon-stroke);
  padding: 12px 12px 12px 14px;
}

.ci-cmd-pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  color: var(--carbon-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.ci-copy-btn {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 76px;
  padding: 0 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  background: var(--carbon-ink);
  color: var(--carbon-bg);
  transition: background-color 120ms var(--ease-snap), color 120ms var(--ease-snap);
}

.ci-copy-btn:hover {
  background: var(--carbon-accent);
  color: var(--carbon-bg);
}

.ci-copy-btn.is-copied {
  background: var(--carbon-positive);
  color: var(--carbon-bg);
}

.ci-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--carbon-muted);
}

/* Middle: Two-Layer Prefix + Event Steer Rail (B5 CSS Scroll-Driven Animation) */
.steer-architecture {
  margin-bottom: clamp(40px, 5.5vw, 60px);
  padding: clamp(22px, 3vw, 34px);
  background: var(--carbon-elev);
  border-top: 1px solid var(--carbon-rule-strong);
  border-bottom: 1px solid var(--carbon-rule);
}

.steer-arch-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.steer-arch-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  color: var(--carbon-ink);
}

.headroom-meter-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 260px;
}

.headroom-readout {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--carbon-muted);
}

.headroom-readout strong {
  color: var(--carbon-positive);
}

.headroom-track {
  height: 8px;
  background: var(--carbon-bg);
  border: 1px solid var(--carbon-rule);
  position: relative;
}

.headroom-fill {
  height: 100%;
  width: 14%;
  background: var(--carbon-positive);
}

.steer-rail-layout {
  position: relative;
  padding-left: 32px;
  display: grid;
  gap: 20px;
}

.steer-rail-track {
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--carbon-rule);
}

.steer-rail-fill {
  width: 100%;
  height: 100%;
  background: var(--carbon-stroke);
  transform-origin: top center;
}

@keyframes steer-rail-draw {
  from {
    transform: scaleY(0.08);
  }
  to {
    transform: scaleY(1);
  }
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .steer-rail-fill {
      animation: steer-rail-draw linear both;
      animation-timeline: view();
      animation-range: entry 15% cover 65%;
    }
  }
}

.steer-node {
  position: relative;
  padding: 14px 18px;
  background: var(--carbon-bg);
  border-left: 2px solid var(--carbon-rule-strong);
  transition: border-color 200ms var(--ease-out);
}

.steer-node::before {
  content: "";
  position: absolute;
  left: -28px;
  top: 18px;
  width: 10px;
  height: 10px;
  background: var(--carbon-bg);
  border: 2px solid var(--carbon-muted);
  transition: background-color 200ms var(--ease-out), border-color 200ms var(--ease-out);
}

.steer-node.is-lit {
  border-left-color: var(--carbon-positive);
}

.steer-node.is-lit::before {
  background: var(--carbon-stroke);
  border-color: var(--carbon-stroke);
}

.steer-node-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.steer-node-name {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--carbon-ink);
}

.steer-node-tag {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--carbon-accent);
}

.steer-node p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--carbon-muted);
}

/* ==========================================================================
   ACT V · WARM STONE (#F3EFE6) — 6 NUMBERED FAQ & DOUBLE-RULED COLOPHON
   ========================================================================== */

.act-stone {
  background: var(--stone-bg);
  color: var(--stone-ink);
}

.faq-list {
  border-top: 2px solid var(--paper-rule-strong);
}

.faq-item {
  border-bottom: 1px solid var(--stone-rule);
}

.faq-summary {
  list-style: none;
  min-height: 56px;
  padding: 18px 0;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 32px;
  align-items: baseline;
  gap: 12px;
  cursor: pointer;
}

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

.faq-idx {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--stone-accent-ink);
}

.faq-q {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.08rem, 1.6vw, 1.32rem);
  line-height: 1.36;
  color: var(--stone-ink);
}

.faq-marker {
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 600;
  color: var(--stone-muted);
  text-align: right;
  transition: transform 160ms var(--ease-out);
}

.faq-item[open] .faq-marker {
  transform: rotate(45deg);
  color: var(--stone-accent-ink);
}

.faq-body {
  padding: 0 32px 22px 56px;
  max-width: 74ch;
}

html[lang^="zh"] .faq-body {
  max-width: 44ic;
}

.faq-body p {
  margin: 0 0 10px;
  font-size: 15.5px;
  line-height: 1.68;
  color: var(--stone-muted);
}

.faq-body p:last-child {
  margin-bottom: 0;
}

.faq-body strong {
  color: var(--stone-ink);
  font-weight: 600;
}

.faq-body code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  background: var(--stone-well);
  padding: 1px 5px;
  border: 1px solid var(--stone-rule);
  color: var(--stone-ink);
}

.faq-body a {
  color: var(--stone-accent-ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Double-Ruled Broadsheet Colophon (3px + 3px gap + 1px) */
.colophon-wrap {
  background: var(--stone-bg);
  padding-bottom: 56px;
}

.colophon {
  border-top: 3px solid var(--paper-rule-strong);
  box-shadow: inset 0 3px 0 var(--stone-bg), inset 0 4px 0 var(--paper-rule-strong);
  padding-top: 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 28px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--stone-muted);
}

.colophon-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 16px;
}

.colophon-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--stone-ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.colophon-links a:hover {
  color: var(--stone-accent-ink);
}

.colophon-signoff {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--stone-muted);
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (980px Tablet / 640px Mobile / 375px-390px Precision)
   ========================================================================== */

@media (max-width: 980px) {
  .hero-split,
  .act-header,
  .blueprint-split {
    grid-template-columns: 1fr;
  }

  .hero-left {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--paper-rule-strong);
  }

  .hero-right {
    padding-left: 0;
  }

  .metric-triptych,
  .gun-grid {
    grid-template-columns: 1fr;
  }

  .metric-col {
    padding: 22px 0;
  }

  .metric-col + .metric-col {
    border-left: 0;
    border-top: 1px solid var(--carbon-rule);
    padding-left: 0;
  }

  .gun-col {
    padding: 16px 0;
  }

  .gun-col + .gun-col {
    border-left: 0;
    border-top: 1px solid var(--carbon-rule);
    padding-left: 0;
  }

  .blueprint-stage {
    padding-right: 0;
    border-right: 0;
    border-bottom: 1px solid var(--carbon-rule);
  }

  .compiler-inspector {
    padding-left: 0;
  }
}

@media (max-width: 720px) {
  .masthead {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .wordmark {
    font-size: 18px;
  }

  .ver-stamp,
  .masthead-nav .nav-link {
    display: none;
  }

  .masthead-nav {
    flex-wrap: nowrap;
    gap: 6px;
  }

  .lang-link,
  .gh-link {
    padding: 0 9px;
    min-width: 40px;
  }

  .verbatim-cols {
    grid-template-columns: 1fr;
  }

  .v-col {
    padding: 16px 0;
  }

  .v-col + .v-col {
    border-left: 0;
    border-top: 1px solid var(--paper-rule);
    padding: 16px 0;
  }

  .cmd-strip,
  .ci-cmd-box {
    flex-direction: column;
    align-items: stretch;
  }

  .copy-trigger,
  .ci-copy-btn {
    align-self: flex-end;
  }

  .chamber-raw,
  .chamber-taste {
    padding-inline: 12px;
  }

  .stage-top-actions {
    width: 100%;
    justify-content: space-between;
    gap: 4px;
  }

  .stage-case-btn {
    padding: 0 7px;
    font-size: 11px;
    min-width: 40px;
  }

  .replay-btn {
    padding: 0 9px;
    font-size: 11px;
    min-width: 40px;
  }

  .slop-tail-line {
    display: block;
    margin-top: 3px;
  }

  .slop-inline {
    white-space: normal;
  }

  .excision-stamp {
    white-space: normal;
    font-size: 10.5px;
  }

  .phase-buttons {
    gap: 9px;
  }

  .phase-btn {
    font-size: 11px;
    min-width: 40px;
  }

  .faq-body {
    padding: 0 0 18px 0;
  }

  .headroom-meter-wrap {
    min-width: 0;
    width: 100%;
  }
}
