/* Pick Winner — How It Works
 * ==========================================================
 *
 * PR-1: dark cinematic shell + 10 act scaffolds. Each act is a
 * full-viewport dark section with room for GSAP ScrollTrigger
 * to pin + animate in PR-2. This CSS establishes the resting
 * state and typography; motion / reveal timing lives in JS.
 *
 * Design palette locked to the site's existing cinematic
 * language (Papers + Pinsticker):
 *   ink       #0b1220
 *   ink-2     #0f1826
 *   gold      #d4af37
 *   gold-mute rgba(212,175,55, .55)
 *   text      #f0e8d5
 *   text-mute rgba(240,232,213, .68)
 *   green     #4ade80  (validation ticks)
 *   red       #ef4444  (elimination)
 */

/* ── Shell ───────────────────────────────────────────────── */

body.page-methodology--pw {
  background: #0b1220;
  color: #f0e8d5;
  font-family: Georgia, "Times New Roman", serif;
}

.pw-cine {
  width: 100%;
  overflow-x: hidden;
}

/* ── Act — every scene is a full-viewport dark stage. ────── */

.pw-cine__act {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  position: relative;
  border-bottom: 1px solid rgba(212, 175, 55, 0.08);
}

.pw-cine__inner {
  width: 100%;
  max-width: 820px;
  position: relative;
  z-index: 2;
}
.pw-cine__inner--centered { text-align: center; }

/* ── Atmosphere (title act) — subtle gold spotlights. ───── */

.pw-cine__atmosphere {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.pw-cine__glow {
  position: absolute;
  width: 60vw;
  height: 60vw;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.28;
}
.pw-cine__glow--top    { top: -20vw; left: -10vw;  background: radial-gradient(circle, rgba(212,175,55,0.6) 0%, transparent 70%); }
.pw-cine__glow--bottom { bottom: -20vw; right: -10vw; background: radial-gradient(circle, rgba(212,175,55,0.4) 0%, transparent 70%); }

/* ── Typography ──────────────────────────────────────────── */

.pw-cine__eyebrow {
  margin: 0 0 14px;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.75);
}

.pw-cine__stage {
  margin: 0 0 10px;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.6);
}

.pw-cine__title {
  margin: 0 0 22px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  color: #d4af37;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.pw-cine__title-sub {
  font-style: italic;
  font-size: clamp(16px, 2.2vw, 22px);
  color: rgba(212, 175, 55, 0.6);
  font-weight: 500;
}
.pw-cine__title-main {
  font-size: clamp(52px, 10vw, 120px);
  line-height: 1;
  letter-spacing: -0.02em;
  font-style: italic;
  text-shadow: 0 4px 30px rgba(212, 175, 55, 0.18);
}

.pw-cine__h {
  margin: 0 0 14px;
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 700;
  font-style: italic;
  font-size: clamp(34px, 5.5vw, 60px);
  line-height: 1.05;
  letter-spacing: -0.015em;
  color: #f0e8d5;
}
.pw-cine__h--sm { font-size: clamp(24px, 3vw, 34px); }

.pw-cine__deck {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(17px, 2.2vw, 22px);
  color: rgba(240, 232, 213, 0.72);
  max-width: 44ch;
  margin-inline: auto;
  line-height: 1.4;
}

.pw-cine__lede {
  margin: 0 0 32px;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: clamp(16px, 1.8vw, 19px);
  color: rgba(240, 232, 213, 0.72);
  max-width: 58ch;
  line-height: 1.55;
}

.pw-cine__scroll-hint {
  margin: 40px 0 0;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.55);
}

/* ── Act 1 · Data — source card grid + big counter ─────── */

.pw-cine__sources {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.pw-cine__sources li {
  padding: 14px 18px;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 6px;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #f0e8d5;
}

.pw-cine__counter {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 20px 28px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 10px;
}
.pw-cine__counter-val {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(48px, 6vw, 72px);
  font-weight: 800;
  color: #d4af37;
  line-height: 1;
}
.pw-cine__counter-plus {
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(24px, 3vw, 36px);
  color: #d4af37;
  font-weight: 800;
}
.pw-cine__counter-lbl {
  font-family: system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.55);
  margin-left: 12px;
}

/* ── Act 2 · Score — rating dials ────────────────────────── */

.pw-cine__dials {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
}
.pw-cine__dials li {
  position: relative;
  padding: 22px 14px 18px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 8px;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.65);
}
.pw-cine__dials li::before {
  content: attr(data-value);
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 30px;
  font-weight: 800;
  color: #d4af37;
  margin-bottom: 6px;
  letter-spacing: -0.01em;
}

/* ── Act 3 · Eliminate — horse chip grid ─────────────────── */

.pw-cine__eliminate-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  max-width: 640px;
}
.pw-cine__horse-chip {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(240, 232, 213, 0.18);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  font-family: "Playfair Display", Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  color: rgba(240, 232, 213, 0.55);
  position: relative;
}
.pw-cine__horse-chip[data-fate="promote"] {
  border-color: rgba(212, 175, 55, 0.5);
  background: rgba(212, 175, 55, 0.08);
  color: #d4af37;
}

/* Red-cross overlay — GSAP appends a <span class="pw-cine__horse-x">
 * to each eliminated chip during the Act 3 timeline. Absolutely
 * positioned so it sits on top of the horse number regardless of
 * the chip's inherited alignment. */
.pw-cine__horse-x {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: rgba(239, 68, 68, 0.75);
  font-weight: 800;
  pointer-events: none;
}

@media (max-width: 640px) {
  .pw-cine__eliminate-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ── Act 4 · Prompt — JSON block + token strip ──────────── */

.pw-cine__prompt {
  margin: 0 0 20px;
  padding: 24px;
  background: #06070d;
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 8px;
  font-family: "SF Mono", "Consolas", "Menlo", monospace;
  font-size: 13px;
  line-height: 1.55;
  color: #b8e0d2;
  overflow-x: auto;
  white-space: pre;
}

.pw-cine__token-strip {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.55);
}
.pw-cine__token-val {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 22px;
  font-weight: 800;
  color: #d4af37;
  margin-right: 10px;
  letter-spacing: -0.01em;
}

