{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "faq-scroll-index",
  "type": "registry:component",
  "title": "FAQ Scroll Index",
  "description": "A long-form FAQ with a sticky left column: a rolling 01 / 04 counter and a topic index with a glowing progress rail that follow the group you are reading, a support card, and grouped answers that reveal as they enter view.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "faq",
    "faq",
    "sticky",
    "scroll spy",
    "index",
    "long form",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/faq-scroll-index",
  "files": [
    {
      "path": "registry/hyperblur/faq-scroll-index.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/faq-scroll-index.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface FaqScrollIndexGroup {\n  title: string;\n  items: { question: string; answer: string }[];\n}\n\nexport interface FaqScrollIndexProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  groups?: FaqScrollIndexGroup[];\n  contact?: { label: string; href: string; note?: string };\n  stickyTop?: number;\n  onGroupChange?: (index: number) => void;\n  accent?: string;\n}\n\nconst css = `\n.hb-wc10 {\n  --hb-wc10-accent: #a78bfa;\n  --hb-wc10-top: 24px;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-wc10 *, .hb-wc10 *::before, .hb-wc10 *::after { box-sizing: border-box; }\n.hb-wc10-inner { display: grid; gap: 40px; max-width: 1160px; margin: 0 auto; padding: 72px 20px; }\n.hb-wc10-aside { display: grid; gap: 26px; align-content: start; }\n.hb-wc10-eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 14px; color: #8f8f8f; font-family: var(--font-mono), monospace; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }\n.hb-wc10-eyebrow::before { content: \"\"; width: 18px; height: 1px; background: var(--hb-wc10-accent); }\n.hb-wc10-title { margin: 0; font-family: var(--font-grotesk), var(--font-sans), sans-serif; font-size: clamp(32px, 4.6cqi, 48px); font-weight: 600; line-height: 1.02; letter-spacing: -.04em; text-wrap: balance; }\n.hb-wc10-sub { margin: 14px 0 0; max-width: 380px; color: #8f8f8f; font-size: 15px; line-height: 1.6; }\n.hb-wc10-counter { display: none; align-items: baseline; gap: 10px; font-family: var(--font-grotesk), var(--font-sans), sans-serif; }\n.hb-wc10-num { position: relative; display: inline-block; height: 1em; overflow: hidden; font-size: 64px; font-weight: 600; line-height: 1; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }\n.hb-wc10-num span { display: block; animation: hb-wc10-roll .55s cubic-bezier(.2, .9, .2, 1.1); }\n.hb-wc10-of { color: #5f5f5f; font-size: 18px; font-weight: 500; }\n.hb-wc10-nav { position: relative; display: flex; gap: 6px; margin: 0; padding: 0; list-style: none; overflow-x: auto; scrollbar-width: none; }\n.hb-wc10-nav::-webkit-scrollbar { display: none; }\n.hb-wc10-rail { display: none; }\n.hb-wc10-g { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 999px; background: transparent; color: #8f8f8f; font: inherit; font-size: 13.5px; font-weight: 550; text-align: left; white-space: nowrap; cursor: pointer; transition: color .25s ease, background .25s ease, border-color .25s ease; }\n.hb-wc10-g:hover { color: #ededed; }\n.hb-wc10-g[aria-current=\"true\"] { color: #fff; border-color: color-mix(in srgb, var(--hb-wc10-accent) 55%, transparent); background: color-mix(in srgb, var(--hb-wc10-accent) 12%, transparent); }\n.hb-wc10-g:focus-visible, .hb-wc10-help a:focus-visible { outline: 2px solid var(--hb-wc10-accent); outline-offset: 2px; }\n.hb-wc10-gi { color: #5f5f5f; font-family: var(--font-mono), monospace; font-size: 11.5px; transition: color .25s ease; }\n.hb-wc10-g[aria-current=\"true\"] .hb-wc10-gi { color: var(--hb-wc10-accent); }\n.hb-wc10-gc { margin-left: auto; color: #5f5f5f; font-size: 12px; font-variant-numeric: tabular-nums; }\n.hb-wc10-help { display: none; gap: 12px; padding: 16px; border: 1px solid rgba(255, 255, 255, .08); border-radius: 14px; background: linear-gradient(180deg, #131313, #0f0f0f); }\n.hb-wc10-help p { margin: 0; color: #8f8f8f; font-size: 13.5px; line-height: 1.5; }\n.hb-wc10-help a { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; height: 40px; padding: 0 14px; border-radius: 10px; background: #ededed; color: #0a0a0a; font-size: 14px; font-weight: 600; text-decoration: none; transition: background .2s ease; }\n.hb-wc10-help a:hover { background: #fff; }\n.hb-wc10-help svg { width: 14px; height: 14px; }\n.hb-wc10-faces { display: flex; align-items: center; gap: 10px; color: #ededed; font-size: 13px; font-weight: 550; }\n.hb-wc10-faces span { display: flex; }\n.hb-wc10-faces i { width: 24px; height: 24px; margin-left: -7px; border: 2px solid #121212; border-radius: 50%; font-style: normal; }\n.hb-wc10-faces i:first-child { margin-left: 0; }\n.hb-wc10-main { display: grid; gap: 56px; }\n.hb-wc10-sec { scroll-margin-top: var(--hb-wc10-top); }\n.hb-wc10-sh { display: flex; align-items: baseline; gap: 14px; margin: 0 0 8px; padding-bottom: 16px; border-bottom: 1px solid rgba(255, 255, 255, .08); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }\n.hb-wc10-sh span { color: var(--hb-wc10-accent); font-family: var(--font-mono), monospace; font-size: 13px; font-weight: 500; }\n.hb-wc10-qa { display: grid; gap: 0; margin: 0; }\n.hb-wc10-row { display: grid; gap: 8px; padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); opacity: .45; transform: translateY(8px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .2, 1); }\n.hb-wc10-sec[data-seen=\"true\"] .hb-wc10-row { opacity: 1; transform: none; }\n.hb-wc10-sec[data-seen=\"true\"] .hb-wc10-row:nth-child(2) { transition-delay: .08s; }\n.hb-wc10-sec[data-seen=\"true\"] .hb-wc10-row:nth-child(3) { transition-delay: .16s; }\n.hb-wc10-sec[data-seen=\"true\"] .hb-wc10-row:nth-child(4) { transition-delay: .24s; }\n.hb-wc10-row dt { color: #ededed; font-size: 16px; font-weight: 600; line-height: 1.4; }\n.hb-wc10-row dd { margin: 0; max-width: 620px; color: #9a9a9a; font-size: 14.5px; line-height: 1.7; }\n@keyframes hb-wc10-roll { from { transform: translateY(100%); opacity: 0; } }\n@container (min-width: 820px) {\n  .hb-wc10-inner { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 80px; padding: 112px 40px; }\n  .hb-wc10-aside { position: sticky; top: var(--hb-wc10-top); align-self: start; }\n  .hb-wc10-counter { display: flex; }\n  .hb-wc10-nav { flex-direction: column; gap: 2px; padding-left: 16px; overflow: visible; }\n  .hb-wc10-rail { position: absolute; display: block; left: 0; top: 6px; bottom: 6px; width: 2px; border-radius: 1px; background: rgba(255, 255, 255, .08); }\n  .hb-wc10-rail i { position: absolute; left: 0; top: 0; width: 100%; height: var(--hb-wc10-fill); border-radius: inherit; background: var(--hb-wc10-accent); box-shadow: 0 0 10px var(--hb-wc10-accent); transition: height .5s cubic-bezier(.2, .8, .2, 1); font-style: normal; }\n  .hb-wc10-g { padding: 9px 10px; border-color: transparent; border-radius: 10px; }\n  .hb-wc10-g[aria-current=\"true\"] { border-color: transparent; background: rgba(255, 255, 255, .04); }\n  .hb-wc10-help { display: grid; }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-wc10 *, .hb-wc10 *::before, .hb-wc10 *::after { animation: none !important; transition: none !important; }\n  .hb-wc10-row { opacity: 1; transform: none; }\n}\n`;\n\nconst defaultGroups: FaqScrollIndexGroup[] = [\n  {\n    title: \"Getting started\",\n    items: [\n      { question: \"How long does onboarding take?\", answer: \"Most teams import their first project and invite colleagues in under fifteen minutes. Larger workspaces get a guided session with a specialist in the first week.\" },\n      { question: \"Can I import from my current tool?\", answer: \"Yes. Importers for the four most common project tools bring over tasks, comments, attachments and assignees, and keep the original creation dates.\" },\n      { question: \"Is there a free plan?\", answer: \"The Starter plan is free forever for up to three projects and five members, with no time limit and no card required.\" },\n    ],\n  },\n  {\n    title: \"Plans and billing\",\n    items: [\n      { question: \"What happens when my trial ends?\", answer: \"You drop to Starter automatically. Nothing is deleted, and projects over the limit become read-only until you upgrade or archive them.\" },\n      { question: \"Do you charge for inactive members?\", answer: \"No. Members who have not signed in for 30 days are paused and removed from your next invoice automatically.\" },\n      { question: \"Which payment methods do you accept?\", answer: \"All major cards, SEPA direct debit, and invoices with 30-day terms on yearly Business plans.\" },\n    ],\n  },\n  {\n    title: \"Privacy and security\",\n    items: [\n      { question: \"Who can see my workspace?\", answer: \"Only members you invite. Our support team can access it only after you grant temporary access from Settings, and every session is logged.\" },\n      { question: \"Are you GDPR compliant?\", answer: \"Yes. We sign a data processing agreement on request, store EU workspaces in the EU and list every subprocessor publicly.\" },\n    ],\n  },\n  {\n    title: \"Support\",\n    items: [\n      { question: \"How fast do you reply?\", answer: \"The median first reply is 41 minutes on weekdays. Business plans include a named contact and a four-hour response guarantee.\" },\n      { question: \"Do you offer training?\", answer: \"Live training sessions run every Tuesday and Thursday, and recordings are in the help center.\" },\n    ],\n  },\n];\n\nconst faces = [\"#a78bfa\", \"#f472b6\", \"#38bdf8\"];\n\nexport function FaqScrollIndex({\n  eyebrow = \"FAQ\",\n  title = \"Everything you wanted to ask.\",\n  subtitle = \"Grouped by topic. The index follows along as you read, so you always know where you are.\",\n  groups = defaultGroups,\n  contact = { label: \"Chat with the team\", href: \"#\", note: \"Cannot find your answer? We usually reply within the hour.\" },\n  stickyTop = 24,\n  onGroupChange,\n  accent = \"#a78bfa\",\n  className = \"\",\n  style,\n  ...rest\n}: FaqScrollIndexProps) {\n  const [current, setCurrent] = React.useState(0);\n  const [seen, setSeen] = React.useState<boolean[]>(() => groups.map((_, i) => i === 0));\n  const sections = React.useRef<(HTMLElement | null)[]>([]);\n  const changeRef = React.useRef(onGroupChange);\n  const lastRef = React.useRef(0);\n  const id = React.useId();\n\n  React.useEffect(() => {\n    changeRef.current = onGroupChange;\n  }, [onGroupChange]);\n\n  React.useEffect(() => {\n    if (typeof IntersectionObserver === \"undefined\") return;\n    const visible = new Map<number, number>();\n    const io = new IntersectionObserver(\n      (entries) => {\n        entries.forEach((e) => {\n          const i = Number((e.target as HTMLElement).dataset.index);\n          if (e.isIntersecting) {\n            visible.set(i, e.intersectionRatio);\n            setSeen((s) => (s[i] ? s : s.map((v, k) => (k === i ? true : v))));\n          } else {\n            visible.delete(i);\n          }\n        });\n        if (visible.size) {\n          const first = Math.min(...Array.from(visible.keys()));\n          if (lastRef.current !== first) {\n            lastRef.current = first;\n            setCurrent(first);\n            changeRef.current?.(first);\n          }\n        }\n      },\n      { rootMargin: \"-20% 0px -55% 0px\", threshold: [0, 0.25, 0.5] },\n    );\n    sections.current.forEach((s) => s && io.observe(s));\n    return () => io.disconnect();\n  }, [groups.length]);\n\n  const jump = (i: number) => {\n    const el = sections.current[i];\n    if (!el) return;\n    const reduced = window.matchMedia(\"(prefers-reduced-motion: reduce)\").matches;\n    el.scrollIntoView({ behavior: reduced ? \"auto\" : \"smooth\", block: \"start\" });\n    lastRef.current = i;\n    setCurrent(i);\n    onGroupChange?.(i);\n  };\n\n  const fill = groups.length > 1 ? ((current + 0.5) / groups.length) * 100 : 100;\n  const vars = { \"--hb-wc10-accent\": accent, \"--hb-wc10-top\": `${stickyTop}px`, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-wc10 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-faq-scroll-index\" precedence=\"default\">{css}</style>\n      <div className=\"hb-wc10-inner\">\n        <aside className=\"hb-wc10-aside\">\n          <div>\n            {eyebrow ? <p className=\"hb-wc10-eyebrow\">{eyebrow}</p> : null}\n            <h2 className=\"hb-wc10-title\">{title}</h2>\n            {subtitle ? <p className=\"hb-wc10-sub\">{subtitle}</p> : null}\n          </div>\n          <div className=\"hb-wc10-counter\" aria-hidden=\"true\">\n            <span className=\"hb-wc10-num\">\n              <span key={current}>{String(current + 1).padStart(2, \"0\")}</span>\n            </span>\n            <span className=\"hb-wc10-of\">/ {String(groups.length).padStart(2, \"0\")}</span>\n          </div>\n          <nav aria-label=\"FAQ topics\">\n            <ul className=\"hb-wc10-nav\">\n              <li className=\"hb-wc10-rail\" aria-hidden=\"true\">\n                <i style={{ \"--hb-wc10-fill\": `${fill.toFixed(1)}%` } as React.CSSProperties} />\n              </li>\n              {groups.map((g, i) => (\n                <li key={g.title}>\n                  <button type=\"button\" className=\"hb-wc10-g\" aria-current={current === i ? \"true\" : undefined} aria-controls={`${id}-s${i}`} onClick={() => jump(i)}>\n                    <span className=\"hb-wc10-gi\">{String(i + 1).padStart(2, \"0\")}</span>\n                    {g.title}\n                    <span className=\"hb-wc10-gc\">{g.items.length}</span>\n                  </button>\n                </li>\n              ))}\n            </ul>\n          </nav>\n          {contact ? (\n            <div className=\"hb-wc10-help\">\n              <div className=\"hb-wc10-faces\">\n                <span aria-hidden=\"true\">\n                  {faces.map((f, i) => (\n                    <i key={f} style={{ background: `linear-gradient(135deg, ${f}, #222)`, zIndex: 3 - i }} />\n                  ))}\n                </span>\n                Support is online\n              </div>\n              {contact.note ? <p>{contact.note}</p> : null}\n              <a href={contact.href}>\n                {contact.label}\n                <svg viewBox=\"0 0 14 14\" aria-hidden=\"true\">\n                  <path d=\"M2.5 7h8.5M7.5 3.5L11 7l-3.5 3.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                </svg>\n              </a>\n            </div>\n          ) : null}\n        </aside>\n        <div className=\"hb-wc10-main\">\n          {groups.map((g, i) => (\n            <section\n              key={g.title}\n              id={`${id}-s${i}`}\n              ref={(el) => {\n                sections.current[i] = el;\n              }}\n              className=\"hb-wc10-sec\"\n              data-index={i}\n              data-seen={seen[i] ? \"true\" : \"false\"}\n              aria-labelledby={`${id}-h${i}`}\n            >\n              <h3 className=\"hb-wc10-sh\" id={`${id}-h${i}`}>\n                <span>{String(i + 1).padStart(2, \"0\")}</span>\n                {g.title}\n              </h3>\n              <dl className=\"hb-wc10-qa\">\n                {g.items.map((it) => (\n                  <div key={it.question} className=\"hb-wc10-row\">\n                    <dt>{it.question}</dt>\n                    <dd>{it.answer}</dd>\n                  </div>\n                ))}\n              </dl>\n            </section>\n          ))}\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}