/* Entrance, scroll wipe, hover. Signature: clip-path wipe on headings. */

@media (prefers-reduced-motion: no-preference) {
  .mark-draw {
    stroke-dasharray: 180;
    stroke-dashoffset: 180;
    animation: mark-draw 1.15s var(--ease) forwards;
  }

  .mark-draw:nth-child(2) { animation-delay: 0.18s; }
  .mark-draw:nth-child(3) { animation-delay: 0.32s; }

  .wordmark-type {
    animation: rise 0.7s var(--ease) 0.35s both;
  }

  .hero-kicker { animation: rise 0.7s var(--ease) 0.15s both; }
  .hero-title { animation: rise 0.85s var(--ease) 0.28s both; }
  .hero-lede { animation: rise 0.8s var(--ease) 0.42s both; }
  .hero-intro { animation: rise 0.8s var(--ease) 0.54s both; }
  .hero-byline { animation: rise 0.7s var(--ease) 0.66s both; }
  .hero-figure { animation: rise 1s var(--ease) 0.2s both; }

  .js [data-reveal="rise"] {
    opacity: 0;
    transform: translateY(1.15rem);
    transition: opacity 650ms var(--ease), transform 650ms var(--ease);
    transition-delay: var(--d, 0ms);
  }

  .js [data-reveal="wipe"] {
    opacity: 0;
    transform: translateY(0.8rem);
    transition: opacity 500ms var(--ease), transform 500ms var(--ease);
    transition-delay: var(--d, 0ms);
  }

  .js [data-reveal].is-visible {
    opacity: 1;
    transform: none;
  }

  .js [data-reveal="wipe"].is-visible {
    animation: wipe 780ms var(--ease) both;
    animation-delay: var(--d, 0ms);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(1.15rem);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes mark-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes wipe {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    clip-path: none !important;
  }
}