/* ── Act 5 · Claude — reasoning ol + winner reveal ─────── */

.pw-cine__reasoning {
  list-style: none;
  counter-reset: pw-reason;
  padding: 0;
  margin: 0 0 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.pw-cine__reasoning li {
  counter-increment: pw-reason;
  padding: 14px 18px 14px 60px;
  background: rgba(212, 175, 55, 0.05);
  border-left: 3px solid rgba(212, 175, 55, 0.5);
  border-radius: 0 6px 6px 0;
  font-family: Georgia, serif;
  font-size: 16px;
  color: #f0e8d5;
  position: relative;
}
.pw-cine__reasoning li::before {
  content: counter(pw-reason, decimal-leading-zero);
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: "Playfair Display", Georgia, serif;
  font-weight: 800;
  color: rgba(212, 175, 55, 0.55);
  font-size: 20px;
  font-style: italic;
}

.pw-cine__winner-reveal {
  padding: 28px 32px;
  background: linear-gradient(180deg, rgba(212,175,55,0.12) 0%, rgba(212,175,55,0.04) 100%);
  border: 1px solid rgba(212, 175, 55, 0.4);
  border-radius: 10px;
  text-align: center;
}
.pw-cine__winner-kicker {
  margin: 0 0 8px;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.8);
}
.pw-cine__winner-name {
  margin: 0 0 8px;
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(28px, 4vw, 42px);
  color: #d4af37;
  font-weight: 700;
}
.pw-cine__winner-conf {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.6);
}

/* ── Act 6 · Validate — green-tick check list + fallback ─ */

.pw-cine__checks {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pw-cine__checks li {
  padding: 12px 16px 12px 44px;
  background: rgba(74, 222, 128, 0.05);
  border: 1px solid rgba(74, 222, 128, 0.22);
  border-radius: 6px;
  font-family: Georgia, serif;
  font-size: 15px;
  color: #f0e8d5;
  position: relative;
}
.pw-cine__checks li::before {
  content: "✓";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #4ade80;
  font-weight: 800;
  font-size: 18px;
}

.pw-cine__fallback-note {
  margin: 0;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid rgba(240, 232, 213, 0.28);
  border-radius: 0 6px 6px 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 15px;
  color: rgba(240, 232, 213, 0.75);
  line-height: 1.55;
}

/* ── Act 7 · Calibrate — factors + confidence chips ────── */

.pw-cine__factors {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
}
.pw-cine__factors li {
  padding: 10px 14px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 999px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: #f0e8d5;
  text-align: center;
}

.pw-cine__conf-dial {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.pw-cine__conf-chip {
  padding: 10px 20px;
  border-radius: 999px;
  font-family: system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.pw-cine__conf-chip--high    { background: rgba(74, 222, 128, 0.16); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.4); }
.pw-cine__conf-chip--medium  { background: rgba(212, 175, 55, 0.16); color: #d4af37; border: 1px solid rgba(212, 175, 55, 0.4); }
.pw-cine__conf-chip--spec    { background: rgba(240, 232, 213, 0.06); color: rgba(240, 232, 213, 0.55); border: 1px solid rgba(240, 232, 213, 0.16); }

/* ── Act 8 · Deliver — channel fan-out ──────────────────── */

.pw-cine__channels {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.pw-cine__channels li {
  padding: 22px 20px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 8px;
  text-align: center;
  font-family: system-ui, sans-serif;
  font-size: 14px;
  color: #f0e8d5;
}

/* ── Act 9 · Verify — ledger stats grid ─────────────────── */

.pw-cine__ledger {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin: 0 0 20px;
}
.pw-cine__ledger-stat {
  padding: 22px 18px;
  background: rgba(212, 175, 55, 0.05);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 8px;
  text-align: center;
}
.pw-cine__ledger-stat--hero {
  background: rgba(212, 175, 55, 0.14);
  border-color: rgba(212, 175, 55, 0.5);
}
.pw-cine__ledger-val {
  display: block;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(36px, 5vw, 52px);
  font-weight: 800;
  color: #d4af37;
  line-height: 1;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.pw-cine__ledger-lbl {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.55);
}
.pw-cine__ledger-note {
  margin: 0;
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 12px;
  color: rgba(240, 232, 213, 0.4);
}

/* ── Act 10 · Citation — links + signoff ────────────────── */

.pw-cine__links {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 24px 0 40px;
}
.pw-cine__links a {
  font-family: "Playfair Display", Georgia, serif;
  font-style: italic;
  font-size: clamp(16px, 2vw, 20px);
  color: rgba(212, 175, 55, 0.9);
  text-decoration: none;
  border-bottom: 1px dotted rgba(212, 175, 55, 0.35);
  padding-bottom: 4px;
  align-self: center;
}
.pw-cine__links a:hover,
.pw-cine__links a:focus-visible {
  color: #d4af37;
  border-bottom-style: solid;
  outline: none;
}

.pw-cine__signoff {
  margin: 0;
  font-family: system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: rgba(240, 232, 213, 0.45);
  text-transform: uppercase;
}
.pw-cine__signoff-mark {
  color: #d4af37;
  margin-right: 8px;
}

/* ── PR-3 · Top scroll-progress bar ─────────────────────── */

.pw-cine__progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 60;
  background: rgba(212, 175, 55, 0.08);
  pointer-events: none;
}
.pw-cine__progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);        /* GSAP scrubs this 0 → 1 */
  background: linear-gradient(90deg, #d4af37 0%, #f0e8d5 100%);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.55);
}

/* ── PR-3 · Right-rail navigation ───────────────────────── */

.pw-cine__rail {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 55;
  padding: 8px 6px;
}
.pw-cine__rail-dot {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  color: rgba(240, 232, 213, 0.55);
  position: relative;
}
.pw-cine__rail-dot::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
  transition: transform 0.22s ease, background 0.22s ease;
}
.pw-cine__rail-dot:hover           { color: rgba(240, 232, 213, 0.9); }
.pw-cine__rail-dot:hover::after,
.pw-cine__rail-dot.is-active::after {
  transform: scale(1.35);
}
.pw-cine__rail-dot.is-active       { color: #d4af37; }
.pw-cine__rail-dot.is-active::after {
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.85);
}
.pw-cine__rail-lbl {
  position: absolute;
  right: 26px;
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  opacity: 0;
  pointer-events: none;
  font-family: 'Georgia', serif;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.92);
  background: rgba(11, 18, 32, 0.92);
  padding: 4px 10px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 3px;
  white-space: nowrap;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.pw-cine__rail-dot:hover .pw-cine__rail-lbl,
.pw-cine__rail-dot:focus-visible .pw-cine__rail-lbl {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* ── PR-3 · Winner-reveal integration (verdict + verify chip) ── */

.pw-cine__winner-verdict {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 14px;
  font-family: 'Georgia', serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  border-radius: 3px;
  border: 1px solid;
  font-weight: 700;
}
.pw-cine__winner-verdict--win {
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.55);
  background: rgba(74, 222, 128, 0.08);
}
.pw-cine__winner-verdict--placed {
  color: #d4af37;
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.08);
}
.pw-cine__winner-verdict--lost {
  color: rgba(240, 232, 213, 0.55);
  border-color: rgba(240, 232, 213, 0.2);
  background: rgba(240, 232, 213, 0.03);
}
.pw-cine__winner-verify {
  margin-top: 18px;
  display: flex;
  justify-content: center;
}
/* Verify chip inherits its own styling from proof/verify_chip.css.
 * We only wrap it in centering + spacing. */

