{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comparison-scorecard",
  "type": "registry:component",
  "title": "Comparison Scorecard",
  "description": "An us versus them scorecard with two overall score rings and a list of benchmark metrics, each with paired bars that grow in and numbers that count up, plus a delta chip per row.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "comparison",
    "benchmark",
    "versus",
    "scorecard",
    "animated bars",
    "count up",
    "competitors"
  ],
  "docs": "https://hyperblur.dev/effects/comparison-scorecard",
  "files": [
    {
      "path": "registry/hyperblur/comparison-scorecard.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/comparison-scorecard.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface ComparisonScorecardSide {\n  name: string;\n  score: number;\n}\n\nexport interface ComparisonScorecardMetric {\n  label: string;\n  detail?: string;\n  us: number;\n  them: number;\n  max: number;\n  unit?: string;\n  lowerIsBetter?: boolean;\n}\n\nexport interface ComparisonScorecardProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  us?: ComparisonScorecardSide;\n  them?: ComparisonScorecardSide;\n  metrics?: ComparisonScorecardMetric[];\n  source?: string;\n  cta?: { label: string; href: string } | null;\n  duration?: number;\n  accent?: string;\n}\n\nconst css = `\n.hb-yh2 {\n  --hb-yh2-accent: #10b981;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  overflow: hidden;\n  padding: clamp(64px, 9cqi, 112px) 20px;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yh2 *, .hb-yh2 *::before, .hb-yh2 *::after { box-sizing: border-box; }\n.hb-yh2-in { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 20px; max-width: 1120px; margin: 0 auto; }\n.hb-yh2-left {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  min-width: 0;\n  padding: 32px;\n  border: 1px solid rgba(255,255,255,.08);\n  border-radius: 22px;\n  background:\n    radial-gradient(80% 60% at 0% 0%, color-mix(in srgb, var(--hb-yh2-accent) 16%, transparent), transparent 70%),\n    linear-gradient(180deg, #121212, #0d0d0d);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);\n  overflow: hidden;\n}\n.hb-yh2-eyebrow { color: color-mix(in srgb, var(--hb-yh2-accent) 70%, #fff); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }\n.hb-yh2-title { margin: 14px 0 0; font-size: clamp(28px, 3.6cqi, 40px); font-weight: 650; letter-spacing: -.035em; line-height: 1.08; }\n.hb-yh2-sub { margin: 14px 0 0; color: #8f8f8f; font-size: 15px; line-height: 1.6; }\n.hb-yh2-rings { display: flex; align-items: center; gap: 22px; margin-top: auto; padding-top: 32px; }\n.hb-yh2-ring { position: relative; flex: none; width: 112px; height: 112px; }\n.hb-yh2-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }\n.hb-yh2-ring circle { fill: none; stroke-width: 8; }\n.hb-yh2-track { stroke: rgba(255,255,255,.07); }\n.hb-yh2-arc { stroke-linecap: round; }\n.hb-yh2-ring[data-us=\"true\"] .hb-yh2-arc { stroke: var(--hb-yh2-accent); filter: drop-shadow(0 0 6px color-mix(in srgb, var(--hb-yh2-accent) 60%, transparent)); }\n.hb-yh2-ring[data-us=\"false\"] { width: 84px; height: 84px; }\n.hb-yh2-ring[data-us=\"false\"] .hb-yh2-arc { stroke: #525252; }\n.hb-yh2-rv { position: absolute; inset: 0; display: grid; place-items: center; align-content: center; text-align: center; }\n.hb-yh2-rn { font-size: 30px; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1; }\n.hb-yh2-ring[data-us=\"false\"] .hb-yh2-rn { color: #a1a1a1; font-size: 22px; }\n.hb-yh2-rl { margin-top: 4px; color: #8f8f8f; font-size: 11px; }\n.hb-yh2-vs { color: #525252; font-size: 12px; font-weight: 600; letter-spacing: .1em; }\n.hb-yh2-cta {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  align-self: flex-start;\n  height: 42px;\n  margin-top: 26px;\n  padding: 0 18px;\n  border-radius: 999px;\n  background: #ededed;\n  color: #0a0a0a;\n  font-size: 14px;\n  font-weight: 600;\n  text-decoration: none;\n  transition: background-color .2s ease, transform .15s ease;\n}\n.hb-yh2-cta:hover { background: #fff; }\n.hb-yh2-cta svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s ease; }\n.hb-yh2-cta:hover svg { transform: translateX(3px); }\n.hb-yh2-right { min-width: 0; padding: 10px 28px; border: 1px solid rgba(255,255,255,.08); border-radius: 22px; background: #0e0e0e; }\n.hb-yh2-legend { display: flex; align-items: center; gap: 18px; padding: 18px 0 14px; border-bottom: 1px solid rgba(255,255,255,.07); color: #8f8f8f; font-size: 12.5px; }\n.hb-yh2-legend span { display: inline-flex; align-items: center; gap: 7px; }\n.hb-yh2-legend i { width: 10px; height: 10px; border-radius: 3px; background: #404040; }\n.hb-yh2-legend span:first-child i { background: var(--hb-yh2-accent); }\n.hb-yh2-legend b { margin-left: auto; color: #6f6f6f; font-weight: 500; }\n.hb-yh2-list { margin: 0; padding: 0; list-style: none; }\n.hb-yh2-m { display: grid; grid-template-columns: minmax(0, 190px) minmax(0, 1fr) auto; align-items: center; gap: 8px 22px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.06); }\n.hb-yh2-m:last-child { border-bottom: 0; }\n.hb-yh2-ml { font-size: 14px; font-weight: 600; }\n.hb-yh2-md { margin-top: 3px; color: #6f6f6f; font-size: 12px; line-height: 1.4; }\n.hb-yh2-bars { display: grid; gap: 6px; min-width: 0; }\n.hb-yh2-bar { display: flex; align-items: center; gap: 10px; min-width: 0; }\n.hb-yh2-track2 { position: relative; flex: 1; height: 8px; border-radius: 99px; background: rgba(255,255,255,.05); overflow: hidden; }\n.hb-yh2-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--hb-yh2-w) * 1%); border-radius: inherit; background: #3f3f3f; transform-origin: left; transform: scaleX(var(--hb-yh2-p, 1)); }\n.hb-yh2-bar[data-us=\"true\"] .hb-yh2-fill { background: linear-gradient(90deg, color-mix(in srgb, var(--hb-yh2-accent) 55%, #0a0a0a), var(--hb-yh2-accent)); box-shadow: 0 0 14px color-mix(in srgb, var(--hb-yh2-accent) 50%, transparent); }\n.hb-yh2-num { position: relative; flex: none; width: 64px; color: #8f8f8f; font-size: 12.5px; font-variant-numeric: tabular-nums; text-align: right; }\n.hb-yh2-bar[data-us=\"true\"] .hb-yh2-num { color: #ededed; font-weight: 600; }\n.hb-yh2-delta {\n  display: inline-flex;\n  align-items: center;\n  height: 24px;\n  padding: 0 9px;\n  border-radius: 999px;\n  background: color-mix(in srgb, var(--hb-yh2-accent) 14%, transparent);\n  color: color-mix(in srgb, var(--hb-yh2-accent) 70%, #fff);\n  font-size: 12px;\n  font-weight: 650;\n  font-variant-numeric: tabular-nums;\n  white-space: nowrap;\n}\n.hb-yh2-src { margin: 0; padding: 14px 0 16px; border-top: 1px solid rgba(255,255,255,.07); color: #5f5f5f; font-size: 11.5px; }\n.hb-yh2 a:focus-visible { outline: 2px solid var(--hb-yh2-accent); outline-offset: 3px; }\n@container (max-width: 860px) {\n  .hb-yh2-in { grid-template-columns: minmax(0, 1fr); }\n  .hb-yh2-rings { padding-top: 26px; }\n}\n@container (max-width: 520px) {\n  .hb-yh2-left { padding: 24px; }\n  .hb-yh2-right { padding: 6px 18px; }\n  .hb-yh2-m { grid-template-columns: minmax(0, 1fr) auto; }\n  .hb-yh2-bars { grid-column: 1 / -1; grid-row: 2; }\n  .hb-yh2-legend b { display: none; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-yh2 *, .hb-yh2 *::before, .hb-yh2 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nconst defaultMetrics: ComparisonScorecardMetric[] = [\n  { label: \"Time to first insight\", detail: \"From signup to a shared dashboard\", us: 4, them: 38, max: 40, unit: \"min\", lowerIsBetter: true },\n  { label: \"Query speed\", detail: \"p95 on a 200M row table\", us: 0.8, them: 6.4, max: 7, unit: \"s\", lowerIsBetter: true },\n  { label: \"Connectors included\", detail: \"Without paid add-ons\", us: 140, them: 35, max: 150 },\n  { label: \"Weekly active rate\", detail: \"Share of seats used each week\", us: 87, them: 41, max: 100, unit: \"%\" },\n  { label: \"Support reply time\", detail: \"Median, business hours\", us: 9, them: 52, max: 60, unit: \"min\", lowerIsBetter: true },\n];\n\nfunction fmt(n: number, unit?: string) {\n  const v = Math.abs(n) >= 10 ? Math.round(n).toString() : n.toFixed(1);\n  if (!unit) return v;\n  return unit === \"%\" ? `${v}%` : `${v} ${unit}`;\n}\n\nfunction ease(t: number) {\n  return 1 - Math.pow(1 - t, 3);\n}\n\nexport function ComparisonScorecard({\n  eyebrow = \"Fieldnote vs the usual stack\",\n  title = \"Same questions, answered nine times faster\",\n  subtitle = \"We ran both tools side by side for 30 days with 212 analysts at 18 companies. These are the medians.\",\n  us = { name: \"Fieldnote\", score: 9.2 },\n  them = { name: \"Legacy BI\", score: 6.1 },\n  metrics = defaultMetrics,\n  source = \"Independent benchmark by Northgate Research, September 2026. Legacy BI is the average of three incumbent tools.\",\n  cta = { label: \"Read the full report\", href: \"#\" },\n  duration = 1400,\n  accent = \"#10b981\",\n  className = \"\",\n  style,\n  ...rest\n}: ComparisonScorecardProps) {\n  const [p, setP] = React.useState(0);\n\n  React.useEffect(() => {\n    if (typeof window === \"undefined\") return;\n    if (window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches) {\n      const id = window.requestAnimationFrame(() => setP(1));\n      return () => window.cancelAnimationFrame(id);\n    }\n    let raf = 0;\n    let start = 0;\n    const tick = (t: number) => {\n      if (!start) start = t;\n      const k = Math.min(1, (t - start) / duration);\n      setP(ease(k));\n      if (k < 1) raf = window.requestAnimationFrame(tick);\n    };\n    const delay = window.setTimeout(() => {\n      raf = window.requestAnimationFrame(tick);\n    }, 250);\n    return () => {\n      window.clearTimeout(delay);\n      window.cancelAnimationFrame(raf);\n    };\n  }, [duration]);\n\n  const R = 44;\n  const C = 2 * Math.PI * R;\n\n  return (\n    <section className={`hb-yh2 ${className}`} style={{ \"--hb-yh2-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-comparison-scorecard\" precedence=\"default\">\n        {css}\n      </style>\n      <div className=\"hb-yh2-in\">\n        <div className=\"hb-yh2-left\">\n          <span className=\"hb-yh2-eyebrow\">{eyebrow}</span>\n          <h2 className=\"hb-yh2-title\">{title}</h2>\n          {subtitle && <p className=\"hb-yh2-sub\">{subtitle}</p>}\n          <div className=\"hb-yh2-rings\" role=\"img\" aria-label={`Overall score: ${us.name} ${us.score} out of 10, ${them.name} ${them.score} out of 10`}>\n            {[us, them].map((side, i) => (\n              <React.Fragment key={side.name}>\n                {i === 1 && <span className=\"hb-yh2-vs\">VS</span>}\n                <div className=\"hb-yh2-ring\" data-us={i === 0 ? \"true\" : \"false\"}>\n                  <svg viewBox=\"0 0 100 100\" aria-hidden=\"true\">\n                    <circle className=\"hb-yh2-track\" cx=\"50\" cy=\"50\" r={R} />\n                    <circle\n                      className=\"hb-yh2-arc\"\n                      cx=\"50\"\n                      cy=\"50\"\n                      r={R}\n                      strokeDasharray={C.toFixed(2)}\n                      strokeDashoffset={(C * (1 - (side.score / 10) * p)).toFixed(2)}\n                    />\n                  </svg>\n                  <div className=\"hb-yh2-rv\" aria-hidden=\"true\">\n                    <span className=\"hb-yh2-rn\">{(side.score * p).toFixed(1)}</span>\n                    <span className=\"hb-yh2-rl\">{side.name}</span>\n                  </div>\n                </div>\n              </React.Fragment>\n            ))}\n          </div>\n          {cta && (\n            <a href={cta.href} className=\"hb-yh2-cta\">\n              {cta.label}\n              <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                <path d=\"M3 8h10M9 4l4 4-4 4\" />\n              </svg>\n            </a>\n          )}\n        </div>\n        <div className=\"hb-yh2-right\">\n          <div className=\"hb-yh2-legend\">\n            <span>\n              <i aria-hidden=\"true\" />\n              {us.name}\n            </span>\n            <span>\n              <i aria-hidden=\"true\" />\n              {them.name}\n            </span>\n            <b>Median of 212 analysts</b>\n          </div>\n          <ul className=\"hb-yh2-list\">\n            {metrics.map((m, i) => {\n              const k = Math.max(0, Math.min(1, (p * (metrics.length + 2) - i) / 3));\n              const better = m.lowerIsBetter ? m.them / Math.max(m.us, 0.0001) : m.us / Math.max(m.them, 0.0001);\n              const delta = m.lowerIsBetter ? `${better.toFixed(better >= 10 ? 0 : 1)}x faster` : `+${Math.round((better - 1) * 100)}%`;\n              return (\n                <li key={m.label} className=\"hb-yh2-m\">\n                  <div>\n                    <div className=\"hb-yh2-ml\">{m.label}</div>\n                    {m.detail && <div className=\"hb-yh2-md\">{m.detail}</div>}\n                  </div>\n                  <div className=\"hb-yh2-bars\">\n                    {[\n                      { us: true, v: m.us },\n                      { us: false, v: m.them },\n                    ].map((b) => (\n                      <div key={b.us ? \"us\" : \"them\"} className=\"hb-yh2-bar\" data-us={b.us ? \"true\" : \"false\"}>\n                        <span className=\"hb-yh2-track2\">\n                          <span\n                            className=\"hb-yh2-fill\"\n                            style={{ \"--hb-yh2-w\": ((b.v / m.max) * 100).toFixed(2), \"--hb-yh2-p\": ease(k).toFixed(4) } as React.CSSProperties}\n                          />\n                        </span>\n                        <span className=\"hb-yh2-num\">\n                          <span aria-hidden=\"true\">{fmt(b.v * ease(k), m.unit)}</span>\n                          <span style={{ position: \"absolute\", width: 1, height: 1, overflow: \"hidden\", clipPath: \"inset(50%)\" }}>\n                            {`${b.us ? us.name : them.name}: ${fmt(b.v, m.unit)}`}\n                          </span>\n                        </span>\n                      </div>\n                    ))}\n                  </div>\n                  <span className=\"hb-yh2-delta\">{delta}</span>\n                </li>\n              );\n            })}\n          </ul>\n          {source && <p className=\"hb-yh2-src\">{source}</p>}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}