{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"engraved-steel-membership-card-that-turns-on-its-edge-and-catches-a-fixed-lamp-in-its-lettering","type":"registry:block","title":"Engraved Steel Membership Card That Turns on Its Edge and Catches a Fixed Lamp in Its Lettering","description":"Membership card in brushed steel: engraved lettering flares under a fixed lamp as you spin it on its edge. Copy the React code or the HTML version free.","dependencies":[],"files":[{"path":"components/we-inc/engraved-steel-membership-card-that-turns-on-its-edge-and-catches-a-fixed-lamp-in-its-lettering.tsx","type":"registry:component","content":"import { useEffect, useRef, useState } from \"react\";\nimport type { KeyboardEvent as ReactKeyboardEvent } from \"react\";\n\n// Everything engraved on the card. Change the words here and both faces redraw.\nconst card = {\n  house: \"NORTHLIGHT\",\n  kind: \"MEMBERS' STUDIO\",\n  member: \"Ines Calloway\",\n  tier: \"FOUNDING MEMBER\",\n  number: \"0417\",\n  since: \"SINCE 2019\",\n  monogram: \"N\",\n  backLine: \"ADMITS THE BEARER AND ONE GUEST\",\n  address: \"14 TALLOW LANE  /  RING THE BRASS BELL\",\n};\nconst W = 460; // card width in CSS pixels\nconst H = 290; // card height\nconst THICK = 9; // card thickness, a little more than a real one so the edge reads\nconst RADIUS = 18;\nconst SWAY = 0.5; // how far it rocks either side while idle, in radians\nconst TURN_EVERY = 7.5; // seconds between turning itself over\nconst SERIF = '\"Didot\",\"Bodoni 72\",\"Bodoni MT\",\"Playfair Display\",Georgia,\"Times New Roman\",serif';\nconst SANS = '\"Helvetica Neue\",Helvetica,Arial,sans-serif';\n\ntype Face = {\n  ctx: CanvasRenderingContext2D;\n  base: HTMLCanvasElement;\n  mask: HTMLCanvasElement;\n  recess: HTMLCanvasElement;\n  hi: HTMLCanvasElement[]; // bright walls: light from left, right, above, below\n  lo: HTMLCanvasElement[]; // the same walls in shadow\n  dark: boolean;\n};\n\nconst blank = (w: number, h: number) => { const c = document.createElement(\"canvas\"); c.width = w; c.height = h; return c; };\n\n// Tracked capitals, drawn letter by letter so it works where canvas letter spacing does not.\nconst tracked = (c: CanvasRenderingContext2D, text: string, x: number, y: number, gap: number, align: \"left\" | \"right\" | \"center\" = \"left\") => {\n  let w = 0;\n  for (const ch of text) w += c.measureText(ch).width + gap;\n  w -= gap;\n  let cx = align === \"left\" ? x : align === \"right\" ? x - w : x - w / 2;\n  c.textAlign = \"left\";\n  for (const ch of text) { c.fillText(ch, cx, y); cx += c.measureText(ch).width + gap; }\n};\n\n// The artwork of each face, drawn in white. Its outline becomes the engraving.\nconst drawFront = (c: CanvasRenderingContext2D) => {\n  c.fillStyle = \"#fff\"; c.strokeStyle = \"#fff\"; c.textBaseline = \"alphabetic\";\n  c.font = `600 13px ${SANS}`; tracked(c, card.house, 30, 44, 4.6);\n  c.font = `500 7.5px ${SANS}`; tracked(c, card.kind, 30, 60, 2.6);\n  c.font = `400 37px ${SERIF}`; c.textAlign = \"left\"; c.fillText(card.member, 28, 176);\n  c.font = `600 8px ${SANS}`; tracked(c, card.tier, 30, 198, 3);\n  c.font = `500 12px ${SANS}`; tracked(c, `No. ${card.number}`, 30, H - 30, 2.4);\n  c.font = `500 8px ${SANS}`; tracked(c, card.since, W - 30, H - 30.5, 2.8, \"right\");\n  // An engine-turned rosette: thirty ellipses round one centre.\n  const rx = W - 98, ry = H / 2 - 6;\n  c.lineWidth = 0.85;\n  for (let i = 0; i < 30; i++) {\n    c.beginPath(); c.ellipse(rx, ry, 66, 25, (i * Math.PI) / 30, 0, Math.PI * 2); c.stroke();\n  }\n  c.lineWidth = 1.4; c.beginPath(); c.arc(rx, ry, 72, 0, Math.PI * 2); c.stroke();\n  c.globalCompositeOperation = \"destination-out\"; c.beginPath(); c.arc(rx, ry, 21, 0, Math.PI * 2); c.fill();\n  c.globalCompositeOperation = \"source-over\";\n  c.lineWidth = 1; c.beginPath(); c.arc(rx, ry, 21, 0, Math.PI * 2); c.stroke();\n  c.font = `400 26px ${SERIF}`; c.textAlign = \"center\"; c.fillText(card.monogram, rx, ry + 9.5);\n};\nconst drawBack = (c: CanvasRenderingContext2D) => {\n  c.fillStyle = \"#fff\"; c.strokeStyle = \"#fff\"; c.textBaseline = \"alphabetic\";\n  c.lineWidth = 1.1; c.beginPath(); c.roundRect(15, 15, W - 30, H - 30, 9); c.stroke();\n  c.lineWidth = 0.7; c.beginPath(); c.roundRect(20, 20, W - 40, H - 40, 6); c.stroke();\n  c.font = `600 11px ${SANS}`; tracked(c, card.house, W / 2, 58, 5, \"center\");\n  c.font = `400 86px ${SERIF}`; tracked(c, card.number, W / 2, 176, 5, \"center\");\n  c.fillRect(W / 2 - 96, 197, 192, 1);\n  c.font = `600 8px ${SANS}`; tracked(c, card.backLine, W / 2, 218, 3, \"center\");\n  c.font = `500 7.5px ${SANS}`; tracked(c, card.address, W / 2, H - 42, 2.6, \"center\");\n};\n\nexport default function EngravedSteelMembershipCard() {\n  const root = useRef<HTMLDivElement>(null);\n  const spin = useRef<HTMLDivElement>(null);\n  const shadow = useRef<HTMLDivElement>(null);\n  const front = useRef<HTMLCanvasElement>(null);\n  const back = useRef<HTMLCanvasElement>(null);\n  const [showsBack, setShowsBack] = useState(false);\n  const [scale, setScale] = useState(1);\n  const api = useRef<{ flip: () => void; nudge: (d: number) => void } | null>(null);\n\n  useEffect(() => {\n    const el = root.current, sp = spin.current, fc = front.current, bc = back.current, sh = shadow.current;\n    if (!el || !sp || !fc || !bc || !sh) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    const d = Math.min(2.4, Math.min(2, window.devicePixelRatio || 1) * Math.max(1, Math.min(1.3, (el.clientWidth - 44) / W)));\n    const PW = Math.round(W * d), PH = Math.round(H * d);\n\n    const build = (cv: HTMLCanvasElement, art: (c: CanvasRenderingContext2D) => void, dark: boolean): Face | null => {\n      cv.width = PW; cv.height = PH;\n      const ctx = cv.getContext(\"2d\");\n      if (!ctx) return null;\n      // Brushed plate: thousands of short horizontal scratches over one flat tone.\n      const base = blank(PW, PH), b = base.getContext(\"2d\");\n      if (!b) return null;\n      b.fillStyle = dark ? \"#17382f\" : \"#bdb6a8\"; b.fillRect(0, 0, PW, PH);\n      let seed = dark ? 41 : 17;\n      const rand = () => { seed = (seed * 16807) % 2147483647; return seed / 2147483647; };\n      for (let y = 0; y < PH; y++) {\n        const row = rand();\n        b.fillStyle = row > 0.5 ? `rgba(255,255,255,${(row - 0.5) * (dark ? 0.08 : 0.14)})` : `rgba(0,0,0,${(0.5 - row) * (dark ? 0.26 : 0.1)})`;\n        b.fillRect(0, y, PW, 1);\n        for (let k = 0; k < 5; k++) {\n          const x = rand() * PW, len = (30 + rand() * 260) * d, v = rand();\n          b.fillStyle = v > 0.5 ? `rgba(255,255,255,${(v - 0.5) * (dark ? 0.13 : 0.26)})` : `rgba(0,0,0,${(0.5 - v) * (dark ? 0.36 : 0.13)})`;\n          b.fillRect(x, y, len, 1);\n        }\n      }\n      // The artwork, then a slightly softened copy whose slopes are the walls of the cut.\n      const mask = blank(PW, PH), m = mask.getContext(\"2d\");\n      const soft = blank(PW, PH), s = soft.getContext(\"2d\");\n      if (!m || !s) return null;\n      m.scale(d, d); art(m);\n      if (\"filter\" in s) s.filter = `blur(${0.42 * d}px)`;\n      s.drawImage(mask, 0, 0);\n      const a = s.getImageData(0, 0, PW, PH).data;\n      const out = [0, 1, 2, 3].map(() => new ImageData(PW, PH));\n      for (let y = 1; y < PH - 1; y++) {\n        for (let x = 1; x < PW - 1; x++) {\n          const i = (y * PW + x) * 4 + 3;\n          const gx = a[i + 4] - a[i - 4], gy = a[i + PW * 4] - a[i - PW * 4];\n          if (gx === 0 && gy === 0) continue;\n          // 0 lit from the left, 1 lit from the right, 2 lit from above, 3 lit from below\n          const set = (n: number, v: number) => { const o = out[n].data; o[i - 3] = 255; o[i - 2] = 255; o[i - 1] = 255; o[i] = Math.min(255, v * 1.7); };\n          if (gx < 0) set(0, -gx); else if (gx > 0) set(1, gx);\n          if (gy < 0) set(2, -gy); else if (gy > 0) set(3, gy);\n        }\n      }\n      const hi = out.map((im) => { const c = blank(PW, PH); c.getContext(\"2d\")?.putImageData(im, 0, 0); return c; });\n      const lo = hi.map((src) => {\n        const c = blank(PW, PH), x = c.getContext(\"2d\");\n        if (x) { x.drawImage(src, 0, 0); x.globalCompositeOperation = \"source-in\"; x.fillStyle = \"#000\"; x.fillRect(0, 0, PW, PH); }\n        return c;\n      });\n      // The floor of the cut: darker and matt on the bright face, bare steel on the black one.\n      const recess = blank(PW, PH), r = recess.getContext(\"2d\");\n      if (r) { r.drawImage(soft, 0, 0); r.globalCompositeOperation = \"source-in\"; r.fillStyle = dark ? \"#a3a39c\" : \"#2b2722\"; r.fillRect(0, 0, PW, PH); }\n      return { ctx, base, mask: soft, recess, hi, lo, dark };\n    };\n    const faces = [build(fc, drawFront, false), build(bc, drawBack, true)];\n    const tmp = blank(PW, PH), tx = tmp.getContext(\"2d\");\n\n    const s = { th: 0, v: 0, side: 0, drag: false, t: 0, idle: 0, tiltX: 0, tiltTo: 0, moved: 0, lastX: 0, lastT: 0, shown: 0 };\n    if (reduce) s.th = -0.36;\n\n    // One face. `a` is how far the face is turned from square on, `lx` where the lamp sits for it.\n    const paint = (f: Face, a: number) => {\n      const { ctx } = f;\n      const lx = Math.sin(-0.3 - a); // the lamp is up and to the left of the camera\n      ctx.globalCompositeOperation = \"source-over\"; ctx.globalAlpha = 1;\n      ctx.drawImage(f.base, 0, 0);\n      const facing = Math.max(0, Math.cos(a + 0.3));\n      ctx.fillStyle = `rgba(6,6,8,${(f.dark ? 0.34 : 0.4) * (1 - facing) + 0.04})`; ctx.fillRect(0, 0, PW, PH);\n      // The lamp and a weaker window light, each a soft band that slides across as the card turns.\n      const band = (centre: number, width: number, strength: number, warm: boolean) => {\n        const g = ctx.createLinearGradient((centre - width) * PW, 0, (centre + width) * PW, PH * 0.22);\n        const c = warm ? \"255,246,232\" : \"226,236,255\";\n        g.addColorStop(0, `rgba(${c},0)`); g.addColorStop(0.36, `rgba(${c},${strength * 0.32})`); g.addColorStop(0.5, `rgba(${c},${strength})`);\n        g.addColorStop(0.62, `rgba(${c},${strength * 0.3})`); g.addColorStop(1, `rgba(${c},0)`);\n        return g;\n      };\n      const c1 = 0.5 + (a + 0.16) * 1.25, c2 = 0.5 + (a - 0.62) * 1.25;\n      ctx.globalCompositeOperation = \"screen\";\n      ctx.fillStyle = band(c1, 0.6, f.dark ? 0.28 : 0.7, true); ctx.fillRect(0, 0, PW, PH);\n      ctx.fillStyle = band(c1 + 0.015, 0.1, f.dark ? 0.12 : 0.5, true); ctx.fillRect(0, 0, PW, PH);\n      ctx.fillStyle = band(c2, 0.36, f.dark ? 0.14 : 0.3, false); ctx.fillRect(0, 0, PW, PH);\n      // The room below is darker than the room above, and the plate shows it.\n      ctx.globalCompositeOperation = \"source-over\";\n      const fall = ctx.createLinearGradient(0, 0, 0, PH);\n      fall.addColorStop(0, \"rgba(255,255,255,0.07)\"); fall.addColorStop(0.5, \"rgba(0,0,0,0)\"); fall.addColorStop(1, \"rgba(0,0,0,0.24)\");\n      ctx.fillStyle = fall; ctx.fillRect(0, 0, PW, PH);\n      ctx.globalCompositeOperation = \"source-over\";\n      ctx.globalAlpha = f.dark ? 0.94 : 0.9; ctx.drawImage(f.recess, 0, 0); ctx.globalAlpha = 1;\n      // The same two lights again, but only inside the lettering, tighter and much brighter.\n      if (tx) {\n        tx.globalCompositeOperation = \"source-over\"; tx.clearRect(0, 0, PW, PH); tx.drawImage(f.mask, 0, 0);\n        tx.globalCompositeOperation = \"source-in\";\n        const g = tx.createLinearGradient((c1 - 0.3) * PW, 0, (c1 + 0.3) * PW, PH * 0.22);\n        const k = f.dark ? 1 : 0.5;\n        g.addColorStop(0, \"rgba(255,250,240,0)\"); g.addColorStop(0.42, `rgba(255,250,240,${0.3 * k})`); g.addColorStop(0.5, `rgba(255,252,246,${k})`); g.addColorStop(0.58, `rgba(255,250,240,${0.3 * k})`); g.addColorStop(1, \"rgba(255,250,240,0)\");\n        tx.fillStyle = g; tx.fillRect(0, 0, PW, PH);\n        ctx.globalCompositeOperation = f.dark ? \"lighter\" : \"screen\"; ctx.drawImage(tmp, 0, 0);\n      }\n      // Walls of the cut. Which side is lit depends on which side of the lamp the face is turned to.\n      const side = Math.min(1, Math.abs(lx) * 2.3), glint = Math.pow(side, 1.4);\n      const lit = lx < 0 ? 0 : 1, shade = lx < 0 ? 1 : 0;\n      ctx.globalCompositeOperation = \"source-over\";\n      ctx.globalAlpha = 0.15 + 0.45 * side; ctx.drawImage(f.lo[shade], 0, 0);\n      ctx.globalAlpha = 0.4; ctx.drawImage(f.lo[3], 0, 0);\n      ctx.globalCompositeOperation = \"lighter\";\n      ctx.globalAlpha = 0.08 + (f.dark ? 0.8 : 0.62) * glint; ctx.drawImage(f.hi[lit], 0, 0);\n      ctx.globalAlpha = f.dark ? 0.36 : 0.34; ctx.drawImage(f.hi[2], 0, 0);\n      // Polished chamfer round the rim.\n      ctx.globalAlpha = 1; ctx.globalCompositeOperation = \"source-over\";\n      const rim = ctx.createLinearGradient(0, 0, PW, PH);\n      const p = Math.max(0.02, Math.min(0.98, c1));\n      rim.addColorStop(0, \"rgba(255,255,255,0.5)\"); rim.addColorStop(Math.max(0.01, p - 0.2), \"rgba(255,255,255,0.14)\"); rim.addColorStop(p, \"rgba(255,255,255,0.95)\");\n      rim.addColorStop(Math.min(0.99, p + 0.2), \"rgba(255,255,255,0.1)\"); rim.addColorStop(1, \"rgba(0,0,0,0.5)\");\n      ctx.lineWidth = 1.6 * d; ctx.strokeStyle = rim;\n      ctx.beginPath(); ctx.roundRect(0.8 * d, 0.8 * d, PW - 1.6 * d, PH - 1.6 * d, (RADIUS - 0.8) * d); ctx.stroke();\n    };\n\n    const render = () => {\n      const turn = ((s.th % (Math.PI * 2)) + Math.PI * 3) % (Math.PI * 2) - Math.PI; // -PI..PI, 0 is the front square on\n      const frontUp = Math.abs(turn) < Math.PI / 2;\n      const f = faces[frontUp ? 0 : 1];\n      if (f) paint(f, frontUp ? turn : turn > 0 ? turn - Math.PI : turn + Math.PI);\n      sp.style.transform = `rotateX(${(7 + s.tiltX).toFixed(2)}deg) rotateY(${((s.th * 180) / Math.PI).toFixed(2)}deg)`;\n      const edge = Math.abs(Math.sin(s.th)), e = Math.round(70 + 150 * Math.pow(edge, 0.7));\n      sp.style.setProperty(\"--edge\", `linear-gradient(180deg, rgb(${e + 26},${e + 22},${e + 14}) 0%, rgb(${e},${e - 2},${e - 6}) 38%, rgb(${Math.round(e * 0.55)},${Math.round(e * 0.55)},${Math.round(e * 0.57)}) 100%)`);\n      const flat = Math.abs(Math.cos(s.th));\n      sh.style.transform = `translateX(-50%) scaleX(${(0.12 + 0.88 * flat).toFixed(3)})`;\n      sh.style.opacity = (0.55 + 0.35 * flat).toFixed(3);\n      const side = frontUp ? 0 : 1;\n      if (side !== s.shown) { s.shown = side; setShowsBack(side === 1); }\n    };\n\n    let raf = 0, last = 0, visible = true;\n    const frame = (now: number) => {\n      raf = 0;\n      const dt = Math.min(0.05, last ? (now - last) / 1000 : 0.016); last = now;\n      s.t += dt;\n      if (!s.drag) {\n        s.idle += dt;\n        if (!reduce && s.idle > TURN_EVERY) { s.idle = 0; s.side += 1; }\n        const target = s.side * Math.PI + (reduce ? -0.36 : SWAY * Math.sin(s.t * 0.62));\n        s.v += ((target - s.th) * 15 - s.v * 4.4) * dt;\n        s.th += s.v * dt;\n      }\n      s.tiltX += (s.tiltTo - s.tiltX) * Math.min(1, dt * 6);\n      render();\n      const resting = reduce && !s.drag && Math.abs(s.v) < 0.002 && Math.abs(s.side * Math.PI - 0.36 - s.th) < 0.002;\n      if (visible && !document.hidden && !resting) raf = requestAnimationFrame(frame);\n    };\n    const wake = () => { if (!raf) { last = 0; raf = requestAnimationFrame(frame); } };\n\n    api.current = {\n      flip: () => { s.side += 1; s.idle = 0; if (reduce) { s.th = s.side * Math.PI - 0.36; s.v = 0; render(); } else wake(); },\n      nudge: (dir: number) => { s.v += dir * 5; s.idle = 0; wake(); },\n    };\n\n    const down = (e: PointerEvent) => {\n      s.drag = true; s.moved = 0; s.lastX = e.clientX; s.lastT = performance.now(); s.v = 0;\n      sp.setPointerCapture(e.pointerId); wake();\n    };\n    const move = (e: PointerEvent) => {\n      const box = el.getBoundingClientRect();\n      s.tiltTo = -((e.clientY - box.top) / box.height - 0.5) * 10;\n      if (!s.drag) return;\n      const dx = e.clientX - s.lastX, now = performance.now(), dt = Math.max(8, now - s.lastT) / 1000;\n      s.moved += Math.abs(dx); s.th += dx * 0.011; s.v = s.v * 0.5 + ((dx * 0.011) / dt) * 0.5;\n      s.lastX = e.clientX; s.lastT = now;\n      if (reduce) render();\n    };\n    const up = () => {\n      if (!s.drag) return;\n      s.drag = false; s.idle = 0;\n      if (s.moved < 5) { s.v = 0; s.side += 1; }\n      else {\n        if (performance.now() - s.lastT > 90) s.v = 0;\n        s.v = Math.max(-16, Math.min(16, s.v));\n        s.side = Math.round((s.th + s.v * 0.3) / Math.PI);\n      }\n      if (reduce) { s.th = s.side * Math.PI - 0.36; s.v = 0; render(); } else wake();\n    };\n    const leave = () => { s.tiltTo = 0; };\n    sp.addEventListener(\"pointerdown\", down);\n    el.addEventListener(\"pointermove\", move);\n    sp.addEventListener(\"pointerup\", up);\n    sp.addEventListener(\"pointercancel\", up);\n    el.addEventListener(\"pointerleave\", leave);\n\n    const fit = () => setScale(Math.min(1.3, (el.clientWidth - 44) / W));\n    fit();\n    const ro = new ResizeObserver(fit); ro.observe(el);\n    const io = new IntersectionObserver(([en]) => { visible = en.isIntersecting; if (visible && !reduce) wake(); });\n    io.observe(el);\n    const vis = () => { if (!document.hidden && !reduce) wake(); };\n    document.addEventListener(\"visibilitychange\", vis);\n    render();\n    if (!reduce) wake();\n\n    return () => {\n      cancelAnimationFrame(raf); ro.disconnect(); io.disconnect();\n      document.removeEventListener(\"visibilitychange\", vis);\n      sp.removeEventListener(\"pointerdown\", down); el.removeEventListener(\"pointermove\", move);\n      sp.removeEventListener(\"pointerup\", up); sp.removeEventListener(\"pointercancel\", up); el.removeEventListener(\"pointerleave\", leave);\n      api.current = null;\n    };\n  }, []);\n\n  const onKey = (e: ReactKeyboardEvent<HTMLButtonElement>) => {\n    if (e.key === \"ArrowLeft\" || e.key === \"ArrowRight\") { e.preventDefault(); api.current?.nudge(e.key === \"ArrowLeft\" ? -1 : 1); }\n  };\n\n  const layers = Array.from({ length: THICK - 1 }, (_, i) => i + 1 - THICK / 2);\n\n  return (\n    <div ref={root} className=\"relative flex min-h-[660px] w-full items-center justify-center overflow-hidden bg-[#0b0b0d] py-20\">\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ background: \"radial-gradient(60% 46% at 50% 44%, #2b2a2c 0%, #17171a 46%, #0b0b0d 100%)\" }} />\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute left-1/2 top-[64%] h-40 w-[720px] max-w-[130%] -translate-x-1/2 rounded-[50%]\" style={{ background: \"radial-gradient(closest-side, rgba(255,240,220,0.07), rgba(255,240,220,0))\" }} />\n\n      <div className=\"relative\" style={{ width: W * scale, height: H * scale }}>\n        <div className=\"absolute left-0 top-0\" style={{ width: W, height: H, transform: `scale(${scale})`, transformOrigin: \"0 0\", perspective: 1500 }}>\n          <div ref={shadow} aria-hidden=\"true\" className=\"pointer-events-none absolute left-1/2 h-12 rounded-[50%]\" style={{ top: H + 40, width: W * 0.94, transform: \"translateX(-50%)\", background: \"radial-gradient(closest-side, rgba(0,0,0,0.9), rgba(0,0,0,0.5) 55%, rgba(0,0,0,0))\", filter: \"blur(10px)\" }} />\n          <div ref={spin} className=\"absolute inset-0 cursor-grab touch-pan-y select-none active:cursor-grabbing\" style={{ transformStyle: \"preserve-3d\", transform: \"rotateX(7deg) rotateY(0deg)\" }}>\n            {layers.map((z) => (\n              <div key={z} aria-hidden=\"true\" className=\"absolute inset-0\" style={{ borderRadius: RADIUS, background: \"var(--edge, #777)\", transform: `translateZ(${z}px)` }} />\n            ))}\n            <canvas ref={front} aria-hidden=\"true\" className=\"absolute inset-0 h-full w-full bg-[#bdb6a8]\" style={{ borderRadius: RADIUS, transform: `translateZ(${THICK / 2}px)`, backfaceVisibility: \"hidden\", WebkitBackfaceVisibility: \"hidden\" }} />\n            <canvas ref={back} aria-hidden=\"true\" className=\"absolute inset-0 h-full w-full bg-[#17382f]\" style={{ borderRadius: RADIUS, transform: `rotateY(180deg) translateZ(${THICK / 2}px)`, backfaceVisibility: \"hidden\", WebkitBackfaceVisibility: \"hidden\" }} />\n            <button\n              type=\"button\"\n              onClick={(e) => { if (e.detail === 0) api.current?.flip(); }}\n              onKeyDown={onKey}\n              aria-pressed={showsBack}\n              aria-label={`${card.house} membership card, ${showsBack ? \"back\" : \"front\"} showing. Press to turn it over, or use the left and right arrow keys to spin it.`}\n              className=\"absolute inset-0 cursor-grab rounded-[18px] outline-none focus-visible:ring-2 focus-visible:ring-amber-200 focus-visible:ring-offset-4 focus-visible:ring-offset-[#0b0b0d] active:cursor-grabbing\"\n              style={{ transform: `translateZ(${THICK / 2 + 1}px)`, touchAction: \"pan-y\" }}\n            />\n          </div>\n        </div>\n      </div>\n\n      <p className=\"sr-only\" aria-live=\"polite\">\n        {showsBack ? `Back of the card: number ${card.number}. ${card.backLine.toLowerCase()}. ${card.address.toLowerCase()}.` : `Front of the card: ${card.house}, ${card.kind.toLowerCase()}. ${card.member}, ${card.tier.toLowerCase()}, number ${card.number}, ${card.since.toLowerCase()}.`}\n      </p>\n      <p className=\"pointer-events-none absolute bottom-7 left-7 font-mono text-[10px] font-semibold uppercase leading-5 tracking-[0.22em] text-zinc-100\">\n        {card.house} card no. {card.number}\n        <span className=\"block font-medium text-zinc-400\">Drag to spin it, tap to turn it over</span>\n      </p>\n    </div>\n  );\n}\n"}]}
