#site-intro { display: none; }

html[data-intro=play] #site-intro {
  display: block;
  position: fixed;
  inset: 0;
  z-index: 100;
  overflow: hidden;
  isolation: isolate;
  background: #171b20;
}

html[data-intro=play],
html[data-intro=play] body { overflow: hidden; scroll-behavior: auto; }
body.home { background: #f1efea; }
html[data-intro=play]:not([data-intro-phase=zoom]) body > :not(#site-intro) { visibility: hidden; }

/* A soft pool of blue behind the mark keeps the stage free of extra UI. */
#site-intro::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(ellipse min(52vw, 440px) min(42vh, 300px) at center, #2f8bab66, transparent 82%);
  opacity: 0;
}

#site-intro[data-ready=true]::before { animation: intro-light 900ms ease-out both; }

#site-intro .intro-waves {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

#site-intro .intro-waves[hidden] { display: none; }

/* Keep the grain sharp even when the WebGL buffer is scaled up. */
#site-intro:has(.intro-waves:not([hidden]))::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('/shaders/intro-grain.svg') repeat;
  mix-blend-mode: soft-light;
  opacity: .42;
  pointer-events: none;
}
#site-intro:has(.intro-waves:not([hidden])) .intro-center {
  z-index: 1;
  filter: drop-shadow(0 2px 7px #1a142399);
}

#site-intro .intro-center {
  position: absolute;
  left: 50%;
  top: 50%;
  width: clamp(108px, 13vw, 164px);
  aspect-ratio: 527 / 432;
  transform: translate(-50%, -50%);
}

#site-intro .intro-logo {
  position: absolute;
  inset: 0;
  opacity: 0;
  background: #f5f4f0;
  mask: url('/brand/Signature_Flow_Black.svg?v=2') center / contain no-repeat;
  -webkit-mask: url('/brand/Signature_Flow_Black.svg?v=2') center / contain no-repeat;
  will-change: transform, opacity;
}

#site-intro .intro-logo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 33%, #a2c8d6 50%, transparent 67%);
  transform: translateX(-135%);
}

#site-intro[data-ready=true] .intro-logo { animation: intro-brand-sting 900ms both; }
#site-intro[data-ready=true] .intro-logo::after { animation: intro-sheen 650ms 190ms cubic-bezier(.22,.61,.36,1) both; }

html[data-intro-phase=zoom] #floating-dock { animation: intro-nav 480ms cubic-bezier(.2,.8,.2,1) 160ms both; }
html[data-intro-phase=zoom] .hero :is(.hero-greeting,.display,.hero-lede,.hero-actions,.hero-meta,.hero-portrait) {
  animation: intro-hero 500ms cubic-bezier(.2,.8,.2,1) 250ms both;
}
html[data-intro-phase=zoom] .hero :is(.hero-lede,.hero-actions,.hero-meta,.hero-portrait) { animation-delay: 310ms; }
html[data-intro-phase=zoom] .hero h1 { animation-name: intro-hero !important; }

@media (prefers-reduced-motion: reduce) {
  #site-intro { display: none !important; }
  html[data-intro-phase=zoom] :is(#floating-dock,.hero *) { animation: none !important; }
}

@keyframes intro-light { from { opacity: 0; } to { opacity: 1; } }
@keyframes intro-sheen { to { transform: translateX(135%); } }
@keyframes intro-brand-sting {
  0% { opacity: 0; transform: translateY(22px) rotate(-16deg) scale(.66); animation-timing-function: cubic-bezier(.2,.83,.24,1); }
  48% { opacity: 1; transform: translateY(-5px) rotate(4deg) scale(1.055); animation-timing-function: ease-out; }
  76%, 100% { opacity: 1; transform: none; }
}
@keyframes intro-hero { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
@keyframes intro-nav { from { opacity: 0; transform: translate(-50%,-14px); } to { opacity: 1; transform: translate(-50%,0); } }
