/* EQUILIBRIUM — PASS 25
   Sticky-scene hardening. Keep overrides narrowly scoped to experiences that
   still need them. Page-owned sticky choreography must remain authoritative. */

/* -------------------------------------------------------------------------- */
/* RÊVERIE: one sticky owner only.                                             */
/* -------------------------------------------------------------------------- */
.reverie-entry-minimal__stage{
  position:relative!important;
  min-height:0!important;
  overflow:visible!important;
}

.reverie-entry-minimal__sketch{
  position:relative!important;
  top:auto!important;
  min-height:0!important;
}

.reverie-sketchbook,
.reverie-sketchbook__journey{
  overflow:visible!important;
}

.reverie-sketchbook__journey{
  position:relative!important;
  min-height:560svh!important;
}

.reverie-sketchbook__stage{
  position:sticky!important;
  top:calc(env(safe-area-inset-top, 0px) + .45rem)!important;
  height:calc(100svh - env(safe-area-inset-top, 0px) - .9rem)!important;
  min-height:0!important;
  max-height:none!important;
  overflow:hidden!important;
}

/* Gamer Lucide, Quantum and Resonance deliberately have no Pass25 runway
   override here. Their current components own their stage/journey heights.
   Earlier forced min-heights created empty tails and black tunnels on mobile. */

/* React-generated Kaguya runtime does not inherit Astro's scoped style token.
   Give the canvas an explicit global viewport contract so it cannot collapse to
   its intrinsic 300x150 size behind the hero. */
.kaguya-stage .kaguya-runtime{
  position:absolute!important;
  inset:0!important;
  z-index:0!important;
  width:100%!important;
  height:100%!important;
  min-width:0!important;
  min-height:0!important;
  overflow:hidden!important;
  background:#05070b!important;
}
.kaguya-stage .kaguya-runtime canvas{
  display:block!important;
  width:100%!important;
  height:100%!important;
}

/* Immersive canvases must never sit above the global mobile navigation. */
body:has(.reverie-sketchbook) .nav-shell,
body:has(.quantum-journey) .nav-shell,
body:has(.trippy-journey) .nav-shell,
body:has(.lucid-room) .nav-shell,
body:has(.resonance-v2) .nav-shell,
.kaguya-page .nav-shell{z-index:12000!important}
body:has(.reverie-sketchbook) .nav-drawer,
body:has(.quantum-journey) .nav-drawer,
body:has(.trippy-journey) .nav-drawer,
body:has(.lucid-room) .nav-drawer,
body:has(.resonance-v2) .nav-drawer,
.kaguya-page .nav-drawer{z-index:12100!important}
body:has(.reverie-sketchbook) .nav-drawer-backdrop,
body:has(.quantum-journey) .nav-drawer-backdrop,
body:has(.trippy-journey) .nav-drawer-backdrop,
body:has(.lucid-room) .nav-drawer-backdrop,
body:has(.resonance-v2) .nav-drawer-backdrop,
.kaguya-page .nav-drawer-backdrop{z-index:12050!important}

@media (max-width: 52rem){
  .reverie-sketchbook__journey{min-height:640svh!important}
  .reverie-sketchbook__stage{
    top:0!important;
    height:100dvh!important;
    min-height:0!important;
  }

  /* Keep the native Resonance scene compact while reserving room around the
     fixed global Chat/Live dock. No artificial scroll runway is introduced. */
  .resonance-hero{
    top:max(6.4rem,calc(env(safe-area-inset-top, 0px) + 5.55rem))!important;
  }
  .signal-readout{
    bottom:max(12.4rem,calc(env(safe-area-inset-bottom, 0px) + 11.8rem))!important;
  }
  .frequency-rail-wrap{
    bottom:max(2.75rem,calc(env(safe-area-inset-bottom, 0px) + 2.25rem))!important;
  }

  .kaguya-copy{
    top:max(6.35rem,calc(env(safe-area-inset-top, 0px) + 5.55rem))!important;
  }
  .kaguya-modes{
    bottom:max(2.75rem,calc(env(safe-area-inset-bottom, 0px) + 2.25rem))!important;
  }
}

@media (max-width: 52rem) and (max-height: 47.5rem){
  .resonance-hero p{display:none!important}
  .resonance-hero h1{font-size:clamp(2.45rem,12vw,3.75rem)!important}
  .signal-readout{bottom:max(10.8rem,calc(env(safe-area-inset-bottom, 0px) + 10.3rem))!important}
  .kaguya-copy p{display:none!important}
  .kaguya-copy h1{font-size:clamp(2.65rem,14vw,4.35rem)!important}
}

@media (max-width: 34rem){
  .reverie-sketchbook__journey{min-height:700svh!important}
}
