{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"testimonial-wall","type":"registry:block","title":"Testimonial Wall","description":"The landing-page wall of quotes – columns that scroll endlessly in opposite directions, ease to a stop on hover and scrub with inertia","dependencies":[],"files":[{"path":"blocks/testimonial-wall/testimonial-wall.tsx","type":"registry:block","content":"\"use client\";\n\nimport { useEffect, useLayoutEffect, useRef, useState, type CSSProperties } from \"react\";\n\n/*\n * Testimonial Wall – the landing-page wall of quotes, in a single self-contained file.\n * Quotes are dealt into columns (3 on wide containers, 2 on tablets, 1 on phones – measured on the wall itself,\n * not the window) that scroll vertically and endlessly, alternating up and down at slightly different speeds.\n * Every column repeats a measured set of cards and wraps by exactly its height, so the loop has no gap and no\n * jump; the top and bottom edges fade out with a mask. One requestAnimationFrame loop owns a velocity per column:\n * hovering or keyboard-focusing a column eases it to a stop, leaving winds it back up, and dragging it with the\n * mouse scrubs it with inertia. On touch the page keeps scrolling natively – pressing and holding a column pauses\n * it to read. It only runs while on screen, and prefers-reduced-motion shows a static grid instead.\n * The styles are injected below.\n */\n\nexport type Testimonial = {\n  /** The quote itself – mix short and long ones, the masonry looks more natural */\n  quote: string;\n  name: string;\n  /** e.g. \"Design Engineer\" */\n  role?: string;\n  /** e.g. \"Fieldnote\" – shown after the role */\n  company?: string;\n  /** Photo URL; without one the initials sit on a soft gray circle */\n  avatar?: string;\n  /** 1–5 – a small, calm gray star row above the quote */\n  rating?: number;\n  /** A small gray check beside the name */\n  verified?: boolean;\n};\n\nexport type TestimonialWallProps = {\n  items: Testimonial[];\n  /** Most columns on a wide container – narrower containers use fewer (2 below 740px, 1 below 480px) */\n  columns?: 1 | 2 | 3;\n  /** Pixels per second of the first column; the others run a little slower and faster */\n  speed?: number;\n  /** Ease a column to a stop while the pointer is over it or a card in it has keyboard focus */\n  pauseOnHover?: boolean;\n  /** Accessible name of the wall */\n  label?: string;\n  /** Extra class on the wrapper – set the height with --ui-tw-height (600px by default) */\n  className?: string;\n};\n\n/** Motion state of one column, kept outside React so the loop never re-renders */\ntype ColState = {\n  /** Offset into the loop in px – the real set starts at -x */\n  y: number;\n  v: number;\n  /** Height of one set, including its trailing gap – the wrap distance */\n  h: number;\n  drag: null | { id: number; lastY: number; lastT: number; moved: number; captured: boolean };\n  /** Pending nudge (px) to bring a focused card into view */\n  seek: number;\n};\n\n/** Run direction and pace of each column: up, down, up – never quite in step */\nconst PACE = [1, -0.84, 1.12];\n/** Where each column starts in its loop, so the rows of cards don't line up */\nconst START = [0, 0.42, 0.18];\n\nconst mod = (n: number, m: number) => (m > 0 ? ((n % m) + m) % m : 0);\nconst clamp = (n: number, a: number, b: number) => Math.min(b, Math.max(a, n));\n\n/** First character of a word as a whole grapheme, so an emoji like 👩🏽‍💻 or an accent never splits */\nconst firstChar = (word: string) =>\n  (typeof Intl.Segmenter === \"function\"\n    ? new Intl.Segmenter().segment(word)[Symbol.iterator]().next().value?.segment\n    : Array.from(word)[0]) ?? \"\";\n\n/** Suffixes that are not a family name – \"Christopher Montgomery III\" reads \"CM\", not \"CI\" */\nconst SUFFIX = /^(jr|sr|i{1,3}|iv|v|vi|phd|md|esq)\\.?,?$/i;\n\n/** First and last word, so \"María José de la Cruz y Fernández\" reads \"MF\" */\nconst initials = (name: string) => {\n  const words = name.split(/\\s+/).filter(Boolean);\n  // Words that start with a letter win, so \"🦊 Fox\" reads \"F\"\n  const named = words.filter((w) => /^\\p{L}/u.test(w));\n  const list = named.length ? named : words;\n  const core = list.length > 1 ? list.filter((w, i) => i === 0 || !SUFFIX.test(w)) : list;\n  const picked = core.length > 1 ? [core[0], core[core.length - 1]] : core;\n  return picked.map((p) => firstChar(p).toUpperCase()).join(\"\") || \"?\";\n};\n\n/** Shows the full text as a tooltip, but only when it is cut off */\nconst showFull = (e: React.PointerEvent<HTMLElement>) => {\n  const el = e.currentTarget;\n  const cut = el.scrollWidth > el.clientWidth + 1 || el.scrollHeight > el.clientHeight + 1;\n  el.title = cut ? (el.textContent ?? \"\") : \"\";\n};\n\n/** Photo, or the initials when there is none or it fails to load */\nfunction Avatar({ src, name }: { src?: string; name: string }) {\n  const [broken, setBroken] = useState<string | null>(null);\n  return src && broken !== src ? (\n    <img\n      className=\"ui-tw__avatar\"\n      src={src}\n      alt=\"\"\n      width={36}\n      height={36}\n      loading=\"lazy\"\n      decoding=\"async\"\n      draggable={false}\n      onError={() => setBroken(src)}\n    />\n  ) : (\n    <span className=\"ui-tw__avatar ui-tw__avatar--initials\" aria-hidden=\"true\">\n      {initials(name)}\n    </span>\n  );\n}\n\n/** Container width → column count; matches the container queries in the styles */\nconst fit = (width: number, max: number) => Math.min(max, width >= 740 ? 3 : width >= 480 ? 2 : 1);\n\nexport function TestimonialWall({\n  items,\n  columns = 3,\n  speed = 28,\n  pauseOnHover = true,\n  label = \"What customers say\",\n  className,\n}: TestimonialWallProps) {\n  const root = useRef<HTMLDivElement>(null);\n  const cols = useRef<(HTMLDivElement | null)[]>([]);\n  const tracks = useRef<(HTMLDivElement | null)[]>([]);\n  const sets = useRef<(HTMLUListElement | null)[]>([]);\n  const state = useRef<ColState[]>([]);\n  const hover = useRef<boolean[]>([]);\n  const hold = useRef<boolean[]>([]);\n  const focus = useRef<boolean[]>([]);\n  const [fitCount, setCount] = useState<number>(columns);\n  // Never more columns than quotes, so one or two quotes don't leave empty lanes\n  const count = Math.max(1, Math.min(fitCount, items.length));\n  const [copies, setCopies] = useState<number[]>([]);\n  const [reduced, setReduced] = useState(false);\n\n  // Deal the quotes into columns: 1, 2, 3, 1, 2, 3 … so short and long ones mix in every column\n  const dealt: Testimonial[][] = Array.from({ length: count }, (_, c) => items.filter((_, i) => i % count === c));\n\n  // Latest props for the loop without restarting it\n  const live = useRef({ speed, pauseOnHover, count });\n  live.current = { speed, pauseOnHover, count };\n\n  useEffect(() => {\n    const mq = window.matchMedia(\"(prefers-reduced-motion: reduce)\");\n    const sync = () => setReduced(mq.matches);\n    sync();\n    mq.addEventListener(\"change\", sync);\n    return () => mq.removeEventListener(\"change\", sync);\n  }, []);\n\n  // Column count follows the wall's own width (before paint, so it never flashes the wrong layout)\n  useLayoutEffect(() => {\n    const el = root.current;\n    if (!el) return;\n    const measure = () => setCount(fit(el.clientWidth, columns));\n    measure();\n    const ro = new ResizeObserver(measure);\n    ro.observe(el);\n    return () => ro.disconnect();\n  }, [columns]);\n\n  // Measure every column: one set's height and how many copies cover the column plus one wrap\n  useEffect(() => {\n    if (reduced) return;\n    const measure = () => {\n      const next = dealt.map((_, i) => {\n        const set = sets.current[i];\n        const col = cols.current[i];\n        if (!set || !col) return 2;\n        // Layout px, not screen px – a CSS zoom or scale on an ancestor must not skew the wrap distance\n        const scale = col.getBoundingClientRect().height / (col.offsetHeight || 1) || 1;\n        const h = set.getBoundingClientRect().height / scale;\n        const s = (state.current[i] ??= { y: h * (START[i] ?? 0), v: 0, h, drag: null, seek: 0 });\n        // Keep the same spot within the set when its height changes (fewer columns, font load)\n        if (s.h > 0 && h > 0 && s.h !== h) s.y = (s.y / s.h) * h;\n        s.h = h;\n        // Capped, as a guard against a column that isn't given a height\n        return h > 0 ? Math.min(12, Math.ceil(col.clientHeight / h) + 1) : 2;\n      });\n      state.current.length = dealt.length;\n      setCopies((prev) => (prev.length === next.length && prev.every((c, i) => c === next[i]) ? prev : next));\n    };\n    measure();\n    const ro = new ResizeObserver(measure);\n    for (const el of [...sets.current.slice(0, count), ...cols.current.slice(0, count)]) if (el) ro.observe(el);\n    return () => ro.disconnect();\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [reduced, count, items]);\n\n  // The loop: one velocity per column that eases toward its target, so stops and starts are never abrupt\n  useEffect(() => {\n    const el = root.current;\n    if (reduced || !el) return;\n    let raf = 0;\n    let last = 0;\n    let visible = false;\n\n    const frame = (now: number) => {\n      const dt = last ? Math.min(0.05, (now - last) / 1000) : 0;\n      last = now;\n      const { speed, pauseOnHover, count } = live.current;\n      for (let i = 0; i < count; i++) {\n        const s = state.current[i];\n        const track = tracks.current[i];\n        if (!s || !track || s.h <= 0) continue;\n        const pace = count === 1 ? 1 : PACE[i % 3]!;\n        const stopped = hold.current[i] || focus.current[i] || (pauseOnHover && hover.current[i]);\n        if (!s.drag) {\n          const target = stopped ? 0 : speed * pace;\n          // A fling coasts out; slowing down for hover is a little quicker than winding back up\n          const fling = Math.abs(s.v - target) > Math.max(120, speed * 2);\n          const tau = fling ? 0.55 : stopped ? 0.32 : 0.7;\n          s.v += (target - s.v) * (1 - Math.exp(-dt / tau));\n          s.y += s.v * dt;\n          if (s.seek) {\n            const step = s.seek * (1 - Math.exp(-dt / 0.12));\n            s.y += step;\n            s.seek = Math.abs(s.seek - step) < 0.5 ? 0 : s.seek - step;\n          }\n        }\n        // While a card has keyboard focus the column may sit just outside one wrap (see onFocusCard);\n        // otherwise the offset stays inside one set, where every copy looks the same\n        s.y = focus.current[i] ? clamp(s.y, -s.h, s.h * 2) : mod(s.y, s.h);\n        track.style.transform = `translate3d(0, ${-(s.h + s.y)}px, 0)`;\n      }\n      raf = visible ? requestAnimationFrame(frame) : 0;\n    };\n\n    // Runs only while on screen\n    const io = new IntersectionObserver(([e]) => {\n      visible = e.isIntersecting;\n      if (visible && !raf) {\n        last = 0;\n        raf = requestAnimationFrame(frame);\n      }\n    });\n    io.observe(el);\n    return () => {\n      io.disconnect();\n      cancelAnimationFrame(raf);\n    };\n  }, [reduced]);\n\n  /* ---------- Drag (mouse, pen) and press-and-hold (touch) ---------- */\n\n  const onPointerDown = (i: number) => (e: React.PointerEvent<HTMLDivElement>) => {\n    const s = state.current[i];\n    if (!s) return;\n    // Touch: the page keeps scrolling natively, a finger resting on a column just holds it still\n    if (e.pointerType === \"touch\") {\n      hold.current[i] = true;\n      return;\n    }\n    if (e.button !== 0) return;\n    s.drag = { id: e.pointerId, lastY: e.clientY, lastT: e.timeStamp, moved: 0, captured: false };\n    s.v = 0;\n  };\n\n  const onPointerMove = (i: number) => (e: React.PointerEvent<HTMLDivElement>) => {\n    const s = state.current[i];\n    const d = s?.drag;\n    if (!s || !d || d.id !== e.pointerId) return;\n    const col = e.currentTarget;\n    const scale = col.getBoundingClientRect().height / (col.offsetHeight || 1) || 1;\n    const dy = (e.clientY - d.lastY) / scale;\n    const dt = Math.max(1, e.timeStamp - d.lastT) / 1000;\n    d.moved += Math.abs(dy);\n    // Capture only once it is clearly a drag, so a plain click still focuses a card or follows a link\n    if (!d.captured && d.moved > 4) {\n      d.captured = true;\n      col.setPointerCapture(e.pointerId);\n      col.setAttribute(\"data-dragging\", \"\");\n    }\n    s.y -= dy;\n    // Smoothed release velocity in px/s\n    s.v = s.v * 0.6 + (-dy / dt) * 0.4;\n    d.lastY = e.clientY;\n    d.lastT = e.timeStamp;\n  };\n\n  const onPointerUp = (i: number) => (e: React.PointerEvent<HTMLDivElement>) => {\n    hold.current[i] = false;\n    const s = state.current[i];\n    const d = s?.drag;\n    if (!s || !d || d.id !== e.pointerId) return;\n    // A pause before letting go means no fling\n    if (e.timeStamp - d.lastT > 80) s.v = 0;\n    s.v = clamp(s.v, -2400, 2400);\n    s.drag = null;\n    e.currentTarget.removeAttribute(\"data-dragging\");\n    if (d.captured) {\n      // Swallow the click that ends a drag, so a link inside a quote doesn't open\n      const col = e.currentTarget;\n      const stop = (ev: MouseEvent) => {\n        ev.preventDefault();\n        ev.stopPropagation();\n      };\n      col.addEventListener(\"click\", stop, { capture: true, once: true });\n      setTimeout(() => col.removeEventListener(\"click\", stop, { capture: true }), 0);\n    }\n  };\n\n  /* ---------- Keyboard: a focused card stops its column and is nudged into view ---------- */\n\n  const onFocusCard = (i: number) => (e: React.FocusEvent<HTMLElement>) => {\n    const s = state.current[i];\n    const col = cols.current[i];\n    if (reduced || !s || !col || s.h <= 0 || !e.currentTarget.matches(\":focus-visible\")) return;\n    // Layout units: the card's place in its set, the column's height\n    const li = e.currentTarget.parentElement as HTMLElement;\n    const top = li.offsetTop;\n    const h = e.currentTarget.offsetHeight;\n    const viewH = col.clientHeight;\n    const pad = Math.min(56, viewH * 0.12);\n    // Only the real set is focusable; pick the wrap (one set up, here or one down) that is closest, so the\n    // nudge is short – every copy looks the same, so the switch is invisible\n    s.y = [s.y - s.h, s.y, s.y + s.h].reduce((best, y) =>\n      Math.abs(top - y - viewH / 2) < Math.abs(top - best - viewH / 2) ? y : best,\n    );\n    const at = top - s.y;\n    if (h > viewH - pad * 2 || at < pad) s.seek = at - pad;\n    else if (at + h > viewH - pad) s.seek = at + h - (viewH - pad);\n    else s.seek = 0;\n  };\n\n  const card = (t: Testimonial, i: number, interactive: boolean, key: string) => {\n    // The dot stays with the role, so a wrap starts cleanly with the company\n    const meta = [t.role?.trim(), t.company?.trim()].filter(Boolean).join(\"\\u00a0· \");\n    const stars = t.rating ? clamp(Math.round(t.rating), 1, 5) : 0;\n    return (\n      <li key={key} className=\"ui-tw__item\">\n        <figure\n          className=\"ui-tw__card\"\n          tabIndex={interactive ? 0 : undefined}\n          onFocus={interactive ? onFocusCard(i) : undefined}\n        >\n          {stars && Number.isFinite(stars) ? (\n            <div className=\"ui-tw__stars\" role=\"img\" aria-label={`Rated ${stars} out of 5`}>\n              {Array.from({ length: 5 }, (_, n) => (\n                <svg key={n} viewBox=\"0 0 16 16\" aria-hidden=\"true\" data-on={n < stars || undefined}>\n                  <path d=\"M8 1.6l1.9 3.95 4.35.6-3.17 3.03.78 4.32L8 11.43 4.14 13.5l.78-4.32L1.75 6.15l4.35-.6L8 1.6z\" />\n                </svg>\n              ))}\n            </div>\n          ) : null}\n          {t.quote.trim() && (\n            <blockquote className=\"ui-tw__quote\">\n              <p dir=\"auto\" onPointerEnter={showFull}>{t.quote.trim()}</p>\n            </blockquote>\n          )}\n          <figcaption className=\"ui-tw__who\">\n            <Avatar src={t.avatar} name={t.name} />\n            <span className=\"ui-tw__id\">\n              <span className=\"ui-tw__name\">\n                <span className=\"ui-tw__name-text\" dir=\"auto\" onPointerEnter={showFull}>{t.name.trim()}</span>\n                {t.verified ? (\n                  <svg className=\"ui-tw__verified\" viewBox=\"0 0 16 16\" role=\"img\" aria-label=\"Verified customer\">\n                    <circle cx=\"8\" cy=\"8\" r=\"7\" />\n                    <path d=\"M5.2 8.1l1.9 1.9 3.7-3.8\" fill=\"none\" stroke=\"var(--ui-tw-card)\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n                  </svg>\n                ) : null}\n              </span>\n              {meta ? <span className=\"ui-tw__meta\" dir=\"auto\" onPointerEnter={showFull}>{meta}</span> : null}\n            </span>\n          </figcaption>\n        </figure>\n      </li>\n    );\n  };\n\n  const cls = [\"ui-tw\", className].filter(Boolean).join(\" \");\n\n  return (\n    <>\n      <style href=\"ui-testimonial-wall\" precedence=\"default\">\n        {css}\n      </style>\n      <div\n        ref={root}\n        className={cls}\n        role=\"region\"\n        aria-label={label}\n        data-cols={count}\n        data-static={reduced || undefined}\n        style={{ \"--ui-tw-cols\": count } as CSSProperties}\n        data-empty={items.length === 0 || undefined}\n      >\n        {items.length === 0 && <p className=\"ui-tw__empty\">No quotes yet</p>}\n        {items.length > 0 && dealt.map((list, i) =>\n          reduced ? (\n            // Reduced motion: a calm, static masonry – every quote once, nothing moves\n            <div key={i} className=\"ui-tw__col\">\n              <ul className=\"ui-tw__set\">{list.map((t, n) => card(t, i, true, String(n)))}</ul>\n            </div>\n          ) : (\n            <div\n              key={i}\n              ref={(n) => {\n                cols.current[i] = n;\n              }}\n              className=\"ui-tw__col\"\n              onPointerEnter={(e) => {\n                if (e.pointerType !== \"touch\") hover.current[i] = true;\n              }}\n              onPointerLeave={() => (hover.current[i] = false)}\n              onPointerDown={onPointerDown(i)}\n              onPointerMove={onPointerMove(i)}\n              onPointerUp={onPointerUp(i)}\n              onPointerCancel={onPointerUp(i)}\n              // Keyboard focus stops the column; a mouse click that focuses a card does not\n              onFocus={(e) => (focus.current[i] = e.target.matches(\":focus-visible\"))}\n              onBlur={(e) => {\n                if (!e.currentTarget.contains(e.relatedTarget as Node | null)) focus.current[i] = false;\n              }}\n            >\n              <div\n                ref={(n) => {\n                  tracks.current[i] = n;\n                }}\n                className=\"ui-tw__track\"\n                style={{ transform: `translate3d(0, ${-((state.current[i]?.h ?? 0) + (state.current[i]?.y ?? 0))}px, 0)` }}\n              >\n                {/* One copy above the real set and enough below it, so a nudge or a wrap never shows a gap */}\n                {Array.from({ length: 1 + Math.max(2, copies[i] ?? 2) }, (_, c) => {\n                  const real = c === 1;\n                  return (\n                    <ul\n                      key={real ? \"real\" : c}\n                      ref={\n                        real\n                          ? (n) => {\n                              sets.current[i] = n;\n                            }\n                          : undefined\n                      }\n                      className=\"ui-tw__set\"\n                      // Only the real set is read out and reachable by Tab; the copies are decoration\n                      aria-hidden={!real || undefined}\n                      inert={!real || undefined}\n                    >\n                      {list.map((t, n) => card(t, i, real, `${c}-${n}`))}\n                    </ul>\n                  );\n                })}\n              </div>\n            </div>\n          ),\n        )}\n      </div>\n    </>\n  );\n}\n\n/* ---------- Styles ---------- */\n\nconst css = /* css */ `\n.ui-tw {\n  --ui-tw-card: var(--aui-surface, #ffffff);\n  --ui-tw-line: var(--aui-border, #ececec);\n  --ui-tw-ink: var(--aui-ink, #171717);\n  --ui-tw-text: var(--aui-ink, #404040);\n  --ui-tw-muted: var(--aui-muted, #8f8f8f);\n  --ui-tw-faint: var(--aui-placeholder, #b5b5b5);\n  --ui-tw-star: #a3a3a8;\n  --ui-tw-star-off: #e2e2e5;\n  --ui-tw-initials: #f0f0f1;\n  --ui-tw-shadow: var(--aui-shadow-card, 0 0 0 1px var(--ui-tw-line), 0 1px 2px rgba(0, 0, 0, 0.04));\n  --ui-tw-lift: 0 0 0 1px var(--ui-tw-line), 0 2px 4px rgba(0, 0, 0, 0.03), 0 12px 28px -10px rgba(0, 0, 0, 0.14);\n  --ui-tw-focus: var(--aui-focus, rgba(0, 96, 226, 0.7));\n  --ui-tw-gap: 16px;\n  --ui-tw-fade: 96px;\n  --ui-tw-dim: 0.62;\n  --ui-tw-ease: var(--aui-ease, cubic-bezier(0.22, 1, 0.36, 1));\n  container-type: inline-size;\n  display: grid;\n  grid-template-columns: repeat(var(--ui-tw-cols, 3), minmax(0, 1fr));\n  /* One row exactly as tall as the wall, so a column's height never follows its (repeated) content */\n  grid-template-rows: minmax(0, 1fr);\n  gap: var(--ui-tw-gap);\n  width: 100%;\n  min-width: 0;\n  height: var(--ui-tw-height, 600px);\n  /* Room at the sides for the lifted card's shadow; the wall clips everything else */\n  padding-inline: 12px;\n  box-sizing: border-box;\n  overflow: hidden;\n  -webkit-mask-image: linear-gradient(180deg, transparent, #000 var(--ui-tw-fade), #000 calc(100% - var(--ui-tw-fade)), transparent);\n  mask-image: linear-gradient(180deg, transparent, #000 var(--ui-tw-fade), #000 calc(100% - var(--ui-tw-fade)), transparent);\n  font-family: var(--aui-font, \"Inter\", ui-sans-serif, system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif);\n  -webkit-font-smoothing: antialiased;\n}\n\n.ui-tw[data-empty] { display: grid; place-items: center; height: auto; min-height: 160px; -webkit-mask-image: none; mask-image: none; }\n.ui-tw__empty { margin: 0; font-size: 14px; color: var(--ui-tw-muted); }\n\n.ui-tw__col {\n  position: relative;\n  min-width: 0;\n  min-height: 0;\n  height: 100%;\n  cursor: grab;\n  user-select: none;\n  -webkit-user-select: none;\n  -webkit-touch-callout: none;\n}\n.ui-tw__col[data-dragging] { cursor: grabbing; }\n.ui-tw__track { will-change: transform; }\n.ui-tw__set {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  margin: 0;\n  padding: 0;\n  list-style: none;\n}\n/* Every card carries its gap below, so one set's height is exactly the wrap distance */\n.ui-tw__item { margin-bottom: var(--ui-tw-gap); }\n\n.ui-tw__card {\n  display: flex;\n  flex-direction: column;\n  gap: 14px;\n  margin: 0;\n  padding: 18px 20px 18px;\n  border-radius: var(--aui-radius-lg, 16px);\n  background: var(--ui-tw-card);\n  box-shadow: var(--ui-tw-shadow);\n  color: var(--ui-tw-text);\n  transition: transform 320ms var(--ui-tw-ease), box-shadow 320ms var(--ui-tw-ease), opacity 320ms var(--ui-tw-ease);\n}\n.ui-tw__card:focus { outline: none; }\n.ui-tw__card:focus-visible { outline: 2px solid var(--ui-tw-focus); outline-offset: 2px; }\n\n.ui-tw__stars { display: flex; gap: 2px; margin-bottom: -4px; }\n.ui-tw__stars svg { width: 13px; height: 13px; fill: var(--ui-tw-star-off); }\n.ui-tw__stars svg[data-on] { fill: var(--ui-tw-star); }\n\n.ui-tw__quote { margin: 0; }\n.ui-tw__quote p {\n  margin: 0;\n  font-size: 14px;\n  line-height: 1.6;\n  letter-spacing: -0.006em;\n  text-wrap: pretty;\n  overflow-wrap: break-word;\n  /* Line breaks in a quote are kept; very long quotes stop at ten lines so a card never outgrows the wall */\n  white-space: pre-line;\n  display: -webkit-box;\n  -webkit-box-orient: vertical;\n  -webkit-line-clamp: 10;\n  line-clamp: 10;\n  overflow: hidden;\n}\n\n.ui-tw__who { display: flex; align-items: center; gap: 10px; min-width: 0; }\n.ui-tw__avatar {\n  flex: none;\n  width: 36px;\n  height: 36px;\n  border-radius: 50%;\n  object-fit: cover;\n  background: var(--ui-tw-initials);\n  /* A hairline ring keeps light photos from melting into the card */\n  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);\n  pointer-events: none;\n}\n.ui-tw__avatar--initials {\n  display: grid;\n  place-items: center;\n  font-size: 12.5px;\n  font-weight: 600;\n  letter-spacing: 0.01em;\n  color: var(--ui-tw-muted);\n}\n.ui-tw__id { display: grid; gap: 1px; min-width: 0; }\n.ui-tw__name {\n  display: flex;\n  /* Top-aligned, so the check stays on the first line when a long name wraps */\n  align-items: flex-start;\n  gap: 5px;\n  min-width: 0;\n  font-size: 13.5px;\n  font-weight: 500;\n  line-height: 18px;\n  color: var(--ui-tw-ink);\n}\n/* The name identifies the person: it wraps to a second line (an email-like name breaks anywhere) and only then is cut */\n.ui-tw__name-text {\n  display: -webkit-box;\n  min-width: 0;\n  overflow: hidden;\n  overflow-wrap: anywhere;\n  -webkit-box-orient: vertical;\n  -webkit-line-clamp: 2;\n  line-clamp: 2;\n}\n.ui-tw__verified { flex: none; margin-top: 2px; width: 14px; height: 14px; fill: var(--ui-tw-faint); }\n/* Role and company wrap once at most, then end in an ellipsis */\n.ui-tw__meta {\n  min-width: 0;\n  overflow: hidden;\n  overflow-wrap: anywhere;\n  display: -webkit-box;\n  -webkit-box-orient: vertical;\n  -webkit-line-clamp: 2;\n  line-clamp: 2;\n  font-size: 12.5px;\n  line-height: 17px;\n  color: var(--ui-tw-muted);\n}\n\n/* Hover: the card under the pointer lifts a little, the rest of the wall steps back */\n@media (hover: hover) {\n  .ui-tw__col:not([data-dragging]) .ui-tw__card:hover { transform: translateY(-3px); box-shadow: var(--ui-tw-lift); }\n  .ui-tw:has(.ui-tw__col:not([data-dragging]) .ui-tw__card:hover) .ui-tw__card:not(:hover) { opacity: var(--ui-tw-dim); }\n}\n/* Keyboard focus gets the same lift */\n.ui-tw__card:focus-visible { transform: translateY(-3px); box-shadow: var(--ui-tw-lift); }\n\n/* Narrow walls (one column on phones): roomier, more readable quotes */\n@container (max-width: 479px) {\n  .ui-tw__card { padding: 18px 18px 18px; }\n  .ui-tw__quote p { font-size: 15px; line-height: 1.58; }\n}\n@container (max-width: 739px) {\n  .ui-tw__col { --ui-tw-gap: 14px; }\n}\n\n/* Reduced motion: a static masonry that shows every quote – no fixed height, no fade */\n.ui-tw[data-static] {\n  height: auto;\n  grid-template-rows: auto;\n  overflow: visible;\n  -webkit-mask-image: none;\n  mask-image: none;\n}\n.ui-tw[data-static] .ui-tw__col { height: auto; cursor: auto; user-select: auto; -webkit-user-select: auto; }\n\n@media (prefers-reduced-motion: reduce) {\n  .ui-tw__card { 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-tw {\n  --ui-tw-card: var(--aui-surface, #19191b);\n  --ui-tw-line: var(--aui-border, #2a2a2e);\n  --ui-tw-ink: var(--aui-ink, #ededed);\n  --ui-tw-text: var(--aui-ink, #c8c8cc);\n  --ui-tw-muted: var(--aui-muted, #8b8b92);\n  --ui-tw-faint: var(--aui-placeholder, #6b6b72);\n  --ui-tw-star: #7a7a82;\n  --ui-tw-star-off: #2f2f34;\n  --ui-tw-initials: #232327;\n  --ui-tw-shadow: var(--aui-shadow-card, 0 0 0 1px var(--ui-tw-line));\n  --ui-tw-lift: 0 0 0 1px #34343a, 0 12px 28px -10px rgba(0, 0, 0, 0.6);\n  --ui-tw-focus: var(--aui-focus, rgba(77, 141, 255, 0.8));\n}\n:where(.dark, [data-theme=\"dark\"]) .ui-tw__avatar { box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06); }\n`;\n"}]}