{"version":3,"file":"ArcheWorkStack_1.fOdU0all.mjs","names":["useRef","__esmMin","init_ssg_sandbox_shims","init_npm_react_18_3_1","de","c","J","init_jsx_runtime","ce","window","RenderTarget","init_framer_DcxuU94H","stickyAncestor","el","stop","withWorkStack","host","root","cards","raf","near","release","collect","content","frame","vh","i","top","enter","clamp","next","cover","moving","s","easeOut","lag","ty","sc","r","sheet","onScroll","io","onResize","Component","ref","props","init_ArcheWorkStack_1","v","t"],"sources":["https:/framerusercontent.com/modules/Cz6yKaZ5oBoOLzEAiNBm/Arl2p2AEYqgJE6FeJ8XF/ArcheWorkStack_1.js"],"sourcesContent":["// Arché \"Selected works\" sticky stack — scroll-scrubbed choreography (override on the Work Section).\n// Per card (all driven by scroll position, identity transform once a card is pinned and uncovered):\n//  • entering:  blurred Background lags behind (parallax 8%, scale 1.2 → 1)\n//               project Image opens from an inset frame (clip-path) as the card rises\n//  • covered:   the card sinks back (scale 1 → 0.92) and dims (black ::after shade 0 → 0.55, same as brightness 1 → 0.45)\n//               while its Background keeps drifting (6%, scale → 1.12)\n// Perf: dimming is an opacity-only ::after shade driven by a CSS variable (no filter repaint, and no DOM inserted into\n// React's tree: the CMS list hydrates lazily, and an inserted node caused hydration errors #418/#422), and cards are promoted to their own\n// layer only while they move, so the page doesn't carry five full-screen layers at rest.\n// Off on the canvas and for prefers-reduced-motion.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useRef}from\"react\";import{RenderTarget}from\"framer\";const clamp=v=>v<0?0:v>1?1:v;const easeOut=t=>1-Math.pow(1-t,3);function stickyAncestor(el,stop){let n=el;while(n&&n!==stop){if(getComputedStyle(n).position===\"sticky\")return n;n=n.parentElement;}return el;}export function withWorkStack(Component){return /*#__PURE__*/forwardRef((props,ref)=>{const host=useRef(null);useEffect(()=>{if(RenderTarget.current()===RenderTarget.canvas)return;if(window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches)return;const root=host.current;if(!root)return;let cards=[];let raf=0;let near=false;const release=()=>cards.forEach(c=>{c.content.style.transform=c.content.style.willChange=\"\";if(c.bg)c.bg.style.transform=c.bg.style.willChange=\"\";if(c.image)c.image.style.clipPath=\"\";c.content.style.removeProperty(\"--arche-shade\");});const collect=()=>{release();// only the visible breakpoint's cards (hidden breakpoints have zero size)\ncards=Array.from(root.querySelectorAll('[data-framer-name=\"Work 01\"]')).filter(c=>c.offsetWidth>0).map(content=>{content.style.transformOrigin=\"50% 30%\";return{content,live:false,sticky:stickyAncestor(content,root),bg:content.querySelector(':scope > [data-framer-name=\"Background\"]'),image:content.querySelector('[data-framer-name=\"Image\"]')};});};const frame=()=>{raf=0;const vh=window.innerHeight;for(let i=0;i<cards.length;i++){const c=cards[i];const top=c.sticky.getBoundingClientRect().top;const enter=clamp(1-top/vh);const next=cards[i+1];const cover=next?clamp(1-next.sticky.getBoundingClientRect().top/vh):0;// promote to a layer only while this card is in motion\nconst moving=enter>0&&enter<1||cover>0&&cover<1;if(moving!==c.live){c.live=moving;c.content.style.willChange=moving?\"transform\":\"\";if(c.bg)c.bg.style.willChange=moving?\"transform\":\"\";}// card sinks + dims while the next one slides over it\nconst s=1-.08*easeOut(cover);c.content.style.transform=cover>0?`scale(${s})`:\"\";c.content.style.setProperty(\"--arche-shade\",cover>0?(.55*cover).toFixed(3):\"0\");// background parallax (scale always covers the shift, so no edge ever shows)\nif(c.bg){const lag=1-enter;const ty=-8*lag+6*cover;const sc=1+.2*lag+.12*cover;c.bg.style.transform=lag>0||cover>0?`translate3d(0, ${ty}%, 0) scale(${sc})`:\"\";}// project image opens from an inset frame as the card rises\nif(c.image){const r=1-easeOut(clamp((enter-.15)/.75));c.image.style.clipPath=r>.001?`inset(${16*r}% ${12*r}% ${16*r}% ${12*r}%)`:\"\";}}};// the shade lives in a head stylesheet (outside React's tree), keyed to the card layer name\nlet sheet=document.head.querySelector(\"style[data-arche-workstack]\");if(!sheet){sheet=document.createElement(\"style\");sheet.setAttribute(\"data-arche-workstack\",\"\");sheet.textContent='[data-framer-name=\"Work Section\"] [data-framer-name=\"Work 01\"]::after{content:\"\";position:absolute;inset:0;background:#000;opacity:var(--arche-shade,0);pointer-events:none;z-index:9;border-radius:inherit}';document.head.appendChild(sheet);}const onScroll=()=>{if(near&&!raf)raf=requestAnimationFrame(frame);};const io=new IntersectionObserver(([e])=>{near=e.isIntersecting;if(near)onScroll();},{rootMargin:\"100% 0px 100% 0px\"});io.observe(root);const onResize=()=>{collect();onScroll();};collect();frame();window.addEventListener(\"scroll\",onScroll,{passive:true});window.addEventListener(\"resize\",onResize);return()=>{io.disconnect();window.removeEventListener(\"scroll\",onScroll);window.removeEventListener(\"resize\",onResize);if(raf)cancelAnimationFrame(raf);release();};},[]);const setRef=el=>{host.current=el;if(typeof ref===\"function\")ref(el);else if(ref)ref.current=el;};return /*#__PURE__*/_jsx(Component,{ref:setRef,...props});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withWorkStack\":{\"type\":\"reactHoc\",\"name\":\"withWorkStack\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ArcheWorkStack_1.map"],"mappings":"A,gMAU2L,SAASY,EAAe,EAAG,EAAK,CAAC,IAAI,EAAEC,EAAG,KAAM,GAAG,IAAIC,GAAK,CAAC,GAAG,iBAAiB,CAAC,CAAC,CAAC,WAAW,SAAS,OAAO,EAAE,EAAE,EAAE,aAAc,CAAC,OAAOD,CAAG,CAAC,SAAgBE,EAAc,EAAU,CAAC,MAAoB,iBAAY,EAAM,IAAM,CAAC,IAAMC,EAAKhB,EAAO,IAAI,EAM4mB,OAN1mBQ,MAAc,CAAwD,GAApDE,EAAa,QAAQ,IAAIA,EAAa,QAAiBD,EAAO,WAAW,kCAAkC,CAAC,CAAC,QAAQ,OAAO,IAAMQ,EAAKD,EAAK,QAAQ,GAAG,CAACC,EAAK,OAAO,IAAIC,EAAM,CAAC,EAAMC,EAAI,EAAMC,EAAK,GAAYC,MAAYH,EAA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