{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "modal-fullscreen-menu",
  "type": "registry:component",
  "title": "Fullscreen Reveal Menu",
  "description": "A fullscreen navigation overlay that opens as a circle growing from the menu button, with oversized links rising in sequence. Hovering one link dims the rest and slides in an arrow.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "modals",
    "fullscreen",
    "overlay",
    "menu",
    "navigation",
    "clip path",
    "agency"
  ],
  "docs": "https://hyperblur.dev/effects/modal-fullscreen-menu",
  "files": [
    {
      "path": "registry/hyperblur/modal-fullscreen-menu.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/modal-fullscreen-menu.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface FullscreenMenuLink {\n  label: string;\n  href: string;\n  meta?: string;\n}\n\nexport interface FullscreenMenuContact {\n  label: string;\n  value: string;\n  href?: string;\n}\n\nexport interface ModalFullscreenMenuProps extends Omit<React.HTMLAttributes<HTMLDivElement>, \"title\"> {\n  open?: boolean;\n  defaultOpen?: boolean;\n  onOpenChange?: (open: boolean) => void;\n  embedded?: boolean;\n  trigger?: React.ReactNode;\n  brand?: string;\n  links?: FullscreenMenuLink[];\n  contact?: FullscreenMenuContact[];\n  note?: string;\n  onNavigate?: (href: string) => void;\n  accent?: string;\n}\n\nconst defaultLinks: FullscreenMenuLink[] = [\n  { label: \"Work\", href: \"#work\", meta: \"24 projects\" },\n  { label: \"Studio\", href: \"#studio\", meta: \"Since 2014\" },\n  { label: \"Services\", href: \"#services\", meta: \"Brand, web, motion\" },\n  { label: \"Journal\", href: \"#journal\", meta: \"New essay\" },\n  { label: \"Contact\", href: \"#contact\", meta: \"Reply in 24h\" },\n];\n\nconst defaultContact: FullscreenMenuContact[] = [\n  { label: \"New business\", value: \"hello@northfold.studio\", href: \"mailto:hello@northfold.studio\" },\n  { label: \"Studio\", value: \"88 Wythe Ave, Brooklyn\" },\n  { label: \"Social\", value: \"Instagram · Dribbble · LinkedIn\" },\n];\n\nconst css = `\n.hb-xe4 { --hb-xe4-accent: #ff5a36; display: inline-block; box-sizing: border-box; color: #f2f0eb; font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif); }\n.hb-xe4 *, .hb-xe4 *::before, .hb-xe4 *::after { box-sizing: border-box; }\n.hb-xe4[data-embedded] { position: relative; display: block; width: 100%; height: 100%; min-height: 190px; border-radius: 16px; overflow: hidden; isolation: isolate; background: #0b0b0b; }\n.hb-xe4-site { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; padding: 14px 16px; }\n.hb-xe4-bar { display: flex; align-items: center; justify-content: space-between; }\n.hb-xe4-logo { font-family: var(--font-grotesk, inherit); font-weight: 700; font-size: 14px; letter-spacing: -0.03em; }\n.hb-xe4-hero { font-family: var(--font-grotesk, inherit); font-size: 26px; line-height: 1; letter-spacing: -0.045em; font-weight: 600; color: #3a3936; }\n.hb-xe4-trigger { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 14px; border: 1px solid rgba(242, 240, 235, 0.16); border-radius: 999px; background: rgba(255, 255, 255, 0.03); color: inherit; font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; transition: border-color 0.25s ease, background-color 0.25s ease; }\n.hb-xe4-trigger:hover { border-color: rgba(242, 240, 235, 0.34); background: rgba(255, 255, 255, 0.06); }\n.hb-xe4-trigger i { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--hb-xe4-accent); font-style: normal; }\n.hb-xe4-trigger i::before, .hb-xe4-trigger i::after { content: \"\"; position: absolute; width: 10px; height: 1.5px; border-radius: 2px; background: #0b0b0b; transition: transform 0.3s cubic-bezier(0.3, 0.7, 0.4, 1); }\n.hb-xe4-trigger i::before { transform: translateY(-2.5px); }\n.hb-xe4-trigger i::after { transform: translateY(2.5px); }\n.hb-xe4-trigger:hover i::before { transform: translateY(-2.5px) scaleX(0.6); }\n.hb-xe4 a:focus-visible, .hb-xe4 button:focus-visible { outline: 2px solid var(--hb-xe4-accent); outline-offset: 3px; }\n.hb-xe4-layer { container-type: size; position: fixed; inset: 0; z-index: 1000; height: 100dvh; display: flex; flex-direction: column; background: radial-gradient(90% 70% at 100% 0%, color-mix(in srgb, var(--hb-xe4-accent) 16%, transparent), transparent 60%), #0e0d0c; outline: none; clip-path: circle(150% at var(--hb-xe4-x, 100%) var(--hb-xe4-y, 0%)); animation: hb-xe4-open 0.8s cubic-bezier(0.7, 0, 0.2, 1) both; }\n.hb-xe4[data-embedded] .hb-xe4-layer { position: absolute; height: auto; z-index: 2; }\n.hb-xe4-layer[data-state=\"closed\"] { animation: hb-xe4-close 0.55s cubic-bezier(0.7, 0, 0.3, 1) both; pointer-events: none; }\n.hb-xe4-top { flex: none; display: flex; align-items: center; justify-content: space-between; padding: clamp(12px, 3.4cqh, 28px) clamp(14px, 4cqw, 40px); }\n.hb-xe4-close { display: inline-flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 14px; border: 1px solid rgba(242, 240, 235, 0.16); border-radius: 999px; background: transparent; color: inherit; font: inherit; font-size: 12.5px; font-weight: 600; letter-spacing: 0.02em; cursor: pointer; }\n.hb-xe4-close i { position: relative; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: #f2f0eb; font-style: normal; transition: transform 0.4s cubic-bezier(0.3, 0.7, 0.4, 1); }\n.hb-xe4-close:hover i { transform: rotate(90deg); }\n.hb-xe4-close i::before, .hb-xe4-close i::after { content: \"\"; position: absolute; width: 10px; height: 1.5px; border-radius: 2px; background: #0b0b0b; transform: rotate(45deg); }\n.hb-xe4-close i::after { transform: rotate(-45deg); }\n.hb-xe4-main { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: 1fr; align-items: end; gap: 24px; padding: 0 clamp(14px, 4cqw, 40px) clamp(14px, 5cqh, 44px); }\n.hb-xe4-list { list-style: none; margin: 0; padding: 0; }\n.hb-xe4-li { overflow: hidden; border-top: 1px solid rgba(242, 240, 235, 0.08); }\n.hb-xe4-li:last-child { border-bottom: 1px solid rgba(242, 240, 235, 0.08); }\n.hb-xe4-link { position: relative; display: flex; align-items: baseline; gap: clamp(8px, 2cqw, 22px); padding: clamp(1px, 0.6cqh, 8px) 0; color: inherit; text-decoration: none; transform: translateY(105%); animation: hb-xe4-rise 0.9s calc(0.32s + var(--hb-xe4-i) * 0.06s) cubic-bezier(0.2, 0.9, 0.1, 1) both; transition: opacity 0.35s ease, color 0.35s ease; border-radius: 4px; }\n.hb-xe4-list:hover .hb-xe4-link:not(:hover), .hb-xe4-list:focus-within .hb-xe4-link:not(:focus-visible):not(:hover) { opacity: 0.32; }\n.hb-xe4-idx { flex: none; width: clamp(18px, 4cqw, 34px); font-family: var(--font-mono, ui-monospace, monospace); font-size: clamp(9px, 1.6cqh, 12px); color: #8a877f; }\n.hb-xe4-word { font-family: var(--font-grotesk, inherit); font-size: clamp(18px, min(11.5cqh, 10cqw), 104px); font-weight: 600; letter-spacing: -0.045em; line-height: 1.02; transition: transform 0.5s cubic-bezier(0.2, 0.9, 0.1, 1); }\n.hb-xe4-link:hover .hb-xe4-word, .hb-xe4-link:focus-visible .hb-xe4-word { transform: translateX(clamp(6px, 2cqw, 22px)); }\n.hb-xe4-meta { margin-left: auto; font-size: clamp(10px, 1.8cqh, 13px); color: #8a877f; white-space: nowrap; }\n.hb-xe4-arrow { align-self: center; width: clamp(12px, 3.6cqh, 30px); height: clamp(12px, 3.6cqh, 30px); color: var(--hb-xe4-accent); opacity: 0; transform: translateX(-12px) rotate(-45deg); transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.2, 0.9, 0.1, 1); }\n.hb-xe4-link:hover .hb-xe4-arrow, .hb-xe4-link:focus-visible .hb-xe4-arrow { opacity: 1; transform: none; }\n.hb-xe4-aside { display: none; align-content: end; gap: 18px; animation: hb-xe4-fade 0.6s 0.7s ease both; }\n.hb-xe4-aside dl { margin: 0; display: grid; gap: 14px; }\n.hb-xe4-aside dt { color: #8a877f; font-size: 12px; margin-bottom: 3px; }\n.hb-xe4-aside dd { margin: 0; font-size: 14px; }\n.hb-xe4-aside a { color: inherit; text-decoration: none; background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat; transition: background-size 0.4s cubic-bezier(0.2, 0.9, 0.1, 1); }\n.hb-xe4-aside a:hover { background-size: 100% 1px; }\n.hb-xe4-note { display: inline-flex; align-items: center; gap: 8px; color: #c8c5bd; font-size: 13px; }\n.hb-xe4-note::before { content: \"\"; width: 7px; height: 7px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, 0.15); }\n@container (min-width: 720px) {\n  .hb-xe4-main { grid-template-columns: minmax(0, 1fr) 260px; gap: 56px; }\n  .hb-xe4-aside { display: grid; }\n}\n@container (max-width: 420px) {\n  .hb-xe4-meta { display: none; }\n}\n@keyframes hb-xe4-open { from { clip-path: circle(0px at var(--hb-xe4-x, 100%) var(--hb-xe4-y, 0%)); } to { clip-path: circle(150% at var(--hb-xe4-x, 100%) var(--hb-xe4-y, 0%)); } }\n@keyframes hb-xe4-close { from { clip-path: circle(150% at var(--hb-xe4-x, 100%) var(--hb-xe4-y, 0%)); } to { clip-path: circle(0px at var(--hb-xe4-x, 100%) var(--hb-xe4-y, 0%)); } }\n@keyframes hb-xe4-rise { to { transform: none; } }\n@keyframes hb-xe4-fade { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) {\n  .hb-xe4-layer, .hb-xe4-layer[data-state=\"closed\"], .hb-xe4-link, .hb-xe4-aside { animation: none; transform: none; }\n  .hb-xe4-layer[data-state=\"closed\"] { opacity: 0; }\n  .hb-xe4-word, .hb-xe4-arrow, .hb-xe4-link, .hb-xe4-trigger, .hb-xe4-trigger i::before, .hb-xe4-close i { transition: none; }\n}\n`;\n\nconst focusable =\n  'a[href],button:not(:disabled),input:not(:disabled),select:not(:disabled),textarea:not(:disabled),[tabindex]:not([tabindex=\"-1\"])';\n\nfunction useLayer(\n  open: boolean,\n  embedded: boolean,\n  panel: React.RefObject<HTMLElement | null>,\n  onClose: () => void,\n  userOpened: React.RefObject<boolean>,\n) {\n  const closeRef = React.useRef(onClose);\n  React.useEffect(() => {\n    closeRef.current = onClose;\n  });\n  React.useEffect(() => {\n    if (!open) return;\n    const node = panel.current;\n    const steal = !embedded || userOpened.current;\n    const previous = document.activeElement as HTMLElement | null;\n    const html = document.documentElement;\n    const overflow = html.style.overflow;\n    if (!embedded) html.style.overflow = \"hidden\";\n    if (steal && node) {\n      const target = node.querySelector<HTMLElement>(\"[data-autofocus]\") ?? node.querySelector<HTMLElement>(focusable) ?? node;\n      target.focus({ preventScroll: true });\n    }\n    const onKey = (e: KeyboardEvent) => {\n      if (!node) return;\n      if (embedded && !node.contains(document.activeElement)) return;\n      if (e.key === \"Escape\") {\n        e.preventDefault();\n        closeRef.current();\n        return;\n      }\n      if (e.key !== \"Tab\") return;\n      const items = Array.from(node.querySelectorAll<HTMLElement>(focusable)).filter((el) => el.getClientRects().length > 0);\n      if (!items.length) {\n        e.preventDefault();\n        node.focus();\n        return;\n      }\n      const first = items[0];\n      const last = items[items.length - 1];\n      const active = document.activeElement;\n      if (!node.contains(active)) {\n        e.preventDefault();\n        first.focus();\n      } else if (e.shiftKey && (active === first || active === node)) {\n        e.preventDefault();\n        last.focus();\n      } else if (!e.shiftKey && active === last) {\n        e.preventDefault();\n        first.focus();\n      }\n    };\n    document.addEventListener(\"keydown\", onKey);\n    return () => {\n      document.removeEventListener(\"keydown\", onKey);\n      if (!embedded) html.style.overflow = overflow;\n      if (steal && previous && previous.isConnected && previous !== document.body) previous.focus({ preventScroll: true });\n    };\n  }, [open, embedded, panel, userOpened]);\n}\n\nexport function ModalFullscreenMenu({\n  open,\n  defaultOpen,\n  onOpenChange,\n  embedded = false,\n  trigger = \"Menu\",\n  brand = \"Northfold\",\n  links = defaultLinks,\n  contact = defaultContact,\n  note = \"Booking new projects for Q1 2027\",\n  onNavigate,\n  accent = \"#ff5a36\",\n  className = \"\",\n  style,\n  ...rest\n}: ModalFullscreenMenuProps) {\n  const [inner, setInner] = React.useState(defaultOpen ?? embedded);\n  const isOpen = open ?? inner;\n  const [present, setPresent] = React.useState(isOpen);\n  const [origin, setOrigin] = React.useState<{ x: string; y: string }>({ x: \"calc(100% - 48px)\", y: \"32px\" });\n  const userOpened = React.useRef(false);\n  const layer = React.useRef<HTMLDivElement>(null);\n  const root = React.useRef<HTMLDivElement>(null);\n  const id = React.useId();\n\n  if (isOpen && !present) setPresent(true);\n\n  const setOpen = React.useCallback(\n    (next: boolean) => {\n      if (next) userOpened.current = true;\n      if (open === undefined) setInner(next);\n      onOpenChange?.(next);\n    },\n    [open, onOpenChange],\n  );\n  const close = React.useCallback(() => setOpen(false), [setOpen]);\n\n  React.useEffect(() => {\n    if (isOpen || !present) return;\n    const t = setTimeout(() => setPresent(false), 560);\n    return () => clearTimeout(t);\n  }, [isOpen, present]);\n\n  useLayer(isOpen, embedded, layer, close, userOpened);\n\n  function openFrom(e: React.MouseEvent<HTMLButtonElement>) {\n    const r = e.currentTarget.getBoundingClientRect();\n    const base = embedded && root.current ? root.current.getBoundingClientRect() : { left: 0, top: 0 };\n    setOrigin({ x: `${(r.left + r.width / 2 - base.left).toFixed(0)}px`, y: `${(r.top + r.height / 2 - base.top).toFixed(0)}px` });\n    setOpen(true);\n  }\n\n  function onListKey(e: React.KeyboardEvent<HTMLUListElement>) {\n    if (e.key !== \"ArrowDown\" && e.key !== \"ArrowUp\") return;\n    const items = Array.from(e.currentTarget.querySelectorAll<HTMLAnchorElement>(\"a\"));\n    const i = items.indexOf(document.activeElement as HTMLAnchorElement);\n    if (i < 0) return;\n    e.preventDefault();\n    items[(i + (e.key === \"ArrowDown\" ? 1 : -1) + items.length) % items.length].focus();\n  }\n\n  const vars = { \"--hb-xe4-accent\": accent, ...style } as React.CSSProperties;\n\n  const triggerButton =\n    trigger !== null ? (\n      <button type=\"button\" className=\"hb-xe4-trigger\" aria-haspopup=\"dialog\" aria-expanded={isOpen} onClick={openFrom}>\n        {trigger}\n        <i aria-hidden=\"true\" />\n      </button>\n    ) : null;\n\n  return (\n    <div ref={root} className={`hb-xe4 ${className}`} data-embedded={embedded || undefined} style={vars} {...rest}>\n      <style href=\"hb-xe4-css\" precedence=\"default\">{css}</style>\n      {embedded ? (\n        <div className=\"hb-xe4-site\">\n          <div className=\"hb-xe4-bar\">\n            <span className=\"hb-xe4-logo\">{brand}</span>\n            {triggerButton}\n          </div>\n          <div className=\"hb-xe4-hero\" aria-hidden=\"true\">Brands with a pulse.</div>\n        </div>\n      ) : (\n        triggerButton\n      )}\n      {present && (\n        <div\n          ref={layer}\n          role=\"dialog\"\n          aria-modal=\"true\"\n          aria-labelledby={`${id}-t`}\n          tabIndex={-1}\n          className=\"hb-xe4-layer\"\n          data-state={isOpen ? \"open\" : \"closed\"}\n          style={{ \"--hb-xe4-x\": origin.x, \"--hb-xe4-y\": origin.y } as React.CSSProperties}\n        >\n          <div className=\"hb-xe4-top\">\n            <span id={`${id}-t`} className=\"hb-xe4-logo\">{brand}</span>\n            <button type=\"button\" className=\"hb-xe4-close\" onClick={close} aria-label=\"Close menu\">\n              Close\n              <i aria-hidden=\"true\" />\n            </button>\n          </div>\n          <div className=\"hb-xe4-main\">\n            <nav aria-label=\"Main\">\n              <ul className=\"hb-xe4-list\" onKeyDown={onListKey}>\n                {links.map((l, i) => (\n                  <li key={l.href} className=\"hb-xe4-li\">\n                    <a\n                      href={l.href}\n                      className=\"hb-xe4-link\"\n                      style={{ \"--hb-xe4-i\": i } as React.CSSProperties}\n                      data-autofocus={i === 0 ? \"\" : undefined}\n                      onClick={() => {\n                        onNavigate?.(l.href);\n                        close();\n                      }}\n                    >\n                      <span className=\"hb-xe4-idx\">{String(i + 1).padStart(2, \"0\")}</span>\n                      <span className=\"hb-xe4-word\">{l.label}</span>\n                      <svg className=\"hb-xe4-arrow\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n                        <path d=\"M5 12h14m-6-6 6 6-6 6\" />\n                      </svg>\n                      {l.meta && <span className=\"hb-xe4-meta\">{l.meta}</span>}\n                    </a>\n                  </li>\n                ))}\n              </ul>\n            </nav>\n            <aside className=\"hb-xe4-aside\">\n              <dl>\n                {contact.map((c) => (\n                  <div key={c.label}>\n                    <dt>{c.label}</dt>\n                    <dd>{c.href ? <a href={c.href}>{c.value}</a> : c.value}</dd>\n                  </div>\n                ))}\n              </dl>\n              {note && <span className=\"hb-xe4-note\">{note}</span>}\n            </aside>\n          </div>\n        </div>\n      )}\n    </div>\n  );\n}\n"
    }
  ]
}