{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "proof-video-grid",
  "type": "registry:component",
  "title": "Proof Video Grid",
  "description": "A light section with a featured video testimonial and a playlist of clips, every portrait drawn in CSS. Playing a clip runs a progress bar with timed captions, and picking a row in the playlist swaps the featured story.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "social-proof",
    "video testimonials",
    "playlist",
    "captions",
    "css art",
    "light",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/proof-video-grid",
  "files": [
    {
      "path": "registry/hyperblur/proof-video-grid.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/proof-video-grid.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface VideoStory {\n  name: string;\n  role: string;\n  company: string;\n  duration: number;\n  captions: string[];\n  backdrop?: [string, string];\n  skin?: string;\n  hair?: string;\n  cloth?: string;\n}\n\nexport interface ProofVideoGridProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  stories?: VideoStory[];\n  defaultIndex?: number;\n  defaultPlaying?: boolean;\n  accent?: string;\n  onStoryPlay?: (index: number) => void;\n}\n\nconst css = `\n.hb-wb4 {\n  --hb-wb4-accent: #e8590c;\n  box-sizing: border-box;\n  position: relative;\n  width: 100%;\n  container-type: inline-size;\n  background: #f7f5ef;\n  color: #141414;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-wb4 *, .hb-wb4 *::before, .hb-wb4 *::after { box-sizing: border-box; }\n.hb-wb4-wrap { max-width: 1120px; margin: 0 auto; padding: 80px 24px 88px; }\n.hb-wb4-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 32px; }\n.hb-wb4-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; color: #6b6b6b; font-size: 13px; font-weight: 500; }\n.hb-wb4-rec { width: 8px; height: 8px; border-radius: 50%; background: var(--hb-wb4-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-wb4-accent) 18%, transparent); animation: hb-wb4-blink 1.6s ease-in-out infinite; }\n.hb-wb4-title { margin: 0; max-width: 560px; font-size: clamp(28px, 4cqw, 44px); font-weight: 600; line-height: 1.04; letter-spacing: -.04em; text-wrap: balance; }\n.hb-wb4-sub { margin: 0; max-width: 300px; color: #6b6b6b; font-size: 14.5px; line-height: 1.55; }\n.hb-wb4-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 20px; }\n.hb-wb4-player {\n  position: relative;\n  aspect-ratio: 16 / 10;\n  overflow: hidden;\n  border-radius: 20px;\n  background: #111;\n  box-shadow: 0 1px 0 rgba(255, 255, 255, .6) inset, 0 2px 4px rgba(0, 0, 0, .06), 0 30px 60px -30px rgba(40, 30, 10, .45);\n}\n.hb-wb4-art {\n  position: absolute;\n  inset: 0;\n  overflow: hidden;\n  background: radial-gradient(70% 90% at 70% 20%, var(--hb-wb4-b1), var(--hb-wb4-b2));\n}\n.hb-wb4-art::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background:\n    radial-gradient(9% 14% at 18% 30%, rgba(255, 255, 255, .22), transparent 70%),\n    radial-gradient(6% 9% at 28% 62%, rgba(255, 255, 255, .14), transparent 70%),\n    radial-gradient(12% 18% at 86% 70%, rgba(255, 220, 160, .18), transparent 70%),\n    linear-gradient(90deg, rgba(0, 0, 0, .25), transparent 30%, transparent 70%, rgba(0, 0, 0, .3));\n}\n.hb-wb4-body {\n  position: absolute;\n  left: 50%;\n  bottom: -6%;\n  width: 54%;\n  height: 40%;\n  border-radius: 46% 46% 10% 10% / 70% 70% 10% 10%;\n  background: linear-gradient(180deg, var(--hb-wb4-cl), color-mix(in srgb, var(--hb-wb4-cl) 60%, #000));\n  transform: translateX(-46%);\n  box-shadow: inset 0 6px 14px rgba(255, 255, 255, .12);\n}\n.hb-wb4-neck { position: absolute; left: 50%; bottom: 30%; width: 11%; height: 14%; border-radius: 30%; background: linear-gradient(180deg, color-mix(in srgb, var(--hb-wb4-sk) 70%, #000), var(--hb-wb4-sk)); transform: translateX(-38%); }\n.hb-wb4-head2 {\n  position: absolute;\n  left: 50%;\n  top: 22%;\n  width: 21%;\n  aspect-ratio: .82;\n  border-radius: 46% 46% 44% 44% / 52% 52% 48% 48%;\n  background: radial-gradient(70% 60% at 38% 40%, color-mix(in srgb, var(--hb-wb4-sk) 85%, #fff), var(--hb-wb4-sk) 60%, color-mix(in srgb, var(--hb-wb4-sk) 70%, #000));\n  transform: translateX(-42%) rotate(-3deg);\n  animation: hb-wb4-nod 4.8s ease-in-out infinite;\n  animation-play-state: var(--hb-wb4-run, paused);\n}\n.hb-wb4-hair { position: absolute; inset: -8% -6% 52% -6%; border-radius: 50% 50% 30% 30% / 70% 70% 30% 30%; background: linear-gradient(160deg, color-mix(in srgb, var(--hb-wb4-hr) 80%, #fff), var(--hb-wb4-hr)); }\n.hb-wb4-vig { position: absolute; inset: 0; background: radial-gradient(90% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .45)); pointer-events: none; }\n.hb-wb4-play {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  display: grid;\n  place-items: center;\n  width: 76px;\n  height: 76px;\n  padding: 0;\n  border: 1px solid rgba(255, 255, 255, .35);\n  border-radius: 50%;\n  background: rgba(255, 255, 255, .16);\n  -webkit-backdrop-filter: blur(12px);\n  backdrop-filter: blur(12px);\n  color: #fff;\n  cursor: pointer;\n  transform: translate(-50%, -50%);\n  transition: transform .35s cubic-bezier(.2, .8, .2, 1), background .3s ease, opacity .3s ease;\n}\n.hb-wb4-play:hover { transform: translate(-50%, -50%) scale(1.06); background: rgba(255, 255, 255, .26); }\n.hb-wb4-play:focus-visible { outline: 2px solid #fff; outline-offset: 4px; }\n.hb-wb4-player[data-playing=\"true\"] .hb-wb4-play { opacity: 0; }\n.hb-wb4-player[data-playing=\"true\"]:hover .hb-wb4-play, .hb-wb4-player[data-playing=\"true\"] .hb-wb4-play:focus-visible { opacity: 1; }\n.hb-wb4-third { position: absolute; left: 20px; top: 18px; display: flex; align-items: center; gap: 10px; color: #fff; }\n.hb-wb4-third b { display: block; font-size: 14px; font-weight: 600; }\n.hb-wb4-third span { display: block; font-size: 12px; opacity: .75; }\n.hb-wb4-third i { width: 3px; height: 30px; border-radius: 2px; background: var(--hb-wb4-accent); }\n.hb-wb4-cap {\n  position: absolute;\n  left: 50%;\n  bottom: 54px;\n  max-width: 82%;\n  padding: 7px 12px;\n  border-radius: 8px;\n  background: rgba(0, 0, 0, .62);\n  color: #fff;\n  font-size: clamp(13px, 1.6cqw, 17px);\n  font-weight: 500;\n  line-height: 1.4;\n  text-align: center;\n  transform: translateX(-50%);\n  animation: hb-wb4-cap .35s cubic-bezier(.2, .8, .2, 1) both;\n}\n.hb-wb4-bar { position: absolute; left: 20px; right: 20px; bottom: 20px; display: flex; align-items: center; gap: 12px; color: #fff; font-size: 12px; font-family: var(--font-mono, ui-monospace, monospace); font-variant-numeric: tabular-nums; }\n.hb-wb4-track { position: relative; flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); overflow: hidden; }\n.hb-wb4-fill { position: absolute; inset: 0; border-radius: inherit; background: var(--hb-wb4-accent); transform-origin: left; transform: scaleX(var(--hb-wb4-p, 0)); transition: transform .12s linear; }\n.hb-wb4-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }\n.hb-wb4-row {\n  display: grid;\n  grid-template-columns: 112px minmax(0, 1fr);\n  align-items: center;\n  gap: 14px;\n  width: 100%;\n  padding: 8px;\n  border: 1px solid transparent;\n  border-radius: 14px;\n  background: transparent;\n  color: inherit;\n  font: inherit;\n  text-align: left;\n  cursor: pointer;\n  transition: background .3s ease, border-color .3s ease, box-shadow .3s ease;\n}\n.hb-wb4-row:hover { background: rgba(255, 255, 255, .6); }\n.hb-wb4-row[aria-current=\"true\"] { border-color: rgba(0, 0, 0, .08); background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 12px 24px -16px rgba(40, 30, 10, .3); }\n.hb-wb4-row:focus-visible { outline: 2px solid var(--hb-wb4-accent); outline-offset: 2px; }\n.hb-wb4-mini { position: relative; aspect-ratio: 16 / 10; overflow: hidden; border-radius: 9px; }\n.hb-wb4-mini .hb-wb4-dur { position: absolute; right: 5px; bottom: 5px; padding: 1px 5px; border-radius: 4px; background: rgba(0, 0, 0, .65); color: #fff; font-size: 10px; font-family: var(--font-mono, ui-monospace, monospace); }\n.hb-wb4-row b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; }\n.hb-wb4-row span.hb-wb4-who { display: block; margin-top: 2px; color: #6b6b6b; font-size: 12.5px; line-height: 1.4; }\n.hb-wb4-row em { display: block; margin-top: 6px; color: #8a8a8a; font-size: 12px; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hb-wb4-eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; margin-right: 6px; vertical-align: -1px; }\n.hb-wb4-eq i { width: 2px; height: 100%; border-radius: 1px; background: var(--hb-wb4-accent); animation: hb-wb4-eq .9s ease-in-out infinite; transform-origin: bottom; }\n.hb-wb4-eq i:nth-child(2) { animation-delay: -.3s; }\n.hb-wb4-eq i:nth-child(3) { animation-delay: -.6s; }\n.hb-wb4-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@keyframes hb-wb4-blink { 50% { opacity: .35; } }\n@keyframes hb-wb4-nod { 0%, 100% { transform: translateX(-42%) rotate(-3deg); } 35% { transform: translateX(-40%) rotate(2deg) translateY(1%); } 70% { transform: translateX(-43%) rotate(-1deg); } }\n@keyframes hb-wb4-cap { from { opacity: 0; transform: translate(-50%, 6px); } }\n@keyframes hb-wb4-eq { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }\n@container (max-width: 820px) {\n  .hb-wb4-grid { grid-template-columns: minmax(0, 1fr); }\n  .hb-wb4-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }\n  .hb-wb4-row { grid-template-columns: minmax(0, 1fr); }\n  .hb-wb4-row em { display: none; }\n}\n@container (max-width: 560px) {\n  .hb-wb4-wrap { padding: 56px 16px 64px; }\n  .hb-wb4-head { flex-direction: column; align-items: flex-start; gap: 12px; }\n  .hb-wb4-play { width: 56px; height: 56px; }\n  .hb-wb4-cap { bottom: 44px; max-width: 92%; }\n  .hb-wb4-third { left: 14px; top: 12px; }\n  .hb-wb4-bar { left: 14px; right: 14px; bottom: 14px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wb4-rec, .hb-wb4-head2, .hb-wb4-cap, .hb-wb4-eq i { animation: none; }\n  .hb-wb4-play, .hb-wb4-row, .hb-wb4-fill { transition: none; }\n}\n`;\n\nconst defaultStories: VideoStory[] = [\n  {\n    name: \"Renata Alves\",\n    role: \"Owner\",\n    company: \"Casa Alves Bakery\",\n    duration: 14,\n    captions: [\"We were doing every order on paper.\", \"Now the shop runs on Tillwise from one tablet.\", \"Saturday mornings went from chaos to calm.\", \"And I finally take Sundays off.\"],\n    backdrop: [\"#f2b880\", \"#7a3e1d\"],\n    skin: \"#b07a55\",\n    hair: \"#2a1a12\",\n    cloth: \"#e8e1d4\",\n  },\n  {\n    name: \"Jonas Becker\",\n    role: \"Founder\",\n    company: \"Becker Cycles\",\n    duration: 12,\n    captions: [\"Inventory used to be a guess.\", \"Now I know what sells before the weekend.\", \"We cut dead stock by a third.\"],\n    backdrop: [\"#9ec5d8\", \"#1f3d52\"],\n    skin: \"#e2b9a0\",\n    hair: \"#a0662e\",\n    cloth: \"#2f4a3a\",\n  },\n  {\n    name: \"Amina Yusuf\",\n    role: \"Manager\",\n    company: \"Lantern Coffee\",\n    duration: 11,\n    captions: [\"Our baristas learned it in ten minutes.\", \"Tips come in on the same screen.\", \"The team actually likes closing now.\"],\n    backdrop: [\"#c8b6e2\", \"#3b2a5c\"],\n    skin: \"#6e4630\",\n    hair: \"#151010\",\n    cloth: \"#c2593a\",\n  },\n  {\n    name: \"Marco Bellini\",\n    role: \"Chef\",\n    company: \"Osteria Nove\",\n    duration: 13,\n    captions: [\"Tickets hit the kitchen in a second.\", \"No more shouting across the pass.\", \"Covers are up twenty percent this year.\"],\n    backdrop: [\"#a8d5a2\", \"#24452a\"],\n    skin: \"#d6a684\",\n    hair: \"#3a3a3a\",\n    cloth: \"#f2f2f2\",\n  },\n];\n\nfunction fmt(s: number) {\n  const v = Math.max(0, Math.floor(s));\n  return `${Math.floor(v / 60)}:${String(v % 60).padStart(2, \"0\")}`;\n}\n\nfunction Portrait({ s }: { s: VideoStory }) {\n  const vars = {\n    \"--hb-wb4-b1\": s.backdrop?.[0] ?? \"#d9c7a8\",\n    \"--hb-wb4-b2\": s.backdrop?.[1] ?? \"#3a2e20\",\n    \"--hb-wb4-sk\": s.skin ?? \"#c69274\",\n    \"--hb-wb4-hr\": s.hair ?? \"#2b1d14\",\n    \"--hb-wb4-cl\": s.cloth ?? \"#3a4a5a\",\n  } as React.CSSProperties;\n  return (\n    <div className=\"hb-wb4-art\" style={vars} aria-hidden=\"true\">\n      <div className=\"hb-wb4-body\" />\n      <div className=\"hb-wb4-neck\" />\n      <div className=\"hb-wb4-head2\">\n        <div className=\"hb-wb4-hair\" />\n      </div>\n      <div className=\"hb-wb4-vig\" />\n    </div>\n  );\n}\n\nexport function ProofVideoGrid({\n  eyebrow = \"38 video stories\",\n  title = \"Small shops, in their own words\",\n  subtitle = \"Unscripted clips from owners who run their counter, kitchen or workshop on Tillwise.\",\n  stories = defaultStories,\n  defaultIndex = 0,\n  defaultPlaying = true,\n  accent = \"#e8590c\",\n  onStoryPlay,\n  className = \"\",\n  style,\n  ...rest\n}: ProofVideoGridProps) {\n  const uid = React.useId();\n  const n = stories.length;\n  const [index, setIndex] = React.useState(Math.max(0, Math.min(defaultIndex, n - 1)));\n  const [playing, setPlaying] = React.useState(defaultPlaying);\n  const [time, setTime] = React.useState(0);\n  const timeRef = React.useRef(0);\n  const s = stories[index];\n  const dur = s ? Math.max(s.duration, 1) : 1;\n\n  React.useEffect(() => {\n    if (!playing) return;\n    const id = window.setInterval(() => {\n      const next = timeRef.current + 0.1;\n      if (next >= dur) {\n        window.clearInterval(id);\n        timeRef.current = 0;\n        setTime(0);\n        setPlaying(false);\n        return;\n      }\n      timeRef.current = next;\n      setTime(next);\n    }, 100);\n    return () => window.clearInterval(id);\n  }, [playing, dur, index]);\n\n  const choose = (i: number) => {\n    setIndex(i);\n    timeRef.current = 0;\n    setTime(0);\n    setPlaying(true);\n    onStoryPlay?.(i);\n  };\n\n  const toggle = () => {\n    if (!playing) onStoryPlay?.(index);\n    setPlaying((p) => !p);\n  };\n\n  if (!s) return null;\n  const capIndex = Math.min(s.captions.length - 1, Math.floor((time / dur) * s.captions.length));\n  const caption = s.captions[capIndex];\n  const vars = { \"--hb-wb4-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-wb4 ${className}`} style={vars} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-proof-video-grid\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wb4-wrap\">\n        <div className=\"hb-wb4-head\">\n          <div>\n            <p className=\"hb-wb4-eyebrow\"><span className=\"hb-wb4-rec\" aria-hidden=\"true\" />{eyebrow}</p>\n            <h2 id={`${uid}-t`} className=\"hb-wb4-title\">{title}</h2>\n          </div>\n          {subtitle && <p className=\"hb-wb4-sub\">{subtitle}</p>}\n        </div>\n        <div className=\"hb-wb4-grid\">\n          <div\n            className=\"hb-wb4-player\"\n            data-playing={playing}\n            style={{ \"--hb-wb4-run\": playing ? \"running\" : \"paused\", \"--hb-wb4-p\": (time / dur).toFixed(3) } as React.CSSProperties}\n          >\n            <Portrait s={s} />\n            <div className=\"hb-wb4-third\">\n              <i aria-hidden=\"true\" />\n              <div>\n                <b>{s.name}</b>\n                <span>{`${s.role}, ${s.company}`}</span>\n              </div>\n            </div>\n            {playing && caption && (\n              <p key={`${index}-${capIndex}`} className=\"hb-wb4-cap\" aria-live=\"polite\">{caption}</p>\n            )}\n            <button type=\"button\" className=\"hb-wb4-play\" aria-label={playing ? `Pause story from ${s.name}` : `Play story from ${s.name}`} onClick={toggle}>\n              {playing ? (\n                <svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><rect x=\"6\" y=\"5\" width=\"4\" height=\"14\" rx=\"1.2\" fill=\"currentColor\" /><rect x=\"14\" y=\"5\" width=\"4\" height=\"14\" rx=\"1.2\" fill=\"currentColor\" /></svg>\n              ) : (\n                <svg width=\"26\" height=\"26\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M8 5.5v13a1 1 0 001.5.86l10.4-6.5a1 1 0 000-1.72L9.5 4.64A1 1 0 008 5.5z\" fill=\"currentColor\" /></svg>\n              )}\n            </button>\n            <div className=\"hb-wb4-bar\" aria-hidden=\"true\">\n              <span>{fmt(time)}</span>\n              <div className=\"hb-wb4-track\"><div className=\"hb-wb4-fill\" /></div>\n              <span>{fmt(dur)}</span>\n            </div>\n            <p className=\"hb-wb4-sr\">{s.captions.join(\" \")}</p>\n          </div>\n          <ul className=\"hb-wb4-list\" aria-label=\"More stories\">\n            {stories.map((st, i) => (\n              <li key={`${st.name}-${i}`}>\n                <button type=\"button\" className=\"hb-wb4-row\" aria-current={i === index} onClick={() => choose(i)}>\n                  <div className=\"hb-wb4-mini\">\n                    <Portrait s={st} />\n                    <span className=\"hb-wb4-dur\">{fmt(st.duration)}</span>\n                  </div>\n                  <div style={{ minWidth: 0 }}>\n                    <b>{st.name}</b>\n                    <span className=\"hb-wb4-who\">{st.company}</span>\n                    <em>\n                      {i === index && playing && (\n                        <span className=\"hb-wb4-eq\" aria-hidden=\"true\"><i /><i /><i /></span>\n                      )}\n                      {`\"${st.captions[0]}\"`}\n                    </em>\n                  </div>\n                </button>\n              </li>\n            ))}\n          </ul>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}