/* ==========================================================================
   宁境 LUMINA — 8-Act Extended Progressive Horror Stylesheet
   --corruption (0.00 -> 1.00) & body[data-stage="1..8"]
   ========================================================================== */

:root {
  --corruption: 0;
  --bg-page: #F8FAFC;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --text-main: #0F172A;
  --text-muted: #475569;
  --accent: #4F46E5;
  --accent-soft: rgba(79, 70, 229, 0.1);
  --border-color: #E2E8F0;
  --nav-bg: rgba(248, 250, 252, 0.88);
  --shadow-card: 0 14px 36px -12px rgba(15, 23, 42, 0.1);
  --radius: 16px;
}

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

/* CRITICAL: clip instead of hidden so position:sticky works in Acts 4, 5, 6, 7, 8 */
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
  scroll-behavior: auto;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  transition: background-color 0.6s ease, color 0.5s ease;
}

/* ==========================================================================
   8-Act Theme Progression
   ========================================================================== */

body[data-stage="2"] {
  --bg-page: #ECEFF3;
  --bg-surface: #F4F6F9;
  --text-main: #18202C;
  --text-muted: #525E6E;
  --border-color: #CBD5E1;
  --nav-bg: rgba(235, 239, 244, 0.9);
}

body[data-stage="3"] {
  --bg-page: #0E0A0B;
  --bg-surface: #171012;
  --bg-subtle: #1D1215;
  --text-main: #E7D6D8;
  --text-muted: #A4868B;
  --accent: #DC2626;
  --accent-soft: rgba(220, 38, 38, 0.16);
  --border-color: rgba(185, 28, 28, 0.34);
  --nav-bg: rgba(14, 9, 10, 0.92);
  --shadow-card: 0 18px 42px -12px rgba(0, 0, 0, 0.78);
}

body[data-stage="4"],
body[data-stage="5"],
body[data-stage="6"],
body[data-stage="7"],
body[data-stage="8"] {
  --bg-page: #040304;
  --bg-surface: #0A0607;
  --text-main: #EFE1E3;
  --text-muted: #8E7478;
  --accent: #EF4444;
  --border-color: rgba(220, 38, 38, 0.42);
  --nav-bg: rgba(6, 4, 5, 0.94);
}

body[data-loop="1"][data-stage="1"],
body[data-loop="1"][data-stage="2"] {
  --bg-page: #E5E7EB;
}

.container {
  width: min(1160px, 92vw);
  margin: 0 auto;
}

/* ==========================================================================
   Fixed Overlays: Vignette, Grain, VHS, Subliminal Flash, Watcher Eyes
   ========================================================================== */

#vignette-overlay,
#film-grain,
#vhs-glitch-overlay,
#subliminal-flash,
#eyes-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

#vignette-overlay {
  z-index: 60;
  opacity: calc(max(0, (var(--corruption) - 0.14) * 1.15));
  background: radial-gradient(circle at 50% 50%, transparent 42%, rgba(8, 2, 4, 0.8) 84%, rgba(2, 0, 1, 0.97) 100%);
}

#film-grain {
  z-index: 61;
  opacity: calc(max(0, (var(--corruption) - 0.22) * 0.26));
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0px, rgba(0, 0, 0, 0.07) 2px, transparent 3px),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.03) 0px, transparent 2px);
  mix-blend-mode: overlay;
}

#vhs-glitch-overlay {
  z-index: 95;
  opacity: 0;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 0, 40, 0.2) 0px,
    rgba(0, 255, 220, 0.15) 3px,
    rgba(0, 0, 0, 0.86) 6px
  );
  transition: opacity 0.12s ease;
}

#vhs-glitch-overlay.active {
  opacity: 1;
  animation: vhs-flash 0.35s steps(3) infinite;
}

#subliminal-flash {
  z-index: 130;
  opacity: 0;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
}

#subliminal-flash img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: contrast(2.2) invert(1) grayscale(1);
  opacity: 0.9;
}

#subliminal-flash .subliminal-text {
  position: absolute;
  font-size: clamp(46px, 9vw, 110px);
  font-weight: 900;
  letter-spacing: 0.2em;
  color: #DC2626;
  text-shadow: 0 0 28px rgba(0, 0, 0, 0.9);
}

#subliminal-flash.active {
  opacity: 1;
}

#eyes-canvas {
  z-index: 62;
  width: 100vw;
  height: 100vh;
}

.breach-mute-btn {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 125;
  appearance: none;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid rgba(239, 68, 68, 0.48);
  background: rgba(10, 4, 6, 0.82);
  color: #FCA5A5;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

body.breach-active .breach-mute-btn {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   Warnings & Floating Whispers
   ========================================================================== */

#exit-warning {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  padding: 12px 20px;
  background: #7F1D1D;
  color: #FEE2E2;
  font-weight: 700;
  font-size: 14px;
  text-align: center;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #EF4444;
  transform: translateY(-110%);
  transition: transform 0.22s ease;
  pointer-events: none;
}

#exit-warning.visible {
  transform: translateY(0);
}

#idle-whisper,
#knock-caption,
#scroll-resist-msg {
  position: fixed;
  left: 50%;
  transform: translate(-50%, 10px);
  z-index: 88;
  padding: 12px 24px;
  border-radius: 999px;
  background: rgba(10, 4, 6, 0.9);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #FCA5A5;
  font-size: 14px;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85);
}

#idle-whisper { bottom: 14%; }
#knock-caption { bottom: 22%; color: #F8FAFC; border-color: rgba(255, 255, 255, 0.25); }
#scroll-resist-msg { top: 18%; z-index: 126; color: #FEE2E2; background: rgba(127, 29, 29, 0.94); }

#idle-whisper.visible,
#knock-caption.visible,
#scroll-resist-msg.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

