(function(){var prog=document.getElementById("sd-progress");var nav=document.getElementById("navbar");window.addEventListener("scroll",function(){var dH=document.documentElement.scrollHeight-window.innerHeight;if(prog)prog.style.width=(dH>0?(window.scrollY/dH)*100:0)+"%";if(nav)nav.classList.toggle("sd-scrolled",window.scrollY>50);});var glow=document.getElementById("sd-cursor-glow");if(glow){document.addEventListener("mousemove",function(e){glow.style.left=e.clientX+"px";glow.style.top=e.clientY+"px";});}var canvas=document.getElementById("sd-particles");if(canvas){var ctx=canvas.getContext("2d");var W,H,pts=[];function resize(){W=canvas.width=window.innerWidth;H=canvas.height=window.innerHeight;}resize();window.addEventListener("resize",resize);for(var i=0;i<30;i++){pts.push({x:Math.random()*1200,y:Math.random()*800,size:Math.random()*1.5+0.4,sx:(Math.random()-.5)*.3,sy:(Math.random()-.5)*.3,op:Math.random()*.3+.05,col:Math.random()>.5?"#FF69B4":"#FF1493"});}function draw(){ctx.clearRect(0,0,W,H);pts.forEach(function(p){p.x+=p.sx;p.y+=p.sy;if(p.x<0||p.x>W)p.sx*=-1;if(p.y<0||p.y>H)p.sy*=-1;ctx.save();ctx.globalAlpha=p.op;ctx.fillStyle=p.col;ctx.beginPath();ctx.arc(p.x,p.y,p.size,0,Math.PI*2);ctx.fill();ctx.restore();});requestAnimationFrame(draw);}draw();}var allR=[];["section > div","section > article",".product-card",".item-card",".lookbook-item",".grid-item"].forEach(function(sel){document.querySelectorAll(sel).forEach(function(el){if(!el.classList.contains("sd-reveal")&&!el.querySelector("canvas")){el.classList.add("sd-reveal");allR.push(el);}});});document.querySelectorAll("img").forEach(function(img){img.classList.add("sd-img-reveal");});var io=new IntersectionObserver(function(entries){entries.forEach(function(e,i){if(e.isIntersecting){var idx=allR.indexOf(e.target);setTimeout(function(){e.target.classList.add("sd-visible");e.target.querySelectorAll("img.sd-img-reveal").forEach(function(img){img.classList.add("sd-visible");});},( idx%5)*90);io.unobserve(e.target);}});},{threshold:0.1});allR.forEach(function(el){io.observe(el);});document.querySelectorAll("img.sd-img-reveal").forEach(function(img){var imgObs=new IntersectionObserver(function(entries){entries.forEach(function(e){if(e.isIntersecting){e.target.classList.add("sd-visible");imgObs.unobserve(e.target);}});},{threshold:0.15});imgObs.observe(img);});})();