{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-spotlight",
  "type": "registry:component",
  "title": "Navbar Spotlight",
  "description": "A pitch-black bar lit only where the pointer is: a flashlight reveals a dot grid, makes nearby labels glow and runs a beam along the bottom edge. Touch moves the light too, and idleAt can park it for a static hero.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "spotlight",
    "flashlight",
    "dark",
    "glow",
    "header"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-spotlight",
  "files": [
    {
      "path": "registry/hyperblur/navbar-spotlight.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-spotlight.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarSpotlightLink {\n  label: string;\n  href: string;\n}\n\nexport interface NavbarSpotlightProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  links?: NavbarSpotlightLink[];\n  active?: number;\n  defaultActive?: number;\n  onActiveChange?: (index: number) => void;\n  status?: string | null;\n  cta?: { label: string; href: string } | null;\n  size?: number;\n  idleAt?: number | null;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst css = `\n.hb-xi4 {\n  --hb-xi4-accent: #5ee7ff;\n  --hb-xi4-x: 50%;\n  --hb-xi4-y: 50%;\n  --hb-xi4-r: 150px;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  background: #030304;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xi4 *, .hb-xi4 *::before, .hb-xi4 *::after { box-sizing: border-box; }\n.hb-xi4-bar { position: relative; z-index: 2; overflow: hidden; background: #050506; }\n.hb-xi4-bar::after { content: \"\"; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: rgba(255,255,255,.07); }\n.hb-xi4-grid {\n  position: absolute;\n  inset: 0;\n  background-image: radial-gradient(rgba(255,255,255,.55) 1px, transparent 1.2px);\n  background-size: 14px 14px;\n  background-position: 7px 7px;\n  -webkit-mask-image: radial-gradient(var(--hb-xi4-r) circle at var(--hb-xi4-x) var(--hb-xi4-y), rgba(0,0,0,.5), transparent 70%);\n  mask-image: radial-gradient(var(--hb-xi4-r) circle at var(--hb-xi4-x) var(--hb-xi4-y), rgba(0,0,0,.5), transparent 70%);\n  opacity: var(--hb-xi4-on, 0);\n  transition: opacity .5s ease;\n  pointer-events: none;\n}\n.hb-xi4-glow {\n  position: absolute;\n  inset: 0;\n  background: radial-gradient(calc(var(--hb-xi4-r) * 1.4) circle at var(--hb-xi4-x) var(--hb-xi4-y), color-mix(in srgb, var(--hb-xi4-accent) 13%, transparent), transparent 70%);\n  opacity: var(--hb-xi4-on, 0);\n  transition: opacity .5s ease;\n  pointer-events: none;\n}\n.hb-xi4-beam {\n  position: absolute;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  z-index: 1;\n  height: 1px;\n  background: radial-gradient(calc(var(--hb-xi4-r) * 1.1) 2px at var(--hb-xi4-x) 50%, var(--hb-xi4-accent), transparent);\n  opacity: var(--hb-xi4-on, 0);\n  transition: opacity .5s ease;\n  pointer-events: none;\n}\n.hb-xi4-row { position: relative; display: flex; align-items: center; gap: 20px; max-width: 1140px; height: 64px; margin: 0 auto; padding: 0 24px; }\n.hb-xi4-lit {\n  position: absolute;\n  inset: 0;\n  z-index: 1;\n  -webkit-mask-image: radial-gradient(calc(var(--hb-xi4-r) * .8) circle at var(--hb-xi4-x) var(--hb-xi4-y), #000 0%, rgba(0,0,0,.6) 45%, transparent 100%);\n  mask-image: radial-gradient(calc(var(--hb-xi4-r) * .8) circle at var(--hb-xi4-x) var(--hb-xi4-y), #000 0%, rgba(0,0,0,.6) 45%, transparent 100%);\n  opacity: var(--hb-xi4-on, 0);\n  transition: opacity .5s ease;\n  pointer-events: none;\n}\n.hb-xi4-lit .hb-xi4-brand, .hb-xi4-lit .hb-xi4-link, .hb-xi4-lit .hb-xi4-status { color: #fff; text-shadow: 0 0 18px color-mix(in srgb, var(--hb-xi4-accent) 70%, transparent); }\n.hb-xi4-lit .hb-xi4-mark { border-color: var(--hb-xi4-accent); box-shadow: 0 0 14px color-mix(in srgb, var(--hb-xi4-accent) 60%, transparent); }\n.hb-xi4-lit .hb-xi4-ghost { border-color: color-mix(in srgb, var(--hb-xi4-accent) 70%, transparent); color: #fff; box-shadow: 0 0 20px -4px var(--hb-xi4-accent); }\n.hb-xi4-brand { display: inline-flex; align-items: center; gap: 10px; color: #8a8a8f; font-family: var(--font-mono, ui-monospace, monospace); font-size: 14px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; border-radius: 6px; }\n.hb-xi4-mark { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #3a3a40; border-radius: 6px; }\n.hb-xi4-mark::before { content: \"\"; width: 8px; height: 8px; border-radius: 2px; background: currentColor; transform: rotate(45deg); }\n.hb-xi4-links { display: flex; align-items: center; gap: 2px; margin: 0 auto; padding: 0; list-style: none; }\n.hb-xi4-link { position: relative; display: inline-flex; align-items: center; height: 36px; padding: 0 14px; color: #6e6e74; font-size: 14px; font-weight: 500; text-decoration: none; border-radius: 8px; transition: color .25s ease; }\n.hb-xi4-link:hover, .hb-xi4-link:focus-visible { color: #d4d4d8; }\n.hb-xi4-link[aria-current=\"page\"] { color: #ededed; }\n.hb-xi4-link[aria-current=\"page\"]::before { content: \"\"; position: absolute; left: 14px; right: 14px; top: -14px; height: 2px; border-radius: 0 0 2px 2px; background: var(--hb-xi4-accent); box-shadow: 0 0 12px var(--hb-xi4-accent); }\n.hb-xi4-end { display: flex; align-items: center; gap: 14px; }\n.hb-xi4-status { display: inline-flex; align-items: center; gap: 8px; color: #6e6e74; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; white-space: nowrap; }\n.hb-xi4-status::before { content: \"\"; width: 6px; height: 6px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.15); animation: hb-xi4-blink 2.4s ease-in-out infinite; }\n.hb-xi4-ghost { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid #2a2a30; border-radius: 9px; color: #c8c8cc; font-size: 13.5px; font-weight: 550; text-decoration: none; background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,0)); transition: border-color .25s ease, color .25s ease; }\n.hb-xi4-ghost:hover { border-color: #45454d; color: #fff; }\n.hb-xi4-ghost svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }\n.hb-xi4-burger { display: none; place-items: center; width: 38px; height: 38px; margin: 0; padding: 0; border: 1px solid #2a2a30; border-radius: 9px; background: transparent; color: #ededed; cursor: pointer; }\n.hb-xi4-burger svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }\n.hb-xi4-sheet { display: none; }\n.hb-xi4 a:focus-visible, .hb-xi4 button:focus-visible { outline: 2px solid var(--hb-xi4-accent); outline-offset: 2px; }\n.hb-xi4-stage { position: relative; height: 640px; overflow: hidden; background: radial-gradient(900px 420px at 50% -10%, color-mix(in srgb, var(--hb-xi4-accent) 9%, transparent), transparent 70%); }\n.hb-xi4-hero { max-width: 760px; margin: 0 auto; padding: 96px 24px 0; text-align: center; }\n.hb-xi4-chip { display: inline-flex; gap: 8px; padding: 6px 12px; border: 1px solid #222; border-radius: 999px; color: #8a8a8f; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; }\n.hb-xi4-chip b { color: var(--hb-xi4-accent); font-weight: 500; }\n.hb-xi4-h { margin: 22px 0 16px; font-size: clamp(34px, 6.4cqi, 62px); font-weight: 600; letter-spacing: -.045em; line-height: 1.02; background: linear-gradient(180deg, #fff 30%, #6e6e74); -webkit-background-clip: text; background-clip: text; color: transparent; }\n.hb-xi4-sub { max-width: 500px; margin: 0 auto; color: #8a8a8f; font-size: 16px; line-height: 1.6; }\n.hb-xi4-term { max-width: 640px; margin: 44px auto 0; padding: 16px 18px; border: 1px solid #1d1d21; border-radius: 12px; background: #08080a; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12.5px; line-height: 1.9; text-align: left; color: #6e6e74; }\n.hb-xi4-term b { color: #34d399; font-weight: 500; }\n.hb-xi4-term em { color: #f87171; font-style: normal; }\n@keyframes hb-xi4-blink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }\n@keyframes hb-xi4-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }\n@container (max-width: 800px) {\n  .hb-xi4-links, .hb-xi4-status, .hb-xi4-ghost { display: none; }\n  .hb-xi4-end { margin-left: auto; }\n  .hb-xi4-burger { display: grid; }\n  .hb-xi4-row { height: 58px; padding: 0 16px; }\n  .hb-xi4-sheet[data-open=\"true\"] { position: relative; z-index: 2; display: grid; padding: 6px 16px 16px; border-bottom: 1px solid rgba(255,255,255,.07); background: #050506; }\n  .hb-xi4-sheet a { display: flex; align-items: center; gap: 14px; height: 48px; border-bottom: 1px solid #141417; color: #a1a1a6; font-size: 15px; text-decoration: none; animation: hb-xi4-in .4s cubic-bezier(.2,.8,.2,1) both; }\n  .hb-xi4-sheet a span { width: 24px; color: #45454d; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; }\n  .hb-xi4-sheet a[aria-current=\"page\"] { color: #fff; }\n  .hb-xi4-sheet a[aria-current=\"page\"] span { color: var(--hb-xi4-accent); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-xi4 *, .hb-xi4 *::before, .hb-xi4 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultLinks: NavbarSpotlightLink[] = [\n  { label: \"Platform\", href: \"#\" },\n  { label: \"Detection\", href: \"#\" },\n  { label: \"Integrations\", href: \"#\" },\n  { label: \"Customers\", href: \"#\" },\n  { label: \"Docs\", href: \"#\" },\n];\n\nfunction Row({\n  brand,\n  links,\n  current,\n  status,\n  cta,\n  onSelect,\n  burger,\n}: {\n  brand: string;\n  links: NavbarSpotlightLink[];\n  current: number;\n  status: string | null;\n  cta: { label: string; href: string } | null;\n  onSelect?: (i: number) => void;\n  burger?: React.ReactNode;\n}) {\n  const arrow = (\n    <svg viewBox=\"0 0 12 12\" aria-hidden=\"true\">\n      <path d=\"M2.5 6h7M6.5 3l3 3-3 3\" />\n    </svg>\n  );\n  return (\n    <>\n      <a href=\"#\" className=\"hb-xi4-brand\" aria-label={`${brand} home`}>\n        <span className=\"hb-xi4-mark\" aria-hidden=\"true\" />\n        {brand}\n      </a>\n      <ul className=\"hb-xi4-links\">\n        {links.map((link, i) => (\n          <li key={link.label}>\n            <a href={link.href} className=\"hb-xi4-link\" aria-current={i === current ? \"page\" : undefined} onClick={() => onSelect?.(i)}>\n              {link.label}\n            </a>\n          </li>\n        ))}\n      </ul>\n      <div className=\"hb-xi4-end\">\n        {status && <span className=\"hb-xi4-status\">{status}</span>}\n        {cta && (\n          <a href={cta.href} className=\"hb-xi4-ghost\">\n            {cta.label}\n            {arrow}\n          </a>\n        )}\n        {burger}\n      </div>\n    </>\n  );\n}\n\nexport function NavbarSpotlight({\n  brand = \"Nocturne\",\n  links = defaultLinks,\n  active,\n  defaultActive = 1,\n  onActiveChange,\n  status = \"All systems normal\",\n  cta = { label: \"Book a demo\", href: \"#\" },\n  size = 150,\n  idleAt = null,\n  accent = \"#5ee7ff\",\n  showBackdrop = true,\n  className = \"\",\n  style,\n  ...rest\n}: NavbarSpotlightProps) {\n  const uid = React.useId();\n  const barRef = React.useRef<HTMLDivElement>(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  const track = (e: React.PointerEvent<HTMLDivElement>) => {\n    const bar = barRef.current;\n    if (!bar) return;\n    const r = bar.getBoundingClientRect();\n    bar.style.setProperty(\"--hb-xi4-x\", `${(e.clientX - r.left).toFixed(1)}px`);\n    bar.style.setProperty(\"--hb-xi4-y\", `${(e.clientY - r.top).toFixed(1)}px`);\n    bar.style.setProperty(\"--hb-xi4-on\", \"1\");\n  };\n  const leave = () => {\n    const bar = barRef.current;\n    if (!bar) return;\n    if (idleAt === null) {\n      bar.style.setProperty(\"--hb-xi4-on\", \"0\");\n      return;\n    }\n    bar.style.setProperty(\"--hb-xi4-x\", `${(idleAt * 100).toFixed(2)}%`);\n    bar.style.setProperty(\"--hb-xi4-y\", \"50%\");\n  };\n\n  const idle =\n    idleAt === null\n      ? {}\n      : { \"--hb-xi4-x\": `${(Math.min(1, Math.max(0, idleAt)) * 100).toFixed(2)}%`, \"--hb-xi4-y\": \"50%\", \"--hb-xi4-on\": \"1\" };\n\n  return (\n    <header\n      className={`hb-xi4 ${className}`}\n      style={{ \"--hb-xi4-accent\": accent, \"--hb-xi4-r\": `${size}px`, ...style } as React.CSSProperties}\n      onKeyDown={(e) => {\n        if (e.key === \"Escape\" && open) setOpen(false);\n      }}\n      {...rest}\n    >\n      <style href=\"hb-navbar-spotlight\" precedence=\"default\">\n        {css}\n      </style>\n      <div\n        ref={barRef}\n        className=\"hb-xi4-bar\"\n        style={idle as React.CSSProperties}\n        onPointerMove={track}\n        onPointerDown={track}\n        onPointerLeave={leave}\n      >\n        <span className=\"hb-xi4-glow\" aria-hidden=\"true\" />\n        <span className=\"hb-xi4-grid\" aria-hidden=\"true\" />\n        <nav className=\"hb-xi4-row\" aria-label=\"Main\">\n          <Row\n            brand={brand}\n            links={links}\n            current={current}\n            status={status}\n            cta={cta}\n            onSelect={select}\n            burger={\n              <button\n                type=\"button\"\n                className=\"hb-xi4-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                <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                  <path d={open ? \"M4 4L12 12\" : \"M2.5 5.5L13.5 5.5\"} />\n                  <path d={open ? \"M4 12L12 4\" : \"M2.5 10.5L13.5 10.5\"} />\n                </svg>\n              </button>\n            }\n          />\n        </nav>\n        <div className=\"hb-xi4-lit\" aria-hidden=\"true\" inert>\n          <div className=\"hb-xi4-row\">\n            <Row brand={brand} links={links} current={current} status={status} cta={cta} />\n          </div>\n        </div>\n        <span className=\"hb-xi4-beam\" aria-hidden=\"true\" />\n      </div>\n      <div id={`${uid}-sheet`} className=\"hb-xi4-sheet\" data-open={open ? \"true\" : \"false\"}>\n        {links.map((link, i) => (\n          <a\n            key={link.label}\n            href={link.href}\n            aria-current={i === current ? \"page\" : undefined}\n            style={{ animationDelay: `${(i * 0.04).toFixed(2)}s` }}\n            onClick={() => select(i)}\n          >\n            <span>{String(i + 1).padStart(2, \"0\")}</span>\n            {link.label}\n          </a>\n        ))}\n        {cta && (\n          <a href={cta.href} onClick={() => setOpen(false)}>\n            <span>{\"->\"}</span>\n            {cta.label}\n          </a>\n        )}\n      </div>\n      {showBackdrop && (\n        <div className=\"hb-xi4-stage\" aria-hidden=\"true\">\n          <div className=\"hb-xi4-hero\">\n            <span className=\"hb-xi4-chip\">\n              <b>v3.2</b> Runtime detection for serverless\n            </span>\n            <h2 className=\"hb-xi4-h\">See every request before it lands.</h2>\n            <p className=\"hb-xi4-sub\">Nocturne watches traffic at the edge, scores intent in under 4 ms and blocks the bad actors your WAF lets through.</p>\n            <div className=\"hb-xi4-term\">\n              <div>\n                <b>allow</b> 203.0.113.24 GET /api/orders 200 1.8ms\n              </div>\n              <div>\n                <b>allow</b> 198.51.100.7 POST /checkout 201 3.1ms\n              </div>\n              <div>\n                <em>block</em> 192.0.2.91 POST /login credential stuffing, score 0.97\n              </div>\n              <div>\n                <b>allow</b> 203.0.113.80 GET /assets/app.js 304 0.4ms\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}