/* ==========================================================================
   THE LOST CARAVAGGIO — CASE FILE 1969
   Tenebrist Chiaroscuro + 1980s Archival Cold-Case Visual System
   ========================================================================== */

:root {
  /* Tenebrism (Dark Gallery) Palette */
  --bg-obsidian: #0B0908;
  --bg-umber: #14110F;
  --bg-charcoal: #1C1815;
  --bg-elevated: #231E1A;

  /* Archival Parchment (Daylight Dossier) Palette */
  --paper-light: #F3EFE6;
  --paper-mid: #EAE4D7;
  --paper-dark: #DDD5C4;
  --ink-dark: #191B1C;
  --ink-mid: #4A4E50;
  --ink-soft: #757772;

  /* Chiaroscuro & Signal Accents */
  --gold-candle: #D4A359;
  --gold-bright: #EBC886;
  --crimson: #B8291E;
  --crimson-bright: #D93B2E;
  --steel: #2C4C64;

  /* Text on Dark */
  --text-ivory: #EFE9DD;
  --text-stone: #B8B0A2;
  --text-muted: #827A6E;

  /* Borders */
  --rule-dark-subtle: rgba(239, 233, 221, 0.12);
  --rule-dark-strong: rgba(239, 233, 221, 0.24);
  --rule-paper: #C8C1B2;

  /* Typography */
  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --max-w: 1220px;
  --nav-h: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background-color: var(--bg-obsidian);
  color: var(--text-ivory);
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-obsidian);
  color: var(--text-ivory);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background-color: var(--crimson);
  color: var(--paper-light);
}

a {
  color: inherit;
}

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

/* ==========================================================================
   SCROLL PROGRESS & FLOATING ARCHIVAL TOP BAR
   ========================================================================== */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0%;
  background: linear-gradient(90deg, var(--crimson), var(--gold-candle));
  z-index: 1200;
  transition: width 0.08s linear;
}

.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: rgba(11, 9, 8, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule-dark-subtle);
  transition: background 0.3s ease, border-color 0.3s ease;
}

.top-bar-inner {
  max-width: 1360px;
  height: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--text-ivory);
  flex-shrink: 0;
}

.brand-emblem {
  width: 30px;
  height: 30px;
  color: var(--text-ivory);
}

.brand-emblem .reticle-group {
  transform-origin: 20px 20px;
  transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.brand-link:hover .brand-emblem .reticle-group {
  transform: rotate(90deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-name {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--gold-candle);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 2px;
}

.chapter-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.chap-link {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  padding: 0.38rem 0.65rem;
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.chap-link .chap-num {
  color: var(--gold-candle);
  opacity: 0.6;
}

.chap-link:hover,
.chap-link.active {
  color: var(--text-ivory);
  border-bottom-color: var(--crimson-bright);
}

.chap-link.active .chap-num {
  opacity: 1;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.75rem;
  background: rgba(239, 233, 221, 0.05);
  border: 1px solid var(--rule-dark-strong);
  color: var(--text-stone);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.sound-toggle:hover {
  border-color: var(--gold-candle);
  color: var(--text-ivory);
}

.sound-toggle.is-on {
  border-color: var(--gold-candle);
  background: rgba(212, 163, 89, 0.14);
  color: var(--gold-bright);
}

.sound-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.sound-toggle.is-on .sound-dot {
  background: var(--gold-bright);
  box-shadow: 0 0 8px var(--gold-candle);
}

.essay-link {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-stone);
  text-decoration: none;
  padding: 0.38rem 0.6rem;
  border: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.essay-link:hover {
  color: var(--text-ivory);
  border-color: var(--rule-dark-subtle);
}

/* ==========================================================================
   SHARED LAYOUT & REVEAL ANIMATION
   ========================================================================== */
.section-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
  z-index: 2;
}

.chapter-section {
  padding: 6.5rem 0;
  position: relative;
  border-top: 1px solid var(--rule-dark-subtle);
}

.chapter-header {
  max-width: 760px;
  margin-bottom: 3rem;
}

.chapter-kicker {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-candle);
  margin-bottom: 0.8rem;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.chapter-kicker::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: var(--crimson-bright);
}

.chapter-title {
  font-family: var(--font-serif);
  font-size: clamp(2.25rem, 4.2vw, 3.5rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 1.15rem;
}

.chapter-intro {
  font-size: 1.05rem;
  line-height: 1.75;
  color: var(--text-stone);
}

.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s cubic-bezier(0.22, 1, 0.36, 1), transform 0.75s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   ACT 00: PROLOGUE HERO — PALERMO OCTOBER 1969
   ========================================================================== */
.hero-section {
  min-height: 100vh;
  padding: calc(var(--nav-h) + 3.25rem) 0 4.5rem;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    radial-gradient(ellipse 65% 55% at 72% 45%, rgba(212, 163, 89, 0.11), transparent 70%),
    radial-gradient(ellipse 50% 60% at 15% 80%, rgba(184, 41, 30, 0.08), transparent 70%),
    var(--bg-obsidian);
  overflow: hidden;
}

.rain-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.45;
}

.hero-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background: radial-gradient(circle at 50% 50%, transparent 45%, rgba(7, 5, 4, 0.85) 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(320px, 0.88fr);
  gap: 4rem;
  align-items: center;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.8rem, 5.2vw, 4.6rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--text-ivory);
  margin-bottom: 1.65rem;
}

.title-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--crimson-bright);
  margin-bottom: 0.75rem;
}

