{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "stats-odometer",
  "type": "registry:component",
  "title": "Stats Odometer",
  "description": "A light instrument panel of mechanical counters. When the section scrolls into view each digit drum spins into place, the ones place turning longest, inside shaded wheels like a real odometer.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "stats",
    "stats",
    "odometer",
    "counter",
    "rolling digits",
    "light",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/stats-odometer",
  "files": [
    {
      "path": "registry/hyperblur/stats-odometer.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/stats-odometer.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface OdometerStat {\n  value: string;\n  label: string;\n  note?: string;\n  unit?: string;\n}\n\nexport interface StatsOdometerProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  stats?: OdometerStat[];\n  duration?: number;\n  accent?: string;\n}\n\nconst css = `\n.hb-wb6 {\n  --hb-wb6-accent: #d9480f;\n  --hb-wb6-fs: clamp(36px, 5.4cqw, 60px);\n  box-sizing: border-box;\n  position: relative;\n  width: 100%;\n  container-type: inline-size;\n  background: #f7f5ef;\n  color: #161512;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-wb6 *, .hb-wb6 *::before, .hb-wb6 *::after { box-sizing: border-box; }\n.hb-wb6::before {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background-image: linear-gradient(rgba(22, 21, 18, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(22, 21, 18, .05) 1px, transparent 1px);\n  background-size: 32px 32px;\n  -webkit-mask: radial-gradient(80% 70% at 50% 30%, #000, transparent 80%);\n  mask: radial-gradient(80% 70% at 50% 30%, #000, transparent 80%);\n  pointer-events: none;\n}\n.hb-wb6-wrap { position: relative; max-width: 1120px; margin: 0 auto; padding: 72px 24px 88px; }\n.hb-wb6-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 48px; align-items: end; margin-bottom: 36px; }\n.hb-wb6-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: #6d6a62; font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; font-family: var(--font-mono, ui-monospace, monospace); }\n.hb-wb6-eyebrow i { width: 7px; height: 7px; border-radius: 2px; background: var(--hb-wb6-accent); }\n.hb-wb6-title { margin: 0; font-size: clamp(28px, 4.2cqw, 46px); font-weight: 600; line-height: 1.02; letter-spacing: -.04em; text-wrap: balance; }\n.hb-wb6-sub { margin: 0; color: #6d6a62; font-size: 15px; line-height: 1.6; }\n.hb-wb6-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }\n.hb-wb6-mod {\n  position: relative;\n  min-width: 0;\n  padding: 22px 24px 20px;\n  border: 1px solid rgba(22, 21, 18, .1);\n  border-radius: 18px;\n  background: linear-gradient(180deg, #fffdf8, #f1eee5);\n  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(40, 30, 10, .06), 0 20px 40px -28px rgba(40, 30, 10, .35);\n}\n.hb-wb6-mod::before, .hb-wb6-mod::after {\n  content: \"\";\n  position: absolute;\n  top: 12px;\n  width: 6px;\n  height: 6px;\n  border-radius: 50%;\n  background: radial-gradient(circle at 35% 35%, #fff, #b9b4a7);\n  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);\n}\n.hb-wb6-mod::before { left: 12px; }\n.hb-wb6-mod::after { right: 12px; }\n.hb-wb6-plate { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 0 14px; padding: 0 10px; color: #8a867c; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-family: var(--font-mono, ui-monospace, monospace); }\n.hb-wb6-plate span:last-child { color: var(--hb-wb6-accent); }\n.hb-wb6-meter {\n  display: flex;\n  align-items: stretch;\n  gap: 4px;\n  width: max-content;\n  max-width: 100%;\n  padding: 8px;\n  border-radius: 12px;\n  background: #1a1916;\n  box-shadow: inset 0 2px 6px rgba(0, 0, 0, .6), 0 1px 0 #fff;\n  font-size: var(--hb-wb6-fs);\n  font-family: var(--font-mono, ui-monospace, monospace);\n  font-weight: 500;\n  line-height: 1;\n  font-variant-numeric: tabular-nums;\n}\n.hb-wb6-cell {\n  position: relative;\n  width: .78em;\n  height: 1.24em;\n  overflow: hidden;\n  border-radius: 6px;\n  background: linear-gradient(180deg, #2a2823, #f4f1e8 22%, #fffdf7 50%, #f4f1e8 78%, #2a2823);\n  color: #161512;\n}\n.hb-wb6-cell::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(180deg, rgba(0, 0, 0, .55), transparent 28%, transparent 72%, rgba(0, 0, 0, .55));\n  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .25);\n  border-radius: inherit;\n  pointer-events: none;\n}\n.hb-wb6-cell::before { content: \"\"; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: rgba(0, 0, 0, .08); z-index: 1; }\n.hb-wb6-strip {\n  display: flex;\n  flex-direction: column;\n  transform: translateY(0);\n  transition: transform var(--hb-wb6-t) cubic-bezier(.16, .84, .3, 1);\n  transition-delay: var(--hb-wb6-dl);\n}\n.hb-wb6-strip span { display: grid; place-items: center; height: 1.24em; }\n.hb-wb6[data-on=\"true\"] .hb-wb6-strip { transform: translateY(calc(var(--hb-wb6-idx) * -1.24em)); }\n.hb-wb6-sep { display: grid; place-items: end center; width: .34em; padding-bottom: .16em; color: #f4f1e8; font-size: .7em; }\n.hb-wb6-sep[data-wide] { width: auto; padding: 0 .12em .16em; place-items: end start; color: var(--hb-wb6-accent); font-size: .5em; }\n.hb-wb6-foot { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 16px; padding: 0 2px; }\n.hb-wb6-label { margin: 0; font-size: 15px; font-weight: 600; letter-spacing: -.01em; }\n.hb-wb6-note { color: #6d6a62; font-size: 12.5px; font-family: var(--font-mono, ui-monospace, monospace); white-space: nowrap; }\n.hb-wb6-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n@container (max-width: 720px) {\n  .hb-wb6-head { grid-template-columns: minmax(0, 1fr); }\n  .hb-wb6-grid { grid-template-columns: minmax(0, 1fr); }\n  .hb-wb6 { --hb-wb6-fs: clamp(30px, 9cqw, 54px); }\n}\n@container (max-width: 420px) {\n  .hb-wb6-wrap { padding: 56px 16px 64px; }\n  .hb-wb6-mod { padding: 20px 14px 16px; }\n  .hb-wb6-meter { gap: 3px; padding: 6px; }\n  .hb-wb6-foot { flex-direction: column; gap: 4px; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wb6-strip { transition: none; transform: translateY(calc(var(--hb-wb6-idx) * -1.24em)); }\n}\n`;\n\nconst defaultStats: OdometerStat[] = [\n  { value: \"2,481,906\", label: \"Parcels routed this year\", note: \"+18% vs 2025\" },\n  { value: \"99.982\", unit: \"%\", label: \"On-time handoffs\", note: \"rolling 90 days\" },\n  { value: \"14,320\", label: \"Drivers on the network\", note: \"in 212 cities\" },\n  { value: \"38\", unit: \"min\", label: \"Median door-to-door\", note: \"down from 61\" },\n];\n\nconst ROUNDS = 3;\n\nexport function StatsOdometer({\n  eyebrow = \"Network counter\",\n  title = \"The numbers behind every delivery window\",\n  subtitle = \"Measured live from our dispatch ledger, not estimated. The counters reset each January and roll forward with every scan.\",\n  stats = defaultStats,\n  duration = 2400,\n  accent = \"#d9480f\",\n  className = \"\",\n  style,\n  ...rest\n}: StatsOdometerProps) {\n  const uid = React.useId();\n  const ref = React.useRef<HTMLElement>(null);\n  const [on, setOn] = React.useState(false);\n\n  React.useEffect(() => {\n    const el = ref.current;\n    if (!el) return;\n    if (typeof IntersectionObserver === \"undefined\") {\n      const raf = requestAnimationFrame(() => setOn(true));\n      return () => cancelAnimationFrame(raf);\n    }\n    const io = new IntersectionObserver(\n      (entries) => {\n        if (entries.some((e) => e.isIntersecting)) {\n          setOn(true);\n          io.disconnect();\n        }\n      },\n      { threshold: 0.25 },\n    );\n    io.observe(el);\n    return () => io.disconnect();\n  }, []);\n\n  const strip = Array.from({ length: ROUNDS * 10 }, (_, i) => i % 10);\n  const vars = { \"--hb-wb6-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section ref={ref} className={`hb-wb6 ${className}`} style={vars} data-on={on} aria-labelledby={`${uid}-t`} {...rest}>\n      <style href=\"hb-stats-odometer\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wb6-wrap\">\n        <div className=\"hb-wb6-head\">\n          <div>\n            <p className=\"hb-wb6-eyebrow\"><i aria-hidden=\"true\" />{eyebrow}</p>\n            <h2 id={`${uid}-t`} className=\"hb-wb6-title\">{title}</h2>\n          </div>\n          {subtitle && <p className=\"hb-wb6-sub\">{subtitle}</p>}\n        </div>\n        <ul className=\"hb-wb6-grid\">\n          {stats.map((s, si) => {\n            const chars = s.value.split(\"\");\n            const digitCount = chars.filter((c) => c >= \"0\" && c <= \"9\").length;\n            let place = digitCount;\n            return (\n              <li key={`${s.label}-${si}`} className=\"hb-wb6-mod\">\n                <p className=\"hb-wb6-plate\" aria-hidden=\"true\">\n                  <span>{`Unit ${String(si + 1).padStart(2, \"0\")}`}</span>\n                  <span>Live</span>\n                </p>\n                <span className=\"hb-wb6-sr\">{`${s.value}${s.unit ? ` ${s.unit}` : \"\"}`}</span>\n                <div className=\"hb-wb6-meter\" aria-hidden=\"true\">\n                  {chars.map((c, ci) => {\n                    if (c >= \"0\" && c <= \"9\") {\n                      place -= 1;\n                      const d = Number(c);\n                      const fromRight = place;\n                      const spins = Math.max(0, ROUNDS - 1 - Math.min(fromRight, ROUNDS - 1));\n                      const idx = spins * 10 + d;\n                      const t = Math.round(duration * (0.55 + 0.45 * (1 - fromRight / Math.max(digitCount, 1))));\n                      const dl = Math.round(si * 140 + fromRight * 40);\n                      return (\n                        <span key={ci} className=\"hb-wb6-cell\">\n                          <span\n                            className=\"hb-wb6-strip\"\n                            style={{ \"--hb-wb6-idx\": idx, \"--hb-wb6-t\": `${t}ms`, \"--hb-wb6-dl\": `${dl}ms` } as React.CSSProperties}\n                          >\n                            {strip.map((v, k) => <span key={k}>{v}</span>)}\n                          </span>\n                        </span>\n                      );\n                    }\n                    return <span key={ci} className=\"hb-wb6-sep\">{c}</span>;\n                  })}\n                  {s.unit && <span className=\"hb-wb6-sep\" data-wide=\"\">{s.unit}</span>}\n                </div>\n                <div className=\"hb-wb6-foot\">\n                  <h3 className=\"hb-wb6-label\">{s.label}</h3>\n                  {s.note && <span className=\"hb-wb6-note\">{s.note}</span>}\n                </div>\n              </li>\n            );\n          })}\n        </ul>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}