{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "profile",
  "type": "registry:block",
  "title": "Profile",
  "description": "A social profile with a painted cover, a Follow button that pinches off a notification bell like a droplet, followers that roll up, and posts, replies and a media grid that opens into a lightbox.",
  "categories": [
    "screen",
    "Personal"
  ],
  "dependencies": [
    "lucide-react",
    "motion"
  ],
  "registryDependencies": [
    "utils",
    "https://coss.com/ui/r/avatar.json",
    "https://coss.com/ui/r/button.json",
    "https://coss.com/ui/r/menu.json"
  ],
  "files": [
    {
      "path": "registry/devl/profile.tsx",
      "type": "registry:component",
      "content": "\"use client\";\n\nimport {\n  ArrowLeftIcon,\n  BadgeCheckIcon,\n  BarChart2Icon,\n  BellIcon,\n  BellRingIcon,\n  BookmarkIcon,\n  CalendarDaysIcon,\n  CheckIcon,\n  ChevronLeftIcon,\n  ChevronRightIcon,\n  EllipsisIcon,\n  HeartIcon,\n  LinkIcon,\n  MapPinIcon,\n  MessageCircleIcon,\n  PinIcon,\n  Repeat2Icon,\n  ShareIcon,\n  XIcon,\n} from \"lucide-react\";\nimport {\n  AnimatePresence,\n  animate,\n  motion,\n  useMotionValue,\n  useMotionValueEvent,\n  useReducedMotion,\n  useScroll,\n  useTransform,\n} from \"motion/react\";\nimport { Fragment, type ReactNode, useEffect, useId, useRef, useState } from \"react\";\nimport { cn } from \"@/lib/utils\";\nimport { Avatar, AvatarFallback } from \"@/components/ui/avatar\";\nimport { Button } from \"@/components/ui/button\";\nimport { Menu, MenuCheckboxItem, MenuItem, MenuPopup, MenuSeparator, MenuTrigger } from \"@/components/ui/menu\";\n\nexport type ProfileHue = \"amber\" | \"rose\" | \"violet\" | \"teal\" | \"sky\" | \"orange\" | \"emerald\" | \"indigo\" | \"fuchsia\";\n\nexport interface ProfileArt {\n  glyph: string;\n  hue: ProfileHue;\n  caption: string;\n}\n\nexport interface ProfilePost {\n  id: string;\n  text: string;\n  time: string;\n  pinned?: boolean;\n  media?: ProfileArt[];\n  link?: { domain: string; title: string; hue: ProfileHue };\n  replyTo?: { name: string; handle: string; text: string; hue: ProfileHue };\n  replies: number;\n  reposts: number;\n  likes: number;\n  views: string;\n  liked?: boolean;\n}\n\nexport interface ProfileUser {\n  name: string;\n  handle: string;\n  bio: string;\n  location: string;\n  website: string;\n  joined: string;\n  following: number;\n  followers: number;\n  posts: number;\n  verified?: boolean;\n  followsYou?: boolean;\n}\n\nexport interface ProfileSuggestion {\n  name: string;\n  handle: string;\n  hue: ProfileHue;\n  note: string;\n}\n\nexport interface ProfileProps {\n  className?: string;\n  user?: ProfileUser;\n  posts?: ProfilePost[];\n  replies?: ProfilePost[];\n  media?: ProfileArt[];\n  suggestions?: ProfileSuggestion[];\n  mutuals?: string[];\n  initiallyFollowing?: boolean;\n  onBack?: () => void;\n}\n\nconst spring = { type: \"spring\", stiffness: 520, damping: 44, mass: 1 } as const;\nconst easeOut = [0.23, 1, 0.32, 1] as const;\nconst press = \"transition-[color,background-color,box-shadow,scale,opacity] duration-150 ease-out active:scale-[0.97]\";\n\nconst hues: Record<ProfileHue, { art: string; avatar: string }> = {\n  amber: { art: \"from-amber-200 via-amber-300 to-orange-400\", avatar: \"from-amber-300 to-orange-500\" },\n  rose: { art: \"from-rose-200 via-rose-300 to-pink-500\", avatar: \"from-rose-300 to-pink-500\" },\n  violet: { art: \"from-violet-300 via-violet-400 to-indigo-500\", avatar: \"from-violet-400 to-indigo-500\" },\n  teal: { art: \"from-teal-200 via-teal-300 to-emerald-500\", avatar: \"from-teal-300 to-emerald-500\" },\n  sky: { art: \"from-sky-200 via-sky-300 to-blue-500\", avatar: \"from-sky-300 to-blue-500\" },\n  orange: { art: \"from-orange-200 via-orange-300 to-red-400\", avatar: \"from-orange-300 to-red-500\" },\n  emerald: { art: \"from-emerald-200 via-emerald-300 to-teal-600\", avatar: \"from-emerald-300 to-teal-600\" },\n  indigo: { art: \"from-indigo-300 via-indigo-400 to-violet-700\", avatar: \"from-indigo-400 to-violet-700\" },\n  fuchsia: { art: \"from-fuchsia-200 via-fuchsia-300 to-purple-500\", avatar: \"from-fuchsia-300 to-purple-500\" },\n};\n\nconst defaultUser: ProfileUser = {\n  name: \"Wren Halloway\",\n  handle: \"wrenmakes\",\n  bio: \"Illustrator and type nerd. Drawing one letter a day for all of 2026. Running @nightjar.studio with two cats and a lot of tracing paper.\",\n  location: \"Lisbon\",\n  website: \"wrenhalloway.studio\",\n  joined: \"Joined March 2019\",\n  following: 312,\n  followers: 18402,\n  posts: 1204,\n  verified: true,\n  followsYou: true,\n};\n\nconst defaultPosts: ProfilePost[] = [\n  {\n    id: \"p1\",\n    pinned: true,\n    text: \"Day 297 of #letteraday: a lowercase g that took four tries. The ear kept wanting to be a question mark. Prints of the whole alphabet go up in December.\",\n    time: \"Oct 22\",\n    media: [{ glyph: \"g\", hue: \"amber\", caption: \"Day 297 · lowercase g\" }],\n    replies: 48,\n    reposts: 212,\n    likes: 2318,\n    views: \"41K\",\n  },\n  {\n    id: \"p2\",\n    text: \"Hot take: kerning is just vibes with a ruler.\",\n    time: \"3h\",\n    replies: 96,\n    reposts: 140,\n    likes: 842,\n    views: \"18K\",\n  },\n  {\n    id: \"p3\",\n    text: \"Wrote up how I pull colour palettes out of the old matchbox labels my grandad kept in a biscuit tin. Five palettes, free to use.\",\n    time: \"Oct 20\",\n    link: { domain: \"wrenhalloway.studio\", title: \"Palettes from the matchbox drawer\", hue: \"orange\" },\n    replies: 22,\n    reposts: 88,\n    likes: 604,\n    views: \"12K\",\n  },\n  {\n    id: \"p4\",\n    text: \"Studio window at 7am, and the same view at 7pm. I should be drawing but look at it.\",\n    time: \"Oct 18\",\n    media: [\n      { glyph: \"\", hue: \"rose\", caption: \"Morning\" },\n      { glyph: \"\", hue: \"indigo\", caption: \"Dusk\" },\n    ],\n    replies: 31,\n    reposts: 45,\n    likes: 1290,\n    views: \"22K\",\n    liked: true,\n  },\n  {\n    id: \"p5\",\n    text: \"Reminder that @mira.draws is running a free lettering session on Sunday. Bring a pencil and low expectations, that’s the whole vibe.\",\n    time: \"Oct 16\",\n    replies: 9,\n    reposts: 64,\n    likes: 377,\n    views: \"8.1K\",\n  },\n];\n\nconst defaultReplies: ProfilePost[] = [\n  {\n    id: \"r1\",\n    replyTo: { name: \"Mira Castell\", handle: \"mira.draws\", text: \"What pens are you using for the ink studies? They look so soft.\", hue: \"teal\" },\n    text: \"A 0.3 fineliner for outlines and a brush pen that’s about 80% dried out. The dry one is the secret.\",\n    time: \"1h\",\n    replies: 4,\n    reposts: 3,\n    likes: 129,\n    views: \"2.4K\",\n  },\n  {\n    id: \"r2\",\n    replyTo: { name: \"Otto Brennan\", handle: \"ottotype\", text: \"Serif or sans for a bakery that’s been open since 1962?\", hue: \"sky\" },\n    text: \"Chunky slab, slightly too tight, like it was hand-painted on the window by someone in a hurry. Bakeries deserve swagger.\",\n    time: \"Oct 21\",\n    replies: 12,\n    reposts: 8,\n    likes: 301,\n    views: \"5.6K\",\n  },\n  {\n    id: \"r3\",\n    replyTo: { name: \"Priya Nair\", handle: \"priyanair\", text: \"Do you plan the whole alphabet or wing it day by day?\", hue: \"fuchsia\" },\n    text: \"Wing it, then quietly redraw the ones that don’t match. Q has been redrawn six times. Q knows what it did.\",\n    time: \"Oct 19\",\n    replies: 6,\n    reposts: 2,\n    likes: 188,\n    views: \"3.1K\",\n  },\n];\n\nconst defaultMedia: ProfileArt[] = [\n  { glyph: \"g\", hue: \"amber\", caption: \"Day 297 · lowercase g\" },\n  { glyph: \"&\", hue: \"violet\", caption: \"Day 290 · ampersand\" },\n  { glyph: \"R\", hue: \"teal\", caption: \"Day 284 · capital R\" },\n  { glyph: \"Q\", hue: \"rose\", caption: \"Day 276 · Q, sixth attempt\" },\n  { glyph: \"a\", hue: \"sky\", caption: \"Day 268 · double-storey a\" },\n  { glyph: \"M\", hue: \"orange\", caption: \"Day 259 · capital M\" },\n  { glyph: \"?\", hue: \"emerald\", caption: \"Day 251 · question mark\" },\n  { glyph: \"k\", hue: \"fuchsia\", caption: \"Day 243 · lowercase k\" },\n  { glyph: \"S\", hue: \"indigo\", caption: \"Day 237 · capital S\" },\n];\n\nconst defaultSuggestions: ProfileSuggestion[] = [\n  { name: \"Mira Castell\", handle: \"mira.draws\", hue: \"teal\", note: \"Follows you\" },\n  { name: \"Otto Brennan\", handle: \"ottotype\", hue: \"sky\", note: \"Type designer\" },\n  { name: \"Nightjar Studio\", handle: \"nightjar.studio\", hue: \"indigo\", note: \"Wren’s studio\" },\n];\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .map((p) => p[0])\n    .join(\"\")\n    .slice(0, 2)\n    .toUpperCase();\n}\n\nconst compact = (n: number) =>\n  n >= 10_000 ? `${(n / 1000).toFixed(1).replace(/\\.0$/, \"\")}K` : n.toLocaleString(\"en-US\");\n\nfunction Tween({ value, format = (n: number) => Math.round(n).toLocaleString(\"en-US\") }: { value: number; format?: (n: number) => string }) {\n  const reduce = useReducedMotion();\n  const mv = useMotionValue(value);\n  const text = useTransform(mv, format);\n  useEffect(() => {\n    if (reduce) {\n      mv.set(value);\n      return;\n    }\n    const controls = animate(mv, value, { type: \"spring\", stiffness: 220, damping: 30 });\n    return () => controls.stop();\n  }, [value, reduce, mv]);\n  return <motion.span className=\"tabular-nums\">{text}</motion.span>;\n}\n\nfunction Count({ value }: { value: number }) {\n  const reduce = useReducedMotion();\n  const prev = useRef(value);\n  const dir = value >= prev.current ? 1 : -1;\n  useEffect(() => {\n    prev.current = value;\n  }, [value]);\n  return (\n    <span className=\"relative inline-flex h-4 min-w-[1ch] overflow-hidden tabular-nums\">\n      <AnimatePresence custom={dir} initial={false} mode=\"popLayout\">\n        <motion.span\n          animate={{ y: 0, opacity: 1 }}\n          custom={dir}\n          exit={reduce ? { opacity: 0 } : { y: dir * -12, opacity: 0 }}\n          initial={reduce ? { opacity: 0 } : { y: dir * 12, opacity: 0 }}\n          key={value}\n          transition={{ duration: 0.18, ease: easeOut }}\n        >\n          {compact(value)}\n        </motion.span>\n      </AnimatePresence>\n    </span>\n  );\n}\n\nfunction Art({ art, className, large }: { art: ProfileArt; className?: string; large?: boolean }) {\n  const scene = !art.glyph;\n  return (\n    <span\n      aria-hidden\n      className={cn(\n        \"relative flex items-center justify-center overflow-hidden bg-gradient-to-br text-white\",\n        hues[art.hue].art,\n        className,\n      )}\n    >\n      {scene ? (\n        <>\n          <span\n            className={cn(\n              \"absolute top-[28%] left-1/2 aspect-square w-[26%] -translate-x-1/2 rounded-full\",\n              art.hue === \"indigo\" ? \"bg-amber-100/90 shadow-[0_0_40px_10px] shadow-amber-100/30\" : \"bg-amber-100 shadow-[0_0_60px_20px] shadow-amber-50/60\",\n            )}\n          />\n          <svg className=\"absolute inset-x-0 bottom-0 h-[46%] w-full\" preserveAspectRatio=\"none\" viewBox=\"0 0 100 40\">\n            <path className=\"fill-black/15\" d=\"M0 18 L12 12 L22 16 L34 6 L46 14 L58 9 L70 15 L82 8 L100 14 V40 H0Z\" />\n            <path className=\"fill-black/25\" d=\"M0 26 Q20 18 40 24 T80 22 T100 24 V40 H0Z\" />\n          </svg>\n          <span className=\"absolute inset-0 border-[6px] border-black/10\" />\n        </>\n      ) : (\n        <>\n          <span className=\"absolute -top-1/4 -left-1/4 size-3/4 rounded-full bg-white/20 blur-2xl\" />\n          <span\n            className={cn(\n              \"relative font-heading font-semibold leading-none drop-shadow-sm\",\n              large ? \"text-[min(40cqw,14rem)]\" : \"text-[min(52cqw,9rem)]\",\n            )}\n          >\n            {art.glyph}\n          </span>\n        </>\n      )}\n    </span>\n  );\n}\n\nfunction RichText({ text }: { text: string }) {\n  const parts = text.split(/([@#][\\w.]+\\w)/g);\n  return (\n    <>\n      {parts.map((p, i) =>\n        /^[@#]/.test(p) ? (\n          <span className=\"text-info-foreground\" key={i}>\n            {p}\n          </span>\n        ) : (\n          <Fragment key={i}>{p}</Fragment>\n        ),\n      )}\n    </>\n  );\n}\n\nexport function Profile({\n  className,\n  user = defaultUser,\n  posts: initialPosts = defaultPosts,\n  replies: initialReplies = defaultReplies,\n  media = defaultMedia,\n  suggestions = defaultSuggestions,\n  mutuals = [\"Mira Castell\", \"Otto Brennan\"],\n  initiallyFollowing = false,\n  onBack,\n}: ProfileProps) {\n  const reduce = useReducedMotion();\n  const uid = useId().replace(/:/g, \"\");\n  const [following, setFollowing] = useState(initiallyFollowing);\n  const [bell, setBell] = useState(false);\n  const [tab, setTab] = useState<\"posts\" | \"replies\" | \"media\">(\"posts\");\n  const [posts, setPosts] = useState(initialPosts);\n  const [replies, setReplies] = useState(initialReplies);\n  const [lightbox, setLightbox] = useState<number | null>(null);\n  const [suggested, setSuggested] = useState<string[]>([]);\n  const [muted, setMuted] = useState(false);\n  const [copied, setCopied] = useState(false);\n  const copyTimer = useRef<ReturnType<typeof setTimeout> | null>(null);\n  useEffect(() => () => {\n    if (copyTimer.current) clearTimeout(copyTimer.current);\n  }, []);\n  const copyProfileLink = () => {\n    navigator.clipboard?.writeText(`https://${user.website}/@${user.handle}`).catch(() => {});\n    setCopied(true);\n    if (copyTimer.current) clearTimeout(copyTimer.current);\n    copyTimer.current = setTimeout(() => setCopied(false), 1600);\n  };\n  const scrollRef = useRef<HTMLDivElement>(null);\n  // Sticky elements report their stuck position, so a plain marker above the tabs is measured instead.\n  const tabsRef = useRef<HTMLDivElement>(null);\n  const { scrollY } = useScroll({ container: scrollRef });\n  const barBg = useTransform(scrollY, [96, 150], [0, 1]);\n  const [compactBar, setCompactBar] = useState(false);\n  useMotionValueEvent(scrollY, \"change\", (y) => setCompactBar(y > 150));\n\n  const followers = user.followers + (following && !initiallyFollowing ? 1 : 0) - (!following && initiallyFollowing ? 1 : 0);\n\n  const toggleLike = (list: \"posts\" | \"replies\", id: string) => {\n    const fn = (all: ProfilePost[]) =>\n      all.map((p) => (p.id === id ? { ...p, liked: !p.liked, likes: p.likes + (p.liked ? -1 : 1) } : p));\n    if (list === \"posts\") setPosts(fn);\n    else setReplies(fn);\n  };\n\n  const switchTab = (t: typeof tab) => {\n    setTab(t);\n    const el = scrollRef.current;\n    const tabs = tabsRef.current;\n    if (el && tabs && el.scrollTop > tabs.offsetTop - 56) el.scrollTo({ top: tabs.offsetTop - 56 });\n  };\n\n  const mutualText =\n    mutuals.length === 0\n      ? null\n      : mutuals.length === 1\n        ? `Followed by ${mutuals[0]}`\n        : `Followed by ${mutuals[0]}, ${mutuals[1]}${mutuals.length > 2 ? ` and ${mutuals.length - 2} others` : \"\"}`;\n\n  return (\n    <div\n      className={cn(\n        \"@container relative isolate flex h-[760px] w-full overflow-hidden bg-background text-foreground text-sm\",\n        className,\n      )}\n    >\n      <div className=\"relative min-w-0 flex-1 overflow-y-auto\" ref={scrollRef}>\n        <div className=\"mx-auto flex max-w-[1000px] justify-center gap-6\">\n          <main className=\"relative w-full max-w-[600px] min-w-0 @3xl:border-x\">\n            <div className=\"sticky top-0 z-20 flex h-14 items-center gap-3 px-3\">\n              <motion.span aria-hidden className=\"absolute inset-0 -z-10 border-b bg-background/85 backdrop-blur-md\" style={{ opacity: barBg }} />\n              {onBack && (\n                <Button\n                  aria-label=\"Back\"\n                  className={cn(\n                    \"transition-colors\",\n                    compactBar ? \"\" : \"bg-black/30 text-white backdrop-blur-sm hover:bg-black/40\",\n                  )}\n                  onClick={onBack}\n                  size=\"icon-sm\"\n                  variant=\"ghost\"\n                >\n                  <ArrowLeftIcon />\n                </Button>\n              )}\n              <motion.div className=\"flex min-w-0 flex-col\" style={{ opacity: barBg }}>\n                <span className=\"truncate font-heading font-semibold\">{user.name}</span>\n                <span className=\"text-muted-foreground text-xs tabular-nums\">{user.posts.toLocaleString(\"en-US\")} posts</span>\n              </motion.div>\n              <AnimatePresence>\n                {compactBar && (\n                  <motion.div\n                    animate={{ opacity: 1, scale: 1 }}\n                    className=\"ms-auto\"\n                    exit={{ opacity: 0, scale: 0.95 }}\n                    initial={{ opacity: 0, scale: 0.95 }}\n                    transition={{ duration: 0.15, ease: easeOut }}\n                  >\n                    <Button\n                      className={press}\n                      onClick={() => setFollowing((f) => !f)}\n                      size=\"sm\"\n                      variant={following ? \"outline\" : \"default\"}\n                    >\n                      {following ? \"Following\" : \"Follow\"}\n                    </Button>\n                  </motion.div>\n                )}\n              </AnimatePresence>\n            </div>\n\n            <Cover />\n\n            <div className=\"flex flex-col gap-3 px-4 pb-4\">\n              <div className=\"flex items-end justify-between gap-3\">\n                <span className=\"-mt-12 rounded-full bg-background p-1 @3xl:-mt-14\">\n                  <Avatar className=\"[--avatar-size:--spacing(22)] @3xl:[--avatar-size:--spacing(26)]\">\n                    <AvatarFallback\n                      className={cn(\"bg-gradient-to-br font-heading font-semibold text-2xl text-white @3xl:text-3xl\", hues.violet.avatar)}\n                    >\n                      {initials(user.name)}\n                    </AvatarFallback>\n                  </Avatar>\n                </span>\n                <div className=\"flex items-center gap-2 pb-1\">\n                  <Menu>\n                    <MenuTrigger\n                      render={\n                        <Button\n                          aria-label={`More options for @${user.handle}`}\n                          className={cn(\"size-9 rounded-full before:rounded-full sm:size-9\", press)}\n                          size=\"icon\"\n                          variant=\"outline\"\n                        />\n                      }\n                    >\n                      <AnimatePresence initial={false} mode=\"popLayout\">\n                        <motion.span\n                          animate={{ opacity: 1, scale: 1 }}\n                          className=\"flex\"\n                          exit={{ opacity: 0, scale: 0.8 }}\n                          initial={{ opacity: 0, scale: 0.8 }}\n                          key={copied ? \"copied\" : \"more\"}\n                          transition={{ duration: 0.15, ease: easeOut }}\n                        >\n                          {copied ? <CheckIcon className=\"text-success-foreground\" /> : <EllipsisIcon />}\n                        </motion.span>\n                      </AnimatePresence>\n                    </MenuTrigger>\n                    <MenuPopup align=\"end\" className=\"w-56\">\n                      <MenuItem onClick={copyProfileLink}>\n                        <LinkIcon /> Copy link to profile\n                      </MenuItem>\n                      <MenuSeparator />\n                      <MenuCheckboxItem checked={muted} onCheckedChange={setMuted} variant=\"switch\">\n                        Mute @{user.handle}\n                      </MenuCheckboxItem>\n                    </MenuPopup>\n                  </Menu>\n                  <FollowButton\n                    bell={bell}\n                    following={following}\n                    name={user.name}\n                    onBell={() => setBell((b) => !b)}\n                    onToggle={() => {\n                      setFollowing((f) => !f);\n                      if (following) setBell(false);\n                    }}\n                  />\n                </div>\n              </div>\n\n              <div className=\"flex flex-col gap-0.5\">\n                <h2 className=\"flex items-center gap-1.5 font-heading font-semibold text-xl tracking-tight\">\n                  {user.name}\n                  {user.verified && <BadgeCheckIcon aria-label=\"Verified\" className=\"size-5 fill-info text-background\" />}\n                </h2>\n                <div className=\"flex items-center gap-2 text-muted-foreground\">\n                  <span>@{user.handle}</span>\n                  {user.followsYou && (\n                    <span className=\"rounded-md bg-muted px-1.5 py-0.5 font-medium text-[11px] text-muted-foreground\">Follows you</span>\n                  )}\n                  {muted && (\n                    <span className=\"rounded-md bg-warning/12 px-1.5 py-0.5 font-medium text-[11px] text-warning-foreground\">Muted</span>\n                  )}\n                  <span aria-live=\"polite\" className=\"sr-only\">\n                    {copied ? \"Profile link copied\" : \"\"}\n                  </span>\n                </div>\n              </div>\n\n              <p className=\"text-pretty leading-relaxed\">\n                <RichText text={user.bio} />\n              </p>\n\n              <ul className=\"flex flex-wrap gap-x-4 gap-y-1.5 text-muted-foreground\">\n                <li className=\"flex items-center gap-1.5\">\n                  <MapPinIcon aria-hidden className=\"size-4\" />\n                  {user.location}\n                </li>\n                <li className=\"flex items-center gap-1.5\">\n                  <LinkIcon aria-hidden className=\"size-4\" />\n                  <a\n                    className=\"rounded-sm text-info-foreground underline-offset-2 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring\"\n                    href={`https://${user.website}`}\n                    onClick={(e) => e.preventDefault()}\n                  >\n                    {user.website}\n                  </a>\n                </li>\n                <li className=\"flex items-center gap-1.5\">\n                  <CalendarDaysIcon aria-hidden className=\"size-4\" />\n                  {user.joined}\n                </li>\n              </ul>\n\n              <div className=\"flex flex-wrap gap-x-4 gap-y-1\">\n                <span>\n                  <span className=\"font-medium tabular-nums\">{user.following.toLocaleString(\"en-US\")}</span>{\" \"}\n                  <span className=\"text-muted-foreground\">Following</span>\n                </span>\n                <span>\n                  <span className=\"font-medium\">\n                    <Tween value={followers} />\n                  </span>{\" \"}\n                  <span className=\"text-muted-foreground\">Followers</span>\n                </span>\n              </div>\n\n              {mutualText && (\n                <div className=\"flex items-center gap-2 text-muted-foreground text-xs\">\n                  <span className=\"flex -space-x-1.5\">\n                    {mutuals.slice(0, 3).map((m, i) => (\n                      <Avatar className=\"ring-2 ring-background [--avatar-size:--spacing(5)]\" key={m}>\n                        <AvatarFallback\n                          className={cn(\"bg-gradient-to-br font-semibold text-[10px] text-white\", hues[([\"teal\", \"sky\", \"rose\"] as const)[i % 3]].avatar)}\n                        >\n                          {m[0]}\n                        </AvatarFallback>\n                      </Avatar>\n                    ))}\n                  </span>\n                  <span className=\"truncate\">{mutualText}</span>\n                </div>\n              )}\n            </div>\n\n            <div aria-hidden ref={tabsRef} />\n            <div className=\"sticky top-14 z-10 border-b bg-background\">\n              <div aria-label=\"Profile sections\" className=\"flex\" role=\"tablist\">\n                {(\n                  [\n                    [\"posts\", \"Posts\"],\n                    [\"replies\", \"Replies\"],\n                    [\"media\", \"Media\"],\n                  ] as const\n                ).map(([value, label]) => {\n                  const on = tab === value;\n                  return (\n                    <button\n                      aria-controls={`${uid}-panel`}\n                      aria-selected={on}\n                      className={cn(\n                        \"relative flex h-12 flex-1 cursor-pointer items-center justify-center outline-none transition-colors hover:bg-accent/60 focus-visible:bg-accent\",\n                        on ? \"font-medium text-foreground\" : \"text-muted-foreground\",\n                      )}\n                      id={`${uid}-tab-${value}`}\n                      key={value}\n                      onClick={() => switchTab(value)}\n                      onKeyDown={(e) => {\n                        const order = [\"posts\", \"replies\", \"media\"] as const;\n                        const i = order.indexOf(value);\n                        const next = e.key === \"ArrowRight\" ? order[(i + 1) % 3] : e.key === \"ArrowLeft\" ? order[(i + 2) % 3] : null;\n                        if (next) {\n                          e.preventDefault();\n                          switchTab(next);\n                          document.getElementById(`${uid}-tab-${next}`)?.focus();\n                        }\n                      }}\n                      role=\"tab\"\n                      tabIndex={on ? 0 : -1}\n                      type=\"button\"\n                    >\n                      {label}\n                      {on && (\n                        <motion.span\n                          className=\"absolute bottom-0 left-1/2 h-[3px] w-12 -translate-x-1/2 rounded-full bg-foreground\"\n                          layoutId={`${uid}-tab`}\n                          transition={reduce ? { duration: 0 } : spring}\n                        />\n                      )}\n                    </button>\n                  );\n                })}\n              </div>\n            </div>\n\n            <div aria-labelledby={`${uid}-tab-${tab}`} className=\"min-h-[656px]\" id={`${uid}-panel`} role=\"tabpanel\">\n              <AnimatePresence initial={false} mode=\"wait\">\n                <motion.div\n                  animate={{ opacity: 1 }}\n                  exit={{ opacity: 0 }}\n                  initial={{ opacity: 0 }}\n                  key={tab}\n                  transition={{ duration: 0.12 }}\n                >\n                  {tab === \"posts\" && (\n                    <ul className=\"divide-y\">\n                      {posts.map((p) => (\n                        <PostItem\n                          key={p.id}\n                          onLike={() => toggleLike(\"posts\", p.id)}\n                          onOpenMedia={(art) => {\n                            const i = media.findIndex((m) => m.caption === art.caption);\n                            if (i >= 0) setLightbox(i);\n                          }}\n                          post={p}\n                          user={user}\n                        />\n                      ))}\n                    </ul>\n                  )}\n                  {tab === \"replies\" && (\n                    <ul className=\"divide-y\">\n                      {replies.map((p) => (\n                        <PostItem key={p.id} onLike={() => toggleLike(\"replies\", p.id)} post={p} user={user} />\n                      ))}\n                    </ul>\n                  )}\n                  {tab === \"media\" && (\n                    <ul className=\"grid grid-cols-3 gap-1 p-1\">\n                      {media.map((m, i) => (\n                        <li className=\"@container\" key={m.caption}>\n                          <button\n                            aria-label={`Open ${m.caption}`}\n                            className={cn(\n                              \"group/media relative block aspect-square w-full cursor-pointer overflow-hidden rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n                              press,\n                            )}\n                            onClick={() => setLightbox(i)}\n                            type=\"button\"\n                          >\n                            <Art art={m} className=\"size-full transition-transform duration-300 ease-out [@media(hover:hover)]:group-hover/media:scale-[1.03]\" />\n                          </button>\n                        </li>\n                      ))}\n                    </ul>\n                  )}\n                </motion.div>\n              </AnimatePresence>\n            </div>\n          </main>\n\n          <aside className=\"sticky top-0 hidden w-[300px] shrink-0 flex-col gap-4 self-start py-4 @5xl:flex\">\n            <section aria-labelledby={`${uid}-sugg`} className=\"rounded-2xl border bg-card p-4 shadow-xs/5\">\n              <h3 className=\"font-heading font-semibold\" id={`${uid}-sugg`}>\n                You might like\n              </h3>\n              <ul className=\"mt-3 flex flex-col gap-3\">\n                {suggestions.map((s) => {\n                  const on = suggested.includes(s.handle);\n                  return (\n                    <li className=\"flex items-center gap-3\" key={s.handle}>\n                      <Avatar className=\"[--avatar-size:--spacing(9)]\">\n                        <AvatarFallback className={cn(\"bg-gradient-to-br font-semibold text-white text-xs\", hues[s.hue].avatar)}>\n                          {initials(s.name)}\n                        </AvatarFallback>\n                      </Avatar>\n                      <div className=\"flex min-w-0 flex-1 flex-col\">\n                        <span className=\"truncate font-medium\">{s.name}</span>\n                        <span className=\"truncate text-muted-foreground text-xs\">{s.note}</span>\n                      </div>\n                      <Button\n                        aria-pressed={on}\n                        className={cn(\"min-w-[5.5rem]\", press)}\n                        onClick={() => setSuggested((all) => (on ? all.filter((h) => h !== s.handle) : [...all, s.handle]))}\n                        size=\"sm\"\n                        variant={on ? \"ghost\" : \"outline\"}\n                      >\n                        {on ? \"Following\" : \"Follow\"}\n                      </Button>\n                    </li>\n                  );\n                })}\n              </ul>\n            </section>\n            <section aria-labelledby={`${uid}-alpha`} className=\"rounded-2xl border bg-card p-4 shadow-xs/5\">\n              <div className=\"flex items-baseline justify-between\">\n                <h3 className=\"font-heading font-semibold\" id={`${uid}-alpha`}>\n                  Letter a day\n                </h3>\n                <span className=\"text-muted-foreground text-xs tabular-nums\">297 / 365</span>\n              </div>\n              <div aria-hidden className=\"mt-3 grid grid-cols-[repeat(15,minmax(0,1fr))] gap-[3px]\">\n                {Array.from({ length: 60 }, (_, i) => (\n                  <span\n                    className={cn(\n                      \"aspect-square rounded-[calc(var(--radius)*0.2)]\",\n                      i > 51\n                        ? \"bg-muted\"\n                        : i === 51\n                          ? \"bg-amber-400 ring-2 ring-amber-400/30\"\n                          : i % 7 === 3 && i < 49\n                            ? \"bg-muted\"\n                            : \"bg-violet-500/80 dark:bg-violet-400/80\",\n                    )}\n                    key={i}\n                  />\n                ))}\n              </div>\n              <p className=\"mt-3 text-muted-foreground text-xs\">The last 60 days. Seven skipped, all of them Mondays.</p>\n            </section>\n            <nav aria-label=\"Footer\" className=\"flex flex-wrap gap-x-3 gap-y-1 px-4 text-muted-foreground text-xs\">\n              {[\"Terms\", \"Privacy\", \"Cookies\", \"Accessibility\"].map((l) => (\n                <a\n                  className=\"rounded-sm outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring\"\n                  href=\"#top\"\n                  key={l}\n                  onClick={(e) => e.preventDefault()}\n                >\n                  {l}\n                </a>\n              ))}\n              <span>© 2026 Ripple</span>\n            </nav>\n          </aside>\n        </div>\n      </div>\n\n      <Lightbox\n        index={lightbox}\n        items={media}\n        onChange={setLightbox}\n        onClose={() => setLightbox(null)}\n      />\n    </div>\n  );\n}\n\nfunction Cover() {\n  return (\n    <div aria-hidden className=\"relative -mt-14 h-[168px] overflow-hidden @3xl:h-[200px]\">\n      <div\n        className=\"absolute inset-0\"\n        style={{\n          background:\n            \"radial-gradient(55% 90% at 10% 15%, var(--color-amber-200) 0%, transparent 60%), radial-gradient(45% 80% at 88% 0%, var(--color-rose-300) 0%, transparent 65%), radial-gradient(70% 90% at 62% 115%, var(--color-violet-400) 0%, transparent 60%), linear-gradient(120deg, var(--color-orange-200), var(--color-rose-300) 50%, var(--color-violet-300))\",\n        }}\n      />\n      <svg className=\"absolute inset-0 size-full opacity-30 mix-blend-soft-light\" preserveAspectRatio=\"none\" viewBox=\"0 0 600 200\">\n        {Array.from({ length: 9 }, (_, i) => (\n          <path\n            d={`M-20 ${40 + i * 18} C 120 ${10 + i * 20}, 260 ${90 + i * 14}, 420 ${40 + i * 18} S 640 ${20 + i * 16}, 640 ${30 + i * 18}`}\n            fill=\"none\"\n            key={i}\n            stroke=\"white\"\n            strokeWidth=\"1.2\"\n          />\n        ))}\n      </svg>\n      <div className=\"absolute inset-0 dark:bg-black/15\" />\n    </div>\n  );\n}\n\nfunction FollowButton({\n  following,\n  bell,\n  name,\n  onToggle,\n  onBell,\n}: {\n  following: boolean;\n  bell: boolean;\n  name: string;\n  onToggle: () => void;\n  onBell: () => void;\n}) {\n  const reduce = useReducedMotion();\n  const filterId = `follow-goo-${useId().replace(/:/g, \"\")}`;\n  const [hover, setHover] = useState(false);\n  const pillW = following ? 112 : 92;\n  const total = following ? pillW + 44 : pillW;\n  const move = reduce ? { duration: 0 } : { type: \"spring\", stiffness: 420, damping: 30, mass: 0.9 } as const;\n  const label = following ? (hover ? \"Unfollow\" : \"Following\") : \"Follow\";\n\n  return (\n    <motion.div\n      animate={{ width: total }}\n      className=\"relative h-9 shrink-0\"\n      initial={false}\n      style={{\n        // Opaque colours only: an alpha fill would fringe through the goo threshold.\n        [\"--goo\" as string]: following\n          ? \"color-mix(in srgb, var(--foreground) 10%, var(--background))\"\n          : \"var(--primary)\",\n      }}\n      transition={move}\n    >\n      <svg aria-hidden className=\"absolute size-0\">\n        <filter colorInterpolationFilters=\"sRGB\" height=\"200%\" id={filterId} width=\"160%\" x=\"-30%\" y=\"-50%\">\n          <feGaussianBlur in=\"SourceGraphic\" result=\"blur\" stdDeviation=\"5\" />\n          <feColorMatrix in=\"blur\" values=\"1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 28 -12\" />\n        </filter>\n      </svg>\n      <span aria-hidden className=\"absolute inset-0\" style={{ filter: `url(#${filterId})` }}>\n        <motion.span\n          animate={{ width: pillW }}\n          className=\"absolute inset-y-0 right-0 rounded-full bg-(--goo) transition-[background-color] duration-200\"\n          initial={false}\n          transition={move}\n        />\n        <motion.span\n          animate={{ scale: following ? 1 : 0.6 }}\n          className=\"absolute top-0 left-0 size-9 rounded-full bg-(--goo) transition-[background-color] duration-200\"\n          initial={false}\n          transition={move}\n        />\n      </span>\n\n      <AnimatePresence initial={false}>\n        {following && (\n          <motion.button\n            animate={{ opacity: 1 }}\n            aria-label={bell ? `Turn off notifications from ${name}` : `Get notified when ${name} posts`}\n            aria-pressed={bell}\n            className={cn(\n              \"absolute top-0 left-0 flex size-9 cursor-pointer items-center justify-center rounded-full text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background\",\n              press,\n            )}\n            exit={{ opacity: 0, transition: { duration: 0.08 } }}\n            initial={{ opacity: 0 }}\n            onClick={onBell}\n            transition={{ duration: 0.15, delay: reduce ? 0 : 0.14 }}\n            type=\"button\"\n          >\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              <motion.span\n                animate={{ rotate: 0, opacity: 1 }}\n                initial={reduce ? { opacity: 0 } : { rotate: bell ? -18 : 0, opacity: 0 }}\n                key={bell ? \"on\" : \"off\"}\n                transition={{ type: \"spring\", stiffness: 500, damping: 14 }}\n              >\n                {bell ? <BellRingIcon className=\"size-4\" /> : <BellIcon className=\"size-4\" />}\n              </motion.span>\n            </AnimatePresence>\n          </motion.button>\n        )}\n      </AnimatePresence>\n\n      <motion.button\n        animate={{ width: pillW }}\n        aria-label={following ? `Unfollow ${name}` : `Follow ${name}`}\n        aria-pressed={following}\n        className={cn(\n          \"absolute top-0 right-0 flex h-9 cursor-pointer items-center justify-center rounded-full font-medium outline-none transition-[color,scale] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background active:scale-[0.97]\",\n          following ? (hover ? \"text-destructive-foreground\" : \"text-foreground\") : \"text-primary-foreground\",\n        )}\n        onBlur={() => setHover(false)}\n        onClick={() => {\n          onToggle();\n          setHover(false);\n        }}\n        onPointerEnter={(e) => e.pointerType === \"mouse\" && setHover(true)}\n        onPointerLeave={() => setHover(false)}\n        initial={false}\n        transition={move}\n        type=\"button\"\n      >\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          <motion.span\n            animate={{ opacity: 1, y: 0, filter: \"blur(0px)\" }}\n            exit={reduce ? { opacity: 0 } : { opacity: 0, y: -6, filter: \"blur(2px)\" }}\n            initial={reduce ? { opacity: 0 } : { opacity: 0, y: 6, filter: \"blur(2px)\" }}\n            key={label}\n            transition={{ duration: 0.16, ease: easeOut }}\n          >\n            {label}\n          </motion.span>\n        </AnimatePresence>\n      </motion.button>\n    </motion.div>\n  );\n}\n\nfunction PostItem({\n  post,\n  user,\n  onLike,\n  onOpenMedia,\n}: {\n  post: ProfilePost;\n  user: ProfileUser;\n  onLike: () => void;\n  onOpenMedia?: (art: ProfileArt) => void;\n}) {\n  const [reposted, setReposted] = useState(false);\n  const [saved, setSaved] = useState(false);\n\n  const header = (\n    <div className=\"flex min-w-0 items-center gap-1.5\">\n      <span className=\"truncate font-medium\">{user.name}</span>\n      {user.verified && <BadgeCheckIcon aria-label=\"Verified\" className=\"size-4 shrink-0 fill-info text-background\" />}\n      <span className=\"truncate text-muted-foreground\">@{user.handle}</span>\n      <span aria-hidden className=\"text-muted-foreground\">\n        ·\n      </span>\n      <span className=\"shrink-0 text-muted-foreground\">{post.time}</span>\n    </div>\n  );\n\n  return (\n    <li className=\"flex flex-col gap-2 px-4 py-3.5\">\n      {post.pinned && (\n        <span className=\"flex items-center gap-1.5 ps-8 font-medium text-muted-foreground text-xs\">\n          <PinIcon className=\"size-3.5\" /> Pinned\n        </span>\n      )}\n      {post.replyTo && (\n        <div className=\"relative flex gap-3\">\n          <span aria-hidden className=\"absolute top-11 bottom-[-0.875rem] left-[19px] w-0.5 rounded-full bg-border\" />\n          <Avatar className=\"[--avatar-size:--spacing(10)]\">\n            <AvatarFallback className={cn(\"bg-gradient-to-br font-semibold text-white text-xs\", hues[post.replyTo.hue].avatar)}>\n              {initials(post.replyTo.name)}\n            </AvatarFallback>\n          </Avatar>\n          <div className=\"flex min-w-0 flex-1 flex-col gap-0.5 pb-1\">\n            <div className=\"flex min-w-0 items-center gap-1.5\">\n              <span className=\"truncate font-medium\">{post.replyTo.name}</span>\n              <span className=\"truncate text-muted-foreground\">@{post.replyTo.handle}</span>\n            </div>\n            <p className=\"text-pretty\">{post.replyTo.text}</p>\n          </div>\n        </div>\n      )}\n      <article className=\"flex gap-3\">\n        <Avatar className=\"[--avatar-size:--spacing(10)]\">\n          <AvatarFallback className={cn(\"bg-gradient-to-br font-heading font-semibold text-white text-xs\", hues.violet.avatar)}>\n            {initials(user.name)}\n          </AvatarFallback>\n        </Avatar>\n        <div className=\"flex min-w-0 flex-1 flex-col gap-1\">\n          {header}\n          {post.replyTo && (\n            <span className=\"-mt-0.5 text-muted-foreground text-xs\">\n              Replying to <span className=\"text-info-foreground\">@{post.replyTo.handle}</span>\n            </span>\n          )}\n          <p className=\"text-pretty leading-relaxed\">\n            <RichText text={post.text} />\n          </p>\n          {post.media && post.media.length > 0 && (\n            <div className={cn(\"mt-1.5 grid gap-1 overflow-hidden rounded-2xl border\", post.media.length > 1 ? \"grid-cols-2\" : \"grid-cols-1\")}>\n              {post.media.map((m) => (\n                <button\n                  aria-label={`Open image: ${m.caption}`}\n                  className={cn(\n                    \"@container block cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset\",\n                    post.media && post.media.length > 1 ? \"aspect-[4/5]\" : \"aspect-[16/10]\",\n                  )}\n                  disabled={!m.glyph || !onOpenMedia}\n                  key={m.caption}\n                  onClick={() => onOpenMedia?.(m)}\n                  type=\"button\"\n                >\n                  <Art art={m} className=\"size-full\" />\n                </button>\n              ))}\n            </div>\n          )}\n          {post.link && (\n            <a\n              className={cn(\n                \"mt-1.5 flex overflow-hidden rounded-2xl border outline-none transition-colors hover:bg-accent/40 focus-visible:ring-2 focus-visible:ring-ring\",\n              )}\n              href={`https://${post.link.domain}`}\n              onClick={(e) => e.preventDefault()}\n            >\n              <span aria-hidden className={cn(\"flex w-24 shrink-0 items-end gap-0.5 bg-gradient-to-br p-2.5 @md:w-32\", hues[post.link.hue].art)}>\n                {[\"bg-amber-100\", \"bg-orange-500\", \"bg-red-700\", \"bg-teal-700\", \"bg-indigo-950\"].map((c) => (\n                  <span className={cn(\"h-7 flex-1 rounded-sm ring-1 ring-black/10\", c)} key={c} />\n                ))}\n              </span>\n              <span className=\"flex min-w-0 flex-col justify-center gap-0.5 px-3 py-3\">\n                <span className=\"truncate text-muted-foreground text-xs\">{post.link.domain}</span>\n                <span className=\"line-clamp-2 font-medium\">{post.link.title}</span>\n              </span>\n            </a>\n          )}\n          <div className=\"-ms-2 mt-1 flex items-center justify-between text-muted-foreground\">\n            <Stat icon={<MessageCircleIcon />} label={`${post.replies} replies`}>\n              {compact(post.replies)}\n            </Stat>\n            <Action\n              active={reposted}\n              activeClass=\"text-emerald-600 dark:text-emerald-400\"\n              icon={<Repeat2Icon />}\n              label={reposted ? \"Undo repost\" : \"Repost\"}\n              onClick={() => setReposted((r) => !r)}\n            >\n              <Count value={post.reposts + (reposted ? 1 : 0)} />\n            </Action>\n            <LikeAction count={post.likes} liked={Boolean(post.liked)} onClick={onLike} />\n            <Stat icon={<BarChart2Icon />} label={`${post.views} views`}>\n              {post.views}\n            </Stat>\n            <div className=\"flex\">\n              <Action\n                active={saved}\n                activeClass=\"text-info-foreground\"\n                icon={<BookmarkIcon className={cn(saved && \"fill-current\")} />}\n                label={saved ? \"Remove bookmark\" : \"Bookmark\"}\n                onClick={() => setSaved((s) => !s)}\n              />\n              <ShareAction id={post.id} />\n            </div>\n          </div>\n        </div>\n      </article>\n    </li>\n  );\n}\n\nfunction Stat({ icon, label, children }: { icon: ReactNode; label: string; children: ReactNode }) {\n  return (\n    <span aria-label={label} className=\"flex h-8 items-center gap-1.5 px-2 text-xs tabular-nums [&_svg]:size-4\" role=\"img\">\n      {icon}\n      <span aria-hidden>{children}</span>\n    </span>\n  );\n}\n\nfunction ShareAction({ id }: { id: string }) {\n  const [copied, setCopied] = useState(false);\n  const timer = useRef<ReturnType<typeof setTimeout> | null>(null);\n  useEffect(() => () => {\n    if (timer.current) clearTimeout(timer.current);\n  }, []);\n  return (\n    <Action\n      active={copied}\n      activeClass=\"text-success-foreground\"\n      icon={\n        <AnimatePresence initial={false} mode=\"popLayout\">\n          <motion.span\n            animate={{ opacity: 1, scale: 1 }}\n            className=\"flex\"\n            exit={{ opacity: 0, scale: 0.8 }}\n            initial={{ opacity: 0, scale: 0.8 }}\n            key={copied ? \"done\" : \"share\"}\n            transition={{ duration: 0.15, ease: easeOut }}\n          >\n            {copied ? <CheckIcon /> : <ShareIcon />}\n          </motion.span>\n        </AnimatePresence>\n      }\n      label={copied ? \"Link copied\" : \"Copy link to post\"}\n      toggle={false}\n      onClick={() => {\n        navigator.clipboard?.writeText(`https://example.com/post/${id}`).catch(() => {});\n        setCopied(true);\n        if (timer.current) clearTimeout(timer.current);\n        timer.current = setTimeout(() => setCopied(false), 1600);\n      }}\n    />\n  );\n}\n\nfunction Action({\n  icon,\n  label,\n  children,\n  active,\n  activeClass,\n  onClick,\n  toggle = true,\n}: {\n  icon: ReactNode;\n  label: string;\n  children?: ReactNode;\n  active?: boolean;\n  activeClass?: string;\n  onClick?: () => void;\n  toggle?: boolean;\n}) {\n  return (\n    <button\n      aria-label={label}\n      aria-pressed={toggle && onClick && active !== undefined ? active : undefined}\n      className={cn(\n        \"flex h-8 cursor-pointer items-center gap-1.5 rounded-full px-2 text-xs outline-none hover:bg-accent hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring [&_svg]:size-4\",\n        press,\n        active && activeClass,\n      )}\n      onClick={onClick}\n      type=\"button\"\n    >\n      {icon}\n      {children}\n    </button>\n  );\n}\n\nfunction LikeAction({ liked, count, onClick }: { liked: boolean; count: number; onClick: () => void }) {\n  const reduce = useReducedMotion();\n  const [pop, setPop] = useState(0);\n  return (\n    <button\n      aria-label={liked ? \"Unlike\" : \"Like\"}\n      aria-pressed={liked}\n      className={cn(\n        \"group/like flex h-8 cursor-pointer items-center gap-1.5 rounded-full px-2 text-xs outline-none hover:bg-rose-500/10 hover:text-rose-600 focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-rose-400\",\n        press,\n        liked && \"text-rose-600 dark:text-rose-400\",\n      )}\n      onClick={() => {\n        if (!liked && !reduce) setPop((p) => p + 1);\n        onClick();\n      }}\n      type=\"button\"\n    >\n      <span className=\"relative flex size-4 items-center justify-center\">\n        <motion.span\n          animate={pop ? { scale: [1, 1.3, 1] } : undefined}\n          key={pop}\n          transition={{ duration: 0.32, times: [0, 0.4, 1], ease: easeOut }}\n        >\n          <HeartIcon className={cn(\"size-4 transition-[fill] duration-150\", liked && \"fill-current\")} />\n        </motion.span>\n        {pop > 0 && (\n          <motion.span\n            animate={{ scale: 1.9, opacity: 0 }}\n            aria-hidden\n            className=\"absolute inset-0 rounded-full border-2 border-rose-500 dark:border-rose-400\"\n            initial={{ scale: 0.6, opacity: 0.8 }}\n            key={`ring-${pop}`}\n            transition={{ duration: 0.4, ease: easeOut }}\n          />\n        )}\n      </span>\n      <Count value={count} />\n    </button>\n  );\n}\n\nfunction Lightbox({\n  items,\n  index,\n  onChange,\n  onClose,\n}: {\n  items: ProfileArt[];\n  index: number | null;\n  onChange: (i: number) => void;\n  onClose: () => void;\n}) {\n  const reduce = useReducedMotion();\n  const closeRef = useRef<HTMLButtonElement>(null);\n  const open = index !== null;\n  useEffect(() => {\n    if (open) closeRef.current?.focus();\n  }, [open]);\n  const item = index !== null ? items[index] : null;\n  const go = (d: number) => index !== null && onChange((index + d + items.length) % items.length);\n\n  return (\n    <AnimatePresence>\n      {open && item && (\n        <motion.div\n          animate={{ opacity: 1 }}\n          aria-label={item.caption}\n          aria-modal\n          className=\"absolute inset-0 z-50 flex flex-col items-center justify-center gap-4 bg-black/85 p-4 backdrop-blur-sm\"\n          exit={{ opacity: 0 }}\n          initial={{ opacity: 0 }}\n          onClick={onClose}\n          onKeyDown={(e) => {\n            if (e.key === \"Escape\") onClose();\n            if (e.key === \"ArrowRight\") go(1);\n            if (e.key === \"ArrowLeft\") go(-1);\n          }}\n          role=\"dialog\"\n          transition={{ duration: 0.2, ease: easeOut }}\n        >\n          <button\n            aria-label=\"Close\"\n            className=\"absolute top-3 right-3 flex size-9 cursor-pointer items-center justify-center rounded-full bg-white/10 text-white outline-none hover:bg-white/20 focus-visible:ring-2 focus-visible:ring-white\"\n            onClick={onClose}\n            ref={closeRef}\n            type=\"button\"\n          >\n            <XIcon className=\"size-4\" />\n          </button>\n          <motion.div\n            animate={{ opacity: 1, scale: 1 }}\n            className=\"@container w-full max-w-[440px]\"\n            initial={reduce ? { opacity: 0 } : { opacity: 0, scale: 0.96 }}\n            onClick={(e) => e.stopPropagation()}\n            transition={{ duration: 0.22, ease: easeOut }}\n          >\n            <AnimatePresence initial={false} mode=\"popLayout\">\n              <motion.div\n                animate={{ opacity: 1 }}\n                className=\"@container\"\n                exit={{ opacity: 0 }}\n                initial={{ opacity: 0 }}\n                key={item.caption}\n                transition={{ duration: 0.15 }}\n              >\n                <Art art={item} className=\"aspect-square w-full rounded-2xl\" large />\n              </motion.div>\n            </AnimatePresence>\n          </motion.div>\n          <div className=\"flex items-center gap-3 text-white\" onClick={(e) => e.stopPropagation()}>\n            <button\n              aria-label=\"Previous\"\n              className=\"flex size-9 cursor-pointer items-center justify-center rounded-full bg-white/10 outline-none hover:bg-white/20 focus-visible:ring-2 focus-visible:ring-white\"\n              onClick={() => go(-1)}\n              type=\"button\"\n            >\n              <ChevronLeftIcon className=\"size-4\" />\n            </button>\n            <span className=\"min-w-44 text-center text-sm\">\n              {item.caption}\n              <span className=\"block text-white/60 text-xs tabular-nums\">\n                {(index ?? 0) + 1} of {items.length}\n              </span>\n            </span>\n            <button\n              aria-label=\"Next\"\n              className=\"flex size-9 cursor-pointer items-center justify-center rounded-full bg-white/10 outline-none hover:bg-white/20 focus-visible:ring-2 focus-visible:ring-white\"\n              onClick={() => go(1)}\n              type=\"button\"\n            >\n              <ChevronRightIcon className=\"size-4\" />\n            </button>\n          </div>\n        </motion.div>\n      )}\n    </AnimatePresence>\n  );\n}\n"
    }
  ]
}