const revealTargets = document.querySelectorAll(
  ".section-heading, .gear-card, .architecture-copy, .architecture-visual, .steps li, .cta-section",
);

if ("IntersectionObserver" in window && !matchMedia("(prefers-reduced-motion: reduce)").matches) {
  for (const target of revealTargets) target.dataset.reveal = "";
  const observer = new IntersectionObserver(
    (entries) => {
      for (const entry of entries) {
        if (!entry.isIntersecting) continue;
        entry.target.classList.add("revealed");
        observer.unobserve(entry.target);
      }
    },
    { rootMargin: "0px 0px -40px", threshold: 0.08 },
  );
  for (const target of revealTargets) observer.observe(target);
}
