/* =====================================================
   SPLASH / INTRO — ink-bloom reveal
   Shown once per session, on the first load only.

   Robustness (matches the theme's no-JS philosophy):
   - Hidden by default; only `.js .splash` shows it, so without JS
     the page is never covered.
   - `html.splash-done` (set by the head script after the first view)
     keeps it hidden on every later page of the session.
   - `prefers-reduced-motion` skips it entirely.
   - The reveal + dismissal is CSS-driven, so even if main.js never
     runs the splash clears itself (main.js only adds scroll-lock +
     DOM cleanup as enhancement).
   ===================================================== */
.splash { display: none; }

.js .splash {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 10001;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Fallback dismissal: turn non-blocking, then hide — no JS needed */
  animation: splashEnd 2.6s forwards;
}

.js.splash-done .splash { display: none; }

@media (prefers-reduced-motion: reduce) {
  .js .splash { display: none; }
}

/* The growing transparent "ink hole". Its huge box-shadow IS the black
   cover during the intro; as the hole grows the cover recedes off-screen
   and the page blooms open from the centre. */
.splash__bloom {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: transparent;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 100vmax var(--color-bg-deep);
  animation: splashBloom 0.95s cubic-bezier(0.7, 0, 0.25, 1) 1.2s forwards;
}

/* Brand sits above the cover and dissolves just as the bloom opens. */
.splash__brand {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  animation: splashBrandIn 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94) both,
             splashBrandOut 0.4s ease 1.2s forwards;
}

/* Ink drop that falls onto the name */
.splash__drop {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--color-text);
  box-shadow: 0 0 18px rgba(235, 235, 235, 0.25);
  animation: splashDrop 1s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.splash__name {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 9vw, 5rem);
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-text);
}

.splash__eyebrow {
  font-size: 0.6875rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--color-muted);
}

@keyframes splashBloom {
  0%   { width: 0;        height: 0; }
  100% { width: 220vmax;  height: 220vmax; }
}

@keyframes splashBrandIn {
  0%   { opacity: 0; transform: translateY(16px); }
  100% { opacity: 1; transform: translateY(0); }
}

@keyframes splashBrandOut {
  to { opacity: 0; transform: translateY(-10px) scale(0.96); }
}

/* drop falls in, squashes on landing, settles */
@keyframes splashDrop {
  0%   { opacity: 0; transform: translateY(-46px) scale(0.2); }
  55%  { opacity: 1; transform: translateY(0)     scale(1); }
  72%  { transform: translateY(0) scale(1.15, 0.82); }
  100% { transform: translateY(0) scale(1); }
}

/* Self-clearing safety net: stop blocking clicks after the bloom,
   then hide entirely. */
@keyframes splashEnd {
  0%   { pointer-events: auto; visibility: visible; }
  82%  { pointer-events: auto; visibility: visible; }
  83%  { pointer-events: none; }
  100% { pointer-events: none; visibility: hidden; }
}