/* ── Mobile trims ────────────────────────────────────────── */

@media (max-width: 640px) {
  .pw-cine__act {
    min-height: auto;   /* release the 100vh lock — mobile scroll flows */
    padding: 56px 18px;
  }
  .pw-cine__inner { max-width: 100%; }
  .pw-cine__prompt { font-size: 11.5px; padding: 18px; }
  /* Compact rail — labels hidden, dots stay usable. */
  .pw-cine__rail {
    right: 10px;
    gap: 9px;
    padding: 6px 4px;
    background: rgba(11, 18, 32, 0.55);
    border-radius: 22px;
    backdrop-filter: blur(6px);
  }
  .pw-cine__rail-dot::after { width: 7px; height: 7px; }
  .pw-cine__rail-lbl        { display: none; }
}

/* ═══════════════════════════════════════════════════════════
 * PR-4 · LIVING-LAB UPLIFT
 * The page becomes a live scientific instrument — grid backdrop,
 * streaming telemetry, per-act algorithm visualisations.
 * ═══════════════════════════════════════════════════════════ */

/* Article sits above the fixed backdrop layer. */
.pw-cine {
  position: relative;
  z-index: 2;
}

/* ── Ambient lab backdrop ────────────────────────────────── */

.pw-lab {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  overflow: hidden;
}
.pw-lab__grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right,  rgba(212,175,55,0.05) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(212,175,55,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 40%, transparent 85%);
}
.pw-lab__vignette {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center,
              transparent 0%,
              rgba(6, 10, 20, 0.55) 75%,
              rgba(6, 10, 20, 0.85) 100%);
}
.pw-lab__telemetry {
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(212, 175, 55, 0.18);
  white-space: nowrap;
  overflow: hidden;
  text-transform: uppercase;
  padding: 4px 20px;
}
.pw-lab__telemetry--top    { top: 44px; }
.pw-lab__telemetry--bottom { bottom: 44px; }
.pw-lab__telemetry span {
  display: inline-block;
  white-space: nowrap;
}
.pw-lab__pulse {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4af37;
  box-shadow: 0 0 12px rgba(212,175,55,0.6);
  animation: pwLabPulse 2.4s ease-in-out infinite;
}
.pw-lab__pulse--tl { top: 20px;    left: 20px; }
.pw-lab__pulse--tr { top: 20px;    right: 20px; animation-delay: 0.6s; }
.pw-lab__pulse--bl { bottom: 20px; left: 20px;  animation-delay: 1.2s; }
.pw-lab__pulse--br { bottom: 20px; right: 20px; animation-delay: 1.8s; }
@keyframes pwLabPulse {
  0%, 100% { opacity: 0.25; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.4); }
}

/* ── Fixed instrument HUD (top-left) ─────────────────────── */

.pw-system {
  position: fixed;
  top: 84px;
  left: 22px;
  z-index: 58;
  min-width: 240px;
  padding: 12px 14px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: rgba(240, 232, 213, 0.75);
  background: rgba(6, 10, 20, 0.72);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 4px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 4px 22px rgba(0,0,0,0.4);
}
.pw-system__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.pw-system__row--meta { color: rgba(240, 232, 213, 0.55); font-size: 10.5px; }
.pw-system__led {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 10px rgba(74, 222, 128, 0.7);
  animation: pwLedPulse 1.6s ease-in-out infinite;
}
@keyframes pwLedPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}
.pw-system__brand {
  color: #d4af37;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.pw-system__badge {
  margin-left: auto;
  padding: 2px 6px;
  font-size: 9.5px;
  letter-spacing: 0.18em;
  color: #4ade80;
  border: 1px solid rgba(74, 222, 128, 0.35);
  border-radius: 2px;
}
.pw-system__kv em {
  font-style: normal;
  color: rgba(212, 175, 55, 0.55);
  margin-right: 4px;
  letter-spacing: 0.14em;
}

