{
  "id": "thumb-expand-detail",
  "kind": "element",
  "title": "Thumbnail expand to detail",
  "summary": "A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.",
  "url": "https://enrichr.dev/elements/thumb-expand-detail.html",
  "section": "gallery",
  "techniques": [
    "pointer-interaction",
    "reveal",
    "3d-css"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "cinematic",
    "polished",
    "modern"
  ],
  "intents": [
    "thumbnail expands to full screen on click",
    "image grows into detail page transition",
    "gallery thumb to hero image transition",
    "hover thumbnail neighbours move away",
    "masked title reveal after image expand"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "thumbWidth",
      "label": "Thumbnail width (%)",
      "type": "range",
      "min": 22,
      "max": 46,
      "step": 1,
      "value": 34
    },
    {
      "key": "hoverScale",
      "label": "Hover swell",
      "type": "range",
      "min": 1,
      "max": 1.4,
      "step": 0.02,
      "value": 1.2
    },
    {
      "key": "duration",
      "label": "Expand time (ms)",
      "type": "range",
      "min": 400,
      "max": 2000,
      "step": 50,
      "value": 1100
    },
    {
      "key": "title",
      "label": "Title",
      "type": "text",
      "value": "The quiet architecture of small things"
    }
  ],
  "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 \"Thumbnail expand to detail\" element to this project.\n\nThis is the \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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/thumb-expand-detail.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 \"Thumbnail expand to detail\" 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 \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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 \"Thumbnail expand to detail\" element to this codebase.\n\nThis is the \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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-thumb-expand-detail.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Thumbnail expand to detail 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 \"Thumbnail expand to detail\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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- thumb-expand-detail.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 \"./thumb-expand-detail\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ThumbExpandDetail(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 \"Thumbnail expand to detail\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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- thumb-expand-detail.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/ThumbExpandDetail.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./thumb-expand-detail\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ThumbExpandDetail(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 \"Thumbnail expand to detail\" element.\n\nThis is the \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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), thumb-expand-detail.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 \"Thumbnail expand to detail\" element. No packages, no server code.\n\nThis is the \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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 thumb-expand-detail.js and then main.js), style.css (the CSS below), thumb-expand-detail.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 \"Thumbnail expand to detail\" 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 \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.json\n\nWhat it does: This is a vanilla port of the Codrops thumbnail-to-fullscreen idea, with no GSAP or scroll library. One requestAnimationFrame loop drives an open progress value from 0 to 1 with an expo in-out curve, and a hover value that eases toward 0 or 1. The thumbnail is a full-stage art layer revealed through a clip-path inset: at 0 the inset is the thumbnail rectangle and the art is scaled down to fit it, at 1 the inset is zero and the art is at full size, so the image grows without distortion. The two neighbours slide outward, tilt on the Y axis and fade as the value rises. Title and subtitle are translated out of overflow-hidden masks with a small rotation, starting once the image is mostly grown. When the open state completes, the detail panel becomes its own scroll container.\nAccessibility: The thumbnail is a real button with a visible focus ring, and keyboard focus gives the same swell as hover. After opening, focus moves to the Close button, Escape closes, and focus returns to the thumbnail. The detail panel is inert until it is open, and is focusable so the keyboard can scroll it. With prefers-reduced-motion the expand is instant and the hover swell is off.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Thumbnail width (%): range 22 to 46, step 1, default 34\n- Hover swell: range 1 to 1.4, step 0.02, default 1.2\n- Expand time (ms): range 400 to 2000, step 50, default 1100\n- Title: text, default The quiet architecture of small things\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/thumb-expand-detail.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 \"Thumbnail expand to detail\" 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 \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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 ThumbExpandDetail.\n2. Paste the JavaScript below into a separate code file named thumb-expand-detail.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 \"./thumb-expand-detail\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function ThumbExpandDetail(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(ThumbExpandDetail, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  thumbWidth: { type: ControlType.Number, title: \"Thumbnail width\", min: 22, max: 46, step: 1, defaultValue: 34 },\n  hoverScale: { type: ControlType.Number, title: \"Hover swell\", min: 1, max: 1.4, step: 0.02, defaultValue: 1.2 },\n  duration: { type: ControlType.Number, title: \"Expand time\", min: 400, max: 2000, step: 50, defaultValue: 1100 },\n  title: { type: ControlType.String, title: \"Title\", defaultValue: \"The quiet architecture of small things\" },\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 \"Thumbnail expand to detail\" 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 \"Thumbnail expand to detail\" element from the Enrichr Library: A centred thumbnail between two neighbours that swells on hover, then grows to fill the stage on click while the title and subtitle rise out of masks and a detail panel scrolls on its own.\nPage: https://enrichr.dev/elements/thumb-expand-detail.html\nMachine-readable spec: https://enrichr.dev/elements/thumb-expand-detail.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-thumb-expand-detail\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-thumb-expand-detail\"), { ...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 thumbnail is a real button with a visible focus ring, and keyboard focus gives the same swell as hover. After opening, focus moves to the Close button, Escape closes, and focus returns to the thumbnail. The detail panel is inert until it is open, and is focusable so the keyboard can scroll it. With prefers-reduced-motion the expand is instant and the hover swell is off.",
  "performance": "Per frame it writes one clip-path, a few transforms and opacity values on five elements. Nothing triggers layout while animating; sizes are measured only on resize through a ResizeObserver. The loop stops as soon as the open progress and hover value settle.",
  "dependencies": [],
  "codepen": "https://codepen.io/Enrichr-Dev/pen/PwpXBML",
  "source": {
    "markup": "<div class=\"ef-tfd\">\n  <svg class=\"ef-tfd__defs\" width=\"0\" height=\"0\" aria-hidden=\"true\" focusable=\"false\">\n    <symbol id=\"ef-tfd-pz1\" viewBox=\"1513.7 1453.9 322.3 322.3\"><path fill=\"currentColor\" d=\"M1821 1761.2h-292.3v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5.1 7.8 8.6 19.7 13.6 32.7 11.9 16.8-2.3 30.1-16 32-32.7 2.5-22.6-15.1-41.6-37.1-41.6-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.4-14.5-14.4v-111.7h292.3v111.7c0 8-6.4 14.4-14.5 14.4-4.2 0-8.1-1.8-10.9-5-7.9-8.6-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.6 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5z\"/></symbol>\n    <symbol id=\"ef-tfd-pz4\" viewBox=\"1423.36 860.8 503.07 322.3\"><path fill=\"currentColor\" d=\"M1821 875.8v111.6c0 8 6.5 14.5 14.5 14.5 4.2 0 8.1-1.9 10.9-5 6.8-7.5 16.7-12.3 27.7-12.3 22 0 39.6 19 37.1 41.6-1.9 16.7-15.2 30.5-32 32.7-13 1.7-24.8-3.3-32.7-11.9-2.8-3.2-6.8-5-11-5-8 0-14.5 6.4-14.5 14.4v111.7h-111.6c-8 0-14.5-6.5-14.5-14.5 0-4.2 1.9-8.2 5-11 8.7-7.9 13.7-19.7 12-32.7-2.3-16.8-16-30.1-32.8-32-22.5-2.5-41.5 15.1-41.5 37.1 0 11 4.7 20.9 12.3 27.7 3.1 2.8 4.9 6.7 4.9 10.8v0.1c0 8-6.4 14.5-14.5 14.5h-111.6v-111.7c0-8-6.4-14.4-14.5-14.4-4.1 0-8 1.8-10.8 4.9-6.9 7.6-16.7 12.3-27.7 12.3-22 0-39.6-19-37.1-41.6 1.9-16.7 15.2-30.4 32-32.7 13-1.7 24.8 3.3 32.7 11.9 2.8 3.2 6.7 5.1 10.9 5.1 8.1 0 14.5-6.5 14.5-14.5v-111.6z\"/></symbol>\n    <symbol id=\"ef-tfd-pz8\" viewBox=\"1513.7 166.86 322.3 503.06\"><path fill=\"currentColor\" d=\"M1528.7 564.5v-111.6c0-8 6.5-14.5 14.5-14.5 4.2 0 8.2 1.9 11 5 7.8 8.7 19.7 13.7 32.7 11.9 16.8-2.2 30.1-15.9 32-32.7 2.5-22.5-15.1-41.5-37.1-41.5-11 0-20.9 4.7-27.7 12.3-2.8 3.1-6.7 4.9-10.9 4.9-8 0-14.5-6.5-14.5-14.5v-111.6h111.6c8.1 0 14.5-6.5 14.5-14.5 0-4.1-1.8-8.1-4.9-10.9-7.6-6.8-12.3-16.6-12.3-27.6 0-22 19-39.6 41.5-37.1 16.8 1.8 30.5 15.2 32.8 32 1.7 12.9-3.3 24.8-12 32.7-3.1 2.8-5 6.7-5 10.9 0 8 6.5 14.5 14.5 14.5h111.6v111.6c0 8-6.4 14.5-14.5 14.5-4.2 0-8.1-1.9-10.9-5-7.9-8.7-19.7-13.6-32.7-11.9-16.8 2.2-30.1 15.9-32 32.7-2.5 22.5 15.1 41.6 37.1 41.6 11 0 20.8-4.8 27.7-12.3 2.8-3.1 6.7-5 10.8-5 8.1 0 14.5 6.5 14.5 14.5v111.6h-111.6c-8 0-14.5 6.5-14.5 14.5 0 4.2 1.9 8.1 5 10.9 7.5 6.8 12.3 16.7 12.3 27.7 0 22-19 39.5-41.6 37.1-16.8-1.9-30.5-15.3-32.7-32-1.7-13 3.3-24.9 11.9-32.7 3.1-2.9 5-6.8 5-11 0-8-6.4-14.5-14.5-14.5z\"/></symbol>\n  </svg>\n  <div class=\"ef-tfd__stage\">\n    <div class=\"ef-tfd__thumbs\" aria-hidden=\"true\">\n      <div class=\"ef-tfd__side ef-tfd__side--l\"><svg class=\"ef-tfd__pz\"><use href=\"#ef-tfd-pz8\"/></svg></div>\n      <div class=\"ef-tfd__side ef-tfd__side--r\"><svg class=\"ef-tfd__pz\"><use href=\"#ef-tfd-pz1\"/></svg></div>\n    </div>\n    <div class=\"ef-tfd__cap\" aria-hidden=\"true\"><span class=\"ef-tfd__capn\">03</span><span class=\"ef-tfd__capt\">Field notes</span></div>\n    <div class=\"ef-tfd__hero\" aria-hidden=\"true\">\n      <div class=\"ef-tfd__art\">\n        <svg class=\"ef-tfd__pz ef-tfd__pz--a\"><use href=\"#ef-tfd-pz4\"/></svg>\n        <svg class=\"ef-tfd__pz ef-tfd__pz--b\"><use href=\"#ef-tfd-pz1\"/></svg>\n        <svg class=\"ef-tfd__pz ef-tfd__pz--c\"><use href=\"#ef-tfd-pz8\"/></svg>\n      </div>\n    </div>\n    <button class=\"ef-tfd__hit\" type=\"button\" aria-label=\"Open the story\"></button>\n    <div class=\"ef-tfd__detail\" inert>\n      <div class=\"ef-tfd__intro\">\n        <p class=\"ef-tfd__kick\">Chapter three</p>\n        <h3 class=\"ef-tfd__title\"><span class=\"ef-tfd__blk\"></span></h3>\n        <p class=\"ef-tfd__sub\"><span class=\"ef-tfd__blk\">Field notes from the studio floor</span></p>\n      </div>\n      <div class=\"ef-tfd__body\">\n        <p>Every project starts as a pile of small shapes that do not quite fit. The work is mostly patience: turning each piece until the edge you need faces the edge it has to meet.</p>\n        <div class=\"ef-tfd__plate\"><svg class=\"ef-tfd__pz\"><use href=\"#ef-tfd-pz4\"/></svg></div>\n        <p>This panel scrolls on its own, inside the stage, so it behaves the same in a full page or in a small embedded frame. Wheel and touch scrolling only act on it while you are over it.</p>\n        <p>When the thumbnail grows, the title and subtitle rise out of a mask one after the other, and the neighbouring thumbnails swing away so nothing competes for attention.</p>\n        <div class=\"ef-tfd__plate ef-tfd__plate--alt\"><svg class=\"ef-tfd__pz\"><use href=\"#ef-tfd-pz1\"/></svg></div>\n        <p>Press Escape or use the Close button to shrink it back into the row.</p>\n      </div>\n    </div>\n    <button class=\"ef-tfd__close\" type=\"button\" tabindex=\"-1\" aria-label=\"Close the story\">Close</button>\n  </div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n/* Adapted from https://github.com/codrops/ThumbFullTransition (MIT) — Copyright (c) 2009 - 2020 [Codrops](https://tympanus.net/codrops) */\n.ef-tfd { --ef-acc: #e6ff55; position: relative; width: 100%; height: 100%; min-height: 26rem; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; color: #fbf8f1; }\n.ef-tfd__defs { position: absolute; width: 0; height: 0; overflow: hidden; }\n.ef-tfd__stage { position: absolute; inset: 0; overflow: hidden; background: radial-gradient(ellipse at 50% 40%, #0a6b46 -40%, #0c1e18 70%); }\n.ef-tfd__thumbs { position: absolute; inset: 0; perspective: 900px; }\n.ef-tfd__side { position: absolute; left: 0; top: 0; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #2f7d5b, #005236 60%, #0c1e18); color: var(--ef-acc); will-change: transform, opacity; }\n.ef-tfd__side--r { background: linear-gradient(200deg, #c6f26b -30%, #2f7d5b 40%, #005236); color: #0c1e18; }\n.ef-tfd__side .ef-tfd__pz { position: absolute; left: 50%; top: 50%; width: 70%; height: 70%; transform: translate(-50%, -50%) rotate(-8deg); }\n.ef-tfd__cap { position: absolute; left: 0; top: 0; display: flex; gap: 0.6rem; align-items: baseline; font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; white-space: nowrap; will-change: transform, opacity; }\n.ef-tfd__capn { color: var(--ef-acc); font-weight: 700; }\n.ef-tfd__capt { opacity: 0.8; }\n.ef-tfd__hero { position: absolute; inset: 0; will-change: clip-path; clip-path: inset(30% 30% 30% 30% round 14px); }\n.ef-tfd__art { position: absolute; inset: 0; background: radial-gradient(circle at 78% 22%, rgba(230, 255, 85, 0.35), transparent 38%), linear-gradient(155deg, #0a6b46 0%, #005236 45%, #0c1e18 100%); transform-origin: 50% 50%; will-change: transform; }\n.ef-tfd__pz { display: block; color: var(--ef-acc); }\n.ef-tfd__pz--a, .ef-tfd__pz--b, .ef-tfd__pz--c { position: absolute; }\n.ef-tfd__pz--a { left: 8%; top: 22%; width: 52%; height: 36%; transform: rotate(-9deg); }\n.ef-tfd__pz--b { right: 8%; bottom: 10%; width: 30%; height: 30%; color: #c6f26b; transform: rotate(14deg); }\n.ef-tfd__pz--c { right: 22%; top: 6%; width: 14%; height: 26%; color: #fbf8f1; opacity: 0.85; transform: rotate(6deg); }\n.ef-tfd__hit { position: absolute; left: 0; top: 0; margin: 0; padding: 0; border: 0; border-radius: 14px; background: transparent; cursor: pointer; outline: none; }\n.ef-tfd__hit:focus-visible { box-shadow: 0 0 0 3px var(--ef-acc); }\n.ef-tfd__detail { position: absolute; inset: 0; overflow: hidden; visibility: hidden; opacity: 0; pointer-events: none; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scrollbar-width: thin; scrollbar-color: #2f7d5b transparent; }\n.ef-tfd.is-active .ef-tfd__detail { visibility: visible; opacity: 1; }\n.ef-tfd.is-open .ef-tfd__detail { overflow-y: auto; pointer-events: auto; }\n.ef-tfd__detail:focus-visible { outline: 2px solid var(--ef-acc); outline-offset: -4px; }\n.ef-tfd__intro { box-sizing: border-box; min-height: 100%; padding: 1.6rem 1.6rem 1.8rem; display: flex; flex-direction: column; justify-content: flex-end; background: linear-gradient(0deg, rgba(12, 30, 24, 0.82), rgba(12, 30, 24, 0) 62%); }\n.ef-tfd__kick { margin: 0 0 0.5rem; font-size: 0.7rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ef-acc); }\n.ef-tfd__title { margin: 0; font-size: clamp(1.7rem, 7vw, 2.8rem); line-height: 1.02; letter-spacing: -0.02em; font-weight: 800; max-width: 16ch; overflow: hidden; padding-bottom: 0.08em; }\n.ef-tfd__sub { margin: 0.5rem 0 0; font-size: 0.95rem; opacity: 0.9; overflow: hidden; }\n.ef-tfd__blk { display: block; transform-origin: 0 100%; will-change: transform; }\n.ef-tfd__body { position: relative; padding: 1.6rem; background: #fbf8f1; color: #0c1e18; font-size: 0.95rem; line-height: 1.6; }\n.ef-tfd__body p { margin: 0 0 1.1rem; max-width: 46ch; }\n.ef-tfd__plate { height: 9rem; margin: 0 0 1.2rem; border-radius: 12px; position: relative; overflow: hidden; background: linear-gradient(150deg, #0a6b46, #005236 55%, #0c1e18); }\n.ef-tfd__plate .ef-tfd__pz { position: absolute; left: 50%; top: 50%; width: 46%; height: 70%; transform: translate(-50%, -50%) rotate(-6deg); }\n.ef-tfd__plate--alt { background: linear-gradient(200deg, #c6f26b -20%, #2f7d5b 50%, #005236); }\n.ef-tfd__plate--alt .ef-tfd__pz { color: #0c1e18; width: 36%; }\n.ef-tfd__close { position: absolute; top: 0.9rem; right: 0.9rem; z-index: 3; padding: 0.45rem 0.9rem; border-radius: 999px; border: 1px solid rgba(251, 248, 241, 0.5); background: rgba(12, 30, 24, 0.55); color: #fbf8f1; font: inherit; font-size: 0.78rem; letter-spacing: 0.06em; cursor: pointer; opacity: 0; visibility: hidden; transition: background 200ms, color 200ms; }\n.ef-tfd.is-open .ef-tfd__close { opacity: 1; visibility: visible; }\n.ef-tfd__close:hover { background: var(--ef-acc); color: #0c1e18; }\n.ef-tfd__close:focus-visible { outline: 2px solid var(--ef-acc); outline-offset: 2px; }\n@media (prefers-reduced-motion: reduce) { .ef-tfd__close { transition: none; } }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Adapted from https://github.com/codrops/ThumbFullTransition (MIT) — Copyright (c) 2009 - 2020 [Codrops](https://tympanus.net/codrops)\n// Thumb expand detail: a centred thumbnail between two neighbours. Hover swells it and swings the neighbours away; click (or Enter)\n// grows it to fill the stage with an expo in-out, the title and subtitle rise out of masks, then a detail panel scrolls on its own.\n// Vanilla port: one rAF loop drives an open progress (0 to 1) and a hover spring; the thumbnail is a clip-path inset plus a scaled art layer.\n// mount(root, { accent, thumbWidth (% of stage), hoverScale (1-1.4), duration (ms), title })\nfunction mount(root, o) {\n  var mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n  var stage = root.querySelector(\".ef-tfd__stage\");\n  var hero = root.querySelector(\".ef-tfd__hero\");\n  var art = root.querySelector(\".ef-tfd__art\");\n  var hit = root.querySelector(\".ef-tfd__hit\");\n  var detail = root.querySelector(\".ef-tfd__detail\");\n  var closeBtn = root.querySelector(\".ef-tfd__close\");\n  var sideL = root.querySelector(\".ef-tfd__side--l\");\n  var sideR = root.querySelector(\".ef-tfd__side--r\");\n  var cap = root.querySelector(\".ef-tfd__cap\");\n  var titleBlk = root.querySelector(\".ef-tfd__title .ef-tfd__blk\");\n  var subBlk = root.querySelector(\".ef-tfd__sub .ef-tfd__blk\");\n  var opts = {}, W = 0, H = 0, tw = 0, th = 0, top0 = 0, p = 0, h = 0, hT = 0;\n  var anim = null, raf = 0, last = 0, isOpen = false, ro = null, offs = [];\n\n  function clamp(v) { return v < 0 ? 0 : v > 1 ? 1 : v; }\n  function lerp(a, b, t) { return a + (b - a) * t; }\n  function inOutExpo(u) { return u <= 0 ? 0 : u >= 1 ? 1 : u < 0.5 ? Math.pow(2, 20 * u - 10) / 2 : (2 - Math.pow(2, -20 * u + 10)) / 2; }\n  function outExpo(u) { return u >= 1 ? 1 : 1 - Math.pow(2, -10 * u); }\n\n  function measure() {\n    W = stage.clientWidth; H = stage.clientHeight;\n    tw = Math.round(W * opts.thumbWidth / 100);\n    th = Math.round(tw * 1.25);\n    if (th > H * 0.62) { th = Math.round(H * 0.62); tw = Math.round(th / 1.25); }\n    top0 = Math.round(H * 0.46 - th / 2);\n    var base = \"left:\" + Math.round((W - tw) / 2) + \"px;top:\" + top0 + \"px;width:\" + tw + \"px;height:\" + th + \"px\";\n    hit.style.cssText = base;\n    sideL.style.cssText = base; sideR.style.cssText = base;\n    cap.style.left = Math.round((W - tw) / 2) + \"px\";\n    render();\n  }\n\n  function render() {\n    var reduce = mq.matches;\n    var il = ((W - tw) / 2) * (1 - p), it = top0 * (1 - p), ib = (H - top0 - th) * (1 - p);\n    var rad = 14 * (1 - p);\n    hero.style.clipPath = \"inset(\" + it.toFixed(1) + \"px \" + il.toFixed(1) + \"px \" + ib.toFixed(1) + \"px \" + il.toFixed(1) + \"px round \" + rad.toFixed(1) + \"px)\";\n    var s0 = Math.max(tw / W, th / H);\n    var hh = reduce ? 0 : h;\n    var s = lerp(s0 * (1 + (opts.hoverScale - 1) * hh), 1, p);\n    var cy0 = top0 + th / 2;\n    art.style.transform = \"translate3d(0,\" + ((cy0 - H / 2) * (1 - p)).toFixed(1) + \"px,0) scale(\" + s.toFixed(4) + \")\";\n    // neighbours: drift outward and tilt on hover, swing far away while opening\n    var gap = Math.max(10, tw * 0.1);\n    var fade = 1 - clamp(p * 1.6);\n    [[sideL, -1], [sideR, 1]].forEach(function (a) {\n      var dir = a[1];\n      var x = dir * (tw + gap + tw * 0.25 * hh + tw * 1.5 * p);\n      var ry = -dir * (15 * hh + 30 * p);\n      var z = 40 * hh + 160 * p;\n      a[0].style.transform = \"translate3d(\" + x.toFixed(1) + \"px,0,\" + z.toFixed(1) + \"px) rotateY(\" + ry.toFixed(1) + \"deg)\";\n      a[0].style.opacity = String(((1 - 0.2 * hh) * fade).toFixed(3));\n    });\n    cap.style.transform = \"translate3d(0,\" + (top0 + th + 14).toFixed(0) + \"px,0)\";\n    cap.style.opacity = String(clamp(1 - p * 1.8).toFixed(3));\n    // title + subtitle rise out of their masks once the image is mostly grown\n    var tt = outExpo(clamp((p - 0.35) / 0.65)), st = outExpo(clamp((p - 0.5) / 0.5));\n    titleBlk.style.transform = \"translate3d(0,\" + ((1 - tt) * 110).toFixed(1) + \"%,0) rotate(\" + ((1 - tt) * 3).toFixed(2) + \"deg)\";\n    subBlk.style.transform = \"translate3d(0,\" + ((1 - st) * 110).toFixed(1) + \"%,0) rotate(\" + ((1 - st) * 3).toFixed(2) + \"deg)\";\n    hit.style.visibility = (p === 0 && !anim) ? \"visible\" : \"hidden\";\n    root.classList.toggle(\"is-active\", p > 0);\n  }\n\n  function tick(now) {\n    raf = 0;\n    var dt = last ? Math.min(64, now - last) : 16;\n    last = now;\n    var busy = false;\n    if (anim) {\n      var u = clamp((now - anim.t0) / anim.dur);\n      p = lerp(anim.from, anim.to, inOutExpo(u));\n      if (u >= 1) { p = anim.to; var d = anim.done; anim = null; render(); if (d) d(); } else busy = true;\n    }\n    var dh = hT - h;\n    if (Math.abs(dh) > 0.002) { h += dh * (1 - Math.exp(-dt / 150)); busy = true; } else h = hT;\n    render();\n    if (busy) raf = requestAnimationFrame(tick); else last = 0;\n  }\n  function kick() { if (!raf) raf = requestAnimationFrame(tick); }\n\n  function go(to, done) {\n    var dur = mq.matches ? 0 : opts.duration;\n    if (dur <= 0) { anim = null; p = to; render(); if (done) done(); return; }\n    anim = { from: p, to: to, t0: performance.now(), dur: dur * (Math.abs(to - p)), done: done };\n    if (anim.dur < 1) { anim = null; p = to; render(); if (done) done(); return; }\n    kick();\n  }\n\n  function openIt() {\n    if (isOpen || anim) return;\n    isOpen = true; hT = 0;\n    go(1, function () {\n      root.classList.add(\"is-open\");\n      detail.removeAttribute(\"inert\");\n      detail.tabIndex = 0;\n      closeBtn.tabIndex = 0;\n      closeBtn.focus();\n    });\n  }\n  function closeIt() {\n    if (!isOpen || anim) return;\n    root.classList.remove(\"is-open\");\n    detail.setAttribute(\"inert\", \"\");\n    detail.removeAttribute(\"tabindex\");\n    closeBtn.tabIndex = -1;\n    detail.scrollTop = 0;\n    isOpen = false;\n    go(0, function () { hit.focus(); });\n  }\n\n  function onEnter() { if (!isOpen && !anim) { hT = 1; kick(); } }\n  function onLeave() { hT = 0; kick(); }\n  function onKey(e) { if (e.key === \"Escape\" && isOpen) { e.preventDefault(); closeIt(); } }\n  function on(el, ev, fn) { el.addEventListener(ev, fn); offs.push(function () { el.removeEventListener(ev, fn); }); }\n  on(hit, \"pointerenter\", onEnter);\n  on(hit, \"pointerleave\", onLeave);\n  on(hit, \"focus\", onEnter);\n  on(hit, \"blur\", onLeave);\n  on(hit, \"click\", openIt);\n  on(closeBtn, \"click\", closeIt);\n  on(root, \"keydown\", onKey);\n  if (typeof ResizeObserver !== \"undefined\") { ro = new ResizeObserver(function () { measure(); }); ro.observe(stage); }\n\n  function update(next) {\n    opts = Object.assign({ accent: \"#e6ff55\", thumbWidth: 34, hoverScale: 1.2, duration: 1100, title: \"The quiet architecture of small things\" }, opts, next || {});\n    opts.thumbWidth = Math.max(20, Math.min(50, +opts.thumbWidth));\n    opts.hoverScale = Math.max(1, Math.min(1.5, +opts.hoverScale));\n    opts.duration = Math.max(0, +opts.duration);\n    stage.style.setProperty(\"--ef-acc\", opts.accent);\n    if (titleBlk.textContent !== opts.title) titleBlk.textContent = opts.title;\n    measure();\n  }\n  update(o);\n  function destroy() {\n    offs.forEach(function (f) { f(); }); offs = [];\n    if (ro) { ro.disconnect(); ro = null; }\n    if (raf) cancelAnimationFrame(raf);\n    raf = 0; anim = null;\n  }\n  return { update: update, destroy: destroy };\n}"
  }
}