#cookie-toast {
  position: fixed;
  left: 22px;
  bottom: 22px;
  z-index: 85;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(248, 113, 113, 0.45);
  color: #E2E8F0;
  font-size: 13px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

#cookie-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Sticky Navbar
   ========================================================================== */

#navbar {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--nav-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  transition: background 0.5s ease, border-color 0.5s ease, opacity 0.35s ease, transform 0.35s ease;
}

body.breach-active #navbar {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-100%);
}

.nav-inner {
  width: min(1160px, 92vw);
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 700;
  font-size: 18px;
}

.brand em {
  font-style: normal;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-left: 4px;
}

.brand-icon-wrap {
  position: relative;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#brand-icon-moon,
#brand-icon-eye {
  position: absolute;
  inset: 0;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

#brand-icon-eye {
  opacity: 0;
  transform: scale(0.75);
}

body[data-stage="3"] #brand-icon-moon,
body[data-stage="4"] #brand-icon-moon,
body[data-stage="5"] #brand-icon-moon,
body[data-stage="6"] #brand-icon-moon,
body[data-stage="7"] #brand-icon-moon,
body[data-stage="8"] #brand-icon-moon {
  opacity: 0;
  transform: scale(0.75);
}

body[data-stage="3"] #brand-icon-eye,
body[data-stage="4"] #brand-icon-eye,
body[data-stage="5"] #brand-icon-eye,
body[data-stage="6"] #brand-icon-eye,
body[data-stage="7"] #brand-icon-eye,
body[data-stage="8"] #brand-icon-eye {
  opacity: 1;
  transform: scale(1);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.25s ease;
}

.nav-link:hover {
  color: var(--text-main);
}

body[data-stage="3"] .nav-link,
body[data-stage="4"] .nav-link,
body[data-stage="5"] .nav-link,
body[data-stage="6"] .nav-link {
  text-shadow: 1px 0 rgba(239, 68, 68, 0.55), -1px 0 rgba(34, 211, 238, 0.35);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.audio-pill {
  appearance: none;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  padding: 12px 22px;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn-sm { padding: 8px 15px; font-size: 13px; border-radius: 8px; }

.btn-primary {
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.45);
}

.btn-ghost {
  background: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
}

/* ==========================================================================
   ACT 1: Pure Modern SaaS Marketing Page + Metrics + Craftsmanship
   ========================================================================== */

.section-act-1 {
  padding: 48px 0 92px;
}

.promo-wrap { margin-bottom: 24px; }

.promo-pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(79, 70, 229, 0.22);
  font-size: 13px;
  font-weight: 600;
}

