/* ==========================================================================
   AdBrust Motion — styles for the shared motion system (assets/js/adbrust-motion.js).
   API and rules: docs/ADBRUST-BLUEPRINT.md, "Motion".
   Everything here is switched off under prefers-reduced-motion.
   ========================================================================== */

/* ---------- Reveal on scroll: [data-adbrust-reveal] (fade + 16px up, once) ----------
   Motion adds .adbrust-motion-on to <html> only when motion is allowed (not in the editor). */
.adbrust-motion-on [data-adbrust-reveal] {
  opacity: 0;
  transform: translateY(var(--adbrust-reveal-distance));
  transition: opacity var(--adbrust-reveal-duration) var(--adbrust-ease-out), transform var(--adbrust-reveal-duration) var(--adbrust-ease-out);
}
.adbrust-motion-on [data-adbrust-reveal].adbrust-is-visible { opacity: 1; transform: none; }

/* ---------- Parallax: [data-adbrust-parallax="0.35"] ---------- */
[data-adbrust-parallax] { will-change: transform; }

/* ---------- Marquee: [data-adbrust-marquee="30"] (seconds per repeat) ----------
   Put the text once inside the track; Motion repeats it and adds .adbrust-is-running. */
[data-adbrust-marquee] { display: flex; width: max-content; }
[data-adbrust-marquee].adbrust-is-running { animation: adbrust-marquee var(--adbrust-marquee-duration, 30s) linear infinite; }
:hover > [data-adbrust-marquee] { animation-play-state: paused; }
@keyframes adbrust-marquee { to { transform: translate3d(-50%, 0, 0); } }

/* ---------- Lenis smooth scroll (helper rules required by Lenis) ---------- */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }

@media (prefers-reduced-motion: reduce) {
  .adbrust-motion-on [data-adbrust-reveal] { opacity: 1; transform: none; transition: none; }
  [data-adbrust-marquee].adbrust-is-running { animation: none; }
}
