/* Everything decorative stays in #bg-gallery's existing z-index:0 context.
   The existing contrast overlay and semantic interface remain above it. */
#bg-gallery[data-world] {
  overflow: hidden;
  background: #07080a;
  isolation: isolate;
}

#bg-poster,
#bg-poster img,
#landing-world-fx-host,
#landing-world-fx-host canvas,
#landing-return-veil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#bg-poster { z-index: 0; }
#bg-poster img { object-fit: cover; object-position: 50% 50%; }
#bg-gallery[data-world] #bg-video { z-index: 1; opacity: 0; transition: none; }
#bg-gallery[data-world][data-media-visible] #bg-video { opacity: 1; }
#landing-world-fx-host { z-index: 2; overflow: hidden; }
#landing-world-fx-host canvas { display: block; }
#landing-return-veil {
  z-index: 3;
  opacity: 0;
  /* Canonical horizon placement is updated from the cached cover transform.
     No screen-wide darkening or transform is applied to the source video. */
  background: linear-gradient(to bottom,
    transparent 0%, rgb(var(--world-horizon-rgb, 175 166 172)) 38%,
    rgb(var(--world-horizon-rgb, 175 166 172)) 62%, transparent 100%);
  top: var(--world-horizon-top, 46%);
  height: var(--world-horizon-height, 9%);
  bottom: auto;
}

/* Night over the film's own daylight before and without the stage (night.js): multiplied toward the stage's
   night colours, a deep blue sky over a cold blue ground. Under the stage's host, which covers it once live. */
#landing-night-veil {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: multiply;
  background: linear-gradient(to bottom,
    rgb(16 18 28) 0%, rgb(22 25 38) calc(var(--world-night-horizon, 50.8%) - 4%),
    rgb(70 82 120) calc(var(--world-night-horizon, 50.8%) + 1%), rgb(70 82 120) 100%);
}

body.immersive #landing-night-veil,
body.immersive #bg-poster,
body.immersive #bg-gallery[data-world] #bg-video,
body.immersive #landing-world-fx-host,
body.immersive #landing-return-veil { opacity: 0 !important; }

#landing-motion-toggle {
  font: inherit;
  color: inherit;
}
#landing-motion-toggle:focus-visible {
  outline: 1px solid currentColor;
  outline-offset: 4px;
}
/* E1 sound: made by index.js while the stage is live, just above the pause control. */
#landing-sound-toggle {
  position: fixed; left: 1.15rem; bottom: 3.9rem; z-index: 5;
  padding: .45rem .75rem; border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 999px;
  background: rgba(7,8,10,.6); color: var(--ink-soft, rgba(255,255,255,.72)); font: inherit; font-size: .65rem; cursor: pointer;
}
#landing-sound-toggle[hidden] { display: none; }
#landing-sound-toggle:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
body.immersive #landing-sound-toggle { visibility: hidden; }
/* Reset, for the site's admin only (index.js makes it once signed in): just above the sound control. */
#landing-reset-toggle {
  position: fixed; left: 1.15rem; bottom: 6.2rem; z-index: 5;
  padding: .45rem .75rem; border: 1px solid var(--line, rgba(255,255,255,.14)); border-radius: 999px;
  background: rgba(7,8,10,.6); color: var(--ink-soft, rgba(255,255,255,.72)); font: inherit; font-size: .65rem; cursor: pointer;
}
#landing-reset-toggle:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
body.immersive #landing-reset-toggle { visibility: hidden; }

#bg-gallery[data-world-tier="0"] #landing-world-fx-host,
#bg-gallery[data-world-tier="0"] #landing-return-veil { visibility: hidden; }

@media (prefers-reduced-motion: reduce) {
  #landing-world-fx-host,
  #landing-return-veil { visibility: hidden !important; }
  #bg-gallery[data-world] *,
  #landing-motion-toggle,
  #landing-sound-toggle,
  #landing-reset-toggle { animation: none !important; transition: none !important; }
}
