/*
 * BEAST OF AFRICA — global-video-bg.css  v3.0  (Phase 0 rebuild)
 *
 * What changed vs v2.1 (the version that "caused blurs + freezing"):
 *  • No GPU `filter: brightness()` animated on the <video> itself — that was
 *    the compositing cost that froze on mobile / mid-range GPUs. Darkening is
 *    now a single static gradient on ::after, which the compositor handles
 *    almost for free.
 *  • The ~100 `!important` "nuclear" overrides are gone. #boaVideoBg is a
 *    direct child of <body>, so position:fixed is not trapped; we only keep
 *    the minimal guards that matter.
 *  • Inner-page hero backgrounds are NO LONGER force-hidden. The video sits
 *    at z-index:-1 behind self-sufficient pages, so toggling it off can never
 *    strip a hero's own background again.
 *  • Mobile + reduced-motion fall back to a static graded backdrop (no video).
 *
 * Z-index: -1 #boaVideoBg · 1000 header · 1999 drawer · 5000 modals
 */

#boaVideoBg {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  /* Static fallback shown before the video is ready, on mobile, and when
     reduced-motion / save-data suppress playback entirely. */
  background:
    radial-gradient(ellipse 90% 70% at 50% 18%, #16302a 0%, transparent 60%),
    linear-gradient(180deg, #0c1a15 0%, #081210 100%);
}

#boaVideoBg video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  /* Fade in only once the controller marks it ready — avoids a black flash. */
  opacity: 0;
  transition: opacity .8s ease;
  /* Promote to its own layer for smooth playback, but NO filter. */
  transform: translateZ(0);
}

#boaVideoBg.boa-video-ready video {
  opacity: 1;
}

/* Cinematic colour grade — the darkening lives here, not on the video. */
#boaVideoBg::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(8,14,12,.30) 0%, rgba(8,14,12,.55) 55%, rgba(8,14,12,.92) 100%),
    linear-gradient(90deg, rgba(8,14,12,.55) 0%, transparent 40%, transparent 60%, rgba(8,14,12,.45) 100%),
    radial-gradient(ellipse 80% 60% at 50% 80%, rgba(12,28,20,.30) 0%, transparent 70%);
}

/* Minimal guard: ancestors of a position:fixed element must not create a
   transform/filter stacking context. We scope this to html/body only — far
   safer than the old blanket overrides. */
html { background: #081210; }
body.boa-platform { background: transparent; }

/* On phones we never attach the video (controller skips it); show the static
   backdrop only and drop the side vignettes so text stays legible. */
@media (max-width: 768px) {
  #boaVideoBg video { display: none; }
  #boaVideoBg::after {
    background: linear-gradient(180deg, rgba(8,14,12,.45) 0%, rgba(8,14,12,.92) 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  #boaVideoBg video { display: none; }
}
