{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "marketing-hero-product",
  "title": "Marketing hero with product shot",
  "description": "Marketing hero with product shot is a production-ready blocks component from BJORK UI, packaged for shadcn registries.",
  "dependencies": [
    "clsx",
    "framer-motion",
    "lucide-react",
    "next-themes",
    "tailwind-merge"
  ],
  "files": [
    {
      "path": "components/bjork-ui/blocks/marketing-hero-product.tsx",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useId, useRef, useState, type ReactNode } from \"react\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport { ArrowRight, Menu, X } from \"lucide-react\";\nimport { AgentTrace, type AgentStep } from \"@/components/bjork-ui/ai/agent-trace\";\nimport {\n  blockFrame,\n  blockToneProps,\n  CtaLink,\n  focusRing,\n  SampleMark,\n  useBlockReducedMotion,\n  type BlockLink,\n  type BlockTone,\n} from \"@/components/bjork-ui/blocks/marketing-kit\";\nimport { cn } from \"@/lib/utils\";\n\nexport type HeroRunStatus = \"ok\" | \"slow\" | \"failed\" | \"live\";\n\nexport interface HeroRun {\n  id: string;\n  label: string;\n  /** Short text on the right, such as \"9.9s\". */\n  meta: string;\n  status: HeroRunStatus;\n}\n\nexport interface HeroScriptStep {\n  id: string;\n  kind: string;\n  label: string;\n  /** How long the step runs before it finishes. */\n  seconds: number;\n  detail?: string;\n  /** Finish this step as failed. */\n  fails?: boolean;\n}\n\nexport interface HeroMetric {\n  label: string;\n  value: string;\n  /** Change against the previous period, such as \"-18%\". */\n  delta?: string;\n  /** Whether the delta is good news. Colours it green or red. */\n  deltaTone?: \"good\" | \"bad\";\n}\n\nexport interface HeroProductShot {\n  /** Breadcrumb in the window title bar. */\n  path: string[];\n  runs: HeroRun[];\n  /** Index of the selected run in `runs`. */\n  activeRun?: number;\n  metrics: HeroMetric[];\n  /** Points for the latency sparkline, any scale. */\n  spark?: number[];\n  /** Fixed steps for the trace. Wins over `script`. */\n  steps?: AgentStep[];\n  /** A run that plays through on a loop. Without `steps` or `script` the trace plays its own demo. */\n  script?: HeroScriptStep[];\n  traceTitle?: string;\n  /** Frozen clock for screenshots. */\n  now?: number;\n}\n\nexport interface MarketingHeroProductProps {\n  brand?: { name: string; href: string; logo?: ReactNode };\n  /** Header links. Pass an empty array to hide the header. */\n  nav?: BlockLink[];\n  signIn?: BlockLink;\n  /** Small button at the right of the header. Defaults to the primary call to action. */\n  headerCta?: BlockLink;\n  announcement?: { tag: string; label: string; href: string };\n  title: ReactNode;\n  description: ReactNode;\n  primaryCta: BlockLink;\n  secondaryCta?: BlockLink;\n  /** Short reassurance notes under the buttons. */\n  notes?: string[];\n  /** The built-in product window. Ignored when `media` is set. */\n  shot?: HeroProductShot;\n  /** Replace the built-in product window with your own screenshot or video. */\n  media?: ReactNode;\n  tone?: BlockTone;\n  /** Heading level of the title. Use \"h2\" when the hero is not the first section. */\n  headingLevel?: \"h1\" | \"h2\";\n  /** Play the entrance motion. Turn off for screenshots. */\n  animate?: boolean;\n  className?: string;\n}\n\nexport const MARKETING_HERO_SAMPLE: MarketingHeroProductProps = {\n  brand: { name: \"Tracewell\", href: \"#\" },\n  nav: [\n    { label: \"Product\", href: \"#product\" },\n    { label: \"Docs\", href: \"#docs\" },\n    { label: \"Pricing\", href: \"#pricing\" },\n    { label: \"Changelog\", href: \"#changelog\" },\n  ],\n  signIn: { label: \"Sign in\", href: \"#sign-in\" },\n  headerCta: { label: \"Get started\", href: \"#start\" },\n  announcement: { tag: \"New\", label: \"Replay any run from its trace\", href: \"#replay\" },\n  title: (\n    <>\n      See every step\n      <br className=\"hidden @xl:block\" /> your agents take.\n    </>\n  ),\n  description:\n    \"Tracewell records each tool call, retry and handoff as a live trace, so you find the slow step before your users do.\",\n  primaryCta: { label: \"Start tracing free\", href: \"#start\" },\n  secondaryCta: { label: \"Book a walkthrough\", href: \"#demo\" },\n  notes: [\"No card required\", \"SOC 2 Type II\", \"Two lines to install\"],\n  shot: {\n    path: [\"northbay\", \"support-agent\", \"run_8f2c41\"],\n    activeRun: 0,\n    runs: [\n      { id: \"run_8f2c41\", label: \"Refund request #4471\", meta: \"live\", status: \"live\" },\n      { id: \"run_8f2b07\", label: \"Plan downgrade\", meta: \"4.1s\", status: \"ok\" },\n      { id: \"run_8f2a93\", label: \"Invoice lookup\", meta: \"11.8s\", status: \"slow\" },\n      { id: \"run_8f2a10\", label: \"Address change\", meta: \"2.6s\", status: \"ok\" },\n      { id: \"run_8f29c4\", label: \"Warranty claim\", meta: \"3.2s\", status: \"failed\" },\n      { id: \"run_8f2911\", label: \"Order status\", meta: \"1.9s\", status: \"ok\" },\n    ],\n    metrics: [\n      { label: \"p95 latency\", value: \"2.4s\", delta: \"-18%\", deltaTone: \"good\" },\n      { label: \"Tokens per run\", value: \"18.2k\", delta: \"+4%\", deltaTone: \"bad\" },\n      { label: \"Cost per run\", value: \"$0.031\", delta: \"-9%\", deltaTone: \"good\" },\n    ],\n    spark: [5.1, 4.6, 4.9, 4.2, 3.8, 4.1, 3.4, 3.1, 3.3, 2.8, 2.6, 2.9, 2.4, 2.5, 2.4],\n    traceTitle: \"Refund request #4471\",\n    script: [\n      { id: \"read\", kind: \"think\", label: \"Read refund request\", seconds: 0.7 },\n      { id: \"order\", kind: \"tool\", label: \"Look up order #4471\", seconds: 1.2 },\n      {\n        id: \"policy\",\n        kind: \"search\",\n        label: 'Search policy: \"damaged on arrival\"',\n        seconds: 1.6,\n        detail: \"2 matches: Returns policy section 4.2, Carrier claims playbook\",\n      },\n      { id: \"refund\", kind: \"tool\", label: \"Issue partial refund, $38.00\", seconds: 4.6 },\n      { id: \"reply\", kind: \"think\", label: \"Draft reply to customer\", seconds: 1.4 },\n      { id: \"send\", kind: \"tool\", label: \"Send reply and close ticket\", seconds: 0.8 },\n    ],\n  },\n};\n\nconst RUN_DOT: Record<HeroRunStatus, string> = {\n  ok: \"bg-[color:var(--bjork-text-faint)]\",\n  slow: \"bg-[#f2b544]\",\n  failed: \"bg-[#ff5c4d]\",\n  live: \"bg-[color:var(--bjork-accent)]\",\n};\n\nconst RUN_WORD: Record<HeroRunStatus, string> = {\n  ok: \"finished\",\n  slow: \"slow\",\n  failed: \"failed\",\n  live: \"running\",\n};\n\n/**\n * A landing-page hero: header, announcement, headline and calls to action over a product window that\n * plays a live agent trace. The layout reads its own width, so it works full-bleed or inside a column.\n */\nexport function MarketingHeroProduct({\n  brand = MARKETING_HERO_SAMPLE.brand,\n  nav = MARKETING_HERO_SAMPLE.nav,\n  signIn,\n  headerCta,\n  announcement,\n  title,\n  description,\n  primaryCta,\n  secondaryCta,\n  notes,\n  shot,\n  media,\n  tone = \"auto\",\n  headingLevel = \"h1\",\n  animate = true,\n  className,\n}: MarketingHeroProductProps) {\n  const reduce = useBlockReducedMotion();\n  const titleId = useId();\n  const Heading = headingLevel;\n  const toneProps = blockToneProps(tone);\n  const play = animate && !reduce;\n\n  const enter = (delay: number) =>\n    animate\n      ? {\n          initial: { opacity: 0, y: play ? 16 : 0 },\n          animate: { opacity: 1, y: 0 },\n          transition: {\n            opacity: { duration: reduce ? 0.2 : 0.6, ease: [0.23, 1, 0.32, 1] as const, delay: reduce ? 0 : delay },\n            y: { type: \"spring\" as const, stiffness: 240, damping: 30, mass: 0.9, delay },\n          },\n        }\n      : {};\n\n  return (\n    <section\n      aria-labelledby={titleId}\n      {...toneProps}\n      className={cn(\n        \"@container relative isolate w-full overflow-hidden bg-[var(--bjork-bg)] font-bjork-alpha text-[color:var(--bjork-text)]\",\n        toneProps.className,\n        className,\n      )}\n    >\n      <HeroBackdrop />\n\n      {brand && nav && nav.length > 0 ? (\n        <HeroHeader brand={brand} nav={nav} signIn={signIn} cta={headerCta ?? primaryCta} />\n      ) : null}\n\n      <div className={cn(blockFrame, \"relative pb-0 pt-14 @3xl:pt-20 @5xl:pt-24\")}>\n        <div className=\"flex flex-col items-center text-center\">\n          {announcement ? (\n            <motion.div {...enter(0)}>\n              <a\n                href={announcement.href}\n                className={cn(\n                  \"group/pill inline-flex max-w-full items-center gap-2.5 rounded-full border border-[color:var(--bjork-border)] bg-[var(--bjork-surface)] py-1 pl-1 pr-3 text-[13px] text-[color:var(--bjork-text-medium)] shadow-[var(--bjork-shadow-soft)] transition-colors duration-150 hover:border-[color:var(--bjork-border-strong)] hover:text-[color:var(--bjork-text)]\",\n                  focusRing,\n                )}\n              >\n                <span className=\"rounded-full bg-[var(--bjork-accent-soft)] px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.1em] text-[color:var(--bjork-accent)]\">\n                  {announcement.tag}\n                </span>\n                <span className=\"truncate\">{announcement.label}</span>\n                <ArrowRight\n                  aria-hidden\n                  className=\"size-3.5 shrink-0 transition-transform duration-200 ease-out group-hover/pill:translate-x-0.5 motion-reduce:transition-none\"\n                />\n              </a>\n            </motion.div>\n          ) : null}\n\n          <motion.div {...enter(0.06)}>\n            <Heading\n              id={titleId}\n              className=\"mt-7 text-balance font-bjork-display text-[42px] font-semibold leading-[0.98] tracking-[-0.045em] text-[color:var(--bjork-text)] @xl:text-[60px] @4xl:text-[76px]\"\n            >\n              {title}\n            </Heading>\n          </motion.div>\n\n          <motion.p\n            {...enter(0.12)}\n            className=\"mt-6 max-w-[46ch] text-pretty text-[16px] leading-7 text-[color:var(--bjork-text-medium)] @xl:text-[18px] @xl:leading-8\"\n          >\n            {description}\n          </motion.p>\n\n          <motion.div\n            {...enter(0.18)}\n            className=\"mt-9 flex w-full flex-col items-stretch justify-center gap-3 @md:w-auto @md:flex-row @md:items-center\"\n          >\n            <CtaLink link={primaryCta} arrow />\n            {secondaryCta ? <CtaLink link={secondaryCta} variant=\"secondary\" /> : null}\n          </motion.div>\n\n          {notes && notes.length > 0 ? (\n            <motion.ul\n              {...enter(0.22)}\n              className=\"mt-6 flex flex-wrap items-center justify-center gap-x-5 gap-y-2 text-[13px] text-[color:var(--bjork-text-muted)]\"\n            >\n              {notes.map((note) => (\n                <li key={note} className=\"flex items-center gap-2\">\n                  <svg viewBox=\"0 0 12 12\" aria-hidden className=\"size-3 text-[color:var(--bjork-accent)]\">\n                    <path d=\"M2.5 6.2 5 8.5l4.5-5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                  </svg>\n                  {note}\n                </li>\n              ))}\n            </motion.ul>\n          ) : null}\n        </div>\n\n        <motion.div\n          initial={animate ? { opacity: 0, y: play ? 40 : 0, rotateX: play ? 10 : 0 } : false}\n          animate={{ opacity: 1, y: 0, rotateX: 0 }}\n          transition={{\n            opacity: { duration: reduce ? 0.2 : 0.8, ease: [0.23, 1, 0.32, 1], delay: reduce ? 0 : 0.28 },\n            y: { type: \"spring\", stiffness: 120, damping: 24, mass: 1.1, delay: 0.28 },\n            rotateX: { type: \"spring\", stiffness: 120, damping: 24, mass: 1.1, delay: 0.28 },\n          }}\n          style={{ transformPerspective: 1600, transformOrigin: \"50% 0%\" }}\n          className=\"relative mt-14 @3xl:mt-20\"\n        >\n          {media ?? (shot ? <ProductWindow shot={shot} tone={tone} /> : null)}\n        </motion.div>\n      </div>\n    </section>\n  );\n}\n\nfunction HeroBackdrop() {\n  return (\n    <div aria-hidden className=\"pointer-events-none absolute inset-0 -z-10\">\n      <div\n        className=\"absolute inset-x-0 top-0 h-[720px] opacity-[0.55]\"\n        style={{\n          backgroundImage:\n            \"linear-gradient(to right, var(--bjork-border-muted) 1px, transparent 1px), linear-gradient(to bottom, var(--bjork-border-muted) 1px, transparent 1px)\",\n          backgroundSize: \"56px 56px\",\n          backgroundPosition: \"center top\",\n          maskImage: \"radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 100%)\",\n          WebkitMaskImage: \"radial-gradient(ellipse 60% 70% at 50% 0%, #000 30%, transparent 100%)\",\n        }}\n      />\n      <div\n        className=\"absolute left-1/2 top-[560px] h-[420px] w-[min(1100px,120%)] -translate-x-1/2 rounded-[50%] opacity-70 blur-[90px]\"\n        style={{ background: \"radial-gradient(closest-side, var(--bjork-accent-soft), transparent)\" }}\n      />\n    </div>\n  );\n}\n\nfunction HeroHeader({\n  brand,\n  nav,\n  signIn,\n  cta,\n}: {\n  brand: NonNullable<MarketingHeroProductProps[\"brand\"]>;\n  nav: BlockLink[];\n  signIn?: BlockLink;\n  cta: BlockLink;\n}) {\n  const [open, setOpen] = useState(false);\n  const menuId = useId();\n  const buttonRef = useRef<HTMLButtonElement>(null);\n  const reduce = useBlockReducedMotion();\n\n  const close = useCallback((restoreFocus: boolean) => {\n    setOpen(false);\n    if (restoreFocus) buttonRef.current?.focus();\n  }, []);\n\n  useEffect(() => {\n    if (!open) return;\n    const onKey = (event: KeyboardEvent) => {\n      if (event.key === \"Escape\") close(true);\n    };\n    window.addEventListener(\"keydown\", onKey);\n    return () => window.removeEventListener(\"keydown\", onKey);\n  }, [open, close]);\n\n  return (\n    <header className=\"relative z-20\">\n      <div className={cn(blockFrame, \"flex h-16 items-center justify-between gap-6\")}>\n        <a\n          href={brand.href}\n          className={cn(\"flex items-center gap-2.5 rounded-[8px] text-[15px] font-semibold tracking-[-0.02em]\", focusRing)}\n        >\n          {brand.logo ?? <SampleMark />}\n          {brand.name}\n        </a>\n\n        <nav aria-label=\"Primary\" className=\"hidden @3xl:block\">\n          <ul className=\"flex items-center gap-1\">\n            {nav.map((link) => (\n              <li key={link.href}>\n                <a\n                  href={link.href}\n                  onClick={link.onClick}\n                  className={cn(\n                    \"rounded-[9px] px-3 py-2 text-[14px] text-[color:var(--bjork-text-medium)] transition-colors duration-150 hover:bg-[var(--bjork-surface-hover)] hover:text-[color:var(--bjork-text)]\",\n                    focusRing,\n                  )}\n                >\n                  {link.label}\n                </a>\n              </li>\n            ))}\n          </ul>\n        </nav>\n\n        <div className=\"flex items-center gap-2\">\n          {signIn ? (\n            <a\n              href={signIn.href}\n              onClick={signIn.onClick}\n              className={cn(\n                \"hidden rounded-[9px] px-3 py-2 text-[14px] text-[color:var(--bjork-text-medium)] transition-colors duration-150 hover:text-[color:var(--bjork-text)] @md:inline-flex\",\n                focusRing,\n              )}\n            >\n              {signIn.label}\n            </a>\n          ) : null}\n          <CtaLink link={cta} variant=\"secondary\" className=\"hidden h-9 px-3.5 text-[13px] @md:inline-flex\" />\n          <button\n            ref={buttonRef}\n            type=\"button\"\n            aria-expanded={open}\n            aria-controls={menuId}\n            aria-label={open ? \"Close menu\" : \"Open menu\"}\n            onClick={() => setOpen((value) => !value)}\n            className={cn(\n              \"grid size-9 place-items-center rounded-[10px] border border-[color:var(--bjork-border)] bg-[var(--bjork-surface)] text-[color:var(--bjork-text-medium)] transition-transform duration-150 active:scale-[0.95] motion-reduce:transition-none @3xl:hidden\",\n              focusRing,\n            )}\n          >\n            {open ? <X aria-hidden className=\"size-4\" /> : <Menu aria-hidden className=\"size-4\" />}\n          </button>\n        </div>\n      </div>\n\n      <AnimatePresence initial={false}>\n        {open ? (\n          <motion.nav\n            key=\"menu\"\n            id={menuId}\n            aria-label=\"Primary\"\n            initial={{ opacity: 0, y: reduce ? 0 : -6 }}\n            animate={{ opacity: 1, y: 0 }}\n            exit={{ opacity: 0, y: reduce ? 0 : -4, transition: { duration: 0.12 } }}\n            transition={{ duration: 0.2, ease: [0.23, 1, 0.32, 1] }}\n            className=\"absolute inset-x-3 top-[60px] rounded-[16px] border border-[color:var(--bjork-border)] bg-[var(--bjork-menu)] p-2 shadow-[var(--bjork-shadow-menu)] backdrop-blur-md @3xl:hidden\"\n          >\n            <ul className=\"flex flex-col\">\n              {[...nav, ...(signIn ? [signIn] : [])].map((link) => (\n                <li key={link.href}>\n                  <a\n                    href={link.href}\n                    onClick={(event) => {\n                      link.onClick?.(event);\n                      close(false);\n                    }}\n                    className={cn(\n                      \"flex h-11 items-center rounded-[10px] px-3 text-[15px] text-[color:var(--bjork-text-strong)] hover:bg-[var(--bjork-surface-hover)]\",\n                      focusRing,\n                    )}\n                  >\n                    {link.label}\n                  </a>\n                </li>\n              ))}\n            </ul>\n          </motion.nav>\n        ) : null}\n      </AnimatePresence>\n    </header>\n  );\n}\n\nconst SCRIPT_HOLD_MS = 3200;\n\n/** Plays a script step by step and starts over after a pause. Reduced motion shows the finished run. */\nfunction useScriptedSteps(script: HeroScriptStep[] | undefined, enabled: boolean) {\n  const reduce = useBlockReducedMotion();\n  const [stage, setStage] = useState(0);\n  const [startedAt, setStartedAt] = useState<number | undefined>(undefined);\n  const [cycle, setCycle] = useState(0);\n  const length = script?.length ?? 0;\n  const playing = enabled && !reduce && length > 0;\n\n  useEffect(() => {\n    if (!playing || !script) return;\n    const delay = stage < length ? script[stage].seconds * 1000 : SCRIPT_HOLD_MS;\n    const id = window.setTimeout(() => {\n      if (stage < length) {\n        setStage(stage + 1);\n        setStartedAt(Date.now());\n      } else {\n        setStage(0);\n        setStartedAt(Date.now());\n        setCycle((value) => value + 1);\n      }\n    }, delay);\n    return () => window.clearTimeout(id);\n  }, [playing, script, stage, length]);\n\n  const at = playing ? stage : length;\n  const steps: AgentStep[] | undefined = script?.map((step, index) => {\n    const base = { id: step.id, kind: step.kind, label: step.label, detail: step.detail };\n    if (index < at) {\n      return { ...base, status: step.fails ? \"error\" : \"done\", durationMs: Math.round(step.seconds * 1000) };\n    }\n    if (index === at) return { ...base, status: \"active\", startedAt };\n    return { ...base, status: \"pending\" };\n  });\n\n  return { steps, cycle };\n}\n\nfunction ProductWindow({ shot, tone }: { shot: HeroProductShot; tone: BlockTone }) {\n  const active = shot.runs[shot.activeRun ?? 0];\n  const scripted = useScriptedSteps(shot.script, !shot.steps);\n  const steps = shot.steps ?? scripted.steps;\n  return (\n    <figure className=\"@container relative mx-auto max-w-[1120px]\">\n      <div className=\"relative overflow-hidden rounded-[18px] border border-[color:var(--bjork-border-strong)] bg-[var(--bjork-surface)] shadow-[0_40px_80px_-40px_rgba(0,0,0,0.35),var(--bjork-shadow-panel)] @2xl:rounded-[22px]\">\n        <div className=\"flex h-11 items-center gap-3 border-b border-[color:var(--bjork-border)] bg-[var(--bjork-panel)] px-4\">\n          <div aria-hidden className=\"flex gap-1.5\">\n            {[0, 1, 2].map((dot) => (\n              <span key={dot} className=\"size-2.5 rounded-full bg-[color:var(--bjork-border-strong)]\" />\n            ))}\n          </div>\n          <p className=\"min-w-0 flex-1 truncate font-mono text-[11px] text-[color:var(--bjork-text-muted)]\">\n            {shot.path.map((part, index) => (\n              <span key={part}>\n                {index > 0 ? <span className=\"px-1.5 text-[color:var(--bjork-text-faint)]\">/</span> : null}\n                <span className={index === shot.path.length - 1 ? \"text-[color:var(--bjork-text-medium)]\" : undefined}>\n                  {part}\n                </span>\n              </span>\n            ))}\n          </p>\n          {active?.status === \"live\" ? (\n            <span className=\"flex items-center gap-1.5 rounded-full border border-[color:var(--bjork-accent-muted)] bg-[var(--bjork-accent-soft)] px-2 py-0.5 font-mono text-[10px] uppercase tracking-[0.1em] text-[color:var(--bjork-accent)]\">\n              <span className=\"relative flex size-1.5\">\n                <span className=\"absolute inset-0 animate-ping rounded-full bg-[color:var(--bjork-accent)] opacity-60 motion-reduce:hidden\" />\n                <span className=\"relative size-1.5 rounded-full bg-[color:var(--bjork-accent)]\" />\n              </span>\n              Live\n            </span>\n          ) : null}\n        </div>\n\n        <div className=\"grid min-h-[420px] grid-cols-1 @2xl:grid-cols-[200px_minmax(0,1fr)] @5xl:grid-cols-[220px_minmax(0,1fr)_240px]\">\n          <aside aria-label=\"Recent runs\" className=\"hidden border-r border-[color:var(--bjork-border)] bg-[var(--bjork-panel)] p-3 @2xl:block\">\n            <p className=\"px-2 pb-2 pt-1 font-mono text-[10px] uppercase tracking-[0.12em] text-[color:var(--bjork-text-soft)]\">\n              Runs · last hour\n            </p>\n            <ul className=\"flex flex-col gap-0.5\">\n              {shot.runs.map((run, index) => {\n                const selected = index === (shot.activeRun ?? 0);\n                return (\n                  <li\n                    key={run.id}\n                    aria-current={selected ? \"true\" : undefined}\n                    className={cn(\n                      \"flex items-center gap-2.5 rounded-[9px] px-2 py-2\",\n                      selected ? \"bg-[var(--bjork-surface-active)]\" : undefined,\n                    )}\n                  >\n                    <span aria-hidden className={cn(\"size-1.5 shrink-0 rounded-full\", RUN_DOT[run.status])} />\n                    <span className=\"min-w-0 flex-1\">\n                      <span\n                        className={cn(\n                          \"block truncate text-[12.5px] leading-4\",\n                          selected ? \"text-[color:var(--bjork-text)]\" : \"text-[color:var(--bjork-text-medium)]\",\n                        )}\n                      >\n                        {run.label}\n                      </span>\n                      <span className=\"block truncate font-mono text-[11px] leading-4 text-[color:var(--bjork-text-soft)]\">\n                        {run.id}\n                      </span>\n                    </span>\n                    <span className=\"font-mono text-[11px] tabular-nums text-[color:var(--bjork-text-soft)]\">\n                      <span className=\"sr-only\">{RUN_WORD[run.status]}, </span>\n                      {run.meta}\n                    </span>\n                  </li>\n                );\n              })}\n            </ul>\n          </aside>\n\n          <div className=\"min-w-0 px-5 py-6 @2xl:px-8 @2xl:py-7\">\n            <AgentTrace\n              key={scripted.cycle}\n              steps={steps ?? []}\n              attract={!steps}\n              title={shot.traceTitle ?? \"Trace\"}\n              autoCollapse={false}\n              now={shot.now}\n              tone={tone === \"auto\" ? undefined : tone}\n              className=\"max-w-none\"\n            />\n          </div>\n\n          <aside\n            aria-label=\"Run health\"\n            className=\"border-t border-[color:var(--bjork-border)] p-5 @2xl:col-span-2 @5xl:col-span-1 @5xl:border-l @5xl:border-t-0\"\n          >\n            <p className=\"font-mono text-[10px] uppercase tracking-[0.12em] text-[color:var(--bjork-text-soft)]\">\n              Support agent · 7 days\n            </p>\n            {shot.spark ? <Sparkline points={shot.spark} /> : null}\n            <dl className=\"mt-1 grid grid-cols-3 gap-4 @5xl:grid-cols-1 @5xl:gap-0\">\n              {shot.metrics.map((metric) => (\n                <div\n                  key={metric.label}\n                  className=\"flex flex-col gap-1 @5xl:flex-row @5xl:items-baseline @5xl:justify-between @5xl:border-b @5xl:border-[color:var(--bjork-border-muted)] @5xl:py-3 @5xl:last:border-b-0\"\n                >\n                  <dt className=\"text-[12px] text-[color:var(--bjork-text-muted)]\">{metric.label}</dt>\n                  <dd className=\"flex items-baseline gap-2\">\n                    <span className=\"text-[17px] font-semibold tabular-nums tracking-[-0.02em] @5xl:text-[15px]\">\n                      {metric.value}\n                    </span>\n                    {metric.delta ? (\n                      <span\n                        className={cn(\n                          \"font-mono text-[11px] tabular-nums\",\n                          metric.deltaTone === \"bad\" ? \"text-[#d9634f]\" : \"text-[#3fa774]\",\n                        )}\n                      >\n                        {metric.delta}\n                      </span>\n                    ) : null}\n                  </dd>\n                </div>\n              ))}\n            </dl>\n          </aside>\n        </div>\n      </div>\n      <div\n        aria-hidden\n        className=\"pointer-events-none absolute inset-x-0 bottom-0 h-28 bg-gradient-to-t from-[var(--bjork-bg)] to-transparent\"\n      />\n    </figure>\n  );\n}\n\nfunction Sparkline({ points }: { points: number[] }) {\n  const gradientId = useId();\n  const width = 200;\n  const height = 56;\n  const max = Math.max(...points);\n  const min = Math.min(...points);\n  const span = max - min || 1;\n  const coords = points.map((value, index) => [\n    (index / (points.length - 1)) * width,\n    6 + (1 - (value - min) / span) * (height - 12),\n  ]);\n  const line = coords.map(([x, y], index) => `${index === 0 ? \"M\" : \"L\"}${x.toFixed(1)} ${y.toFixed(1)}`).join(\" \");\n\n  return (\n    <svg\n      viewBox={`0 0 ${width} ${height}`}\n      preserveAspectRatio=\"none\"\n      aria-hidden\n      className=\"mt-3 h-14 w-full overflow-visible\"\n    >\n      <defs>\n        <linearGradient id={gradientId} x1=\"0\" x2=\"0\" y1=\"0\" y2=\"1\">\n          <stop offset=\"0%\" stopColor=\"var(--bjork-accent)\" stopOpacity=\"0.22\" />\n          <stop offset=\"100%\" stopColor=\"var(--bjork-accent)\" stopOpacity=\"0\" />\n        </linearGradient>\n      </defs>\n      <path d={`${line} L${width} ${height} L0 ${height} Z`} fill={`url(#${gradientId})`} />\n      <path d={line} fill=\"none\" stroke=\"var(--bjork-accent)\" strokeWidth=\"1.5\" vectorEffect=\"non-scaling-stroke\" />\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/blocks/marketing-hero-product.tsx"
    },
    {
      "path": "components/bjork-ui/ai/agent-trace.tsx",
      "content": "\"use client\";\n\nimport {\n  useCallback,\n  useEffect,\n  useId,\n  useSyncExternalStore,\n  useLayoutEffect,\n  useMemo,\n  useRef,\n  useState,\n  type CSSProperties,\n  type ReactNode,\n} from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { LiveRegion, VisuallyHidden } from \"@/components/bjork-ui/_core/a11y\";\nimport { useVisibleLoop } from \"@/components/bjork-ui/_core/loop\";\nimport { BJORK_PALETTE, type BjorkTone } from \"@/components/bjork-ui/_core/palette\";\nimport { ease, easeCss, springs } from \"@/components/bjork-ui/_core/motion\";\nimport { useBjorkTone } from \"@/components/bjork-ui/_core/tone\";\nimport {\n  StrokeMorphIcon,\n  type StrokeIconName,\n} from \"@/components/bjork-ui/utilities/stroke-morph-icon\";\nimport { cn } from \"@/lib/utils\";\n\nexport type AgentStepStatus = \"pending\" | \"active\" | \"done\" | \"error\" | \"skipped\";\n\nexport interface AgentStep {\n  id: string;\n  /** Free-form tag such as \"search\" or \"tool\". Shown in uppercase at 420px and wider. */\n  kind?: string;\n  label: string;\n  detail?: ReactNode;\n  status: AgentStepStatus;\n  /** Epoch milliseconds (Date.now()) when an active step began. Without it, the first observed time is used. */\n  startedAt?: number;\n  /** Final duration in milliseconds. Required for a finished step to show a duration. */\n  durationMs?: number;\n}\n\nexport interface AgentTraceProps {\n  steps: AgentStep[];\n  /** Header title. Default \"Thinking\". */\n  title?: string;\n  /** Controlled collapsed state. */\n  collapsed?: boolean;\n  defaultCollapsed?: boolean;\n  onCollapsedChange?: (collapsed: boolean) => void;\n  /** Fold to the header 800ms after every step is done or skipped. Never when a step errored. Default true. */\n  autoCollapse?: boolean;\n  /** Steps slower than this turn amber. Default 4000. */\n  slowThresholdMs?: number;\n  /** Replaces the step count and duration in the header while collapsed. */\n  summary?: ReactNode;\n  density?: \"comfortable\" | \"compact\";\n  tone?: BjorkTone;\n  /** Plays a built-in demo script on a loop. Ignores `steps`. */\n  attract?: boolean;\n  /** Demo/preview only: freezes the clock. */\n  now?: number;\n  className?: string;\n}\n\ninterface RailState {\n  scale: number;\n  color: string;\n  shimmer: boolean;\n}\n\nconst TICK_MS = 100;\nconst AUTO_COLLAPSE_MS = 800;\nconst ATTRACT_IDLE_MS = 4000;\nconst ATTRACT_CYCLE_S = 16;\n// Gap between a glyph's edge and the rail: 8px glyph radius + 3px air.\nconst GLYPH_GAP = 11;\nconst SHIMMER_KEYFRAMES =\n  \"@keyframes agent-trace-shimmer { from { transform: translateY(-24px); } to { transform: translateY(var(--rail-h, 48px)); } }\";\n\nconst STATUS_ICON: Record<AgentStepStatus, StrokeIconName> = {\n  pending: \"dot\",\n  active: \"busy\",\n  done: \"check\",\n  error: \"close\",\n  skipped: \"minus\",\n};\n\nconst STATUS_WORD: Record<AgentStepStatus, string> = {\n  pending: \"pending\",\n  active: \"running\",\n  done: \"done\",\n  error: \"failed\",\n  skipped: \"skipped\",\n};\n\ninterface ScriptStep {\n  id: string;\n  kind: string;\n  label: string;\n  seconds: number;\n  error?: boolean;\n}\n\nconst ATTRACT_SCRIPT: ScriptStep[] = [\n  { id: \"parse\", kind: \"think\", label: \"Parse request\", seconds: 0.6 },\n  { id: \"search\", kind: \"search\", label: 'Search docs: \"optical alignment\"', seconds: 1.8 },\n  { id: \"read\", kind: \"read\", label: \"Read OPTICAL-ALIGNMENT.md\", seconds: 1.1 },\n  { id: \"draft\", kind: \"code\", label: \"Draft component spec\", seconds: 5.2 },\n  { id: \"typecheck\", kind: \"tool\", label: \"Run type check\", seconds: 2.0, error: true },\n  { id: \"retry\", kind: \"tool\", label: \"Retry type check\", seconds: 1.4 },\n  { id: \"compose\", kind: \"think\", label: \"Compose answer\", seconds: 0.9 },\n];\n\n// Start time of each script step in seconds, and the end of the script.\nconst SCRIPT_STARTS_S = ATTRACT_SCRIPT.reduce<number[]>(\n  (acc, step, i) => (i === 0 ? [0] : [...acc, acc[i - 1] + ATTRACT_SCRIPT[i - 1].seconds]),\n  [],\n);\nconst SCRIPT_END_S = ATTRACT_SCRIPT.reduce((sum, step) => sum + step.seconds, 0);\n\n// Frame k: steps before k are finished, step k is active, the rest are pending. k = 7 is finished.\nconst ATTRACT_FRAMES: AgentStep[][] = Array.from({ length: ATTRACT_SCRIPT.length + 1 }, (_, stage) =>\n  ATTRACT_SCRIPT.map((step, i): AgentStep => {\n    if (i < stage) {\n      return {\n        id: step.id,\n        kind: step.kind,\n        label: step.label,\n        status: step.error ? \"error\" : \"done\",\n        durationMs: Math.round(step.seconds * 1000),\n      };\n    }\n    return {\n      id: step.id,\n      kind: step.kind,\n      label: step.label,\n      status: i === stage ? \"active\" : \"pending\",\n    };\n  }),\n);\n\nfunction stageAt(t: number): number {\n  let stage = 0;\n  SCRIPT_STARTS_S.forEach((start, i) => {\n    if (t >= start) stage = i;\n  });\n  return stage;\n}\n\nfunction formatMs(ms: number): string {\n  return `${(ms / 1000).toFixed(1)}s`;\n}\n\nfunction liveElapsed(\n  step: AgentStep,\n  now: number,\n  playing: boolean,\n  attractMs: number,\n  since: ReadonlyMap<string, number>,\n): number {\n  if (playing) return attractMs;\n  return Math.max(0, now - (step.startedAt ?? since.get(step.id) ?? now));\n}\n\nfunction railOf(owner: AgentStep | undefined, slow: boolean, reduce: boolean): RailState {\n  const color = slow ? \"var(--bjork-warning)\" : \"var(--bjork-accent)\";\n  if (!owner) return { scale: 0, color, shimmer: false };\n  if (owner.status === \"done\" || owner.status === \"skipped\") return { scale: 1, color, shimmer: false };\n  if (owner.status === \"active\") {\n    // Reduced motion: a static half-filled segment instead of the shimmer.\n    return reduce ? { scale: 0.5, color, shimmer: false } : { scale: 0, color, shimmer: true };\n  }\n  return { scale: 0, color, shimmer: false };\n}\n\n/**\n * A timeline of agent steps. The rail fills as steps finish, slow steps turn amber, and the whole trace\n * folds into a one-line receipt once it is done.\n */\nexport function AgentTrace({\n  steps,\n  title = \"Thinking\",\n  collapsed,\n  defaultCollapsed = false,\n  onCollapsedChange,\n  autoCollapse = true,\n  slowThresholdMs = 4000,\n  summary,\n  density = \"comfortable\",\n  tone: toneProp,\n  attract = false,\n  now,\n  className,\n}: AgentTraceProps) {\n  const tone = useBjorkTone(toneProp);\n  const pal = BJORK_PALETTE[tone];\n  // Hydration-safe: the server and the first client render both report \"not reduced\", then the real value applies.\n  const hydrated = useSyncExternalStore(\n    () => () => {},\n    () => true,\n    () => false,\n  );\n  const reducedMotion = useReducedMotion();\n  const reduce = hydrated && reducedMotion === true;\n  const rootRef = useRef<HTMLDivElement>(null);\n  const listId = useId();\n\n  const compact = density === \"compact\";\n  const PAD = compact ? 4 : 8; // row padding\n  const MIN_H = compact ? 28 : 36;\n  const CENTRE = PAD + 10; // glyph centre: the 20px label line box is centred on the glyph (R4, R6)\n\n  // Attract script state. Only the stage changes React state; the clock lives in refs.\n  const playing = attract && !reduce;\n  const [stage, setStage] = useState(0);\n  const clockRef = useRef(0);\n  const stageRef = useRef(0);\n  const holdRef = useRef(false);\n  const elapsedRef = useRef(0);\n  const inputAt = useRef(Number.NEGATIVE_INFINITY);\n\n  const displayed = useMemo<AgentStep[]>(() => {\n    if (!attract) return steps;\n    return ATTRACT_FRAMES[reduce ? ATTRACT_SCRIPT.length : stage];\n  }, [attract, reduce, stage, steps]);\n\n  // Collapsed state, controlled or not.\n  const controlled = collapsed !== undefined;\n  const [innerCollapsed, setInnerCollapsed] = useState(defaultCollapsed);\n  const isCollapsed = controlled ? collapsed : innerCollapsed;\n  const onChangeRef = useRef(onCollapsedChange);\n  useLayoutEffect(() => {\n    onChangeRef.current = onCollapsedChange;\n  });\n  const collapseTo = useCallback(\n    (next: boolean) => {\n      if (!controlled) setInnerCollapsed(next);\n      onChangeRef.current?.(next);\n    },\n    [controlled],\n  );\n\n  const allFinished =\n    displayed.length > 0 && displayed.every((s) => s.status === \"done\" || s.status === \"skipped\");\n  const anyError = displayed.some((s) => s.status === \"error\");\n\n  useEffect(() => {\n    if (!autoCollapse || !allFinished || anyError || attract) return;\n    const id = window.setTimeout(() => collapseTo(true), AUTO_COLLAPSE_MS);\n    return () => window.clearTimeout(id);\n  }, [autoCollapse, allFinished, anyError, attract, collapseTo]);\n\n  // Live time. Refs and DOM writes only, so the 10Hz tick never re-renders React.\n  const activeSince = useRef(new Map<string, number>());\n  const liveSlowRef = useRef(new Set<string>());\n  const [liveSlow, setLiveSlow] = useState<ReadonlySet<string>>(() => new Set());\n  const latest = useRef({ displayed, slowThresholdMs, playing, now });\n\n  const paintLive = useCallback(() => {\n    const root = rootRef.current;\n    if (!root) return;\n    const { displayed: list, playing: live } = latest.current;\n    const clock = latest.current.now ?? Date.now();\n    let total = 0;\n    for (const s of list) if (s.durationMs !== undefined) total += s.durationMs;\n    const active = list.find((s) => s.status === \"active\");\n    if (active) total += liveElapsed(active, clock, live, elapsedRef.current, activeSince.current);\n    root.querySelectorAll<HTMLElement>(\"[data-live-elapsed]\").forEach((el) => {\n      const step = list.find((s) => s.id === el.dataset.liveElapsed);\n      if (step) el.textContent = formatMs(liveElapsed(step, clock, live, elapsedRef.current, activeSince.current));\n    });\n    const totalEl = root.querySelector<HTMLElement>(\"[data-live-total]\");\n    if (totalEl) totalEl.textContent = formatMs(total);\n  }, []);\n\n  // Runs after every commit. It records when steps became active and repaints the live text.\n  useLayoutEffect(() => {\n    latest.current = { displayed, slowThresholdMs, playing, now };\n    const clock = now ?? Date.now();\n    const since = activeSince.current;\n    const activeIds = new Set<string>();\n    for (const s of displayed) {\n      if (s.status !== \"active\") continue;\n      activeIds.add(s.id);\n      if (s.startedAt === undefined && !since.has(s.id)) since.set(s.id, clock);\n    }\n    for (const id of since.keys()) if (!activeIds.has(id)) since.delete(id);\n    paintLive();\n  });\n\n  const tick = useCallback(() => {\n    paintLive();\n    const { displayed: list, slowThresholdMs: threshold, playing: live, now: frozen } = latest.current;\n    const active = list.find((s) => s.status === \"active\");\n    if (!active || liveSlowRef.current.has(active.id)) return;\n    const ms = liveElapsed(active, frozen ?? Date.now(), live, elapsedRef.current, activeSince.current);\n    if (ms > threshold) {\n      liveSlowRef.current.add(active.id);\n      setLiveSlow(new Set(liveSlowRef.current));\n    }\n  }, [paintLive]);\n\n  const hasActive = displayed.some((s) => s.status === \"active\");\n  useEffect(() => {\n    if (!hasActive || now !== undefined) return;\n    const id = window.setInterval(tick, TICK_MS);\n    return () => window.clearInterval(id);\n  }, [hasActive, now, tick]);\n\n  // Attract clock. Pauses for 4s after any pointer or key input inside the component.\n  const markInput = useCallback(() => {\n    inputAt.current = performance.now();\n  }, []);\n\n  const frame = (dt: number) => {\n    if (performance.now() - inputAt.current < ATTRACT_IDLE_MS) return true;\n    let t = clockRef.current + dt;\n    if (t >= ATTRACT_CYCLE_S) t -= ATTRACT_CYCLE_S;\n    clockRef.current = t;\n    const nextStage = t >= SCRIPT_END_S ? ATTRACT_SCRIPT.length : stageAt(t);\n    elapsedRef.current = nextStage < ATTRACT_SCRIPT.length ? (t - SCRIPT_STARTS_S[nextStage]) * 1000 : 0;\n    if (nextStage !== stageRef.current) {\n      stageRef.current = nextStage;\n      setStage(nextStage);\n    }\n    const hold = t >= SCRIPT_END_S;\n    if (hold !== holdRef.current) {\n      holdRef.current = hold;\n      collapseTo(hold); // the trace folds for 3s at the end of each run\n    }\n    return true;\n  };\n  useVisibleLoop(rootRef, frame, { enabled: playing });\n\n  // LiveRegion text. Derived during render, so it updates only when a status changes.\n  const [announce, setAnnounce] = useState<{ seen: AgentStep[]; message: string }>(() => ({\n    seen: displayed,\n    message: \"\",\n  }));\n  let message = announce.message;\n  if (announce.seen !== displayed) {\n    const before = new Map(announce.seen.map((s) => [s.id, s.status] as const));\n    for (const s of displayed) {\n      if (before.get(s.id) === s.status) continue;\n      if (s.status === \"done\") message = `${s.label}: done`;\n      if (s.status === \"error\") message = `${s.label}: failed`;\n    }\n    setAnnounce({ seen: displayed, message });\n  }\n\n  const isSlow = (s: AgentStep) =>\n    (s.durationMs !== undefined && s.durationMs > slowThresholdMs) || liveSlow.has(s.id);\n\n  const countLabel = `${displayed.length} ${displayed.length === 1 ? \"step\" : \"steps\"}`;\n\n  const cssVars = {\n    \"--bjork-text\": pal.text,\n    \"--bjork-text-medium\": pal.textMedium,\n    \"--bjork-text-muted\": pal.textMuted,\n    \"--bjork-text-soft\": pal.textSoft,\n    \"--bjork-text-faint\": pal.textFaint,\n    \"--bjork-border\": pal.border,\n    \"--bjork-accent\": pal.accent,\n    \"--bjork-accent-ink\": pal.accentInk,\n    \"--bjork-accent-foreground\": pal.accentFg,\n    \"--bjork-warning\": pal.warning,\n    \"--bjork-ring-offset\": pal.bg,\n  } as CSSProperties;\n\n  return (\n    <div\n      ref={rootRef}\n      data-loop=\"idle\"\n      className={cn(\n        \"@container relative w-full max-w-[520px] font-bjork-alpha text-[color:var(--bjork-text)]\",\n        className,\n      )}\n      style={cssVars}\n      onPointerDown={markInput}\n      onPointerMove={markInput}\n      onKeyDown={markInput}\n    >\n      <style href=\"bjork-agent-trace-shimmer\" precedence=\"default\">\n        {SHIMMER_KEYFRAMES}\n      </style>\n\n      <button\n        type=\"button\"\n        aria-expanded={!isCollapsed}\n        aria-controls={listId}\n        onClick={() => collapseTo(!isCollapsed)}\n        className={cn(\n          \"flex w-full cursor-pointer items-center justify-between gap-3 rounded-[8px] text-left outline-none transition-transform duration-150 ease-out active:scale-[0.97] motion-reduce:transition-none focus-visible:ring-2 focus-visible:ring-[color:var(--bjork-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--bjork-ring-offset)]\",\n          compact ? \"py-1\" : \"py-2\",\n        )}\n      >\n        <span className=\"flex min-w-0 flex-wrap items-baseline gap-x-2\">\n          <span className=\"text-[14px] font-semibold leading-5 text-[color:var(--bjork-text)]\">{title}</span>\n          {isCollapsed && summary !== undefined ? (\n            <span className=\"min-w-0 font-mono text-[12px] leading-5 text-[color:var(--bjork-text-muted)]\">\n              {summary}\n            </span>\n          ) : (\n            <span className=\"font-mono text-[12px] leading-5 tabular-nums text-[color:var(--bjork-text-muted)]\">\n              {countLabel}\n              {displayed.length > 0 && (\n                <>\n                  {\" · \"}\n                  <span data-live-total />\n                </>\n              )}\n            </span>\n          )}\n        </span>\n        <span\n          aria-hidden=\"true\"\n          className={cn(\n            \"grid size-3 shrink-0 place-items-center text-[color:var(--bjork-text-muted)] transition-transform duration-[180ms] ease-out motion-reduce:transition-none\",\n            isCollapsed ? \"rotate-0\" : \"rotate-180\",\n          )}\n        >\n          <StrokeMorphIcon name=\"chevron-down\" size={12} strokeWidth={1.75} color={pal.textMuted} />\n        </span>\n      </button>\n\n      <div\n        id={listId}\n        aria-hidden={isCollapsed || undefined}\n        inert={isCollapsed}\n        className=\"grid\"\n        style={{\n          gridTemplateRows: isCollapsed ? \"0fr\" : \"1fr\",\n          opacity: isCollapsed ? 0 : 1,\n          transition: reduce ? \"none\" : `grid-template-rows 280ms ${easeCss.drawer}, opacity 280ms ${easeCss.drawer}`,\n        }}\n      >\n        <div className=\"min-h-0 overflow-hidden\">\n          <ol className=\"relative pt-1\">\n            {displayed.map((step, i) => {\n              const above = i > 0 ? displayed[i - 1] : undefined;\n              const below = i < displayed.length - 1 ? displayed[i + 1] : undefined;\n              return (\n                <StepRow\n                  key={step.id}\n                  step={step}\n                  aboveRail={i > 0 ? railOf(above, above ? isSlow(above) : false, reduce) : null}\n                  belowRail={below ? railOf(step, isSlow(step), reduce) : null}\n                  slow={isSlow(step)}\n                  pal={pal}\n                  reduce={reduce}\n                  pad={PAD}\n                  centre={CENTRE}\n                  minHeight={MIN_H}\n                />\n              );\n            })}\n          </ol>\n        </div>\n      </div>\n\n      <LiveRegion message={message} />\n    </div>\n  );\n}\n\ninterface StepRowProps {\n  step: AgentStep;\n  aboveRail: RailState | null;\n  belowRail: RailState | null;\n  slow: boolean;\n  pal: (typeof BJORK_PALETTE)[BjorkTone];\n  reduce: boolean;\n  pad: number;\n  centre: number;\n  minHeight: number;\n}\n\nfunction StepRow({ step, aboveRail, belowRail, slow, pal, reduce, pad, centre, minHeight }: StepRowProps) {\n  const detailId = useId();\n  const [detailEl, setDetailEl] = useState<HTMLSpanElement | null>(null);\n  const [expanded, setExpanded] = useState(false);\n  const [overflows, setOverflows] = useState(false);\n  const expandedRef = useRef(expanded);\n  useLayoutEffect(() => {\n    expandedRef.current = expanded;\n  }, [expanded]);\n\n  const hasDetail = step.detail !== undefined && step.detail !== null && step.detail !== \"\";\n\n  // A detail is a disclosure only when its one-line truncation actually hides text. The measurement is\n  // skipped while expanded, because the wrapped text would then read as fitting.\n  useEffect(() => {\n    if (!detailEl || typeof ResizeObserver === \"undefined\") return;\n    const ro = new ResizeObserver(() => {\n      if (!expandedRef.current) setOverflows(detailEl.scrollWidth > detailEl.clientWidth + 1);\n    });\n    ro.observe(detailEl);\n    return () => ro.disconnect();\n  }, [detailEl]);\n\n  const expandable = hasDetail && (overflows || expanded);\n\n  const glyphColor =\n    step.status === \"active\"\n      ? pal.accentInk\n      : step.status === \"error\"\n        ? pal.error\n        : step.status === \"done\"\n          ? pal.textMuted\n          : pal.textFaint;\n\n  const detailClass = cn(\n    \"block text-[12px] leading-4 text-[color:var(--bjork-text-soft)]\",\n    expanded ? \"whitespace-normal break-words\" : \"truncate\",\n  );\n\n  let durationNode: ReactNode = null;\n  if (step.status === \"active\") {\n    durationNode = <span data-live-elapsed={step.id} />;\n  } else if (step.durationMs !== undefined) {\n    durationNode = formatMs(step.durationMs);\n  }\n\n  return (\n    <motion.li\n      // The blur is set on both sides of the reduced branch: hydration starts unreduced, so a reduced\n      // animate target without a filter would leave the blur in place.\n      initial={reduce ? { opacity: 0, filter: \"blur(0px)\" } : { opacity: 0, y: 6, filter: \"blur(4px)\" }}\n      animate={reduce ? { opacity: 1, filter: \"blur(0px)\" } : { opacity: 1, y: 0, filter: \"blur(0px)\" }}\n      transition={reduce ? { opacity: { duration: 0.12, ease: ease.out }, filter: { duration: 0 } } : springs.blurIn}\n      className=\"relative\"\n      style={{ minHeight, paddingTop: pad, paddingBottom: pad }}\n      data-status={step.status}\n    >\n      {aboveRail && <RailHalf edge=\"upper\" state={aboveRail} centre={centre} reduce={reduce} />}\n      {belowRail && <RailHalf edge=\"lower\" state={belowRail} centre={centre} reduce={reduce} />}\n\n      <span className=\"absolute left-0 flex h-5 w-7 items-center justify-center\" style={{ top: pad }}>\n        <StrokeMorphIcon name={STATUS_ICON[step.status]} size={16} strokeWidth={1.75} color={glyphColor} />\n      </span>\n      <VisuallyHidden>{STATUS_WORD[step.status]}</VisuallyHidden>\n\n      <div className=\"relative min-w-0 pl-9\">\n        <div className=\"flex min-w-0 items-baseline gap-3\">\n          <div className=\"flex min-w-0 flex-1 items-baseline\">\n            {step.kind && (\n              <span className=\"mr-2 hidden w-[44px] shrink-0 truncate font-mono text-[10px] uppercase leading-5 tracking-[0.08em] text-[color:var(--bjork-text-faint)] @[420px]:inline-block\">\n                {step.kind}\n              </span>\n            )}\n            <span\n              className={cn(\n                \"line-clamp-2 min-w-0 text-[14px] font-medium leading-5\",\n                step.status === \"pending\" ? \"text-[color:var(--bjork-text-muted)]\" : \"text-[color:var(--bjork-text)]\",\n              )}\n            >\n              {step.label}\n            </span>\n          </div>\n          {durationNode !== null && (\n            <span\n              className={cn(\n                \"min-w-[3.5ch] shrink-0 whitespace-nowrap text-right font-mono text-[11px] leading-5 tabular-nums\",\n                slow ? \"text-[color:var(--bjork-warning)]\" : \"text-[color:var(--bjork-text-faint)]\",\n              )}\n            >\n              {durationNode}\n            </span>\n          )}\n        </div>\n\n        {hasDetail &&\n          (expandable ? (\n            <button\n              type=\"button\"\n              aria-expanded={expanded}\n              aria-controls={detailId}\n              onClick={() => setExpanded((v) => !v)}\n              className=\"mt-0.5 block w-full min-w-0 cursor-pointer rounded-[4px] text-left outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--bjork-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--bjork-ring-offset)]\"\n            >\n              <span id={detailId} ref={setDetailEl} className={detailClass}>\n                {step.detail}\n              </span>\n            </button>\n          ) : (\n            <span id={detailId} ref={setDetailEl} className={cn(\"mt-0.5\", detailClass)}>\n              {step.detail}\n            </span>\n          ))}\n      </div>\n    </motion.li>\n  );\n}\n\nfunction RailHalf({\n  edge,\n  state,\n  centre,\n  reduce,\n}: {\n  edge: \"upper\" | \"lower\";\n  state: RailState;\n  centre: number;\n  reduce: boolean;\n}) {\n  // The rail stops short of the glyph, so no line is drawn through a check, a busy ring or a pending dot.\n  const position =\n    edge === \"upper\"\n      ? { top: 0, height: Math.max(0, centre - GLYPH_GAP) }\n      : { top: centre + GLYPH_GAP, bottom: 0 };\n  const railRef = useRef<HTMLDivElement>(null);\n  // The shimmer travels the full rail height, so it measures the rail and publishes it as a custom property.\n  useEffect(() => {\n    const el = railRef.current;\n    if (!el || typeof ResizeObserver === \"undefined\") return;\n    const ro = new ResizeObserver(() => el.style.setProperty(\"--rail-h\", `${el.clientHeight}px`));\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, []);\n  return (\n    <div\n      ref={railRef}\n      aria-hidden=\"true\"\n      className=\"pointer-events-none absolute left-[14px] w-px -translate-x-1/2 overflow-hidden bg-[color:var(--bjork-border)]\"\n      style={position}\n    >\n      <div\n        className=\"absolute inset-0 origin-top\"\n        style={{\n          background: state.color,\n          transform: `scaleY(${state.scale})`,\n          transition: reduce ? \"none\" : \"transform 320ms cubic-bezier(0.23,1,0.32,1)\",\n        }}\n      />\n      {state.shimmer && (\n        <div\n          className=\"absolute inset-x-0 top-0 h-[24px]\"\n          style={{\n            background: `linear-gradient(to bottom, transparent, ${state.color}, transparent)`,\n            animation: \"agent-trace-shimmer 1.4s linear infinite\",\n          }}\n        />\n      )}\n    </div>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/ai/agent-trace.tsx"
    },
    {
      "path": "components/bjork-ui/_core/a11y.tsx",
      "content": "import type { ReactNode } from \"react\";\n\n// Text for assistive tech only.\nexport function VisuallyHidden({ children }: { children: ReactNode }) {\n  return <span className=\"sr-only\">{children}</span>;\n}\n\n// Announces `message` when it changes. Same text re-rendered does not re-announce.\nexport function LiveRegion({\n  message,\n  politeness = \"polite\",\n}: {\n  message: string;\n  politeness?: \"polite\" | \"assertive\";\n}) {\n  return (\n    <span role=\"status\" aria-live={politeness} aria-atomic=\"true\" className=\"sr-only\">\n      {message}\n    </span>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/a11y.tsx"
    },
    {
      "path": "components/bjork-ui/_core/loop.ts",
      "content": "\"use client\";\n\nimport { useCallback, useEffect, useMemo, useRef, type RefObject } from \"react\";\n\nexport interface VisibleLoopOptions {\n  enabled?: boolean;\n  fpsCap?: number;\n  rootMargin?: string;\n}\n\n/**\n * Runs `frame(dt, t)` on requestAnimationFrame while the element is near the viewport,\n * the tab is visible and `enabled` is not false. Return `false` from `frame` to go idle\n * until `wake()` is called. Writes `data-loop` on the element: running, idle or paused.\n */\nexport function useVisibleLoop(\n  ref: RefObject<HTMLElement | null>,\n  frame: (dt: number, t: number) => boolean | void,\n  opts?: VisibleLoopOptions,\n): { wake: () => void } {\n  const enabled = opts?.enabled !== false;\n  const fpsCap = opts?.fpsCap ?? 0;\n  const rootMargin = opts?.rootMargin ?? \"96px\";\n\n  const frameRef = useRef(frame);\n  useEffect(() => {\n    frameRef.current = frame;\n  }, [frame]);\n\n  const wakeRef = useRef<() => void>(() => {});\n  const wake = useCallback(() => wakeRef.current(), []);\n\n  useEffect(() => {\n    const el = ref.current;\n    if (!el || typeof window === \"undefined\") return;\n\n    let wants = true; // false once the frame callback returns false\n    let inView = false;\n    let raf = 0;\n    let last = 0;\n    let t = 0;\n    const minFrame = fpsCap > 0 ? 1000 / fpsCap : 0;\n\n    const canRun = () => enabled && inView && document.visibilityState === \"visible\";\n    const stop = () => {\n      if (raf) cancelAnimationFrame(raf);\n      raf = 0;\n    };\n\n    const update = () => {\n      if (!enabled) {\n        stop();\n        el.dataset.loop = \"paused\";\n        return;\n      }\n      if (!wants) {\n        stop();\n        el.dataset.loop = \"idle\";\n        return;\n      }\n      if (!canRun()) {\n        stop();\n        el.dataset.loop = \"paused\";\n        return;\n      }\n      el.dataset.loop = \"running\";\n      if (!raf) {\n        last = performance.now();\n        raf = requestAnimationFrame(tick);\n      }\n    };\n\n    const tick = (now: number) => {\n      raf = 0;\n      if (!canRun() || !wants) {\n        update();\n        return;\n      }\n      const elapsed = now - last;\n      if (minFrame && elapsed < minFrame - 0.5) {\n        raf = requestAnimationFrame(tick);\n        return;\n      }\n      last = now;\n      const dt = Math.min(0.05, Math.max(0, elapsed / 1000));\n      t += dt;\n      const keep = frameRef.current(dt, t);\n      if (keep === false) {\n        wants = false;\n        update();\n        return;\n      }\n      raf = requestAnimationFrame(tick);\n    };\n\n    const observer = new IntersectionObserver(\n      ([entry]) => {\n        inView = entry.isIntersecting;\n        update();\n      },\n      { rootMargin },\n    );\n    observer.observe(el);\n\n    const onVisibility = () => update();\n    document.addEventListener(\"visibilitychange\", onVisibility);\n\n    wakeRef.current = () => {\n      wants = true;\n      update();\n    };\n\n    update();\n\n    return () => {\n      stop();\n      observer.disconnect();\n      document.removeEventListener(\"visibilitychange\", onVisibility);\n      wakeRef.current = () => {};\n    };\n  }, [ref, enabled, fpsCap, rootMargin]);\n\n  return useMemo(() => ({ wake }), [wake]);\n}\n\n// matchMedia based check. False on the server.\nexport function isCoarsePointer(): boolean {\n  if (typeof window === \"undefined\" || typeof window.matchMedia !== \"function\") return false;\n  return window.matchMedia(\"(pointer: coarse)\").matches;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/loop.ts"
    },
    {
      "path": "components/bjork-ui/_core/palette.ts",
      "content": "export type BjorkTone = \"dark\" | \"light\";\n\n// Canvas, WebGL and SVG attribute colours. DOM code uses the CSS tokens with these as fallbacks.\nexport const BJORK_PALETTE = {\n  dark: {\n    bg: \"#050505\", stage: \"#111111\", surface: \"#121212\", raised: \"#161616\", active: \"#202020\",\n    border: \"#232323\", borderStrong: \"#343434\",\n    text: \"#ededed\", textMedium: \"rgba(237,237,237,0.72)\", textMuted: \"rgba(237,237,237,0.6)\",\n    textSoft: \"rgba(237,237,237,0.5)\", textFaint: \"rgba(237,237,237,0.22)\", hair: \"rgba(237,237,237,0.12)\",\n    accent: \"#ec5c13\", accentInk: \"#ec5c13\", accentFill: \"#b84a12\", accentSoft: \"rgba(236,92,19,0.12)\", accentMuted: \"rgba(236,92,19,0.24)\",\n    accentFg: \"#fff2ea\", success: \"#4cc38a\", warning: \"#f2b544\", error: \"#ff5c4d\",\n  },\n  light: {\n    bg: \"#f7f5ef\", stage: \"#f7f5ef\", surface: \"#fffcf6\", raised: \"#f5efe3\", active: \"#efe7d8\",\n    border: \"#eee6db\", borderStrong: \"#e1d7c8\",\n    text: \"#171717\", textMedium: \"rgba(23,23,23,0.78)\", textMuted: \"rgba(23,23,23,0.68)\",\n    textSoft: \"rgba(23,23,23,0.62)\", textFaint: \"rgba(23,23,23,0.22)\", hair: \"rgba(23,23,23,0.10)\",\n    accent: \"#ec7d43\", accentInk: \"#b4531f\", accentFill: \"#ec7d43\", accentSoft: \"rgba(236,125,67,0.10)\", accentMuted: \"rgba(236,125,67,0.20)\",\n    accentFg: \"#3f2112\", success: \"#1f8a55\", warning: \"#a86b00\", error: \"#c8361f\",\n  },\n} as const;\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/palette.ts"
    },
    {
      "path": "components/bjork-ui/_core/motion.ts",
      "content": "// Shared springs, easings and durations. Components import these instead of inventing values.\n\nexport const springs = {\n  press: { type: \"spring\", stiffness: 500, damping: 30, mass: 0.6 },\n  snappy: { type: \"spring\", stiffness: 400, damping: 25, mass: 1 },\n  standard: { type: \"spring\", stiffness: 300, damping: 30, mass: 0.8 },\n  soft: { type: \"spring\", stiffness: 200, damping: 25, mass: 1.2 },\n  settle: { type: \"spring\", stiffness: 380, damping: 30, mass: 0.8 },\n  blurIn: { type: \"spring\", stiffness: 400, damping: 28, mass: 0.6 },\n} as const;\n\nexport const ease = {\n  out: [0.23, 1, 0.32, 1],\n  inOut: [0.77, 0, 0.175, 1],\n  drawer: [0.32, 0.72, 0, 1],\n} as const;\n\nexport const easeCss = {\n  out: \"cubic-bezier(0.23,1,0.32,1)\",\n  inOut: \"cubic-bezier(0.77,0,0.175,1)\",\n  drawer: \"cubic-bezier(0.32,0.72,0,1)\",\n} as const;\n\nexport const durations = { press: 140, tooltip: 160, menu: 200, panel: 280 } as const; // ms\n\n// Cubic bezier easing for canvas and rAF code. Returns progress y for input x in [0, 1].\nexport function cubicBezier(x1: number, y1: number, x2: number, y2: number): (t: number) => number {\n  const cx = 3 * x1;\n  const bx = 3 * (x2 - x1) - cx;\n  const ax = 1 - cx - bx;\n  const cy = 3 * y1;\n  const by = 3 * (y2 - y1) - cy;\n  const ay = 1 - cy - by;\n  const sampleX = (s: number) => ((ax * s + bx) * s + cx) * s;\n  const sampleY = (s: number) => ((ay * s + by) * s + cy) * s;\n  const sampleDX = (s: number) => (3 * ax * s + 2 * bx) * s + cx;\n\n  const solveX = (x: number) => {\n    let s = x;\n    for (let i = 0; i < 8; i++) {\n      const err = sampleX(s) - x;\n      if (Math.abs(err) < 1e-6) return s;\n      const d = sampleDX(s);\n      if (Math.abs(d) < 1e-6) break;\n      s -= err / d;\n    }\n    let lo = 0;\n    let hi = 1;\n    s = x;\n    while (lo < hi) {\n      const v = sampleX(s);\n      if (Math.abs(v - x) < 1e-6) return s;\n      if (x > v) lo = s;\n      else hi = s;\n      s = (lo + hi) / 2;\n      if (hi - lo < 1e-7) break;\n    }\n    return s;\n  };\n\n  return (t: number) => {\n    if (t <= 0) return 0;\n    if (t >= 1) return 1;\n    return sampleY(solveX(t));\n  };\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/motion.ts"
    },
    {
      "path": "components/bjork-ui/_core/tone.ts",
      "content": "\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\nimport { useTheme } from \"next-themes\";\nimport type { BjorkTone } from \"./palette\";\n\nconst subscribeNoop = () => () => {};\nconst getMounted = () => true;\nconst getServerMounted = () => false;\n\n/**\n * Resolves the tone for a component. An explicit `tone` always wins.\n * Otherwise it follows next-themes' resolved theme, but only after mount,\n * so the server render and first client render agree on dark.\n */\nexport function useBjorkTone(tone?: BjorkTone): BjorkTone {\n  const { resolvedTheme } = useTheme();\n  const mounted = useSyncExternalStore(subscribeNoop, getMounted, getServerMounted);\n  if (tone) return tone;\n  if (!mounted) return \"dark\";\n  return resolvedTheme === \"light\" ? \"light\" : \"dark\";\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/tone.ts"
    },
    {
      "path": "components/bjork-ui/utilities/stroke-morph-icon.tsx",
      "content": "\"use client\";\n\nimport { useLayoutEffect, useRef, useState, type RefObject } from \"react\";\nimport { useReducedMotion } from \"framer-motion\";\nimport { cn } from \"@/lib/utils\";\nimport { useVisibleLoop } from \"@/components/bjork-ui/_core/loop\";\nimport { stepSpring, type SpringState } from \"@/components/bjork-ui/_core/spring\";\nimport { easeCss } from \"@/components/bjork-ui/_core/motion\";\n\nexport type StrokeIconName =\n  | \"menu\"\n  | \"equal\"\n  | \"minus\"\n  | \"plus\"\n  | \"close\"\n  | \"chevron-down\"\n  | \"chevron-up\"\n  | \"chevron-right\"\n  | \"chevron-left\"\n  | \"arrow-right\"\n  | \"arrow-down\"\n  | \"arrow-left\"\n  | \"arrow-up\"\n  | \"check\"\n  | \"play\"\n  | \"pause\"\n  | \"dot\"\n  | \"ellipsis\"\n  | \"busy\"\n  | (string & {});\n\n// Three line segments in a 24 x 24 box. `hidden` lines render at opacity 0 and collapse\n// onto the centroid of the visible endpoints. `group` icons share geometry and only rotate.\nexport interface StrokeIconDef {\n  lines: [number, number, number, number][];\n  hidden?: [boolean, boolean, boolean];\n  group?: string;\n  rotation?: number;\n  spin?: boolean;\n  strokeScale?: number;\n}\n\nexport interface StrokeMorphIconProps {\n  name: StrokeIconName;\n  size?: number;\n  strokeWidth?: number;\n  color?: string;\n  spring?: { stiffness: number; damping: number; mass: number };\n  spin?: boolean;\n  label?: string;\n  className?: string;\n}\n\ntype Seg = [number, number, number, number];\n\nconst DEFAULT_SPRING = { stiffness: 380, damping: 30, mass: 0.7 };\nconst CROSS_LINES: StrokeIconDef[\"lines\"] = [\n  [12, 5, 12, 19],\n  [5, 12, 19, 12],\n  [12, 12, 12, 12],\n];\nconst CHEVRON_LINES: StrokeIconDef[\"lines\"] = [\n  [6, 9, 12, 15],\n  [12, 15, 18, 9],\n  [12, 15, 12, 15],\n];\nconst ARROW_LINES: StrokeIconDef[\"lines\"] = [\n  [5, 12, 19, 12],\n  [13, 6, 19, 12],\n  [13, 18, 19, 12],\n];\n\nexport const strokeIcons: Record<string, StrokeIconDef> = {\n  menu: {\n    lines: [\n      [4, 7, 20, 7],\n      [4, 12, 20, 12],\n      [4, 17, 20, 17],\n    ],\n  },\n  equal: {\n    lines: [\n      [5, 9, 19, 9],\n      [5, 15, 19, 15],\n      [12, 12, 12, 12],\n    ],\n    hidden: [false, false, true],\n  },\n  minus: {\n    lines: [\n      [5, 12, 19, 12],\n      [12, 12, 12, 12],\n      [12, 12, 12, 12],\n    ],\n    hidden: [false, true, true],\n  },\n  plus: { lines: CROSS_LINES, hidden: [false, false, true], group: \"cross\", rotation: 0 },\n  close: { lines: CROSS_LINES, hidden: [false, false, true], group: \"cross\", rotation: 45 },\n  \"chevron-down\": { lines: CHEVRON_LINES, hidden: [false, false, true], group: \"chevron\", rotation: 0 },\n  \"chevron-up\": { lines: CHEVRON_LINES, hidden: [false, false, true], group: \"chevron\", rotation: 180 },\n  \"chevron-right\": { lines: CHEVRON_LINES, hidden: [false, false, true], group: \"chevron\", rotation: -90 },\n  \"chevron-left\": { lines: CHEVRON_LINES, hidden: [false, false, true], group: \"chevron\", rotation: 90 },\n  \"arrow-right\": { lines: ARROW_LINES, group: \"arrow\", rotation: 0 },\n  \"arrow-down\": { lines: ARROW_LINES, group: \"arrow\", rotation: 90 },\n  \"arrow-left\": { lines: ARROW_LINES, group: \"arrow\", rotation: 180 },\n  \"arrow-up\": { lines: ARROW_LINES, group: \"arrow\", rotation: -90 },\n  check: {\n    lines: [\n      [5, 12.5, 10, 17.5],\n      [10, 17.5, 19, 7],\n      [10, 17.5, 10, 17.5],\n    ],\n    hidden: [false, false, true],\n  },\n  // The +0.75px optical x nudge is already in these coordinates (OPTICAL-ALIGNMENT R2).\n  play: {\n    lines: [\n      [8.75, 5, 8.75, 19],\n      [8.75, 5, 19.75, 12],\n      [8.75, 19, 19.75, 12],\n    ],\n  },\n  pause: {\n    lines: [\n      [9, 6, 9, 18],\n      [15, 6, 15, 18],\n      [12, 12, 12, 12],\n    ],\n    hidden: [false, false, true],\n  },\n  dot: {\n    lines: [\n      [12, 12, 12, 12],\n      [12, 12, 12, 12],\n      [12, 12, 12, 12],\n    ],\n    hidden: [false, true, true],\n    strokeScale: 1.6,\n  },\n  ellipsis: {\n    lines: [\n      [6, 12, 6, 12],\n      [12, 12, 12, 12],\n      [18, 12, 18, 12],\n    ],\n  },\n  busy: {\n    lines: [\n      [12, 12, 12, 5],\n      [12, 12, 18.06, 15.5],\n      [12, 12, 5.94, 15.5],\n    ],\n    group: \"busy\",\n    rotation: 0,\n    spin: true,\n  },\n};\n\n// Optical nudges, in the icon's own frame (the group rotation carries them with the icon).\n// Measured with the blur test (OPTICAL-ALIGNMENT R1 / checklist 1 and 4): arrows carry their\n// visual weight toward the head, so they move back toward the tail; the check's weight sits low.\nconst OPTICAL_NUDGE = new Map<StrokeIconDef, [number, number]>([\n  [strokeIcons[\"arrow-right\"], [-1.6, 0]], // arrow-right: weight +1.63 units right of centre\n  [strokeIcons[\"arrow-down\"], [-1.6, 0]],\n  [strokeIcons[\"arrow-left\"], [-1.6, 0]],\n  [strokeIcons[\"arrow-up\"], [-1.6, 0]],\n  [strokeIcons.check, [0, -0.9]], // check: weight +0.94 units below centre\n]);\n\nfunction nudgeOf(def: StrokeIconDef): [number, number] {\n  return OPTICAL_NUDGE.get(def) ?? [0, 0];\n}\n\nfunction isSeg(v: unknown): v is Seg {\n  return Array.isArray(v) && v.length === 4 && v.every((n) => typeof n === \"number\" && Number.isFinite(n));\n}\n\n// Registers a custom icon. Throws a TypeError unless it has exactly three finite line segments.\nexport function defineStrokeIcon(name: string, def: StrokeIconDef): void {\n  if (!name) throw new TypeError(\"defineStrokeIcon: name must be a non-empty string\");\n  if (!Array.isArray(def.lines) || def.lines.length !== 3 || !def.lines.every(isSeg)) {\n    throw new TypeError(`defineStrokeIcon(\"${name}\"): lines must be exactly 3 [x1, y1, x2, y2] segments`);\n  }\n  if (def.hidden !== undefined && (!Array.isArray(def.hidden) || def.hidden.length !== 3)) {\n    throw new TypeError(`defineStrokeIcon(\"${name}\"): hidden must have exactly 3 booleans`);\n  }\n  strokeIcons[name] = def;\n}\n\nconst warnedNames = new Set<string>();\n\nfunction resolveStrokeIcon(name: string): StrokeIconDef {\n  if (Object.prototype.hasOwnProperty.call(strokeIcons, name)) return strokeIcons[name];\n  if (process.env.NODE_ENV !== \"production\" && !warnedNames.has(name)) {\n    warnedNames.add(name);\n    console.warn(`StrokeMorphIcon: unknown name \"${name}\", rendering \"dot\" instead.`);\n  }\n  return strokeIcons.dot;\n}\n\n// Effective geometry: hidden lines collapse onto the centroid of the visible endpoints.\nconst effCache = new WeakMap<StrokeIconDef, Seg[]>();\n\nfunction effOf(def: StrokeIconDef): Seg[] {\n  const cached = effCache.get(def);\n  if (cached) return cached;\n  const visible = [0, 1, 2].map((i) => !def.hidden?.[i]);\n  let sx = 0;\n  let sy = 0;\n  let n = 0;\n  def.lines.forEach(([x1, y1, x2, y2], i) => {\n    if (!visible[i]) return;\n    sx += x1 + x2;\n    sy += y1 + y2;\n    n += 2;\n  });\n  const cx = n ? sx / n : 12;\n  const cy = n ? sy / n : 12;\n  const eff = def.lines.map((seg, i): Seg => (visible[i] ? seg : [cx, cy, cx, cy]));\n  effCache.set(def, eff);\n  return eff;\n}\n\nfunction visibleOf(def: StrokeIconDef): boolean[] {\n  return [0, 1, 2].map((i) => !def.hidden?.[i]);\n}\n\ninterface Assignment {\n  perm: number[]; // source line i goes to target line perm[i]\n  flip: boolean[]; // swap that line's endpoints\n}\n\nconst PERMS = [\n  [0, 1, 2],\n  [0, 2, 1],\n  [1, 0, 2],\n  [1, 2, 0],\n  [2, 0, 1],\n  [2, 1, 0],\n];\n\n// Best endpoint matching: 6 permutations, and per line the cheaper of the 2 endpoint flips\n// (the 8 flip combinations reduce to this because each line's flip is independent).\nfunction bestAssignment(src: Seg[], dst: Seg[]): Assignment {\n  let best: Assignment = { perm: [0, 1, 2], flip: [false, false, false] };\n  let bestCost = Infinity;\n  for (const perm of PERMS) {\n    let total = 0;\n    const flip: boolean[] = [];\n    for (let i = 0; i < 3; i++) {\n      const [ax1, ay1, ax2, ay2] = src[i];\n      const [bx1, by1, bx2, by2] = dst[perm[i]];\n      const straight = (ax1 - bx1) ** 2 + (ay1 - by1) ** 2 + (ax2 - bx2) ** 2 + (ay2 - by2) ** 2;\n      const crossed = (ax1 - bx2) ** 2 + (ay1 - by2) ** 2 + (ax2 - bx1) ** 2 + (ay2 - by1) ** 2;\n      flip.push(crossed < straight);\n      total += Math.min(straight, crossed);\n    }\n    if (total < bestCost) {\n      bestCost = total;\n      best = { perm: [...perm], flip };\n    }\n  }\n  return best;\n}\n\n// Memoised per (from, to) pair of defs. Used when the icon has settled on `from`.\nconst matchCache = new WeakMap<StrokeIconDef, WeakMap<StrokeIconDef, Assignment>>();\n\nfunction canonicalMatch(from: StrokeIconDef, to: StrokeIconDef): Assignment {\n  let inner = matchCache.get(from);\n  if (!inner) {\n    inner = new WeakMap();\n    matchCache.set(from, inner);\n  }\n  const cached = inner.get(to);\n  if (cached) return cached;\n  const result = bestAssignment(effOf(from), effOf(to));\n  inner.set(to, result);\n  return result;\n}\n\n// Shortest signed rotation from `from` to `to` (degrees), in (-180, 180].\nfunction shortestDelta(from: number, to: number): number {\n  return ((((to - from) % 360) + 540) % 360) - 180;\n}\n\n// Attributes are written to 2 decimals (0.005 of a 24-unit box). Finer precision only adds settle time.\nconst fmt = (v: number) => String(Math.round(v * 100) / 100);\nconst COORDS = [\"x1\", \"y1\", \"x2\", \"y2\"] as const;\n\ninterface MorphEls {\n  group: SVGGElement;\n  lines: (SVGLineElement | null)[];\n}\n\n// Owns the imperative morph. React renders once; every frame writes attributes through refs.\nclass Morph {\n  private els: MorphEls | null = null;\n  private cur = new Float64Array(12);\n  private from = new Float64Array(12);\n  private to = new Float64Array(12);\n  private curAngle: number;\n  private fromAngle: number;\n  private toAngle: number;\n  private curScale = 1;\n  private fromScale = 1;\n  private toScale = 1;\n  private curNudge: [number, number];\n  private fromNudge: [number, number];\n  private toNudge: [number, number];\n  private slotLine = [0, 1, 2]; // settled: element s shows canonical line slotLine[s]\n  private targetLine = [0, 1, 2];\n  private visibleTo = [true, true, true];\n  private spring: SpringState = { x: 0, v: 0 };\n  private written: (string | undefined)[] = [];\n  private strokeWidth = 2;\n  private active = false;\n  private cfg = DEFAULT_SPRING;\n  target: StrokeIconDef;\n\n  constructor(def: StrokeIconDef) {\n    this.target = def;\n    effOf(def).forEach((seg, s) => this.to.set(seg, s * 4));\n    this.cur.set(this.to);\n    this.from.set(this.to);\n    this.curAngle = this.fromAngle = this.toAngle = def.rotation ?? 0;\n    this.curScale = this.fromScale = this.toScale = def.strokeScale ?? 1;\n    this.curNudge = this.fromNudge = this.toNudge = nudgeOf(def);\n  }\n\n  bind(els: MorphEls) {\n    this.els = els;\n    this.paint(1);\n  }\n\n  setConfig(cfg: { stiffness: number; damping: number; mass: number }) {\n    this.cfg = cfg;\n  }\n\n  setStrokeWidth(strokeWidth: number) {\n    this.strokeWidth = strokeWidth;\n    this.paint(this.active ? this.spring.x : 1);\n  }\n\n  retarget(next: StrokeIconDef, reduce: boolean) {\n    const prev = this.target;\n    const sameGroup = !!next.group && next.group === prev.group;\n    this.target = next;\n\n    if (!sameGroup) {\n      let assignment: Assignment;\n      if (this.active) {\n        // Mid-flight: match from the current lerped geometry, not from a settled def.\n        const current: Seg[] = [0, 1, 2].map((s) => [\n          this.cur[s * 4],\n          this.cur[s * 4 + 1],\n          this.cur[s * 4 + 2],\n          this.cur[s * 4 + 3],\n        ]);\n        assignment = bestAssignment(current, effOf(next));\n      } else {\n        assignment = canonicalMatch(prev, next);\n      }\n      const eff = effOf(next);\n      const visible = visibleOf(next);\n      for (let s = 0; s < 3; s++) {\n        const c = this.active ? s : this.slotLine[s];\n        const t = this.active ? assignment.perm[s] : assignment.perm[c];\n        const flip = this.active ? assignment.flip[s] : assignment.flip[c];\n        this.targetLine[s] = t;\n        const [x1, y1, x2, y2] = eff[t];\n        const seg: Seg = flip ? [x2, y2, x1, y1] : [x1, y1, x2, y2];\n        this.to.set(seg, s * 4);\n        this.visibleTo[s] = visible[t];\n      }\n      // A line that changes visibility fades over 120ms ease-out, or instantly when reduced.\n      this.applyVisibility(reduce);\n    }\n\n    this.fromAngle = this.curAngle;\n    this.fromScale = this.curScale;\n    this.fromNudge = [this.curNudge[0], this.curNudge[1]];\n    this.from.set(this.cur);\n    this.toAngle = this.curAngle + shortestDelta(this.curAngle, next.rotation ?? 0);\n    this.toScale = next.strokeScale ?? 1;\n    this.toNudge = nudgeOf(next);\n\n    if (reduce) {\n      this.settle();\n      return;\n    }\n    this.spring.x = 0; // keep the velocity so an interrupted move carries its momentum\n    this.active = true;\n  }\n\n  private applyVisibility(reduce: boolean) {\n    const els = this.els;\n    if (!els) return;\n    for (let s = 0; s < 3; s++) {\n      const line = els.lines[s];\n      if (!line) continue;\n      line.style.transition = reduce ? \"none\" : `opacity 120ms ${easeCss.out}`;\n      line.style.opacity = this.visibleTo[s] ? \"1\" : \"0\";\n    }\n  }\n\n  // Frame step for useVisibleLoop. Returns false when idle.\n  step(dt: number): boolean {\n    if (!this.active) return false;\n    stepSpring(this.spring, 1, this.cfg, dt);\n    if (Math.abs(this.spring.x - 1) < 5e-4 && Math.abs(this.spring.v) < 5e-3) {\n      this.settle();\n      return false;\n    }\n    this.paint(this.spring.x);\n    return true;\n  }\n\n  // Snap to the exact canonical geometry of the target and go idle.\n  private settle() {\n    const eff = effOf(this.target);\n    for (let s = 0; s < 3; s++) {\n      this.slotLine[s] = this.targetLine[s];\n      const seg = eff[this.targetLine[s]];\n      this.to.set(seg, s * 4);\n    }\n    this.from.set(this.to);\n    this.fromAngle = this.toAngle;\n    this.curAngle = this.toAngle;\n    this.fromScale = this.toScale;\n    this.curScale = this.toScale;\n    this.fromNudge = [this.toNudge[0], this.toNudge[1]];\n    this.curNudge = [this.toNudge[0], this.toNudge[1]];\n    this.active = false;\n    this.spring.x = 1;\n    this.spring.v = 0;\n    this.paint(1);\n  }\n\n  private paint(p: number) {\n    const els = this.els;\n    if (!els) return;\n    for (let s = 0; s < 3; s++) {\n      const line = els.lines[s];\n      for (let k = 0; k < 4; k++) {\n        const i = s * 4 + k;\n        const v = this.from[i] + (this.to[i] - this.from[i]) * p;\n        this.cur[i] = v;\n        const str = fmt(v);\n        if (line && this.written[i] !== str) {\n          line.setAttribute(COORDS[k], str);\n          this.written[i] = str;\n        }\n      }\n    }\n    this.curAngle = this.fromAngle + (this.toAngle - this.fromAngle) * p;\n    this.curScale = this.fromScale + (this.toScale - this.fromScale) * p;\n    const nx = this.fromNudge[0] + (this.toNudge[0] - this.fromNudge[0]) * p;\n    const ny = this.fromNudge[1] + (this.toNudge[1] - this.fromNudge[1]) * p;\n    this.curNudge = [nx, ny];\n    const transform = `rotate(${fmt(this.curAngle)} 12 12) translate(${fmt(nx)} ${fmt(ny)})`;\n    if (this.written[12] !== transform) {\n      els.group.setAttribute(\"transform\", transform);\n      this.written[12] = transform;\n    }\n    const sw = fmt(this.strokeWidth * this.curScale);\n    if (this.written[13] !== sw) {\n      els.group.setAttribute(\"stroke-width\", sw);\n      this.written[13] = sw;\n    }\n  }\n}\n\nexport function StrokeMorphIcon({\n  name,\n  size = 24,\n  strokeWidth = 2,\n  color = \"currentColor\",\n  spring,\n  spin,\n  label,\n  className,\n}: StrokeMorphIconProps) {\n  const reduceMotion = useReducedMotion() === true;\n  const def = resolveStrokeIcon(name);\n\n  // Initial markup only. After mount, attributes are owned by the Morph, so these\n  // constants never change and React never overwrites an in-flight frame.\n  const [initial] = useState(() => {\n    const eff = effOf(def);\n    const visible = visibleOf(def);\n    return {\n      segs: eff,\n      visible,\n      transform: `rotate(${def.rotation ?? 0} 12 12) translate(${nudgeOf(def).map(fmt).join(\" \")})`,\n      strokeWidth: fmt(strokeWidth * (def.strokeScale ?? 1)),\n    };\n  });\n  const [morph] = useState(() => new Morph(def));\n\n  const svgRef = useRef<SVGSVGElement>(null);\n  const groupRef = useRef<SVGGElement>(null);\n  const lineRefs = useRef<(SVGLineElement | null)[]>([null, null, null]);\n\n  // The <svg> stays the root (icon-with-label rules target `>svg`). The loop hook only reads\n  // the element's box and dataset, which SVG elements also have.\n  const loop = useVisibleLoop(svgRef as RefObject<HTMLElement | null>, (dt) => morph.step(dt));\n\n  useLayoutEffect(() => {\n    if (!groupRef.current) return;\n    morph.bind({ group: groupRef.current, lines: lineRefs.current });\n  }, [morph]);\n\n  useLayoutEffect(() => {\n    morph.setConfig(spring ?? DEFAULT_SPRING);\n  });\n\n  useLayoutEffect(() => {\n    if (morph.target === def) return;\n    morph.retarget(def, reduceMotion);\n    if (!reduceMotion) loop.wake();\n  }, [def, reduceMotion, morph, loop]);\n\n  useLayoutEffect(() => {\n    morph.setStrokeWidth(strokeWidth);\n  }, [morph, strokeWidth]);\n\n  const spinning = (spin ?? def.spin) === true;\n\n  return (\n    <svg\n      ref={svgRef}\n      width={size}\n      height={size}\n      viewBox=\"0 0 24 24\"\n      fill=\"none\"\n      stroke={color}\n      strokeLinecap=\"round\"\n      strokeLinejoin=\"round\"\n      role={label ? \"img\" : undefined}\n      aria-label={label}\n      aria-hidden={label ? undefined : true}\n      className={cn(\"shrink-0\", className)}\n    >\n      <g\n        className={spinning ? \"motion-safe:animate-spin\" : undefined}\n        style={{ transformBox: \"view-box\", transformOrigin: \"12px 12px\" }}\n      >\n        <g ref={groupRef} strokeWidth={initial.strokeWidth} transform={initial.transform}>\n          {initial.segs.map(([x1, y1, x2, y2], i) => (\n            <line\n              key={i}\n              ref={(el) => {\n                lineRefs.current[i] = el;\n              }}\n              x1={x1}\n              y1={y1}\n              x2={x2}\n              y2={y2}\n              style={{ opacity: initial.visible[i] ? 1 : 0 }}\n            />\n          ))}\n        </g>\n      </g>\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/utilities/stroke-morph-icon.tsx"
    },
    {
      "path": "lib/utils.ts",
      "content": "import { clsx, type ClassValue } from \"clsx\"\nimport { twMerge } from \"tailwind-merge\"\n\nexport function cn(...inputs: ClassValue[]) {\n  return twMerge(clsx(inputs))\n}\n",
      "type": "registry:lib",
      "target": "@lib/utils.ts"
    },
    {
      "path": "components/bjork-ui/_core/spring.ts",
      "content": "// Pure spring math, no React. Units: stiffness k, damping d (coefficient), mass m, time in seconds.\n\nexport interface SpringConfig {\n  stiffness: number;\n  damping: number;\n  mass: number;\n}\n\nexport interface SpringState {\n  x: number;\n  v: number;\n}\n\n// Damping ratio zeta = d / (2 * sqrt(k * m)).\nexport function dampingRatio(c: SpringConfig): number {\n  return c.damping / (2 * Math.sqrt(c.stiffness * c.mass));\n}\n\n// Exact solution of y'' = -(k/m) y - (d/m) y' for displacement y0 and velocity v0 at time t.\n// Returns displacement and velocity together so stepping can be exact, not integrated.\nfunction solveLinear(t: number, c: SpringConfig, y0: number, v0: number): { y: number; v: number } {\n  const w0 = Math.sqrt(c.stiffness / c.mass);\n  const z = dampingRatio(c);\n\n  if (Math.abs(z - 1) < 1e-9) {\n    // Critically damped.\n    const e = Math.exp(-w0 * t);\n    const b = v0 + w0 * y0;\n    return { y: e * (y0 + b * t), v: e * (b - w0 * (y0 + b * t)) };\n  }\n  if (z < 1) {\n    // Underdamped.\n    const wd = w0 * Math.sqrt(1 - z * z);\n    const a = z * w0;\n    const B = (v0 + a * y0) / wd;\n    const e = Math.exp(-a * t);\n    const cos = Math.cos(wd * t);\n    const sin = Math.sin(wd * t);\n    return {\n      y: e * (y0 * cos + B * sin),\n      v: e * (-a * (y0 * cos + B * sin) + wd * (-y0 * sin + B * cos)),\n    };\n  }\n  // Overdamped.\n  const s = w0 * Math.sqrt(z * z - 1);\n  const r1 = -z * w0 + s;\n  const r2 = -z * w0 - s;\n  const B = (v0 - r1 * y0) / (r2 - r1);\n  const A = y0 - B;\n  const e1 = Math.exp(r1 * t);\n  const e2 = Math.exp(r2 * t);\n  return { y: A * e1 + B * e2, v: A * r1 * e1 + B * r2 * e2 };\n}\n\n// Analytic position at time t for a spring from `from` to `to` with initial velocity v0.\nexport function springAt(t: number, c: SpringConfig, from = 0, to = 1, v0 = 0): number {\n  return to + solveLinear(t, c, from - to, v0).y;\n}\n\n// Overshoot as a fraction of the total travel. Zero when critically or overdamped.\nexport function overshoot(c: SpringConfig): number {\n  const z = dampingRatio(c);\n  if (z >= 1) return 0;\n  return Math.exp((-Math.PI * z) / Math.sqrt(1 - z * z));\n}\n\n// Seconds until the spring stays within epsilon of its target (fraction of travel).\n// Found by scanning backwards from a bound derived from the slowest decay rate.\nexport function settleTime(c: SpringConfig, epsilon = 0.001): number {\n  const w0 = Math.sqrt(c.stiffness / c.mass);\n  const z = dampingRatio(c);\n  const slowest = z < 1 ? z * w0 : (z - Math.sqrt(z * z - 1)) * w0;\n  const tEnd = (Math.log(1 / epsilon) / slowest) * 1.5 + 0.05;\n  const steps = 4000;\n  const dt = tEnd / steps;\n  const band = epsilon;\n  let last = 0;\n  for (let i = 0; i <= steps; i++) {\n    const t = i * dt;\n    if (Math.abs(springAt(t, c, 1, 0, 0)) >= band) last = t;\n  }\n  return last + dt;\n}\n\n// Advances the state by dt towards `target`. Uses the exact solution of the linear spring\n// (no integration), so it tracks springAt to rounding error at any step size and stays stable\n// for stiff configs where a fixed-step integrator drifts.\nexport function stepSpring(s: SpringState, target: number, c: SpringConfig, dt: number): void {\n  if (dt <= 0) return;\n  const r = solveLinear(dt, c, s.x - target, s.v);\n  s.x = target + r.y;\n  s.v = r.v;\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/_core/spring.ts"
    },
    {
      "path": "components/bjork-ui/blocks/marketing-kit.tsx",
      "content": "\"use client\";\n\nimport {\n  useSyncExternalStore,\n  type CSSProperties,\n  type MouseEventHandler,\n  type ReactNode,\n} from \"react\";\nimport { motion, useReducedMotion } from \"framer-motion\";\nimport { ArrowRight } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\n\n/**\n * Shared pieces for the marketing blocks: tone scoping, hydration-safe reduced motion,\n * the section heading, call-to-action links and the in-view reveal.\n */\n\nexport type BlockTone = \"light\" | \"dark\" | \"auto\";\n\nconst subscribeNoop = () => () => {};\n\n/** `true` once hydrated and the visitor asked for reduced motion. The server and first client render agree on `false`. */\nexport function useBlockReducedMotion(): boolean {\n  const hydrated = useSyncExternalStore(subscribeNoop, () => true, () => false);\n  const prefers = useReducedMotion();\n  return hydrated && prefers === true;\n}\n\n/**\n * Scopes the library tokens to one block. \"light\" and \"dark\" re-declare every `--bjork-*` token on the\n * section through the `.light` / `.dark` classes; \"auto\" inherits whatever the page sets.\n * Blocks only colour through these tokens, never through `dark:` variants, so a forced tone holds.\n */\nexport function blockToneProps(tone: BlockTone): { className?: string; style?: CSSProperties } {\n  if (tone === \"auto\") return {};\n  return { className: tone, style: { colorScheme: tone } };\n}\n\n/** Focus ring used by every interactive element in the blocks. */\nexport const focusRing =\n  \"outline-none focus-visible:ring-2 focus-visible:ring-[color:var(--bjork-accent)] focus-visible:ring-offset-2 focus-visible:ring-offset-[color:var(--bjork-ring-offset)]\";\n\n/** Section padding and width that every block shares, so stacked blocks line up. */\nexport const blockFrame = \"mx-auto w-full max-w-[1200px] px-5 @2xl:px-8 @5xl:px-10\";\n\nexport interface BlockLink {\n  label: string;\n  href: string;\n  /** Optional click handler; the link still navigates unless you call `preventDefault`. */\n  onClick?: MouseEventHandler<HTMLAnchorElement>;\n}\n\nexport function Eyebrow({ children, className }: { children: ReactNode; className?: string }) {\n  return (\n    <p\n      className={cn(\n        \"flex items-center gap-2 font-mono text-[11px] uppercase leading-4 tracking-[0.12em] text-[color:var(--bjork-text-muted)]\",\n        className,\n      )}\n    >\n      <span aria-hidden className=\"size-1.5 rounded-full bg-[color:var(--bjork-accent)]\" />\n      {children}\n    </p>\n  );\n}\n\nexport interface SectionHeaderProps {\n  id: string;\n  eyebrow?: ReactNode;\n  title: ReactNode;\n  description?: ReactNode;\n  align?: \"start\" | \"center\";\n  as?: \"h1\" | \"h2\" | \"h3\";\n  className?: string;\n  children?: ReactNode;\n}\n\nexport function SectionHeader({\n  id,\n  eyebrow,\n  title,\n  description,\n  align = \"start\",\n  as: Heading = \"h2\",\n  className,\n  children,\n}: SectionHeaderProps) {\n  return (\n    <div\n      className={cn(\n        \"flex flex-col gap-4\",\n        align === \"center\" ? \"items-center text-center\" : \"items-start text-left\",\n        className,\n      )}\n    >\n      {eyebrow ? <Eyebrow>{eyebrow}</Eyebrow> : null}\n      <Heading\n        id={id}\n        className=\"max-w-[20ch] text-balance font-bjork-display text-[34px] font-semibold leading-[1.02] tracking-[-0.035em] text-[color:var(--bjork-text)] @xl:text-[44px] @4xl:text-[52px]\"\n      >\n        {title}\n      </Heading>\n      {description ? (\n        <p className=\"max-w-[58ch] text-pretty text-[16px] leading-7 text-[color:var(--bjork-text-medium)] @xl:text-[17px]\">\n          {description}\n        </p>\n      ) : null}\n      {children}\n    </div>\n  );\n}\n\ntype CtaVariant = \"primary\" | \"secondary\" | \"ghost\";\n\nconst ctaBase =\n  \"group/cta relative inline-flex h-11 shrink-0 items-center justify-center gap-2 whitespace-nowrap rounded-[13px] px-[18px] text-[14px] font-medium tracking-[-0.01em] transition-[transform,background-color,border-color,color] duration-150 ease-out active:scale-[0.97] motion-reduce:transition-none motion-reduce:active:scale-100\";\n\nconst ctaVariants: Record<CtaVariant, string> = {\n  primary: \"bjork-layered-button-accent text-white\",\n  secondary:\n    \"border border-[color:var(--bjork-border-strong)] bg-[var(--bjork-surface)] text-[color:var(--bjork-text)] shadow-[var(--bjork-shadow-soft)] hover:border-[color:var(--bjork-text-faint)] hover:bg-[var(--bjork-surface-hover)]\",\n  ghost:\n    \"px-2 text-[color:var(--bjork-text-medium)] hover:text-[color:var(--bjork-text)]\",\n};\n\nexport function CtaLink({\n  link,\n  variant = \"primary\",\n  arrow = false,\n  className,\n}: {\n  link: BlockLink;\n  variant?: CtaVariant;\n  arrow?: boolean;\n  className?: string;\n}) {\n  return (\n    <a\n      href={link.href}\n      onClick={link.onClick}\n      className={cn(ctaBase, ctaVariants[variant], focusRing, className)}\n    >\n      <span>{link.label}</span>\n      {arrow ? (\n        <ArrowRight\n          aria-hidden\n          className=\"size-4 transition-transform duration-200 ease-out group-hover/cta:translate-x-0.5 motion-reduce:transition-none\"\n        />\n      ) : null}\n    </a>\n  );\n}\n\n/**\n * Fades and lifts its children the first time they scroll into view. Under reduced motion only the\n * fade runs, with no movement.\n */\nexport function Reveal({\n  children,\n  delay = 0,\n  className,\n  as = \"div\",\n}: {\n  children: ReactNode;\n  delay?: number;\n  className?: string;\n  as?: \"div\" | \"li\";\n}) {\n  const reduce = useBlockReducedMotion();\n  const Component = as === \"li\" ? motion.li : motion.div;\n  return (\n    <Component\n      className={className}\n      initial={{ opacity: 0, y: 14 }}\n      whileInView={{ opacity: 1, y: 0 }}\n      viewport={{ once: true, amount: 0.2 }}\n      transition={{\n        opacity: { duration: reduce ? 0.2 : 0.5, ease: [0.23, 1, 0.32, 1], delay: reduce ? 0 : delay },\n        y: reduce ? { duration: 0 } : { type: \"spring\", stiffness: 260, damping: 30, mass: 0.9, delay },\n      }}\n    >\n      {children}\n    </Component>\n  );\n}\n\n/** A small product mark used by the sample content. Swap it for your logo. */\nexport function SampleMark({ className }: { className?: string }) {\n  return (\n    <svg viewBox=\"0 0 24 24\" aria-hidden className={cn(\"size-6\", className)}>\n      <rect x=\"1\" y=\"1\" width=\"22\" height=\"22\" rx=\"7\" fill=\"var(--bjork-text)\" />\n      <path\n        d=\"M6.5 15.5h3l2-7 2 7h4\"\n        fill=\"none\"\n        stroke=\"var(--bjork-bg)\"\n        strokeWidth=\"1.9\"\n        strokeLinecap=\"round\"\n        strokeLinejoin=\"round\"\n      />\n      <circle cx=\"17.5\" cy=\"15.5\" r=\"1.6\" fill=\"var(--bjork-accent)\" />\n    </svg>\n  );\n}\n",
      "type": "registry:component",
      "target": "@components/bjork-ui/blocks/marketing-kit.tsx"
    }
  ],
  "cssVars": {
    "light": {
      "bjork-bg": "#f7f3ea",
      "bjork-surface": "#fffcf6",
      "bjork-surface-muted": "rgba(250, 246, 237, 0.94)",
      "bjork-surface-hover": "#f5efe3",
      "bjork-surface-active": "#efe7d8",
      "bjork-panel": "#f8f2e7",
      "bjork-menu": "rgba(255, 252, 246, 0.98)",
      "bjork-field": "rgba(255, 252, 246, 0.96)",
      "bjork-field-muted": "rgba(248, 242, 231, 0.82)",
      "bjork-field-inset": "rgba(239, 231, 216, 0.72)",
      "bjork-error-bg": "#fff0e8",
      "bjork-text": "#171717",
      "bjork-text-strong": "rgba(23, 23, 23, 0.9)",
      "bjork-text-medium": "rgba(23, 23, 23, 0.78)",
      "bjork-text-muted": "rgba(23, 23, 23, 0.68)",
      "bjork-text-soft": "rgba(23, 23, 23, 0.62)",
      "bjork-text-faint": "rgba(23, 23, 23, 0.22)",
      "bjork-inverted-text": "#fff8f0",
      "bjork-border": "#eee6db",
      "bjork-border-muted": "#f5ede2",
      "bjork-border-strong": "#e1d7c8",
      "bjork-thumb": "#a49b8e",
      "bjork-track": "#ded6ca",
      "bjork-accent": "#ec7d43",
      "bjork-accent-hover": "#f0935f",
      "bjork-accent-soft": "rgba(236, 125, 67, 0.1)",
      "bjork-accent-muted": "rgba(236, 125, 67, 0.2)",
      "bjork-accent-badge": "rgba(236, 125, 67, 0.16)",
      "bjork-accent-badge-foreground": "#8d421d",
      "bjork-accent-foreground": "#3f2112",
      "bjork-accent-fill": "#ec7d43",
      "bjork-accent-fill-hover": "#f0935f",
      "bjork-shadow-surface": "inset 0 7px 14px rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.92), inset 1px 0 0 rgba(88, 72, 49, 0.026), inset -1px 0 0 rgba(255, 255, 255, 0.68), 0 14px 22px -9px rgba(66, 52, 33, 0.11)",
      "bjork-shadow-soft": "inset 0 1px 0 rgba(88, 72, 49, 0.045), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.86)",
      "bjork-shadow-panel": "inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.64), 0 18px 38px -30px rgba(66, 52, 33, 0.2)",
      "bjork-shadow-menu": "inset 0 1px 0 rgba(88, 72, 49, 0.04), inset 0 12px 24px rgba(88, 72, 49, 0.022), inset 1px 0 0 rgba(88, 72, 49, 0.024), inset -1px 0 0 rgba(255, 255, 255, 0.62), 0 22px 44px -26px rgba(66, 52, 33, 0.22)",
      "bjork-shadow-inset": "inset 0 1px 10px rgba(88, 72, 49, 0.12), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.72)",
      "bjork-ring-offset": "#f7f3ea"
    },
    "dark": {
      "bjork-bg": "#111111",
      "bjork-surface": "#121212",
      "bjork-surface-muted": "rgba(22, 22, 22, 0.92)",
      "bjork-surface-hover": "#161616",
      "bjork-surface-active": "#202020",
      "bjork-panel": "#0d0d0d",
      "bjork-menu": "rgba(18, 18, 18, 0.98)",
      "bjork-field": "rgba(18, 18, 18, 0.95)",
      "bjork-field-muted": "rgba(18, 18, 18, 0.55)",
      "bjork-field-inset": "rgba(9, 9, 9, 0.75)",
      "bjork-error-bg": "#130d0a",
      "bjork-text": "#ededed",
      "bjork-text-strong": "rgba(237, 237, 237, 0.9)",
      "bjork-text-medium": "rgba(237, 237, 237, 0.72)",
      "bjork-text-muted": "rgba(237, 237, 237, 0.6)",
      "bjork-text-soft": "rgba(237, 237, 237, 0.5)",
      "bjork-text-faint": "rgba(237, 237, 237, 0.22)",
      "bjork-inverted-text": "#080808",
      "bjork-border": "#232323",
      "bjork-border-muted": "#1c1c1c",
      "bjork-border-strong": "#343434",
      "bjork-thumb": "#626262",
      "bjork-track": "#090909",
      "bjork-accent": "#ec5c13",
      "bjork-accent-hover": "#f07832",
      "bjork-accent-soft": "rgba(236, 92, 19, 0.12)",
      "bjork-accent-muted": "rgba(236, 92, 19, 0.24)",
      "bjork-accent-badge": "#b84a12",
      "bjork-accent-badge-foreground": "#fff2ea",
      "bjork-accent-foreground": "#fff2ea",
      "bjork-accent-fill": "#b84a12",
      "bjork-accent-fill-hover": "#a84a14",
      "bjork-shadow-surface": "inset 0 7px 14px rgba(255, 255, 255, 0.03), inset 0 0.5px 0.5px rgba(255, 255, 255, 0.06), 0 14px 20px -6px rgba(0, 0, 0, 0.45)",
      "bjork-shadow-soft": "inset 0 1px 0 rgba(255, 255, 255, 0.045)",
      "bjork-shadow-panel": "inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 18px 36px -28px rgba(0, 0, 0, 0.9)",
      "bjork-shadow-menu": "inset 0 1px 0 rgba(255, 255, 255, 0.055), inset 0 12px 24px rgba(255, 255, 255, 0.018), inset 0 -18px 26px rgba(0, 0, 0, 0.24), 0 22px 42px -22px rgba(0, 0, 0, 0.9)",
      "bjork-shadow-inset": "inset 0 1px 10px rgba(0, 0, 0, 0.45)",
      "bjork-ring-offset": "#080808"
    }
  },
  "css": {
    ".bjork-range": {
      "box-shadow": "inset 0 1px 1px rgba(255, 255, 255, 0.04), 0 0 14px rgba(189, 69, 20, 0.06)"
    },
    ".bjork-range::-webkit-slider-thumb": {
      "appearance": "none",
      "width": "16px",
      "height": "8px",
      "border": "0",
      "border-radius": "999px",
      "background": "var(--bjork-thumb)",
      "box-shadow": "inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.42)"
    },
    ".bjork-range::-moz-range-thumb": {
      "width": "16px",
      "height": "8px",
      "border": "0",
      "border-radius": "999px",
      "background": "var(--bjork-thumb)",
      "box-shadow": "inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.42)"
    },
    ".bjork-layered-button-accent, .bjork-layered-button-raised": {
      "position": "relative",
      "isolation": "isolate",
      "appearance": "none",
      "overflow": "hidden",
      "border": "0",
      "border-radius": "13px",
      "box-shadow": "inset 0 1px 0 #ffffff38, 0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
      "transition": "filter 150ms ease-out, box-shadow 150ms ease-out"
    },
    ".bjork-layered-button-accent::after, .bjork-layered-button-raised::after": {
      "position": "absolute",
      "inset": "0",
      "pointer-events": "none",
      "content": "\"\"",
      "border": "1.5px solid transparent",
      "border-radius": "inherit",
      "background": "linear-gradient(#ffffffb8, #0000003d 41% 75%, #ffffff47) border-box",
      "mix-blend-mode": "overlay",
      "-webkit-mask-image": "linear-gradient(#000, #000), linear-gradient(#000, #000)",
      "mask-image": "linear-gradient(#000, #000), linear-gradient(#000, #000)",
      "-webkit-mask-clip": "padding-box, border-box",
      "mask-clip": "padding-box, border-box",
      "-webkit-mask-origin": "padding-box, border-box",
      "mask-origin": "padding-box, border-box",
      "-webkit-mask-composite": "xor",
      "mask-composite": "exclude"
    },
    ".bjork-layered-button-accent": {
      "color": "oklch(100% 0 0)",
      "text-shadow": "0 -1px #00000040",
      "background": "radial-gradient(ellipse at -20px top, rgba(255, 255, 255, 0.14), transparent), linear-gradient(180deg, #ec5c13 0%, #ec5c13 62%, color-mix(in oklab, #ec5c13 84%, black 16%) 100%)"
    },
    ".bjork-layered-button-raised": {
      "color": "oklch(100% 0 0)",
      "text-shadow": "0 -1px #00000026",
      "background": "radial-gradient(ellipse at -20px top, #ffffff38, #fff0), linear-gradient(180deg, oklch(0.1881 0.006 265), oklch(0.5493 0.0081 265))"
    },
    ".dark .bjork-layered-button-raised": {
      "color": "oklch(0.2574 0.0056 265)",
      "text-shadow": "0 -1px #00000026",
      "background": "radial-gradient(ellipse at -20px top, #ffffff38, #fff0), linear-gradient(180deg, color-mix(in oklab, oklch(0.9674 0.0013 265) 80%, oklch(0.2574 0.0056 265) 20%), color-mix(in oklab, oklch(0.669 0.0107 265) 80%, oklch(0.2574 0.0056 265) 20%))"
    },
    "@media (hover: hover)": {
      ".bjork-layered-button-accent:hover": {
        "filter": "brightness(1.08) saturate(1.04)"
      },
      ".bjork-layered-button-raised:hover": {
        "filter": "brightness(1.08) contrast(0.9)"
      }
    }
  },
  "meta": {
    "collection": "Blocks",
    "registryUrl": "https://ui.isaiahbjork.com/marketing-hero-product.json",
    "installCommand": "npx shadcn@latest add https://ui.isaiahbjork.com/marketing-hero-product.json"
  },
  "type": "registry:block"
}