/* ── Act 0 · Title instrument card ───────────────────────── */

.pw-title-instr {
  margin: 34px auto 0;
  max-width: 460px;
  padding: 16px 18px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: rgba(240, 232, 213, 0.7);
  background: rgba(6, 10, 20, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.22);
  border-radius: 4px;
  text-align: left;
}
.pw-title-instr__row {
  display: flex;
  gap: 14px;
  padding: 4px 0;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.1);
}
.pw-title-instr__row:last-child { border-bottom: 0; }
.pw-title-instr__k {
  min-width: 100px;
  color: rgba(212, 175, 55, 0.6);
  text-transform: uppercase;
}
.pw-title-instr__v {
  flex: 1;
  color: rgba(240, 232, 213, 0.9);
}

/* ── Act 1 · Data pipeline (SVG) ─────────────────────────── */

.pw-pipeline {
  margin: 36px auto 0;
  max-width: 900px;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 32px;
  align-items: center;
}
.pw-pipeline__svg {
  width: 100%;
  height: auto;
  max-height: 460px;
}
.pw-pipeline__halo {
  animation: pwCoreHalo 3.6s ease-in-out infinite;
  transform-origin: 360px 240px;
}
@keyframes pwCoreHalo {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 1;   transform: scale(1.12); }
}
.pw-pipeline__core-lbl {
  fill: #d4af37;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.2em;
}
.pw-pipeline__core-sub {
  fill: rgba(240, 232, 213, 0.6);
  font-family: 'Consolas', monospace;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pw-pipeline__source circle {
  fill: rgba(11, 18, 32, 0.9);
  stroke: rgba(240, 232, 213, 0.45);
  stroke-width: 1.2;
}
.pw-pipeline__source-particle {
  fill: #d4af37;
  filter: drop-shadow(0 0 4px rgba(212,175,55,0.7));
}
.pw-pipeline__source-line {
  stroke: rgba(212, 175, 55, 0.2);
  stroke-width: 1;
  stroke-dasharray: 3 4;
}
.pw-pipeline__legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
  font-size: 11.5px;
  color: rgba(240, 232, 213, 0.78);
}
.pw-pipeline__legend li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-left: 2px solid transparent;
  transition: border-color 0.4s ease, background 0.4s ease;
}
.pw-pipeline__legend li.is-active {
  border-left-color: #d4af37;
  background: rgba(212, 175, 55, 0.06);
}
.pw-pipeline__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(240, 232, 213, 0.3);
  flex-shrink: 0;
  transition: background 0.4s ease, box-shadow 0.4s ease;
}
.pw-pipeline__legend li.is-active .pw-pipeline__dot {
  background: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
}
.pw-pipeline__tick {
  margin-left: auto;
  font-style: normal;
  color: #d4af37;
  font-weight: 700;
  letter-spacing: 0.08em;
}

/* ── Act 2 · Rating dials (rings + sparklines) ───────────── */

.pw-dials {
  list-style: none;
  padding: 0;
  margin: 36px 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 18px;
}
.pw-dial {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px;
  background: rgba(6, 10, 20, 0.4);
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 4px;
  transition: border-color 0.4s ease, transform 0.4s ease;
}
.pw-dial:hover {
  border-color: rgba(212, 175, 55, 0.42);
  transform: translateY(-2px);
}
.pw-dial__ring {
  position: relative;
  width: 82px;
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pw-dial__ring-svg {
  position: absolute;
  inset: 0;
  transform: rotate(-90deg);
}
.pw-dial__ring-bg {
  fill: none;
  stroke: rgba(240, 232, 213, 0.08);
  stroke-width: 4;
}
.pw-dial__ring-fg {
  fill: none;
  stroke: #d4af37;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 163;             /* 2π·26 ≈ 163 */
  stroke-dashoffset: 163;
  filter: drop-shadow(0 0 3px rgba(212,175,55,0.6));
  transition: stroke-dashoffset 1.4s ease-out;
}
.pw-dial__val {
  position: relative;
  z-index: 2;
  font-family: 'Playfair Display', 'Georgia', serif;
  font-size: 22px;
  font-weight: 700;
  color: #f0e8d5;
}
.pw-dial__lbl {
  margin-top: 8px;
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.75);
}
.pw-dial__spark {
  width: 100%;
  max-width: 72px;
  height: 20px;
  margin-top: 8px;
  overflow: visible;
}
.pw-dial__spark polyline {
  fill: none;
  stroke: rgba(74, 222, 128, 0.65);
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(74,222,128,0.35));
}

