{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-beams",
  "type": "registry:component",
  "title": "Hero Beams",
  "description": "Vertical light beams fall and fade toward a glowing horizon arc, under a headline that splits into red and cyan on hover. Three stats count up when the hero scrolls into view.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "hero",
    "hero",
    "beams",
    "horizon",
    "stats",
    "landing",
    "chromatic"
  ],
  "docs": "https://hyperblur.dev/effects/hero-beams",
  "files": [
    {
      "path": "registry/hyperblur/hero-beams.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/hero-beams.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HeroBeamsAction {\n  label: string;\n  href: string;\n}\n\nexport interface HeroBeamsStat {\n  value: number;\n  label: string;\n  decimals?: number;\n  prefix?: string;\n  suffix?: string;\n}\n\nexport interface HeroBeamsProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  primaryCta?: HeroBeamsAction | null;\n  secondaryCta?: HeroBeamsAction | null;\n  stats?: HeroBeamsStat[];\n  accent?: string;\n  beams?: number;\n  seed?: number;\n}\n\nconst css = `\n@keyframes hb-hrb-up {\n  from { opacity: 0; transform: translate3d(0, 16px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n@keyframes hb-hrb-fall {\n  0% { transform: translate3d(0, -100%, 0); opacity: 0; }\n  12% { opacity: var(--hb-hrb-o); }\n  80% { opacity: var(--hb-hrb-o); }\n  100% { transform: translate3d(0, 4%, 0); opacity: 0; }\n}\n@keyframes hb-hrb-breathe {\n  0%, 100% { opacity: .75; transform: translateX(-50%) scaleX(1); }\n  50% { opacity: 1; transform: translateX(-50%) scaleX(1.06); }\n}\n.hb-hrb {\n  --hb-hrb-accent: #2f7bff;\n  position: relative;\n  isolation: isolate;\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  width: 100%;\n  min-height: 560px;\n  overflow: hidden;\n  container-type: inline-size;\n  background: radial-gradient(70% 55% at 50% 0%, #10131c, #060608 70%);\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-hrb *, .hb-hrb *::before, .hb-hrb *::after { box-sizing: border-box; }\n.hb-hrb-stage {\n  position: absolute;\n  inset: 0;\n  z-index: -2;\n  pointer-events: none;\n  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 62%, transparent 86%);\n  mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 62%, transparent 86%);\n}\n.hb-hrb-rail {\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: var(--hb-hrb-x);\n  width: 1px;\n  background: linear-gradient(to bottom, transparent, rgba(255, 255, 255, .055) 25%, rgba(255, 255, 255, .055) 75%, transparent);\n}\n.hb-hrb-beam {\n  position: absolute;\n  top: 0;\n  left: var(--hb-hrb-x);\n  width: var(--hb-hrb-w, 1px);\n  height: 100%;\n  margin-left: calc(var(--hb-hrb-w, 1px) / -2 + .5px);\n  background: linear-gradient(to bottom, transparent calc(100% - var(--hb-hrb-len)), color-mix(in srgb, var(--hb-hrb-accent) 75%, transparent) calc(100% - 14px), #ffffff 100%);\n  opacity: 0;\n  animation: hb-hrb-fall var(--hb-hrb-d) cubic-bezier(.45, 0, .7, 1) var(--hb-hrb-dl) infinite;\n  will-change: transform, opacity;\n}\n.hb-hrb-beam::after {\n  content: \"\";\n  position: absolute;\n  bottom: -2px;\n  left: 50%;\n  width: 4px;\n  height: 4px;\n  border-radius: 50%;\n  background: #ffffff;\n  transform: translateX(-50%);\n  box-shadow: 0 0 8px 2px var(--hb-hrb-accent), 0 0 26px 6px color-mix(in srgb, var(--hb-hrb-accent) 45%, transparent);\n}\n.hb-hrb-glow {\n  position: absolute;\n  left: 50%;\n  bottom: 60px;\n  z-index: -1;\n  width: min(1100px, 120cqi);\n  height: 320px;\n  border-radius: 50%;\n  pointer-events: none;\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-hrb-accent) 34%, transparent), transparent);\n  filter: blur(10px);\n  transform: translateX(-50%);\n  animation: hb-hrb-breathe 6s ease-in-out infinite;\n}\n.hb-hrb-inner {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  width: 100%;\n  max-width: 1000px;\n  margin: 0 auto;\n  padding: 72px 24px 0;\n  text-align: center;\n}\n.hb-hrb-a {\n  animation: hb-hrb-up .8s cubic-bezier(.2, .8, .2, 1) both;\n  animation-delay: calc(var(--hb-hrb-i, 0) * 80ms);\n}\n.hb-hrb-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  max-width: 100%;\n  margin: 0 0 24px;\n  padding: 6px 14px;\n  border: 1px solid rgba(255, 255, 255, .1);\n  border-radius: 999px;\n  background: linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .02));\n  color: #c4c6cc;\n  font-size: 13px;\n  line-height: 18px;\n  backdrop-filter: blur(8px);\n}\n.hb-hrb-eyebrow span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-hrb-eyebrow svg { flex: none; color: color-mix(in srgb, var(--hb-hrb-accent) 50%, #ffffff); }\n.hb-hrb-title {\n  position: relative;\n  max-width: 880px;\n  margin: 0;\n  color: #f4f5f7;\n  font-size: clamp(34px, 7.2cqi, 72px);\n  font-weight: 700;\n  line-height: 1.04;\n  letter-spacing: -.04em;\n  text-wrap: balance;\n  cursor: default;\n}\n.hb-hrb-title::before,\n.hb-hrb-title::after {\n  content: attr(data-text);\n  position: absolute;\n  inset: 0;\n  pointer-events: none;\n  opacity: 0;\n  mix-blend-mode: screen;\n  transition: transform .35s cubic-bezier(.2, .8, .2, 1), opacity .35s ease;\n}\n.hb-hrb-title::before { color: #ff3d7f; }\n.hb-hrb-title::after { color: #33d6ff; }\n.hb-hrb-title:hover::before { opacity: .85; transform: translate3d(-2.5px, -1px, 0); }\n.hb-hrb-title:hover::after { opacity: .85; transform: translate3d(2.5px, 1px, 0); }\n.hb-hrb-sub {\n  max-width: 600px;\n  margin: 22px 0 0;\n  color: #9a9ca3;\n  font-size: clamp(16px, 1.95cqi, 18.5px);\n  line-height: 1.6;\n  text-wrap: pretty;\n}\n.hb-hrb-actions {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  gap: 12px;\n  margin-top: 32px;\n}\n.hb-hrb-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  min-height: 46px;\n  padding: 0 22px;\n  border: 1px solid rgba(255, 255, 255, .14);\n  border-radius: 999px;\n  background: rgba(10, 10, 14, .55);\n  color: #ededed;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 600;\n  line-height: 1;\n  text-decoration: none;\n  white-space: nowrap;\n  backdrop-filter: blur(8px);\n  transition: transform .2s ease, background-color .2s ease, border-color .2s ease, box-shadow .25s ease;\n}\n.hb-hrb-btn:hover { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .28); transform: translate3d(0, -1px, 0); }\n.hb-hrb-btn:active { transform: scale(.98); }\n.hb-hrb-btn:focus-visible { outline: 2px solid var(--hb-hrb-accent); outline-offset: 3px; }\n.hb-hrb-btn svg { transition: transform .2s ease; }\n.hb-hrb-btn:hover svg { transform: translate3d(3px, 0, 0); }\n.hb-hrb-btn[data-primary=\"true\"] {\n  border-color: transparent;\n  background: var(--hb-hrb-accent);\n  color: #ffffff;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 0 0 1px color-mix(in srgb, var(--hb-hrb-accent) 70%, #ffffff), 0 12px 36px -8px var(--hb-hrb-accent);\n}\n.hb-hrb-btn[data-primary=\"true\"]:hover {\n  background: color-mix(in srgb, var(--hb-hrb-accent) 86%, #ffffff);\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .32), 0 0 0 1px color-mix(in srgb, var(--hb-hrb-accent) 60%, #ffffff), 0 16px 44px -8px var(--hb-hrb-accent);\n}\n.hb-hrb-ground {\n  position: relative;\n  width: 100%;\n  margin-top: auto;\n  padding: 82px 24px 36px;\n}\n.hb-hrb-ground::before {\n  content: \"\";\n  position: absolute;\n  top: 48px;\n  left: 50%;\n  z-index: -1;\n  width: max(960px, 170cqi);\n  aspect-ratio: 1;\n  border-radius: 50%;\n  pointer-events: none;\n  background: radial-gradient(closest-side, #050507 92%, #08090d 100%);\n  transform: translateX(-50%);\n  box-shadow:\n    inset 0 1.5px 0 color-mix(in srgb, var(--hb-hrb-accent) 45%, #ffffff),\n    inset 0 22px 50px -24px color-mix(in srgb, var(--hb-hrb-accent) 70%, transparent),\n    0 -2px 14px color-mix(in srgb, var(--hb-hrb-accent) 65%, transparent),\n    0 -18px 70px color-mix(in srgb, var(--hb-hrb-accent) 40%, transparent);\n}\n.hb-hrb-stats {\n  display: grid;\n  grid-template-columns: repeat(3, minmax(0, 1fr));\n  max-width: 640px;\n  margin: 0 auto;\n  padding: 0;\n  list-style: none;\n}\n.hb-hrb-stat {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 6px;\n  min-width: 0;\n  padding: 0 12px;\n}\n.hb-hrb-stat + .hb-hrb-stat { border-left: 1px solid rgba(255, 255, 255, .08); }\n.hb-hrb-num {\n  color: #ffffff;\n  font-size: clamp(22px, 3cqi, 30px);\n  font-weight: 650;\n  line-height: 1.1;\n  letter-spacing: -.03em;\n  font-variant-numeric: tabular-nums;\n  white-space: nowrap;\n}\n.hb-hrb-num small {\n  margin-left: 1px;\n  color: color-mix(in srgb, var(--hb-hrb-accent) 45%, #ffffff);\n  font-size: .62em;\n  font-weight: 600;\n  letter-spacing: 0;\n}\n.hb-hrb-label {\n  overflow: hidden;\n  max-width: 100%;\n  color: #7d7f87;\n  font-size: 13px;\n  line-height: 1.3;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n}\n@container (max-width: 520px) {\n  .hb-hrb-inner { padding-top: 60px; padding-left: 20px; padding-right: 20px; }\n  .hb-hrb-actions { flex-direction: column; align-self: stretch; }\n  .hb-hrb-btn { width: 100%; }\n  .hb-hrb-ground { padding: 64px 12px 28px; }\n  .hb-hrb-ground::before { top: 36px; }\n  .hb-hrb-stat { padding: 0 6px; }\n  .hb-hrb-label { font-size: 11.5px; white-space: normal; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-hrb-a, .hb-hrb-glow { animation: none; }\n  .hb-hrb-beam { animation: none; opacity: var(--hb-hrb-o); transform: translate3d(0, var(--hb-hrb-rest), 0); }\n  .hb-hrb-title::before, .hb-hrb-title::after, .hb-hrb-btn, .hb-hrb-btn svg { transition: none; }\n  .hb-hrb-btn:hover, .hb-hrb-btn:hover svg { transform: none; }\n}\n`;\n\nconst defaultPrimary: HeroBeamsAction = { label: \"Deploy now\", href: \"#\" };\nconst defaultSecondary: HeroBeamsAction = { label: \"Talk to sales\", href: \"#\" };\nconst defaultStats: HeroBeamsStat[] = [\n  { value: 310, suffix: \"+\", label: \"Edge regions\" },\n  { value: 38, suffix: \"ms\", label: \"Median cold start\" },\n  { value: 99.99, decimals: 2, suffix: \"%\", label: \"Uptime, last 12 months\" },\n];\n\nfunction hash(seed: number, i: number) {\n  let x = (Math.imul(i + 1, 0x9e3779b1) ^ Math.imul((seed | 0) + 3, 0x85ebca6b)) >>> 0;\n  x = Math.imul((x >>> 16) ^ x, 0x45d9f3b) >>> 0;\n  x = Math.imul((x >>> 16) ^ x, 0x45d9f3b) >>> 0;\n  x = ((x >>> 16) ^ x) >>> 0;\n  return x / 4294967296;\n}\n\nfunction delay(index: number) {\n  return { \"--hb-hrb-i\": index } as React.CSSProperties;\n}\n\nfunction format(stat: HeroBeamsStat, value: number) {\n  const d = Math.max(0, Math.min(4, stat.decimals ?? 0));\n  return value.toLocaleString(\"en-US\", { minimumFractionDigits: d, maximumFractionDigits: d });\n}\n\nfunction HeroBeamsStats({ stats }: { stats: HeroBeamsStat[] }) {\n  const ref = React.useRef<HTMLUListElement>(null);\n  const [p, setP] = React.useState(0);\n\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    let raf = 0;\n    let begin = 0;\n    const duration = 1700;\n\n    function tick(now: number) {\n      if (!begin) begin = now;\n      const t = Math.min(1, (now - begin) / duration);\n      setP(1 - Math.pow(1 - t, 4));\n      if (t < 1) raf = requestAnimationFrame(tick);\n    }\n\n    const io = new IntersectionObserver(\n      (entries) => {\n        if (!entries[0]?.isIntersecting) return;\n        io.disconnect();\n        if (reduce) setP(1);\n        else raf = requestAnimationFrame(tick);\n      },\n      { threshold: 0.4 },\n    );\n    io.observe(el);\n    return () => {\n      io.disconnect();\n      if (raf) cancelAnimationFrame(raf);\n    };\n  }, []);\n\n  return (\n    <ul ref={ref} className=\"hb-hrb-stats\">\n      {stats.map((stat) => {\n        const final = `${stat.prefix ?? \"\"}${format(stat, stat.value)}${stat.suffix ?? \"\"}`;\n        return (\n          <li key={stat.label} className=\"hb-hrb-stat\">\n            <span className=\"hb-hrb-num\" aria-hidden=\"true\">\n              {stat.prefix ? <small>{stat.prefix}</small> : null}\n              {format(stat, stat.value * p)}\n              {stat.suffix ? <small>{stat.suffix}</small> : null}\n            </span>\n            <span className=\"hb-hrb-label\">\n              <span style={{ position: \"absolute\", width: 1, height: 1, overflow: \"hidden\", clip: \"rect(0 0 0 0)\" }}>{final} </span>\n              {stat.label}\n            </span>\n          </li>\n        );\n      })}\n    </ul>\n  );\n}\n\nexport function HeroBeams({\n  eyebrow = \"Relay 3.0 is here with streaming logs\",\n  title = \"Ship to the edge at the speed of light\",\n  subtitle = \"Deploy APIs and full-stack apps to every region in seconds, with preview URLs for every branch and instant rollbacks.\",\n  primaryCta = defaultPrimary,\n  secondaryCta = defaultSecondary,\n  stats = defaultStats,\n  accent = \"#2f7bff\",\n  beams = 18,\n  seed = 4,\n  className = \"\",\n  style,\n  ...rest\n}: HeroBeamsProps) {\n  const count = Math.max(0, Math.min(48, Math.floor(beams)));\n  const lanes = Array.from({ length: count }, (_, i) => {\n    const jitter = (hash(seed, i * 5 + 1) - 0.5) * (70 / Math.max(1, count));\n    const x = Math.min(98, Math.max(2, ((i + 0.5) / Math.max(1, count)) * 100 + jitter));\n    const center = 1 - Math.abs(x - 50) / 50;\n    return {\n      x: x.toFixed(2),\n      d: (3.6 + hash(seed, i * 5 + 2) * 4.2).toFixed(2),\n      dl: (-hash(seed, i * 5 + 3) * 8).toFixed(2),\n      len: Math.round(70 + hash(seed, i * 5 + 4) * 150),\n      o: (0.35 + center * 0.4 + hash(seed, i * 5 + 5) * 0.25).toFixed(2),\n      w: hash(seed, i * 5 + 6) > 0.72 ? 2 : 1,\n      rest: (-20 - hash(seed, i * 5 + 7) * 60).toFixed(1),\n    };\n  });\n\n  const vars = { \"--hb-hrb-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-hrb ${className}`} style={vars} {...rest}>\n      <style href=\"hb-hero-beams\" precedence=\"default\">{css}</style>\n      <div className=\"hb-hrb-stage\" aria-hidden=\"true\">\n        {lanes.map((lane, i) => (\n          <React.Fragment key={i}>\n            <span className=\"hb-hrb-rail\" style={{ \"--hb-hrb-x\": `${lane.x}%` } as React.CSSProperties} />\n            <span\n              className=\"hb-hrb-beam\"\n              style={\n                {\n                  \"--hb-hrb-x\": `${lane.x}%`,\n                  \"--hb-hrb-d\": `${lane.d}s`,\n                  \"--hb-hrb-dl\": `${lane.dl}s`,\n                  \"--hb-hrb-len\": `${lane.len}px`,\n                  \"--hb-hrb-o\": lane.o,\n                  \"--hb-hrb-w\": `${lane.w}px`,\n                  \"--hb-hrb-rest\": `${lane.rest}%`,\n                } as React.CSSProperties\n              }\n            />\n          </React.Fragment>\n        ))}\n      </div>\n      <div className=\"hb-hrb-glow\" aria-hidden=\"true\" />\n      <div className=\"hb-hrb-inner\">\n        {eyebrow ? (\n          <p className=\"hb-hrb-eyebrow hb-hrb-a\" style={delay(0)}>\n            <svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\">\n              <path d=\"M13.2 2.5 4.8 13.4a.6.6 0 0 0 .48.96H11l-1.2 7.1c-.1.58.64.9 1 .43l8.4-10.9a.6.6 0 0 0-.48-.96H13l1.2-7.1c.1-.58-.64-.9-1-.43z\" />\n            </svg>\n            <span>{eyebrow}</span>\n          </p>\n        ) : null}\n        <h1 className=\"hb-hrb-title hb-hrb-a\" style={delay(1)} data-text={title}>\n          {title}\n        </h1>\n        {subtitle ? (\n          <p className=\"hb-hrb-sub hb-hrb-a\" style={delay(2)}>\n            {subtitle}\n          </p>\n        ) : null}\n        {primaryCta || secondaryCta ? (\n          <div className=\"hb-hrb-actions hb-hrb-a\" style={delay(3)}>\n            {primaryCta ? (\n              <a className=\"hb-hrb-btn\" data-primary=\"true\" href={primaryCta.href}>\n                {primaryCta.label}\n                <svg width=\"16\" height=\"16\" 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-hrb-btn\" href={secondaryCta.href}>\n                {secondaryCta.label}\n              </a>\n            ) : null}\n          </div>\n        ) : null}\n      </div>\n      <div className=\"hb-hrb-ground\">\n        {stats.length > 0 ? <HeroBeamsStats stats={stats} /> : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}