.promo-pill.gaslight {
  background: rgba(127, 29, 29, 0.18);
  color: #B91C1C;
  border-color: rgba(220, 38, 38, 0.45);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.02fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-title {
  margin: 0 0 18px;
  font-size: clamp(32px, 4.1vw, 48px);
  line-height: 1.18;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.hero-subtitle {
  margin: 0 0 28px;
  font-size: 17px;
  color: var(--text-muted);
  max-width: 52ch;
}

.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
}

.hero-trust-note {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.hero-photo-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: #CBD5E1;
  box-shadow: 0 28px 60px -18px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.7);
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-img.overlay-img {
  opacity: 0;
  transition: opacity 0.8s ease;
}

body.hero-uncanny .hero-img.overlay-img { opacity: 1; }

.float-chip {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #0F172A;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

body.hero-uncanny .float-chip {
  background: rgba(18, 12, 14, 0.88);
  color: #FECACA;
  border: 1px solid rgba(220, 38, 38, 0.45);
}

.chip-tl { top: 16px; left: 16px; }
.chip-tr { top: 16px; right: 16px; }
.chip-bl { bottom: 16px; left: 16px; }

.chip-dot { width: 8px; height: 8px; border-radius: 50%; }
.chip-dot.green { background: #10B981; box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22); }
.chip-dot.blue { background: #0EA5E9; box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.22); }
.chip-dot.indigo { background: #4F46E5; box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.22); }
.chip-dot.crimson { background: #EF4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.35); }

.metrics-bar {
  margin-top: 56px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  padding: 24px 28px;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

.metric-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
}

.metric-label {
  font-size: 13px;
  color: var(--text-muted);
}

.partner-bar {
  margin-top: 44px;
  padding: 22px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.partner-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.partner-logos { display: flex; flex-wrap: wrap; gap: 28px; }
.partner-item { font-size: 15px; font-weight: 700; color: #64748B; }

.features-grid {
  margin-top: 48px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.feature-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.feature-card h3 { margin: 0 0 10px; font-size: 18px; }
.feature-card p { margin: 0; font-size: 14px; color: var(--text-muted); }

/* Craftsmanship Split Showcase */
.craft-showcase {
  margin-top: 76px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 36px;
  align-items: center;
}

.craft-left h2 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
}

.spec-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.spec-item {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
}

.spec-item strong { display: block; font-size: 14px; margin-bottom: 2px; }
.spec-item span { font-size: 13px; color: var(--text-muted); }

.clinical-chart {
  margin-top: 22px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
}

.chart-title { font-size: 13px; font-weight: 700; margin-bottom: 14px; }
.bar-row { margin-bottom: 12px; }
.bar-row:last-child { margin-bottom: 0; }

.bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 6px;
}

.awake-sub { color: var(--text-muted); font-size: 12px; }
.awake-sub.corrupt { color: #DC2626; font-weight: 700; }

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.bar-fill { height: 100%; background: #0EA5E9; border-radius: 999px; }
.bar-fill.indigo { background: #4F46E5; }
.bar-fill.emerald { background: #10B981; }

.hardware-diagram-card {
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 24px 52px -14px rgba(15, 23, 42, 0.28);
}

.hardware-svg { width: 100%; height: auto; display: block; }

/* ==========================================================================
   ACT 2: Uncanny Slip, 6-Card Reviews & Team
   ========================================================================== */

.section-act-2 {
  padding: 90px 0 96px;
  border-top: 1px solid var(--border-color);
}

.section-header { max-width: 740px; margin-bottom: 42px; }
.section-header.compact { margin-bottom: 26px; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 8px;
}

.eyebrow.blood-eyebrow { color: #EF4444; }

.section-header h2,
.section-header h3 {
  margin: 0 0 10px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.25;
}

.section-lead { margin: 0; color: var(--text-muted); font-size: 15px; }

.report-showcase {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 28px;
}

.report-photo-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #0F172A;
  min-height: 360px;
}

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

.report-img-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 14px 18px;
  background: linear-gradient(to top, rgba(2, 6, 12, 0.92), transparent);
  color: #E2E8F0;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
}

.rec-tag { color: #F87171; font-family: monospace; font-weight: 700; }

.report-telemetry-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.telemetry-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

.t-label { font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }
.t-value { font-size: 15px; font-weight: 700; }
.t-value-muted { font-size: 13px; color: #64748B; }

.status-pill {
  flex-shrink: 0;
  height: fit-content;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.status-pill.ok { background: rgba(16, 185, 129, 0.14); color: #059669; }
.status-pill.muted { background: rgba(100, 116, 139, 0.16); color: #475569; }

.audio-log-box {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  background: var(--bg-page);
}

.log-title { font-size: 12px; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; }
.audio-log-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.audio-log-list li { display: flex; gap: 10px; }
.log-time { flex-shrink: 0; font-family: monospace; font-size: 12px; color: var(--text-muted); }
.log-creepy .log-time { color: #DC2626; font-weight: 700; }

.waveform-box {
  padding: 14px 16px;
  border-radius: 12px;
  background: #0F172A;
  color: #E2E8F0;
}

.waveform-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 12px; margin-bottom: 8px; }
.spike-alert { color: #F87171; font-weight: 600; }
.sleep-wave-svg { width: 100%; height: 76px; display: block; }
.wave-pulse-dot { animation: pulse-dot 1.3s ease-in-out infinite; }

.reviews-block,
.team-block { margin-top: 72px; }

.reviews-grid,
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.review-card,
.team-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.team-card { padding: 0; overflow: hidden; }
.team-photo-wrap { aspect-ratio: 4 / 3; background: #0B0B0D; overflow: hidden; }
.team-photo { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.12); }
.team-info { padding: 20px 22px 24px; }
.team-info h4 { margin: 0 0 4px; font-size: 18px; }
.team-role { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 10px; }
.team-info p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.review-top { display: flex; align-items: center; gap: 12px; }

.avatar-circle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.reviewer-name { font-size: 14px; font-weight: 700; }
.stars { color: #F59E0B; font-size: 13px; }
.review-body { margin: 0; font-size: 14px; color: var(--text-muted); }

.ai-polish-badge {
  margin-top: auto;
  padding: 8px 11px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #047857;
  font-size: 12px;
  font-weight: 600;
}

/* ==========================================================================
   ACT 3: Surrender Contract, Decay, Parasitic Pricing & 6-Item FAQ
   ========================================================================== */

.section-act-3 {
  padding: 96px 0 104px;
  background: linear-gradient(180deg, rgba(14, 10, 11, 0) 0%, #0E0A0B 10%, #080506 100%);
  color: #E7D6D8;
  border-top: 1px solid rgba(185, 28, 28, 0.28);
}

body[data-stage="3"] .section-act-3,
body[data-stage="4"] .section-act-3 {
  filter: url(#horror-turbulence);
}

.contract-box {
  margin-bottom: 68px;
  padding: 28px 32px;
  border-radius: 14px;
  background: #140C0E;
  border: 1px solid rgba(220, 38, 38, 0.42);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.7);
}

.contract-header h3 { margin: 0 0 14px; font-size: 22px; color: #FEE2E2; }

.contract-clauses {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 14px;
  color: #C7AEB2;
}

.contract-clauses .clause-red { color: #FCA5A5; }

.glitch-heading {
  color: #FDE8E8;
  text-shadow: 2px 0 rgba(220, 38, 38, 0.72), -2px 0 rgba(34, 211, 238, 0.38);
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  align-items: stretch;
}

.pricing-card {
  background: #150E10;
  border: 1px solid rgba(185, 28, 28, 0.34);
  border-radius: 14px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 22px 46px rgba(0, 0, 0, 0.65);
  transition: transform 0.35s ease;
}

body[data-stage="3"] .crooked-left,
body[data-stage="4"] .crooked-left { transform: rotate(-1.5deg) translateY(6px); }
body[data-stage="3"] .crooked-right,
body[data-stage="4"] .crooked-right { transform: rotate(1.4deg) translateY(10px); }

.plan-tag { font-family: monospace; font-size: 11px; letter-spacing: 0.14em; color: #A4868B; }
.pricing-card h3 { margin: 0; font-size: 21px; color: #FEE2E2; }
.plan-price { font-size: 28px; font-weight: 800; color: #FFFFFF; }
.plan-price span { font-size: 14px; font-weight: 500; color: #A4868B; }

.plan-features { margin: 0; padding-left: 18px; color: #BFA8AC; font-size: 14px; display: flex; flex-direction: column; gap: 8px; }

.btn-plan-disabled {
  margin-top: auto;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(30, 20, 22, 0.8);
  color: #9CA3AF;
  font-size: 13px;
  cursor: not-allowed;
}

.active-parasite-plan {
  position: relative;
  border: 1.5px solid #EF4444;
  background: radial-gradient(circle at top, rgba(127, 29, 29, 0.38), #130A0C 72%);
  animation: crimson-pulse 2.4s ease-in-out infinite;
}

.plan-badge-pulse {
  position: absolute;
  top: -12px;
  right: 18px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #DC2626;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
}

.parasite-note { margin: 0; font-size: 13px; color: #FCA5A5; }

.mirror-telemetry-list {
  list-style: none;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.58);
  border: 1px solid rgba(220, 38, 38, 0.35);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.mirror-telemetry-list li { display: flex; justify-content: space-between; gap: 10px; color: #9CA3AF; }
.mirror-telemetry-list strong { color: #FECACA; text-align: right; }

.plan-bound-bar {
  margin-top: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.16);
  border: 1px solid rgba(220, 38, 38, 0.45);
  color: #FCA5A5;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.btn-handover {
  margin-top: auto;
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 12px 14px;
  border-radius: 8px;
  background: #7F1D1D;
  border: 1px solid #EF4444;
  color: #FEE2E2;
  font-size: 13px;
  font-weight: 700;
}

.faq-block { margin-top: 76px; }
.faq-list { display: flex; flex-direction: column; gap: 14px; }
.faq-item { border: 1px solid rgba(185, 28, 28, 0.32); border-radius: 12px; background: #130B0D; overflow: hidden; }
.faq-item.open { border-color: rgba(239, 68, 68, 0.72); }

.faq-question {
  width: 100%;
  appearance: none;
  background: transparent;
  border: none;
  color: #FDE8E8;
  padding: 18px 20px;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.faq-chevron { font-family: monospace; font-size: 20px; color: #EF4444; transition: transform 0.25s ease; }
.faq-item.open .faq-chevron { transform: rotate(45deg); }
.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.38s ease, padding 0.38s ease; padding: 0 20px; }
.faq-item.open .faq-answer { max-height: 240px; padding: 0 20px 18px; }
.faq-answer p { margin: 0; font-size: 14px; color: #D4B4B8; line-height: 1.75; }

/* ==========================================================================
   ACT 4: Sticky mmWave Apartment Radar + Incident Photo Archive
   ========================================================================== */

.section-act-4 {
  background: #060405;
  color: #EFE1E3;
}

.section-radar {
  position: relative;
  height: 240vh;
}

.radar-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 76px 20px 24px;
}

.radar-header-bar { text-align: center; }
.radar-header-bar h2 { margin: 0; font-size: clamp(20px, 2.5vw, 28px); color: #FEE2E2; }

.radar-frame {
  width: min(940px, 92vw);
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid rgba(56, 189, 248, 0.35);
  box-shadow: 0 0 60px rgba(14, 165, 233, 0.16), 0 30px 60px rgba(0, 0, 0, 0.9);
  background: #050B0E;
}

#radar-canvas { width: 100%; height: 100%; display: block; }

.radar-footer-bar {
  width: min(940px, 92vw);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  color: #7DD3FC;
}

.radar-sub-warn { color: #F87171; }

.archive-section { padding: 80px 0 96px; border-top: 1px solid rgba(185, 28, 28, 0.25); }
.archive-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 28px; }

.archive-card {
  border-radius: 14px;
  overflow: hidden;
  background: #0E080A;
  border: 1px solid rgba(185, 28, 28, 0.36);
  box-shadow: 0 24px 52px rgba(0, 0, 0, 0.8);
}

.archive-img-wrap { position: relative; aspect-ratio: 16 / 9; overflow: hidden; }
.archive-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; filter: contrast(1.1); }

.archive-stamp {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(10, 2, 4, 0.84);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
}

.archive-caption { padding: 20px 22px; }
.archive-caption h4 { margin: 0 0 8px; font-size: 18px; color: #FEE2E2; }
.archive-caption p { margin: 0; font-size: 13.5px; color: #BFA8AC; }

/* ==========================================================================
   ACT 5: Disintegrating DOM & Whispering Void (250vh)
   ========================================================================== */

.section-void {
  position: relative;
  height: 250vh;
  background: radial-gradient(circle at 50% 50%, #120609 0%, #040203 75%);
}

.void-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.void-parallax-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.void-whisper {
  position: absolute;
  color: rgba(239, 68, 68, 0.42);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-shadow: 0 0 18px rgba(220, 38, 38, 0.35);
}

.w1 { top: 14%; left: 10%; font-size: 28px; transform: rotate(-6deg); }
.w2 { top: 22%; right: 12%; font-size: 22px; transform: rotate(5deg); }
.w3 { top: 46%; left: 8%; font-size: 20px; transform: rotate(3deg); }
.w4 { top: 58%; right: 14%; font-size: 26px; transform: rotate(-4deg); }
.w5 { bottom: 20%; left: 16%; font-size: 24px; transform: rotate(-8deg); }
.w6 { bottom: 14%; right: 10%; font-size: 19px; transform: rotate(6deg); }
.w7 { top: 32%; left: 46%; font-size: 32px; color: rgba(255, 255, 255, 0.14); }

.void-fragments {
  position: relative;
  z-index: 4;
  width: min(860px, 90vw);
  display: grid;
  gap: 24px;
}

.broken-card {
  padding: 20px 24px;
  border-radius: 10px;
  background: rgba(12, 6, 8, 0.88);
  border: 1px solid rgba(220, 38, 38, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.9);
}

.frag-1 { transform: rotate(-2.4deg) translateX(-18px); }
.frag-2 { transform: rotate(2.1deg) translateX(22px); }
.frag-3 { transform: rotate(-1.2deg); }

.frag-tag { font-family: monospace; font-size: 11px; color: #EF4444; letter-spacing: 0.12em; }
.broken-card p { margin: 8px 0 0; font-size: 16px; color: #FEE2E2; }

/* ==========================================================================
   ACT 6: Sticky 4-Channel CCTV -> Fullscreen Breach (340vh)
   ========================================================================== */

.section-surveillance { position: relative; height: 340vh; background: #040405; }

.surveillance-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 76px 20px 24px;
}

.warning-glitch {
  display: inline-block;
  padding: 6px 16px;
  border: 1px solid rgba(239, 68, 68, 0.6);
  background: rgba(69, 10, 10, 0.68);
  color: #FCA5A5;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-shadow: 2px 0 rgba(239, 68, 68, 0.8), -2px 0 rgba(34, 211, 238, 0.45);
}

.cam-monitor-frame {
  width: min(980px, 92vw);
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid #1E2923;
  box-shadow: 0 0 65px rgba(16, 48, 28, 0.38), 0 30px 70px rgba(0, 0, 0, 0.92);
  background: #050906;
}

#cam-canvas { width: 100%; height: 100%; display: block; }

.surveillance-hud-footer {
  width: min(980px, 92vw);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  color: #86EFAC;
}

.cam-hint-sub { color: #EF4444; }

/* ==========================================================================
   ACT 7 & ACT 8: Sticky Flashlight Room & Multi-Beat Climax (340vh each)
   ========================================================================== */

.section-abyss,
.section-climax {
  position: relative;
  height: 340vh;
  background: #020203;
}

.abyss-sticky,
.climax-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  background: #020203;
}

#abyss-canvas,
#climax-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.abyss-overlay,
.climax-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 36px 24px 48px;
}

.flashlight-hint {
  padding: 8px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(226, 232, 240, 0.72);
  font-size: 13px;
  letter-spacing: 0.08em;
}

body.breach-active #slam-hint { opacity: 0; }

.breach-ui {
  width: min(760px, 92vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

body.breach-visual-ready .breach-ui { opacity: 1; transform: translateY(0); }

.breach-terminal {
  width: 100%;
  padding: 18px 24px;
  background: rgba(8, 1, 2, 0.86);
  border: 1px solid rgba(239, 68, 68, 0.75);
  box-shadow: 0 0 42px rgba(153, 27, 27, 0.6);
  text-align: center;
}

.breach-code {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: #EF4444;
  margin-bottom: 6px;
}

.breach-line {
  margin: 0;
  color: #FEE2E2;
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 700;
  text-shadow: 0 0 12px rgba(239, 68, 68, 0.65);
}

.breach-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.breach-actions.visible { opacity: 1; pointer-events: auto; }

.btn-breach-wake,
.btn-breach-reset {
  appearance: none;
  padding: 13px 22px;
  border-radius: 6px;
  font-family: "JetBrains Mono", "PingFang SC", monospace;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.btn-breach-wake {
  background: rgba(127, 29, 29, 0.9);
  color: #FEE2E2;
  border: 1px solid #EF4444;
  box-shadow: 0 0 24px rgba(220, 38, 38, 0.45);
}

.btn-breach-reset {
  background: rgba(12, 12, 16, 0.9);
  color: #D1D5DB;
  border: 1px solid rgba(255, 255, 255, 0.25);
}

body.breach-visual-ready .climax-sticky { animation: breach-shudder 0.2s infinite; }
body.slam-jolt .climax-sticky { animation: slam-jolt 0.3s ease-out; }
body.ambush-jolt .abyss-sticky { animation: slam-jolt 0.35s ease-out; }

/* ==========================================================================
   Haunted Live Support Chat Widget (#lumina-chat)
   ========================================================================== */

.lumina-chat {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 86;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

body.breach-active .lumina-chat {
  opacity: 0;
  pointer-events: none;
}

.chat-launcher {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.24);
}

.launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10B981;
}

.lumina-chat.haunted .launcher-dot {
  background: #EF4444;
  box-shadow: 0 0 10px #EF4444;
}

.chat-unread {
  display: none;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #EF4444;
  color: #FFF;
  font-size: 11px;
  align-items: center;
  justify-content: center;
}

.chat-unread.show { display: inline-flex; }

.chat-panel {
  width: min(340px, 90vw);
  border-radius: 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
  overflow: hidden;
  display: none;
  flex-direction: column;
}

.lumina-chat.open .chat-panel { display: flex; }

.lumina-chat.haunted .chat-panel {
  background: #10090B;
  border-color: rgba(220, 38, 38, 0.55);
  color: #FEE2E2;
}

.chat-header {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-agent { display: flex; align-items: center; gap: 10px; }

.chat-avatar-img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: none;
  filter: contrast(1.5) grayscale(1);
}

.lumina-chat.possessed .chat-avatar-img { display: block; }
.lumina-chat.possessed .chat-avatar-dot { display: none; }

.chat-avatar-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10B981;
}

.lumina-chat.haunted .chat-avatar-dot { background: #EF4444; }
.chat-title { font-size: 13px; font-weight: 700; }
.chat-subtitle { font-size: 11px; color: var(--text-muted); }

.chat-close {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
}

.chat-messages {
  padding: 14px;
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chat-msg {
  max-width: 88%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12.5px;
  line-height: 1.5;
}

.chat-msg.bot {
  align-self: flex-start;
  background: var(--bg-subtle);
  color: var(--text-main);
}

.lumina-chat.haunted .chat-msg.bot {
  background: rgba(127, 29, 29, 0.28);
  border: 1px solid rgba(220, 38, 38, 0.35);
  color: #FECACA;
}

.chat-msg.user {
  align-self: flex-end;
  background: var(--accent);
  color: #FFF;
}

.chat-typing {
  display: none;
  padding: 0 14px 8px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.chat-typing.active { display: block; }

.chat-quick-replies {
  padding: 0 14px 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-reply-btn {
  appearance: none;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-main);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  cursor: pointer;
}

.chat-input-fake {
  padding: 10px 14px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}

/* ==========================================================================
   Cookie Consent Banner
   ========================================================================== */

.cookie-banner {
  position: fixed;
  left: 20px;
  right: 20px;
  bottom: 76px;
  z-index: 90;
  max-width: 960px;
  margin: 0 auto;
  padding: 18px 22px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border: 1px solid #CBD5E1;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  color: #0F172A;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.cookie-banner.hidden { opacity: 0; transform: translateY(30px); pointer-events: none; }
.cookie-content { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.cookie-text { flex: 1 1 420px; }
.cookie-text strong { display: block; font-size: 14px; margin-bottom: 4px; }
.cookie-text p { margin: 0; font-size: 12px; color: #475569; }
.cookie-buttons { display: flex; gap: 10px; }

/* ==========================================================================
   Keyframes & Responsive
   ========================================================================== */

@keyframes pulse-dot { 0%, 100% { r: 4; opacity: 1; } 50% { r: 7; opacity: 0.45; } }
@keyframes crimson-pulse { 0%, 100% { box-shadow: 0 0 24px rgba(220, 38, 38, 0.28); } 50% { box-shadow: 0 0 42px rgba(220, 38, 38, 0.56); } }
@keyframes breach-shudder { 0% { transform: translate(0, 0); } 25% { transform: translate(-3px, 2px); } 50% { transform: translate(3px, -2px); } 75% { transform: translate(-2px, -3px); } 100% { transform: translate(2px, 2px); } }
@keyframes slam-jolt { 0% { transform: translate(0, 0) scale(1); } 20% { transform: translate(-9px, 6px) scale(1.02); } 45% { transform: translate(7px, -5px) scale(1.01); } 75% { transform: translate(-4px, 3px); } 100% { transform: translate(0, 0); } }
@keyframes vhs-flash { 0% { transform: translateY(0); } 50% { transform: translateY(-4px); } 100% { transform: translateY(3px); } }

@media (max-width: 960px) {
  .hero-grid,
  .craft-showcase,
  .report-showcase,
  .features-grid,
  .reviews-grid,
  .team-grid,
  .pricing-grid,
  .archive-grid,
  .metrics-bar {
    grid-template-columns: 1fr;
  }

  .nav-links { display: none; }
  body[data-stage="3"] .crooked-left,
  body[data-stage="3"] .crooked-right { transform: none; }
}

/* ==========================================================================
   Multi-Loop Cognitive Filter Decay & Act 9 Truth Cinema Finale
   ========================================================================== */

/* Hero Decay Layer & Void Corridor Backdrop */
.hero-img.decay-img {
  opacity: 0;
  transition: opacity 0.6s ease;
}

.void-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.28;
  filter: contrast(1.25) brightness(0.75);
  pointer-events: none;
}

/* Loop 1 (82%): Almost completely normal sunlit SaaS look! */
body[data-loop="1"] .filter-hud {
  background: rgba(255, 255, 255, 0.92);
  border-color: #CBD5E1;
  color: #0F172A;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
body[data-loop="1"] .filter-loop-label { color: #334155; }
body[data-loop="1"] .filter-pct-text { color: #4F46E5; }
body[data-loop="1"] .filter-bar-track { background: #E2E8F0; }
body[data-loop="1"] .filter-bar-fill { background: linear-gradient(90deg, #4F46E5, #0EA5E9); }
body[data-loop="1"] .btn-fast-dive {
  background: #EEF2FF;
  border-color: #C7D2FE;
  color: #3730A3;
}
body[data-loop="1"] .btn-hud-reset {
  background: #F1F5F9;
  border-color: #CBD5E1;
  color: #475569;
}

/* Loop 2 (54%): Bruised aged paper, translucent ghost overlay, mild crooked tilt */
body[data-loop="2"] {
  --bg-page: #DFDDD4;
  --bg-surface: #E5E3DA;
  --bg-subtle: #D5D2C8;
  --border-color: #9CA3AF;
  --nav-bg: rgba(223, 221, 212, 0.92);
}
body[data-loop="2"] .hero-img.overlay-img { opacity: 0.48; }
body[data-loop="2"] #act-1 .feature-card:nth-child(2) { transform: rotate(-1.4deg); }
body[data-loop="2"] #act-1 .feature-card:nth-child(3) { transform: rotate(1.2deg); }
body[data-loop="2"] #act-1 .hero-title,
body[data-loop="2"] #act-1 h2 {
  text-shadow: 1.5px 0 rgba(220, 38, 38, 0.45), -1.5px 0 rgba(14, 165, 233, 0.35);
}

/* Loop 3 (23%): Dark morgue charcoal, decay-hero reveal, CSS clip-path RGB slicing */
body[data-loop="3"] {
  --bg-page: #11080A;
  --bg-surface: #1A0E11;
  --bg-subtle: #231115;
  --text-main: #E7D6D8;
  --text-muted: #A4868B;
  --accent: #DC2626;
  --border-color: rgba(220, 38, 38, 0.48);
  --nav-bg: rgba(16, 7, 9, 0.94);
}
body[data-loop="3"] .hero-img.decay-img { opacity: 1; }
body[data-loop="3"] #act-1 .feature-card:nth-child(1) { transform: rotate(-2.4deg) translateY(6px); }
body[data-loop="3"] #act-1 .feature-card:nth-child(2) { transform: rotate(2.1deg) translateY(-4px); }
body[data-loop="3"] #act-1 .feature-card:nth-child(3) { transform: rotate(-1.6deg) translateY(8px); }
body[data-loop="3"] .pricing-card,
body[data-loop="3"] .review-card {
  border-color: rgba(239, 68, 68, 0.52);
  box-shadow: 0 0 26px rgba(153, 27, 27, 0.28);
}

/* Loop 4 (4% -> 0%): Total visual apocalypse, void-corridor bleed, violent glitch slicing */
body[data-loop="4"] {
  --bg-page: #040203;
  --bg-surface: #0B0406;
  --bg-subtle: #14070A;
  --text-main: #FECACA;
  --text-muted: #9E6E74;
  --accent: #EF4444;
  --border-color: rgba(239, 68, 68, 0.65);
  --nav-bg: rgba(4, 2, 3, 0.96);
}
body[data-loop="4"]::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  background: url("assets/void-corridor.png") center / cover no-repeat;
  opacity: 0.24;
  filter: contrast(1.3) saturate(0.4);
  pointer-events: none;
}
body[data-loop="4"] #page-wrapper { position: relative; z-index: 2; }
body[data-loop="4"] .hero-img.decay-img {
  opacity: 1;
  filter: contrast(1.28) saturate(0.7);
  animation: decay-tremble 0.24s infinite;
}
body[data-loop="4"] #act-1 .partner-bar { opacity: 0.42; transform: skewX(-4deg); }
body[data-loop="4"] #act-1 .feature-card:nth-child(1) { transform: rotate(-3.8deg) skewX(-2deg); }
body[data-loop="4"] #act-1 .feature-card:nth-child(2) { transform: rotate(3.2deg) translateY(-10px); }
body[data-loop="4"] #act-1 .feature-card:nth-child(3) { transform: rotate(-2.9deg) translateX(8px); }
body[data-loop="4"] .metrics-bar { transform: skewX(2deg) rotate(-0.8deg); border-color: #EF4444; }
body[data-loop="4"] .review-card:nth-child(odd) { transform: rotate(-1.8deg); }
body[data-loop="4"] .review-card:nth-child(even) { transform: rotate(1.6deg); }

/* CSS clip-path: polygon() RGB Analog Glitch Slicing on Loop 3 & Loop 4 */
body[data-loop="3"] .analog-glitch,
body[data-loop="4"] .analog-glitch {
  position: relative;
  text-shadow: 2px 0 rgba(255, 0, 85, 0.72), -2px 0 rgba(0, 255, 255, 0.5);
}

body[data-loop="3"] .analog-glitch::before,
body[data-loop="3"] .analog-glitch::after,
body[data-loop="4"] .analog-glitch::before,
body[data-loop="4"] .analog-glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  pointer-events: none;
}

body[data-loop="3"] .analog-glitch::before,
body[data-loop="4"] .analog-glitch::before {
  left: 2px;
  text-shadow: -2px 0 #ff0055;
  animation: analog-slice 2.4s infinite linear alternate-reverse;
}

body[data-loop="3"] .analog-glitch::after,
body[data-loop="4"] .analog-glitch::after {
  left: -2px;
  text-shadow: 2px 0 #00ffff;
  animation: analog-slice 1.7s infinite linear alternate-reverse;
}

body[data-loop="4"] .analog-glitch::before { animation-duration: 0.9s; }
body[data-loop="4"] .analog-glitch::after { animation-duration: 0.7s; }

.dual-lie-strike {
  display: block;
  text-decoration: line-through;
  opacity: 0.52;
  font-size: 0.86em;
}

.dual-lie-truth {
  display: block;
  margin-top: 4px;
  color: #B91C1C;
  font-weight: 700;
}

body[data-loop="3"] .dual-lie-truth,
body[data-loop="4"] .dual-lie-truth {
  color: #FCA5A5;
}

@keyframes analog-slice {
  0% { clip-path: polygon(0 12%, 100% 12%, 100% 16%, 0 16%); transform: translate(0); }
  15% { clip-path: polygon(0 72%, 100% 72%, 100% 82%, 0 82%); transform: translate(-5px, 2px); }
  30% { clip-path: polygon(0 38%, 100% 38%, 100% 44%, 0 44%); transform: translate(4px, -1px); }
  50% { clip-path: polygon(0 2%, 100% 2%, 100% 8%, 0 8%); transform: translate(-3px, 2px); }
  75% { clip-path: polygon(0 58%, 100% 58%, 100% 66%, 0 66%); transform: translate(3px, 0); }
  100% { clip-path: polygon(0 26%, 100% 26%, 100% 31%, 0 31%); transform: translate(-2px, -1px); }
}

@keyframes decay-tremble {
  0% { transform: scale(1.03) translate(0, 0); }
  25% { transform: scale(1.03) translate(-2px, 1px); }
  50% { transform: scale(1.04) translate(2px, -1px); }
  75% { transform: scale(1.03) translate(-1px, -2px); }
  100% { transform: scale(1.03) translate(1px, 1px); }
}

/* Compressed sticky section heights on subsequent awakenings so replay feels punchy */
body[data-loop="1"] .section-radar,
body[data-loop="1"] .section-void,
body[data-loop="1"] .section-surveillance,
body[data-loop="1"] .section-abyss,
body[data-loop="1"] .section-climax { height: 220vh; }

body[data-loop="2"] .section-radar,
body[data-loop="2"] .section-void,
body[data-loop="2"] .section-surveillance,
body[data-loop="2"] .section-abyss,
body[data-loop="2"] .section-climax { height: 190vh; }

body[data-loop="3"] .section-radar,
body[data-loop="3"] .section-void,
body[data-loop="3"] .section-surveillance,
body[data-loop="3"] .section-abyss,
body[data-loop="3"] .section-climax { height: 175vh; }

body[data-loop="4"] .section-radar,
body[data-loop="4"] .section-void,
body[data-loop="4"] .section-surveillance,
body[data-loop="4"] .section-abyss,
body[data-loop="4"] .section-climax { height: 160vh; }

/* Loop 4 Shattered Memory Ruins Banner */
.loop4-ruins {
  display: none;
  margin-bottom: 28px;
  padding: 20px 24px;
  border-radius: 10px;
  background: rgba(18, 4, 7, 0.92);
  border: 1px solid rgba(239, 68, 68, 0.65);
  box-shadow: 0 0 36px rgba(153, 27, 27, 0.45);
  font-family: "JetBrains Mono", "PingFang SC", monospace;
}
body[data-loop="4"] .loop4-ruins { display: block; }
.ruins-tag { font-size: 11px; letter-spacing: 0.14em; color: #EF4444; font-weight: 700; margin-bottom: 10px; }
.loop4-ruins p { margin: 4px 0; font-size: 13.5px; color: #FCA5A5; }
.loop4-ruins .ruins-scream { margin-top: 10px; font-size: 18px; font-weight: 800; color: #FEE2E2; letter-spacing: 0.12em; }

/* Diegetic Cognitive Filter HUD */
.filter-hud {
  position: fixed;
  top: 80px;
  left: 18px;
  z-index: 84;
  width: 248px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(10, 5, 7, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(220, 38, 38, 0.48);
  color: #FEE2E2;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.55);
  display: none;
  flex-direction: column;
  gap: 8px;
}

body:not([data-loop="0"]) .filter-hud { display: flex; }
body.breach-active .filter-hud,
body.truth-active .filter-hud { opacity: 0; pointer-events: none; }

.filter-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: "JetBrains Mono", "PingFang SC", monospace;
  font-size: 11.5px;
  font-weight: 700;
}

.filter-loop-label { color: #FCA5A5; }
.filter-pct-text { color: #EF4444; }

.filter-bar-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.filter-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #DC2626, #F87171);
  transition: width 0.45s ease;
}

.filter-hud-actions {
  display: flex;
  gap: 6px;
}

.btn-fast-dive {
  flex: 1;
  appearance: none;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(239, 68, 68, 0.5);
  background: rgba(127, 29, 29, 0.45);
  color: #FEE2E2;
  font-family: "JetBrains Mono", "PingFang SC", monospace;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.btn-hud-reset {
  appearance: none;
  padding: 6px 9px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.08);
  color: #D1D5DB;
  font-size: 12px;
  cursor: pointer;
}

/* Awakening Transition Curtain */
.awakening-curtain {
  position: fixed;
  inset: 0;
  z-index: 140;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.24s ease;
}

.awakening-curtain.active {
  opacity: 1;
  pointer-events: auto;
}

.curtain-eyelid {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  background: #020102;
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}
.curtain-eyelid.top { top: 0; transform: translateY(0); }
.curtain-eyelid.bottom { bottom: 0; transform: translateY(0); }
.awakening-curtain.blinking-open .curtain-eyelid.top { transform: translateY(-100%); }
.awakening-curtain.blinking-open .curtain-eyelid.bottom { transform: translateY(100%); }

.curtain-center {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 24px;
}

.awakening-title {
  font-size: clamp(28px, 5vw, 52px);
  font-weight: 800;
  color: #FEE2E2;
  letter-spacing: 0.14em;
  text-shadow: 0 0 28px rgba(220, 38, 38, 0.65);
  margin-bottom: 12px;
}

.awakening-sub {
  font-family: "JetBrains Mono", "PingFang SC", monospace;
  font-size: 14px;
  color: #FCA5A5;
  letter-spacing: 0.06em;
}

/* Act 9: Full-Screen Truth Cinema Finale */
.truth-cinema {
  position: fixed;
  inset: 0;
  z-index: 145;
  background: #020203;
  color: #F8FAFC;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
  overflow: hidden;
}

body.truth-active .truth-cinema {
  opacity: 1;
  pointer-events: auto;
}

.truth-bg-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.88;
  animation: truth-breathe 14s ease-in-out infinite alternate;
}

.truth-glass-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(0, 0, 0, 0.16) 25%, rgba(2, 1, 3, 0.88) 100%);
  pointer-events: none;
}

.truth-handprint-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.truth-handprint {
  position: absolute;
  width: 140px;
  height: 180px;
  transform: translate(-50%, -50%);
  opacity: 0.52;
  filter: blur(0.6px);
}

.truth-topbar {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.truth-status-tag {
  padding: 6px 14px;
  border-radius: 6px;
  background: rgba(6, 2, 4, 0.82);
  border: 1px solid rgba(239, 68, 68, 0.55);
  color: #FCA5A5;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.truth-mute-btn {
  appearance: none;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(6, 6, 10, 0.78);
  color: #E2E8F0;
  font-size: 12px;
  cursor: pointer;
}

.truth-stage {
  position: relative;
  z-index: 4;
  margin: auto auto 28px;
  width: min(820px, 92vw);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.truth-subtitle-box {
  padding: 26px 30px;
  border-radius: 12px;
  background: rgba(4, 3, 6, 0.86);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.truth-beat-text {
  margin: 0 0 14px;
  font-size: clamp(16px, 2.1vw, 20px);
  line-height: 1.85;
  color: #F8FAFC;
}

.truth-beat-meta {
  display: flex;
  justify-content: space-between;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
  color: #94A3B8;
}

.truth-ending-controls {
  padding: 22px 26px;
  border-radius: 12px;
  background: rgba(12, 3, 5, 0.9);
  border: 1px solid rgba(239, 68, 68, 0.65);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.truth-ending-controls.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.truth-archive-stamp {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 13px;
  font-weight: 700;
  color: #EF4444;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.truth-pound-log {
  margin: 0 0 16px;
  font-size: 14px;
  color: #FECACA;
}

.truth-btn-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-pound-glass,
.btn-truth-reset {
  appearance: none;
  padding: 12px 20px;
  border-radius: 8px;
  font-family: "JetBrains Mono", "PingFang SC", monospace;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.btn-pound-glass {
  background: rgba(153, 27, 27, 0.9);
  color: #FEE2E2;
  border: 1px solid #EF4444;
}

.btn-truth-reset {
  background: rgba(15, 23, 42, 0.92);
  color: #CBD5E1;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

body.truth-pound-jolt .truth-cinema {
  animation: slam-jolt 0.3s ease-out;
}

@keyframes truth-breathe {
  0% { transform: scale(1.0); }
  100% { transform: scale(1.06); }
}
