/* ============================================================
   QUEEN CHAOS MAINSTAGE — depth + interaction layer
   Jessie Lynn, 2026-11-23. Dad: "massive depth and interaction,
   right now it is so FLAT". Inspired by the indoor festival stage
   Amanda loves: LED wall, lasers, spotlights, haze, a floor that
   runs away from you - in HER colours only (void, royal, lilac,
   chrome, and the rationed --hot pink from site.css).

   Loaded from site_head.php on every page, right AFTER site.css and
   BEFORE any page css - so the few rules that compete with index.css
   win on specificity, not order. Nothing here renames or replaces her
   variables. Every effect:
     - is aria-hidden decoration, never content;
     - animates transform/opacity where it can (cheap to draw);
     - stops when the hero scrolls off (.stage-off, set by stage.js);
     - goes completely still under prefers-reduced-motion.
   ============================================================ */

/* ---------- the stage container: sits behind the hero content ---------- */
.hero{ isolation:isolate; perspective:1200px; }
.stage{ position:absolute; inset:0; z-index:0; pointer-events:none; overflow:hidden;
  --mx:0; --my:0; --sy:0; }               /* set by stage.js: mouse -1..1, scroll px */
/* .dust is excluded: index.css positions it absolute over the hero */
.hero > :not(.stage):not(.dust){ position:relative; z-index:2; }
.hero .dust{ z-index:1; transform:translate3d(calc(var(--mx,0) * -26px), calc(var(--my,0) * -18px), 0); }

/* every layer moves by its own depth - far layers barely, near ones a lot */
.stage > *{ position:absolute; will-change:transform; }

/* ---------- 1. LED WALL (farthest) ----------
   A dot-matrix screen: a moving purple→pink light run seen through
   a mask of round LEDs. */
