{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"cork-board-testimonials-with-pinned-portrait-postcards-that-swing-unpin-and-turn-over-to-a-handwritten-note","type":"registry:block","title":"Cork Board Testimonials with Pinned Portrait Postcards That Swing, Unpin and Turn over to a Handwritten Note","description":"Testimonial board of portrait postcards on map pins: they sway when brushed, then unpin and turn over to a handwritten note. Free React and HTML code.","dependencies":["framer-motion"],"files":[{"path":"components/we-inc/cork-board-testimonials-with-pinned-portrait-postcards-that-swing-unpin-and-turn-over-to-a-handwritten-note.tsx","type":"registry:component","content":"import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\n\n/** One postcard per person: the photograph is the front, the words are written on the back. */\nconst cards = [\n  {\n    name: \"Imani Okafor\",\n    role: \"Founder\",\n    company: \"Saltmarsh Ceramics\",\n    city: \"Porto\",\n    date: \"14 MAR\",\n    quote: \"You rebuilt our shop in three weeks and it finally looks the way the pots feel in your hand. My mother rang to ask who took the pictures.\",\n    sign: \"Imani\",\n    pin: \"#d7352a\",\n    photo: { src: \"https://images.pexels.com/photos/30878711/pexels-photo-30878711.jpeg?auto=compress&cs=tinysrgb&w=800\", alt: \"Woman with sculpted braids and red eye make-up in a red striped top against a yellow wall\", tone: \"#f0b400\", focus: \"50% 22%\" },\n  },\n  {\n    name: \"Tomas Rivera\",\n    role: \"Owner\",\n    company: \"Rivera Cycle Works\",\n    city: \"Valencia\",\n    date: \"02 JUN\",\n    quote: \"I sent a page of scribbles on a Sunday night. By Wednesday there was a booking page my mechanics could actually use with greasy thumbs.\",\n    sign: \"Tomas\",\n    pin: \"#f2c230\",\n    photo: { src: \"https://images.pexels.com/photos/11492642/pexels-photo-11492642.jpeg?auto=compress&cs=tinysrgb&w=800\", alt: \"Man in a black jacket sitting on a wooden stool in front of an orange studio backdrop\", tone: \"#e8860c\", focus: \"50% 30%\" },\n  },\n  {\n    name: \"Noor Haddad\",\n    role: \"Head of Brand\",\n    company: \"Fieldnote Coffee\",\n    city: \"Amman\",\n    date: \"27 SEP\",\n    quote: \"Every agency told us to pick one colour and behave. You let the bags stay loud and made the rest of the page quiet enough to hear them.\",\n    sign: \"Noor x\",\n    pin: \"#1f55d8\",\n    photo: { src: \"https://images.pexels.com/photos/7515731/pexels-photo-7515731.jpeg?auto=compress&cs=tinysrgb&w=800\", alt: \"Profile of a woman with slicked-back hair in a red top, half lit against a yellow and red backdrop\", tone: \"#e9a60a\", focus: \"50% 40%\" },\n  },\n  {\n    name: \"Desmond Achebe\",\n    role: \"Florist\",\n    company: \"Stem and Thorn\",\n    city: \"Accra\",\n    date: \"09 DEC\",\n    quote: \"The launch went out on a Friday and I spent Saturday wrapping peonies instead of answering emails. That has never happened before.\",\n    sign: \"Des\",\n    pin: \"#f4efe6\",\n    photo: { src: \"https://images.pexels.com/photos/9955031/pexels-photo-9955031.jpeg?auto=compress&cs=tinysrgb&w=800\", alt: \"Man in a white beret and white jacket holding a pink peony against a deep blue backdrop\", tone: \"#1d4f86\", focus: \"50% 26%\" },\n  },\n  {\n    name: \"Leila Mbeki\",\n    role: \"Director\",\n    company: \"Longroom Records\",\n    city: \"Durban\",\n    date: \"21 JAN\",\n    quote: \"We asked for a site. We got somebody who listened to the whole back catalogue first and then argued with us about the running order.\",\n    sign: \"Leila\",\n    pin: \"#18996b\",\n    photo: { src: \"https://images.pexels.com/photos/32174976/pexels-photo-32174976.jpeg?auto=compress&cs=tinysrgb&w=800\", alt: \"Woman with an afro and silver bracelets holding her hands to her hair against a red backdrop\", tone: \"#d2332b\", focus: \"50% 24%\" },\n  },\n];\n\n// A card is drawn at reading size and scaled down while it hangs.\nconst CW = 340;\nconst CH = 480;\nconst PIN_Y = 22; // where the pin goes through, measured from the top edge\n// Two arrangements: a wide board and a tall one for phones. homes are [pin x, pin y, hanging angle].\nconst WIDE = { w: 1100, h: 680, rest: 0.56, open: 1, cx: 550, cy: 346, homes: [[152, 66, -3], [296, 372, 2.4], [550, 92, -1.4], [812, 366, -2.2], [950, 62, 3.2]] };\nconst TALL = { w: 400, h: 700, rest: 0.365, open: 0.92, cx: 200, cy: 416, homes: [[74, 46, -3], [200, 62, 1.6], [112, 262, 2.4], [326, 42, 3], [292, 270, -2.6]] };\nconst ORDER = [2, 0, 4, 1, 3]; // the order the board reads itself out in\n\nconst clamp = (v: number, lo: number, hi: number) => Math.min(hi, Math.max(lo, v));\nconst lerp = (a: number, b: number, t: number) => a + (b - a) * t;\nconst ease = (t: number) => t * t * (3 - 2 * t);\n\nconst svg = (s: string) => `url(\"data:image/svg+xml,${encodeURIComponent(s)}\")`;\n// pressed cork: coarse granules, dark crevices between them and fine grit on top\nconst CORK = svg(\n  `<svg xmlns='http://www.w3.org/2000/svg' width='360' height='360'><filter id='g' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.2' numOctaves='3' seed='7' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.3  0 0 0 0 0.16  0 0 0 0 0.06  4.2 0 0 0 -1.95'/></filter><filter id='h' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.3' numOctaves='2' seed='23' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.9  0 0 0 0 0.72  0 0 0 0 0.48  0 3.6 0 0 -1.9'/></filter><filter id='s' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='2' seed='3' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.13  0 0 0 0 0.06  0 0 0 0 0.02  0 0 6 0 -3.25'/></filter><filter id='t' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2' seed='5' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.25  0 0 0 0 0.12  0 0 0 0 0.02  2.2 0 0 0 -0.95'/></filter><rect width='360' height='360' fill='#b27f4e'/><rect width='360' height='360' filter='url(#t)' opacity='0.5'/><rect width='360' height='360' filter='url(#g)' opacity='0.62'/><rect width='360' height='360' filter='url(#h)' opacity='0.4'/><rect width='360' height='360' filter='url(#s)' opacity='0.85'/></svg>`,\n);\nconst GRAIN = svg(\n  `<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='p' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' seed='11' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.3  0 0 0 0 0.22  0 0 0 0 0.1  0 0 0 0.5 -0.14'/></filter><rect width='160' height='160' filter='url(#p)'/></svg>`,\n);\nconst HAND = `\"Bradley Hand\", \"Segoe Print\", \"Noteworthy\", \"Marker Felt\", cursive`;\nconst INK = \"#1c2a5a\";\n\ntype Sim = { th: number; w: number; o: number; ov: number; target: number; pin: number; pinV: number; pinUp: boolean };\n\nexport default function CorkBoardPostcards() {\n  const reduce = !!useReducedMotion();\n  const rootRef = useRef<HTMLDivElement>(null);\n  const sceneRef = useRef<HTMLDivElement>(null);\n  const wrapRefs = useRef<(HTMLDivElement | null)[]>([]);\n  const cardRefs = useRef<(HTMLDivElement | null)[]>([]);\n  const shadeRefs = useRef<(HTMLDivElement | null)[]>([]);\n  const glareRefs = useRef<(HTMLDivElement | null)[]>([]);\n  const pinRefs = useRef<(HTMLDivElement | null)[]>([]);\n  const [tall, setTall] = useState(false);\n  const [open, setOpen] = useState<number | null>(null);\n  const openRef = useRef<number | null>(open);\n  const sim = useRef<Sim[]>(cards.map(() => ({ th: 0, w: 0, o: 0, ov: 0, target: 0, pin: 0, pinV: 0, pinUp: false })));\n  const env = useRef({ scale: 1, touched: false, inside: false, visible: true, layout: WIDE });\n\n  const paint = useCallback((i: number) => {\n    const L = env.current.layout;\n    const c = sim.current[i];\n    const [px, py, rest] = L.homes[i];\n    const e = clamp(c.o, 0, 1);\n    const s = lerp(L.rest, L.open, c.o);\n    const x = (L.cx - px) * e;\n    const y = (L.cy - (CH / 2 - PIN_Y) * L.open - py) * e + Math.sin(e * Math.PI) * 20;\n    const ang = (rest + c.th) * (1 - e) - 1.6 * e;\n    const flip = 180 * ease(clamp((c.o - 0.12) / 0.74, 0, 1));\n    const card = cardRefs.current[i];\n    const shade = shadeRefs.current[i];\n    const wrap = wrapRefs.current[i];\n    const glare = glareRefs.current[i];\n    const pin = pinRefs.current[i];\n    const base = `translate3d(${x.toFixed(2)}px, ${y.toFixed(2)}px, 0) rotate(${ang.toFixed(3)}deg) scale(${s.toFixed(4)})`;\n    if (card) card.style.transform = `${base} rotateY(${flip.toFixed(2)}deg)`;\n    if (shade) {\n      shade.style.transform = `${base} scaleX(${Math.max(0.06, Math.abs(Math.cos((flip * Math.PI) / 180))).toFixed(3)})`;\n      shade.style.setProperty(\"--lift\", e.toFixed(3));\n    }\n    // the card stays under its pin until the pin has let go, then comes forward of everything\n    if (wrap) wrap.style.zIndex = c.o > 0.28 ? \"40\" : c.o > 0.015 ? \"20\" : \"10\";\n    if (glare) glare.style.transform = `translate3d(${(c.th * 9).toFixed(1)}px, 0, 0)`;\n    if (pin) pin.style.setProperty(\"--up\", clamp(c.pin, 0, 1.3).toFixed(3));\n  }, []);\n\n  const toggle = useCallback(\n    (i: number | null, byHand: boolean) => {\n      if (byHand) env.current.touched = true;\n      const next = i !== null && openRef.current === i ? null : i;\n      openRef.current = next;\n      setOpen(next);\n      sim.current.forEach((c, k) => {\n        const t = k === next ? 1 : 0;\n        if (c.target !== t) {\n          c.target = t;\n          c.pinUp = true;\n        }\n        if (reduce) {\n          c.o = t;\n          c.th = 0;\n          c.pinUp = false;\n          c.pin = 0;\n          paint(k);\n        }\n      });\n    },\n    [paint, reduce],\n  );\n\n  // size the scene to its box and pick the arrangement\n  useEffect(() => {\n    const root = rootRef.current;\n    const scene = sceneRef.current;\n    if (!root || !scene) return;\n    const measure = () => {\n      const narrow = root.clientWidth < 700;\n      const L = narrow ? TALL : WIDE;\n      const sc = clamp(root.clientWidth / L.w, 0.5, 1.12);\n      env.current.scale = sc;\n      env.current.layout = L;\n      root.style.height = `${Math.round(L.h * sc)}px`;\n      scene.style.width = `${L.w}px`;\n      scene.style.height = `${L.h}px`;\n      scene.style.transform = `translateX(-50%) scale(${sc.toFixed(4)})`;\n      setTall(narrow);\n      cards.forEach((_, i) => paint(i));\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(root);\n    return () => ro.disconnect();\n  }, [paint]);\n\n  useEffect(() => {\n    cards.forEach((_, i) => paint(i));\n  }, [tall, paint]);\n\n  // the swing of every card on its pin, and the trip out to the middle and back\n  useEffect(() => {\n    if (reduce) {\n      toggle(ORDER[0], false);\n      return;\n    }\n    const root = rootRef.current;\n    if (!root) return;\n    const e = env.current;\n    let raf = 0;\n    let last = performance.now();\n    let gust = 1.4;\n    let step = 0;\n    let wait = 0.45;\n    const tick = (now: number) => {\n      raf = 0;\n      const dt = Math.min(0.032, (now - last) / 1000);\n      last = now;\n      // a draught crosses the board now and then\n      gust -= dt;\n      if (gust < 0) {\n        gust = 3.4 + Math.random() * 1.6;\n        const dir = Math.random() < 0.5 ? -1 : 1;\n        sim.current.forEach((c, i) => {\n          if (c.target === 0) c.w += dir * (14 + ((i * 37) % 11));\n        });\n      }\n      // read the board out by itself until somebody touches it\n      if (!e.touched && !e.inside) {\n        wait -= dt;\n        if (wait < 0) {\n          if (openRef.current === null) {\n            toggle(ORDER[step % ORDER.length], false);\n            step += 1;\n            wait = 4.6;\n          } else {\n            toggle(null, false);\n            wait = 1.1;\n          }\n        }\n      }\n      sim.current.forEach((c, i) => {\n        const rest = c.target === 0 && c.o < 0.02;\n        // pendulum about the pin\n        c.w += (-40 * c.th - 1.5 * c.w) * dt;\n        c.th = clamp(c.th + c.w * dt, -38, 38);\n        // travel\n        c.ov += (72 * (c.target - c.o) - 13.5 * c.ov) * dt;\n        c.o += c.ov * dt;\n        if (c.pinUp && c.target === 1 && c.o > 0.3) c.pinUp = false;\n        if (c.pinUp && c.target === 0 && c.o < 0.045) {\n          c.pinUp = false;\n          c.w += (i % 2 ? 1 : -1) * 46; // pressed home a little off centre\n        }\n        c.pinV += (260 * ((c.pinUp ? 1 : 0) - c.pin) - 22 * c.pinV) * dt;\n        c.pin += c.pinV * dt;\n        if (!rest || Math.abs(c.w) > 0.02 || Math.abs(c.th) > 0.02 || Math.abs(c.pinV) > 0.01) paint(i);\n      });\n      if (e.visible && !document.hidden) raf = requestAnimationFrame(tick);\n    };\n    const start = () => {\n      if (!raf && e.visible && !document.hidden) {\n        last = performance.now();\n        raf = requestAnimationFrame(tick);\n      }\n    };\n    const io = new IntersectionObserver(([en]) => {\n      e.visible = en.isIntersecting;\n      start();\n    });\n    io.observe(root);\n    document.addEventListener(\"visibilitychange\", start);\n    start();\n    return () => {\n      cancelAnimationFrame(raf);\n      io.disconnect();\n      document.removeEventListener(\"visibilitychange\", start);\n    };\n  }, [paint, reduce, toggle]);\n\n  // a passing pointer knocks the hanging cards\n  const onMove = (ev: React.PointerEvent) => {\n    const scene = sceneRef.current;\n    if (!scene || reduce) return;\n    const e = env.current;\n    const L = e.layout;\n    const r = scene.getBoundingClientRect();\n    const x = (ev.clientX - r.left) / e.scale;\n    const y = (ev.clientY - r.top) / e.scale;\n    const hw = (CW * L.rest) / 2;\n    L.homes.forEach(([px, py], i) => {\n      const c = sim.current[i];\n      if (c.target !== 0) return;\n      const below = y - py;\n      if (Math.abs(x - px) < hw + 10 && below > 10 && below < CH * L.rest) c.w -= clamp(ev.movementX, -40, 40) * 0.34 * (below / (CH * L.rest));\n    });\n  };\n\n  const L = tall ? TALL : WIDE;\n\n  return (\n    <section\n      ref={rootRef}\n      aria-label=\"Notes from clients\"\n      className=\"relative w-full select-none overflow-hidden bg-[#b08052]\"\n      style={{ height: WIDE.h, backgroundImage: CORK, backgroundSize: \"360px 360px\" }}\n      onPointerMove={onMove}\n      onPointerEnter={() => (env.current.inside = true)}\n      onPointerLeave={() => (env.current.inside = false)}\n    >\n      <style>{`\n        .cork-board-postcards-shade > i { position: absolute; inset: 0; border-radius: 5px; background: #2a1404; }\n        .cork-board-postcards-shade > i:nth-child(1) { opacity: calc(0.7 * (1 - var(--lift, 0))); transform: translate(4px, 6px); filter: blur(5px); }\n        .cork-board-postcards-shade > i:nth-child(2) { top: 45%; opacity: calc(0.55 * (1 - var(--lift, 0))); transform: translate(13px, 20px) skewX(2deg); filter: blur(16px); }\n        .cork-board-postcards-shade > i:nth-child(3) { opacity: calc(0.52 * var(--lift, 0)); transform: translate(36px, 50px) scale(0.97); filter: blur(32px); }\n        .cork-board-postcards-pin b { transform: translate(calc(var(--up, 0) * -9px), calc(var(--up, 0) * -15px)) scale(calc(1 + var(--up, 0) * 0.16)); }\n        .cork-board-postcards-pin u { transform: translate(calc(5px + var(--up, 0) * 9px), calc(8px + var(--up, 0) * 13px)) scale(calc(1 + var(--up, 0) * 0.25)); opacity: calc(0.6 - var(--up, 0) * 0.22); }\n        .cork-board-postcards-pin s { transform: rotate(-31deg) scaleY(var(--up, 0)); }\n      `}</style>\n\n      {/* light falling across the board from the top left, and the corners going dim */}\n      <div aria-hidden=\"true\" className=\"pointer-events-none absolute inset-0\" style={{ background: \"radial-gradient(120% 90% at 22% 8%, rgba(255,226,170,0.34), rgba(255,226,170,0) 55%), radial-gradient(140% 120% at 50% 45%, rgba(40,18,0,0) 55%, rgba(40,18,0,0.5) 100%)\" }} />\n\n      <div ref={sceneRef} className=\"absolute left-1/2 top-0 origin-top\" style={{ width: L.w, height: L.h, transform: \"translateX(-50%)\" }}>\n        {/* holes left by older pins */}\n        {[[0.12, 0.62], [0.31, 0.2], [0.45, 0.83], [0.66, 0.12], [0.72, 0.9], [0.9, 0.52], [0.58, 0.55]].map(([hx, hy], i) => (\n          <span key={i} aria-hidden=\"true\" className=\"absolute h-[5px] w-[5px] rounded-full\" style={{ left: `${hx * 100}%`, top: `${hy * 100}%`, background: \"radial-gradient(circle at 40% 35%, #1a0c02 0 45%, rgba(26,12,2,0.35) 70%, rgba(26,12,2,0) 100%)\", boxShadow: \"0.5px 1px 0 rgba(255,225,180,0.35)\" }} />\n        ))}\n\n        {cards.map((c, i) => {\n          const [px, py, hang] = L.homes[i];\n          const isOpen = open === i;\n          const first = `rotate(${hang}deg) scale(${L.rest})`; // until the frame loop takes over\n          return (\n            <div key={c.name} ref={(el) => void (wrapRefs.current[i] = el)} className=\"pointer-events-none absolute inset-0\" style={{ perspective: 1700, zIndex: 10 }}>\n              <div ref={(el) => void (shadeRefs.current[i] = el)} aria-hidden=\"true\" className=\"cork-board-postcards-shade absolute\" style={{ left: px - CW / 2, top: py - PIN_Y, width: CW, height: CH, transformOrigin: `50% ${PIN_Y}px`, transform: first }}>\n                <i />\n                <i />\n                <i />\n              </div>\n              <div\n                ref={(el) => void (cardRefs.current[i] = el)}\n                className=\"pointer-events-auto absolute cursor-pointer\"\n                style={{ left: px - CW / 2, top: py - PIN_Y, width: CW, height: CH, transformOrigin: `50% ${PIN_Y}px`, transformStyle: \"preserve-3d\", transform: first }}\n                onClick={() => toggle(i, true)}\n              >\n                {/* front: the photograph */}\n                <div className=\"absolute inset-0 overflow-hidden rounded-[5px] bg-[#f6f1e7]\" style={{ backfaceVisibility: \"hidden\", boxShadow: \"inset 0 0 0 1px rgba(60,40,20,0.18), inset 0 -2px 3px rgba(60,40,20,0.12)\" }}>\n                  <div className=\"absolute inset-[13px] overflow-hidden rounded-[1px]\" style={{ background: c.photo.tone, boxShadow: \"0 0 0 1px rgba(0,0,0,0.14)\" }}>\n                    <img src={c.photo.src} alt={c.photo.alt} width={314} height={454} draggable={false} className=\"h-full w-full object-cover\" style={{ objectPosition: c.photo.focus }} />\n                    <div ref={(el) => void (glareRefs.current[i] = el)} aria-hidden=\"true\" className=\"absolute -inset-x-1/2 inset-y-0\" style={{ background: \"linear-gradient(104deg, rgba(255,255,255,0) 38%, rgba(255,255,255,0.2) 47%, rgba(255,255,255,0.03) 54%, rgba(255,255,255,0) 62%)\" }} />\n                    <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ boxShadow: \"inset 0 0 26px rgba(0,0,0,0.2)\" }} />\n                  </div>\n                  <span aria-hidden=\"true\" className=\"absolute left-1/2 h-[7px] w-[7px] -translate-x-1/2 rounded-full bg-[#1c0e04]\" style={{ top: PIN_Y - 3.5, boxShadow: \"0 1px 0 rgba(255,255,255,0.5)\" }} />\n                  <button\n                    type=\"button\"\n                    tabIndex={isOpen ? -1 : 0}\n                    aria-expanded={isOpen}\n                    aria-label={`Unpin the postcard from ${c.name} and read the back`}\n                    className=\"absolute inset-0 rounded-[5px] focus:outline-none focus-visible:ring-4 focus-visible:ring-[#1c2a5a] focus-visible:ring-offset-2 focus-visible:ring-offset-[#f6f1e7]\"\n                    onClick={(ev) => {\n                      ev.stopPropagation();\n                      toggle(i, true);\n                    }}\n                  />\n                </div>\n\n                {/* back: the note */}\n                <figure className=\"absolute inset-0 m-0 overflow-hidden rounded-[5px] bg-[#f3ead6]\" aria-hidden={!isOpen} style={{ backfaceVisibility: \"hidden\", transform: \"rotateY(180deg)\", backgroundImage: `${GRAIN}, linear-gradient(160deg, #f8f1e0, #ecdfc4)`, boxShadow: \"inset 0 0 0 1px rgba(90,60,20,0.2), inset 0 0 40px rgba(150,110,50,0.14)\" }}>\n                  <span aria-hidden=\"true\" className=\"absolute left-1/2 h-[7px] w-[7px] -translate-x-1/2 rounded-full bg-[#1c0e04]\" style={{ top: PIN_Y - 3.5, boxShadow: \"0 1px 0 rgba(255,255,255,0.6)\" }} />\n                  <div aria-hidden=\"true\" className=\"absolute left-[26px] top-[44px] text-[#8a3a22]\">\n                    <p className=\"font-serif text-[19px] font-bold uppercase leading-none tracking-[0.3em]\">Post card</p>\n                    <p className=\"mt-[7px] text-[7.5px] font-semibold uppercase tracking-[0.34em] opacity-80\">This side for the kind words</p>\n                  </div>\n                  {/* stamp */}\n                  <div aria-hidden=\"true\" className=\"absolute right-[24px] top-[34px] h-[92px] w-[76px] rotate-[2.5deg]\" style={{ background: \"radial-gradient(circle at 4px 4px, rgba(251,247,238,0) 0 2.5px, #fbf7ee 3.1px) -4px -4px / 8px 8px\", filter: \"drop-shadow(0 1px 1.5px rgba(60,30,0,0.4))\" }}>\n                    <div className=\"absolute inset-[3px] bg-[#fbf7ee] p-[4px]\">\n                      <div className=\"relative h-full w-full overflow-hidden\" style={{ background: c.photo.tone }}>\n                        <img src={c.photo.src} alt=\"\" width={62} height={78} draggable={false} className=\"h-full w-full object-cover\" style={{ objectPosition: c.photo.focus, filter: \"saturate(0.8) contrast(1.06)\" }} />\n                        <span className=\"absolute bottom-0 left-0 right-0 bg-[#fbf7ee] pt-[2px] text-center text-[5.5px] font-bold uppercase leading-none tracking-[0.18em] text-[#5b2a1a]\">{c.city} 45</span>\n                      </div>\n                    </div>\n                  </div>\n                  {/* postmark */}\n                  <svg aria-hidden=\"true\" viewBox=\"0 0 150 80\" className=\"absolute right-[62px] top-[66px] h-[72px] w-[136px] -rotate-[9deg] opacity-[0.72]\" fill=\"none\" stroke=\"#27324f\" strokeWidth=\"1.5\">\n                    <circle cx=\"38\" cy=\"40\" r=\"30\" />\n                    <circle cx=\"38\" cy=\"40\" r=\"20\" strokeWidth=\"1\" />\n                    <text x=\"38\" y=\"38\" textAnchor=\"middle\" fontSize=\"9\" fontWeight=\"700\" fill=\"#27324f\" stroke=\"none\" fontFamily=\"ui-monospace, Menlo, monospace\">{c.date}</text>\n                    <text x=\"38\" y=\"49\" textAnchor=\"middle\" fontSize=\"6.5\" fontWeight=\"700\" fill=\"#27324f\" stroke=\"none\" fontFamily=\"ui-monospace, Menlo, monospace\" letterSpacing=\"1\">{c.city.toUpperCase()}</text>\n                    {[20, 30, 40, 50, 60].map((yy) => (\n                      <path key={yy} d={`M72 ${yy} q9 -6 18 0 t18 0 t18 0 t18 0`} strokeLinecap=\"round\" />\n                    ))}\n                  </svg>\n\n                  <blockquote className=\"absolute left-[28px] right-[26px] top-[150px] m-0 text-[20.5px] leading-[31px]\" style={{ fontFamily: HAND, color: INK, backgroundImage: \"linear-gradient(rgba(60,80,140,0) 30px, rgba(60,80,140,0.2) 30px)\", backgroundSize: \"100% 31px\", transform: \"rotate(-0.7deg)\" }}>\n                    {c.quote}\n                    <span aria-hidden=\"true\" className=\"mt-[6px] block pr-[6px] text-right text-[27px] leading-[40px]\" style={{ transform: \"rotate(-4deg)\" }}>\n                      {c.sign}\n                    </span>\n                  </blockquote>\n                  <div aria-hidden=\"true\" className=\"absolute inset-0\" style={{ background: \"linear-gradient(104deg, rgba(255,255,255,0.4), rgba(255,255,255,0) 36%, rgba(110,70,10,0) 62%, rgba(110,70,10,0.16))\" }} />\n                  <figcaption className=\"absolute bottom-[24px] left-[28px] right-[26px] border-t border-[#8a3a22]/50 pt-[11px]\">\n                    <span className=\"block text-[8px] font-bold uppercase tracking-[0.32em] text-[#8a3a22]\">Sent by</span>\n                    <span className=\"mt-[5px] block font-serif text-[17px] font-semibold leading-tight text-[#2a1c10]\">{c.name}</span>\n                    <span className=\"mt-[2px] block text-[10.5px] font-medium uppercase tracking-[0.16em] text-[#4a3524]\">\n                      {c.role}, {c.company}\n                    </span>\n                  </figcaption>\n                  <button\n                    type=\"button\"\n                    tabIndex={isOpen ? 0 : -1}\n                    aria-label={`Pin the postcard from ${c.name} back on the board`}\n                    className=\"absolute inset-0 rounded-[5px] focus:outline-none focus-visible:ring-4 focus-visible:ring-inset focus-visible:ring-[#8a3a22]\"\n                    onClick={(ev) => {\n                      ev.stopPropagation();\n                      toggle(i, true);\n                    }}\n                  />\n                </figure>\n              </div>\n            </div>\n          );\n        })}\n\n        {/* the pins stay in the board; each lifts to let its card go and presses home when it comes back */}\n        {cards.map((c, i) => {\n          const [px, py] = L.homes[i];\n          const d = Math.round(30 * (tall ? 0.74 : 1));\n          return (\n            <div key={c.name} ref={(el) => void (pinRefs.current[i] = el)} aria-hidden=\"true\" className=\"cork-board-postcards-pin pointer-events-none absolute\" style={{ left: px - d / 2, top: py - d / 2, width: d, height: d, zIndex: 30 }}>\n              <u className=\"absolute inset-0 rounded-full bg-[#1d0d02] no-underline\" style={{ filter: \"blur(4px)\" }} />\n              <s className=\"absolute left-1/2 top-1/2 -ml-[1px] h-[22px] w-[2px] origin-top no-underline\" style={{ marginTop: -22, transformOrigin: \"50% 100%\", background: \"linear-gradient(90deg, #6d6f76, #f4f6fa 45%, #7c7f88)\" }} />\n              <b className=\"absolute inset-0 block rounded-full\" style={{ background: `radial-gradient(circle at 34% 28%, rgba(255,255,255,0.98) 0 5%, rgba(255,255,255,0.5) 11%, rgba(255,255,255,0) 30%), radial-gradient(circle at 62% 70%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.42) 78%), radial-gradient(circle at 70% 78%, rgba(255,255,255,0.22) 0 10%, rgba(255,255,255,0) 26%), ${c.pin}`, boxShadow: \"inset 0 0 0 1px rgba(0,0,0,0.18)\" }} />\n            </div>\n          );\n        })}\n      </div>\n\n      <p className=\"pointer-events-none absolute bottom-4 left-5 rounded-[2px] bg-[#f6f1e7] px-2.5 py-1.5 text-[9px] font-bold uppercase leading-none tracking-[0.24em] text-[#2a1c10]\" style={{ boxShadow: \"1px 2px 3px rgba(40,18,0,0.45)\", transform: \"rotate(-1.2deg)\" }}>\n        {open === null ? \"Press a card to unpin it\" : \"Press it again to pin it back\"}\n      </p>\n    </section>\n  );\n}\n"}]}
