/* ═══ background.css — v3 module. Owner: B1 (see SPEC.md v3 ownership).
   Layer contract: #wa-aurora is fixed, inset 0, z-index var(--z-mesh) — below ALL
   content, pointer-events:none. The WRAPPER carries the static fallback gradient;
   the canvas paints the WebGL aurora on top of it when (and only when) it runs.
   Fallback chain is therefore automatic: any time the canvas is absent, hidden,
   or never lit, the gradient underneath shows through. All motion gated in JS on
   html.wa-anim + prefers-reduced-motion (DESIGN_LAW #6, #9). ═══ */

#wa-aurora{
  position:fixed;
  inset:0;
  z-index:var(--z-mesh,0);
  pointer-events:none;
  overflow:hidden;
  /* Static fallback: multi-stop ink field, every stop inside the shader palette
     (#0B0A08 → #211D17, i.e. within ±8% luminance of --primary #131110), plus one
     whisper of gold at 0.04 alpha (≤0.05 cap). This is what no-JS, no-WebGL,
     reduced-motion, and perf-gated users see. */
  background:
    radial-gradient(120% 90% at 14% 8%,  var(--aurora-a) 0%, rgba(var(--aurora-a-rgb),0) 55%),
    radial-gradient(110% 85% at 86% 88%, var(--aurora-b) 0%, rgba(var(--aurora-b-rgb),0) 58%),
    radial-gradient(70% 55% at 68% 30%,  rgba(var(--accent-rgb),0.04) 0%, rgba(var(--accent-rgb),0) 60%),
    linear-gradient(158deg, #0B0A08 0%, var(--primary) 48%, #1C1913 100%);
}

#wa-aurora-canvas{
  position:absolute;
  inset:0;
  width:100%;               /* CSS-scaled up; backing store is ≤0.5× device px (JS) */
  height:100%;
  display:block;
  opacity:0;                /* JS adds .is-live after the first rendered frame */
  transition:opacity var(--dur-max,600ms) var(--ease-soft,cubic-bezier(.4,0,.2,1));
}
#wa-aurora-canvas.is-live{opacity:1;}

/* Belt-and-braces: even if JS never runs its teardown, reduced-motion users
   must land on the static gradient (tokens.css also neutralises the fade). */
@media (prefers-reduced-motion: reduce){
  #wa-aurora canvas{display:none!important;}
}
