{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "notfound-astronaut",
  "type": "registry:component",
  "title": "404 Astronaut",
  "description": "A lost in space 404 page with an illustrated astronaut that floats and slowly spins over an outlined code, twinkling stars, a glowing planet horizon and pointer parallax.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "not-found",
    "404",
    "error page",
    "space",
    "astronaut",
    "parallax",
    "stars"
  ],
  "docs": "https://hyperblur.dev/effects/notfound-astronaut",
  "files": [
    {
      "path": "registry/hyperblur/notfound-astronaut.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/notfound-astronaut.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NotfoundAstronautLink {\n  label: string;\n  href: string;\n}\n\nexport interface NotfoundAstronautProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  code?: string;\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  primary?: NotfoundAstronautLink;\n  secondary?: NotfoundAstronautLink;\n  onReport?: () => void;\n  stars?: number;\n  parallax?: boolean;\n  accent?: string;\n}\n\nconst css = `\n.hb-kg2 {\n  --hb-kg2-accent: #8b5cf6;\n  --hb-kg2-px: 0;\n  --hb-kg2-py: 0;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  isolation: isolate;\n  container-type: inline-size;\n  background: radial-gradient(120% 80% at 50% 0%, #120f1f 0%, #0a0a0a 60%);\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-kg2 *, .hb-kg2 *::before, .hb-kg2 *::after { box-sizing: border-box; }\n.hb-kg2-sky { position: absolute; inset: -24px; z-index: -1; pointer-events: none; }\n.hb-kg2-layer {\n  position: absolute;\n  inset: 0;\n  transition: transform .6s cubic-bezier(.2, .8, .2, 1);\n}\n.hb-kg2-l1 { transform: translate3d(calc(var(--hb-kg2-px) * -6px), calc(var(--hb-kg2-py) * -6px), 0); }\n.hb-kg2-l2 { transform: translate3d(calc(var(--hb-kg2-px) * -14px), calc(var(--hb-kg2-py) * -14px), 0); }\n.hb-kg2-l3 { transform: translate3d(calc(var(--hb-kg2-px) * -26px), calc(var(--hb-kg2-py) * -26px), 0); }\n.hb-kg2-star {\n  position: absolute;\n  width: var(--hb-kg2-s);\n  height: var(--hb-kg2-s);\n  border-radius: 50%;\n  background: #fff;\n  opacity: .3;\n  animation: hb-kg2-twinkle var(--hb-kg2-t) ease-in-out var(--hb-kg2-d) infinite alternate;\n}\n.hb-kg2-star[data-glow] { box-shadow: 0 0 6px 1px rgba(255, 255, 255, .7); }\n.hb-kg2-shoot {\n  position: absolute;\n  top: 14%;\n  left: 62%;\n  width: 120px;\n  height: 1px;\n  background: linear-gradient(90deg, rgba(255, 255, 255, .9), transparent);\n  transform: rotate(-24deg);\n  opacity: 0;\n  animation: hb-kg2-shoot 7s ease-in 2s infinite;\n}\n.hb-kg2-planet {\n  position: absolute;\n  left: 50%;\n  bottom: -150cqi;\n  width: 160cqi;\n  aspect-ratio: 1;\n  transform: translateX(-50%);\n  border-radius: 50%;\n  background: radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--hb-kg2-accent) 55%, #0a0a0a) 0%, #0d0b16 22%, #0a0a0a 45%);\n  box-shadow: 0 -2px 0 color-mix(in srgb, var(--hb-kg2-accent) 70%, #fff), 0 -30px 120px -10px color-mix(in srgb, var(--hb-kg2-accent) 55%, transparent);\n}\n.hb-kg2-ringed {\n  position: absolute;\n  top: 12%;\n  right: 9%;\n  width: clamp(54px, 9cqi, 96px);\n}\n.hb-kg2-inner {\n  position: relative;\n  max-width: 1120px;\n  margin: 0 auto;\n  padding: 56px 20px 80px;\n  text-align: center;\n}\n.hb-kg2-stage {\n  position: relative;\n  display: grid;\n  place-items: center;\n  height: clamp(200px, 32cqi, 300px);\n}\n.hb-kg2-code {\n  position: absolute;\n  inset: 0;\n  display: grid;\n  place-items: center;\n  margin: 0;\n  font-size: clamp(130px, 31cqi, 300px);\n  font-weight: 800;\n  line-height: 1;\n  letter-spacing: -.05em;\n  color: transparent;\n  -webkit-text-stroke: 1px rgba(255, 255, 255, .14);\n  background: linear-gradient(180deg, rgba(255, 255, 255, .08), transparent 75%);\n  -webkit-background-clip: text;\n  background-clip: text;\n  user-select: none;\n}\n.hb-kg2-float {\n  position: relative;\n  width: clamp(120px, 19cqi, 184px);\n  animation: hb-kg2-float 6s ease-in-out infinite alternate;\n}\n.hb-kg2-spin { animation: hb-kg2-spin 40s linear infinite; }\n.hb-kg2-spin svg { display: block; width: 100%; height: auto; overflow: visible; filter: drop-shadow(0 20px 30px rgba(0, 0, 0, .5)); }\n.hb-kg2-eyebrow {\n  margin: 4px 0 0;\n  color: color-mix(in srgb, var(--hb-kg2-accent) 60%, #fff);\n  font-family: ui-monospace, \"SFMono-Regular\", Menlo, Consolas, monospace;\n  font-size: 12px;\n  letter-spacing: .16em;\n  text-transform: uppercase;\n}\n.hb-kg2-title {\n  margin: 12px 0 0;\n  font-size: clamp(34px, 5.6cqi, 58px);\n  font-weight: 650;\n  line-height: 1.04;\n  letter-spacing: -.035em;\n}\n.hb-kg2-sub {\n  margin: 14px auto 0;\n  max-width: 470px;\n  color: #8f8f8f;\n  font-size: 16px;\n  line-height: 1.6;\n  text-wrap: pretty;\n}\n.hb-kg2-actions {\n  display: flex;\n  flex-wrap: wrap;\n  justify-content: center;\n  gap: 10px;\n  margin-top: 30px;\n}\n.hb-kg2-btn {\n  display: inline-flex;\n  align-items: center;\n  justify-content: center;\n  gap: 8px;\n  min-height: 44px;\n  padding: 0 22px;\n  border: 1px solid transparent;\n  border-radius: 999px;\n  font: inherit;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  white-space: nowrap;\n  transition: transform .2s cubic-bezier(.2, .8, .2, 1), background-color .2s ease, border-color .2s ease, box-shadow .2s ease;\n}\n.hb-kg2-btn svg { width: 16px; height: 16px; }\n.hb-kg2-btn:focus-visible { outline: 2px solid color-mix(in srgb, var(--hb-kg2-accent) 70%, #fff); outline-offset: 3px; }\n.hb-kg2-primary {\n  background: linear-gradient(180deg, color-mix(in srgb, var(--hb-kg2-accent) 85%, #fff), var(--hb-kg2-accent));\n  color: #fff;\n  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 12px 32px -12px var(--hb-kg2-accent);\n}\n.hb-kg2-primary:hover { transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 16px 40px -10px var(--hb-kg2-accent); }\n.hb-kg2-ghost { border-color: rgba(255, 255, 255, .12); background: rgba(10, 10, 10, .5); color: #ededed; backdrop-filter: blur(6px); }\n.hb-kg2-ghost:hover { transform: translateY(-1px); border-color: rgba(255, 255, 255, .3); background: rgba(255, 255, 255, .06); }\n@container (min-width: 760px) {\n  .hb-kg2-inner { padding: 72px 40px 104px; }\n}\n@keyframes hb-kg2-twinkle { from { opacity: .15; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }\n@keyframes hb-kg2-float { from { transform: translateY(-10px) rotate(-6deg); } to { transform: translateY(12px) rotate(6deg); } }\n@keyframes hb-kg2-spin { to { transform: rotate(360deg); } }\n@keyframes hb-kg2-shoot {\n  0%, 82% { opacity: 0; transform: translate(0, 0) rotate(-24deg); }\n  86% { opacity: 1; }\n  100% { opacity: 0; transform: translate(-240px, 108px) rotate(-24deg); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-kg2-star, .hb-kg2-float, .hb-kg2-spin, .hb-kg2-shoot { animation: none; }\n  .hb-kg2-layer, .hb-kg2-btn { transition: none; }\n  .hb-kg2-btn:hover { transform: none; }\n}\n`;\n\nfunction rand(i: number, salt: number) {\n  let h = Math.imul(i + 1, 2654435761) ^ Math.imul(salt + 7, 1597334677);\n  h ^= h >>> 15;\n  h = Math.imul(h, 2246822519);\n  h ^= h >>> 13;\n  h = Math.imul(h, 3266489917);\n  h ^= h >>> 16;\n  return (h >>> 0) / 4294967295;\n}\n\nfunction Astronaut({ uid }: { uid: string }) {\n  const visor = `${uid}-visor`;\n  const suit = `${uid}-suit`;\n  return (\n    <svg viewBox=\"0 0 200 230\" aria-hidden=\"true\">\n      <defs>\n        <linearGradient id={visor} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n          <stop offset=\"0\" stopColor=\"#1b1530\" />\n          <stop offset=\".55\" stopColor=\"#0d0b18\" />\n          <stop offset=\"1\" style={{ stopColor: \"var(--hb-kg2-accent)\" }} />\n        </linearGradient>\n        <linearGradient id={suit} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\">\n          <stop offset=\"0\" stopColor=\"#ffffff\" />\n          <stop offset=\"1\" stopColor=\"#c4c7d2\" />\n        </linearGradient>\n      </defs>\n      <path d=\"M64 128c-30 6-44 30-58 62\" fill=\"none\" stroke=\"#9a9db0\" strokeWidth=\"3\" strokeLinecap=\"round\" strokeDasharray=\"1 7\" />\n      <rect x=\"58\" y=\"92\" width=\"84\" height=\"74\" rx=\"16\" fill=\"#a9adbd\" />\n      <g transform=\"rotate(-38 72 112)\">\n        <rect x=\"30\" y=\"102\" width=\"46\" height=\"22\" rx=\"11\" fill={`url(#${suit})`} />\n        <circle cx=\"32\" cy=\"113\" r=\"11\" fill=\"#d9dbe3\" />\n      </g>\n      <g transform=\"rotate(28 128 112)\">\n        <rect x=\"124\" y=\"102\" width=\"46\" height=\"22\" rx=\"11\" fill={`url(#${suit})`} />\n        <circle cx=\"168\" cy=\"113\" r=\"11\" fill=\"#d9dbe3\" />\n      </g>\n      <g transform=\"rotate(10 88 160)\">\n        <rect x=\"76\" y=\"150\" width=\"22\" height=\"50\" rx=\"11\" fill={`url(#${suit})`} />\n        <rect x=\"74\" y=\"190\" width=\"26\" height=\"16\" rx=\"7\" fill=\"#8d91a3\" />\n      </g>\n      <g transform=\"rotate(-16 112 160)\">\n        <rect x=\"102\" y=\"150\" width=\"22\" height=\"50\" rx=\"11\" fill={`url(#${suit})`} />\n        <rect x=\"100\" y=\"190\" width=\"26\" height=\"16\" rx=\"7\" fill=\"#8d91a3\" />\n      </g>\n      <rect x=\"68\" y=\"94\" width=\"64\" height=\"80\" rx=\"26\" fill={`url(#${suit})`} />\n      <rect x=\"84\" y=\"118\" width=\"32\" height=\"22\" rx=\"5\" fill=\"#d3d6df\" />\n      <circle cx=\"92\" cy=\"129\" r=\"3.2\" style={{ fill: \"var(--hb-kg2-accent)\" }} />\n      <circle cx=\"100\" cy=\"129\" r=\"3.2\" fill=\"#22d3ee\" />\n      <circle cx=\"108\" cy=\"129\" r=\"3.2\" fill=\"#fbbf24\" />\n      <rect x=\"84\" y=\"148\" width=\"32\" height=\"4\" rx=\"2\" fill=\"#c4c7d2\" />\n      <circle cx=\"100\" cy=\"64\" r=\"44\" fill={`url(#${suit})`} />\n      <rect x=\"66\" y=\"40\" width=\"68\" height=\"50\" rx=\"24\" fill={`url(#${visor})`} />\n      <path d=\"M76 56c4-8 12-11 20-11\" fill=\"none\" stroke=\"#fff\" strokeOpacity=\".55\" strokeWidth=\"4\" strokeLinecap=\"round\" />\n      <circle cx=\"120\" cy=\"76\" r=\"3\" fill=\"#fff\" fillOpacity=\".35\" />\n      <rect x=\"96\" y=\"12\" width=\"8\" height=\"10\" rx=\"3\" fill=\"#c4c7d2\" />\n      <circle cx=\"100\" cy=\"10\" r=\"4\" style={{ fill: \"var(--hb-kg2-accent)\" }} />\n    </svg>\n  );\n}\n\nfunction RingedPlanet() {\n  return (\n    <svg viewBox=\"0 0 100 60\" aria-hidden=\"true\">\n      <circle cx=\"50\" cy=\"30\" r=\"18\" fill=\"#1d1830\" />\n      <path d=\"M32 30a18 18 0 0 1 36 0\" style={{ fill: \"color-mix(in srgb, var(--hb-kg2-accent) 50%, #2a2440)\" }} />\n      <ellipse cx=\"50\" cy=\"32\" rx=\"44\" ry=\"9\" fill=\"none\" stroke=\"rgba(255,255,255,.35)\" strokeWidth=\"1.5\" transform=\"rotate(-12 50 32)\" />\n    </svg>\n  );\n}\n\nexport function NotfoundAstronaut({\n  code = \"404\",\n  eyebrow = \"Error 404\",\n  title = \"Lost in space\",\n  subtitle = \"The page you were looking for drifted out of orbit. It may have been moved, renamed, or it never launched at all.\",\n  primary = { label: \"Take me home\", href: \"/\" },\n  secondary = { label: \"Report this link\", href: \"mailto:support@orbitly.io?subject=Broken%20link\" },\n  onReport,\n  stars = 90,\n  parallax = true,\n  accent = \"#8b5cf6\",\n  className = \"\",\n  style,\n  onPointerMove,\n  onPointerLeave,\n  ...rest\n}: NotfoundAstronautProps) {\n  const uid = React.useId().replace(/[^a-zA-Z0-9_-]/g, \"\");\n  const ref = React.useRef<HTMLElement>(null);\n  const vars = { \"--hb-kg2-accent\": accent, ...style } as React.CSSProperties;\n\n  const field = React.useMemo(\n    () =>\n      Array.from({ length: stars }, (_, i) => {\n        const size = 1 + rand(i, 3) * 2.2;\n        return {\n          layer: i % 3,\n          left: `${(rand(i, 1) * 100).toFixed(2)}%`,\n          top: `${(rand(i, 2) * 100).toFixed(2)}%`,\n          size: `${size.toFixed(2)}px`,\n          glow: size > 2.6,\n          t: `${(2 + rand(i, 4) * 4).toFixed(2)}s`,\n          d: `${(-rand(i, 5) * 6).toFixed(2)}s`,\n        };\n      }),\n    [stars],\n  );\n\n  const move = (e: React.PointerEvent<HTMLElement>) => {\n    onPointerMove?.(e);\n    if (!parallax || e.pointerType === \"touch\" || !ref.current) return;\n    const r = ref.current.getBoundingClientRect();\n    const x = ((e.clientX - r.left) / r.width) * 2 - 1;\n    const y = ((e.clientY - r.top) / r.height) * 2 - 1;\n    ref.current.style.setProperty(\"--hb-kg2-px\", x.toFixed(3));\n    ref.current.style.setProperty(\"--hb-kg2-py\", y.toFixed(3));\n  };\n\n  const leave = (e: React.PointerEvent<HTMLElement>) => {\n    onPointerLeave?.(e);\n    ref.current?.style.setProperty(\"--hb-kg2-px\", \"0\");\n    ref.current?.style.setProperty(\"--hb-kg2-py\", \"0\");\n  };\n\n  return (\n    <section\n      ref={ref}\n      className={`hb-kg2 ${className}`}\n      style={vars}\n      aria-labelledby={`${uid}-title`}\n      onPointerMove={move}\n      onPointerLeave={leave}\n      {...rest}\n    >\n      <style href=\"hb-notfound-astronaut\" precedence=\"default\">{css}</style>\n      <div className=\"hb-kg2-sky\" aria-hidden=\"true\">\n        {[0, 1, 2].map((layer) => (\n          <div key={layer} className={`hb-kg2-layer hb-kg2-l${layer + 1}`}>\n            {field\n              .filter((s) => s.layer === layer)\n              .map((s, i) => (\n                <span\n                  key={i}\n                  className=\"hb-kg2-star\"\n                  data-glow={s.glow ? \"\" : undefined}\n                  style={{ left: s.left, top: s.top, \"--hb-kg2-s\": s.size, \"--hb-kg2-t\": s.t, \"--hb-kg2-d\": s.d } as React.CSSProperties}\n                />\n              ))}\n            {layer === 1 && <div className=\"hb-kg2-ringed\"><RingedPlanet /></div>}\n            {layer === 0 && <span className=\"hb-kg2-shoot\" />}\n          </div>\n        ))}\n        <div className=\"hb-kg2-planet\" />\n      </div>\n      <div className=\"hb-kg2-inner\">\n        <div className=\"hb-kg2-stage\" aria-hidden=\"true\">\n          <p className=\"hb-kg2-code\">{code}</p>\n          <div className=\"hb-kg2-layer hb-kg2-l3\" style={{ position: \"relative\", inset: \"auto\", display: \"grid\", placeItems: \"center\" }}>\n            <div className=\"hb-kg2-float\">\n              <div className=\"hb-kg2-spin\"><Astronaut uid={uid} /></div>\n            </div>\n          </div>\n        </div>\n        <p className=\"hb-kg2-eyebrow\">{eyebrow}</p>\n        <h1 id={`${uid}-title`} className=\"hb-kg2-title\">{title}</h1>\n        {subtitle && <p className=\"hb-kg2-sub\">{subtitle}</p>}\n        <div className=\"hb-kg2-actions\">\n          <a className=\"hb-kg2-btn hb-kg2-primary\" href={primary.href}>\n            <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2.5 7.5 8 3l5.5 4.5V13a.5.5 0 0 1-.5.5H9.5V10h-3v3.5H3a.5.5 0 0 1-.5-.5V7.5Z\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinejoin=\"round\" /></svg>\n            {primary.label}\n          </a>\n          <a className=\"hb-kg2-btn hb-kg2-ghost\" href={secondary.href} onClick={onReport}>{secondary.label}</a>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}