.hero-title em {
  font-style: italic;
  color: var(--gold-candle);
  font-weight: 400;
}

.hero-lead {
  font-size: 1.08rem;
  line-height: 1.78;
  color: var(--text-stone);
  max-width: 58ch;
  margin-bottom: 0.9rem;
}

.hero-sublead {
  font-family: var(--font-serif);
  font-size: 1.45rem;
  font-style: italic;
  color: var(--text-ivory);
  margin-bottom: 2rem;
}

.telemetry-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--rule-dark-strong);
  border-bottom: 1px solid var(--rule-dark-subtle);
  margin-bottom: 2.2rem;
}

.telemetry-cell {
  padding: 0.95rem 0.85rem 0.95rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.telemetry-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.telemetry-value {
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-ivory);
}

.telemetry-value.accent {
  color: var(--crimson-bright);
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.9rem 1.55rem;
  background: var(--crimson);
  color: var(--paper-light);
  text-decoration: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid var(--crimson-bright);
  transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary:hover {
  background: var(--crimson-bright);
  transform: translateY(-1px);
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.25rem;
  background: transparent;
  color: var(--gold-bright);
  border: 1px solid rgba(212, 163, 89, 0.38);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.btn-ghost:hover {
  background: rgba(212, 163, 89, 0.12);
  border-color: var(--gold-bright);
}

/* Interactive Hero Altar Stage */
.altar-frame-card {
  background: var(--bg-umber);
  border: 1px solid var(--rule-dark-strong);
  padding: 0.85rem;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.75);
}

.altar-stage {
  position: relative;
  width: min(100%, calc(68vh * 1022 / 1536));
  aspect-ratio: 1022 / 1536;
  margin: 0 auto;
  overflow: hidden;
  background: #0d0b0a;
}

.altar-base-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.86) contrast(1.06) saturate(0.92);
  transition: filter 0.6s ease;
}

.altar-stage[data-state="empty"] .altar-base-img {
  filter: brightness(0.95) contrast(1.08) saturate(0.85);
}

/* Exact measured pixel geometry of the black altar frame in empty-frame-palermo.jpg */
.altar-painting-slot {
  position: absolute;
  left: 38.2%;
  top: 39.8%;
  width: 23.2%;
  height: 19.3%;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 0.85s cubic-bezier(0.22, 1, 0.36, 1), clip-path 0.85s cubic-bezier(0.22, 1, 0.36, 1), filter 0.6s ease;
  clip-path: inset(0% 0% 0% 0%);
  opacity: 1;
}

.altar-painting-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: brightness(0.92) contrast(1.05) sepia(0.08);
}

.altar-painting-shadow {
  position: absolute;
  inset: 0;
  box-shadow: inset 0 6px 14px rgba(0, 0, 0, 0.75), inset 0 0 8px rgba(0, 0, 0, 0.55);
}

.altar-scanline {
  position: absolute;
  left: 0;
  right: 0;
  top: -15%;
  height: 14%;
  background: linear-gradient(180deg, transparent, rgba(212, 163, 89, 0.75), transparent);
  opacity: 0;
  pointer-events: none;
}

/* Altar States */
.altar-stage[data-state="empty"] .altar-painting-slot {
  clip-path: inset(0% 0% 100% 0%);
  opacity: 0;
}

.altar-stage[data-state="replica"] .altar-painting-slot {
  opacity: 0.98;
  filter: saturate(1.12) brightness(1.08);
}

.altar-stage[data-state="replica"] .altar-scanline {
  animation: scanSweep 1.3s ease-out forwards;
}

@keyframes scanSweep {
  0% { top: -15%; opacity: 0.95; }
  85% { opacity: 0.9; }
  100% { top: 105%; opacity: 0; }
}

.altar-caption-tag {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.35rem 0.65rem;
  background: rgba(11, 9, 8, 0.84);
  border: 1px solid rgba(212, 163, 89, 0.35);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  backdrop-filter: blur(6px);
}

.altar-state-controls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.state-pill {
  background: rgba(239, 233, 221, 0.04);
  border: 1px solid var(--rule-dark-subtle);
  padding: 0.55rem 0.4rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  color: var(--text-muted);
  transition: all 0.2s ease;
}

.state-pill .pill-year {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
}

.state-pill .pill-name {
  font-size: 0.72rem;
}

.state-pill:hover {
  border-color: var(--rule-dark-strong);
  color: var(--text-ivory);
}

.state-pill.active {
  background: rgba(184, 41, 30, 0.22);
  border-color: var(--crimson-bright);
  color: var(--text-ivory);
}

.state-pill.active .pill-year {
  color: var(--gold-bright);
}

.scroll-cue {
  position: absolute;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  z-index: 3;
}

.scroll-cue-line {
  width: 1px;
  height: 24px;
  background: linear-gradient(180deg, var(--gold-candle), transparent);
}

/* ==========================================================================
   ACT 01: CHIAROSCURO CANVAS INSPECTOR
   ========================================================================== */
.chapter-dark {
  background:
    radial-gradient(ellipse 80% 50% at 30% 10%, rgba(212, 163, 89, 0.06), transparent 65%),
    var(--bg-umber);
}

