{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-prism-glass",
  "type": "registry:component",
  "title": "Navbar Prism Glass",
  "description": "A floating frosted bar whose blur, tint and shadow deepen as the page scrolls, with a specular sheen and a lit rim that follow the pointer. The active link carries a softly pulsing glow dot.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "glass",
    "backdrop blur",
    "pointer",
    "scroll",
    "header"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-prism-glass",
  "files": [
    {
      "path": "registry/hyperblur/navbar-prism-glass.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-prism-glass.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarPrismGlassLink {\n  label: string;\n  href: string;\n  badge?: string;\n}\n\nexport interface NavbarPrismGlassProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  links?: NavbarPrismGlassLink[];\n  active?: number;\n  defaultActive?: number;\n  onActiveChange?: (index: number) => void;\n  signIn?: { label: string; href: string } | null;\n  cta?: { label: string; href: string } | null;\n  frost?: number;\n  scrollRange?: number;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst css = `\n.hb-xi1 {\n  --hb-xi1-accent: #8fa8ff;\n  --hb-xi1-f: .35;\n  --hb-xi1-mx: 50%;\n  --hb-xi1-lit: 0;\n  position: sticky;\n  top: 12px;\n  z-index: 40;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  padding: 0 16px;\n  color: #f2f3f7;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xi1 *, .hb-xi1 *::before, .hb-xi1 *::after { box-sizing: border-box; }\n.hb-xi1-bar {\n  position: relative;\n  max-width: 1080px;\n  margin: 0 auto;\n  border-radius: 20px;\n  background: linear-gradient(180deg, rgba(255,255,255,calc(.06 + var(--hb-xi1-f) * .05)), rgba(255,255,255,calc(.02 + var(--hb-xi1-f) * .03))), rgba(14,16,24,calc(.18 + var(--hb-xi1-f) * .5));\n  -webkit-backdrop-filter: blur(calc(6px + var(--hb-xi1-f) * 16px)) saturate(calc(1.2 + var(--hb-xi1-f) * .7));\n  backdrop-filter: blur(calc(6px + var(--hb-xi1-f) * 16px)) saturate(calc(1.2 + var(--hb-xi1-f) * .7));\n  box-shadow: 0 1px 0 rgba(255,255,255,.14) inset, 0 -1px 0 rgba(0,0,0,.25) inset, 0 18px 40px -18px rgba(0,0,0,calc(.35 + var(--hb-xi1-f) * .35)), 0 2px 6px rgba(0,0,0,.18);\n  transition: box-shadow .4s ease;\n}\n.hb-xi1-bar::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  padding: 1px;\n  border-radius: inherit;\n  background: radial-gradient(260px 120px at var(--hb-xi1-mx) 0%, rgba(255,255,255,calc(.22 + var(--hb-xi1-lit) * .5)), transparent 70%), linear-gradient(180deg, rgba(255,255,255,.22), rgba(255,255,255,.05) 45%, rgba(255,255,255,.12));\n  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n  -webkit-mask-composite: xor;\n  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);\n  mask-composite: exclude;\n  pointer-events: none;\n}\n.hb-xi1-sheen {\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  overflow: hidden;\n  pointer-events: none;\n}\n.hb-xi1-sheen::before {\n  content: \"\";\n  position: absolute;\n  top: -60%;\n  left: var(--hb-xi1-mx);\n  width: 280px;\n  height: 220%;\n  transform: translateX(-50%);\n  background: radial-gradient(closest-side, rgba(255,255,255,.12), transparent);\n  opacity: var(--hb-xi1-lit);\n  transition: opacity .35s ease;\n}\n.hb-xi1-sheen::after {\n  content: \"\";\n  position: absolute;\n  inset: 0 0 auto;\n  height: 50%;\n  background: linear-gradient(180deg, rgba(255,255,255,.07), transparent);\n}\n.hb-xi1-row {\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 18px;\n  height: 60px;\n  padding: 0 10px 0 18px;\n}\n.hb-xi1-brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-size: 16px; font-weight: 650; letter-spacing: -.02em; text-decoration: none; border-radius: 8px; }\n.hb-xi1-mark { position: relative; width: 24px; height: 24px; border-radius: 50%; background: conic-gradient(from 210deg, #ff9ad5, #8fa8ff, #7cf2d6, #ffe08a, #ff9ad5); box-shadow: 0 0 0 1px rgba(255,255,255,.35) inset, 0 4px 12px -2px rgba(143,168,255,.6); }\n.hb-xi1-mark::after { content: \"\"; position: absolute; inset: 6px; border-radius: 50%; background: rgba(12,14,22,.85); box-shadow: 0 1px 0 rgba(255,255,255,.25); }\n.hb-xi1-links { display: flex; align-items: center; gap: 2px; margin: 0 auto; padding: 0; list-style: none; }\n.hb-xi1-link {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  gap: 7px;\n  height: 36px;\n  padding: 0 13px;\n  border-radius: 12px;\n  color: rgba(242,243,247,.68);\n  font-size: 14px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: color .25s ease, background-color .25s ease, transform .35s cubic-bezier(.2,.8,.2,1);\n}\n.hb-xi1-link:hover { color: #fff; background: rgba(255,255,255,.07); }\n.hb-xi1-link:active { transform: translateY(1px); }\n.hb-xi1-link[aria-current=\"page\"] { color: #fff; }\n.hb-xi1-link[aria-current=\"page\"]::after {\n  content: \"\";\n  position: absolute;\n  left: 50%;\n  bottom: 3px;\n  width: 4px;\n  height: 4px;\n  margin-left: -2px;\n  border-radius: 50%;\n  background: var(--hb-xi1-accent);\n  box-shadow: 0 0 8px 1px var(--hb-xi1-accent), 0 0 18px 2px color-mix(in srgb, var(--hb-xi1-accent) 50%, transparent);\n  animation: hb-xi1-pulse 2.8s ease-in-out infinite;\n}\n.hb-xi1-badge { padding: 1px 6px; border-radius: 6px; background: color-mix(in srgb, var(--hb-xi1-accent) 22%, transparent); color: color-mix(in srgb, var(--hb-xi1-accent) 60%, #fff); font-size: 10.5px; font-weight: 650; letter-spacing: .02em; box-shadow: 0 0 0 1px color-mix(in srgb, var(--hb-xi1-accent) 35%, transparent) inset; }\n.hb-xi1-end { display: flex; align-items: center; gap: 6px; }\n.hb-xi1-in { display: inline-flex; align-items: center; height: 36px; padding: 0 12px; border-radius: 12px; color: rgba(242,243,247,.8); font-size: 14px; font-weight: 500; text-decoration: none; transition: color .2s ease, background-color .2s ease; }\n.hb-xi1-in:hover { color: #fff; background: rgba(255,255,255,.07); }\n.hb-xi1-cta {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  height: 40px;\n  padding: 0 16px;\n  border-radius: 13px;\n  background: linear-gradient(180deg, #ffffff, #dfe3ef);\n  color: #0d0f17;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  box-shadow: 0 1px 0 #fff inset, 0 -1px 0 rgba(0,0,0,.12) inset, 0 8px 20px -8px rgba(143,168,255,.7);\n  transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .25s ease;\n}\n.hb-xi1-cta:hover { transform: translateY(-1px); box-shadow: 0 1px 0 #fff inset, 0 -1px 0 rgba(0,0,0,.12) inset, 0 12px 26px -8px rgba(143,168,255,.85); }\n.hb-xi1-cta:active { transform: translateY(0) scale(.98); }\n.hb-xi1-burger { display: none; place-items: center; width: 40px; height: 40px; margin: 0; padding: 0; border: 0; border-radius: 12px; background: rgba(255,255,255,.08); color: #fff; cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset; }\n.hb-xi1-burger span { position: relative; display: block; width: 16px; height: 10px; }\n.hb-xi1-burger span::before, .hb-xi1-burger span::after { content: \"\"; position: absolute; left: 0; right: 0; height: 1.6px; border-radius: 2px; background: currentColor; transition: transform .35s cubic-bezier(.7,0,.2,1), top .35s cubic-bezier(.7,0,.2,1); }\n.hb-xi1-burger span::before { top: 1px; }\n.hb-xi1-burger span::after { top: 7.4px; }\n.hb-xi1-burger[aria-expanded=\"true\"] span::before { top: 4.2px; transform: rotate(45deg); }\n.hb-xi1-burger[aria-expanded=\"true\"] span::after { top: 4.2px; transform: rotate(-45deg); }\n.hb-xi1-sheet { display: none; }\n.hb-xi1 a:focus-visible, .hb-xi1 button:focus-visible { outline: 2px solid var(--hb-xi1-accent); outline-offset: 2px; }\n.hb-xi1-stage { position: relative; height: 700px; overflow: hidden; background: #07080d; color: #f2f3f7; container-type: inline-size; }\n.hb-xi1-wrap { position: relative; background: #07080d; }\n.hb-xi1-wrap > .hb-xi1 { position: absolute; top: 16px; left: 0; right: 0; }\n.hb-xi1-orb { position: absolute; border-radius: 50%; filter: blur(48px); opacity: .85; animation: hb-xi1-drift 14s ease-in-out infinite alternate; }\n.hb-xi1-hero { position: relative; max-width: 760px; margin: 0 auto; padding: 150px 24px 0; text-align: center; }\n.hb-xi1-eyebrow { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 999px; background: rgba(255,255,255,.06); box-shadow: 0 0 0 1px rgba(255,255,255,.1) inset; color: rgba(242,243,247,.8); font-size: 13px; }\n.hb-xi1-h { margin: 22px 0 16px; font-family: var(--font-grotesk, var(--font-sans, ui-sans-serif, system-ui, sans-serif)); font-size: clamp(36px, 7cqi, 68px); font-weight: 600; letter-spacing: -.04em; line-height: 1; }\n.hb-xi1-sub { max-width: 520px; margin: 0 auto; color: rgba(242,243,247,.62); font-size: 17px; line-height: 1.55; }\n.hb-xi1-tiles { position: absolute; left: 50%; bottom: -40px; display: flex; gap: 18px; transform: translateX(-50%); }\n.hb-xi1-tile { width: 210px; height: 260px; border-radius: 22px; box-shadow: 0 0 0 1px rgba(255,255,255,.12) inset, 0 30px 60px -20px rgba(0,0,0,.7); }\n@keyframes hb-xi1-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }\n@keyframes hb-xi1-drift { from { transform: translate3d(0,0,0) scale(1); } to { transform: translate3d(40px,-30px,0) scale(1.12); } }\n@keyframes hb-xi1-drop { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: none; } }\n@container (max-width: 780px) {\n  .hb-xi1-links, .hb-xi1-in { display: none; }\n  .hb-xi1-end { margin-left: auto; }\n  .hb-xi1-burger { display: grid; }\n  .hb-xi1-row { height: 56px; padding: 0 8px 0 14px; }\n  .hb-xi1-sheet[data-open=\"true\"] { position: relative; display: grid; gap: 2px; padding: 4px 8px 10px; animation: hb-xi1-drop .35s cubic-bezier(.2,.8,.2,1) both; }\n  .hb-xi1-sheet a { display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 0 12px; border-radius: 12px; color: rgba(242,243,247,.82); font-size: 15px; font-weight: 500; text-decoration: none; }\n  .hb-xi1-sheet a:hover, .hb-xi1-sheet a[aria-current=\"page\"] { background: rgba(255,255,255,.07); color: #fff; }\n  .hb-xi1-sheet a svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; opacity: .5; }\n  .hb-xi1-tiles { display: none; }\n}\n@container (max-width: 420px) {\n  .hb-xi1-cta { height: 36px; padding: 0 12px; font-size: 13px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-xi1 *, .hb-xi1 *::before, .hb-xi1 *::after, .hb-xi1-stage * { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultLinks: NavbarPrismGlassLink[] = [\n  { label: \"Studio\", href: \"#\" },\n  { label: \"Presets\", href: \"#\", badge: \"New\" },\n  { label: \"Gallery\", href: \"#\" },\n  { label: \"Pricing\", href: \"#\" },\n  { label: \"Learn\", href: \"#\" },\n];\n\nexport function NavbarPrismGlass({\n  brand = \"Halo\",\n  links = defaultLinks,\n  active,\n  defaultActive = 0,\n  onActiveChange,\n  signIn = { label: \"Sign in\", href: \"#\" },\n  cta = { label: \"Open Studio\", href: \"#\" },\n  frost,\n  scrollRange = 140,\n  accent = \"#8fa8ff\",\n  showBackdrop = true,\n  className = \"\",\n  style,\n  ...rest\n}: NavbarPrismGlassProps) {\n  const uid = React.useId();\n  const rootRef = React.useRef<HTMLElement>(null);\n  const [inner, setInner] = React.useState(defaultActive);\n  const [open, setOpen] = React.useState(false);\n  const current = active ?? inner;\n\n  const select = (i: number) => {\n    if (active === undefined) setInner(i);\n    onActiveChange?.(i);\n    setOpen(false);\n  };\n\n  React.useEffect(() => {\n    const node = rootRef.current;\n    if (!node) return;\n    if (frost !== undefined) {\n      node.style.setProperty(\"--hb-xi1-f\", Math.min(1, Math.max(0, frost)).toFixed(3));\n      return;\n    }\n    if (showBackdrop) return;\n    let frame = 0;\n    const update = () => {\n      frame = 0;\n      const v = Math.min(1, Math.max(0, window.scrollY / Math.max(1, scrollRange)));\n      node.style.setProperty(\"--hb-xi1-f\", v.toFixed(3));\n    };\n    const onScroll = () => {\n      if (!frame) frame = window.requestAnimationFrame(update);\n    };\n    update();\n    window.addEventListener(\"scroll\", onScroll, { passive: true });\n    return () => {\n      window.cancelAnimationFrame(frame);\n      window.removeEventListener(\"scroll\", onScroll);\n    };\n  }, [frost, scrollRange, showBackdrop]);\n\n  const onMove = (e: React.PointerEvent<HTMLDivElement>) => {\n    const node = rootRef.current;\n    if (!node) return;\n    const r = e.currentTarget.getBoundingClientRect();\n    node.style.setProperty(\"--hb-xi1-mx\", `${(e.clientX - r.left).toFixed(1)}px`);\n    node.style.setProperty(\"--hb-xi1-lit\", \"1\");\n  };\n  const onLeave = () => rootRef.current?.style.setProperty(\"--hb-xi1-lit\", \"0\");\n\n  const chevron = (\n    <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n      <path d=\"M5 3l4 4-4 4\" />\n    </svg>\n  );\n\n  const header = (\n    <header\n      ref={rootRef}\n      className={`hb-xi1 ${className}`}\n      style={{ \"--hb-xi1-accent\": accent, ...style } as React.CSSProperties}\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\" && open) setOpen(false);\n      }}\n      {...rest}\n    >\n      <style href=\"hb-navbar-prism-glass\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-xi1-bar\" onPointerMove={onMove} onPointerLeave={onLeave}>\n        <span className=\"hb-xi1-sheen\" aria-hidden=\"true\" />\n        <nav className=\"hb-xi1-row\" aria-label=\"Main\">\n          <a href=\"#\" className=\"hb-xi1-brand\" aria-label={`${brand} home`}>\n            <span className=\"hb-xi1-mark\" aria-hidden=\"true\" />\n            {brand}\n          </a>\n          <ul className=\"hb-xi1-links\">\n            {links.map((link, i) => (\n              <li key={link.label}>\n                <a\n                  href={link.href}\n                  className=\"hb-xi1-link\"\n                  aria-current={i === current ? \"page\" : undefined}\n                  onClick={() => select(i)}\n                >\n                  {link.label}\n                  {link.badge && <span className=\"hb-xi1-badge\">{link.badge}</span>}\n                </a>\n              </li>\n            ))}\n          </ul>\n          <div className=\"hb-xi1-end\">\n            {signIn && (\n              <a href={signIn.href} className=\"hb-xi1-in\">\n                {signIn.label}\n              </a>\n            )}\n            {cta && (\n              <a href={cta.href} className=\"hb-xi1-cta\">\n                {cta.label}\n              </a>\n            )}\n            <button\n              type=\"button\"\n              className=\"hb-xi1-burger\"\n              aria-label={open ? \"Close menu\" : \"Open menu\"}\n              aria-expanded={open}\n              aria-controls={`${uid}-sheet`}\n              onClick={() => setOpen((v) => !v)}\n            >\n              <span aria-hidden=\"true\" />\n            </button>\n          </div>\n        </nav>\n        <div id={`${uid}-sheet`} className=\"hb-xi1-sheet\" data-open={open ? \"true\" : \"false\"}>\n          {links.map((link, i) => (\n            <a key={link.label} href={link.href} aria-current={i === current ? \"page\" : undefined} onClick={() => select(i)}>\n              <span>{link.label}</span>\n              {chevron}\n            </a>\n          ))}\n          {signIn && (\n            <a href={signIn.href} onClick={() => setOpen(false)}>\n              <span>{signIn.label}</span>\n              {chevron}\n            </a>\n          )}\n        </div>\n      </div>\n    </header>\n  );\n\n  if (!showBackdrop) return header;\n\n  return (\n    <div className=\"hb-xi1-wrap\">\n      {header}\n      <div className=\"hb-xi1-stage\" aria-hidden=\"true\">\n        <span className=\"hb-xi1-orb\" style={{ width: 420, height: 420, left: \"8%\", top: 20, background: \"#ff7ac6\" }} />\n        <span className=\"hb-xi1-orb\" style={{ width: 460, height: 460, right: \"6%\", top: -60, background: \"#5b7cff\", animationDelay: \"-5s\" }} />\n        <span className=\"hb-xi1-orb\" style={{ width: 360, height: 360, left: \"38%\", top: 260, background: \"#34e0b8\", animationDelay: \"-9s\" }} />\n        <div className=\"hb-xi1-hero\">\n          <span className=\"hb-xi1-eyebrow\">Halo 4 · Relight any photo in one pass</span>\n          <h2 className=\"hb-xi1-h\">Edit the light, not the pixels.</h2>\n          <p className=\"hb-xi1-sub\">Drop a portrait, drag the sun, and Halo rebuilds shadows, reflections and skin tone in real time.</p>\n        </div>\n        <div className=\"hb-xi1-tiles\">\n          <span className=\"hb-xi1-tile\" style={{ background: \"linear-gradient(160deg, #ffb38a, #ff5f8f 55%, #46206b)\" }} />\n          <span className=\"hb-xi1-tile\" style={{ background: \"linear-gradient(200deg, #9be7ff, #4c6cff 60%, #1b1d4a)\", transform: \"translateY(-30px)\" }} />\n          <span className=\"hb-xi1-tile\" style={{ background: \"linear-gradient(170deg, #c6ffdd, #2fbf8f 50%, #0e3b3a)\" }} />\n        </div>\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}