{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-vertical-rail",
  "type": "registry:component",
  "title": "Navbar Vertical Rail",
  "description": "A header turned on its side: a sticky left rail with rotated, numbered links, a glowing marker that slides to the current page and a round call to action. Under 640px it becomes a top bar with a clip-path menu of large numbered links.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "vertical",
    "rail",
    "portfolio",
    "studio",
    "header"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-vertical-rail",
  "files": [
    {
      "path": "registry/hyperblur/navbar-vertical-rail.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-vertical-rail.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarVerticalRailLink {\n  label: string;\n  href: string;\n}\n\nexport interface NavbarVerticalRailProps extends React.HTMLAttributes<HTMLDivElement> {\n  brand?: string;\n  links?: NavbarVerticalRailLink[];\n  active?: number;\n  defaultActive?: number;\n  onActiveChange?: (index: number) => void;\n  cta?: { label: string; href: string } | null;\n  status?: string | null;\n  menuOpen?: boolean;\n  defaultMenuOpen?: boolean;\n  onMenuOpenChange?: (open: boolean) => void;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst defaultLinks: NavbarVerticalRailLink[] = [\n  { label: \"Work\", href: \"#work\" },\n  { label: \"Studio\", href: \"#studio\" },\n  { label: \"Index\", href: \"#index\" },\n  { label: \"Notes\", href: \"#notes\" },\n  { label: \"Contact\", href: \"#contact\" },\n];\n\nconst ease = \"cubic-bezier(.22,1,.36,1)\";\n\nconst css = `\n.hb-xj2 {\n  --hb-xj2-accent: #d4ff3f;\n  position: relative;\n  box-sizing: border-box;\n  display: flex;\n  width: 100%;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xj2 *, .hb-xj2 *::before, .hb-xj2 *::after { box-sizing: border-box; }\n.hb-xj2[data-backdrop=\"true\"] { min-height: 660px; overflow: hidden; }\n.hb-xj2-rail {\n  position: sticky;\n  top: 0;\n  z-index: 3;\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  flex: none;\n  width: 84px;\n  height: 100dvh;\n  padding: 22px 0 20px;\n  border-right: 1px solid #1f1f1f;\n  background: linear-gradient(180deg, #111111, #0c0c0c);\n}\n.hb-xj2[data-backdrop=\"true\"] .hb-xj2-rail { height: auto; min-height: 660px; align-self: stretch; }\n.hb-xj2-logo {\n  display: grid;\n  place-items: center;\n  width: 44px;\n  height: 44px;\n  border-radius: 14px;\n  background: var(--hb-xj2-accent);\n  color: #0a0a0a;\n  font-family: var(--font-grotesk, inherit);\n  font-size: 17px;\n  font-weight: 700;\n  letter-spacing: -.04em;\n  text-decoration: none;\n  box-shadow: inset 0 -2px 0 rgba(0,0,0,.18), 0 10px 24px -10px color-mix(in srgb, var(--hb-xj2-accent) 70%, transparent);\n  transition: transform .4s ${ease};\n}\n.hb-xj2-logo:hover { transform: rotate(-8deg) scale(1.04); }\n.hb-xj2-count {\n  margin-top: 22px;\n  color: #6b6b6b;\n  font-family: var(--font-mono, monospace);\n  font-size: 11px;\n  letter-spacing: .04em;\n  font-variant-numeric: tabular-nums;\n}\n.hb-xj2-count b { display: block; color: #ededed; font-weight: 500; text-align: center; }\n.hb-xj2-wrap { position: relative; margin: auto 0; }\n.hb-xj2-list {\n  display: flex;\n  flex-direction: column;\n  align-items: center;\n  gap: 2px;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n.hb-xj2-wrap::before {\n  content: \"\";\n  position: absolute;\n  top: 4px;\n  bottom: 4px;\n  left: 50%;\n  width: 1px;\n  background: linear-gradient(180deg, transparent, #262626 12%, #262626 88%, transparent);\n  transform: translateX(-21px);\n}\n.hb-xj2-mark {\n  position: absolute;\n  left: 50%;\n  top: 0;\n  width: 3px;\n  height: var(--hb-xj2-h, 0px);\n  border-radius: 3px;\n  background: var(--hb-xj2-accent);\n  box-shadow: 0 0 14px 1px color-mix(in srgb, var(--hb-xj2-accent) 55%, transparent);\n  transform: translate(-22px, var(--hb-xj2-y, 0px));\n  transition: transform .6s ${ease}, height .6s ${ease};\n}\n.hb-xj2-link {\n  position: relative;\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  padding: 9px 8px;\n  border-radius: 10px;\n  color: #8a8a8a;\n  font-size: 12px;\n  font-weight: 500;\n  letter-spacing: .08em;\n  text-transform: uppercase;\n  text-decoration: none;\n  writing-mode: vertical-rl;\n  transform: rotate(180deg);\n  transition: color .25s ease, background-color .25s ease;\n}\n.hb-xj2-link:hover { color: #ededed; background: rgba(255,255,255,.04); }\n.hb-xj2-link[aria-current=\"page\"] { color: #ededed; }\n.hb-xj2-num { color: #4d4d4d; font-family: var(--font-mono, monospace); font-size: 10px; letter-spacing: 0; transition: color .25s ease; }\n.hb-xj2-link[aria-current=\"page\"] .hb-xj2-num { color: var(--hb-xj2-accent); }\n.hb-xj2-foot { display: flex; flex-direction: column; align-items: center; gap: 14px; }\n.hb-xj2-status { position: relative; display: grid; place-items: center; width: 20px; height: 20px; }\n.hb-xj2-pulse { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #22c55e; }\n.hb-xj2-pulse::after { content: \"\"; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #22c55e; animation: hb-xj2-ping 2.2s ${ease} infinite; }\n@keyframes hb-xj2-ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(1.6); opacity: 0; } }\n.hb-xj2-cta {\n  position: relative;\n  display: grid;\n  place-items: center;\n  width: 48px;\n  height: 48px;\n  border-radius: 50%;\n  border: 1px solid #2a2a2a;\n  background: #151515;\n  color: #ededed;\n  text-decoration: none;\n  overflow: hidden;\n  transition: border-color .3s ease, color .3s ease;\n}\n.hb-xj2-cta::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: 50%;\n  background: var(--hb-xj2-accent);\n  transform: scale(0);\n  transition: transform .45s ${ease};\n}\n.hb-xj2-cta:hover { border-color: var(--hb-xj2-accent); color: #0a0a0a; }\n.hb-xj2-cta:hover::before { transform: scale(1); }\n.hb-xj2-cta svg { position: relative; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n.hb-xj2-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n.hb-xj2 a:focus-visible, .hb-xj2 button:focus-visible { outline: 2px solid var(--hb-xj2-accent); outline-offset: 2px; }\n.hb-xj2-main { position: relative; flex: 1; min-width: 0; }\n.hb-xj2-top { display: none; }\n.hb-xj2-panel { display: none; }\n@container (max-width: 640px) {\n  .hb-xj2 { flex-direction: column; }\n  .hb-xj2-rail { display: none; }\n  .hb-xj2-top {\n    position: sticky;\n    top: 0;\n    z-index: 4;\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    height: 62px;\n    padding: 0 14px;\n    border-bottom: 1px solid #1f1f1f;\n    background: rgba(12,12,12,.9);\n    backdrop-filter: blur(14px);\n  }\n  .hb-xj2-top .hb-xj2-logo { width: 38px; height: 38px; border-radius: 12px; font-size: 15px; }\n  .hb-xj2-crumb { display: flex; align-items: center; gap: 10px; color: #8a8a8a; font-family: var(--font-mono, monospace); font-size: 12px; }\n  .hb-xj2-crumb b { color: #ededed; font-family: inherit; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }\n  .hb-xj2-menu {\n    display: inline-flex;\n    align-items: center;\n    gap: 8px;\n    height: 38px;\n    padding: 0 14px;\n    border: 1px solid #2a2a2a;\n    border-radius: 999px;\n    background: #151515;\n    color: #ededed;\n    font: inherit;\n    font-size: 12px;\n    font-weight: 600;\n    letter-spacing: .08em;\n    text-transform: uppercase;\n    cursor: pointer;\n  }\n  .hb-xj2-dots { display: grid; grid-template-columns: repeat(2, 3px); gap: 3px; transition: transform .5s ${ease}; }\n  .hb-xj2-dots span { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }\n  .hb-xj2[data-open=\"true\"] .hb-xj2-dots { transform: rotate(45deg); }\n  .hb-xj2[data-backdrop=\"true\"] .hb-xj2-top { position: relative; }\n  .hb-xj2[data-backdrop=\"false\"] .hb-xj2-panel { position: fixed; }\n  .hb-xj2-panel {\n    position: absolute;\n    top: 62px;\n    left: 0;\n    right: 0;\n    z-index: 5;\n    display: block;\n    padding: 10px 14px 18px;\n    border-bottom: 1px solid #1f1f1f;\n    background: #0d0d0d;\n    clip-path: inset(0 0 100% 0);\n    transition: clip-path .6s ${ease};\n  }\n  .hb-xj2[data-open=\"true\"] .hb-xj2-panel { clip-path: inset(0 0 0 0); }\n  .hb-xj2-plist { margin: 0; padding: 0; list-style: none; }\n  .hb-xj2-plink {\n    display: flex;\n    align-items: baseline;\n    gap: 14px;\n    padding: 12px 4px;\n    border-bottom: 1px solid #1a1a1a;\n    color: #9a9a9a;\n    font-family: var(--font-grotesk, inherit);\n    font-size: 30px;\n    font-weight: 500;\n    letter-spacing: -.03em;\n    text-decoration: none;\n    transform: translateY(14px);\n    opacity: 0;\n    transition: transform .6s ${ease}, opacity .4s ease, color .2s ease;\n    transition-delay: calc(var(--hb-xj2-i) * 45ms + 80ms);\n  }\n  .hb-xj2[data-open=\"true\"] .hb-xj2-plink { transform: none; opacity: 1; }\n  .hb-xj2-plink[aria-current=\"page\"], .hb-xj2-plink:hover { color: #ededed; }\n  .hb-xj2-plink small { color: #4d4d4d; font-family: var(--font-mono, monospace); font-size: 11px; letter-spacing: 0; }\n  .hb-xj2-plink[aria-current=\"page\"] small { color: var(--hb-xj2-accent); }\n  .hb-xj2-pcta {\n    display: flex;\n    align-items: center;\n    justify-content: space-between;\n    margin-top: 16px;\n    height: 50px;\n    padding: 0 18px;\n    border-radius: 14px;\n    background: var(--hb-xj2-accent);\n    color: #0a0a0a;\n    font-weight: 600;\n    text-decoration: none;\n  }\n  .hb-xj2-pcta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\n}\n.hb-xj2-page { padding: 56px 56px 40px; }\n.hb-xj2-kicker { color: #6b6b6b; font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: .04em; }\n.hb-xj2-page h2 {\n  margin: 18px 0 0;\n  max-width: 760px;\n  font-family: var(--font-grotesk, inherit);\n  font-size: clamp(38px, 7.4cqi, 84px);\n  font-weight: 500;\n  line-height: .98;\n  letter-spacing: -.05em;\n}\n.hb-xj2-page h2 span { color: var(--hb-xj2-accent); }\n.hb-xj2-tiles { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 14px; margin-top: 44px; }\n.hb-xj2-tile { position: relative; height: 190px; border-radius: 18px; border: 1px solid #1f1f1f; overflow: hidden; }\n.hb-xj2-tile:nth-child(1) { background: radial-gradient(120% 90% at 20% 10%, #3b3b1a, #141414 60%); }\n.hb-xj2-tile:nth-child(2) { background: radial-gradient(120% 90% at 80% 20%, #1d2b3d, #121212 60%); }\n.hb-xj2-tile:nth-child(3) { background: radial-gradient(120% 90% at 50% 100%, #3a1d2a, #121212 60%); }\n.hb-xj2-tile span { position: absolute; left: 16px; bottom: 14px; color: #d4d4d4; font-size: 13px; }\n.hb-xj2-tile small { position: absolute; right: 16px; bottom: 14px; color: #6b6b6b; font-family: var(--font-mono, monospace); font-size: 11px; }\n@container (max-width: 640px) {\n  .hb-xj2-page { padding: 32px 18px; }\n  .hb-xj2-tiles { grid-template-columns: 1fr 1fr; }\n  .hb-xj2-tile:nth-child(1) { grid-column: span 2; }\n  .hb-xj2-tile { height: 130px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-xj2 *, .hb-xj2 *::before, .hb-xj2 *::after { transition: none !important; animation: none !important; }\n}\n`;\n\nfunction ArrowUpRight() {\n  return (\n    <svg viewBox=\"0 0 20 20\" aria-hidden=\"true\">\n      <path d=\"M6 14 14 6M7.5 6H14v6.5\" />\n    </svg>\n  );\n}\n\nexport function NavbarVerticalRail({\n  brand = \"Nº\",\n  links = defaultLinks,\n  active,\n  defaultActive = 0,\n  onActiveChange,\n  cta = { label: \"Start a project\", href: \"#contact\" },\n  status = \"Booking Q1\",\n  menuOpen,\n  defaultMenuOpen = false,\n  onMenuOpenChange,\n  accent = \"#d4ff3f\",\n  showBackdrop = true,\n  className,\n  style,\n  children,\n  ...rest\n}: NavbarVerticalRailProps) {\n  const [innerActive, setInnerActive] = React.useState(defaultActive);\n  const [innerOpen, setInnerOpen] = React.useState(defaultMenuOpen);\n  const listRef = React.useRef<HTMLUListElement>(null);\n  const markRef = React.useRef<HTMLSpanElement>(null);\n  const menuRef = React.useRef<HTMLButtonElement>(null);\n  const panelId = React.useId();\n  const current = active ?? innerActive;\n  const open = menuOpen ?? innerOpen;\n\n  React.useLayoutEffect(() => {\n    const list = listRef.current;\n    const mark = markRef.current;\n    if (!list || !mark) return;\n    const place = () => {\n      const link = list.querySelectorAll<HTMLElement>(\".hb-xj2-link\")[current];\n      if (!link) return;\n      mark.style.setProperty(\"--hb-xj2-y\", `${link.offsetTop + 8}px`);\n      mark.style.setProperty(\"--hb-xj2-h\", `${Math.max(0, link.offsetHeight - 16)}px`);\n    };\n    place();\n    const ro = new ResizeObserver(place);\n    ro.observe(list);\n    return () => ro.disconnect();\n  }, [current, links]);\n\n  const setOpen = React.useCallback(\n    (next: boolean) => {\n      if (menuOpen === undefined) setInnerOpen(next);\n      onMenuOpenChange?.(next);\n    },\n    [menuOpen, onMenuOpenChange],\n  );\n\n  React.useEffect(() => {\n    if (!open) return;\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setOpen(false);\n        menuRef.current?.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => document.removeEventListener(\"keydown\", onKey);\n  }, [open, setOpen]);\n\n  const choose = (i: number) => {\n    if (active === undefined) setInnerActive(i);\n    onActiveChange?.(i);\n  };\n\n  const onListKey = (e: React.KeyboardEvent<HTMLUListElement>) => {\n    if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\") return;\n    const items = Array.from(e.currentTarget.querySelectorAll<HTMLAnchorElement>(\".hb-xj2-link\"));\n    const at = items.indexOf(document.activeElement as HTMLAnchorElement);\n    if (at < 0) return;\n    e.preventDefault();\n    const next = (at + (e.key === \"ArrowDown\" ? 1 : -1) + items.length) % items.length;\n    items[next].focus();\n  };\n\n  const pad = (n: number) => String(n).padStart(2, \"0\");\n\n  return (\n    <div\n      className={[\"hb-xj2\", className].filter(Boolean).join(\" \")}\n      data-open={open ? \"true\" : \"false\"}\n      data-backdrop={showBackdrop ? \"true\" : \"false\"}\n      style={{ \"--hb-xj2-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-navbar-vertical-rail\" precedence=\"default\">\n        {css}\n      </style>\n      <nav className=\"hb-xj2-rail\" aria-label=\"Main\">\n        <a className=\"hb-xj2-logo\" href=\"#top\">\n          {brand}\n        </a>\n        <div className=\"hb-xj2-count\" aria-hidden=\"true\">\n          <b>{pad(current + 1)}</b>/{pad(links.length)}\n        </div>\n        <div className=\"hb-xj2-wrap\">\n        <span className=\"hb-xj2-mark\" ref={markRef} aria-hidden=\"true\" />\n        <ul className=\"hb-xj2-list\" ref={listRef} onKeyDown={onListKey}>\n          {links.map((l, i) => (\n            <li key={l.href + i}>\n              <a className=\"hb-xj2-link\" href={l.href} aria-current={i === current ? \"page\" : undefined} onClick={() => choose(i)}>\n                <span className=\"hb-xj2-num\" aria-hidden=\"true\">\n                  {pad(i + 1)}\n                </span>\n                <span>{l.label}</span>\n              </a>\n            </li>\n          ))}\n        </ul>\n        </div>\n        <div className=\"hb-xj2-foot\">\n          {status && (\n            <span className=\"hb-xj2-status\" title={status}>\n              <span className=\"hb-xj2-pulse\" aria-hidden=\"true\" />\n              <span className=\"hb-xj2-sr\">{status}</span>\n            </span>\n          )}\n          {cta && (\n            <a className=\"hb-xj2-cta\" href={cta.href} title={cta.label}>\n              <ArrowUpRight />\n              <span className=\"hb-xj2-sr\">{cta.label}</span>\n            </a>\n          )}\n        </div>\n      </nav>\n      <div className=\"hb-xj2-top\">\n        <a className=\"hb-xj2-logo\" href=\"#top\">\n          {brand}\n        </a>\n        <span className=\"hb-xj2-crumb\" aria-hidden=\"true\">\n          {pad(current + 1)} <b>{links[current]?.label}</b>\n        </span>\n        <button ref={menuRef} type=\"button\" className=\"hb-xj2-menu\" aria-expanded={open} aria-controls={panelId} onClick={() => setOpen(!open)}>\n          {open ? \"Close\" : \"Menu\"}\n          <span className=\"hb-xj2-dots\" aria-hidden=\"true\">\n            <span />\n            <span />\n            <span />\n            <span />\n          </span>\n        </button>\n      </div>\n      <nav className=\"hb-xj2-panel\" id={panelId} aria-label=\"Main\" inert={!open}>\n        <ul className=\"hb-xj2-plist\">\n          {links.map((l, i) => (\n            <li key={l.href + i}>\n              <a\n                className=\"hb-xj2-plink\"\n                href={l.href}\n                aria-current={i === current ? \"page\" : undefined}\n                style={{ \"--hb-xj2-i\": i } as React.CSSProperties}\n                onClick={() => {\n                  choose(i);\n                  setOpen(false);\n                }}\n              >\n                <small>{pad(i + 1)}</small>\n                {l.label}\n              </a>\n            </li>\n          ))}\n        </ul>\n        {cta && (\n          <a className=\"hb-xj2-pcta\" href={cta.href}>\n            {cta.label}\n            <ArrowUpRight />\n          </a>\n        )}\n      </nav>\n      <div className=\"hb-xj2-main\">\n        {children ??\n          (showBackdrop && (\n            <div className=\"hb-xj2-page\" aria-hidden=\"true\">\n              <div className=\"hb-xj2-kicker\">Independent design studio, Lisbon</div>\n              <h2>\n                Brands and interfaces with a <span>point of view</span>.\n              </h2>\n              <div className=\"hb-xj2-tiles\">\n                <div className=\"hb-xj2-tile\">\n                  <span>Ostra, identity system</span>\n                  <small>2026</small>\n                </div>\n                <div className=\"hb-xj2-tile\">\n                  <span>Lumo banking app</span>\n                  <small>2025</small>\n                </div>\n                <div className=\"hb-xj2-tile\">\n                  <span>Kiln ceramics</span>\n                  <small>2025</small>\n                </div>\n              </div>\n            </div>\n          ))}\n      </div>\n    </div>\n  );\n}\n"
    }
  ]
}