{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "about-timeline-scroll",
  "type": "registry:component",
  "title": "About Timeline Scroll",
  "description": "A light, horizontal company timeline with snap scrolling. A year rail above fills as you scroll, the active year lights up, and arrow buttons, year markers and the keyboard all move between milestones.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "about",
    "about",
    "timeline",
    "horizontal scroll",
    "scroll snap",
    "history",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/about-timeline-scroll",
  "files": [
    {
      "path": "registry/hyperblur/about-timeline-scroll.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/about-timeline-scroll.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface AboutTimelineMilestone {\n  year: string;\n  title: string;\n  text: string;\n  stat?: string;\n  statLabel?: string;\n}\n\nexport interface AboutTimelineScrollProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  milestones?: AboutTimelineMilestone[];\n  onMilestoneChange?: (index: number) => void;\n  accent?: string;\n}\n\nconst defaultMilestones: AboutTimelineMilestone[] = [\n  { year: \"2017\", title: \"A spreadsheet that refused to die\", text: \"Three freight planners in Rotterdam share one Excel file for routing. We build a tiny web app so they can stop emailing it around.\", stat: \"3\", statLabel: \"first users\" },\n  { year: \"2018\", title: \"Seed round and a real office\", text: \"Harbour Ventures leads a 2.4 million seed. We move into a former bicycle shop near the Maas and hire our first designer.\", stat: \"$2.4M\", statLabel: \"seed\" },\n  { year: \"2019\", title: \"Live tracking ships\", text: \"Vessel positions update every ten seconds. Customers start opening Tideline before their email in the morning.\", stat: \"140\", statLabel: \"carriers\" },\n  { year: \"2021\", title: \"The remote year\", text: \"The office closes, the team triples, and we write the handbook that still guides how we work across nine countries.\", stat: \"62\", statLabel: \"people\" },\n  { year: \"2023\", title: \"Series B and the API\", text: \"A 38 million round funds the public API. Two thousand developers build on it in the first quarter.\", stat: \"2,100\", statLabel: \"API teams\" },\n  { year: \"2025\", title: \"One in six containers\", text: \"Tideline now plans routes for one in six containers that cross the North Sea, and we are just getting started.\", stat: \"17%\", statLabel: \"North Sea volume\" },\n];\n\nconst css = `\n@keyframes hb-yg2-rise {\n  from { opacity: 0; transform: translateY(18px); }\n  to { opacity: 1; transform: none; }\n}\n.hb-yg2 {\n  --hb-yg2-accent: #ff6b4a;\n  --hb-yg2-ink: #1b1a17;\n  --hb-yg2-muted: #6d6a62;\n  --hb-yg2-p: 0;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  container-type: inline-size;\n  background: #f7f5ef;\n  color: var(--hb-yg2-ink);\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-yg2 *, .hb-yg2 *::before, .hb-yg2 *::after { box-sizing: border-box; }\n.hb-yg2-in {\n  position: relative;\n  max-width: 1120px;\n  margin: 0 auto;\n  padding: 88px 24px 72px;\n}\n.hb-yg2-top {\n  display: flex;\n  flex-wrap: wrap;\n  align-items: flex-end;\n  justify-content: space-between;\n  gap: 24px;\n}\n.hb-yg2-eyebrow {\n  color: var(--hb-yg2-accent);\n  font-size: 13px;\n  font-weight: 600;\n  letter-spacing: 0.08em;\n  text-transform: uppercase;\n}\n.hb-yg2-title {\n  max-width: 640px;\n  margin: 12px 0 0;\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  font-size: clamp(36px, 5.6cqw, 60px);\n  font-weight: 400;\n  line-height: 1;\n  letter-spacing: -0.02em;\n  text-wrap: balance;\n}\n.hb-yg2-sub {\n  max-width: 460px;\n  margin: 16px 0 0;\n  color: var(--hb-yg2-muted);\n  font-size: 16px;\n  line-height: 1.6;\n}\n.hb-yg2-nav { display: flex; gap: 8px; }\n.hb-yg2-arrow {\n  display: grid;\n  place-items: center;\n  width: 44px;\n  height: 44px;\n  border: 1px solid rgba(27, 26, 23, 0.14);\n  border-radius: 50%;\n  background: #fff;\n  color: var(--hb-yg2-ink);\n  cursor: pointer;\n  transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;\n}\n.hb-yg2-arrow:hover:not(:disabled) { background: var(--hb-yg2-ink); color: #f7f5ef; }\n.hb-yg2-arrow:active:not(:disabled) { transform: scale(0.94); }\n.hb-yg2-arrow:disabled { opacity: 0.35; cursor: default; }\n.hb-yg2-arrow:focus-visible { outline: 2px solid var(--hb-yg2-accent); outline-offset: 2px; }\n.hb-yg2-rail {\n  position: relative;\n  display: flex;\n  justify-content: space-between;\n  margin-top: 48px;\n  padding-top: 18px;\n}\n.hb-yg2-rail::before, .hb-yg2-rail::after {\n  content: \"\";\n  position: absolute;\n  top: 0;\n  left: 0;\n  height: 2px;\n  border-radius: 2px;\n}\n.hb-yg2-rail::before { right: 0; background: rgba(27, 26, 23, 0.1); }\n.hb-yg2-rail::after {\n  width: 100%;\n  background: var(--hb-yg2-accent);\n  transform-origin: left;\n  transform: scaleX(var(--hb-yg2-p));\n  transition: transform 0.12s linear;\n}\n.hb-yg2-year {\n  position: relative;\n  padding: 0;\n  border: 0;\n  background: none;\n  color: var(--hb-yg2-muted);\n  font: inherit;\n  font-size: 13px;\n  font-weight: 600;\n  font-variant-numeric: tabular-nums;\n  cursor: pointer;\n  transition: color 0.2s ease;\n}\n.hb-yg2-year::before {\n  content: \"\";\n  position: absolute;\n  top: -23px;\n  left: 50%;\n  width: 10px;\n  height: 10px;\n  margin-left: -5px;\n  border: 2px solid #f7f5ef;\n  border-radius: 50%;\n  background: rgba(27, 26, 23, 0.25);\n  transition: background 0.2s ease, transform 0.2s ease;\n}\n.hb-yg2-year[aria-current=\"true\"] { color: var(--hb-yg2-ink); }\n.hb-yg2-year[aria-current=\"true\"]::before { background: var(--hb-yg2-accent); transform: scale(1.4); }\n.hb-yg2-year:focus-visible { outline: 2px solid var(--hb-yg2-accent); outline-offset: 4px; border-radius: 4px; }\n.hb-yg2-track {\n  display: flex;\n  gap: 16px;\n  margin: 28px -24px 0;\n  padding: 4px 24px 24px;\n  overflow-x: auto;\n  scroll-snap-type: x mandatory;\n  scroll-padding: 0 24px;\n  scrollbar-width: none;\n  outline: none;\n}\n.hb-yg2-track::-webkit-scrollbar { display: none; }\n.hb-yg2-track:focus-visible { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--hb-yg2-accent) 50%, transparent); border-radius: 12px; }\n.hb-yg2-card {\n  position: relative;\n  flex: 0 0 min(82%, 330px);\n  display: flex;\n  flex-direction: column;\n  min-height: 300px;\n  padding: 26px;\n  border: 1px solid rgba(27, 26, 23, 0.1);\n  border-radius: 20px;\n  background: #fff;\n  box-shadow: 0 1px 2px rgba(27, 26, 23, 0.04);\n  scroll-snap-align: start;\n  animation: hb-yg2-rise 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;\n  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;\n}\n.hb-yg2-card[data-active=\"true\"] {\n  border-color: color-mix(in srgb, var(--hb-yg2-accent) 40%, transparent);\n  box-shadow: 0 24px 50px -28px color-mix(in srgb, var(--hb-yg2-accent) 60%, rgba(27, 26, 23, 0.4));\n  transform: translateY(-4px);\n}\n.hb-yg2-big {\n  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);\n  font-size: 64px;\n  line-height: 0.9;\n  letter-spacing: -0.03em;\n  color: transparent;\n  -webkit-text-stroke: 1px rgba(27, 26, 23, 0.35);\n  transition: color 0.35s ease, -webkit-text-stroke-color 0.35s ease;\n}\n.hb-yg2-card[data-active=\"true\"] .hb-yg2-big { color: var(--hb-yg2-accent); -webkit-text-stroke-color: transparent; }\n.hb-yg2-card h3 {\n  margin: 22px 0 0;\n  font-size: 19px;\n  font-weight: 600;\n  line-height: 1.25;\n  letter-spacing: -0.015em;\n}\n.hb-yg2-card p {\n  margin: 10px 0 0;\n  color: var(--hb-yg2-muted);\n  font-size: 14.5px;\n  line-height: 1.6;\n}\n.hb-yg2-stat {\n  display: flex;\n  align-items: baseline;\n  gap: 8px;\n  margin-top: auto;\n  padding-top: 20px;\n  border-top: 1px dashed rgba(27, 26, 23, 0.14);\n}\n.hb-yg2-stat strong { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }\n.hb-yg2-stat span { color: var(--hb-yg2-muted); font-size: 13px; }\n.hb-yg2-spacer { flex: 0 0 1px; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-yg2-card { animation: none; }\n  .hb-yg2-card, .hb-yg2-big, .hb-yg2-rail::after, .hb-yg2-year::before, .hb-yg2-arrow { transition: none; }\n  .hb-yg2-track { scroll-behavior: auto; }\n}\n`;\n\nexport function AboutTimelineScroll({\n  eyebrow = \"Our story\",\n  title = \"From one shared spreadsheet to the North Sea\",\n  subtitle = \"Eight years of Tideline, one milestone at a time. Drag, scroll or use the arrows.\",\n  milestones = defaultMilestones,\n  onMilestoneChange,\n  accent = \"#ff6b4a\",\n  className = \"\",\n  style,\n  ...rest\n}: AboutTimelineScrollProps) {\n  const rootRef = React.useRef<HTMLElement>(null);\n  const trackRef = React.useRef<HTMLDivElement>(null);\n  const cardRefs = React.useRef<(HTMLElement | null)[]>([]);\n  const [active, setActive] = React.useState(0);\n  const [edges, setEdges] = React.useState({ start: true, end: false });\n  const activeRef = React.useRef(0);\n\n  const sync = React.useCallback(() => {\n    const track = trackRef.current;\n    const root = rootRef.current;\n    if (!track || !root) return;\n    const max = track.scrollWidth - track.clientWidth;\n    const p = max > 0 ? track.scrollLeft / max : 1;\n    root.style.setProperty(\"--hb-yg2-p\", p.toFixed(3));\n    const left = track.getBoundingClientRect().left;\n    let best = 0;\n    let bestDist = Infinity;\n    cardRefs.current.forEach((el, i) => {\n      if (!el) return;\n      const d = Math.abs(el.getBoundingClientRect().left - left - 24);\n      if (d < bestDist) { bestDist = d; best = i; }\n    });\n    if (p > 0.995) best = milestones.length - 1;\n    if (best !== activeRef.current) {\n      activeRef.current = best;\n      setActive(best);\n      onMilestoneChange?.(best);\n    }\n    setEdges((prev) => {\n      const next = { start: track.scrollLeft < 4, end: track.scrollLeft > max - 4 };\n      return prev.start === next.start && prev.end === next.end ? prev : next;\n    });\n  }, [milestones.length, onMilestoneChange]);\n\n  React.useEffect(() => {\n    const track = trackRef.current;\n    if (!track) return;\n    const frame = requestAnimationFrame(sync);\n    const ro = new ResizeObserver(() => sync());\n    ro.observe(track);\n    return () => {\n      cancelAnimationFrame(frame);\n      ro.disconnect();\n    };\n  }, [sync]);\n\n  const goTo = (i: number) => {\n    const track = trackRef.current;\n    const el = cardRefs.current[i];\n    if (!track || !el) return;\n    const reduce = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    track.scrollTo({ left: el.offsetLeft - 24, behavior: reduce ? \"auto\" : \"smooth\" });\n  };\n\n  const onKey = (e: React.KeyboardEvent) => {\n    if (e.key === \"ArrowRight\") { e.preventDefault(); goTo(Math.min(active + 1, milestones.length - 1)); }\n    if (e.key === \"ArrowLeft\") { e.preventDefault(); goTo(Math.max(active - 1, 0)); }\n    if (e.key === \"Home\") { e.preventDefault(); goTo(0); }\n    if (e.key === \"End\") { e.preventDefault(); goTo(milestones.length - 1); }\n  };\n\n  return (\n    <section ref={rootRef} className={`hb-yg2 ${className}`} style={{ \"--hb-yg2-accent\": accent, ...style } as React.CSSProperties} {...rest}>\n      <style href=\"hb-about-timeline-scroll\" precedence=\"default\">{css}</style>\n      <div className=\"hb-yg2-in\">\n        <div className=\"hb-yg2-top\">\n          <div>\n            <span className=\"hb-yg2-eyebrow\">{eyebrow}</span>\n            <h2 className=\"hb-yg2-title\">{title}</h2>\n            <p className=\"hb-yg2-sub\">{subtitle}</p>\n          </div>\n          <div className=\"hb-yg2-nav\">\n            <button type=\"button\" className=\"hb-yg2-arrow\" aria-label=\"Previous milestone\" disabled={edges.start} onClick={() => goTo(Math.max(active - 1, 0))}>\n              <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M15 6l-6 6 6 6\" /></svg>\n            </button>\n            <button type=\"button\" className=\"hb-yg2-arrow\" aria-label=\"Next milestone\" disabled={edges.end} onClick={() => goTo(Math.min(active + 1, milestones.length - 1))}>\n              <svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" aria-hidden=\"true\"><path d=\"M9 6l6 6-6 6\" /></svg>\n            </button>\n          </div>\n        </div>\n        <div className=\"hb-yg2-rail\">\n          {milestones.map((m, i) => (\n            <button key={m.year + i} type=\"button\" className=\"hb-yg2-year\" aria-current={i === active} onClick={() => goTo(i)}>\n              {m.year}\n            </button>\n          ))}\n        </div>\n        <div\n          ref={trackRef}\n          className=\"hb-yg2-track\"\n          tabIndex={0}\n          role=\"region\"\n          aria-label=\"Company timeline\"\n          onScroll={sync}\n          onKeyDown={onKey}\n        >\n          {milestones.map((m, i) => (\n            <article\n              key={m.year + i}\n              ref={(el) => { cardRefs.current[i] = el; }}\n              className=\"hb-yg2-card\"\n              data-active={i === active}\n              style={{ animationDelay: `${(i * 0.08).toFixed(2)}s` }}\n            >\n              <span className=\"hb-yg2-big\" aria-hidden=\"true\">{m.year}</span>\n              <h3>{m.title}</h3>\n              <p>{m.text}</p>\n              {m.stat && (\n                <div className=\"hb-yg2-stat\">\n                  <strong>{m.stat}</strong>\n                  <span>{m.statLabel}</span>\n                </div>\n              )}\n            </article>\n          ))}\n          <span className=\"hb-yg2-spacer\" aria-hidden=\"true\" />\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}