(() => { const root = document.documentElement; const reduce = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches; const items = [...document.querySelectorAll('.v520-reveal')]; items.forEach((item, index) => { item.style.setProperty('--v520-i', String(index % 5)); }); if (reduce || !('IntersectionObserver' in window)) { items.forEach((item) => item.classList.add('is-visible')); return; } root.classList.add('v520-motion-ready'); const observer = new IntersectionObserver((entries) => { entries.forEach((entry) => { if (!entry.isIntersecting) return; entry.target.classList.add('is-visible'); observer.unobserve(entry.target); }); }, { rootMargin: '0px 0px -8% 0px', threshold: 0.12 }); items.forEach((item) => observer.observe(item)); })();