{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-profile-holo",
  "type": "registry:component",
  "title": "Profile Holo",
  "description": "A profile card with a foil layer whose rainbow shifts with the pointer angle, an initials avatar and a stats row.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "components",
    "card",
    "profile",
    "holographic",
    "foil",
    "avatar",
    "pointer"
  ],
  "docs": "https://hyperblur.dev/effects/card-profile-holo",
  "files": [
    {
      "path": "registry/hyperblur/card-profile-holo.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/card-profile-holo.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface HoloStat {\n  label: string;\n  value: string;\n}\n\nexport interface CardProfileHoloProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n  name?: string;\n  role?: string;\n  handle?: string;\n  serial?: string;\n  stats?: HoloStat[];\n  avatar?: string;\n  hue?: number;\n  tilt?: number;\n  ratio?: number;\n  idle?: boolean;\n}\n\nconst css = `\n.hb-qk2 {\n  --hb-qk2-rx: 0deg;\n  --hb-qk2-ry: 0deg;\n  --hb-qk2-gx: 30%;\n  --hb-qk2-gy: 28%;\n  --hb-qk2-px: 40%;\n  --hb-qk2-py: 40%;\n  --hb-qk2-ang: 115deg;\n  position: relative;\n  display: block;\n  width: 100%;\n  aspect-ratio: var(--hb-qk2-r);\n  perspective: 900px;\n  font-family: inherit;\n  box-sizing: border-box;\n  touch-action: pan-y;\n  -webkit-tap-highlight-color: transparent;\n}\n.hb-qk2 *, .hb-qk2 *::before, .hb-qk2 *::after { box-sizing: border-box; }\n.hb-qk2-card {\n  position: absolute;\n  inset: 0;\n  overflow: hidden;\n  isolation: isolate;\n  border-radius: 20px;\n  border: 1px solid #2a2a2a;\n  background: linear-gradient(145deg, #1a1c23, #0e0f13);\n  color: #ededed;\n  transform: rotateX(var(--hb-qk2-rx)) rotateY(var(--hb-qk2-ry));\n  box-shadow: 0 22px 40px -22px rgba(0, 0, 0, 0.95);\n  will-change: transform;\n}\n.hb-qk2-foil {\n  position: absolute;\n  inset: 0;\n  z-index: 1;\n  pointer-events: none;\n  mix-blend-mode: screen;\n  opacity: 0.42;\n  background: repeating-linear-gradient(\n    var(--hb-qk2-ang),\n    hsl(calc(var(--hb-qk2-h) + 0) 92% 60%) 0%,\n    hsl(calc(var(--hb-qk2-h) + 60) 92% 62%) 8%,\n    hsl(calc(var(--hb-qk2-h) + 120) 92% 60%) 16%,\n    hsl(calc(var(--hb-qk2-h) + 180) 92% 62%) 24%,\n    hsl(calc(var(--hb-qk2-h) + 240) 92% 60%) 32%,\n    hsl(calc(var(--hb-qk2-h) + 300) 92% 62%) 40%,\n    hsl(calc(var(--hb-qk2-h) + 360) 92% 60%) 48%\n  );\n  background-size: 280% 280%;\n  background-position: var(--hb-qk2-px) var(--hb-qk2-py);\n}\n.hb-qk2-tex {\n  position: absolute;\n  inset: 0;\n  z-index: 1;\n  pointer-events: none;\n  mix-blend-mode: overlay;\n  opacity: 0.6;\n  background:\n    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.9) 0 1px, transparent 2px) 0 0 / 23px 19px,\n    radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.7) 0 1px, transparent 2px) 0 0 / 17px 21px,\n    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.1) 0 2px, transparent 2px 7px);\n}\n.hb-qk2-shine {\n  position: absolute;\n  inset: 0;\n  z-index: 1;\n  pointer-events: none;\n  mix-blend-mode: overlay;\n  background: radial-gradient(farthest-corner circle at var(--hb-qk2-gx) var(--hb-qk2-gy), rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0) 58%);\n}\n.hb-qk2-in {\n  position: relative;\n  z-index: 2;\n  display: flex;\n  height: 100%;\n  flex-direction: column;\n  justify-content: space-between;\n  padding: 14px 16px 12px;\n}\n.hb-qk2-top {\n  display: flex;\n  align-items: center;\n  justify-content: space-between;\n  font-size: 10px;\n  letter-spacing: 0.14em;\n  text-transform: uppercase;\n  color: #9a9a9a;\n}\n.hb-qk2-chip {\n  padding: 3px 8px;\n  border-radius: 999px;\n  border: 1px solid rgba(255, 255, 255, 0.16);\n  color: #d8d8d8;\n}\n.hb-qk2-id {\n  display: flex;\n  min-width: 0;\n  align-items: center;\n  gap: 12px;\n}\n.hb-qk2-av {\n  position: relative;\n  flex: none;\n  display: grid;\n  place-items: center;\n  width: 54px;\n  height: 54px;\n  border-radius: 50%;\n  background-size: cover;\n  background-position: center;\n  font-size: 19px;\n  font-weight: 700;\n  letter-spacing: 0.02em;\n  color: #ffffff;\n  box-shadow: 0 0 0 2px #0e0f13, 0 0 0 3px rgba(255, 255, 255, 0.5);\n}\n.hb-qk2-who { min-width: 0; }\n.hb-qk2-name {\n  margin: 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  font-size: 19px;\n  font-weight: 650;\n  line-height: 1.15;\n  letter-spacing: -0.01em;\n  color: #ffffff;\n}\n.hb-qk2-role {\n  margin: 2px 0 0;\n  overflow: hidden;\n  text-overflow: ellipsis;\n  white-space: nowrap;\n  font-size: 12px;\n  line-height: 1.3;\n  color: #b4b4b4;\n}\n.hb-qk2-handle { color: #cfe0ff; }\n.hb-qk2-stats {\n  display: grid;\n  grid-template-columns: repeat(var(--hb-qk2-n), minmax(0, 1fr));\n  border-top: 1px solid rgba(255, 255, 255, 0.14);\n  padding-top: 8px;\n}\n.hb-qk2-stat { min-width: 0; padding-left: 10px; border-left: 1px solid rgba(255, 255, 255, 0.1); }\n.hb-qk2-stat:first-child { padding-left: 0; border-left: 0; }\n.hb-qk2-v {\n  display: block;\n  font-size: 15px;\n  font-weight: 650;\n  line-height: 1.1;\n  font-variant-numeric: tabular-nums;\n  color: #ffffff;\n}\n.hb-qk2-l {\n  display: block;\n  margin-top: 2px;\n  font-size: 9.5px;\n  letter-spacing: 0.1em;\n  text-transform: uppercase;\n  color: #8f8f8f;\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-qk2-card { transform: none; will-change: auto; }\n}\n`;\n\nconst defaultStats: HoloStat[] = [\n  { label: \"Shipped\", value: \"148\" },\n  { label: \"Reviews\", value: \"2.4k\" },\n  { label: \"Streak\", value: \"61d\" },\n];\n\nfunction clamp01(n: number) {\n  return Math.min(1, Math.max(0, n));\n}\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .filter(Boolean)\n    .slice(0, 2)\n    .map((w) => w[0])\n    .join(\"\")\n    .toUpperCase();\n}\n\nfunction avatarHue(name: string) {\n  let h = 7;\n  for (let i = 0; i < name.length; i += 1) h = (h * 31 + name.charCodeAt(i)) % 360;\n  return h;\n}\n\nexport function CardProfileHolo({\n  name = \"Mira Kovac\",\n  role = \"Staff Designer, Lumen\",\n  handle = \"@mirak\",\n  serial = \"No. 014 / 120\",\n  stats = defaultStats,\n  avatar,\n  hue = 210,\n  tilt = 10,\n  ratio = 1.75,\n  idle = true,\n  className = \"\",\n  style,\n  onPointerMove,\n  onPointerLeave,\n  onPointerCancel,\n  ...rest\n}: CardProfileHoloProps) {\n  const root = React.useRef<HTMLDivElement>(null);\n  const st = React.useRef({ tx: 0.3, ty: 0.28, x: 0.3, y: 0.28, hover: false });\n\n  React.useEffect(() => {\n    const el = root.current;\n    if (!el) return;\n    const s = st.current;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const paint = () => {\n      const rx = reduce ? 0 : (0.5 - s.y) * 2 * tilt;\n      const ry = reduce ? 0 : (s.x - 0.5) * 2 * tilt;\n      const ang = 90 + (s.x - 0.5) * 140 + (s.y - 0.5) * 60;\n      el.style.setProperty(\"--hb-qk2-rx\", `${rx.toFixed(2)}deg`);\n      el.style.setProperty(\"--hb-qk2-ry\", `${ry.toFixed(2)}deg`);\n      el.style.setProperty(\"--hb-qk2-gx\", `${(s.x * 100).toFixed(1)}%`);\n      el.style.setProperty(\"--hb-qk2-gy\", `${(s.y * 100).toFixed(1)}%`);\n      el.style.setProperty(\"--hb-qk2-px\", `${(s.x * 100).toFixed(1)}%`);\n      el.style.setProperty(\"--hb-qk2-py\", `${(s.y * 100).toFixed(1)}%`);\n      el.style.setProperty(\"--hb-qk2-ang\", `${ang.toFixed(1)}deg`);\n    };\n    if (reduce) {\n      s.x = 0.3;\n      s.y = 0.28;\n      paint();\n      return;\n    }\n    let raf = 0;\n    const frame = (now: number) => {\n      const t = now / 1000;\n      if (!s.hover) {\n        if (idle) {\n          s.tx = 0.5 + 0.4 * Math.sin(t * 0.7);\n          s.ty = 0.5 + 0.32 * Math.sin(t * 0.55 + 0.8);\n        } else {\n          s.tx = 0.5;\n          s.ty = 0.5;\n        }\n      }\n      s.x += (s.tx - s.x) * 0.1;\n      s.y += (s.ty - s.y) * 0.1;\n      paint();\n      raf = requestAnimationFrame(frame);\n    };\n    const io = new IntersectionObserver(([entry]) => {\n      cancelAnimationFrame(raf);\n      if (entry.isIntersecting) raf = requestAnimationFrame(frame);\n    });\n    io.observe(el);\n    return () => {\n      io.disconnect();\n      cancelAnimationFrame(raf);\n    };\n  }, [tilt, idle]);\n\n  const move = (e: React.PointerEvent<HTMLDivElement>) => {\n    onPointerMove?.(e);\n    const r = e.currentTarget.getBoundingClientRect();\n    if (!r.width || !r.height) return;\n    const s = st.current;\n    s.hover = true;\n    s.tx = clamp01((e.clientX - r.left) / r.width);\n    s.ty = clamp01((e.clientY - r.top) / r.height);\n  };\n\n  const leave = (e: React.PointerEvent<HTMLDivElement>) => {\n    onPointerLeave?.(e);\n    st.current.hover = false;\n  };\n\n  const cancel = (e: React.PointerEvent<HTMLDivElement>) => {\n    onPointerCancel?.(e);\n    st.current.hover = false;\n  };\n\n  const ah = avatarHue(name);\n  const avatarStyle: React.CSSProperties = avatar\n    ? { backgroundImage: `url(${JSON.stringify(avatar)})` }\n    : { background: `linear-gradient(140deg, hsl(${ah} 62% 52%), hsl(${(ah + 40) % 360} 60% 34%))` };\n\n  return (\n    <div\n      ref={root}\n      className={`hb-qk2 ${className}`}\n      style={\n        {\n          \"--hb-qk2-r\": ratio,\n          \"--hb-qk2-h\": hue,\n          \"--hb-qk2-n\": Math.max(1, stats.length),\n          ...style,\n        } as React.CSSProperties\n      }\n      onPointerMove={move}\n      onPointerLeave={leave}\n      onPointerCancel={cancel}\n      {...rest}\n    >\n      <style href=\"hb-card-profile-holo\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qk2-card\">\n        <div className=\"hb-qk2-foil\" aria-hidden=\"true\" />\n        <div className=\"hb-qk2-tex\" aria-hidden=\"true\" />\n        <div className=\"hb-qk2-shine\" aria-hidden=\"true\" />\n        <div className=\"hb-qk2-in\">\n          <div className=\"hb-qk2-top\">\n            <span>{serial}</span>\n            <span className=\"hb-qk2-chip\">Holo</span>\n          </div>\n          <div className=\"hb-qk2-id\">\n            <span className=\"hb-qk2-av\" style={avatarStyle} aria-hidden=\"true\">\n              {avatar ? null : initials(name)}\n            </span>\n            <div className=\"hb-qk2-who\">\n              <h3 className=\"hb-qk2-name\">{name}</h3>\n              <p className=\"hb-qk2-role\">{role}</p>\n              {handle ? <p className=\"hb-qk2-role hb-qk2-handle\">{handle}</p> : null}\n            </div>\n          </div>\n          <div className=\"hb-qk2-stats\">\n            {stats.map((stat) => (\n              <div className=\"hb-qk2-stat\" key={stat.label}>\n                <span className=\"hb-qk2-v\">{stat.value}</span>\n                <span className=\"hb-qk2-l\">{stat.label}</span>\n              </div>\n            ))}\n          </div>\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}