{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "hero-gradient-sphere",
  "type": "registry:component",
  "title": "Hero Gradient Sphere",
  "description": "A split hero with a lit 3D sphere whose gradient mesh swirls inside it, a turning wireframe, an orbit ring with a moon that passes behind, and a row of palette tokens beside the copy.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "hero",
    "hero",
    "sphere",
    "gradient",
    "mesh",
    "3d",
    "design tools"
  ],
  "docs": "https://hyperblur.dev/effects/hero-gradient-sphere",
  "files": [
    {
      "path": "registry/hyperblur/hero-gradient-sphere.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/hero-gradient-sphere.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HeroGradientSphereAction {\n  label: string;\n  href: string;\n}\n\nexport interface HeroGradientSphereToken {\n  name: string;\n  value: string;\n}\n\nexport interface HeroGradientSphereProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  primaryCta?: HeroGradientSphereAction | null;\n  secondaryCta?: HeroGradientSphereAction | null;\n  colors?: [string, string, string];\n  tokens?: HeroGradientSphereToken[];\n  speed?: number;\n  headingAs?: \"h1\" | \"h2\";\n}\n\nconst css = `\n.hb-vb6 {\n  --hb-vb6-c1: #ff5f3d;\n  --hb-vb6-c2: #7c3aed;\n  --hb-vb6-c3: #22d3ee;\n  --hb-vb6-sp: 1;\n  position: relative;\n  box-sizing: border-box;\n  display: grid;\n  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);\n  align-items: center;\n  gap: 32px;\n  width: 100%;\n  min-height: 620px;\n  padding: 60px clamp(20px, 6cqi, 72px);\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: #09090b;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-vb6 *, .hb-vb6 *::before, .hb-vb6 *::after { box-sizing: border-box; }\n.hb-vb6::before {\n  content: \"\";\n  position: absolute;\n  right: -10%;\n  top: 50%;\n  z-index: -1;\n  width: 70%;\n  aspect-ratio: 1;\n  transform: translateY(-50%);\n  background: radial-gradient(closest-side, color-mix(in srgb, var(--hb-vb6-c2) 30%, transparent), transparent);\n  pointer-events: none;\n}\n.hb-vb6-copy { max-width: 520px; }\n.hb-vb6-in { animation: hb-vb6-up .9s cubic-bezier(.16, 1, .3, 1) both; animation-delay: var(--hb-vb6-d, 0ms); }\n@keyframes hb-vb6-up {\n  from { opacity: 0; transform: translate3d(0, 14px, 0); }\n  to { opacity: 1; transform: none; }\n}\n.hb-vb6-eyebrow { margin: 0; color: rgba(237, 237, 237, .55); font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; letter-spacing: .04em; }\n.hb-vb6-eyebrow b { color: #ededed; font-weight: 500; }\n.hb-vb6-title {\n  margin: 18px 0 0;\n  color: #f5f5f5;\n  font-family: var(--font-grotesk, inherit);\n  font-size: clamp(36px, 5.6cqi, 62px);\n  font-weight: 600;\n  line-height: 1.02;\n  letter-spacing: -.04em;\n  text-wrap: balance;\n}\n.hb-vb6-sub { margin: 18px 0 0; color: rgba(237, 237, 237, .58); font-size: clamp(14.5px, 1.7cqi, 16.5px); line-height: 1.55; }\n.hb-vb6-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }\n.hb-vb6-btn {\n  display: inline-flex;\n  align-items: 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  color: #ededed;\n  font: inherit;\n  font-size: 15px;\n  font-weight: 550;\n  text-decoration: none;\n  white-space: nowrap;\n  transition: transform .25s cubic-bezier(.2, .8, .2, 1), background .25s ease, border-color .25s ease;\n}\n.hb-vb6-btn:hover { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .28); transform: translateY(-1px); }\n.hb-vb6-btn:active { transform: scale(.98); }\n.hb-vb6-btn:focus-visible { outline: 2px solid var(--hb-vb6-c3); outline-offset: 3px; }\n.hb-vb6-btn[data-primary] {\n  position: relative;\n  border-color: transparent;\n  background: #f5f5f5;\n  color: #09090b;\n}\n.hb-vb6-btn[data-primary]::before {\n  content: \"\";\n  position: absolute;\n  inset: -2px;\n  z-index: -1;\n  border-radius: inherit;\n  background: conic-gradient(from var(--hb-vb6-a, 0deg), var(--hb-vb6-c1), var(--hb-vb6-c2), var(--hb-vb6-c3), var(--hb-vb6-c1));\n  filter: blur(10px);\n  opacity: 0;\n  transition: opacity .3s ease;\n}\n.hb-vb6-btn[data-primary]:hover::before { opacity: .7; }\n.hb-vb6-tokens { display: flex; flex-wrap: wrap; gap: 8px; margin: 30px 0 0; padding: 0; list-style: none; }\n.hb-vb6-token {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  padding: 5px 10px 5px 5px;\n  border: 1px solid rgba(255, 255, 255, .08);\n  border-radius: 9px;\n  background: rgba(255, 255, 255, .025);\n  color: rgba(237, 237, 237, .7);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 11px;\n}\n.hb-vb6-token i { width: 16px; height: 16px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); font-style: normal; }\n.hb-vb6-token span { color: rgba(237, 237, 237, .4); }\n.hb-vb6-stage { position: relative; width: 100%; max-width: 460px; aspect-ratio: 1; justify-self: center; pointer-events: none; }\n.hb-vb6-sphere {\n  position: absolute;\n  inset: 12%;\n  overflow: hidden;\n  border-radius: 50%;\n  background: radial-gradient(circle at 40% 35%, color-mix(in srgb, var(--hb-vb6-c3) 40%, #ffffff), var(--hb-vb6-c2) 55%, #12081f 100%);\n  box-shadow: 0 50px 90px -30px color-mix(in srgb, var(--hb-vb6-c2) 70%, transparent), 0 0 0 1px rgba(255, 255, 255, .06);\n  animation: hb-vb6-breathe calc(10s / var(--hb-vb6-sp)) cubic-bezier(.45, 0, .55, 1) infinite alternate;\n}\n@keyframes hb-vb6-breathe {\n  from { transform: scale(.985); }\n  to { transform: scale(1.015); }\n}\n.hb-vb6-swirl {\n  position: absolute;\n  inset: -20%;\n  animation: hb-vb6-spin calc(var(--hb-vb6-dur) / var(--hb-vb6-sp)) linear infinite;\n  animation-direction: var(--hb-vb6-dir);\n}\n.hb-vb6-blob {\n  position: absolute;\n  left: var(--hb-vb6-l);\n  top: var(--hb-vb6-t);\n  width: var(--hb-vb6-s);\n  aspect-ratio: 1;\n  border-radius: 50%;\n  background: var(--hb-vb6-col);\n  filter: blur(34px);\n  mix-blend-mode: screen;\n  opacity: .9;\n}\n@keyframes hb-vb6-spin {\n  to { transform: rotate(360deg); }\n}\n.hb-vb6-shade {\n  position: absolute;\n  inset: 0;\n  border-radius: 50%;\n  background:\n    radial-gradient(circle at 30% 24%, rgba(255, 255, 255, .55) 0, rgba(255, 255, 255, .12) 12%, transparent 30%),\n    radial-gradient(circle at 68% 74%, transparent 34%, rgba(5, 2, 12, .72) 78%);\n  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14), inset -18px -24px 60px rgba(0, 0, 0, .4), inset 10px 14px 30px rgba(255, 255, 255, .12);\n}\n.hb-vb6-grain {\n  position: absolute;\n  inset: 0;\n  border-radius: 50%;\n  background: repeating-radial-gradient(circle at 30% 30%, rgba(255, 255, 255, .05) 0 1px, transparent 1px 3px);\n  mix-blend-mode: overlay;\n  opacity: .6;\n}\n.hb-vb6-wire { position: absolute; inset: 12%; width: 76%; height: 76%; overflow: visible; }\n.hb-vb6-mer {\n  transform-box: fill-box;\n  transform-origin: center;\n  animation: hb-vb6-turn calc(14s / var(--hb-vb6-sp)) cubic-bezier(.45, 0, .55, 1) infinite;\n  animation-delay: calc(var(--hb-vb6-m) * -14s / var(--hb-vb6-sp) / 6);\n}\n@keyframes hb-vb6-turn {\n  0% { transform: scaleX(1); }\n  50% { transform: scaleX(-1); }\n  100% { transform: scaleX(1); }\n}\n.hb-vb6-orbit { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }\n.hb-vb6-tag {\n  position: absolute;\n  right: 0;\n  bottom: 10%;\n  padding: 8px 12px;\n  border: 1px solid rgba(255, 255, 255, .12);\n  border-radius: 12px;\n  background: rgba(14, 14, 18, .7);\n  backdrop-filter: blur(12px);\n  color: rgba(237, 237, 237, .8);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-size: 11px;\n  line-height: 1.5;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);\n}\n.hb-vb6-tag b { color: #fff; font-weight: 500; }\n@container (max-width: 760px) {\n  .hb-vb6 { grid-template-columns: 1fr; padding-top: 40px; }\n  .hb-vb6-stage { order: -1; max-width: 300px; }\n}\n@container (max-width: 480px) {\n  .hb-vb6-actions { flex-direction: column; align-items: stretch; }\n  .hb-vb6-btn { justify-content: center; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-vb6-in, .hb-vb6-sphere, .hb-vb6-swirl, .hb-vb6-mer { animation: none; }\n  .hb-vb6-btn, .hb-vb6-btn[data-primary]::before { transition: none; }\n  .hb-vb6-moon { display: none; }\n}\n`;\n\nconst defaultTokens: HeroGradientSphereToken[] = [\n  { name: \"ember-500\", value: \"#ff5f3d\" },\n  { name: \"iris-600\", value: \"#7c3aed\" },\n  { name: \"tide-400\", value: \"#22d3ee\" },\n  { name: \"ink-950\", value: \"#12081f\" },\n];\n\nconst defaultPrimary: HeroGradientSphereAction = { label: \"Generate a palette\", href: \"#\" };\nconst defaultSecondary: HeroGradientSphereAction = { label: \"View token docs\", href: \"#\" };\n\nfunction d(ms: number) {\n  return { \"--hb-vb6-d\": `${ms}ms` } as React.CSSProperties;\n}\n\nexport function HeroGradientSphere({\n  eyebrow = \"Meshwork / tokens v5 now sync to iOS and Android\",\n  title = \"Color systems that hold together at every scale\",\n  subtitle = \"Meshwork blends your brand colors into accessible palettes, then ships them as tokens for Figma, CSS and native apps in one sync.\",\n  primaryCta = defaultPrimary,\n  secondaryCta = defaultSecondary,\n  colors = [\"#ff5f3d\", \"#7c3aed\", \"#22d3ee\"],\n  tokens = defaultTokens,\n  speed = 1,\n  headingAs = \"h1\",\n  className = \"\",\n  style,\n  ...rest\n}: HeroGradientSphereProps) {\n  const Heading = headingAs;\n  const uid = React.useId().replace(/:/g, \"\");\n  const vars = {\n    \"--hb-vb6-c1\": colors[0],\n    \"--hb-vb6-c2\": colors[1],\n    \"--hb-vb6-c3\": colors[2],\n    \"--hb-vb6-sp\": Math.max(speed, 0.1),\n    ...style,\n  } as React.CSSProperties;\n  const swirls = [\n    { dur: \"18s\", dir: \"normal\", blobs: [{ l: \"8%\", t: \"14%\", s: \"56%\", col: \"var(--hb-vb6-c1)\" }, { l: \"52%\", t: \"56%\", s: \"40%\", col: \"var(--hb-vb6-c3)\" }] },\n    { dur: \"26s\", dir: \"reverse\", blobs: [{ l: \"48%\", t: \"6%\", s: \"46%\", col: \"var(--hb-vb6-c3)\" }, { l: \"10%\", t: \"60%\", s: \"38%\", col: \"#ffd166\" }] },\n    { dur: \"34s\", dir: \"normal\", blobs: [{ l: \"30%\", t: \"34%\", s: \"36%\", col: \"#ffffff\" }] },\n  ];\n  const ring = \"M 404 230 A 196 50 0 1 1 46 230 A 196 50 0 1 1 404 230\";\n\n  return (\n    <section className={`hb-vb6 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-hero-gradient-sphere\" precedence=\"default\">{css}</style>\n      <div className=\"hb-vb6-copy\">\n        {eyebrow ? (\n          <p className=\"hb-vb6-eyebrow hb-vb6-in\" style={d(40)}>\n            {eyebrow.includes(\" / \") ? (\n              <>\n                <b>{eyebrow.split(\" / \")[0]}</b> / {eyebrow.split(\" / \").slice(1).join(\" / \")}\n              </>\n            ) : (\n              eyebrow\n            )}\n          </p>\n        ) : null}\n        <Heading className=\"hb-vb6-title hb-vb6-in\" style={d(130)}>\n          {title}\n        </Heading>\n        {subtitle ? (\n          <p className=\"hb-vb6-sub hb-vb6-in\" style={d(230)}>\n            {subtitle}\n          </p>\n        ) : null}\n        {primaryCta || secondaryCta ? (\n          <div className=\"hb-vb6-actions hb-vb6-in\" style={d(330)}>\n            {primaryCta ? (\n              <a className=\"hb-vb6-btn\" data-primary=\"\" href={primaryCta.href}>\n                {primaryCta.label}\n              </a>\n            ) : null}\n            {secondaryCta ? (\n              <a className=\"hb-vb6-btn\" href={secondaryCta.href}>\n                {secondaryCta.label}\n              </a>\n            ) : null}\n          </div>\n        ) : null}\n        {tokens.length ? (\n          <ul className=\"hb-vb6-tokens hb-vb6-in\" style={d(430)} aria-label=\"Palette tokens\">\n            {tokens.map((token) => (\n              <li key={token.name} className=\"hb-vb6-token\">\n                <i style={{ background: token.value }} aria-hidden=\"true\" />\n                {token.name}\n                <span>{token.value}</span>\n              </li>\n            ))}\n          </ul>\n        ) : null}\n      </div>\n      <div className=\"hb-vb6-stage hb-vb6-in\" style={d(200)} aria-hidden=\"true\">\n        <svg className=\"hb-vb6-orbit\" viewBox=\"0 0 450 450\">\n          <g transform=\"rotate(-16 225 225)\">\n            <path d={ring} fill=\"none\" stroke=\"rgba(255,255,255,.14)\" strokeWidth=\"1\" />\n          </g>\n        </svg>\n        <div className=\"hb-vb6-sphere\">\n          {swirls.map((swirl, i) => (\n            <div key={i} className=\"hb-vb6-swirl\" style={{ \"--hb-vb6-dur\": swirl.dur, \"--hb-vb6-dir\": swirl.dir } as React.CSSProperties}>\n              {swirl.blobs.map((blob, j) => (\n                <span\n                  key={j}\n                  className=\"hb-vb6-blob\"\n                  style={{ \"--hb-vb6-l\": blob.l, \"--hb-vb6-t\": blob.t, \"--hb-vb6-s\": blob.s, \"--hb-vb6-col\": blob.col } as React.CSSProperties}\n                />\n              ))}\n            </div>\n          ))}\n          <span className=\"hb-vb6-grain\" />\n          <span className=\"hb-vb6-shade\" />\n        </div>\n        <svg className=\"hb-vb6-wire\" viewBox=\"0 0 200 200\">\n          {[-60, -30, 0, 30, 60].map((lat) => {\n            const rad = (lat * Math.PI) / 180;\n            return (\n              <ellipse\n                key={lat}\n                cx=\"100\"\n                cy={(100 - Math.sin(rad) * 99).toFixed(2)}\n                rx={(Math.cos(rad) * 99).toFixed(2)}\n                ry={(Math.cos(rad) * 12).toFixed(2)}\n                fill=\"none\"\n                stroke=\"rgba(255,255,255,.12)\"\n                strokeWidth=\".5\"\n              />\n            );\n          })}\n          {[0, 1, 2, 3, 4, 5].map((m) => (\n            <ellipse key={m} className=\"hb-vb6-mer\" cx=\"100\" cy=\"100\" rx=\"99\" ry=\"99\" fill=\"none\" stroke=\"rgba(255,255,255,.1)\" strokeWidth=\".5\" style={{ \"--hb-vb6-m\": m } as React.CSSProperties} />\n          ))}\n        </svg>\n        <svg className=\"hb-vb6-orbit\" viewBox=\"0 0 450 450\">\n          <defs>\n            <radialGradient id={`${uid}-moon`} cx=\".35\" cy=\".3\" r=\".7\">\n              <stop offset=\"0\" stopColor=\"#ffffff\" />\n              <stop offset=\".5\" stopColor={colors[2]} />\n              <stop offset=\"1\" stopColor={colors[1]} />\n            </radialGradient>\n          </defs>\n          <g transform=\"rotate(-16 225 225)\">\n            <path d=\"M 404 230 A 196 50 0 0 1 46 230\" fill=\"none\" stroke=\"rgba(255,255,255,.28)\" strokeWidth=\"1\" />\n            <circle className=\"hb-vb6-moon\" r=\"9\" fill={`url(#${uid}-moon)`}>\n              <animateMotion dur=\"12s\" repeatCount=\"indefinite\" path={ring} />\n              <animate attributeName=\"opacity\" dur=\"12s\" repeatCount=\"indefinite\" values=\"1;1;0;0;1\" keyTimes=\"0;.5;.58;.92;1\" />\n            </circle>\n          </g>\n        </svg>\n        <div className=\"hb-vb6-tag\">\n          <b>contrast 7.2 : 1</b>\n          <br />\n          AAA on ink-950\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}