/* splash.css — homepage-only splash. Loaded and used only by index.html.
   All motion is CSS transitions reacting to beat-1..4 classes that
   splash.js's timeline adds to #splash — there is no animation loop. */

@property --splash-r {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 0%;
}

html.splash-lock,
html.splash-lock body {
  overflow: hidden;
  height: 100%;
}

#splash {
  position: fixed;
  inset: 0;
  z-index:var(--z-reveal);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--void);
  font-family: var(--mono);
  --splash-r: 0%;
  -webkit-mask-image: radial-gradient(circle at 50% 50%, transparent 0%, transparent var(--splash-r), #000 calc(var(--splash-r) + 1px));
  mask-image: radial-gradient(circle at 50% 50%, transparent 0%, transparent var(--splash-r), #000 calc(var(--splash-r) + 1px));
  transition: --splash-r .46s var(--ease-inout);
}

/* If @property isn't supported, --splash-r can't interpolate: the mask
   still applies, it just snaps instead of animating on the beat-4 class
   change. The splash still completes correctly either way. */

#splash.beat-4 {
  --splash-r: 100%;
  pointer-events: none;
}

/* beat 1 — small, quiet mark */
.splash-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .4s ease, transform .4s ease;
}
#splash.beat-1 .splash-mark { opacity: 1; transform: translateY(0); }
#splash.beat-3 .splash-mark,
#splash.beat-4 .splash-mark { opacity: 0; transition-duration: .2s; }

.splash-mark .splash-word {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: .01em;
  background: linear-gradient(95deg, var(--cyan), var(--cobalt) 55%, var(--cobalt-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.splash-mark .splash-word .dia {
  font-style: normal;
  color: var(--raspberry);
  font-size: .55em;
  -webkit-text-fill-color: var(--raspberry);
  margin-left: .15em;
}
.splash-mark .splash-tag {
  font-size: .7rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--dim);
}

/* prompt — text + arrow only, the entire interactive surface */
.splash-prompt {
  margin-top: 1.6rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: none;
  border: none;
  padding: .5rem;
  cursor: pointer;
  font-family: var(--mono);
  font-size: .78rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0;
  transition: opacity .4s ease, transform .15s ease;
}
#splash.beat-2 .splash-prompt { opacity: 1; }
#splash.beat-3 .splash-prompt,
#splash.beat-4 .splash-prompt { opacity: 0; transition-duration: .15s; }
.splash-prompt.is-pressed { transform: scale(.92); }
.splash-prompt svg {
  width: 15px;
  height: 9px;
  color: var(--cyan);
  animation: splash-nudge 1.6s ease-in-out infinite;
}
#splash.beat-3 .splash-prompt svg,
#splash.beat-4 .splash-prompt svg { animation: none; }
@keyframes splash-nudge {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(4px); }
}

/* beat 3/4 — the climax, dissolving into the page */
.splash-big {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0;
  transform: scale(.85);
  filter: blur(0);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease, filter .46s ease;
}
#splash.beat-3 .splash-big { opacity: 1; transform: scale(1); }
#splash.beat-4 .splash-big {
  opacity: 0;
  transform: scale(1.5);
  filter: blur(6px);
  transition-duration: .46s;
}
.splash-big b {
  font-family: var(--display);
  font-weight: 800;
  text-transform: uppercase;
  line-height: .92;
  letter-spacing: -.01em;
  font-size: clamp(2.4rem, 14vw, 6rem);
  background: linear-gradient(100deg, var(--white) 0%, var(--cyan) 45%, var(--cobalt) 75%, var(--cobalt-deep) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (prefers-reduced-motion: reduce) {
  /* Defense in depth — splash.js already skips mounting #splash entirely
     for reduced-motion visitors, so this should never matter in practice.
     If it ever does run, nothing here animates. */
  #splash, #splash *, .splash-prompt svg {
    transition: none !important;
    animation: none !important;
  }
}
