/* ==========================================================================
   CreatorVault — Shared Aurora / Fog Background Standard  (aurora-bg.css)
   --------------------------------------------------------------------------
   The ONE animated background for the whole CreatorVault tool line.

   FINAL TUNING — locked by the owner, 2026-10-20 (after seeing Stripe live):
   the fog is drifting COLOURED SMOKE in the style of Stripe's hero —
   RICH, VIVID, SATURATED PRIMARY colours that clearly READ as moving
   smoke. Muted / pale / washed-out versions were rejected as "purana"
   (dated). Presence is high but never a solid wall: the navy base and
   the soft gradient falloff keep it elegant, and content always sits on
   panels above it. Motion stays calm — drift cycles ~30–48 s, travel
   <= ~70 px, transform-only. NEVER: flicker, strobe, hard pulsing,
   hue-rotate. Reduced-motion = static coloured smoke.

   Usage (full guide: ANIMATION-STANDARD.md):
     <link rel="stylesheet" href="../_shared/aurora-bg.css">
     <div class="cv-aurora" aria-hidden="true"> ...blobs... </div>  (after <body>)
     Optional parallax: <script src="../_shared/aurora-bg.js" defer></script>
   ========================================================================== */

/* ---------- Colour / presence tokens (single source of truth) ---------- */
:root{
  --cv-base:        #050A14;   /* deep navy base                    */
  --cv-base-2:      #0A1128;   /* upper base glow                   */
  --cv-violet:      #A855F7;
  --cv-gold:        #C9A961;
  --cv-blue:        #3B82F6;
  --cv-teal:        #14B8A6;

  /* Blob CORE opacity — VIVID bands (owner's final tuning, 2026-10-20).
     Dark mode:  violet .45–.60 · gold .28–.40 · blue .40–.55 · teal .32–.45
     Light mode: violet .20–.30 · gold .22–.32 · blue .18–.28 · teal .14–.22
     Cores are rich; the 42% mid-stop and 72% transparent falloff are what
     keep the smoke soft instead of solid. */
  --cv-o-violet: .55;
  --cv-o-gold:   .34;
  --cv-o-blue:   .48;
  --cv-o-teal:   .40;
  --cv-o-ring:   .13;
  --cv-o-grain:  .03;

  --cv-blur: 70px;             /* static filter blur, desktop only  */
  --cv-sat: 1.5;               /* saturation lift — the "rich" knob */
  --cv-par-x: 0;               /* parallax vars, set by aurora-bg.js */
  --cv-par-y: 0;
}

/* ---------- Stage ---------- */
.cv-aurora{
  position:fixed;
  inset:0;
  z-index:0;                   /* page content must sit at z-index >= 1 */
  overflow:hidden;
  pointer-events:none;
  background:
    radial-gradient(120% 90% at 50% -10%, var(--cv-base-2) 0%, transparent 60%),
    var(--cv-base);
}

/* Parallax wrapper — JS moves THIS layer (±14px max), blobs drift inside it,
   so parallax never fights the keyframe transforms. */
.cv-aurora__par{
  position:absolute;
  inset:-4%;
  transform:translate3d(
    calc(var(--cv-par-x) * 14px),
    calc(var(--cv-par-y) * 10px), 0);
  will-change:transform;
}

/* ---------- Aurora blobs (the coloured smoke) ---------- */
.cv-aurora__blob{
  position:absolute;
  border-radius:50%;
  filter:blur(var(--cv-blur)) saturate(var(--cv-sat));
  will-change:transform;
  /* Opacity lives in the gradient stops — no opacity pulsing (calm law). */
}
.cv-aurora__blob--violet{
  width:66vmax; height:66vmax;
  left:-14vmax; top:-18vmax;
  mix-blend-mode:screen;
  background:radial-gradient(circle at 50% 50%,
    rgba(168,85,247,var(--cv-o-violet)) 0%,
    rgba(168,85,247,calc(var(--cv-o-violet) * .55)) 42%,
    transparent 72%);
  animation:cv-drift-a 36s ease-in-out infinite alternate;
}
.cv-aurora__blob--gold{
  width:48vmax; height:48vmax;
  right:-10vmax; top:6vh;
  background:radial-gradient(circle at 50% 50%,
    rgba(201,169,97,var(--cv-o-gold)) 0%,
    rgba(201,169,97,calc(var(--cv-o-gold) * .55)) 42%,
    transparent 72%);
  animation:cv-drift-b 44s ease-in-out infinite alternate;
}
.cv-aurora__blob--blue{
  width:56vmax; height:56vmax;
  right:-16vmax; bottom:-20vmax;
  mix-blend-mode:screen;
  background:radial-gradient(circle at 50% 50%,
    rgba(59,130,246,var(--cv-o-blue)) 0%,
    rgba(59,130,246,calc(var(--cv-o-blue) * .55)) 42%,
    transparent 72%);
  animation:cv-drift-c 30s ease-in-out infinite alternate;
}
.cv-aurora__blob--teal{
  width:40vmax; height:40vmax;
  left:26vw; bottom:-16vmax;
  mix-blend-mode:screen;
  background:radial-gradient(circle at 50% 50%,
    rgba(20,184,166,var(--cv-o-teal)) 0%,
    rgba(20,184,166,calc(var(--cv-o-teal) * .55)) 42%,
    transparent 72%);
  animation:cv-drift-b 48s ease-in-out infinite alternate-reverse;
}

