{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "blog-featured-grid",
  "type": "registry:component",
  "title": "Blog Featured Grid",
  "description": "A blog index section with one large featured story beside a two by two grid of recent posts, gradient covers, category chips and author initials.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "blog",
    "blog",
    "posts",
    "grid",
    "featured",
    "journal",
    "covers"
  ],
  "docs": "https://hyperblur.dev/effects/blog-featured-grid",
  "files": [
    {
      "path": "registry/hyperblur/blog-featured-grid.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/blog-featured-grid.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface BlogFeaturedPost {\n  title: string;\n  excerpt?: string;\n  category: string;\n  author: string;\n  date: string;\n  readTime: string;\n  href: string;\n  cover?: string;\n}\n\nexport interface BlogFeaturedGridProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  eyebrow?: string;\n  title?: string;\n  subtitle?: string;\n  posts?: BlogFeaturedPost[];\n  cta?: { label: string; href: string };\n  accent?: string;\n  onPostClick?: (post: BlogFeaturedPost, index: number) => void;\n}\n\nconst defaultPosts: BlogFeaturedPost[] = [\n  {\n    title: \"How we cut cold starts from 1.8s to 240ms without rewriting the runtime\",\n    excerpt: \"A year of profiling edge functions taught us that most latency hides in places nobody measures. Here is the playbook we now run on every new service.\",\n    category: \"Engineering\",\n    author: \"Priya Raman\",\n    date: \"Oct 28, 2026\",\n    readTime: \"12 min read\",\n    href: \"#\",\n  },\n  {\n    title: \"Designing empty states that actually move people forward\",\n    category: \"Design\",\n    author: \"Tomás Álvarez\",\n    date: \"Oct 24, 2026\",\n    readTime: \"6 min read\",\n    href: \"#\",\n  },\n  {\n    title: \"Our pricing page, rebuilt from 41 customer interviews\",\n    category: \"Growth\",\n    author: \"Hana Ito\",\n    date: \"Oct 19, 2026\",\n    readTime: \"8 min read\",\n    href: \"#\",\n  },\n  {\n    title: \"Postgres row-level security at 30,000 tenants\",\n    category: \"Engineering\",\n    author: \"Marcus Bell\",\n    date: \"Oct 14, 2026\",\n    readTime: \"10 min read\",\n    href: \"#\",\n  },\n  {\n    title: \"Release notes: offline drafts, faster search, team spaces\",\n    category: \"Product\",\n    author: \"Elin Berg\",\n    date: \"Oct 9, 2026\",\n    readTime: \"4 min read\",\n    href: \"#\",\n  },\n];\n\nconst palettes = [\n  [\"#2a1b5c\", \"#7c3aed\", \"#f0abfc\"],\n  [\"#0c2f3a\", \"#0ea5a4\", \"#a7f3d0\"],\n  [\"#3a1a12\", \"#ea580c\", \"#fde68a\"],\n  [\"#101c3d\", \"#2f7bff\", \"#bae6fd\"],\n  [\"#2d0f24\", \"#db2777\", \"#fbcfe8\"],\n  [\"#14261a\", \"#16a34a\", \"#d9f99d\"],\n];\n\nfunction hash(value: string) {\n  let h = 2166136261;\n  for (let i = 0; i < value.length; i++) {\n    h ^= value.charCodeAt(i);\n    h = Math.imul(h, 16777619);\n  }\n  return h >>> 0;\n}\n\nfunction initials(name: string) {\n  return name\n    .split(/\\s+/)\n    .filter(Boolean)\n    .slice(0, 2)\n    .map((part) => part[0]?.toUpperCase() ?? \"\")\n    .join(\"\");\n}\n\nfunction coverBackground(seed: number) {\n  const [deep, mid, light] = palettes[seed % palettes.length];\n  const x = 20 + (seed % 60);\n  const y = 15 + ((seed >> 3) % 50);\n  return `radial-gradient(120% 90% at ${x}% ${y}%, ${light} 0%, transparent 42%), radial-gradient(90% 120% at ${100 - x}% 100%, ${mid} 0%, transparent 60%), linear-gradient(135deg, ${deep}, ${mid})`;\n}\n\nfunction CoverArt({ seed }: { seed: number }) {\n  const variant = seed % 4;\n  return (\n    <svg className=\"hb-ki1-art\" viewBox=\"0 0 320 200\" preserveAspectRatio=\"xMidYMid slice\" aria-hidden=\"true\">\n      {variant === 0 &&\n        [0, 1, 2, 3, 4, 5].map((i) => (\n          <circle key={i} cx=\"250\" cy=\"150\" r={(30 + i * 28).toFixed(0)} fill=\"none\" stroke=\"rgba(255,255,255,.22)\" strokeWidth=\"1\" />\n        ))}\n      {variant === 1 &&\n        Array.from({ length: 14 }, (_, i) => (\n          <line key={i} x1={(i * 26 - 40).toFixed(0)} y1=\"210\" x2={(i * 26 + 60).toFixed(0)} y2=\"-10\" stroke=\"rgba(255,255,255,.16)\" strokeWidth=\"1\" />\n        ))}\n      {variant === 2 &&\n        Array.from({ length: 60 }, (_, i) => {\n          const cx = 20 + (i % 12) * 26;\n          const cy = 24 + Math.floor(i / 12) * 38;\n          const r = 1.4 + ((hash(`${seed}-${i}`) % 30) / 10);\n          return <circle key={i} cx={cx} cy={cy} r={r.toFixed(2)} fill=\"rgba(255,255,255,.32)\" />;\n        })}\n      {variant === 3 &&\n        [0, 1, 2, 3].map((i) => (\n          <path\n            key={i}\n            d={`M -10 ${(120 + i * 18).toFixed(0)} C 80 ${(60 + i * 18).toFixed(0)}, 180 ${(180 + i * 12).toFixed(0)}, 330 ${(90 + i * 20).toFixed(0)}`}\n            fill=\"none\"\n            stroke=\"rgba(255,255,255,.24)\"\n            strokeWidth=\"1.2\"\n          />\n        ))}\n    </svg>\n  );\n}\n\nconst css = `\n.hb-ki1 {\n  --hb-ki1-accent: #8b5cf6;\n  box-sizing: border-box;\n  width: 100%;\n  container-type: inline-size;\n  background: #0a0a0a;\n  color: #ededed;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-ki1 *, .hb-ki1 *::before, .hb-ki1 *::after { box-sizing: border-box; }\n.hb-ki1-inner {\n  max-width: 1120px;\n  margin: 0 auto;\n  padding: clamp(56px, 9cqi, 104px) clamp(18px, 4cqi, 40px);\n}\n.hb-ki1-head {\n  display: grid;\n  gap: 18px;\n  margin-bottom: clamp(28px, 4cqi, 44px);\n}\n.hb-ki1-eyebrow {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  margin: 0 0 12px;\n  color: var(--hb-ki1-accent);\n  font-size: 13px;\n  font-weight: 600;\n  letter-spacing: .04em;\n  text-transform: uppercase;\n}\n.hb-ki1-eyebrow::before {\n  content: \"\";\n  width: 18px;\n  height: 1px;\n  background: currentColor;\n}\n.hb-ki1-title {\n  margin: 0;\n  max-width: 620px;\n  font-size: clamp(30px, 4.6cqi, 46px);\n  font-weight: 650;\n  line-height: 1.06;\n  letter-spacing: -.035em;\n  text-wrap: balance;\n}\n.hb-ki1-side { display: grid; gap: 16px; align-content: end; justify-items: start; }\n.hb-ki1-sub {\n  margin: 0;\n  max-width: 420px;\n  color: #8f8f8f;\n  font-size: 15px;\n  line-height: 1.6;\n}\n.hb-ki1-cta {\n  display: inline-flex;\n  align-items: center;\n  gap: 8px;\n  height: 38px;\n  padding: 0 16px;\n  border: 1px solid rgba(255,255,255,.12);\n  border-radius: 999px;\n  background: rgba(255,255,255,.03);\n  color: #ededed;\n  font-size: 14px;\n  font-weight: 500;\n  text-decoration: none;\n  transition: border-color .2s ease, background-color .2s ease;\n}\n.hb-ki1-cta svg { width: 14px; height: 14px; transition: transform .25s cubic-bezier(.2,.7,.2,1); }\n.hb-ki1-cta:hover { border-color: rgba(255,255,255,.24); background: rgba(255,255,255,.06); }\n.hb-ki1-cta:hover svg { transform: translateX(3px); }\n.hb-ki1-cta:focus-visible { outline: 2px solid var(--hb-ki1-accent); outline-offset: 3px; }\n.hb-ki1-grid {\n  display: grid;\n  gap: 16px;\n}\n.hb-ki1-minis { display: grid; gap: 16px; }\n.hb-ki1-card {\n  position: relative;\n  display: flex;\n  flex-direction: column;\n  min-width: 0;\n  border: 1px solid rgba(255,255,255,.08);\n  border-radius: 18px;\n  background: linear-gradient(180deg, #131313, #0f0f0f);\n  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);\n  color: inherit;\n  text-decoration: none;\n  overflow: hidden;\n  animation: hb-ki1-rise .7s cubic-bezier(.2,.7,.2,1) both;\n  animation-delay: var(--hb-ki1-d, 0ms);\n  transition: border-color .25s ease, transform .35s cubic-bezier(.2,.7,.2,1);\n}\n.hb-ki1-card:hover { border-color: color-mix(in srgb, var(--hb-ki1-accent) 40%, rgba(255,255,255,.08)); transform: translateY(-2px); }\n.hb-ki1-card:focus-visible { outline: 2px solid var(--hb-ki1-accent); outline-offset: 3px; }\n.hb-ki1-cover {\n  position: relative;\n  aspect-ratio: 16 / 9;\n  overflow: hidden;\n  border-bottom: 1px solid rgba(255,255,255,.06);\n}\n.hb-ki1-feat .hb-ki1-cover { aspect-ratio: 16 / 10; }\n.hb-ki1-zoom {\n  position: absolute;\n  inset: 0;\n  transition: transform .8s cubic-bezier(.2,.7,.2,1);\n}\n.hb-ki1-zoom::after {\n  content: \"\";\n  position: absolute;\n  width: 60%;\n  aspect-ratio: 1;\n  left: 50%;\n  top: 30%;\n  border-radius: 50%;\n  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 65%);\n  filter: blur(18px);\n  animation: hb-ki1-drift 14s ease-in-out infinite alternate;\n}\n.hb-ki1-card:hover .hb-ki1-zoom, .hb-ki1-card:focus-visible .hb-ki1-zoom { transform: scale(1.07); }\n.hb-ki1-art { position: absolute; inset: 0; width: 100%; height: 100%; }\n.hb-ki1-shade {\n  position: absolute;\n  inset: 0;\n  background: linear-gradient(180deg, transparent 55%, rgba(10,10,10,.55));\n}\n.hb-ki1-chip {\n  position: absolute;\n  left: 12px;\n  top: 12px;\n  display: inline-flex;\n  align-items: center;\n  height: 24px;\n  padding: 0 10px;\n  border: 1px solid rgba(255,255,255,.18);\n  border-radius: 999px;\n  background: rgba(10,10,10,.42);\n  backdrop-filter: blur(8px);\n  -webkit-backdrop-filter: blur(8px);\n  color: #fff;\n  font-size: 11.5px;\n  font-weight: 600;\n  letter-spacing: .02em;\n}\n.hb-ki1-body {\n  display: flex;\n  flex: 1;\n  flex-direction: column;\n  gap: 10px;\n  padding: 14px 16px 16px;\n}\n.hb-ki1-feat .hb-ki1-body { gap: 12px; padding: 20px 22px 22px; }\n.hb-ki1-ptitle {\n  margin: 0;\n  font-size: 15.5px;\n  font-weight: 600;\n  line-height: 1.32;\n  letter-spacing: -.01em;\n  text-wrap: pretty;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n.hb-ki1-feat .hb-ki1-ptitle {\n  font-size: clamp(20px, 2.6cqi, 27px);\n  line-height: 1.18;\n  letter-spacing: -.025em;\n  -webkit-line-clamp: 3;\n}\n.hb-ki1-ptitle span {\n  background: linear-gradient(var(--hb-ki1-accent), var(--hb-ki1-accent)) 0 100% / 0 1px no-repeat;\n  transition: background-size .4s cubic-bezier(.2,.7,.2,1);\n}\n.hb-ki1-card:hover .hb-ki1-ptitle span { background-size: 100% 1px; }\n.hb-ki1-excerpt {\n  margin: 0;\n  color: #8f8f8f;\n  font-size: 14.5px;\n  line-height: 1.6;\n  display: -webkit-box;\n  -webkit-line-clamp: 2;\n  -webkit-box-orient: vertical;\n  overflow: hidden;\n}\n.hb-ki1-meta {\n  display: flex;\n  align-items: center;\n  gap: 10px;\n  margin-top: auto;\n  color: #8f8f8f;\n  font-size: 12.5px;\n  min-width: 0;\n}\n.hb-ki1-avatar {\n  display: inline-grid;\n  place-items: center;\n  flex: none;\n  width: 26px;\n  height: 26px;\n  border-radius: 50%;\n  box-shadow: inset 0 0 0 1px rgba(255,255,255,.2);\n  color: #fff;\n  font-size: 10.5px;\n  font-weight: 700;\n  letter-spacing: .02em;\n}\n.hb-ki1-feat .hb-ki1-avatar { width: 30px; height: 30px; font-size: 11.5px; }\n.hb-ki1-name { color: #d4d4d4; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\n.hb-ki1-dot { width: 3px; height: 3px; flex: none; border-radius: 50%; background: #4a4a4a; }\n.hb-ki1-time { white-space: nowrap; }\n.hb-ki1-hide-sm { display: none; }\n@container (min-width: 640px) {\n  .hb-ki1-head { grid-template-columns: 1.3fr 1fr; align-items: end; }\n  .hb-ki1-side { justify-items: end; text-align: right; }\n  .hb-ki1-minis { grid-template-columns: 1fr 1fr; }\n  .hb-ki1-hide-sm { display: inline; }\n}\n@container (min-width: 880px) {\n  .hb-ki1-grid { grid-template-columns: 1.08fr 1fr; gap: 18px; }\n  .hb-ki1-minis { gap: 18px; }\n  .hb-ki1-feat .hb-ki1-cover { aspect-ratio: auto; flex: 1; min-height: 240px; }\n}\n@keyframes hb-ki1-rise {\n  from { opacity: 0; transform: translateY(14px); }\n  to { opacity: 1; transform: none; }\n}\n@keyframes hb-ki1-drift {\n  from { transform: translate(-80%, -30%) scale(.9); }\n  to { transform: translate(-10%, 20%) scale(1.15); }\n}\n@media (prefers-reduced-motion: reduce) {\n  .hb-ki1-card, .hb-ki1-zoom::after { animation: none; }\n  .hb-ki1-card, .hb-ki1-zoom, .hb-ki1-cta svg, .hb-ki1-ptitle span { transition: none; }\n}\n`;\n\nfunction Arrow() {\n  return (\n    <svg viewBox=\"0 0 16 16\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden=\"true\">\n      <path d=\"M3 8h10M9 4l4 4-4 4\" />\n    </svg>\n  );\n}\n\nfunction PostCard({\n  post,\n  index,\n  featured,\n  onPostClick,\n}: {\n  post: BlogFeaturedPost;\n  index: number;\n  featured: boolean;\n  onPostClick?: (post: BlogFeaturedPost, index: number) => void;\n}) {\n  const seed = hash(post.title) + index * 7;\n  const avatarSeed = hash(post.author);\n  const [b, a] = palettes[avatarSeed % palettes.length];\n  return (\n    <a\n      className={featured ? \"hb-ki1-card hb-ki1-feat\" : \"hb-ki1-card\"}\n      href={post.href}\n      onClick={onPostClick ? () => onPostClick(post, index) : undefined}\n      style={{ \"--hb-ki1-d\": `${(index * 90).toFixed(0)}ms` } as React.CSSProperties}\n    >\n      <div className=\"hb-ki1-cover\">\n        <div className=\"hb-ki1-zoom\" style={{ background: post.cover ?? coverBackground(seed) }}>\n          {!post.cover && <CoverArt seed={seed} />}\n        </div>\n        <div className=\"hb-ki1-shade\" />\n        <span className=\"hb-ki1-chip\">{post.category}</span>\n      </div>\n      <div className=\"hb-ki1-body\">\n        <h3 className=\"hb-ki1-ptitle\">\n          <span>{post.title}</span>\n        </h3>\n        {featured && post.excerpt && <p className=\"hb-ki1-excerpt\">{post.excerpt}</p>}\n        <div className=\"hb-ki1-meta\">\n          <span className=\"hb-ki1-avatar\" style={{ background: `linear-gradient(135deg, ${a}, ${b})` }} aria-hidden=\"true\">\n            {initials(post.author)}\n          </span>\n          <span className=\"hb-ki1-name\">{post.author}</span>\n          <span className=\"hb-ki1-dot\" aria-hidden=\"true\" />\n          {featured && (\n            <>\n              <span className=\"hb-ki1-time hb-ki1-hide-sm\">{post.date}</span>\n              <span className=\"hb-ki1-dot hb-ki1-hide-sm\" aria-hidden=\"true\" />\n            </>\n          )}\n          <span className=\"hb-ki1-time\">{post.readTime}</span>\n        </div>\n      </div>\n    </a>\n  );\n}\n\nexport function BlogFeaturedGrid({\n  eyebrow = \"The Northwind journal\",\n  title = \"Notes on building fast, calm software\",\n  subtitle = \"Deep dives from our engineering, design and growth teams. New essays every Tuesday.\",\n  posts = defaultPosts,\n  cta = { label: \"View all posts\", href: \"#\" },\n  accent = \"#8b5cf6\",\n  onPostClick,\n  className,\n  style,\n  ...rest\n}: BlogFeaturedGridProps) {\n  const [featured, ...others] = posts;\n  return (\n    <section\n      className={className ? `hb-ki1 ${className}` : \"hb-ki1\"}\n      style={{ \"--hb-ki1-accent\": accent, ...style } as React.CSSProperties}\n      {...rest}\n    >\n      <style href=\"hb-blog-featured-grid\" precedence=\"default\">{css}</style>\n      <div className=\"hb-ki1-inner\">\n        <header className=\"hb-ki1-head\">\n          <div>\n            {eyebrow && <p className=\"hb-ki1-eyebrow\">{eyebrow}</p>}\n            <h2 className=\"hb-ki1-title\">{title}</h2>\n          </div>\n          <div className=\"hb-ki1-side\">\n            {subtitle && <p className=\"hb-ki1-sub\">{subtitle}</p>}\n            {cta && (\n              <a className=\"hb-ki1-cta\" href={cta.href}>\n                {cta.label}\n                <Arrow />\n              </a>\n            )}\n          </div>\n        </header>\n        {featured && (\n          <div className=\"hb-ki1-grid\">\n            <PostCard post={featured} index={0} featured onPostClick={onPostClick} />\n            {others.length > 0 && (\n              <div className=\"hb-ki1-minis\">\n                {others.slice(0, 4).map((post, i) => (\n                  <PostCard key={`${post.title}-${i}`} post={post} index={i + 1} featured={false} onPostClick={onPostClick} />\n                ))}\n              </div>\n            )}\n          </div>\n        )}\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}