/* =============================================================================
 * css/splash.css — DVD-ad splash overlay (WAVE-0 OWNED)
 * -----------------------------------------------------------------------------
 * Pink/cyan cinema-studio splash shown BEFORE any WebGL/Babylon work.
 * Timing contract (js/splash.js sets these custom properties):
 *   --splash-beat  600..1500 ms — the DVD-ad beat (council: 0.6 s–1.5 s)
 *   --splash-fade  200/400 ms   — handoff cross-fade duration
 * The markup itself is injected by js/main.js (`injectSplashMarkup`).
 * =========================================================================== */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(70rem 48rem at 18% 16%, rgba(255, 95, 168, .34), transparent 60%),
    radial-gradient(66rem 46rem at 84% 82%, rgba(94, 231, 255, .28), transparent 58%),
    linear-gradient(140deg, #150a22 0%, #0b0713 52%, #07131d 100%);
  transition:
    opacity var(--splash-fade, 400ms) ease,
    filter var(--splash-fade, 400ms) ease,
    transform var(--splash-fade, 400ms) ease;
}

/* Handoff: cross-fade + slight push, then hard hide (js/splash.js adds both). */
.splash--out {
  opacity: 0;
  filter: blur(10px);
  transform: scale(1.04);
  pointer-events: none;
}

.splash--gone,
.splash[hidden] {
  display: none;
}

/* --- DVD letterbox bars --------------------------------------------------- */
.splash__letterbox {
  position: absolute;
  left: 0;
  right: 0;
  height: clamp(22px, 6vh, 64px);
  background: #000;
  z-index: 3;
}

.splash__letterbox--top { top: 0; }
.splash__letterbox--bottom { bottom: 0; }

/* --- CRT scanlines drifting over everything -------------------------------- */
.splash__scan {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, .34) 0 1px,
    rgba(0, 0, 0, 0) 1px 3px
  );
  opacity: .55;
  animation: splash-scan 5.2s linear infinite;
}

@keyframes splash-scan {
  from { background-position-y: 0; }
  to { background-position-y: 3px; }
}

/* --- centre card ----------------------------------------------------------- */
.splash__box {
  position: relative;
  z-index: 1;
  width: min(680px, 86vw);
  padding: clamp(26px, 5vh, 48px) clamp(22px, 4vw, 44px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 14px;
  background: rgba(11, 7, 19, .78);
  box-shadow:
    0 40px 120px rgba(0, 0, 0, .65),
    0 0 90px rgba(255, 95, 168, .18),
    0 0 60px rgba(94, 231, 255, .14);
  backdrop-filter: blur(6px);
}

.splash__kicker {
  margin: 0 0 18px;
  font-size: 10px;
  letter-spacing: .52em;
  text-transform: uppercase;
  color: var(--cyan, #5ee7ff);
  animation: splash-flicker 1.4s steps(2, end) infinite;
}

/* Chromatic-aberration logo — the DVD-ad signature (pink left, cyan right). */
.splash__logo {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-weight: 300;
  font-size: clamp(38px, 7vw, 84px);
  line-height: .98;
  letter-spacing: .08em;
  color: #fff;
  text-shadow:
    3px 0 0 rgba(255, 95, 168, .85),
    -3px 0 0 rgba(94, 231, 255, .85),
    0 0 34px rgba(255, 158, 203, .35);
  animation: splash-chroma 1.8s ease-in-out infinite;
}

.splash__logo span {
  background: linear-gradient(100deg, var(--pink, #ff5fa8) 10%, var(--pink-soft, #ff9ecb) 45%, var(--cyan, #5ee7ff) 92%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

@keyframes splash-chroma {
  0%, 100% {
    text-shadow: 3px 0 0 rgba(255, 95, 168, .85), -3px 0 0 rgba(94, 231, 255, .85), 0 0 34px rgba(255, 158, 203, .35);
  }
  50% {
    text-shadow: -4px 0 0 rgba(255, 95, 168, .9), 4px 0 0 rgba(94, 231, 255, .9), 0 0 46px rgba(94, 231, 255, .4);
  }
}

@keyframes splash-flicker {
  0%, 92%, 100% { opacity: 1; }
  94% { opacity: .35; }
  96% { opacity: 1; }
}

.splash__sub {
  margin: 14px 0 0;
  font-size: 11px;
  letter-spacing: .38em;
  text-transform: uppercase;
  color: rgba(246, 242, 247, .72);
}

/* --- capability readout lines (filled by js/splash.js) --------------------- */
.splash__caps {
  list-style: none;
  margin: 26px auto 0;
  padding: 14px 16px;
  max-width: 420px;
  text-align: left;
  border: 1px solid rgba(94, 231, 255, .32);
  border-radius: 8px;
  background: rgba(7, 4, 13, .8);
}

.splash__caps li {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11.5px;
  letter-spacing: .14em;
  color: var(--cyan, #5ee7ff);
  padding: 3px 0;
  opacity: 0;
  animation: splash-line 260ms ease forwards;
}

.splash__caps li::before {
  content: "▸ ";
  color: var(--pink-soft, #ff9ecb);
}

/* Staggered read-in — completes well inside the 0.6 s beat floor. */
.splash__caps li:nth-child(1) { animation-delay: 80ms; }
.splash__caps li:nth-child(2) { animation-delay: 200ms; }
.splash__caps li:nth-child(3) { animation-delay: 320ms; }
.splash__caps li:nth-child(4) { animation-delay: 440ms; }

@keyframes splash-line {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* --- beat progress bar (fills over --splash-beat) -------------------------- */
.splash__bar {
  margin: 26px auto 0;
  width: min(360px, 70%);
  height: 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .12);
  overflow: hidden;
}

.splash__bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--pink, #ff5fa8), var(--cyan, #5ee7ff));
  box-shadow: 0 0 16px rgba(255, 95, 168, .8);
  /* #17: the variable is preset in index.html's <head> (and re-stamped with
     the same value by js/splash.js) BEFORE this markup exists, so the fill
     now starts with the real beat — no mid-animation recalculation. The
     fallback mirrors that non-reduced preset (1480ms) instead of the old
     orphan 1400ms default. */
  animation: splash-fill var(--splash-beat, 1480ms) linear forwards;
}

@keyframes splash-fill {
  from { width: 0; }
  to { width: 100%; }
}

.splash__foot {
  margin: 16px 0 0;
  font-size: 9.5px;
  letter-spacing: .44em;
  text-transform: uppercase;
  color: rgba(246, 242, 247, .48);
}

/* --- reduced motion: keep the beat, drop the movement (council) ------------ */
@media (prefers-reduced-motion: reduce) {
  .splash__scan,
  .splash__kicker,
  .splash__logo {
    animation: none;
  }
  .splash__caps li {
    animation-duration: 1ms;
    animation-delay: 0ms;
  }
  .splash {
    transition-duration: 200ms;
  }
}
