/* ==========================================================================
   Aurora v2 (PORCH-WO-14ar, R18; DECISIONS #163). The one aurora layer for every
   aurora / ambient background: the CTA and ministry panels (Ambient drift), the national CTA
   veil and the WPBakery ink + Contained panels. Never the green closing panel (14ar-2, #165).
   The engine is port/site/js/aurora-veil.js; this file is everything it needs from CSS:
   - the palettes, as custom properties built from tokens (the engine reads them, so
     no colour lives in JS);
   - the host (.au): a WebGL canvas fades in over a soft CSS layer. The CSS layer is the
     resting glow without JS and the fallback without WebGL; the engine seeds it with
     the same composition through --au-x / --au-y / --au-a / --au-intensity;
   - hiding the older static glows once a panel is under the engine ([data-au]).
   14ar-4: one uniform palette ceiling protects contrast; no spatial text masks. CSS fallback uses the same ceiling and a continuous field.
   Dials: --veil-intensity, --veil-tempo, --veil-bold, --veil-blur (tokens.css).
   ========================================================================== */

/* ---- Palettes ------------------------------------------------------------- */
/* green + brand: Pine and copper (Nolan's pick, 14ar-3): pine, copper and sage over ink, green-light as the highlight. */
.au-pal--green,
.au-pal--brand    { --au-base: var(--c-ink); --au-c1: var(--c-aurora-pine); --au-c2: var(--c-aurora-copper); --au-c3: var(--c-sage); --au-hi: var(--c-green-light); }
/* national (14av, Nolan #170: the same soft look with a hint of yellow): warm ochre light, one band carrying a little of the sunflower yellow,
   a deeper ochre for depth; the yellow itself is only the highlight. Never a yellow wash. */
.au-pal--national { --au-base: var(--c-ink); --au-c1: var(--c-ochre); --au-c2: color-mix(in srgb, var(--c-national) 62%, var(--c-ochre)); --au-c3: color-mix(in srgb, var(--c-ochre) 60%, var(--c-ink)); --au-hi: var(--c-national-hover); }

/* ---- The host ---------------------------------------------------------------- */
.au {
  position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: var(--au-base);
  --au-x: 50%; --au-y: 50%; --au-a: 90deg;
  /* Before JS can measure text, keep the resting light below the tested ceiling. */
  --au-intensity: 0.12;
}
.au::before {
  content: ""; position: absolute; inset: -12%; will-change: transform;
  background: linear-gradient(var(--au-a), var(--au-c1), var(--au-c2) 50%, var(--au-c3));
  opacity: calc(0.95 * var(--au-intensity));
  mask-image: radial-gradient(ellipse 85% 110% at var(--au-x) var(--au-y), var(--c-white), transparent);
}
.au::after { content: none; }
.motion-ok .au.au-run::before { animation: au-sway 52s ease-in-out infinite alternate; }
@keyframes au-sway { to { transform: translate3d(-3%, -2%, 0) scale(1.04); } }

.au canvas { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; opacity: 0; transition: opacity var(--dur-reveal) var(--ease-out); }
.au.is-live canvas { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .au canvas { transition: none; } }

/* ---- Once a panel is under the engine, its older static glows step aside ------- */
.ambient[data-au] > .ambient__bg { display: none; }
.vc_row.wpb_row.wnm-shape--inset.wnm-bg--ink[data-au]::before,
.vc_row.wpb_row.wnm-shape--inset.wnm-bg--ink[data-au]::after { display: none; }
.vc_row.wpb_row.wnm-shape--inset.wnm-bg--ink[data-au]:is(#full-statement, #affiliation, #national-program) { background-image: none; }