/* Drift paths — owner-tuned pace: full cycles 30–48 s (lively, never
   frantic), travel <= ~70 px, scale change <= 6%. Transform only. */
@keyframes cv-drift-a{
  from{ transform:translate3d(0,0,0)        scale(1);    }
  to  { transform:translate3d(4.5vw,3vh,0)  scale(1.05); }
}
@keyframes cv-drift-b{
  from{ transform:translate3d(0,0,0)        scale(1.04); }
  to  { transform:translate3d(-3.5vw,4vh,0) scale(1);    }
}
@keyframes cv-drift-c{
  from{ transform:translate3d(0,0,0)         scale(1);    }
  to  { transform:translate3d(-4vw,-3vh,0)   scale(1.06); }
}

/* ---------- Conic glow ring (halo accent) ---------- */
.cv-aurora__ring{
  position:absolute;
  width:88vmin; height:88vmin;
  right:-24vmin; top:-30vmin;
  border-radius:50%;
  opacity:var(--cv-o-ring);
  background:conic-gradient(from 0deg,
    transparent 0deg, rgba(201,169,97,.9) 70deg, transparent 150deg,
    transparent 190deg, rgba(168,85,247,.9) 260deg, transparent 330deg);
  -webkit-mask:radial-gradient(closest-side, transparent 76%, #000 78%, #000 82%, transparent 84%);
          mask:radial-gradient(closest-side, transparent 76%, #000 78%, #000 82%, transparent 84%);
  animation:cv-ring 120s linear infinite;   /* one slow turn */
}
@keyframes cv-ring{ to{ transform:rotate(360deg); } }

/* ---------- Film grain (SVG turbulence, whisper-quiet) ---------- */
.cv-aurora__grain{
  position:absolute;
  inset:0;
  opacity:var(--cv-o-grain);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  background-size:160px 160px;
}

/* ---------- Glass panel helper (content floats ON the smoke) ---------- */
.cv-glass{
  background:rgba(10,17,40,.55);
  border:1px solid rgba(201,169,97,.16);
  backdrop-filter:blur(14px) saturate(1.1);
  -webkit-backdrop-filter:blur(14px) saturate(1.1);
  border-radius:14px;
}

/* ==========================================================================
   LIGHT MODE — the same smoke as rich pastel colour over warm ivory.
   Activate by putting data-theme="light" on <html> (or class cv-light on
   <body>). Colours stay recognisably rich — never a white-out, never neon.
   ========================================================================== */
[data-theme="light"] .cv-aurora,
body.cv-light .cv-aurora{
  --cv-o-violet: .26;   /* vivid bands: violet .20–.30 */
  --cv-o-gold:   .28;   /*              gold   .22–.32 */
  --cv-o-blue:   .24;   /*              blue   .18–.28 */
  --cv-o-teal:   .20;   /*              teal   .14–.22 */
  --cv-o-ring:   .14;
  --cv-o-grain:  .026;
  --cv-sat: 1.35;
  background:
    radial-gradient(120% 90% at 50% -10%, #FFFFFF 0%, transparent 60%),
    linear-gradient(180deg, #FBF8F1 0%, #F4EFE3 100%);
}
/* On ivory, screen-blend would wash the smoke out — normal blending keeps
   the colours rich and visible. */
[data-theme="light"] .cv-aurora__blob,
body.cv-light .cv-aurora__blob{ mix-blend-mode:normal; }
[data-theme="light"] .cv-glass,
body.cv-light .cv-glass{
  background:rgba(255,255,255,.55);
  border-color:rgba(201,169,97,.28);
}

/* ==========================================================================
   LOW-FX FALLBACK — small screens / weak GPUs (also add class
   "cv-aurora--lowfx" manually if a page needs it).
   Saturation stays (cheap), the heavy blur goes, fewer blobs, no ring.
   ========================================================================== */
@media (max-width:640px){
  .cv-aurora__blob{ filter:saturate(var(--cv-sat)); }
  .cv-aurora__blob--teal,
  .cv-aurora__ring{ display:none; }
  .cv-aurora__par{ transform:none; }   /* no parallax on phones */
}
.cv-aurora--lowfx .cv-aurora__blob{ filter:saturate(var(--cv-sat)); }
.cv-aurora--lowfx .cv-aurora__blob--teal,
.cv-aurora--lowfx .cv-aurora__ring{ display:none; }
.cv-aurora--lowfx .cv-aurora__par{ transform:none; }

/* ==========================================================================
   REDUCED MOTION — static coloured smoke. Colours stay, movement stops.
   ========================================================================== */
@media (prefers-reduced-motion: reduce){
  .cv-aurora__blob,
  .cv-aurora__ring{ animation:none !important; }
  .cv-aurora__par{ transform:none !important; }
}
