{
  "id": "card-hover-tilt",
  "kind": "element",
  "title": "Card hover tilt with glare",
  "summary": "A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.",
  "url": "https://enrichr.dev/elements/card-hover-tilt.html",
  "section": "gallery",
  "techniques": [
    "pointer-interaction",
    "3d-css"
  ],
  "stack": [
    "Vanilla JS",
    "CSS"
  ],
  "frameworks": [
    "React",
    "Next.js",
    "Vanilla"
  ],
  "mood": [
    "modern",
    "polished",
    "playful"
  ],
  "intents": [
    "3d tilt card hover effect",
    "card glare follows mouse",
    "perspective hover cards",
    "pointer tracking card highlight",
    "product card lift shadow"
  ],
  "status": "tested",
  "params": [
    {
      "key": "accent",
      "label": "Accent colour",
      "type": "color",
      "value": "#e6ff55"
    },
    {
      "key": "maxTilt",
      "label": "Max tilt (deg)",
      "type": "range",
      "min": 2,
      "max": 25,
      "step": 1,
      "value": 12
    },
    {
      "key": "glare",
      "label": "Glare strength",
      "type": "range",
      "min": 0,
      "max": 1,
      "step": 0.05,
      "value": 0.5
    },
    {
      "key": "lift",
      "label": "Lift (px)",
      "type": "range",
      "min": 0,
      "max": 60,
      "step": 2,
      "value": 24
    },
    {
      "key": "count",
      "label": "Cards",
      "type": "range",
      "min": 2,
      "max": 8,
      "step": 1,
      "value": 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 \"Card hover tilt with glare\" element to this project.\n\nThis is the \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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/card-hover-tilt.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 \"Card hover tilt with glare\" 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 \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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 \"Card hover tilt with glare\" element to this codebase.\n\nThis is the \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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-card-hover-tilt.mdc so the rule stays with the project:\n---\ndescription: How to use the Enrichr Card hover tilt with glare 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 \"Card hover tilt with glare\" element. Tailwind is available but this component needs no utility classes.\n\nThis is the \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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- card-hover-tilt.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 \"./card-hover-tilt\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function CardHoverTilt(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 \"Card hover tilt with glare\" element to this React + Vite + TypeScript + Tailwind project. Do not install any packages.\n\nThis is the \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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- card-hover-tilt.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/CardHoverTilt.tsx):\n```tsx\n\"use client\";\nimport { useEffect, useRef } from \"react\";\nimport { markup, mount } from \"./card-hover-tilt\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function CardHoverTilt(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 \"Card hover tilt with glare\" element.\n\nThis is the \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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), card-hover-tilt.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 \"Card hover tilt with glare\" element. No packages, no server code.\n\nThis is the \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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 card-hover-tilt.js and then main.js), style.css (the CSS below), card-hover-tilt.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 \"Card hover tilt with glare\" 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 \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.json\n\nWhat it does: On pointer move, the script converts the position inside a card to 0 to 1 and writes it to CSS variables on that card: --rx and --ry for rotation, --mx and --my for the glare centre, --gl for glare strength and --lift for depth. The stylesheet does the rest: the card uses perspective rotateX and rotateY with translateZ, the glare is a radial gradient centred on the pointer, the shadow offset follows the tilt, and the text sits on a deeper translateZ layer so it moves a little more than the card face. On leave, the variables reset and a longer transition eases the card back.\nAccessibility: Cards are links, so they keep keyboard focus and a visible focus ring, and focus lifts and lights the card without needing a pointer. Tilt is mouse and pen only. Touch devices and reduced motion get the static card with glare and shadow but no rotation. Check the contrast of text over your own artwork; a darkening scrim sits under the text here.\n\nTunable settings:\n- Accent colour: color, default #e6ff55\n- Max tilt (deg): range 2 to 25, step 1, default 12\n- Glare strength: range 0 to 1, step 0.05, default 0.5\n- Lift (px): range 0 to 60, step 2, default 24\n- Cards: range 2 to 8, step 1, default 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/card-hover-tilt.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 \"Card hover tilt with glare\" 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 \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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 CardHoverTilt.\n2. Paste the JavaScript below into a separate code file named card-hover-tilt.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 \"./card-hover-tilt\"; // markup is the HTML string; mount is the JavaScript's mount function\n\nexport default function CardHoverTilt(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(CardHoverTilt, {\n  accent: { type: ControlType.Color, title: \"Accent colour\", defaultValue: \"#e6ff55\" },\n  maxTilt: { type: ControlType.Number, title: \"Max tilt\", min: 2, max: 25, step: 1, defaultValue: 12 },\n  glare: { type: ControlType.Number, title: \"Glare strength\", min: 0, max: 1, step: 0.05, defaultValue: 0.5 },\n  lift: { type: ControlType.Number, title: \"Lift\", min: 0, max: 60, step: 2, defaultValue: 24 },\n  count: { type: ControlType.Number, title: \"Cards\", min: 2, max: 8, step: 1, defaultValue: 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 \"Card hover tilt with glare\" 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 \"Card hover tilt with glare\" element from the Enrichr Library: A grid of cards that tilt in 3D toward the pointer with a moving glare highlight and a lifted shadow, all driven by CSS variables.\nPage: https://enrichr.dev/elements/card-hover-tilt.html\nMachine-readable spec: https://enrichr.dev/elements/card-hover-tilt.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-card-hover-tilt\"></div>, and a <script> block with the JavaScript followed by:\n   mount(document.getElementById(\"enrichr-card-hover-tilt\"), { ...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": "Cards are links, so they keep keyboard focus and a visible focus ring, and focus lifts and lights the card without needing a pointer. Tilt is mouse and pen only. Touch devices and reduced motion get the static card with glare and shadow but no rotation. Check the contrast of text over your own artwork; a darkening scrim sits under the text here.",
  "performance": "Per pointer move there are a few custom property writes on a single card. Transforms and opacity are the only properties that animate. Avoid putting heavy filters or large blurred shadows on many cards at once.",
  "dependencies": [],
  "source": {
    "markup": "<div class=\"ef-cht\">\n  <div class=\"ef-cht__wrap\"><div class=\"ef-cht__grid\"></div></div>\n</div>",
    "css": "/* Enrichr Library · https://enrichr.dev */\n.ef-cht { width: 100%; }\n.ef-cht__wrap { box-sizing: border-box; width: 100%; min-height: 18rem; padding: 1.3rem; border-radius: 1rem; display: flex; align-items: center; font-family: system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif; }\n.ef-cht__grid { width: 100%; display: grid; grid-template-columns: repeat(auto-fit, minmax(7rem, 1fr)); gap: 1rem; perspective: 1000px; }\n.ef-cht__card { --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; --gl: 0; --lift: 0px; position: relative; display: block; aspect-ratio: 4 / 5; border-radius: 0.9rem; color: #fbf8f1; text-decoration: none; transform-style: preserve-3d; transform: rotateX(var(--rx)) rotateY(var(--ry)) translateZ(var(--lift)); transition: transform 500ms cubic-bezier(.2,.8,.2,1), box-shadow 500ms cubic-bezier(.2,.8,.2,1); box-shadow: 0 8px 14px -8px rgba(0, 0, 0, 0.5); will-change: transform; outline: none; }\n.ef-cht__card.is-live { transition: transform 90ms linear, box-shadow 300ms; box-shadow: calc(var(--ry) * -1.2) calc(var(--rx) * 1.2 + 22px) 34px -14px rgba(0, 0, 0, 0.65); }\n.ef-cht__card:focus-visible { box-shadow: 0 0 0 2px var(--ef-acc, #e6ff55), 0 22px 30px -14px rgba(0, 0, 0, 0.65); --lift: 18px; --gl: 0.5; }\n.ef-cht__art { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; }\n.ef-cht__glare { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: var(--gl); background: radial-gradient(circle at var(--mx) var(--my), var(--ef-glare, rgba(255, 255, 255, 0.55)), transparent 58%); mix-blend-mode: soft-light; transition: opacity 300ms; }\n.ef-cht__txt { position: absolute; left: 0.9rem; right: 0.9rem; bottom: 0.85rem; transform: translateZ(34px); pointer-events: none; }\n.ef-cht__t { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; line-height: 1.15; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }\n.ef-cht__s { display: block; margin-top: 0.2rem; font-size: 0.72rem; opacity: 0.8; letter-spacing: 0.04em; }\n.ef-cht__n { position: absolute; top: 0.8rem; left: 0.9rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.14em; transform: translateZ(26px); opacity: 0.85; }\n@media (prefers-reduced-motion: reduce) { .ef-cht__card, .ef-cht__card.is-live { transition: box-shadow 200ms; transform: none; } }\n.ef-cht__art::after { content: \"\"; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, 0.12), transparent 30%, transparent 48%, rgba(0, 0, 0, 0.6)); }",
    "js": "// Enrichr Library · https://enrichr.dev\n// Card hover tilt: a grid of cards that tilt in 3D toward the pointer, with a glare highlight that follows it and a lifted shadow.\n// Everything is driven by CSS variables (--rx --ry --mx --my --gl --lift) set on each card. Mouse and pen only; touch and reduced motion\n// get the glare and shadow without any movement. Keyboard focus lifts a card and lights it.\n// mount(root, { background, accent, maxTilt (deg), glare (0-1), lift (px), count (2-8) })\nfunction mount(root, o) {\n  var reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n  var wrap = root.querySelector(\".ef-cht__wrap\");\n  var grid = root.querySelector(\".ef-cht__grid\");\n  var opts = {}, cards = [], offs = [];\n  var DATA = [[\"Tidal\", \"Field notes\"], [\"Ember\", \"Studio series\"], [\"Moss\", \"Quiet objects\"], [\"Dusk\", \"Night shift\"], [\"Arch\", \"Form study\"], [\"Grain\", \"Print run\"], [\"Haze\", \"Soft light\"], [\"Loop\", \"Motion kit\"]];\n\n  function art(i, a) {\n    var c = \"#fbf8f1\", d = \"#0c1e18\";\n    var p = i % 6;\n    if (p === 0) return \"radial-gradient(circle at 70% 30%, \" + a + \" 0 18%, transparent 19%), linear-gradient(160deg, #005236, \" + d + \")\";\n    if (p === 1) return \"conic-gradient(from 210deg at 35% 65%, #005236, \" + a + \", \" + c + \", #005236)\";\n    if (p === 2) return \"repeating-linear-gradient(120deg, #005236 0 12px, \" + d + \" 12px 24px)\";\n    if (p === 3) return \"radial-gradient(circle at 30% 35%, \" + a + \" 0 20%, transparent 21%), radial-gradient(circle at 62% 62%, \" + c + \" 0 20%, transparent 21%), linear-gradient(200deg, #0a6b46, \" + d + \")\";\n    if (p === 4) return \"radial-gradient(ellipse 36% 26% at 50% 44%, \" + c + \" 0 99%, transparent 100%), linear-gradient(\" + c + \", \" + c + \") 50% 70% / 72% 40% no-repeat, linear-gradient(190deg, #005236, \" + a + \")\";\n    return \"radial-gradient(circle, \" + a + \" 0 2.5px, transparent 3px) 0 0 / 16px 16px, linear-gradient(145deg, #005236, \" + d + \")\";\n  }\n  function clear() { offs.forEach(function (f) { f(); }); offs = []; }\n  function build() {\n    clear();\n    grid.textContent = \"\";\n    cards = [];\n    for (var i = 0; i < opts.count; i++) (function (i) {\n      var a = document.createElement(\"a\");\n      a.className = \"ef-cht__card\";\n      a.href = \"#\";\n      var bg = document.createElement(\"span\"); bg.className = \"ef-cht__art\"; bg.style.background = art(i, opts.accent);\n      var gl = document.createElement(\"span\"); gl.className = \"ef-cht__glare\";\n      var n = document.createElement(\"span\"); n.className = \"ef-cht__n\"; n.textContent = String(i + 1).padStart(2, \"0\");\n      var tx = document.createElement(\"span\"); tx.className = \"ef-cht__txt\";\n      var t = document.createElement(\"span\"); t.className = \"ef-cht__t\"; t.textContent = DATA[i % DATA.length][0];\n      var s = document.createElement(\"span\"); s.className = \"ef-cht__s\"; s.textContent = DATA[i % DATA.length][1];\n      tx.appendChild(t); tx.appendChild(s);\n      a.appendChild(bg); a.appendChild(gl); a.appendChild(n); a.appendChild(tx);\n      function mv(e) {\n        if (e.pointerType === \"touch\") return;\n        var r = a.getBoundingClientRect();\n        var px = (e.clientX - r.left) / r.width, py = (e.clientY - r.top) / r.height;\n        a.classList.add(\"is-live\");\n        a.style.setProperty(\"--mx\", (px * 100).toFixed(1) + \"%\");\n        a.style.setProperty(\"--my\", (py * 100).toFixed(1) + \"%\");\n        a.style.setProperty(\"--gl\", String(opts.glare));\n        if (reduce) return;\n        a.style.setProperty(\"--ry\", ((px - 0.5) * 2 * opts.maxTilt).toFixed(2) + \"deg\");\n        a.style.setProperty(\"--rx\", ((0.5 - py) * 2 * opts.maxTilt).toFixed(2) + \"deg\");\n        a.style.setProperty(\"--lift\", opts.lift + \"px\");\n      }\n      function lv() {\n        a.classList.remove(\"is-live\");\n        a.style.setProperty(\"--rx\", \"0deg\"); a.style.setProperty(\"--ry\", \"0deg\");\n        a.style.setProperty(\"--gl\", \"0\"); a.style.setProperty(\"--lift\", \"0px\");\n      }\n      function ck(e) { e.preventDefault(); }\n      a.addEventListener(\"pointermove\", mv);\n      a.addEventListener(\"pointerleave\", lv);\n      a.addEventListener(\"click\", ck);\n      offs.push(function () { a.removeEventListener(\"pointermove\", mv); a.removeEventListener(\"pointerleave\", lv); a.removeEventListener(\"click\", ck); });\n      grid.appendChild(a);\n      cards.push(a);\n    })(i);\n  }\n  function update(next) {\n    var prev = opts;\n    opts = Object.assign({ background: \"#0c1e18\", accent: \"#e6ff55\", maxTilt: 12, glare: 0.5, lift: 24, count: 6 }, opts, next || {});\n    opts.count = Math.max(2, Math.min(8, Math.round(opts.count)));\n    wrap.style.background = opts.background;\n    wrap.style.setProperty(\"--ef-acc\", opts.accent);\n    wrap.style.setProperty(\"--ef-glare\", \"rgba(255,255,255,0.7)\");\n    if (prev.count !== opts.count || prev.accent !== opts.accent) build();\n  }\n  update(o);\n  return { update: update, destroy: clear };\n}"
  }
}