{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-dot-orbit",
  "type": "registry:component",
  "title": "Hero Dot Orbit",
  "description": "Big atom on an indigo-to-electric-blue glow: dense glowing nucleus, tilted dotted orbit rings and bright cyan electrons with fading trails, centered text below, floating rectangular bar.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "hero",
    "hero",
    "atom",
    "orbit",
    "canvas",
    "science"
  ],
  "docs": "https://hyperblur.dev/effects/hero-dot-orbit",
  "files": [
    {
      "path": "registry/hyperblur/hero-dot-orbit.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/hero-dot-orbit.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HeroDotOrbitLink {\n  label: string;\n  href: string;\n}\n\nexport interface HeroDotOrbitProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  subtitle?: string;\n  caption?: string;\n  command?: string;\n  primaryCta?: HeroDotOrbitLink | null;\n  brand?: string;\n  nav?: HeroDotOrbitLink[];\n  navCta?: HeroDotOrbitLink | null;\n  learnMore?: HeroDotOrbitLink | null;\n  accent?: string;\n  density?: number;\n  speed?: number;\n  orbits?: number;\n  electrons?: number;\n  headingAs?: \"h1\" | \"h2\";\n  onSearch?: () => void;\n}\n\ntype HeroLink = HeroDotOrbitLink;\n\nconst css = `\n@keyframes hb-hh3-up {\n  from { opacity: 0; transform: translate3d(0, 14px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n.hb-hh3 {\n  --hb-hh3-accent: #22d3ee;\n  --hb-hh3-ink: #04122b;\n  --hb-hh3-fg: #eef2ff;\n  --hb-hh3-mute: rgba(199, 210, 254, .72);\n  --hb-hh3-line: rgba(165, 180, 252, .28);\n  --hb-hh3-panel: rgba(11, 16, 38, .6);\n  --hb-hh3-align: center;\n  --hb-hh3-mono: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);\n  position: relative;\n  isolation: isolate;\n  box-sizing: border-box;\n  display: flex;\n  flex-direction: column;\n  width: 100%;\n  min-height: 720px;\n  overflow: hidden;\n  container-type: inline-size;\n  background:\n    radial-gradient(62% 58% at 50% 38%, rgba(29, 59, 255, .78) 0%, rgba(25, 46, 200, .42) 42%, rgba(11, 16, 38, 0) 78%),\n    #0b1026;\n  color: var(--hb-hh3-fg);\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  -webkit-font-smoothing: antialiased;\n}\n.hb-hh3 *, .hb-hh3 *::before, .hb-hh3 *::after { box-sizing: border-box; }\n.hb-hh3-canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }\n.hb-hh3-bar {\n  position: relative; z-index: 3; display: flex; align-items: center; gap: 20px;\n  width: calc(100% - 32px); max-width: 1040px; margin: 16px auto 0; padding: 9px 10px 9px 18px;\n  border: 1px solid rgba(165, 180, 252, .22); border-radius: 8px;\n  background: rgba(11, 16, 38, .5); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);\n  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, .7);\n}\n.hb-hh3-brand { display: inline-flex; align-items: center; gap: 9px; color: #fff; font-size: 15px; font-weight: 700; letter-spacing: -.01em; text-decoration: none; }\n.hb-hh3-mark { flex: none; color: var(--hb-hh3-accent); }\n.hb-hh3-links { display: flex; align-items: center; justify-content: center; gap: 4px; flex: 1; margin: 0; padding: 0; list-style: none; }\n.hb-hh3-nav { flex: 1; }\n.hb-hh3-link { display: inline-flex; padding: 7px 12px; border-radius: 8px; color: rgba(224, 231, 255, .78); font-size: 13.5px; text-decoration: none; transition: color .2s ease, background-color .2s ease; }\n.hb-hh3-link:hover { color: #fff; background: rgba(255, 255, 255, .08); }\n.hb-hh3-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }\n.hb-hh3-search { display: inline-grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: rgba(224, 231, 255, .8); cursor: pointer; }\n.hb-hh3-search:hover { color: #fff; background: rgba(255, 255, 255, .1); }\n.hb-hh3-solid { display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: 8px; background: #fff; color: #0b1026; font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; transition: filter .2s ease; }\n.hb-hh3-solid:hover { filter: brightness(.92); }\n.hb-hh3-stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 340px; }\n.hb-hh3-copy {\n  position: relative; z-index: 2; margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 16px;\n  width: 100%; max-width: 760px; margin: 0 auto; padding: 0 28px 44px; text-align: center;\n}\n.hb-hh3-title {\n  max-width: 17em; margin: 0; color: #fff; font-size: clamp(28px, 4cqi, 54px); font-weight: 650; line-height: 1.05; letter-spacing: -.04em; text-wrap: balance;\n  text-shadow: 0 2px 28px rgba(5, 10, 40, .95), 0 0 6px rgba(5, 10, 40, .6);\n  animation: hb-hh3-up .8s cubic-bezier(.2, .7, .2, 1) both;\n}\n.hb-hh3-sub {\n  max-width: 38em; margin: 0; color: rgba(224, 231, 255, .86); font-size: 15.5px; line-height: 1.55; text-wrap: pretty;\n  text-shadow: 0 1px 18px rgba(5, 10, 40, .95);\n  animation: hb-hh3-up .8s .08s cubic-bezier(.2, .7, .2, 1) both;\n}\n.hb-hh3-side { animation: hb-hh3-up .8s .16s cubic-bezier(.2, .7, .2, 1) both; }\n.hb-hh3-more { color: var(--hb-hh3-accent); font-size: 14px; font-weight: 600; text-decoration: none; }\n.hb-hh3-more:hover { text-decoration: underline; text-underline-offset: 5px; }\n.hb-hh3-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; align-items: var(--hb-hh3-align, flex-start); }\n.hb-hh3-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; max-width: 100%; justify-content: var(--hb-hh3-align, flex-start); }\n.hb-hh3-cta {\n  display: inline-flex; flex: none; align-items: center; justify-content: center; gap: 6px;\n  height: 44px; padding: 0 16px 0 20px; border-radius: 8px;\n  background: var(--hb-hh3-accent); color: var(--hb-hh3-ink);\n  font-size: 14px; font-weight: 600; letter-spacing: -.01em; text-decoration: none; white-space: nowrap;\n  transition: filter .2s ease, transform .2s ease;\n}\n.hb-hh3-cta:hover { filter: brightness(1.08); }\n.hb-hh3-cta svg { transition: transform .2s ease; }\n.hb-hh3-cta:hover svg { transform: translateX(2px); }\n.hb-hh3-cmd {\n  display: flex; align-items: center; gap: 8px; min-width: 0; height: 44px; padding: 0 6px 0 14px;\n  border: 1px solid var(--hb-hh3-line); border-radius: 8px; background: var(--hb-hh3-panel);\n  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);\n}\n.hb-hh3-prompt { flex: none; color: var(--hb-hh3-accent); font-family: var(--hb-hh3-mono); font-size: 12px; }\n.hb-hh3-code { min-width: 0; overflow: hidden; color: var(--hb-hh3-fg); font-family: var(--hb-hh3-mono); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }\n.hb-hh3-copybtn {\n  display: inline-grid; flex: none; place-items: center; width: 30px; height: 30px; padding: 0;\n  border: 0; border-radius: 6px; background: transparent; color: var(--hb-hh3-mute); cursor: pointer;\n  transition: color .2s ease, background-color .2s ease;\n}\n.hb-hh3-copybtn:hover { color: var(--hb-hh3-fg); background: var(--hb-hh3-line); }\n.hb-hh3-copybtn[data-done=\"true\"] { color: var(--hb-hh3-accent); }\n.hb-hh3-caption { margin: 0; color: var(--hb-hh3-mute); font-family: var(--hb-hh3-mono); font-size: 11.5px; letter-spacing: .04em; }\n.hb-hh3-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n.hb-hh3 a:focus-visible, .hb-hh3 button:focus-visible { outline: 2px solid var(--hb-hh3-accent); outline-offset: 2px; }\n\n@container (max-width: 760px) {\n  .hb-hh3-copy { padding: 0 22px 36px; }\n}\n@container (max-width: 640px) {\n  .hb-hh3-links, .hb-hh3-solid { display: none; }\n  .hb-hh3-bar { padding: 8px 10px 8px 14px; }\n  .hb-hh3-stage { min-height: 96cqi; }\n  .hb-hh3-sub { font-size: 14.5px; }\n  .hb-hh3-side, .hb-hh3-row { align-self: stretch; }\n  .hb-hh3-row { flex-direction: column; }\n  .hb-hh3-cta { width: 100%; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-hh3-title, .hb-hh3-sub, .hb-hh3-side { animation: none; }\n  .hb-hh3-link, .hb-hh3-cta, .hb-hh3-cta svg, .hb-hh3-copybtn, .hb-hh3-solid { transition: none; }\n}\n`;\n\nconst defaultNav: HeroDotOrbitLink[] = [\n  { label: \"Platform\", href: \"#\" },\n  { label: \"Services\", href: \"#\" },\n  { label: \"Changelog\", href: \"#\" },\n];\nconst defaultNavCta: HeroDotOrbitLink = { label: \"Start free\", href: \"#\" };\nconst defaultPrimary: HeroDotOrbitLink = { label: \"Open the console\", href: \"#\" };\nconst defaultMore: HeroDotOrbitLink = { label: \"See how it works\", href: \"#\" };\n\nconst TAU = Math.PI * 2;\nconst GOLDEN = Math.PI * (3 - Math.sqrt(5));\n\nfunction hash(i: number, salt: number) {\n  let x = (Math.imul(i + 1, 0x9e3779b1) ^ Math.imul(salt + 11, 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 hexRgb(value: string): [number, number, number] | null {\n  const m = /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(value.trim());\n  if (!m) return null;\n  let h = m[1];\n  if (h.length === 3) h = h[0] + h[0] + h[1] + h[1] + h[2] + h[2];\n  const n = parseInt(h, 16);\n  return [(n >> 16) & 255, (n >> 8) & 255, n & 255];\n}\n\nfunction resolveRgb(value: string, ctx: CanvasRenderingContext2D, fallback: [number, number, number]): [number, number, number] {\n  const direct = hexRgb(value);\n  if (direct) return direct;\n  ctx.fillStyle = \"#000000\";\n  ctx.fillStyle = value;\n  const out = String(ctx.fillStyle);\n  const hex = hexRgb(out);\n  if (hex) return hex;\n  const nums = out.match(/[\\d.]+/g);\n  if (nums && nums.length >= 3) return [Number(nums[0]), Number(nums[1]), Number(nums[2])];\n  return fallback;\n}\n\nfunction inkFor(accent: string, dark: string) {\n  const rgb = hexRgb(accent);\n  if (!rgb) return dark;\n  const lum = (0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]) / 255;\n  return lum > 0.55 ? dark : \"#ffffff\";\n}\n\nfunction clampNum(v: number, lo: number, hi: number, fallback: number) {\n  if (!Number.isFinite(v)) return fallback;\n  return Math.min(hi, Math.max(lo, v));\n}\n\nfunction makeSprite(rgb: [number, number, number], size: number, core: number) {\n  const c = document.createElement(\"canvas\");\n  c.width = size;\n  c.height = size;\n  const g = c.getContext(\"2d\");\n  if (!g) return c;\n  const r = size / 2;\n  const grad = g.createRadialGradient(r, r, 0, r, r, r);\n  const mix = (v: number) => Math.round(v + (255 - v) * core);\n  grad.addColorStop(0, `rgba(${mix(rgb[0])}, ${mix(rgb[1])}, ${mix(rgb[2])}, 1)`);\n  grad.addColorStop(0.2, `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 0.9)`);\n  grad.addColorStop(0.5, `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 0.28)`);\n  grad.addColorStop(1, `rgba(${rgb[0]}, ${rgb[1]}, ${rgb[2]}, 0)`);\n  g.fillStyle = grad;\n  g.fillRect(0, 0, size, size);\n  return c;\n}\n\nfunction useCopy(command: string) {\n  const timerRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);\n  const [copied, setCopied] = React.useState(false);\n  React.useEffect(() => {\n    return () => {\n      if (timerRef.current) clearTimeout(timerRef.current);\n    };\n  }, []);\n  const copy = React.useCallback(() => {\n    navigator.clipboard?.writeText(command).catch(() => undefined);\n    setCopied(true);\n    if (timerRef.current) clearTimeout(timerRef.current);\n    timerRef.current = setTimeout(() => setCopied(false), 1600);\n  }, [command]);\n  return { copied, copy };\n}\n\nfunction SearchIcon() {\n  return (\n    <svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\">\n      <circle cx=\"11\" cy=\"11\" r=\"6.5\" />\n      <path d=\"M16 16l4.5 4.5\" />\n    </svg>\n  );\n}\n\nfunction Actions({\n  caption,\n  command,\n  primaryCta,\n  copied,\n  onCopy,\n}: {\n  caption: string;\n  command: string;\n  primaryCta: HeroLink | null;\n  copied: boolean;\n  onCopy: () => void;\n}) {\n  if (!caption && !command && !primaryCta) return null;\n  return (\n    <div className=\"hb-hh3-side\">\n      {command || primaryCta ? (\n        <div className=\"hb-hh3-row\">\n          {primaryCta ? (\n            <a className=\"hb-hh3-cta\" href={primaryCta.href}>\n              {primaryCta.label}\n              <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                <path d=\"M9 6l6 6-6 6\" />\n              </svg>\n            </a>\n          ) : null}\n          {command ? (\n            <div className=\"hb-hh3-cmd\">\n              <span className=\"hb-hh3-prompt\" aria-hidden=\"true\">$</span>\n              <code className=\"hb-hh3-code\">{command}</code>\n              <button type=\"button\" className=\"hb-hh3-copybtn\" data-done={copied} onClick={onCopy} aria-label={copied ? \"Copied\" : \"Copy command\"}>\n                {copied ? (\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 12.5l4.5 4.5L19 7.5\" />\n                  </svg>\n                ) : (\n                  <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.9\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                    <rect x=\"8.5\" y=\"8.5\" width=\"11\" height=\"11\" rx=\"2\" />\n                    <path d=\"M15.5 8.5V6.7a2.2 2.2 0 0 0-2.2-2.2H6.7a2.2 2.2 0 0 0-2.2 2.2v6.6a2.2 2.2 0 0 0 2.2 2.2h1.8\" />\n                  </svg>\n                )}\n                <span className=\"hb-hh3-sr\" aria-live=\"polite\">{copied ? \"Copied\" : \"\"}</span>\n              </button>\n            </div>\n          ) : null}\n        </div>\n      ) : null}\n      {caption ? <p className=\"hb-hh3-caption\">{caption}</p> : null}\n    </div>\n  );\n}\n\n\nfunction Mark() {\n  return (\n    <svg className=\"hb-hh3-mark\" width=\"22\" height=\"22\" viewBox=\"0 0 28 28\" fill=\"none\" aria-hidden=\"true\">\n      <circle cx=\"14\" cy=\"14\" r=\"3.4\" fill=\"currentColor\" />\n      <ellipse cx=\"14\" cy=\"14\" rx=\"12\" ry=\"4.6\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n      <ellipse cx=\"14\" cy=\"14\" rx=\"12\" ry=\"4.6\" stroke=\"currentColor\" strokeWidth=\"1.5\" transform=\"rotate(60 14 14)\" />\n      <ellipse cx=\"14\" cy=\"14\" rx=\"12\" ry=\"4.6\" stroke=\"currentColor\" strokeWidth=\"1.5\" transform=\"rotate(120 14 14)\" />\n    </svg>\n  );\n}\n\nexport function HeroDotOrbit({\n  title = \"A stable core with everything in orbit.\",\n  subtitle = \"One small, typed nucleus and every service moving around it at its own pace. Observable from the first request, and every line is yours to change.\",\n  caption = \"1 nucleus · 5 orbits · one canvas at 60 fps\",\n  command = \"npx shadcn@latest add https://hyperblur.dev/r/hero-dot-orbit.json\",\n  brand = \"Valence\",\n  accent = \"#22d3ee\",\n  primaryCta = defaultPrimary,\n  nav = defaultNav,\n  navCta = defaultNavCta,\n  learnMore = defaultMore,\n  density = 1,\n  speed = 1,\n  orbits = 5,\n  electrons = 1,\n  headingAs = \"h1\",\n  onSearch,\n  className = \"\",\n  style,\n  ...rest\n}: HeroDotOrbitProps) {\n  const rootRef = React.useRef<HTMLElement>(null);\n  const canvasRef = React.useRef<HTMLCanvasElement>(null);\n  const stageRef = React.useRef<HTMLDivElement>(null);\n  const { copied, copy } = useCopy(command);\n\n  React.useEffect(() => {\n    const root = rootRef.current;\n    const canvas = canvasRef.current;\n    const stage = stageRef.current;\n    const ctx = canvas?.getContext(\"2d\");\n    if (!root || !canvas || !stage || !ctx) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const mult = clampNum(density, 0.2, 2, 1);\n    const pace = clampNum(speed, 0, 4, 1);\n    const nOrb = Math.round(clampNum(orbits, 1, 9, 5));\n    const nEl = Math.round(clampNum(electrons, 1, 4, 1));\n    const perRing = Math.round(640 * mult);\n    const nNuc = Math.round(1200 * mult);\n    const nStars = 90;\n    const TRAIL = 26;\n\n    const oa = new Float32Array(nOrb);\n    const ob = new Float32Array(nOrb);\n    const oBeta = new Float32Array(nOrb);\n    const oTilt = new Float32Array(nOrb);\n    const oSpeed = new Float32Array(nOrb);\n    for (let k = 0; k < nOrb; k++) {\n      oa[k] = 0.82 + 0.18 * hash(k, 3);\n      ob[k] = oa[k] * (0.4 + 0.12 * hash(k, 4));\n      oBeta[k] = (k / nOrb) * Math.PI + 0.2;\n      oTilt[k] = 0.15 + 0.4 * hash(k, 5) + (k % 2) * 0.3;\n      oSpeed[k] = (0.55 + 0.35 * hash(k, 6)) * (k % 2 ? -1 : 1);\n    }\n    const rTh = new Float32Array(nOrb * perRing);\n    const rJ = new Float32Array(nOrb * perRing * 2);\n    const rS = new Float32Array(nOrb * perRing);\n    for (let k = 0; k < nOrb; k++) {\n      for (let j = 0; j < perRing; j++) {\n        const i = k * perRing + j;\n        rTh[i] = ((j + hash(i, 11) * 0.7) / perRing) * TAU;\n        rJ[i * 2] = (hash(i, 12) - 0.5) * 0.024;\n        rJ[i * 2 + 1] = (hash(i, 13) - 0.5) * 0.03;\n        rS[i] = 0.7 + hash(i, 14) * 0.7;\n      }\n    }\n    const nx = new Float32Array(nNuc);\n    const ny = new Float32Array(nNuc);\n    const nz = new Float32Array(nNuc);\n    const nc = new Uint8Array(nNuc);\n    const ns = new Float32Array(nNuc);\n    for (let i = 0; i < nNuc; i++) {\n      const y = 1 - (2 * (i + 0.5)) / nNuc;\n      const r = Math.sqrt(1 - y * y);\n      const th = i * GOLDEN;\n      const d = Math.cbrt(0.15 + 0.85 * hash(i, 21));\n      nx[i] = Math.cos(th) * r * d;\n      ny[i] = y * d;\n      nz[i] = Math.sin(th) * r * d;\n      nc[i] = hash(i, 22) < 0.45 ? 0 : hash(i, 22) < 0.8 ? 1 : 2;\n      ns[i] = 0.7 + hash(i, 23) * 0.6;\n    }\n\n    const acc = resolveRgb(accent, ctx, [34, 211, 238]);\n    const sprRing = makeSprite([150, 176, 255], 48, 0.45);\n    const sprCyan = makeSprite(acc, 64, 0.55);\n    const sprWhite = makeSprite([214, 228, 255], 48, 0.7);\n    const sprBlue = makeSprite([79, 123, 255], 48, 0.3);\n    const sprEl = makeSprite(acc, 96, 0.75);\n    const nucSprites = [sprWhite, sprCyan, sprBlue];\n\n    const total = nOrb * perRing;\n    const PX = new Float32Array(total);\n    const PY = new Float32Array(total);\n    const PZ = new Float32Array(total);\n    const PB = new Float32Array(total);\n    const NX = new Float32Array(nNuc);\n    const NY = new Float32Array(nNuc);\n    const NZ = new Float32Array(nNuc);\n\n    let w = 0;\n    let h = 0;\n    let dpr = 1;\n    let cx = 0;\n    let cy = 0;\n    let R = 200;\n    let unit = 1;\n    let visible = true;\n    let raf = 0;\n    let last = 0;\n    let time = reduce ? 4.5 : 0;\n\n    function layout() {\n      if (!root || !canvas || !stage) return;\n      const rect = root.getBoundingClientRect();\n      w = rect.width;\n      h = rect.height;\n      dpr = Math.min(2, window.devicePixelRatio || 1);\n      canvas.width = Math.max(1, Math.round(w * dpr));\n      canvas.height = Math.max(1, Math.round(h * dpr));\n      const st = stage.getBoundingClientRect();\n      const small = w < 640;\n      cx = w / 2;\n      if (small) {\n        R = Math.min(w * 0.56, st.height * 0.62);\n        cy = st.top - rect.top + st.height / 2;\n      } else {\n        R = Math.min(w * 0.42, h * 0.56);\n        cy = h * 0.4;\n      }\n      unit = Math.max(0.55, Math.min(1.6, R / 300));\n    }\n\n    function draw() {\n      if (!ctx || !w || !h) return;\n      ctx.setTransform(dpr, 0, 0, dpr, 0, 0);\n      ctx.clearRect(0, 0, w, h);\n      ctx.globalCompositeOperation = \"lighter\";\n      for (let k = 0; k < nStars; k++) {\n        const tw = reduce ? 0.6 : 0.5 + 0.5 * Math.sin(time * (0.6 + hash(k, 91)) + hash(k, 92) * TAU);\n        ctx.globalAlpha = 0.12 + 0.4 * tw * hash(k, 93);\n        const s = (2 + hash(k, 94) * 4) * unit;\n        ctx.drawImage(sprWhite, hash(k, 95) * w - s / 2, hash(k, 96) * h - s / 2, s, s);\n      }\n      const spin = time * 0.22 * pace;\n      const cS = Math.cos(spin);\n      const sS = Math.sin(spin);\n      const pitch = 0.3;\n      const cP = Math.cos(pitch);\n      const sP = Math.sin(pitch);\n      const roll = -0.32;\n      const cR = Math.cos(roll);\n      const sR = Math.sin(roll);\n\n      const glow = ctx.createRadialGradient(cx, cy, 0, cx, cy, R * 0.62);\n      glow.addColorStop(0, `rgba(${acc[0]}, ${acc[1]}, ${acc[2]}, .5)`);\n      glow.addColorStop(0.35, \"rgba(60, 100, 255, .26)\");\n      glow.addColorStop(1, \"rgba(29, 59, 255, 0)\");\n      ctx.globalAlpha = 1;\n      ctx.fillStyle = glow;\n      ctx.fillRect(cx - R, cy - R, R * 2, R * 2);\n\n      const elTh = new Float32Array(nOrb * nEl);\n      for (let k = 0; k < nOrb; k++) {\n        for (let e = 0; e < nEl; e++) {\n          elTh[k * nEl + e] = time * oSpeed[k] * pace * 0.9 + (e / nEl) * TAU + k * 1.3;\n        }\n      }\n\n      function place(k: number, th: number, jr: number, jy: number, out: number[]) {\n        const lx = Math.cos(th) * (oa[k] + jr);\n        const ly = Math.sin(th) * (ob[k] + jr);\n        const lz = jy;\n        const bc = Math.cos(oBeta[k]);\n        const bs = Math.sin(oBeta[k]);\n        const x1 = lx * bc - ly * bs;\n        const y1 = lx * bs + ly * bc;\n        const ct = Math.cos(oTilt[k]);\n        const st = Math.sin(oTilt[k]);\n        const y2 = y1 * ct - lz * st;\n        const z2 = y1 * st + lz * ct;\n        const x3 = x1 * cS + z2 * sS;\n        const z3 = -x1 * sS + z2 * cS;\n        const y4 = y2 * cP - z3 * sP;\n        const z4 = y2 * sP + z3 * cP;\n        const x5 = x3 * cR - y4 * sR;\n        const y5 = x3 * sR + y4 * cR;\n        const persp = 1 + z4 * 0.12;\n        out[0] = cx + x5 * R * persp;\n        out[1] = cy - y5 * R * persp;\n        out[2] = z4;\n      }\n      const tmp = [0, 0, 0];\n      for (let k = 0; k < nOrb; k++) {\n        for (let j = 0; j < perRing; j++) {\n          const i = k * perRing + j;\n          const th = rTh[i];\n          place(k, th, rJ[i * 2], rJ[i * 2 + 1], tmp);\n          PX[i] = tmp[0];\n          PY[i] = tmp[1];\n          PZ[i] = tmp[2];\n          let g = 0;\n          for (let e = 0; e < nEl; e++) {\n            const dir = oSpeed[k] > 0 ? 1 : -1;\n            let d = (elTh[k * nEl + e] - th) * dir;\n            d = d - Math.floor(d / TAU) * TAU;\n            if (d < 1.3) g = Math.max(g, (1 - d / 1.3) * (1 - d / 1.3));\n          }\n          PB[i] = g;\n        }\n      }\n      for (let pass = 0; pass < 2; pass++) {\n        for (let i = 0; i < total; i++) {\n          if ((PZ[i] >= 0 ? 1 : 0) !== pass) continue;\n          const front = 0.5 + 0.5 * PZ[i];\n          const b = 0.4 + 0.5 * front + PB[i] * 0.7;\n          ctx.globalAlpha = Math.min(1, b);\n          const s = (5 + 3 * front + PB[i] * 5) * unit * rS[i];\n          ctx.drawImage(PB[i] > 0.3 ? sprCyan : sprRing, PX[i] - s / 2, PY[i] - s / 2, s, s);\n        }\n        if (pass === 0) {\n          const beat = reduce ? 1 : 1 + 0.035 * Math.sin(time * 2.2);\n          const nr = R * 0.19 * beat;\n          const nspin = time * 0.5 * pace;\n          const cN = Math.cos(nspin);\n          const sN = Math.sin(nspin);\n          for (let i = 0; i < nNuc; i++) {\n            const x1 = nx[i] * cN + nz[i] * sN;\n            const z1 = -nx[i] * sN + nz[i] * cN;\n            const y2 = ny[i] * cP - z1 * sP;\n            const z2 = ny[i] * sP + z1 * cP;\n            const x3 = x1 * cR - y2 * sR;\n            const y3 = x1 * sR + y2 * cR;\n            NX[i] = cx + x3 * nr;\n            NY[i] = cy - y3 * nr;\n            NZ[i] = z2;\n          }\n          for (let i = 0; i < nNuc; i++) {\n            const f = 0.5 + 0.5 * NZ[i];\n            ctx.globalAlpha = 0.35 + 0.55 * f;\n            const s = (6 + 6 * f) * ns[i] * unit;\n            ctx.drawImage(nucSprites[nc[i]], NX[i] - s / 2, NY[i] - s / 2, s, s);\n          }\n        }\n      }\n      for (let k = 0; k < nOrb; k++) {\n        const dir = oSpeed[k] > 0 ? 1 : -1;\n        for (let e = 0; e < nEl; e++) {\n          const th0 = elTh[k * nEl + e];\n          for (let q = TRAIL; q >= 0; q--) {\n            const th = th0 - dir * q * 0.05;\n            place(k, th, 0, 0, tmp);\n            const f = 1 - q / TRAIL;\n            const depth = 0.55 + 0.45 * (0.5 + 0.5 * tmp[2]);\n            ctx.globalAlpha = (q === 0 ? 1 : f * f * 0.7) * depth;\n            const s = (q === 0 ? 24 : 5 + 14 * f) * unit * (0.8 + 0.3 * depth);\n            ctx.drawImage(q === 0 ? sprEl : sprCyan, tmp[0] - s / 2, tmp[1] - s / 2, s, s);\n          }\n        }\n      }\n      ctx.globalAlpha = 1;\n      ctx.globalCompositeOperation = \"source-over\";\n    }\n\n    function frame(now: number) {\n      raf = 0;\n      const step = last ? Math.min(0.05, (now - last) / 1000) : 0;\n      last = now;\n      time += step;\n      draw();\n      schedule();\n    }\n\n    function schedule() {\n      if (reduce || raf || !visible || document.hidden) return;\n      raf = requestAnimationFrame(frame);\n    }\n\n    function stop() {\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0;\n      last = 0;\n    }\n\n    function onVisibility() {\n      if (document.hidden) stop();\n      else schedule();\n    }\n\n    layout();\n    draw();\n    const ro = new ResizeObserver(() => {\n      layout();\n      draw();\n    });\n    ro.observe(root);\n    const io = new IntersectionObserver((entries) => {\n      visible = entries[0]?.isIntersecting ?? true;\n      if (visible) schedule();\n      else stop();\n    });\n    io.observe(root);\n    document.addEventListener(\"visibilitychange\", onVisibility);\n    schedule();\n\n    return () => {\n      stop();\n      ro.disconnect();\n      io.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVisibility);\n    };\n  }, [accent, density, speed, orbits, electrons]);\n\n  const Heading = headingAs;\n  const vars = { \"--hb-hh3-accent\": accent, \"--hb-hh3-ink\": inkFor(accent, \"#04122b\"), ...style } as React.CSSProperties;\n\n  return (\n    <section ref={rootRef} className={`hb-hh3 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-hero-dot-orbit\" precedence=\"default\">{css}</style>\n      <canvas ref={canvasRef} className=\"hb-hh3-canvas\" aria-hidden=\"true\" />\n      <header className=\"hb-hh3-bar\">\n        <a className=\"hb-hh3-brand\" href=\"#\">\n          <Mark />\n          <span>{brand}</span>\n        </a>\n        {nav.length ? (\n          <nav className=\"hb-hh3-nav\" aria-label=\"Primary\">\n            <ul className=\"hb-hh3-links\">\n              {nav.map((item) => (\n                <li key={item.label}>\n                  <a className=\"hb-hh3-link\" href={item.href}>\n                    {item.label}\n                  </a>\n                </li>\n              ))}\n            </ul>\n          </nav>\n        ) : (\n          <span style={{ flex: 1 }} />\n        )}\n        <div className=\"hb-hh3-tools\">\n          <button type=\"button\" className=\"hb-hh3-search\" aria-label=\"Search\" onClick={onSearch}>\n            <SearchIcon />\n          </button>\n          {navCta ? (\n            <a className=\"hb-hh3-solid\" href={navCta.href}>\n              {navCta.label}\n            </a>\n          ) : null}\n        </div>\n      </header>\n      <div ref={stageRef} className=\"hb-hh3-stage\" aria-hidden=\"true\" />\n      <div className=\"hb-hh3-copy\">\n        <Heading className=\"hb-hh3-title\">{title}</Heading>\n        {subtitle ? <p className=\"hb-hh3-sub\">{subtitle}</p> : null}\n        <Actions caption={caption} command={command} primaryCta={primaryCta} copied={copied} onCopy={copy} />\n        {learnMore ? (\n          <a className=\"hb-hh3-more\" href={learnMore.href}>\n            {learnMore.label}\n          </a>\n        ) : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}