{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "footer-newsletter-groups",
  "type": "registry:component",
  "title": "Footer Newsletter Groups",
  "description": "A footer led by a gridded newsletter card with a send button that morphs into a drawn check and a reader count that rolls up. Each link column has a highlight that glides between links, and the columns fold into accordions on narrow containers.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "footer",
    "footer",
    "newsletter",
    "links",
    "accordion",
    "form",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/footer-newsletter-groups",
  "files": [
    {
      "path": "registry/hyperblur/footer-newsletter-groups.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/footer-newsletter-groups.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface FooterNewsletterGroupsLink {\n  label: string;\n  href: string;\n  badge?: string;\n}\n\nexport interface FooterNewsletterGroupsGroup {\n  title: string;\n  links: FooterNewsletterGroupsLink[];\n}\n\nexport interface FooterNewsletterGroupsProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\" | \"onSubmit\"> {\n  brand?: string;\n  title?: string;\n  subtitle?: string;\n  placeholder?: string;\n  buttonLabel?: string;\n  successMessage?: string;\n  subscribers?: number;\n  groups?: FooterNewsletterGroupsGroup[];\n  copyright?: string;\n  region?: string;\n  onSubmit?: (email: string) => void | Promise<void>;\n  accent?: string;\n}\n\nconst css = `\n.hb-wc2 {\n  --hb-wc2-accent: #10b981;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-wc2 *, .hb-wc2 *::before, .hb-wc2 *::after { box-sizing: border-box; }\n.hb-wc2-inner { max-width: 1160px; margin: 0 auto; padding: 56px 20px 28px; }\n.hb-wc2-news {\n  position: relative;\n  display: grid;\n  gap: 24px;\n  padding: 28px 22px;\n  border: 1px solid rgba(255, 255, 255, .08);\n  border-radius: 22px;\n  overflow: hidden;\n  background:\n    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--hb-wc2-accent) 16%, transparent), transparent 55%),\n    linear-gradient(180deg, #131313, #0e0e0e);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 30px 80px -40px rgba(0, 0, 0, .8);\n}\n.hb-wc2-news::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background-image: linear-gradient(rgba(255, 255, 255, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .035) 1px, transparent 1px);\n  background-size: 28px 28px;\n  mask-image: linear-gradient(90deg, transparent 30%, #000);\n  pointer-events: none;\n}\n.hb-wc2-copy { position: relative; z-index: 1; display: grid; gap: 10px; }\n.hb-wc2-kicker { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--hb-wc2-accent); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }\n.hb-wc2-kicker svg { width: 14px; height: 14px; }\n.hb-wc2-title { margin: 0; font-family: var(--font-grotesk), var(--font-sans), sans-serif; font-size: 28px; font-weight: 600; line-height: 1.1; letter-spacing: -.025em; }\n.hb-wc2-sub { margin: 0; max-width: 440px; color: #8f8f8f; font-size: 15px; line-height: 1.55; }\n.hb-wc2-form { position: relative; z-index: 1; display: grid; gap: 12px; align-content: center; }\n.hb-wc2-field {\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 6px;\n  padding: 6px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 14px;\n  background: rgba(0, 0, 0, .45);\n  transition: border-color .25s ease, box-shadow .25s ease;\n}\n.hb-wc2-field:focus-within { border-color: color-mix(in srgb, var(--hb-wc2-accent) 70%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--hb-wc2-accent) 18%, transparent); }\n.hb-wc2-field[data-error=\"true\"] { border-color: #f05252; animation: hb-wc2-shake .4s cubic-bezier(.36, .07, .19, .97); }\n.hb-wc2-input { flex: 1; min-width: 0; height: 40px; padding: 0 10px; border: 0; background: transparent; color: #ededed; font: inherit; font-size: 15px; outline: none; }\n.hb-wc2-input::placeholder { color: #5f5f5f; }\n.hb-wc2-btn {\n  position: relative;\n  display: inline-grid;\n  place-items: center;\n  flex: none;\n  height: 40px;\n  min-width: 40px;\n  padding: 0 18px;\n  border: 0;\n  border-radius: 10px;\n  background: var(--hb-wc2-accent);\n  color: #04140d;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 650;\n  cursor: pointer;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 8px 24px -8px var(--hb-wc2-accent);\n  transition: padding .45s cubic-bezier(.2, .9, .2, 1), filter .2s ease, transform .15s ease;\n}\n.hb-wc2-btn:hover { filter: brightness(1.08); }\n.hb-wc2-btn:active { transform: scale(.97); }\n.hb-wc2-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }\n.hb-wc2-btn[data-state=\"done\"] { padding: 0 11px; cursor: default; }\n.hb-wc2-btn[data-state=\"busy\"] { cursor: progress; }\n.hb-wc2-btn-label { transition: opacity .2s ease; }\n.hb-wc2-btn[data-state=\"done\"] .hb-wc2-btn-label, .hb-wc2-btn[data-state=\"busy\"] .hb-wc2-btn-label { opacity: 0; width: 0; overflow: hidden; }\n.hb-wc2-check { position: absolute; width: 18px; height: 18px; }\n.hb-wc2-check path { stroke-dasharray: 20; stroke-dashoffset: 20; }\n.hb-wc2-btn[data-state=\"done\"] .hb-wc2-check path { animation: hb-wc2-draw .5s .15s cubic-bezier(.65, 0, .35, 1) forwards; }\n.hb-wc2-spin { position: absolute; width: 16px; height: 16px; border: 2px solid rgba(4, 20, 13, .25); border-top-color: #04140d; border-radius: 50%; animation: hb-wc2-spin .7s linear infinite; }\n.hb-wc2-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; color: #7a7a7a; font-size: 13px; }\n.hb-wc2-faces { display: flex; }\n.hb-wc2-face { width: 22px; height: 22px; margin-left: -6px; border: 2px solid #111; border-radius: 50%; }\n.hb-wc2-face:first-child { margin-left: 0; }\n.hb-wc2-count { display: inline-flex; overflow: hidden; height: 1.3em; color: #ededed; font-variant-numeric: tabular-nums; font-weight: 600; }\n.hb-wc2-digit { display: inline-block; animation: hb-wc2-roll .5s cubic-bezier(.2, .9, .2, 1.2); }\n.hb-wc2-ok { color: var(--hb-wc2-accent); }\n.hb-wc2-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 40px; }\n.hb-wc2-group { border-bottom: 1px solid rgba(255, 255, 255, .07); }\n.hb-wc2-gh { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 2px; border: 0; background: none; color: #ededed; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }\n.hb-wc2-gh:focus-visible { outline: 2px solid var(--hb-wc2-accent); outline-offset: 2px; border-radius: 6px; }\n.hb-wc2-gh svg { width: 14px; height: 14px; color: #6f6f6f; transition: transform .35s cubic-bezier(.3, 1.4, .5, 1); }\n.hb-wc2-group[data-open=\"true\"] .hb-wc2-gh svg { transform: rotate(45deg); color: var(--hb-wc2-accent); }\n.hb-wc2-gt { display: none; margin: 0 0 16px; color: #6f6f6f; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-wc2-wrap { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .4s cubic-bezier(.2, .8, .2, 1); }\n.hb-wc2-group[data-open=\"true\"] .hb-wc2-wrap { grid-template-rows: 1fr; }\n.hb-wc2-wrap > div { min-height: 0; overflow: hidden; }\n.hb-wc2-list { position: relative; display: grid; gap: 2px; margin: 0; padding: 0 0 14px; list-style: none; }\n.hb-wc2-marker {\n  position: absolute;\n  left: -10px;\n  right: -10px;\n  top: 0;\n  height: 34px;\n  border-radius: 9px;\n  background: linear-gradient(90deg, color-mix(in srgb, var(--hb-wc2-accent) 16%, transparent), rgba(255, 255, 255, .03));\n  box-shadow: inset 2px 0 0 var(--hb-wc2-accent);\n  opacity: 0;\n  transform: translateY(var(--hb-wc2-y, 0px));\n  transition: transform .35s cubic-bezier(.2, .9, .25, 1.1), opacity .2s ease;\n  pointer-events: none;\n}\n.hb-wc2-list[data-hover=\"true\"] .hb-wc2-marker { opacity: 1; }\n.hb-wc2-li { position: relative; }\n.hb-wc2-link { display: flex; align-items: center; gap: 8px; height: 34px; color: #a1a1a1; font-size: 14px; text-decoration: none; transition: color .2s ease, transform .3s cubic-bezier(.2, .9, .25, 1.1); }\n.hb-wc2-link:hover, .hb-wc2-link:focus-visible { color: #fff; transform: translateX(6px); }\n.hb-wc2-link:focus-visible { outline: none; }\n.hb-wc2-arrow { width: 12px; height: 12px; margin-left: auto; opacity: 0; transform: translateX(-6px); transition: opacity .2s ease, transform .3s cubic-bezier(.2, .9, .25, 1.1); color: var(--hb-wc2-accent); }\n.hb-wc2-link:hover .hb-wc2-arrow, .hb-wc2-link:focus-visible .hb-wc2-arrow { opacity: 1; transform: translateX(0); }\n.hb-wc2-badge { padding: 2px 7px; border-radius: 999px; background: color-mix(in srgb, var(--hb-wc2-accent) 18%, transparent); color: var(--hb-wc2-accent); font-size: 11px; font-weight: 650; }\n.hb-wc2-bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 32px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .07); color: #6f6f6f; font-size: 13px; }\n.hb-wc2-brand { display: inline-flex; align-items: center; gap: 10px; color: #ededed; font-weight: 650; font-size: 15px; }\n.hb-wc2-logo { width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 210deg, var(--hb-wc2-accent), #0a0a0a 60%, var(--hb-wc2-accent)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .15); }\n.hb-wc2-region { display: inline-flex; align-items: center; gap: 8px; }\n.hb-wc2-region svg { width: 14px; height: 14px; }\n@keyframes hb-wc2-draw { to { stroke-dashoffset: 0; } }\n@keyframes hb-wc2-spin { to { transform: rotate(360deg); } }\n@keyframes hb-wc2-roll { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }\n@keyframes hb-wc2-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }\n@container (min-width: 720px) {\n  .hb-wc2-inner { padding: 80px 40px 32px; }\n  .hb-wc2-news { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; padding: 40px; }\n  .hb-wc2-title { font-size: 34px; }\n  .hb-wc2-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px; margin-top: 56px; }\n  .hb-wc2-group { border: 0; }\n  .hb-wc2-gh { display: none; }\n  .hb-wc2-gt { display: block; }\n  .hb-wc2-wrap { grid-template-rows: 1fr; }\n  .hb-wc2-list { padding: 0; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wc2 *, .hb-wc2 *::before { animation: none !important; transition: none !important; }\n  .hb-wc2-check path { stroke-dashoffset: 0; }\n}\n`;\n\nconst defaultGroups: FooterNewsletterGroupsGroup[] = [\n  { title: \"Product\", links: [{ label: \"Field maps\", href: \"#\" }, { label: \"Crew scheduling\", href: \"#\" }, { label: \"Offline mode\", href: \"#\", badge: \"New\" }, { label: \"Pricing\", href: \"#\" }] },\n  { title: \"Solutions\", links: [{ label: \"Agriculture\", href: \"#\" }, { label: \"Forestry\", href: \"#\" }, { label: \"Utilities\", href: \"#\" }, { label: \"Survey teams\", href: \"#\" }] },\n  { title: \"Learn\", links: [{ label: \"Field Notes\", href: \"#\" }, { label: \"Guides\", href: \"#\" }, { label: \"Webinars\", href: \"#\" }, { label: \"API reference\", href: \"#\" }] },\n  { title: \"Company\", links: [{ label: \"About\", href: \"#\" }, { label: \"Careers\", href: \"#\", badge: \"6\" }, { label: \"Partners\", href: \"#\" }, { label: \"Contact\", href: \"#\" }] },\n];\n\nconst faces = [\"#10b981\", \"#f59e0b\", \"#6366f1\", \"#ec4899\"];\n\nexport function FooterNewsletterGroups({\n  brand = \"Terrain\",\n  title = \"Field Notes, every other Thursday.\",\n  subtitle = \"One email with what we shipped, a deep dive from a crew in the field, and nothing you will want to unsubscribe from.\",\n  placeholder = \"you@company.com\",\n  buttonLabel = \"Subscribe\",\n  successMessage = \"You are in. The next issue lands Thursday.\",\n  subscribers = 18240,\n  groups = defaultGroups,\n  copyright = \"© 2026 Terrain Systems\",\n  region = \"English, United States\",\n  onSubmit,\n  accent = \"#10b981\",\n  className = \"\",\n  style,\n  ...rest\n}: FooterNewsletterGroupsProps) {\n  const [email, setEmail] = React.useState(\"\");\n  const [state, setState] = React.useState<\"idle\" | \"busy\" | \"done\">(\"idle\");\n  const [error, setError] = React.useState(false);\n  const [count, setCount] = React.useState(subscribers);\n  const [open, setOpen] = React.useState<number | null>(0);\n  const [hover, setHover] = React.useState<number | null>(null);\n  const markers = React.useRef<(HTMLLIElement | null)[]>([]);\n  const id = React.useId();\n\n  const submit = async (e: React.FormEvent) => {\n    e.preventDefault();\n    if (state !== \"idle\") return;\n    if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)) {\n      setError(true);\n      return;\n    }\n    setError(false);\n    setState(\"busy\");\n    try {\n      await onSubmit?.(email);\n      await new Promise((r) => setTimeout(r, 600));\n      setState(\"done\");\n      setCount((c) => c + 1);\n    } catch {\n      setState(\"idle\");\n      setError(true);\n    }\n  };\n\n  const point = (g: number, li: HTMLLIElement) => {\n    const m = markers.current[g];\n    if (m) m.style.setProperty(\"--hb-wc2-y\", `${li.offsetTop}px`);\n    setHover(g);\n  };\n\n  const digits = count.toLocaleString(\"en-US\");\n  const vars = { \"--hb-wc2-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <footer className={`hb-wc2 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-footer-newsletter-groups\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wc2-inner\">\n        <div className=\"hb-wc2-news\">\n          <div className=\"hb-wc2-copy\">\n            <p className=\"hb-wc2-kicker\">\n              <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                <path d=\"M2 4.5h12v8H2zM2 4.5l6 4.5 6-4.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" />\n              </svg>\n              Newsletter\n            </p>\n            <h2 className=\"hb-wc2-title\">{title}</h2>\n            <p className=\"hb-wc2-sub\">{subtitle}</p>\n          </div>\n          <form className=\"hb-wc2-form\" onSubmit={submit} noValidate>\n            <div className=\"hb-wc2-field\" data-error={error ? \"true\" : \"false\"}>\n              <label htmlFor={`${id}-e`} style={{ position: \"absolute\", width: 1, height: 1, overflow: \"hidden\", clipPath: \"inset(50%)\" }}>Email address</label>\n              <input\n                id={`${id}-e`}\n                className=\"hb-wc2-input\"\n                type=\"email\"\n                value={email}\n                placeholder={placeholder}\n                disabled={state === \"done\"}\n                aria-invalid={error}\n                onChange={(e) => {\n                  setEmail(e.target.value);\n                  if (error) setError(false);\n                }}\n              />\n              <button className=\"hb-wc2-btn\" type=\"submit\" data-state={state} aria-label={state === \"done\" ? \"Subscribed\" : buttonLabel}>\n                <span className=\"hb-wc2-btn-label\">{buttonLabel}</span>\n                {state === \"busy\" ? <span className=\"hb-wc2-spin\" aria-hidden=\"true\" /> : null}\n                {state === \"done\" ? (\n                  <svg className=\"hb-wc2-check\" viewBox=\"0 0 18 18\" aria-hidden=\"true\">\n                    <path d=\"M3.5 9.5l3.5 3.5 7.5-8\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                  </svg>\n                ) : null}\n              </button>\n            </div>\n            <div className=\"hb-wc2-meta\" aria-live=\"polite\">\n              {state === \"done\" ? (\n                <span className=\"hb-wc2-ok\">{successMessage}</span>\n              ) : error ? (\n                <span style={{ color: \"#f87171\" }}>Enter a valid email address.</span>\n              ) : (\n                <>\n                  <span className=\"hb-wc2-faces\" aria-hidden=\"true\">\n                    {faces.map((f, i) => (\n                      <span key={f} className=\"hb-wc2-face\" style={{ background: `linear-gradient(135deg, ${f}, #1f1f1f)`, zIndex: 4 - i }} />\n                    ))}\n                  </span>\n                  <span>\n                    Read by{\" \"}\n                    <span className=\"hb-wc2-count\">\n                      {Array.from(digits).map((d, i) => (\n                        <span key={`${i}-${d}`} className=\"hb-wc2-digit\">{d}</span>\n                      ))}\n                    </span>{\" \"}\n                    field teams\n                  </span>\n                </>\n              )}\n            </div>\n          </form>\n        </div>\n        <nav className=\"hb-wc2-cols\" aria-label=\"Footer\">\n          {groups.map((g, gi) => (\n            <div key={g.title} className=\"hb-wc2-group\" data-open={open === gi ? \"true\" : \"false\"}>\n              <button className=\"hb-wc2-gh\" type=\"button\" aria-expanded={open === gi} aria-controls={`${id}-g${gi}`} onClick={() => setOpen((o) => (o === gi ? null : gi))}>\n                {g.title}\n                <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n                  <path d=\"M7 2v10M2 7h10\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" />\n                </svg>\n              </button>\n              <p className=\"hb-wc2-gt\">{g.title}</p>\n              <div className=\"hb-wc2-wrap\" id={`${id}-g${gi}`}>\n                <div>\n                  <ul className=\"hb-wc2-list\" data-hover={hover === gi ? \"true\" : \"false\"} onPointerLeave={() => setHover(null)} onBlur={() => setHover(null)}>\n                    <li\n                      className=\"hb-wc2-marker\"\n                      aria-hidden=\"true\"\n                      role=\"presentation\"\n                      ref={(el) => {\n                        markers.current[gi] = el;\n                      }}\n                    />\n                    {g.links.map((l) => (\n                      <li key={l.label} className=\"hb-wc2-li\" onPointerEnter={(e) => point(gi, e.currentTarget)} onFocus={(e) => point(gi, e.currentTarget)}>\n                        <a className=\"hb-wc2-link\" href={l.href}>\n                          {l.label}\n                          {l.badge ? <span className=\"hb-wc2-badge\">{l.badge}</span> : null}\n                          <svg className=\"hb-wc2-arrow\" viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n                            <path d=\"M2 6h7.5M6.5 3l3 3-3 3\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                          </svg>\n                        </a>\n                      </li>\n                    ))}\n                  </ul>\n                </div>\n              </div>\n            </div>\n          ))}\n        </nav>\n        <div className=\"hb-wc2-bottom\">\n          <span className=\"hb-wc2-brand\">\n            <span className=\"hb-wc2-logo\" aria-hidden=\"true\" />\n            {brand}\n          </span>\n          <span>{copyright}</span>\n          <span className=\"hb-wc2-region\">\n            <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n              <circle cx=\"8\" cy=\"8\" r=\"6\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n              <path d=\"M2 8h12M8 2c2 2 2 10 0 12M8 2c-2 2-2 10 0 12\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.3\" />\n            </svg>\n            {region}\n          </span>\n        </div>\n      </div>\n    </footer>\n  );\n}\n"
    }
  ]
}