{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "navbar-hero-fill",
  "type": "registry:component",
  "title": "Navbar Hero Fill",
  "description": "A transparent navbar over a full-bleed hero that fills in proportion to scroll: the background, blur, shadow, text color and height all follow one progress value instead of snapping. On phones a circular overlay opens with large staggered links and a focus trap.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "navigation",
    "navbar",
    "transparent",
    "scroll",
    "hero",
    "overlay menu",
    "hospitality"
  ],
  "docs": "https://hyperblur.dev/effects/navbar-hero-fill",
  "files": [
    {
      "path": "registry/hyperblur/navbar-hero-fill.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/navbar-hero-fill.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface NavbarHeroFillProps extends Omit<React.HTMLAttributes<HTMLElement>, \"children\"> {\n  brand?: string;\n  links?: { label: string; href: string }[];\n  cta?: { label: string; href: string } | null;\n  progress?: number;\n  distance?: number;\n  menuOpen?: boolean;\n  defaultMenuOpen?: boolean;\n  onMenuOpenChange?: (open: boolean) => void;\n  accent?: string;\n  showBackdrop?: boolean;\n}\n\nconst defaultLinks = [\n  { label: \"Stays\", href: \"#stays\" },\n  { label: \"Experiences\", href: \"#experiences\" },\n  { label: \"Journal\", href: \"#journal\" },\n  { label: \"About\", href: \"#about\" },\n];\n\nconst ease = \"cubic-bezier(.22,1,.36,1)\";\n\nconst css = `\n.hb-xj8 {\n  --hb-xj8-accent: #c2410c;\n  --hb-xj8-p: 0;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-xj8 *, .hb-xj8 *::before, .hb-xj8 *::after { box-sizing: border-box; }\n.hb-xj8[data-backdrop=\"true\"] { height: 620px; overflow: hidden; background: #0a0a0a; }\n.hb-xj8-bar {\n  position: fixed;\n  top: 0;\n  left: 0;\n  right: 0;\n  z-index: 20;\n  display: flex;\n  align-items: center;\n  gap: 24px;\n  height: calc(84px - 20px * var(--hb-xj8-p));\n  padding: 0 calc(36px - 12px * var(--hb-xj8-p));\n  color: color-mix(in srgb, #15130f calc(var(--hb-xj8-p) * 100%), #ffffff);\n}\n.hb-xj8[data-backdrop=\"true\"] .hb-xj8-bar { position: absolute; }\n.hb-xj8-fill {\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  background: rgba(250,248,243,calc(.92 * var(--hb-xj8-p)));\n  backdrop-filter: blur(calc(18px * var(--hb-xj8-p))) saturate(calc(100% + 60% * var(--hb-xj8-p)));\n  box-shadow: 0 1px 0 rgba(21,19,15,calc(.08 * var(--hb-xj8-p))), 0 10px 30px -12px rgba(0,0,0,calc(.25 * var(--hb-xj8-p)));\n}\n.hb-xj8-fill::before {\n  content: \"\";\n  position: absolute;\n  inset: 0 0 -60px;\n  z-index: -1;\n  background: linear-gradient(180deg, rgba(0,0,0,.45), transparent);\n  opacity: calc(1 - var(--hb-xj8-p));\n  pointer-events: none;\n}\n.hb-xj8-brand { display: inline-flex; align-items: center; gap: 10px; color: inherit; font-family: var(--font-grotesk, inherit); font-size: calc(22px - 3px * var(--hb-xj8-p)); font-weight: 600; letter-spacing: -.03em; text-decoration: none; }\n.hb-xj8-sun { position: relative; width: 22px; height: 22px; border-radius: 50%; border: 2px solid currentColor; }\n.hb-xj8-sun::after { content: \"\"; position: absolute; left: -4px; right: -4px; bottom: 3px; height: 2px; background: currentColor; box-shadow: 0 -4px 0 0 transparent; }\n.hb-xj8-links { display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0; list-style: none; }\n.hb-xj8-link {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  height: 38px;\n  padding: 0 14px;\n  color: inherit;\n  font-size: 14.5px;\n  font-weight: 500;\n  text-decoration: none;\n  opacity: .88;\n  transition: opacity .2s ease;\n}\n.hb-xj8-link::after { content: \"\"; position: absolute; left: 14px; right: 14px; bottom: 6px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: 100% 50%; transition: transform .45s ${ease}; }\n.hb-xj8-link:hover { opacity: 1; }\n.hb-xj8-link:hover::after { transform: scaleX(1); transform-origin: 0 50%; }\n.hb-xj8-cta {\n  position: relative;\n  display: inline-flex;\n  align-items: center;\n  height: 42px;\n  padding: 0 20px;\n  border-radius: 999px;\n  border: 1px solid color-mix(in srgb, currentColor 40%, transparent);\n  color: inherit;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  white-space: nowrap;\n  overflow: hidden;\n  isolation: isolate;\n  transition: color .3s ease, border-color .3s ease;\n}\n.hb-xj8-cta::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  z-index: -1;\n  background: var(--hb-xj8-accent);\n  opacity: var(--hb-xj8-p);\n}\n.hb-xj8[data-filled=\"true\"] .hb-xj8-cta { color: #fff; border-color: transparent; }\n.hb-xj8-cta:hover { border-color: currentColor; }\n.hb-xj8-burger { display: none; }\n.hb-xj8-overlay { display: none; }\n.hb-xj8 a:focus-visible, .hb-xj8 button:focus-visible { outline: 2px solid var(--hb-xj8-accent); outline-offset: 3px; }\n@container (max-width: 720px) {\n  .hb-xj8-bar { padding: 0 16px; gap: 12px; height: calc(68px - 8px * var(--hb-xj8-p)); }\n  .hb-xj8-links, .hb-xj8-bar > .hb-xj8-cta { display: none; }\n  .hb-xj8-burger {\n    position: relative;\n    display: inline-flex;\n    align-items: center;\n    gap: 10px;\n    height: 40px;\n    margin-left: auto;\n    padding: 0 4px 0 14px;\n    border: 0;\n    border-radius: 999px;\n    background: none;\n    color: inherit;\n    font: inherit;\n    font-size: 13px;\n    font-weight: 600;\n    letter-spacing: .08em;\n    text-transform: uppercase;\n    cursor: pointer;\n  }\n  .hb-xj8-burger i { position: relative; display: block; width: 32px; height: 32px; border-radius: 50%; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); font-style: normal; }\n  .hb-xj8-burger i::before, .hb-xj8-burger i::after { content: \"\"; position: absolute; left: 9px; right: 9px; height: 1.5px; background: currentColor; transition: transform .5s ${ease}, top .5s ${ease}; }\n  .hb-xj8-burger i::before { top: 12px; }\n  .hb-xj8-burger i::after { top: 18px; }\n  .hb-xj8-overlay {\n    position: fixed;\n    inset: 0;\n    z-index: 30;\n    display: flex;\n    flex-direction: column;\n    height: 100dvh;\n    padding: 18px 16px 28px;\n    background: #15130f;\n    color: #faf8f3;\n    clip-path: circle(0px at calc(100% - 36px) 34px);\n    visibility: hidden;\n    transition: clip-path .7s ${ease}, visibility 0s linear .7s;\n  }\n  .hb-xj8[data-backdrop=\"true\"] .hb-xj8-overlay { position: absolute; height: 100%; }\n  .hb-xj8[data-open=\"true\"] .hb-xj8-overlay { clip-path: circle(150% at calc(100% - 36px) 34px); visibility: visible; transition: clip-path .7s ${ease}, visibility 0s; }\n  .hb-xj8-otop { display: flex; align-items: center; justify-content: space-between; height: 34px; }\n  .hb-xj8-close { display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 4px 0 14px; border: 0; background: none; color: inherit; font: inherit; font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; cursor: pointer; }\n  .hb-xj8-close i { position: relative; display: block; width: 32px; height: 32px; border-radius: 50%; border: 1px solid rgba(250,248,243,.3); font-style: normal; }\n  .hb-xj8-close i::before, .hb-xj8-close i::after { content: \"\"; position: absolute; left: 9px; right: 9px; top: 15px; height: 1.5px; background: currentColor; transform: rotate(45deg); }\n  .hb-xj8-close i::after { transform: rotate(-45deg); }\n  .hb-xj8-olist { margin: auto 0 0; padding: 0; list-style: none; }\n  .hb-xj8-olist li { overflow: hidden; border-bottom: 1px solid rgba(250,248,243,.12); }\n  .hb-xj8-olink {\n    display: flex;\n    align-items: baseline;\n    justify-content: space-between;\n    padding: 14px 0;\n    color: inherit;\n    font-family: var(--font-grotesk, inherit);\n    font-size: 40px;\n    font-weight: 500;\n    letter-spacing: -.04em;\n    line-height: 1;\n    text-decoration: none;\n    transform: translateY(105%);\n    transition: transform .7s ${ease};\n    transition-delay: calc(var(--hb-xj8-i) * 60ms + 120ms);\n  }\n  .hb-xj8-olink small { color: rgba(250,248,243,.45); font-family: var(--font-mono, monospace); font-size: 12px; letter-spacing: 0; }\n  .hb-xj8[data-open=\"true\"] .hb-xj8-olink { transform: none; }\n  .hb-xj8-ofoot { display: flex; justify-content: space-between; align-items: center; margin-top: 26px; color: rgba(250,248,243,.6); font-size: 13px; opacity: 0; transition: opacity .4s ease .5s; }\n  .hb-xj8[data-open=\"true\"] .hb-xj8-ofoot { opacity: 1; }\n  .hb-xj8-ofoot a { display: inline-flex; align-items: center; height: 44px; padding: 0 20px; border-radius: 999px; background: var(--hb-xj8-accent); color: #fff; font-weight: 600; text-decoration: none; }\n}\n.hb-xj8-scroll { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }\n.hb-xj8-scroll::-webkit-scrollbar { display: none; }\n.hb-xj8-hero {\n  position: relative;\n  height: 560px;\n  display: flex;\n  flex-direction: column;\n  justify-content: flex-end;\n  padding: 0 36px 54px;\n  color: #fff;\n  background:\n    radial-gradient(60% 50% at 75% 30%, rgba(255,196,120,.85), transparent 60%),\n    radial-gradient(80% 60% at 20% 10%, rgba(255,120,80,.55), transparent 60%),\n    linear-gradient(180deg, #f59e0b 0%, #c2410c 38%, #4a1d0c 70%, #170b06 100%);\n  overflow: hidden;\n}\n.hb-xj8-hill { position: absolute; left: -10%; right: -10%; border-radius: 50% 50% 0 0; }\n.hb-xj8-hill:nth-child(1) { bottom: 120px; height: 260px; background: #6b2a10; opacity: .7; transform: translateX(-18%); }\n.hb-xj8-hill:nth-child(2) { bottom: 40px; height: 240px; background: #3b160a; transform: translateX(22%); }\n.hb-xj8-hill:nth-child(3) { bottom: -60px; height: 240px; background: #170b06; }\n.hb-xj8-hero small { position: relative; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; opacity: .8; }\n.hb-xj8-hero h2 { position: relative; margin: 12px 0 0; max-width: 620px; font-family: var(--font-grotesk, inherit); font-size: clamp(36px, 7cqi, 72px); font-weight: 500; line-height: .98; letter-spacing: -.045em; }\n.hb-xj8-body { padding: 44px 36px 80px; background: #faf8f3; color: #15130f; }\n.hb-xj8-body h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -.02em; }\n.hb-xj8-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 18px; }\n.hb-xj8-card { height: 200px; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; justify-content: flex-end; color: #fff; }\n.hb-xj8-card b { font-size: 15px; font-weight: 600; }\n.hb-xj8-card small { font-size: 12px; opacity: .8; }\n@container (max-width: 720px) { .hb-xj8-hero { padding: 0 16px 40px; height: 480px; } .hb-xj8-body { padding: 32px 16px 60px; } .hb-xj8-cards { grid-template-columns: 1fr; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xj8 *, .hb-xj8 *::before, .hb-xj8 *::after { transition: none !important; animation: none !important; }\n}\n`;\n\nexport function NavbarHeroFill({\n  brand = \"Solstice\",\n  links = defaultLinks,\n  cta = { label: \"Book a stay\", href: \"#book\" },\n  progress,\n  distance = 220,\n  menuOpen,\n  defaultMenuOpen = false,\n  onMenuOpenChange,\n  accent = \"#c2410c\",\n  showBackdrop = true,\n  className,\n  style,\n  ...rest\n}: NavbarHeroFillProps) {\n  const [measured, setMeasured] = React.useState(0);\n  const [innerOpen, setInnerOpen] = React.useState(defaultMenuOpen);\n  const scrollRef = React.useRef<HTMLDivElement>(null);\n  const burgerRef = React.useRef<HTMLButtonElement>(null);\n  const overlayRef = React.useRef<HTMLDivElement>(null);\n  const overlayId = React.useId();\n  const open = menuOpen ?? innerOpen;\n  const p = Math.min(1, Math.max(0, progress ?? measured));\n\n  React.useEffect(() => {\n    if (progress !== undefined) return;\n    const target: HTMLElement | Window = showBackdrop && scrollRef.current ? scrollRef.current : window;\n    let raf = 0;\n    const read = () => {\n      raf = 0;\n      const y = target instanceof Window ? target.scrollY : target.scrollTop;\n      const next = Math.round(Math.min(1, Math.max(0, y / Math.max(1, distance))) * 100) / 100;\n      setMeasured(next);\n    };\n    const onScroll = () => {\n      if (!raf) raf = requestAnimationFrame(read);\n    };\n    raf = requestAnimationFrame(read);\n    target.addEventListener(\"scroll\", onScroll, { passive: true });\n    return () => {\n      if (raf) cancelAnimationFrame(raf);\n      target.removeEventListener(\"scroll\", onScroll);\n    };\n  }, [progress, distance, showBackdrop]);\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 overlay = overlayRef.current;\n    const lock = !showBackdrop;\n    const prev = document.body.style.overflow;\n    if (lock) document.body.style.overflow = \"hidden\";\n    const first = overlay?.querySelector<HTMLElement>(\"button, a\");\n    const t = window.setTimeout(() => first?.focus(), 60);\n    const onKey = (e: KeyboardEvent) => {\n      if (e.key === \"Escape\") {\n        setOpen(false);\n        burgerRef.current?.focus();\n        return;\n      }\n      if (e.key !== \"Tab\" || !overlay) return;\n      const nodes = Array.from(overlay.querySelectorAll<HTMLElement>(\"button, a[href]\"));\n      if (!nodes.length) return;\n      const a = nodes[0];\n      const b = nodes[nodes.length - 1];\n      if (e.shiftKey && document.activeElement === a) {\n        e.preventDefault();\n        b.focus();\n      } else if (!e.shiftKey && document.activeElement === b) {\n        e.preventDefault();\n        a.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => {\n      window.clearTimeout(t);\n      document.removeEventListener(\"keydown\", onKey);\n      if (lock) document.body.style.overflow = prev;\n    };\n  }, [open, setOpen, showBackdrop]);\n\n  const close = () => {\n    setOpen(false);\n    burgerRef.current?.focus();\n  };\n\n  return (\n    <header\n      className={[\"hb-xj8\", className].filter(Boolean).join(\" \")}\n      data-backdrop={showBackdrop ? \"true\" : \"false\"}\n      data-filled={p > 0.5 ? \"true\" : \"false\"}\n      data-open={open ? \"true\" : \"false\"}\n      style={{ \"--hb-xj8-accent\": accent, \"--hb-xj8-p\": p.toFixed(2), ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-navbar-hero-fill\" precedence=\"default\">\n        {css}\n      </style>\n      <nav className=\"hb-xj8-bar\" aria-label=\"Main\">\n        <div className=\"hb-xj8-fill\" aria-hidden=\"true\" />\n        <a className=\"hb-xj8-brand\" href=\"#top\">\n          <span className=\"hb-xj8-sun\" aria-hidden=\"true\" />\n          {brand}\n        </a>\n        <ul className=\"hb-xj8-links\">\n          {links.map((l) => (\n            <li key={l.href}>\n              <a className=\"hb-xj8-link\" href={l.href}>\n                {l.label}\n              </a>\n            </li>\n          ))}\n        </ul>\n        {cta && (\n          <a className=\"hb-xj8-cta\" href={cta.href}>\n            {cta.label}\n          </a>\n        )}\n        <button ref={burgerRef} type=\"button\" className=\"hb-xj8-burger\" aria-expanded={open} aria-controls={overlayId} onClick={() => setOpen(true)}>\n          Menu\n          <i aria-hidden=\"true\" />\n        </button>\n      </nav>\n      <div className=\"hb-xj8-overlay\" id={overlayId} ref={overlayRef} role=\"dialog\" aria-modal=\"true\" aria-label=\"Menu\" inert={!open}>\n        <div className=\"hb-xj8-otop\">\n          <a className=\"hb-xj8-brand\" href=\"#top\" style={{ fontSize: 20 }}>\n            <span className=\"hb-xj8-sun\" aria-hidden=\"true\" />\n            {brand}\n          </a>\n          <button type=\"button\" className=\"hb-xj8-close\" onClick={close}>\n            Close\n            <i aria-hidden=\"true\" />\n          </button>\n        </div>\n        <ul className=\"hb-xj8-olist\">\n          {links.map((l, i) => (\n            <li key={l.href}>\n              <a className=\"hb-xj8-olink\" href={l.href} style={{ \"--hb-xj8-i\": i } as React.CSSProperties} onClick={() => setOpen(false)}>\n                {l.label}\n                <small>{String(i + 1).padStart(2, \"0\")}</small>\n              </a>\n            </li>\n          ))}\n        </ul>\n        <div className=\"hb-xj8-ofoot\">\n          <span>Open year round, Algarve</span>\n          {cta && <a href={cta.href}>{cta.label}</a>}\n        </div>\n      </div>\n      {showBackdrop && (\n        <div className=\"hb-xj8-scroll\" ref={scrollRef} tabIndex={-1}>\n          <div className=\"hb-xj8-hero\">\n            <span className=\"hb-xj8-hill\" aria-hidden=\"true\" />\n            <span className=\"hb-xj8-hill\" aria-hidden=\"true\" />\n            <span className=\"hb-xj8-hill\" aria-hidden=\"true\" />\n            <small>Cliffside retreat, Algarve</small>\n            <h2>Slow mornings above the Atlantic</h2>\n          </div>\n          <div className=\"hb-xj8-body\">\n            <h3>Rooms with a horizon</h3>\n            <div className=\"hb-xj8-cards\">\n              <div className=\"hb-xj8-card\" style={{ background: \"linear-gradient(160deg,#f59e0b,#7c2d12)\" }}>\n                <b>Cliff suite</b>\n                <small>From $420 a night</small>\n              </div>\n              <div className=\"hb-xj8-card\" style={{ background: \"linear-gradient(160deg,#0e7490,#082f49)\" }}>\n                <b>Ocean loft</b>\n                <small>From $360 a night</small>\n              </div>\n              <div className=\"hb-xj8-card\" style={{ background: \"linear-gradient(160deg,#65a30d,#1a2e05)\" }}>\n                <b>Garden cabin</b>\n                <small>From $240 a night</small>\n              </div>\n            </div>\n          </div>\n        </div>\n      )}\n    </header>\n  );\n}\n"
    }
  ]
}