import{r,u as w,$ as j,a0 as N,a1 as S,j as e,m as n}from"./index-CqI-dFNO.js";const V={reading:"max-w-3xl",wide:"max-w-5xl",gallery:"max-w-7xl"};function E({children:s,className:t=""}){return e.jsx("div",{className:t,children:s})}const u=[{initial:{opacity:0,y:36},inView:{opacity:1,y:0}},{initial:{opacity:0,clipPath:"inset(0 0 18% 0)",y:20},inView:{opacity:1,clipPath:"inset(0 0 0% 0)",y:0}},{initial:{opacity:0,y:28,x:-14},inView:{opacity:1,y:0,x:0}}];function z({eyebrow:s,title:t,intro:a,children:l,width:x="wide",marker:o}){const f=r.Children.toArray(l),d=r.useRef(null),p=w();j(t,a?P(a,160):void 0);const{scrollYProgress:h}=N({target:d,offset:["start start","end end"]}),y=S(h,{stiffness:120,damping:28,restDelta:.001}),m=V[x],v=t.length>110?"clamp(1.35rem, 2.1vw, 1.85rem)":t.length>70?"clamp(1.5rem, 2.8vw, 2.25rem)":t.length>40?"clamp(1.75rem, 3.6vw, 2.75rem)":"clamp(2rem, 4.4vw, 3.25rem)";return e.jsxs("div",{ref:d,className:"relative surface-base pt-44 pb-28 min-h-screen overflow-x-clip",children:[e.jsx(n.div,{"aria-hidden":"true",style:{scaleX:y},className:"pointer-events-none fixed inset-x-0 top-0 z-[120] h-[3px] origin-left bg-gradient-to-r from-accent-emerald via-accent-blue to-accent-purple"}),e.jsxs("div",{className:"pointer-events-none absolute inset-0 -z-10 overflow-hidden","aria-hidden":"true",children:[e.jsx("div",{className:"float-gentle absolute -top-24 -left-24 h-72 w-72 rounded-full bg-accent-emerald/[0.08] blur-3xl"}),e.jsx("div",{className:"drift-left absolute top-1/3 -right-24 h-80 w-80 rounded-full bg-accent-purple/[0.08] blur-3xl"}),e.jsx("div",{className:"drift-right absolute bottom-0 left-1/4 h-64 w-64 rounded-full bg-primary/[0.06] blur-3xl"}),e.jsx("span",{className:"float-gentle absolute top-44 right-[12%] h-2 w-2 rounded-full bg-accent-emerald/25"}),e.jsx("span",{className:"drift-right absolute bottom-40 left-[10%] h-1.5 w-1.5 rounded-full bg-accent-blue/25",style:{animationDelay:"-3s"}})]}),e.jsxs("header",{className:`relative px-6 sm:px-8 lg:px-12 ${m} mx-auto`,children:[o&&e.jsx("span",{"aria-hidden":"true",className:"pointer-events-none absolute -top-20 left-0 select-none font-bagel text-6xl leading-none text-primary/[0.06] sm:-top-24 sm:text-7xl",children:o}),e.jsxs(n.div,{initial:{opacity:0,y:28},animate:{opacity:1,y:0},transition:{type:"spring",stiffness:140,damping:18,mass:.9},className:"relative grid gap-x-10 gap-y-6 lg:grid-cols-12",children:[e.jsxs("div",{className:"lg:col-span-9",children:[e.jsxs(n.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{type:"spring",stiffness:300,damping:14,delay:.05},className:"inline-flex items-center gap-3 text-sm font-semibold uppercase tracking-[0.24em] text-accent-emerald",children:[e.jsx("span",{"aria-hidden":"true",className:"h-px w-8 bg-accent-emerald/50"}),s]}),e.jsx("h1",{className:"mt-5 font-bagel leading-[1.15] tracking-tight text-primary",style:{fontSize:v},children:t})]}),a&&e.jsx(n.p,{initial:{opacity:0,y:18},animate:{opacity:1,y:0},transition:{duration:.6,delay:.18,ease:[.22,1,.36,1]},className:"text-lg leading-relaxed text-muted-foreground lg:col-span-7 lg:col-start-5 lg:border-l lg:border-border lg:pl-8",children:a})]})]}),e.jsx("div",{className:"mt-16 space-y-8",children:f.map((i,c)=>{const b=r.isValidElement(i)&&i.type===E,g=u[c%u.length];return e.jsx(n.section,{initial:p?void 0:g.initial,whileInView:p?void 0:g.inView,viewport:{once:!0,margin:"-90px"},transition:{type:"spring",stiffness:130,damping:18,mass:.9,delay:Math.min(c,3)*.07},className:b?"relative w-full":`relative px-6 sm:px-8 lg:px-12 ${m} mx-auto`,children:i},r.isValidElement(i)&&i.key?i.key:c)})})]})}function P(s,t){if(s.length<=t)return s;const a=s.slice(0,t),l=a.lastIndexOf(" ");return`${(l>t*.6?a.slice(0,l):a).trimEnd()}…`}export{z as P};