.inspector-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--rule-dark-subtle);
}

.mode-switch {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.58rem 1rem;
  background: rgba(239, 233, 221, 0.04);
  border: 1px solid var(--rule-dark-subtle);
  color: var(--text-stone);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: var(--gold-candle);
  color: var(--text-ivory);
}

.mode-btn.active {
  background: rgba(212, 163, 89, 0.16);
  border-color: var(--gold-candle);
  color: var(--gold-bright);
}

.inspector-progress {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.progress-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.progress-counter {
  color: var(--gold-bright);
  font-weight: 600;
}

.progress-bar-track {
  width: 110px;
  height: 4px;
  background: rgba(239, 233, 221, 0.12);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--crimson-bright), var(--gold-candle));
  transition: width 0.35s ease;
}

.inspector-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(320px, 0.78fr);
  gap: 2.5rem;
  align-items: start;
}

.painting-stage-wrap {
  position: relative;
  background: #080706;
  padding: 1rem;
  border: 1px solid var(--rule-dark-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.65);
}

.painting-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1166 / 1536;
  overflow: hidden;
  user-select: none;
  cursor: crosshair;
  background: #050404;
}

.painting-img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: filter 0.45s ease;
}

/* Torchlight mask using CSS variables updated smoothly in JS */
.torch-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    circle 195px at var(--mx, 39%) var(--my, 24%),
    rgba(255, 225, 165, 0.05) 0%,
    rgba(12, 9, 7, 0.18) 38%,
    rgba(8, 6, 5, 0.84) 72%,
    rgba(5, 4, 3, 0.96) 100%
  );
  transition: opacity 0.55s ease;
}

.painting-stage-wrap[data-mode="gallery"] .torch-overlay,
.painting-stage-wrap[data-mode="scale"] .torch-overlay {
  opacity: 0;
}

.painting-stage-wrap[data-mode="gallery"] .painting-img {
  filter: brightness(1.08) contrast(1.04);
}

.painting-stage-wrap[data-mode="scale"] .painting-img {
  filter: brightness(0.75) saturate(0.85);
}

.torch-hint {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  padding: 0.4rem 0.85rem;
  background: rgba(11, 9, 8, 0.82);
  border: 1px solid rgba(212, 163, 89, 0.35);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--gold-bright);
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.torch-hint.hidden,
.painting-stage-wrap:not([data-mode="torch"]) .torch-hint {
  opacity: 0;
}

/* Scale Overlay (268 x 197 cm + 175 cm human silhouette) */
.scale-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.45s ease;
  border: 1px dashed rgba(212, 163, 89, 0.65);
}

.painting-stage-wrap[data-mode="scale"] .scale-overlay {
  opacity: 1;
}

.scale-dim-vertical {
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 0;
  border-left: 1px solid var(--gold-bright);
  display: flex;
  align-items: center;
}

.scale-dim-vertical span {
  background: rgba(11, 9, 8, 0.9);
  border: 1px solid var(--gold-candle);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.25rem 0.55rem;
  margin-left: 8px;
  white-space: nowrap;
}

.scale-dim-horizontal {
  position: absolute;
  top: 14px;
  left: 0;
  right: 0;
  border-top: 1px solid var(--gold-bright);
  display: flex;
  justify-content: center;
}

.scale-dim-horizontal span {
  background: rgba(11, 9, 8, 0.9);
  border: 1px solid var(--gold-candle);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  margin-top: 8px;
}

/* 175cm / 268cm = 65.3% of painting height! */
.scale-human {
  position: absolute;
  right: 6%;
  bottom: 0;
  height: 65.3%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
}

.scale-human svg {
  height: 100%;
  width: auto;
  filter: drop-shadow(0 0 12px rgba(0, 0, 0, 0.9));
}

.scale-human-label {
  position: absolute;
  top: -1.6rem;
  right: 0;
  background: var(--crimson);
  color: var(--paper-light);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  padding: 0.18rem 0.45rem;
  white-space: nowrap;
}

/* 7 Canvas Hotspots */
.hotspot {
  position: absolute;
  transform: translate(-50%, -50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(11, 9, 8, 0.76);
  border: 1.5px solid var(--gold-candle);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.hotspot-num {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  position: relative;
  z-index: 2;
}

.hotspot-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid rgba(212, 163, 89, 0.45);
  animation: hotspotPulse 2.6s ease-out infinite;
}

@keyframes hotspotPulse {
  0% { transform: scale(0.85); opacity: 0.85; }
  100% { transform: scale(1.5); opacity: 0; }
}

.hotspot:hover {
  transform: translate(-50%, -50%) scale(1.16);
  background: var(--gold-candle);
  color: var(--bg-obsidian);
}

.hotspot.visited {
  border-color: rgba(239, 233, 221, 0.55);
}

.hotspot.active {
  background: var(--crimson-bright);
  border-color: var(--paper-light);
  color: var(--paper-light);
  transform: translate(-50%, -50%) scale(1.18);
  box-shadow: 0 0 20px rgba(217, 59, 46, 0.65);
}

.painting-stage-wrap[data-mode="scale"] .hotspot {
  opacity: 0.22;
}

/* Curator Loupe & Dossier Panel */
.curator-panel {
  background: var(--bg-charcoal);
  border: 1px solid var(--rule-dark-strong);
  position: sticky;
  top: calc(var(--nav-h) + 1.5rem);
}

.loupe-frame {
  position: relative;
  width: 100%;
  height: 225px;
  overflow: hidden;
  border-bottom: 1px solid var(--rule-dark-subtle);
  background: #080706;
}

.loupe-viewport {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
  background-size: 300%;
  background-position: 39% 24%;
  transition: background-position 0.55s cubic-bezier(0.22, 1, 0.36, 1), background-size 0.55s ease;
  filter: contrast(1.06) brightness(1.04);
}

.loupe-crosshair {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(to right, transparent calc(50% - 0.5px), rgba(212, 163, 89, 0.25) 50%, transparent calc(50% + 0.5px)),
    linear-gradient(to bottom, transparent calc(50% - 0.5px), rgba(212, 163, 89, 0.25) 50%, transparent calc(50% + 0.5px));
}

.loupe-badge {
  position: absolute;
  right: 0.75rem;
  bottom: 0.75rem;
  padding: 0.22rem 0.5rem;
  background: rgba(11, 9, 8, 0.85);
  border: 1px solid rgba(212, 163, 89, 0.32);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--gold-bright);
  letter-spacing: 0.06em;
}

