(() => { 'use strict'; const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches; const header = document.querySelector('.site-header'); const heroCard = document.querySelector('.hero-card'); const updateHeader = () => header?.classList.toggle('mx-scrolled', window.scrollY > 18); updateHeader(); addEventListener('scroll', updateHeader, { passive: true }); if (heroCard && !heroCard.querySelector('.mx-power-stage')) { heroCard.insertAdjacentHTML('afterbegin', ` `); } if (!reduceMotion && heroCard) { heroCard.addEventListener('pointermove', (e) => { if (innerWidth < 901) return; const r = heroCard.getBoundingClientRect(); const x = (e.clientX - r.left) / r.width - .5; const y = (e.clientY - r.top) / r.height - .5; heroCard.style.transform = `rotateY(${x * 7}deg) rotateX(${-y * 5}deg) translateY(-2px)`; }); heroCard.addEventListener('pointerleave', () => { heroCard.style.transform = ''; }); } const candidates = document.querySelectorAll('main section > .container, body > section:not(.hero) > .container'); candidates.forEach(el => el.classList.add('mx-reveal')); if ('IntersectionObserver' in window && !reduceMotion) { const io = new IntersectionObserver(entries => entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('mx-visible'); io.unobserve(entry.target); } }), { threshold: .09, rootMargin: '0px 0px -6% 0px' }); candidates.forEach(el => io.observe(el)); } else candidates.forEach(el => el.classList.add('mx-visible')); })();