/* Scroll reveal + counter
   Behaviour: js/motion.js. Values: css/tokens.css (Motion block).
   Rule for the site: every section after the hero and the "Trusted by" bar reveals on scroll. */

/* ---------- Reveal ----------
   Add data-reveal to any element. Optional values: "fade", "left", "right" (default: slides up).
   Elements are only hidden when JavaScript is running (the .js class) and the visitor has not
   asked for reduced motion. Without JavaScript, or with reduced motion, everything is simply visible. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translate3d(0, var(--reveal-distance), 0);
    will-change: opacity, transform;
  }
  .js [data-reveal="fade"]  { transform: none; }
  .js [data-reveal="left"]  { transform: translate3d(calc(var(--reveal-distance) * -1), 0, 0); }
  .js [data-reveal="right"] { transform: translate3d(var(--reveal-distance), 0, 0); }

  /* The transition lives on the revealed state, so hiding (and "Replay" in the style guide) is instant. */
  .js [data-reveal].is-revealed {
    opacity: 1;
    transform: none;
    transition:
      opacity var(--reveal-duration) var(--ease) var(--reveal-delay, 0ms),
      transform var(--reveal-duration) var(--ease) var(--reveal-delay, 0ms);
  }
}
@media print {
  .js [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Counter ----------
   <span class="count" data-count="320" data-prefix="$">
     <span class="sr-only">$320</span>                       final value, read by screen readers
     <span class="count__live" aria-hidden="true">$320</span> the animated copy
   </span>
   The final value is in the HTML, so it also shows without JavaScript and with reduced motion. */
.count__live { font-variant-numeric: tabular-nums; }