.curator-body {
  padding: 1.65rem 1.75rem;
}

.curator-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
}

.curator-index {
  color: var(--gold-candle);
  letter-spacing: 0.06em;
}

.curator-tag {
  color: var(--text-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.curator-title {
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 600;
  line-height: 1.15;
  color: var(--text-ivory);
  margin-bottom: 0.9rem;
}

.curator-desc {
  font-size: 0.96rem;
  line-height: 1.72;
  color: var(--text-stone);
  margin-bottom: 1.25rem;
}

.curator-note {
  padding: 0.95rem 1.05rem;
  background: rgba(212, 163, 89, 0.06);
  border-left: 2px solid var(--crimson-bright);
}

.note-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  margin-bottom: 0.35rem;
}

.curator-note p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-ivory);
}

.curator-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.75rem;
  border-top: 1px solid var(--rule-dark-subtle);
  background: rgba(0, 0, 0, 0.22);
}

.curator-nav-btn {
  background: transparent;
  border: 1px solid var(--rule-dark-strong);
  color: var(--text-ivory);
  padding: 0.42rem 0.78rem;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  transition: all 0.2s ease;
}

.curator-nav-btn:hover {
  border-color: var(--gold-candle);
  color: var(--gold-bright);
}

.curator-dots {
  display: flex;
  gap: 5px;
}

.curator-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rule-dark-strong);
  transition: background 0.2s ease, transform 0.2s ease;
}

.curator-dot.active {
  background: var(--crimson-bright);
  transform: scale(1.3);
}

/* ==========================================================================
   ACT 02: FUGITIVE PAINTER — ARCHIVAL PARCHMENT MAP CHAPTER
   (Direct visual bridge to Obscure Art History's daylight archival palette)
   ========================================================================== */
.chapter-parchment {
  background: var(--paper-light);
  color: var(--ink-dark);
  border-top: 2px solid var(--ink-dark);
  border-bottom: 2px solid var(--ink-dark);
}

.chapter-parchment .chapter-kicker {
  color: var(--crimson);
}

.chapter-parchment .chapter-title {
  color: var(--ink-dark);
}

.chapter-parchment .chapter-intro {
  color: var(--ink-mid);
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 2.5rem;
  align-items: stretch;
}

.map-canvas-card {
  background: var(--paper-mid);
  border: 1px solid var(--ink-dark);
  display: flex;
  flex-direction: column;
}

.map-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule-paper);
  background: var(--paper-dark);
}

.map-code {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--ink-mid);
}

.map-play-btn {
  background: var(--ink-dark);
  color: var(--paper-light);
  border: none;
  padding: 0.38rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  transition: background 0.2s ease;
}

.map-play-btn:hover {
  background: var(--crimson);
}

.svg-map-wrap {
  flex: 1;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.italy-map {
  width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--rule-paper);
}

.map-sea-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.24em;
  fill: rgba(44, 76, 100, 0.42);
  font-style: italic;
}

.map-land {
  fill: #F5F1E8;
  stroke: #8A8272;
  stroke-width: 1.4;
  transition: fill 0.3s ease;
}

.map-sicily {
  fill: #EFE9DB;
  stroke: #5D574C;
  stroke-width: 1.6;
}

.route-ghost {
  fill: none;
  stroke: rgba(25, 27, 28, 0.18);
  stroke-width: 1.8;
  stroke-dasharray: 4 5;
}

.route-seg {
  fill: none;
  stroke: var(--crimson);
  stroke-width: 2.6;
  stroke-linecap: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  transition: stroke-dashoffset 0.85s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.4s ease;
  opacity: 0.25;
}

.route-seg.revealed {
  stroke-dashoffset: 0;
  opacity: 1;
}

.map-node {
  cursor: pointer;
  outline: none;
}

.node-pulse {
  fill: rgba(184, 41, 30, 0.18);
  transform-box: fill-box;
  transform-origin: center;
  opacity: 0;
}

.map-node.active .node-pulse {
  opacity: 1;
  animation: mapPulse 1.8s ease-out infinite;
}

