(()=>{((h,s)=>{let c=h.querySelector(".starfield-background");if(!c)return;let a=18,n=0,r=0,o=0,i=0,e=0;if(matchMedia("(prefers-reduced-motion: reduce)").matches)return;function d(t){let m=window.innerWidth/2,f=window.innerHeight/2,l=(t.clientX-m)/m,v=(t.clientY-f)/f;n=l*a,r=v*a,e||(e=requestAnimationFrame(u))}function u(){e=0,o+=(n-o)*.08,i+=(r-i)*.08,c.style.setProperty("--mx",o.toFixed(2)+"px"),c.style.setProperty("--my",i.toFixed(2)+"px"),(Math.abs(n-o)>.01||Math.abs(r-i)>.01)&&(e=requestAnimationFrame(u))}s.addEventListener("mousemove",d,{passive:!0}),s.addEventListener("mouseleave",()=>{n=0,r=0,e||(e=requestAnimationFrame(u))},{passive:!0}),s.addEventListener("touchmove",t=>{!t.touches||!t.touches[0]||d(t.touches[0])},{passive:!0})})(document,window);})();