/* Composition bar (stacked weights) */
.pw-comp {
  margin-top: 8px;
  padding: 16px 18px;
  background: rgba(6, 10, 20, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 4px;
}
.pw-comp__lbl {
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.65);
  margin: 0 0 10px;
}
.pw-comp__bar {
  display: flex;
  height: 26px;
  border-radius: 3px;
  overflow: hidden;
  background: rgba(240, 232, 213, 0.04);
}
.pw-comp__seg {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Consolas', monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  color: #0b1220;
  font-weight: 700;
  background: linear-gradient(180deg, #d4af37 0%, #b48923 100%);
  border-right: 1px solid rgba(11, 18, 32, 0.55);
  transition: filter 0.25s ease;
  cursor: default;
}
.pw-comp__seg:nth-child(even) { background: linear-gradient(180deg, #e8c65d 0%, #c8961e 100%); }
.pw-comp__seg:last-child      { border-right: 0; }
.pw-comp__seg:hover           { filter: brightness(1.15); }

/* ── Act 3 · Leaderboard (Live-sort visualization) ───────── */

.pw-leaderboard {
  margin: 36px 0 16px;
  padding: 18px;
  background: rgba(6, 10, 20, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 5px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
}
.pw-leaderboard__head {
  display: grid;
  grid-template-columns: 40px 1fr 2fr 1.6fr;
  gap: 12px;
  padding: 4px 8px 10px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.55);
  border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
}
.pw-leaderboard__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.pw-lb-row {
  display: grid;
  grid-template-columns: 40px 1fr 2fr 1.6fr;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px dashed rgba(240, 232, 213, 0.05);
  font-size: 12px;
  color: rgba(240, 232, 213, 0.82);
  transition: opacity 0.5s ease, filter 0.5s ease;
}
.pw-lb-row:last-child { border-bottom: 0; }
.pw-lb-num {
  color: rgba(212, 175, 55, 0.55);
  font-weight: 700;
}
.pw-lb-horse { color: #f0e8d5; }
.pw-lb-bar {
  position: relative;
  height: 22px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #f0e8d5;
  font-weight: 700;
  background: rgba(240, 232, 213, 0.04);
  border-radius: 2px;
  overflow: hidden;
}
.pw-lb-bar em {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0;
  background: linear-gradient(90deg,
              rgba(212,175,55,0.15),
              rgba(212,175,55,0.35));
  transition: width 1s ease-out;
}
.pw-lb-fate {
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-align: right;
}
.pw-lb-row[data-fate="promote"] .pw-lb-fate {
  color: #d4af37;
  font-weight: 700;
}
.pw-lb-row[data-fate="promote"] .pw-lb-bar em {
  background: linear-gradient(90deg,
              rgba(212,175,55,0.35),
              rgba(212,175,55,0.75));
  box-shadow: inset 0 0 12px rgba(212, 175, 55, 0.3);
}
.pw-lb-row[data-fate="out"] {
  opacity: 0.4;
}
.pw-lb-row[data-fate="out"] .pw-lb-fate {
  color: rgba(239, 68, 68, 0.7);
}
.pw-lb-row[data-fate="out"] .pw-lb-bar em {
  background: rgba(239, 68, 68, 0.18);
}
.pw-leaderboard__foot {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(212, 175, 55, 0.15);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pw-lb-tag {
  padding: 3px 10px;
  border-radius: 2px;
  border: 1px solid;
}
.pw-lb-tag--in   { color: #d4af37; border-color: rgba(212, 175, 55, 0.4); background: rgba(212, 175, 55, 0.06); }
.pw-lb-tag--out  { color: rgba(239, 68, 68, 0.85); border-color: rgba(239, 68, 68, 0.4); background: rgba(239, 68, 68, 0.06); }
.pw-lb-tag--time { color: rgba(240, 232, 213, 0.55); border-color: rgba(240, 232, 213, 0.2); background: rgba(240, 232, 213, 0.02); margin-left: auto; }

/* ── Act 4 · Prompt build progress ──────────────────────── */

.pw-build {
  list-style: none;
  padding: 0;
  margin: 32px 0 22px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
}
.pw-build__step {
  display: grid;
  grid-template-columns: 1fr auto 24px;
  gap: 14px;
  align-items: center;
  padding: 9px 14px;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.12);
  font-size: 11.5px;
  color: rgba(240, 232, 213, 0.85);
}
.pw-build__step:last-child { border-bottom: 0; }
.pw-build__k {
  color: rgba(212, 175, 55, 0.72);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pw-build__v em {
  font-style: normal;
  font-weight: 700;
  color: #f0e8d5;
}
.pw-build__tick {
  color: #4ade80;
  font-size: 14px;
  text-align: center;
}
.pw-build__tick--gold { color: #d4af37; font-size: 16px; }
.pw-build__step--total {
  margin-top: 6px;
  padding-top: 12px;
  border-top: 1px solid rgba(212, 175, 55, 0.28);
  border-bottom: 0;
}
.pw-build__step--total .pw-build__k   { color: #d4af37; }
.pw-build__step--total .pw-build__v em { font-size: 15px; }

.pw-cache {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  padding: 6px 12px;
  font-family: 'Consolas', monospace;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: rgba(240, 232, 213, 0.75);
  border: 1px solid rgba(74, 222, 128, 0.32);
  border-radius: 3px;
  background: rgba(74, 222, 128, 0.05);
}
.pw-cache__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.7);
  animation: pwLedPulse 1.6s ease-in-out infinite;
}
.pw-cache__k { color: rgba(212, 175, 55, 0.7); text-transform: uppercase; }
.pw-cache__v { color: #4ade80; font-weight: 700; }

/* ── Act 5 · Brain / neural-net + chat stream ───────────── */

.pw-brain {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 32px;
  margin: 40px 0 24px;
  align-items: stretch;
}
.pw-brain__viz {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  padding: 22px;
  background: rgba(6, 10, 20, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 5px;
}
.pw-brain__svg {
  width: 100%;
  max-width: 320px;
  height: auto;
}
.pw-brain__edge {
  stroke: rgba(240, 232, 213, 0.16);
  stroke-width: 1;
  stroke-dasharray: 2 3;
  transition: stroke 0.6s ease, stroke-width 0.6s ease, stroke-dasharray 0.6s ease;
}
.pw-brain__edge.is-active {
  stroke: rgba(212, 175, 55, 0.75);
  stroke-width: 2.5;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.55));
}
.pw-brain__node circle:nth-child(2) {
  fill: rgba(11, 18, 32, 0.95);
  stroke: rgba(240, 232, 213, 0.35);
  stroke-width: 1.5;
  transition: stroke 0.6s ease;
}
.pw-brain__node text {
  fill: #f0e8d5;
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
}
.pw-brain__halo {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.pw-brain__node.is-winner .pw-brain__halo { opacity: 1; }
.pw-brain__node.is-winner circle:nth-child(2) {
  stroke: #d4af37;
  stroke-width: 2.5;
}
.pw-brain__node.is-winner text { fill: #d4af37; }
.pw-brain__node.is-loser  { opacity: 0.35; }
.pw-brain__legend {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px;
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: rgba(240, 232, 213, 0.65);
}
.pw-brain__legend li { display: flex; align-items: center; gap: 8px; }
.pw-brain__legend span {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(240, 232, 213, 0.35);
}
.pw-brain__legend span[data-node="A"] { background: #d4af37; box-shadow: 0 0 6px rgba(212,175,55,0.55); }

.pw-brain__stream {
  padding: 18px;
  background: rgba(6, 10, 20, 0.65);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 5px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
  display: flex;
  flex-direction: column;
  min-height: 260px;
}
.pw-brain__stream-head {
  margin: 0 0 14px;
  padding-bottom: 10px;
  font-size: 10.5px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.72);
  border-bottom: 1px dashed rgba(212, 175, 55, 0.2);
}
.pw-brain__msgs {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 12.5px;
  line-height: 1.5;
  color: rgba(240, 232, 213, 0.9);
}
.pw-brain__msgs li {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 6px 0;
  border-left: 2px solid transparent;
  padding-left: 10px;
}
.pw-brain__msgs li.is-typed { border-left-color: rgba(212, 175, 55, 0.4); }
.pw-brain__msg-t {
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(212, 175, 55, 0.55);
  align-self: start;
  padding-top: 3px;
}
.pw-brain__msg-txt b {
  color: #d4af37;
  font-weight: 700;
}
.pw-brain__msg--commit {
  margin-top: 4px;
  padding: 10px 12px !important;
  background: rgba(212, 175, 55, 0.08);
  border-left-color: #d4af37 !important;
  border-radius: 3px;
}
.pw-brain__msg--commit .pw-brain__msg-txt {
  color: #f0e8d5;
  font-weight: 700;
}

/* ── Act 6 · Terminal validation ────────────────────────── */

.pw-terminal {
  margin: 32px 0 22px;
  background: rgba(6, 10, 20, 0.85);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-radius: 5px;
  font-family: 'Consolas', 'SF Mono', 'Monaco', monospace;
  overflow: hidden;
}
.pw-terminal__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(11, 18, 32, 0.95);
  border-bottom: 1px solid rgba(212, 175, 55, 0.18);
}
.pw-terminal__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(240, 232, 213, 0.25);
}
.pw-terminal__dot:nth-child(1) { background: rgba(239, 68, 68, 0.6); }
.pw-terminal__dot:nth-child(2) { background: rgba(212, 175, 55, 0.6); }
.pw-terminal__dot:nth-child(3) { background: rgba(74, 222, 128, 0.6); }
.pw-terminal__ttl {
  margin-left: 14px;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(240, 232, 213, 0.7);
}
.pw-terminal__body {
  list-style: none;
  padding: 18px 20px;
  margin: 0;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(240, 232, 213, 0.85);
}
.pw-terminal__body li {
  display: flex;
  gap: 6px;
  align-items: baseline;
  white-space: nowrap;
  overflow: hidden;
}
.pw-t-time { color: rgba(212, 175, 55, 0.55); flex-shrink: 0; }
.pw-t-run  { color: rgba(240, 232, 213, 0.9); flex-shrink: 0; }
.pw-t-dots {
  color: rgba(240, 232, 213, 0.25);
  overflow: hidden;
  text-overflow: clip;
  flex: 1;
  min-width: 20px;
}
.pw-t-status {
  flex-shrink: 0;
  font-weight: 700;
  letter-spacing: 0.1em;
}
.pw-t-status--ok    { color: rgba(240, 232, 213, 0.7); }
.pw-t-status--pass  { color: #4ade80; }
.pw-t-status--emit  { color: #d4af37; }
.pw-terminal__foot {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(212, 175, 55, 0.2);
}

/* ── Act 7 · Confidence needle-gauge ────────────────────── */

.pw-gauge {
  margin: 36px 0 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 22px;
  background: rgba(6, 10, 20, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 5px;
}
.pw-gauge__svg {
  width: 100%;
  max-width: 360px;
  height: auto;
}
.pw-gauge__needle {
  transform-origin: 160px 170px;
  transition: transform 1.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.55));
}
.pw-gauge__tick {
  fill: rgba(240, 232, 213, 0.7);
  font-family: 'Consolas', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.pw-gauge__readout {
  font-family: 'Consolas', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 232, 213, 0.7);
  margin: 0;
}
.pw-gauge__val {
  color: #d4af37;
  font-family: 'Playfair Display', serif;
  font-style: italic;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.06em;
  margin-left: 6px;
}

/* ── Act 8 · Emission wires ──────────────────────────────── */

.pw-wires {
  margin: 32px 0 20px;
  padding: 22px;
  background: rgba(6, 10, 20, 0.5);
  border: 1px solid rgba(212, 175, 55, 0.16);
  border-radius: 5px;
}
.pw-wires__svg { width: 100%; height: auto; max-height: 340px; }
.pw-wires__pick { fill: rgba(11, 18, 32, 0.95); stroke: #d4af37; stroke-width: 2; }
.pw-wires__pick-halo {
  animation: pwCoreHalo 3s ease-in-out infinite;
  transform-origin: 360px 60px;
}
.pw-wires__pick-lbl {
  fill: #d4af37;
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.22em;
}
.pw-wires__wire {
  fill: none;
  stroke: rgba(212, 175, 55, 0.22);
  stroke-width: 1.2;
  stroke-dasharray: 3 4;
}
.pw-wires__terminal circle {
  fill: rgba(11, 18, 32, 0.95);
  stroke: rgba(240, 232, 213, 0.6);
  stroke-width: 1.5;
}
.pw-wires__terminal.is-lit circle {
  stroke: #d4af37;
  fill: rgba(212, 175, 55, 0.15);
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.55));
}
.pw-wires__terminal text {
  fill: rgba(240, 232, 213, 0.75);
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  letter-spacing: 0.1em;
}
.pw-wires__pulse {
  fill: #d4af37;
  filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.7));
}

/* ── Act 9 · Merkle tree ────────────────────────────────── */

.pw-merkle {
  margin: 32px 0 24px;
  padding: 22px;
  background: rgba(6, 10, 20, 0.55);
  border: 1px solid rgba(212, 175, 55, 0.18);
  border-radius: 5px;
}
.pw-merkle__svg { width: 100%; height: auto; max-height: 280px; }
.pw-merkle__root rect {
  fill: rgba(212, 175, 55, 0.12);
  stroke: #d4af37;
  stroke-width: 1.5;
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.35));
}
.pw-merkle__node rect {
  fill: rgba(11, 18, 32, 0.9);
  stroke: rgba(212, 175, 55, 0.5);
  stroke-width: 1.2;
}
.pw-merkle__leaf rect {
  fill: rgba(11, 18, 32, 0.7);
  stroke: rgba(240, 232, 213, 0.35);
  stroke-width: 1;
}
.pw-merkle__lbl {
  fill: rgba(212, 175, 55, 0.75);
  font-family: 'Consolas', monospace;
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.pw-merkle__hash {
  fill: #f0e8d5;
  font-family: 'Consolas', monospace;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.pw-merkle__edge {
  stroke: rgba(212, 175, 55, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 3 3;
  opacity: 0;
  transition: opacity 0.6s ease;
}
.pw-merkle__edge.is-active { opacity: 1; stroke-dasharray: none; }

/* ═══════════════════════════════════════════════════════════
 * PR-5 · CONTINUOUS MOTION LAYER
 * Idle animations that keep every section feeling alive after
 * the initial scroll-reveal has settled. Every keyframe respects
 * prefers-reduced-motion via a global @media block below.
 * ═══════════════════════════════════════════════════════════ */

/* Act 1 · Core hex — soft pulse (breathing effect) */
.pw-pipeline__core {
  animation: pwCoreBreath 4.2s ease-in-out infinite;
  transform-origin: 360px 240px;
}
@keyframes pwCoreBreath {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.35)); }
  50%      { filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.75)); }
}

