/* ==========================================================================
   LumiNest 栖居 — Progressive Psychological Decay, Corridor & Horror Climax
   Dormant at scroll=0; awakens incrementally and irreversibly.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Global Viewport FX Overlays (Dormant at top)
   -------------------------------------------------------------------------- */
.fx-vignette {
  --mouse-x: 0.5;
  --mouse-y: 0.5;
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(
      circle at calc(var(--mouse-x) * 100%) calc(var(--mouse-y) * 100%),
      transparent 18%,
      rgba(8, 4, 5, 0.62) 68%,
      rgba(3, 1, 2, 0.95) 100%
    );
  transition: opacity 0.3s linear;
}

.fx-veins-border {
  position: fixed;
  inset: 0;
  z-index: 81;
  pointer-events: none;
  opacity: 0;
  box-shadow:
    inset 0 0 90px rgba(90, 6, 12, 0.65),
    inset 0 0 28px rgba(10, 0, 2, 0.95);
}

.fx-scanlines {
  position: fixed;
  inset: 0;
  z-index: 82;
  pointer-events: none;
  opacity: 0;
  background:
    repeating-linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 0px,
      rgba(0, 0, 0, 0) 2px,
      rgba(0, 0, 0, 0.28) 3px,
      rgba(0, 0, 0, 0.28) 4px
    );
  mix-blend-mode: multiply;
}

/* Peripheral Watcher: tall shadowy head/shoulder peeking from screen edge */
.fx-peripheral-watcher {
  position: fixed;
  top: 28vh;
  right: -85px;
  width: 110px;
  height: 320px;
  z-index: 84;
  pointer-events: none;
  opacity: 0;
  transform: translateX(65px) rotate(-6deg);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  filter: blur(1.4px);
}

.fx-peripheral-watcher.is-peeking {
  opacity: 0.92;
  transform: translateX(-28px) rotate(-9deg);
}

.fx-peripheral-watcher.is-left {
  right: auto;
  left: -85px;
  transform: translateX(-65px) scaleX(-1) rotate(-6deg);
}

.fx-peripheral-watcher.is-left.is-peeking {
  opacity: 0.92;
  transform: translateX(28px) scaleX(-1) rotate(-9deg);
}

/* Single-frame subliminal flash overlay */
.fx-subliminal {
  position: fixed;
  inset: 0;
  z-index: 120;
  pointer-events: none;
  opacity: 0;
  background: #050203;
  display: grid;
  place-items: center;
}

.fx-subliminal.is-flashing {
  opacity: 1;
}

.fx-subliminal-text {
  position: absolute;
  color: #dc2626;
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  letter-spacing: 0.28em;
  text-shadow: 0 0 24px rgba(220, 38, 38, 0.9);
  font-weight: 700;
}

/* --------------------------------------------------------------------------
   Progressive Body / Darkening & Corruption States
   -------------------------------------------------------------------------- */
body.phase-uncanny .brand-dot {
  background: radial-gradient(circle at 35% 35%, #ef4444, #7f1d1d);
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.85);
  animation-duration: 1.1s;
}

body.phase-dread .site-nav {
  background: rgba(14, 12, 13, 0.88);
  border-bottom-color: rgba(153, 27, 27, 0.35);
}

body.phase-dread .brand,
body.phase-dread .nav-links a {
  color: #d6d3d1;
}

body.phase-dread .btn-nav-cta {
  background: #7f1d1d;
  color: #fecaca;
  box-shadow: 0 0 18px rgba(185, 28, 28, 0.45);
}

body.phase-dread .audio-toggle-btn {
  background: rgba(28, 20, 22, 0.9);
  border-color: rgba(185, 28, 28, 0.4);
  color: #fca5a5;
}

body.phase-dread .live-toast {
  background: rgba(18, 8, 10, 0.95);
  border-color: rgba(185, 28, 28, 0.55);
  color: #fecaca;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75);
}

body.phase-dread .live-toast-time {
  color: #ef4444;
}

/* Review Card 3 & 4 Horror Escalation */
.review-card-cursed {
  position: relative;
  overflow: hidden;
}

body.phase-dread .review-card,
body.phase-dread .bento-card,
body.phase-dread .price-card {
  background: rgba(22, 20, 21, 0.92);
  border-color: rgba(120, 53, 53, 0.26);
  color: #e7e5e4;
}

body.phase-dread .review-body,
body.phase-dread .bento-card h3,
body.phase-dread .price-tier-name,
body.phase-dread .faq-item summary {
  color: #f5f5f4;
}

body.phase-dread .bento-card p,
body.phase-dread .section-desc,
body.phase-dread .faq-item p,
body.phase-dread .price-features {
  color: #a8a29e;
}

body.phase-dread .official-reply {
  background: rgba(127, 29, 29, 0.22);
  border-left-color: #dc2626;
  color: #fecaca;
}

body.phase-dread .official-reply strong {
  color: #f87171;
}

/* Cursed Pricing Tier */
.price-card-obsolete {
  transition: opacity 0.4s ease, filter 0.4s ease;
}

