{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "reviews",
  "title": "Reviews",
  "author": "AlgorizeTech",
  "description": "Ask the user to pick one of 4 reviews variants: https://avaraui.com/view/reviews. This item holds 4 of them as looks of one component (testimonial-loom, stacked-carousel, logo-carousel, up-down-marquee). Skip the question if the user already named one. A high-converting Review and Testimonial section with a 3D rotating background globe, smooth right-to-left marquee cards, and client rating badges.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [
    "https://avaraui.com/r/half-stars.json",
    "utils"
  ],
  "files": [
    {
      "path": "src/components/custom/blocks/ReviewsBlock.tsx",
      "content": "\"use client\";\n\nimport { useEffect, useRef, useState, useCallback } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { Star, ArrowLeft, ArrowRight } from \"lucide-react\";\nimport { HalfStars } from \"@/components/custom/blocks/HalfStarsBlock\";\nimport { springLinear } from \"./motion-curves\";\n\nexport type ReviewsVariant =\n\t| \"up-down-vertical-marquee\"\n\t| \"stacked-carousel\"\n\t| \"logo-carousel\"\n\t| \"testimonial-loom\";\n\nexport interface ReviewItem {\n\tid: string;\n\tname: string;\n\trole: string;\n\tavatar?: string;\n\trating: number;\n\tcontent: string;\n\tcompany?: string;\n\tlogo?: React.ReactNode;\n\thighlight?: string;\n}\n\nexport interface ReviewsProps {\n\tvariant?: ReviewsVariant;\n\ttitle?: string;\n\tsubtitle?: string;\n\treviews?: ReviewItem[];\n\tautoSlide?: boolean;\n\tautoSlideInterval?: number;\n\tmarqueeSpeed?: number;\n\tclassName?: string;\n}\n\nconst DEFAULT_REVIEWS: ReviewItem[] = [\n\t{\n\t\tid: \"1\",\n\t\tname: \"Tamar Mendelson\",\n\t\trole: \"Restaurant Critic\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150483/photo-1534528741775-53994a69daeb-1790150482280.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"I was impressed by the food! And I could really tell that they use high-quality ingredients. The staff was friendly and attentive. I'll definitely be back for more!\",\n\t},\n\t{\n\t\tid: \"2\",\n\t\tname: \"Alice Johnson\",\n\t\trole: \"Product Director\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158813/photo-1494790108377-be9c29b29330-1790158812212.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"The difference between AlgorizeTech and other agencies is their talent pool. You actually work with senior developers. Code quality and architecture are top-tier!\",\n\t},\n\t{\n\t\tid: \"3\",\n\t\tname: \"Arlene McCoy\",\n\t\trole: \"Co-Founder & CEO\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150480/photo-1507003211169-0a1dd7228f2d-1790150482276.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"Their 'Quality Obsessed' mantra is apparent in everything they do. They pushed back on bad ideas, suggested better alternatives, and boosted conversion by 40%!\",\n\t},\n\t{\n\t\tid: \"4\",\n\t\tname: \"Sofia Chen\",\n\t\trole: \"Lead Systems Architect\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150481/photo-1517841905240-472988babdf9-1790150482277.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"Integrating their UI components shaved weeks off our launch roadmap. Built-in performance optimizations and accessibility standards saved us hundreds of hours!\",\n\t},\n\t{\n\t\tid: \"5\",\n\t\tname: \"Mr. Martin\",\n\t\trole: \"Chief Operating Officer\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158814/photo-1500648767791-00dcc994a43e-1790158812212.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"The unlimited revisions gave us creative freedom without scope creep. AlgorizeTech refined every single detail until our team was 100% thrilled with results!\",\n\t},\n\t{\n\t\tid: \"6\",\n\t\tname: \"David Kim\",\n\t\trole: \"Head of Design\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158814/photo-1539571696357-5a69c17a67c6-1790158812214.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"The attention to clean typography, micro-interactions, and layout scaling surpassed all expectations. It transformed our web product into a modern design!\",\n\t},\n\t{\n\t\tid: \"7\",\n\t\tname: \"Elena Rostova\",\n\t\trole: \"VP of Engineering\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158814/photo-1573496359142-b8d87734a5a2-1790158812214.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"Their component library is bulletproof. Seamless dark mode integration, accessible keyboard navigation, and animation physics work impeccably out of the box!\",\n\t},\n\t{\n\t\tid: \"8\",\n\t\tname: \"Marcus Vance\",\n\t\trole: \"Tech Lead\",\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158814/photo-1522075469751-3a6694fb2f61-1790158812213.jpg\",\n\t\trating: 5.0,\n\t\tcontent:\n\t\t\t\"Outstanding developer experience from day one. Clean TypeScript types, well-documented component exports, and instant setup made integration effortless!\",\n\t},\n];\n\n// ==========================================\n// MOTION\n// ==========================================\n// Stacked cards glide between slots on this spring.\nconst CARD_SPRING = springLinear({ stiffness: 170, damping: 22, mass: 0.8 });\nconst EASE_OUT = \"cubic-bezier(0, 0, 0.58, 1)\";\nconst EXPO_OUT = \"cubic-bezier(0.16, 1, 0.3, 1)\";\n\n// How each swapping piece of text or image comes in (CSS) and goes out (WAAPI).\nconst SWAP_KEYFRAMES = `\n\t@keyframes reviews-rating-in { from { opacity: 0; translate: 0 8px; filter: blur(4px); } }\n\t@keyframes reviews-name-in { from { opacity: 0; translate: 0 12px; filter: blur(4px); } }\n\t@keyframes reviews-role-in { from { opacity: 0; translate: 0 10px; filter: blur(4px); } }\n\t@keyframes reviews-quote-in { from { opacity: 0; translate: 0 14px; filter: blur(6px); } }\n\t@keyframes reviews-logo-quote-in { from { opacity: 0; translate: 0 28px; } }\n\t@keyframes reviews-logo-image-in { from { opacity: 0; scale: 1.08; } }\n`;\n\ntype SwapMotion = {\n\t/** Values the element rests at once it has come in. */\n\trest: Record<string, string>;\n\t/** Values the leaving element animates to. */\n\texit: Record<string, string>;\n\t/** ms */\n\tduration: number;\n\t/** ms, applied to the way out as well as the way in */\n\tdelay?: number;\n\teasing: string;\n};\n\n/** From the element's current computed values to `to`, as WAAPI keyframes. */\nfunction fromCurrent(el: Element, to: Record<string, string>) {\n\tconst style = getComputedStyle(el);\n\tconst frames: Record<string, string[]> = {};\n\tfor (const key of Object.keys(to)) {\n\t\tframes[key] = [style.getPropertyValue(key), to[key]];\n\t}\n\treturn frames;\n}\n\n/**\n * One element swapped in \"wait\" order: when `itemKey` changes, the element on\n * screen animates out from wherever it is, and only once that ends is the\n * latest item rendered (it comes in with its own CSS animation). If the key\n * comes back mid-exit, the element settles back to rest from where it got to.\n * `ref` must be attached to the swapped element.\n */\nfunction useWaitSwap<T, E extends HTMLElement>(\n\tref: React.RefObject<E | null>,\n\titem: T,\n\titemKey: string,\n\tmotion: SwapMotion,\n) {\n\tconst [shownKey, setShownKey] = useState(itemKey);\n\tconst leaving = shownKey !== itemKey;\n\n\t// The leaving element keeps showing the item it had; otherwise it follows\n\t// the current one. Held in state (synced during render while not leaving)\n\t// so render never reads a ref.\n\tconst [lastShown, setLastShown] = useState(item);\n\tif (!leaving && lastShown !== item) setLastShown(item);\n\tconst latestKey = useRef(itemKey);\n\tconst motionRef = useRef(motion);\n\tuseEffect(() => {\n\t\tlatestKey.current = itemKey;\n\t\tmotionRef.current = motion;\n\t});\n\n\tuseEffect(() => {\n\t\tif (!leaving) return;\n\t\tconst el = ref.current;\n\t\tif (!el) {\n\t\t\tsetShownKey(latestKey.current);\n\t\t\treturn;\n\t\t}\n\t\tconst { exit, duration, delay = 0, easing } = motionRef.current;\n\t\tlet done = false;\n\t\tconst animation = el.animate(fromCurrent(el, exit), {\n\t\t\tduration,\n\t\t\tdelay,\n\t\t\teasing,\n\t\t\tfill: \"both\",\n\t\t});\n\t\tanimation.finished\n\t\t\t.then(() => {\n\t\t\t\tdone = true;\n\t\t\t\tsetShownKey(latestKey.current);\n\t\t\t})\n\t\t\t.catch(() => {});\n\t\treturn () => {\n\t\t\tif (done) return;\n\t\t\t// The key came back before the exit finished: settle back from here.\n\t\t\tconst { rest } = motionRef.current;\n\t\t\tel.animate(fromCurrent(el, rest), {\n\t\t\t\tduration,\n\t\t\t\tdelay,\n\t\t\t\teasing,\n\t\t\t\tfill: \"backwards\",\n\t\t\t});\n\t\t\tanimation.cancel();\n\t\t};\n\t}, [leaving, ref]);\n\n\treturn { shown: leaving ? lastShown : item, shownKey };\n}\n\nconst TEXT_REST = { opacity: \"1\", translate: \"0px 0px\", filter: \"blur(0px)\" };\nconst RATING_SWAP: SwapMotion = {\n\trest: TEXT_REST,\n\texit: { opacity: \"0\", translate: \"0px -8px\", filter: \"blur(4px)\" },\n\tduration: 250,\n\teasing: EASE_OUT,\n};\nconst NAME_SWAP: SwapMotion = {\n\trest: TEXT_REST,\n\texit: { opacity: \"0\", translate: \"0px -12px\", filter: \"blur(4px)\" },\n\tduration: 300,\n\teasing: EASE_OUT,\n};\nconst ROLE_SWAP: SwapMotion = {\n\trest: TEXT_REST,\n\texit: { opacity: \"0\", translate: \"0px -10px\", filter: \"blur(4px)\" },\n\tduration: 300,\n\tdelay: 50,\n\teasing: EASE_OUT,\n};\nconst QUOTE_SWAP: SwapMotion = {\n\trest: TEXT_REST,\n\texit: { opacity: \"0\", translate: \"0px -14px\", filter: \"blur(6px)\" },\n\tduration: 350,\n\tdelay: 80,\n\teasing: EASE_OUT,\n};\nconst LOGO_QUOTE_SWAP: SwapMotion = {\n\trest: { opacity: \"1\", translate: \"0px 0px\" },\n\texit: { opacity: \"0\", translate: \"0px -16px\" },\n\tduration: 400,\n\teasing: EXPO_OUT,\n};\nconst LOGO_IMAGE_SWAP: SwapMotion = {\n\trest: { opacity: \"1\", scale: \"1\" },\n\texit: { opacity: \"0\", scale: \"0.95\" },\n\tduration: 450,\n\teasing: EXPO_OUT,\n};\n\n// ==========================================\n// ULTRA-REALISTIC COBE WEBGL 3D GLOBE\n// ==========================================\n\n\n// ==========================================\n// 3D STACKED PORTRAIT CAROUSEL VARIANT\n// ==========================================\nfunction StackedCardsCarousel({\n\treviews,\n\tautoSlide = true,\n\tautoSlideInterval = 4000,\n}: {\n\treviews: ReviewItem[];\n\tautoSlide?: boolean;\n\tautoSlideInterval?: number;\n}) {\n\tconst [activeIndex, setActiveIndex] = useState(0);\n\tconst [isHovered, setIsHovered] = useState(false);\n\tconst [isSmallScreen, setIsSmallScreen] = useState(false);\n\tconst total = reviews.length;\n\n\t// Monitor viewport width to adjust card offsets for small mobile screens\n\tuseEffect(() => {\n\t\tconst checkScreen = () => {\n\t\t\tif (typeof window !== \"undefined\") {\n\t\t\t\tsetIsSmallScreen(window.innerWidth < 640);\n\t\t\t}\n\t\t};\n\t\tcheckScreen();\n\t\twindow.addEventListener(\"resize\", checkScreen);\n\t\treturn () => window.removeEventListener(\"resize\", checkScreen);\n\t}, []);\n\n\tconst handleNext = useCallback(() => {\n\t\tsetActiveIndex((prev) => (prev + 1) % total);\n\t}, [total]);\n\n\tconst handlePrev = useCallback(() => {\n\t\tsetActiveIndex((prev) => (prev - 1 + total) % total);\n\t}, [total]);\n\n\t// Auto-Slide effect\n\tuseEffect(() => {\n\t\tif (!autoSlide || isHovered || total <= 1) return;\n\t\tconst timer = setInterval(() => {\n\t\t\thandleNext();\n\t\t}, autoSlideInterval);\n\t\treturn () => clearInterval(timer);\n\t}, [autoSlide, autoSlideInterval, isHovered, total, handleNext]);\n\n\tconst activeReview = reviews[activeIndex] || reviews[0];\n\n\tconst ratingRef = useRef<HTMLDivElement>(null);\n\tconst rating = useWaitSwap<ReviewItem, HTMLDivElement>(\n\t\tratingRef,\n\t\tactiveReview,\n\t\tactiveReview.id + \"-rating\",\n\t\tRATING_SWAP,\n\t);\n\tconst nameRef = useRef<HTMLHeadingElement>(null);\n\tconst name = useWaitSwap<ReviewItem, HTMLHeadingElement>(\n\t\tnameRef,\n\t\tactiveReview,\n\t\tactiveReview.id + \"-name\",\n\t\tNAME_SWAP,\n\t);\n\tconst roleRef = useRef<HTMLParagraphElement>(null);\n\tconst role = useWaitSwap<ReviewItem, HTMLParagraphElement>(\n\t\troleRef,\n\t\tactiveReview,\n\t\tactiveReview.id + \"-role\",\n\t\tROLE_SWAP,\n\t);\n\tconst quoteRef = useRef<HTMLParagraphElement>(null);\n\tconst quote = useWaitSwap<ReviewItem, HTMLParagraphElement>(\n\t\tquoteRef,\n\t\tactiveReview,\n\t\tactiveReview.id + \"-content\",\n\t\tQUOTE_SWAP,\n\t);\n\n\t// Responsive peek offset distances based on screen width\n\tconst peekDistance = isSmallScreen ? 48 : 85;\n\tconst loopDistance = isSmallScreen ? 85 : 130;\n\n\treturn (\n\t\t<div\n\t\t\tonMouseEnter={() => setIsHovered(true)}\n\t\t\tonMouseLeave={() => setIsHovered(false)}\n\t\t\tclassName=\"w-full max-w-6xl mx-auto grid grid-cols-1 lg:grid-cols-12 gap-6 lg:gap-12 items-center py-4 sm:py-12 px-3 sm:px-6 overflow-hidden\"\n\t\t>\n\t\t\t{/* Left Column: Synchronized 3D Cyclic Ring Stage */}\n\t\t\t<div\n\t\t\t\tclassName=\"lg:col-span-6 relative w-full h-[270px] xs:h-[310px] sm:h-[400px] md:h-[440px] flex items-center justify-center select-none overflow-hidden\"\n\t\t\t\tstyle={{ perspective: \"1000px\" }}\n\t\t\t>\n\t\t\t\t{reviews.map((review, idx) => {\n\t\t\t\t\t// Relative offset in cyclic orbit ring\n\t\t\t\t\tconst offset = (idx - activeIndex + total) % total;\n\n\t\t\t\t\tlet xOffset: number;\n\t\t\t\t\tlet yOffset: number;\n\t\t\t\t\tlet rotateY = 0;\n\t\t\t\t\tlet rotateZ = 0;\n\t\t\t\t\tlet scale: number;\n\t\t\t\t\tlet zIndex: number;\n\t\t\t\t\tlet opacity: number;\n\n\t\t\t\t\tif (offset === 0) {\n\t\t\t\t\t\t// 1. Center Front Active Card\n\t\t\t\t\t\txOffset = 0;\n\t\t\t\t\t\tyOffset = 0;\n\t\t\t\t\t\trotateY = 0;\n\t\t\t\t\t\trotateZ = 0;\n\t\t\t\t\t\tscale = 1.0;\n\t\t\t\t\t\tzIndex = 30;\n\t\t\t\t\t\topacity = 1.0;\n\t\t\t\t\t} else if (offset === 1 || (total === 2 && offset === 1)) {\n\t\t\t\t\t\t// 2. Right Peek Card\n\t\t\t\t\t\txOffset = peekDistance;\n\t\t\t\t\t\tyOffset = 6;\n\t\t\t\t\t\trotateY = -14;\n\t\t\t\t\t\trotateZ = 5;\n\t\t\t\t\t\tscale = 0.86;\n\t\t\t\t\t\tzIndex = 20;\n\t\t\t\t\t\topacity = 0.85;\n\t\t\t\t\t} else if (offset === total - 1) {\n\t\t\t\t\t\t// 3. Left Peek Card\n\t\t\t\t\t\txOffset = -peekDistance;\n\t\t\t\t\t\tyOffset = 6;\n\t\t\t\t\t\trotateY = 14;\n\t\t\t\t\t\trotateZ = -5;\n\t\t\t\t\t\tscale = 0.86;\n\t\t\t\t\t\tzIndex = 20;\n\t\t\t\t\t\topacity = 0.85;\n\t\t\t\t\t} else if (offset === 2) {\n\t\t\t\t\t\t// 4. Looping Underneath Card (Right -> Bottom Loop)\n\t\t\t\t\t\txOffset = loopDistance;\n\t\t\t\t\t\tyOffset = 35;\n\t\t\t\t\t\trotateY = -22;\n\t\t\t\t\t\trotateZ = 2;\n\t\t\t\t\t\tscale = 0.7;\n\t\t\t\t\t\tzIndex = 5;\n\t\t\t\t\t\topacity = 0.35;\n\t\t\t\t\t} else if (offset === total - 2) {\n\t\t\t\t\t\t// 5. Looping Underneath Card (Left -> Bottom Loop)\n\t\t\t\t\t\txOffset = -loopDistance;\n\t\t\t\t\t\tyOffset = 35;\n\t\t\t\t\t\trotateY = 22;\n\t\t\t\t\t\trotateZ = -2;\n\t\t\t\t\t\tscale = 0.7;\n\t\t\t\t\t\tzIndex = 5;\n\t\t\t\t\t\topacity = 0.35;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Off-screen hidden slot for items > 5\n\t\t\t\t\t\txOffset = 0;\n\t\t\t\t\t\tyOffset = 50;\n\t\t\t\t\t\tscale = 0.6;\n\t\t\t\t\t\tzIndex = 0;\n\t\t\t\t\t\topacity = 0;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={review.id}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\ttransform: `translateX(${xOffset}px) translateY(${yOffset}px) scale(${scale}) rotateY(${rotateY}deg) rotateZ(${rotateZ}deg)`,\n\t\t\t\t\t\t\t\tzIndex,\n\t\t\t\t\t\t\t\topacity,\n\t\t\t\t\t\t\t\ttransition: `transform ${CARD_SPRING.duration}ms ${CARD_SPRING.easing}, opacity ${CARD_SPRING.duration}ms ${CARD_SPRING.easing}, z-index ${CARD_SPRING.duration}ms ${CARD_SPRING.easing}`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\tclassName=\"absolute w-[140px] h-[215px] xs:w-[170px] xs:h-[255px] sm:w-[230px] sm:h-[350px] md:w-[250px] md:h-[375px] rounded-[24px] sm:rounded-[28px] overflow-hidden border border-border shadow-none bg-card cursor-pointer transform-gpu\"\n\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\tif (offset === 1) handleNext();\n\t\t\t\t\t\t\t\tif (offset === total - 1) handlePrev();\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tsrc={review.avatar || \"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150483/photo-1534528741775-53994a69daeb-1790150482280.jpg\"}\n\t\t\t\t\t\t\t\talt={review.name}\n\t\t\t\t\t\t\t\tclassName=\"w-full h-full object-cover rounded-[24px] sm:rounded-[28px] pointer-events-none\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t})}\n\t\t\t</div>\n\n\t\t\t{/* Right Column: Animated Review Content & Navigation Controls */}\n\t\t\t<div className=\"lg:col-span-6 flex flex-col justify-center items-start space-y-3 sm:space-y-4 font-sans text-left px-2 sm:px-4\">\n\t\t\t\t{/* Rating Stars */}\n\t\t\t\t<div\n\t\t\t\t\tkey={rating.shownKey}\n\t\t\t\t\tref={ratingRef}\n\t\t\t\t\tclassName=\"flex items-center gap-1.5\"\n\t\t\t\t\tstyle={{ animation: `reviews-rating-in 0.25s ${EASE_OUT} backwards` }}\n\t\t\t\t>\n\t\t\t\t\t<HalfStars\n\t\t\t\t\t\trating={rating.shown.rating}\n\t\t\t\t\t\tsize={16}\n\t\t\t\t\t\tshowText={false}\n\t\t\t\t\t\tactiveColor=\"text-amber-500\"\n\t\t\t\t\t\tinactiveColor=\"text-amber-500/20\"\n\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\taria-label={`Rated ${rating.shown.rating.toFixed(1)} out of 5`}\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"text-xs font-semibold text-foreground\">\n\t\t\t\t\t\t{rating.shown.rating.toFixed(1)}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Reviewer Info */}\n\t\t\t\t<div className=\"space-y-0.5 sm:space-y-1\">\n\t\t\t\t\t<h3\n\t\t\t\t\t\tkey={name.shownKey}\n\t\t\t\t\t\tref={nameRef}\n\t\t\t\t\t\tclassName=\"text-xl xs:text-2xl sm:text-3xl md:text-4xl font-extrabold text-foreground tracking-tight\"\n\t\t\t\t\t\tstyle={{ animation: `reviews-name-in 0.3s ${EASE_OUT} backwards` }}\n\t\t\t\t\t>\n\t\t\t\t\t\t{name.shown.name}\n\t\t\t\t\t</h3>\n\n\t\t\t\t\t<p\n\t\t\t\t\t\tkey={role.shownKey}\n\t\t\t\t\t\tref={roleRef}\n\t\t\t\t\t\tclassName=\"text-xs sm:text-base font-medium text-muted-foreground\"\n\t\t\t\t\t\tstyle={{ animation: `reviews-role-in 0.3s ${EASE_OUT} 0.05s backwards` }}\n\t\t\t\t\t>\n\t\t\t\t\t\t{role.shown.role}\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Review Quote Text */}\n\t\t\t\t<p\n\t\t\t\t\tkey={quote.shownKey}\n\t\t\t\t\tref={quoteRef}\n\t\t\t\t\tclassName=\"text-sm xs:text-base sm:text-lg md:text-xl text-foreground/90 leading-relaxed font-normal pt-1 sm:pt-2 pb-2 sm:pb-4 max-w-xl min-h-[90px] sm:min-h-[120px]\"\n\t\t\t\t\tstyle={{ animation: `reviews-quote-in 0.35s ${EASE_OUT} 0.08s backwards` }}\n\t\t\t\t>\n\t\t\t\t\t\"{quote.shown.content}\"\n\t\t\t\t</p>\n\n\t\t\t\t{/* Circular Arrow Navigation Buttons */}\n\t\t\t\t<div className=\"flex items-center gap-3 pt-1 sm:pt-2\">\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handlePrev}\n\t\t\t\t\t\tclassName=\"size-10 sm:size-12 rounded-full bg-primary text-primary-foreground hover:scale-105 active:scale-95 transition-all flex items-center justify-center shadow-lg cursor-pointer\"\n\t\t\t\t\t\taria-label=\"Previous review\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ArrowLeft className=\"size-4 sm:size-5 stroke-[2.5]\" />\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleNext}\n\t\t\t\t\t\tclassName=\"size-10 sm:size-12 rounded-full bg-primary text-primary-foreground hover:scale-105 active:scale-95 transition-all flex items-center justify-center shadow-lg cursor-pointer\"\n\t\t\t\t\t\taria-label=\"Next review\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ArrowRight className=\"size-4 sm:size-5 stroke-[2.5]\" />\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// ==========================================\n// REUSABLE MODERN REVIEW CARD\n// ==========================================\nfunction ReviewCard({\n\treview,\n\tclassName,\n}: {\n\treview: ReviewItem;\n\tclassName?: string;\n}) {\n\treturn (\n\t\t<div\n\t\t\tclassName={cn(\n\t\t\t\t\"relative p-5 sm:p-6 rounded-3xl bg-card border border-border/80 text-card-foreground shadow-sm hover:border-primary/30 hover:shadow-xl hover:shadow-primary/5 hover:-translate-y-1 transition-all duration-300 group flex flex-col justify-between overflow-hidden cursor-pointer select-none\",\n\t\t\t\tclassName\n\t\t\t)}\n\t\t>\n\t\t\t{/* Top Bar: Stars Badge + Verified Tag */}\n\t\t\t<div className=\"flex items-center justify-between gap-2 mb-3\">\n\t\t\t\t<div className=\"flex items-center gap-1 bg-amber-500/10 border border-amber-500/20 px-2.5 py-1 rounded-full text-amber-500\">\n\t\t\t\t\t<HalfStars\n\t\t\t\t\t\trating={review.rating}\n\t\t\t\t\t\tsize={14}\n\t\t\t\t\t\tshowText={false}\n\t\t\t\t\t\tactiveColor=\"text-amber-500\"\n\t\t\t\t\t\tinactiveColor=\"text-amber-500/20\"\n\t\t\t\t\t\trole=\"img\"\n\t\t\t\t\t\taria-label={`Rated ${review.rating.toFixed(1)} out of 5`}\n\t\t\t\t\t/>\n\t\t\t\t\t<span className=\"text-xs font-extrabold text-amber-600 dark:text-amber-400 ml-1\">\n\t\t\t\t\t\t{review.rating.toFixed(1)}\n\t\t\t\t\t</span>\n\t\t\t\t</div>\n\t\t\t\t<span className=\"inline-flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-primary bg-primary/10 border border-primary/20 px-2.5 py-0.5 rounded-full\">\n\t\t\t\t\tVerified\n\t\t\t\t</span>\n\t\t\t</div>\n\n\t\t\t{/* Middle Section: Left Accent Line & Review Text */}\n\t\t\t<div className=\"my-2 border-l-2 border-primary/40 pl-3 py-0.5\">\n\t\t\t\t<p className=\"text-xs sm:text-sm text-foreground/90 leading-relaxed font-medium\">\n\t\t\t\t\t\"{review.content}\"\n\t\t\t\t</p>\n\t\t\t</div>\n\n\t\t\t{/* Bottom User Bar */}\n\t\t\t<div className=\"pt-3 mt-2 border-t border-border/40 flex items-center justify-between gap-3\">\n\t\t\t\t<div className=\"flex items-center gap-3 min-w-0\">\n\t\t\t\t\t<div className=\"relative shrink-0\">\n\t\t\t\t\t\t{review.avatar ? (\n\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\tsrc={review.avatar}\n\t\t\t\t\t\t\t\talt={review.name}\n\t\t\t\t\t\t\t\tclassName=\"size-10 rounded-full object-cover ring-2 ring-primary/20 group-hover:ring-primary/60 transition-all duration-300\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<div className=\"size-10 rounded-full bg-primary/10 text-primary flex items-center justify-center font-semibold text-sm ring-2 ring-primary/20 group-hover:ring-primary/60 transition-all duration-300\">\n\t\t\t\t\t\t\t\t{review.name.charAt(0)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t<span className=\"absolute -bottom-0.5 -right-0.5 size-3 bg-emerald-500 rounded-full ring-2 ring-card\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"min-w-0\">\n\t\t\t\t\t\t<h4 className=\"text-xs sm:text-sm font-semibold text-foreground group-hover:text-primary transition-colors truncate\">\n\t\t\t\t\t\t\t{review.name}\n\t\t\t\t\t\t</h4>\n\t\t\t\t\t\t<p className=\"text-[11px] text-muted-foreground truncate font-medium\">\n\t\t\t\t\t\t\t{review.role}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// ==========================================\n// 4-COLUMN VERTICAL MARQUEE VARIANT\n// ==========================================\nfunction FourColumnMarqueeReviews({\n\treviews,\n\tspeed = 100,\n}: {\n\treviews: ReviewItem[];\n\tspeed?: number;\n}) {\n\tconst col1 = [...reviews, ...reviews];\n\tconst col2 = [...reviews.slice(1), ...reviews, ...reviews.slice(0, 1)];\n\tconst col3 = [...reviews.slice(2), ...reviews, ...reviews.slice(0, 2)];\n\tconst col4 = [...reviews.slice(3), ...reviews, ...reviews.slice(0, 3)];\n\n\tconst speedStr = `${speed}s`;\n\n\tconst columns = [\n\t\t{ items: col1, dir: \"up\", speed: speedStr, visibility: \"flex\" },\n\t\t{ items: col2, dir: \"down\", speed: speedStr, visibility: \"flex\" },\n\t\t{ items: col3, dir: \"up\", speed: speedStr, visibility: \"hidden lg:flex\" },\n\t\t{ items: col4, dir: \"down\", speed: speedStr, visibility: \"hidden xl:flex\" },\n\t];\n\n\treturn (\n\t\t<div className=\"relative w-full max-w-7xl mx-auto px-2 sm:px-4\">\n\t\t\t{/* MOBILE VIEW (< sm): 4 Horizontal Left & Right Scrolling Marquee Rows */}\n\t\t\t<div className=\"block sm:hidden relative w-full overflow-hidden space-y-3 py-2\">\n\t\t\t\t{/* Left & Right Horizontal Fade Masks */}\n\t\t\t\t<div className=\"pointer-events-none absolute inset-y-0 left-0 w-12 bg-gradient-to-r from-background to-transparent z-20\" />\n\t\t\t\t<div className=\"pointer-events-none absolute inset-y-0 right-0 w-12 bg-gradient-to-l from-background to-transparent z-20\" />\n\n\t\t\t\t{/* Row 1 (Col 1): Scrolls Left */}\n\t\t\t\t<div className=\"overflow-hidden w-full\">\n\t\t\t\t\t<div className=\"flex gap-3 w-max reviews-hmarquee-left\">\n\t\t\t\t\t\t{[...col1, ...col1].map((review, idx) => (\n\t\t\t\t\t\t\t<ReviewCard key={`m1-${review.id}-${idx}`} review={review} className=\"w-[260px] shrink-0\" />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Row 2 (Col 2): Scrolls Right */}\n\t\t\t\t<div className=\"overflow-hidden w-full\">\n\t\t\t\t\t<div className=\"flex gap-3 w-max reviews-hmarquee-right\">\n\t\t\t\t\t\t{[...col2, ...col2].map((review, idx) => (\n\t\t\t\t\t\t\t<ReviewCard key={`m2-${review.id}-${idx}`} review={review} className=\"w-[260px] shrink-0\" />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Row 3 (Col 3): Scrolls Left */}\n\t\t\t\t<div className=\"overflow-hidden w-full\">\n\t\t\t\t\t<div className=\"flex gap-3 w-max reviews-hmarquee-left\">\n\t\t\t\t\t\t{[...col3, ...col3].map((review, idx) => (\n\t\t\t\t\t\t\t<ReviewCard key={`m3-${review.id}-${idx}`} review={review} className=\"w-[260px] shrink-0\" />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Row 4 (Col 4): Scrolls Right */}\n\t\t\t\t<div className=\"overflow-hidden w-full\">\n\t\t\t\t\t<div className=\"flex gap-3 w-max reviews-hmarquee-right\">\n\t\t\t\t\t\t{[...col4, ...col4].map((review, idx) => (\n\t\t\t\t\t\t\t<ReviewCard key={`m4-${review.id}-${idx}`} review={review} className=\"w-[260px] shrink-0\" />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{/* TABLET (md: 2 columns), LARGE DESKTOP (lg: 3 columns), EXTRA LARGE (xl: 4 columns) */}\n\t\t\t<div className=\"hidden sm:block relative\">\n\t\t\t\t{/* Top & Bottom Ambient Fade Masks */}\n\t\t\t\t<div className=\"pointer-events-none absolute inset-x-0 top-0 h-28 bg-gradient-to-b from-background via-background/80 to-transparent z-20\" />\n\t\t\t\t<div className=\"pointer-events-none absolute inset-x-0 bottom-0 h-28 bg-gradient-to-t from-background via-background/80 to-transparent z-20\" />\n\n\t\t\t\t{/* Responsive Grid: 2 cols on md/sm, 3 cols on lg, 4 cols on xl */}\n\t\t\t\t<div className=\"grid grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4 sm:gap-6 h-[580px] sm:h-[680px] overflow-hidden relative\">\n\t\t\t\t\t{columns.map((col, colIdx) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tkey={colIdx}\n\t\t\t\t\t\t\tclassName={cn(\"relative h-full overflow-hidden flex flex-col\", col.visibility)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\"flex flex-col gap-4 sm:gap-5 shrink-0\",\n\t\t\t\t\t\t\t\t\tcol.dir === \"up\"\n\t\t\t\t\t\t\t\t\t\t? \"reviews-vmarquee-up\"\n\t\t\t\t\t\t\t\t\t\t: \"reviews-vmarquee-down\"\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\tanimationDuration: col.speed,\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{[...col.items, ...col.items].map((review, idx) => (\n\t\t\t\t\t\t\t\t\t<ReviewCard\n\t\t\t\t\t\t\t\t\t\tkey={`${review.id}-${colIdx}-${idx}`}\n\t\t\t\t\t\t\t\t\t\treview={review}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// ==========================================\n// LOGO TAB TESTIMONIAL CAROUSEL VARIANT\n// ==========================================\nfunction LogoCarouselVariant({\n\treviews,\n\ttitle = \"Loved by teams building what's next\",\n\tsubtitle = \"Hear how founders are using our platform to save time, simplify their workflow, and grow their business.\",\n}: {\n\treviews: ReviewItem[];\n\ttitle?: string;\n\tsubtitle?: string;\n}) {\n\tconst [activeIndex, setActiveIndex] = useState(0);\n\n\tconst items = reviews.length > 0 ? reviews : DEFAULT_REVIEWS;\n\tconst activeItem = items[activeIndex] || items[0];\n\n\tconst quoteRef = useRef<HTMLDivElement>(null);\n\tconst quote = useWaitSwap<ReviewItem, HTMLDivElement>(\n\t\tquoteRef,\n\t\tactiveItem,\n\t\tString(activeItem.id || activeIndex),\n\t\tLOGO_QUOTE_SWAP,\n\t);\n\tconst portraitRef = useRef<HTMLImageElement>(null);\n\tconst portrait = useWaitSwap<ReviewItem, HTMLImageElement>(\n\t\tportraitRef,\n\t\tactiveItem,\n\t\tString(activeItem.id || activeIndex),\n\t\tLOGO_IMAGE_SWAP,\n\t);\n\n\tconst handlePrev = () => {\n\t\tsetActiveIndex((prev) => (prev - 1 + items.length) % items.length);\n\t};\n\n\tconst handleNext = () => {\n\t\tsetActiveIndex((prev) => (prev + 1) % items.length);\n\t};\n\n\tconst handleSelect = (idx: number) => {\n\t\tsetActiveIndex(idx);\n\t};\n\n\treturn (\n\t\t<div className=\"w-full max-w-5xl mx-auto py-8 px-4 flex flex-col items-center\">\n\t\t\t{/* Top Header Badge & Titles */}\n\t\t\t{(title || subtitle) && (\n\t\t\t\t<div className=\"relative z-20 w-full mx-auto text-center space-y-3 mb-8 sm:mb-10 flex flex-col items-center\">\n\t\t\t\t\t<div className=\"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-semibold uppercase tracking-wider\">\n\t\t\t\t\t\t<Star className=\"size-3.5 fill-primary text-primary\" /> Client Testimonials\n\t\t\t\t\t</div>\n\t\t\t\t\t{title && (\n\t\t\t\t\t\t<h2 className=\"text-2xl sm:text-4xl font-extrabold tracking-tight text-foreground leading-tight\">\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t)}\n\t\t\t\t\t{subtitle && (\n\t\t\t\t\t\t<p className=\"text-xs sm:text-base text-muted-foreground w-[90%] max-w-5xl mx-auto leading-relaxed\">\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* Company Logos Row (Independent Infinite Marquee) */}\n\t\t\t<div className=\"w-full overflow-hidden relative py-4 mb-6 group\">\n\t\t\t\t<div className=\"pointer-events-none absolute left-0 top-0 bottom-0 w-12 bg-gradient-to-r from-background to-transparent z-10\" />\n\t\t\t\t<div className=\"pointer-events-none absolute right-0 top-0 bottom-0 w-12 bg-gradient-to-l from-background to-transparent z-10\" />\n\n\t\t\t\t<div className=\"flex w-max gap-8 sm:gap-14 reviews-hmarquee-left group-hover:[animation-play-state:paused]\">\n\t\t\t\t\t{[...items, ...items, ...items, ...items].map((item, idx) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tkey={`${item.id || idx}-${idx}`}\n\t\t\t\t\t\t\t\tclassName=\"flex items-center gap-2.5 px-4 py-2 rounded-xl select-none shrink-0 opacity-60 hover:opacity-100 transition-opacity duration-300 text-muted-foreground hover:text-foreground\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{item.logo ? (\n\t\t\t\t\t\t\t\t\t<div className=\"size-6 shrink-0 flex items-center justify-center\">\n\t\t\t\t\t\t\t\t\t\t{item.logo}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t\t<div className=\"size-6 rounded-full bg-primary/20 text-primary flex items-center justify-center text-xs font-semibold\">\n\t\t\t\t\t\t\t\t\t\t{item.company ? item.company.charAt(0) : item.name.charAt(0)}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t<span className=\"text-sm sm:text-base tracking-tight font-semibold\">\n\t\t\t\t\t\t\t\t\t{item.company || item.name}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{/* Pagination Indicator Dots */}\n\t\t\t<div className=\"flex items-center justify-center gap-2 mb-8\">\n\t\t\t\t{items.map((_, idx) => (\n\t\t\t\t\t<button\n\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={() => handleSelect(idx)}\n\t\t\t\t\t\taria-label={`Go to slide ${idx + 1}`}\n\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\"h-2 rounded-full transition-all duration-300 cursor-pointer\",\n\t\t\t\t\t\t\tidx === activeIndex\n\t\t\t\t\t\t\t\t? \"w-8 bg-primary shadow-sm\"\n\t\t\t\t\t\t\t\t: \"w-2 bg-muted-foreground/30 hover:bg-muted-foreground/50\"\n\t\t\t\t\t\t)}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</div>\n\n\t\t\t{/* Split Testimonial Card (White Background, Zero Shadow) */}\n\t\t\t<div className=\"w-full max-w-4xl rounded-2xl border border-border/80 bg-background dark:bg-card text-foreground shadow-none overflow-hidden grid grid-cols-1 md:grid-cols-12 transition-all duration-300\">\n\t\t\t\t{/* Quote & Author Info (Left Column) */}\n\t\t\t\t<div className=\"md:col-span-7 p-8 sm:p-12 flex flex-col justify-between space-y-6 overflow-hidden\">\n\t\t\t\t\t<div\n\t\t\t\t\t\tkey={quote.shownKey}\n\t\t\t\t\t\tref={quoteRef}\n\t\t\t\t\t\tclassName=\"space-y-6\"\n\t\t\t\t\t\tstyle={{ animation: `reviews-logo-quote-in 0.4s ${EXPO_OUT} backwards` }}\n\t\t\t\t\t>\n\t\t\t\t\t\t\t<p className=\"text-lg sm:text-2xl font-medium text-foreground leading-relaxed tracking-tight\">\n\t\t\t\t\t\t\t\t{(() => {\n\t\t\t\t\t\t\t\t\tconst quoteText = quote.shown.content.startsWith('\"')\n\t\t\t\t\t\t\t\t\t\t? quote.shown.content\n\t\t\t\t\t\t\t\t\t\t: `\"${quote.shown.content}\"`;\n\t\t\t\t\t\t\t\t\tconst words = quoteText.split(\" \");\n\t\t\t\t\t\t\t\t\tlet globalCharIdx = 0;\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<span className=\"inline\">\n\t\t\t\t\t\t\t\t\t\t\t{words.map((word, wordIdx) => {\n\t\t\t\t\t\t\t\t\t\t\t\tconst chars = word.split(\"\");\n\t\t\t\t\t\t\t\t\t\t\t\tconst wordNode = (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<span key={wordIdx} className=\"inline-block whitespace-nowrap mr-[0.25em]\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{chars.map((char) => {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconst idx = globalCharIdx++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={idx}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"inline-block text-muted-foreground/30 animate-[typo-color-reveal_0.6s_cubic-bezier(0.16,1,0.3,1)_both]\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tanimationDelay: `${idx * 14}ms`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{char}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t\tglobalCharIdx++;\n\t\t\t\t\t\t\t\t\t\t\t\treturn wordNode;\n\t\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t})()}\n\t\t\t\t\t\t\t</p>\n\n\t\t\t\t\t\t\t<div className=\"pt-4 border-t border-border/40\">\n\t\t\t\t\t\t\t\t<h3 className=\"text-lg sm:text-xl font-semibold font-serif text-foreground\">\n\t\t\t\t\t\t\t\t\t{quote.shown.name}\n\t\t\t\t\t\t\t\t</h3>\n\t\t\t\t\t\t\t\t<p className=\"text-xs sm:text-sm text-muted-foreground mt-0.5\">\n\t\t\t\t\t\t\t\t\t{quote.shown.role}\n\t\t\t\t\t\t\t\t\t{quote.shown.company ? `, ${quote.shown.company}` : \"\"}\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{/* Author Portrait Image (Right Column with 4px Padding) */}\n\t\t\t\t<div className=\"md:col-span-5 relative min-h-[280px] sm:min-h-[360px] p-1 sm:p-1.5\">\n\t\t\t\t\t<div className=\"relative w-full h-full rounded-xl sm:rounded-2xl overflow-hidden bg-muted/20\">\n\t\t\t\t\t\t<img\n\t\t\t\t\t\t\tkey={portrait.shownKey}\n\t\t\t\t\t\t\tref={portraitRef}\n\t\t\t\t\t\t\tsrc={\n\t\t\t\t\t\t\t\tportrait.shown.avatar ||\n\t\t\t\t\t\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150483/photo-1534528741775-53994a69daeb-1790150482280.jpg\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\talt={portrait.shown.name}\n\t\t\t\t\t\t\tstyle={{ animation: `reviews-logo-image-in 0.45s ${EXPO_OUT} backwards` }}\n\t\t\t\t\t\t\tclassName=\"absolute inset-0 w-full h-full object-cover object-center rounded-xl sm:rounded-2xl\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{/* Arrow Navigation Buttons */}\n\t\t\t<div className=\"flex items-center justify-center gap-3 mt-8\">\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={handlePrev}\n\t\t\t\t\tclassName=\"size-11 rounded-xl border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 active:scale-95 transition-all flex items-center justify-center shadow-none cursor-pointer\"\n\t\t\t\t\taria-label=\"Previous review\"\n\t\t\t\t>\n\t\t\t\t\t<ArrowLeft className=\"size-4 stroke-[2.5]\" />\n\t\t\t\t</button>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={handleNext}\n\t\t\t\t\tclassName=\"size-11 rounded-xl bg-primary text-primary-foreground hover:opacity-90 active:scale-95 transition-all flex items-center justify-center shadow-none cursor-pointer\"\n\t\t\t\t\taria-label=\"Next review\"\n\t\t\t\t>\n\t\t\t\t\t<ArrowRight className=\"size-4 stroke-[2.5]\" />\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\n// ==========================================\n// TESTIMONIAL LOOM PRO (ENVELOPE) VARIANT\n// ==========================================\n\ninterface LoomEnvelopePreset {\n\tid: string;\n\touterColor: string;\n\tsideFlapColor: string;\n\tinnerColor: string;\n\tflapInnerColor: string;\n\tcreaseColor: string;\n\tstampColor: string;\n\taccentColor: string;\n\thubCode: string;\n\tdispatchCode: string;\n\tmetricBadge: string;\n\tdate: string;\n\tname: string;\n\trole: string;\n\tcompany: string;\n\trating: number;\n\tavatar: string;\n\tcontent: string;\n}\n\nconst LOOM_ENVELOPE_PRESETS: LoomEnvelopePreset[] = [\n\t{\n\t\tid: \"loom-1\",\n\t\touterColor: \"color-mix(in oklab, var(--primary) 18%, var(--secondary))\",\n\t\tsideFlapColor: \"color-mix(in oklab, var(--primary) 24%, var(--secondary))\",\n\t\tinnerColor: \"color-mix(in oklab, var(--primary) 38%, var(--muted))\",\n\t\tflapInnerColor: \"color-mix(in oklab, var(--primary) 34%, var(--muted))\",\n\t\tcreaseColor: \"color-mix(in oklab, var(--primary) 36%, var(--border))\",\n\t\tstampColor: \"color-mix(in oklab, var(--primary) 62%, var(--foreground))\",\n\t\taccentColor: \"var(--primary)\",\n\t\thubCode: \"ZURICH · CH\",\n\t\tdispatchCode: \"ARC-101\",\n\t\tmetricBadge: \"+142% Conversion\",\n\t\tdate: \"14 Mar 2026\",\n\t\tname: \"Sienna Laurent\",\n\t\trole: \"VP of Product\",\n\t\tcompany: \"Veloce Labs\",\n\t\trating: 5,\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150483/photo-1534528741775-53994a69daeb-1790150482280.jpg\",\n\t\tcontent:\n\t\t\t\"Rebuilding our checkout architecture with their modular system lifted completed checkouts by 142% in the very first quarter.\",\n\t},\n\t{\n\t\tid: \"loom-2\",\n\t\touterColor: \"color-mix(in oklab, var(--primary) 24%, var(--secondary))\",\n\t\tsideFlapColor: \"color-mix(in oklab, var(--primary) 30%, var(--secondary))\",\n\t\tinnerColor: \"color-mix(in oklab, var(--primary) 44%, var(--muted))\",\n\t\tflapInnerColor: \"color-mix(in oklab, var(--primary) 40%, var(--muted))\",\n\t\tcreaseColor: \"color-mix(in oklab, var(--primary) 42%, var(--border))\",\n\t\tstampColor: \"color-mix(in oklab, var(--primary) 68%, var(--foreground))\",\n\t\taccentColor: \"var(--primary)\",\n\t\thubCode: \"STOCKHOLM · SE\",\n\t\tdispatchCode: \"ARC-204\",\n\t\tmetricBadge: \"3.4x Faster Ship\",\n\t\tdate: \"28 Apr 2026\",\n\t\tname: \"Henrik Lindqvist\",\n\t\trole: \"Principal Designer\",\n\t\tcompany: \"NordicGrid\",\n\t\trating: 5,\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150480/photo-1507003211169-0a1dd7228f2d-1790150482276.jpg\",\n\t\tcontent:\n\t\t\t\"What used to take three sprints now ships in four days. The component primitives bridged design and engineering effortlessly.\",\n\t},\n\t{\n\t\tid: \"loom-3\",\n\t\touterColor: \"color-mix(in oklab, var(--primary) 15%, var(--secondary))\",\n\t\tsideFlapColor: \"color-mix(in oklab, var(--primary) 21%, var(--secondary))\",\n\t\tinnerColor: \"color-mix(in oklab, var(--primary) 35%, var(--muted))\",\n\t\tflapInnerColor: \"color-mix(in oklab, var(--primary) 31%, var(--muted))\",\n\t\tcreaseColor: \"color-mix(in oklab, var(--primary) 34%, var(--border))\",\n\t\tstampColor: \"color-mix(in oklab, var(--primary) 60%, var(--foreground))\",\n\t\taccentColor: \"var(--primary)\",\n\t\thubCode: \"LONDON · UK\",\n\t\tdispatchCode: \"ARC-309\",\n\t\tmetricBadge: \"99.98% Uptime\",\n\t\tdate: \"19 May 2026\",\n\t\tname: \"Camille Moreau\",\n\t\trole: \"Head of Growth\",\n\t\tcompany: \"AetherPay\",\n\t\trating: 5,\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158813/photo-1494790108377-be9c29b29330-1790158812212.jpg\",\n\t\tcontent:\n\t\t\t\"Our enterprise onboarding flow now feels like a tactile luxury product. Enterprise trial-to-paid conversions doubled in six weeks.\",\n\t},\n\t{\n\t\tid: \"loom-4\",\n\t\touterColor: \"color-mix(in oklab, var(--primary) 21%, var(--secondary))\",\n\t\tsideFlapColor: \"color-mix(in oklab, var(--primary) 27%, var(--secondary))\",\n\t\tinnerColor: \"color-mix(in oklab, var(--primary) 42%, var(--muted))\",\n\t\tflapInnerColor: \"color-mix(in oklab, var(--primary) 38%, var(--muted))\",\n\t\tcreaseColor: \"color-mix(in oklab, var(--primary) 40%, var(--border))\",\n\t\tstampColor: \"color-mix(in oklab, var(--primary) 65%, var(--foreground))\",\n\t\taccentColor: \"var(--primary)\",\n\t\thubCode: \"SAN FRANCISCO · US\",\n\t\tdispatchCode: \"ARC-412\",\n\t\tmetricBadge: \"-58% Latency\",\n\t\tdate: \"04 Jun 2026\",\n\t\tname: \"Devon K. Mercer\",\n\t\trole: \"VP of Engineering\",\n\t\tcompany: \"Kinetix Cloud\",\n\t\trating: 5,\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158814/photo-1539571696357-5a69c17a67c6-1790158812214.jpg\",\n\t\tcontent:\n\t\t\t\"Zero layout shift, silky 60fps transitions, and clean TypeScript interfaces out of the box. Our entire frontend squad swears by it.\",\n\t},\n\t{\n\t\tid: \"loom-5\",\n\t\touterColor: \"color-mix(in oklab, var(--primary) 27%, var(--secondary))\",\n\t\tsideFlapColor: \"color-mix(in oklab, var(--primary) 33%, var(--secondary))\",\n\t\tinnerColor: \"color-mix(in oklab, var(--primary) 46%, var(--muted))\",\n\t\tflapInnerColor: \"color-mix(in oklab, var(--primary) 42%, var(--muted))\",\n\t\tcreaseColor: \"color-mix(in oklab, var(--primary) 44%, var(--border))\",\n\t\tstampColor: \"color-mix(in oklab, var(--primary) 70%, var(--foreground))\",\n\t\taccentColor: \"var(--primary)\",\n\t\thubCode: \"TOKYO · JP\",\n\t\tdispatchCode: \"ARC-518\",\n\t\tmetricBadge: \"4.9★ CSAT Score\",\n\t\tdate: \"21 Jul 2026\",\n\t\tname: \"Mei-Ling Sato\",\n\t\trole: \"Co-Founder & CEO\",\n\t\tcompany: \"Sora Studio\",\n\t\trating: 5,\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790150481/photo-1517841905240-472988babdf9-1790150482277.jpg\",\n\t\tcontent:\n\t\t\t\"Partnering with them felt like embedding a world-class design engineering team directly into our core product organization.\",\n\t},\n\t{\n\t\tid: \"loom-6\",\n\t\touterColor: \"color-mix(in oklab, var(--primary) 19%, var(--secondary))\",\n\t\tsideFlapColor: \"color-mix(in oklab, var(--primary) 25%, var(--secondary))\",\n\t\tinnerColor: \"color-mix(in oklab, var(--primary) 39%, var(--muted))\",\n\t\tflapInnerColor: \"color-mix(in oklab, var(--primary) 35%, var(--muted))\",\n\t\tcreaseColor: \"color-mix(in oklab, var(--primary) 38%, var(--border))\",\n\t\tstampColor: \"color-mix(in oklab, var(--primary) 64%, var(--foreground))\",\n\t\taccentColor: \"var(--primary)\",\n\t\thubCode: \"BERLIN · DE\",\n\t\tdispatchCode: \"ARC-625\",\n\t\tmetricBadge: \"10x Team Velocity\",\n\t\tdate: \"09 Aug 2026\",\n\t\tname: \"Lukas Richter\",\n\t\trole: \"Chief Technology Officer\",\n\t\tcompany: \"Hyperion AI\",\n\t\trating: 5,\n\t\tavatar:\n\t\t\t\"https://res.cloudinary.com/dodndg7ai/image/upload/f_webp,q_auto,w_800,c_limit/v1790158814/photo-1500648767791-00dcc994a43e-1790158812212.jpg\",\n\t\tcontent:\n\t\t\t\"Lighthouse performance jumped from 64 to 99 across every route while adding rich interactive motion that customers love.\",\n\t},\n];\n\ntype LoomStage =\n\t| \"closed\"\n\t| \"opening\"\n\t| \"extracting\"\n\t| \"tucking\"\n\t| \"closing\";\n\ntype LoomSlidePhase =\n\t| \"center\"\n\t| \"out-left\"\n\t| \"out-right\"\n\t| \"enter-from-right\"\n\t| \"enter-from-left\";\n\nfunction TestimonialLoomVariant({\n\treviews,\n\tautoSlide = true,\n\tanimationSpeed = 100,\n}: {\n\treviews: ReviewItem[];\n\tautoSlide?: boolean;\n\tanimationSpeed?: number;\n}) {\n\tconst items: LoomEnvelopePreset[] = LOOM_ENVELOPE_PRESETS.map((preset, idx) => {\n\t\tconst custom = reviews[idx];\n\t\tconst isDefaultSample =\n\t\t\t!custom ||\n\t\t\tcustom.name === \"Tamar Mendelson\" ||\n\t\t\tcustom.name === \"Alice Johnson\" ||\n\t\t\tcustom.name === \"Arlene McCoy\" ||\n\t\t\tcustom.name === \"Sofia Chen\" ||\n\t\t\tcustom.name === \"Mr. Martin\" ||\n\t\t\tcustom.name === \"David Kim\";\n\t\tif (isDefaultSample) return preset;\n\t\treturn {\n\t\t\t...preset,\n\t\t\tname: custom.name || preset.name,\n\t\t\trole: custom.role || preset.role,\n\t\t\tcompany: custom.company || preset.company,\n\t\t\tavatar: custom.avatar || preset.avatar,\n\t\t\tcontent: custom.content || preset.content,\n\t\t\trating: custom.rating ?? preset.rating,\n\t\t};\n\t});\n\n\tconst [activeIndex, setActiveIndex] = useState<number>(3);\n\tconst [stage, setStage] = useState<LoomStage>(\"closed\");\n\tconst [flapBehind, setFlapBehind] = useState<boolean>(false);\n\tconst [slidePhase, setSlidePhase] = useState<LoomSlidePhase>(\"center\");\n\tconst [isTransitioning, setIsTransitioning] = useState<boolean>(false);\n\tconst [isPaused, setIsPaused] = useState<boolean>(false);\n\tconst [cycleKey, setCycleKey] = useState<number>(0);\n\n\tconst transitionTimersRef = useRef<number[]>([]);\n\tconst stageRef = useRef<LoomStage>(stage);\n\tstageRef.current = stage;\n\n\tconst clearTransitionTimers = useCallback(() => {\n\t\tfor (const id of transitionTimersRef.current) {\n\t\t\twindow.clearTimeout(id);\n\t\t}\n\t\ttransitionTimersRef.current = [];\n\t}, []);\n\n\tuseEffect(() => {\n\t\treturn () => clearTransitionTimers();\n\t}, [clearTransitionTimers]);\n\n\tconst count = items.length;\n\tconst activeItem = items[activeIndex] ?? items[0];\n\n\t// Connect top range slider (`marqueeSpeed`: 40..200, default 100) directly to\n\t// all envelope opening, card arc extraction/insertion, closing, sliding, and auto-play durations.\n\tconst normalizedSpeed =\n\t\tanimationSpeed <= 35 ? 100 : Math.max(40, Math.min(200, animationSpeed));\n\tconst speedScale = normalizedSpeed / 100;\n\n\tconst tOpenDelay = Math.round(220 * speedScale);\n\tconst flapDuration = Math.round(640 * speedScale);\n\tconst tFlapMidpoint = tOpenDelay + Math.round(flapDuration * 0.5);\n\tconst tExtractDelay = tOpenDelay + Math.round(flapDuration * 0.75);\n\tconst cardExtractDuration = Math.round(1050 * speedScale);\n\n\tconst cardInsertDuration = Math.round(920 * speedScale);\n\tconst flapCloseDuration = Math.round(580 * speedScale);\n\tconst slideDuration = Math.round(440 * speedScale);\n\tconst totalCycleDuration = Math.round(6200 * speedScale);\n\n\t// Standard opening & card arc-extraction sequence whenever an envelope sits at center\n\tuseEffect(() => {\n\t\tif (isTransitioning) return;\n\n\t\tsetStage(\"closed\");\n\t\tsetFlapBehind(false);\n\n\t\tconst tOpen = window.setTimeout(() => {\n\t\t\tsetStage(\"opening\");\n\t\t}, tOpenDelay);\n\n\t\tconst tFlapZ = window.setTimeout(() => {\n\t\t\tsetFlapBehind(true);\n\t\t}, tFlapMidpoint);\n\n\t\tconst tExtract = window.setTimeout(() => {\n\t\t\tsetStage(\"extracting\");\n\t\t}, tExtractDelay);\n\n\t\treturn () => {\n\t\t\twindow.clearTimeout(tOpen);\n\t\t\twindow.clearTimeout(tFlapZ);\n\t\t\twindow.clearTimeout(tExtract);\n\t\t};\n\t}, [\n\t\tactiveIndex,\n\t\tcycleKey,\n\t\tisTransitioning,\n\t\ttOpenDelay,\n\t\ttFlapMidpoint,\n\t\ttExtractDelay,\n\t]);\n\n\t// Full card lift-and-insert -> flap close -> envelope slide out -> new envelope slide in -> open sequence\n\tconst navigateTo = useCallback(\n\t\t(targetIndex: number, direction: \"next\" | \"prev\") => {\n\t\t\tclearTransitionTimers();\n\t\t\tsetIsTransitioning(true);\n\n\t\t\tconst currentStage = stageRef.current;\n\t\t\tlet elapsed = 0;\n\n\t\t\t// 1. Lift card up over the front pocket lip and slide it down inside the envelope\n\t\t\tif (currentStage === \"extracting\") {\n\t\t\t\tsetStage(\"tucking\");\n\t\t\t\telapsed += Math.round(cardInsertDuration * 0.88);\n\t\t\t}\n\n\t\t\t// 2. Fold & seal the top triangular flap over the pocket\n\t\t\tif (currentStage !== \"closed\") {\n\t\t\t\tconst tCloseFlap = window.setTimeout(() => {\n\t\t\t\t\tsetStage(\"closing\");\n\t\t\t\t}, elapsed);\n\t\t\t\tconst tFlapFront = window.setTimeout(() => {\n\t\t\t\t\tsetFlapBehind(false);\n\t\t\t\t}, elapsed + Math.round(flapCloseDuration * 0.5));\n\t\t\t\ttransitionTimersRef.current.push(tCloseFlap, tFlapFront);\n\t\t\t\telapsed += flapCloseDuration + Math.round(60 * speedScale);\n\t\t\t} else {\n\t\t\t\tsetStage(\"closed\");\n\t\t\t\tsetFlapBehind(false);\n\t\t\t}\n\n\t\t\t// 3. Slide the sealed envelope out (left for \"next\", right for \"prev\")\n\t\t\tconst tSlideOut = window.setTimeout(() => {\n\t\t\t\tsetStage(\"closed\");\n\t\t\t\tsetFlapBehind(false);\n\t\t\t\tsetSlidePhase(direction === \"next\" ? \"out-left\" : \"out-right\");\n\t\t\t}, elapsed);\n\t\t\ttransitionTimersRef.current.push(tSlideOut);\n\t\t\telapsed += slideDuration;\n\n\t\t\t// 4. Position the new sealed envelope on the opposite side (right for \"next\", left for \"prev\")\n\t\t\tconst tPositionIncoming = window.setTimeout(() => {\n\t\t\t\tsetActiveIndex(targetIndex);\n\t\t\t\tsetStage(\"closed\");\n\t\t\t\tsetFlapBehind(false);\n\t\t\t\tsetSlidePhase(\n\t\t\t\t\tdirection === \"next\" ? \"enter-from-right\" : \"enter-from-left\",\n\t\t\t\t);\n\t\t\t}, elapsed);\n\t\t\ttransitionTimersRef.current.push(tPositionIncoming);\n\t\t\telapsed += 32;\n\n\t\t\t// 5. Slide the new sealed envelope smoothly into the center\n\t\t\tconst tSlideIn = window.setTimeout(() => {\n\t\t\t\tsetSlidePhase(\"center\");\n\t\t\t}, elapsed);\n\t\t\ttransitionTimersRef.current.push(tSlideIn);\n\t\t\telapsed += slideDuration;\n\n\t\t\t// 6. Once seated at center, trigger the opening & card extraction sequence\n\t\t\tconst tFinish = window.setTimeout(() => {\n\t\t\t\tsetIsTransitioning(false);\n\t\t\t\tsetCycleKey((k) => k + 1);\n\t\t\t}, elapsed);\n\t\t\ttransitionTimersRef.current.push(tFinish);\n\t\t},\n\t\t[\n\t\t\tclearTransitionTimers,\n\t\t\tcardInsertDuration,\n\t\t\tflapCloseDuration,\n\t\t\tslideDuration,\n\t\t\tspeedScale,\n\t\t],\n\t);\n\n\tuseEffect(() => {\n\t\tif (!autoSlide || isPaused || isTransitioning) return;\n\t\tconst timer = window.setTimeout(() => {\n\t\t\tnavigateTo((activeIndex + 1) % count, \"next\");\n\t\t}, totalCycleDuration);\n\t\treturn () => window.clearTimeout(timer);\n\t}, [\n\t\tactiveIndex,\n\t\tautoSlide,\n\t\tcount,\n\t\tisPaused,\n\t\tisTransitioning,\n\t\tcycleKey,\n\t\ttotalCycleDuration,\n\t\tnavigateTo,\n\t]);\n\n\tconst handleSelect = useCallback(\n\t\t(index: number) => {\n\t\t\tif (index === activeIndex) {\n\t\t\t\tif (!isTransitioning) setCycleKey((k) => k + 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconst direction = index > activeIndex ? \"next\" : \"prev\";\n\t\t\tnavigateTo(index, direction);\n\t\t},\n\t\t[activeIndex, isTransitioning, navigateTo],\n\t);\n\n\tconst handlePrev = useCallback(() => {\n\t\tnavigateTo((activeIndex - 1 + count) % count, \"prev\");\n\t}, [activeIndex, count, navigateTo]);\n\n\tconst handleNext = useCallback(() => {\n\t\tnavigateTo((activeIndex + 1) % count, \"next\");\n\t}, [activeIndex, count, navigateTo]);\n\n\tconst serialNumber = `0${activeIndex + 1} / 0${count}`;\n\n\tconst isExtracting = stage === \"extracting\";\n\tconst isTucking = stage === \"tucking\";\n\tconst isFlapOpen =\n\t\tstage === \"opening\" ||\n\t\tstage === \"extracting\" ||\n\t\tstage === \"tucking\";\n\n\tconst activeFlapDuration =\n\t\tstage === \"closing\" ? flapCloseDuration : flapDuration;\n\n\t// Horizontal slide transform for the entire envelope stage:\n\tconst envelopeSlideTransform =\n\t\tslidePhase === \"out-left\" || slidePhase === \"enter-from-left\"\n\t\t\t? \"translate3d(-115%, 0px, 0px) rotate(-3.5deg) scale(0.94)\"\n\t\t\t: slidePhase === \"out-right\" || slidePhase === \"enter-from-right\"\n\t\t\t\t? \"translate3d(115%, 0px, 0px) rotate(3.5deg) scale(0.94)\"\n\t\t\t\t: \"translate3d(0px, 0px, 0px) rotate(0deg) scale(1)\";\n\n\tconst envelopeSlideOpacity = slidePhase === \"center\" ? 1 : 0;\n\tconst isInstantJump =\n\t\tslidePhase === \"enter-from-right\" || slidePhase === \"enter-from-left\";\n\n\t// Card keyframe animation:\n\t// - \"extracting\": rises out from inside pocket (z-index 15 -> y: -200px), then crosses over front lip (z-index 30) and settles on front face (y: -30px, rotate: -1.5deg)\n\t// - \"tucking\": lifts up from front face (z-index 30 -> y: -200px), crosses behind pocket lip (z-index 15), and slides down inside pocket (y: +12px, scale: 0.9)\n\tconst cardAnimation = isExtracting\n\t\t? `loom-card-extract ${cardExtractDuration}ms cubic-bezier(0.25, 1, 0.4, 1) forwards`\n\t\t: isTucking\n\t\t\t? `loom-card-insert ${cardInsertDuration}ms cubic-bezier(0.32, 0, 0.2, 1) forwards`\n\t\t\t: \"none\";\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"loom-stage-root relative w-full min-h-[590px] xs:min-h-[650px] sm:min-h-[840px] bg-background text-foreground flex flex-col items-center justify-end pt-44 xs:pt-52 sm:pt-76 pb-8 sm:pb-14 px-2.5 xs:px-4 select-none overflow-hidden transition-colors duration-300\"\n\t\t\tonMouseEnter={() => setIsPaused(true)}\n\t\t\tonMouseLeave={() => setIsPaused(false)}\n\t\t>\n\t\t\t{/* Main Envelope Stage */}\n\t\t\t<div\n\t\t\t\tonClick={() => {\n\t\t\t\t\tif (!isTransitioning) setCycleKey((k) => k + 1);\n\t\t\t\t}}\n\t\t\t\ttitle=\"Click to replay envelope animation\"\n\t\t\t\tclassName=\"relative w-full max-w-[340px] xs:max-w-[400px] sm:max-w-[540px] h-[230px] xs:h-[260px] sm:h-[336px] cursor-pointer\"\n\t\t\t\tstyle={{\n\t\t\t\t\tperspective: \"1500px\",\n\t\t\t\t\tperspectiveOrigin: \"50% 0%\",\n\t\t\t\t\ttransform: envelopeSlideTransform,\n\t\t\t\t\topacity: envelopeSlideOpacity,\n\t\t\t\t\ttransition: isInstantJump\n\t\t\t\t\t\t? \"none\"\n\t\t\t\t\t\t: `transform ${slideDuration}ms cubic-bezier(0.22, 1, 0.36, 1), opacity ${Math.round(slideDuration * 0.75)}ms ease`,\n\t\t\t\t\twillChange: \"transform, opacity\",\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{/* 1. Envelope Back Interior Lining (Behind Card) */}\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"absolute inset-0 overflow-hidden transition-colors duration-500\",\n\t\t\t\t\t\tflapBehind ? \"rounded-b-[10px] rounded-t-none\" : \"rounded-[10px]\",\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\tbackgroundColor: activeItem.innerColor,\n\t\t\t\t\t\tzIndex: 1,\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t{/* 2. Top Triangular Flap (3D Hinged Flush at Top Edge) */}\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"absolute top-0 left-0 right-0 h-[52%] pointer-events-none\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\ttransformOrigin: \"top center\",\n\t\t\t\t\t\ttransform: isFlapOpen ? \"rotateX(180deg)\" : \"rotateX(0deg)\",\n\t\t\t\t\t\ttransition: `transform ${activeFlapDuration}ms cubic-bezier(0.42, 0, 0.58, 1)`,\n\t\t\t\t\t\tzIndex: flapBehind ? 5 : 35,\n\t\t\t\t\t\twillChange: \"transform\",\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\tviewBox=\"0 0 540 175\"\n\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\tclassName=\"absolute inset-0 w-full h-full overflow-visible\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td={\n\t\t\t\t\t\t\t\tflapBehind\n\t\t\t\t\t\t\t\t\t? \"M 0,-2 L 540,-2 L 540,0 L 278,168 Q 270,174 262,168 L 0,0 Z\"\n\t\t\t\t\t\t\t\t\t: \"M 0,6 Q 0,0 6,0 L 534,0 Q 540,0 540,6 L 278,168 Q 270,174 262,168 Z\"\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfill={\n\t\t\t\t\t\t\t\tflapBehind\n\t\t\t\t\t\t\t\t\t? activeItem.innerColor\n\t\t\t\t\t\t\t\t\t: activeItem.outerColor\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstroke={flapBehind ? \"none\" : activeItem.creaseColor}\n\t\t\t\t\t\t\tstrokeWidth=\"1.2\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\n\t\t\t\t{/* 3. Editorial Letterhead Testimonial Card (Pulls Up Out of Deep Pocket -> Settles in Front of Envelope) */}\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"loom-card-slot absolute inset-x-0 bottom-[12px] sm:bottom-[16px] flex justify-center pointer-events-none\"\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\ttransformOrigin: \"bottom center\",\n\t\t\t\t\t\tzIndex: 15,\n\t\t\t\t\t\tanimation: cardAnimation,\n\t\t\t\t\t\twillChange: \"transform\",\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"w-[90%] sm:w-[87%] rounded-[8px] sm:rounded-[10px] bg-card text-card-foreground border border-border/80 pointer-events-auto relative overflow-hidden transition-colors duration-300\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tboxShadow: isExtracting\n\t\t\t\t\t\t\t\t? \"0 24px 44px -14px rgba(0, 0, 0, 0.24), 0 6px 16px -4px rgba(0, 0, 0, 0.08)\"\n\t\t\t\t\t\t\t\t: \"0 4px 10px -4px rgba(0, 0, 0, 0.08)\",\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* Top Accent Stationery Bar */}\n\t\t\t\t\t\t<div className=\"h-[3px] sm:h-[3.5px] w-full bg-primary transition-colors duration-300\" />\n\n\t\t\t\t\t\t<div className=\"px-3.5 xs:px-4 sm:px-7 pt-3 xs:pt-3.5 sm:pt-5 pb-3 xs:pb-3.5 sm:pb-5\">\n\t\t\t\t\t\t\t{/* Header Row: Rating + Impact Metric Pill */}\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-between gap-1.5 sm:gap-2 mb-2 sm:mb-3\">\n\t\t\t\t\t\t\t\t<div className=\"flex items-center gap-1.5 sm:gap-2 shrink-0\">\n\t\t\t\t\t\t\t\t\t<div className=\"flex items-center gap-0.5\">\n\t\t\t\t\t\t\t\t\t\t{Array.from({ length: 5 }).map((_, sIdx) => {\n\t\t\t\t\t\t\t\t\t\t\tconst filled = sIdx < Math.round(activeItem.rating);\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<Star\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={sIdx}\n\t\t\t\t\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"w-2.5 h-2.5 sm:w-3 sm:h-3\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfilled\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t? \"fill-amber-500 text-amber-500\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t: \"fill-muted text-muted\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<span className=\"font-mono text-[9.5px] sm:text-[10.5px] font-bold text-foreground/80\">\n\t\t\t\t\t\t\t\t\t\t{activeItem.rating.toFixed(1)}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t<span className=\"inline-flex items-center gap-1 sm:gap-1.5 px-2 sm:px-2.5 py-0.5 rounded-full text-[8.5px] xs:text-[9.5px] sm:text-[10.5px] font-semibold tracking-[0.02em] sm:tracking-[0.03em] bg-primary/10 text-primary border border-primary/25 truncate\">\n\t\t\t\t\t\t\t\t\t<span className=\"w-1 h-1 sm:w-1.5 sm:h-1.5 rounded-full bg-primary shrink-0\" />\n\t\t\t\t\t\t\t\t\t<span className=\"truncate\">{activeItem.metricBadge}</span>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t{/* Quote Body */}\n\t\t\t\t\t\t\t<div className=\"relative pl-2.5 sm:pl-3.5 my-1.5 sm:my-2.5\">\n\t\t\t\t\t\t\t\t<div className=\"absolute left-0 top-1 bottom-1 w-[2px] rounded-full bg-primary/60\" />\n\t\t\t\t\t\t\t\t<p className=\"text-[11.5px] xs:text-[12.5px] sm:text-[15px] leading-[17px] xs:leading-[19px] sm:leading-[25px] font-normal tracking-[-0.01em] text-foreground/90 min-h-[51px] xs:min-h-[57px] sm:min-h-[75px] line-clamp-3 sm:line-clamp-none\">\n\t\t\t\t\t\t\t\t\t&ldquo;{activeItem.content}&rdquo;\n\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t{/* Bottom Author Row separated by dashed stationery perforation */}\n\t\t\t\t\t\t\t<div className=\"flex items-center justify-between gap-2 sm:gap-3 mt-2.5 sm:mt-3.5 pt-2 sm:pt-3 border-t border-dashed border-border\">\n\t\t\t\t\t\t\t\t<div className=\"flex items-center gap-2 sm:gap-3 min-w-0\">\n\t\t\t\t\t\t\t\t\t{/* Framed Stamp Avatar */}\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tclassName=\"relative shrink-0 p-[2.5px] sm:p-[3.5px] bg-background rounded-[5px] sm:rounded-[6px] shadow-xs border border-border\"\n\t\t\t\t\t\t\t\t\t\tstyle={{ transform: \"rotate(-2.5deg)\" }}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tsrc={activeItem.avatar}\n\t\t\t\t\t\t\t\t\t\t\talt={activeItem.name}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"w-8 h-8 xs:w-9 xs:h-9 sm:w-11 sm:h-11 object-cover rounded-[2.5px] sm:rounded-[3px] block\"\n\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t\t<div className=\"flex flex-col text-left min-w-0\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"flex items-center gap-1 sm:gap-1.5\">\n\t\t\t\t\t\t\t\t\t\t\t<span className=\"text-[11.5px] xs:text-[12.5px] sm:text-[14px] font-bold tracking-[-0.01em] text-foreground leading-tight truncate\">\n\t\t\t\t\t\t\t\t\t\t\t\t{activeItem.name}\n\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\t\t\twidth=\"12\"\n\t\t\t\t\t\t\t\t\t\t\t\theight=\"12\"\n\t\t\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\t\t\t\t\t\tclassName=\"fill-primary shrink-0 sm:w-[13px] sm:h-[13px]\"\n\t\t\t\t\t\t\t\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<path d=\"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1.41 14.59L6.7 12.7l1.41-1.41 2.48 2.48 5.29-5.29 1.41 1.41-6.7 6.7z\" />\n\t\t\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t<span className=\"text-[9.5px] xs:text-[10.5px] sm:text-[11.5px] text-muted-foreground leading-snug mt-0.5 truncate\">\n\t\t\t\t\t\t\t\t\t\t\t{activeItem.role} · <strong className=\"font-medium text-foreground/85\">{activeItem.company}</strong>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t\t\t{/* Right Dispatch Date & Ref */}\n\t\t\t\t\t\t\t\t<div className=\"hidden sm:flex flex-col items-end text-right font-mono shrink-0\">\n\t\t\t\t\t\t\t\t\t<span className=\"text-[9.5px] uppercase tracking-[0.08em] text-muted-foreground\">\n\t\t\t\t\t\t\t\t\t\t{activeItem.dispatchCode}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t<span className=\"text-[10px] font-semibold text-foreground/80\">\n\t\t\t\t\t\t\t\t\t\t{activeItem.date}\n\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\n\t\t\t\t{/* 4. Full Front Envelope Pocket (zIndex 25: Card is 100% hidden behind it when inside, rises out of V-mouth, then settles in front at zIndex 30) */}\n\t\t\t\t<div\n\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\"absolute inset-0 overflow-hidden pointer-events-none\",\n\t\t\t\t\t\tflapBehind ? \"rounded-b-[10px] rounded-t-none\" : \"rounded-[10px]\",\n\t\t\t\t\t)}\n\t\t\t\t\tstyle={{ zIndex: 25 }}\n\t\t\t\t>\n\t\t\t\t\t<svg\n\t\t\t\t\t\tviewBox=\"0 0 540 336\"\n\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\tclassName=\"absolute inset-0 w-full h-full\"\n\t\t\t\t\t>\n\t\t\t\t\t\t{/* Left Folded Side Flap */}\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M 0,0 L 270,175 L 0,336 Z\"\n\t\t\t\t\t\t\tfill={activeItem.sideFlapColor}\n\t\t\t\t\t\t\tstroke={activeItem.creaseColor}\n\t\t\t\t\t\t\tstrokeWidth=\"1.15\"\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{/* Right Folded Side Flap */}\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M 540,0 L 270,175 L 540,336 Z\"\n\t\t\t\t\t\t\tfill={activeItem.sideFlapColor}\n\t\t\t\t\t\t\tstroke={activeItem.creaseColor}\n\t\t\t\t\t\t\tstrokeWidth=\"1.15\"\n\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t{/* Bottom Overlapping Pocket Flap */}\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\td=\"M 0,336 L 260,156 Q 270,149 280,156 L 540,336 Z\"\n\t\t\t\t\t\t\tfill={activeItem.outerColor}\n\t\t\t\t\t\t\tstroke={activeItem.creaseColor}\n\t\t\t\t\t\t\tstrokeWidth=\"1.2\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\n\t\t\t\t\t{/* Minimalist Center Pocket Clasp Emblem */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"absolute left-1/2 top-[46%] -translate-x-1/2 -translate-y-1/2 w-6 h-6 xs:w-7 xs:h-7 sm:w-8 sm:h-8 rounded-full flex items-center justify-center transition-colors duration-500\"\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tbackgroundColor: activeItem.outerColor,\n\t\t\t\t\t\t\tborder: `1.25px solid ${activeItem.creaseColor}`,\n\t\t\t\t\t\t\tcolor: activeItem.stampColor,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName=\"w-4 h-4 xs:w-5 xs:h-5 sm:w-5.5 sm:h-5.5 rounded-full flex items-center justify-center\"\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tborder: `1px solid ${activeItem.creaseColor}`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Star className=\"w-2 h-2 xs:w-2.5 xs:h-2.5 fill-current opacity-85\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\n\t\t\t\t\t{/* Simple Minimalist Bottom Footer (Inside Bottom Flap, Clear of Crease Lines) */}\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"absolute inset-x-7 xs:inset-x-10 sm:inset-x-16 bottom-2 sm:bottom-3 flex items-center justify-between gap-2 text-[8.5px] xs:text-[9.5px] sm:text-[11px]\"\n\t\t\t\t\t\tstyle={{ color: activeItem.stampColor }}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div className=\"flex items-center gap-1.5 sm:gap-2 min-w-0\">\n\t\t\t\t\t\t\t<span className=\"font-mono font-semibold tracking-[0.06em] sm:tracking-[0.08em] opacity-65 shrink-0\">\n\t\t\t\t\t\t\t\t{serialNumber}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span className=\"opacity-30 shrink-0\">•</span>\n\t\t\t\t\t\t\t<span className=\"font-semibold tracking-[0.02em] opacity-90 truncate\">\n\t\t\t\t\t\t\t\t{activeItem.company}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\n\t\t\t\t\t\t<div className=\"flex items-center gap-1 sm:gap-1.5 shrink-0\">\n\t\t\t\t\t\t\t<span className=\"w-1 h-1 sm:w-1.5 sm:h-1.5 rounded-full bg-primary opacity-80\" />\n\t\t\t\t\t\t\t<span className=\"font-mono text-[8px] xs:text-[9px] sm:text-[10px] uppercase tracking-[0.08em] sm:tracking-[0.1em] opacity-70\">\n\t\t\t\t\t\t\t\t{activeItem.date}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t{/* Bottom Navigation Strip: Mini Envelope Thumbnails + Theme-Styled Arrow Buttons */}\n\t\t\t<div className=\"relative z-40 flex flex-col items-center gap-4 sm:gap-5 mt-7 sm:mt-11 w-full\">\n\t\t\t\t<div className=\"flex items-center justify-center gap-1 xs:gap-1.5 sm:gap-2.5 max-w-full px-1\">\n\t\t\t\t\t{items.map((env, idx) => {\n\t\t\t\t\t\tconst isActive = idx === activeIndex;\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<div key={env.id} className=\"flex flex-col items-center\">\n\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\tonClick={() => handleSelect(idx)}\n\t\t\t\t\t\t\t\t\taria-label={`Select testimonial ${idx + 1} from ${env.name}`}\n\t\t\t\t\t\t\t\t\tclassName={cn(\n\t\t\t\t\t\t\t\t\t\t\"relative w-[38px] h-[26px] xs:w-[44px] xs:h-[30px] sm:w-[54px] sm:h-[36px] rounded-[5px] sm:rounded-[6px] overflow-hidden transition-all cursor-pointer\",\n\t\t\t\t\t\t\t\t\t\tisActive\n\t\t\t\t\t\t\t\t\t\t\t? \"ring-[1.5px] ring-primary ring-offset-[2px] ring-offset-background scale-[1.03]\"\n\t\t\t\t\t\t\t\t\t\t\t: \"opacity-75 hover:opacity-100\",\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tbackgroundColor: env.outerColor,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{/* Mini 3D envelope flap polygons */}\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\tviewBox=\"0 0 54 36\"\n\t\t\t\t\t\t\t\t\t\tpreserveAspectRatio=\"none\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"absolute inset-0 w-full h-full pointer-events-none\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<polygon\n\t\t\t\t\t\t\t\t\t\t\tpoints=\"0,0 27,19 0,36\"\n\t\t\t\t\t\t\t\t\t\t\tfill={env.sideFlapColor}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<polygon\n\t\t\t\t\t\t\t\t\t\t\tpoints=\"54,0 27,19 54,36\"\n\t\t\t\t\t\t\t\t\t\t\tfill={env.sideFlapColor}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\td=\"M 0,36 L 27,17 L 54,36 Z\"\n\t\t\t\t\t\t\t\t\t\t\tfill={env.outerColor}\n\t\t\t\t\t\t\t\t\t\t\tstroke={env.creaseColor}\n\t\t\t\t\t\t\t\t\t\t\tstrokeWidth=\"0.9\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\t\t\t\td=\"M 0,0 L 27,19 L 54,0\"\n\t\t\t\t\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\t\t\t\t\tstroke={env.creaseColor}\n\t\t\t\t\t\t\t\t\t\t\tstrokeWidth=\"1\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</svg>\n\n\t\t\t\t\t\t\t\t\t{/* Mini stamp avatar in bottom-right corner */}\n\t\t\t\t\t\t\t\t\t<div className=\"absolute bottom-0.5 right-0.5 sm:bottom-1 sm:right-1 w-3 h-3 sm:w-4 sm:h-4 bg-card p-[1px] sm:p-[1.5px] rounded-[2px] shadow-2xs\">\n\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\tsrc={env.avatar}\n\t\t\t\t\t\t\t\t\t\t\talt=\"\"\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"w-full h-full object-cover rounded-[1px] block\"\n\t\t\t\t\t\t\t\t\t\t\tloading=\"lazy\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</button>\n\n\t\t\t\t\t\t\t\t{/* Active progress indicator bar synced to `totalCycleDuration` */}\n\t\t\t\t\t\t\t\t<div className=\"w-full h-[2px] mt-1 sm:mt-1.5 rounded-full overflow-hidden bg-primary/15\">\n\t\t\t\t\t\t\t\t\t{isActive && (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tkey={`${activeIndex}-${cycleKey}-${totalCycleDuration}`}\n\t\t\t\t\t\t\t\t\t\t\tclassName=\"h-full bg-primary rounded-full\"\n\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\twidth: \"100%\",\n\t\t\t\t\t\t\t\t\t\t\t\ttransformOrigin: \"left center\",\n\t\t\t\t\t\t\t\t\t\t\t\tanimation:\n\t\t\t\t\t\t\t\t\t\t\t\t\tautoSlide && !isPaused\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? `loom-progress-fill ${totalCycleDuration}ms linear forwards`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: \"none\",\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\n\t\t\t\t{/* Paired Rounded-XL Arrow Navigation Buttons (matching reference screenshot) */}\n\t\t\t\t<div className=\"flex items-center justify-center gap-3\">\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handlePrev}\n\t\t\t\t\t\tclassName=\"size-9 xs:size-10 sm:size-11 rounded-xl border border-primary/30 bg-primary/10 text-primary hover:bg-primary/20 active:scale-95 transition-all flex items-center justify-center shadow-none cursor-pointer\"\n\t\t\t\t\t\taria-label=\"Previous envelope\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ArrowLeft className=\"size-4 stroke-[2.5]\" />\n\t\t\t\t\t</button>\n\t\t\t\t\t<button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tonClick={handleNext}\n\t\t\t\t\t\tclassName=\"size-9 xs:size-10 sm:size-11 rounded-xl bg-primary text-primary-foreground hover:opacity-90 active:scale-95 transition-all flex items-center justify-center shadow-none cursor-pointer\"\n\t\t\t\t\t\taria-label=\"Next envelope\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ArrowRight className=\"size-4 stroke-[2.5]\" />\n\t\t\t\t\t</button>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<style>{`\n\t\t\t\t.loom-stage-root {\n\t\t\t\t\t--loom-inside-y: 12px;\n\t\t\t\t\t--loom-inside-scale: 0.54;\n\t\t\t\t\t--loom-peak-y: -210px;\n\t\t\t\t\t--loom-peak-scale: 0.85;\n\t\t\t\t\t--loom-settle-y: -18px;\n\t\t\t\t}\n\t\t\t\t@media (min-width: 480px) {\n\t\t\t\t\t.loom-stage-root {\n\t\t\t\t\t\t--loom-inside-y: 12px;\n\t\t\t\t\t\t--loom-inside-scale: 0.58;\n\t\t\t\t\t\t--loom-peak-y: -232px;\n\t\t\t\t\t\t--loom-peak-scale: 0.86;\n\t\t\t\t\t\t--loom-settle-y: -22px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@media (min-width: 640px) {\n\t\t\t\t\t.loom-stage-root {\n\t\t\t\t\t\t--loom-inside-y: 14px;\n\t\t\t\t\t\t--loom-inside-scale: 0.62;\n\t\t\t\t\t\t--loom-peak-y: -275px;\n\t\t\t\t\t\t--loom-peak-scale: 0.86;\n\t\t\t\t\t\t--loom-settle-y: -26px;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t.loom-card-slot {\n\t\t\t\t\ttransform: translate3d(0px, var(--loom-inside-y), 0px) rotate(0deg) scale(var(--loom-inside-scale));\n\t\t\t\t}\n\t\t\t\t@keyframes loom-progress-fill {\n\t\t\t\t\tfrom { transform: scaleX(0); }\n\t\t\t\t\tto   { transform: scaleX(1); }\n\t\t\t\t}\n\t\t\t\t@keyframes loom-card-extract {\n\t\t\t\t\t0% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-inside-y), 0px) rotate(0deg) scale(var(--loom-inside-scale));\n\t\t\t\t\t\tz-index: 15;\n\t\t\t\t\t\tanimation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);\n\t\t\t\t\t}\n\t\t\t\t\t52% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-peak-y), 0px) rotate(0.5deg) scale(var(--loom-peak-scale));\n\t\t\t\t\t\tz-index: 15;\n\t\t\t\t\t}\n\t\t\t\t\t53% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-peak-y), 0px) rotate(0.5deg) scale(var(--loom-peak-scale));\n\t\t\t\t\t\tz-index: 30;\n\t\t\t\t\t\tanimation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);\n\t\t\t\t\t}\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-settle-y), 0px) rotate(-1.5deg) scale(1);\n\t\t\t\t\t\tz-index: 30;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t@keyframes loom-card-insert {\n\t\t\t\t\t0% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-settle-y), 0px) rotate(-1.5deg) scale(1);\n\t\t\t\t\t\tz-index: 30;\n\t\t\t\t\t\tanimation-timing-function: cubic-bezier(0.33, 1, 0.68, 1);\n\t\t\t\t\t}\n\t\t\t\t\t47% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-peak-y), 0px) rotate(0.5deg) scale(var(--loom-peak-scale));\n\t\t\t\t\t\tz-index: 30;\n\t\t\t\t\t}\n\t\t\t\t\t48% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-peak-y), 0px) rotate(0.5deg) scale(var(--loom-peak-scale));\n\t\t\t\t\t\tz-index: 15;\n\t\t\t\t\t\tanimation-timing-function: cubic-bezier(0.32, 0, 0.2, 1);\n\t\t\t\t\t}\n\t\t\t\t\t100% {\n\t\t\t\t\t\ttransform: translate3d(0px, var(--loom-inside-y), 0px) rotate(0deg) scale(var(--loom-inside-scale));\n\t\t\t\t\t\tz-index: 15;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t`}</style>\n\t\t</div>\n\t);\n}\n\n// ==========================================\n// MAIN REVIEWS BLOCK\n// ==========================================\nexport function ReviewsBlock({\n\tvariant = \"up-down-vertical-marquee\",\n\ttitle = \"Loved by Tech Leaders Worldwide\",\n\tsubtitle = \"See how fast-growing teams scale products with our senior engineering team.\",\n\treviews = DEFAULT_REVIEWS,\n\tautoSlide = true,\n\tautoSlideInterval = 4000,\n\tmarqueeSpeed = 100,\n\tclassName,\n}: ReviewsProps) {\n\tif (variant === \"testimonial-loom\") {\n\t\treturn (\n\t\t\t<section\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"relative w-full overflow-hidden border-y border-border transition-colors duration-300\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<TestimonialLoomVariant\n\t\t\t\t\treviews={reviews}\n\t\t\t\t\tautoSlide={autoSlide}\n\t\t\t\t\tanimationSpeed={marqueeSpeed}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t);\n\t}\n\n\tif (variant === \"logo-carousel\") {\n\t\treturn (\n\t\t\t<section\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"relative w-full bg-background text-foreground py-12 sm:py-20 px-4 overflow-hidden border-y border-border transition-colors duration-300\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<style>{`\n\t\t\t\t\t@keyframes reviews-marquee-left-scroll {\n\t\t\t\t\t\tfrom { transform: translateX(0); }\n\t\t\t\t\t\tto   { transform: translateX(-50%); }\n\t\t\t\t\t}\n\t\t\t\t\t@keyframes typo-color-reveal {\n\t\t\t\t\t\t0% {\n\t\t\t\t\t\t\tcolor: var(--primary, oklch(0.205 0 0));\n\t\t\t\t\t\t\topacity: 0.25;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t100% {\n\t\t\t\t\t\t\tcolor: inherit;\n\t\t\t\t\t\t\topacity: 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t.reviews-hmarquee-left {\n\t\t\t\t\t\tanimation: reviews-marquee-left-scroll ${marqueeSpeed}s linear infinite;\n\t\t\t\t\t}\n\t\t\t\t\t.reviews-hmarquee-left:hover {\n\t\t\t\t\t\tanimation-play-state: paused;\n\t\t\t\t\t}\n\t\t\t\t\t${SWAP_KEYFRAMES}\n\t\t\t\t`}</style>\n\t\t\t\t<LogoCarouselVariant\n\t\t\t\t\treviews={reviews}\n\t\t\t\t\ttitle={title !== \"Loved by Tech Leaders Worldwide\" ? title : \"Loved by teams building what's next\"}\n\t\t\t\t\tsubtitle={subtitle !== \"See how fast-growing teams scale products with our senior engineering team.\" ? subtitle : \"Hear how founders are using our platform to save time, simplify their workflow, and grow their business.\"}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t);\n\t}\n\n\tconst isStacked = variant === \"stacked-carousel\";\n\n\treturn (\n\t\t<section\n\t\t\tclassName={cn(\n\t\t\t\t\"relative w-full bg-background text-foreground py-12 sm:py-20 px-4 overflow-hidden border-y border-border transition-colors duration-300\",\n\t\t\t\tclassName,\n\t\t\t)}>\n\t\t\t{/* Self-contained marquee animation styles */}\n\t\t\t<style>{`\n\t\t\t\t@keyframes reviews-marquee-scroll {\n\t\t\t\t\tfrom { transform: translateX(0); }\n\t\t\t\t\tto   { transform: translateX(-50%); }\n\t\t\t\t}\n\t\t\t\t@keyframes reviews-marquee-left-scroll {\n\t\t\t\t\tfrom { transform: translateX(0); }\n\t\t\t\t\tto   { transform: translateX(-50%); }\n\t\t\t\t}\n\t\t\t\t@keyframes reviews-marquee-right-scroll {\n\t\t\t\t\tfrom { transform: translateX(-50%); }\n\t\t\t\t\tto   { transform: translateX(0); }\n\t\t\t\t}\n\t\t\t\t@keyframes reviews-vmarquee-up-scroll {\n\t\t\t\t\tfrom { transform: translateY(0); }\n\t\t\t\t\tto   { transform: translateY(-50%); }\n\t\t\t\t}\n\t\t\t\t@keyframes reviews-vmarquee-down-scroll {\n\t\t\t\t\tfrom { transform: translateY(-50%); }\n\t\t\t\t\tto   { transform: translateY(0); }\n\t\t\t\t}\n\t\t\t\t.reviews-marquee-track {\n\t\t\t\t\tanimation: reviews-marquee-scroll ${marqueeSpeed}s linear infinite;\n\t\t\t\t}\n\t\t\t\t.reviews-hmarquee-left {\n\t\t\t\t\tanimation: reviews-marquee-left-scroll ${marqueeSpeed}s linear infinite;\n\t\t\t\t}\n\t\t\t\t.reviews-hmarquee-right {\n\t\t\t\t\tanimation: reviews-marquee-right-scroll ${marqueeSpeed}s linear infinite;\n\t\t\t\t}\n\t\t\t\t.reviews-vmarquee-up {\n\t\t\t\t\tanimation: reviews-vmarquee-up-scroll linear infinite;\n\t\t\t\t}\n\t\t\t\t.reviews-vmarquee-down {\n\t\t\t\t\tanimation: reviews-vmarquee-down-scroll linear infinite;\n\t\t\t\t}\n\t\t\t\t.reviews-marquee-track:hover,\n\t\t\t\t.reviews-hmarquee-left:hover,\n\t\t\t\t.reviews-hmarquee-right:hover,\n\t\t\t\t.reviews-vmarquee-up:hover,\n\t\t\t\t.reviews-vmarquee-down:hover {\n\t\t\t\t\tanimation-play-state: paused;\n\t\t\t\t}\n\t\t\t\t${SWAP_KEYFRAMES}\n\t\t\t`}</style>\n\n\t\t\t{/* Header Info */}\n\t\t\t{(title || subtitle) && (\n\t\t\t\t<div className=\"relative z-20 w-full mx-auto text-center space-y-3 mb-8 sm:mb-12 flex flex-col items-center\">\n\t\t\t\t\t<div className=\"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-primary/10 border border-primary/20 text-primary text-xs font-semibold uppercase tracking-wider\">\n\t\t\t\t\t\t<Star className=\"size-3.5 fill-primary text-primary\" /> Client\n\t\t\t\t\t\tTestimonials\n\t\t\t\t\t</div>\n\t\t\t\t\t{title && (\n\t\t\t\t\t\t<h2 className=\"text-2xl sm:text-4xl font-extrabold tracking-tight text-foreground leading-tight\">\n\t\t\t\t\t\t\t{title}\n\t\t\t\t\t\t</h2>\n\t\t\t\t\t)}\n\t\t\t\t\t{subtitle && (\n\t\t\t\t\t\t<p className=\"text-xs sm:text-base text-muted-foreground w-[90%] max-w-5xl mx-auto leading-relaxed\">\n\t\t\t\t\t\t\t{subtitle}\n\t\t\t\t\t\t</p>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\t\t\t)}\n\n\t\t\t{/* Render selected variant */}\n\t\t\t{isStacked ? (\n\t\t\t\t<StackedCardsCarousel\n\t\t\t\t\treviews={reviews}\n\t\t\t\t\tautoSlide={autoSlide}\n\t\t\t\t\tautoSlideInterval={autoSlideInterval}\n\t\t\t\t/>\n\t\t\t) : (\n\t\t\t\t<FourColumnMarqueeReviews reviews={reviews} speed={marqueeSpeed} />\n\t\t\t)}\n\t\t</section>\n\t);\n}\n\nexport default ReviewsBlock;\n",
      "type": "registry:component",
      "target": "components/custom/blocks/ReviewsBlock.tsx"
    },
    {
      "path": "src/components/custom/blocks/motion-curves.ts",
      "content": "/**\n * Motion curves with no animation library behind them.\n *\n * The components here ship as CSS, GSAP or Motion builds that must move\n * identically, so the curves are computed once, from the same numbers, and\n * handed to whichever engine runs them:\n *\n *   - `cubicBezier(x1, y1, x2, y2)` → an easing function (GSAP accepts any\n *     `(progress) => value` as `ease`), exact for Motion's `ease: [..]` arrays\n *     and for CSS `cubic-bezier()`.\n *   - `spring({ stiffness, damping, mass })` → the analytic solution Motion\n *     Motion uses, as an easing function plus the time it takes to settle, or\n *     as a CSS `linear()` string for a fixed start and end.\n *   - `createSpringFollower` → a value that chases a moving target through the\n *     same spring every frame, like Motion's `useSpring`, for pointer-driven\n *     motion that no fixed curve can describe.\n */\n\n// ---------------------------------------------------------------------------\n// Cubic bezier\n// ---------------------------------------------------------------------------\n\n/**\n * The CSS / Motion cubic-bezier as a function of progress. Newton-Raphson\n * with a bisection fallback, the same solver browsers use.\n */\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number) {\n  if (x1 === y1 && x2 === y2) return (t: number) => t;\n\n  const a = (p1: number, p2: number) => 1 - 3 * p2 + 3 * p1;\n  const b = (p1: number, p2: number) => 3 * p2 - 6 * p1;\n  const c = (p1: number) => 3 * p1;\n  const at = (t: number, p1: number, p2: number) =>\n    ((a(p1, p2) * t + b(p1, p2)) * t + c(p1)) * t;\n  const slope = (t: number, p1: number, p2: number) =>\n    3 * a(p1, p2) * t * t + 2 * b(p1, p2) * t + c(p1);\n\n  const solveX = (x: number) => {\n    let t = x;\n    for (let i = 0; i < 8; i++) {\n      const s = slope(t, x1, x2);\n      if (Math.abs(s) < 1e-6) break;\n      const err = at(t, x1, x2) - x;\n      if (Math.abs(err) < 1e-7) return t;\n      t -= err / s;\n    }\n    let lo = 0;\n    let hi = 1;\n    t = x;\n    for (let i = 0; i < 30 && hi - lo > 1e-7; i++) {\n      const value = at(t, x1, x2);\n      if (value < x) lo = t;\n      else hi = t;\n      t = (lo + hi) / 2;\n    }\n    return t;\n  };\n\n  return (x: number) => (x <= 0 ? 0 : x >= 1 ? 1 : at(solveX(x), y1, y2));\n}\n\n/** Motion's named eases, as the cubic-beziers they are. */\nexport const MOTION_EASE = {\n  linear: [0, 0, 1, 1],\n  easeIn: [0.42, 0, 1, 1],\n  easeOut: [0, 0, 0.58, 1],\n  easeInOut: [0.42, 0, 0.58, 1],\n  circIn: [0.55, 0, 1, 0.45],\n  circOut: [0.55, 0, 0.45, 1],\n  circInOut: [0.85, 0, 0.15, 1],\n  backIn: [0.31, 0.01, 0.66, -0.59],\n  backOut: [0.33, 1.53, 0.69, 0.99],\n  anticipate: [0.66, -0.56, 0.34, 1.35],\n} as const;\n\n/**\n * Motion's default layout transition (`layout` / `layoutId`):\n * `{ duration: 0.45, ease: [0.4, 0, 0.1, 1] }`.\n */\nexport const LAYOUT_TRANSITION = { duration: 0.45, ease: [0.4, 0, 0.1, 1] as const };\n\n// ---------------------------------------------------------------------------\n// Spring\n// ---------------------------------------------------------------------------\n\nexport interface SpringOptions {\n  /** Motion default 100. */\n  stiffness?: number;\n  /** Motion default 10. */\n  damping?: number;\n  /** Motion default 1. */\n  mass?: number;\n  /** Starting velocity, in units of the whole distance per second. */\n  velocity?: number;\n  /** How close to the end counts as settled, as a fraction of the distance. */\n  restDelta?: number;\n}\n\n/**\n * Normalised position (0 → 1) of a spring released from 0 towards 1, at time\n * `t` seconds. The closed-form solution Motion's `spring()` generator\n * uses for the under-, critically and over-damped cases.\n */\nexport function springAt(options: SpringOptions = {}) {\n  const { stiffness = 100, damping = 10, mass = 1, velocity = 0 } = options;\n  const zeta = damping / (2 * Math.sqrt(stiffness * mass));\n  const omega0 = Math.sqrt(stiffness / mass);\n  // Motion's convention: distance still to cover, velocity toward it negated.\n  const delta = 1;\n  const v0 = -velocity;\n\n  if (zeta < 1) {\n    const omegaD = omega0 * Math.sqrt(1 - zeta * zeta);\n    return (t: number) => {\n      const envelope = Math.exp(-zeta * omega0 * t);\n      return (\n        1 -\n        envelope *\n          (((v0 + zeta * omega0 * delta) / omegaD) * Math.sin(omegaD * t) +\n            delta * Math.cos(omegaD * t))\n      );\n    };\n  }\n  if (zeta === 1) {\n    return (t: number) => 1 - Math.exp(-omega0 * t) * (delta + (v0 + omega0 * delta) * t);\n  }\n  const omegaD = omega0 * Math.sqrt(zeta * zeta - 1);\n  return (t: number) => {\n    const envelope = Math.exp(-zeta * omega0 * t);\n    const freq = Math.min(omegaD * t, 300);\n    return (\n      1 -\n      (envelope *\n        ((v0 + zeta * omega0 * delta) * Math.sinh(freq) + omegaD * delta * Math.cosh(freq))) /\n        omegaD\n    );\n  };\n}\n\n/** Seconds until the spring stays within `restDelta` of its end. */\nexport function springDuration(options: SpringOptions = {}) {\n  const at = springAt(options);\n  const restDelta = options.restDelta ?? 0.001;\n  const step = 1 / 240;\n  let lastOutside = 0;\n  for (let t = 0; t <= 10; t += step) {\n    if (Math.abs(1 - at(t)) > restDelta) lastOutside = t;\n    else if (t - lastOutside > 0.1) break;\n  }\n  return Math.max(lastOutside + step, step);\n}\n\n/**\n * A spring as a duration and an easing function over it — what GSAP takes:\n *\n *   const { duration, ease } = springEase({ stiffness: 300, damping: 20 });\n *   gsap.to(el, { y: 0, duration, ease });\n *\n * Exact for a fixed start and end; a spring that has to react mid-flight to a\n * new target needs `createSpringFollower` instead.\n */\nexport function springEase(options: SpringOptions = {}) {\n  const duration = springDuration(options);\n  const at = springAt(options);\n  return {\n    duration,\n    ease: (progress: number) => (progress >= 1 ? 1 : at(progress * duration)),\n  };\n}\n\n/**\n * A spring as a CSS `linear()` easing and its duration in ms, for\n * `transition` / `animation` with a fixed start and end.\n *\n *   const { easing, duration } = springLinear({ stiffness: 400, damping: 30 });\n *   el.style.transition = `transform ${duration}ms ${easing}`;\n */\nexport function springLinear(options: SpringOptions = {}, pointsPerSecond = 60) {\n  const duration = springDuration(options);\n  const at = springAt(options);\n  const count = Math.max(Math.ceil(duration * pointsPerSecond), 8);\n  const points: string[] = [];\n  for (let i = 0; i <= count; i++) {\n    const t = (i / count) * duration;\n    points.push(String(Math.round((i === count ? 1 : at(t)) * 10000) / 10000));\n  }\n  return { easing: `linear(${points.join(\", \")})`, duration: Math.round(duration * 1000) };\n}\n\n// ---------------------------------------------------------------------------\n// Spring follower (useSpring equivalent)\n// ---------------------------------------------------------------------------\n\n/** Something that calls back once per frame with the time since the last, in ms. */\nexport interface FrameTicker {\n  add: (callback: (deltaMs: number) => void) => () => void;\n}\n\n/** requestAnimationFrame as a ticker — the library-free default. */\nexport const rafTicker: FrameTicker = {\n  add(callback) {\n    let last = performance.now();\n    let frame = requestAnimationFrame(function tick(now) {\n      callback(now - last);\n      last = now;\n      frame = requestAnimationFrame(tick);\n    });\n    return () => cancelAnimationFrame(frame);\n  },\n};\n\nexport interface SpringFollower {\n  /** Chase a new target from wherever the value is now, keeping its velocity. */\n  set: (target: number) => void;\n  /** Move to a value instantly, with no motion. */\n  jump: (value: number) => void;\n  get: () => number;\n  destroy: () => void;\n}\n\n/**\n * A value that follows its target through a spring, integrating the same\n * equation of motion Motion's `useSpring` solves — so a pointer-driven spring\n * reads the same in every build. Runs only while moving; `onUpdate` receives\n * each new value.\n */\nexport function createSpringFollower(\n  initial: number,\n  onUpdate: (value: number) => void,\n  options: SpringOptions & { restSpeed?: number; ticker?: FrameTicker } = {},\n): SpringFollower {\n  const { stiffness = 100, damping = 10, mass = 1, ticker = rafTicker } = options;\n  const restDelta = options.restDelta ?? 0.01;\n  const restSpeed = options.restSpeed ?? 0.01;\n  let value = initial;\n  let target = initial;\n  let velocity = 0;\n  let stop: (() => void) | null = null;\n\n  const step = (deltaMs: number) => {\n    // Fixed 1ms sub-steps keep the integration stable for stiff springs and\n    // independent of the frame rate.\n    const steps = Math.min(Math.max(Math.round(deltaMs), 1), 250);\n    for (let i = 0; i < steps; i++) {\n      const force = -stiffness * (value - target) - damping * velocity;\n      velocity += (force / mass) * 0.001;\n      value += velocity * 0.001;\n    }\n    if (Math.abs(target - value) < restDelta && Math.abs(velocity) < restSpeed) {\n      value = target;\n      velocity = 0;\n      stop?.();\n      stop = null;\n    }\n    onUpdate(value);\n  };\n\n  return {\n    set(next) {\n      target = next;\n      if (!stop && value !== target) stop = ticker.add(step);\n    },\n    jump(next) {\n      stop?.();\n      stop = null;\n      value = target = next;\n      velocity = 0;\n      onUpdate(value);\n    },\n    get: () => value,\n    destroy() {\n      stop?.();\n      stop = null;\n    },\n  };\n}\n",
      "type": "registry:component",
      "target": "components/custom/blocks/motion-curves.ts"
    }
  ],
  "categories": [
    "marketing",
    "data-display"
  ],
  "type": "registry:component"
}