/* Act 2 · Dial ring — slow shimmer sweep */
.pw-dial__ring::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
              transparent 0deg,
              rgba(212, 175, 55, 0.15) 20deg,
              transparent 40deg,
              transparent 360deg);
  animation: pwDialShimmer 6s linear infinite;
  pointer-events: none;
  opacity: 0.7;
}
@keyframes pwDialShimmer {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Act 2 · Composition bar — light sweep */
.pw-comp__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg,
              transparent 0%,
              rgba(255, 255, 255, 0.14) 50%,
              transparent 100%);
  transform: translateX(-100%);
  animation: pwCompSweep 5s ease-in-out infinite;
  pointer-events: none;
}
.pw-comp__bar { position: relative; }
@keyframes pwCompSweep {
  0%   { transform: translateX(-100%); }
  55%, 100% { transform: translateX(100%); }
}

/* Act 3 · Leaderboard — top row (winner) breathes */
.pw-lb-row[data-fate="promote"]:first-child .pw-lb-bar em {
  animation: pwLbTopPulse 3.6s ease-in-out infinite;
}
@keyframes pwLbTopPulse {
  0%, 100% { box-shadow: inset 0 0 10px rgba(212, 175, 55, 0.2); }
  50%      { box-shadow: inset 0 0 22px rgba(212, 175, 55, 0.55); }
}

