/* The hero entrance. CSS only, so the first screen never waits for JavaScript. Each part of a hero takes
   a hero-step-* class for its place in the order: hero-step-0 enters first, and each step after it starts
   90ms later (110ms for the lines of the homepage's heading). */

@layer utilities {
  @media (prefers-reduced-motion: no-preference) {
    .motion-safe\:animate-hero-rise {
      animation: hero-rise 800ms var(--ease-smooth-out) calc(var(--hero-step, 0) * 90ms + 60ms) both;
    }

    .motion-safe\:animate-hero-line {
      animation: hero-line 900ms var(--ease-smooth-out) calc(var(--hero-step, 0) * 110ms + 60ms) both;
    }
  }

  /* A part's place in the entrance order. */
  .hero-step-0 {
    --hero-step: 0;
  }

  .hero-step-1 {
    --hero-step: 1;
  }

  .hero-step-2 {
    --hero-step: 2;
  }

  .hero-step-3 {
    --hero-step: 3;
  }

  .hero-step-4 {
    --hero-step: 4;
  }

  .hero-step-5 {
    --hero-step: 5;
  }
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
}

@keyframes hero-line {
  from {
    clip-path: inset(0 0 100% 0);
    transform: translateY(0.35em);
  }
  to {
    clip-path: inset(0 0 -0.2em 0);
    transform: none;
  }
}
