/* First-visit reveal: the film resolves from an inky, defocused field while its UI assembles in sequence. */
.hero-entry-veil {
  position: absolute;
  /* Above the film and its paper transition, below all hero UI. */
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  background: #000;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
  clip-path: inset(0);
}

/* Keep the veil strictly between the film and the interface, never over the copy. */
.hero-motion { z-index: -1; }
.hero-index,
.eyebrow,
.hero h1,
.hero-title-tagline,
.hero-service,
.hero-actions,
.hero-foot { z-index: 2; }

body.hero-intro-pending .hero-entry-veil {
  opacity: 1;
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

body.hero-intro-pending .brand-mark,
body.hero-intro-pending .main-nav,
body.hero-intro-pending .site-controls,
body.hero-intro-pending .hero-index,
body.hero-intro-pending .eyebrow,
body.hero-intro-pending .hero h1,
body.hero-intro-pending .hero-title-tagline,
body.hero-intro-pending .hero-service,
body.hero-intro-pending .hero-actions,
body.hero-intro-pending .hero-foot { opacity: 0; }

body.hero-intro-play .hero-entry-veil { animation: hero-film-resolve 8s cubic-bezier(.16, .72, .18, 1) forwards; }
body.hero-intro-play .brand-mark,
body.hero-intro-play .main-nav,
body.hero-intro-play .site-controls,
body.hero-intro-play .hero-index,
body.hero-intro-play .eyebrow,
body.hero-intro-play .hero h1,
body.hero-intro-play .hero-title-tagline,
body.hero-intro-play .hero-service,
body.hero-intro-play .hero-actions,
body.hero-intro-play .hero-foot {
  animation: hero-ui-arrive .78s cubic-bezier(.18, .8, .2, 1) both;
}
body.hero-intro-play .brand-mark,
body.hero-intro-play .main-nav,
body.hero-intro-play .site-controls { animation-delay: .16s; }
body.hero-intro-play .hero-index,
body.hero-intro-play .eyebrow { animation-delay: .34s; }
body.hero-intro-play .hero h1 { animation-delay: .48s; }
body.hero-intro-play .hero-title-tagline { animation-delay: .61s; }
body.hero-intro-play .hero-service { animation-delay: .71s; }
body.hero-intro-play .hero-actions { animation-delay: .82s; }
body.hero-intro-play .hero-foot { animation-delay: .94s; }

@keyframes hero-film-resolve {
  0% { opacity: 1; backdrop-filter: blur(28px); -webkit-backdrop-filter: blur(28px); }
  100% { opacity: 0; backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); }
}
@keyframes hero-ui-arrive {
  0% { opacity: 0; translate: 0 1.15rem; filter: blur(7px); }
  100% { opacity: 1; translate: 0 0; filter: blur(0); }
}

/* Apply the stored dark scheme before the body exists, preventing a light flash on refresh. */
html.theme-dark-preload,
html.theme-dark-preload body { background: #161918; color: #eef0ea; }
html.theme-dark-preload .hero { background: #161918; }
html.theme-dark-preload .hero::after {
  background: linear-gradient(to bottom, rgba(22, 25, 24, 0) 0%, rgba(22, 25, 24, .08) 22%, rgba(22, 25, 24, .48) 61%, #161918 100%);
}

@media (prefers-reduced-motion: reduce) {
  .hero-entry-veil { display: none; }
  body.hero-intro-pending .brand-mark,
  body.hero-intro-pending .main-nav,
  body.hero-intro-pending .site-controls,
  body.hero-intro-pending .hero-index,
  body.hero-intro-pending .eyebrow,
  body.hero-intro-pending .hero h1,
  body.hero-intro-pending .hero-title-tagline,
  body.hero-intro-pending .hero-service,
  body.hero-intro-pending .hero-actions,
  body.hero-intro-pending .hero-foot { opacity: 1; }
}
