{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footer",
  "title": "Footer",
  "description": "Four premium, minimal animated footers: sticky reveal, giant kinetic wordmark, classic columns with newsletter, and an expanding curtain panel with a magnetic CTA.",
  "dependencies": [
    "gsap",
    "@gsap/react",
    "motion",
    "lucide-react"
  ],
  "registryDependencies": [
    "utils",
    "https://trytweenly.vercel.app/r/use-reduced-motion.json",
    "https://trytweenly.vercel.app/r/tweenly-theme.json"
  ],
  "files": [
    {
      "path": "registry/new-york/footer/footer.tsx",
      "content": "\"use client\"\n\nimport {\n  useEffect,\n  useId,\n  useRef,\n  useState,\n  type CSSProperties,\n  type FormEvent,\n  type PointerEvent as ReactPointerEvent,\n  type ReactNode,\n} from \"react\"\nimport { AnimatePresence, motion, useMotionValue, useSpring, useTransform } from \"motion/react\"\nimport gsap from \"gsap\"\nimport { ScrollTrigger } from \"gsap/ScrollTrigger\"\nimport { useGSAP } from \"@gsap/react\"\nimport { ArrowRight, ArrowUp, ArrowUpRight, Check, Globe, LoaderCircle, Mail } from \"lucide-react\"\nimport { useReducedMotion } from \"@/registry/new-york/hooks/use-reduced-motion\"\nimport { cn } from \"@/lib/utils\"\n\ngsap.registerPlugin(useGSAP, ScrollTrigger)\n\nexport type FooterVariant = \"sticky-reveal\" | \"big-type\" | \"columns\" | \"curtain\"\n\nexport interface FooterLink {\n  label: string\n  href: string\n  /** Small pill next to the label, e.g. \"New\" or \"Hiring\". */\n  badge?: string\n}\n\nexport interface FooterColumn {\n  title: string\n  links: FooterLink[]\n}\n\nexport interface FooterSocial {\n  /** Used as the accessible name and to pick a built-in icon (GitHub, X, LinkedIn, Dribbble, YouTube, Instagram, Email). */\n  label: string\n  href: string\n  /** Custom icon. Defaults to a built-in icon chosen by label. */\n  icon?: ReactNode\n}\n\nexport interface FooterProps {\n  /** Layout and motion style. Default: \"sticky-reveal\" */\n  variant?: FooterVariant\n  /** Brand name, used for the wordmark and the default copyright. Default: \"Motion\" */\n  brand?: string\n  /** Mark shown before the brand name. Default: an accent dot */\n  logo?: ReactNode\n  /** Short line under the brand (the eyebrow in the curtain variant). Default: \"Interfaces that feel quietly alive.\" */\n  description?: string\n  /** Link groups. Default: Product / Company / Resources */\n  columns?: FooterColumn[]\n  /** Social links. Default: GitHub, X, LinkedIn */\n  socials?: FooterSocial[]\n  /** Show the newsletter form (columns and big-type). Default: true */\n  newsletter?: boolean\n  /** Called with the email when the newsletter form is submitted. Throw or reject to show an error. */\n  onSubscribe?: (email: string) => Promise<void> | void\n  /** Call-to-action, used by the magnetic button in the curtain variant. Default: { label: \"Start a project\", href: \"#\" } */\n  cta?: { label: string; href: string }\n  /** Scrolling text in the curtain variant. Default: \"Let's work together\" */\n  marqueeText?: string\n  /** Copyright line. Default: \"© {year} {brand}. All rights reserved.\" */\n  copyright?: string\n  /** Links in the bottom bar. Default: Privacy / Terms / Cookies */\n  legal?: FooterLink[]\n  /** Footer background (any CSS color). Follows the theme by default. Default: \"var(--background)\" */\n  background?: string\n  /** Main text color. Default: \"var(--foreground)\" */\n  color?: string\n  /** Accent for badges, focus rings, the CTA and hovers. Default: \"#ff4d12\" */\n  accent?: string\n  /** Secondary text color for links and captions. Default: \"var(--muted-foreground)\" */\n  muted?: string\n  /** Corner radius of inputs and buttons in px; the curtain panel starts at twice this. Default: 12 */\n  radius?: number\n  /** Height of the sticky-reveal footer (any CSS length), capped at the scroller height. Default: \"70vh\" */\n  height?: string\n  /** Wordmark size relative to the width-filling size (1 = edge to edge). Default: 1 */\n  wordmarkSize?: number\n  /** Show the giant wordmark (sticky-reveal and big-type). Default: true */\n  showWordmark?: boolean\n  /** Run scroll and entrance animations. When false (or with reduced motion) the final state renders. Default: true */\n  animate?: boolean\n  /** Scroll container to track instead of the window. Default: null (window) */\n  scroller?: HTMLElement | null\n  /** Additional classes for the root <footer>. */\n  className?: string\n}\n\nconst EASE_OUT = [0.22, 1, 0.36, 1] as const\nconst EMAIL = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/\nconst YEAR = new Date().getFullYear()\nconst PAD_X = \"px-[clamp(1.25rem,5cqw,4rem)]\"\nconst DISPLAY = \"font-[family-name:var(--font-display)]\"\nconst FOCUS =\n  \"rounded-sm outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--fc-accent)\"\n\nexport const FOOTER_DEFAULT_COLUMNS: FooterColumn[] = [\n  {\n    title: \"Product\",\n    links: [\n      { label: \"Features\", href: \"#\" },\n      { label: \"Pricing\", href: \"#\" },\n      { label: \"Changelog\", href: \"#\", badge: \"New\" },\n    ],\n  },\n  {\n    title: \"Company\",\n    links: [\n      { label: \"About\", href: \"#\" },\n      { label: \"Careers\", href: \"#\", badge: \"Hiring\" },\n      { label: \"Contact\", href: \"#\" },\n    ],\n  },\n  {\n    title: \"Resources\",\n    links: [\n      { label: \"Docs\", href: \"#\" },\n      { label: \"Guides\", href: \"#\" },\n      { label: \"Blog\", href: \"#\" },\n    ],\n  },\n]\n\nexport const FOOTER_DEFAULT_SOCIALS: FooterSocial[] = [\n  { label: \"GitHub\", href: \"#\" },\n  { label: \"X\", href: \"#\" },\n  { label: \"LinkedIn\", href: \"#\" },\n]\n\nconst DEFAULT_LEGAL: FooterLink[] = [\n  { label: \"Privacy\", href: \"#\" },\n  { label: \"Terms\", href: \"#\" },\n  { label: \"Cookies\", href: \"#\" },\n]\n\n/* ----------------------------------------------------------------------------\n * Icons (lucide ships no brand marks, so these are minimal inline SVGs)\n * ------------------------------------------------------------------------- */\n\nfunction BrandSvg({ d }: { d: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\" className=\"size-4\">\n      <path d={d} />\n    </svg>\n  )\n}\n\nconst BRAND_PATHS: [RegExp, string][] = [\n  [\n    /github/,\n    \"M12 .5a11.5 11.5 0 0 0-3.64 22.41c.58.1.79-.25.79-.56v-2c-3.2.7-3.88-1.37-3.88-1.37-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.69 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.46.11-3.05 0 0 .97-.31 3.17 1.18a10.9 10.9 0 0 1 5.77 0c2.2-1.49 3.17-1.18 3.17-1.18.63 1.59.23 2.76.11 3.05.74.81 1.19 1.84 1.19 3.1 0 4.42-2.7 5.4-5.26 5.68.41.36.78 1.06.78 2.14v3.17c0 .31.21.67.8.56A11.5 11.5 0 0 0 12 .5Z\",\n  ],\n  [\n    /^x$|twitter|x\\.com/,\n    \"M17.75 2.5h3.07l-6.7 7.66L22 21.5h-6.17l-4.84-6.32-5.53 6.32H2.38l7.17-8.2L2 2.5h6.33l4.37 5.78 5.05-5.78Zm-1.08 17.15h1.7L7.4 4.24H5.58l11.09 15.41Z\",\n  ],\n  [\n    /linkedin/,\n    \"M20.45 20.45h-3.55v-5.57c0-1.33-.03-3.04-1.85-3.04-1.86 0-2.14 1.45-2.14 2.94v5.67H9.35V9h3.41v1.56h.05c.48-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28ZM5.34 7.43a2.06 2.06 0 1 1 0-4.12 2.06 2.06 0 0 1 0 4.12ZM7.12 20.45H3.56V9h3.56v11.45ZM22.22 0H1.77C.8 0 0 .77 0 1.73v20.54C0 23.23.8 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.73V1.73C24 .77 23.2 0 22.22 0Z\",\n  ],\n  [\n    /dribbble/,\n    \"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24Zm7.93 5.53a10.2 10.2 0 0 1 2.3 6.37c-.34-.07-3.7-.75-7.08-.33-.08-.17-.15-.35-.22-.52-.2-.48-.43-.96-.66-1.43 3.73-1.52 5.43-3.7 5.66-4.09ZM12 1.77c2.6 0 4.97.97 6.77 2.57-.19.27-1.72 2.32-5.33 3.67A54.4 54.4 0 0 0 9.64 2.05 10.3 10.3 0 0 1 12 1.77Zm-4.3.95c.27.36 2.02 2.8 3.66 5.7A38.3 38.3 0 0 1 2.1 9.64a10.28 10.28 0 0 1 5.6-6.92ZM1.76 12.02v-.33c.35.01 4.44.06 8.66-1.2.24.47.47.95.68 1.43l-.33.1c-4.36 1.4-6.68 5.25-6.87 5.57a10.2 10.2 0 0 1-2.14-5.57Zm10.24 10.2c-2.35 0-4.52-.8-6.25-2.14.15-.31 1.87-3.63 6.65-5.3l.06-.02a42.4 42.4 0 0 1 2.18 7.76c-.82.35-1.72.55-2.64.55v-.85Zm4.43-1.51a44.4 44.4 0 0 0-1.99-7.28c3.17-.5 5.94.33 6.28.44a10.23 10.23 0 0 1-4.29 6.84Z\",\n  ],\n  [\n    /youtube/,\n    \"M23.5 6.2a3.02 3.02 0 0 0-2.12-2.14C19.5 3.55 12 3.55 12 3.55s-7.5 0-9.38.5A3.02 3.02 0 0 0 .5 6.2 31.4 31.4 0 0 0 0 12a31.4 31.4 0 0 0 .5 5.8 3.02 3.02 0 0 0 2.12 2.14c1.88.5 9.38.5 9.38.5s7.5 0 9.38-.5a3.02 3.02 0 0 0 2.12-2.14A31.4 31.4 0 0 0 24 12a31.4 31.4 0 0 0-.5-5.8ZM9.55 15.57V8.43L15.82 12l-6.27 3.57Z\",\n  ],\n  [\n    /instagram/,\n    \"M12 2.16c3.2 0 3.58.01 4.85.07 3.25.15 4.77 1.69 4.92 4.92.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.15 3.23-1.66 4.77-4.92 4.92-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-3.26-.15-4.77-1.7-4.92-4.92C2.17 15.58 2.16 15.2 2.16 12s.01-3.58.07-4.85C2.38 3.92 3.9 2.38 7.15 2.23 8.42 2.17 8.8 2.16 12 2.16ZM12 0C8.74 0 8.33.01 7.05.07 2.7.27.27 2.69.07 7.05.01 8.33 0 8.74 0 12s.01 3.67.07 4.95c.2 4.36 2.62 6.78 6.98 6.98C8.33 23.99 8.74 24 12 24s3.67-.01 4.95-.07c4.35-.2 6.78-2.62 6.98-6.98.06-1.28.07-1.69.07-4.95s-.01-3.67-.07-4.95c-.2-4.35-2.62-6.78-6.98-6.98C15.67.01 15.26 0 12 0Zm0 5.84a6.16 6.16 0 1 0 0 12.32 6.16 6.16 0 0 0 0-12.32ZM12 16a4 4 0 1 1 0-8 4 4 0 0 1 0 8Zm6.4-11.85a1.44 1.44 0 1 0 0 2.88 1.44 1.44 0 0 0 0-2.88Z\",\n  ],\n]\n\nfunction socialIcon(label: string): ReactNode {\n  const key = label.trim().toLowerCase()\n  const match = BRAND_PATHS.find(([re]) => re.test(key))\n  if (match) return <BrandSvg d={match[1]} />\n  if (/mail|email|newsletter/.test(key)) return <Mail className=\"size-4\" aria-hidden=\"true\" />\n  return <Globe className=\"size-4\" aria-hidden=\"true\" />\n}\n\nconst isExternal = (href: string) => /^https?:\\/\\//.test(href)\nconst linkTarget = (href: string) =>\n  isExternal(href) ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {}\n\n/* ----------------------------------------------------------------------------\n * Building blocks\n * ------------------------------------------------------------------------- */\n\nfunction FooterAnchor({ link, className }: { link: FooterLink; className?: string }) {\n  return (\n    <a\n      href={link.href}\n      {...linkTarget(link.href)}\n      className={cn(\n        \"group/link inline-flex items-center gap-1.5 text-(--fc-muted) transition-colors duration-300 hover:text-(--fc-fg)\",\n        FOCUS,\n        className\n      )}\n    >\n      <span className=\"relative after:absolute after:inset-x-0 after:-bottom-0.5 after:h-px after:origin-right after:scale-x-0 after:bg-current after:transition-transform after:duration-500 after:ease-[cubic-bezier(0.22,1,0.36,1)] group-hover/link:after:origin-left group-hover/link:after:scale-x-100\">\n        {link.label}\n      </span>\n      {link.badge && (\n        <span\n          className=\"rounded-full px-1.5 py-px text-[10px] font-medium leading-4 text-(--fc-accent)\"\n          style={{ background: \"color-mix(in oklab, var(--fc-accent) 16%, transparent)\" }}\n        >\n          {link.badge}\n        </span>\n      )}\n      <ArrowUpRight\n        aria-hidden=\"true\"\n        className=\"size-3 -translate-x-1 translate-y-1 opacity-0 transition-[transform,opacity] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover/link:translate-x-0 group-hover/link:translate-y-0 group-hover/link:opacity-100\"\n      />\n    </a>\n  )\n}\n\nfunction LinkColumn({ column, index }: { column: FooterColumn; index: number }) {\n  const id = useId()\n  return (\n    <nav aria-labelledby={id} data-fc-reveal className=\"min-w-0\">\n      <p id={id} className=\"mb-4 text-xs font-medium uppercase tracking-[0.12em] text-(--fc-fg)\">\n        <span className=\"mr-2 font-mono text-(--fc-muted) opacity-60\">{String(index + 1).padStart(2, \"0\")}</span>\n        {column.title}\n      </p>\n      <ul className=\"space-y-2.5 text-sm\">\n        {column.links.map((link) => (\n          <li key={link.label + link.href}>\n            <FooterAnchor link={link} />\n          </li>\n        ))}\n      </ul>\n    </nav>\n  )\n}\n\nfunction LinkColumns({ columns, className }: { columns: FooterColumn[]; className?: string }) {\n  return (\n    <div\n      className={cn(\n        \"grid grid-cols-2 gap-x-6 gap-y-10 @xl:grid-cols-[repeat(var(--fc-cols),minmax(0,1fr))]\",\n        className\n      )}\n      style={{ \"--fc-cols\": Math.max(columns.length, 1) } as CSSProperties}\n    >\n      {columns.map((column, i) => (\n        <LinkColumn key={column.title} column={column} index={i} />\n      ))}\n    </div>\n  )\n}\n\nfunction Brand({ brand, logo }: { brand: string; logo?: ReactNode }) {\n  return (\n    <div className=\"flex items-center gap-2.5 text-(--fc-fg)\">\n      {logo ?? <span aria-hidden=\"true\" className=\"size-2.5 rounded-full bg-(--fc-accent)\" />}\n      <span className={cn(DISPLAY, \"text-2xl font-semibold uppercase leading-none tracking-wide\")}>{brand}</span>\n    </div>\n  )\n}\n\nfunction Socials({ socials, className }: { socials: FooterSocial[]; className?: string }) {\n  if (!socials.length) return null\n  return (\n    <ul className={cn(\"flex flex-wrap gap-2\", className)}>\n      {socials.map((s) => (\n        <li key={s.label + s.href}>\n          <a\n            href={s.href}\n            aria-label={s.label}\n            {...linkTarget(s.href)}\n            className=\"group/social relative grid size-10 place-items-center overflow-hidden rounded-full border border-(--fc-border) text-(--fc-fg) outline-none transition-colors duration-300 before:absolute before:inset-0 before:scale-0 before:rounded-full before:bg-(--fc-fg) before:transition-transform before:duration-500 before:ease-[cubic-bezier(0.22,1,0.36,1)] hover:text-(--fc-bg) hover:before:scale-100 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--fc-accent)\"\n          >\n            <span className=\"relative transition-transform duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover/social:-rotate-8 group-hover/social:scale-110\">\n              {s.icon ?? socialIcon(s.label)}\n            </span>\n          </a>\n        </li>\n      ))}\n    </ul>\n  )\n}\n\ntype SubscribeStatus = \"idle\" | \"loading\" | \"success\" | \"error\"\n\nfunction Newsletter({ onSubscribe, radius }: { onSubscribe?: FooterProps[\"onSubscribe\"]; radius: number }) {\n  const id = useId()\n  const [email, setEmail] = useState(\"\")\n  const [status, setStatus] = useState<SubscribeStatus>(\"idle\")\n  const timer = useRef<number | undefined>(undefined)\n\n  useEffect(() => () => window.clearTimeout(timer.current), [])\n\n  async function submit(e: FormEvent<HTMLFormElement>) {\n    e.preventDefault()\n    if (status === \"loading\") return\n    window.clearTimeout(timer.current)\n    if (!EMAIL.test(email.trim())) {\n      setStatus(\"error\")\n      return\n    }\n    setStatus(\"loading\")\n    try {\n      await onSubscribe?.(email.trim())\n      setStatus(\"success\")\n      setEmail(\"\")\n      timer.current = window.setTimeout(() => setStatus(\"idle\"), 3200)\n    } catch {\n      setStatus(\"error\")\n    }\n  }\n\n  const message =\n    status === \"success\"\n      ? \"Thanks, you're on the list.\"\n      : status === \"error\"\n        ? \"Please enter a valid email address.\"\n        : \"One short email a month. No spam.\"\n\n  return (\n    <form onSubmit={submit} noValidate className=\"w-full max-w-sm\">\n      <label htmlFor={id} className=\"mb-3 block text-sm font-medium text-(--fc-fg)\">\n        Stay in the loop\n      </label>\n      <div\n        className={cn(\n          \"flex items-center gap-1 border bg-(--fc-fg)/[0.03] p-1 transition-colors duration-300 focus-within:border-(--fc-muted)\",\n          status === \"error\" ? \"border-(--fc-accent)\" : \"border-(--fc-border)\"\n        )}\n        style={{ borderRadius: radius + 4 }}\n      >\n        <input\n          id={id}\n          type=\"email\"\n          inputMode=\"email\"\n          autoComplete=\"email\"\n          placeholder=\"you@company.com\"\n          value={email}\n          aria-invalid={status === \"error\"}\n          aria-describedby={`${id}-msg`}\n          onChange={(e) => {\n            setEmail(e.target.value)\n            if (status === \"error\") setStatus(\"idle\")\n          }}\n          className=\"h-9 min-w-0 flex-1 bg-transparent px-3 text-sm text-(--fc-fg) outline-none placeholder:text-(--fc-muted)/70\"\n        />\n        <button\n          type=\"submit\"\n          aria-label={status === \"success\" ? \"Subscribed\" : \"Subscribe\"}\n          disabled={status === \"loading\"}\n          className=\"relative grid h-9 w-11 shrink-0 place-items-center overflow-hidden bg-(--fc-fg) text-(--fc-bg) outline-none transition-transform duration-300 active:scale-95 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-(--fc-accent) disabled:cursor-wait\"\n          style={{\n            borderRadius: radius,\n            background: status === \"success\" ? \"var(--fc-accent)\" : undefined,\n          }}\n        >\n          <AnimatePresence mode=\"popLayout\" initial={false}>\n            <motion.span\n              key={status === \"error\" ? \"idle\" : status}\n              initial={{ y: 14, opacity: 0, filter: \"blur(2px)\" }}\n              animate={{ y: 0, opacity: 1, filter: \"blur(0px)\" }}\n              exit={{ y: -14, opacity: 0, filter: \"blur(2px)\" }}\n              transition={{ duration: 0.35, ease: EASE_OUT }}\n              className=\"grid place-items-center\"\n            >\n              {status === \"loading\" ? (\n                <LoaderCircle className=\"size-4 animate-spin\" aria-hidden=\"true\" />\n              ) : status === \"success\" ? (\n                <Check className=\"size-4\" strokeWidth={2.5} aria-hidden=\"true\" />\n              ) : (\n                <ArrowRight className=\"size-4\" aria-hidden=\"true\" />\n              )}\n            </motion.span>\n          </AnimatePresence>\n        </button>\n      </div>\n      <p\n        id={`${id}-msg`}\n        aria-live=\"polite\"\n        className={cn(\n          \"mt-2.5 text-xs transition-colors duration-300\",\n          status === \"error\" || status === \"success\" ? \"text-(--fc-fg)\" : \"text-(--fc-muted)\"\n        )}\n      >\n        {message}\n      </p>\n    </form>\n  )\n}\n\nfunction BackToTop({ scroller, reduced }: { scroller?: HTMLElement | null; reduced: boolean }) {\n  return (\n    <button\n      type=\"button\"\n      onClick={() => (scroller ?? window).scrollTo({ top: 0, behavior: reduced ? \"auto\" : \"smooth\" })}\n      className={cn(\"group/top inline-flex items-center gap-2 text-(--fc-muted) transition-colors hover:text-(--fc-fg)\", FOCUS)}\n    >\n      Back to top\n      <span className=\"relative grid size-7 place-items-center overflow-hidden rounded-full border border-(--fc-border)\">\n        <ArrowUp\n          aria-hidden=\"true\"\n          className=\"size-3.5 transition-transform duration-500 ease-[cubic-bezier(0.76,0,0.24,1)] group-hover/top:-translate-y-7\"\n        />\n        <ArrowUp\n          aria-hidden=\"true\"\n          className=\"absolute size-3.5 translate-y-7 text-(--fc-accent) transition-transform duration-500 ease-[cubic-bezier(0.76,0,0.24,1)] group-hover/top:translate-y-0\"\n        />\n      </span>\n    </button>\n  )\n}\n\nfunction BottomBar({\n  copyright,\n  legal,\n  scroller,\n  reduced,\n  className,\n}: {\n  copyright: string\n  legal: FooterLink[]\n  scroller?: HTMLElement | null\n  reduced: boolean\n  className?: string\n}) {\n  return (\n    <div\n      data-fc-reveal\n      className={cn(\n        \"flex flex-col gap-4 border-t border-(--fc-border) pt-5 text-xs text-(--fc-muted) @2xl:flex-row @2xl:items-center @2xl:justify-between\",\n        className\n      )}\n    >\n      <p>{copyright}</p>\n      <div className=\"flex flex-wrap items-center gap-x-6 gap-y-3\">\n        {legal.length > 0 && (\n          <ul className=\"flex flex-wrap gap-x-5 gap-y-2\">\n            {legal.map((l) => (\n              <li key={l.label + l.href}>\n                <FooterAnchor link={l} />\n              </li>\n            ))}\n          </ul>\n        )}\n        <BackToTop scroller={scroller} reduced={reduced} />\n      </div>\n    </div>\n  )\n}\n\n/** Giant display wordmark, auto-fitted to its container width. Letters are split for animation. */\nfunction Wordmark({\n  text,\n  scale,\n  interactive = false,\n  className,\n}: {\n  text: string\n  scale: number\n  interactive?: boolean\n  className?: string\n}) {\n  const boxRef = useRef<HTMLDivElement>(null)\n  const textRef = useRef<HTMLSpanElement>(null)\n  const chars = Array.from(text)\n\n  useEffect(() => {\n    const box = boxRef.current\n    const el = textRef.current\n    if (!box || !el) return\n    let lastWidth = -1\n    let frame = 0\n\n    const fit = (force = false) => {\n      const available = box.clientWidth\n      if (!available || (!force && available === lastWidth)) return\n      lastWidth = available\n      el.style.fontSize = \"100px\"\n      const natural = el.offsetWidth // layout width, unaffected by letter transforms\n      if (natural > 0) el.style.fontSize = `${((100 * available) / natural) * scale * 0.995}px`\n    }\n\n    fit(true)\n    // Defer to the next frame so the height change doesn't re-enter the observer\n    const ro = new ResizeObserver(() => {\n      cancelAnimationFrame(frame)\n      frame = requestAnimationFrame(() => fit())\n    })\n    ro.observe(box)\n    let alive = true\n    document.fonts?.ready.then(() => {\n      if (!alive) return\n      fit(true)\n      ScrollTrigger.refresh()\n    })\n    return () => {\n      alive = false\n      cancelAnimationFrame(frame)\n      ro.disconnect()\n    }\n  }, [text, scale])\n\n  return (\n    <div\n      ref={boxRef}\n      className={cn(\n        DISPLAY,\n        \"w-full select-none overflow-hidden pt-[0.1em] font-bold uppercase leading-[0.8] tracking-[-0.01em] text-(--fc-fg)\",\n        className\n      )}\n    >\n      <span className=\"sr-only\">{text}</span>\n      <span\n        ref={textRef}\n        aria-hidden=\"true\"\n        className=\"inline-block whitespace-nowrap\"\n        // Estimate before measuring, so the first paint is already close\n        style={{ fontSize: `${(100 / Math.max(chars.length * 0.5, 1)) * scale}cqw` }}\n      >\n        {chars.map((c, i) => (\n          <span key={i} data-fc-letter className=\"inline-block origin-bottom-left will-change-transform\">\n            <span\n              className={cn(\n                \"inline-block\",\n                interactive &&\n                  \"transition-[transform,color] duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] hover:-translate-y-[0.08em] hover:text-(--fc-accent)\"\n              )}\n            >\n              {c === \" \" ? \" \" : c}\n            </span>\n          </span>\n        ))}\n      </span>\n    </div>\n  )\n}\n\nfunction MagneticCta({ cta, reduced }: { cta: { label: string; href: string }; reduced: boolean }) {\n  const x = useMotionValue(0)\n  const y = useMotionValue(0)\n  const sx = useSpring(x, { stiffness: 420, damping: 32, mass: 0.6 })\n  const sy = useSpring(y, { stiffness: 420, damping: 32, mass: 0.6 })\n  const lx = useTransform(sx, (v) => v * 0.45)\n  const ly = useTransform(sy, (v) => v * 0.45)\n\n  const onMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n    if (reduced || e.pointerType !== \"mouse\") return\n    const r = e.currentTarget.getBoundingClientRect()\n    x.set((e.clientX - (r.left + r.width / 2)) * 0.35)\n    y.set((e.clientY - (r.top + r.height / 2)) * 0.35)\n  }\n  const reset = () => {\n    x.set(0)\n    y.set(0)\n  }\n\n  return (\n    <div onPointerMove={onMove} onPointerLeave={reset} className=\"-m-8 grid place-items-center p-8\">\n      <motion.a\n        href={cta.href}\n        {...linkTarget(cta.href)}\n        style={{ x: sx, y: sy }}\n        className=\"group/cta relative grid size-[clamp(8rem,20cqw,12rem)] place-items-center overflow-hidden rounded-full bg-(--fc-accent) text-center text-sm font-medium text-white outline-none focus-visible:outline-2 focus-visible:outline-offset-4 focus-visible:outline-(--fc-fg)\"\n      >\n        <span\n          aria-hidden=\"true\"\n          className=\"absolute inset-0 translate-y-full rounded-[inherit] bg-(--fc-fg) transition-transform duration-700 ease-[cubic-bezier(0.76,0,0.24,1)] group-hover/cta:translate-y-0\"\n        />\n        <motion.span\n          style={{ x: lx, y: ly }}\n          className=\"relative flex flex-col items-center gap-1.5 px-4 transition-colors duration-500 group-hover/cta:text-(--fc-bg)\"\n        >\n          <ArrowUpRight\n            aria-hidden=\"true\"\n            className=\"size-5 transition-transform duration-500 ease-[cubic-bezier(0.22,1,0.36,1)] group-hover/cta:rotate-45\"\n          />\n          {cta.label}\n        </motion.span>\n      </motion.a>\n    </div>\n  )\n}\n\n/* ----------------------------------------------------------------------------\n * Footer\n * ------------------------------------------------------------------------- */\n\nexport function Footer({\n  variant = \"sticky-reveal\",\n  brand = \"Motion\",\n  logo,\n  description = \"Interfaces that feel quietly alive.\",\n  columns = FOOTER_DEFAULT_COLUMNS,\n  socials = FOOTER_DEFAULT_SOCIALS,\n  newsletter = true,\n  onSubscribe,\n  cta = { label: \"Start a project\", href: \"#\" },\n  marqueeText = \"Let's work together\",\n  copyright,\n  legal = DEFAULT_LEGAL,\n  background = \"var(--background)\",\n  color = \"var(--foreground)\",\n  accent = \"#ff4d12\",\n  muted = \"var(--muted-foreground)\",\n  radius = 12,\n  height = \"70vh\",\n  wordmarkSize = 1,\n  showWordmark = true,\n  animate = true,\n  scroller = null,\n  className,\n}: FooterProps) {\n  const rootRef = useRef<HTMLElement>(null)\n  const reduced = useReducedMotion()\n  const motionOn = animate && !reduced\n  const copy = copyright ?? `© ${YEAR} ${brand}. All rights reserved.`\n  const panelRadius = radius * 2\n\n  const vars = {\n    \"--fc-bg\": background,\n    \"--fc-fg\": color,\n    \"--fc-muted\": muted,\n    \"--fc-accent\": accent,\n    \"--fc-border\": `color-mix(in oklab, ${color} 9%, transparent)`,\n  } as CSSProperties\n\n  // Sticky reveal needs the visible height of the scroller (falls back to the viewport)\n  useEffect(() => {\n    const root = rootRef.current\n    if (!root || !scroller) return\n    const set = () => root.style.setProperty(\"--fc-vh\", `${scroller.clientHeight}px`)\n    set()\n    const ro = new ResizeObserver(set)\n    ro.observe(scroller)\n    return () => {\n      ro.disconnect()\n      root.style.removeProperty(\"--fc-vh\")\n    }\n  }, [scroller])\n\n  useGSAP(\n    () => {\n      const root = rootRef.current\n      if (!root || !motionOn) return\n      const sc = scroller ?? undefined\n      const letters = gsap.utils.toArray<HTMLElement>(\"[data-fc-letter]\", root)\n      const reveals = gsap.utils.toArray<HTMLElement>(\"[data-fc-reveal]\", root)\n\n      const staggerIn = (trigger: Element) =>\n        reveals.length &&\n        gsap.fromTo(\n          reveals,\n          { y: 28, opacity: 0 },\n          {\n            y: 0,\n            opacity: 1,\n            duration: 1,\n            ease: \"expo.out\",\n            stagger: 0.07,\n            scrollTrigger: { trigger, scroller: sc, start: \"top 88%\", toggleActions: \"play none none reverse\" },\n          }\n        )\n\n      if (variant === \"sticky-reveal\") {\n        const wrap = root.querySelector(\"[data-fc-wrap]\")\n        const content = root.querySelector(\"[data-fc-content]\")\n        if (!wrap || !content) return\n        const tl = gsap.timeline({\n          scrollTrigger: {\n            trigger: wrap,\n            scroller: sc,\n            start: \"top bottom\",\n            end: \"bottom bottom\",\n            scrub: 0.6,\n            invalidateOnRefresh: true,\n          },\n        })\n        tl.fromTo(\n          content,\n          { yPercent: -22, scale: 0.94, opacity: 0.25 },\n          { yPercent: 0, scale: 1, opacity: 1, ease: \"power2.out\", duration: 1 },\n          0\n        )\n        if (letters.length) {\n          tl.fromTo(\n            letters,\n            { yPercent: 110 },\n            { yPercent: 0, ease: \"power3.out\", duration: 0.55, stagger: { amount: 0.3 } },\n            0.1\n          )\n        }\n      }\n\n      if (variant === \"big-type\") {\n        staggerIn(root)\n        const mark = letters[0]?.closest(\"[data-fc-mark]\")\n        if (mark) {\n          gsap.fromTo(\n            letters,\n            { yPercent: 115, skewY: 10 },\n            {\n              yPercent: 0,\n              skewY: 0,\n              duration: 1.2,\n              ease: \"expo.out\",\n              stagger: 0.045,\n              scrollTrigger: { trigger: mark, scroller: sc, start: \"top 96%\", toggleActions: \"play none none reverse\" },\n            }\n          )\n        }\n      }\n\n      if (variant === \"columns\") staggerIn(root)\n\n      if (variant === \"curtain\") {\n        const panel = root.querySelector(\"[data-fc-panel]\")\n        const inner = root.querySelector(\"[data-fc-inner]\")\n        const track = root.querySelector(\"[data-fc-track]\")\n        if (panel) {\n          gsap\n            .timeline({\n              scrollTrigger: {\n                trigger: root,\n                scroller: sc,\n                start: \"top bottom\",\n                end: \"bottom bottom\",\n                scrub: 0.6,\n                invalidateOnRefresh: true,\n              },\n            })\n            .fromTo(\n              panel,\n              { clipPath: `inset(7% 6% 0% 6% round ${panelRadius}px)` },\n              { clipPath: \"inset(0% 0% 0% 0% round 0px)\", ease: \"power2.out\", duration: 1 },\n              0\n            )\n            .fromTo(inner, { y: 90, opacity: 0.4 }, { y: 0, opacity: 1, ease: \"power2.out\", duration: 1 }, 0)\n        }\n        if (track) gsap.to(track, { xPercent: -50, duration: 26, ease: \"none\", repeat: -1 })\n      }\n\n      const refresh = window.setTimeout(() => ScrollTrigger.refresh(), 120)\n      return () => window.clearTimeout(refresh)\n    },\n    {\n      scope: rootRef,\n      dependencies: [variant, motionOn, scroller, height, brand, showWordmark, wordmarkSize, panelRadius, marqueeText, columns.length],\n      revertOnUpdate: true,\n    }\n  )\n\n  const footerClass = cn(\"@container relative w-full text-(--fc-fg)\", className)\n\n  /* ---------------------------------- sticky reveal ---------------------------------- */\n  if (variant === \"sticky-reveal\") {\n    const h = `min(${height}, var(--fc-vh, 100dvh))`\n    return (\n      <footer ref={rootRef} className={footerClass} style={vars}>\n        <div\n          data-fc-wrap\n          className=\"relative\"\n          style={{ height: h, clipPath: \"polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)\" }}\n        >\n          <div className=\"relative\" style={{ height: `calc(var(--fc-vh, 100dvh) + ${h})`, top: \"calc(-1 * var(--fc-vh, 100dvh))\" }}>\n            <div\n              className=\"sticky overflow-hidden bg-(--fc-bg)\"\n              style={{ height: h, top: `calc(var(--fc-vh, 100dvh) - ${h})` }}\n            >\n              <div\n                data-fc-content\n                className={cn(PAD_X, \"flex h-full origin-bottom flex-col justify-between gap-8 pb-5 pt-[clamp(2rem,6cqw,4.5rem)]\")}\n              >\n                <div className=\"grid gap-10 @3xl:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)]\">\n                  <div className=\"flex flex-col items-start gap-5\">\n                    <Brand brand={brand} logo={logo} />\n                    {description && (\n                      <p className=\"max-w-xs text-balance text-sm leading-relaxed text-(--fc-muted)\">{description}</p>\n                    )}\n                    <Socials socials={socials} />\n                  </div>\n                  <LinkColumns columns={columns} />\n                </div>\n                <div className=\"flex flex-col gap-4\">\n                  {showWordmark && <Wordmark text={brand} scale={wordmarkSize} />}\n                  <BottomBar copyright={copy} legal={legal} scroller={scroller} reduced={reduced} />\n                </div>\n              </div>\n            </div>\n          </div>\n        </div>\n      </footer>\n    )\n  }\n\n  /* ------------------------------------ big type ------------------------------------- */\n  if (variant === \"big-type\") {\n    return (\n      <footer ref={rootRef} className={cn(footerClass, \"overflow-clip bg-(--fc-bg)\")} style={vars}>\n        <div className={cn(PAD_X, \"pt-[clamp(3rem,8cqw,6rem)]\")}>\n          <div className=\"grid gap-12 @3xl:grid-cols-[minmax(0,1fr)_minmax(0,1.6fr)]\">\n            <div data-fc-reveal className=\"flex flex-col items-start gap-6\">\n              <p className=\"max-w-sm text-balance text-[clamp(1.25rem,2.6cqw,1.75rem)] font-medium leading-snug tracking-tight\">\n                {description}\n              </p>\n              {newsletter && <Newsletter onSubscribe={onSubscribe} radius={radius} />}\n            </div>\n            <LinkColumns columns={columns} />\n          </div>\n          <div\n            data-fc-reveal\n            className=\"mt-14 flex flex-wrap items-center justify-between gap-4 border-t border-(--fc-border) pt-5\"\n          >\n            <Brand brand={brand} logo={logo} />\n            <Socials socials={socials} />\n          </div>\n        </div>\n        {showWordmark && (\n          <div data-fc-mark className={cn(PAD_X, \"mt-6\")}>\n            <Wordmark text={brand} scale={wordmarkSize} interactive />\n          </div>\n        )}\n        <div className={cn(PAD_X, \"pb-5 pt-4\")}>\n          <BottomBar copyright={copy} legal={legal} scroller={scroller} reduced={reduced} />\n        </div>\n      </footer>\n    )\n  }\n\n  /* ------------------------------------ columns -------------------------------------- */\n  if (variant === \"columns\") {\n    return (\n      <footer ref={rootRef} className={cn(footerClass, \"border-t border-(--fc-border) bg-(--fc-bg)\")} style={vars}>\n        <div className={cn(PAD_X, \"pb-5 pt-[clamp(3rem,7cqw,5.5rem)]\")}>\n          <div className=\"grid gap-12 @3xl:grid-cols-[minmax(0,1fr)_minmax(0,1.7fr)] @3xl:gap-16\">\n            <div data-fc-reveal className=\"flex flex-col items-start gap-5\">\n              <Brand brand={brand} logo={logo} />\n              {description && (\n                <p className=\"max-w-xs text-balance text-sm leading-relaxed text-(--fc-muted)\">{description}</p>\n              )}\n              <Socials socials={socials} />\n              {newsletter && (\n                <div className=\"mt-4 w-full\">\n                  <Newsletter onSubscribe={onSubscribe} radius={radius} />\n                </div>\n              )}\n            </div>\n            <LinkColumns columns={columns} />\n          </div>\n          <BottomBar copyright={copy} legal={legal} scroller={scroller} reduced={reduced} className=\"mt-16\" />\n        </div>\n      </footer>\n    )\n  }\n\n  /* ------------------------------------ curtain -------------------------------------- */\n  const phrase = marqueeText\n  return (\n    <footer ref={rootRef} className={footerClass} style={vars}>\n      <div\n        data-fc-panel\n        className=\"overflow-hidden bg-(--fc-bg)\"\n      >\n        <div data-fc-inner className=\"pb-5 pt-[clamp(3rem,8cqw,6rem)]\">\n          <p className={cn(PAD_X, \"flex items-center gap-2 text-xs uppercase tracking-[0.14em] text-(--fc-muted)\")}>\n            <span aria-hidden=\"true\" className=\"size-1.5 rounded-full bg-(--fc-accent)\" />\n            {description}\n          </p>\n\n          <div className=\"relative mt-6 overflow-hidden\">\n            <p className=\"sr-only\">{phrase}</p>\n            <div\n              data-fc-track\n              aria-hidden=\"true\"\n              className={cn(\n                DISPLAY,\n                \"flex w-max whitespace-nowrap text-[clamp(3.5rem,13cqw,11rem)] font-bold uppercase leading-[0.95] tracking-[-0.01em]\"\n              )}\n            >\n              {Array.from({ length: 2 }, (_, half) => (\n                <span key={half} className=\"flex\">\n                  {Array.from({ length: 3 }, (_, i) => (\n                    <span key={i} className=\"flex items-center\">\n                      <span className=\"px-[0.18em]\">{phrase}</span>\n                      <span className=\"text-(--fc-accent)\">·</span>\n                    </span>\n                  ))}\n                </span>\n              ))}\n            </div>\n          </div>\n\n          <div\n            className={cn(\n              PAD_X,\n              \"mt-[clamp(2.5rem,6cqw,4.5rem)] grid items-center gap-12 @3xl:grid-cols-[auto_minmax(0,1fr)] @3xl:gap-20\"\n            )}\n          >\n            <div className=\"flex justify-center @3xl:justify-start\">\n              <MagneticCta cta={cta} reduced={reduced} />\n            </div>\n            <div className=\"grid gap-10\">\n              <LinkColumns columns={columns} />\n              <div className=\"flex flex-wrap items-center justify-between gap-4\">\n                <Brand brand={brand} logo={logo} />\n                <Socials socials={socials} />\n              </div>\n            </div>\n          </div>\n\n          <div className={cn(PAD_X, \"mt-12\")}>\n            <BottomBar copyright={copy} legal={legal} scroller={scroller} reduced={reduced} />\n          </div>\n        </div>\n      </div>\n    </footer>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "docs": "Docs, live playground and every prop: https://trytweenly.vercel.app/docs/components/footer",
  "type": "registry:component"
}