{
  "id": "expanding-rounded-menu",
  "kind": "element",
  "title": "Expanding rounded menu",
  "summary": "A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.",
  "url": "https://enrichr.dev/elements/expanding-rounded-menu.html",
  "section": "nav",
  "techniques": [
    "pointer-interaction",
    "stagger",
    "reveal"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "playful",
    "fluid",
    "polished"
  ],
  "intents": [
    "expanding circle menu animation",
    "clip-path circle reveal menu",
    "round button opens fullscreen menu",
    "staggered menu links",
    "accessible overlay menu focus trap"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "background",
      "label": "Background",
      "type": "color",
      "value": "#0c1e18"
    },
    {
      "key": "duration",
      "label": "Open duration (ms)",
      "type": "range",
      "min": 200,
      "max": 1400,
      "step": 50,
      "value": 650
    },
    {
      "key": "stagger",
      "label": "Link stagger (ms)",
      "type": "range",
      "min": 0,
      "max": 200,
      "step": 10,
      "value": 70
    },
    {
      "key": "radius",
      "label": "Panel radius (rem)",
      "type": "range",
      "min": 0.5,
      "max": 3,
      "step": 0.1,
      "value": 1.6
    }
  ],
  "license": "Free to use in personal and client projects during the preview. Final licence terms will be published here before any paid tier starts; ask before reselling the code as a collection.",
  "contract": "function mount(root, opts) -> { update(partialOpts), destroy() }; root must contain the element markup",
  "exports": {
    "claude": "Add the \"Expanding rounded menu\" element to this project.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nSteps:\n1. Look at the project first to see its framework and where components, styles and static files live. Follow its conventions.\n2. Fetch https://enrichr.dev/elements/expanding-rounded-menu.json if you can read URLs (fields: source.markup, source.css, source.js, params); otherwise use the source at the end of this message.\n3. Add the files, mount it where I tell you (default: the top of the home page), and pass the settings below as the opts.\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n5. Run the dev server and check it. with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "chatgpt": "I want the \"Expanding rounded menu\" element on my website. Below is its complete source. Please:\n1. Build one self-contained index.html that I can open locally to see it working (put the CSS in a <style> tag and the JavaScript in a <script> tag, with the markup in the body).\n2. Then explain, step by step, which parts go where in my own site, and how to mount it. My stack is: [tell me yours, or say \"plain HTML\"].\n3. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.",
    "cursor": "Add the \"Expanding rounded menu\" element to this codebase.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nUse Composer / agent mode. First search the repo for how components, styles and scripts are organised, then add the files in the matching places, mount it on the page I name, and run the app to confirm it works. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.\n\nOptional: save this as .cursor/rules/enrichr-expanding-rounded-menu.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Expanding rounded menu element\nalwaysApply: false\n---\nmount(root, opts) expects the element markup inside root and returns { update, destroy }. Always call destroy() on unmount and never edit the ef- class names.",
    "v0": "Create a Next.js (App Router) client component for the \"Expanding rounded menu\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles to create:\n- expanding-rounded-menu.js : the JavaScript below, with one line appended at the end: export { mount };  (and the markup exported as: export const markup = \"<the markup string>\";). If the project uses TypeScript and does not allow JS imports, put // @ts-nocheck on the first line.\n- the CSS below goes in your global stylesheet (or a plain .css file imported once at the app root). The class names are global and start with ef-.\n\nUse this component as the wrapper (adjust the import paths):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./expanding-rounded-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ExpandingRoundedMenu(props: Record<string, unknown>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n```\n\nRender it on the home page so I can see it. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "lovable": "Add the \"Expanding rounded menu\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles to create:\n- expanding-rounded-menu.js : the JavaScript below, with one line appended at the end: export { mount };  (and the markup exported as: export const markup = \"<the markup string>\";). If the project uses TypeScript and does not allow JS imports, put // @ts-nocheck on the first line.\n- the CSS below goes in your global stylesheet (or a plain .css file imported once at the app root). The class names are global and start with ef-.\n\nWrapper component (src/components/ExpandingRoundedMenu.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./expanding-rounded-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ExpandingRoundedMenu(props: Record<string, unknown>) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n```\n\nRemove the \"use client\" line if it is not needed. Show it on the home page. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "bolt": "Create a small Vite project (vanilla JavaScript, no framework unless I already have one) that shows the \"Expanding rounded menu\" element.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles: index.html (a container element, then a script tag), style.css (the CSS below), expanding-rounded-menu.js (the JavaScript below) and main.js that sets the container's innerHTML to the markup and calls mount(container, opts) with the settings below. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}\n\nVerify: with reduced motion on, nothing moves; it works at 375px wide and with touch only; there are no console errors; scrolling stays smooth; destroy() is called when it unmounts.",
    "replit": "Create a new HTML, CSS and JavaScript Repl that shows the \"Expanding rounded menu\" element. No packages, no server code.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nFiles: index.html (a container element, link style.css, load expanding-rounded-menu.js and then main.js), style.css (the CSS below), expanding-rounded-menu.js (the JavaScript below), main.js (sets the container's innerHTML to the markup, then calls mount(container, opts) with the settings below). Press Run to preview. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "figma": "Designer handoff notes for the \"Expanding rounded menu\" element (Enrichr Library). Figma cannot run this JavaScript inside a design file, so use it as a motion reference and hand the code to a developer.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nWhat it does: The panel is always laid out at full size but clipped with clip-path: circle() centred on the button. Opening animates the circle radius to 150%, so the panel appears to grow out of the button, and its rounded corners come from border-radius on the panel itself. Each link has an index in --i and its transition-delay is calculated from it plus the open duration, which gives the stagger. The script only toggles one is-open class, updates aria-expanded, and handles Esc, outside presses and Tab wrapping.\nAccessibility: The button reports aria-expanded and swaps its label between open and close. While open, focus moves to the first link, Tab and Shift+Tab wrap between the button and the links, and Esc closes and returns focus to the button. The closed panel is visibility hidden so its links cannot be tabbed to. Reduced motion removes every transition and shows or hides the panel instantly.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Background: color, default #0c1e18\n- Open duration (ms): range 200 to 1400, step 50, default 650\n- Link stagger (ms): range 0 to 200, step 10, default 70\n- Panel radius (rem): range 0.5 to 3, step 0.1, default 1.6\n\nCurrent settings:\n{{SETTINGS}}\n\nFor the developer: Element contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\nIn Figma:\n- Draw the resting state as a frame and the end state as a second frame; link them with Smart Animate to show the motion in a prototype.\n- Put the settings above in the frame's notes or Dev Mode annotations so the developer matches them.\n- Link https://enrichr.dev/elements/expanding-rounded-menu.html in the handoff: the live demo and the copy-ready code are there. Developers can paste the prompts for Claude, Cursor or v0 from the Export menu.\nNothing is copied from another designer's file; this is original code from Enrichr.",
    "framer": "Add the \"Expanding rounded menu\" element to Framer as a code component. Framer code components are React, so wrap the vanilla code like this. Check it in the Framer editor, as Framer's component API can change.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\n1. In Framer: Assets > Code > New component. Name it ExpandingRoundedMenu.\n2. Paste the JavaScript below into a separate code file named expanding-rounded-menu.js in the same project, with  export { mount };  and  export const markup = \"<the markup string>\";  added. Put the CSS into the component as a <style> tag.\n3. Component:\n```tsx\nimport { addPropertyControls, ControlType } from \"framer\"\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./expanding-rounded-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ExpandingRoundedMenu(props: any) {\n  const ref = useRef<HTMLDivElement>(null);\n  const fx = useRef<{ update: (o: object) => void; destroy: () => void } | null>(null);\n  useEffect(() => {\n    const root = ref.current;\n    if (!root) return;\n    root.innerHTML = markup;\n    fx.current = mount(root, props);\n    return () => { fx.current?.destroy(); fx.current = null; root.innerHTML = \"\"; };\n  }, []);\n  useEffect(() => { fx.current?.update(props); }, [JSON.stringify(props)]);\n  return <div ref={ref} />;\n}\n\naddPropertyControls(ExpandingRoundedMenu, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  background: { type: ControlType.Color, title: \"Background\", defaultValue: \"#0c1e18\" },\n  duration: { type: ControlType.Number, title: \"Open duration\", min: 200, max: 1400, step: 50, defaultValue: 650 },\n  stagger: { type: ControlType.Number, title: \"Link stagger\", min: 0, max: 200, step: 10, defaultValue: 70 },\n  radius: { type: ControlType.Number, title: \"Panel radius\", min: 0.5, max: 3, step: 0.1, defaultValue: 1.6 },\n})\n```\n4. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}",
    "webflow": "Add the \"Expanding rounded menu\" element to a Webflow site with an Embed element. Test it on the published or preview site: scripts in embeds may not run inside the Designer canvas.\n\nThis is the \"Expanding rounded menu\" element from the Enrichr Library: A round menu button that grows into a full rounded panel with a clip-path reveal and staggered links, with Esc, outside-click and a focus trap.\nPage: https://enrichr.dev/elements/expanding-rounded-menu.html\nMachine-readable spec: https://enrichr.dev/elements/expanding-rounded-menu.json\n\nElement contract (vanilla JavaScript, no dependencies):\n- The JavaScript defines a function mount(root, opts).\n- root is an empty container element. Set root.innerHTML to the markup first, then call mount(root, opts).\n- It returns an object with update(partialOpts) and destroy(). Call destroy() when the element is removed. Some elements also return replay().\n- The CSS classes all start with \"ef-\" so they will not collide with your styles.\n\n1. Add an Embed element where it should appear. Paste a <style> block with the CSS, one container <div id=\"enrichr-expanding-rounded-menu\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-expanding-rounded-menu\"), { ...your settings... });\n   (set the container's innerHTML to the markup first, as in the contract).\n2. Embed elements have a size limit (check Webflow's current number). If the code is longer, host the JS and CSS as files and link them from Custom code in the page settings, then keep only the container and the mount call in the Embed.\n3. Keep the behaviour of the source unchanged. Do not add dependencies. Respect prefers-reduced-motion. Keep text as real HTML.\n\nSettings:\n{{SETTINGS}}\n\nSource:\n{{CODE}}"
  },
  "exportTools": [
    "claude",
    "chatgpt",
    "cursor",
    "v0",
    "lovable",
    "bolt",
    "replit",
    "figma",
    "framer",
    "webflow"
  ],
  "accessibility": "The button reports aria-expanded and swaps its label between open and close. While open, focus moves to the first link, Tab and Shift+Tab wrap between the button and the links, and Esc closes and returns focus to the button. The closed panel is visibility hidden so its links cannot be tabbed to. Reduced motion removes every transition and shows or hides the panel instantly.",
  "performance": "Only clip-path, transform and opacity change. The panel is one element with a handful of links. Avoid very large blurred shadows on the panel while it animates.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-erm\">\n  <div class=\"ef-erm__stage\">\n    <p class=\"ef-erm__hint\">Menu</p>\n    <div class=\"ef-erm__panel\" id=\"ef-erm-panel\" role=\"dialog\" aria-label=\"Site menu\"><nav class=\"ef-erm__nav\"></nav></div>\n    <button class=\"ef-erm__btn\" type=\"button\" aria-expanded=\"false\" aria-controls=\"ef-erm-panel\" aria-label=\"Open menu\"><span class=\"ef-erm__bar\"></span><span class=\"ef-erm__bar\"></span></button>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-erm { width: 100%; }\n.ef-erm__stage { --bx: 2.4rem; --by: 2.4rem; --dur: 650ms; --rad: 1.6rem; position: relative; box-sizing: border-box; width: 100%; min-height: 22rem; overflow: hidden; border-radius: 1rem; background: #0c1e18; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; color: #fbf8f1; }\n.ef-erm__hint { position: absolute; left: 1.4rem; top: 1.5rem; margin: 0; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; opacity: 0.6; }\n.ef-erm__panel { position: absolute; inset: 0.7rem; border-radius: var(--rad); background: linear-gradient(155deg, #0a6b46, #005236 55%, #0c1e18); box-shadow: inset 0 0 0 1px rgba(230, 255, 85, 0.18); clip-path: circle(1.6rem at calc(100% - var(--bx) + 0.7rem) calc(var(--by) - 0.7rem)); visibility: hidden; transition: clip-path var(--dur) cubic-bezier(.7,0,.2,1), visibility 0s linear var(--dur); }\n.ef-erm.is-open .ef-erm__panel { clip-path: circle(150% at calc(100% - var(--bx) + 0.7rem) calc(var(--by) - 0.7rem)); visibility: visible; transition: clip-path var(--dur) cubic-bezier(.7,0,.2,1), visibility 0s; }\n.ef-erm__nav { box-sizing: border-box; height: 100%; padding: 4.4rem 1.6rem 1.4rem; display: flex; flex-direction: column; justify-content: center; gap: 0.15rem; }\n.ef-erm__link { display: flex; align-items: baseline; gap: 0.8rem; padding: 0.35rem 0; color: #fbf8f1; text-decoration: none; font-size: clamp(1.4rem, 5vw, 2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; opacity: 0; transform: translateY(1.2rem); transition: opacity 300ms ease, transform 400ms cubic-bezier(.2,.8,.2,1), color 200ms; transition-delay: 0ms; border-radius: 0.5rem; outline: none; }\n.ef-erm.is-open .ef-erm__link { opacity: 1; transform: none; transition-delay: calc(var(--dur) * 0.45 + var(--i) * var(--stg, 70ms)); }\n.ef-erm__num { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; color: var(--ef-acc, #e6ff55); }\n.ef-erm__link:hover, .ef-erm__link:focus-visible { color: var(--ef-acc, #e6ff55); }\n.ef-erm__link:focus-visible { box-shadow: 0 0 0 2px var(--ef-acc, #e6ff55); padding-left: 0.4rem; }\n.ef-erm__btn { position: absolute; top: calc(var(--by) - 1.7rem); right: calc(var(--bx) - 1.7rem); z-index: 2; width: 3.4rem; height: 3.4rem; border: 0; border-radius: 50%; cursor: pointer; background: var(--ef-acc, #e6ff55); display: grid; place-content: center; gap: 0.32rem; transition: transform 300ms cubic-bezier(.2,.8,.2,1), box-shadow 200ms; outline: none; }\n.ef-erm__btn:hover { transform: scale(1.06); }\n.ef-erm__btn:focus-visible { box-shadow: 0 0 0 3px #0c1e18, 0 0 0 5px var(--ef-acc, #e6ff55); }\n.ef-erm__bar { display: block; width: 1.3rem; height: 2px; background: #0c1e18; border-radius: 2px; transition: transform 350ms cubic-bezier(.2,.8,.2,1); }\n.ef-erm.is-open .ef-erm__bar:nth-child(1) { transform: translateY(0.19rem) rotate(45deg); }\n.ef-erm.is-open .ef-erm__bar:nth-child(2) { transform: translateY(-0.19rem) rotate(-45deg); }\n@media (prefers-reduced-motion: reduce) {\n  .ef-erm__panel, .ef-erm.is-open .ef-erm__panel { transition: none; }\n  .ef-erm__link, .ef-erm.is-open .ef-erm__link { transition: none; transform: none; }\n  .ef-erm__bar, .ef-erm__btn { transition: none; }\n}",
    "js": "// Enrichr Library · https://enrichr.dev\n// Expanding rounded menu: a round button grows a clipped, rounded panel from its own centre and staggers the links in.\n// The reveal is one clip-path circle transition; links get a --i index for the stagger. Esc or an outside press closes it, Tab is trapped\n// inside while open and focus returns to the button. Reduced motion skips the transitions and just shows the panel.\n// mount(root, { background, accent, duration (ms), stagger (ms), radius (rem) })\nfunction mount(root, o) {\n  var host = root.classList.contains(\"ef-erm\") ? root : root.querySelector(\".ef-erm\");\n  var stage = root.querySelector(\".ef-erm__stage\");\n  var btn = root.querySelector(\".ef-erm__btn\");\n  var nav = root.querySelector(\".ef-erm__nav\");\n  var opts = {}, links = [], built = false, openState = false;\n  var ITEMS = [\"Work\", \"Studio\", \"Journal\", \"Shop\", \"Contact\"];\n\n  function build() {\n    ITEMS.forEach(function (name, i) {\n      var a = document.createElement(\"a\");\n      a.className = \"ef-erm__link\";\n      a.href = \"#\";\n      a.style.setProperty(\"--i\", String(i));\n      var n = document.createElement(\"span\"); n.className = \"ef-erm__num\"; n.textContent = String(i + 1).padStart(2, \"0\");\n      var t = document.createElement(\"span\"); t.textContent = name;\n      a.appendChild(n); a.appendChild(t);\n      a.addEventListener(\"click\", onLink);\n      nav.appendChild(a);\n      links.push(a);\n    });\n    built = true;\n  }\n  function onLink(e) { e.preventDefault(); setOpen(false, true); }\n  function setOpen(v, refocus) {\n    if (v === openState) return;\n    openState = v;\n    host.classList.toggle(\"is-open\", v);\n    btn.setAttribute(\"aria-expanded\", v ? \"true\" : \"false\");\n    btn.setAttribute(\"aria-label\", v ? \"Close menu\" : \"Open menu\");\n    if (v) { if (links[0]) links[0].focus({ preventScroll: true }); }\n    else if (refocus) btn.focus({ preventScroll: true });\n  }\n  function onBtn() { setOpen(!openState, true); }\n  function onKey(e) {\n    if (!openState) return;\n    if (e.key === \"Escape\") { e.preventDefault(); setOpen(false, true); return; }\n    if (e.key !== \"Tab\") return;\n    var seq = [btn].concat(links);\n    var i = seq.indexOf(document.activeElement);\n    if (i === -1) { e.preventDefault(); seq[0].focus(); return; }\n    e.preventDefault();\n    var next = (i + (e.shiftKey ? -1 : 1) + seq.length) % seq.length;\n    seq[next].focus();\n  }\n  function onDown(e) {\n    if (!openState) return;\n    if (!nav.contains(e.target) && !btn.contains(e.target)) setOpen(false, false);\n  }\n  btn.addEventListener(\"click\", onBtn);\n  document.addEventListener(\"keydown\", onKey);\n  document.addEventListener(\"pointerdown\", onDown);\n  build();\n\n  function update(next) {\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", duration: 650, stagger: 70, radius: 1.6 }, opts, next || {});\n    stage.style.background = opts.background;\n    stage.style.setProperty(\"--ef-acc\", opts.accent);\n    stage.style.setProperty(\"--dur\", opts.duration + \"ms\");\n    stage.style.setProperty(\"--stg\", opts.stagger + \"ms\");\n    stage.style.setProperty(\"--rad\", opts.radius + \"rem\");\n  }\n  update(o);\n  return {\n    update: update,\n    destroy: function () {\n      btn.removeEventListener(\"click\", onBtn);\n      document.removeEventListener(\"keydown\", onKey);\n      document.removeEventListener(\"pointerdown\", onDown);\n      links.forEach(function (a) { a.removeEventListener(\"click\", onLink); });\n    }\n  };\n}"
  }
}