document.querySelectorAll('.faq-item').forEach(el => { el.classList.remove('open'); el.querySelector('.faq-question').setAttribute('aria-expanded','false'); }); if (!isOpen) { item.classList.add('open'); btn.setAttribute('aria-expanded','true'); } }); }); // ── Scroll Fade-In ── const fadeEls = document.querySelectorAll('.fade-in'); const observer = new IntersectionObserver(entries => { entries.forEach(e => { if (e.isIntersecting) { e.target.classList.add('visible'); observer.unobserve(e.target); } }); }, { threshold: 0.1, rootMargin: '0px 0px -40px 0px' }); fadeEls.forEach(el => observer.observe(el)); // ── Sticky CTA ── const stickyCta = document.getElementById('sticky-cta'); const mainCta = document.getElementById('main-cta'); const stickyObs = new IntersectionObserver(entries => { entries.forEach(e => { if (e.isIntersecting) { stickyCta.classList.remove('visible'); stickyCta.setAttribute('aria-hidden','true'); } else { stickyCta.classList.add('visible'); stickyCta.setAttribute('aria-hidden','false'); } }); }, { threshold: 0.5 }); if (mainCta) stickyObs.observe(mainCta); window.addEventListener('scroll', () => { const heroBottom = document.getElementById('hero').getBoundingClientRect().bottom; if (heroBottom > 0) { stickyCta.classList.remove('visible'); stickyCta.setAttribute('aria-hidden','true'); } }, { passive: true });