{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-dot-dna",
  "type": "registry:component",
  "title": "Hero Dot DNA",
  "description": "Huge horizontal double helix running edge to edge over a deep teal gradient, slowly turning on its axis, with glowing mint and white dots, luminous rungs and pulses travelling left to right.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "hero",
    "hero",
    "dna",
    "helix",
    "canvas",
    "biotech"
  ],
  "docs": "https://hyperblur.dev/effects/hero-dot-dna",
  "files": [
    {
      "path": "registry/hyperblur/hero-dot-dna.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/hero-dot-dna.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HeroDotDnaLink {\n  label: string;\n  href: string;\n}\n\nexport interface HeroDotDnaProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  subtitle?: string;\n  caption?: string;\n  command?: string;\n  primaryCta?: HeroDotDnaLink | null;\n  brand?: string;\n  nav?: HeroDotDnaLink[];\n  navCta?: HeroDotDnaLink | null;\n  learnMore?: HeroDotDnaLink | null;\n  accent?: string;\n  density?: number;\n  speed?: number;\n  turns?: number;\n  pulses?: number;\n  headingAs?: \"h1\" | \"h2\";\n  onSearch?: () => void;\n  showBar?: boolean;\n}\n\ntype HeroLink = HeroDotDnaLink;\n\nconst css = `\n@keyframes hb-hh2-up {\n  from { opacity: 0; transform: translate3d(0, 14px, 0); }\n  to { opacity: 1; transform: translate3d(0, 0, 0); }\n}\n.hb-hh2 {\n  --hb-hh2-accent: #5eead4;\n  --hb-hh2-ink: #042f2e;\n  --hb-hh2-fg: #ecfdf5;\n  --hb-hh2-mute: rgba(204, 251, 241, .68);\n  --hb-hh2-line: rgba(204, 251, 241, .22);\n  --hb-hh2-panel: rgba(4, 47, 46, .55);\n  --hb-hh2-align: center;\n  --hb-hh2-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(70% 55% at 50% 38%, rgba(94, 234, 212, .2), transparent 72%),\n    linear-gradient(160deg, #042f2e 0%, #075e5a 52%, #0f766e 100%);\n  color: var(--hb-hh2-fg);\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  -webkit-font-smoothing: antialiased;\n}\n.hb-hh2 *, .hb-hh2 *::before, .hb-hh2 *::after { box-sizing: border-box; }\n.hb-hh2-canvas { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; pointer-events: none; }\n.hb-hh2-bar {\n  position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 24px;\n  width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 40px;\n}\n.hb-hh2-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; font-weight: 700; letter-spacing: -.02em; text-decoration: none; }\n.hb-hh2-mark { flex: none; color: var(--hb-hh2-accent); }\n.hb-hh2-menu { display: flex; align-items: center; gap: 30px; }\n.hb-hh2-links { display: flex; align-items: center; gap: 30px; margin: 0; padding: 0; list-style: none; }\n.hb-hh2-link { color: rgba(236, 253, 245, .8); font-size: 14px; text-decoration: none; transition: color .2s ease; }\n.hb-hh2-link:hover { color: #fff; text-decoration: underline; text-underline-offset: 6px; }\n.hb-hh2-search { display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: rgba(236, 253, 245, .8); cursor: pointer; }\n.hb-hh2-search:hover { color: #fff; background: rgba(255, 255, 255, .1); }\n.hb-hh2-stage { position: relative; z-index: 1; flex: 1 1 auto; min-height: 300px; }\n.hb-hh2-copy {\n  position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 20px;\n  width: 100%; max-width: 860px; margin: 0 auto; padding: 0 32px 56px; text-align: center;\n}\n.hb-hh2-title {\n  max-width: 16em; margin: 0; color: #fff; font-size: clamp(30px, 4.6cqi, 62px); font-weight: 700; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance;\n  text-shadow: 0 2px 30px rgba(4, 47, 46, .9), 0 0 4px rgba(4, 47, 46, .5);\n  animation: hb-hh2-up .8s cubic-bezier(.2, .7, .2, 1) both;\n}\n.hb-hh2-sub {\n  max-width: 38em; margin: 0; color: rgba(236, 253, 245, .86); font-size: 16px; line-height: 1.55; text-wrap: pretty;\n  text-shadow: 0 1px 20px rgba(4, 47, 46, .95);\n  animation: hb-hh2-up .8s .08s cubic-bezier(.2, .7, .2, 1) both;\n}\n.hb-hh2-side { animation: hb-hh2-up .8s .16s cubic-bezier(.2, .7, .2, 1) both; }\n.hb-hh2-more { color: var(--hb-hh2-accent); font-size: 14px; font-weight: 600; text-decoration: none; }\n.hb-hh2-more:hover { text-decoration: underline; text-underline-offset: 5px; }\n.hb-hh2-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; align-items: var(--hb-hh2-align, flex-start); }\n.hb-hh2-row { display: flex; flex-wrap: wrap; align-items: stretch; gap: 10px; max-width: 100%; justify-content: var(--hb-hh2-align, flex-start); }\n.hb-hh2-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-hh2-accent); color: var(--hb-hh2-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-hh2-cta:hover { filter: brightness(1.08); }\n.hb-hh2-cta svg { transition: transform .2s ease; }\n.hb-hh2-cta:hover svg { transform: translateX(2px); }\n.hb-hh2-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-hh2-line); border-radius: 8px; background: var(--hb-hh2-panel);\n  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);\n}\n.hb-hh2-prompt { flex: none; color: var(--hb-hh2-accent); font-family: var(--hb-hh2-mono); font-size: 12px; }\n.hb-hh2-code { min-width: 0; overflow: hidden; color: var(--hb-hh2-fg); font-family: var(--hb-hh2-mono); font-size: 12px; white-space: nowrap; text-overflow: ellipsis; }\n.hb-hh2-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-hh2-mute); cursor: pointer;\n  transition: color .2s ease, background-color .2s ease;\n}\n.hb-hh2-copybtn:hover { color: var(--hb-hh2-fg); background: var(--hb-hh2-line); }\n.hb-hh2-copybtn[data-done=\"true\"] { color: var(--hb-hh2-accent); }\n.hb-hh2-caption { margin: 0; color: var(--hb-hh2-mute); font-family: var(--hb-hh2-mono); font-size: 11.5px; letter-spacing: .04em; }\n.hb-hh2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n.hb-hh2 a:focus-visible, .hb-hh2 button:focus-visible { outline: 2px solid var(--hb-hh2-accent); outline-offset: 2px; }\n\n@container (max-width: 760px) {\n  .hb-hh2-bar { padding: 18px 24px; }\n  .hb-hh2-copy { padding: 0 24px 40px; }\n}\n@container (max-width: 640px) {\n  .hb-hh2-links { display: none; }\n  .hb-hh2-menu { gap: 12px; }\n  .hb-hh2-stage { min-height: 52cqi; }\n  .hb-hh2-sub { font-size: 14.5px; }\n  .hb-hh2-side, .hb-hh2-row { align-self: stretch; }\n  .hb-hh2-row { flex-direction: column; }\n  .hb-hh2-cta { width: 100%; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-hh2-title, .hb-hh2-sub, .hb-hh2-side { animation: none; }\n  .hb-hh2-link, .hb-hh2-cta, .hb-hh2-cta svg, .hb-hh2-copybtn { transition: none; }\n}\n`;\n\nconst defaultNav: HeroDotDnaLink[] = [\n  { label: \"Pipelines\", href: \"#\" },\n  { label: \"Research\", href: \"#\" },\n  { label: \"Docs\", href: \"#\" },\n];\nconst defaultNavCta: HeroDotDnaLink = { label: \"Request access\", href: \"#\" };\nconst defaultPrimary: HeroDotDnaLink = { label: \"Run a sequence\", href: \"#\" };\nconst defaultMore: HeroDotDnaLink = { label: \"Learn more\", href: \"#\" };\n\nconst TAU = Math.PI * 2;\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-hh2-side\">\n      {command || primaryCta ? (\n        <div className=\"hb-hh2-row\">\n          {primaryCta ? (\n            <a className=\"hb-hh2-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-hh2-cmd\">\n              <span className=\"hb-hh2-prompt\" aria-hidden=\"true\">$</span>\n              <code className=\"hb-hh2-code\">{command}</code>\n              <button type=\"button\" className=\"hb-hh2-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-hh2-sr\" aria-live=\"polite\">{copied ? \"Copied\" : \"\"}</span>\n              </button>\n            </div>\n          ) : null}\n        </div>\n      ) : null}\n      {caption ? <p className=\"hb-hh2-caption\">{caption}</p> : null}\n    </div>\n  );\n}\n\n\nfunction Mark() {\n  return (\n    <svg className=\"hb-hh2-mark\" width=\"22\" height=\"22\" viewBox=\"0 0 24 24\" fill=\"none\" aria-hidden=\"true\">\n      <path d=\"M3 7c6 0 12 10 18 10M3 17c6 0 12-10 18-10\" stroke=\"currentColor\" strokeWidth=\"1.8\" strokeLinecap=\"round\" />\n      <path d=\"M7.5 8.6v6.8M16.5 8.6v6.8M12 10.4v3.2\" stroke=\"currentColor\" strokeWidth=\"1.5\" strokeLinecap=\"round\" opacity=\".7\" />\n    </svg>\n  );\n}\n\nexport function HeroDotDna({\n  title = \"Two strands. One source of truth.\",\n  subtitle = \"Version every dataset and replay every experiment. A pipeline that pairs each change with its proof, from the first sample to the final figure.\",\n  caption = \"6 turns · 60 base pairs · runs in any React app\",\n  command = \"npx shadcn@latest add https://hyperblur.dev/r/hero-dot-dna.json\",\n  brand = \"Your brand\",\n  accent = \"#5eead4\",\n  primaryCta = defaultPrimary,\n  nav = defaultNav,\n  navCta = defaultNavCta,\n  learnMore = defaultMore,\n  density = 1,\n  speed = 1,\n  turns = 6,\n  pulses = 3,\n  headingAs = \"h1\",\n  onSearch,\n  showBar = false,\n  className = \"\",\n  style,\n  ...rest\n}: HeroDotDnaProps) {\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 nTurns = clampNum(turns, 1, 16, 6);\n    const nPulses = Math.round(clampNum(pulses, 0, 8, 3));\n    const perStrand = Math.round(2300 * mult);\n    const nRungs = Math.max(10, Math.round(nTurns * 9));\n    const perRung = Math.max(6, Math.round(18 * Math.sqrt(mult)));\n    const total = perStrand * 2 + nRungs * (perRung + 2);\n    const pt = new Float32Array(total);\n    const pq = new Uint8Array(total);\n    const pk = new Uint8Array(total);\n    const pj = new Float32Array(total);\n    const ps = new Float32Array(total);\n    const pr = new Int16Array(total);\n    let n = 0;\n    for (let q = 0; q < 2; q++) {\n      for (let j = 0; j < perStrand; j++) {\n        pt[n] = (j + hash(j, 21 + q) * 0.8) / perStrand;\n        pq[n] = q;\n        pk[n] = 0;\n        pj[n] = hash(j, 23 + q);\n        ps[n] = hash(j, 25 + q);\n        n++;\n      }\n    }\n    for (let k = 0; k < nRungs; k++) {\n      const t = (k + 0.5) / nRungs;\n      for (let d = 0; d < perRung; d++) {\n        pt[n] = t;\n        pk[n] = 1;\n        pq[n] = d / (perRung - 1) < 0.5 ? 0 : 1;\n        ps[n] = 0.06 + (0.88 * d) / (perRung - 1);\n        pj[n] = hash(n, 31);\n        pr[n] = k;\n        n++;\n      }\n      for (let e = 0; e < 2; e++) {\n        pt[n] = t;\n        pk[n] = 2;\n        pq[n] = e;\n        ps[n] = e;\n        pj[n] = hash(n, 33);\n        pr[n] = k;\n        n++;\n      }\n    }\n    const nBokeh = 26;\n\n    const acc = resolveRgb(accent, ctx, [94, 234, 212]);\n    const sprMint = makeSprite(acc, 64, 0.35);\n    const sprWhite = makeSprite([226, 255, 250], 64, 0.6);\n    const sprBokeh = makeSprite(acc, 128, 0);\n\n    const X = new Float32Array(total);\n    const Y = new Float32Array(total);\n    const Z = new Float32Array(total);\n    const B = new Float32Array(total);\n    const Sz = new Float32Array(total);\n    const rungGlow = new Float32Array(nRungs);\n    const pulseT = new Float32Array(Math.max(1, nPulses));\n\n    let w = 0;\n    let h = 0;\n    let dpr = 1;\n    let cx = 0;\n    let cy = 0;\n    let len = 1;\n    let rad = 1;\n    let eTurns = nTurns;\n    let unit = 1;\n    let visible = true;\n    let raf = 0;\n    let last = 0;\n    let time = reduce ? 3.2 : 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      cy = st.top - rect.top + st.height / 2;\n      len = w * (small ? 1.5 : 1.16);\n      rad = small ? Math.min(h * 0.22, st.height * 0.5) : Math.min(h * 0.31, w * 0.3);\n      eTurns = small ? Math.max(1.5, nTurns * 0.4) : nTurns * 0.62;\n      unit = Math.max(0.55, Math.min(1.5, rad / 260));\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 < nBokeh; k++) {\n        const u = (hash(k, 61) + time * 0.012 * pace * (0.5 + hash(k, 62))) % 1;\n        const bx = hash(k, 63) * w;\n        const by = h * (1.1 - u * 1.2);\n        const bs = (50 + hash(k, 64) * 130) * unit;\n        ctx.globalAlpha = 0.06 + hash(k, 65) * 0.1;\n        ctx.drawImage(sprBokeh, bx - bs / 2, by - bs / 2, bs, bs);\n      }\n      const spin = time * 0.55 * pace;\n      const roll = -0.07;\n      const cR = Math.cos(roll);\n      const sR = Math.sin(roll);\n      const pitch = 0.28;\n      const cP = Math.cos(pitch);\n      const sP = Math.sin(pitch);\n      for (let p = 0; p < nPulses; p++) {\n        const v = time * 0.07 * pace * (1 + 0.2 * (p % 3)) + p / nPulses + 0.1;\n        pulseT[p] = v - Math.floor(v);\n      }\n      for (let k = 0; k < nRungs; k++) {\n        const tk = (k + 0.5) / nRungs;\n        let g = 0;\n        for (let p = 0; p < nPulses; p++) {\n          const d = pulseT[p] - tk;\n          let e = Math.exp(-(d * d) / 0.0007);\n          if (d < 0 && d > -0.12) e += 0.5 * Math.exp(d * 24);\n          if (e > g) g = e;\n        }\n        rungGlow[k] = g;\n      }\n      const off = 2.35;\n      for (let i = 0; i < n; i++) {\n        const t = pt[i];\n        const kind = pk[i];\n        let ang: number;\n        let r0 = 1;\n        let yy = 0;\n        let gl = 0;\n        if (kind === 0) {\n          ang = t * eTurns * TAU + pq[i] * off + spin;\n          r0 = 1 + (pj[i] - 0.5) * 0.14;\n          yy = (ps[i] - 0.5) * 0.05;\n          for (let p = 0; p < nPulses; p++) {\n            if ((p & 1) !== pq[i] && nPulses > 1) continue;\n            const d = pulseT[p] - t;\n            let e = Math.exp(-(d * d) / 0.00025);\n            if (d < 0 && d > -0.07) e += 0.4 * Math.exp(d * 40);\n            if (e > gl) gl = e;\n          }\n        } else {\n          const a1 = t * eTurns * TAU + spin;\n          const a2 = a1 + off;\n          const s = ps[i];\n          if (kind === 1) {\n            const ax = Math.cos(a1);\n            const az = Math.sin(a1);\n            const bx = Math.cos(a2);\n            const bz = Math.sin(a2);\n            const ex = ax + (bx - ax) * s;\n            const ez = az + (bz - az) * s;\n            ang = Math.atan2(ez, ex);\n            r0 = Math.sqrt(ex * ex + ez * ez);\n            yy = (pj[i] - 0.5) * 0.03;\n          } else {\n            ang = s ? a2 : a1;\n          }\n          gl = rungGlow[pr[i]];\n        }\n        const mx = (t * 2 - 1) * 0.5 * len;\n        const my = Math.cos(ang) * r0 * rad;\n        const mz = Math.sin(ang) * r0;\n        const y1 = my * cP - mz * rad * sP;\n        const z1 = my * sP + mz * rad * cP;\n        const persp = 1 + (z1 / rad) * 0.1;\n        const xr = mx;\n        const yr = y1 * persp + yy * rad;\n        X[i] = cx + xr * cR - yr * sR;\n        Y[i] = cy + xr * sR + yr * cR;\n        Z[i] = mz;\n        const front = 0.5 + 0.5 * mz;\n        let b: number;\n        let sz: number;\n        if (kind === 0) {\n          b = (0.16 + 0.34 * front) * (0.7 + 0.3 * pj[i]) + gl * 0.85;\n          sz = (7 + 5 * front + gl * 9) * (0.8 + 0.4 * ps[i]);\n        } else if (kind === 1) {\n          b = (0.3 + 0.4 * front) + gl * 0.7;\n          sz = (5 + 4 * front + gl * 7) * (0.8 + 0.4 * pj[i]);\n        } else {\n          b = 0.45 + 0.4 * front + gl * 0.6;\n          sz = 11 + 7 * front + gl * 10;\n        }\n        B[i] = b;\n        Sz[i] = sz * unit;\n      }\n      for (let pass = 0; pass < 2; pass++) {\n        for (let i = 0; i < n; i++) {\n          if ((Z[i] >= 0 ? 1 : 0) !== pass) continue;\n          const b = B[i];\n          if (b < 0.02) continue;\n          const white = pq[i] === 1 || (pk[i] === 1 && pj[i] > 0.6) ? 1 : 0;\n          ctx.globalAlpha = Math.min(1, b);\n          const s = Sz[i];\n          ctx.drawImage(white ? sprWhite : sprMint, X[i] - s / 2, Y[i] - s / 2, s, s);\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, turns, pulses]);\n\n  const Heading = headingAs;\n  const vars = { \"--hb-hh2-accent\": accent, \"--hb-hh2-ink\": inkFor(accent, \"#042f2e\"), ...style } as React.CSSProperties;\n\n  return (\n    <section ref={rootRef} className={`hb-hh2 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-hero-dot-dna\" precedence=\"default\">{css}</style>\n      <canvas ref={canvasRef} className=\"hb-hh2-canvas\" aria-hidden=\"true\" />\n      {showBar ? (\n      <header className=\"hb-hh2-bar\">\n        <a className=\"hb-hh2-brand\" href=\"#\">\n          <Mark />\n          <span>{brand}</span>\n        </a>\n        <div className=\"hb-hh2-menu\">\n          {nav.length || navCta ? (\n            <nav aria-label=\"Primary\">\n              <ul className=\"hb-hh2-links\">\n                {nav.map((item) => (\n                  <li key={item.label}>\n                    <a className=\"hb-hh2-link\" href={item.href}>\n                      {item.label}\n                    </a>\n                  </li>\n                ))}\n                {navCta ? (\n                  <li>\n                    <a className=\"hb-hh2-link\" href={navCta.href}>\n                      {navCta.label}\n                    </a>\n                  </li>\n                ) : null}\n              </ul>\n            </nav>\n          ) : null}\n          <button type=\"button\" className=\"hb-hh2-search\" aria-label=\"Search\" onClick={onSearch}>\n            <SearchIcon />\n          </button>\n        </div>\n      </header>\n      ) : null}\n      <div ref={stageRef} className=\"hb-hh2-stage\" aria-hidden=\"true\" />\n      <div className=\"hb-hh2-copy\">\n        <Heading className=\"hb-hh2-title\">{title}</Heading>\n        {subtitle ? <p className=\"hb-hh2-sub\">{subtitle}</p> : null}\n        <Actions caption={caption} command={command} primaryCta={primaryCta} copied={copied} onCopy={copy} />\n        {learnMore ? (\n          <a className=\"hb-hh2-more\" href={learnMore.href}>\n            {learnMore.label}\n          </a>\n        ) : null}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}