/* ==========================================================================
   Motion System — Masked Hero Reveal, GPU Ambient Drift, Scroll Reveal
   & Strict prefers-reduced-motion Compliance (Midnight Digital)
   ========================================================================== */

/* A. Hero Masked Typography Reveal (pure CSS keyframes, zero blocking delay) */
.reveal-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
}

.reveal-line {
  display: block;
  animation: heroMaskIn var(--dur-hero) var(--ease-expo) var(--delay, 0ms) both;
}

.hero-stagger {
  animation: heroFadeUp 640ms var(--ease-expo) var(--delay, 0ms) both;
}

@keyframes heroMaskIn {
  from {
    opacity: 0;
    transform: translateY(105%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Slow, GPU-Composited Atmospheric Drift on Midnight Hero Glow */
@keyframes heroOrbDrift {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0.62;
  }
  50% {
    transform: translate3d(-26px, 16px, 0) scale(1.05);
    opacity: 0.78;
  }
  100% {
    transform: translate3d(18px, -12px, 0) scale(0.97);
    opacity: 0.56;
  }
}

.hero__orb {
  animation: heroOrbDrift 20s ease-in-out infinite alternate;
  will-change: transform, opacity;
}

/* B. Scroll-Based Reveal (activated ONLY when JS adds .js-ready to <html>) */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity var(--dur-reveal) var(--ease-expo),
    transform var(--dur-reveal) var(--ease-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

.js-ready [data-reveal='clip'] {
  transform: translateY(16px);
  clip-path: inset(0 0 8% 0);
  transition:
    opacity var(--dur-reveal) var(--ease-expo),
    transform var(--dur-reveal) var(--ease-expo),
    clip-path var(--dur-reveal) var(--ease-expo);
  transition-delay: var(--reveal-delay, 0ms);
}

.js-ready [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  clip-path: inset(0 0 0 0);
}

/* C. Strict Reduced-Motion Compliance */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .reveal-line,
  .hero-stagger,
  .hero__orb {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .hero__orb {
    opacity: 0.5 !important;
  }

  .js-ready [data-reveal],
  .js-ready [data-reveal='clip'] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
    transition: none !important;
  }

  .hero__ambient,
  .contact-box__spotlight {
    display: none;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