@keyframes mapPulse {
  0% { transform: scale(0.7); opacity: 0.9; }
  100% { transform: scale(1.8); opacity: 0; }
}

.node-dot {
  fill: var(--paper-light);
  stroke: var(--ink-dark);
  stroke-width: 2;
  transition: fill 0.2s ease, stroke 0.2s ease, r 0.2s ease;
}

.map-node.visited .node-dot {
  fill: var(--steel);
  stroke: var(--paper-light);
}

.map-node.active .node-dot,
.map-node:hover .node-dot {
  fill: var(--crimson);
  stroke: var(--paper-light);
}

.node-key .node-dot {
  stroke: var(--crimson);
  stroke-width: 2.5;
}

.node-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  fill: var(--ink-mid);
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: fill 0.2s ease;
}

.map-node.active .node-label,
.map-node:hover .node-label {
  fill: var(--crimson);
}

.node-label-key {
  fill: var(--crimson);
  font-size: 10.5px;
}

/* Chronicle Dossier Card */
.chronicle-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.chronicle-stepper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.step-chip {
  background: var(--paper-mid);
  border: 1px solid var(--rule-paper);
  padding: 0.42rem 0.7rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mid);
  transition: all 0.2s ease;
}

.step-chip:hover {
  border-color: var(--ink-dark);
  color: var(--ink-dark);
}

.step-chip.highlight {
  border-color: rgba(184, 41, 30, 0.5);
  color: var(--crimson);
}

.step-chip.active {
  background: var(--ink-dark);
  border-color: var(--ink-dark);
  color: var(--paper-light);
}

.step-chip.highlight.active {
  background: var(--crimson);
  border-color: var(--crimson);
  color: var(--paper-light);
}

.chronicle-card {
  flex: 1;
  background: var(--paper-mid);
  border: 1px solid var(--ink-dark);
  border-top: 4px solid var(--crimson);
  padding: 1.85rem;
  display: flex;
  flex-direction: column;
}

.chronicle-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--rule-paper);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.chronicle-date {
  font-weight: 600;
  color: var(--ink-dark);
}

.chronicle-status {
  color: var(--crimson);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.chronicle-place {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink-dark);
  margin-bottom: 1rem;
}

.chronicle-text {
  font-size: 0.98rem;
  line-height: 1.75;
  color: var(--ink-mid);
  margin-bottom: 1.5rem;
}

.chronicle-work-box {
  background: var(--paper-light);
  border-left: 3px solid var(--steel);
  padding: 0.95rem 1.1rem;
  margin-bottom: 1.75rem;
}

.work-box-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--steel);
  margin-bottom: 0.3rem;
}

.work-box-val {
  font-size: 0.9rem;
  color: var(--ink-dark);
  line-height: 1.55;
}

.chronicle-footer {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1.15rem;
  border-top: 1px solid var(--rule-paper);
}

.chronicle-btn {
  background: transparent;
  border: 1px solid var(--ink-dark);
  color: var(--ink-dark);
  padding: 0.45rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  transition: all 0.2s ease;
}

.chronicle-btn:hover {
  background: var(--ink-dark);
  color: var(--paper-light);
}

.chronicle-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
}

/* ==========================================================================
   ACT 03: NIGHT OF OCTOBER 18, 1969 — INTERACTIVE HEIST RECONSTRUCTION
   ========================================================================== */
.chapter-heist {
  background:
    radial-gradient(ellipse 60% 50% at 25% 50%, rgba(184, 41, 30, 0.09), transparent 70%),
    var(--bg-obsidian);
}

.heist-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 3rem;
  align-items: start;
}

.heist-stage-card {
  background: var(--bg-umber);
  border: 1px solid var(--rule-dark-strong);
  padding: 1.25rem;
}

.heist-stage-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.1rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--rule-dark-subtle);
}

.heist-instruction {
  font-size: 0.88rem;
  color: var(--text-stone);
}

.heist-instruction strong {
  color: var(--gold-bright);
}

.heist-btn-group {
  display: flex;
  gap: 0.5rem;
}

.heist-action-btn {
  background: var(--crimson);
  color: var(--paper-light);
  border: 1px solid var(--crimson-bright);
  padding: 0.42rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  transition: background 0.2s ease;
}

.heist-action-btn:hover {
  background: var(--crimson-bright);
}

.heist-reset-btn {
  background: transparent;
  color: var(--text-stone);
  border: 1px solid var(--rule-dark-strong);
  padding: 0.42rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  transition: all 0.2s ease;
}

.heist-reset-btn:hover {
  border-color: var(--gold-candle);
  color: var(--text-ivory);
}

.heist-canvas-container {
  position: relative;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  aspect-ratio: 1166 / 1536;
}

