{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-grid",
  "type": "registry:component",
  "title": "Hero Grid",
  "description": "A technical hero with a perspective grid floor running toward a glowing horizon, a headline that decodes into place and a copyable install command.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "hero",
    "hero",
    "grid",
    "developer",
    "terminal",
    "decode",
    "landing"
  ],
  "docs": "https://hyperblur.dev/effects/hero-grid",
  "files": [
    {
      "path": "registry/hyperblur/hero-grid.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/hero-grid.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HeroGridAction {\n  label: string;\n  href: string;\n}\n\nexport interface HeroGridStat {\n  value: string;\n  label: string;\n}\n\nexport interface HeroGridProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  command?: string;\n  primaryCta?: HeroGridAction | null;\n  secondaryCta?: HeroGridAction | null;\n  stats?: HeroGridStat[];\n  accent?: string;\n  headingAs?: \"h1\" | \"h2\";\n}\n\nconst css = `\n.hb-hrg {\n  --hb-hrg-accent: #2f7bff;\n  --hb-hrg-soft: color-mix(in srgb, var(--hb-hrg-accent) 55%, #ffffff);\n  position: relative;\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  width: 100%;\n  min-height: 600px;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #030304;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-hrg *, .hb-hrg *::before, .hb-hrg *::after { box-sizing: border-box; }\n.hb-hrg-bg {\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  overflow: hidden;\n  pointer-events: none;\n}\n.hb-hrg-bg::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background-image: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px);\n  background-size: 22px 22px;\n  -webkit-mask-image: radial-gradient(70% 55% at 50% 0%, #000 0%, transparent 80%);\n  mask-image: radial-gradient(70% 55% at 50% 0%, #000 0%, transparent 80%);\n}\n.hb-hrg-floor {\n  position: absolute;\n  left: -60%;\n  right: -60%;\n  bottom: 0;\n  height: 31%;\n  overflow: hidden;\n  perspective: 220px;\n  perspective-origin: 50% 0%;\n  -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 40%);\n  mask-image: linear-gradient(180deg, transparent 0%, #000 40%);\n}\n.hb-hrg-plane {\n  position: absolute;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  height: 320%;\n  transform-origin: 50% 100%;\n  transform: rotateX(76deg);\n  background-image:\n    linear-gradient(90deg, color-mix(in srgb, var(--hb-hrg-accent) 60%, transparent) 1px, transparent 1px),\n    linear-gradient(0deg, color-mix(in srgb, var(--hb-hrg-accent) 60%, transparent) 1px, transparent 1px);\n  background-size: 56px 56px;\n  background-position: center bottom;\n  opacity: .55;\n  animation: hb-hrg-run 2.2s linear infinite;\n  will-change: transform;\n}\n@keyframes hb-hrg-run {\n  from { transform: rotateX(76deg) translate3d(0, 0, 0); }\n  to { transform: rotateX(76deg) translate3d(0, 56px, 0); }\n}\n.hb-hrg-horizon {\n  position: absolute;\n  left: 0;\n  right: 0;\n  bottom: 31%;\n  height: 1px;\n  background: linear-gradient(90deg, transparent 5%, var(--hb-hrg-accent) 30%, #ffffff 50%, var(--hb-hrg-accent) 70%, transparent 95%);\n  opacity: .9;\n}\n.hb-hrg-glow {\n  position: absolute;\n  left: 50%;\n  bottom: 31%;\n  width: 90%;\n  height: 280px;\n  transform: translate(-50%, 50%);\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-hrg-accent) 42%, transparent), transparent);\n  animation: hb-hrg-pulse 6s ease-in-out infinite;\n}\n@keyframes hb-hrg-pulse {\n  0%, 100% { opacity: .75; }\n  50% { opacity: 1; }\n}\n.hb-hrg-sweep {\n  position: absolute;\n  left: 0;\n  right: 0;\n  bottom: calc(31% - 1px);\n  height: 3px;\n  background: linear-gradient(90deg, transparent, #ffffff, transparent);\n  background-size: 30% 100%;\n  background-repeat: no-repeat;\n  animation: hb-hrg-sweep 5s cubic-bezier(.6, 0, .4, 1) infinite;\n  filter: drop-shadow(0 0 6px var(--hb-hrg-accent));\n  opacity: .8;\n}\n@keyframes hb-hrg-sweep {\n  from { background-position: -40% 0; }\n  to { background-position: 140% 0; }\n}\n.hb-hrg-inner {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  width: 100%;\n  max-width: 1000px;\n  padding: clamp(56px, 8cqi, 84px) clamp(20px, 5cqi, 48px) clamp(48px, 6cqi, 64px);\n  text-align: center;\n}\n.hb-hrg-in {\n  animation: hb-hrg-up .7s cubic-bezier(.2, .7, .2, 1) both;\n  animation-delay: var(--hb-hrg-i, 0ms);\n}\n@keyframes hb-hrg-up {\n  from { opacity: 0; transform: translate3d(0, 12px, 0); }\n  to { opacity: 1; transform: none; }\n}\n.hb-hrg-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 10px;\n  max-width: 100%;\n  margin: 0;\n  padding: 6px 12px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 6px;\n  background: rgba(255, 255, 255, .03);\n  color: rgba(237, 237, 237, .7);\n  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n  font-size: 12px;\n  letter-spacing: .04em;\n  text-transform: uppercase;\n}\n.hb-hrg-eyebrow span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }\n.hb-hrg-dot {\n  flex: none;\n  width: 6px;\n  height: 6px;\n  border-radius: 50%;\n  background: #34d399;\n  box-shadow: 0 0 0 3px rgba(52, 211, 153, .18);\n}\n.hb-hrg-title {\n  max-width: 860px;\n  margin: 24px 0 0;\n  color: #f5f5f5;\n  font-size: clamp(34px, 6.8cqi, 72px);\n  font-weight: 650;\n  line-height: 1.03;\n  letter-spacing: -.045em;\n  text-wrap: balance;\n  animation: hb-hrg-fade .5s ease both;\n}\n@keyframes hb-hrg-fade {\n  from { opacity: 0; }\n  to { opacity: 1; }\n}\n.hb-hrg-wd { display: inline-block; white-space: nowrap; }\n.hb-hrg-ch { position: relative; display: inline-block; }\n.hb-hrg-ch[data-g] { color: transparent; }\n.hb-hrg-ch[data-g]::after {\n  content: attr(data-g);\n  position: absolute;\n  left: 50%;\n  top: 0;\n  transform: translateX(-50%);\n  color: var(--hb-hrg-soft);\n  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n  font-weight: 500;\n}\n.hb-hrg-sub {\n  max-width: 560px;\n  margin: 20px 0 0;\n  color: rgba(237, 237, 237, .6);\n  font-size: clamp(15px, 1.9cqi, 17px);\n  line-height: 1.6;\n  text-wrap: pretty;\n}\n.hb-hrg-actions {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: center;\n  justify-content: center;\n  gap: 10px;\n  margin-top: 30px;\n}\n.hb-hrg-term {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  height: 46px;\n  min-width: 0;\n  padding: 0 5px 0 16px;\n  border: 1px solid #262626;\n  border-radius: 10px;\n  background: rgba(10, 10, 12, .85);\n  box-shadow: 0 0 0 4px rgba(255, 255, 255, .02);\n  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n  font-size: 14px;\n}\n.hb-hrg-prompt { color: var(--hb-hrg-accent); user-select: none; }\n.hb-hrg-cmd {\n  min-width: 0;\n  overflow: hidden;\n  color: #ededed;\n  white-space: nowrap;\n  text-overflow: ellipsis;\n}\n.hb-hrg-caret {\n  flex: none;\n  width: 8px;\n  height: 16px;\n  margin-left: -4px;\n  background: var(--hb-hrg-soft);\n  animation: hb-hrg-blink 1.1s steps(1) infinite;\n}\n@keyframes hb-hrg-blink {\n  50% { opacity: 0; }\n}\n.hb-hrg-copy {\n  display: grid;\n  flex: none;\n  place-items: center;\n  width: 36px;\n  height: 36px;\n  margin-left: auto;\n  padding: 0;\n  border: 1px solid transparent;\n  border-radius: 7px;\n  background: transparent;\n  color: #a1a1a1;\n  cursor: pointer;\n  transition: background .15s ease, color .15s ease, border-color .15s ease;\n}\n.hb-hrg-copy:hover { background: rgba(255, 255, 255, .06); color: #ededed; border-color: rgba(255, 255, 255, .08); }\n.hb-hrg-copy:focus-visible { outline: 2px solid var(--hb-hrg-accent); outline-offset: 2px; }\n.hb-hrg-copy[data-done] { color: #34d399; }\n.hb-hrg-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  height: 46px;\n  padding: 0 20px;\n  border: 1px solid rgba(255, 255, 255, .14);\n  border-radius: 10px;\n  background: transparent;\n  color: #ededed;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 550;\n  line-height: 1;\n  text-decoration: none;\n  white-space: nowrap;\n  transition: background .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;\n}\n.hb-hrg-btn:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .26); }\n.hb-hrg-btn:active { transform: scale(.98); }\n.hb-hrg-btn:focus-visible { outline: 2px solid var(--hb-hrg-accent); outline-offset: 3px; }\n.hb-hrg-btn[data-primary] {\n  border-color: color-mix(in srgb, var(--hb-hrg-accent) 70%, #ffffff);\n  background: var(--hb-hrg-accent);\n  color: #ffffff;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 10px 30px -10px var(--hb-hrg-accent);\n}\n.hb-hrg-btn[data-primary]:hover { background: color-mix(in srgb, var(--hb-hrg-accent) 85%, #ffffff); }\n.hb-hrg-btn svg { flex: none; transition: transform .2s ease; }\n.hb-hrg-btn:hover svg { transform: translateX(2px); }\n.hb-hrg-stats {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  margin: 44px 0 0;\n  padding: 0;\n  list-style: none;\n  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;\n}\n.hb-hrg-stat {\n  display: flex;\n  flex-direction: column;\n  gap: 4px;\n  padding: 2px clamp(18px, 4cqi, 36px);\n  border-left: 1px solid rgba(255, 255, 255, .1);\n}\n.hb-hrg-stat:first-child { border-left: 0; }\n.hb-hrg-stat b { color: #f5f5f5; font-size: 20px; font-weight: 500; letter-spacing: -.02em; }\n.hb-hrg-stat span { color: #8f8f8f; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }\n.hb-hrg-mark {\n  position: absolute;\n  width: 11px;\n  height: 11px;\n  color: rgba(255, 255, 255, .28);\n}\n.hb-hrg-mark::before, .hb-hrg-mark::after {\n  content: \"\";\n  position: absolute;\n  background: currentColor;\n}\n.hb-hrg-mark::before { left: 5px; top: 0; width: 1px; height: 11px; }\n.hb-hrg-mark::after { left: 0; top: 5px; width: 11px; height: 1px; }\n.hb-hrg-sr {\n  position: absolute;\n  width: 1px;\n  height: 1px;\n  overflow: hidden;\n  clip: rect(0 0 0 0);\n  white-space: nowrap;\n}\n@container (max-width: 640px) {\n  .hb-hrg-actions { width: 100%; max-width: 420px; }\n  .hb-hrg-term { flex: 1 1 100%; }\n  .hb-hrg-btn { flex: 1 1 0; }\n  .hb-hrg-mark { display: none; }\n  .hb-hrg-stats { margin-top: 36px; }\n  .hb-hrg-stat b { font-size: 17px; }\n}\n@container (max-width: 520px) {\n  .hb-hrg-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }\n  .hb-hrg-stat { padding: 2px 8px; }\n  .hb-hrg-stat span { font-size: 10px; letter-spacing: .05em; }\n}\n@container (max-width: 400px) {\n  .hb-hrg-btn { flex: 1 1 100%; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-hrg-plane, .hb-hrg-glow, .hb-hrg-sweep, .hb-hrg-caret, .hb-hrg-in, .hb-hrg-title { animation: none; }\n  .hb-hrg-btn, .hb-hrg-copy, .hb-hrg-btn svg { transition: none; }\n}\n`;\n\nconst glyphs = \"ABCDEFGHJKLMNPQRSTUVWXYZ0123456789#%&*+=<>/\";\n\nfunction hash(n: number) {\n  let x = Math.imul(n + 1, 374761393);\n  x = Math.imul(x ^ (x >>> 13), 1274126177);\n  x ^= x >>> 16;\n  return x >>> 0;\n}\n\nconst defaultPrimary: HeroGridAction = { label: \"Get started\", href: \"#\" };\nconst defaultSecondary: HeroGridAction = { label: \"Read the docs\", href: \"#\" };\nconst defaultStats: HeroGridStat[] = [\n  { value: \"8 ms\", label: \"Cold start p50\" },\n  { value: \"310\", label: \"Edge cities\" },\n  { value: \"99.999%\", label: \"Uptime SLA\" },\n];\n\nfunction delay(ms: number) {\n  return { \"--hb-hrg-i\": `${ms}ms` } as React.CSSProperties;\n}\n\nexport function HeroGrid({\n  eyebrow = \"v4.2 · Edge runtime is now generally available\",\n  title = \"Deploy to the edge in a single command\",\n  subtitle = \"Relay builds, ships and scales your functions across 310 cities. Push to main and your API is live everywhere in under ten seconds.\",\n  command = \"npx shadcn@latest add https://hyperblur.dev/r/hero-grid.json\",\n  primaryCta = defaultPrimary,\n  secondaryCta = defaultSecondary,\n  stats = defaultStats,\n  accent = \"#2f7bff\",\n  headingAs = \"h1\",\n  className = \"\",\n  style,\n  ...rest\n}: HeroGridProps) {\n  const Heading = headingAs;\n  const vars = { \"--hb-hrg-accent\": accent, ...style } as React.CSSProperties;\n  const headingRef = React.useRef<HTMLHeadingElement>(null);\n  const frame = React.useRef(0);\n  const timer = React.useRef<ReturnType<typeof setTimeout> | undefined>(undefined);\n  const [copied, setCopied] = React.useState(false);\n\n  const decode = React.useCallback(() => {\n    const root = headingRef.current;\n    if (!root || frame.current) return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) return;\n    const chars = Array.from(root.querySelectorAll<HTMLElement>(\".hb-hrg-ch\"));\n    if (!chars.length) return;\n    const begin = performance.now();\n    const span = 1150;\n    const step = span / chars.length;\n    const tick = (now: number) => {\n      const elapsed = now - begin;\n      const round = Math.floor(elapsed / 48);\n      let pending = false;\n      chars.forEach((el, i) => {\n        const settle = 160 + i * step + (hash(i * 13) % 140);\n        if (elapsed >= settle) {\n          if (el.hasAttribute(\"data-g\")) el.removeAttribute(\"data-g\");\n        } else {\n          pending = true;\n          el.setAttribute(\"data-g\", glyphs[hash(i * 31 + round * 7) % glyphs.length]);\n        }\n      });\n      frame.current = pending ? requestAnimationFrame(tick) : 0;\n    };\n    frame.current = requestAnimationFrame(tick);\n  }, []);\n\n  React.useEffect(() => {\n    const root = headingRef.current;\n    decode();\n    return () => {\n      cancelAnimationFrame(frame.current);\n      frame.current = 0;\n      root?.querySelectorAll(\".hb-hrg-ch\").forEach((el) => el.removeAttribute(\"data-g\"));\n    };\n  }, [decode, title]);\n\n  React.useEffect(() => () => clearTimeout(timer.current), []);\n\n  const copy = () => {\n    const done = () => {\n      setCopied(true);\n      clearTimeout(timer.current);\n      timer.current = setTimeout(() => setCopied(false), 1600);\n    };\n    if (typeof navigator !== \"undefined\" && navigator.clipboard) navigator.clipboard.writeText(command).then(done, done);\n    else done();\n  };\n\n  const words = title.split(/\\s+/).filter(Boolean);\n\n  return (\n    <section className={`hb-hrg ${className}`} style={vars} {...rest}>\n      <style href=\"hb-hero-grid\" precedence=\"default\">{css}</style>\n      <div className=\"hb-hrg-bg\" aria-hidden=\"true\">\n        <div className=\"hb-hrg-glow\" />\n        <div className=\"hb-hrg-floor\">\n          <div className=\"hb-hrg-plane\" />\n        </div>\n        <div className=\"hb-hrg-horizon\" />\n        <div className=\"hb-hrg-sweep\" />\n      </div>\n      <div className=\"hb-hrg-inner\">\n        <i className=\"hb-hrg-mark\" style={{ left: 8, top: 24 }} aria-hidden=\"true\" />\n        <i className=\"hb-hrg-mark\" style={{ right: 8, top: 24 }} aria-hidden=\"true\" />\n        {eyebrow ? (\n          <p className=\"hb-hrg-eyebrow hb-hrg-in\" style={delay(0)}>\n            <i className=\"hb-hrg-dot\" aria-hidden=\"true\" />\n            <span>{eyebrow}</span>\n          </p>\n        ) : null}\n        <Heading ref={headingRef} className=\"hb-hrg-title\" onPointerEnter={decode}>\n          <span className=\"hb-hrg-sr\">{title}</span>\n          <span aria-hidden=\"true\">\n            {words.map((word, w) => (\n              <React.Fragment key={w}>\n                {w > 0 ? \" \" : null}\n                <span className=\"hb-hrg-wd\">\n                  {Array.from(word).map((char, c) => (\n                    <span key={c} className=\"hb-hrg-ch\">\n                      {char}\n                    </span>\n                  ))}\n                </span>\n              </React.Fragment>\n            ))}\n          </span>\n        </Heading>\n        {subtitle ? (\n          <p className=\"hb-hrg-sub hb-hrg-in\" style={delay(250)}>\n            {subtitle}\n          </p>\n        ) : null}\n        <div className=\"hb-hrg-actions hb-hrg-in\" style={delay(380)}>\n          {command ? (\n            <div className=\"hb-hrg-term\">\n              <span className=\"hb-hrg-prompt\" aria-hidden=\"true\">$</span>\n              <code className=\"hb-hrg-cmd\">{command}</code>\n              <span className=\"hb-hrg-caret\" aria-hidden=\"true\" />\n              <button type=\"button\" className=\"hb-hrg-copy\" onClick={copy} data-done={copied ? \"\" : undefined} aria-label={copied ? \"Copied\" : \"Copy command\"}>\n                {copied ? (\n                  <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <path d=\"M5 12.5l4.5 4.5L19 7.5\" />\n                  </svg>\n                ) : (\n                  <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.9\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <rect x=\"9\" y=\"9\" width=\"11\" height=\"11\" rx=\"2.5\" />\n                    <path d=\"M15 9V6.5A2.5 2.5 0 0 0 12.5 4h-6A2.5 2.5 0 0 0 4 6.5v6A2.5 2.5 0 0 0 6.5 15H9\" />\n                  </svg>\n                )}\n              </button>\n              <span className=\"hb-hrg-sr\" aria-live=\"polite\">{copied ? \"Command copied to clipboard\" : \"\"}</span>\n            </div>\n          ) : null}\n          {primaryCta ? (\n            <a className=\"hb-hrg-btn\" data-primary=\"\" href={primaryCta.href}>\n              {primaryCta.label}\n              <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                <path d=\"M5 12h14M13 6l6 6-6 6\" />\n              </svg>\n            </a>\n          ) : null}\n          {secondaryCta ? (\n            <a className=\"hb-hrg-btn\" href={secondaryCta.href}>\n              {secondaryCta.label}\n            </a>\n          ) : null}\n        </div>\n        {stats.length > 0 ? (\n          <ul className=\"hb-hrg-stats hb-hrg-in\" style={delay(520)}>\n            {stats.map((stat) => (\n              <li key={stat.label} className=\"hb-hrg-stat\">\n                <b>{stat.value}</b>\n                <span>{stat.label}</span>\n              </li>\n            ))}\n          </ul>\n        ) : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}