{
  "id": "island-menu",
  "kind": "element",
  "title": "Island menu",
  "summary": "A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.",
  "url": "https://enrichr.dev/elements/island-menu.html",
  "section": "nav",
  "techniques": [
    "reveal",
    "stagger"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "modern",
    "playful"
  ],
  "intents": [
    "dynamic island menu",
    "hamburger menu that expands into a pill",
    "animated mobile navigation panel",
    "menu button morph to close icon",
    "overshoot nav open animation"
  ],
  "status": "tested",
  "params": [
    {
      "key": "brand",
      "label": "Brand name",
      "type": "text",
      "value": "Enrichr"
    },
    {
      "key": "items",
      "label": "Links (comma separated)",
      "type": "text",
      "value": "About, Work, Journal, Contact"
    },
    {
      "key": "accent",
      "label": "Accent",
      "type": "color",
      "value": "#0ae448"
    },
    {
      "key": "background",
      "label": "Page background",
      "type": "color",
      "value": "#0e100f"
    },
    {
      "key": "width",
      "label": "Open width (px)",
      "type": "range",
      "min": 200,
      "max": 440,
      "step": 10,
      "value": 320
    }
  ],
  "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 \"Island menu\" element to this project.\n\nThis is the \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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/island-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 \"Island 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 \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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 \"Island menu\" element to this codebase.\n\nThis is the \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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-island-menu.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Island 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 \"Island menu\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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- island-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 \"./island-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function IslandMenu(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 \"Island menu\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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- island-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/IslandMenu.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./island-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function IslandMenu(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 \"Island menu\" element.\n\nThis is the \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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), island-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 \"Island menu\" element. No packages, no server code.\n\nThis is the \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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 island-menu.js and then main.js), style.css (the CSS below), island-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 \"Island 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 \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-menu.json\n\nWhat it does: Everything is CSS transitions switched by one is-open class; the script only toggles the class and handles focus. The island's width transitions from a 50px circle to the open width with a back-out curve (cubic-bezier 0.34, 1.56, 0.64, 1), so it overshoots and settles. The logo fades in while turning from -180 degrees, and the brand name fades in after it. The three hamburger lines are SVG lines: the top and bottom ones move to the middle, rotate 45 degrees in opposite directions and stretch slightly to become a cross, and the middle one fades out. A blurred backdrop fades in over the page. The panel starts at 60 percent scale, nudged up, invisible, with its origin in the top right corner, and grows out with the same overshoot. Each link fades and rises in after a delay of 0.22 seconds plus 0.05 seconds times its position.\nAccessibility: The toggle is a real button with aria-expanded, aria-controls and a label that switches between open and close. Opening from the keyboard moves focus to the first link, Tab cycles between the button and the links while it is open, and Escape closes it and returns focus to the button. A click on the blurred page or on a link also closes it. Closed links are hidden with visibility, so they are out of the tab order. With reduced motion every transition is instant.\n\nTunable settings:\n- Brand name: text, default Enrichr\n- Links (comma separated): text, default About, Work, Journal, Contact\n- Accent: color, default #0ae448\n- Page background: color, default #0e100f\n- Open width (px): range 200 to 440, step 10, default 320\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/island-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 \"Island 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 \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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 IslandMenu.\n2. Paste the JavaScript below into a separate code file named island-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 \"./island-menu\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function IslandMenu(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(IslandMenu, {\n  brand: { type: ControlType.String, title: \"Brand name\", defaultValue: \"Enrichr\" },\n  items: { type: ControlType.String, title: \"Links (comma separated)\", defaultValue: \"About, Work, Journal, Contact\" },\n  accent: { type: ControlType.Color, title: \"Accent\", defaultValue: \"#0ae448\" },\n  background: { type: ControlType.Color, title: \"Page background\", defaultValue: \"#0e100f\" },\n  width: { type: ControlType.Number, title: \"Open width\", min: 200, max: 440, step: 10, defaultValue: 320 },\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 \"Island 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 \"Island menu\" element from the Enrichr Library: A round menu button that stretches into a wide pill, spins its logo in, turns its bars into a cross and pops a panel of links out of the corner.\nPage: https://enrichr.dev/elements/island-menu.html\nMachine-readable spec: https://enrichr.dev/elements/island-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-island-menu\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-island-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 toggle is a real button with aria-expanded, aria-controls and a label that switches between open and close. Opening from the keyboard moves focus to the first link, Tab cycles between the button and the links while it is open, and Escape closes it and returns focus to the button. A click on the blurred page or on a link also closes it. Closed links are hidden with visibility, so they are out of the tab order. With reduced motion every transition is instant.",
  "performance": "No animation loop at all: every change is a CSS transition on transform, opacity or width. The width transition does trigger layout on the island only, which is small. The backdrop blur costs a little while open; drop backdrop-filter if the page behind is heavy.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-ism\"><div class=\"ef-ism__zone\"><header class=\"ef-ism__bar\"><span class=\"ef-ism__name\"></span><div class=\"ef-ism__island\"><span class=\"ef-ism__logo\" aria-hidden=\"true\"><svg viewBox=\"0 0 24 24\" width=\"22\" height=\"22\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linejoin=\"round\"><path d=\"M12 2.5 21.5 12 12 21.5 2.5 12Z\"/><path d=\"M12 7.5 16.5 12 12 16.5 7.5 12Z\"/></svg></span><span class=\"ef-ism__brand\" aria-hidden=\"true\"></span><button type=\"button\" class=\"ef-ism__btn\" aria-expanded=\"false\" aria-label=\"Open navigation menu\"><svg viewBox=\"0 0 16 16\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" aria-hidden=\"true\"><line class=\"ef-ism__ln ef-ism__ln--t\" x1=\"2\" y1=\"4\" x2=\"14\" y2=\"4\"/><line class=\"ef-ism__ln ef-ism__ln--m\" x1=\"2\" y1=\"8\" x2=\"14\" y2=\"8\"/><line class=\"ef-ism__ln ef-ism__ln--b\" x1=\"2\" y1=\"12\" x2=\"14\" y2=\"12\"/></svg></button></div></header><div class=\"ef-ism__backdrop\"></div><nav class=\"ef-ism__panel\" aria-label=\"Main\"><ul class=\"ef-ism__links\"></ul></nav><div class=\"ef-ism__page\"><h2 class=\"ef-ism__h\">Open the island</h2><p>The menu button grows into a wide pill, then the panel drops out of it.</p></div></div></div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-ism__zone { position: relative; overflow: hidden; min-height: 26rem; border-radius: 1rem; color: #f3f1ea; background: var(--ef-bg, #0e100f); container-type: inline-size; --ef-back: cubic-bezier(0.34, 1.56, 0.64, 1); }\n.ef-ism__bar { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem clamp(1rem, 4vw, 2rem); }\n.ef-ism__name { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.ef-ism__island { position: relative; display: flex; align-items: center; justify-content: flex-end; flex-shrink: 0; box-sizing: border-box; width: 50px; height: 50px; padding: 6px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, 0.1); background: rgba(22, 24, 22, 0.92); overflow: hidden; transition: width 0.8s var(--ef-back), border-color 0.3s ease; }\n.ef-ism__island:hover, .ef-ism.is-open .ef-ism__island { border-color: color-mix(in srgb, var(--ef-accent, #0ae448) 40%, transparent); }\n.ef-ism.is-open .ef-ism__island { width: var(--ef-open, 320px); }\n.ef-ism__logo { position: absolute; left: 12px; top: 50%; display: flex; color: var(--ef-accent, #0ae448); opacity: 0; transform: translateY(-50%) rotate(-180deg); transition: opacity 0.3s ease, transform 0.5s var(--ef-back); }\n.ef-ism__brand { position: absolute; left: 44px; top: 50%; transform: translateY(-50%); font-size: 0.85rem; font-weight: 700; white-space: nowrap; opacity: 0; transition: opacity 0.2s ease; }\n.ef-ism.is-open .ef-ism__logo { opacity: 1; transform: translateY(-50%) rotate(0deg); transition-delay: 0.12s; }\n.ef-ism.is-open .ef-ism__brand { opacity: 1; transition: opacity 0.4s ease 0.3s; }\n.ef-ism__btn { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 36px; height: 36px; margin: 0; padding: 0; border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 50%; background: rgba(255, 255, 255, 0.03); color: #bbbaa6; cursor: pointer; transition: background 0.2s, transform 0.2s; }\n.ef-ism__btn:hover { background: color-mix(in srgb, var(--ef-accent, #0ae448) 15%, transparent); transform: scale(1.05); }\n.ef-ism__btn:focus-visible { outline: 2px solid var(--ef-accent, #0ae448); outline-offset: 3px; }\n.ef-ism__ln { transform-box: view-box; transform-origin: 8px 8px; transition: transform 0.28s cubic-bezier(0.65, 0, 0.35, 1), opacity 0.15s ease; }\n.ef-ism.is-open .ef-ism__ln--t { transform: translateY(4px) rotate(45deg) scaleX(1.18); }\n.ef-ism.is-open .ef-ism__ln--m { opacity: 0; }\n.ef-ism.is-open .ef-ism__ln--b { transform: translateY(-4px) rotate(-45deg) scaleX(1.18); }\n.ef-ism__backdrop { position: absolute; inset: 0; z-index: 2; background: rgba(14, 16, 15, 0.82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }\n.ef-ism.is-open .ef-ism__backdrop { opacity: 1; pointer-events: auto; }\n.ef-ism__panel { position: absolute; z-index: 3; top: 4.9rem; right: clamp(1rem, 4vw, 2rem); width: min(calc(100% - 2rem), var(--ef-open, 320px)); box-sizing: border-box; padding: 0.6rem; border: 1.5px solid rgba(255, 255, 255, 0.12); border-radius: 20px; background: rgba(22, 24, 22, 0.98); box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 30px color-mix(in srgb, var(--ef-accent, #0ae448) 6%, transparent); transform-origin: top right; opacity: 0; visibility: hidden; transform: translateY(-10%) scale(0.6); transition: opacity 0.3s ease, transform 0.5s ease, visibility 0s linear 0.5s; }\n.ef-ism.is-open .ef-ism__panel { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s ease 0.1s, transform 0.8s var(--ef-back) 0.1s, visibility 0s; }\n.ef-ism .ef-ism__links { margin: 0; padding: 0; list-style: none; }\n.ef-ism .ef-ism__links li { margin: 0; opacity: 1; }\n.ef-ism__link { display: flex; align-items: center; justify-content: space-between; padding: 0.95rem 1.1rem; border-radius: 12px; color: inherit; font-size: 1.05rem; font-weight: 600; text-decoration: none; opacity: 0; transform: translateY(6px); transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease, color 0.2s ease; }\n.ef-ism.is-open .ef-ism__link { opacity: 1; transform: none; transition: opacity 0.32s ease calc(0.22s + var(--i, 0) * 0.05s), transform 0.32s ease calc(0.22s + var(--i, 0) * 0.05s), background 0.2s ease, color 0.2s ease; }\n.ef-ism__link:hover, .ef-ism__link:focus-visible { background: color-mix(in srgb, var(--ef-accent, #0ae448) 12%, transparent); color: var(--ef-accent, #0ae448); outline: none; }\n.ef-ism__num { font-size: 0.75rem; font-weight: 500; opacity: 0.5; font-variant-numeric: tabular-nums; }\n.ef-ism__page { position: relative; z-index: 1; padding: clamp(2rem, 7vw, 4.5rem) clamp(1rem, 4vw, 2rem) 2.5rem; max-width: 34rem; }\n.ef-ism .ef-ism__h { margin: 0 0 0.8rem; font-size: clamp(2rem, 7vw, 4rem); font-size: clamp(2rem, 9cqi, 4rem); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }\n.ef-ism .ef-ism__page p { margin: 0; opacity: 1; color: rgba(243, 241, 234, 0.65); font-size: 1.05rem; line-height: 1.5; }\n@media (prefers-reduced-motion: reduce) {\n  .ef-ism__zone *, .ef-ism__zone *::before { transition-duration: 0s !important; transition-delay: 0s !important; }\n}",
    "js": "// Enrichr Library · https://enrichr.dev\n// Island menu: a round menu button in the header that stretches into a wide \"dynamic island\" pill with an overshoot,\n// spins a logo in, morphs its three bars into a cross, blurs the page and pops a panel of links out of the corner.\n// Escape, a click on the page or picking a link closes it; focus moves into the links and back to the button.\n// mount(root, { brand, items (comma separated), accent, background, width (px of the open island) })\nfunction mount(root, o) {\n  var wrap = root.querySelector(\".ef-ism\"), zone = root.querySelector(\".ef-ism__zone\");\n  var btn = root.querySelector(\".ef-ism__btn\"), panel = root.querySelector(\".ef-ism__panel\");\n  var list = root.querySelector(\".ef-ism__links\"), backdrop = root.querySelector(\".ef-ism__backdrop\");\n  var name = root.querySelector(\".ef-ism__name\"), brand = root.querySelector(\".ef-ism__brand\");\n  var pid = \"ef-ism-\" + Math.random().toString(36).slice(2, 8);\n  var opts = {}, open = false, links = [];\n  panel.id = pid;\n  btn.setAttribute(\"aria-controls\", pid);\n\n  function set(next, focus) {\n    open = next;\n    wrap.classList.toggle(\"is-open\", open);\n    btn.setAttribute(\"aria-expanded\", String(open));\n    btn.setAttribute(\"aria-label\", open ? \"Close navigation menu\" : \"Open navigation menu\");\n    if (open && focus && links[0]) setTimeout(function () { if (open) links[0].focus({ preventScroll: true }); }, 60);\n    if (!open && focus) btn.focus({ preventScroll: true });\n  }\n  function toggle(e) { set(!open, e.detail === 0); }\n  function onKey(e) {\n    if (!open) return;\n    if (e.key === \"Escape\") { e.preventDefault(); set(false, true); return; }\n    if (e.key !== \"Tab\") return;\n    var ring = [btn].concat(links), i = ring.indexOf(document.activeElement);\n    if (i < 0) return;\n    if (e.shiftKey && i === 0) { e.preventDefault(); ring[ring.length - 1].focus(); }\n    else if (!e.shiftKey && i === ring.length - 1) { e.preventDefault(); ring[0].focus(); }\n  }\n  function closeFromPage() { if (open) set(false, false); }\n  function pick(e) { e.preventDefault(); set(false, true); }\n  function fit() {\n    var max = zone.clientWidth - 2 * parseFloat(getComputedStyle(root.querySelector(\".ef-ism__bar\")).paddingLeft || 0);\n    wrap.style.setProperty(\"--ef-open\", Math.max(50, Math.min(Number(opts.width), max)) + \"px\");\n  }\n  function update(next) {\n    opts = Object.assign({ brand: \"Enrichr\", items: \"About, Work, Journal, Contact\", accent: \"#0ae448\", background: \"#0e100f\", width: 320 }, opts, next || {});\n    name.textContent = opts.brand;\n    brand.textContent = opts.brand;\n    wrap.style.setProperty(\"--ef-accent\", opts.accent);\n    zone.style.setProperty(\"--ef-bg\", opts.background);\n    list.textContent = \"\";\n    links = opts.items.split(\",\").map(function (s) { return s.trim(); }).filter(Boolean).map(function (label, i) {\n      var li = document.createElement(\"li\"), a = document.createElement(\"a\"), t = document.createElement(\"span\"), n = document.createElement(\"span\");\n      a.className = \"ef-ism__link\"; a.href = \"#\"; a.style.setProperty(\"--i\", i);\n      t.textContent = label;\n      n.className = \"ef-ism__num\"; n.textContent = (i < 9 ? \"0\" : \"\") + (i + 1);\n      a.appendChild(t); a.appendChild(n); li.appendChild(a); list.appendChild(li);\n      a.addEventListener(\"click\", pick);\n      return a;\n    });\n    fit();\n  }\n  update(o);\n  btn.addEventListener(\"click\", toggle);\n  backdrop.addEventListener(\"click\", closeFromPage);\n  zone.addEventListener(\"keydown\", onKey);\n  window.addEventListener(\"resize\", fit);\n  return {\n    update: update,\n    destroy: function () {\n      btn.removeEventListener(\"click\", toggle);\n      backdrop.removeEventListener(\"click\", closeFromPage);\n      zone.removeEventListener(\"keydown\", onKey);\n      window.removeEventListener(\"resize\", fit);\n    }\n  };\n}"
  }
}