{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"cover-flow","type":"registry:block","title":"Cover Flow","description":"Browse covers in 3D – drag, flick or scrub the row, it springs to the nearest cover; images drift in their frames over a soft reflection","dependencies":[],"files":[{"path":"illustrations/cover-flow/cover-flow.tsx","type":"registry:block","content":"\"use client\";\n\nimport {\n  useCallback,\n  useEffect,\n  useLayoutEffect,\n  useRef,\n  useState,\n  type KeyboardEvent,\n  type PointerEvent as ReactPointerEvent,\n  type ReactNode,\n} from \"react\";\n\n/*\n * Cover Flow – browse covers in 3D, in a single self-contained file.\n * The cover in front faces you; the others turn away and stack up on both sides, with a soft reflection\n * on the floor. Drag, flick, scrub with the trackpad, use the arrow keys or click a cover – a spring\n * carries the row along and settles on the nearest cover. The caption below rolls to the new title.\n * Everything moves on the GPU (transforms only) and React re-renders only when the front cover changes.\n * The styles are injected below, so no extra files are needed.\n */\n\nexport type CoverFlowItem = {\n  id: string | number;\n  title?: string;\n  subtitle?: string;\n  /** Image URL – or pass your own cover with `cover` */\n  image?: string;\n  alt?: string;\n  /** Any content instead of an image: artwork, a video, a product card */\n  cover?: ReactNode;\n};\n\nexport type CoverFlowProps = {\n  items: CoverFlowItem[];\n  /** Controlled front cover */\n  index?: number;\n  /** Starting cover when uncontrolled – defaults to the middle one */\n  defaultIndex?: number;\n  onIndexChange?: (index: number) => void;\n  /** Clicking (or pressing Enter on) the cover in front */\n  onSelect?: (item: CoverFlowItem, index: number) => void;\n  /** Cover size in px – scales down on narrow containers */\n  itemWidth?: number;\n  itemHeight?: number;\n  /** How far the side covers turn away, in degrees */\n  angle?: number;\n  /** Mirror the covers on the floor */\n  reflection?: boolean;\n  /** Title and subtitle of the front cover */\n  caption?: boolean;\n  /** Replaces the default caption (title and subtitle) */\n  renderCaption?: (item: CoverFlowItem, index: number) => ReactNode;\n  /** Previous / next buttons next to the caption */\n  controls?: boolean;\n  /** A row of small position ticks under the caption */\n  ticks?: boolean;\n  /** A soft click each time a new cover reaches the front */\n  sound?: boolean;\n  \"aria-label\"?: string;\n  className?: string;\n};\n\nconst VISIBLE = 7; // covers drawn on each side\nconst DRAG_PX = 110; // drag distance per cover, before scaling\n\nexport function CoverFlow({\n  items,\n  index,\n  defaultIndex,\n  onIndexChange,\n  onSelect,\n  itemWidth = 280,\n  itemHeight = 280,\n  angle = 50,\n  reflection = true,\n  caption = true,\n  renderCaption,\n  controls = true,\n  ticks = true,\n  sound = false,\n  \"aria-label\": ariaLabel = \"Cover flow\",\n  className,\n}: CoverFlowProps) {\n  const count = items.length;\n  const last = Math.max(count - 1, 0);\n  const clamp = (v: number) => Math.min(Math.max(v, 0), last);\n  const start = clamp(index ?? defaultIndex ?? Math.floor(last / 2));\n\n  const [active, setActive] = useState(start);\n  const [dir, setDir] = useState(1); // direction of travel, for the caption\n  const [scale, setScale] = useState(1);\n\n  const root = useRef<HTMLDivElement>(null);\n  const cards = useRef<(HTMLDivElement | null)[]>([]);\n  // Motion state lives outside React: pos follows target on a spring, painted every frame\n  const m = useRef({ pos: start, target: start, vel: 0, raf: 0, last: 0, active: start });\n  const opts = useRef({ angle, scale, itemWidth, onIndexChange, sound, count });\n  opts.current = { angle, scale, itemWidth, onIndexChange, sound, count };\n\n  const reduced = useRef(false);\n  useEffect(() => {\n    const q = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n    reduced.current = q.matches;\n    const on = () => (reduced.current = q.matches);\n    q.addEventListener(\"change\", on);\n    return () => q.removeEventListener(\"change\", on);\n  }, []);\n\n  // A short, soft tick – made with Web Audio, no sound file\n  const audio = useRef<AudioContext | null>(null);\n  const tick = () => {\n    const ctx = audio.current;\n    if (!ctx || ctx.state !== \"running\") return;\n    const t = ctx.currentTime;\n    const osc = ctx.createOscillator();\n    const gain = ctx.createGain();\n    osc.type = \"triangle\";\n    osc.frequency.setValueAtTime(2200, t);\n    osc.frequency.exponentialRampToValueAtTime(900, t + 0.03);\n    gain.gain.setValueAtTime(0.0001, t);\n    gain.gain.exponentialRampToValueAtTime(0.05, t + 0.004);\n    gain.gain.exponentialRampToValueAtTime(0.0001, t + 0.045);\n    osc.connect(gain).connect(ctx.destination);\n    osc.start(t);\n    osc.stop(t + 0.05);\n  };\n  const wakeAudio = () => {\n    if (!opts.current.sound) return;\n    const Ctx = window.AudioContext ?? (window as unknown as { webkitAudioContext?: typeof AudioContext }).webkitAudioContext;\n    if (!audio.current && Ctx) audio.current = new Ctx();\n    if (audio.current?.state === \"suspended\") void audio.current.resume();\n  };\n  useEffect(() => () => void audio.current?.close(), []);\n\n  // Place every cover for the current (fractional) position\n  const paint = useCallback(() => {\n    const { pos } = m.current;\n    const { angle: a, scale: s, itemWidth: w } = opts.current;\n    const gap = w * 0.78 * s; // center cover to the first side cover\n    const step = w * 0.27 * s; // between side covers\n    const depth = w * 0.7 * s;\n    cards.current.forEach((el, i) => {\n      if (!el) return;\n      const d = i - pos;\n      const ad = Math.abs(d);\n      if (ad > VISIBLE + 1) {\n        el.style.visibility = \"hidden\";\n        return;\n      }\n      const t = Math.min(ad, 1); // 0 in front, 1 once fully turned\n      const dir = Math.sign(d);\n      const x = dir * (t * gap + Math.max(ad - 1, 0) * step);\n      el.style.visibility = \"\";\n      const k = 1 - t * 0.08 - Math.min(Math.max(ad - 1, 0), 4) * 0.015; // recede a little more with distance\n      el.style.transform = `translate3d(${x}px, 0, ${-t * depth}px) rotateY(${-dir * t * a}deg) scale(${k.toFixed(4)})`;\n      el.style.zIndex = String(1000 - Math.round(ad * 10));\n      el.style.setProperty(\"--ui-cf-t\", t.toFixed(3));\n      el.style.setProperty(\"--ui-cf-d\", Math.min(Math.max(d, -1.5), 1.5).toFixed(3)); // drives the image drift\n      el.dataset.side = d < 0 ? \"left\" : \"right\";\n    });\n    const now = Math.round(Math.min(Math.max(pos, 0), opts.current.count - 1));\n    if (now !== m.current.active) {\n      setDir(now > m.current.active ? 1 : -1);\n      m.current.active = now;\n      setActive(now);\n      opts.current.onIndexChange?.(now);\n      tick();\n    }\n  }, []);\n\n  // Spring toward the target; stops itself once settled\n  const run = useCallback(() => {\n    const s = m.current;\n    if (s.raf) return;\n    s.last = performance.now();\n    const frame = (now: number) => {\n      const dt = Math.min(now - s.last, 32) / 1000;\n      s.last = now;\n      const k = 190;\n      const c = 2 * Math.sqrt(k) * 0.92; // a hair under critical: settles with the faintest give\n      s.vel += (k * (s.target - s.pos) - c * s.vel) * dt;\n      s.pos += s.vel * dt;\n      if (Math.abs(s.target - s.pos) < 0.0006 && Math.abs(s.vel) < 0.002) {\n        s.pos = s.target;\n        s.vel = 0;\n        s.raf = 0;\n        paint();\n        return;\n      }\n      paint();\n      s.raf = requestAnimationFrame(frame);\n    };\n    s.raf = requestAnimationFrame(frame);\n  }, [paint]);\n\n  const goTo = useCallback(\n    (i: number) => {\n      const s = m.current;\n      s.target = Math.min(Math.max(Math.round(i), 0), opts.current.count - 1);\n      if (reduced.current) {\n        s.pos = s.target;\n        s.vel = 0;\n        paint();\n      } else run();\n    },\n    [paint, run],\n  );\n\n  useEffect(() => () => cancelAnimationFrame(m.current.raf), []);\n\n  // Controlled index\n  useEffect(() => {\n    if (index !== undefined && index !== Math.round(m.current.target)) goTo(index);\n  }, [index, goTo]);\n\n  // Keep the position valid when items are added or removed\n  useEffect(() => {\n    if (m.current.target > last) goTo(last);\n    else paint();\n  }, [last, goTo, paint]);\n\n  // Scale covers down when the container is narrow\n  useLayoutEffect(() => {\n    const el = root.current;\n    if (!el) return;\n    const fit = () => setScale(Math.min(1, Math.max(0.5, el.clientWidth / (itemWidth * 3.2))));\n    fit();\n    const ro = new ResizeObserver(fit);\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, [itemWidth]);\n  // After every render: items may have been reordered or resized (cheap – React renders only on a new front cover)\n  useLayoutEffect(paint);\n\n  // Trackpad / horizontal wheel scrubs; vertical scrolling stays with the page\n  const snapTimer = useRef(0);\n  useEffect(() => {\n    const el = root.current;\n    if (!el) return;\n    const onWheel = (e: WheelEvent) => {\n      const dx = e.shiftKey && !e.deltaX ? e.deltaY : e.deltaX;\n      if (Math.abs(dx) <= Math.abs(e.deltaY) && !e.shiftKey) return;\n      e.preventDefault();\n      wakeAudio();\n      const s = m.current;\n      const unit = DRAG_PX * opts.current.scale * 1.4;\n      s.target = Math.min(Math.max(s.target + dx / unit, -0.35), opts.current.count - 1 + 0.35);\n      run();\n      window.clearTimeout(snapTimer.current);\n      // Settle with the swipe's momentum: lean toward the direction it was going\n      snapTimer.current = window.setTimeout(() => goTo(s.target + Math.sign(dx) * 0.3), 110);\n    };\n    el.addEventListener(\"wheel\", onWheel, { passive: false });\n    return () => {\n      el.removeEventListener(\"wheel\", onWheel);\n      window.clearTimeout(snapTimer.current);\n    };\n  }, [run, goTo]);\n\n  // Drag and flick: the row follows the finger 1:1, a flick carries on, then it settles on a cover\n  const drag = useRef<{ id: number; x: number; from: number; moved: boolean; hit: number | null; samples: { x: number; t: number }[] } | null>(null);\n  const onPointerDown = (e: ReactPointerEvent<HTMLDivElement>) => {\n    if (e.button !== 0) return;\n    wakeAudio();\n    const hit = (e.target as HTMLElement).closest<HTMLElement>(\"[data-cf-index]\");\n    drag.current = {\n      id: e.pointerId,\n      x: e.clientX,\n      from: m.current.pos,\n      moved: false,\n      hit: hit ? Number(hit.dataset.cfIndex) : null,\n      samples: [{ x: e.clientX, t: performance.now() }],\n    };\n  };\n  const onPointerMove = (e: ReactPointerEvent<HTMLDivElement>) => {\n    const d = drag.current;\n    if (!d || d.id !== e.pointerId) return;\n    const dx = e.clientX - d.x;\n    if (!d.moved) {\n      if (Math.abs(dx) < 6) return;\n      d.moved = true;\n      e.currentTarget.setPointerCapture(e.pointerId);\n      e.currentTarget.dataset.dragging = \"\";\n    }\n    const s = m.current;\n    cancelAnimationFrame(s.raf);\n    s.raf = 0;\n    let p = d.from - dx / (DRAG_PX * opts.current.scale);\n    const max = opts.current.count - 1;\n    if (p < 0) p = p * 0.3; // rubber band past the ends\n    if (p > max) p = max + (p - max) * 0.3;\n    s.pos = s.target = p;\n    s.vel = 0;\n    d.samples.push({ x: e.clientX, t: performance.now() });\n    if (d.samples.length > 6) d.samples.shift();\n    paint();\n  };\n  const onPointerUp = (e: ReactPointerEvent<HTMLDivElement>) => {\n    const d = drag.current;\n    if (!d || d.id !== e.pointerId) return;\n    drag.current = null;\n    delete e.currentTarget.dataset.dragging;\n    if (!d.moved) {\n      // A click: bring that cover to the front, or select it if it is already there\n      if (d.hit === null) return;\n      if (d.hit === Math.round(m.current.target)) onSelect?.(items[d.hit], d.hit);\n      else goTo(d.hit);\n      return;\n    }\n    const first = d.samples[0];\n    const lastS = d.samples[d.samples.length - 1];\n    const dt = Math.max(lastS.t - first.t, 1);\n    const v = -((lastS.x - first.x) / dt) * 1000 / (DRAG_PX * opts.current.scale); // covers per second\n    const s = m.current;\n    s.vel = reduced.current ? 0 : v;\n    let to = Math.round(s.pos + v * 0.18);\n    // A quick flick always moves at least one cover\n    if (Math.abs(v) > 0.8 && to === Math.round(d.from)) to += Math.sign(v);\n    goTo(to);\n  };\n\n  const onKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n    const cur = Math.round(m.current.target);\n    const keys: Record<string, number> = { ArrowLeft: cur - 1, ArrowRight: cur + 1, Home: 0, End: last };\n    if (e.key in keys) {\n      e.preventDefault();\n      wakeAudio();\n      goTo(keys[e.key]);\n    } else if ((e.key === \"Enter\" || e.key === \" \") && onSelect && e.target === e.currentTarget) {\n      e.preventDefault();\n      onSelect(items[cur], cur);\n    }\n  };\n\n  const current = items[active];\n  const w = Math.round(itemWidth * scale);\n  const h = Math.round(itemHeight * scale);\n\n  const face = (item: CoverFlowItem, decorative = false) => (\n    <div className=\"ui-cf__media\">\n      {item.cover ??\n        (item.image ? (\n          <img\n            src={item.image}\n            alt={decorative ? \"\" : (item.alt ?? item.title ?? \"\")}\n            draggable={false}\n            loading=\"lazy\"\n            decoding=\"async\"\n            // A picture that doesn't load leaves the plain cover instead of a broken image and its alt text\n            onError={(e) => (e.currentTarget.style.visibility = \"hidden\")}\n          />\n        ) : null)}\n    </div>\n  );\n\n  return (\n    <div\n      className={[\"ui-cf\", className].filter(Boolean).join(\" \")}\n      style={{ \"--ui-cf-w\": `${w}px`, \"--ui-cf-h\": `${h}px` } as React.CSSProperties}\n      data-reflection={reflection || undefined}\n    >\n      {/* React 19 hoists this into <head> once, no matter how many cover flows render */}\n      <style href=\"ui-cover-flow\" precedence=\"default\">\n        {css}\n      </style>\n\n      <div\n        ref={root}\n        className=\"ui-cf__viewport\"\n        role=\"region\"\n        aria-roledescription=\"carousel\"\n        aria-label={ariaLabel}\n        tabIndex={0}\n        onKeyDown={onKeyDown}\n        onPointerDown={onPointerDown}\n        onPointerMove={onPointerMove}\n        onPointerUp={onPointerUp}\n        onPointerCancel={onPointerUp}\n        data-selectable={onSelect ? \"\" : undefined}\n      >\n        <div className=\"ui-cf__stage\" style={{ perspective: `${Math.round(1000 * scale)}px` }}>\n          {items.map((item, i) => (\n            <div\n              key={item.id}\n              ref={(el) => {\n                cards.current[i] = el;\n              }}\n              className=\"ui-cf__item\"\n              data-cf-index={i}\n              data-active={i === active || undefined}\n              role=\"group\"\n              aria-roledescription=\"slide\"\n              aria-label={`${i + 1} of ${count}${item.title ? `: ${item.title}` : \"\"}`}\n              aria-hidden={i !== active || undefined}\n            >\n              <div className=\"ui-cf__ground\" aria-hidden=\"true\" />\n              <div className=\"ui-cf__card\">{face(item)}</div>\n              {reflection && (\n                <div className=\"ui-cf__reflection\" aria-hidden=\"true\" inert>\n                  <div className=\"ui-cf__card\">{face(item, true)}</div>\n                </div>\n              )}\n            </div>\n          ))}\n        </div>\n      </div>\n\n      {(caption || controls || ticks) && (\n        <div className=\"ui-cf__footer\">\n          <div className=\"ui-cf__row\">\n          {controls && (\n            <button type=\"button\" className=\"ui-cf__nav\" aria-label=\"Previous\" disabled={active === 0} onClick={() => goTo(Math.round(m.current.target) - 1)}>\n              <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                <path d=\"M10 3.5 5.5 8l4.5 4.5\" />\n              </svg>\n            </button>\n          )}\n          {caption && (\n            <div className=\"ui-cf__caption\" aria-live=\"polite\">\n              <div key={current?.id} className=\"ui-cf__caption-in\" data-dir={dir > 0 ? \"next\" : \"prev\"}>\n                {current &&\n                  (renderCaption ? (\n                    renderCaption(current, active)\n                  ) : (\n                    <>\n                      {current.title && <div className=\"ui-cf__title\">{current.title}</div>}\n                      {current.subtitle && <div className=\"ui-cf__subtitle\">{current.subtitle}</div>}\n                    </>\n                  ))}\n              </div>\n            </div>\n          )}\n          {controls && (\n            <button type=\"button\" className=\"ui-cf__nav\" aria-label=\"Next\" disabled={active === last} onClick={() => goTo(Math.round(m.current.target) + 1)}>\n              <svg viewBox=\"0 0 16 16\" aria-hidden=\"true\">\n                <path d=\"M6 3.5 10.5 8 6 12.5\" />\n              </svg>\n            </button>\n          )}\n          </div>\n          {/* Up to 15 covers a tick each – beyond that a quiet count, ticks would run past the edge */}\n          {ticks && count > 15 && (\n            <div className=\"ui-cf__counter\" aria-hidden=\"true\">\n              {active + 1} / {count}\n            </div>\n          )}\n          {ticks && count > 1 && count <= 15 && (\n            <div className=\"ui-cf__ticks\">\n              {items.map((item, i) => (\n                <button\n                  key={item.id}\n                  type=\"button\"\n                  tabIndex={-1}\n                  className=\"ui-cf__tick\"\n                  aria-label={`Show ${item.title ?? `cover ${i + 1}`}`}\n                  aria-current={i === active || undefined}\n                  onClick={() => goTo(i)}\n                />\n              ))}\n            </div>\n          )}\n        </div>\n      )}\n    </div>\n  );\n}\n\nconst css = /* css */ `\n.ui-cf {\n  --ui-cf-ink: #171717;\n  --ui-cf-muted: #8a8a8a;\n  --ui-cf-card: #f1f1f1;\n  --ui-cf-edge: rgba(0, 0, 0, 0.08);\n  --ui-cf-dim: rgba(255, 255, 255, 0.24);\n  --ui-cf-shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 10px 20px -12px rgba(0, 0, 0, 0.18);\n  --ui-cf-reflect: 0.22;\n  --ui-cf-ground: rgba(0, 0, 0, 0.16);\n  --ui-cf-tick: rgba(0, 0, 0, 0.16);\n  --ui-cf-nav: #ffffff;\n  --ui-cf-nav-line: #e7e7e7;\n  --ui-cf-focus: rgba(23, 23, 23, 0.25);\n  --ui-cf-ease: cubic-bezier(0.22, 1, 0.36, 1);\n  display: grid;\n  gap: 4px;\n  width: 100%;\n  min-width: 0;\n  font-family: \"Inter\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif;\n  -webkit-font-smoothing: antialiased;\n}\n\n/* Soft fade on both sides, so the stacks run out instead of being cut off */\n.ui-cf__viewport {\n  position: relative;\n  overflow: hidden;\n  padding: calc(var(--ui-cf-h) * 0.08) 0 0;\n  height: calc(var(--ui-cf-h) * 1.08);\n  border-radius: 12px;\n  outline: none;\n  cursor: grab;\n  touch-action: pan-y;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);\n  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);\n}\n.ui-cf[data-reflection] .ui-cf__viewport { height: calc(var(--ui-cf-h) * 1.4); }\n.ui-cf__viewport[data-dragging] { cursor: grabbing; }\n.ui-cf__viewport:focus-visible .ui-cf__item[data-active] .ui-cf__card {\n  box-shadow: var(--ui-cf-shadow), 0 0 0 3px var(--ui-cf-focus);\n}\n\n.ui-cf__stage {\n  position: relative;\n  height: var(--ui-cf-h);\n  transform-style: preserve-3d;\n}\n.ui-cf__item {\n  position: absolute;\n  top: 0;\n  left: 50%;\n  width: var(--ui-cf-w);\n  height: var(--ui-cf-h);\n  margin-left: calc(var(--ui-cf-w) / -2);\n  transform-style: preserve-3d;\n  will-change: transform;\n}\n.ui-cf__viewport[data-selectable] .ui-cf__item[data-active] { cursor: pointer; }\n.ui-cf__card {\n  position: relative;\n  width: 100%;\n  height: 100%;\n  overflow: hidden;\n  border-radius: 12px;\n  background: var(--ui-cf-card);\n  box-shadow: var(--ui-cf-shadow);\n}\n.ui-cf__media {\n  position: absolute;\n  inset: 0 -8%;\n  transform: translateX(calc(var(--ui-cf-d, 0) * -5%));\n}\n.ui-cf__media > img {\n  display: block;\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  pointer-events: none;\n}\n/* A soft shadow on the floor that fades as a cover turns away */\n.ui-cf__ground {\n  position: absolute;\n  left: 10%;\n  right: 10%;\n  bottom: -3px;\n  height: 8px;\n  border-radius: 50%;\n  background: var(--ui-cf-ground);\n  filter: blur(5px);\n  opacity: calc(1 - var(--ui-cf-t, 0) * 0.7);\n  pointer-events: none;\n}\n/* Hairline edge, a dim that grows as a cover turns away, and a sheen on the side facing the light */\n.ui-cf__card::before,\n.ui-cf__card::after {\n  content: \"\";\n  position: absolute;\n  inset: 0;\n  border-radius: inherit;\n  pointer-events: none;\n}\n.ui-cf__card::before {\n  z-index: 2;\n  box-shadow: inset 0 0 0 1px var(--ui-cf-edge);\n  background: linear-gradient(90deg, rgba(255, 255, 255, 0.22), transparent 45%);\n  opacity: calc(var(--ui-cf-t, 0) * 0.9);\n}\n.ui-cf__item[data-side=\"right\"] .ui-cf__card::before {\n  background: linear-gradient(270deg, rgba(255, 255, 255, 0.22), transparent 45%);\n}\n.ui-cf__card::after {\n  z-index: 1;\n  background: var(--ui-cf-dim);\n  opacity: var(--ui-cf-t, 0);\n}\n\n/* The floor: a flipped copy that fades out – a mask, so it works on any background */\n.ui-cf__reflection {\n  position: absolute;\n  top: 100%;\n  left: 0;\n  width: 100%;\n  height: 32%;\n  margin-top: 2px;\n  overflow: hidden;\n  pointer-events: none;\n  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, var(--ui-cf-reflect)), transparent 85%);\n  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, var(--ui-cf-reflect)), transparent 85%);\n}\n.ui-cf__reflection > .ui-cf__card {\n  height: var(--ui-cf-h);\n  transform: scaleY(-1);\n  transform-origin: 50% calc(var(--ui-cf-h) / 2);\n  box-shadow: none;\n}\n.ui-cf__reflection > .ui-cf__card {\n  position: absolute;\n  bottom: auto;\n  top: 0;\n}\n\n/* Caption with previous / next on either side, position ticks below */\n.ui-cf__footer {\n  position: relative;\n  z-index: 1;\n  display: grid;\n  justify-items: center;\n  gap: 14px;\n  margin-top: calc(var(--ui-cf-h) * -0.04);\n}\n.ui-cf:not([data-reflection]) .ui-cf__footer { margin-top: 12px; }\n.ui-cf__row {\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  gap: 20px;\n  min-height: 44px;\n}\n.ui-cf__counter { color: var(--ui-cf-muted); font-size: 12px; line-height: 14px; font-variant-numeric: tabular-nums; }\n.ui-cf__ticks {\n  display: flex;\n  align-items: center;\n  gap: 2px;\n}\n.ui-cf__tick {\n  display: grid;\n  place-items: center;\n  width: 14px;\n  height: 14px;\n  padding: 0;\n  border: 0;\n  background: none;\n  cursor: pointer;\n}\n.ui-cf__tick::before {\n  content: \"\";\n  width: 5px;\n  height: 5px;\n  border-radius: 999px;\n  background: var(--ui-cf-tick);\n  transition: width 320ms var(--ui-cf-ease), background-color 200ms ease;\n}\n.ui-cf__tick[aria-current]::before {\n  width: 14px;\n  background: var(--ui-cf-ink);\n}\n.ui-cf__tick:hover::before { background: var(--ui-cf-muted); }\n.ui-cf__tick[aria-current]:hover::before { background: var(--ui-cf-ink); }\n.ui-cf__caption {\n  display: grid;\n  min-width: min(220px, 50vw);\n  text-align: center;\n}\n.ui-cf__caption-in { animation: ui-cf-in 420ms var(--ui-cf-ease) both; }\n.ui-cf__caption-in[data-dir=\"prev\"] { animation-name: ui-cf-in-prev; }\n.ui-cf__title {\n  color: var(--ui-cf-ink);\n  font-size: 15px;\n  font-weight: 600;\n  letter-spacing: -0.01em;\n  line-height: 1.35;\n}\n.ui-cf__subtitle {\n  color: var(--ui-cf-muted);\n  font-size: 13px;\n  line-height: 1.4;\n}\n.ui-cf__nav {\n  display: grid;\n  place-items: center;\n  flex: none;\n  width: 32px;\n  height: 32px;\n  padding: 0;\n  border: 0;\n  border-radius: 999px;\n  background: var(--ui-cf-nav);\n  box-shadow: inset 0 0 0 1px var(--ui-cf-nav-line), 0 1px 2px rgba(0, 0, 0, 0.05);\n  color: var(--ui-cf-ink);\n  cursor: pointer;\n  transition: transform 160ms var(--ui-cf-ease), opacity 160ms ease;\n}\n.ui-cf__nav:active { transform: scale(0.92); }\n.ui-cf__nav:disabled { opacity: 0.35; cursor: default; transform: none; }\n.ui-cf__nav:focus-visible { outline: 2px solid var(--ui-cf-focus); outline-offset: 2px; }\n.ui-cf__nav svg {\n  width: 14px;\n  height: 14px;\n  fill: none;\n  stroke: currentColor;\n  stroke-width: 1.7;\n  stroke-linecap: round;\n  stroke-linejoin: round;\n}\n@media (pointer: coarse) {\n  .ui-cf__nav { width: 40px; height: 40px; }\n}\n\n/* The caption rises in from the direction of travel */\n@keyframes ui-cf-in {\n  from { opacity: 0; transform: translate(14px, 4px); filter: blur(3px); }\n  to { opacity: 1; transform: none; filter: none; }\n}\n@keyframes ui-cf-in-prev {\n  from { opacity: 0; transform: translate(-14px, 4px); filter: blur(3px); }\n  to { opacity: 1; transform: none; filter: none; }\n}\n\n@media (prefers-reduced-motion: reduce) {\n  .ui-cf__caption-in { animation: none; }\n  .ui-cf__media { transform: none; }\n  .ui-cf__tick::before { transition: none; }\n  .ui-cf__nav { transition: none; }\n}\n\n/* Dark mode: follows a .dark class or data-theme=\"dark\" on any ancestor, e.g. <html> */\n:where(.dark, [data-theme=\"dark\"]) .ui-cf {\n  --ui-cf-ink: #ededed;\n  --ui-cf-muted: #8f8f8f;\n  --ui-cf-card: #1d1d20;\n  --ui-cf-edge: rgba(255, 255, 255, 0.1);\n  --ui-cf-dim: rgba(0, 0, 0, 0.5);\n  --ui-cf-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 24px -14px rgba(0, 0, 0, 0.6);\n  --ui-cf-reflect: 0.3;\n  --ui-cf-ground: rgba(0, 0, 0, 0.45);\n  --ui-cf-tick: rgba(255, 255, 255, 0.2);\n  --ui-cf-nav: #1d1d20;\n  --ui-cf-nav-line: rgba(255, 255, 255, 0.1);\n  --ui-cf-focus: rgba(255, 255, 255, 0.35);\n}\n`;\n"}]}