/* Cosmic Walk — measured chapters and a persistent, reversible hero. */
:root { --nh-cosmic-vh: 100svh; }
html { overflow-x: clip !important; overflow-y: auto !important; }
body { overflow: visible !important; }
.scroll-container { overflow: visible !important; }
.chapter-section,
.scroll-container > .chapter-section:not(#chapter-intro):not(#chapter-sun),
#chapter-intro.intro-section,
#chapter-sun.epilogue-hero,
#chapter-x.chapter-section.centered {
  display: block !important;
  position: relative !important;
  height: calc(var(--nh-cosmic-vh) * 1.8) !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}
#chapter-intro.intro-section { height: calc(var(--nh-cosmic-vh) * 1.6) !important; }
#chapter-sun.epilogue-hero { height: calc(var(--nh-cosmic-vh) * 1.4) !important; }
.nh-chapter-stage {
  position: sticky;
  top: 0;
  height: var(--nh-cosmic-vh);
  box-sizing: border-box;
  display: flex;
  align-items: center;
  padding: 104px 8vw 70px;
  pointer-events: none;
}
.right-aligned > .nh-chapter-stage { justify-content: flex-end; }
.left-aligned > .nh-chapter-stage,
#chapter-x > .nh-chapter-stage { justify-content: flex-start; }
#chapter-intro > .nh-chapter-stage,
#chapter-sun > .nh-chapter-stage { align-items: flex-end; justify-content: center; }
.nh-chapter-stage .content-wrapper { min-width: 0; }
.vortex-section { min-height: 64svh; height: auto; padding-block: 12svh; }
#chapter-intro .intro-content-wrapper { max-width: 100% !important; }
#chapter-intro .intro-subtitle { text-wrap: balance; }
.chapter-section h2 { text-wrap: balance; overflow-wrap: normal; hyphens: none; }
@media (max-width: 768px), (max-width: 1000px) and (orientation: portrait) {
  .nh-chapter-stage {
    align-items: flex-end;
    padding: max(88px, env(safe-area-inset-top)) max(20px, env(safe-area-inset-right)) max(28px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left));
  }
  .scroll-container .chapter-section .nh-chapter-stage .content-wrapper {
    width: 100% !important; max-width: 40rem !important;
    padding: 0 !important; text-align: left !important;
    background: transparent !important; border: 0 !important;
    box-shadow: none !important; backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
  .scroll-container #chapter-x .content-wrapper { max-width: 40rem !important; text-align: left !important; }
  .chapter-section h2 { font-size: clamp(1.48rem, 4.5vw, 2rem) !important; line-height: 1.12 !important; margin-bottom: 8px !important; }
  .nh-chapter-stage .main-statement { font-size: clamp(.92rem, 2.3vw, 1.05rem) !important; line-height: 1.36 !important; margin-bottom: 8px !important; }
  .nh-chapter-stage .details { font-size: clamp(.82rem, 2vw, .95rem) !important; line-height: 1.46 !important; }
  .nh-chapter-stage .details { max-width: 52ch; }
  .nh-chapter-stage .content-wrapper::before { display: none !important; }
  #chapter-intro .intro-content-wrapper { gap: 16px !important; }
}
@media (max-height: 540px) and (orientation: landscape) {
  .nh-chapter-stage { padding: 80px 5vw 22px; }
  .scroll-container .chapter-section .nh-chapter-stage .content-wrapper,
  .scroll-container #chapter-x .content-wrapper { max-width: 46% !important; }
  .chapter-section h2 { font-size: clamp(1.1rem, 3vw, 1.65rem) !important; }
  .nh-chapter-stage .details { font-size: .76rem !important; line-height: 1.35 !important; }
  .nh-chapter-stage .main-statement { font-size: .82rem !important; }
  #chapter-intro .intro-content-wrapper { flex-direction: row !important; }
  .scroll-container #chapter-sun h2 { font-size: 1.25rem !important; line-height: 1.15 !important; }
}
