/* Ambient details from the previous home, isolated from the scene timelines. */
.home-ambience-ready .continuum .stage-atmosphere::before {
  content: ''; position: absolute; inset: -18%; z-index: -1;
  /* Localized, soft pools make the drift readable. The dark scene stays above
     this layer, and radial falloff needs no animated blur filter. */
  background:
    radial-gradient(ellipse 26% 34% at 22% 30%, #D6B16C66, transparent 100%),
    radial-gradient(ellipse 28% 38% at 56% 35%, #858CE66B, transparent 100%),
    radial-gradient(ellipse 25% 35% at 80% 65%, #54D9C766, transparent 100%);
  opacity: .8; animation: home-atmosphere-drift 10s ease-in-out -2.5s infinite alternate;
}
.home-ambience-ready .continuum .stage-atmosphere .atmosphere-aqua {
  animation: home-aqua-drift 17s ease-in-out -4s infinite alternate;
}
.home-ambience-ready .continuum .stage-atmosphere .atmosphere-violet {
  animation: home-violet-drift 21s ease-in-out -8s infinite alternate;
}
.home-ambient-paused .continuum .stage-atmosphere::before,
.home-ambient-paused .continuum .stage-atmosphere .atmosphere-aqua,
.home-ambient-paused .continuum .stage-atmosphere .atmosphere-violet,
.home-hero-offscreen .continuum .stage-atmosphere::before,
.home-hero-offscreen .continuum .stage-atmosphere .atmosphere-aqua,
.home-hero-offscreen .continuum .stage-atmosphere .atmosphere-violet { animation-play-state: paused; }
.home-entering .continuum .story-copy { animation: home-copy-enter 900ms cubic-bezier(.22, 1, .36, 1) both; }
.home-entering .continuum .story-art { animation: home-art-enter 1050ms 100ms cubic-bezier(.22, 1, .36, 1) both; }
.home-cursor-glow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .home-ambience-ready .home-cursor-glow {
    display: block; position: fixed; top: 0; left: 0; width: 440px; height: 440px;
    border-radius: 50%; pointer-events: none; z-index: 90; opacity: 0; mix-blend-mode: multiply;
    background: radial-gradient(circle, #6772FF29, #54D9C717 34%, transparent 68%);
    transform: translate3d(-600px, -600px, 0); transition: opacity 350ms ease;
  }
  .home-ambience-ready .home-cursor-glow.is-active { opacity: 1; }
}
@keyframes home-atmosphere-drift {
  from { transform: translate3d(-10%, -5%, 0) rotate(-10deg); }
  to { transform: translate3d(12%, 7%, 0) rotate(10deg); }
}
@keyframes home-aqua-drift {
  from { transform: translate3d(-3vw, -2vh, 0) scale(1.06); }
  to { transform: translate3d(5vw, 5vh, 0) scale(1.16); }
}
@keyframes home-violet-drift {
  from { transform: translate3d(4vw, 3vh, 0) scale(1.12); }
  to { transform: translate3d(-4vw, -3vh, 0) scale(1.05); }
}
/* Text and CTA hit areas stay stationary throughout the loading entrance. */
@keyframes home-copy-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes home-art-enter { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }
@media (max-width: 800px) {
  .home-ambience-ready .continuum .stage-atmosphere::before {
    opacity: .6;
    background:
      radial-gradient(ellipse 55% 30% at 22% 24%, #D6B16C47, transparent 100%),
      radial-gradient(ellipse 55% 32% at 68% 68%, #54D9C759, transparent 100%);
    animation-name: home-atmosphere-drift-mobile;
  }
}
@media screen and (max-width: 800px) {
  /* Browser bars can retract beyond 100svh. Let the existing scene background
     cover that space, while its copy, artwork and navigation keep the stable
     small-viewport composition (98px top padding + 65px chapter navigation).
     The stage itself stays clipped, including the opaque night atmosphere. */
  .motion-on .continuum .continuum-stage { height: 100lvh; }
  .motion-on .continuum .stage-layout {
    height: calc(max(620px, 100svh) - 98px - 65px);
  }
}
@keyframes home-atmosphere-drift-mobile {
  from { transform: translate3d(-5%, -5%, 0); }
  to { transform: translate3d(6%, 7%, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .home-cursor-glow { display: none !important; }
  .home-ambience-ready .continuum .stage-atmosphere::before { display: none; }
  .home-ambience-ready .continuum .stage-atmosphere .atmosphere-aqua,
  .home-ambience-ready .continuum .stage-atmosphere .atmosphere-violet { animation: none; }
  .home-entering .continuum .story-copy, .home-entering .continuum .story-art { animation: none; }
}
@media print {
  .home-cursor-glow { display: none !important; }
  .home-ambience-ready .continuum .stage-atmosphere::before { display: none; }
}
