{"version":3,"file":"HeaderBackdrop.CEVO0KR6.mjs","names":["useState","__esmMin","init_ssg_sandbox_shims","window","_e","c","J","init_jsx_runtime","init_npm_react_18_3_1","ce","init_Theme","useIsLightTheme","withHeaderBackdrop","on","setOn","still","setStill","isLight","motion","updateMotion","frame","check","hold","featuredWork","HEADER_PX","SCROLL_PX","schedule","Component","props","BACKGROUND_LIGHT","BACKGROUND","BLUR_LIGHT","BLUR","FADE_MS","init_HeaderBackdrop","el"],"sources":["https:/framerusercontent.com/modules/B5sqsFmKXfljSghCNKQ8/UXkbXheeccbT0E45VAe2/HeaderBackdrop.js"],"sourcesContent":["// Fades in a blurred backdrop behind the fixed nav on Home, Work and About, once the page has scrolled\n// past 24px. It sits under the nav and takes no pointer events. Clear at the top of the page. The Home\n// hero is sticky, so scrolling alone moves nothing behind the nav there; Home waits until Featured Work\n// reaches the header, so the backdrop never cuts through the hero dots. No fade under reduced motion.\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{forwardRef,useEffect,useState}from\"react\";import{useIsLightTheme}from\"https://framerusercontent.com/modules/RfJzO84mVpMUuolTzO1q/BNSwPp5mcPJP1MsucKEu/Theme.js\";const SCROLL_PX=24;const HEADER_PX=92;const FADE_MS=150;const BACKGROUND=\"color-mix(in srgb, var(--token-e2b15e7a-4bfe-45e7-9c4f-4c98fa40629e, #000000) 85%, transparent)\"// Background token at 85%: black in dark, off-white in light\n;const BLUR=\"blur(12px)\";// Light only: a lighter, more blurred band so card tops scrolling under the nav are not bleached.\n// Saturation is lifted slightly so the colored covers keep their color through the band.\nconst BACKGROUND_LIGHT=\"color-mix(in srgb, var(--token-e2b15e7a-4bfe-45e7-9c4f-4c98fa40629e, #F7F8FC) 60%, transparent)\";const BLUR_LIGHT=\"blur(16px) saturate(140%)\";const featuredWork=()=>Array.from(document.querySelectorAll('[data-framer-name=\"Featured Work\"]')).find(el=>el.getClientRects().length>0);export function withHeaderBackdrop(Component){return /*#__PURE__*/forwardRef(function HeaderBackdrop(props,ref){const[on,setOn]=useState(false);const[still,setStill]=useState(false);const isLight=useIsLightTheme();useEffect(()=>{if(typeof window===\"undefined\")return;const motion=window.matchMedia(\"(prefers-reduced-motion: reduce)\");const updateMotion=()=>setStill(motion.matches);updateMotion();motion.addEventListener?.(\"change\",updateMotion);let frame=0;const check=()=>{frame=0;const hold=featuredWork();setOn(hold?hold.getBoundingClientRect().top<=HEADER_PX:window.scrollY>SCROLL_PX);};const schedule=()=>{if(!frame)frame=requestAnimationFrame(check);};check();window.addEventListener(\"scroll\",schedule,{passive:true});window.addEventListener(\"resize\",schedule);return()=>{if(frame)cancelAnimationFrame(frame);window.removeEventListener(\"scroll\",schedule);window.removeEventListener(\"resize\",schedule);motion.removeEventListener?.(\"change\",updateMotion);};},[]);return /*#__PURE__*/_jsx(Component,{...props,ref:ref,\"aria-hidden\":\"true\",style:{...props.style,background:isLight?BACKGROUND_LIGHT:BACKGROUND,backdropFilter:isLight?BLUR_LIGHT:BLUR,WebkitBackdropFilter:isLight?BLUR_LIGHT:BLUR,opacity:on?1:0,transition:still?\"none\":`opacity ${FADE_MS}ms ease-out`,pointerEvents:\"none\"}});});}\nexport const __FramerMetadata__ = {\"exports\":{\"withHeaderBackdrop\":{\"type\":\"reactHoc\",\"name\":\"withHeaderBackdrop\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}"],"mappings":"A,sMAOgT,SAAgBY,EAAmB,EAAU,CAAC,MAAoB,gBAAW,SAAwB,EAAM,EAAI,CAAC,GAAK,CAACC,EAAGC,GAAOd,EAAS,EAAK,EAAO,CAACe,EAAMC,GAAUhB,EAAS,EAAK,EAAQiB,EAAQN,EAAgB,EAAovB,OAAlvBF,MAAc,CAAC,GAAUN,IAAS,OAAY,OAAO,IAAMe,EAAOf,EAAO,WAAW,kCAAkC,EAAQgB,MAAiBH,EAASE,EAAO,OAAO,EAAEC,EAAa,EAAED,EAAO,mBAAmB,SAASC,CAAY,EAAE,IAAIC,E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