/* Homepage logo-reveal splash. Plays once per browser session, first visit only —
   gated by sessionStorage in the inline script next to the markup (index.html / ta/index.html).
   Reuses the site's existing CSS variables (--bg/--ink/--muted/--line/--brass/--navy-ink) —
   no new tokens introduced. All selectors scoped under .splash so nothing here can leak
   into or collide with the rest of the site's stylesheet. */

.splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  overflow: hidden;
}

.splash-vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, rgba(61,53,104,0.0) 0%, rgba(61,53,104,0.05) 100%);
  pointer-events: none;
}

.splash-sheet {
  display: flex; flex-direction: column; align-items: center;
}

.splash .logo-stage {
  position: relative;
  width: clamp(140px, 22vw, 240px);
  height: clamp(152px, 24vw, 260px);
}

/* soft contact shadow the logo settles onto, giving it lift/depth on a light stage */
.splash .logo-shadow {
  position: absolute;
  left: 50%; bottom: 4%;
  width: 62%; height: 14%;
  transform: translate(-50%, 0) scaleX(0.7);
  background: radial-gradient(ellipse at center, rgba(61,53,104,0.28) 0%, rgba(61,53,104,0) 72%);
  opacity: 0;
  pointer-events: none;
  animation: splashShadowIn 1.1s cubic-bezier(.16,.7,.24,1) forwards;
  animation-delay: 0.4s;
}
@keyframes splashShadowIn {
  0%   { opacity: 0; transform: translate(-50%, 0) scaleX(0.55); }
  100% { opacity: 1; transform: translate(-50%, 0) scaleX(1); }
}

/* a soft warm sheen that rakes across the whole stage, arriving just ahead of the logo reveal */
.splash .stage-beam {
  position: absolute; inset: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  animation: splashBeamFade 0.65s ease forwards;
  animation-delay: 0.14s;
}
.splash .stage-beam::before {
  content: "";
  position: absolute; top: -20%; bottom: -20%; left: 50%; width: 44vw;
  background: linear-gradient(100deg,
    transparent 0%,
    rgba(234,176,106,0) 30%,
    rgba(234,176,106,0.65) 46%,
    rgba(169,112,47,0.35) 50%,
    rgba(234,176,106,0.65) 54%,
    rgba(234,176,106,0) 70%,
    transparent 100%);
  transform: translateX(-160vw);
  animation: splashBeamSweep 0.65s cubic-bezier(.4,0,.2,1) forwards;
  animation-delay: 0.14s;
}
@keyframes splashBeamFade {
  0%   { opacity: 0; }
  10%  { opacity: 1; }
  60%  { opacity: 0.7; }
  100% { opacity: 0; }
}
@keyframes splashBeamSweep {
  0%   { transform: translateX(-160vw); }
  100% { transform: translateX(160vw); }
}

.splash .logo-hero {
  position: absolute; inset: 0;
  background-image: url(/assets/img/peacock-logo-navy.svg);
  background-size: contain; background-repeat: no-repeat; background-position: center;
  opacity: 0;
  transform: scale(0.91);
  filter: blur(8px) drop-shadow(0 6px 14px rgba(61,53,104,0));
  animation: splashLogoReveal 0.8s cubic-bezier(.16,.7,.2,1) forwards;
  animation-delay: 0.36s;
}
@keyframes splashLogoReveal {
  0%   { opacity: 0; transform: scale(0.9); filter: blur(10px) drop-shadow(0 4px 8px rgba(61,53,104,0)); }
  50%  { opacity: 1; }
  100% { opacity: 1; transform: scale(1); filter: blur(0) drop-shadow(0 10px 22px rgba(61,53,104,0.16)); }
}

/* a focused glint that flares once, right as the logo settles */
.splash .logo-glint {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 38% 34%, rgba(255,255,255,0.95) 0%, rgba(255,250,235,0.5) 18%, rgba(234,176,106,0) 40%);
  -webkit-mask-image: url(/assets/img/peacock-logo-navy.svg);
  mask-image: url(/assets/img/peacock-logo-navy.svg);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
  animation: splashGlintFlash 0.55s cubic-bezier(.2,.6,.2,1) forwards;
  animation-delay: 0.78s;
}
@keyframes splashGlintFlash {
  0%   { opacity: 0; transform: scale(0.9); }
  40%  { opacity: 1; transform: scale(1.04); }
  100% { opacity: 0; transform: scale(1.08); }
}

/* warm gold sweep during settle, masked to the logo's own silhouette — a shine passing across the mark */
.splash .logo-sweep {
  position: absolute; inset: 0;
  background-image: linear-gradient(100deg,
    transparent 42%,
    rgba(255,255,255,0) 47%,
    rgba(255,252,244,0.95) 50%,
    rgba(234,176,106,0.7) 53%,
    rgba(255,255,255,0) 58%,
    transparent 63%);
  background-size: 340% 340%;
  background-position: -140% 0%;
  -webkit-mask-image: url(/assets/img/peacock-logo-navy.svg);
  mask-image: url(/assets/img/peacock-logo-navy.svg);
  -webkit-mask-size: contain; mask-size: contain;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: center; mask-position: center;
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
}
.splash .logo-sweep.sweep-1 {
  animation: splashSweepMove 0.68s cubic-bezier(.5,0,.12,1) forwards;
  animation-delay: 0.66s;
}
.splash .logo-sweep.sweep-2 {
  animation: splashSweepMove2 0.65s cubic-bezier(.5,0,.15,1) forwards;
  animation-delay: 1.55s;
}
@keyframes splashSweepMove {
  0%   { opacity: 0; background-position: -140% 0%; }
  10%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; background-position: 140% 0%; }
}
@keyframes splashSweepMove2 {
  0%   { opacity: 0; background-position: -140% 0%; }
  14%  { opacity: 0.75; }
  65%  { opacity: 0.6; }
  100% { opacity: 0; background-position: 140% 0%; }
}

.splash .wordmark-wrap {
  margin-top: clamp(18px, 3vw, 28px);
  text-align: center;
}
.splash .wordmark {
  font-family: var(--display); font-weight: 600; color: var(--navy-ink);
  font-size: clamp(26px, 4.5vw, 38px);
  opacity: 0;
  letter-spacing: 0.75em;
  transform: translateY(10px);
  animation: splashWordmarkIn 0.9s cubic-bezier(.16,.7,.2,1) forwards;
  animation-delay: 0.36s;
}
@keyframes splashWordmarkIn {
  0%   { opacity: 0; letter-spacing: 0.75em; transform: translateY(10px); }
  100% { opacity: 1; letter-spacing: 0.42em; transform: translateY(0); }
}
.splash .wordmark-tagline {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
  margin-top: 8px;
  opacity: 0;
  animation: splashTaglineIn 0.7s ease forwards;
  animation-delay: 0.95s;
}
@keyframes splashTaglineIn { to { opacity: 1; } }

.splash.splash-exit {
  animation: splashOut 0.7s cubic-bezier(.5,0,.3,1) forwards;
  animation-delay: 2.6s;
}
@keyframes splashOut { to { opacity: 0; visibility: hidden; } }

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