/* Act 4 · Cache pill — running text sub-line + build tick pulse */
.pw-build__step--total .pw-build__v em {
  animation: pwTotalPulse 2.4s ease-in-out infinite;
}
@keyframes pwTotalPulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.55; }
}
.pw-build__step--total .pw-build__tick {
  animation: pwGoldSpin 6s linear infinite;
  display: inline-block;
}
@keyframes pwGoldSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* Act 5 · Brain winner node — pulsing halo (only after resolve) */
.pw-brain__node.is-winner .pw-brain__halo {
  animation: pwWinnerHalo 2.4s ease-in-out infinite;
  transform-origin: center;
}
@keyframes pwWinnerHalo {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50%      { opacity: 1;    transform: scale(1.18); }
}
.pw-brain__node.is-winner circle:nth-child(2) {
  animation: pwWinnerStroke 2.4s ease-in-out infinite;
}
@keyframes pwWinnerStroke {
  0%, 100% { stroke-width: 2.5; }
  50%      { stroke-width: 3.5; }
}
/* Act 5 · Brain edges — subtle idle shimmer even at rest */
.pw-brain__edge {
  animation: pwEdgeIdle 5.5s ease-in-out infinite;
}
@keyframes pwEdgeIdle {
  0%, 100% { opacity: 0.7; }
  50%      { opacity: 1; }
}
.pw-brain__edge.is-active {
  animation: pwEdgeActive 2.6s ease-in-out infinite;
}
@keyframes pwEdgeActive {
  0%, 100% { stroke-width: 2.2; filter: drop-shadow(0 0 3px rgba(212, 175, 55, 0.4)); }
  50%      { stroke-width: 3.2; filter: drop-shadow(0 0 8px rgba(212, 175, 55, 0.8)); }
}
/* Act 5 · Chat cursor — blinking caret on the commit message */
.pw-brain__msg--commit .pw-brain__msg-txt::after {
  content: '▊';
  color: #d4af37;
  margin-left: 4px;
  animation: pwCaret 1s steps(2, end) infinite;
}
@keyframes pwCaret {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* Act 6 · Terminal — persistent blinking cursor on last line */
.pw-terminal__body::after {
  content: '▊';
  display: block;
  color: #4ade80;
  font-family: 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.9;
  margin-top: 4px;
  animation: pwCaret 1s steps(2, end) infinite;
}

/* Act 7 · Gauge needle — micro-wobble idle after settle */
.pw-gauge__needle {
  animation: pwNeedleIdle 3.4s ease-in-out infinite;
  animation-delay: 4s;    /* wait for GSAP swing to finish */
}
@keyframes pwNeedleIdle {
  0%, 100% { transform: translate(160px, 170px) rotate(-3deg); }
  50%      { transform: translate(160px, 170px) rotate(3deg); }
}
/* Readout digit-shift — subtle "recalibrating" effect */
.pw-gauge__val::after {
  content: '';
  display: inline-block;
  width: 4px;
  height: 12px;
  margin-left: 6px;
  background: #d4af37;
  vertical-align: middle;
  animation: pwCaret 1.2s steps(2, end) infinite;
}

/* Act 8 · PICK node — outer ring pulse (always on) */
.pw-wires__pick {
  animation: pwPickPulse 2.8s ease-in-out infinite;
  transform-origin: 360px 60px;
}
@keyframes pwPickPulse {
  0%, 100% { stroke-width: 2; filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.5)); }
  50%      { stroke-width: 3; filter: drop-shadow(0 0 12px rgba(212, 175, 55, 0.85)); }
}

