/* Motion: sections arrive as they are reached (the reveal system of the LeadX Security site, written
   for this page).

   - An element carries data-reveal="up | left | right | scale | fade | wash". site.js adds .is-in once,
     when the element comes into view, and removes the attribute again when the transition has ended,
     so the element goes back to its own styles (its hover, its own transitions) with no leftovers.
   - It moves with the individual `translate` and `scale` properties, never `transform`, so it composes
     with the transform an element already has (a hover tilt, a centring translate) instead of cancelling
     it.
   - Only opacity, translate and scale change: nothing here costs layout.
   - The hidden state exists only under .js-anim, a class an inline script puts on <html> before the first
     paint. With JavaScript off or blocked, or while site.js is still downloading, nothing is hidden.
   - A group written data-reveal-stagger on the parent staggers its direct data-reveal children, 90ms
     apart on desktop, 70ms on tablet, 55ms on phones (first child 0, up to the eighth).
   - Durations: 650ms for a section's parts, 1100ms for a "wash" (a background, which should already be
     there when the copy lands). One ease, no overshoot. */

.js-anim [data-reveal] {
  opacity: 0;
  transition:
    opacity 650ms cubic-bezier(0.22, 0.61, 0.36, 1),
    translate 650ms cubic-bezier(0.22, 0.61, 0.36, 1),
    scale 650ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

.js-anim [data-reveal="up"] {
  translate: 0 26px;
}

.js-anim [data-reveal="left"] {
  translate: -30px 0;
}

.js-anim [data-reveal="right"] {
  translate: 30px 0;
}

/* A large single object (a card, a banner): settles into place instead of sliding a slab. */
.js-anim [data-reveal="scale"] {
  translate: 0 14px;
  scale: 0.97;
}

.js-anim [data-reveal="wash"] {
  transition-duration: 1100ms;
}

.js-anim [data-reveal].is-in {
  opacity: 1;
  translate: none;
  scale: none;
}

[data-reveal-stagger] > [data-reveal]:nth-child(2) { transition-delay: 90ms; }
[data-reveal-stagger] > [data-reveal]:nth-child(3) { transition-delay: 180ms; }
[data-reveal-stagger] > [data-reveal]:nth-child(4) { transition-delay: 270ms; }
[data-reveal-stagger] > [data-reveal]:nth-child(5) { transition-delay: 360ms; }
[data-reveal-stagger] > [data-reveal]:nth-child(6) { transition-delay: 450ms; }
[data-reveal-stagger] > [data-reveal]:nth-child(7) { transition-delay: 540ms; }
[data-reveal-stagger] > [data-reveal]:nth-child(8) { transition-delay: 630ms; }

/* Tablet and phone: not the desktop numbers scaled down. Sideways reveals become vertical (stacked
   halves have no left and right to enter from) and the travel and the stagger step get shorter. */
@media (max-width: 991.98px) {
  .js-anim [data-reveal="up"],
  .js-anim [data-reveal="left"],
  .js-anim [data-reveal="right"] {
    translate: 0 18px;
  }

  [data-reveal-stagger] > [data-reveal]:nth-child(2) { transition-delay: 70ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(3) { transition-delay: 140ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(4) { transition-delay: 210ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(5) { transition-delay: 280ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(6) { transition-delay: 350ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(7) { transition-delay: 420ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(8) { transition-delay: 490ms; }
}

@media (max-width: 575.98px) {
  [data-reveal-stagger] > [data-reveal]:nth-child(2) { transition-delay: 55ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(3) { transition-delay: 110ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(4) { transition-delay: 165ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(5) { transition-delay: 220ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(6) { transition-delay: 275ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(7) { transition-delay: 330ms; }
  [data-reveal-stagger] > [data-reveal]:nth-child(8) { transition-delay: 385ms; }
}

/* Reduced motion: everything is simply there. */
@media (prefers-reduced-motion: reduce) {
  .js-anim [data-reveal] {
    opacity: 1;
    translate: none;
    scale: none;
    transition: none;
  }
}
