{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"bento-footer-grid","type":"registry:component","title":"Bento Footer Grid","description":"A bento footer whose tiles are live: a 90-day uptime strip you can read day by day, a back-to-top ring that fills as you scroll, a newsletter that widens across its row as its neighbours reflow, and a wordmark that rises into its crop.","dependencies":[],"registryDependencies":[],"files":[{"path":"components/viberdy/bento-footer-grid.tsx","content":"\"use client\";\n\nimport { useEffect, useId, useLayoutEffect, useRef, useState } from \"react\";\nimport type {\n  CSSProperties,\n  FormEvent,\n  KeyboardEvent as ReactKeyboardEvent,\n  MouseEvent as ReactMouseEvent,\n  PointerEvent as ReactPointerEvent,\n  ReactNode,\n} from \"react\";\n\n/**\n * BentoFooterGrid — a site footer set as bento tiles, and the tiles are live.\n *\n * The brand is the one 2x2: mark, a line about what you make, and your\n * social links. Each sitemap column is a 1x2 tile. Around them:\n *\n * - STATUS. Your headline uptime over a 90-day strip of bars, one per day.\n *   Point along the strip (or focus it and use the arrow keys) and a readout\n *   names the day, its uptime and what happened. Today's bar and the headline\n *   figure take the status tone, and today's bar breathes on one slow\n *   10-second pulse while the footer is on screen.\n * - BACK TO TOP. A ring that fills with the reader's scroll progress; press\n *   it and the page glides back up (instantly under reduced motion) while\n *   the ring drains.\n * - NEWSLETTER. Focus the field and the tile expands across its whole row;\n *   the tiles beside it reflow into the row below on a FLIP spring. Leave it\n *   empty and it folds back when focus moves on.\n * - WORDMARK. Your name set huge and cropped by its tile. It is scroll-linked:\n *   as the footer arrives it rises inside its crop, and sinks again if you\n *   scroll back up.\n *\n * Depth is luminance and a 1px hairline; a light that follows the pointer\n * catches the hairlines near it. The subscribe button is the only accent;\n * the status tone is semantic, confined to the dot, today's bar and the\n * figure. Motion runs only while the footer is on screen and never under\n * prefers-reduced-motion.\n *\n * Scroll: by default everything follows the page (the window). Pass\n * scroll=\"self\" when the footer lives in a fixed-height frame that scrolls\n * on its own (a preview, a modal, a docs pane): it then follows its nearest\n * scrolling ancestor.\n *\n * Layout: three or four sitemap columns keep the grid whole. With three, the\n * back-to-top tile stands tall beside them; with four, it moves down beside\n * the status.\n *\n * The newsletter calls your `onSubscribe(email)`; resolve when the address\n * is stored, throw to show the error line. Nothing is sent anywhere else.\n * FOOTER_DEMO below is placeholder content, including a seeded, invented\n * uptime history: never ship it as your status.\n *\n * Needs Tailwind v4 (on v3.4, add the @tailwindcss/container-queries\n * plugin). No dependencies beyond React.\n */\n\nexport type FooterLink = { label: string; href: string };\nexport type FooterColumn = { title: string; links: FooterLink[] };\n/** One day of uptime. Pass them oldest first; the last day is today. */\nexport type UptimeDay = {\n  /** Percent, 0 to 100. */\n  uptime: number;\n  /** \"yyyy-mm-dd\". Without it the readout counts back from today (\"12 days ago\"). */\n  date?: string;\n  /** What happened that day, shown in the readout. */\n  note?: string;\n};\nexport type FooterStatus = {\n  label: string;\n  /** The headline figure. Defaults to the mean of `days`. */\n  value?: string;\n  caption?: string;\n  /** Makes the label a link to your status page. */\n  href?: string;\n  /** Colours the dot, today's bar and the headline figure. */\n  tone?: \"ok\" | \"busy\" | \"down\";\n  /** Up to 90 days, oldest first. From your status provider. */\n  days?: UptimeDay[];\n};\n\nexport type BentoFooterGridProps = {\n  brand: { name: string; pitch?: string; href?: string; mark?: ReactNode };\n  socials?: FooterLink[];\n  /** Three or four columns; up to five links fit a 1x2 tile. */\n  columns: FooterColumn[];\n  status?: FooterStatus;\n  newsletter?: {\n    title: string;\n    placeholder?: string;\n    cta?: string;\n    /** Store the address. Resolve on success; throw to show the error line. */\n    onSubscribe: (email: string) => Promise<void> | void;\n  };\n  legal?: { owner: string; year?: number; links?: FooterLink[] };\n  backToTop?: boolean;\n  /** Close the page with the brand name set huge, cropped and scroll-linked. */\n  wordmark?: boolean;\n  accent?: string;\n  /** \"page\" follows the window; \"self\" follows the nearest scrolling ancestor (a fixed-height frame). */\n  scroll?: \"page\" | \"self\";\n  className?: string;\n};\n\nconst MONO = \"var(--font-mono, var(--font-geist-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace))\";\nconst OUT = \"cubic-bezier(0.16, 1, 0.3, 1)\";\nconst SPRING = \"cubic-bezier(0.34, 1.25, 0.64, 1)\";\nconst TONES = { ok: \"#2bd576\", busy: \"#ffb020\", down: \"#ff5a5a\" };\nconst EMAIL = /^[^\\s@]+@[^\\s@.]+(?:\\.[^\\s@.]+)*\\.[^\\s@.]{2,}$/;\nconst MONTHS = [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n/** The wordmark's crop: where it starts as the tile arrives, and where it settles. */\nconst MARK_FROM = 64;\nconst MARK_TO = 18;\n\n// Today's heartbeat: steady, then one slow dip every 10 seconds, only while live.\nconst BFG_CSS =\n  \"@keyframes bfg-beat{0%,64%,100%{opacity:1}82%{opacity:.35}}\" +\n  \".bfg-beat{animation:bfg-beat 10s ease-in-out infinite;animation-play-state:paused}\" +\n  \"[data-bfg-live] .bfg-beat{animation-play-state:running}\" +\n  \"@media (prefers-reduced-motion:reduce){.bfg-beat{animation:none}}\";\n\n/** Allow relative paths, fragments, http(s), mailto and tel; anything else becomes \"#\". */\nfunction safeHref(href: string): string {\n  const v = href.replace(/[\\t\\n\\r]/g, \"\").trim();\n  if (v.indexOf(String.fromCharCode(92)) !== -1) return \"#\";\n  if (/^(https?:|mailto:|tel:)/i.test(v)) return v;\n  if (/^[/#?]/.test(v) && !/^\\/\\//.test(v)) return v;\n  return \"#\";\n}\n\n/** \"#rrggbb\" if valid, otherwise the fallback. Never interpolated unchecked. */\nfunction safeHex(hex: string | undefined, fallback: string): string {\n  return /^#[0-9a-f]{6}$/i.test(hex || \"\") ? (hex as string) : fallback;\n}\n\nfunction isLight(hex: string): boolean {\n  const n = parseInt(hex.slice(1), 16);\n  const c = [(n >> 16) & 255, (n >> 8) & 255, n & 255].map((v) => {\n    const s = v / 255;\n    return s <= 0.03928 ? s / 12.92 : Math.pow((s + 0.055) / 1.055, 2.4);\n  });\n  return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2] > 0.18;\n}\n\nfunction reduced(): boolean {\n  return window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n}\n\n/** The nearest ancestor that scrolls vertically, or null. */\nfunction scroller(el: HTMLElement): HTMLElement | null {\n  let p = el.parentElement;\n  while (p) {\n    const oy = getComputedStyle(p).overflowY;\n    if (oy === \"auto\" || oy === \"scroll\") return p;\n    p = p.parentElement;\n  }\n  return null;\n}\n\nfunction clampPct(v: number): number {\n  return Math.max(0, Math.min(100, Number.isFinite(v) ? v : 0));\n}\n\nfunction pct(v: number): string {\n  return (Math.floor(clampPct(v) * 100) / 100).toFixed(2) + \"%\";\n}\n\nfunction dayLabel(d: UptimeDay, i: number, n: number): string {\n  const m = d.date ? /^(\\d{4})-(\\d{2})-(\\d{2})/.exec(d.date) : null;\n  if (m && MONTHS[Number(m[2]) - 1]) return Number(m[3]) + \" \" + MONTHS[Number(m[2]) - 1];\n  const ago = n - 1 - i;\n  return ago === 0 ? \"Today\" : ago === 1 ? \"Yesterday\" : ago + \" days ago\";\n}\n\n/** A deterministic, invented uptime history (mulberry32), identical on server and client. */\nfunction seededUptime(seed: number, count = 90): UptimeDay[] {\n  let s = seed >>> 0;\n  const rnd = () => {\n    s = (s + 0x6d2b79f5) >>> 0;\n    let t = s;\n    t = Math.imul(t ^ (t >>> 15), t | 1);\n    t ^= t + Math.imul(t ^ (t >>> 7), t | 61);\n    return ((t ^ (t >>> 14)) >>> 0) / 4294967296;\n  };\n  const minor = [\"Cache restores slowed\", \"Build queue delayed\", \"Dashboard errors\", \"Webhook retries\"];\n  const major = [\"Remote cache unavailable\", \"Builds failing to start\"];\n  const days: UptimeDay[] = [];\n  for (let i = 0; i < count; i++) {\n    const r = rnd();\n    if (i < count - 1 && r > 0.985) days.push({ uptime: Math.round((97.6 + rnd() * 1.3) * 100) / 100, note: major[Math.floor(rnd() * major.length)] });\n    else if (i < count - 1 && r > 0.92) days.push({ uptime: Math.round((99.2 + rnd() * 0.75) * 100) / 100, note: minor[Math.floor(rnd() * minor.length)] });\n    else days.push({ uptime: 100 });\n  }\n  return days;\n}\n\n/**\n * DEMO CONTENT for Kiln, a fictional build tool. Every name, link and figure\n * here is a placeholder, and the 90-day uptime history is invented from a\n * seed: wire status.days to your status provider (or leave the strip out)\n * before the page goes live.\n */\nexport const FOOTER_DEMO: {\n  brand: BentoFooterGridProps[\"brand\"];\n  socials: FooterLink[];\n  columns: FooterColumn[];\n  status: FooterStatus & { days: UptimeDay[] };\n  newsletter: { title: string };\n  legal: { owner: string; year?: number; links: FooterLink[] };\n} = {\n  brand: { name: \"Kiln\", href: \"#\", pitch: \"Builds that remember. Kiln caches every step, so your CI only does the new work.\" },\n  socials: [\n    { label: \"GitHub\", href: \"#\" },\n    { label: \"X\", href: \"#\" },\n    { label: \"LinkedIn\", href: \"#\" },\n    { label: \"YouTube\", href: \"#\" },\n  ],\n  columns: [\n    {\n      title: \"Product\",\n      links: [\n        { label: \"Builds\", href: \"#\" },\n        { label: \"Branch previews\", href: \"#\" },\n        { label: \"Functions\", href: \"#\" },\n        { label: \"Storage\", href: \"#\" },\n        { label: \"Observability\", href: \"#\" },\n      ],\n    },\n    {\n      title: \"Developers\",\n      links: [\n        { label: \"Documentation\", href: \"#\" },\n        { label: \"API reference\", href: \"#\" },\n        { label: \"CLI\", href: \"#\" },\n        { label: \"Templates\", href: \"#\" },\n        { label: \"Changelog\", href: \"#\" },\n      ],\n    },\n    {\n      title: \"Company\",\n      links: [\n        { label: \"About\", href: \"#\" },\n        { label: \"Customers\", href: \"#\" },\n        { label: \"Careers\", href: \"#\" },\n        { label: \"Blog\", href: \"#\" },\n        { label: \"Contact\", href: \"#\" },\n      ],\n    },\n  ],\n  status: { label: \"Operational\", caption: \"Uptime, last 90 days\", tone: \"ok\", days: seededUptime(2609) },\n  newsletter: { title: \"The changelog, once a month. Nothing else.\" },\n  legal: {\n    owner: \"Kiln Labs\",\n    year: 2026,\n    links: [\n      { label: \"Privacy\", href: \"#\" },\n      { label: \"Terms\", href: \"#\" },\n      { label: \"Cookies\", href: \"#\" },\n      { label: \"Security\", href: \"#\" },\n    ],\n  },\n};\n\nconst HAIR: CSSProperties = { background: \"#0f1012\", boxShadow: \"inset 0 0 0 1px rgba(255,255,255,0.08)\" };\nconst LABEL = \"text-[11px] uppercase tracking-[0.12em] text-white/50\";\n// Focus rings as important utilities: hosts often ship an unlayered :focus-visible\n// rule (with its own radius) that would otherwise replace them. Colour is inline.\nconst RING = \"outline-none focus-visible:![outline-style:solid] focus-visible:![outline-width:2px]\";\nconst RING_C: CSSProperties = { outlineColor: \"rgba(255,255,255,0.8)\" };\nconst C4: Record<number, string> = {\n  1: \"@4xl:col-span-1\",\n  2: \"@4xl:col-span-2\",\n  3: \"@4xl:col-span-3\",\n  4: \"@4xl:col-span-4\",\n  5: \"@4xl:col-span-5\",\n  6: \"@4xl:col-span-6\",\n};\n\ntype Box = { x: number; y: number; w: number; h: number };\n\n/** Where an element sits in the grid's layout pixels, including any slide it is in the middle of. */\nfunction pos(el: HTMLElement, grid: HTMLElement): { x: number; y: number } {\n  let x = 0;\n  let y = 0;\n  for (let p: HTMLElement | null = el; p && p !== grid; p = p.offsetParent as HTMLElement | null) {\n    x += p.offsetLeft;\n    y += p.offsetTop;\n  }\n  const t = getComputedStyle(el).transform;\n  if (t && t !== \"none\") {\n    const m = new DOMMatrixReadOnly(t);\n    x += m.m41;\n    y += m.m42;\n  }\n  return { x, y };\n}\n\n/** A tile with a skin is measured by its skin, which may be mid-stretch. */\nfunction box(el: HTMLElement, grid: HTMLElement): Box {\n  const p = pos(el, grid);\n  const skin = el.querySelector<HTMLElement>(\":scope > [data-skin]\");\n  if (skin) return { x: p.x + skin.offsetLeft, y: p.y + skin.offsetTop, w: skin.offsetWidth, h: skin.offsetHeight };\n  return { x: p.x, y: p.y, w: el.offsetWidth, h: el.offsetHeight };\n}\n\nfunction Lights() {\n  return (\n    <>\n      <span\n        aria-hidden\n        className=\"pointer-events-none absolute inset-0 rounded-[20px] transition-opacity duration-200\"\n        style={{\n          opacity: \"var(--bfg-o, 0)\",\n          padding: 1,\n          background: \"radial-gradient(180px circle at var(--bfg-x, -999px) var(--bfg-y, -999px), rgba(255,255,255,0.7), rgba(255,255,255,0) 70%)\",\n          WebkitMask: \"linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0)\",\n          WebkitMaskComposite: \"xor\",\n          mask: \"linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0)\",\n        }}\n      />\n      <span\n        aria-hidden\n        className=\"pointer-events-none absolute inset-0 rounded-[20px] transition-opacity duration-200\"\n        style={{\n          opacity: \"var(--bfg-o, 0)\",\n          background: \"radial-gradient(260px circle at var(--bfg-x, -999px) var(--bfg-y, -999px), rgba(255,255,255,0.07), rgba(255,255,255,0) 70%)\",\n        }}\n      />\n    </>\n  );\n}\n\n/** The skin of a tile that changes size: painted apart from its content so a FLIP can stretch it. */\nfunction Skin() {\n  return (\n    <span data-skin aria-hidden className=\"pointer-events-none absolute left-0 top-0 h-full w-full overflow-hidden rounded-[20px]\" style={HAIR}>\n      <Lights />\n    </span>\n  );\n}\n\nfunction StatusTile({ status }: { status: FooterStatus }) {\n  const days = (status.days ?? []).slice(-90);\n  const n = days.length;\n  const tone = TONES[status.tone ?? \"ok\"];\n  const [at, setAt] = useState<number | null>(null);\n  const cur = at !== null && at < n ? at : null;\n  const value = status.value ?? (n ? pct(days.reduce((s, d) => s + clampPct(d.uptime), 0) / n) : \"\");\n  const read = (i: number) => {\n    const d = days[i];\n    return dayLabel(d, i, n) + \" · \" + pct(d.uptime) + (d.note ? \" · \" + d.note : \"\");\n  };\n  const readout = cur !== null ? read(cur) : (status.caption ?? \"\");\n\n  function fromPointer(e: ReactPointerEvent<HTMLDivElement>) {\n    const r = e.currentTarget.getBoundingClientRect();\n    setAt(Math.max(0, Math.min(n - 1, Math.floor(((e.clientX - r.left) / (r.width || 1)) * n))));\n  }\n  function onKey(e: ReactKeyboardEvent<HTMLDivElement>) {\n    const i = cur ?? n - 1;\n    const to =\n      e.key === \"ArrowLeft\" || e.key === \"ArrowDown\" ? i - 1\n      : e.key === \"ArrowRight\" || e.key === \"ArrowUp\" ? i + 1\n      : e.key === \"PageUp\" ? i - 7\n      : e.key === \"PageDown\" ? i + 7\n      : e.key === \"Home\" ? 0\n      : e.key === \"End\" ? n - 1\n      : null;\n    if (to === null) return;\n    e.preventDefault();\n    setAt(Math.max(0, Math.min(n - 1, to)));\n  }\n\n  const labelCls = \"flex min-w-0 items-center gap-2 \" + LABEL;\n  const labelInner = (\n    <>\n      <span aria-hidden className=\"size-1.5 shrink-0 rounded-full\" style={{ background: tone }} />\n      <span className=\"truncate\">{status.label}</span>\n    </>\n  );\n\n  return (\n    <div className=\"relative flex h-full flex-col justify-between gap-2 p-[14px]\">\n      <div className=\"flex items-start justify-between gap-3\">\n        {status.href ? (\n          <a\n            href={safeHref(status.href)}\n            className={labelCls + \" -m-1 rounded-[6px] p-1 transition-colors duration-200 hover:text-white motion-reduce:transition-none \" + RING + \" focus-visible:![outline-offset:0px] focus-visible:![border-radius:6px]\"}\n            style={{ fontFamily: MONO, ...RING_C }}\n          >\n            {labelInner}\n            <span aria-hidden>↗</span>\n          </a>\n        ) : (\n          <span className={labelCls} style={{ fontFamily: MONO }}>\n            {labelInner}\n          </span>\n        )}\n        {value && (\n          <span className=\"shrink-0 text-[26px] font-bold leading-none tracking-[-0.03em]\" style={{ color: tone, fontVariantNumeric: \"tabular-nums\" }}>\n            {value}\n          </span>\n        )}\n      </div>\n      {n > 0 && (\n        <div\n          role=\"slider\"\n          tabIndex={0}\n          aria-label={\"Uptime by day, last \" + n + \" days\"}\n          aria-valuemin={1}\n          aria-valuemax={n}\n          aria-valuenow={(cur ?? n - 1) + 1}\n          aria-valuetext={read(cur ?? n - 1)}\n          onPointerMove={fromPointer}\n          onPointerDown={fromPointer}\n          onPointerLeave={(e) => {\n            if (e.pointerType === \"mouse\") setAt(null);\n          }}\n          onFocus={(e) => {\n            if (e.currentTarget.matches(\":focus-visible\")) setAt((v) => v ?? n - 1);\n          }}\n          onBlur={() => setAt(null)}\n          onKeyDown={onKey}\n          className={\"relative -mx-1 flex h-7 touch-pan-y items-end gap-[2px] rounded-[6px] px-1 \" + RING + \" focus-visible:![outline-offset:2px] focus-visible:![border-radius:6px]\"}\n          style={RING_C}\n        >\n          {days.map((d, i) => {\n            const u = clampPct(d.uptime);\n            const today = i === n - 1;\n            const on = cur === i;\n            const h = u >= 99.995 ? 100 : u >= 99 ? 58 : 32;\n            return (\n              <span\n                key={i}\n                aria-hidden\n                className={\"min-w-0 flex-1 rounded-[1.5px]\" + (today ? \" bfg-beat\" : \"\")}\n                style={{\n                  height: (on ? 100 : h) + \"%\",\n                  background: today ? tone : \"#ffffff\",\n                  opacity: today ? 1 : on ? 0.95 : h === 100 ? 0.16 : 0.5,\n                  transition: \"opacity 150ms ease-out, height 200ms \" + OUT,\n                }}\n              />\n            );\n          })}\n        </div>\n      )}\n      <div className=\"flex items-baseline justify-between gap-3 text-[11px] leading-tight\" style={{ fontFamily: MONO }}>\n        <span className=\"min-w-0 truncate\" style={{ color: cur !== null ? \"rgba(255,255,255,0.8)\" : \"rgba(255,255,255,0.45)\" }}>\n          {readout}\n        </span>\n        {n > 0 && <span className=\"shrink-0 text-white/30\">Today</span>}\n      </div>\n    </div>\n  );\n}\n\nfunction Newsletter({\n  data,\n  tint,\n  ink,\n  wide,\n  onWide,\n}: {\n  data: NonNullable<BentoFooterGridProps[\"newsletter\"]>;\n  tint: string;\n  ink: string;\n  wide: boolean;\n  onWide: (next: boolean) => void;\n}) {\n  const id = useId();\n  const [email, setEmail] = useState(\"\");\n  const [state, setState] = useState<\"idle\" | \"busy\" | \"done\" | \"invalid\" | \"error\">(\"idle\");\n\n  async function submit(e: FormEvent) {\n    e.preventDefault();\n    const v = email.trim();\n    if (!EMAIL.test(v)) {\n      setState(\"invalid\");\n      return;\n    }\n    setState(\"busy\");\n    try {\n      await data.onSubscribe(v);\n      setState(\"done\");\n      onWide(false);\n    } catch {\n      setState(\"error\");\n    }\n  }\n\n  const message =\n    state === \"invalid\"\n      ? \"Enter a full email address, like name@company.com.\"\n      : state === \"error\"\n        ? \"That didn't go through. Try again in a moment.\"\n        : state === \"done\"\n          ? \"You're on the list. The next issue lands at the start of the month.\"\n          : \"\";\n\n  return (\n    <div\n      onFocus={() => onWide(true)}\n      onBlur={(e) => {\n        const to = e.relatedTarget as Node | null;\n        if (to && e.currentTarget.contains(to)) return;\n        if (!email.trim()) onWide(false);\n      }}\n      className={\"relative flex h-full flex-col justify-center gap-3 \" + (wide ? \"@4xl:flex-row @4xl:items-center @4xl:justify-between @4xl:gap-10\" : \"\")}\n    >\n      <p data-flip=\"nl-title\" className={\"relative text-[15px] font-semibold leading-snug text-white \" + (wide ? \"@4xl:max-w-[24ch]\" : \"\")}>\n        {data.title}\n      </p>\n      {state === \"done\" ? (\n        <p data-flip=\"nl-form\" className=\"relative flex items-center gap-2 text-[14px] text-white/80\" role=\"status\">\n          <svg aria-hidden width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" className=\"shrink-0\">\n            <path d=\"M2.5 7.5 5.5 10.5 11.5 3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n          </svg>\n          {message}\n        </p>\n      ) : (\n        <form data-flip=\"nl-form\" noValidate onSubmit={submit} className={\"relative flex w-full min-w-0 flex-col gap-1.5 \" + (wide ? \"@4xl:max-w-[520px]\" : \"\")}>\n          <div\n            className=\"flex h-11 min-w-0 items-center rounded-[14px] bg-[#131417] p-1 transition-shadow duration-200 focus-within:shadow-[inset_0_0_0_1px_rgba(255,255,255,0.4)]\"\n            style={{ boxShadow: state === \"invalid\" ? \"inset 0 0 0 1px rgba(255,90,90,0.7)\" : undefined }}\n          >\n            <label htmlFor={id} className=\"sr-only\">\n              Email address\n            </label>\n            <input\n              id={id}\n              type=\"email\"\n              maxLength={254}\n              inputMode=\"email\"\n              autoComplete=\"email\"\n              value={email}\n              onChange={(e) => {\n                setEmail(e.target.value);\n                if (state === \"invalid\" || state === \"error\") setState(\"idle\");\n              }}\n              placeholder={data.placeholder ?? \"you@company.com\"}\n              aria-invalid={state === \"invalid\"}\n              aria-describedby={id + \"-msg\"}\n              className=\"h-full min-w-0 flex-1 bg-transparent px-3 text-[14px] text-white outline-none placeholder:text-white/35 focus-visible:![outline:none]\"\n            />\n            <button\n              type=\"submit\"\n              disabled={state === \"busy\"}\n              className={\n                \"h-full shrink-0 rounded-[10px] px-4 text-[13px] font-semibold transition-[filter,opacity] duration-200 hover:brightness-110 disabled:opacity-60 motion-reduce:transition-none \" +\n                RING +\n                \" focus-visible:![outline-offset:2px] focus-visible:![border-radius:10px]\"\n              }\n              style={{ background: tint, color: ink, ...RING_C }}\n            >\n              {state === \"busy\" ? \"Joining…\" : (data.cta ?? \"Subscribe\")}\n            </button>\n          </div>\n          <p id={id + \"-msg\"} role=\"status\" className={\"text-[12px] \" + (state === \"invalid\" || state === \"error\" ? \"text-[#ff8a8a]\" : \"text-white/45\")}>\n            {message}\n          </p>\n        </form>\n      )}\n    </div>\n  );\n}\n\nexport function BentoFooterGrid({\n  brand,\n  socials,\n  columns,\n  status,\n  newsletter,\n  legal,\n  backToTop = true,\n  wordmark = false,\n  accent,\n  scroll = \"page\",\n  className = \"\",\n}: BentoFooterGridProps) {\n  const tint = safeHex(accent, \"#ff5a1f\");\n  const ink = isLight(tint) ? \"#0b0b0c\" : \"#ffffff\";\n  const light = useRef({ x: 0, y: 0, raf: 0 });\n  const footRef = useRef<HTMLElement>(null);\n  const gridRef = useRef<HTMLUListElement>(null);\n  const snaps = useRef(new Map<string, Box>());\n  const [wide, setWide] = useState(false);\n  const year = legal?.year ?? new Date().getFullYear();\n\n  // Footprints. Three columns leave the back-to-top tile a tall 1x2 beside\n  // them; four send it down beside the status. The newsletter's row is\n  // [newsletter][status](top); expanded, the newsletter takes the row and the\n  // rest reflow beside the legal line below, so the grid keeps its rows.\n  const n = columns.length;\n  const topUp = backToTop && n <= 3;\n  const topRow = backToTop && n >= 4;\n  const canWide = !!(newsletter && status && legal);\n  const isWide = wide && canWide;\n  const stW = status ? (newsletter ? (topRow ? 2 : 3) : topRow ? 5 : 6) : 0;\n  const nlW = newsletter ? (status ? 3 : topRow ? 5 : 6) : 0;\n  const lgW = isWide ? 6 - stW - (topRow ? 1 : 0) : 6;\n  const topCls = (n % 2 ? \"row-span-2 \" : \"col-span-2 \") + (topUp ? \"@4xl:col-span-1 @4xl:row-span-2\" : \"@4xl:col-span-1 @4xl:row-span-1\");\n\n  useEffect(() => {\n    const l = light.current;\n    return () => cancelAnimationFrame(l.raf);\n  }, []);\n\n  // One light for the grid, coalesced to a write per animation frame.\n  function onMove(e: ReactPointerEvent<HTMLUListElement>) {\n    const grid = e.currentTarget;\n    const r = grid.getBoundingClientRect();\n    const k = grid.offsetWidth / (r.width || 1);\n    light.current.x = (e.clientX - r.left) * k;\n    light.current.y = (e.clientY - r.top) * k;\n    if (light.current.raf) return;\n    light.current.raf = requestAnimationFrame(() => {\n      light.current.raf = 0;\n      Array.from(grid.children).forEach((c) => {\n        const el = c as HTMLElement;\n        el.style.setProperty(\"--bfg-x\", (light.current.x - el.offsetLeft).toFixed(1) + \"px\");\n        el.style.setProperty(\"--bfg-y\", (light.current.y - el.offsetTop).toFixed(1) + \"px\");\n      });\n      grid.style.setProperty(\"--bfg-o\", \"1\");\n    });\n  }\n\n  // ---- FLIP: the newsletter's expand and its neighbours' reflow -----------\n\n  function expand(next: boolean) {\n    const grid = gridRef.current;\n    if (!canWide || next === wide || !grid) return;\n    grid.querySelectorAll<HTMLElement>(\"[data-flip]\").forEach((el) => snaps.current.set(el.getAttribute(\"data-flip\") as string, box(el, grid)));\n    setWide(next);\n  }\n\n  useLayoutEffect(() => {\n    const grid = gridRef.current;\n    if (!grid || snaps.current.size === 0) return;\n    const reduce = reduced();\n    const duration = wide ? 380 : 300;\n    const easing = wide ? SPRING : OUT;\n    const all = Array.from(grid.querySelectorAll<HTMLElement>(\"[data-flip]\"));\n    // Settle everything first, so every \"now\" is measured at rest.\n    all.forEach((el) => {\n      el.getAnimations().forEach((a) => a.cancel());\n      el.querySelector<HTMLElement>(\":scope > [data-skin]\")?.getAnimations().forEach((a) => a.cancel());\n    });\n    all.forEach((el) => {\n      const prev = snaps.current.get(el.getAttribute(\"data-flip\") as string);\n      if (!prev || reduce) return;\n      const skin = el.querySelector<HTMLElement>(\":scope > [data-skin]\");\n      const now = box(el, grid);\n      if (skin) {\n        // A tile that changes place or size keeps its content in flow and\n        // stretches its skin from the old rectangle to the new one; its inner\n        // parts slide on their own.\n        if (Math.abs(prev.x - now.x) + Math.abs(prev.y - now.y) + Math.abs(prev.w - now.w) + Math.abs(prev.h - now.h) < 1) return;\n        const at = pos(el, grid);\n        skin.animate(\n          [\n            { left: prev.x - at.x + \"px\", top: prev.y - at.y + \"px\", width: prev.w + \"px\", height: prev.h + \"px\" },\n            { left: \"0px\", top: \"0px\", width: now.w + \"px\", height: now.h + \"px\" },\n          ],\n          { duration, easing },\n        );\n        return;\n      }\n      const dx = prev.x - now.x;\n      const dy = prev.y - now.y;\n      if (Math.abs(dx) > 0.5 || Math.abs(dy) > 0.5) {\n        // A tile (or a part of one) that moves: it slides from where it was, above the rest.\n        el.animate(\n          [\n            { transform: \"translate(\" + dx + \"px,\" + dy + \"px)\", zIndex: 2 },\n            { transform: \"none\", zIndex: 2 },\n          ],\n          { duration, easing },\n        );\n      }\n    });\n    snaps.current.clear();\n  }, [wide]);\n\n  // ---- Scroll: the ring, the wordmark's crop and the heartbeat ------------\n  useEffect(() => {\n    const root = footRef.current;\n    if (!root) return;\n    const reduce = reduced();\n    const sc = scroll === \"self\" ? scroller(root) : null;\n    const ring = root.querySelector<SVGCircleElement>(\"[data-bfg-ring]\");\n    const read = root.querySelector<HTMLElement>(\"[data-bfg-pct]\");\n    const mark = root.querySelector<HTMLElement>(\"[data-bfg-mark]\");\n    let visible = false;\n    let raf = 0;\n    const paint = () => {\n      raf = 0;\n      const top = sc ? sc.scrollTop : window.scrollY;\n      const max = sc ? sc.scrollHeight - sc.clientHeight : document.documentElement.scrollHeight - window.innerHeight;\n      const p = max > 1 ? Math.max(0, Math.min(1, top / max)) : 1;\n      ring?.setAttribute(\"stroke-dashoffset\", (1 - p).toFixed(4));\n      if (read) read.textContent = Math.round(p * 100) + \"%\";\n      if (mark && mark.parentElement) {\n        let q = 1;\n        if (!reduce) {\n          // 0 as the wordmark's tile enters the bottom of the view, 1 once all of it is in.\n          const b = mark.parentElement.getBoundingClientRect();\n          const bottom = sc ? sc.getBoundingClientRect().bottom : window.innerHeight;\n          q = Math.max(0, Math.min(1, (bottom - b.top) / (b.height || 1)));\n        }\n        mark.style.transform = \"translateY(\" + (MARK_FROM + (MARK_TO - MARK_FROM) * q).toFixed(2) + \"%)\";\n      }\n    };\n    const onScroll = () => {\n      if (visible && !raf) raf = requestAnimationFrame(paint);\n    };\n    const io = new IntersectionObserver(\n      (es) => {\n        visible = es[es.length - 1].isIntersecting;\n        root.toggleAttribute(\"data-bfg-live\", visible && !reduce);\n        if (visible) onScroll();\n      },\n      { root: sc },\n    );\n    io.observe(root);\n    const target: HTMLElement | Window = sc ?? window;\n    target.addEventListener(\"scroll\", onScroll, { passive: true });\n    window.addEventListener(\"resize\", onScroll);\n    paint();\n    return () => {\n      cancelAnimationFrame(raf);\n      io.disconnect();\n      target.removeEventListener(\"scroll\", onScroll);\n      window.removeEventListener(\"resize\", onScroll);\n    };\n  }, [scroll, wordmark, backToTop]);\n\n  function toTop(e: ReactMouseEvent<HTMLButtonElement>) {\n    const behavior: ScrollBehavior = reduced() ? \"instant\" : \"smooth\";\n    const s = scroll === \"self\" ? scroller(e.currentTarget) : null;\n    if (s) s.scrollTo({ top: 0, behavior });\n    else window.scrollTo({ top: 0, behavior });\n  }\n\n  const tile = \"relative overflow-hidden rounded-[20px]\";\n\n  const topTile = backToTop && (\n    <li data-flip=\"top\" className={tile + \" \" + topCls} style={HAIR}>\n      <button\n        type=\"button\"\n        onClick={toTop}\n        className={\n          \"group absolute inset-px flex flex-col justify-between rounded-[19px] p-[15px] text-left transition-colors duration-200 hover:bg-[#16171a] motion-reduce:transition-none \" +\n          RING +\n          \" focus-visible:![outline-offset:-3px] focus-visible:![border-radius:19px]\"\n        }\n        style={RING_C}\n      >\n        <span className={LABEL} style={{ fontFamily: MONO }}>\n          Back to top\n        </span>\n        <span className=\"flex items-end justify-between gap-3\">\n          <span className=\"relative grid size-[52px] shrink-0 place-items-center\">\n            <svg aria-hidden viewBox=\"0 0 52 52\" className=\"absolute inset-0 size-full -rotate-90\">\n              <circle cx=\"26\" cy=\"26\" r=\"24.5\" fill=\"none\" stroke=\"rgba(255,255,255,0.1)\" strokeWidth=\"1.5\" />\n              <circle data-bfg-ring cx=\"26\" cy=\"26\" r=\"24.5\" fill=\"none\" stroke=\"rgba(255,255,255,0.85)\" strokeWidth=\"1.5\" pathLength={1} strokeDasharray=\"1 1\" strokeDashoffset=\"1\" />\n            </svg>\n            <span\n              aria-hidden\n              className=\"text-[20px] font-bold leading-none transition-transform duration-300 group-hover:-translate-y-1 motion-reduce:transition-none\"\n              style={{ transitionTimingFunction: OUT }}\n            >\n              ↑\n            </span>\n          </span>\n          <span data-bfg-pct aria-hidden className=\"text-[11px] text-white/45\" style={{ fontFamily: MONO, fontVariantNumeric: \"tabular-nums\" }} />\n        </span>\n      </button>\n      <Lights />\n    </li>\n  );\n\n  return (\n    <footer ref={footRef} className={\"@container relative w-full text-white \" + className} style={{ background: \"#08090a\" }}>\n      <style>{BFG_CSS}</style>\n      <div className=\"mx-auto max-w-[1180px] px-5 py-12 @3xl:px-12\">\n        <ul\n          ref={gridRef}\n          role=\"list\"\n          onPointerMove={onMove}\n          onPointerLeave={(e) => {\n            cancelAnimationFrame(light.current.raf);\n            light.current.raf = 0;\n            e.currentTarget.style.setProperty(\"--bfg-o\", \"0\");\n          }}\n          className=\"relative grid grid-cols-2 gap-3 @4xl:grid-cols-6\"\n          style={{ gridAutoRows: \"minmax(104px, auto)\", gridAutoFlow: \"dense\", \"--bfg-o\": \"0\" } as CSSProperties}\n        >\n          {/* The brand: the one 2x2. */}\n          <li className={tile + \" col-span-2 row-span-2 flex flex-col justify-between p-6\"} style={HAIR}>\n            <Lights />\n            <div className=\"relative\">\n              <a\n                href={safeHref(brand.href ?? \"/\")}\n                className={\"inline-flex items-center gap-2.5 rounded-[8px] text-[17px] font-semibold \" + RING + \" focus-visible:![outline-offset:3px] focus-visible:![border-radius:8px]\"}\n                style={RING_C}\n              >\n                {brand.mark ?? (\n                  <span aria-hidden className=\"grid size-7 place-items-center rounded-[8px] bg-white text-[13px] font-bold text-black\">\n                    {brand.name.slice(0, 1)}\n                  </span>\n                )}\n                {brand.name}\n              </a>\n              {brand.pitch && <p className=\"mt-3 max-w-[34ch] text-[15px] leading-snug text-white/60\">{brand.pitch}</p>}\n            </div>\n            {socials && socials.length > 0 && (\n              <ul role=\"list\" aria-label=\"Social\" className=\"relative mt-6 flex flex-wrap gap-2\">\n                {socials.map((s) => (\n                  <li key={s.label}>\n                    <a\n                      href={safeHref(s.href)}\n                      className={\n                        \"inline-flex h-8 items-center rounded-[10px] px-3 text-[12px] text-white/70 transition-colors duration-200 hover:bg-[#16171a] hover:text-white motion-reduce:transition-none \" +\n                        RING +\n                        \" focus-visible:![outline-offset:2px] focus-visible:![border-radius:10px]\"\n                      }\n                      style={{ boxShadow: \"inset 0 0 0 1px rgba(255,255,255,0.12)\", ...RING_C }}\n                    >\n                      {s.label}\n                    </a>\n                  </li>\n                ))}\n              </ul>\n            )}\n          </li>\n\n          {/* The sitemap: a 1x2 per column. */}\n          {columns.map((col) => (\n            <li key={col.title} className={tile + \" row-span-2 p-5\"} style={HAIR}>\n              <Lights />\n              <nav aria-label={col.title} className=\"relative\">\n                <p className={LABEL} style={{ fontFamily: MONO }}>\n                  {col.title}\n                </p>\n                <ul role=\"list\" className=\"mt-3 space-y-1\">\n                  {col.links.map((l) => (\n                    <li key={l.label}>\n                      <a\n                        href={safeHref(l.href)}\n                        className={\n                          \"-mx-1.5 inline-block rounded-[8px] px-1.5 py-0.5 text-[14px] text-white/65 transition-colors duration-200 hover:text-white motion-reduce:transition-none \" +\n                          RING +\n                          \" focus-visible:![outline-offset:0px] focus-visible:![border-radius:8px]\"\n                        }\n                        style={RING_C}\n                      >\n                        {l.label}\n                      </a>\n                    </li>\n                  ))}\n                </ul>\n              </nav>\n            </li>\n          ))}\n\n          {topUp && topTile}\n\n          {/* The newsletter: expands across its row while it has focus or an address. */}\n          {newsletter && (\n            <li data-flip=\"nl\" className={\"relative col-span-2 rounded-[20px] p-4 @4xl:px-5 \" + C4[isWide ? 6 : nlW]}>\n              <Skin />\n              <Newsletter data={newsletter} tint={tint} ink={ink} wide={isWide} onWide={expand} />\n            </li>\n          )}\n\n          {/* Status: the figure over 90 days of bars. */}\n          {status && (\n            <li data-flip=\"status\" className={tile + \" col-span-2 \" + C4[stW]} style={HAIR}>\n              <Lights />\n              <StatusTile status={status} />\n            </li>\n          )}\n\n          {topRow && topTile}\n\n          {/* The legal line: full width, or half beside the status while the newsletter is open. */}\n          {legal && (\n            <li data-flip=\"legal\" className={\"relative col-span-2 rounded-[20px] \" + C4[lgW]}>\n              <Skin />\n              <div className={\"relative flex h-full flex-col justify-center gap-3 p-5 \" + (isWide ? \"\" : \"@4xl:flex-row @4xl:items-center @4xl:justify-between\")}>\n                <p data-flip=\"legal-copy\" className=\"relative text-[12px] text-white/50\" style={{ fontFamily: MONO }}>\n                  {\"© \" + year + \" \" + legal.owner}\n                </p>\n                {legal.links && legal.links.length > 0 && (\n                  <ul data-flip=\"legal-links\" role=\"list\" className=\"relative flex flex-wrap gap-x-4 gap-y-1\">\n                    {legal.links.map((l) => (\n                      <li key={l.label}>\n                        <a\n                          href={safeHref(l.href)}\n                          className={\n                            \"rounded-[6px] text-[13px] text-white/60 transition-colors duration-200 hover:text-white motion-reduce:transition-none \" +\n                            RING +\n                            \" focus-visible:![outline-offset:2px] focus-visible:![border-radius:6px]\"\n                          }\n                          style={RING_C}\n                        >\n                          {l.label}\n                        </a>\n                      </li>\n                    ))}\n                  </ul>\n                )}\n              </div>\n            </li>\n          )}\n\n          {/* The wordmark: set huge, cropped by its tile, rising into the crop with scroll. */}\n          {wordmark && (\n            <li data-flip=\"mark\" aria-hidden className={tile + \" col-span-full @container\"} style={HAIR}>\n              <p\n                data-bfg-mark\n                className=\"select-none whitespace-nowrap px-[3cqw] font-bold leading-[0.8] tracking-[-0.06em] text-[#16171a] will-change-transform\"\n                style={{\n                  fontSize: \"min(\" + Math.min(40, 150 / Math.max(3, brand.name.length)).toFixed(1) + \"cqw, 420px)\",\n                  transform: \"translateY(\" + MARK_TO + \"%)\",\n                  marginTop: \"2cqw\",\n                }}\n              >\n                {brand.name}\n              </p>\n            </li>\n          )}\n        </ul>\n      </div>\n    </footer>\n  );\n}\n","type":"registry:component","target":"components/viberdy/bento-footer-grid.tsx"}],"meta":{"tier":"free","tags":["footer","bento","sitemap","newsletter","status","uptime","scroll progress","section"],"href":"https://viberdy.dev/library/bento-footer-grid","aiPrompt":"Create a React + Tailwind v4 client component, BentoFooterGrid: a site footer set as dark bento tiles whose tiles are live: a 90-day uptime strip you can read day by day, a back-to-top ring that fills with scroll progress, a newsletter tile that expands across its row with a FLIP reflow of its neighbours, and a cropped wordmark that rises into its crop with scroll.\n\nTypes (export them): FooterLink { label, href }; FooterColumn { title, links }; UptimeDay { uptime (0-100), date? (\"yyyy-mm-dd\"), note? }; FooterStatus { label, value? (defaults to the mean of days, floored to two decimals), caption?, href? (makes the label a link with ↗), tone: \"ok\" | \"busy\" | \"down\", days? (up to 90, oldest first, the last is today) }. Props: brand { name, pitch?, href?, mark? (default a 28px white rounded square with the first letter) }, socials?, columns (three or four), status?, newsletter? { title, placeholder?, cta?, onSubscribe(email) (resolve when stored, throw to show the error) }, legal? { owner, year? (default this year), links? }, backToTop (default true), wordmark (default false), accent (\"#rrggbb\", regex-validated, default #ff5a1f), scroll (\"page\" default: follow the window; \"self\": follow the nearest ancestor with overflow-y auto or scroll, for fixed-height frames), className. Sanitise hrefs: strip tabs and newlines, reject backslashes, allow http(s), mailto, tel and relative paths starting / # ? but not //.\n\nAlso export FOOTER_DEMO, the one content object for a fictional build tool (brand, socials, three columns, status with days, newsletter title, legal), with a doc comment saying every name, link and figure is a placeholder and the uptime history is invented from a seed and must never ship as a status. Generate the days with a deterministic mulberry32 generator (identical on server and client): mostly 100, about 7% minor incidents (99.2-99.95, with a short note), about 1.5% major (97.6-98.9), today always 100.\n\nKit tokens: canvas #08090a painted by the footer itself; tiles #0f1012 with an inset 1px hairline at white 0.08, radius 20; raised #16171a on hover; gap 12; grid-auto-rows minmax(104px, auto), dense; mono labels 11px uppercase +0.12em at 50% white; figures bold grotesque with tabular numbers; the subscribe button is the only accent (text dark or white by luminance); the status tone (ok #2bd576, busy #ffb020, down #ff5a5a) is semantic and confined to the dot, today's bar and the headline figure. Focus rings are important utilities (focus-visible:![outline-style:solid], ![outline-width:2px], a per-element ![outline-offset] and ![border-radius]) with the colour inline, so a host's unlayered :focus-visible rule cannot replace them.\n\nLayout: a <footer> that is a Tailwind @container, content max-width 1180px, a <ul role=\"list\"> grid of 2 columns, 6 at @4xl. The brand is the one 2x2 (mark and name as a link, the pitch, socials as hairline chips in a list labelled Social). Each column is a 1x2 tile with a <nav aria-label>. With three columns the back-to-top tile is a tall 1x2 beside them; with four it is a 1x1 in the next row. Then, in DOM order: the newsletter (3 wide), the status (3 wide, or 2 with four columns), back to top if it is in this row, the legal line (6 wide), the wordmark (full width). Use literal class maps for the container spans (@4xl:col-span-1 ... @4xl:col-span-6) so the classes exist in source.\n\nStatus tile: a top row with the dot and label (left) and the figure at 26px bold in the tone (right); a strip of one bar per day (flex, 2px gaps, 28px tall, bars end-aligned): full days full height at white 0.16, minor days 58% at 0.5, major days 32% at 0.5, today's bar in the tone with a class that runs a 10-second pulse (steady, one dip to 0.35 opacity near 82%), paused unless the footer carries data-bfg-live and off under reduced motion; a bottom row with the readout (the caption by default) and \"Today\" at the right. The strip is role=\"slider\" (tabIndex 0, valuemin 1, valuemax n, valuenow and valuetext naming the day): pointer position maps to a day (a hovered bar goes full height and bright), arrows, Page Up/Down (7 days), Home and End move it, keyboard focus starts at today, the readout shows \"12 days ago · 99.68% · Build queue delayed\" (or the date as \"12 Aug\"), and a mouse leaving clears it. touch-action pan-y.\n\nBack to top: a real button on a layer 1px inside the tile (hover #16171a), a mono label, a 52px SVG ring (track white 0.1, progress white 0.85, 1.5px, pathLength 1, dasharray 1 1, rotated -90deg) around a ↑ that rises 4px on hover, and a mono percentage. Progress = scrollTop / (scrollHeight - clientHeight) of the scroller; write the ring's stroke-dashoffset and the percentage directly on scroll (passive listener, coalesced to one animation frame, only while the footer is on screen per an IntersectionObserver whose root is the scroller). The click scrolls the scroller to the top with behavior \"smooth\", or \"instant\" under reduced motion (never \"auto\": hosts often set scroll-behavior smooth on html).\n\nWordmark: a full-width, aria-hidden tile (itself a container) with the brand name in bold at min(150 / max(3, name length) cqw capped at 40cqw, 420px), colour #16171a, leading 0.8, tracking -0.06em. It is scroll-linked: in the same scroll handler, q = (viewport bottom - tile top) / tile height clamped 0-1, and translateY goes from 64% (q 0) to 18% (q 1), so it rises into its crop as the footer arrives and sinks when you scroll back; fixed at 18% under reduced motion.\n\nNewsletter expand (FLIP): the newsletter tile and the legal tile paint a separate \"skin\" (absolute, left 0, top 0, 100% by 100%, radius 20, the tile surface and hairline, the pointer lights) so their content stays in flow. Focus anywhere in the newsletter sets wide; blur to outside it collapses only if the field is empty; a successful subscribe collapses it. Wide (only when newsletter, status and legal all exist): the newsletter spans 6 and lays out as a row (title max 24ch, form max 520px), the status drops to the next row and the legal line shrinks to share it (6 minus the status and any 1x1), stacked; so the rows never change count. Before changing state, record every [data-flip] element's box in grid coordinates (sum offsetLeft/Top up to the grid plus any in-flight transform; a skin tile is measured by its skin). In a layout effect, cancel running animations, then: a skin tile animates its skin's left, top, width and height from the old box (relative to its new position) to its new size; any other flip element (the status, back to top, the wordmark, and the inner title, form, copyright and links, which each carry data-flip) animates transform from the old offset to none with z-index 2. Opening uses 380ms on cubic-bezier(0.34,1.25,0.64,1), closing 300ms on cubic-bezier(0.16,1,0.3,1); nothing animates under reduced motion.\n\nNewsletter form: noValidate, a visually hidden label, an email input (type email, inputMode email, autoComplete email) and the submit inside a 44px field (#131417, radius 14, a white 0.4 inset ring on focus-within, red when invalid); states idle, busy (\"Joining…\", disabled), done (the form is replaced by a check and a role=\"status\" message), invalid and error, with messages in a role=\"status\" line referenced by aria-describedby and aria-invalid on the input.\n\nLight: on pointermove over the grid, coalesced to one write per animation frame, write each item's --bfg-x/--bfg-y (layout pixels via the rect-to-offsetWidth ratio, minus its offsets) and --bfg-o 1 on the grid (0 on leave); every tile has a ring of radial-gradient(180px circle, white 0.7 → transparent 70%) through a 1px padding mask (mask-composite exclude) and a glow of radial 260px white 0.07, both at opacity var(--bfg-o) with 200ms transitions.\n\nOutput one self-contained \"use client\" TSX file with no dependencies beyond React. Build strings with + rather than template literals.","license":"https://viberdy.dev/license"}}