.heist-outer-frame {
  position: relative;
  width: 100%;
  height: 100%;
  padding: 20px;
  background: linear-gradient(135deg, #27201A, #120E0B 50%, #241D17);
  border: 3px solid #3A3027;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85), 0 24px 60px rgba(0, 0, 0, 0.75);
  overflow: hidden;
}

.heist-void-wall {
  position: absolute;
  inset: 20px;
  background:
    radial-gradient(circle at 40% 35%, rgba(235, 229, 217, 0.94), rgba(196, 189, 175, 0.92) 70%, rgba(160, 152, 138, 0.96)),
    repeating-linear-gradient(45deg, rgba(0, 0, 0, 0.025) 0 2px, transparent 2px 6px);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
}

.void-stretcher-marks {
  position: absolute;
  inset: 0;
  border: 8px solid rgba(55, 42, 30, 0.22);
}

.void-label-stamp {
  text-align: center;
  padding: 1rem 1.25rem;
  border: 1px solid var(--rule-paper);
  color: var(--ink-dark);
  background: rgba(243, 239, 230, 0.92);
  font-family: var(--font-mono);
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.6s ease 0.35s, transform 0.6s ease 0.35s;
}

.void-label-stamp span {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.void-label-stamp small {
  display: block;
  font-size: 0.66rem;
  color: var(--ink-mid);
  margin-top: 4px;
}

.heist-canvas-container.is-stolen .void-label-stamp {
  opacity: 1;
  transform: scale(1);
}

.heist-painting-sheet {
  position: absolute;
  inset: 20px;
  overflow: hidden;
  transform-origin: bottom center;
  transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.6s ease, clip-path 0.85s cubic-bezier(0.4, 0, 0.2, 1);
  clip-path: inset(0% 0% 0% 0%);
}

.heist-painting-sheet img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.heist-dark-cloak {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(10, 8, 6, 0.32), rgba(5, 4, 3, 0.74));
  pointer-events: none;
}

.heist-crack-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background:
    linear-gradient(112deg, transparent 49.3%, rgba(235, 224, 200, 0.38) 49.7%, transparent 50.3%),
    linear-gradient(64deg, transparent 34.4%, rgba(235, 224, 200, 0.28) 34.8%, transparent 35.3%),
    linear-gradient(155deg, transparent 69.5%, rgba(235, 224, 200, 0.32) 69.9%, transparent 70.4%);
  transition: opacity 0.45s ease;
}

/* Progressive canvas sag as edges are cut */
.heist-canvas-container.cut-1 .heist-painting-sheet { transform: rotate(-0.6deg) scale(0.994); }
.heist-canvas-container.cut-2 .heist-painting-sheet { transform: rotate(0.9deg) translateY(3px) scale(0.988); }
.heist-canvas-container.cut-2 .heist-crack-overlay { opacity: 0.45; }
.heist-canvas-container.cut-3 .heist-painting-sheet { transform: rotate(-1.5deg) translateY(7px) scale(0.98); }
.heist-canvas-container.cut-3 .heist-crack-overlay { opacity: 0.85; }

/* Rolling up into the stolen rug once all 4 edges are severed */
.heist-canvas-container.is-stolen .heist-painting-sheet {
  clip-path: inset(100% 0% 0% 0%);
  transform: translateY(10px) scale(0.97);
  opacity: 0.2;
}

