/* ══ 1. LOADING OVERLAY ══ */ (function(){ const overlay = document.getElementById('loading-overlay'); // Fix #17: instant hide for reduced-motion users if(window.matchMedia('(prefers-reduced-motion:reduce)').matches){ overlay.style.display='none'; return; } const heroVid = document.querySelector('#hero video'); function hideOverlay(){ overlay.classList.add('hide'); setTimeout(()=>{ overlay.style.display='none'; },1000); } if(heroVid){ heroVid.addEventListener('canplay', hideOverlay, {once:true}); setTimeout(hideOverlay, 2500); // max wait 2.5s } else { setTimeout(hideOverlay, 1000); }