/* Carbon Confido — scroll-triggered section animations (shared by every page)

   How to use in HTML:
     data-reveal                 element fades in and rises as it scrolls into view
     data-reveal="left"          slides in from the left
     data-reveal="right"         slides in from the right
     data-reveal="zoom"          eases in from slightly smaller (good for photos)
     data-reveal-stagger         every child animates one after another
     data-reveal-stagger="zoom"  same, using the chosen style for the children

   Elements only start hidden when JavaScript is running (html.motion is set in
   each page's <head>), so without JS — or with "reduce motion" switched on —
   everything simply shows normally. */

/* Children of a stagger group are hidden straight away by CSS (not only once the
   script tags them), so they never flash visible before animating in. */
html.motion [data-reveal],
html.motion [data-reveal-stagger] > :not(.btn) {
  opacity: 0;
  transform: translate3d(0, 36px, 0);
  transition:
    opacity .9s cubic-bezier(.2,.8,.2,1) var(--reveal-d, 0s),
    transform .9s cubic-bezier(.2,.8,.2,1) var(--reveal-d, 0s);
}
html.motion [data-reveal="left"]  { transform: translate3d(-48px, 0, 0); }
html.motion [data-reveal="right"] { transform: translate3d(48px, 0, 0); }
html.motion [data-reveal="zoom"]  { transform: scale(.94); }

html.motion [data-reveal].is-in,
html.motion [data-reveal-stagger] > .is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html.motion [data-reveal] { opacity: 1 !important; transform: none !important; transition: none !important; }
}

/* Slide-in items start slightly off-screen; clip them so phones/iPads can never
   scroll sideways into that space (clip, unlike hidden, keeps the sticky header working). */
html.motion main { overflow-x: clip; }