.stage-wall{
  inset:-6% 6% 30% 6%;
  transform:translate3d(calc(var(--mx) * 8px), calc(var(--my) * 6px + var(--sy) * .15px), -200px) scale(1.15);
  background:
    linear-gradient(115deg, transparent 0 20%, rgba(255,46,154,.55) 32%, transparent 44% 60%, rgba(108,63,166,.7) 72%, transparent 84%),
    radial-gradient(ellipse 60% 70% at 50% 45%, rgba(108,63,166,.55), rgba(10,9,13,0) 70%);
  background-size:300% 100%, 100% 100%;
  animation:stageWall 9s linear infinite;
  -webkit-mask:radial-gradient(circle, #000 1.3px, transparent 1.9px) 0 0/9px 9px,
               radial-gradient(ellipse 58% 62% at 50% 46%, #000 30%, transparent 78%);
  -webkit-mask-composite:source-in; mask-composite:intersect;
  opacity:.75;
}
@keyframes stageWall{ to{ background-position:-300% 0, 0 0; } }

/* ---------- 2. SPOTLIGHTS from the rig above ---------- */
.stage-beams{ inset:0; transform:translate3d(calc(var(--mx) * 16px), 0, 0); }
.stage-beams i{
  position:absolute; top:-8%; width:22vw; max-width:300px; height:115%;
  background:linear-gradient(180deg, rgba(201,168,232,.38), rgba(201,168,232,.06) 55%, transparent 80%);
  clip-path:polygon(46% 0, 54% 0, 100% 100%, 0 100%);
  transform-origin:50% 0; filter:blur(2px); mix-blend-mode:screen; opacity:.55;
  animation:stageSwing 7s ease-in-out infinite alternate;
}
.stage-beams i:nth-child(1){ left:4%;  animation-delay:-1s; }
.stage-beams i:nth-child(2){ left:26%; animation-delay:-3.5s; background:linear-gradient(180deg, rgba(255,46,154,.32), rgba(255,46,154,.05) 55%, transparent 80%); }
.stage-beams i:nth-child(3){ right:26%; animation-delay:-2s; background:linear-gradient(180deg, rgba(255,46,154,.32), rgba(255,46,154,.05) 55%, transparent 80%); }
.stage-beams i:nth-child(4){ right:4%; animation-delay:-5s; }
@keyframes stageSwing{ 0%{ transform:rotate(-14deg); } 100%{ transform:rotate(14deg); } }

/* ---------- 3. LASERS fanning up from both sides of the stage ---------- */
.stage-lasers{ bottom:22%; width:0; height:0;
  transform:translate3d(calc(var(--mx) * 30px), calc(var(--my) * 14px), 0); }
.stage-lasers-l{ left:6%; } .stage-lasers-r{ right:6%; }
.stage-lasers i{
  position:absolute; left:0; bottom:0; width:120vmax; height:2px; transform-origin:0 50%;
  background:linear-gradient(90deg, rgba(255,46,154,.95), rgba(255,46,154,.35) 40%, transparent 75%);
  box-shadow:0 0 8px rgba(255,46,154,.9), 0 0 22px rgba(255,46,154,.45);
  mix-blend-mode:screen; opacity:0;
  animation:stageLaser 6s ease-in-out infinite;
}
.stage-lasers-r i{ left:auto; right:0; transform-origin:100% 50%;
  background:linear-gradient(270deg, rgba(201,168,232,.95), rgba(201,168,232,.3) 40%, transparent 75%);
  box-shadow:0 0 8px rgba(201,168,232,.9), 0 0 22px rgba(108,63,166,.6); }
.stage-lasers i:nth-child(1){ --a:-12deg; animation-delay:0s; }
.stage-lasers i:nth-child(2){ --a:-24deg; animation-delay:.4s; }
.stage-lasers i:nth-child(3){ --a:-36deg; animation-delay:.8s; }
.stage-lasers i:nth-child(4){ --a:-48deg; animation-delay:1.2s; }
.stage-lasers i:nth-child(5){ --a:-60deg; animation-delay:1.6s; }
.stage-lasers-r i:nth-child(n){ --flip:-1; }
@keyframes stageLaser{
  0%,100%{ opacity:0; transform:rotate(calc(var(--a) * var(--flip,1))) scaleX(.2); }
  15%    { opacity:.9; }
  50%    { opacity:.75; transform:rotate(calc((var(--a) - 14deg) * var(--flip,1))) scaleX(1); }
  80%    { opacity:0; }
}

/* ---------- 4. THE FLOOR — a grid running toward you ---------- */
.stage-floor{
  left:-30%; right:-30%; bottom:-6%; height:46%;
  transform-origin:50% 100%;
  transform:translate3d(calc(var(--mx) * -22px), 0, 0) rotateX(72deg);
  background:
    repeating-linear-gradient(90deg, rgba(201,168,232,.32) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(0deg,  rgba(255,46,154,.30) 0 1px, transparent 1px 64px);
  -webkit-mask:linear-gradient(0deg, #000 10%, transparent 92%); mask:linear-gradient(0deg, #000 10%, transparent 92%);
  animation:stageFloor 2.4s linear infinite;
  opacity:.55;
}
@keyframes stageFloor{ to{ background-position:0 0, 0 64px; } }

/* ---------- 5. HAZE drifting across the front of the stage ---------- */
.stage-haze{ left:-10%; right:-10%; bottom:-10%; height:55%;
  transform:translate3d(calc(var(--mx) * -40px), calc(var(--sy) * -.1px), 0); }
.stage-haze i{ position:absolute; bottom:0; width:60%; height:100%; border-radius:50%;
  background:radial-gradient(ellipse at center, rgba(108,63,166,.40), rgba(108,63,166,0) 65%);
  filter:blur(30px); animation:stageHaze 18s ease-in-out infinite alternate; }
.stage-haze i:nth-child(1){ left:-5%; }
.stage-haze i:nth-child(2){ left:30%; animation-delay:-6s; background:radial-gradient(ellipse at center, rgba(255,46,154,.20), rgba(255,46,154,0) 65%); }
.stage-haze i:nth-child(3){ left:55%; animation-delay:-11s; }
@keyframes stageHaze{ 0%{ transform:translateX(-8%) scale(1); } 100%{ transform:translateX(8%) scale(1.15); } }

/* ---------- 6. THE CREST: on the beat, and turning toward you ----------
   150 BPM = .4s a beat, the hardstyle tempo. The glow kicks, the
   crest itself only breathes - a logo that bounces reads as cheap. */
/* `.hero .hero-logo`, not `.hero-logo`: stage.css loads in the shared head,
   BEFORE index.css, so it has to out-rank index.css on specificity. */
.hero .hero-logo{
  transform-style:preserve-3d;
  transform:rotateY(calc(var(--mx,0) * 10deg)) rotateX(calc(var(--my,0) * -8deg)) translateZ(40px);
  transition:transform .25s ease-out;
  /* `backwards`, not `both`: index.css runs `rise` with fill `both`, which
     keeps holding its final transform after it ends - and an animation
     value beats a normal one, so the tilt above was silently ignored
     (measured: identity matrix with the mouse at the corner). */
  animation:rise .9s cubic-bezier(.2,1,.3,1) backwards, stageBeat .4s ease-out infinite;
}
@keyframes stageBeat{
  0%  { filter:drop-shadow(0 0 60px rgba(255,46,154,.55)) drop-shadow(0 0 26px rgba(108,63,166,.9)); }
  100%{ filter:drop-shadow(0 0 40px rgba(108,63,166,.55)) drop-shadow(0 0 10px rgba(108,63,166,.4)); }
}
.hero h1, .hero-eyebrow, .hero-actions, .hero-marks{
  transform:translate3d(calc(var(--mx,0) * 6px), calc(var(--my,0) * 4px), 0);
  transition:transform .25s ease-out;
}

/* ---------- 7. PYRO — click the stage, it fires (stage.js) ---------- */
.stage-spark{ position:absolute; z-index:3; width:6px; height:6px; border-radius:50%;
  pointer-events:none; background:var(--hot,#FF2E9A);
  box-shadow:0 0 10px 2px rgba(255,46,154,.85);
  animation:stageSpark .9s cubic-bezier(.15,.7,.3,1) forwards; }
.stage-spark.lilac{ background:var(--lilac); box-shadow:0 0 10px 2px rgba(201,168,232,.9); }
@keyframes stageSpark{
  0%  { transform:translate(-50%,-50%) scale(1); opacity:1; }
  100%{ transform:translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(.2); opacity:0; }
}

/* ---------- 8. THE THREE SCREENS ----------
   Dad 2026-11-23: the festival stage has three screens - left, middle,
   right - so hers does too. Her crest lives on the middle one, the
   queen (qcc-wo) on the two sides. Markup: .stage-rig wraps .hero-logo
   in index.php, under the .stage-tagline neon sign.
   The rig is real content (it holds the crest img + alt), so it sits in
   the hero flow, not inside the aria-hidden .stage. */
.stage-rig{
  display:flex; align-items:stretch; justify-content:center;
  gap:clamp(14px, 3vw, 46px); margin:0 auto 22px; perspective:1100px;
  transform:translate3d(calc(var(--mx,0) * -10px), calc(var(--my,0) * -6px), 0);
  transition:transform .25s ease-out;
}
.stage-screen{
  position:relative; border:2px solid transparent;
  /* dark glass inside, a chrome-to-royal frame round the edge */
  background:
    linear-gradient(180deg, rgba(24,16,36,.94), rgba(10,9,13,.97)) padding-box,
    linear-gradient(160deg, #EDE6F6, #6C3FA6 32%, #C9A8E8 55%, #3A2260 80%, #EDE6F6) border-box;
  box-shadow:0 0 0 1px rgba(201,168,232,.12), 0 0 38px rgba(108,63,166,.45), inset 0 0 36px rgba(108,63,166,.35);
}
/* the LED panel: a light run seen through round pixels */
.stage-screen::before{
  content:""; position:absolute; inset:6px; border-radius:inherit;
  background:
    linear-gradient(115deg, transparent 0 22%, rgba(255,46,154,.45) 34%, transparent 46% 58%, rgba(108,63,166,.65) 70%, transparent 84%),
    radial-gradient(ellipse 70% 60% at 50% 45%, rgba(108,63,166,.45), transparent 75%);
  background-size:300% 100%, 100% 100%;
  -webkit-mask:radial-gradient(circle, #000 1.1px, transparent 1.7px) 0 0/7px 7px;
          mask:radial-gradient(circle, #000 1.1px, transparent 1.7px) 0 0/7px 7px;
  animation:stageWall 7s linear infinite; opacity:.85;
}
/* the glass: faint scanlines + a sheen across the top */
.stage-screen::after{
  content:""; position:absolute; inset:6px; border-radius:inherit; pointer-events:none;
  background:
    linear-gradient(180deg, rgba(255,255,255,.10), transparent 22%),
    repeating-linear-gradient(0deg, rgba(0,0,0,.18) 0 1px, transparent 1px 3px);
}

/* the neon sign over the screens - Dad 2026-11-23: "I Got That Good
   Stuff You Want". Text comes from qcc_copy('hero_tagline') so it is
   editable like the rest of the hero wording. A tube sign: white core,
   pink then violet glow, and a quick flicker now and then. */
.stage-tagline{
  margin:0 auto 20px; max-width:min(860px, 92vw);
  font-family:'Pirata One', serif; font-weight:400;
  font-size:clamp(26px, 4.4vw, 48px); line-height:1.05; letter-spacing:.02em;
  color:#FFF3FA;
  text-shadow:0 0 3px #fff, 0 0 10px rgba(255,46,154,.95), 0 0 24px rgba(255,46,154,.7), 0 0 46px rgba(108,63,166,.85);
  transform:translate3d(calc(var(--mx,0) * -14px), calc(var(--my,0) * -8px), 0);
  transition:transform .25s ease-out;
  animation:qccNeon 9s linear infinite;
}
@keyframes qccNeon{
  0%,90%,93%,96%,100%{ opacity:1; }
  91.5%{ opacity:.55; } 94.5%{ opacity:.75; }
}

/* the middle screen: an arched portal with her crest on it */
.stage-screen-c{
  width:min(470px, 84vw); perspective:900px;
  padding:clamp(22px, 3.4vw, 40px) clamp(22px, 4.4vw, 56px) clamp(16px, 2.4vw, 26px);
  border-radius:50% 50% 18px 18px / 30% 30% 18px 18px;
  animation:stageScreenBeat .4s ease-out infinite;
}
.stage-screen-c .hero-logo{ position:relative; z-index:1; margin:0 auto; }
@keyframes stageScreenBeat{
  0%  { box-shadow:0 0 0 1px rgba(201,168,232,.18), 0 0 60px rgba(255,46,154,.42), inset 0 0 44px rgba(108,63,166,.5); }
  100%{ box-shadow:0 0 0 1px rgba(201,168,232,.12), 0 0 34px rgba(108,63,166,.40), inset 0 0 32px rgba(108,63,166,.3); }
}

/* the side screens: tall arched panels angled in toward the middle.
   Dad 2026-11-23: the queen portrait (assets/images/qcc-wo) plays on
   both, over the rising light columns. */
.stage-screen-l, .stage-screen-r{
  width:clamp(84px, 14vw, 200px); margin:7% 0;
  border-radius:50% 50% 14px 14px / 18% 18% 14px 14px;
}
.stage-screen-l{ transform-origin:100% 50%; transform:rotateY(34deg); }
.stage-screen-r{ transform-origin:0 50%;   transform:rotateY(-34deg); }
.stage-screen-l::before, .stage-screen-r::before{
  background:
    repeating-linear-gradient(90deg, transparent 0 14%, rgba(255,46,154,.55) 18%, transparent 22% 30%, rgba(201,168,232,.5) 34%, transparent 38%),
    linear-gradient(0deg, rgba(108,63,166,.7), transparent 70%);
  background-size:100% 100%, 100% 220%;
  animation:stageColumns 3.2s ease-in-out infinite alternate;
}
.stage-screen-r::before{ animation-delay:-1.6s; }
@keyframes stageColumns{ 0%{ background-position:0 0, 0 0; opacity:.55; } 100%{ background-position:0 0, 0 100%; opacity:.95; } }

/* the queen on the side screens - cropped to crown + face, the pixel
   scanlines (::after) sit over her so she reads as ON the screen */
.screen-queen{
  position:absolute; inset:6px; width:calc(100% - 12px); height:calc(100% - 12px);
  object-fit:cover; object-position:50% 12%; border-radius:inherit; z-index:1;
  filter:drop-shadow(0 0 14px rgba(108,63,166,.7)) saturate(1.1);
  animation:stageQueen 6s ease-in-out infinite alternate;
}
.stage-screen-r .screen-queen{ animation-delay:-3s; }
.stage-screen::after{ z-index:2; }
@keyframes stageQueen{ 0%{ opacity:.82; transform:scale(1); } 100%{ opacity:1; transform:scale(1.04); } }

/* ============================================================
   9. SHIMMER + SPARKLE - the rest of the site
   Dad 2026-11-23: "some shimmer and sparkle (not too much though)".
   So: slow, faint, and mostly lilac/chrome - the pink stays on the
   six places site.css rations it to. Nothing here moves layout,
   and the global reduced-motion rule in site.css stills all of it.
   ============================================================ */

/* ---- a few stars twinkling in the dark behind everything ---- */
body::after{
  content:''; position:fixed; inset:0; pointer-events:none; z-index:0;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,.9), transparent 60%),
    radial-gradient(1px 1px at 78% 9%,  rgba(201,168,232,.9), transparent 60%),
    radial-gradient(1.5px 1.5px at 33% 64%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1px 1px at 91% 47%, rgba(201,168,232,.9), transparent 60%),
    radial-gradient(1px 1px at 56% 83%, rgba(255,255,255,.8), transparent 60%),
    radial-gradient(1.5px 1.5px at 6% 91%, rgba(201,168,232,.8), transparent 60%),
    radial-gradient(1px 1px at 64% 31%, rgba(255,255,255,.7), transparent 60%);
  background-size:520px 520px;
  opacity:.35; animation:qccTwinkle 5.5s ease-in-out infinite alternate;
}
@keyframes qccTwinkle{ to{ opacity:.7; } }

/* ---- the announcement bar: a glint runs across it now and then ---- */
.announce{ overflow:hidden; }
.announce::after{
  content:''; position:absolute; top:0; bottom:0; left:-30%; width:22%;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  transform:skewX(-20deg); pointer-events:none;
  animation:qccGlint 7s ease-in-out infinite;
}
@keyframes qccGlint{ 0%,70%{ left:-30%; } 100%{ left:130%; } }

/* ---- section headings: the chrome catches light, the star twinkles ---- */
.section-label h2{ background-size:100% 260%; animation:qccChrome 6s ease-in-out infinite alternate; }
@keyframes qccChrome{ from{ background-position:50% 0; } to{ background-position:50% 100%; } }
.section-label .crest{ animation:qccStar 2.8s ease-in-out infinite; }
@keyframes qccStar{
  0%,100%{ text-shadow:0 0 16px rgba(255,46,154,.75), 0 0 34px rgba(108,63,166,.55); }
  50%    { text-shadow:0 0 22px rgba(255,46,154,.95), 0 0 46px rgba(201,168,232,.7); }
}

/* ---- cards turn toward the pointer, and light follows it (stage.js) ---- */
.card.is-tilting, .line-card.is-tilting{
  transform:perspective(900px) translateY(-6px)
            rotateX(calc(var(--ty,0) * -5deg)) rotateY(calc(var(--tx,0) * 6deg));
  transition:transform .12s ease-out, border-color .32s, box-shadow .32s;
}
.card::after, .line-card::after{
  content:''; position:absolute; inset:0; pointer-events:none; z-index:3;
  background:radial-gradient(circle at var(--gx,50%) var(--gy,30%), rgba(255,255,255,.16), transparent 45%);
  opacity:0; transition:opacity .3s;
}
.card.is-tilting::after, .line-card.is-tilting::after{ opacity:1; }
/* reaching for a card runs the button sheen once - the call to buy */
.card:hover .add-btn::after{ animation:qcc-sheen .75s var(--ease, ease) .1s; }

/* ---- merch lines: a faint holographic foil, like a VIP pass ---- */
.line-card{ overflow:hidden; }
.line-card::before{
  content:''; position:absolute; inset:-40%; pointer-events:none; z-index:0;
  background:conic-gradient(from 0deg, transparent 0 30%, rgba(201,168,232,.10) 38%, rgba(255,196,227,.08) 44%, transparent 52% 100%);
  animation:qccFoil 12s linear infinite;
}
.line-card > *{ position:relative; z-index:1; }
@keyframes qccFoil{ to{ transform:rotate(360deg); } }
.line-badge{ box-shadow:0 0 0 1px rgba(201,168,232,.15), 0 0 18px rgba(108,63,166,.45); animation:qccBadge 4s ease-in-out infinite alternate; }
@keyframes qccBadge{ to{ box-shadow:0 0 0 1px rgba(201,168,232,.3), 0 0 26px rgba(201,168,232,.4); } }

/* ---- the footer: a laser line along the top with a light riding it ---- */
footer::after{
  content:''; position:absolute; top:0; left:0; right:0; height:1px; pointer-events:none;
  background:
    linear-gradient(90deg, transparent, rgba(255,255,255,.9), transparent) -20% 0 / 18% 100% no-repeat,
    linear-gradient(90deg, transparent, rgba(201,168,232,.55), transparent);
  animation:qccRide 6s ease-in-out infinite;
}
@keyframes qccRide{ to{ background-position:120% 0, 0 0; } }

/* ---------- off-screen: stop drawing ---------- */
.stage-off .stage *, .stage-off .hero-logo, .stage-off .stage-screen,
.stage-off .stage-screen::before, .stage-off .screen-queen, .stage-off .stage-tagline{ animation-play-state:paused !important; }

/* ---------- phones: a lighter show ---------- */
@media (max-width:700px){
  .stage-lasers i:nth-child(n+4){ display:none; }
  .stage-beams i:nth-child(2), .stage-beams i:nth-child(3){ display:none; }
  .stage-haze i{ filter:blur(22px); }
  .stage-floor{ height:36%; }
  .stage-screen-l, .stage-screen-r{ display:none; }   /* no room - the middle screen carries it */
}

/* ---------- reduced motion: a still stage, never a moving one ---------- */
@media (prefers-reduced-motion:reduce){
  .stage *, .hero-logo, .hero h1, .hero-eyebrow, .hero-actions, .hero-marks,
  .stage-rig, .stage-screen, .stage-screen::before, .screen-queen, .stage-tagline{
    animation:none !important; transition:none !important; }
  .stage-lasers i{ opacity:.35; transform:rotate(calc(var(--a) * var(--flip,1))); }
  .hero .hero-logo{ transform:none; filter:drop-shadow(0 0 46px rgba(108,63,166,.6)); }
  .card.is-tilting, .line-card.is-tilting{ transform:none; }
  body::after, .announce::after, .line-card::before{ animation:none !important; }
}