.heist-roll-tube {
  position: absolute;
  left: 20px;
  right: 20px;
  top: 20px;
  height: 26px;
  background: linear-gradient(180deg, #523E2B 0%, #241A12 45%, #75593E 75%, #1A130D 100%);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.8);
  opacity: 0;
  pointer-events: none;
  z-index: 6;
}

.heist-canvas-container.is-rolling .heist-roll-tube {
  animation: rollDownAndVanish 1.15s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes rollDownAndVanish {
  0% { top: 20px; opacity: 0.95; transform: scaleY(0.8); }
  70% { top: calc(100% - 46px); opacity: 1; transform: scaleY(1.25); }
  100% { top: calc(100% + 20px); opacity: 0; transform: scaleY(1.25); }
}

/* 4 Interactive Cut Edges */
.cut-edge {
  position: absolute;
  background: transparent;
  border: none;
  z-index: 8;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.cut-top { top: 6px; left: 32px; right: 32px; height: 28px; }
.cut-bottom { bottom: 6px; left: 32px; right: 32px; height: 28px; }
.cut-left { left: 6px; top: 32px; bottom: 32px; width: 28px; }
.cut-right { right: 6px; top: 32px; bottom: 32px; width: 28px; }

.cut-line {
  position: absolute;
  pointer-events: none;
  transition: all 0.25s ease;
}

.cut-top .cut-line,
.cut-bottom .cut-line {
  left: 0; right: 0; height: 2px;
  border-top: 2px dashed rgba(212, 163, 89, 0.72);
}

.cut-left .cut-line,
.cut-right .cut-line {
  top: 0; bottom: 0; width: 2px;
  border-left: 2px dashed rgba(212, 163, 89, 0.72);
}

.cut-tag {
  position: relative;
  z-index: 2;
  background: rgba(11, 9, 8, 0.9);
  border: 1px solid var(--gold-candle);
  color: var(--gold-bright);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  padding: 0.16rem 0.45rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.cut-left .cut-tag,
.cut-right .cut-tag {
  writing-mode: vertical-rl;
  padding: 0.45rem 0.16rem;
}

.cut-edge:hover .cut-tag {
  background: var(--crimson-bright);
  border-color: var(--paper-light);
  color: var(--paper-light);
}

.cut-edge:hover .cut-line {
  border-color: var(--crimson-bright);
}

.cut-edge.is-cut {
  pointer-events: none;
}

.cut-edge.is-cut .cut-line {
  border-style: solid;
  border-color: var(--crimson-bright);
  box-shadow: 0 0 10px rgba(217, 59, 46, 0.8);
}

.cut-edge.is-cut .cut-tag {
  opacity: 0;
  transform: scale(0.8);
}

.forensic-readout {
  margin-top: 1.15rem;
  padding: 0.85rem 1rem;
  background: rgba(0, 0, 0, 0.35);
  border-left: 3px solid var(--crimson-bright);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.readout-code {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
}

.readout-msg {
  font-size: 0.88rem;
  color: var(--text-stone);
}

/* Synchronized Heist Timeline */
.heist-timeline {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  border-left: 1px solid var(--rule-dark-strong);
  padding-left: 1.75rem;
}

.heist-step {
  position: relative;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
  background: rgba(239, 233, 221, 0.025);
  border: 1px solid transparent;
  opacity: 0.55;
  transition: all 0.35s ease;
}

.heist-step::before {
  content: '';
  position: absolute;
  left: calc(-1.75rem - 5.5px);
  top: 1.55rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--bg-obsidian);
  border: 2px solid var(--text-muted);
  transition: all 0.35s ease;
}

.heist-step.active {
  opacity: 1;
  background: rgba(212, 163, 89, 0.07);
  border-color: rgba(212, 163, 89, 0.32);
}

.heist-step.active::before {
  background: var(--crimson-bright);
  border-color: var(--gold-bright);
  box-shadow: 0 0 12px rgba(217, 59, 46, 0.75);
}

.step-time {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  color: var(--gold-candle);
  margin-bottom: 0.35rem;
}

.heist-step h3 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text-ivory);
  margin-bottom: 0.45rem;
}

.heist-step p {
  font-size: 0.94rem;
  line-height: 1.68;
  color: var(--text-stone);
}

/* ==========================================================================
   ACT 04: CONFLICTING TESTIMONIES — COSA NOSTRA EVIDENCE BOARD
   ========================================================================== */
.chapter-board {
  background:
    radial-gradient(circle at 80% 15%, rgba(44, 76, 100, 0.14), transparent 55%),
    #131211;
}

.evidence-board {
  display: grid;
  grid-template-columns: minmax(290px, 0.85fr) minmax(0, 1.15fr);
  gap: 2rem;
  align-items: start;
}

.evidence-files {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.dossier-tab {
  text-align: left;
  padding: 1.1rem 1.2rem;
  background: rgba(239, 233, 221, 0.03);
  border: 1px solid var(--rule-dark-subtle);
  border-left: 3px solid transparent;
  color: var(--text-ivory);
  transition: all 0.22s ease;
}

.dossier-tab:hover {
  background: rgba(239, 233, 221, 0.06);
  border-color: var(--rule-dark-strong);
}

.dossier-tab.active {
  background: rgba(243, 239, 230, 0.09);
  border-color: var(--gold-candle);
  border-left-color: var(--crimson-bright);
  transform: translateX(4px);
}

.tab-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
}

.tab-id {
  color: var(--gold-candle);
  letter-spacing: 0.06em;
}

.tab-status {
  padding: 0.12rem 0.42rem;
  font-size: 0.61rem;
  letter-spacing: 0.05em;
  border: 1px solid currentColor;
}

.status-damaged { color: var(--gold-bright); }
.status-destroyed { color: var(--crimson-bright); }
.status-fragmented { color: #D98A4E; }
.status-intact { color: #7DA7C4; }

.dossier-tab h4 {
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
  color: var(--text-ivory);
}

.dossier-tab p {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.dossier-tab.active p {
  color: var(--text-stone);
}

/* Archival Paper Dossier Viewer */
.dossier-paper {
  background: var(--paper-light);
  color: var(--ink-dark);
  padding: 2.1rem 2.25rem;
  border: 1px solid #C8C1B2;
  border-top: 4px solid var(--ink-dark);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.48);
  margin-bottom: 1.5rem;
}

.dossier-stamp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.85rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--rule-paper);
}

.dossier-serial {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-soft);
  letter-spacing: 0.06em;
}

.theory-status-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  color: var(--ink-mid);
  background: var(--paper-mid);
  padding: 0.22rem 0.6rem;
}

.dossier-heading {
  font-family: var(--font-serif);
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink-dark);
  margin-bottom: 1.15rem;
}

.dossier-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  padding: 0.85rem 0;
  margin-bottom: 1.25rem;
  border-top: 1px solid var(--rule-paper);
  border-bottom: 1px solid var(--rule-paper);
}

.dossier-meta-grid span {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
  margin-bottom: 0.2rem;
}

.dossier-meta-grid strong {
  font-size: 0.88rem;
  color: var(--ink-dark);
}

.dossier-narrative {
  font-size: 1rem;
  line-height: 1.78;
  color: var(--ink-dark);
  margin-bottom: 1.35rem;
}

.dossier-conflict-box {
  background: var(--paper-mid);
  border-left: 3px solid var(--crimson);
  padding: 1rem 1.15rem;
  margin-bottom: 1.4rem;
}

.conflict-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--crimson);
  margin-bottom: 0.35rem;
}

.dossier-conflict-box p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--ink-mid);
}

.plausibility-meter .meter-row {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--ink-mid);
  margin-bottom: 0.45rem;
}

.meter-track {
  height: 7px;
  background: var(--paper-dark);
  overflow: hidden;
}