body.phase-dread .price-card-obsolete {
  opacity: 0.36;
  filter: grayscale(1) blur(0.4px);
}

.price-card-cursed {
  border-color: rgba(185, 28, 28, 0.55) !important;
  box-shadow: 0 24px 60px -15px rgba(153, 27, 27, 0.35);
}

body.phase-dread .price-card-cursed {
  transform: rotate(-0.9deg) scale(1.02);
  background: linear-gradient(180deg, rgba(36, 11, 14, 0.96), rgba(15, 6, 8, 0.98)) !important;
}

.cursed-ribbon {
  position: absolute;
  top: -12px;
  right: 22px;
  padding: 4px 12px;
  border-radius: 999px;
  background: #991b1b;
  color: #fef2f2;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.price-btn-cursed {
  background: #7f1d1d !important;
  border-color: #b91c1c !important;
  color: #fef2f2 !important;
  font-family: var(--font-mono);
}

/* Scratched / bleeding text utility */
.glitch-inline {
  display: inline-block;
  position: relative;
}

body.phase-dread .glitch-jitter {
  animation: textTwitch 3.6s infinite;
}

@keyframes textTwitch {
  0%, 93%, 100% { transform: translate(0, 0) skewX(0deg); opacity: 1; }
  94% { transform: translate(-3px, 1px) skewX(-8deg); color: #ef4444; }
  95% { transform: translate(4px, -1px) skewX(6deg); opacity: 0.75; }
  96% { transform: translate(-1px, 2px) skewX(0deg); color: inherit; }
}

/* --------------------------------------------------------------------------
   Retroactive Infection (If user scrolls deep and tries scrolling BACK UP!)
   -------------------------------------------------------------------------- */
body.has-rotted-top {
  background-color: #080405 !important;
  color: #e7e5e4 !important;
}

body.has-rotted-top .hero-title {
  color: #f5f5f4;
}

body.has-rotted-top .hero-title em {
  color: #ef4444;
  text-shadow: 0 0 22px rgba(220, 38, 38, 0.55);
}

body.has-rotted-top .hero-subtitle,
body.has-rotted-top .metric-item span,
body.has-rotted-top .trust-caption {
  color: #a8a29e;
}

body.has-rotted-top .metric-item strong {
  color: #fca5a5;
}

body.has-rotted-top .trust-inner,
body.has-rotted-top .floating-glass-card {
  background: rgba(20, 10, 12, 0.88);
  border-color: rgba(185, 28, 28, 0.42);
  color: #fecaca;
}

body.has-rotted-top .glass-value {
  color: #fecaca;
}

body.has-rotted-top .btn-secondary {
  background: rgba(28, 12, 15, 0.9);
  border-color: rgba(220, 38, 38, 0.45);
  color: #fecaca;
}

body.has-rotted-top .hero-image-frame::after {
  content: "● 底座已空 · 它已经进屋了";
  position: absolute;
  left: 18px;
  bottom: 16px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(10, 2, 4, 0.82);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #ef4444;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

body.has-rotted-top .eyebrow-pill {
  background: rgba(127, 29, 29, 0.28);
  color: #f87171;
}

/* --------------------------------------------------------------------------
   Stage 5: Sticky First-Person Horror Movie Corridor (68% - 95% Scroll)
   -------------------------------------------------------------------------- */
.corridor-transition-bleed {
  height: 220px;
  background: linear-gradient(to bottom, transparent, #050304 88%);
  position: relative;
  z-index: 5;
}

.corridor-scroll-track {
  position: relative;
  height: 430vh;
  background: #040203;
  z-index: 10;
}

.corridor-sticky-viewport {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #020102;
  cursor: crosshair;
}

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

/* CCTV / LumiNest Night-Vision HUD over Corridor */
.corridor-hud {
  position: absolute;
  inset: 0;
  pointer-events: none;
  padding: 88px 34px 32px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: var(--font-mono);
  color: rgba(226, 232, 240, 0.82);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.hud-top-row,
.hud-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.hud-rec-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #ef4444;
  font-weight: 700;
}

.hud-rec-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 10px #ef4444;
  animation: recBlink 1s steps(2, start) infinite;
}

@keyframes recBlink {
  to { visibility: hidden; }
}

.hud-center-subtitles {
  align-self: center;
  text-align: center;
  max-width: 620px;
  margin-bottom: 6vh;
}

.corridor-narrative-line {
  font-family: var(--font-serif);
  font-size: clamp(1.08rem, 2vw, 1.48rem);
  color: rgba(245, 245, 244, 0.92);
  letter-spacing: 0.12em;
  line-height: 1.8;
  text-shadow: 0 2px 20px #000, 0 0 8px rgba(0, 0, 0, 0.9);
  transition: opacity 0.25s ease;
}

.hud-battery {
  color: #fbbf24;
}

.hud-battery.is-critical {
  color: #ef4444;
  animation: recBlink 0.45s steps(2, start) infinite;
}

/* --------------------------------------------------------------------------
   Stage 6: THE FINAL HORROR MOVIE CLIMAX STAGE (95% - 100% Scroll)
   -------------------------------------------------------------------------- */
.climax-scroll-trigger {
  position: relative;
  height: 145vh;
  background: #010001;
  z-index: 20;
}

.climax-sticky-scene {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000000;
  display: grid;
  place-items: center;
}

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

/* Pre-strike Mirror Reflection Bait */
.climax-bait-box {
  position: relative;
  z-index: 4;
  text-align: center;
  padding: 28px 36px;
  border: 1px solid rgba(185, 28, 28, 0.28);
  background: rgba(5, 2, 3, 0.76);
  backdrop-filter: blur(4px);
  max-width: 460px;
  transition: opacity 0.12s linear, transform 0.12s linear;
}

.climax-bait-crosshair {
  width: 58px;
  height: 58px;
  margin: 0 auto 18px;
  border: 1px dashed rgba(239, 68, 68, 0.65);
  border-radius: 50%;
  display: grid;
  place-items: center;
  animation: pulseCrosshair 1.4s ease-in-out infinite;
}

.climax-bait-crosshair::after {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ef4444;
  box-shadow: 0 0 12px #ef4444;
}

@keyframes pulseCrosshair {
  0%, 100% { transform: scale(1); opacity: 0.75; }
  50% { transform: scale(1.14); opacity: 1; }
}

.climax-bait-title {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: #ef4444;
  letter-spacing: 0.14em;
  margin-bottom: 8px;
}

.climax-bait-sub {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  color: #d6d3d1;
  letter-spacing: 0.08em;
}

/* Post-Strike Terminal Epilogue */
.climax-epilogue-modal {
  position: absolute;
  bottom: 2.8vh;
  right: 3vw;
  z-index: 8;
  width: min(440px, calc(100% - 32px));
  padding: 18px 22px;
  background: rgba(5, 1, 2, 0.78);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(185, 28, 28, 0.55);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.95), inset 0 0 24px rgba(127, 29, 29, 0.25);
  font-family: var(--font-mono);
  color: #fecaca;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.climax-epilogue-modal.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.epilogue-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.76rem;
  color: #ef4444;
  border-bottom: 1px solid rgba(185, 28, 28, 0.35);
  padding-bottom: 10px;
  margin-bottom: 14px;
}

.epilogue-typewriter {
  font-size: 0.88rem;
  line-height: 1.85;
  color: #f5f5f4;
  min-height: 78px;
  white-space: pre-line;
}

.epilogue-actions {
  margin-top: 18px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-epilogue {
  padding: 8px 15px;
  background: rgba(127, 29, 29, 0.32);
  border: 1px solid rgba(220, 38, 38, 0.5);
  color: #fecaca;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-epilogue:hover {
  background: rgba(185, 28, 28, 0.65);
}

/* Cracked Screen Glass SVG Overlay during Climax */
.climax-cracked-glass {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 6;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.08s linear;
}

.climax-cracked-glass.is-shattered {
  opacity: 0.82;
}

/* Mobile Horror Stages: Corridor HUD, Climax Modal & No Overflow */
@media (max-width: 640px) {
  body.phase-dread .price-card-cursed {
    transform: rotate(-0.4deg) scale(1);
  }

  .fx-peripheral-watcher {
    width: 78px;
    height: 220px;
    top: 32vh;
  }

  .corridor-transition-bleed {
    height: 120px;
  }

  .corridor-scroll-track {
    height: 360vh;
  }

  .corridor-hud {
    padding: 68px 14px calc(18px + env(safe-area-inset-bottom));
  }

  .hud-top-row,
  .hud-bottom-row {
    font-size: 0.65rem;
    gap: 8px;
    flex-wrap: wrap;
  }

  .hud-rec-badge {
    gap: 5px;
  }

  .hud-center-subtitles {
    max-width: 100%;
    padding: 0 6px;
    margin-top: auto;
    margin-bottom: 14px;
  }

  .corridor-narrative-line {
    font-size: 0.98rem;
    letter-spacing: 0.06em;
    line-height: 1.65;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(3, 1, 2, 0.45);
  }

  .climax-scroll-trigger {
    height: 155vh;
  }

  .climax-bait-box {
    width: calc(100% - 32px);
    padding: 20px 18px;
  }

  .climax-bait-sub {
    font-size: 0.92rem;
  }

  .climax-epilogue-modal {
    left: 14px;
    right: 14px;
    bottom: calc(14px + env(safe-area-inset-bottom));
    width: auto;
    padding: 14px 16px;
  }

  .epilogue-header {
    font-size: 0.68rem;
    padding-bottom: 7px;
    margin-bottom: 10px;
  }

  .epilogue-typewriter {
    font-size: 0.78rem;
    line-height: 1.68;
    min-height: 62px;
  }

  .epilogue-actions {
    margin-top: 12px;
    gap: 8px;
  }

  .btn-epilogue {
    flex: 1;
    padding: 9px 10px;
    font-size: 0.72rem;
    text-align: center;
  }

  body.has-rotted-top .hero-image-frame::after {
    left: 10px;
    bottom: 10px;
    font-size: 0.68rem;
    padding: 5px 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.phase-dread .glitch-jitter,
  .hud-battery.is-critical {
    animation: none;
  }
}