/* Act 9 · Merkle root — persistent glow pulse */
.pw-merkle__root rect {
  animation: pwRootGlow 3.2s ease-in-out infinite;
}
@keyframes pwRootGlow {
  0%, 100% { filter: drop-shadow(0 0 4px rgba(212, 175, 55, 0.35)); stroke-width: 1.5; }
  50%      { filter: drop-shadow(0 0 14px rgba(212, 175, 55, 0.8));  stroke-width: 2.2; }
}
/* Act 9 · Merkle edges — subtle flow direction */
.pw-merkle__edge.is-active {
  stroke-dasharray: 4 4 !important;
  animation: pwMerkleFlow 1.6s linear infinite;
}
@keyframes pwMerkleFlow {
  from { stroke-dashoffset: 0; }
  to   { stroke-dashoffset: -16; }
}
/* Act 9 · Leaves — tick indicator */
.pw-merkle__leaf rect {
  animation: pwLeafBreath 4s ease-in-out infinite;
}
.pw-merkle__leaf:nth-child(1n) rect { animation-delay: 0s; }
.pw-merkle__leaf:nth-child(2n) rect { animation-delay: 0.6s; }
.pw-merkle__leaf:nth-child(3n) rect { animation-delay: 1.2s; }
.pw-merkle__leaf:nth-child(4n) rect { animation-delay: 1.8s; }
@keyframes pwLeafBreath {
  0%, 100% { stroke: rgba(240, 232, 213, 0.35); }
  50%      { stroke: rgba(212, 175, 55, 0.6); }
}

/* Act 9 · Ledger hero stat — pulse ring behind it */
.pw-cine__ledger-stat--hero {
  position: relative;
}
.pw-cine__ledger-stat--hero::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 6px;
  animation: pwHeroRing 2.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes pwHeroRing {
  0%, 100% { opacity: 0.35; transform: scale(1); }
  50%      { opacity: 0.85; transform: scale(1.05); }
}

/* Global · title stage indicator — dot pulse */
.pw-cine__stage {
  position: relative;
  padding-left: 18px;
}
.pw-cine__stage::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #d4af37;
  box-shadow: 0 0 8px rgba(212, 175, 55, 0.7);
  animation: pwStageDot 1.8s ease-in-out infinite;
}
@keyframes pwStageDot {
  0%, 100% { opacity: 1;    transform: translateY(-50%) scale(1); }
  50%      { opacity: 0.35; transform: translateY(-50%) scale(0.7); }
}

/* Respect reduced-motion — halt every idle keyframe */
@media (prefers-reduced-motion: reduce) {
  .pw-pipeline__core, .pw-dial__ring::after, .pw-comp__bar::after,
  .pw-lb-row[data-fate="promote"]:first-child .pw-lb-bar em,
  .pw-build__step--total .pw-build__v em,
  .pw-build__step--total .pw-build__tick,
  .pw-brain__node.is-winner .pw-brain__halo,
  .pw-brain__node.is-winner circle:nth-child(2),
  .pw-brain__edge, .pw-brain__edge.is-active,
  .pw-brain__msg--commit .pw-brain__msg-txt::after,
  .pw-terminal__body::after,
  .pw-gauge__needle, .pw-gauge__val::after,
  .pw-wires__pick,
  .pw-merkle__root rect, .pw-merkle__edge.is-active, .pw-merkle__leaf rect,
  .pw-cine__ledger-stat--hero::after,
  .pw-cine__stage::before
  { animation: none !important; }
}

/* ── Living-lab mobile trims ─────────────────────────────── */

@media (max-width: 900px) {
  .pw-pipeline { grid-template-columns: 1fr; gap: 18px; }
  .pw-pipeline__legend { max-width: 480px; margin: 0 auto; }
  .pw-brain    { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 640px) {
  .pw-system { display: none; }           /* HUD hidden — too much fixed chrome on phones */
  .pw-lab__telemetry { font-size: 9px; }
  .pw-title-instr    { font-size: 10.5px; padding: 12px 14px; }
  .pw-title-instr__k { min-width: 76px; }
  .pw-leaderboard__head,
  .pw-lb-row { grid-template-columns: 26px 1fr 1.4fr 1fr; font-size: 10.5px; }
  .pw-lb-fate { font-size: 9px; }
  .pw-terminal__body li { font-size: 10.5px; white-space: normal; }
  .pw-t-dots { display: none; }
  .pw-brain__msgs li { grid-template-columns: 42px 1fr; font-size: 11.5px; }
  .pw-brain__msg-t   { font-size: 9.5px; }
  .pw-dials { grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 10px; }
  .pw-dial  { padding: 12px 8px; }
  .pw-dial__ring { width: 66px; height: 66px; }
  .pw-dial__val  { font-size: 18px; }
}
