/* ─────────────────────────────────────────────────────────────────────────
   NEW-U PEPTIDES — vial-intro styling
   Scopes everything under .intro-overlay.vial-intro so the base .intro-
   overlay rules in intro.css stay untouched for non-vial intros.

   Palette (shared with JS canvas work):
     --intro-cyan    : #7ff9ff  — primary accent, glint, build phase
     --intro-azure   : #3d82ff  — mid-phase saturation
     --intro-magenta : #ff4db8  — burst/reveal bloom
     --intro-green   : #39ff14  — NEW-U brand mark
   ───────────────────────────────────────────────────────────────────────── */

.intro-overlay.vial-intro {
  --intro-cyan: #7ff9ff;
  --intro-azure: #3d82ff;
  --intro-magenta: #ff4db8;
  --intro-vial-tighten: 0.9;

  background:
    radial-gradient(72% 56% at 50% 16%, rgba(61, 130, 255, 0.16), transparent 58%),
    radial-gradient(56% 50% at 50% 54%, rgba(255, 77, 184, 0.09), transparent 52%),
    linear-gradient(180deg, #03050a 0%, #070c16 48%, #04060c 100%) !important;
}

.intro-overlay.vial-intro.is-exiting {
  pointer-events: none;
  opacity: 0;
  transition: opacity 620ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Kill the base intro.css ::before label ("LAB SEQUENCE / Vial Activation") —
   the vial story is self-narrating, no chrome text needed. */
.intro-overlay.vial-intro::before {
  content: none;
}

/* Timeline bar (inherited from intro.css ::after). Override the gradient +
   glow so it reads as part of the cyan→magenta journey, then brighten the
   glow per act so the bar "charges" alongside the animation. */
.intro-overlay.vial-intro::after {
  animation: introTimeline var(--intro-duration, 17.2s) linear both;
  background: linear-gradient(90deg,
    rgba(127, 249, 255, 0.92) 0%,
    rgba(61, 130, 255, 0.90) 58%,
    rgba(255, 77, 184, 0.62) 100%);
  box-shadow: 0 0 14px rgba(127, 249, 255, 0.28);
  transition: box-shadow 260ms ease;
}

.intro-overlay.vial-intro[data-intro-phase="build"]::after       { box-shadow: 0 0 16px rgba(127, 249, 255, 0.34); }
.intro-overlay.vial-intro[data-intro-phase="pressurize"]::after  { box-shadow: 0 0 18px rgba(127, 249, 255, 0.34), 0 0 26px rgba(61, 130, 255, 0.16); }
.intro-overlay.vial-intro[data-intro-phase="fill"]::after        { box-shadow: 0 0 18px rgba(127, 249, 255, 0.36), 0 0 32px rgba(61, 130, 255, 0.14); }
.intro-overlay.vial-intro[data-intro-phase="burst"]::after       { box-shadow: 0 0 22px rgba(255, 77, 184, 0.28), 0 0 30px rgba(127, 249, 255, 0.24); }
.intro-overlay.vial-intro[data-intro-phase="reveal"]::after      { box-shadow: 0 0 20px rgba(255, 255, 255, 0.26), 0 0 28px rgba(127, 249, 255, 0.18); }

/* Atmosphere canvas responds to phase — smooth default transition so the
   jumps between acts don't strobe. `burst` is the one beat we want to snap. */
#cv-atmosphere {
  transition: filter 320ms ease;
}
.intro-overlay.vial-intro[data-intro-phase="pressurize"]     #cv-atmosphere { filter: brightness(1.08); }
.intro-overlay.vial-intro[data-intro-phase="act2_collapse"]  #cv-atmosphere { filter: brightness(1.12); transition: filter 120ms ease; }
.intro-overlay.vial-intro[data-intro-phase="burst"]          #cv-atmosphere { filter: brightness(1.40); transition: filter 80ms ease-out; }
.intro-overlay.vial-intro[data-intro-phase="reveal"]         #cv-atmosphere { filter: brightness(0.92); transition: filter 600ms ease; }
.intro-overlay.vial-intro[data-intro-phase="act6_wipe"]      #cv-atmosphere { filter: brightness(0.88); transition: filter 400ms ease; }

/* ── Canvas stack ─────────────────────────────────────────────────────── */
.intro-overlay.vial-intro canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  filter: none;
}

#cv-bg         { z-index: 2; }
#cv-atmosphere { z-index: 4; }
#cv-vial {
  z-index: 6;
  transform: scaleX(var(--intro-vial-tighten, 1));
  transform-origin: 50% 50%;
}
#cv-particles  { z-index: 8; }
#cv-overlay    { z-index: 10; }

/* ── Skip button (cyan-accented override of the base .intro-skip pill) ── */
.intro-overlay.vial-intro .intro-skip {
  background: rgba(8, 12, 16, 0.72) !important;
  border-color: rgba(232, 244, 248, 0.36) !important;
  color: rgba(255, 255, 255, 0.92) !important;
  box-shadow:
    0 10px 26px rgba(0, 0, 0, 0.32),
    inset 0 1px rgba(255, 255, 255, 0.18) !important;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease,
    transform 60ms ease;
}

.intro-overlay.vial-intro .intro-skip:hover {
  color: #fff !important;
  border-color: rgba(127, 249, 255, 0.72) !important;
  box-shadow:
    0 0 0 1px rgba(127, 249, 255, 0.30),
    0 10px 24px rgba(0, 0, 0, 0.32) !important;
}

.intro-overlay.vial-intro .intro-skip:focus-visible {
  outline: 2px solid rgba(127, 249, 255, 0.9);
  outline-offset: 2px;
  box-shadow:
    0 0 0 1px rgba(127, 249, 255, 0.4),
    0 12px 28px rgba(0, 0, 0, 0.34) !important;
}

.intro-overlay.vial-intro .intro-skip:active {
  transform: scale(0.95);
  box-shadow:
    0 0 0 1px rgba(127, 249, 255, 0.55),
    0 4px 10px rgba(0, 0, 0, 0.44) !important;
}

/* ── Cursor torch (fixed, full-viewport vignette tracking the pointer) ─
   JS sets --tx / --ty as percentage strings on every pointermove after
   the reveal phase, and toggles .is-on to fade it in. */
#introCursorTorch {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9;
  opacity: 0;
  transition: opacity 420ms ease;
  background: radial-gradient(
    circle 180px at var(--tx, 50%) var(--ty, 50%),
    rgba(127, 249, 255, 0.06) 0%,
    transparent 38%,
    rgba(0, 0, 0, 0.58) 100%
  );
}

#introCursorTorch.is-on,
#introCursorTorch.active {
  opacity: 1;
}

html.low-gpu #introCursorTorch {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  #introCursorTorch {
    display: none !important;
  }
}

/* ── Responsive tweaks ────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .intro-overlay.vial-intro .intro-skip {
    min-height: 42px;
    min-width: 92px;
    padding: 0.66rem 0.98rem !important;
    font-size: 0.66rem !important;
    letter-spacing: 0.13em !important;
  }
}
