/* ==========================================================
   splash.css : opening animation for Spectrum '26
   Sequence: colour discs fly in and overlap, the name builds letter by
   letter, then the discs and name travel to the header logo while the
   splash fades out (the travel part is done in splash.js).
   ========================================================== */
html.splashing { overflow: hidden; }
html.splashing .brand { visibility: hidden; } /* the splash lands exactly here */

.splash {
  position: fixed; inset: 0; z-index: 200; display: none; place-items: center;
  animation: splash-failsafe 0.01s 7s forwards; /* if the script ever fails, the splash still disappears */
}
.splashing .splash { display: grid; }
@keyframes splash-failsafe { to { visibility: hidden; } }

.splash-bg {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 45%, color-mix(in srgb, var(--primary) 20%, transparent), transparent 58%), var(--bg);
}
.splash-stage { position: relative; display: grid; justify-items: center; gap: 1.4rem; text-align: center; padding: 1rem; }

/* Three discs fly in from different sides and blend where they overlap */
.splash-discs { position: relative; width: min(46vw, 190px); aspect-ratio: 1; transform-origin: 0 0; }
.sd { position: absolute; width: 64%; aspect-ratio: 1; border-radius: 50%; opacity: 0; mix-blend-mode: var(--blend); }
.sd-1 { background: #ff3d95; top: 0; left: 0; animation: sd-left 1s 0.1s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
.sd-2 { background: #ffb41f; top: 0; right: 0; animation: sd-right 1s 0.3s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
.sd-3 { background: #12b5a0; bottom: 0; left: 18%; animation: sd-up 1s 0.5s cubic-bezier(0.2, 0.9, 0.2, 1) forwards; }
@keyframes sd-left  { from { opacity: 0; transform: translateX(-60vw) rotate(-200deg); } to { opacity: 0.95; transform: none; } }
@keyframes sd-right { from { opacity: 0; transform: translateX(60vw) rotate(200deg); } to { opacity: 0.95; transform: none; } }
@keyframes sd-up    { from { opacity: 0; transform: translateY(60vh) scale(0.3); } to { opacity: 0.95; transform: none; } }

/* The name rises letter by letter (letters are created in splash.js) */
.splash-word {
  display: flex; white-space: pre; margin: 0; transform-origin: 0 0;
  font: 800 clamp(2.6rem, 11vw, 6rem) / 1 var(--font-display); letter-spacing: -0.03em; color: var(--ink);
}
.splash-word span { display: inline-block; opacity: 0; transform: translateY(70%) rotate(8deg); animation: letter-in 0.6s calc(1.1s + var(--i) * 0.06s) cubic-bezier(0.2, 0.9, 0.2, 1.2) forwards; }
@keyframes letter-in { to { opacity: 1; transform: none; } }

.splash-sub { margin: 0; color: var(--muted); font-weight: 500; opacity: 0; animation: sub-in 0.6s 2s forwards; }
@keyframes sub-in { to { opacity: 1; } }

.splash-skip { position: absolute; right: 1rem; bottom: 1rem; }