.meter-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--steel), var(--crimson));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Interactive Cold Case Verdict Box */
.verdict-box {
  background: var(--bg-charcoal);
  border: 1px solid var(--rule-dark-strong);
  padding: 1.5rem 1.75rem;
}

.verdict-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold-candle);
  margin-bottom: 0.45rem;
}

.verdict-header h4 {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 600;
  color: var(--text-ivory);
  margin-bottom: 1.1rem;
}

.verdict-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.65rem;
}

.verdict-btn {
  text-align: left;
  padding: 0.75rem 0.95rem;
  background: rgba(239, 233, 221, 0.04);
  border: 1px solid var(--rule-dark-strong);
  color: var(--text-stone);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  transition: all 0.2s ease;
}

.verdict-btn:hover {
  border-color: var(--gold-candle);
  color: var(--text-ivory);
}

.verdict-btn.selected {
  background: rgba(184, 41, 30, 0.22);
  border-color: var(--crimson-bright);
  color: var(--text-ivory);
}

.verdict-response {
  margin-top: 1.15rem;
  padding: 1rem 1.15rem;
  background: rgba(212, 163, 89, 0.07);
  border-left: 3px solid var(--gold-candle);
  animation: fadeSlideUp 0.4s ease;
}

@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.verdict-stamp-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--gold-bright);
  margin-bottom: 0.4rem;
}

.verdict-response p {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-ivory);
}

/* ==========================================================================
   ACT 05: THE HAUNTING LEGACY — BEFORE/AFTER SLIDER & EPILOGUE
   ========================================================================== */
.chapter-legacy {
  background:
    radial-gradient(ellipse 70% 50% at 50% 20%, rgba(212, 163, 89, 0.09), transparent 65%),
    var(--bg-obsidian);
}

.compare-wrapper {
  max-width: 780px;
  margin: 0 auto 4.5rem;
}

.compare-stage {
  position: relative;
  width: 100%;
  max-width: 560px;
  aspect-ratio: 1022 / 1536;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--rule-dark-strong);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.78);
  user-select: none;
  cursor: ew-resize;
  background: #0d0b0a;
}

.compare-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.compare-base-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
}

.compare-painting-slot {
  left: 38.2%;
  top: 39.8%;
  width: 23.2%;
  height: 19.3%;
}

.compare-label {
  position: absolute;
  bottom: 1rem;
  padding: 0.35rem 0.7rem;
  background: rgba(11, 9, 8, 0.85);
  border: 1px solid rgba(212, 163, 89, 0.35);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--gold-bright);
  pointer-events: none;
}

.label-left { left: 1rem; }
.label-right { right: 1rem; }

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 44px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  outline: none;
}

.handle-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--gold-bright);
  box-shadow: 0 0 14px rgba(212, 163, 89, 0.85);
}

.handle-knob {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-obsidian);
  border: 2px solid var(--gold-bright);
  color: var(--gold-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8);
  transition: transform 0.15s ease, background 0.15s ease;
}

.compare-handle:hover .handle-knob,
.compare-handle:focus .handle-knob {
  background: var(--crimson);
  border-color: var(--paper-light);
  color: var(--paper-light);
  transform: scale(1.08);
}

.compare-caption {
  text-align: center;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 1.15rem;
}

/* Epilogue Meditation */
.epilogue-block {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  padding-top: 3.25rem;
  border-top: 1px solid var(--rule-dark-subtle);
}

.epilogue-quote p {
  font-family: var(--font-serif);
  font-size: clamp(1.38rem, 2.5vw, 1.85rem);
  line-height: 1.55;
  color: var(--text-ivory);
  margin-bottom: 1.35rem;
}

.epilogue-punchline {
  font-style: italic;
  color: var(--gold-bright) !important;
  font-size: clamp(1.6rem, 3vw, 2.2rem) !important;
  margin-top: 1.75rem;
}

.epilogue-meta {
  margin-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-muted);
}

.epilogue-meta a {
  color: var(--gold-candle);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.epilogue-meta a:hover {
  color: var(--paper-light);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.interactive-footer {
  background: #070605;
  border-top: 1px solid var(--rule-dark-subtle);
  padding: 2.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer-brand strong {
  color: var(--text-ivory);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.footer-links a {
  color: var(--text-stone);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

/* ==========================================================================
   RESPONSIVE DESIGN
   ========================================================================== */
@media (max-width: 1080px) {
  .chapter-nav {
    display: none;
  }

  .hero-grid,
  .inspector-workspace,
  .map-layout,
  .heist-grid,
  .evidence-board {
    grid-template-columns: 1fr;
    gap: 2.25rem;
  }

  .curator-panel {
    position: static;
  }

  .altar-stage {
    max-width: 420px;
    max-height: none;
  }
}

@media (max-width: 680px) {
  .section-shell {
    padding: 0 1.2rem;
  }

  .top-bar-inner {
    padding: 0 1rem;
  }

  .brand-sub,
  .essay-link {
    display: none;
  }

  .chapter-section {
    padding: 4.25rem 0;
  }

  .telemetry-strip {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }

  .dossier-paper {
    padding: 1.4rem 1.25rem;
  }

  .dossier-meta-grid,
  .verdict-options {
    grid-template-columns: 1fr;
  }

  .scroll-cue {
    display: none;
  }
}

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