Skip to content

Production-ready animations, transitions, backgrounds, and scenes for Remotion

feat: site redesign — landing, docs, guides, blog, showcases, sponsors

kapishdima299e7bb1ab67
diff --git a/CLAUDE.md b/CLAUDE.md
index d2410e56..450bba6b 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -80,3 +80,13 @@ bun run build # production-сборка сайта
bun run typecheck # tsc --noEmit
bun run lint # biome check
bun run registry:build # пересборка registry-artifacts из registry/
+
+<!-- BEGIN:nextjs-agent-rules -->
+
+# This is NOT the Next.js you know
+
+This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.
+
+This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.
+
+<!-- END:nextjs-agent-rules -->
diff --git a/app/(home)/blog/[slug]/page.tsx b/app/(home)/blog/[slug]/page.tsx
index 44086464..efe6b18f 100644
--- a/app/(home)/blog/[slug]/page.tsx
+++ b/app/(home)/blog/[slug]/page.tsx
@@ -1,12 +1,20 @@
-import { ArrowLeft } from "lucide-react";
import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
import { blog } from "@/.source/server";
import { GuideVideo } from "@/components/docs/guide-video";
-import { blogDateFormatter, blogSlug } from "@/lib/blog";
-import { sortByDateDesc } from "@/lib/changelog";
+import { blogSlug } from "@/lib/blog";
+import { cn } from "@/lib/utils";
import { getMDXComponents } from "@/mdx-components";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+import { CopyTextButton } from "../../components/site-page/copy-text-button";
+import { pageHeaderButton } from "../../components/site-page/page-header";
+import { MorePosts } from "../components/more-posts";
+import { PostIndexNav } from "../components/post-index-nav";
+import { PostMeta } from "../components/post-meta";
+import { ScreeningPlayer } from "../components/screening-player";
+import { POST_KIND_LABEL } from "../lib/post-types";
+import { getBlogPosts } from "../lib/posts";
type PageProps = { params: Promise<{ slug: string }> };
@@ -54,87 +62,97 @@ export async function generateMetadata({
const postComponents = { ...getMDXComponents(), GuideVideo };
+const MORE_POSTS = 3;
+
export default async function BlogPostPage({ params }: PageProps) {
const { slug } = await params;
const post = getPost(slug);
if (!post) notFound();
- const iso = post.date.toISOString().slice(0, 10);
+ const posts = await getBlogPosts();
+ const index = posts.findIndex((item) => item.slug === slug);
+ const summary = posts[index];
+ const more = [...posts.slice(index + 1), ...posts.slice(0, index)].slice(
+ 0,
+ MORE_POSTS,
+ );
+ const headings = post.toc.filter((item) => item.depth <= 3);
const MDX = post.body;
- const sorted = sortByDateDesc(blog);
- const index = sorted.findIndex((p) => blogSlug(p) === slug);
- const next = index === -1 ? undefined : sorted[index + 1];
return (
- <section className="pt-10 pb-24 sm:pt-14">
- <div className="section flex flex-col gap-8">
- <Link
- href="/blog"
- className="group relative inline-flex w-fit items-center gap-1.5 text-sm font-medium text-muted-foreground transition-colors before:absolute before:inset-x-0 before:-inset-y-2 before:content-[''] hover:text-foreground"
- >
- <ArrowLeft
- className="size-4 transition-transform group-hover:-translate-x-0.5"
- aria-hidden="true"
- />
- Blog
- </Link>
-
- {post.video ? (
- <GuideVideo
- src={post.video}
- poster={post.videoPoster}
- label={post.title}
+ <>
+ <article>
+ <header className="landing-container flex flex-col gap-5 pt-12 pb-8 md:pt-20 md:pb-12 xl:pt-28 xl:pb-14">
+ <Link
+ href="/blog"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ pageHeaderButton,
+ "self-start",
+ )}
+ >
+ <span aria-hidden="true" className="text-primary">
+ ←
+ </span>
+ Blog
+ </Link>
+ <PostMeta
+ iso={summary.iso}
+ date={summary.dateLabel}
+ tag={POST_KIND_LABEL[summary.kind]}
+ className="pt-3"
/>
- ) : null}
-
- <div className="flex flex-col gap-3">
- <h1 className="text-balance text-3xl font-semibold leading-[1.1] tracking-tight text-foreground sm:text-4xl">
+ <h1 className="max-w-[920px] text-[34px] leading-[38px] tracking-heading text-balance text-foreground md:text-h3">
{post.title}
</h1>
- <time
- dateTime={iso}
- className="font-mono text-xs font-medium text-muted-foreground"
- >
- {blogDateFormatter.format(post.date)}
- </time>
- </div>
-
- <div className="typeset typeset-docs max-w-2xl">
- <MDX components={postComponents} />
- </div>
+ <p className="max-w-[680px] text-[18px] leading-[26px] text-muted-foreground text-pretty md:text-lead">
+ {post.description}
+ </p>
+ </header>
- <div className="max-w-2xl border-t border-border pt-8">
- {next ? (
- <>
- <p className="font-mono text-xs font-medium text-muted-foreground">
- Read next
- </p>
- <Link
- href={`/blog/${blogSlug(next)}`}
- className="group mt-3 flex flex-col gap-1"
- >
- <span className="text-balance text-lg font-semibold tracking-tight text-foreground group-hover:underline">
- {next.title}
- </span>
- <span className="text-pretty text-sm leading-relaxed text-muted-foreground">
- {next.description}
- </span>
- </Link>
- </>
- ) : (
- <Link
- href="/blog"
- className="group relative inline-flex items-center gap-1.5 text-sm font-medium text-muted-foreground transition-colors before:absolute before:inset-x-0 before:-inset-y-2 before:content-[''] hover:text-foreground"
- >
- <ArrowLeft
- className="size-4 transition-transform group-hover:-translate-x-0.5"
- aria-hidden="true"
+ <div className="landing-container xl:flex xl:gap-[120px]">
+ <div className="flex min-w-0 flex-col gap-10 md:gap-14 xl:w-[820px] xl:shrink-0">
+ {summary.video && (
+ <ScreeningPlayer
+ src={summary.video}
+ poster={summary.poster}
+ label={post.title}
+ duration={summary.duration}
+ beats={summary.beats.length}
/>
- All posts
- </Link>
+ )}
+ <div className="typeset typeset-docs max-w-[680px]">
+ <MDX components={postComponents} />
+ </div>
+ </div>
+
+ {(headings.length > 0 || summary.prompt) && (
+ <aside className="hidden w-[300px] shrink-0 flex-col gap-7 self-start xl:sticky xl:top-8 xl:flex">
+ {headings.length > 0 && <PostIndexNav headings={headings} />}
+ {summary.prompt && (
+ <div className="flex flex-col gap-3.5 px-2">
+ <p className="text-small text-muted-foreground">
+ The brief behind this cut, ready to paste into your agent.
+ </p>
+ <CopyTextButton
+ text={summary.prompt}
+ copiedLabel="Prompt copied"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ pageHeaderButton,
+ "self-start",
+ )}
+ >
+ Copy the prompt
+ </CopyTextButton>
+ </div>
+ )}
+ </aside>
)}
</div>
- </div>
- </section>
+ </article>
+
+ <MorePosts posts={more} />
+ </>
);
}
diff --git a/app/(home)/blog/components/beats-list.tsx b/app/(home)/blog/components/beats-list.tsx
new file mode 100644
index 00000000..f1e5687a
--- /dev/null
+++ b/app/(home)/blog/components/beats-list.tsx
@@ -0,0 +1,56 @@
+import { cn } from "@/lib/utils";
+
+/**
+ * Numbered storyboard beats; the first is lit. With `limit`, the rest
+ * collapse into a "+N more beats in the storyboard" row.
+ */
+export function BeatsList({
+ beats,
+ limit,
+ className,
+}: {
+ beats: string[];
+ limit?: number;
+ className?: string;
+}) {
+ const shown = limit ? beats.slice(0, limit) : beats;
+ const more = beats.length - shown.length;
+
+ return (
+ <ol className={cn("flex flex-col border-t border-divider", className)}>
+ {shown.map((beat, index) => (
+ <li
+ key={beat}
+ className="flex gap-3 border-b border-hairline py-3 last:border-b-0 md:py-2.5"
+ >
+ <span
+ className={cn(
+ "w-6 shrink-0 text-caption leading-5 tabular-nums",
+ index === 0 ? "text-primary" : "text-subtle",
+ )}
+ >
+ {String(index + 1).padStart(2, "0")}
+ </span>
+ <span
+ className={cn(
+ "text-[15px] leading-5 md:text-small",
+ index === 0 ? "text-foreground" : "text-body",
+ )}
+ >
+ {beat}
+ </span>
+ </li>
+ ))}
+ {more > 0 && (
+ <li className="flex gap-3 py-3 md:py-2.5">
+ <span className="w-6 shrink-0 text-caption leading-5 text-subtle tabular-nums">
+ +{more}
+ </span>
+ <span className="text-[15px] leading-5 text-muted-foreground md:text-small">
+ more beats in the storyboard
+ </span>
+ </li>
+ )}
+ </ol>
+ );
+}
diff --git a/app/(home)/blog/components/blog-header.tsx b/app/(home)/blog/components/blog-header.tsx
new file mode 100644
index 00000000..2b06c507
--- /dev/null
+++ b/app/(home)/blog/components/blog-header.tsx
@@ -0,0 +1,45 @@
+import { cn } from "@/lib/utils";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+import {
+ pageHeaderButton,
+ SitePageHeader,
+} from "../../components/site-page/page-header";
+
+export const BLOG_LEAD =
+ "The storyboard, the decisions that made each one work, and the prompt that rebuilds it.";
+
+export function BlogHeader({ count }: { count: number }) {
+ return (
+ <SitePageHeader
+ eyebrow={`Blog, ${count} posts`}
+ title="Making-of stories"
+ continuation="behind every video we cut."
+ lead={BLOG_LEAD}
+ >
+ <div className="flex">
+ <a
+ href="/blog/rss.xml"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ pageHeaderButton,
+ )}
+ >
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-3.5 shrink-0 fill-none stroke-current stroke-[2.6] [stroke-linecap:round]"
+ >
+ <circle
+ cx="5"
+ cy="19"
+ r="2.2"
+ className="fill-current stroke-none"
+ />
+ <path d="M3 11a10 10 0 0 1 10 10M3 4a17 17 0 0 1 17 17" />
+ </svg>
+ Subscribe via RSS
+ </a>
+ </div>
+ </SitePageHeader>
+ );
+}
diff --git a/app/(home)/blog/components/featured-post.tsx b/app/(home)/blog/components/featured-post.tsx
new file mode 100644
index 00000000..a7461c8a
--- /dev/null
+++ b/app/(home)/blog/components/featured-post.tsx
@@ -0,0 +1,77 @@
+import { cn } from "@/lib/utils";
+import {
+ LandingButton,
+ landingButtonVariants,
+} from "../../components/landing/ui/landing-button";
+import { CopyTextButton } from "../../components/site-page/copy-text-button";
+import { type BlogPostSummary, POST_KIND_LABEL } from "../lib/post-types";
+import { BeatsList } from "./beats-list";
+import { PostMeta } from "./post-meta";
+import { ScreeningPlayer } from "./screening-player";
+
+const BUTTON =
+ "h-12 w-full rounded-control-sm px-4 text-[15px] leading-5 font-medium md:h-10 md:w-auto";
+
+/**
+ * The screening room: the newest launch video in its player, next to the
+ * first beats of its storyboard and the two ways in (read it, copy the
+ * prompt that rebuilds it).
+ */
+export function FeaturedPost({ post }: { post: BlogPostSummary }) {
+ return (
+ <section
+ aria-label="Featured making-of"
+ className="landing-container md:pb-16 xl:pb-[88px]"
+ >
+ <div className="flex flex-col gap-2 rounded-panel bg-surface p-2 shadow-[0_0_0_1px_var(--hairline),0_24px_48px_-32px_#0e10122e] md:p-2.5 xl:flex-row xl:rounded-shell">
+ {post.video && (
+ <ScreeningPlayer
+ src={post.video}
+ poster={post.poster}
+ label={post.title}
+ duration={post.duration}
+ beats={post.beats.length}
+ className="xl:w-[820px] xl:shrink-0"
+ />
+ )}
+
+ <div className="flex min-w-0 grow flex-col justify-between gap-6 px-3 pt-4 pb-3 md:gap-7 md:pt-7 md:pr-6 md:pb-3.5 md:pl-7">
+ <div className="flex flex-col gap-3 md:gap-4">
+ <PostMeta
+ iso={post.iso}
+ date={post.dateLabel}
+ tag={POST_KIND_LABEL[post.kind]}
+ />
+ <h2 className="text-[24px] leading-[30px] font-medium tracking-title text-foreground text-balance md:text-[30px] md:leading-[34px]">
+ {post.title}
+ </h2>
+ <p className="text-ui leading-6 text-muted-foreground text-pretty">
+ {post.description}
+ </p>
+ </div>
+
+ <div className="flex flex-col gap-6">
+ <BeatsList beats={post.beats} limit={3} />
+ <div className="flex flex-col gap-2 md:flex-row">
+ <LandingButton href={`/blog/${post.slug}`} className={BUTTON}>
+ Read the making-of
+ </LandingButton>
+ {post.prompt && (
+ <CopyTextButton
+ text={post.prompt}
+ copiedLabel="Prompt copied"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ BUTTON,
+ )}
+ >
+ Copy the prompt
+ </CopyTextButton>
+ )}
+ </div>
+ </div>
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/blog/components/guide-card.tsx b/app/(home)/blog/components/guide-card.tsx
new file mode 100644
index 00000000..73a4e59f
--- /dev/null
+++ b/app/(home)/blog/components/guide-card.tsx
@@ -0,0 +1,35 @@
+import { LandingButton } from "../../components/landing/ui/landing-button";
+
+const BUTTON =
+ "h-12 rounded-control-sm px-4 text-[15px] leading-5 font-medium md:h-10";
+
+/** Closing card of the index: where the recipe behind every cut lives. */
+export function GuideCard() {
+ return (
+ <aside className="flex flex-col justify-between gap-7 rounded-card bg-surface p-6 shadow-[0_0_0_1px_var(--hairline)] md:bg-surface-muted md:p-7 md:shadow-none">
+ <div className="flex flex-col gap-3">
+ <p className="text-caption text-primary">Make one for your product</p>
+ <h3 className="text-[24px] leading-[30px] font-medium tracking-title text-foreground md:text-[26px] md:leading-8">
+ Every cut here ships with the prompt that rebuilds it.
+ </h3>
+ <p className="text-[15px] leading-[22px] text-muted-foreground md:text-small md:leading-[21px]">
+ The generic recipe is the launch video guide. Pointing your agent at
+ your site’s own tokens is the part that makes a spot feel like it came
+ from inside the company.
+ </p>
+ </div>
+ <div className="flex flex-col gap-2 md:flex-row">
+ <LandingButton href="/docs/guides/launch-video" className={BUTTON}>
+ Launch video guide
+ </LandingButton>
+ <LandingButton
+ href="/docs/guides/your-brand"
+ variant="secondary"
+ className={BUTTON}
+ >
+ Your brand
+ </LandingButton>
+ </div>
+ </aside>
+ );
+}
diff --git a/app/(home)/blog/components/more-posts.tsx b/app/(home)/blog/components/more-posts.tsx
new file mode 100644
index 00000000..6b42af70
--- /dev/null
+++ b/app/(home)/blog/components/more-posts.tsx
@@ -0,0 +1,35 @@
+import Link from "next/link";
+import type { BlogPostSummary } from "../lib/post-types";
+import { PostCard } from "./post-card";
+
+/** The next three posts, newest first, under the article. */
+export function MorePosts({ posts }: { posts: BlogPostSummary[] }) {
+ if (posts.length === 0) return null;
+
+ return (
+ <section
+ aria-labelledby="more-posts"
+ className="landing-container flex flex-col gap-8 pt-16 pb-[72px] md:gap-10 md:pt-24 xl:pb-section"
+ >
+ <div className="flex items-end justify-between gap-4 border-b border-divider pb-4 md:pb-5">
+ <h2
+ id="more-posts"
+ className="text-[22px] leading-7 tracking-title text-foreground md:text-quote"
+ >
+ More making-of stories
+ </h2>
+ <Link
+ href="/blog"
+ className="-mx-2 rounded-full px-2 text-small text-muted-foreground outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ All posts
+ </Link>
+ </div>
+ <div className="grid gap-8 md:grid-cols-2 md:gap-y-14 xl:grid-cols-3">
+ {posts.map((post) => (
+ <PostCard key={post.slug} post={post} size="sm" />
+ ))}
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/blog/components/post-card.tsx b/app/(home)/blog/components/post-card.tsx
new file mode 100644
index 00000000..4baeb2c1
--- /dev/null
+++ b/app/(home)/blog/components/post-card.tsx
@@ -0,0 +1,67 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { type BlogPostSummary, POST_KIND_LABEL } from "../lib/post-types";
+import { PostMeta } from "./post-meta";
+import { PostPoster } from "./post-poster";
+
+/**
+ * Index card: poster, meta, title, description; the whole card links to the
+ * post. `lg` sits two-up, `sm` in the three-column grid.
+ */
+export function PostCard({
+ post,
+ size,
+}: {
+ post: BlogPostSummary;
+ size: "lg" | "sm";
+}) {
+ const lg = size === "lg";
+ const beats = post.beats.length;
+
+ return (
+ <Link
+ href={`/blog/${post.slug}`}
+ className={cn(
+ "group flex min-w-0 flex-col rounded-card outline-none focus-visible:ring-3 focus-visible:ring-ring focus-visible:ring-offset-4 focus-visible:ring-offset-background",
+ lg ? "gap-4 md:gap-5" : "gap-3.5 md:gap-[18px]",
+ )}
+ >
+ <PostPoster poster={post.poster} duration={post.duration} size={size} />
+ <div className={cn("flex flex-col", lg ? "gap-2.5 md:pr-6" : "gap-2")}>
+ {lg || beats === 0 ? (
+ <PostMeta
+ iso={post.iso}
+ date={post.dateLabel}
+ tag={POST_KIND_LABEL[post.kind]}
+ />
+ ) : (
+ <PostMeta
+ iso={post.iso}
+ date={post.dateLabel}
+ trailing={`${beats} beats`}
+ />
+ )}
+ <h3
+ className={cn(
+ "font-medium tracking-title text-foreground text-balance",
+ lg
+ ? "text-[22px] leading-7 md:text-[26px] md:leading-8"
+ : "text-[18px] leading-[26px] md:text-lead md:leading-[26px]",
+ )}
+ >
+ {post.title}
+ </h3>
+ <p
+ className={cn(
+ "text-muted-foreground text-pretty",
+ lg
+ ? "text-[15px] leading-[22px]"
+ : "text-[15px] leading-[22px] md:text-small md:leading-[21px]",
+ )}
+ >
+ {post.description}
+ </p>
+ </div>
+ </Link>
+ );
+}
diff --git a/app/(home)/blog/components/post-index-nav.tsx b/app/(home)/blog/components/post-index-nav.tsx
new file mode 100644
index 00000000..9add8484
--- /dev/null
+++ b/app/(home)/blog/components/post-index-nav.tsx
@@ -0,0 +1,68 @@
+"use client";
+
+import { type ReactNode, useMemo } from "react";
+import { cn } from "@/lib/utils";
+import { useActiveSection } from "../../components/site-page/use-active-section";
+
+export type PostHeading = { title: ReactNode; url: string; depth: number };
+
+/**
+ * Sticky "In this post" index beside the article, numbered like the legal
+ * page; the heading being read is raised.
+ */
+export function PostIndexNav({ headings }: { headings: PostHeading[] }) {
+ const ids = useMemo(
+ () => headings.map((heading) => heading.url.replace(/^#/, "")),
+ [headings],
+ );
+ const active = useActiveSection(ids);
+
+ return (
+ <nav
+ aria-label="In this post"
+ className="flex flex-col gap-1 rounded-card bg-surface-muted p-2"
+ >
+ <p className="flex items-center justify-between px-3.5 pt-3 pb-2">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ In this post
+ </span>
+ <span className="text-caption text-subtle tabular-nums">
+ {headings.length}
+ </span>
+ </p>
+ {headings.map((heading, index) => {
+ const current = ids[index] === active;
+ return (
+ <a
+ key={heading.url}
+ href={heading.url}
+ aria-current={current ? "location" : undefined}
+ className={cn(
+ "flex min-h-10 shrink-0 items-center gap-2.5 rounded-control-sm px-3.5 py-2.5 outline-none transition-[background-color,box-shadow] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-ring",
+ current
+ ? "bg-surface shadow-[0_0_0_1px_var(--hairline),0_1px_2px_#0e10120a] dark:bg-secondary dark:shadow-[inset_0_1px_0_#ffffff0f,0_0_0_1px_#ffffff0f]"
+ : "hover:bg-surface/70 dark:hover:bg-secondary/60",
+ )}
+ >
+ <span
+ className={cn(
+ "w-[22px] shrink-0 text-caption tabular-nums",
+ current ? "text-primary" : "text-subtle",
+ )}
+ >
+ {String(index + 1).padStart(2, "0")}
+ </span>
+ <span
+ className={cn(
+ "text-[15px] leading-5",
+ current ? "text-primary" : "text-body",
+ )}
+ >
+ {heading.title}
+ </span>
+ </a>
+ );
+ })}
+ </nav>
+ );
+}
diff --git a/app/(home)/blog/components/post-index.tsx b/app/(home)/blog/components/post-index.tsx
new file mode 100644
index 00000000..b1098b14
--- /dev/null
+++ b/app/(home)/blog/components/post-index.tsx
@@ -0,0 +1,95 @@
+"use client";
+
+import { useState } from "react";
+import { cn } from "@/lib/utils";
+import {
+ type BlogPostSummary,
+ POST_KIND_LABEL,
+ type PostKind,
+} from "../lib/post-types";
+import { GuideCard } from "./guide-card";
+import { PostCard } from "./post-card";
+
+type Filter = "all" | PostKind;
+
+const FILTERS: { id: Filter; label: string }[] = [
+ { id: "all", label: "All posts" },
+ { id: "launch", label: `${POST_KIND_LABEL.launch}s` },
+ { id: "product", label: POST_KIND_LABEL.product },
+];
+
+/**
+ * Everything but the featured post: a kind filter, the two newest as large
+ * cards, the rest in a three-column grid closed by the guide card.
+ */
+export function PostIndex({
+ posts,
+ counts,
+}: {
+ posts: BlogPostSummary[];
+ /** Totals per filter, featured post included. */
+ counts: Record<Filter, number>;
+}) {
+ const [filter, setFilter] = useState<Filter>("all");
+ const shown =
+ filter === "all" ? posts : posts.filter((post) => post.kind === filter);
+ const large = shown.slice(0, 2);
+ const rest = shown.slice(2);
+
+ return (
+ <section
+ aria-label="All posts"
+ className="landing-container flex flex-col gap-8 pt-14 pb-[72px] md:gap-10 md:pt-0 xl:pb-section"
+ >
+ <div className="border-b border-divider pb-4 md:pb-5">
+ <fieldset
+ aria-label="Filter posts"
+ className="-mx-5 flex min-w-0 gap-2 overflow-x-auto px-5 [scrollbar-width:none] md:mx-0 md:px-0"
+ >
+ {FILTERS.map((item) => {
+ const active = item.id === filter;
+ return (
+ <button
+ key={item.id}
+ type="button"
+ aria-pressed={active}
+ onClick={() => setFilter(item.id)}
+ className={cn(
+ "flex h-11 shrink-0 items-center gap-2 rounded-control-sm px-3.5 text-[15px] leading-5 outline-none transition-colors duration-150 focus-visible:ring-3 focus-visible:ring-ring md:h-[34px] md:rounded-[10px] md:px-3",
+ active
+ ? "bg-foreground text-background"
+ : "bg-secondary text-foreground hover:bg-[#dcdde0] dark:hover:bg-[#33363b]",
+ )}
+ >
+ {item.label}
+ <span
+ className={cn(
+ "text-caption tabular-nums",
+ active ? "text-background/65" : "text-muted-foreground",
+ )}
+ >
+ {counts[item.id]}
+ </span>
+ </button>
+ );
+ })}
+ </fieldset>
+ </div>
+
+ {large.length > 0 && (
+ <div className="grid gap-8 md:grid-cols-2">
+ {large.map((post) => (
+ <PostCard key={post.slug} post={post} size="lg" />
+ ))}
+ </div>
+ )}
+
+ <div className="grid gap-8 md:grid-cols-2 md:gap-y-14 md:pt-6 xl:grid-cols-3">
+ {rest.map((post) => (
+ <PostCard key={post.slug} post={post} size="sm" />
+ ))}
+ <GuideCard />
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/blog/components/post-meta.tsx b/app/(home)/blog/components/post-meta.tsx
new file mode 100644
index 00000000..bd744c9b
--- /dev/null
+++ b/app/(home)/blog/components/post-meta.tsx
@@ -0,0 +1,42 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/** Date (mono on desktop) followed by an optional tag or trailing note. */
+export function PostMeta({
+ iso,
+ date,
+ tag,
+ trailing,
+ className,
+}: {
+ iso: string;
+ date: string;
+ tag?: ReactNode;
+ /** Pushed to the far end, e.g. "9 beats". */
+ trailing?: ReactNode;
+ className?: string;
+}) {
+ return (
+ <div
+ className={cn(
+ "flex items-center gap-2.5 text-caption text-muted-foreground md:gap-3",
+ trailing && "justify-between",
+ className,
+ )}
+ >
+ <span className="flex items-center gap-2.5 md:gap-3">
+ <time dateTime={iso}>{date}</time>
+ {tag && <PostTag>{tag}</PostTag>}
+ </span>
+ {trailing && <span>{trailing}</span>}
+ </div>
+ );
+}
+
+export function PostTag({ children }: { children: ReactNode }) {
+ return (
+ <span className="flex h-6 items-center rounded-tag bg-surface-muted px-2 text-caption text-body md:h-[22px]">
+ {children}
+ </span>
+ );
+}
diff --git a/app/(home)/blog/components/post-poster.tsx b/app/(home)/blog/components/post-poster.tsx
new file mode 100644
index 00000000..96c9c8bc
--- /dev/null
+++ b/app/(home)/blog/components/post-poster.tsx
@@ -0,0 +1,52 @@
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import { PlayGlyph } from "../../components/site-page/play-glyph";
+
+/**
+ * Poster frame of a post's video with a play key: a plain 36px key on large
+ * cards, a key + duration chip on small ones.
+ */
+export function PostPoster({
+ poster,
+ duration,
+ size,
+}: {
+ poster: string | null;
+ duration: number | null;
+ size: "lg" | "sm";
+}) {
+ return (
+ <div
+ className={cn(
+ "relative aspect-video overflow-hidden bg-dark-surface shadow-[0_0_0_1px_var(--hairline)]",
+ size === "lg" ? "rounded-card" : "rounded-cta",
+ )}
+ >
+ {poster && (
+ // biome-ignore lint/performance/noImgElement: remote CDN video posters of arbitrary origin
+ <img
+ src={poster}
+ alt=""
+ loading="lazy"
+ className="size-full object-cover transition-transform duration-200 ease-[cubic-bezier(0.19,1,0.22,1)] motion-safe:group-hover:scale-[1.015]"
+ />
+ )}
+ {size === "lg" ? (
+ <span className="absolute bottom-3.5 left-3.5 flex size-9 items-center justify-center rounded-[10px] bg-[#fafafa]">
+ <PlayGlyph />
+ </span>
+ ) : (
+ <span className="absolute bottom-2.5 left-2.5 flex h-8 items-center gap-2 rounded-[10px] bg-[#0e1012b8] pr-2.5 pl-1">
+ <span className="flex size-6 items-center justify-center rounded-[7px] bg-[#fafafa]">
+ <PlayGlyph className="h-2 w-1.5" />
+ </span>
+ {duration !== null && (
+ <span className="text-caption text-[#fafafa] tabular-nums">
+ {formatDuration(duration)}
+ </span>
+ )}
+ </span>
+ )}
+ </div>
+ );
+}
diff --git a/app/(home)/blog/components/screening-player.tsx b/app/(home)/blog/components/screening-player.tsx
new file mode 100644
index 00000000..5da8404c
--- /dev/null
+++ b/app/(home)/blog/components/screening-player.tsx
@@ -0,0 +1,193 @@
+"use client";
+
+import {
+ useCallback,
+ useEffect,
+ useLayoutEffect,
+ useRef,
+ useState,
+} from "react";
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import { PauseGlyph, PlayGlyph } from "../../components/site-page/play-glyph";
+
+/**
+ * The screening-room player: the video on a dark stage, a white play key,
+ * the elapsed / total time, a ruler with a scrubbable playhead and the beat
+ * count. Plays only on request; nothing autoplays.
+ */
+export function ScreeningPlayer({
+ src,
+ poster,
+ label,
+ duration: durationHint,
+ beats,
+ className,
+}: {
+ src: string;
+ poster?: string | null;
+ label: string;
+ /** Seconds, known on the server; replaced by the video's own metadata. */
+ duration: number | null;
+ beats: number;
+ className?: string;
+}) {
+ const videoRef = useRef<HTMLVideoElement>(null);
+ const rulerRef = useRef<HTMLDivElement>(null);
+ const headRef = useRef<HTMLSpanElement>(null);
+ const [playing, setPlaying] = useState(false);
+ const [time, setTime] = useState(0);
+ const [duration, setDuration] = useState(durationHint ?? 0);
+
+ // `timeupdate` fires about four times a second, too coarse for the
+ // playhead, so it is painted from the video's own clock every frame.
+ const paintHead = useCallback(() => {
+ const video = videoRef.current;
+ const ruler = rulerRef.current;
+ const head = headRef.current;
+ if (!video || !ruler || !head || duration <= 0) return;
+ const progress = Math.min(video.currentTime / duration, 1);
+ head.style.transform = `translateX(${(ruler.clientWidth - 19) * progress}px)`;
+ }, [duration]);
+
+ // biome-ignore lint/correctness/useExhaustiveDependencies: repaint when a seek or `timeupdate` moves the time
+ useLayoutEffect(() => {
+ paintHead();
+ }, [time, paintHead]);
+
+ useEffect(() => {
+ const ruler = rulerRef.current;
+ if (!ruler) return;
+ const observer = new ResizeObserver(paintHead);
+ observer.observe(ruler);
+ return () => observer.disconnect();
+ }, [paintHead]);
+
+ useEffect(() => {
+ if (!playing) return;
+ let frame = 0;
+ const tick = () => {
+ paintHead();
+ frame = requestAnimationFrame(tick);
+ };
+ frame = requestAnimationFrame(tick);
+ return () => cancelAnimationFrame(frame);
+ }, [playing, paintHead]);
+
+ const toggle = () => {
+ const video = videoRef.current;
+ if (!video) return;
+ if (video.paused) void video.play().catch(() => {});
+ else video.pause();
+ };
+
+ return (
+ <div
+ className={cn(
+ "flex flex-col gap-2 rounded-[18px] bg-dark-surface p-2 md:gap-2.5 md:rounded-card md:p-2.5",
+ className,
+ )}
+ >
+ <div className="aspect-video overflow-hidden rounded-[10px] bg-dark-raised md:rounded-control-sm">
+ {/* biome-ignore lint/a11y/useMediaCaption: the CDN videos ship without caption tracks */}
+ <video
+ ref={videoRef}
+ src={src}
+ poster={poster ?? undefined}
+ aria-label={label}
+ playsInline
+ preload="metadata"
+ onPlay={() => setPlaying(true)}
+ onPause={() => setPlaying(false)}
+ onEnded={() => setPlaying(false)}
+ onTimeUpdate={(e) => setTime(e.currentTarget.currentTime)}
+ onLoadedMetadata={(e) => {
+ if (Number.isFinite(e.currentTarget.duration)) {
+ setDuration(e.currentTarget.duration);
+ }
+ }}
+ onClick={toggle}
+ className="size-full cursor-pointer object-cover"
+ />
+ </div>
+
+ <div className="flex h-10 items-center gap-2.5 md:gap-3.5 md:pr-1">
+ <button
+ type="button"
+ onClick={toggle}
+ aria-label={playing ? "Pause video" : "Play video"}
+ className="relative flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-[#fafafa] outline-none after:absolute after:-inset-0.5 transition-[background-color,translate] duration-150 ease-out hover:bg-white focus-visible:ring-3 focus-visible:ring-white/40 active:translate-y-px"
+ >
+ {playing ? <PauseGlyph /> : <PlayGlyph />}
+ </button>
+ <span className="shrink-0 text-caption text-dark-body tabular-nums">
+ {formatDuration(time)} / {formatDuration(duration)}
+ </span>
+
+ <div
+ ref={rulerRef}
+ className="relative flex h-10 min-w-0 grow items-center justify-between overflow-hidden rounded-[10px] bg-dark-raised pr-2.5 pl-4 md:pr-4 md:pl-[22px]"
+ >
+ {duration > 0 && <RulerLabels duration={duration} />}
+ <span
+ ref={headRef}
+ aria-hidden="true"
+ className="pointer-events-none absolute top-2 left-2 h-6 w-[3px] rounded-[2px] bg-[#fafafa]"
+ />
+ <input
+ type="range"
+ min={0}
+ max={duration || 1}
+ step={0.1}
+ value={time}
+ aria-label="Seek"
+ aria-valuetext={formatDuration(time)}
+ onChange={(e) => {
+ const next = Number(e.currentTarget.value);
+ if (videoRef.current) videoRef.current.currentTime = next;
+ setTime(next);
+ }}
+ className="seek-range absolute inset-0 size-full opacity-0 [--seek-thumb:19px] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60"
+ />
+ </div>
+
+ {beats > 0 && (
+ <span className="shrink-0 text-caption text-dark-body">
+ {beats} beats
+ </span>
+ )}
+ </div>
+ </div>
+ );
+}
+
+/**
+ * Seconds along the ruler: every 10s plus the end on desktop (with hairline
+ * separators), start / a third / end on mobile.
+ */
+function RulerLabels({ duration }: { duration: number }) {
+ const end = Math.round(duration);
+ const stops: number[] = [];
+ for (let t = 0; t < end; t += 10) stops.push(t);
+ if (stops.length > 1 && end - stops[stops.length - 1] <= 5) stops.pop();
+ stops.push(end);
+ const third = Math.round(end / 30) * 10;
+ const compact = new Set([0, third, end]);
+
+ return stops.map((t, index) => (
+ <span key={t} aria-hidden="true" className="contents">
+ {index > 0 && (
+ <span className="hidden h-3 w-px shrink-0 bg-[#3a3e42] md:block" />
+ )}
+ <span
+ className={cn(
+ "text-caption tabular-nums",
+ index === 0 ? "text-[#fafafa]" : "text-dark-body",
+ !compact.has(t) && "max-md:hidden",
+ )}
+ >
+ {t}s
+ </span>
+ </span>
+ ));
+}
diff --git a/app/(home)/blog/lib/post-types.ts b/app/(home)/blog/lib/post-types.ts
new file mode 100644
index 00000000..82aef577
--- /dev/null
+++ b/app/(home)/blog/lib/post-types.ts
@@ -0,0 +1,26 @@
+/** Client-safe post types (no content-collection imports). */
+
+export type PostKind = "launch" | "product";
+
+export const POST_KIND_LABEL: Record<PostKind, string> = {
+ launch: "Launch video",
+ product: "Product",
+};
+
+/** Serializable card data for one post, derived from its MDX source. */
+export type BlogPostSummary = {
+ slug: string;
+ title: string;
+ description: string;
+ iso: string;
+ dateLabel: string;
+ kind: PostKind;
+ /** Beat names from the "The storyboard" list (launch videos only). */
+ beats: string[];
+ /** The fenced prompt under "The prompt", copyable as-is. */
+ prompt: string | null;
+ video: string | null;
+ poster: string | null;
+ /** Seconds, read from the video file. */
+ duration: number | null;
+};
diff --git a/app/(home)/blog/lib/posts.ts b/app/(home)/blog/lib/posts.ts
new file mode 100644
index 00000000..b56f809a
--- /dev/null
+++ b/app/(home)/blog/lib/posts.ts
@@ -0,0 +1,65 @@
+import { cache } from "react";
+import { blog } from "@/.source/server";
+import { blogSlug } from "@/lib/blog";
+import { sortByDateDesc } from "@/lib/changelog";
+import { getVideoDuration } from "@/lib/video-duration";
+import type { BlogPostSummary } from "./post-types";
+
+export type { BlogPostSummary, PostKind } from "./post-types";
+export { POST_KIND_LABEL } from "./post-types";
+
+export const shortDateFormatter = new Intl.DateTimeFormat("en-US", {
+ timeZone: "UTC",
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+});
+
+/** Body of the `### <heading>` section, up to the next h2/h3. */
+function section(raw: string, heading: string): string | null {
+ const start = raw.indexOf(`### ${heading}`);
+ if (start === -1) return null;
+ const rest = raw.slice(start + heading.length + 4);
+ const end = rest.search(/^#{2,3} /m);
+ return end === -1 ? rest : rest.slice(0, end);
+}
+
+function parseBeats(raw: string): string[] {
+ const storyboard = section(raw, "The storyboard");
+ if (!storyboard) return [];
+ return [...storyboard.matchAll(/^\d+\.\s+\*\*(.+?)\*\*/gm)].map(
+ (match) => match[1],
+ );
+}
+
+function parsePrompt(raw: string): string | null {
+ const body = section(raw, "The prompt");
+ const fence = body?.match(/```[^\n]*\n([\s\S]*?)\n```/);
+ return fence ? fence[1] : null;
+}
+
+type BlogEntry = (typeof blog)[number];
+
+async function summarize(post: BlogEntry): Promise<BlogPostSummary> {
+ const raw = await post.getText("raw");
+ const beats = parseBeats(raw);
+ return {
+ slug: blogSlug(post),
+ title: post.title,
+ description: post.description,
+ iso: post.date.toISOString().slice(0, 10),
+ dateLabel: shortDateFormatter.format(post.date),
+ kind: beats.length > 0 ? "launch" : "product",
+ beats,
+ prompt: parsePrompt(raw),
+ video: post.video ?? null,
+ poster: post.videoPoster ?? null,
+ duration: post.video ? await getVideoDuration(post.video) : null,
+ };
+}
+
+/** All posts, newest first, with storyboard, prompt and video length. */
+export const getBlogPosts = cache(
+ (): Promise<BlogPostSummary[]> =>
+ Promise.all(sortByDateDesc(blog).map(summarize)),
+);
diff --git a/app/(home)/blog/page.tsx b/app/(home)/blog/page.tsx
index e5ec60b6..f59e2847 100644
--- a/app/(home)/blog/page.tsx
+++ b/app/(home)/blog/page.tsx
@@ -1,9 +1,8 @@
import type { Metadata } from "next";
-import Link from "next/link";
-import { blog } from "@/.source/server";
-import { blogDateFormatter, blogSlug } from "@/lib/blog";
-import { sortByDateDesc } from "@/lib/changelog";
-import { cn } from "@/lib/utils";
+import { BlogHeader } from "./components/blog-header";
+import { FeaturedPost } from "./components/featured-post";
+import { PostIndex } from "./components/post-index";
+import { getBlogPosts } from "./lib/posts";
const DESCRIPTION =
"Making-of stories behind the videos we build with remocn — the storyboard, the decisions that made each one work, and the prompt that rebuilds it.";
@@ -34,74 +33,24 @@ export const metadata: Metadata = {
},
};
-export default function BlogPage() {
- const posts = sortByDateDesc(blog);
+export default async function BlogPage() {
+ const posts = await getBlogPosts();
+ const featured =
+ posts.find((post) => post.beats.length > 0 && post.video) ?? posts[0];
+ const rest = posts.filter((post) => post !== featured);
return (
<>
- <section className="pt-24 pb-10 sm:pt-28">
- <div className="section">
- <h1 className="text-4xl font-semibold leading-[1.05] tracking-tight text-foreground sm:text-5xl">
- Blog
- </h1>
- <p className="mt-4 max-w-2xl text-pretty text-base leading-relaxed text-muted-foreground sm:text-lg">
- {DESCRIPTION}
- </p>
- </div>
- </section>
-
- <section className="pb-24">
- <ul className="section flex flex-col">
- {posts.map((post, index) => {
- const slug = blogSlug(post);
- const iso = post.date.toISOString().slice(0, 10);
-
- return (
- <li key={slug}>
- <article
- className={cn(
- "group relative grid gap-4 py-8 md:grid-cols-[7rem_1fr_16rem] md:gap-8",
- index > 0 && "border-t border-border",
- )}
- >
- <time
- dateTime={iso}
- className="font-mono text-xs font-medium tabular-nums text-muted-foreground md:pt-1"
- >
- {blogDateFormatter.format(post.date)}
- </time>
-
- <div className="flex min-w-0 flex-col gap-2">
- <h2 className="text-balance text-xl font-semibold tracking-tight text-foreground group-hover:underline sm:text-2xl">
- <Link
- href={`/blog/${slug}`}
- className="after:absolute after:inset-0"
- >
- {post.title}
- </Link>
- </h2>
- <p className="text-pretty text-sm leading-relaxed text-muted-foreground">
- {post.description}
- </p>
- </div>
-
- <div className="aspect-video overflow-hidden rounded-lg bg-muted outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10">
- {post.videoPoster ? (
- // biome-ignore lint/performance/noImgElement: remote CDN video posters of arbitrary origin
- <img
- src={post.videoPoster}
- alt=""
- loading="lazy"
- className="size-full object-cover transition-transform duration-300 group-hover:scale-[1.02]"
- />
- ) : null}
- </div>
- </article>
- </li>
- );
- })}
- </ul>
- </section>
+ <BlogHeader count={posts.length} />
+ {featured && <FeaturedPost post={featured} />}
+ <PostIndex
+ posts={rest}
+ counts={{
+ all: posts.length,
+ launch: posts.filter((post) => post.kind === "launch").length,
+ product: posts.filter((post) => post.kind === "product").length,
+ }}
+ />
</>
);
}
diff --git a/app/(home)/changelog/components/changelog-entry.tsx b/app/(home)/changelog/components/changelog-entry.tsx
new file mode 100644
index 00000000..cc479cac
--- /dev/null
+++ b/app/(home)/changelog/components/changelog-entry.tsx
@@ -0,0 +1,65 @@
+import Link from "next/link";
+import type { ComponentProps, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+
+/**
+ * Small secondary pill used for per-entry actions ("Watch", "Read"); the
+ * pseudo-element stretches its hit area to 44px.
+ */
+export const entryActionClass = cn(
+ landingButtonVariants({ variant: "secondary" }),
+ "relative h-8 gap-1.5 rounded-[10px] px-3 text-small after:absolute after:inset-x-0 after:-inset-y-1.5",
+);
+
+/**
+ * One changelog row: a sticky mono date on the left, the titled body on the
+ * right. The article carries the `#slug` anchor that entries are shared by.
+ */
+export function ChangelogEntry({
+ slug,
+ iso,
+ formattedDate,
+ title,
+ action,
+ children,
+}: {
+ slug: string;
+ iso: string;
+ formattedDate: string;
+ title: string;
+ action?: ReactNode;
+ children: ReactNode;
+}) {
+ return (
+ <article
+ id={slug}
+ className="scroll-mt-8 border-t border-divider pt-8 pb-14 md:grid md:grid-cols-[200px_minmax(0,1fr)] md:gap-10 md:pt-10 md:pb-16"
+ >
+ <div className="md:sticky md:top-8 md:self-start md:pt-2">
+ <time dateTime={iso} className="text-caption text-muted-foreground">
+ {formattedDate}
+ </time>
+ </div>
+
+ <div className="mt-3 min-w-0 max-w-[760px] md:mt-0">
+ <div className="flex items-start justify-between gap-4">
+ <h2 className="text-[22px]/[28px] font-medium tracking-title text-balance text-foreground md:text-[26px]/[32px]">
+ <a
+ href={`#${slug}`}
+ className="-mx-2 box-decoration-clone rounded-tile px-2 outline-none transition-colors hover:bg-muted focus-visible:ring-3 focus-visible:ring-ring"
+ >
+ {title}
+ </a>
+ </h2>
+ {action}
+ </div>
+ {children}
+ </div>
+ </article>
+ );
+}
+
+export function EntryActionLink(props: ComponentProps<typeof Link>) {
+ return <Link {...props} className={cn(entryActionClass, props.className)} />;
+}
diff --git a/app/(home)/changelog/components/changelog-header.tsx b/app/(home)/changelog/components/changelog-header.tsx
new file mode 100644
index 00000000..c71b2a94
--- /dev/null
+++ b/app/(home)/changelog/components/changelog-header.tsx
@@ -0,0 +1,54 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+import {
+ pageHeaderButton,
+ SitePageHeader,
+} from "../../components/site-page/page-header";
+
+const VIEWS = [
+ { id: "text", href: "/changelog", label: "Text" },
+ { id: "video", href: "/changelog/video", label: "Video" },
+] as const;
+
+/** Page header shared by `/changelog` and `/changelog/video`. */
+export function ChangelogHeader({
+ active,
+ eyebrow,
+ continuation,
+}: {
+ active: (typeof VIEWS)[number]["id"];
+ eyebrow: string;
+ continuation: string;
+}) {
+ return (
+ <SitePageHeader
+ eyebrow={eyebrow}
+ title="Changelog."
+ continuation={continuation}
+ lead="New components, transitions, shaders, and icons as they ship."
+ >
+ <nav aria-label="Changelog view" className="flex gap-2.5">
+ {VIEWS.map((view) => {
+ const isActive = view.id === active;
+ return (
+ <Link
+ key={view.id}
+ href={view.href}
+ aria-current={isActive ? "page" : undefined}
+ className={cn(
+ landingButtonVariants({
+ variant: isActive ? "ink" : "secondary",
+ }),
+ pageHeaderButton,
+ "flex-1 md:flex-none",
+ )}
+ >
+ {view.label}
+ </Link>
+ );
+ })}
+ </nav>
+ </SitePageHeader>
+ );
+}
diff --git a/components/changelog/changelog-preview.tsx b/app/(home)/changelog/components/changelog-preview.tsx
similarity index 95%
rename from components/changelog/changelog-preview.tsx
rename to app/(home)/changelog/components/changelog-preview.tsx
index 169b5ba3..c6e77565 100644
--- a/components/changelog/changelog-preview.tsx
+++ b/app/(home)/changelog/components/changelog-preview.tsx
@@ -17,7 +17,7 @@ export function ChangelogPreview({ name }: { name: string }) {
}
return (
- <div className="not-prose mb-6 w-full">
+ <div className="not-prose my-6 w-full">
<PreviewStage
name={name}
load={entry.load}
diff --git a/components/changelog/changelog-video-feed.tsx b/app/(home)/changelog/components/video-feed.tsx
similarity index 69%
rename from components/changelog/changelog-video-feed.tsx
rename to app/(home)/changelog/components/video-feed.tsx
index 97e97384..152f0f87 100644
--- a/components/changelog/changelog-video-feed.tsx
+++ b/app/(home)/changelog/components/video-feed.tsx
@@ -1,8 +1,8 @@
"use client";
-import Link from "next/link";
import { useEffect, useRef, useState } from "react";
-import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+import { useLoopControls } from "../../components/site-page/use-loop-controls";
+import { ChangelogEntry, EntryActionLink } from "./changelog-entry";
export interface ChangelogVideoEntry {
slug: string;
@@ -77,7 +77,7 @@ export function ChangelogVideoFeed({
}, [entries]);
return (
- <div ref={containerRef} className="section flex flex-col gap-16">
+ <div ref={containerRef} className="landing-container pb-16 xl:pb-[120px]">
{entries.map((entry) => (
<ChangelogVideoCard
key={entry.slug}
@@ -100,8 +100,7 @@ function ChangelogVideoCard({
near: boolean;
}) {
const videoRef = useRef<HTMLVideoElement>(null);
- const reducedMotion = usePrefersReducedMotion();
- const [hovered, setHovered] = useState(false);
+ const { reducedMotion, videoProps } = useLoopControls();
useEffect(() => {
const video = videoRef.current;
@@ -114,52 +113,36 @@ function ChangelogVideoCard({
}, [active, reducedMotion]);
return (
- <article
- id={entry.slug}
- className="scroll-mt-24 border-t border-border pt-8 md:grid md:grid-cols-[10rem_1fr] md:gap-8"
+ <ChangelogEntry
+ slug={entry.slug}
+ iso={entry.iso}
+ formattedDate={entry.formattedDate}
+ title={entry.title}
>
- <div className="md:sticky md:top-24 md:self-start">
- <time
- dateTime={entry.iso}
- className="font-mono text-xs font-medium text-muted-foreground"
- >
- {entry.formattedDate}
- </time>
- </div>
-
- <div className="mt-4 min-w-0 md:mt-0">
- <h2 className="text-2xl font-semibold tracking-tight text-foreground sm:text-3xl">
- <a href={`#${entry.slug}`} className="hover:underline">
- {entry.title}
- </a>
- </h2>
-
+ {/* Screening-room frame: always dark, a hairline ring in dark mode. */}
+ <div className="mt-6 rounded-card bg-dark-surface p-2 md:p-2.5 dark:bg-surface dark:shadow-[0_0_0_1px_var(--hairline)]">
<div
data-video-slug={entry.slug}
- className="surface-card mt-6 aspect-video w-full overflow-hidden rounded-2xl"
+ className="aspect-video w-full overflow-hidden rounded-control-sm bg-dark-raised"
>
<video
ref={videoRef}
src={entry.video}
poster={near ? entry.videoPoster : undefined}
- controls={hovered || reducedMotion}
- onPointerEnter={() => setHovered(true)}
- onPointerLeave={() => setHovered(false)}
+ aria-label={entry.title}
muted
loop
playsInline
preload="none"
- className="size-full object-cover"
+ className="size-full object-cover outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-white/60"
+ {...videoProps}
/>
</div>
-
- <Link
- href={`/changelog#${entry.slug}`}
- className="mt-4 inline-block text-sm font-medium text-muted-foreground hover:text-foreground"
- >
- Read the full entry
- </Link>
</div>
- </article>
+
+ <EntryActionLink href={`/changelog#${entry.slug}`} className="mt-4">
+ Read the full entry
+ </EntryActionLink>
+ </ChangelogEntry>
);
}
diff --git a/app/(home)/changelog/page.tsx b/app/(home)/changelog/page.tsx
index 7d9a179e..09e120d0 100644
--- a/app/(home)/changelog/page.tsx
+++ b/app/(home)/changelog/page.tsx
@@ -1,15 +1,15 @@
import type { Metadata } from "next";
-import Link from "next/link";
import type { ComponentProps } from "react";
import { changelog } from "@/.source/server";
-import { ChangelogHero } from "@/components/changelog/changelog-hero";
-import { ChangelogPreview } from "@/components/changelog/changelog-preview";
import {
changelogDateFormatter,
changelogSlug,
sortByDateDesc,
} from "@/lib/changelog";
import { getMDXComponents } from "@/mdx-components";
+import { ChangelogEntry, EntryActionLink } from "./components/changelog-entry";
+import { ChangelogHeader } from "./components/changelog-header";
+import { ChangelogPreview } from "./components/changelog-preview";
const DESCRIPTION =
"Every release of remocn — new components, transitions, shaders, icons, and improvements, newest first.";
@@ -49,54 +49,41 @@ export default function ChangelogPage() {
return (
<>
- <ChangelogHero active="text" />
+ <ChangelogHeader
+ active="text"
+ eyebrow={`Changelog, ${entries.length} releases`}
+ continuation="Every release, newest first."
+ />
- <section className="pb-24">
- <div className="section flex flex-col gap-16">
- {entries.map((entry) => {
- const slug = changelogSlug(entry);
- const iso = entry.date.toISOString().slice(0, 10);
- const MDX = entry.body;
+ <section className="landing-container pb-16 xl:pb-[120px]">
+ {entries.map((entry) => {
+ const slug = changelogSlug(entry);
+ const MDX = entry.body;
- return (
- <article
- key={slug}
- id={slug}
- className="scroll-mt-24 border-t border-border pt-8 md:grid md:grid-cols-[10rem_1fr] md:gap-8"
- >
- <div className="md:sticky md:top-24 md:self-start">
- <time
- dateTime={iso}
- className="font-mono text-xs font-medium text-muted-foreground"
+ return (
+ <ChangelogEntry
+ key={slug}
+ slug={slug}
+ iso={entry.date.toISOString().slice(0, 10)}
+ formattedDate={changelogDateFormatter.format(entry.date)}
+ title={entry.title}
+ action={
+ entry.video ? (
+ <EntryActionLink
+ href={`/changelog/video#${slug}`}
+ className="mt-0.5"
>
- {changelogDateFormatter.format(entry.date)}
- </time>
- </div>
-
- <div className="mt-4 min-w-0 md:mt-0">
- <div className="flex items-baseline justify-between gap-4">
- <h2 className="text-2xl font-semibold tracking-tight text-foreground sm:text-3xl">
- <a href={`#${slug}`} className="hover:underline">
- {entry.title}
- </a>
- </h2>
- {entry.video ? (
- <Link
- href={`/changelog/video#${slug}`}
- className="shrink-0 text-sm font-medium text-muted-foreground hover:text-foreground"
- >
- Watch
- </Link>
- ) : null}
- </div>
- <div className="typeset typeset-docs mt-6">
- <MDX components={entryComponents} />
- </div>
- </div>
- </article>
- );
- })}
- </div>
+ Watch
+ </EntryActionLink>
+ ) : null
+ }
+ >
+ <div className="typeset typeset-docs mt-6">
+ <MDX components={entryComponents} />
+ </div>
+ </ChangelogEntry>
+ );
+ })}
</section>
</>
);
diff --git a/app/(home)/changelog/video/page.tsx b/app/(home)/changelog/video/page.tsx
index 0ea7a7cf..f358c459 100644
--- a/app/(home)/changelog/video/page.tsx
+++ b/app/(home)/changelog/video/page.tsx
@@ -1,12 +1,12 @@
import type { Metadata } from "next";
import { changelog } from "@/.source/server";
-import { ChangelogHero } from "@/components/changelog/changelog-hero";
-import { ChangelogVideoFeed } from "@/components/changelog/changelog-video-feed";
import {
changelogDateFormatter,
changelogSlug,
sortByDateDesc,
} from "@/lib/changelog";
+import { ChangelogHeader } from "../components/changelog-header";
+import { ChangelogVideoFeed } from "../components/video-feed";
const DESCRIPTION =
"Every remocn release as a short video — new components, transitions, shaders, and icons, newest first.";
@@ -52,10 +52,12 @@ export const metadata: Metadata = {
export default function ChangelogVideoPage() {
return (
<>
- <ChangelogHero active="video" />
- <section className="pb-24">
- <ChangelogVideoFeed entries={entries} />
- </section>
+ <ChangelogHeader
+ active="video"
+ eyebrow={`Changelog, ${entries.length} videos`}
+ continuation="Every release, in video."
+ />
+ <ChangelogVideoFeed entries={entries} />
</>
);
}
diff --git a/app/(home)/components/fade-up.tsx b/app/(home)/components/fade-up.tsx
index e7b82b29..9d4b9237 100644
--- a/app/(home)/components/fade-up.tsx
+++ b/app/(home)/components/fade-up.tsx
@@ -2,10 +2,22 @@
import { motion, useInView, useReducedMotion } from "motion/react";
import { type ReactNode, useEffect, useRef, useState } from "react";
-import { SPRING_BOUNCE } from "@/config/site";
-const HIDDEN = { opacity: 0, y: 24, filter: "blur(8px)" };
-const VISIBLE = { opacity: 1, y: 0, filter: "blur(0px)" };
+const EASE_OUT_EXPO = [0.19, 1, 0.22, 1] as const;
+
+// Transform strings so the entrance runs off the main thread.
+const HIDDEN = {
+ opacity: 0,
+ transform: "translateY(24px)",
+ filter: "blur(8px)",
+};
+const VISIBLE = {
+ opacity: 1,
+ transform: "translateY(0px)",
+ filter: "blur(0px)",
+};
+const FADED = { opacity: 0 };
+const SHOWN = { opacity: 1 };
export function FadeUp({
children,
@@ -20,7 +32,7 @@ export function FadeUp({
}) {
const ref = useRef<HTMLDivElement>(null);
const inView = useInView(ref, { once: true, amount: 0.2 });
- const reduced = useReducedMotion();
+ const reduced = useReducedMotion() ?? false;
const [seen] = useState(
() =>
gate !== undefined &&
@@ -30,14 +42,21 @@ export function FadeUp({
useEffect(() => {
if (gate !== undefined) sessionStorage.setItem(gate, "1");
}, [gate]);
- const instant = Boolean(reduced) || seen;
+ // Reduced motion keeps the fade and drops the rise and blur.
+ const [hidden, visible] = reduced ? [FADED, SHOWN] : [HIDDEN, VISIBLE];
return (
<motion.div
ref={ref}
className={className}
- initial={HIDDEN}
- animate={instant || inView ? VISIBLE : HIDDEN}
- transition={instant ? { duration: 0 } : { ...SPRING_BOUNCE, delay }}
+ initial={hidden}
+ animate={seen || inView ? visible : hidden}
+ transition={
+ seen
+ ? { duration: 0 }
+ : reduced
+ ? { duration: 0.3, ease: "easeOut", delay }
+ : { duration: 0.8, ease: EASE_OUT_EXPO, delay }
+ }
>
{children}
</motion.div>
diff --git a/app/(home)/components/github-button.tsx b/app/(home)/components/github-button.tsx
index c2c68d5f..e8f03163 100644
--- a/app/(home)/components/github-button.tsx
+++ b/app/(home)/components/github-button.tsx
@@ -13,7 +13,7 @@ export async function GithubButton() {
data-track="cta_clicked"
data-cta="github_header"
data-destination={GITHUB_URL}
- className="inline-flex h-9 items-center gap-2 rounded-full px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
+ className="inline-flex h-9 items-center gap-2 rounded-full px-3 text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
>
<GitHubIcon className="size-4" />
{stars !== null && (
diff --git a/app/(home)/components/header-nav.tsx b/app/(home)/components/header-nav.tsx
index f7d32721..b0f39a9b 100644
--- a/app/(home)/components/header-nav.tsx
+++ b/app/(home)/components/header-nav.tsx
@@ -30,13 +30,43 @@ const canOpenMenu = () =>
* pointer can travel into the panel, and instant section switching while the
* panel is already open (the panel slides its content instead of reopening).
*/
+const VARIANT_STYLES = {
+ default: {
+ nav: "relative hidden items-center gap-1 sm:flex",
+ item: "relative inline-flex items-center gap-1.5 rounded-full px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none",
+ highlight: undefined,
+ },
+} as const;
+
+export function NavBadge({
+ children,
+ className,
+}: {
+ children: string;
+ className?: string;
+}) {
+ return (
+ <span
+ className={cn(
+ "rounded-tag bg-primary-tint px-1.5 py-0.5 text-micro font-medium text-primary-strong",
+ className,
+ )}
+ >
+ {children}
+ </span>
+ );
+}
+
export function NavDesktop({
links,
className,
+ variant = "default",
}: {
links: NavLink[];
className?: string;
+ variant?: keyof typeof VARIANT_STYLES;
}) {
+ const styles = VARIANT_STYLES[variant];
const navRef = useRef<HTMLElement>(null);
const [highlight, setHighlight] = useState<{
left: number;
@@ -115,9 +145,9 @@ export function NavDesktop({
closeNow();
}
}}
- className={cn("relative hidden items-center gap-1 sm:flex", className)}
+ className={cn(styles.nav, className)}
>
- <SlidingHighlight rect={highlight} />
+ <SlidingHighlight rect={highlight} className={styles.highlight} />
{links.map((link) => {
const hasMenu = SECTION_HREFS.has(link.href);
return (
@@ -143,9 +173,12 @@ export function NavDesktop({
aria-haspopup={hasMenu ? "true" : undefined}
aria-expanded={hasMenu ? open === link.href : undefined}
aria-controls={hasMenu ? "site-mega-menu" : undefined}
- className="relative rounded-full px-3 py-2 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
+ target={link.external ? "_blank" : undefined}
+ rel={link.external ? "noreferrer" : undefined}
+ className={styles.item}
>
{link.label}
+ {link.badge && <NavBadge>{link.badge}</NavBadge>}
</Link>
);
})}
@@ -168,12 +201,14 @@ export function NavMobile({ links }: { links: NavLink[] }) {
render={
<Link
href={link.href}
- aria-label={link.label}
- className="py-3 text-foreground/90 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
+ target={link.external ? "_blank" : undefined}
+ rel={link.external ? "noreferrer" : undefined}
+ className="flex items-center gap-2 py-3 text-foreground/90 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
/>
}
>
{link.label}
+ {link.badge && <NavBadge>{link.badge}</NavBadge>}
</SheetClose>
))}
</nav>
diff --git a/app/(home)/components/hero-badge.tsx b/app/(home)/components/hero-badge.tsx
deleted file mode 100644
index c11d5043..00000000
--- a/app/(home)/components/hero-badge.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-"use client";
-
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import { Badge } from "@/components/ui/badge";
-import { useTrackEvent } from "@/lib/analytics";
-
-const HERO_BADGE_HREF = "/docs/captions/getting-started/introduction";
-
-export function HeroBadge() {
- const trackEvent = useTrackEvent();
-
- return (
- <Badge
- variant="secondary"
- className="group relative mb-5 h-7 gap-1.5 rounded-full px-3 text-xs before:absolute before:inset-x-0 before:-inset-y-2 before:content-['']"
- render={
- <Link
- href={HERO_BADGE_HREF}
- onClick={() =>
- trackEvent("cta_clicked", {
- cta: "hero_motion_graphics_badge",
- destination: HERO_BADGE_HREF,
- })
- }
- />
- }
- >
- <span className="font-semibold text-foreground">Introducing</span>
- <span className="text-foreground">Captions</span>
- <ArrowRight
- className="size-3 transition-transform group-hover:translate-x-0.5"
- aria-hidden="true"
- />
- </Badge>
- );
-}
diff --git a/app/(home)/components/hero-terminal-bg.tsx b/app/(home)/components/hero-terminal-bg.tsx
deleted file mode 100644
index 616994f3..00000000
--- a/app/(home)/components/hero-terminal-bg.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-"use client";
-
-import dynamic from "next/dynamic";
-import { useTheme } from "next-themes";
-import { useEffect, useState } from "react";
-
-const RemocnShader = dynamic(
- () => import("@/components/RemocnShader.webgl").then((m) => m.RemocnShader),
- { ssr: false },
-);
-
-const BACKGROUND = { dark: "#090b0c", light: "#ffffff" };
-
-const MASK =
- "[mask-image:radial-gradient(ellipse_92%_68%_at_50%_58%,black_14%,transparent_84%),linear-gradient(to_bottom,transparent_4%,black_30%,black_88%,transparent_100%),radial-gradient(ellipse_44%_30%_at_50%_31%,transparent_46%,black_92%)]";
-
-export function HeroTerminalBg() {
- const { resolvedTheme } = useTheme();
- const [mounted, setMounted] = useState(false);
-
- useEffect(() => {
- setMounted(true);
- }, []);
-
- if (!mounted) return null;
-
- return (
- <div
- className={`absolute inset-x-0 -top-[388px] h-[150vh] [mask-composite:intersect] ${MASK}`}
- >
- <RemocnShader
- theme={resolvedTheme === "dark" ? "dark" : "light"}
- background={BACKGROUND}
- />
- </div>
- );
-}
diff --git a/app/(home)/components/landing/header/docs-directory.tsx b/app/(home)/components/landing/header/docs-directory.tsx
new file mode 100644
index 00000000..c50a0dc6
--- /dev/null
+++ b/app/(home)/components/landing/header/docs-directory.tsx
@@ -0,0 +1,239 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import {
+ AGENTS,
+ type AgentMark,
+ CATEGORIES,
+ CRAFT,
+ GUIDES,
+ START_HERE,
+ TEMPLATES,
+} from "@/config/docs-directory";
+import { COMPONENT_COUNT } from "@/config/site";
+import { cn } from "@/lib/utils";
+import remocnIconsRegistry from "@/registry/remocn-icons/registry.json";
+import { source } from "@/source";
+import { ClaudeIcon, OpenAIIcon } from "../ui/brand-icons";
+import { HoverZone } from "./hover-zone";
+
+function titleOf(href: string) {
+ const page = source.getPage(href.split("/").filter(Boolean).slice(1));
+ return page?.data.title ?? href;
+}
+
+function countOf(segment: string) {
+ if (segment === "icons") {
+ return remocnIconsRegistry.items.filter((item) =>
+ item.name.startsWith("icon-"),
+ ).length;
+ }
+ return source
+ .getPages()
+ .filter((page) => page.slugs[0] === segment && page.data.component).length;
+}
+
+const guideCount = source
+ .getPages()
+ .filter((page) => page.slugs[0] === "guides" && page.slugs.length > 1).length;
+
+const LABEL = "text-caption leading-4 text-muted-foreground";
+const SUBLABEL = "text-mono leading-4 text-subtle";
+const LINK =
+ "relative z-10 -mx-2.5 flex items-center justify-between gap-3 rounded-[10px] px-2.5 py-[5px] text-[15px] leading-[18px] text-foreground outline-none focus-visible:ring-2 focus-visible:ring-primary";
+
+function Arrow() {
+ return (
+ <span
+ aria-hidden="true"
+ className="text-small leading-[18px] text-primary opacity-0 transition-opacity group-hover/item:opacity-100 group-focus-visible/item:opacity-100"
+ >
+ →
+ </span>
+ );
+}
+
+function MenuLink({
+ href,
+ children,
+ className,
+}: {
+ href: string;
+ children: ReactNode;
+ className?: string;
+}) {
+ return (
+ <Link href={href} data-menu-link className={cn(LINK, className)}>
+ {children}
+ </Link>
+ );
+}
+
+function AgentGlyph({ mark }: { mark: AgentMark }) {
+ switch (mark) {
+ case "claude":
+ return <ClaudeIcon className="size-4" />;
+ case "openai":
+ return <OpenAIIcon className="size-4 text-foreground" />;
+ case "v0":
+ return (
+ <span className="flex size-[18px] items-center justify-center rounded-[5px] bg-foreground text-[9px] leading-3 font-bold text-background">
+ v0
+ </span>
+ );
+ case "opencode":
+ return (
+ <svg viewBox="0 6 24 30" aria-hidden="true" className="h-[18px] w-3.5">
+ <path d="M18 30H6V18H18V30Z" fill="#B7B1B1" />
+ <path
+ d="M18 12H6V30H18V12ZM24 36H0V6H24V36Z"
+ className="fill-foreground"
+ />
+ </svg>
+ );
+ case "agent-run":
+ return (
+ <span className="flex size-[18px] items-center justify-center rounded-[5px] bg-primary-tint">
+ <span className="size-0 border-y-4 border-l-[6px] border-y-transparent border-l-primary" />
+ </span>
+ );
+ }
+}
+
+export function DocsDirectory() {
+ const categories = CATEGORIES.map((category) => ({
+ ...category,
+ count: countOf(category.segment),
+ }))
+ .filter((category) => category.count > 0)
+ .sort((a, b) =>
+ a.segment === "icons"
+ ? 1
+ : b.segment === "icons"
+ ? -1
+ : b.count - a.count,
+ );
+
+ return (
+ <HoverZone className="flex gap-2">
+ <div
+ data-tone="sunken"
+ className="flex *:relative *:z-10 w-[264px] shrink-0 flex-col gap-[18px] rounded-capsule bg-surface-sunken px-[22px] pt-[22px] pb-6 xl:w-[300px]"
+ >
+ <p className={LABEL}>Start here</p>
+ <ul className="-my-1 flex flex-col gap-1">
+ {START_HERE.map((item) => (
+ <li key={item.href}>
+ <Link
+ href={item.href}
+ data-menu-link
+ className="group/item relative z-10 -mx-3 flex items-center justify-between gap-3 rounded-[12px] px-3 py-2.5 outline-none focus-visible:ring-2 focus-visible:ring-primary"
+ >
+ <span className="flex flex-col gap-[3px]">
+ <span className="text-ui font-medium text-foreground">
+ {titleOf(item.href)}
+ </span>
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {item.description}
+ </span>
+ </span>
+ <Arrow />
+ </Link>
+ </li>
+ ))}
+ </ul>
+ <span aria-hidden="true" className="h-px shrink-0 bg-divider" />
+ <p className={LABEL}>Craft</p>
+ <ul className="-my-[5px] flex flex-col">
+ {CRAFT.map((href) => (
+ <li key={href}>
+ <MenuLink href={href}>{titleOf(href)}</MenuLink>
+ </li>
+ ))}
+ </ul>
+ </div>
+
+ <div className="flex *:relative *:z-10 w-[220px] shrink-0 flex-col gap-4 px-[18px] pt-[22px] pb-6 xl:w-[250px]">
+ <p className={LABEL}>Guides</p>
+ <MenuLink href={GUIDES.setup} className="-my-[5px]">
+ {titleOf(GUIDES.setup)}
+ </MenuLink>
+ <p className={SUBLABEL}>Videos</p>
+ <ul className="-my-[5px] flex flex-col">
+ {GUIDES.videos.map((href) => (
+ <li key={href}>
+ <MenuLink href={href}>{titleOf(href)}</MenuLink>
+ </li>
+ ))}
+ </ul>
+ <p className={SUBLABEL}>Practices</p>
+ <ul className="-my-[5px] flex flex-col">
+ {GUIDES.practices.map((href) => (
+ <li key={href}>
+ <MenuLink href={href}>{titleOf(href)}</MenuLink>
+ </li>
+ ))}
+ </ul>
+ <Link
+ href={GUIDES.index}
+ data-menu-link
+ data-no-highlight
+ className="flex h-8 items-center gap-1.5 self-start rounded-[10px] bg-surface-muted px-3 text-caption leading-4 text-foreground outline-none transition-colors hover:bg-secondary focus-visible:ring-2 focus-visible:ring-primary"
+ >
+ All {guideCount} guides
+ <span aria-hidden="true" className="text-primary">
+ →
+ </span>
+ </Link>
+ </div>
+
+ <div className="flex *:relative *:z-10 min-w-0 grow flex-col gap-4 border-l border-border px-[18px] pt-[22px] pb-6">
+ <div className="flex items-baseline justify-between">
+ <p className={LABEL}>Components</p>
+ <p className="text-mono leading-4 text-subtle tabular-nums">
+ {COMPONENT_COUNT} total
+ </p>
+ </div>
+ <ul className="-my-[5px] gap-x-6 xl:columns-2">
+ {categories.map((category) => (
+ <li key={category.segment} className="break-inside-avoid">
+ <MenuLink href={category.href}>
+ <span>{category.label}</span>
+ <span className="text-mono leading-4 text-subtle tabular-nums">
+ {category.count}
+ </span>
+ </MenuLink>
+ </li>
+ ))}
+ </ul>
+ </div>
+
+ <div className="flex *:relative *:z-10 w-[220px] shrink-0 flex-col gap-4 border-l border-border px-[18px] pt-[22px] pb-6 xl:w-[250px]">
+ <p className={LABEL}>Use with your agent</p>
+ <ul className="-my-[5px] flex flex-col">
+ {AGENTS.map((agent) => (
+ <li key={agent.href}>
+ <MenuLink href={agent.href} className="justify-start gap-2.5">
+ <span
+ aria-hidden="true"
+ className="flex size-[18px] shrink-0 items-center justify-center"
+ >
+ <AgentGlyph mark={agent.mark} />
+ </span>
+ {titleOf(agent.href)}
+ </MenuLink>
+ </li>
+ ))}
+ </ul>
+ <span aria-hidden="true" className="h-px shrink-0 bg-border" />
+ <p className={LABEL}>Templates</p>
+ <ul className="-my-[5px] flex flex-col">
+ {TEMPLATES.map((href) => (
+ <li key={href}>
+ <MenuLink href={href}>{titleOf(href)}</MenuLink>
+ </li>
+ ))}
+ </ul>
+ </div>
+ </HoverZone>
+ );
+}
diff --git a/app/(home)/components/landing/header/github-stars-link.tsx b/app/(home)/components/landing/header/github-stars-link.tsx
new file mode 100644
index 00000000..c9e322dc
--- /dev/null
+++ b/app/(home)/components/landing/header/github-stars-link.tsx
@@ -0,0 +1,41 @@
+import Link from "next/link";
+import { GITHUB_URL } from "@/config/site";
+import { formatStars, getGitHubStars } from "@/lib/github";
+import { cn } from "@/lib/utils";
+import { GitHubLogoIcon } from "../ui/brand-icons";
+
+/** "GitHub 2.1k": repo link with the live star count (hidden if the API fails). */
+export async function GitHubStarsLink({
+ className,
+ iconClassName = "size-[18px]",
+ pill,
+}: {
+ className?: string;
+ iconClassName?: string;
+ pill?: string;
+}) {
+ const stars = await getGitHubStars();
+ return (
+ <Link
+ href={GITHUB_URL}
+ target="_blank"
+ rel="noreferrer"
+ data-track="cta_clicked"
+ data-cta="github_header"
+ data-destination={GITHUB_URL}
+ data-pill={pill}
+ className={cn(
+ "flex shrink-0 items-center gap-2 text-ui text-foreground-nav outline-none transition-colors focus-visible:ring-2 focus-visible:ring-ring",
+ className,
+ )}
+ >
+ <GitHubLogoIcon className={iconClassName} />
+ GitHub
+ {stars !== null && (
+ <span className="text-muted-foreground tabular-nums">
+ {formatStars(stars).toLowerCase()}
+ </span>
+ )}
+ </Link>
+ );
+}
diff --git a/app/(home)/components/landing/header/hover-zone.tsx b/app/(home)/components/landing/header/hover-zone.tsx
new file mode 100644
index 00000000..7a8c9c72
--- /dev/null
+++ b/app/(home)/components/landing/header/hover-zone.tsx
@@ -0,0 +1,132 @@
+"use client";
+
+import {
+ animate,
+ motion,
+ useMotionTemplate,
+ useMotionValue,
+ useReducedMotion,
+} from "motion/react";
+import { type ReactNode, useEffect, useRef, useState } from "react";
+import { cn } from "@/lib/utils";
+
+const FOLLOW = {
+ type: "spring",
+ visualDuration: 0.06,
+ bounce: 0,
+ restDelta: 0.5,
+} as const;
+
+const TONES = {
+ sunken: { color: "--surface", radius: 12 },
+ plain: { color: "--surface-muted", radius: 10 },
+} as const;
+
+const TARGET = "[data-menu-link]:not([data-no-highlight])";
+
+export function HoverZone({
+ className,
+ children,
+}: {
+ className?: string;
+ children: ReactNode;
+}) {
+ const reduced = useReducedMotion() ?? false;
+ const zoneRef = useRef<HTMLDivElement>(null);
+ const [shown, setShown] = useState(false);
+ const x = useMotionValue(0);
+ const y = useMotionValue(0);
+ const width = useMotionValue(0);
+ const height = useMotionValue(0);
+ const radius = useMotionValue(10);
+ const color = useMotionValue("rgba(0, 0, 0, 0)");
+ const transform = useMotionTemplate`translate3d(${x}px, ${y}px, 0)`;
+
+ useEffect(() => {
+ const zone = zoneRef.current;
+ if (!zone) return;
+ let current: Element | null = null;
+ let visible = false;
+
+ const follow = (target: EventTarget | null) => {
+ const link = target instanceof Element ? target.closest(TARGET) : null;
+ if (!link || !zone.contains(link) || link === current) return;
+ current = link;
+ const zoneRect = zone.getBoundingClientRect();
+ const rect = link.getBoundingClientRect();
+ const next = [
+ rect.left - zoneRect.left,
+ rect.top - zoneRect.top,
+ rect.width,
+ rect.height,
+ ];
+ const values = [x, y, width, height];
+ const toneName = link.closest<HTMLElement>("[data-tone]")?.dataset.tone;
+ const tone = toneName === "sunken" ? TONES.sunken : TONES.plain;
+ const nextColor = getComputedStyle(zone)
+ .getPropertyValue(tone.color)
+ .trim();
+ if (!visible || reduced) {
+ radius.jump(tone.radius);
+ color.jump(nextColor);
+ values.forEach((value, i) => {
+ value.jump(next[i]);
+ });
+ visible = true;
+ setShown(true);
+ return;
+ }
+ values.forEach((value, i) => {
+ animate(value, next[i], FOLLOW);
+ });
+ animate(radius, tone.radius, FOLLOW);
+ animate(color, nextColor, FOLLOW);
+ };
+
+ const hide = () => {
+ current = null;
+ visible = false;
+ setShown(false);
+ };
+
+ const onOver = (event: PointerEvent) => follow(event.target);
+ const onFocusIn = (event: FocusEvent) => follow(event.target);
+ const onFocusOut = (event: FocusEvent) => {
+ if (!zone.contains(event.relatedTarget as Node | null)) hide();
+ };
+
+ zone.addEventListener("pointerover", onOver);
+ zone.addEventListener("pointerleave", hide);
+ zone.addEventListener("focusin", onFocusIn);
+ zone.addEventListener("focusout", onFocusOut);
+ return () => {
+ zone.removeEventListener("pointerover", onOver);
+ zone.removeEventListener("pointerleave", hide);
+ zone.removeEventListener("focusin", onFocusIn);
+ zone.removeEventListener("focusout", onFocusOut);
+ };
+ }, [reduced, x, y, width, height, radius, color]);
+
+ return (
+ <div ref={zoneRef} className={cn("relative isolate", className)}>
+ <motion.span
+ aria-hidden="true"
+ initial={false}
+ style={{
+ transform,
+ width,
+ height,
+ borderRadius: radius,
+ backgroundColor: color,
+ }}
+ animate={{ opacity: shown ? 1 : 0 }}
+ transition={{
+ duration: reduced ? 0 : shown ? 0.1 : 0.16,
+ ease: "easeOut",
+ }}
+ className="pointer-events-none absolute top-0 left-0 z-0"
+ />
+ {children}
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/header/landing-nav.tsx b/app/(home)/components/landing/header/landing-nav.tsx
new file mode 100644
index 00000000..21b80f4c
--- /dev/null
+++ b/app/(home)/components/landing/header/landing-nav.tsx
@@ -0,0 +1,402 @@
+"use client";
+
+import { motion, useReducedMotion } from "motion/react";
+import Link from "next/link";
+import { usePathname } from "next/navigation";
+import {
+ createContext,
+ type ReactNode,
+ useCallback,
+ useContext,
+ useEffect,
+ useMemo,
+ useRef,
+ useState,
+} from "react";
+import { DOCS_MENU_HREF } from "@/config/docs-directory";
+import { type NavLink, STUDIO_URL } from "@/config/site";
+import { cn } from "@/lib/utils";
+import { NavBadge } from "../../header-nav";
+import { StudioAppIcon } from "../ui/remocn-mark";
+
+const OPEN_DELAY = 60;
+const CLOSE_DELAY = 140;
+
+const canOpenMenu = () =>
+ typeof window !== "undefined" &&
+ window.matchMedia("(min-width: 64rem) and (hover: hover)").matches;
+
+type MenuState = {
+ open: string | null;
+ scheduleOpen: (href: string) => void;
+ scheduleClose: (delay?: number) => void;
+ cancelClose: () => void;
+ openNow: (href: string) => void;
+ closeNow: () => void;
+};
+
+const MenuContext = createContext<MenuState | null>(null);
+
+function useMenu() {
+ const value = useContext(MenuContext);
+ if (!value)
+ throw new Error("Landing nav parts must render inside LandingMenu");
+ return value;
+}
+
+export function LandingMenu({
+ className,
+ children,
+}: {
+ className?: string;
+ children: ReactNode;
+}) {
+ const [open, setOpen] = useState<string | null>(null);
+ const openTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
+ const closeTimer = useRef<ReturnType<typeof setTimeout> | null>(null);
+ const pathname = usePathname();
+
+ const clearTimers = useCallback(() => {
+ if (openTimer.current) clearTimeout(openTimer.current);
+ if (closeTimer.current) clearTimeout(closeTimer.current);
+ openTimer.current = null;
+ closeTimer.current = null;
+ }, []);
+
+ useEffect(() => clearTimers, [clearTimers]);
+
+ useEffect(() => {
+ if (pathname) setOpen(null);
+ }, [pathname]);
+
+ useEffect(() => {
+ if (!open) return;
+ const onKey = (event: KeyboardEvent) => {
+ if (event.key !== "Escape") return;
+ clearTimers();
+ setOpen(null);
+ // The panel turns inert as it closes, which would drop focus to <body>.
+ if (document.activeElement?.closest("#landing-docs-menu")) {
+ document
+ .querySelector<HTMLElement>('[aria-controls="landing-docs-menu"]')
+ ?.focus();
+ }
+ };
+ window.addEventListener("keydown", onKey);
+ return () => window.removeEventListener("keydown", onKey);
+ }, [open, clearTimers]);
+
+ const value = useMemo<MenuState>(
+ () => ({
+ open,
+ scheduleOpen: (href) => {
+ if (!canOpenMenu()) return;
+ clearTimers();
+ if (open) setOpen(href);
+ else openTimer.current = setTimeout(() => setOpen(href), OPEN_DELAY);
+ },
+ scheduleClose: (delay = CLOSE_DELAY) => {
+ clearTimers();
+ closeTimer.current = setTimeout(() => setOpen(null), delay);
+ },
+ cancelClose: () => {
+ if (closeTimer.current) clearTimeout(closeTimer.current);
+ closeTimer.current = null;
+ },
+ openNow: (href) => {
+ clearTimers();
+ setOpen(href);
+ },
+ closeNow: () => {
+ clearTimers();
+ setOpen(null);
+ },
+ }),
+ [open, clearTimers],
+ );
+
+ return (
+ <MenuContext.Provider value={value}>
+ <div className={className}>{children}</div>
+ </MenuContext.Provider>
+ );
+}
+
+function Chevron({ open }: { open: boolean }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn(
+ "size-3.5 shrink-0 transition-transform duration-200 ease-out",
+ open && "rotate-180",
+ )}
+ >
+ <path
+ d="m6 9 6 6 6-6"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+const POP_SPRING = {
+ type: "spring",
+ stiffness: 420,
+ damping: 20,
+ mass: 0.8,
+ restDelta: 0.5,
+ restSpeed: 4,
+} as const;
+
+const STUDIO_GROW = 28;
+
+const TUCK = { duration: 0.2, ease: [0.25, 1, 0.5, 1] } as const;
+
+function StudioPop({ shown }: { shown: boolean }) {
+ const reduced = useReducedMotion() ?? false;
+ const transition = reduced ? { duration: 0 } : shown ? POP_SPRING : TUCK;
+ return (
+ <motion.span
+ aria-hidden="true"
+ initial={false}
+ data-pill-pop
+ animate={{ width: shown ? STUDIO_GROW : 0 }}
+ transition={transition}
+ className="relative z-0 -mr-1.5 flex h-[22px] shrink-0 items-center"
+ >
+ <motion.span
+ initial={false}
+ // Transform strings (not x/scale/rotate) so the browser can run the
+ // spring off the main thread.
+ animate={
+ shown
+ ? {
+ transform: "translateX(0px) scale(1) rotate(0deg)",
+ opacity: 1,
+ }
+ : {
+ transform: "translateX(18px) scale(0.4) rotate(-18deg)",
+ opacity: 0,
+ }
+ }
+ transition={transition}
+ className="flex"
+ >
+ <StudioAppIcon size={22} radius={6} markSize={9} />
+ </motion.span>
+ </motion.span>
+ );
+}
+
+function YieldingBadge({
+ hidden,
+ children,
+}: {
+ hidden: boolean;
+ children: string;
+}) {
+ const reduced = useReducedMotion() ?? false;
+ const transition = reduced ? { duration: 0 } : hidden ? TUCK : POP_SPRING;
+ return (
+ <motion.span
+ data-pill-yield
+ initial={false}
+ animate={
+ hidden
+ ? { width: 0, marginLeft: -6, opacity: 0, scale: 0.8 }
+ : { width: "auto", marginLeft: 0, opacity: 1, scale: 1 }
+ }
+ transition={transition}
+ className="flex shrink-0 justify-end overflow-hidden"
+ >
+ <NavBadge className="shrink-0">{children}</NavBadge>
+ </motion.span>
+ );
+}
+
+const ITEM =
+ "relative flex h-(--hdr-item-h) items-center gap-1.5 rounded-(--hdr-item-r) px-(--hdr-pad) text-ui outline-none transition-[color,background-color,box-shadow] duration-150 focus-visible:ring-2 focus-visible:ring-primary";
+const RAISED =
+ "bg-surface font-medium text-foreground shadow-[0_0_0_1px_#0E10120D,0_1px_3px_#0E10121A] dark:shadow-[0_0_0_1px_#FFFFFF12]";
+
+export function LandingNav({
+ links,
+ className,
+}: {
+ links: NavLink[];
+ className?: string;
+}) {
+ const menu = useMenu();
+ const pathname = usePathname();
+ const [studioHot, setStudioHot] = useState(false);
+ const studioRef = useRef<HTMLAnchorElement>(null);
+ const [studioWidth, setStudioWidth] = useState<number>();
+
+ useEffect(() => {
+ const item = studioRef.current;
+ if (!item) return;
+ const measure = () => {
+ if (item.querySelector("[data-pill-pop]")?.getBoundingClientRect().width)
+ return;
+ const badge = item.querySelector("[data-pill-yield]");
+ const freed = badge ? badge.getBoundingClientRect().width + 6 : 0;
+ setStudioWidth(item.getBoundingClientRect().width + STUDIO_GROW - freed);
+ };
+ measure();
+ document.fonts?.ready.then(measure);
+ window.addEventListener("resize", measure);
+ return () => window.removeEventListener("resize", measure);
+ }, []);
+
+ return (
+ <nav
+ aria-label="Main"
+ onMouseEnter={menu.cancelClose}
+ onMouseLeave={() => menu.scheduleClose()}
+ className={cn("relative flex items-center", className)}
+ >
+ {links.map((link) => {
+ const hasMenu = link.href === DOCS_MENU_HREF;
+ const isOpen = hasMenu && menu.open === link.href;
+ const prefix = link.current === undefined ? link.href : link.current;
+ const current =
+ !link.external &&
+ prefix !== null &&
+ pathname !== "/" &&
+ pathname.startsWith(prefix);
+ const faded = menu.open !== null && !isOpen;
+ const isStudio = link.href === STUDIO_URL;
+ const isSponsors = link.href === "/sponsors";
+ return (
+ <Link
+ key={link.href}
+ href={link.href}
+ data-pill="nav"
+ ref={isStudio ? studioRef : undefined}
+ data-pill-width={isStudio ? studioWidth : undefined}
+ data-pill-sweep={isStudio ? "" : undefined}
+ data-pill-metal={isSponsors ? "" : undefined}
+ onMouseEnter={() => {
+ if (isStudio) setStudioHot(true);
+ if (hasMenu) menu.scheduleOpen(link.href);
+ else menu.scheduleClose(100);
+ }}
+ onMouseLeave={isStudio ? () => setStudioHot(false) : undefined}
+ onFocus={
+ isStudio
+ ? (event) =>
+ setStudioHot(event.currentTarget.matches(":focus-visible"))
+ : undefined
+ }
+ onBlur={isStudio ? () => setStudioHot(false) : undefined}
+ onKeyDown={(event) => {
+ if (!hasMenu) return;
+ if (event.key === "ArrowDown" || event.key === " ") {
+ event.preventDefault();
+ menu.openNow(link.href);
+ requestAnimationFrame(() =>
+ document
+ .querySelector<HTMLElement>(
+ "#landing-docs-menu [data-menu-link]",
+ )
+ ?.focus(),
+ );
+ }
+ }}
+ onClick={menu.closeNow}
+ aria-haspopup={hasMenu ? "true" : undefined}
+ aria-expanded={hasMenu ? isOpen : undefined}
+ aria-controls={hasMenu ? "landing-docs-menu" : undefined}
+ aria-current={current ? "page" : undefined}
+ target={link.external ? "_blank" : undefined}
+ rel={link.external ? "noreferrer" : undefined}
+ className={cn(
+ ITEM,
+ current
+ ? RAISED
+ : isOpen
+ ? "text-foreground"
+ : faded
+ ? "text-muted-foreground"
+ : "text-foreground-nav",
+ hasMenu && "pr-3",
+ )}
+ >
+ {isStudio && <StudioPop shown={studioHot} />}
+ <span className="relative z-10">{link.label}</span>
+ {hasMenu && <Chevron open={isOpen} />}
+ {link.badge &&
+ (isStudio ? (
+ <YieldingBadge hidden={studioHot}>{link.badge}</YieldingBadge>
+ ) : (
+ <NavBadge>{link.badge}</NavBadge>
+ ))}
+ </Link>
+ );
+ })}
+ </nav>
+ );
+}
+
+export function LandingMenuPanel({
+ href,
+ children,
+}: {
+ href: string;
+ children: ReactNode;
+}) {
+ const menu = useMenu();
+ const reduced = useReducedMotion() ?? false;
+ const open = menu.open === href;
+
+ return (
+ <nav
+ aria-label="Docs"
+ inert={!open}
+ onMouseEnter={menu.cancelClose}
+ onMouseLeave={() => menu.scheduleClose()}
+ onBlur={(event) => {
+ if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {
+ menu.scheduleClose(0);
+ }
+ }}
+ className={cn(
+ "absolute inset-x-4 top-full z-50 pt-2.5 max-lg:hidden md:inset-x-10 xl:inset-x-0",
+ open
+ ? "visible"
+ : "pointer-events-none invisible [transition:visibility_0s_linear_160ms]",
+ )}
+ >
+ <motion.div
+ id="landing-docs-menu"
+ initial={false}
+ animate={open ? "open" : "closed"}
+ variants={{
+ // Transform strings so the open/close runs off the main thread.
+ open: {
+ opacity: 1,
+ transform: "translateY(0px) scale(1)",
+ transition: reduced
+ ? { duration: 0 }
+ : { type: "spring", stiffness: 520, damping: 40, mass: 0.7 },
+ },
+ closed: {
+ opacity: 0,
+ transform: "translateY(-6px) scale(0.985)",
+ transition: reduced
+ ? { duration: 0 }
+ : { duration: 0.14, ease: [0.23, 1, 0.32, 1] },
+ },
+ }}
+ className="origin-top rounded-panel bg-surface p-3 shadow-[0_0_0_1px_#0E10120F,0_24px_60px_#0E10121F] dark:shadow-[0_0_0_1px_#FFFFFF12,0_24px_60px_#00000080]"
+ >
+ {children}
+ </motion.div>
+ </nav>
+ );
+}
diff --git a/app/(home)/components/landing/header/landing-wordmark.tsx b/app/(home)/components/landing/header/landing-wordmark.tsx
new file mode 100644
index 00000000..24b6cbb0
--- /dev/null
+++ b/app/(home)/components/landing/header/landing-wordmark.tsx
@@ -0,0 +1,23 @@
+import { cn } from "@/lib/utils";
+import { RemocnMark } from "../ui/remocn-mark";
+
+/**
+ * The remocn wordmark at the header/footer sizes: 19px on mobile, 22px from
+ * `lg` up (mark 14×15 → 16×17), matching both artboards. Inside the header
+ * the `lg` size follows `--hdr-wordmark`.
+ */
+export function LandingWordmark({ className }: { className?: string }) {
+ return (
+ <span
+ className={cn(
+ "inline-flex items-baseline gap-px text-foreground",
+ className,
+ )}
+ >
+ <RemocnMark className="h-[15px] w-3.5 lg:h-[calc(var(--hdr-wordmark,22px)*17/22)] lg:w-[calc(var(--hdr-wordmark,22px)*16/22)]" />
+ <span className="font-wordmark text-[19px] leading-[19px] font-semibold tracking-[-0.025em] lg:text-[length:var(--hdr-wordmark,22px)] lg:leading-[var(--hdr-wordmark,22px)]">
+ emocn
+ </span>
+ </span>
+ );
+}
diff --git a/app/(home)/components/landing/header/mobile-menu.tsx b/app/(home)/components/landing/header/mobile-menu.tsx
new file mode 100644
index 00000000..73a66beb
--- /dev/null
+++ b/app/(home)/components/landing/header/mobile-menu.tsx
@@ -0,0 +1,147 @@
+import Link from "next/link";
+import {
+ Sheet,
+ SheetClose,
+ SheetContent,
+ SheetTitle,
+ SheetTrigger,
+} from "@/components/ui/sheet";
+import { NAV_LINKS, X_URL } from "@/config/site";
+import { cn } from "@/lib/utils";
+import { NavBadge } from "../../header-nav";
+import { XLogoIcon } from "../ui/brand-icons";
+import { landingButtonVariants } from "../ui/landing-button";
+import { GitHubStarsLink } from "./github-stars-link";
+import { LandingWordmark } from "./landing-wordmark";
+
+const ICON_BUTTON =
+ "flex size-11 shrink-0 items-center justify-center rounded-control bg-capsule text-foreground outline-none transition-colors hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring";
+
+const GET_STARTED_HREF = "/docs/getting-started/introduction";
+
+/**
+ * Mobile menu (below `lg`): a hamburger capsule that opens a full-screen sheet
+ * with the logo/close row, the big link list and the GitHub / X / Get started
+ * actions pinned to the bottom.
+ */
+export function MobileMenu() {
+ return (
+ <Sheet>
+ <SheetTrigger className={ICON_BUTTON} aria-label="Open menu">
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-[18px]">
+ <path
+ d="M4 8h16M4 16h16"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ />
+ </svg>
+ </SheetTrigger>
+ <SheetContent
+ side="right"
+ showCloseButton={false}
+ className="border-0 bg-background shadow-none data-[side=right]:w-full data-[side=right]:border-l-0 data-[side=right]:sm:max-w-none"
+ >
+ <SheetTitle className="sr-only">Menu</SheetTitle>
+ <div className="flex items-center justify-between px-4 py-3 md:px-10">
+ <SheetClose
+ nativeButton={false}
+ render={
+ <Link
+ href="/"
+ aria-label="remocn home"
+ className="flex h-11 items-center rounded-control bg-capsule px-3.5 outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ />
+ }
+ >
+ <LandingWordmark />
+ </SheetClose>
+ <SheetClose className={ICON_BUTTON} aria-label="Close menu">
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-[18px]">
+ <path
+ d="M6 6l12 12M18 6 6 18"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ />
+ </svg>
+ </SheetClose>
+ </div>
+
+ <div className="flex flex-1 flex-col justify-between overflow-y-auto px-5 pt-4 pb-7 md:px-10">
+ <nav aria-label="Main" className="flex flex-col">
+ {NAV_LINKS.map((link) => (
+ <SheetClose
+ key={link.href}
+ nativeButton={false}
+ render={
+ <Link
+ href={link.href}
+ target={link.external ? "_blank" : undefined}
+ rel={link.external ? "noreferrer" : undefined}
+ className="flex h-14 shrink-0 items-center gap-2.5 border-b border-border text-[26px] leading-[30px] tracking-[-0.03em] text-foreground outline-none focus-visible:bg-muted"
+ />
+ }
+ >
+ {link.label}
+ {link.badge && (
+ <NavBadge className="px-[7px] text-mono">
+ {link.badge}
+ </NavBadge>
+ )}
+ </SheetClose>
+ ))}
+ </nav>
+
+ <div className="mt-8 flex flex-col gap-2.5">
+ <div className="flex gap-2.5">
+ <GitHubStarsLink
+ iconClassName="size-4"
+ className="h-[52px] flex-1 justify-center rounded-cta bg-secondary text-foreground hover:bg-[#dcdde0] dark:hover:bg-[#33363b]"
+ />
+ <a
+ href={X_URL}
+ target="_blank"
+ rel="noreferrer"
+ aria-label="remocn on X"
+ className="flex size-[52px] shrink-0 items-center justify-center rounded-cta bg-secondary text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-2 focus-visible:ring-ring dark:hover:bg-[#33363b]"
+ >
+ <XLogoIcon className="size-4" />
+ </a>
+ </div>
+ <SheetClose
+ nativeButton={false}
+ render={
+ <Link
+ href={GET_STARTED_HREF}
+ className={cn(
+ landingButtonVariants({ variant: "ink" }),
+ "h-14 w-full gap-2 text-[17px] leading-5 font-medium",
+ )}
+ />
+ }
+ >
+ Get started
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-4 text-primary-soft dark:text-primary"
+ >
+ <path
+ d="M5 12h14M13 6l6 6-6 6"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </SheetClose>
+ </div>
+ </div>
+ </SheetContent>
+ </Sheet>
+ );
+}
diff --git a/app/(home)/components/landing/header/pill-track.tsx b/app/(home)/components/landing/header/pill-track.tsx
new file mode 100644
index 00000000..1fdeb496
--- /dev/null
+++ b/app/(home)/components/landing/header/pill-track.tsx
@@ -0,0 +1,103 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { type Rect, StretchPill } from "./stretch-pill";
+
+const ITEM = "[data-pill]";
+const HELD = `${ITEM}[data-popup-open], ${ITEM}[aria-expanded="true"]`;
+
+function finalWidth(item: HTMLElement) {
+ const declared = Number(item.dataset.pillWidth);
+ return declared > 0 ? declared : item.getBoundingClientRect().width;
+}
+
+export function HeaderPill() {
+ const anchorRef = useRef<HTMLSpanElement>(null);
+ const [rect, setRect] = useState<Rect | null>(null);
+
+ useEffect(() => {
+ const track = anchorRef.current?.parentElement;
+ if (!track) return;
+ let hovered: HTMLElement | null = null;
+ let focused: HTMLElement | null = null;
+ let shown = false;
+
+ const sync = () => {
+ const target =
+ hovered ?? focused ?? track.querySelector<HTMLElement>(HELD);
+ if (!target) {
+ shown = false;
+ track.removeAttribute("data-pill-zone");
+ setRect(null);
+ return;
+ }
+ const trackBox = track.getBoundingClientRect();
+ const box = target.getBoundingClientRect();
+ const sweeps = target.dataset.pillSweep !== undefined;
+ setRect({
+ left: box.left - trackBox.left,
+ top: box.top - trackBox.top,
+ width: finalWidth(target),
+ enter: !shown && sweeps ? "from-right" : "fade",
+ behind: target.dataset.pill === "behind",
+ metal: target.dataset.pillMetal !== undefined,
+ });
+ shown = true;
+ track.setAttribute("data-pill-zone", target.dataset.pill ?? "");
+ };
+
+ const itemOf = (node: EventTarget | null) =>
+ node instanceof Element ? node.closest<HTMLElement>(ITEM) : null;
+
+ const onOver = (event: PointerEvent) => {
+ if (event.pointerType === "touch") return;
+ const item = itemOf(event.target);
+ if (item && item !== hovered) {
+ hovered = item;
+ sync();
+ }
+ };
+ const onLeave = () => {
+ hovered = null;
+ sync();
+ };
+ const onFocusIn = (event: FocusEvent) => {
+ const item = itemOf(event.target);
+ if (item?.matches(":focus-visible")) {
+ focused = item;
+ sync();
+ }
+ };
+ const onFocusOut = () => {
+ focused = null;
+ sync();
+ };
+ const observer = new MutationObserver(() => {
+ if (!hovered && !focused) sync();
+ });
+ observer.observe(track, {
+ subtree: true,
+ attributes: true,
+ attributeFilter: ["data-popup-open", "aria-expanded"],
+ });
+
+ track.addEventListener("pointerover", onOver);
+ track.addEventListener("pointerleave", onLeave);
+ track.addEventListener("focusin", onFocusIn);
+ track.addEventListener("focusout", onFocusOut);
+ return () => {
+ observer.disconnect();
+ track.removeEventListener("pointerover", onOver);
+ track.removeEventListener("pointerleave", onLeave);
+ track.removeEventListener("focusin", onFocusIn);
+ track.removeEventListener("focusout", onFocusOut);
+ };
+ }, []);
+
+ return (
+ <>
+ <span ref={anchorRef} hidden />
+ <StretchPill rect={rect} className="z-0" />
+ </>
+ );
+}
diff --git a/app/(home)/components/landing/header/registry-health-badge.tsx b/app/(home)/components/landing/header/registry-health-badge.tsx
new file mode 100644
index 00000000..c9d2a7f9
--- /dev/null
+++ b/app/(home)/components/landing/header/registry-health-badge.tsx
@@ -0,0 +1,13 @@
+import { getRegistryHealth } from "@/lib/registry-health";
+import { RegistryHealthButton } from "./registry-health";
+
+/**
+ * Server half of the header health button: fetches the remocn entry from the
+ * shadcn directory (cached for an hour) and renders nothing when the data is
+ * missing, stale or in an unknown score format.
+ */
+export async function RegistryHealthBadge() {
+ const health = await getRegistryHealth();
+ if (!health) return null;
+ return <RegistryHealthButton health={health} />;
+}
diff --git a/app/(home)/components/landing/header/registry-health-card.tsx b/app/(home)/components/landing/header/registry-health-card.tsx
new file mode 100644
index 00000000..57380e2c
--- /dev/null
+++ b/app/(home)/components/landing/header/registry-health-card.tsx
@@ -0,0 +1,77 @@
+import type { SVGProps } from "react";
+import {
+ formatHealthCheckedAt,
+ formatHealthPoints,
+ REGISTRY_HEALTH_DOCS_URL,
+ type RegistryHealth,
+} from "@/lib/registry-health";
+
+/** The shadcn/ui double-stroke mark used on the health button and badge. */
+export function ShadcnMark({
+ strokeWidth = 32,
+ ...props
+}: SVGProps<SVGSVGElement>) {
+ return (
+ <svg viewBox="0 0 256 256" aria-hidden="true" {...props}>
+ <path
+ d="M208 128 128 208M192 40 40 192"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ />
+ </svg>
+ );
+}
+
+/** Body of the "Registry health" popover: header, score rows, footer. */
+export function RegistryHealthCard({ health }: { health: RegistryHealth }) {
+ return (
+ <div className="flex flex-col gap-3.5">
+ <div className="flex flex-col gap-1.5 px-3 pt-3">
+ <div className="flex items-center justify-between">
+ <p className="text-ui font-medium text-foreground">Registry health</p>
+ <span className="flex h-6 items-center gap-1.5 rounded-tile bg-foreground px-[9px] text-mono text-background">
+ <ShadcnMark strokeWidth={28} className="size-3" />
+ shadcn directory
+ </span>
+ </div>
+ <p className="text-small text-muted-foreground">{health.summary}</p>
+ </div>
+
+ <dl className="flex flex-col gap-2.5 rounded-cta bg-muted p-4 text-[15px] leading-5">
+ {health.checks.map((check) => (
+ <div
+ key={check.label}
+ className="flex items-baseline justify-between"
+ >
+ <dt className="text-muted-foreground">{check.label}</dt>
+ <dd className="flex gap-1 tabular-nums">
+ <span className="text-foreground">
+ {formatHealthPoints(check.score)}
+ </span>
+ <span className="text-subtle">/ {check.max}</span>
+ </dd>
+ </div>
+ ))}
+ </dl>
+
+ <div className="flex items-center justify-between px-3 pb-2.5">
+ <span className="text-mono text-muted-foreground tabular-nums">
+ Checked {formatHealthCheckedAt(health.checkedAt)}
+ </span>
+ <a
+ href={REGISTRY_HEALTH_DOCS_URL}
+ target="_blank"
+ rel="noreferrer"
+ className="-mx-1.5 flex items-center gap-1 rounded-md px-1.5 text-caption text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ How it's scored
+ <span aria-hidden="true" className="text-primary">
+ ↗
+ </span>
+ </a>
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/header/registry-health.tsx b/app/(home)/components/landing/header/registry-health.tsx
new file mode 100644
index 00000000..9f5f13f1
--- /dev/null
+++ b/app/(home)/components/landing/header/registry-health.tsx
@@ -0,0 +1,86 @@
+"use client";
+
+import { Popover } from "@base-ui/react/popover";
+import { useRef, useState } from "react";
+import {
+ formatHealthPoints,
+ REGISTRY_HEALTH_STATUS_LABEL,
+ type RegistryHealth,
+ type RegistryHealthStatus,
+} from "@/lib/registry-health";
+import { cn } from "@/lib/utils";
+import { RegistryHealthCard, ShadcnMark } from "./registry-health-card";
+
+// Healthy is the expected state and needs no signal; anything else gets a dot.
+const STATUS_DOT: Partial<Record<RegistryHealthStatus, string>> = {
+ observing: "bg-muted-foreground",
+ degraded: "bg-amber-500",
+ unavailable: "bg-destructive",
+};
+
+/**
+ * "Healthy 98.9" header button, fed live data from the shadcn directory (see
+ * `RegistryHealthBadge`). The popover opens on hover, on keyboard focus
+ * and on click; it's portaled with a high z-index so it layers over the hero.
+ * It hangs 7px under the button, right edge 6px past it (as in the design).
+ */
+export function RegistryHealthButton({ health }: { health: RegistryHealth }) {
+ const [open, setOpen] = useState(false);
+ // After Escape, focus returns to the trigger; don't let that reopen it.
+ const suppressFocusOpen = useRef(false);
+ const label = REGISTRY_HEALTH_STATUS_LABEL[health.status];
+ const score = formatHealthPoints(health.score);
+ const dot = STATUS_DOT[health.status];
+
+ return (
+ <Popover.Root
+ open={open}
+ onOpenChange={(next, details) => {
+ if (!next && details.reason === "escape-key") {
+ suppressFocusOpen.current = true;
+ }
+ setOpen(next);
+ }}
+ >
+ <Popover.Trigger
+ openOnHover
+ delay={80}
+ closeDelay={150}
+ onFocus={(event) => {
+ if (suppressFocusOpen.current) return;
+ if (event.currentTarget.matches(":focus-visible")) setOpen(true);
+ }}
+ onBlur={() => {
+ suppressFocusOpen.current = false;
+ }}
+ aria-label={`Registry health: ${label}, ${score} out of 100`}
+ data-pill="right"
+ className="relative flex h-(--hdr-item-h) shrink-0 cursor-default items-center gap-2 rounded-(--hdr-item-r) px-[calc(var(--hdr-pad)+1px)] text-ui text-foreground-nav outline-none focus-visible:ring-2 focus-visible:ring-primary"
+ >
+ <ShadcnMark className="size-[18px]" />
+ {dot && (
+ <span aria-hidden="true" className={cn("size-2 rounded-full", dot)} />
+ )}
+ {label}
+ <span className="text-muted-foreground tabular-nums">{score}</span>
+ </Popover.Trigger>
+ <Popover.Portal>
+ <Popover.Positioner
+ side="bottom"
+ align="end"
+ sideOffset={7}
+ alignOffset={-6}
+ className="z-50"
+ >
+ <Popover.Popup
+ initialFocus={false}
+ aria-label="Registry health"
+ className="w-[348px] origin-(--transform-origin) rounded-[22px] bg-card p-2 shadow-[0_0_0_1px_rgb(14_16_18/7%),0_24px_48px_-20px_rgb(14_16_18/28%)] outline-none transition-[opacity,transform] duration-150 ease-out data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-starting-style:scale-[0.98] data-starting-style:opacity-0 dark:shadow-[0_0_0_1px_rgb(255_255_255/8%),0_24px_48px_-20px_rgb(0_0_0/60%)]"
+ >
+ <RegistryHealthCard health={health} />
+ </Popover.Popup>
+ </Popover.Positioner>
+ </Popover.Portal>
+ </Popover.Root>
+ );
+}
diff --git a/app/(home)/components/landing/header/stretch-pill.tsx b/app/(home)/components/landing/header/stretch-pill.tsx
new file mode 100644
index 00000000..3ae74400
--- /dev/null
+++ b/app/(home)/components/landing/header/stretch-pill.tsx
@@ -0,0 +1,120 @@
+"use client";
+
+import {
+ animate,
+ motion,
+ useMotionValue,
+ useReducedMotion,
+ useTransform,
+} from "motion/react";
+import { useEffect, useRef } from "react";
+import { cn } from "@/lib/utils";
+import { MetalRing } from "../ui/metal-ring";
+
+export type Rect = {
+ left: number;
+ width: number;
+ top?: number;
+ enter?: "fade" | "from-right";
+ behind?: boolean;
+ /** Ring the pill with the travelling `border-metal` (Sponsors). */
+ metal?: boolean;
+};
+
+const LEAD_SPRING = {
+ type: "spring",
+ stiffness: 560,
+ damping: 44,
+ mass: 0.6,
+} as const;
+const TRAIL_SPRING = {
+ type: "spring",
+ stiffness: 170,
+ damping: 19,
+ mass: 0.9,
+} as const;
+const SWEEP_SPRING = {
+ type: "spring",
+ stiffness: 420,
+ damping: 20,
+ mass: 0.8,
+ restDelta: 0.5,
+} as const;
+
+export function StretchPill({
+ rect,
+ className,
+}: {
+ rect: Rect | null;
+ className?: string;
+}) {
+ const reduced = useReducedMotion() ?? false;
+ const left = useMotionValue(0);
+ const right = useMotionValue(0);
+ const top = useMotionValue(rect?.top ?? 0);
+ const width = useTransform(() => Math.max(right.get() - left.get(), 0));
+ const shown = useRef(false);
+
+ const targetLeft = rect?.left;
+ const targetRight = rect ? rect.left + rect.width : undefined;
+ const targetTop = rect?.top ?? 0;
+ const enter = rect?.enter ?? "fade";
+ useEffect(() => {
+ if (targetLeft === undefined || targetRight === undefined) {
+ shown.current = false;
+ return;
+ }
+ if (!shown.current || reduced) {
+ top.jump(targetTop);
+ right.jump(targetRight);
+ if (enter === "from-right" && !reduced) {
+ left.jump(targetRight);
+ animate(left, targetLeft, SWEEP_SPRING);
+ } else {
+ left.jump(targetLeft);
+ }
+ shown.current = true;
+ return;
+ }
+ const movingRight = targetLeft > left.get();
+ animate(left, targetLeft, movingRight ? TRAIL_SPRING : LEAD_SPRING);
+ animate(right, targetRight, movingRight ? LEAD_SPRING : TRAIL_SPRING);
+ animate(top, targetTop, LEAD_SPRING);
+ }, [targetLeft, targetRight, targetTop, enter, reduced, left, right, top]);
+
+ return (
+ <motion.span
+ aria-hidden="true"
+ initial={false}
+ style={{ x: left, y: top, width }}
+ animate={{ opacity: rect && !rect.behind ? 1 : 0 }}
+ transition={
+ reduced
+ ? { duration: 0 }
+ : rect?.behind
+ ? { duration: 0.1, delay: 0.24, ease: "linear" }
+ : { duration: 0.16, ease: "easeOut" }
+ }
+ className={cn(
+ "pointer-events-none absolute top-0 left-0 -z-10 h-(--hdr-item-h) rounded-(--hdr-item-r) bg-surface/55",
+ className,
+ )}
+ >
+ {/* The ring sits on the pill's edge (inset by its width, so it doesn't
+ grow the pill). Paused while hidden so it doesn't tick for nothing. */}
+ <motion.span
+ initial={false}
+ animate={{ opacity: rect?.metal ? 1 : 0 }}
+ transition={
+ reduced ? { duration: 0 } : { duration: 0.2, ease: "easeOut" }
+ }
+ className="absolute inset-0.5 rounded-[calc(var(--hdr-item-r)-2px)]"
+ >
+ <MetalRing
+ width={2}
+ className={cn(!rect?.metal && "before:[animation-play-state:paused]")}
+ />
+ </motion.span>
+ </motion.span>
+ );
+}
diff --git a/app/(home)/components/landing/scenes/crt-wordmark.tsx b/app/(home)/components/landing/scenes/crt-wordmark.tsx
new file mode 100644
index 00000000..c878c769
--- /dev/null
+++ b/app/(home)/components/landing/scenes/crt-wordmark.tsx
@@ -0,0 +1,84 @@
+"use client";
+
+import { AbsoluteFill, Easing, interpolate, useCurrentFrame } from "remotion";
+import { CrtScreen } from "@/registry/remocn/crt-screen";
+import { RemocnMark } from "../ui/remocn-mark";
+
+const EASE = Easing.bezier(0.22, 1, 0.36, 1);
+const INK = "#E6E6E6";
+
+export function CrtWordmark({
+ text = "emocn",
+ fontSize = 220,
+}: {
+ text?: string;
+ fontSize?: number;
+}) {
+ const frame = useCurrentFrame();
+ const clamp = {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ } as const;
+
+ const beam = interpolate(frame, [0, 6, 12], [0.004, 0.012, 1], {
+ ...clamp,
+ easing: EASE,
+ });
+ const glow = interpolate(frame, [0, 8, 20], [0, 1, 0], clamp);
+ const reveal = interpolate(frame, [10, 40], [0, 1], {
+ ...clamp,
+ easing: EASE,
+ });
+ const flicker =
+ 1 - 0.05 * Math.max(0, Math.sin(frame * 1.7) * Math.sin(frame * 0.31));
+
+ return (
+ <CrtScreen curvature={1} scanlines={1} maskScale={2} vignette={1}>
+ <AbsoluteFill style={{ background: "#050505" }}>
+ <AbsoluteFill
+ style={{
+ transform: `scaleY(${beam})`,
+ }}
+ >
+ <AbsoluteFill
+ style={{
+ background: `radial-gradient(ellipse 60% 50% at 50% 50%, rgba(255,255,255,${0.1 + glow * 0.6}), transparent 70%)`,
+ }}
+ />
+ <AbsoluteFill
+ style={{
+ alignItems: "center",
+ justifyContent: "center",
+ color: INK,
+ opacity: reveal * flicker,
+ filter: `blur(${(1 - reveal) * 14}px)`,
+ }}
+ >
+ <span
+ style={{
+ display: "inline-flex",
+ alignItems: "baseline",
+ gap: fontSize * 0.01,
+ }}
+ >
+ <RemocnMark
+ style={{ height: fontSize * 0.78, width: fontSize * 0.72 }}
+ />
+ <span
+ className="font-wordmark"
+ style={{
+ fontSize,
+ lineHeight: 1,
+ fontWeight: 600,
+ letterSpacing: "-0.025em",
+ }}
+ >
+ {text}
+ </span>
+ </span>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ </CrtScreen>
+ );
+}
diff --git a/app/(home)/components/landing/scenes/index.ts b/app/(home)/components/landing/scenes/index.ts
new file mode 100644
index 00000000..192303ba
--- /dev/null
+++ b/app/(home)/components/landing/scenes/index.ts
@@ -0,0 +1,24 @@
+import type { ComponentType } from "react";
+import type { PreviewManifestEntry } from "@/registry/__manifest__";
+
+type SceneEntry = {
+ preview: PreviewManifestEntry;
+ load: () => Promise<{ default: ComponentType<Record<string, unknown>> }>;
+};
+
+export const LANDING_SCENES: Record<string, SceneEntry> = {
+ "crt-wordmark": {
+ preview: {
+ durationInFrames: 180,
+ fps: 30,
+ compositionWidth: 1280,
+ compositionHeight: 720,
+ previewBackdrop: { type: "color", value: "#050505" },
+ defaults: { text: "emocn", fontSize: 220 },
+ },
+ load: () =>
+ import("./crt-wordmark").then((module) => ({
+ default: module.CrtWordmark,
+ })),
+ },
+};
diff --git a/app/(home)/components/landing/sections/final-cta.tsx b/app/(home)/components/landing/sections/final-cta.tsx
new file mode 100644
index 00000000..02296c70
--- /dev/null
+++ b/app/(home)/components/landing/sections/final-cta.tsx
@@ -0,0 +1,66 @@
+import { GITHUB_URL } from "@/config/site";
+import { LandingButton } from "../ui/landing-button";
+import { LiveSilk } from "../ui/live-silk";
+
+/** Shader panel darkened toward the centre so the headline reads. */
+const PANEL_SHADE =
+ "radial-gradient(ellipse var(--cta-spread) 60% at 50% 50% in oklab, #08040a99 0%, #08040a1a 100%)";
+
+export function FinalCta() {
+ return (
+ <section
+ data-section="final-cta"
+ className="landing-container pt-[72px] pb-14 xl:pt-0 xl:pb-[100px]"
+ >
+ <div
+ data-reveal="fade"
+ data-seq
+ className="relative isolate flex flex-col items-center justify-center gap-5 overflow-clip rounded-shell px-[22px] py-14 text-center [--cta-spread:80%] md:gap-7 md:px-10 md:py-24 md:[--cta-spread:55%] xl:h-[560px] xl:rounded-[36px] xl:py-0"
+ >
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 -z-10 bg-[url(/landing/shader-cta.png)] bg-cover bg-center"
+ />
+ <LiveSilk
+ color="#8A2A94"
+ sheenColor="#F5D0FE"
+ className="bg-settle absolute inset-0 -z-10"
+ />
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 -z-10"
+ style={{ backgroundImage: PANEL_SHADE }}
+ />
+ <h2
+ data-reveal="text"
+ className="w-full max-w-[860px] [--reveal-i:1] text-[34px] leading-[36px] tracking-display text-white md:text-[56px] md:leading-[58px] md:text-balance xl:text-[72px] xl:leading-[74px] xl:text-wrap"
+ >
+ Your product deserves better than a screen recording.
+ </h2>
+ <p
+ data-reveal
+ className="text-[16px] leading-6 text-[#e9d5ff] [--reveal-i:2] md:text-[19px] md:text-balance"
+ >
+ An agent, an empty folder, ten minutes. Open source, all the way down.
+ </p>
+ <div
+ data-reveal
+ className="flex w-full flex-col gap-2.5 pt-1.5 [--reveal-i:3] md:w-auto md:flex-row"
+ >
+ <LandingButton href="/docs/guides/setup" variant="light" arrow="→">
+ Make your first video
+ </LandingButton>
+ <LandingButton
+ href={GITHUB_URL}
+ target="_blank"
+ rel="noreferrer"
+ variant="ink"
+ className="dark:bg-dark-surface dark:text-white dark:hover:bg-dark-raised"
+ >
+ Star on GitHub
+ </LandingButton>
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero.tsx b/app/(home)/components/landing/sections/hero.tsx
new file mode 100644
index 00000000..90e36c88
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero.tsx
@@ -0,0 +1,46 @@
+import { LandingButton } from "../ui/landing-button";
+import { HeroHeadline } from "./hero/hero-headline";
+import { PromptStage } from "./hero/prompt-stage";
+import { StudioPill } from "./hero/studio-pill";
+
+export function Hero() {
+ return (
+ <section data-section="hero" className="relative">
+ {/* Page-top wash, starts under the transparent 92px header. */}
+ <div
+ aria-hidden="true"
+ className="pointer-events-none absolute inset-x-0 -top-[92px] -z-10 h-[1502px] bg-[linear-gradient(180deg,#E9E9EA_0%,#F4F4F5_30%,#FAFAFA_55%)] dark:hidden"
+ />
+
+ <div className="flex flex-col items-center px-5 pt-8 md:px-10 md:pt-20">
+ <StudioPill />
+ <HeroHeadline />
+ <div className="flex w-full flex-col items-center gap-6 pt-5 md:gap-[30px] md:pt-[30px]">
+ <p className="hero-in max-w-[640px] text-center [--reveal-i:3] text-[18px] leading-[26px] text-body md:text-lead md:leading-7">
+ Describe your product to your AI agent. It builds the demo video
+ from <span className="whitespace-nowrap">ready-made</span> pieces
+ while you watch in the browser.
+ </p>
+ <div className="hero-in hero-rise flex w-full flex-col gap-2.5 [--reveal-i:4] md:w-auto md:flex-row">
+ <LandingButton
+ href="/docs/guides/setup"
+ arrow="→"
+ className="w-full md:w-auto"
+ >
+ Make your first video
+ </LandingButton>
+ <LandingButton
+ href="/showcases"
+ variant="secondary"
+ className="w-full md:w-auto"
+ >
+ See what ships
+ </LandingButton>
+ </div>
+ </div>
+ </div>
+
+ <PromptStage />
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/composer-status.tsx b/app/(home)/components/landing/sections/hero/composer-status.tsx
new file mode 100644
index 00000000..3273c7aa
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/composer-status.tsx
@@ -0,0 +1,31 @@
+"use client";
+
+import { useComposerSignal } from "./scenes/composer-signal";
+
+export function ComposerStatus() {
+ const { composed } = useComposerSignal();
+ const label =
+ composed >= 6
+ ? "All 6 scenes composed"
+ : `Composing scene ${composed + 1} of 6`;
+ return (
+ <div className="flex justify-center px-5 md:pt-7">
+ <p className="flex items-center gap-3 rounded-control-sm bg-[#F0F0F1] px-4 py-2.5 text-[#3F4A4F] md:gap-2.5 md:px-3.5 md:py-2 dark:bg-muted dark:text-body">
+ <span
+ aria-hidden="true"
+ className="size-2 shrink-0 rounded-full bg-primary shadow-[0_0_0_4px_#A800B729]"
+ />
+ <span className="flex flex-col gap-0.5 md:hidden">
+ <span className="text-caption tabular-nums">{label}</span>
+ <span className="flex items-center gap-1.5 text-muted-foreground">
+ <span className="text-caption">Preview at</span>
+ <span className="font-mono text-mono">localhost:3000</span>
+ </span>
+ </span>
+ <span className="hidden text-mono tabular-nums md:inline">
+ {label}, preview at <span className="font-mono">localhost:3000</span>
+ </span>
+ </p>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/composer/composer-loop.tsx b/app/(home)/components/landing/sections/hero/composer/composer-loop.tsx
new file mode 100644
index 00000000..62904e0a
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/composer/composer-loop.tsx
@@ -0,0 +1,268 @@
+"use client";
+
+import { AnimatePresence, motion, type Transition } from "motion/react";
+import { createContext, type ReactNode, useContext, useRef } from "react";
+import { cn } from "@/lib/utils";
+import {
+ ClaudeCodeIcon,
+ CursorIcon,
+ GeminiIcon,
+ OpenAIIcon,
+} from "../../../ui/brand-icons";
+import { PickedContent, PickedPill } from "./picked-chip";
+import { AGENT_LABEL, type AgentId, SCENARIOS } from "./scenarios";
+import { type ComposerState, useComposerLoop } from "./use-composer-loop";
+
+const EASE_OUT_QUAD = [0.25, 0.46, 0.45, 0.94] as const;
+
+/** Picks swap as a left-to-right ripple, like a logo carousel wave. */
+const PICK_DURATION = 0.45;
+const PICK_STAGGER = 0.09;
+
+type LoopContext = { state: ComposerState; reducedMotion: boolean };
+
+const ComposerLoopContext = createContext<LoopContext | null>(null);
+
+function useLoop() {
+ const value = useContext(ComposerLoopContext);
+ if (!value) throw new Error("Composer parts must render inside ComposerLoop");
+ return value;
+}
+
+/** The composer `<figure>`: owns the loop and pauses it off screen. */
+export function ComposerLoop({
+ className,
+ label,
+ children,
+}: {
+ className?: string;
+ label: string;
+ children: ReactNode;
+}) {
+ const ref = useRef<HTMLElement>(null);
+ const { playing, ...loop } = useComposerLoop(ref);
+ return (
+ <ComposerLoopContext.Provider value={loop}>
+ <figure
+ ref={ref}
+ aria-label={label}
+ data-paused={playing ? undefined : ""}
+ className={className}
+ >
+ {children}
+ </figure>
+ </ComposerLoopContext.Provider>
+ );
+}
+
+const AGENT_ICON: Record<AgentId, (className: string) => ReactNode> = {
+ "claude-code": (c) => <ClaudeCodeIcon className={c} />,
+ codex: (c) => <OpenAIIcon className={cn(c, "text-foreground")} />,
+ cursor: (c) => <CursorIcon className={cn(c, "text-foreground")} />,
+ "gemini-cli": (c) => <GeminiIcon className={c} />,
+};
+
+function swapVariants(reducedMotion: boolean, transition: Transition) {
+ if (reducedMotion) {
+ return {
+ initial: { opacity: 0 },
+ animate: { opacity: 1, transition },
+ exit: { opacity: 0, transition },
+ };
+ }
+ return {
+ initial: { opacity: 0, transform: "translateY(60%)", filter: "blur(2px)" },
+ animate: {
+ opacity: 1,
+ transform: "translateY(0%)",
+ filter: "blur(0px)",
+ transition,
+ },
+ exit: {
+ opacity: 0,
+ transform: "translateY(-50%)",
+ filter: "blur(3px)",
+ transition,
+ },
+ };
+}
+
+/** "Claude Code · ~/acme-launch", swapping agents between prompts. */
+export function AgentLine() {
+ const { state, reducedMotion } = useLoop();
+ const scenario = SCENARIOS[state.agentIndex];
+ const variants = swapVariants(reducedMotion, {
+ duration: 0.35,
+ ease: EASE_OUT_QUAD,
+ });
+
+ return (
+ <div className="relative flex h-5 items-center md:h-[22px]">
+ <AnimatePresence mode="popLayout" initial={false}>
+ <motion.div
+ key={scenario.agent}
+ {...variants}
+ className="flex items-center gap-2 md:gap-2.5"
+ >
+ {AGENT_ICON[scenario.agent]("size-5 shrink-0 md:size-[22px]")}
+ <span className="flex items-center gap-2 md:hidden">
+ <span className="text-[14px] leading-[18px] text-foreground">
+ {AGENT_LABEL[scenario.agent]}
+ </span>
+ <span className="font-mono text-mono text-muted-foreground">
+ {scenario.folder}
+ </span>
+ </span>
+ <span className="hidden text-caption whitespace-pre text-muted-foreground md:inline">
+ {`${AGENT_LABEL[scenario.agent]} · `}
+ <span className="font-mono">{scenario.folder}</span>
+ </span>
+ </motion.div>
+ </AnimatePresence>
+ </div>
+ );
+}
+
+/**
+ * The prompt being typed. Every prompt is laid out invisibly in the same grid
+ * cell, so the paragraph keeps the height of the tallest one and the controls
+ * below never move.
+ */
+export function TypedPrompt({ className }: { className?: string }) {
+ const { state, reducedMotion } = useLoop();
+ const prompt = SCENARIOS[state.index].prompt;
+ const typed = prompt.slice(0, state.typed);
+ const selectionStart = state.selectionStart ?? state.typed;
+ const blinking = state.phase === "hold" || state.phase === "empty";
+
+ return (
+ <p className={cn("grid", className)}>
+ <span className="sr-only">{SCENARIOS[0].prompt}</span>
+ {SCENARIOS.map((scenario) => (
+ <span
+ key={scenario.agent}
+ aria-hidden="true"
+ className="invisible col-start-1 row-start-1"
+ >
+ {scenario.prompt}
+ </span>
+ ))}
+ <motion.span
+ key={reducedMotion ? state.index : "typed"}
+ aria-hidden="true"
+ className="col-start-1 row-start-1"
+ initial={reducedMotion ? { opacity: 0 } : false}
+ animate={{ opacity: 1 }}
+ transition={{ duration: 0.3, ease: "easeOut" }}
+ >
+ {typed.slice(0, selectionStart)}
+ {selectionStart < typed.length && (
+ <span className="rounded-[3px] bg-primary-tint box-decoration-clone text-foreground">
+ {typed.slice(selectionStart)}
+ </span>
+ )}
+ {!reducedMotion && (
+ <span
+ data-loop
+ className={cn(
+ "ml-px inline-block h-[1.05em] w-[2px] translate-y-[0.16em] rounded-full bg-primary",
+ blinking && "animate-[caret-blink_1.06s_steps(1)_infinite]",
+ state.selectionStart !== null && "opacity-0",
+ )}
+ />
+ )}
+ </motion.span>
+ </p>
+ );
+}
+
+/** The four blocks the agent picked, swapping as a wave per prompt. */
+export function PickedRow() {
+ const { state, reducedMotion } = useLoop();
+
+ return (
+ <ul className="flex items-center gap-2">
+ {[0, 1, 2, 3].map((slot) => (
+ <PickedSlot
+ key={slot}
+ slot={slot}
+ activeIndex={state.pickedIndex}
+ reducedMotion={reducedMotion}
+ />
+ ))}
+ </ul>
+ );
+}
+
+/**
+ * One pill. The pill itself never moves or resizes: every block that can land
+ * in this slot is laid out invisibly in the same grid cell, so the pill is as
+ * wide as the longest of them, and only the content rolls vertically inside
+ * it (clipped), like a slot-machine reel.
+ */
+function PickedSlot({
+ slot,
+ activeIndex,
+ reducedMotion,
+}: {
+ slot: number;
+ activeIndex: number;
+ reducedMotion: boolean;
+}) {
+ const block = SCENARIOS[activeIndex].picked[slot];
+ const variants = rollVariants(reducedMotion, {
+ duration: PICK_DURATION,
+ ease: EASE_OUT_QUAD,
+ delay: slot * PICK_STAGGER,
+ });
+
+ return (
+ <li className="shrink-0">
+ <PickedPill href={block.href} label={block.title}>
+ {SCENARIOS.map((scenario) => (
+ <PickedContent
+ key={scenario.picked[slot].name}
+ block={scenario.picked[slot]}
+ sizer
+ className="invisible"
+ />
+ ))}
+ <AnimatePresence initial={false}>
+ <motion.span
+ key={block.name}
+ {...variants}
+ className="col-start-1 row-start-1 flex"
+ >
+ <PickedContent block={block} />
+ </motion.span>
+ </AnimatePresence>
+ </PickedPill>
+ </li>
+ );
+}
+
+/** Vertical-only roll: in from below, out through the top, inside the pill. */
+function rollVariants(reducedMotion: boolean, transition: Transition) {
+ if (reducedMotion) {
+ return {
+ initial: { opacity: 0 },
+ animate: { opacity: 1, transition },
+ exit: { opacity: 0, transition },
+ };
+ }
+ return {
+ initial: { opacity: 0, transform: "translateY(100%)", filter: "blur(2px)" },
+ animate: {
+ opacity: 1,
+ transform: "translateY(0%)",
+ filter: "blur(0px)",
+ transition,
+ },
+ exit: {
+ opacity: 0,
+ transform: "translateY(-100%)",
+ filter: "blur(2px)",
+ transition,
+ },
+ };
+}
diff --git a/app/(home)/components/landing/sections/hero/composer/picked-chip.tsx b/app/(home)/components/landing/sections/hero/composer/picked-chip.tsx
new file mode 100644
index 00000000..e3512f6b
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/composer/picked-chip.tsx
@@ -0,0 +1,307 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { RemocnMark } from "../../../ui/remocn-mark";
+import type { ChipTile, PickedBlock } from "./scenarios";
+
+const TILE =
+ "relative flex size-[26px] shrink-0 items-center justify-center overflow-hidden rounded-tile";
+const LIGHT_TILE = `${TILE} bg-white text-[#0E1012] shadow-[0_0_0_1px_#0E101214]`;
+const DARK_TILE = `${TILE} bg-[#0E1012]`;
+const STILL = "motion-reduce:animate-none";
+
+const stroke = {
+ fill: "none",
+ stroke: "currentColor",
+ strokeWidth: 2.2,
+ strokeLinecap: "round" as const,
+ strokeLinejoin: "round" as const,
+};
+
+function Tile({ tile }: { tile: ChipTile }) {
+ switch (tile.kind) {
+ case "drift":
+ return (
+ <span data-tile className={TILE}>
+ <span
+ className={cn(
+ "absolute top-0 left-0 h-[121.875%] w-[260%] animate-tile-drift bg-[length:100%_100%]",
+ STILL,
+ )}
+ style={{ backgroundImage: `url(${tile.src})` }}
+ />
+ </span>
+ );
+ case "gradient":
+ return (
+ <span data-tile className={TILE}>
+ <span
+ className={cn(
+ "absolute inset-y-0 left-0 w-[200%] animate-tile-pan",
+ STILL,
+ )}
+ style={{ backgroundImage: tile.background }}
+ />
+ </span>
+ );
+ case "blur-in":
+ return (
+ <span data-tile className={LIGHT_TILE}>
+ <span
+ className={cn(
+ "animate-tile-blur-in text-mono font-bold tracking-[-0.04em]",
+ STILL,
+ )}
+ >
+ Aa
+ </span>
+ </span>
+ );
+ case "typewriter":
+ return (
+ <span data-tile className={cn(LIGHT_TILE, "gap-px")}>
+ <span
+ className={cn(
+ "animate-tile-type text-mono font-bold tracking-[-0.04em]",
+ STILL,
+ )}
+ >
+ Aa
+ </span>
+ <span className="h-3 w-[1.5px] animate-[caret-blink_1.06s_steps(1)_infinite] rounded-full bg-primary motion-reduce:hidden" />
+ </span>
+ );
+ case "zoom":
+ return (
+ <span data-tile className={cn(TILE, "bg-[#E4E4E7]")}>
+ <span
+ className={cn(
+ "absolute inset-[5px] animate-tile-zoom rounded-[3px]",
+ STILL,
+ )}
+ style={{ backgroundColor: tile.color }}
+ />
+ </span>
+ );
+ case "whip":
+ return (
+ <span data-tile className={cn(TILE, "justify-start")}>
+ <span
+ className={cn(
+ "flex h-full w-[300%] shrink-0 animate-tile-whip",
+ STILL,
+ )}
+ >
+ <span
+ className="h-full flex-1"
+ style={{ backgroundColor: tile.color }}
+ />
+ <span className="h-full flex-1 bg-[#E4E4E7]" />
+ <span
+ className="h-full flex-1"
+ style={{ backgroundColor: tile.color }}
+ />
+ </span>
+ </span>
+ );
+ case "glitch": {
+ const split = `linear-gradient(90deg, ${tile.color} 55%, #0E1012 55%)`;
+ return (
+ <span data-tile className={TILE} style={{ background: split }}>
+ <span
+ className={cn(
+ "absolute inset-x-0 top-0 h-[9px] animate-tile-glitch",
+ STILL,
+ )}
+ style={{ background: split }}
+ />
+ <span
+ className={cn(
+ "absolute inset-x-0 bottom-0 h-[8px] animate-tile-glitch [animation-delay:-0.12s] [animation-direction:reverse]",
+ STILL,
+ )}
+ style={{ background: split }}
+ />
+ </span>
+ );
+ }
+ case "caption":
+ return (
+ <span data-tile className={cn(DARK_TILE, "gap-[3px]")}>
+ {["", "[animation-delay:-1.2s]"].map((delay) => (
+ <span
+ key={delay}
+ className="h-1.5 w-[7px] overflow-hidden rounded-[2px]"
+ >
+ <span
+ className={cn(
+ "block h-full w-[200%] animate-tile-karaoke bg-[linear-gradient(90deg,#F0ABFC_50%,#4A4E52_50%)]",
+ delay,
+ STILL,
+ )}
+ />
+ </span>
+ ))}
+ </span>
+ );
+ case "terminal":
+ return (
+ <span data-tile className={cn(DARK_TILE, "gap-[2px] text-[#86EFAC]")}>
+ <svg viewBox="0 0 24 24" className="size-3 shrink-0">
+ <path d="m7 7 5 5-5 5" {...stroke} strokeWidth={2.8} />
+ </svg>
+ <span
+ className={cn(
+ "h-[2px] w-[8px] origin-left animate-tile-line rounded-full bg-[#86EFAC]",
+ STILL,
+ )}
+ />
+ </span>
+ );
+ case "chart":
+ return (
+ <span
+ data-tile
+ className={cn(LIGHT_TILE, "items-end gap-[2px] pb-[6px]")}
+ >
+ {[
+ "h-1.5 bg-[#C026D3]",
+ "h-2.5 bg-[#C026D3] [animation-delay:0.12s]",
+ "h-3.5 bg-[#A800B7] [animation-delay:0.24s]",
+ ].map((bar) => (
+ <span
+ key={bar}
+ className={cn(
+ "w-[3px] origin-bottom animate-tile-grow rounded-[1px]",
+ bar,
+ STILL,
+ )}
+ />
+ ))}
+ </span>
+ );
+ case "check":
+ return (
+ <span data-tile className={cn(LIGHT_TILE, "text-[#22C55E]")}>
+ <svg viewBox="0 0 24 24" className="size-4">
+ <path
+ d="M20 6 9 17l-5-5"
+ pathLength={1}
+ strokeDasharray={1}
+ className={cn("animate-tile-draw", STILL)}
+ {...stroke}
+ />
+ </svg>
+ </span>
+ );
+ case "cursor":
+ return (
+ <span data-tile className={LIGHT_TILE}>
+ <svg
+ viewBox="0 0 24 24"
+ className={cn("size-3.5 animate-tile-cursor", STILL)}
+ >
+ <path
+ d="M5 3l14 7.5-6.2 1.8L10 19z"
+ fill="currentColor"
+ stroke="currentColor"
+ strokeWidth="1.5"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </span>
+ );
+ case "number":
+ return (
+ <span data-tile className={cn(DARK_TILE, "items-start")}>
+ <span
+ className={cn(
+ "flex animate-tile-roll flex-col text-[11px] text-white tabular-nums",
+ STILL,
+ )}
+ >
+ {["42", "43", "44", "42"].map((value, i) => (
+ <span
+ key={`${value}-${i}`}
+ className="flex h-[26px] items-center"
+ >
+ {value}
+ </span>
+ ))}
+ </span>
+ </span>
+ );
+ case "logo":
+ return (
+ <span data-tile className={cn(DARK_TILE, "text-white")}>
+ <RemocnMark className={cn("h-3 w-[11px] animate-tile-pop", STILL)} />
+ </span>
+ );
+ case "scanlines":
+ return (
+ <span data-tile className={cn(TILE, "animate-tile-flicker", STILL)}>
+ <span
+ className={cn(
+ "absolute inset-x-0 -top-1 h-[calc(100%+4px)] animate-tile-scanline bg-[repeating-linear-gradient(0deg,#0E1012_0_2px,#1F3D2A_2px_4px)]",
+ STILL,
+ )}
+ />
+ </span>
+ );
+ }
+}
+
+/**
+ * The pill shell: a link to the active block's docs page. Children stack in a
+ * single grid cell (see PickedSlot), and the clip keeps the rolling content
+ * inside the pill.
+ */
+export function PickedPill({
+ href,
+ label,
+ children,
+}: {
+ href: string;
+ label: string;
+ children: ReactNode;
+}) {
+ return (
+ <Link
+ href={href}
+ aria-label={label}
+ className="grid overflow-clip rounded-control-sm bg-surface-muted py-[5px] pr-3 pl-[5px] outline-none transition-colors duration-150 hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {children}
+ </Link>
+ );
+}
+
+/** Tile + docs title of one picked block. */
+export function PickedContent({
+ block,
+ sizer = false,
+ className,
+}: {
+ block: PickedBlock;
+ sizer?: boolean;
+ className?: string;
+}) {
+ return (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "col-start-1 row-start-1 flex items-center gap-2",
+ className,
+ )}
+ >
+ {sizer ? (
+ <span className="size-[26px] shrink-0" />
+ ) : (
+ <Tile tile={block.tile} />
+ )}
+ <span className="text-[13px] leading-4 whitespace-nowrap text-foreground">
+ {block.title}
+ </span>
+ </span>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/composer/scenarios.ts b/app/(home)/components/landing/sections/hero/composer/scenarios.ts
new file mode 100644
index 00000000..5a14b581
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/composer/scenarios.ts
@@ -0,0 +1,189 @@
+/**
+ * What the hero composer cycles through: an agent, the folder it runs in, the
+ * prompt it's given and four real registry blocks it would pick for it. Every
+ * `name` is a live registry item, `title` and `href` come from its docs page.
+ */
+
+export type AgentId = "claude-code" | "codex" | "cursor" | "gemini-cli";
+
+export type ChipTile =
+ | { kind: "drift"; src: string }
+ | { kind: "gradient"; background: string }
+ | { kind: "blur-in" }
+ | { kind: "typewriter" }
+ | { kind: "zoom"; color: string }
+ | { kind: "whip"; color: string }
+ | { kind: "glitch"; color: string }
+ | { kind: "caption" }
+ | { kind: "terminal" }
+ | { kind: "chart" }
+ | { kind: "check" }
+ | { kind: "cursor" }
+ | { kind: "number" }
+ | { kind: "logo" }
+ | { kind: "scanlines" };
+
+export type PickedBlock = {
+ /** Registry item name. */
+ name: string;
+ /** Docs page title, shown on the chip. */
+ title: string;
+ href: string;
+ tile: ChipTile;
+};
+
+export type Scenario = {
+ agent: AgentId;
+ folder: string;
+ prompt: string;
+ picked: [PickedBlock, PickedBlock, PickedBlock, PickedBlock];
+};
+
+export const AGENT_LABEL: Record<AgentId, string> = {
+ "claude-code": "Claude Code",
+ codex: "Codex",
+ cursor: "Cursor",
+ "gemini-cli": "Gemini CLI",
+};
+
+export const SCENARIOS: Scenario[] = [
+ {
+ agent: "claude-code",
+ folder: "~/acme-launch",
+ prompt:
+ "Make a 20s launch video for Acme. Dark, fast, one liquid shader behind the title, captions on the voiceover.",
+ picked: [
+ {
+ name: "shader-liquid-metal",
+ title: "Liquid Metal",
+ href: "/docs/shaders/components/shader-liquid-metal",
+ tile: { kind: "drift", src: "/landing/shader-violet.png" },
+ },
+ {
+ name: "soft-blur-in",
+ title: "Soft Blur In",
+ href: "/docs/typography/soft-blur-in",
+ tile: { kind: "blur-in" },
+ },
+ {
+ name: "zoom-blur",
+ title: "Zoom Blur",
+ href: "/docs/transitions/zoom-blur",
+ tile: { kind: "zoom", color: "#0E7490" },
+ },
+ {
+ name: "caption-karaoke",
+ title: "Karaoke",
+ href: "/docs/captions/components/caption-karaoke",
+ tile: { kind: "caption" },
+ },
+ ],
+ },
+ {
+ agent: "codex",
+ folder: "~/ledger",
+ prompt:
+ "Turn this week's changelog into a 30s feature video. Charts filling in, a terminal deploy, our logo at the end.",
+ picked: [
+ {
+ name: "animated-bar-chart",
+ title: "Animated Bar Chart",
+ href: "/docs/ui-blocks/animated-bar-chart",
+ tile: { kind: "chart" },
+ },
+ {
+ name: "terminal-simulator",
+ title: "Terminal Simulator",
+ href: "/docs/ui-blocks/terminal-simulator",
+ tile: { kind: "terminal" },
+ },
+ {
+ name: "whip-pan",
+ title: "Whip Pan",
+ href: "/docs/transitions/whip-pan",
+ tile: { kind: "whip", color: "#A800B7" },
+ },
+ {
+ name: "logo-enter",
+ title: "Logo Enter",
+ href: "/docs/social/logo-enter",
+ tile: { kind: "logo" },
+ },
+ ],
+ },
+ {
+ agent: "cursor",
+ folder: "~/pulse-beta",
+ prompt:
+ "A 15s vertical teaser for the Pulse beta. Glitchy CRT look, hard cuts, the launch date counting up at the end.",
+ picked: [
+ {
+ name: "crt-screen",
+ title: "CRT Screen",
+ href: "/docs/filters/components/crt-screen",
+ tile: { kind: "scanlines" },
+ },
+ {
+ name: "glitch-cut",
+ title: "Glitch Cut",
+ href: "/docs/transitions/glitch-cut",
+ tile: { kind: "glitch", color: "#22C55E" },
+ },
+ {
+ name: "rolling-number",
+ title: "Rolling Number",
+ href: "/docs/typography/rolling-number",
+ tile: { kind: "number" },
+ },
+ {
+ name: "shader-grain-gradient",
+ title: "Grain Gradient",
+ href: "/docs/shaders/components/shader-grain-gradient",
+ tile: {
+ kind: "gradient",
+ background:
+ "radial-gradient(circle at 30% 30%, #F97316, #DB2777 55%, #3B0764)",
+ },
+ },
+ ],
+ },
+ {
+ agent: "gemini-cli",
+ folder: "~/notes-app",
+ prompt:
+ "Show how fast our notes app is. A cursor typing a note, checkmarks popping in, a soft mesh gradient behind it all.",
+ picked: [
+ {
+ name: "simulated-cursor",
+ title: "Simulated Cursor",
+ href: "/docs/effects/simulated-cursor",
+ tile: { kind: "cursor" },
+ },
+ {
+ name: "typewriter",
+ title: "Typewriter",
+ href: "/docs/typography/typewriter",
+ tile: { kind: "typewriter" },
+ },
+ {
+ name: "check-list",
+ title: "Check List",
+ href: "/docs/ui-blocks/check-list",
+ tile: { kind: "check" },
+ },
+ {
+ name: "shader-mesh-gradient",
+ title: "Mesh Gradient",
+ href: "/docs/shaders/components/shader-mesh-gradient",
+ tile: { kind: "drift", src: "/landing/shader-magenta.png" },
+ },
+ ],
+ },
+];
+
+/** The longest prompt reserves the paragraph height so nothing below jumps. */
+export const LONGEST_PROMPT = SCENARIOS.reduce(
+ (longest, scenario) =>
+ scenario.prompt.length > longest.length ? scenario.prompt : longest,
+ "",
+);
diff --git a/app/(home)/components/landing/sections/hero/composer/use-composer-loop.ts b/app/(home)/components/landing/sections/hero/composer/use-composer-loop.ts
new file mode 100644
index 00000000..948eb986
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/composer/use-composer-loop.ts
@@ -0,0 +1,158 @@
+"use client";
+
+import { useInView, usePageInView, useReducedMotion } from "motion/react";
+import { type RefObject, useEffect, useRef, useState } from "react";
+import { publishScenario } from "../scenes/composer-signal";
+import { SCENARIOS } from "./scenarios";
+
+/**
+ * One prompt's life in the hero composer:
+ * typing → hold (picks swap in) → selecting (word by word, like ⌥⇧←) →
+ * selected → empty (agent swaps) → next prompt typing.
+ */
+export type Phase = "typing" | "hold" | "selecting" | "selected" | "empty";
+
+export type ComposerState = {
+ /** Scenario whose prompt is in the input. */
+ index: number;
+ /** Scenario whose agent is shown in the header line. */
+ agentIndex: number;
+ /** Scenario whose blocks are shown in the Picked row. */
+ pickedIndex: number;
+ phase: Phase;
+ /** Characters of the prompt currently typed. */
+ typed: number;
+ /** Selection start (selection runs to `typed`); null = no selection. */
+ selectionStart: number | null;
+};
+
+const HOLD_MS = 2800;
+const SELECT_STEP_MS = 55;
+const SELECTED_MS = 420;
+const EMPTY_MS = 520;
+const REDUCED_CYCLE_MS = 6000;
+
+// The server render and the first client frame show the first prompt fully
+// typed with its picks, which is also the whole experience without JS.
+const INITIAL: ComposerState = {
+ index: 0,
+ agentIndex: 0,
+ pickedIndex: 0,
+ phase: "hold",
+ typed: SCENARIOS[0].prompt.length,
+ selectionStart: null,
+};
+
+/** Human-ish typing cadence: a little jitter, a breath after punctuation. */
+function typingDelay(char: string | undefined) {
+ if (char === "." || char === ",") return 150;
+ return 26 + Math.random() * 22;
+}
+
+/** Start of the word before `from`, skipping trailing spaces (⌥⇧← jumps). */
+function previousWordStart(text: string, from: number) {
+ let i = from;
+ while (i > 0 && text[i - 1] === " ") i--;
+ while (i > 0 && text[i - 1] !== " ") i--;
+ return i;
+}
+
+function next(state: ComposerState): [ComposerState, number] {
+ const prompt = SCENARIOS[state.index].prompt;
+ switch (state.phase) {
+ case "typing": {
+ if (state.typed < prompt.length) {
+ return [
+ { ...state, typed: state.typed + 1 },
+ typingDelay(prompt[state.typed]),
+ ];
+ }
+ // Done typing: the agent "picks" its blocks for this prompt.
+ return [{ ...state, phase: "hold", pickedIndex: state.index }, HOLD_MS];
+ }
+ case "hold":
+ return [
+ { ...state, phase: "selecting", selectionStart: state.typed },
+ SELECT_STEP_MS,
+ ];
+ case "selecting": {
+ const start = previousWordStart(prompt, state.selectionStart ?? 0);
+ if (start > 0) {
+ return [{ ...state, selectionStart: start }, SELECT_STEP_MS];
+ }
+ return [{ ...state, selectionStart: 0, phase: "selected" }, SELECTED_MS];
+ }
+ case "selected": {
+ // Backspace over the selection, and the next agent takes over.
+ const upcoming = (state.index + 1) % SCENARIOS.length;
+ return [
+ {
+ ...state,
+ phase: "empty",
+ typed: 0,
+ selectionStart: null,
+ agentIndex: upcoming,
+ },
+ EMPTY_MS,
+ ];
+ }
+ case "empty":
+ return [
+ { ...state, phase: "typing", index: state.agentIndex, typed: 0 },
+ typingDelay(undefined),
+ ];
+ }
+}
+
+/**
+ * Drives the composer. Runs only while the composer is on screen and the tab
+ * is visible; resumes from where it paused. Under reduced motion there is no
+ * typing or selecting: whole scenarios swap on a slow timer.
+ */
+export function useComposerLoop(rootRef: RefObject<HTMLElement | null>) {
+ const [state, setState] = useState<ComposerState>(INITIAL);
+ const stateRef = useRef(state);
+ stateRef.current = state;
+
+ const reducedMotion = useReducedMotion() ?? false;
+ const inView = useInView(rootRef, { margin: "100px" });
+ const pageInView = usePageInView();
+ const playing = inView && pageInView;
+
+ useEffect(() => {
+ if (!playing) return;
+
+ if (reducedMotion) {
+ const id = setInterval(() => {
+ const upcoming = (stateRef.current.index + 1) % SCENARIOS.length;
+ setState({
+ ...INITIAL,
+ index: upcoming,
+ agentIndex: upcoming,
+ pickedIndex: upcoming,
+ typed: SCENARIOS[upcoming].prompt.length,
+ });
+ }, REDUCED_CYCLE_MS);
+ return () => clearInterval(id);
+ }
+
+ let timeout: ReturnType<typeof setTimeout>;
+ const schedule = (delay: number) => {
+ timeout = setTimeout(() => {
+ const [nextState, nextDelay] = next(stateRef.current);
+ stateRef.current = nextState;
+ setState(nextState);
+ schedule(nextDelay);
+ }, delay);
+ };
+ // Resuming mid-hold restarts the hold so the prompt is readable again.
+ schedule(stateRef.current.phase === "hold" ? HOLD_MS : SELECT_STEP_MS);
+ return () => clearTimeout(timeout);
+ }, [playing, reducedMotion]);
+
+ useEffect(() => {
+ publishScenario(state.pickedIndex);
+ }, [state.pickedIndex]);
+
+ return { state, reducedMotion, playing };
+}
diff --git a/app/(home)/components/landing/sections/hero/floating-scene.tsx b/app/(home)/components/landing/sections/hero/floating-scene.tsx
new file mode 100644
index 00000000..31f59a26
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/floating-scene.tsx
@@ -0,0 +1,329 @@
+import type { CSSProperties } from "react";
+import { cn } from "@/lib/utils";
+
+type SceneKind =
+ | "shader-title"
+ | "halftone"
+ | "terminal"
+ | "number"
+ | "karaoke"
+ | "vertical";
+
+export type Scene = {
+ index: number;
+ block: string;
+ kind: SceneKind;
+ /**
+ * Desktop placement inside the 1440px prompt stage, rotated around the
+ * top-left corner. Right-side cards are anchored with `right` so they hug
+ * the edge between 1280 and 1440 instead of overflowing.
+ */
+ float: {
+ top: number;
+ left?: number;
+ right?: number;
+ width: number;
+ height: number;
+ rotate: number;
+ };
+ /** Width in the mobile scroll row; scenes without it are desktop-only. */
+ rowWidth?: number;
+};
+
+/** Ordered as the desktop paint order (later cards sit on top). */
+export const SCENES: Scene[] = [
+ {
+ index: 1,
+ block: "shader-liquid-metal",
+ kind: "shader-title",
+ float: { top: 50, left: 24, width: 290, height: 180, rotate: -7 },
+ rowWidth: 180,
+ },
+ {
+ index: 5,
+ block: "caption-karaoke",
+ kind: "karaoke",
+ float: { top: 272, right: 22, width: 250, height: 170, rotate: -5 },
+ rowWidth: 200,
+ },
+ {
+ index: 2,
+ block: "halftone-print",
+ kind: "halftone",
+ float: { top: 300, left: 190, width: 200, height: 200, rotate: 6 },
+ rowWidth: 130,
+ },
+ {
+ index: 3,
+ block: "terminal-simulator",
+ kind: "terminal",
+ float: { top: 560, left: 30, width: 240, height: 150, rotate: -4 },
+ },
+ {
+ index: 4,
+ block: "rolling-number",
+ kind: "number",
+ float: { top: 0, right: 50, width: 220, height: 150, rotate: 7 },
+ },
+ {
+ index: 6,
+ block: "logo-enter",
+ kind: "vertical",
+ float: { top: 440, right: 312, width: 150, height: 250, rotate: 8 },
+ },
+];
+
+/** Mobile row order: scene 1, 2, 5. */
+export const ROW_SCENES = [1, 2, 5]
+ .map((index) => SCENES.find((scene) => scene.index === index))
+ .filter((scene): scene is Scene => Boolean(scene?.rowWidth));
+
+const VIOLET = "url(/landing/shader-violet.png)";
+const MAGENTA = "url(/landing/shader-magenta.png)";
+
+const KIND_STYLE: Record<
+ SceneKind,
+ {
+ float: string;
+ row?: string;
+ floatBg?: CSSProperties;
+ rowBg?: CSSProperties;
+ }
+> = {
+ "shader-title": {
+ float:
+ "justify-end gap-1 rounded-card px-[22px] py-5 shadow-[0_30px_60px_-20px_#3B076466]",
+ row: "justify-between rounded-[18px] px-4 pt-3.5 pb-4 shadow-[0_20px_40px_-20px_#3B076466]",
+ floatBg: {
+ backgroundImage: `linear-gradient(180deg, #0A040E99 0%, #0A040E00 60%), ${VIOLET}`,
+ backgroundPosition: "50%",
+ backgroundSize: "cover",
+ },
+ },
+ halftone: {
+ float:
+ "justify-end rounded-card px-[18px] py-4 shadow-[0_30px_60px_-20px_#83184366]",
+ row: "justify-end rounded-[18px] p-3.5 shadow-[0_20px_40px_-20px_#83184366]",
+ floatBg: {
+ backgroundImage: MAGENTA,
+ backgroundPosition: "40%",
+ backgroundSize: "cover",
+ },
+ rowBg: {
+ backgroundImage: `linear-gradient(0deg, #2A061899 0%, #2A061800 55%), ${MAGENTA}`,
+ backgroundPosition: "50%, 40%",
+ backgroundSize: "cover",
+ },
+ },
+ terminal: {
+ float:
+ "justify-between rounded-[18px] bg-[#17191B] px-[18px] py-4 shadow-[0_30px_60px_-24px_#0E101266]",
+ },
+ number: {
+ float:
+ "justify-between rounded-[18px] bg-[#A800B7] px-[18px] py-4 shadow-[0_30px_60px_-20px_#A800B766]",
+ },
+ karaoke: {
+ float:
+ "justify-between rounded-card bg-[#0E1012] px-[22px] pt-[18px] pb-[22px] shadow-[0_30px_60px_-20px_#0E101266]",
+ row: "justify-between rounded-[18px] bg-[#0E1012] px-4 pt-3.5 pb-4 shadow-[0_20px_40px_-20px_#0E101266]",
+ },
+ vertical: {
+ float:
+ "items-center justify-between rounded-[18px] bg-white px-3 py-4 shadow-[0_0_0_1px_#0E10120F,0_30px_60px_-20px_#0E101240]",
+ },
+};
+
+type Variant = "float" | "row";
+
+/**
+ * A rendered "scene" the agent has composed. `float` is the rotated desktop
+ * card scattered around the composer; `row` is the flat card in the mobile
+ * horizontal row. Purely decorative.
+ */
+export function FloatingScene({
+ scene,
+ variant,
+}: {
+ scene: Scene;
+ variant: Variant;
+}) {
+ const style = KIND_STYLE[scene.kind];
+
+ if (variant === "row") {
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ "flex h-[150px] shrink-0 flex-col overflow-clip",
+ style.row,
+ )}
+ style={{
+ width: scene.rowWidth,
+ ...(style.rowBg ?? style.floatBg),
+ }}
+ >
+ <SceneBody scene={scene} variant={variant} />
+ </div>
+ );
+ }
+
+ const { top, left, right, width, height, rotate } = scene.float;
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ "absolute hidden origin-top-left flex-col overflow-clip xl:flex",
+ style.float,
+ )}
+ style={{
+ top,
+ left,
+ right,
+ width,
+ height,
+ rotate: `${rotate}deg`,
+ ...style.floatBg,
+ }}
+ >
+ <SceneBody scene={scene} variant={variant} />
+ </div>
+ );
+}
+
+/** "scene 1 · block" on desktop, "Scene 1" over a mono block name on mobile. */
+function SceneTag({
+ scene,
+ variant,
+ className,
+}: {
+ scene: Scene;
+ variant: Variant;
+ className: string;
+}) {
+ if (variant === "row") {
+ return (
+ <div className={`flex flex-col gap-0.5 ${className}`}>
+ <span className="text-caption">Scene {scene.index}</span>
+ <span className="w-max font-mono text-mono">{scene.block}</span>
+ </div>
+ );
+ }
+ return (
+ <div className={`text-micro ${className}`}>
+ scene {scene.index} · <span className="font-mono">{scene.block}</span>
+ </div>
+ );
+}
+
+function SceneBody({ scene, variant }: { scene: Scene; variant: Variant }) {
+ const row = variant === "row";
+
+ switch (scene.kind) {
+ case "shader-title":
+ return (
+ <>
+ <SceneTag
+ scene={scene}
+ variant={variant}
+ className="text-[#F5D0FE]"
+ />
+ <div
+ className={cn(
+ "font-medium tracking-[-0.05em] text-white",
+ row ? "text-[24px] leading-[26px]" : "text-[30px] leading-8",
+ )}
+ >
+ Ship it on Tuesday.
+ </div>
+ </>
+ );
+ case "halftone":
+ return (
+ <SceneTag scene={scene} variant={variant} className="text-white" />
+ );
+ case "terminal":
+ return (
+ <>
+ <div className="flex flex-col gap-[5px] font-mono text-micro">
+ <span className="text-[#9AA3A7]">$ acme deploy --prod</span>
+ <span className="text-success-soft">✓ live at acme.dev</span>
+ </div>
+ <SceneTag
+ scene={scene}
+ variant={variant}
+ className="text-dark-muted"
+ />
+ </>
+ );
+ case "number":
+ return (
+ <>
+ <SceneTag
+ scene={scene}
+ variant={variant}
+ className="text-[#F5D0FE]"
+ />
+ <div className="text-[52px] leading-[52px] font-medium tracking-[-0.06em] text-white">
+ 2,418
+ </div>
+ </>
+ );
+ case "karaoke":
+ return (
+ <>
+ <SceneTag
+ scene={scene}
+ variant={variant}
+ className="text-[#9AA3A7]"
+ />
+ <KaraokeLine compact={row} />
+ </>
+ );
+ case "vertical":
+ return (
+ <>
+ <div className="text-[10px] leading-[13px] text-[#6B7A80]">
+ scene {scene.index} · 9:16
+ </div>
+ <div className="flex items-center gap-1.5">
+ <span className="size-[22px] shrink-0 rounded-[7px] bg-[url(/landing/shader-magenta.png)] bg-cover bg-[position:30%]" />
+ <span className="text-[22px] leading-6 font-semibold tracking-[-0.05em] text-[#0E1012]">
+ acme
+ </span>
+ </div>
+ <div className="font-mono text-[10px] leading-[13px] text-[#6B7A80]">
+ {scene.block}
+ </div>
+ </>
+ );
+ }
+}
+
+function KaraokeLine({ compact }: { compact: boolean }) {
+ const word = cn(
+ "font-semibold tracking-[-0.03em]",
+ compact ? "text-[20px] leading-[26px]" : "text-[24px] leading-[30px]",
+ );
+ const dim = cn(word, "text-white/35");
+ return (
+ <div
+ className={cn(
+ "flex flex-wrap items-center",
+ compact ? "gap-1" : "gap-1.5",
+ )}
+ >
+ <span className={dim}>one prompt,</span>
+ <span
+ className={cn(
+ word,
+ "bg-[#F0ABFC] text-[#0E1012]",
+ compact ? "rounded-[7px] px-1.5" : "rounded-tile px-2",
+ )}
+ >
+ one
+ </span>
+ <span className={dim}>afternoon</span>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/hero-headline.tsx b/app/(home)/components/landing/sections/hero/hero-headline.tsx
new file mode 100644
index 00000000..f5072b98
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/hero-headline.tsx
@@ -0,0 +1,49 @@
+import type { ReactNode } from "react";
+import { HeroAeTile, HeroVideoTile } from "./tiles/hero-tiles";
+
+const HEADLINE = "You want the video, not the ordeal";
+
+export const TILE_SLOT = "size-[46px] md:size-[0.839em]";
+
+/**
+ * Display headline with two rotated tiles between the words. The tiles are
+ * sized in `em`, so the whole line scales with the font size per breakpoint.
+ * Mobile breaks into four lines ("You want / the ▢ video, / not the ▢ /
+ * ordeal"), md+ into two.
+ */
+export function HeroHeadline({
+ videoTile = <HeroVideoTile className={TILE_SLOT} />,
+ aeTile = <HeroAeTile className={TILE_SLOT} />,
+}: {
+ videoTile?: ReactNode;
+ aeTile?: ReactNode;
+}) {
+ return (
+ <h1 className="flex flex-col items-center pt-7 text-[52px] leading-none tracking-[-0.05em] text-foreground md:pt-9 md:text-[72px] lg:text-[96px] xl:text-display">
+ <span className="sr-only">{HEADLINE}</span>
+ <span
+ aria-hidden="true"
+ className="hero-in flex flex-col items-center [--reveal-i:1] md:flex-row md:gap-[0.177em]"
+ >
+ <span className="whitespace-pre">
+ You want<span className="hidden md:inline"> the</span>
+ </span>
+ <span className="flex items-center gap-2.5 md:gap-[0.177em]">
+ <span className="md:hidden">the</span>
+ {videoTile}
+ <span>video,</span>
+ </span>
+ </span>
+ <span
+ aria-hidden="true"
+ className="hero-in flex flex-col items-center [--reveal-i:2] md:flex-row md:gap-[0.177em]"
+ >
+ <span className="flex items-center gap-2.5 md:gap-[0.177em]">
+ <span className="whitespace-pre">not the</span>
+ {aeTile}
+ </span>
+ <span className="text-title-muted">ordeal</span>
+ </span>
+ </h1>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/prompt-composer.tsx b/app/(home)/components/landing/sections/hero/prompt-composer.tsx
new file mode 100644
index 00000000..8bb0a1c0
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/prompt-composer.tsx
@@ -0,0 +1,84 @@
+import { COMPONENT_COUNT, STUDIO_URL } from "@/config/site";
+import { MetalRing } from "../../ui/metal-ring";
+import { StudioAppIcon } from "../../ui/remocn-mark";
+import {
+ AgentLine,
+ ComposerLoop,
+ PickedRow,
+ TypedPrompt,
+} from "./composer/composer-loop";
+
+/**
+ * Illustration of agents using the remocn skill: prompts type themselves,
+ * get selected and replaced, the agent swaps and its picked blocks ripple in.
+ * Not a real input: the send button is decorative; "Run in Remocn Studio" and
+ * the picked chips are live links.
+ */
+export function PromptComposer() {
+ return (
+ <div className="px-5 md:px-10">
+ <ComposerLoop
+ label="Example prompts: AI agents building product videos with remocn blocks"
+ className="relative mx-auto flex w-full max-w-[860px] flex-col rounded-panel bg-surface p-2 shadow-[0_0_0_1px_#0E10120F,0_24px_60px_-20px_#0E101233] md:rounded-shell md:p-2.5"
+ >
+ <div className="flex flex-col gap-5 rounded-[18px] bg-surface-muted px-[18px] pt-5 pb-4 md:gap-7 md:rounded-card md:px-7 md:pt-[26px] md:pb-[22px]">
+ <AgentLine />
+
+ <TypedPrompt className="text-[20px] leading-7 tracking-title text-foreground md:text-quote md:leading-9" />
+
+ <div className="flex flex-col gap-3 md:flex-row md:items-center md:justify-between">
+ <p className="flex items-center gap-2 text-subtle md:gap-0">
+ <span className="text-mono md:text-caption">remocn skill</span>
+ <span className="hidden text-caption whitespace-pre md:inline">
+ {" · "}
+ </span>
+ <span className="text-caption tabular-nums">
+ {COMPONENT_COUNT} blocks available
+ </span>
+ </p>
+
+ <div className="flex items-center gap-2">
+ <a
+ href={STUDIO_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ className="relative flex h-[46px] flex-1 items-center gap-2 rounded-[14px] border-2 border-metal pr-3.5 pl-1.5 text-[15px] leading-[18px] text-foreground shadow-[0_1px_2px_#0E10121F,0_4px_16px_#A800B724] outline-none transition-shadow duration-150 hover:shadow-[0_1px_2px_#0E10121F,0_6px_20px_#A800B740] focus-visible:ring-3 focus-visible:ring-ring md:h-11 md:flex-none md:text-[14px]"
+ >
+ <StudioAppIcon size={30} radius={8} className="md:hidden" />
+ <StudioAppIcon
+ size={28}
+ radius={8}
+ className="hidden md:flex"
+ />
+ Run in Remocn Studio
+ <MetalRing width={2} />
+ </a>
+ <span
+ aria-hidden="true"
+ className="flex size-[46px] shrink-0 items-center justify-center rounded-control-sm bg-foreground text-background md:size-10"
+ >
+ <svg viewBox="0 0 24 24" className="size-[18px]">
+ <path
+ d="M12 19V5M5 12l7-7 7 7"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </span>
+ </div>
+ </div>
+ </div>
+
+ <div className="flex items-center gap-2 overflow-clip pt-3 pb-1 pl-2.5 md:px-[18px] md:pt-4 md:pb-2">
+ <span className="shrink-0 pr-1 text-caption text-subtle md:pr-1.5 md:text-mono">
+ Picked
+ </span>
+ <PickedRow />
+ </div>
+ </ComposerLoop>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/prompt-stage.tsx b/app/(home)/components/landing/sections/hero/prompt-stage.tsx
new file mode 100644
index 00000000..cb6ba684
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/prompt-stage.tsx
@@ -0,0 +1,26 @@
+import { ComposerStatus } from "./composer-status";
+import { FloatingScene, ROW_SCENES } from "./floating-scene";
+import { PromptComposer } from "./prompt-composer";
+import { HeroSceneField } from "./scenes/hero-scene-field";
+
+/**
+ * The composer with the scenes it produced. From xl up the scenes float
+ * around it, rotated; below xl they become a horizontal row under it.
+ */
+export function PromptStage() {
+ return (
+ <div className="hero-in hero-rise relative mx-auto flex [--reveal-i:5] w-full max-w-[1440px] flex-col gap-5 overflow-x-clip pt-10 md:pb-20 xl:gap-0 xl:pt-[130px] xl:pb-[320px]">
+ <HeroSceneField />
+
+ <PromptComposer />
+
+ <div className="flex gap-3 overflow-x-auto px-5 pt-1 pb-6 [scrollbar-width:none] md:justify-center xl:hidden">
+ {ROW_SCENES.map((scene) => (
+ <FloatingScene key={scene.index} scene={scene} variant="row" />
+ ))}
+ </div>
+
+ <ComposerStatus />
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/clips.tsx b/app/(home)/components/landing/sections/hero/scenes/clips.tsx
new file mode 100644
index 00000000..e6df3b7c
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/clips.tsx
@@ -0,0 +1,1215 @@
+"use client";
+
+import {
+ AnimatePresence,
+ animate,
+ motion,
+ useMotionValue,
+ useTransform,
+} from "motion/react";
+import {
+ type CSSProperties,
+ type ReactNode,
+ useEffect,
+ useId,
+ useState,
+} from "react";
+import { cn } from "@/lib/utils";
+import type { Clip } from "./scenario-scenes";
+
+export const CLIP_DURATION: Record<Clip["kind"], number> = {
+ "shader-title": 2.2,
+ "type-title": 2.6,
+ karaoke: 2.6,
+ zoom: 2.4,
+ whip: 2.4,
+ glitch: 2.4,
+ terminal: 2.8,
+ rolling: 2.2,
+ logo: 2.2,
+ bars: 2.2,
+ crt: 2.4,
+ cursor: 2.8,
+ checklist: 2.6,
+ "line-chart": 2.4,
+ "code-morph": 2.6,
+ marker: 2.4,
+ stars: 2.4,
+ decode: 2.6,
+ slot: 2.6,
+ "split-flap": 2.8,
+ "power-off": 2.8,
+ keystroke: 2.4,
+ "word-pop": 2.4,
+ search: 2.8,
+};
+
+const EASE_OUT = [0.22, 1, 0.36, 1] as const;
+
+export const CLIP_SURFACE: Record<Clip["kind"], string> = {
+ "shader-title": "bg-[#1A0820] text-white",
+ "type-title": "bg-[#2A0618] text-white",
+ karaoke: "bg-[#0E1012] text-white",
+ zoom: "bg-[#141318] text-white",
+ whip: "bg-[#0E1012] text-white",
+ glitch: "bg-[#0B0D0C] text-white",
+ terminal: "bg-[#17191B] text-white",
+ rolling: "bg-[#A800B7] text-white",
+ logo: "bg-white text-[#0E1012]",
+ bars: "bg-white text-[#0E1012]",
+ crt: "bg-[#07110B] text-[#9BF5B8]",
+ cursor: "bg-[#F4F4F5] text-[#0E1012]",
+ checklist: "bg-[#17191B] text-white",
+ "line-chart": "bg-white text-[#0E1012]",
+ "code-morph": "bg-[#101214] text-[#E4E5E7]",
+ marker: "bg-[#0E1012] text-white",
+ stars: "bg-white text-[#0E1012]",
+ decode: "bg-[#0B0D0C] text-[#9BF5B8]",
+ slot: "bg-[#17191B] text-white",
+ "split-flap": "bg-[#0E1012] text-white",
+ "power-off": "bg-black text-white",
+ keystroke: "bg-[#F4F4F5] text-[#0E1012]",
+ "word-pop": "bg-[#FBE8FD] text-[#0E1012]",
+ search: "bg-white text-[#0E1012]",
+};
+
+function Fill({
+ children,
+ className,
+ style,
+}: {
+ children: ReactNode;
+ className?: string;
+ style?: CSSProperties;
+}) {
+ return (
+ <div
+ className={cn("absolute inset-0 overflow-hidden", className)}
+ style={style}
+ >
+ {children}
+ </div>
+ );
+}
+
+function useTicker(
+ count: number,
+ stepMs: number,
+ startMs: number,
+ cycle: number,
+) {
+ const [index, setIndex] = useState(-1);
+ useEffect(() => {
+ setIndex(-1);
+ if (cycle < 0) return;
+ let i = -1;
+ let interval: ReturnType<typeof setInterval>;
+ const start = setTimeout(() => {
+ i = 0;
+ setIndex(0);
+ interval = setInterval(() => {
+ i += 1;
+ if (i >= count) {
+ clearInterval(interval);
+ return;
+ }
+ setIndex(i);
+ }, stepMs);
+ }, startMs);
+ return () => {
+ clearTimeout(start);
+ clearInterval(interval);
+ };
+ }, [count, stepMs, startMs, cycle]);
+ return index;
+}
+
+type ClipProps = { clip: Clip; cycle: number; speed: number };
+
+function ShaderTitle({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "shader-title" }> }) {
+ const words = clip.title.split(" ");
+ return (
+ <Fill
+ className="animate-[scene-drift_12s_ease-in-out_infinite_alternate] bg-cover"
+ style={{
+ backgroundImage: `linear-gradient(180deg, #0A040E99 0%, #0A040E00 60%), url(${clip.image})`,
+ backgroundSize: "auto, 180%",
+ }}
+ >
+ <div
+ key={cycle}
+ className="absolute inset-x-[22px] bottom-5 flex flex-wrap gap-x-[0.24em] text-[30px] leading-8 font-medium tracking-[-0.05em]"
+ >
+ {words.map((word, i) => (
+ <motion.span
+ key={`${word}-${i}`}
+ initial={{ opacity: 0, filter: "blur(10px)", y: 10 }}
+ animate={{ opacity: 1, filter: "blur(0px)", y: 0 }}
+ transition={{
+ duration: 0.7 / speed,
+ delay: (0.15 + i * 0.12) / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function TypeTitle({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "type-title" }> }) {
+ const typed = useTicker(clip.title.length, 70 / speed, 200 / speed, cycle);
+ return (
+ <Fill
+ className="animate-[scene-drift_12s_ease-in-out_infinite_alternate] bg-cover"
+ style={{
+ backgroundImage: `linear-gradient(180deg, #2A061866 0%, #2A061800 60%), url(${clip.image})`,
+ backgroundSize: "auto, 180%",
+ }}
+ >
+ <div className="absolute inset-x-[22px] bottom-5 text-[28px] leading-8 font-medium tracking-[-0.05em]">
+ {clip.title.slice(0, typed + 1)}
+ <span className="ml-0.5 inline-block h-[0.9em] w-[2px] translate-y-[0.12em] animate-[caret-blink_1.06s_steps(1)_infinite] bg-white" />
+ </div>
+ </Fill>
+ );
+}
+
+function Karaoke({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "karaoke" }> }) {
+ const layoutKey = useId();
+ const active = useTicker(clip.words.length, 380 / speed, 250 / speed, cycle);
+ return (
+ <Fill>
+ <div className="absolute inset-x-[22px] bottom-[22px] flex flex-wrap items-center gap-x-1.5 gap-y-0.5 text-[24px] leading-[30px] font-semibold tracking-[-0.03em]">
+ {clip.words.map((word, i) => (
+ <span key={`${word}-${i}`} className="relative px-1">
+ {active === i && (
+ <motion.span
+ layoutId={`karaoke-${layoutKey}`}
+ transition={{
+ type: "spring",
+ visualDuration: 0.22 / speed,
+ bounce: 0.15,
+ }}
+ className="absolute inset-0 -z-0 rounded-tile bg-[#F0ABFC]"
+ />
+ )}
+ <span
+ className={cn(
+ "relative transition-colors duration-150",
+ active === i
+ ? "text-[#0E1012]"
+ : i < active
+ ? "text-white"
+ : "text-white/35",
+ )}
+ >
+ {word}
+ </span>
+ </span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function TwoFrames({
+ frames,
+ cycle,
+ speed,
+ exit,
+ enter,
+ classNames,
+}: {
+ frames: [string, string];
+ cycle: number;
+ speed: number;
+ exit: Record<string, number[] | string[]>;
+ enter: Record<string, number[] | string[]>;
+ classNames: [string, string];
+}) {
+ const duration = 2 / speed;
+ const times = [0, 0.45, 0.62, 1];
+ return (
+ <div key={cycle} className="absolute inset-0">
+ <motion.div
+ className={cn(
+ "absolute inset-0 flex items-center justify-center",
+ classNames[0],
+ )}
+ animate={exit}
+ transition={{ duration, times, ease: "easeInOut" }}
+ >
+ <span className="text-[44px] leading-none font-semibold tracking-[-0.05em]">
+ {frames[0]}
+ </span>
+ </motion.div>
+ <motion.div
+ className={cn(
+ "absolute inset-0 flex items-center justify-center",
+ classNames[1],
+ )}
+ animate={enter}
+ transition={{ duration, times, ease: "easeInOut" }}
+ >
+ <span className="text-[44px] leading-none font-semibold tracking-[-0.05em]">
+ {frames[1]}
+ </span>
+ </motion.div>
+ </div>
+ );
+}
+
+function Zoom({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "zoom" }> }) {
+ return (
+ <Fill>
+ <TwoFrames
+ frames={clip.frames}
+ cycle={cycle}
+ speed={speed}
+ classNames={["bg-[#141318]", "bg-[#1C1A24]"]}
+ exit={{
+ opacity: [1, 1, 0, 0],
+ scale: [1, 1.04, 1.22, 1.22],
+ filter: ["blur(0px)", "blur(0px)", "blur(10px)", "blur(10px)"],
+ }}
+ enter={{
+ opacity: [0, 0, 1, 1],
+ scale: [0.88, 0.88, 1, 1],
+ filter: ["blur(10px)", "blur(10px)", "blur(0px)", "blur(0px)"],
+ }}
+ />
+ </Fill>
+ );
+}
+
+function Whip({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "whip" }> }) {
+ return (
+ <Fill>
+ <TwoFrames
+ frames={clip.frames}
+ cycle={cycle}
+ speed={speed}
+ classNames={["bg-[#0E1012]", "bg-[#A800B7]"]}
+ exit={{
+ x: ["0%", "0%", "-110%", "-110%"],
+ filter: ["blur(0px)", "blur(0px)", "blur(6px)", "blur(6px)"],
+ }}
+ enter={{
+ x: ["110%", "110%", "0%", "0%"],
+ filter: ["blur(6px)", "blur(6px)", "blur(0px)", "blur(0px)"],
+ }}
+ />
+ </Fill>
+ );
+}
+
+function Glitch({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "glitch" }> }) {
+ const slices = [0, 1, 2, 3];
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-0 flex items-center justify-center"
+ >
+ {slices.map((slice) => (
+ <motion.span
+ key={slice}
+ aria-hidden="true"
+ className="absolute text-[52px] leading-none font-black tracking-[-0.04em] text-white"
+ style={{
+ clipPath: `inset(${slice * 25}% 0 ${75 - slice * 25}% 0)`,
+ }}
+ animate={{
+ x: [0, 0, slice % 2 ? 9 : -11, slice % 2 ? -4 : 6, 0, 0],
+ color: [
+ "#FFFFFF",
+ "#FFFFFF",
+ slice % 2 ? "#86EFAC" : "#F0ABFC",
+ "#FFFFFF",
+ "#FFFFFF",
+ "#FFFFFF",
+ ],
+ }}
+ transition={{
+ duration: 1.6 / speed,
+ times: [0, 0.4, 0.46, 0.52, 0.58, 1],
+ ease: "linear",
+ }}
+ >
+ {clip.text}
+ </motion.span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function Terminal({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "terminal" }> }) {
+ const typed = useTicker(clip.command.length, 45 / speed, 200 / speed, cycle);
+ const done = typed >= clip.command.length - 1;
+ return (
+ <Fill className="px-[18px] pt-4">
+ <div className="flex flex-col gap-[5px] font-mono text-micro">
+ <span className="text-[#9AA3A7]">
+ $ {clip.command.slice(0, typed + 1)}
+ {!done && (
+ <span className="ml-px inline-block h-3 w-[6px] translate-y-0.5 bg-[#9AA3A7]" />
+ )}
+ </span>
+ {done && (
+ <motion.span
+ key={cycle}
+ initial={{ opacity: 0, y: 4 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.3 / speed,
+ delay: 0.35 / speed,
+ ease: EASE_OUT,
+ }}
+ className="text-[#86EFAC]"
+ >
+ ✓ {clip.result}
+ </motion.span>
+ )}
+ </div>
+ </Fill>
+ );
+}
+
+function Rolling({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "rolling" }> }) {
+ const value = useMotionValue(0);
+ const text = useTransform(value, (v) =>
+ Math.round(v).toLocaleString("en-US"),
+ );
+ useEffect(() => {
+ if (cycle < 0) return;
+ value.jump(0);
+ const controls = animate(value, clip.to, {
+ duration: 1.4 / speed,
+ delay: 0.15 / speed,
+ ease: [0.16, 1, 0.3, 1],
+ });
+ return () => controls.stop();
+ }, [cycle, clip.to, speed, value]);
+ return (
+ <Fill className="px-[18px]">
+ <motion.div className="absolute bottom-4 left-[18px] text-[52px] leading-[52px] font-medium tracking-[-0.06em] tabular-nums">
+ {text}
+ </motion.div>
+ </Fill>
+ );
+}
+
+function Logo({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "logo" }> }) {
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-0 flex items-center justify-center gap-1.5"
+ >
+ <motion.span
+ className="size-[22px] shrink-0 rounded-[7px] bg-cover bg-[position:30%]"
+ style={{ backgroundImage: `url(${clip.image})` }}
+ initial={{ scale: 0.4, rotate: -20, opacity: 0 }}
+ animate={{ scale: 1, rotate: 0, opacity: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: 0.45 / speed,
+ bounce: 0.35,
+ delay: 0.15 / speed,
+ }}
+ />
+ <span className="flex overflow-hidden text-[22px] leading-6 font-semibold tracking-[-0.05em]">
+ {clip.name.split("").map((letter, i) => (
+ <motion.span
+ key={`${letter}-${i}`}
+ initial={{ y: "110%" }}
+ animate={{ y: "0%" }}
+ transition={{
+ duration: 0.5 / speed,
+ delay: (0.35 + i * 0.05) / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {letter}
+ </motion.span>
+ ))}
+ </span>
+ </div>
+ </Fill>
+ );
+}
+
+function Bars({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "bars" }> }) {
+ const max = Math.max(...clip.values);
+ return (
+ <Fill className="px-[22px]">
+ <span className="absolute top-9 left-[22px] text-caption text-[#6B7A80]">
+ {clip.label}
+ </span>
+ <div
+ key={cycle}
+ className="absolute inset-x-[22px] bottom-5 flex h-[86px] items-end gap-2"
+ >
+ {clip.values.map((v, i) => (
+ <motion.span
+ key={`${v}-${i}`}
+ className={cn(
+ "flex-1 origin-bottom rounded-[4px]",
+ i === clip.values.length - 1 ? "bg-[#A800B7]" : "bg-[#F0ABFC]",
+ )}
+ style={{ height: `${(v / max) * 100}%` }}
+ initial={{ scaleY: 0 }}
+ animate={{ scaleY: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: 0.5 / speed,
+ bounce: 0.2,
+ delay: (0.15 + i * 0.08) / speed,
+ }}
+ />
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function Crt({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "crt" }> }) {
+ return (
+ <Fill>
+ <motion.div
+ key={cycle}
+ className="absolute inset-0 flex items-center justify-center"
+ initial={{ scaleY: 0.02, opacity: 0.4, filter: "brightness(3)" }}
+ animate={{ scaleY: 1, opacity: 1, filter: "brightness(1)" }}
+ transition={{
+ duration: 0.45 / speed,
+ delay: 0.15 / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ <span className="text-[46px] leading-none font-bold tracking-[0.02em] [text-shadow:-2px_0_#F0ABFC99,2px_0_#22C55E99]">
+ {clip.text}
+ </span>
+ </motion.div>
+ <span className="pointer-events-none absolute inset-0 animate-[tile-scan_0.6s_linear_infinite] bg-[repeating-linear-gradient(0deg,#00000059_0_2px,transparent_2px_4px)]" />
+ </Fill>
+ );
+}
+
+function Cursor({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "cursor" }> }) {
+ const d = (s: number) => s / speed;
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-0 flex items-center justify-center"
+ >
+ <motion.span
+ className="rounded-[10px] px-4 py-2 text-small font-medium"
+ initial={{ backgroundColor: "#0E1012", color: "#FFFFFF", scale: 1 }}
+ animate={{
+ scale: [1, 1, 0.94, 1],
+ backgroundColor: ["#0E1012", "#0E1012", "#0E1012", "#22C55E"],
+ }}
+ transition={{
+ duration: d(1.6),
+ times: [0, 0.62, 0.7, 0.82],
+ ease: "easeOut",
+ }}
+ >
+ {clip.label}
+ </motion.span>
+ <motion.svg
+ viewBox="0 0 24 24"
+ className="absolute size-5 text-[#0E1012]"
+ initial={{ x: 60, y: 46, opacity: 0 }}
+ animate={{
+ x: [60, 60, 12, 12],
+ y: [46, 46, 8, 8],
+ opacity: [0, 1, 1, 1],
+ scale: [1, 1, 1, 0.85],
+ }}
+ transition={{
+ duration: d(1.2),
+ times: [0, 0.15, 0.8, 1],
+ ease: EASE_OUT,
+ }}
+ >
+ <path
+ d="M5 3l14 7.5-6.2 1.8L10 19z"
+ fill="currentColor"
+ stroke="white"
+ strokeWidth="1.5"
+ strokeLinejoin="round"
+ />
+ </motion.svg>
+ </div>
+ </Fill>
+ );
+}
+
+function Checklist({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "checklist" }> }) {
+ return (
+ <Fill className="px-[18px] pt-4">
+ <ul key={cycle} className="flex flex-col gap-2">
+ {clip.items.map((item, i) => (
+ <motion.li
+ key={item}
+ className="flex items-center gap-2 text-small"
+ initial={{ opacity: 0, x: -6 }}
+ animate={{ opacity: 1, x: 0 }}
+ transition={{
+ duration: 0.35 / speed,
+ delay: (0.1 + i * 0.3) / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ <span className="flex size-4 items-center justify-center rounded-[5px] bg-[#22C55E]">
+ <svg viewBox="0 0 24 24" className="size-3 text-white">
+ <motion.path
+ d="M20 6 9 17l-5-5"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="3"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 0.3 / speed,
+ delay: (0.3 + i * 0.3) / speed,
+ ease: EASE_OUT,
+ }}
+ />
+ </svg>
+ </span>
+ {item}
+ </motion.li>
+ ))}
+ </ul>
+ </Fill>
+ );
+}
+
+function LineChart({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "line-chart" }> }) {
+ const path = "M4 64 C 30 58, 44 40, 70 44 S 116 22, 140 26 S 186 6, 216 8";
+ return (
+ <Fill className="px-[22px]">
+ <div className="absolute top-9 left-[22px] flex items-baseline gap-2">
+ <span className="text-caption text-[#6B7A80]">{clip.label}</span>
+ <motion.span
+ key={cycle}
+ className="text-caption font-medium text-[#16A34A]"
+ initial={{ opacity: 0, y: 4 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.3 / speed,
+ delay: 1.1 / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {clip.delta}
+ </motion.span>
+ </div>
+ <svg
+ key={cycle}
+ viewBox="0 0 220 72"
+ className="absolute inset-x-[18px] bottom-4 h-[72px] w-[calc(100%-36px)] overflow-visible"
+ >
+ <motion.path
+ d={path}
+ fill="none"
+ stroke="#A800B7"
+ strokeWidth="3"
+ strokeLinecap="round"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 1.1 / speed,
+ delay: 0.15 / speed,
+ ease: [0.65, 0, 0.35, 1],
+ }}
+ />
+ <motion.circle
+ cx="216"
+ cy="8"
+ r="5"
+ fill="#A800B7"
+ initial={{ scale: 0 }}
+ animate={{ scale: [0, 1.4, 1] }}
+ transition={{
+ duration: 0.45 / speed,
+ delay: 1.2 / speed,
+ ease: EASE_OUT,
+ }}
+ />
+ </svg>
+ </Fill>
+ );
+}
+
+function CodeMorph({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "code-morph" }> }) {
+ const [morphed, setMorphed] = useState(false);
+ useEffect(() => {
+ setMorphed(false);
+ if (cycle < 0) return;
+ const id = setTimeout(() => setMorphed(true), 900 / speed);
+ return () => clearTimeout(id);
+ }, [cycle, speed]);
+ const value = morphed ? clip.to : clip.from;
+ return (
+ <Fill className="px-[18px] pt-[18px] font-mono text-[12px] leading-5">
+ <div className="text-[#6B7A80]">{"{"}</div>
+ <div className="flex pl-4">
+ <span className="text-[#E4E5E7]">"{clip.key}":&nbsp;</span>
+ <span className="text-[#99FFE4]">"</span>
+ <span className="relative flex">
+ {value.split("").map((char, i) => (
+ <span key={i} className="relative inline-flex overflow-hidden">
+ <AnimatePresence mode="popLayout" initial={false}>
+ <motion.span
+ key={`${char}-${i}-${morphed}`}
+ className={
+ morphed && clip.from[i] !== clip.to[i]
+ ? "text-[#FFC799]"
+ : "text-[#99FFE4]"
+ }
+ initial={{ y: "100%", opacity: 0 }}
+ animate={{ y: "0%", opacity: 1 }}
+ exit={{ y: "-100%", opacity: 0 }}
+ transition={{
+ duration: 0.35 / speed,
+ delay: (i * 0.03) / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {char}
+ </motion.span>
+ </AnimatePresence>
+ </span>
+ ))}
+ </span>
+ <span className="text-[#99FFE4]">"</span>
+ </div>
+ <div className="text-[#6B7A80]">{"}"}</div>
+ </Fill>
+ );
+}
+
+function Marker({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "marker" }> }) {
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-x-[22px] bottom-[22px] flex flex-wrap items-center gap-x-2 text-[24px] leading-[32px] font-semibold tracking-[-0.03em]"
+ >
+ {clip.words.map((word, i) => (
+ <motion.span
+ key={`${word}-${i}`}
+ className="relative"
+ initial={{ opacity: 0, y: 6 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.35 / speed,
+ delay: (0.1 + i * 0.1) / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {i === clip.marked && (
+ <motion.span
+ className="absolute inset-x-[-4px] bottom-[3px] -z-0 h-[14px] origin-left rounded-[3px] bg-[#A800B7]"
+ initial={{ scaleX: 0 }}
+ animate={{ scaleX: 1 }}
+ transition={{
+ duration: 0.45 / speed,
+ delay: 0.9 / speed,
+ ease: [0.65, 0, 0.35, 1],
+ }}
+ />
+ )}
+ <span className="relative">{word}</span>
+ </motion.span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function Stars({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "stars" }> }) {
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-0 flex flex-col items-center justify-center gap-2"
+ >
+ <motion.svg
+ viewBox="0 0 24 24"
+ className="size-9 text-[#F5B400]"
+ initial={{ scale: 0, rotate: -60 }}
+ animate={{ scale: 1, rotate: 0 }}
+ transition={{
+ type: "spring",
+ visualDuration: 0.5 / speed,
+ bounce: 0.45,
+ delay: 0.15 / speed,
+ }}
+ >
+ <path
+ d="M12 2.5l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.3 6.1 20.6l1.3-6.6L2.5 9.4l6.6-.8z"
+ fill="currentColor"
+ />
+ </motion.svg>
+ <motion.span
+ className="text-[26px] leading-7 font-semibold tracking-[-0.04em]"
+ initial={{ opacity: 0, y: 10, filter: "blur(6px)" }}
+ animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
+ transition={{
+ duration: 0.5 / speed,
+ delay: 0.5 / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {clip.count}
+ </motion.span>
+ <motion.span
+ className="text-caption text-[#6B7A80]"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ transition={{ duration: 0.4 / speed, delay: 0.75 / speed }}
+ >
+ GitHub stars
+ </motion.span>
+ </div>
+ </Fill>
+ );
+}
+
+const GLYPHS = "ABCDEFGHJKLMNPQRSTUVWXYZ0123456789#%&*";
+
+function Decode({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "decode" }> }) {
+ const [text, setText] = useState(clip.text);
+ useEffect(() => {
+ if (cycle < 0) return;
+ let frame = 0;
+ const total = clip.text.length;
+ const id = setInterval(() => {
+ frame += 1;
+ const settled = Math.floor(frame / 2);
+ setText(
+ clip.text
+ .split("")
+ .map((char, i) =>
+ char === " " || i < settled
+ ? char
+ : GLYPHS[Math.floor(Math.random() * GLYPHS.length)],
+ )
+ .join(""),
+ );
+ if (settled > total) clearInterval(id);
+ }, 45 / speed);
+ return () => clearInterval(id);
+ }, [cycle, clip.text, speed]);
+ return (
+ <Fill className="flex items-center px-[18px]">
+ <span className="font-mono text-[20px] leading-6 tracking-[0.04em]">
+ {text}
+ </span>
+ </Fill>
+ );
+}
+
+function Slot({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "slot" }> }) {
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-x-[18px] top-1/2 flex -translate-y-1/2 gap-1.5"
+ >
+ {clip.digits.split("").map((digit, i) => {
+ const spins = 10 + i * 4 + Number(digit);
+ return (
+ <span
+ key={i}
+ className="relative h-[52px] flex-1 overflow-hidden rounded-[8px] bg-[#0E1012] shadow-[inset_0_0_0_1px_#FFFFFF14]"
+ >
+ <motion.span
+ className="absolute inset-x-0 top-0 flex flex-col items-center"
+ initial={{ y: 0 }}
+ animate={{ y: -spins * 52 }}
+ transition={{
+ duration: (1 + i * 0.25) / speed,
+ delay: 0.1 / speed,
+ ease: [0.16, 1, 0.3, 1],
+ }}
+ >
+ {Array.from({ length: spins + 1 }, (_, n) => (
+ <span
+ key={n}
+ className="flex h-[52px] items-center text-[34px] font-semibold tabular-nums"
+ >
+ {n % 10}
+ </span>
+ ))}
+ </motion.span>
+ </span>
+ );
+ })}
+ </div>
+ </Fill>
+ );
+}
+
+function SplitFlap({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "split-flap" }> }) {
+ const [letters, setLetters] = useState(clip.text.split("").map(() => " "));
+ useEffect(() => {
+ if (cycle < 0) return;
+ let tick = 0;
+ const id = setInterval(() => {
+ tick += 1;
+ setLetters(
+ clip.text
+ .split("")
+ .map((char, i) =>
+ tick > 6 + i * 3 ? char : GLYPHS[(tick * 7 + i * 3) % 26],
+ ),
+ );
+ if (tick > 6 + clip.text.length * 3) clearInterval(id);
+ }, 70 / speed);
+ return () => clearInterval(id);
+ }, [cycle, clip.text, speed]);
+ return (
+ <Fill>
+ <div className="absolute inset-x-[22px] bottom-[22px] flex gap-1.5">
+ {letters.map((letter, i) => (
+ <span
+ key={i}
+ className="relative flex h-[58px] w-[44px] items-center justify-center overflow-hidden rounded-[6px] bg-[#1F2226] text-[34px] font-bold"
+ >
+ <AnimatePresence mode="popLayout" initial={false}>
+ <motion.span
+ key={letter}
+ initial={{ rotateX: -90, opacity: 0.4 }}
+ animate={{ rotateX: 0, opacity: 1 }}
+ exit={{ rotateX: 90, opacity: 0.4 }}
+ transition={{ duration: 0.06 / speed }}
+ >
+ {letter}
+ </motion.span>
+ </AnimatePresence>
+ <span className="absolute inset-x-0 top-1/2 h-px bg-black/60" />
+ </span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function PowerOff({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "power-off" }> }) {
+ const d = 1.8 / speed;
+ return (
+ <Fill>
+ <motion.div
+ key={cycle}
+ className="absolute inset-0 flex items-center justify-center bg-cover"
+ style={{
+ backgroundImage: "url(/landing/shader-why.png)",
+ backgroundPosition: "50%",
+ }}
+ animate={{
+ scaleY: [1, 1, 0.012, 0.012, 1],
+ scaleX: [1, 1, 1, 0.02, 1],
+ filter: [
+ "brightness(1)",
+ "brightness(1)",
+ "brightness(3)",
+ "brightness(4)",
+ "brightness(1)",
+ ],
+ }}
+ transition={{
+ duration: d,
+ times: [0, 0.35, 0.5, 0.62, 1],
+ ease: "easeInOut",
+ }}
+ >
+ <span className="text-[26px] font-semibold tracking-[-0.04em] text-white">
+ {clip.name}
+ </span>
+ </motion.div>
+ </Fill>
+ );
+}
+
+function Keystroke({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "keystroke" }> }) {
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-x-[18px] top-[34px] flex items-center gap-2"
+ >
+ {clip.keys.map((key, i) => (
+ <motion.span
+ key={key}
+ className="flex h-11 min-w-11 items-center justify-center rounded-[9px] bg-white px-3 text-[20px] font-medium shadow-[0_0_0_1px_#0E10121A,0_3px_0_#0E10121F]"
+ animate={{
+ y: [0, 0, 3, 3, 0],
+ boxShadow: [
+ "0 0 0 1px #0E10121A, 0 3px 0 #0E10121F",
+ "0 0 0 1px #0E10121A, 0 3px 0 #0E10121F",
+ "0 0 0 1px #0E10121A, 0 0px 0 #0E10121F",
+ "0 0 0 1px #0E10121A, 0 0px 0 #0E10121F",
+ "0 0 0 1px #0E10121A, 0 3px 0 #0E10121F",
+ ],
+ }}
+ transition={{
+ duration: 1.2 / speed,
+ times: [0, 0.2 + i * 0.12, 0.28 + i * 0.12, 0.7, 0.85],
+ ease: "easeOut",
+ }}
+ >
+ {key}
+ </motion.span>
+ ))}
+ <motion.span
+ className="ml-1 text-small text-[#6B7A80]"
+ initial={{ opacity: 0, x: -4 }}
+ animate={{ opacity: 1, x: 0 }}
+ transition={{
+ duration: 0.3 / speed,
+ delay: 0.55 / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {clip.label}
+ </motion.span>
+ </div>
+ </Fill>
+ );
+}
+
+function WordPop({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "word-pop" }> }) {
+ return (
+ <Fill>
+ <div
+ key={cycle}
+ className="absolute inset-x-[22px] bottom-[22px] flex flex-wrap items-center gap-x-1.5 text-[24px] leading-[30px] font-semibold tracking-[-0.03em]"
+ >
+ {clip.words.map((word, i) => (
+ <motion.span
+ key={`${word}-${i}`}
+ initial={{ scale: 0.5, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: 0.35 / speed,
+ bounce: 0.45,
+ delay: (0.15 + i * 0.22) / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+function Search({
+ clip,
+ cycle,
+ speed,
+}: ClipProps & { clip: Extract<Clip, { kind: "search" }> }) {
+ const typed = useTicker(clip.query.length, 80 / speed, 200 / speed, cycle);
+ const done = typed >= clip.query.length - 1;
+ return (
+ <Fill className="px-3 pt-4">
+ <div className="flex h-8 items-center gap-1.5 rounded-[9px] bg-[#F4F4F5] px-2.5 text-caption">
+ <svg viewBox="0 0 24 24" className="size-3.5 shrink-0 text-[#6B7A80]">
+ <circle
+ cx="11"
+ cy="11"
+ r="7"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2.4"
+ />
+ <path
+ d="M20 20l-3.5-3.5"
+ stroke="currentColor"
+ strokeWidth="2.4"
+ strokeLinecap="round"
+ />
+ </svg>
+ <span className="truncate">{clip.query.slice(0, typed + 1)}</span>
+ </div>
+ <div className="mt-2 flex flex-col gap-1.5">
+ {done &&
+ clip.results.map((result, i) => (
+ <motion.span
+ key={`${result}-${cycle}`}
+ className="rounded-[8px] bg-[#FBE8FD] px-2.5 py-2 text-caption"
+ initial={{ opacity: 0, y: 8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.35 / speed,
+ delay: (0.15 + i * 0.12) / speed,
+ ease: EASE_OUT,
+ }}
+ >
+ {result}
+ </motion.span>
+ ))}
+ </div>
+ </Fill>
+ );
+}
+
+export function ClipView(props: ClipProps) {
+ const { clip } = props;
+ switch (clip.kind) {
+ case "shader-title":
+ return <ShaderTitle {...props} clip={clip} />;
+ case "type-title":
+ return <TypeTitle {...props} clip={clip} />;
+ case "karaoke":
+ return <Karaoke {...props} clip={clip} />;
+ case "zoom":
+ return <Zoom {...props} clip={clip} />;
+ case "whip":
+ return <Whip {...props} clip={clip} />;
+ case "glitch":
+ return <Glitch {...props} clip={clip} />;
+ case "terminal":
+ return <Terminal {...props} clip={clip} />;
+ case "rolling":
+ return <Rolling {...props} clip={clip} />;
+ case "logo":
+ return <Logo {...props} clip={clip} />;
+ case "bars":
+ return <Bars {...props} clip={clip} />;
+ case "crt":
+ return <Crt {...props} clip={clip} />;
+ case "cursor":
+ return <Cursor {...props} clip={clip} />;
+ case "checklist":
+ return <Checklist {...props} clip={clip} />;
+ case "line-chart":
+ return <LineChart {...props} clip={clip} />;
+ case "code-morph":
+ return <CodeMorph {...props} clip={clip} />;
+ case "marker":
+ return <Marker {...props} clip={clip} />;
+ case "stars":
+ return <Stars {...props} clip={clip} />;
+ case "decode":
+ return <Decode {...props} clip={clip} />;
+ case "slot":
+ return <Slot {...props} clip={clip} />;
+ case "split-flap":
+ return <SplitFlap {...props} clip={clip} />;
+ case "power-off":
+ return <PowerOff {...props} clip={clip} />;
+ case "keystroke":
+ return <Keystroke {...props} clip={clip} />;
+ case "word-pop":
+ return <WordPop {...props} clip={clip} />;
+ case "search":
+ return <Search {...props} clip={clip} />;
+ }
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/composer-signal.ts b/app/(home)/components/landing/sections/hero/scenes/composer-signal.ts
new file mode 100644
index 00000000..54d1471e
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/composer-signal.ts
@@ -0,0 +1,35 @@
+"use client";
+
+import { useSyncExternalStore } from "react";
+
+type Signal = { scenario: number; composed: number };
+
+let signal: Signal = { scenario: 0, composed: 6 };
+const listeners = new Set<() => void>();
+
+function emit() {
+ for (const listener of listeners) listener();
+}
+
+export function publishScenario(scenario: number) {
+ if (signal.scenario === scenario) return;
+ signal = { ...signal, scenario };
+ emit();
+}
+
+export function publishComposed(composed: number) {
+ if (signal.composed === composed) return;
+ signal = { ...signal, composed };
+ emit();
+}
+
+function subscribe(listener: () => void) {
+ listeners.add(listener);
+ return () => listeners.delete(listener);
+}
+
+const getSnapshot = () => signal;
+
+export function useComposerSignal() {
+ return useSyncExternalStore(subscribe, getSnapshot, getSnapshot);
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/config.ts b/app/(home)/components/landing/sections/hero/scenes/config.ts
new file mode 100644
index 00000000..fc1375c4
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/config.ts
@@ -0,0 +1,95 @@
+import type { ClipSpec } from "../tiles/config";
+import { DEFAULT_LIVE_CLIPS } from "./live-clips";
+
+export const SWAP_TRANSITIONS = [
+ "dither",
+ "whip",
+ "flip",
+ "zoom",
+ "cut",
+] as const;
+export const CONTENT_MODES = ["sync", "static"] as const;
+
+export type SwapTransition = (typeof SWAP_TRANSITIONS)[number];
+export type ContentMode = (typeof CONTENT_MODES)[number];
+
+export const SCENE_SET_OPTIONS = [
+ "live",
+ "catalog",
+ "frames",
+ "effects",
+ "story",
+] as const;
+export type SceneSetOption = (typeof SCENE_SET_OPTIONS)[number];
+
+export type ScenesConfig = {
+ frame: {
+ float: number;
+ floatPeriod: number;
+ floatTilt: number;
+ parallax: number;
+ depthSpread: number;
+ };
+ swap: {
+ set: SceneSetOption;
+ mode: ContentMode;
+ transition: SwapTransition;
+ stagger: number;
+ duration: number;
+ cell: number;
+ band: number;
+ passes: number;
+ dim: number;
+ };
+ play: {
+ speed: number;
+ loopGap: number;
+ };
+ live: ClipSpec[][];
+};
+
+export const DEFAULT_SCENES_CONFIG: ScenesConfig = {
+ frame: {
+ float: 6,
+ floatPeriod: 9,
+ floatTilt: 1,
+ parallax: 14,
+ depthSpread: 0.6,
+ },
+ swap: {
+ set: "live",
+ mode: "sync",
+ transition: "dither",
+ stagger: 140,
+ duration: 900,
+ cell: 3,
+ band: 0.28,
+ passes: 1,
+ dim: 0.25,
+ },
+ play: {
+ speed: 1,
+ loopGap: 1.2,
+ },
+ live: DEFAULT_LIVE_CLIPS,
+};
+
+export const SLOT_DEPTH: Record<number, number> = {
+ 1: 1,
+ 2: 0.55,
+ 3: 0.35,
+ 4: 0.8,
+ 5: 0.65,
+ 6: 0.45,
+};
+
+export const SLOT_ORDER = [1, 2, 3, 4, 5, 6];
+
+export const VIDEO_FRAME: Record<number, { width: number; height: number }> = {
+ 1: { width: 288, height: 162 },
+ 2: { width: 192, height: 192 },
+ 3: { width: 240, height: 135 },
+ 4: { width: 176, height: 176 },
+ 5: { width: 256, height: 144 },
+ 6: { width: 144, height: 256 },
+};
diff --git a/app/(home)/components/landing/sections/hero/scenes/dither-sweep.ts b/app/(home)/components/landing/sections/hero/scenes/dither-sweep.ts
new file mode 100644
index 00000000..6a10ab43
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/dither-sweep.ts
@@ -0,0 +1,127 @@
+function bayer(size: number): number[][] {
+ if (size === 1) return [[0]];
+ const half = bayer(size / 2);
+ const out: number[][] = Array.from({ length: size }, () =>
+ Array(size).fill(0),
+ );
+ for (let y = 0; y < size / 2; y++) {
+ for (let x = 0; x < size / 2; x++) {
+ const v = half[y][x] * 4;
+ out[y][x] = v;
+ out[y][x + size / 2] = v + 2;
+ out[y + size / 2][x] = v + 3;
+ out[y + size / 2][x + size / 2] = v + 1;
+ }
+ }
+ return out;
+}
+
+const MATRIX = bayer(8);
+const LEVELS = 64;
+
+const ANGLE = (115 * Math.PI) / 180;
+const DIR_X = Math.sin(ANGLE);
+const DIR_Y = -Math.cos(ANGLE);
+
+export type SweepOptions = {
+ canvas: HTMLCanvasElement;
+ layer: HTMLElement;
+ width: number;
+ height: number;
+ cell: number;
+ band: number;
+ passes: number;
+ duration: number;
+ color: string;
+ onDone: () => void;
+};
+
+function project(x: number, y: number, width: number, height: number) {
+ const corners = [
+ [0, 0],
+ [width, 0],
+ [0, height],
+ [width, height],
+ ].map(([cx, cy]) => cx * DIR_X + cy * DIR_Y);
+ const min = Math.min(...corners);
+ const max = Math.max(...corners);
+ return (x * DIR_X + y * DIR_Y - min) / (max - min);
+}
+
+function easeInOut(t: number) {
+ return t < 0.5 ? 4 * t * t * t : 1 - (-2 * t + 2) ** 3 / 2;
+}
+
+export function runDitherSweep(options: SweepOptions) {
+ const {
+ canvas,
+ layer,
+ width,
+ height,
+ cell,
+ band,
+ passes,
+ duration,
+ color,
+ onDone,
+ } = options;
+ const ratio = window.devicePixelRatio || 1;
+ canvas.width = width * ratio;
+ canvas.height = height * ratio;
+ const context = canvas.getContext("2d");
+ if (!context) {
+ onDone();
+ return () => {};
+ }
+ context.scale(ratio, ratio);
+ const cols = Math.ceil(width / cell);
+ const rows = Math.ceil(height / cell);
+ const positions: number[] = [];
+ for (let row = 0; row < rows; row++) {
+ for (let col = 0; col < cols; col++) {
+ positions.push(
+ project((col + 0.5) * cell, (row + 0.5) * cell, width, height),
+ );
+ }
+ }
+ const dot = Math.max(1, cell - 1);
+ const total = duration * (passes + 1);
+ const start = performance.now();
+ let frame = 0;
+
+ const draw = (now: number) => {
+ const elapsed = Math.min((now - start) / total, 1);
+ const pass = Math.min(Math.floor(elapsed * (passes + 1)), passes);
+ const local = easeInOut(elapsed * (passes + 1) - pass);
+ const reveal = pass === passes;
+ const edge = -band + local * (1 + 2 * band);
+
+ context.clearRect(0, 0, width, height);
+ context.fillStyle = color;
+ for (let row = 0; row < rows; row++) {
+ for (let col = 0; col < cols; col++) {
+ const u = positions[row * cols + col];
+ const distance = Math.abs(u - edge) / band;
+ if (distance >= 1) continue;
+ const density = (1 - distance) ** 1.6;
+ if (MATRIX[row % 8][col % 8] < density * LEVELS) {
+ context.fillRect(col * cell, row * cell, dot, dot);
+ }
+ }
+ }
+
+ const cut = reveal ? edge * 100 : -100;
+ const mask = `linear-gradient(${115}deg, #000 ${cut - 0.5}%, transparent ${cut + 0.5}%)`;
+ layer.style.maskImage = elapsed >= 1 ? "" : mask;
+ layer.style.webkitMaskImage = elapsed >= 1 ? "" : mask;
+
+ if (elapsed < 1) {
+ frame = requestAnimationFrame(draw);
+ } else {
+ context.clearRect(0, 0, width, height);
+ onDone();
+ }
+ };
+ frame = requestAnimationFrame(draw);
+ return () => cancelAnimationFrame(frame);
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/hero-scene-field.tsx b/app/(home)/components/landing/sections/hero/scenes/hero-scene-field.tsx
new file mode 100644
index 00000000..6d6f377e
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/hero-scene-field.tsx
@@ -0,0 +1,14 @@
+"use client";
+
+import type { ScenesConfig } from "./config";
+import saved from "./hero-scenes.json";
+import { DEFAULT_LIVE_CLIPS } from "./live-clips";
+import { SceneField } from "./scene-field";
+import { liveSet } from "./sets/live";
+
+const config = saved as ScenesConfig;
+const set = liveSet(config.live ?? DEFAULT_LIVE_CLIPS);
+
+export function HeroSceneField() {
+ return <SceneField config={config} set={set} />;
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/hero-scenes.json b/app/(home)/components/landing/sections/hero/scenes/hero-scenes.json
new file mode 100644
index 00000000..23d65bec
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/hero-scenes.json
@@ -0,0 +1,285 @@
+{
+ "frame": {
+ "float": 10,
+ "floatPeriod": 9,
+ "floatTilt": 1,
+ "parallax": 29,
+ "depthSpread": 0.15
+ },
+ "swap": {
+ "set": "live",
+ "mode": "sync",
+ "transition": "cut",
+ "stagger": 140,
+ "duration": 900,
+ "cell": 3,
+ "band": 0.28,
+ "passes": 1,
+ "dim": 0.25
+ },
+ "play": {
+ "speed": 1,
+ "loopGap": 1.2
+ },
+ "live": [
+ [
+ {
+ "name": "shader-dithering",
+ "start": 0,
+ "zoom": 1,
+ "end": "run",
+ "background": "#0E1012",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "caption-cube",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#262626",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "check-list",
+ "start": 0,
+ "zoom": 1.4,
+ "end": "hold",
+ "background": "#f1eee7",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "chromatic-wave",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#0E1012",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "kinetic-center-build",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "echo-stack",
+ "start": 0,
+ "zoom": 0.75,
+ "end": "hold",
+ "background": "#0a0a0a",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ }
+ ],
+ [
+ {
+ "name": "shader-text-reveal",
+ "start": 0,
+ "zoom": 1,
+ "end": "run",
+ "background": "#000000",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "shader-caustics",
+ "start": 0,
+ "zoom": 1,
+ "end": "run",
+ "background": "#0E1012",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "terminal-simulator",
+ "start": 0,
+ "zoom": 1.35,
+ "end": "hold",
+ "background": "#050505",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "perspective-marquee",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#050505",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "whip-pan",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#141318",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "github-stars",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#F4F4F5",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {
+ "orientation": "vertical"
+ }
+ }
+ ],
+ [
+ {
+ "name": "shader-grain-gradient",
+ "start": 0,
+ "zoom": 1,
+ "end": "run",
+ "background": "#12020F",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {
+ "colors": ["#A800B7", "#F472B6", "#3B0764"],
+ "colorBack": "#12020F",
+ "intensity": 0.35,
+ "noise": 0.25
+ }
+ },
+ {
+ "name": "matrix-decode",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#0E1012",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "page-turn",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#f1eee7",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "speed-lines",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#002fa7",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "stripe-type",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#2b3bff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "kinetic-warp",
+ "start": 0,
+ "zoom": 0.5,
+ "end": "hold",
+ "background": "#0E1012",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ }
+ ],
+ [
+ {
+ "name": "shader-mesh-gradient",
+ "start": 0,
+ "zoom": 1,
+ "end": "run",
+ "background": "#3B0764",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {
+ "colors": ["#A800B7", "#F5D0FE", "#3B0764", "#E879F9"],
+ "distortion": 0.8,
+ "swirl": 0.3
+ }
+ },
+ {
+ "name": "bauhaus-build",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#f1eee7",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "caption-drop",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#262626",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "word-stream",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "caption-word-pop",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#262626",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "centered-word-build",
+ "start": 0,
+ "zoom": 0.65,
+ "end": "loop",
+ "background": "radial-gradient(circle at 50% 108%, #ffd77a 0%, #ff6840 31%, #f13d21 78%)",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ }
+ ]
+ ]
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/live-clips.ts b/app/(home)/components/landing/sections/hero/scenes/live-clips.ts
new file mode 100644
index 00000000..9a3da679
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/live-clips.ts
@@ -0,0 +1,113 @@
+import type { ClipSpec } from "../tiles/config";
+
+function clip(
+ name: string,
+ background: string,
+ options: Partial<ClipSpec> = {},
+): ClipSpec {
+ return {
+ name,
+ start: 0,
+ zoom: 1,
+ end: "hold",
+ background,
+ radius: 0.25,
+ cut: "auto",
+ props: {},
+ ...options,
+ };
+}
+
+const FUCHSIA = ["#A800B7", "#F472B6", "#3B0764"];
+
+export const DEFAULT_LIVE_CLIPS: ClipSpec[][] = [
+ [
+ clip("shader-liquid-metal", "#2E0727", {
+ end: "run",
+ props: {
+ colorBack: "#2E0727",
+ colorTint: "#FF5FD9",
+ repetition: 2,
+ distortion: 0.18,
+ speed: 0.7,
+ },
+ }),
+ clip("soft-blur-in", "#FFFFFF", {
+ props: { text: "Acme", fontSize: 220, color: "#0E1012" },
+ }),
+ clip("zoom-blur", "#141318"),
+ clip("icon-sparkles", "#FDF4FF", {
+ zoom: 0.62,
+ end: "loop",
+ props: { color: "#A800B7", strokeWidth: 1.8 },
+ }),
+ clip("caption-karaoke", "#262626"),
+ clip("logo-enter", "#FFFFFF"),
+ ],
+ [
+ clip("animated-bar-chart", "#0A0A0A", { props: { barColor: "#C026D3" } }),
+ clip("rolling-number", "#FFFFFF", {
+ props: { to: 2418, fontSize: 210, color: "#0E1012" },
+ }),
+ clip("terminal-simulator", "#050505"),
+ clip("icon-check", "#ECFDF3", {
+ zoom: 0.62,
+ end: "loop",
+ props: { color: "#16A34A", strokeWidth: 2 },
+ }),
+ clip("whip-pan", "#141318"),
+ clip("github-stars", "#F4F4F5", { props: { orientation: "vertical" } }),
+ ],
+ [
+ clip("shader-grain-gradient", "#12020F", {
+ end: "run",
+ props: {
+ colors: FUCHSIA,
+ colorBack: "#12020F",
+ intensity: 0.35,
+ noise: 0.25,
+ },
+ }),
+ clip("slot-machine-roll", "#0E1012", {
+ props: { from: "10.23", to: "10.24", color: "#FFFFFF", fontSize: 190 },
+ }),
+ clip("rgb-glitch-text", "#0B0D0C", {
+ props: { text: "PULSE", color: "#FFFFFF", fontSize: 170 },
+ }),
+ clip("icon-bell", "#0E1012", {
+ zoom: 0.62,
+ end: "loop",
+ props: { color: "#F0ABFC", strokeWidth: 2 },
+ }),
+ clip("caption-split-flap", "#262626"),
+ clip("matrix-decode", "#07110B", {
+ props: { text: "BETA", fontSize: 150 },
+ }),
+ ],
+ [
+ clip("shader-mesh-gradient", "#3B0764", {
+ end: "run",
+ props: {
+ colors: ["#A800B7", "#F5D0FE", "#3B0764", "#E879F9"],
+ distortion: 0.8,
+ swirl: 0.3,
+ },
+ }),
+ clip("typewriter", "#FFFFFF", {
+ props: {
+ text: "notes",
+ fontSize: 180,
+ color: "#0E1012",
+ cursorColor: "#A800B7",
+ },
+ }),
+ clip("check-list", "#F1EEE7"),
+ clip("icon-heart", "#FFF1F2", {
+ zoom: 0.62,
+ end: "loop",
+ props: { color: "#E11D48", strokeWidth: 2 },
+ }),
+ clip("caption-word-pop", "#262626"),
+ clip("keystroke", "#E9E9E5"),
+ ],
+];
diff --git a/app/(home)/components/landing/sections/hero/scenes/scenario-scenes.ts b/app/(home)/components/landing/sections/hero/scenes/scenario-scenes.ts
new file mode 100644
index 00000000..2a7c1f27
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/scenario-scenes.ts
@@ -0,0 +1,133 @@
+export type Clip =
+ | { kind: "shader-title"; image: string; title: string }
+ | { kind: "type-title"; image: string; title: string }
+ | { kind: "karaoke"; words: string[] }
+ | { kind: "zoom"; frames: [string, string] }
+ | { kind: "whip"; frames: [string, string] }
+ | { kind: "glitch"; text: string }
+ | { kind: "terminal"; command: string; result: string }
+ | { kind: "rolling"; to: number }
+ | { kind: "logo"; name: string; image: string }
+ | { kind: "bars"; label: string; values: number[] }
+ | { kind: "crt"; text: string }
+ | { kind: "cursor"; label: string }
+ | { kind: "checklist"; items: string[] }
+ | { kind: "line-chart"; label: string; delta: string }
+ | { kind: "code-morph"; key: string; from: string; to: string }
+ | { kind: "marker"; words: string[]; marked: number }
+ | { kind: "stars"; count: string }
+ | { kind: "decode"; text: string }
+ | { kind: "slot"; digits: string }
+ | { kind: "split-flap"; text: string }
+ | { kind: "power-off"; name: string }
+ | { kind: "keystroke"; keys: string[]; label: string }
+ | { kind: "word-pop"; words: string[] }
+ | { kind: "search"; query: string; results: string[] };
+
+export type SceneEntry = { block: string; clip: Clip };
+
+const VIOLET = "/landing/shader-violet.png";
+const MAGENTA = "/landing/shader-magenta.png";
+
+export const SCENARIO_SCENES: Record<number, SceneEntry>[] = [
+ {
+ 1: {
+ block: "shader-liquid-metal",
+ clip: {
+ kind: "shader-title",
+ image: VIOLET,
+ title: "Ship it on Tuesday.",
+ },
+ },
+ 2: { block: "zoom-blur", clip: { kind: "zoom", frames: ["Acme", "2.0"] } },
+ 3: {
+ block: "terminal-simulator",
+ clip: {
+ kind: "terminal",
+ command: "acme deploy --prod",
+ result: "live at acme.dev",
+ },
+ },
+ 4: { block: "rolling-number", clip: { kind: "rolling", to: 2418 } },
+ 5: {
+ block: "caption-karaoke",
+ clip: { kind: "karaoke", words: ["one", "prompt,", "one", "afternoon"] },
+ },
+ 6: {
+ block: "logo-enter",
+ clip: { kind: "logo", name: "acme", image: MAGENTA },
+ },
+ },
+ {
+ 1: {
+ block: "animated-line-chart",
+ clip: { kind: "line-chart", label: "Weekly active", delta: "+38%" },
+ },
+ 2: {
+ block: "whip-pan",
+ clip: { kind: "whip", frames: ["Faster", "Lighter"] },
+ },
+ 3: {
+ block: "code-morph",
+ clip: { kind: "code-morph", key: "version", from: "2.3.0", to: "2.4.0" },
+ },
+ 4: {
+ block: "animated-bar-chart",
+ clip: {
+ kind: "bars",
+ label: "Changes shipped",
+ values: [4, 7, 5, 9, 12],
+ },
+ },
+ 5: {
+ block: "caption-marker",
+ clip: {
+ kind: "marker",
+ words: ["twelve", "fixes,", "zero", "downtime"],
+ marked: 2,
+ },
+ },
+ 6: { block: "github-stars", clip: { kind: "stars", count: "1.6k" } },
+ },
+ {
+ 1: { block: "crt-screen", clip: { kind: "crt", text: "PULSE" } },
+ 2: { block: "glitch-cut", clip: { kind: "glitch", text: "BETA" } },
+ 3: {
+ block: "matrix-decode",
+ clip: { kind: "decode", text: "INVITES OPEN" },
+ },
+ 4: { block: "slot-machine-roll", clip: { kind: "slot", digits: "1024" } },
+ 5: {
+ block: "caption-split-flap",
+ clip: { kind: "split-flap", text: "FALL" },
+ },
+ 6: { block: "tv-power-off", clip: { kind: "power-off", name: "pulse" } },
+ },
+ {
+ 1: {
+ block: "typewriter",
+ clip: { kind: "type-title", image: MAGENTA, title: "Notes, but fast." },
+ },
+ 2: { block: "simulated-cursor", clip: { kind: "cursor", label: "Save" } },
+ 3: {
+ block: "check-list",
+ clip: { kind: "checklist", items: ["Capture", "Sync", "Share"] },
+ },
+ 4: {
+ block: "keystroke",
+ clip: { kind: "keystroke", keys: ["⌘", "N"], label: "New note" },
+ },
+ 5: {
+ block: "caption-word-pop",
+ clip: { kind: "word-pop", words: ["write", "it", "down,", "ship", "it"] },
+ },
+ 6: {
+ block: "search-reveal",
+ clip: {
+ kind: "search",
+ query: "standup",
+ results: ["Standup, Mon", "Standup, Tue"],
+ },
+ },
+ },
+];
diff --git a/app/(home)/components/landing/sections/hero/scenes/scene-field.tsx b/app/(home)/components/landing/sections/hero/scenes/scene-field.tsx
new file mode 100644
index 00000000..e1ca8dbc
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/scene-field.tsx
@@ -0,0 +1,405 @@
+"use client";
+
+import {
+ AnimatePresence,
+ type MotionValue,
+ motion,
+ useReducedMotion,
+ useSpring,
+ useTransform,
+} from "motion/react";
+import { type Ref, useCallback, useEffect, useRef, useState } from "react";
+import { cn } from "@/lib/utils";
+import { SCENES, type Scene } from "../floating-scene";
+import { publishComposed, useComposerSignal } from "./composer-signal";
+import {
+ type ScenesConfig,
+ SLOT_DEPTH,
+ SLOT_ORDER,
+ type SwapTransition,
+ VIDEO_FRAME,
+} from "./config";
+import { runDitherSweep } from "./dither-sweep";
+import type { SceneSet } from "./sets/types";
+
+const SWAP_EASE = [0.7, 0, 0.2, 1] as const;
+
+function swapVariants(transition: Exclude<SwapTransition, "dither">) {
+ switch (transition) {
+ case "whip":
+ return {
+ initial: { x: "105%", filter: "blur(8px)" },
+ animate: { x: "0%", filter: "blur(0px)" },
+ exit: { x: "-105%", filter: "blur(8px)" },
+ };
+ case "zoom":
+ return {
+ initial: { scale: 0.86, opacity: 0, filter: "blur(10px)" },
+ animate: { scale: 1, opacity: 1, filter: "blur(0px)" },
+ exit: { scale: 1.14, opacity: 0, filter: "blur(10px)" },
+ };
+ case "flip":
+ return {
+ initial: { rotateY: -90 },
+ animate: { rotateY: 0 },
+ exit: { rotateY: 90 },
+ };
+ case "cut":
+ return { initial: {}, animate: {}, exit: {} };
+ }
+}
+
+const HIDDEN_MASK = {
+ maskImage: "linear-gradient(#0000, #0000)",
+ WebkitMaskImage: "linear-gradient(#0000, #0000)",
+};
+
+/**
+ * `shown` is on top (masked while the dither sweep hasn't revealed it yet),
+ * `previous` stays under it until the sweep ends, `standby` is mounted ahead of
+ * its turn but hidden and paused.
+ */
+type LayerRole = "shown" | "previous" | "standby";
+
+const LAYER_Z: Record<LayerRole, number> = {
+ shown: 2,
+ previous: 1,
+ standby: 0,
+};
+
+function SceneLayer({
+ set,
+ scenario,
+ slot,
+ cycle,
+ speed,
+ layerRef,
+ role = "shown",
+ hidden,
+}: {
+ set: SceneSet;
+ scenario: number;
+ slot: number;
+ cycle: number;
+ speed: number;
+ layerRef?: Ref<HTMLDivElement>;
+ role?: LayerRole;
+ hidden?: boolean;
+}) {
+ const scene = set[scenario][slot];
+ return (
+ <div
+ ref={layerRef}
+ className={cn("absolute inset-0", scene.surface)}
+ style={{
+ zIndex: LAYER_Z[role],
+ visibility: role === "standby" ? "hidden" : undefined,
+ ...(hidden ? HIDDEN_MASK : undefined),
+ }}
+ >
+ {scene.render({ cycle, speed }, role !== "standby")}
+ </div>
+ );
+}
+
+const whenIdle = (run: () => void) => {
+ if ("requestIdleCallback" in window) {
+ const id = window.requestIdleCallback(run, { timeout: 3000 });
+ return () => window.cancelIdleCallback(id);
+ }
+ const id = setTimeout(run, 500);
+ return () => clearTimeout(id);
+};
+
+function SceneCard({
+ slot,
+ order,
+ scenario,
+ config,
+ set,
+ active,
+ pointerX,
+ pointerY,
+ onComposed,
+}: {
+ slot: Scene;
+ order: number;
+ scenario: number;
+ config: ScenesConfig;
+ set: SceneSet;
+ active: boolean;
+ pointerX: MotionValue<number>;
+ pointerY: MotionValue<number>;
+ onComposed: (order: number) => void;
+}) {
+ const reduced = useReducedMotion() ?? false;
+ const depth = 1 - (1 - SLOT_DEPTH[slot.index]) * config.frame.depthSpread;
+ const parallaxX = useTransform(
+ pointerX,
+ (v) => v * config.frame.parallax * depth,
+ );
+ const parallaxY = useTransform(
+ pointerY,
+ (v) => v * config.frame.parallax * depth * 0.6,
+ );
+ const target = config.swap.mode === "sync" ? scenario : 0;
+ const [shown, setShown] = useState(target);
+ const [previous, setPrevious] = useState<number | null>(null);
+ // Scenarios whose layer is mounted. Each one stays mounted once it's in:
+ // remounting a live scene on every swap meant rebuilding its players and
+ // recompiling shader programs, a multi-frame freeze each time.
+ const [warm, setWarm] = useState<number[]>(() => [target]);
+ const [cycle, setCycle] = useState(0);
+ const [previousCycle, setPreviousCycle] = useState(0);
+ const cycleRef = useRef(0);
+ cycleRef.current = cycle;
+ const cardRef = useRef<HTMLDivElement>(null);
+ const [visible, setVisible] = useState(true);
+ const canvasRef = useRef<HTMLCanvasElement>(null);
+ const incomingRef = useRef<HTMLDivElement>(null);
+ const { top, left, right, rotate } = slot.float;
+ const { width, height } = VIDEO_FRAME[slot.index] ?? slot.float;
+ const { duration, stagger, transition, cell, band, passes } = config.swap;
+ const { speed, loopGap } = config.play;
+ const dither = transition === "dither" && !reduced;
+ const scene = set[shown][slot.index];
+ const dotTone = scene.dark ? "#F0ABFC" : "#A800B7";
+
+ useEffect(() => {
+ if (target === shown) return;
+ const swap = setTimeout(() => {
+ setWarm((list) => (list.includes(target) ? list : [...list, target]));
+ setPrevious(shown);
+ setPreviousCycle(cycleRef.current);
+ setShown(target);
+ setCycle(0);
+ }, order * stagger);
+ return () => clearTimeout(swap);
+ }, [target, shown, order, stagger]);
+
+ useEffect(() => {
+ if (previous === null) return;
+ const finish = () => {
+ setPrevious(null);
+ onComposed(order);
+ };
+ if (!dither) {
+ const done = setTimeout(finish, 500);
+ return () => clearTimeout(done);
+ }
+ const canvas = canvasRef.current;
+ const layer = incomingRef.current;
+ if (!canvas || !layer) {
+ finish();
+ return;
+ }
+ return runDitherSweep({
+ canvas,
+ layer,
+ width,
+ height,
+ cell,
+ band,
+ passes,
+ duration,
+ color: dotTone,
+ onDone: finish,
+ });
+ }, [
+ previous,
+ dither,
+ width,
+ height,
+ cell,
+ band,
+ passes,
+ duration,
+ dotTone,
+ order,
+ onComposed,
+ ]);
+
+ // Mount the next scenario's layer while idle, ahead of its swap.
+ const upcoming = (shown + 1) % set.length;
+ const needsWarm = dither && previous === null && !warm.includes(upcoming);
+ useEffect(() => {
+ if (!needsWarm) return;
+ return whenIdle(() =>
+ setWarm((list) => (list.includes(upcoming) ? list : [...list, upcoming])),
+ );
+ }, [needsWarm, upcoming]);
+
+ useEffect(() => {
+ const node = cardRef.current;
+ if (!node) return;
+ const observer = new IntersectionObserver(([e]) =>
+ setVisible(e.isIntersecting),
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ useEffect(() => {
+ if (reduced || !visible) return;
+ const period = (scene.duration / speed + loopGap) * 1000;
+ const id = setInterval(() => setCycle((c) => c + 1), period);
+ return () => clearInterval(id);
+ }, [reduced, visible, scene, speed, loopGap]);
+
+ const swapping = previous !== null;
+ return (
+ <div
+ ref={cardRef}
+ aria-hidden="true"
+ className="absolute hidden origin-top-left xl:block"
+ style={{ top, left, right, width, height, rotate: `${rotate}deg` }}
+ >
+ <motion.div
+ className="size-full"
+ style={reduced ? undefined : { x: parallaxX, y: parallaxY }}
+ >
+ <div
+ data-loop
+ className="size-full"
+ style={
+ reduced || config.frame.float === 0
+ ? undefined
+ : {
+ ["--float-amp" as string]: `${config.frame.float * depth}px`,
+ ["--float-tilt" as string]: `${config.frame.floatTilt}deg`,
+ // Periods differ per card so the field never moves in step.
+ animation: `scene-float ${config.frame.floatPeriod * (1 + (order % 3) * 0.13)}s ease-in-out infinite`,
+ animationDelay: `-${(order / SLOT_ORDER.length) * config.frame.floatPeriod}s`,
+ }
+ }
+ >
+ <motion.div
+ animate={{ opacity: active ? 1 : 1 - config.swap.dim }}
+ transition={{ duration: 0.4, ease: "easeOut" }}
+ className="relative size-full overflow-hidden rounded-[10px] shadow-[0_0_0_1px_#0E10120A,0_14px_28px_-8px_#0E10121F,0_32px_64px_-24px_#0E101229] [perspective:800px]"
+ >
+ {dither || reduced ? (
+ <>
+ {(dither ? warm : [shown]).map((layerScenario) => {
+ const role: LayerRole =
+ layerScenario === shown
+ ? "shown"
+ : layerScenario === previous
+ ? "previous"
+ : "standby";
+ return (
+ <SceneLayer
+ key={`${config.swap.set}-${layerScenario}`}
+ set={set}
+ scenario={layerScenario}
+ slot={slot.index}
+ cycle={role === "previous" ? previousCycle : cycle}
+ speed={speed}
+ role={role}
+ layerRef={role === "shown" ? incomingRef : undefined}
+ hidden={swapping && role === "shown" && dither}
+ />
+ );
+ })}
+ <canvas
+ ref={canvasRef}
+ className="pointer-events-none absolute inset-0 z-[3] size-full"
+ />
+ </>
+ ) : (
+ <AnimatePresence
+ initial={false}
+ mode={transition === "flip" ? "wait" : "sync"}
+ >
+ <motion.div
+ key={shown}
+ {...swapVariants(
+ transition === "dither" ? "cut" : transition,
+ )}
+ transition={{
+ duration: transition === "flip" ? 0.28 : 0.5,
+ ease: SWAP_EASE,
+ }}
+ className="absolute inset-0"
+ >
+ <SceneLayer
+ set={set}
+ scenario={shown}
+ slot={slot.index}
+ cycle={cycle}
+ speed={speed}
+ />
+ </motion.div>
+ </AnimatePresence>
+ )}
+ </motion.div>
+ </div>
+ </motion.div>
+ </div>
+ );
+}
+
+export function SceneField({
+ config,
+ set,
+ pinned,
+}: {
+ config: ScenesConfig;
+ set: SceneSet;
+ pinned?: number;
+}) {
+ const signal = useComposerSignal();
+ const scenario = pinned ?? signal.scenario;
+ const [activeOrder, setActiveOrder] = useState(SLOT_ORDER.length - 1);
+ const rawX = useSpringPointer();
+
+ const firstScenario = useRef(scenario);
+ useEffect(() => {
+ if (config.swap.mode !== "sync") return;
+ if (scenario === firstScenario.current) return;
+ firstScenario.current = -1;
+ publishComposed(0);
+ }, [scenario, config.swap.mode]);
+
+ const onComposed = useCallback((order: number) => {
+ setActiveOrder(order);
+ publishComposed(order + 1);
+ }, []);
+
+ return (
+ <>
+ {SCENES.map((slot) => {
+ const order = SLOT_ORDER.indexOf(slot.index);
+ return (
+ <SceneCard
+ key={slot.index}
+ slot={slot}
+ order={order}
+ scenario={scenario}
+ config={config}
+ set={set}
+ active={config.swap.mode !== "sync" || order === activeOrder}
+ pointerX={rawX.x}
+ pointerY={rawX.y}
+ onComposed={onComposed}
+ />
+ );
+ })}
+ </>
+ );
+}
+
+function useSpringPointer() {
+ const x = useSpring(0, { stiffness: 60, damping: 18, mass: 0.8 });
+ const y = useSpring(0, { stiffness: 60, damping: 18, mass: 0.8 });
+ useEffect(() => {
+ const onMove = (event: PointerEvent) => {
+ if (event.pointerType === "touch") return;
+ x.set((event.clientX / window.innerWidth) * 2 - 1);
+ y.set((event.clientY / window.innerHeight) * 2 - 1);
+ };
+ window.addEventListener("pointermove", onMove);
+ return () => window.removeEventListener("pointermove", onMove);
+ }, [x, y]);
+ return { x, y };
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/effects.tsx b/app/(home)/components/landing/sections/hero/scenes/sets/effects.tsx
new file mode 100644
index 00000000..63fc7df8
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/effects.tsx
@@ -0,0 +1,374 @@
+"use client";
+
+import { motion } from "motion/react";
+import { EASE_IN_OUT, EASE_OUT, Frame, Letters } from "./kit";
+import type { SceneDef, SceneProps, SceneSet } from "./types";
+
+type Effect =
+ | "blur"
+ | "glitch"
+ | "halftone"
+ | "extrude"
+ | "outline"
+ | "wave"
+ | "echo"
+ | "stretch"
+ | "tracking"
+ | "rolodex"
+ | "sheen"
+ | "focus"
+ | "squeeze";
+
+type Material = {
+ word: string;
+ surface: string;
+ ink: string;
+ accent: string;
+ dark: boolean;
+};
+
+const MATERIALS: Material[] = [
+ {
+ word: "Acme",
+ surface: "bg-[#0E1012]",
+ ink: "#FFFFFF",
+ accent: "#F0ABFC",
+ dark: true,
+ },
+ {
+ word: "Ledger",
+ surface: "bg-white",
+ ink: "#0E1012",
+ accent: "#A800B7",
+ dark: false,
+ },
+ {
+ word: "Pulse",
+ surface: "bg-black",
+ ink: "#FFFFFF",
+ accent: "#22C55E",
+ dark: true,
+ },
+ {
+ word: "Notes",
+ surface: "bg-[#FBE8FD]",
+ ink: "#0E1012",
+ accent: "#A800B7",
+ dark: false,
+ },
+];
+
+const BLOCK: Record<Effect, string> = {
+ blur: "soft-blur-in",
+ glitch: "rgb-glitch-text",
+ halftone: "halftone-print",
+ extrude: "extrude-pop",
+ outline: "outline-trace",
+ wave: "chromatic-wave",
+ echo: "echo-stack",
+ stretch: "stretch-in",
+ tracking: "tracking-in",
+ rolodex: "rolodex-flip",
+ sheen: "sheen-slide-in",
+ focus: "focus-blur-resolve",
+ squeeze: "squeeze-in",
+};
+
+const WORD = "text-[46px] font-semibold tracking-[-0.05em] leading-none";
+
+function EffectWord({
+ cycle,
+ speed,
+ effect,
+ material,
+}: SceneProps & { effect: Effect; material: Material }) {
+ const { word, ink, accent } = material;
+ const d = (s: number) => s / speed;
+ const color = { color: ink };
+
+ const body = (() => {
+ switch (effect) {
+ case "blur":
+ return (
+ <Letters
+ text={word}
+ cycle={cycle}
+ speed={speed}
+ className={WORD}
+ initial={{ opacity: 0, filter: "blur(12px)" }}
+ animate={{ opacity: 1, filter: "blur(0px)" }}
+ stagger={0.06}
+ />
+ );
+ case "glitch":
+ return (
+ <span key={cycle} className={`relative ${WORD}`}>
+ {[accent, "#38BDF8"].map((tint, i) => (
+ <motion.span
+ key={tint}
+ className="absolute inset-0 mix-blend-screen"
+ style={{ color: tint }}
+ animate={{
+ x: [0, 0, i ? 5 : -5, i ? -3 : 3, 0, 0],
+ opacity: [0, 0, 1, 1, 0, 0],
+ }}
+ transition={{
+ duration: d(1.2),
+ times: [0, 0.3, 0.35, 0.42, 0.48, 1],
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ <span className="relative" style={color}>
+ {word}
+ </span>
+ </span>
+ );
+ case "halftone":
+ return (
+ <motion.span
+ key={cycle}
+ className={WORD}
+ style={{
+ color: "transparent",
+ backgroundImage: `radial-gradient(circle, ${ink} 45%, transparent 47%)`,
+ backgroundClip: "text",
+ WebkitBackgroundClip: "text",
+ }}
+ initial={{ backgroundSize: "2px 2px" }}
+ animate={{ backgroundSize: ["2px 2px", "9px 9px", "5px 5px"] }}
+ transition={{ duration: d(1.4), ease: EASE_IN_OUT }}
+ >
+ {word}
+ </motion.span>
+ );
+ case "extrude":
+ return (
+ <motion.span
+ key={cycle}
+ className={WORD}
+ style={color}
+ initial={{ textShadow: `0 0 0 ${accent}`, y: 0 }}
+ animate={{
+ textShadow: [
+ `0 0 0 ${accent}`,
+ `4px 4px 0 ${accent}, 8px 8px 0 ${accent}55`,
+ ],
+ y: [0, -4],
+ }}
+ transition={{
+ type: "spring",
+ visualDuration: d(0.5),
+ bounce: 0.4,
+ delay: d(0.2),
+ }}
+ >
+ {word}
+ </motion.span>
+ );
+ case "outline":
+ return (
+ <motion.span
+ key={cycle}
+ className={WORD}
+ style={{ WebkitTextStroke: `1.5px ${ink}` }}
+ initial={{ color: "rgba(0,0,0,0)" }}
+ animate={{ color: ["rgba(0,0,0,0)", "rgba(0,0,0,0)", ink] }}
+ transition={{
+ duration: d(1.4),
+ times: [0, 0.55, 1],
+ ease: EASE_OUT,
+ }}
+ >
+ {word}
+ </motion.span>
+ );
+ case "wave":
+ return (
+ <span className={`inline-flex ${WORD}`}>
+ {word.split("").map((char, i) => (
+ <motion.span
+ key={`${char}-${i}`}
+ animate={{ y: [0, -10, 0], color: [ink, accent, ink] }}
+ transition={{
+ duration: d(1),
+ delay: d(i * 0.08),
+ repeat: Infinity,
+ repeatDelay: d(0.6),
+ ease: "easeInOut",
+ }}
+ >
+ {char}
+ </motion.span>
+ ))}
+ </span>
+ );
+ case "echo":
+ return (
+ <span key={cycle} className={`relative ${WORD}`}>
+ {[3, 2, 1].map((n) => (
+ <motion.span
+ key={n}
+ className="absolute inset-0"
+ style={{ color: accent }}
+ initial={{ y: 0, opacity: 0 }}
+ animate={{ y: -n * 9, opacity: 0.18 * (4 - n) }}
+ transition={{
+ duration: d(0.6),
+ ease: EASE_OUT,
+ delay: d(0.2 + n * 0.05),
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ <span className="relative" style={color}>
+ {word}
+ </span>
+ </span>
+ );
+ case "stretch":
+ return (
+ <motion.span
+ key={cycle}
+ className={`inline-block ${WORD}`}
+ style={color}
+ initial={{ scaleX: 0.15, scaleY: 1.6, opacity: 0 }}
+ animate={{ scaleX: 1, scaleY: 1, opacity: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: d(0.55),
+ bounce: 0.3,
+ delay: d(0.15),
+ }}
+ >
+ {word}
+ </motion.span>
+ );
+ case "tracking":
+ return (
+ <motion.span
+ key={cycle}
+ className={WORD}
+ style={color}
+ initial={{ letterSpacing: "0.5em", opacity: 0 }}
+ animate={{ letterSpacing: "-0.05em", opacity: 1 }}
+ transition={{ duration: d(0.9), ease: EASE_OUT, delay: d(0.1) }}
+ >
+ {word}
+ </motion.span>
+ );
+ case "rolodex":
+ return (
+ <span className="[perspective:300px]">
+ <Letters
+ text={word}
+ cycle={cycle}
+ speed={speed}
+ className={WORD}
+ letterClassName="[transform-origin:50%_50%_-16px]"
+ initial={{ rotateX: -90, opacity: 0 }}
+ animate={{ rotateX: 0, opacity: 1 }}
+ stagger={0.07}
+ />
+ </span>
+ );
+ case "sheen":
+ return (
+ <span
+ key={cycle}
+ className={`relative inline-block overflow-hidden ${WORD}`}
+ >
+ <motion.span
+ className="relative inline-block"
+ style={color}
+ initial={{ x: -24, opacity: 0 }}
+ animate={{ x: 0, opacity: 1 }}
+ transition={{ duration: d(0.5), ease: EASE_OUT, delay: d(0.1) }}
+ >
+ {word}
+ </motion.span>
+ <motion.span
+ className="absolute inset-y-0 w-6 -skew-x-12"
+ style={{
+ backgroundColor: accent,
+ mixBlendMode: material.dark ? "screen" : "multiply",
+ opacity: 0.6,
+ }}
+ initial={{ left: "-20%" }}
+ animate={{ left: "120%" }}
+ transition={{
+ duration: d(0.7),
+ ease: EASE_IN_OUT,
+ delay: d(0.6),
+ }}
+ />
+ </span>
+ );
+ case "focus":
+ return (
+ <span className={`inline-flex ${WORD}`} style={color}>
+ {word.split("").map((char, i) => (
+ <motion.span
+ key={`${char}-${i}-${cycle}`}
+ initial={{ filter: "blur(10px)", opacity: 0.3 }}
+ animate={{ filter: "blur(0px)", opacity: 1 }}
+ transition={{
+ duration: d(0.5),
+ ease: EASE_OUT,
+ delay: d(0.1 + ((i * 37) % 5) * 0.12),
+ }}
+ >
+ {char}
+ </motion.span>
+ ))}
+ </span>
+ );
+ case "squeeze":
+ return (
+ <motion.span
+ key={cycle}
+ className={`inline-block ${WORD}`}
+ style={color}
+ initial={{ scaleY: 0.05, scaleX: 1.4, opacity: 0 }}
+ animate={{ scaleY: 1, scaleX: 1, opacity: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: d(0.5),
+ bounce: 0.35,
+ delay: d(0.15),
+ }}
+ >
+ {word}
+ </motion.span>
+ );
+ }
+ })();
+
+ return <Frame className="flex items-center justify-center">{body}</Frame>;
+}
+
+const PLAN: Effect[][] = [
+ ["blur", "glitch", "halftone", "extrude", "outline", "wave"],
+ ["echo", "stretch", "tracking", "rolodex", "sheen", "focus"],
+ ["halftone", "wave", "blur", "squeeze", "glitch", "rolodex"],
+ ["extrude", "squeeze", "outline", "focus", "tracking", "sheen"],
+];
+
+function scene(scenario: number, effect: Effect): SceneDef {
+ const material = MATERIALS[scenario];
+ return {
+ block: BLOCK[effect],
+ surface: material.surface,
+ dark: material.dark,
+ duration: effect === "wave" ? 3 : 2,
+ render: (p) => <EffectWord {...p} effect={effect} material={material} />,
+ };
+}
+
+export const EFFECTS_SET: SceneSet = PLAN.map((effects, scenario) =>
+ Object.fromEntries(
+ effects.map((effect, i) => [i + 1, scene(scenario, effect)]),
+ ),
+);
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/frames.tsx b/app/(home)/components/landing/sections/hero/scenes/sets/frames.tsx
new file mode 100644
index 00000000..7dba268a
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/frames.tsx
@@ -0,0 +1,860 @@
+"use client";
+
+import { motion } from "motion/react";
+import { EASE_IN_OUT, EASE_OUT, Frame, Letters, Words } from "./kit";
+import type { SceneDef, SceneProps, SceneSet } from "./types";
+
+const VIOLET = "/landing/shader-violet.png";
+const MAGENTA = "/landing/shader-magenta.png";
+
+const big = "font-semibold tracking-[-0.05em] leading-[0.9]";
+
+function def(
+ block: string,
+ surface: string,
+ dark: boolean,
+ duration: number,
+ render: SceneDef["render"],
+): SceneDef {
+ return { block, surface, dark, duration, render };
+}
+
+function ShaderType({
+ cycle,
+ speed,
+ image,
+ text,
+}: SceneProps & { image: string; text: string }) {
+ return (
+ <Frame
+ className="bg-cover"
+ style={{ backgroundImage: `url(${image})`, backgroundPosition: "40%" }}
+ >
+ <motion.div
+ className="absolute inset-0 bg-cover"
+ style={{ backgroundImage: `url(${image})` }}
+ animate={{ scale: [1, 1.12] }}
+ transition={{
+ duration: 6,
+ ease: "linear",
+ repeat: Infinity,
+ repeatType: "mirror",
+ }}
+ />
+ <div className="absolute inset-x-5 bottom-4 text-[46px] text-white">
+ <Letters
+ text={text}
+ cycle={cycle}
+ speed={speed}
+ className={big}
+ initial={{ y: "60%", opacity: 0, filter: "blur(8px)" }}
+ animate={{ y: "0%", opacity: 1, filter: "blur(0px)" }}
+ stagger={0.035}
+ />
+ </div>
+ </Frame>
+ );
+}
+
+function Bauhaus({ cycle, speed }: SceneProps) {
+ const d = (s: number) => s / speed;
+ return (
+ <Frame className="bg-[#0E1012]">
+ <div key={cycle} className="absolute inset-0">
+ <motion.span
+ className="absolute top-6 left-6 size-[96px] rounded-full bg-[#A800B7]"
+ initial={{ scale: 0 }}
+ animate={{ scale: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: d(0.5),
+ bounce: 0.35,
+ delay: d(0.1),
+ }}
+ />
+ <motion.span
+ className="absolute right-6 bottom-6 h-[64px] w-[128px] rounded-t-full bg-[#F4F4F5]"
+ initial={{ rotate: -180, opacity: 0 }}
+ animate={{ rotate: 0, opacity: 1 }}
+ transition={{ duration: d(0.7), ease: EASE_OUT, delay: d(0.35) }}
+ style={{ transformOrigin: "50% 100%" }}
+ />
+ <motion.span
+ className="absolute top-[70px] right-[52px] size-[44px] bg-[#F0ABFC]"
+ initial={{ scale: 0, rotate: 45 }}
+ animate={{ scale: 1, rotate: 0 }}
+ transition={{
+ type: "spring",
+ visualDuration: d(0.45),
+ bounce: 0.3,
+ delay: d(0.6),
+ }}
+ />
+ </div>
+ </Frame>
+ );
+}
+
+function SpeedLines({ cycle, speed, word }: SceneProps & { word: string }) {
+ const lines = [18, 38, 58, 78, 98, 118];
+ return (
+ <Frame className="bg-[#0E1012]">
+ {lines.map((top, i) => (
+ <motion.span
+ key={top}
+ className="absolute h-[2px] rounded-full bg-white/30"
+ style={{ top, width: 60 + (i % 3) * 40 }}
+ animate={{ x: [-160, 280] }}
+ transition={{
+ duration: (0.55 + (i % 3) * 0.15) / speed,
+ repeat: Infinity,
+ ease: "linear",
+ delay: i * 0.08,
+ }}
+ />
+ ))}
+ <motion.span
+ key={cycle}
+ className={`absolute bottom-6 left-[18px] text-[54px] text-white italic ${big}`}
+ initial={{ x: -260, skewX: -20, filter: "blur(6px)" }}
+ animate={{ x: 0, skewX: 0, filter: "blur(0px)" }}
+ transition={{
+ duration: 0.6 / speed,
+ ease: EASE_OUT,
+ delay: 0.1 / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ </Frame>
+ );
+}
+
+function MaskLines({
+ cycle,
+ speed,
+ lines,
+ className,
+}: SceneProps & { lines: string[]; className: string }) {
+ return (
+ <Frame className={className}>
+ <div
+ key={cycle}
+ className="absolute inset-x-[18px] bottom-4 flex flex-col"
+ >
+ {lines.map((line, i) => (
+ <span key={line} className="overflow-hidden">
+ <motion.span
+ className={`block text-[40px] ${big}`}
+ initial={{ y: "105%" }}
+ animate={{ y: "0%" }}
+ transition={{
+ duration: 0.6 / speed,
+ ease: EASE_IN_OUT,
+ delay: (0.15 + i * 0.14) / speed,
+ }}
+ >
+ {line}
+ </motion.span>
+ </span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function TrimBurst({ cycle, speed, word }: SceneProps & { word: string }) {
+ const rays = Array.from({ length: 12 }, (_, i) => i * 30);
+ return (
+ <Frame className="bg-[#0E1012]">
+ <div
+ key={cycle}
+ className="absolute inset-0 flex items-center justify-center"
+ >
+ {rays.map((angle) => (
+ <motion.span
+ key={angle}
+ className="absolute h-[3px] w-[70px] origin-left rounded-full bg-[#F0ABFC]"
+ style={{ rotate: `${angle}deg`, left: "50%", top: "50%" }}
+ initial={{ scaleX: 0, x: 20 }}
+ animate={{ scaleX: [0, 1, 0], x: [20, 40, 90] }}
+ transition={{
+ duration: 0.8 / speed,
+ ease: EASE_OUT,
+ delay: 0.2 / speed,
+ }}
+ />
+ ))}
+ <motion.span
+ className={`text-[44px] text-white ${big}`}
+ initial={{ scale: 0.4, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: 0.4 / speed,
+ bounce: 0.45,
+ delay: 0.25 / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ </div>
+ </Frame>
+ );
+}
+
+function EchoStack({ cycle, speed, words }: SceneProps & { words: string[] }) {
+ return (
+ <Frame className="bg-[#A800B7]">
+ <div
+ key={cycle}
+ className="absolute inset-0 flex flex-col items-center justify-center gap-1"
+ >
+ {words.map((word, i) => (
+ <motion.span
+ key={word}
+ className={`text-[36px] text-white ${big}`}
+ initial={{ opacity: 0, scale: 1.6, filter: "blur(6px)" }}
+ animate={{
+ opacity: i === words.length - 1 ? 1 : 0.45,
+ scale: 1,
+ filter: "blur(0px)",
+ }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EASE_OUT,
+ delay: (0.15 + i * 0.25) / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function Mondrian({ cycle, speed, word }: SceneProps & { word: string }) {
+ const d = (s: number) => s / speed;
+ return (
+ <Frame className="bg-[#F4F4F5]">
+ <div key={cycle} className="absolute inset-0">
+ {[
+ {
+ cls: "left-[96px] top-0 h-full w-[6px]",
+ from: { scaleY: 0 },
+ to: { scaleY: 1 },
+ origin: "top",
+ },
+ {
+ cls: "left-0 top-[104px] h-[6px] w-full",
+ from: { scaleX: 0 },
+ to: { scaleX: 1 },
+ origin: "left",
+ },
+ {
+ cls: "left-[196px] top-[104px] h-[76px] w-[6px]",
+ from: { scaleY: 0 },
+ to: { scaleY: 1 },
+ origin: "top",
+ },
+ ].map((line, i) => (
+ <motion.span
+ key={line.cls}
+ className={`absolute bg-[#0E1012] ${line.cls}`}
+ style={{ transformOrigin: line.origin }}
+ initial={line.from}
+ animate={line.to}
+ transition={{
+ duration: d(0.4),
+ ease: EASE_IN_OUT,
+ delay: d(0.1 + i * 0.15),
+ }}
+ />
+ ))}
+ <motion.span
+ className="absolute top-0 left-0 h-[104px] w-[96px] bg-[#A800B7]"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ transition={{ duration: d(0.3), delay: d(0.6) }}
+ />
+ <motion.span
+ className="absolute right-0 bottom-0 h-[70px] w-[88px] bg-[#0E1012]"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ transition={{ duration: d(0.3), delay: d(0.75) }}
+ />
+ <motion.span
+ className={`absolute top-6 left-[118px] text-[40px] text-[#0E1012] ${big}`}
+ initial={{ opacity: 0, y: 8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: d(0.4), ease: EASE_OUT, delay: d(0.9) }}
+ >
+ {word}
+ </motion.span>
+ </div>
+ </Frame>
+ );
+}
+
+function SpringNumber({
+ cycle,
+ speed,
+ value,
+ caption,
+}: SceneProps & { value: string; caption: string }) {
+ return (
+ <Frame className="bg-[#0E1012]">
+ <div
+ key={cycle}
+ className="absolute inset-0 flex flex-col items-center justify-center"
+ >
+ <motion.span
+ className={`text-[96px] text-white ${big}`}
+ initial={{ scale: 0.3, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{
+ type: "spring",
+ visualDuration: 0.55 / speed,
+ bounce: 0.4,
+ delay: 0.15 / speed,
+ }}
+ >
+ {value}
+ </motion.span>
+ <motion.span
+ className="text-small text-[#F0ABFC]"
+ initial={{ opacity: 0, y: 6 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.4 / speed, delay: 0.6 / speed }}
+ >
+ {caption}
+ </motion.span>
+ </div>
+ </Frame>
+ );
+}
+
+function Squiggle({ cycle, speed, text }: SceneProps & { text: string }) {
+ return (
+ <Frame className="bg-white">
+ <div key={cycle} className="absolute inset-x-[18px] bottom-5">
+ <motion.span
+ className={`block text-[38px] text-[#0E1012] ${big}`}
+ initial={{ opacity: 0, y: 10 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.45 / speed,
+ ease: EASE_OUT,
+ delay: 0.1 / speed,
+ }}
+ >
+ {text}
+ </motion.span>
+ <svg
+ viewBox="0 0 200 20"
+ className="mt-1 h-4 w-[190px] overflow-visible"
+ >
+ <motion.path
+ d="M2 12 C 22 2, 32 20, 52 10 S 82 2, 102 12 S 132 20, 152 9 S 182 4, 198 11"
+ fill="none"
+ stroke="#A800B7"
+ strokeWidth="4"
+ strokeLinecap="round"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 0.7 / speed,
+ ease: EASE_IN_OUT,
+ delay: 0.5 / speed,
+ }}
+ />
+ </svg>
+ </div>
+ </Frame>
+ );
+}
+
+function TrackingIn({ cycle, speed, word }: SceneProps & { word: string }) {
+ return (
+ <Frame className="flex items-center justify-center bg-white">
+ <motion.span
+ key={cycle}
+ className="text-[34px] font-semibold text-[#0E1012]"
+ initial={{ letterSpacing: "0.6em", opacity: 0, filter: "blur(6px)" }}
+ animate={{ letterSpacing: "-0.03em", opacity: 1, filter: "blur(0px)" }}
+ transition={{
+ duration: 0.9 / speed,
+ ease: EASE_OUT,
+ delay: 0.1 / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ </Frame>
+ );
+}
+
+function WaveWipe({
+ cycle,
+ speed,
+ from,
+ to,
+}: SceneProps & { from: string; to: string }) {
+ return (
+ <Frame className="bg-[#0E1012]">
+ <span
+ className={`absolute bottom-5 left-[22px] text-[42px] text-white ${big}`}
+ >
+ {from}
+ </span>
+ <motion.div
+ key={cycle}
+ className="absolute inset-0 bg-[#A800B7]"
+ initial={{ clipPath: "circle(0% at 0% 100%)" }}
+ animate={{ clipPath: "circle(150% at 0% 100%)" }}
+ transition={{
+ duration: 0.9 / speed,
+ ease: EASE_IN_OUT,
+ delay: 0.6 / speed,
+ }}
+ >
+ <span
+ className={`absolute bottom-5 left-[22px] text-[42px] text-white ${big}`}
+ >
+ {to}
+ </span>
+ </motion.div>
+ </Frame>
+ );
+}
+
+function Rolodex({ cycle, speed, words }: SceneProps & { words: string[] }) {
+ return (
+ <Frame className="bg-[#0E1012] [perspective:400px]">
+ <div
+ key={cycle}
+ className="absolute inset-0 flex flex-col items-center justify-center gap-2"
+ >
+ {words.map((word, i) => (
+ <motion.span
+ key={word}
+ className={`text-[34px] text-white ${big}`}
+ style={{ transformOrigin: "50% 50% -20px" }}
+ initial={{ rotateX: -90, opacity: 0 }}
+ animate={{ rotateX: 0, opacity: 1 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EASE_OUT,
+ delay: (0.15 + i * 0.3) / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function RgbGlitch({ cycle, speed, word }: SceneProps & { word: string }) {
+ const burst = {
+ duration: 1.4 / speed,
+ times: [0, 0.3, 0.34, 0.38, 0.42, 1],
+ repeat: 0,
+ };
+ return (
+ <Frame className="flex items-center justify-center bg-black">
+ <div key={cycle} className="relative">
+ <motion.span
+ className={`absolute inset-0 text-[56px] text-[#F0ABFC] mix-blend-screen ${big}`}
+ animate={{ x: [0, 0, -6, 4, 0, 0] }}
+ transition={burst}
+ >
+ {word}
+ </motion.span>
+ <motion.span
+ className={`absolute inset-0 text-[56px] text-[#22C55E] mix-blend-screen ${big}`}
+ animate={{ x: [0, 0, 6, -3, 0, 0] }}
+ transition={burst}
+ >
+ {word}
+ </motion.span>
+ <span
+ className={`relative text-[56px] text-white mix-blend-screen ${big}`}
+ >
+ {word}
+ </span>
+ </div>
+ </Frame>
+ );
+}
+
+function Truchet({ cycle, speed }: SceneProps) {
+ const tiles = Array.from({ length: 25 }, (_, i) => i);
+ return (
+ <Frame className="bg-[#0B0D0C]">
+ <div
+ key={cycle}
+ className="absolute inset-0 grid grid-cols-5 grid-rows-5"
+ >
+ {tiles.map((i) => (
+ <motion.svg
+ key={i}
+ viewBox="0 0 40 40"
+ className="size-full"
+ initial={{ rotate: 0 }}
+ animate={{ rotate: (i * 7) % 3 === 0 ? 90 : 0 }}
+ transition={{
+ duration: 0.45 / speed,
+ ease: EASE_IN_OUT,
+ delay: (0.1 + ((i * 5) % 9) * 0.06) / speed,
+ }}
+ >
+ <path
+ d="M20 0 A20 20 0 0 0 0 20 M40 20 A20 20 0 0 0 20 40"
+ fill="none"
+ stroke="#22C55E"
+ strokeWidth="5"
+ />
+ </motion.svg>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function CharRise({ cycle, speed, text }: SceneProps & { text: string }) {
+ return (
+ <Frame className="bg-[#17191B]">
+ <div className="absolute inset-x-[18px] bottom-3 overflow-hidden text-[64px] text-white">
+ <Letters
+ text={text}
+ cycle={cycle}
+ speed={speed}
+ className={big}
+ initial={{ y: "100%" }}
+ animate={{ y: "0%" }}
+ transition={{ duration: 0.6 / speed, ease: EASE_IN_OUT }}
+ stagger={0.06}
+ />
+ </div>
+ </Frame>
+ );
+}
+
+function StripeType({ cycle, speed, word }: SceneProps & { word: string }) {
+ const stripes = [0, 1, 2, 3, 4, 5];
+ return (
+ <Frame className="flex items-center justify-center bg-[#A800B7]">
+ <span className={`text-[58px] text-white ${big}`}>{word}</span>
+ <div key={cycle} className="absolute inset-0 flex flex-col">
+ {stripes.map((i) => (
+ <motion.span
+ key={i}
+ className="flex-1 origin-right bg-[#A800B7]"
+ initial={{ scaleX: 1 }}
+ animate={{ scaleX: 0 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EASE_IN_OUT,
+ delay: (0.2 + i * 0.07) / speed,
+ }}
+ />
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function ZoomWords({ cycle, speed, words }: SceneProps & { words: string[] }) {
+ return (
+ <Frame className="bg-[#0E1012]">
+ <Words
+ words={words}
+ cycle={cycle}
+ speed={speed}
+ className={`absolute inset-x-[22px] bottom-5 gap-x-2 text-[36px] text-white ${big}`}
+ initial={{ scale: 3, opacity: 0, filter: "blur(10px)" }}
+ animate={{ scale: 1, opacity: 1, filter: "blur(0px)" }}
+ transition={{ duration: 0.5 / speed, ease: EASE_OUT }}
+ stagger={0.28}
+ />
+ </Frame>
+ );
+}
+
+function Marquee({ word, speed }: SceneProps & { word: string }) {
+ const rows = [0, 1, 2, 3, 4, 5];
+ return (
+ <Frame className="bg-black">
+ <div className="absolute inset-0 flex flex-col justify-center gap-1">
+ {rows.map((row) => (
+ <motion.span
+ key={row}
+ className={`whitespace-nowrap text-[32px] ${big} ${row % 2 ? "text-[#22C55E]" : "text-white/20"}`}
+ animate={{ x: row % 2 ? ["0%", "-50%"] : ["-50%", "0%"] }}
+ transition={{
+ duration: 4 / speed,
+ ease: "linear",
+ repeat: Infinity,
+ }}
+ >
+ {`${word} ${word} ${word} ${word} `}
+ </motion.span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function WordCrossfade({
+ cycle,
+ speed,
+ words,
+ image,
+}: SceneProps & { words: string[]; image: string }) {
+ const step = 0.7 / speed;
+ return (
+ <Frame
+ className="bg-cover"
+ style={{ backgroundImage: `url(${image})`, backgroundPosition: "40%" }}
+ >
+ <div key={cycle} className="absolute inset-x-5 bottom-4 h-[48px]">
+ {words.map((word, i) => (
+ <motion.span
+ key={word}
+ className={`absolute bottom-0 left-0 text-[48px] text-white ${big}`}
+ initial={{ opacity: 0, filter: "blur(8px)" }}
+ animate={{
+ opacity: i === words.length - 1 ? [0, 1] : [0, 1, 0],
+ filter:
+ i === words.length - 1
+ ? ["blur(8px)", "blur(0px)"]
+ : ["blur(8px)", "blur(0px)", "blur(8px)"],
+ }}
+ transition={{
+ duration: step * (i === words.length - 1 ? 0.6 : 1.2),
+ delay: 0.1 + i * step,
+ ease: "easeInOut",
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function InkUnderline({ cycle, speed, text }: SceneProps & { text: string }) {
+ return (
+ <Frame className="flex flex-col items-start justify-center bg-[#F4F4F5] px-6">
+ <span className={`text-[56px] text-[#0E1012] ${big}`}>{text}</span>
+ <svg
+ key={cycle}
+ viewBox="0 0 140 14"
+ className="h-3.5 w-[140px] overflow-visible"
+ >
+ <motion.path
+ d="M3 9 C 40 3, 90 3, 137 8"
+ fill="none"
+ stroke="#0E1012"
+ strokeWidth="6"
+ strokeLinecap="round"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EASE_OUT,
+ delay: 0.3 / speed,
+ }}
+ />
+ </svg>
+ </Frame>
+ );
+}
+
+function MarkerHighlight({
+ cycle,
+ speed,
+ before,
+ marked,
+}: SceneProps & { before: string; marked: string }) {
+ return (
+ <Frame className="bg-white">
+ <div
+ key={cycle}
+ className={`absolute inset-x-[18px] bottom-5 text-[40px] text-[#0E1012] ${big}`}
+ >
+ <span>{before} </span>
+ <span className="relative">
+ <motion.span
+ className="absolute inset-x-[-4px] bottom-[2px] h-[60%] origin-left rounded-[4px] bg-[#F0ABFC]"
+ initial={{ scaleX: 0 }}
+ animate={{ scaleX: 1 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EASE_IN_OUT,
+ delay: 0.35 / speed,
+ }}
+ />
+ <span className="relative">{marked}</span>
+ </span>
+ </div>
+ </Frame>
+ );
+}
+
+function StaggerUp({ cycle, speed, lines }: SceneProps & { lines: string[] }) {
+ return (
+ <Frame className="bg-[#FBE8FD]">
+ <Words
+ words={lines}
+ cycle={cycle}
+ speed={speed}
+ className={`absolute inset-x-[18px] bottom-4 flex-col text-[30px] text-[#0E1012] ${big}`}
+ initial={{ opacity: 0, y: 14 }}
+ animate={{ opacity: 1, y: 0 }}
+ stagger={0.18}
+ />
+ </Frame>
+ );
+}
+
+function RingText({ text, speed }: SceneProps & { text: string }) {
+ return (
+ <Frame className="flex items-center justify-center bg-[#0E1012]">
+ <motion.svg
+ viewBox="0 0 120 120"
+ className="size-[132px]"
+ animate={{ rotate: 360 }}
+ transition={{ duration: 9 / speed, ease: "linear", repeat: Infinity }}
+ >
+ <defs>
+ <path
+ id="ring-text"
+ d="M60 60 m-46 0 a46 46 0 1 1 92 0 a46 46 0 1 1 -92 0"
+ />
+ </defs>
+ <text className="fill-white text-[13px] font-semibold">
+ <textPath href="#ring-text">{text}</textPath>
+ </text>
+ </motion.svg>
+ <span className="absolute size-3 rounded-full bg-[#A800B7]" />
+ </Frame>
+ );
+}
+
+function PeriodDrop({ cycle, speed, word }: SceneProps & { word: string }) {
+ return (
+ <Frame className="flex items-center justify-center bg-white">
+ <span
+ key={cycle}
+ className={`flex items-end text-[38px] text-[#0E1012] ${big}`}
+ >
+ {word}
+ <motion.span
+ className="text-[#A800B7]"
+ initial={{ y: -120 }}
+ animate={{ y: [-120, 0, -18, 0, -5, 0] }}
+ transition={{
+ duration: 0.9 / speed,
+ times: [0, 0.4, 0.6, 0.75, 0.88, 1],
+ ease: "easeOut",
+ delay: 0.2 / speed,
+ }}
+ >
+ .
+ </motion.span>
+ </span>
+ </Frame>
+ );
+}
+
+export const FRAMES_SET: SceneSet = [
+ {
+ 1: def("shader-liquid-metal", "bg-[#1A0820]", true, 2.2, (p) => (
+ <ShaderType {...p} image={VIOLET} text="ACME 2.0" />
+ )),
+ 2: def("bauhaus-build", "bg-[#0E1012]", true, 2, (p) => <Bauhaus {...p} />),
+ 3: def("speed-lines", "bg-[#0E1012]", true, 2, (p) => (
+ <SpeedLines {...p} word="FAST" />
+ )),
+ 4: def("mask-reveal-up", "bg-[#A800B7] text-white", true, 2, (p) => (
+ <MaskLines
+ {...p}
+ lines={["Out", "Tuesday."]}
+ className="bg-[#A800B7] text-white"
+ />
+ )),
+ 5: def("trim-burst", "bg-[#0E1012]", true, 1.8, (p) => (
+ <TrimBurst {...p} word="LIVE" />
+ )),
+ 6: def("echo-stack", "bg-[#A800B7]", true, 2.2, (p) => (
+ <EchoStack {...p} words={["ship", "it", "now"]} />
+ )),
+ },
+ {
+ 1: def("mondrian-split", "bg-[#F4F4F5]", false, 2.2, (p) => (
+ <Mondrian {...p} word="v2.4" />
+ )),
+ 2: def("spring-scale-in", "bg-[#0E1012]", true, 1.8, (p) => (
+ <SpringNumber {...p} value="12" caption="changes" />
+ )),
+ 3: def("squiggle", "bg-white", false, 2, (p) => (
+ <Squiggle {...p} text="faster sync" />
+ )),
+ 4: def("tracking-in", "bg-white", false, 1.8, (p) => (
+ <TrackingIn {...p} word="LEDGER" />
+ )),
+ 5: def("wave-wipe", "bg-[#0E1012]", true, 2.2, (p) => (
+ <WaveWipe {...p} from="before" to="after" />
+ )),
+ 6: def("rolodex-flip", "bg-[#0E1012]", true, 2.2, (p) => (
+ <Rolodex {...p} words={["fix", "ship", "repeat"]} />
+ )),
+ },
+ {
+ 1: def("rgb-glitch-text", "bg-black", true, 2, (p) => (
+ <RgbGlitch {...p} word="PULSE" />
+ )),
+ 2: def("truchet-flip", "bg-[#0B0D0C]", true, 2, (p) => <Truchet {...p} />),
+ 3: def("per-character-rise", "bg-[#17191B]", true, 1.8, (p) => (
+ <CharRise {...p} text="10.24" />
+ )),
+ 4: def("stripe-type", "bg-[#A800B7]", true, 1.8, (p) => (
+ <StripeType {...p} word="SOON" />
+ )),
+ 5: def("zoom-words", "bg-[#0E1012]", true, 2.2, (p) => (
+ <ZoomWords {...p} words={["coming", "this", "fall"]} />
+ )),
+ 6: def("infinite-marquee", "bg-black", true, 3, (p) => (
+ <Marquee {...p} word="PULSE" />
+ )),
+ },
+ {
+ 1: def("per-word-crossfade", "bg-[#2A0618]", true, 2.4, (p) => (
+ <WordCrossfade
+ {...p}
+ words={["write.", "sync.", "ship."]}
+ image={MAGENTA}
+ />
+ )),
+ 2: def("ink-underline", "bg-[#F4F4F5]", false, 1.6, (p) => (
+ <InkUnderline {...p} text="fast" />
+ )),
+ 3: def("marker-highlight", "bg-white", false, 1.8, (p) => (
+ <MarkerHighlight {...p} before="0.2s" marked="sync" />
+ )),
+ 4: def("staggered-fade-up", "bg-[#FBE8FD]", false, 1.8, (p) => (
+ <StaggerUp {...p} lines={["capture", "sync", "share"]} />
+ )),
+ 5: def("ring-text", "bg-[#0E1012]", true, 3, (p) => (
+ <RingText {...p} text="write it down, ship it, " />
+ )),
+ 6: def("period-drop", "bg-white", false, 1.8, (p) => (
+ <PeriodDrop {...p} word="notes" />
+ )),
+ },
+];
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/index.tsx b/app/(home)/components/landing/sections/hero/scenes/sets/index.tsx
new file mode 100644
index 00000000..af22e6da
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/index.tsx
@@ -0,0 +1,41 @@
+"use client";
+
+import { CLIP_DURATION, CLIP_SURFACE, ClipView } from "../clips";
+import { SCENARIO_SCENES } from "../scenario-scenes";
+import { EFFECTS_SET } from "./effects";
+import { FRAMES_SET } from "./frames";
+import { LIVE_SET } from "./live";
+import { STORY_SET } from "./story";
+import type { SceneSet } from "./types";
+
+const LIGHT = new Set(["bg-white", "bg-[#F4F4F5]", "bg-[#FBE8FD]"]);
+
+const CATALOG_SET: SceneSet = SCENARIO_SCENES.map((scenes) =>
+ Object.fromEntries(
+ Object.entries(scenes).map(([slot, entry]) => {
+ const surface = CLIP_SURFACE[entry.clip.kind];
+ return [
+ slot,
+ {
+ block: entry.block,
+ surface,
+ dark: !LIGHT.has(surface.split(" ")[0]),
+ duration: CLIP_DURATION[entry.clip.kind],
+ render: (p) => <ClipView clip={entry.clip} {...p} />,
+ },
+ ];
+ }),
+ ),
+);
+
+export const SCENE_SETS = {
+ live: LIVE_SET,
+ catalog: CATALOG_SET,
+ frames: FRAMES_SET,
+ effects: EFFECTS_SET,
+ story: STORY_SET,
+} satisfies Record<string, SceneSet>;
+
+export type SceneSetId = keyof typeof SCENE_SETS;
+
+export const SCENE_SET_IDS = Object.keys(SCENE_SETS) as SceneSetId[];
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/kit.tsx b/app/(home)/components/landing/sections/hero/scenes/sets/kit.tsx
new file mode 100644
index 00000000..8bfee487
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/kit.tsx
@@ -0,0 +1,121 @@
+"use client";
+
+import {
+ motion,
+ type TargetAndTransition,
+ type Transition,
+} from "motion/react";
+import type { CSSProperties, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+export const EASE_OUT = [0.22, 1, 0.36, 1] as const;
+export const EASE_IN_OUT = [0.65, 0, 0.35, 1] as const;
+
+export function Frame({
+ children,
+ className,
+ style,
+}: {
+ children: ReactNode;
+ className?: string;
+ style?: CSSProperties;
+}) {
+ return (
+ <div
+ className={cn("absolute inset-0 overflow-hidden", className)}
+ style={style}
+ >
+ {children}
+ </div>
+ );
+}
+
+export function Letters({
+ text,
+ cycle,
+ speed,
+ initial,
+ animate,
+ transition,
+ stagger = 0.04,
+ delay = 0.15,
+ className,
+ letterClassName,
+}: {
+ text: string;
+ cycle: number;
+ speed: number;
+ initial: TargetAndTransition;
+ animate: TargetAndTransition;
+ transition?: Transition;
+ stagger?: number;
+ delay?: number;
+ className?: string;
+ letterClassName?: string;
+}) {
+ return (
+ <span key={cycle} className={cn("inline-flex", className)}>
+ {text.split("").map((char, i) => (
+ <motion.span
+ key={`${char}-${i}`}
+ className={cn("inline-block whitespace-pre", letterClassName)}
+ initial={initial}
+ animate={animate}
+ transition={{
+ duration: 0.55 / speed,
+ ease: EASE_OUT,
+ ...transition,
+ delay: (delay + i * stagger) / speed,
+ }}
+ >
+ {char}
+ </motion.span>
+ ))}
+ </span>
+ );
+}
+
+export function Words({
+ words,
+ cycle,
+ speed,
+ initial,
+ animate,
+ transition,
+ stagger = 0.12,
+ delay = 0.15,
+ className,
+ wordClassName,
+}: {
+ words: string[];
+ cycle: number;
+ speed: number;
+ initial: TargetAndTransition;
+ animate: TargetAndTransition;
+ transition?: Transition;
+ stagger?: number;
+ delay?: number;
+ className?: string;
+ wordClassName?: string;
+}) {
+ return (
+ <span key={cycle} className={cn("flex flex-wrap", className)}>
+ {words.map((word, i) => (
+ <motion.span
+ key={`${word}-${i}`}
+ className={cn("inline-block", wordClassName)}
+ initial={initial}
+ animate={animate}
+ transition={{
+ duration: 0.55 / speed,
+ ease: EASE_OUT,
+ ...transition,
+ delay: (delay + i * stagger) / speed,
+ }}
+ >
+ {word}
+ </motion.span>
+ ))}
+ </span>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/live.tsx b/app/(home)/components/landing/sections/hero/scenes/sets/live.tsx
new file mode 100644
index 00000000..c6bbafd6
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/live.tsx
@@ -0,0 +1,33 @@
+"use client";
+
+import { CatalogCard } from "../../../../ui/catalog-card";
+import type { ClipSpec } from "../../tiles/config";
+import { DEFAULT_LIVE_CLIPS } from "../live-clips";
+import type { SceneDef, SceneSet } from "./types";
+
+const LIGHT = /^#(f|e)/i;
+
+function scene(spec: ClipSpec): SceneDef {
+ return {
+ block: spec.name,
+ surface: "",
+ dark: !LIGHT.test(spec.background),
+ duration: 4,
+ render: (_, active) => <CatalogCard spec={spec} active={active} />,
+ };
+}
+
+const cache = new WeakMap<ClipSpec[][], SceneSet>();
+
+export function liveSet(clips: ClipSpec[][]): SceneSet {
+ let set = cache.get(clips);
+ if (!set) {
+ set = clips.map((slots) =>
+ Object.fromEntries(slots.map((spec, i) => [i + 1, scene(spec)])),
+ );
+ cache.set(clips, set);
+ }
+ return set;
+}
+
+export const LIVE_SET = liveSet(DEFAULT_LIVE_CLIPS);
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/story.tsx b/app/(home)/components/landing/sections/hero/scenes/sets/story.tsx
new file mode 100644
index 00000000..0b79ff56
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/story.tsx
@@ -0,0 +1,1078 @@
+"use client";
+
+import { motion } from "motion/react";
+import { type ReactNode, useEffect, useState } from "react";
+import { cn } from "@/lib/utils";
+import { Frame } from "./kit";
+import type { SceneDef, SceneProps, SceneSet } from "./types";
+
+const EXPO = [0.16, 1, 0.3, 1] as const;
+const STRONG = [0.23, 1, 0.32, 1] as const;
+const IN_OUT = [0.65, 0, 0.35, 1] as const;
+const stepped = (n: number) => (t: number) => Math.floor(t * n) / n;
+const heavy = "font-semibold tracking-[-0.05em] leading-[0.95]";
+
+function Camera({
+ children,
+ className,
+}: {
+ children: ReactNode;
+ className?: string;
+}) {
+ return (
+ <motion.div
+ className={cn("absolute inset-0", className)}
+ animate={{ scale: [1, 1.04] }}
+ transition={{
+ duration: 7,
+ ease: "linear",
+ repeat: Infinity,
+ repeatType: "mirror",
+ }}
+ >
+ {children}
+ </motion.div>
+ );
+}
+
+function useTyped(
+ text: string,
+ cycle: number,
+ msPerChar: number,
+ startMs: number,
+) {
+ const [count, setCount] = useState(text.length);
+ useEffect(() => {
+ if (cycle < 0) return;
+ setCount(0);
+ let n = 0;
+ let id: ReturnType<typeof setInterval>;
+ const start = setTimeout(() => {
+ id = setInterval(() => {
+ n += 1;
+ setCount(n);
+ if (n >= text.length) clearInterval(id);
+ }, msPerChar);
+ }, startMs);
+ return () => {
+ clearTimeout(start);
+ clearInterval(id);
+ };
+ }, [text, cycle, msPerChar, startMs]);
+ return count;
+}
+
+const GLYPHS = "ABCDEFGHJKLMNPRSTUVWXYZ0123456789";
+
+function useScramble(text: string, cycle: number, speed: number) {
+ const [out, setOut] = useState(text);
+ useEffect(() => {
+ if (cycle < 0) return;
+ let frame = 0;
+ const id = setInterval(() => {
+ frame += 1;
+ const locked = Math.floor(frame / 3);
+ setOut(
+ text
+ .split("")
+ .map((c, i) =>
+ c === " " || i < locked
+ ? c
+ : GLYPHS[(frame * 7 + i * 13) % GLYPHS.length],
+ )
+ .join(""),
+ );
+ if (locked > text.length) clearInterval(id);
+ }, 40 / speed);
+ return () => clearInterval(id);
+ }, [text, cycle, speed]);
+ return out;
+}
+
+function MaskedTitle({ cycle, speed }: SceneProps) {
+ const lines = ["Ship it on", "Tuesday."];
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <Camera>
+ <div
+ key={cycle}
+ className="absolute inset-x-5 bottom-5 flex flex-col text-[32px] text-white"
+ >
+ {lines.map((line, i) => (
+ <span key={line} className="overflow-hidden pb-0.5">
+ <motion.span
+ className={`block ${heavy}`}
+ initial={{ y: "105%" }}
+ animate={{ y: "0%" }}
+ transition={{
+ duration: 0.7 / speed,
+ ease: EXPO,
+ delay: (0.15 + i * 0.12) / speed,
+ }}
+ >
+ {line}
+ </motion.span>
+ </span>
+ ))}
+ </div>
+ </Camera>
+ </Frame>
+ );
+}
+
+function ScrambleTitle({ cycle, speed }: SceneProps) {
+ const title = useScramble("LEDGER 2.4", cycle, speed);
+ const sub = useScramble("release notes", cycle, speed * 0.7);
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <Camera>
+ <div className="absolute inset-x-5 bottom-5 flex flex-col gap-1.5">
+ <span className="font-mono text-[28px] leading-none font-semibold tracking-[-0.02em] text-white tabular-nums">
+ {title}
+ </span>
+ <span className="font-mono text-mono text-white/45">{sub}</span>
+ </div>
+ </Camera>
+ </Frame>
+ );
+}
+
+function SteppedShapes({ cycle, speed }: SceneProps) {
+ const shapes = [
+ "rounded-full",
+ "",
+ "rounded-t-full",
+ "rounded-full",
+ "rotate-45",
+ "",
+ ];
+ return (
+ <Frame className="bg-[#EDEEF0]">
+ <div key={cycle} className="absolute inset-x-5 top-5 flex gap-2">
+ {shapes.map((shape, i) => (
+ <motion.span
+ key={i}
+ className={cn(
+ "size-7 bg-[#0E1012]",
+ shape,
+ i === 3 && "bg-[#22C55E]",
+ )}
+ initial={{ scale: 0 }}
+ animate={{ scale: 1 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: stepped(6),
+ delay: (0.1 + i * 0.06) / speed,
+ }}
+ />
+ ))}
+ </div>
+ <motion.span
+ key={`w-${cycle}`}
+ className={`absolute bottom-4 left-5 text-[46px] text-[#0E1012] ${heavy}`}
+ initial={{ y: 20, opacity: 0 }}
+ animate={{ y: 0, opacity: 1 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: stepped(7),
+ delay: 0.6 / speed,
+ }}
+ >
+ Pulse
+ </motion.span>
+ </Frame>
+ );
+}
+
+function PushIn({ cycle, speed }: SceneProps) {
+ return (
+ <Frame className="bg-[#FFE27A]">
+ <motion.div
+ key={cycle}
+ className="absolute inset-0"
+ initial={{ scale: 1 }}
+ animate={{ scale: 1.35 }}
+ transition={{ duration: 2.2 / speed, ease: IN_OUT }}
+ style={{ transformOrigin: "70% 55%" }}
+ >
+ <svg viewBox="0 0 288 162" className="absolute inset-0 size-full">
+ <motion.path
+ d="M196 120 C 192 96, 206 84, 204 70 C 202 54, 186 50, 188 38 C 190 26, 208 22, 216 32 C 222 40, 220 50, 230 56 C 238 61, 236 74, 226 78 C 236 90, 230 104, 222 120"
+ fill="none"
+ stroke="#0E1012"
+ strokeWidth="3"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 1.4 / speed,
+ ease: IN_OUT,
+ delay: 0.1 / speed,
+ }}
+ />
+ </svg>
+ </motion.div>
+ <motion.span
+ key={`t-${cycle}`}
+ className={`absolute bottom-4 left-5 text-[26px] text-[#0E1012] ${heavy}`}
+ initial={{ opacity: 0, y: 8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{ duration: 0.5 / speed, ease: EXPO, delay: 2 / speed }}
+ >
+ Think it. Write it.
+ </motion.span>
+ </Frame>
+ );
+}
+
+function StatSlide({ cycle, speed }: SceneProps) {
+ return (
+ <Frame className="bg-black">
+ <div
+ key={cycle}
+ className="absolute inset-x-5 bottom-6 flex flex-col gap-1.5"
+ >
+ <motion.span
+ className={`text-[56px] text-white tabular-nums ${heavy}`}
+ initial={{ opacity: 0, y: 16 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EXPO,
+ delay: 0.15 / speed,
+ }}
+ >
+ 2,418
+ </motion.span>
+ <motion.span
+ className="text-small text-white/55"
+ initial={{ opacity: 0, y: 8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.5 / speed,
+ ease: EXPO,
+ delay: 0.35 / speed,
+ }}
+ >
+ signups in week one
+ </motion.span>
+ </div>
+ </Frame>
+ );
+}
+
+function Odometer({ cycle, speed }: SceneProps) {
+ const digits = ["1", "2"];
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <div className="absolute inset-x-4 top-4 flex flex-col gap-1.5 font-mono text-[9px] text-white/30">
+ <span>await ledger.release()</span>
+ <span>{" changes: 12,"}</span>
+ <span>{" status: shipped"}</span>
+ </div>
+ <div key={cycle} className="absolute bottom-5 left-4 flex">
+ {digits.map((digit, i) => {
+ const spins = 10 + Number(digit) + i * 10;
+ return (
+ <span
+ key={i}
+ className="relative h-[64px] w-[38px] overflow-hidden"
+ >
+ <motion.span
+ className="absolute inset-x-0 top-0 flex flex-col"
+ initial={{ y: 0 }}
+ animate={{ y: -spins * 64 }}
+ transition={{
+ duration: (1.2 + i * 0.2) / speed,
+ ease: EXPO,
+ delay: 0.1 / speed,
+ }}
+ >
+ {Array.from({ length: spins + 1 }, (_, n) => (
+ <span
+ key={n}
+ className={`flex h-[64px] items-center text-[60px] text-white tabular-nums ${heavy}`}
+ >
+ {n % 10}
+ </span>
+ ))}
+ </motion.span>
+ </span>
+ );
+ })}
+ </div>
+ <motion.span
+ key={`chip-${cycle}`}
+ className="absolute right-4 bottom-7 rounded-[8px] bg-white px-2 py-1 text-caption font-medium text-[#0E1012]"
+ initial={{ scale: 0.6, opacity: 0 }}
+ animate={{ scale: [0.6, 1.04, 1], opacity: 1 }}
+ transition={{ duration: 0.4 / speed, ease: STRONG, delay: 1.5 / speed }}
+ >
+ changes
+ </motion.span>
+ </Frame>
+ );
+}
+
+function LinearPunch({ cycle, speed }: SceneProps) {
+ return (
+ <Frame className="flex items-center justify-center bg-black">
+ <motion.div
+ key={cycle}
+ className="flex flex-col items-center gap-1"
+ initial={{ scale: 1 }}
+ animate={{ scale: [1, 1, 1.3] }}
+ transition={{
+ duration: 0.97 / speed,
+ times: [0, 0.82, 1],
+ ease: "linear",
+ delay: 0.2 / speed,
+ }}
+ >
+ <span className="font-mono text-[46px] leading-none font-semibold tracking-[-0.03em] text-white tabular-nums">
+ 10.24
+ </span>
+ <span className="font-mono text-mono text-white/45">launch</span>
+ </motion.div>
+ </Frame>
+ );
+}
+
+function ClonedDigits({ speed }: SceneProps) {
+ const clones = [3, 2, 1];
+ return (
+ <Frame className="bg-[#A800B7]">
+ {clones.map((n) => (
+ <motion.span
+ key={n}
+ className={`absolute top-1/2 left-1/2 text-[70px] text-[#F0ABFC] ${heavy}`}
+ style={{ opacity: 0.25 + 0.15 * (3 - n) }}
+ animate={{
+ x: ["-50%", `${-50 + n * 9}%`, "-50%"],
+ y: ["-50%", `${-50 - n * 10}%`, "-50%"],
+ }}
+ transition={{
+ duration: 3 / speed,
+ ease: "linear",
+ repeat: Infinity,
+ delay: n * 0.12,
+ }}
+ >
+ 0.2s
+ </motion.span>
+ ))}
+ <span
+ className={`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 text-[70px] text-white ${heavy}`}
+ >
+ 0.2s
+ </span>
+ </Frame>
+ );
+}
+
+function ComparisonChart({ cycle, speed }: SceneProps) {
+ return (
+ <Frame className="bg-black">
+ <svg
+ key={cycle}
+ viewBox="0 0 240 135"
+ className="absolute inset-0 size-full"
+ >
+ <line x1="24" y1="112" x2="224" y2="112" stroke="#FFFFFF1F" />
+ <motion.path
+ d="M24 104 C 70 98, 120 90, 220 78"
+ fill="none"
+ stroke="#4A4E52"
+ strokeWidth="2.5"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 1.2 / speed,
+ ease: IN_OUT,
+ delay: 0.1 / speed,
+ }}
+ />
+ <motion.path
+ d="M24 104 C 70 92, 120 60, 220 26"
+ fill="none"
+ stroke="#F0ABFC"
+ strokeWidth="2.5"
+ initial={{ pathLength: 0 }}
+ animate={{ pathLength: 1 }}
+ transition={{
+ duration: 1.2 / speed,
+ ease: IN_OUT,
+ delay: 0.1 / speed,
+ }}
+ />
+ <motion.circle
+ cx="220"
+ cy="26"
+ r="4"
+ fill="#F0ABFC"
+ initial={{ scale: 0.8, opacity: 0 }}
+ animate={{ scale: 1, opacity: 1 }}
+ transition={{ duration: 0.25 / speed, delay: 1.3 / speed }}
+ />
+ </svg>
+ <span className="absolute top-4 left-5 text-[11px] text-white/55">
+ Activation, higher is better
+ </span>
+ <motion.span
+ key={`l-${cycle}`}
+ className="absolute top-[34px] right-5 text-[11px] font-medium text-[#F0ABFC]"
+ initial={{ opacity: 0 }}
+ animate={{ opacity: 1 }}
+ transition={{ duration: 0.25 / speed, delay: 1.35 / speed }}
+ >
+ Acme
+ </motion.span>
+ </Frame>
+ );
+}
+
+function BaselineBars({ cycle, speed }: SceneProps) {
+ const bars = [32, 46, 40, 58, 52, 74, 100];
+ return (
+ <Frame className="bg-white">
+ <span className="absolute top-4 left-5 text-[11px] text-[#6B7A80]">
+ Changes per week
+ </span>
+ <div
+ key={cycle}
+ className="absolute inset-x-5 bottom-5 flex h-[78px] items-end gap-1.5 border-b border-[#0E10121F]"
+ >
+ {bars.map((v, i) => (
+ <motion.span
+ key={i}
+ className={cn(
+ "flex-1 origin-bottom rounded-t-[3px]",
+ i === bars.length - 1 ? "bg-[#A800B7]" : "bg-[#0E1012]/15",
+ )}
+ style={{ height: `${v}%` }}
+ initial={{ scaleY: 0 }}
+ animate={{ scaleY: 1 }}
+ transition={{
+ duration: 0.45 / speed,
+ ease: STRONG,
+ delay: (0.1 + i * 0.05) / speed,
+ }}
+ />
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function CascadeRows({ cycle, speed }: SceneProps) {
+ const children = ["design team", "early access", "press"];
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <div
+ key={cycle}
+ className="absolute inset-x-4 top-4 flex flex-col gap-1.5 text-[11px]"
+ >
+ <motion.span
+ className="flex items-center justify-between rounded-[6px] bg-white/[0.06] px-2.5 py-1.5 text-white"
+ initial={{ opacity: 0, y: 8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.25 / speed,
+ ease: EXPO,
+ delay: 0.1 / speed,
+ }}
+ >
+ Beta invites
+ <span className="font-mono text-white/45 tabular-nums">1,024</span>
+ </motion.span>
+ {children.map((child, i) => (
+ <motion.span
+ key={child}
+ className="ml-4 flex items-center gap-2 px-2.5 py-1 text-white/70"
+ initial={{ opacity: 0, y: 8 }}
+ animate={{ opacity: 1, y: 0 }}
+ transition={{
+ duration: 0.25 / speed,
+ ease: EXPO,
+ delay: (0.45 + i * 0.06) / speed,
+ }}
+ >
+ <span className="size-1.5 rounded-full bg-[#22C55E]" />
+ {child}
+ </motion.span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function DotMap({ cycle, speed }: SceneProps) {
+ const cols = 22;
+ const rows = 9;
+ const lit = new Set([
+ 25, 26, 47, 48, 70, 93, 100, 101, 122, 123, 145, 112, 113, 135, 158, 160,
+ 181,
+ ]);
+ return (
+ <Frame className="bg-white">
+ <div
+ key={cycle}
+ className="absolute inset-x-4 top-4 grid gap-[5px]"
+ style={{ gridTemplateColumns: `repeat(${cols}, 1fr)` }}
+ >
+ {Array.from({ length: cols * rows }, (_, i) => (
+ <motion.span
+ key={i}
+ className="aspect-square rounded-full"
+ initial={{ backgroundColor: "#0E101214" }}
+ animate={
+ lit.has(i)
+ ? { backgroundColor: "#A800B7", scale: [1, 1.5, 1] }
+ : { backgroundColor: "#0E101214" }
+ }
+ transition={{
+ duration: 0.35 / speed,
+ delay: (0.2 + (i % cols) * 0.04) / speed,
+ }}
+ />
+ ))}
+ </div>
+ <span className="absolute bottom-3 left-4 text-[11px] text-[#6B7A80]">
+ Synced in 42 countries
+ </span>
+ </Frame>
+ );
+}
+
+function BeatCut({ cycle, speed }: SceneProps) {
+ const words = ["one", "prompt.", "one", "afternoon."];
+ const [index, setIndex] = useState(words.length - 1);
+ useEffect(() => {
+ if (cycle < 0) return;
+ setIndex(0);
+ let i = 0;
+ const id = setInterval(() => {
+ i += 1;
+ if (i >= words.length) {
+ clearInterval(id);
+ return;
+ }
+ setIndex(i);
+ }, 330 / speed);
+ return () => clearInterval(id);
+ }, [cycle, speed]);
+ return (
+ <Frame className="flex items-center justify-center bg-[#0B0C0E]">
+ <span className={`text-[40px] text-white ${heavy}`}>{words[index]}</span>
+ </Frame>
+ );
+}
+
+function PhraseMask({ cycle, speed }: SceneProps) {
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <div
+ key={cycle}
+ className="absolute inset-x-4 bottom-5 flex flex-col text-[26px]"
+ >
+ <span className="overflow-hidden">
+ <motion.span
+ className={`block text-white/70 ${heavy}`}
+ initial={{ y: "105%" }}
+ animate={{ y: "0%" }}
+ transition={{
+ duration: 0.6 / speed,
+ ease: EXPO,
+ delay: 0.15 / speed,
+ }}
+ >
+ twelve fixes,
+ </motion.span>
+ </span>
+ <span className="overflow-hidden">
+ <motion.span
+ className={`block text-white ${heavy}`}
+ initial={{ y: "105%" }}
+ animate={{ y: "0%" }}
+ transition={{
+ duration: 0.6 / speed,
+ ease: EXPO,
+ delay: 0.4 / speed,
+ }}
+ >
+ <span className="font-bold">zero</span> downtime.
+ </motion.span>
+ </span>
+ </div>
+ </Frame>
+ );
+}
+
+function SlamWords({ cycle, speed }: SceneProps) {
+ const words = ["coming", "this", "fall."];
+ const [index, setIndex] = useState(words.length - 1);
+ useEffect(() => {
+ if (cycle < 0) return;
+ setIndex(0);
+ let i = 0;
+ const id = setInterval(() => {
+ i += 1;
+ if (i >= words.length) {
+ clearInterval(id);
+ return;
+ }
+ setIndex(i);
+ }, 300 / speed);
+ return () => clearInterval(id);
+ }, [cycle, speed]);
+ return (
+ <Frame className="flex items-center justify-center bg-[#22C55E]">
+ <motion.span
+ key={`${cycle}-${index}`}
+ className="text-[54px] leading-none font-black tracking-[-0.06em] text-[#0E1012]"
+ style={{ display: "inline-block", transformOrigin: "50% 100%" }}
+ initial={{ scaleY: 1.6, scaleX: 0.78 }}
+ animate={{ scaleY: 1, scaleX: 0.82 }}
+ transition={{ duration: 0.12 / speed, ease: STRONG }}
+ >
+ {words[index]}
+ </motion.span>
+ </Frame>
+ );
+}
+
+function TerminalCaption({ cycle, speed }: SceneProps) {
+ const text = "write it down, ship it";
+ const typed = useTyped(text, cycle, 33 / speed, 200 / speed);
+ return (
+ <Frame className="bg-[#101214] px-4 pt-5">
+ <span className="font-mono text-[15px] leading-6 text-[#E4E5E7]">
+ <span className="text-[#F0ABFC]">{"› "}</span>
+ {text.slice(0, typed)}
+ <span className="ml-0.5 inline-block h-4 w-[7px] translate-y-[3px] animate-[caret-blink_1.06s_steps(1)_infinite] bg-[#E4E5E7]" />
+ </span>
+ </Frame>
+ );
+}
+
+function UiRows({ badge, diff }: { badge?: boolean; diff?: boolean }) {
+ return (
+ <div className="absolute inset-0 flex">
+ <div className="w-[52px] border-r border-white/[0.06] p-2.5">
+ {[0, 1, 2, 3].map((i) => (
+ <span
+ key={i}
+ className="mb-2 block h-1.5 rounded-full bg-white/10"
+ style={{ width: `${70 - i * 10}%` }}
+ />
+ ))}
+ </div>
+ <div className="flex flex-1 flex-col gap-2 p-3">
+ {[0, 1, 2, 3, 4].map((i) =>
+ diff ? (
+ <span
+ key={i}
+ className={cn(
+ "flex h-3 items-center gap-1.5 rounded-[3px] px-1 font-mono text-[8px]",
+ i % 2
+ ? "bg-[#22C55E]/15 text-[#86EFAC]"
+ : "bg-[#EF4444]/15 text-[#FCA5A5]",
+ )}
+ >
+ {i % 2 ? "+ sync()" : "- poll()"}
+ </span>
+ ) : (
+ <span key={i} className="flex items-center gap-2">
+ <span className="size-2 rounded-full border border-white/25" />
+ <span
+ className="h-1.5 rounded-full bg-white/15"
+ style={{ width: `${80 - i * 9}%` }}
+ />
+ {badge && i === 1 && (
+ <span
+ data-badge
+ className="ml-auto rounded-full bg-[#A800B7] px-1.5 py-px text-[8px] font-medium text-white"
+ >
+ v2.0
+ </span>
+ )}
+ </span>
+ ),
+ )}
+ </div>
+ </div>
+ );
+}
+
+function DriftPunch({ cycle, speed }: SceneProps) {
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <motion.div
+ key={cycle}
+ className="absolute inset-0"
+ style={{ transformOrigin: "88% 36%" }}
+ initial={{ x: 0, scale: 1 }}
+ animate={{ x: [0, -6, -6], scale: [1, 1.03, 1.9] }}
+ transition={{
+ duration: 1.9 / speed,
+ times: [0, 0.8, 1],
+ ease: ["linear", EXPO],
+ }}
+ >
+ <UiRows badge />
+ </motion.div>
+ </Frame>
+ );
+}
+
+function AnchoredMatch({ cycle, speed }: SceneProps) {
+ const [swapped, setSwapped] = useState(false);
+ useEffect(() => {
+ if (cycle < 0) return;
+ setSwapped(false);
+ const id = setTimeout(() => setSwapped(true), 1000 / speed);
+ return () => clearTimeout(id);
+ }, [cycle, speed]);
+ return (
+ <Frame className="bg-[#0B0C0E]">
+ <motion.div
+ className="absolute inset-0"
+ animate={{ x: [0, -8] }}
+ transition={{
+ duration: 6,
+ ease: "linear",
+ repeat: Infinity,
+ repeatType: "mirror",
+ }}
+ >
+ <UiRows diff={swapped} />
+ </motion.div>
+ </Frame>
+ );
+}
+
+function SplitSeam({ cycle, speed }: SceneProps) {
+ const travel = {
+ duration: 1.4 / speed,
+ ease: "linear" as const,
+ delay: 0.2 / speed,
+ };
+ return (
+ <Frame className="flex">
+ <div className="relative flex-1 overflow-hidden bg-black">
+ <motion.span
+ key={cycle}
+ className="absolute top-1/2 size-10 -translate-y-1/2 rounded-full bg-white"
+ initial={{ left: "10%" }}
+ animate={{ left: "200%" }}
+ transition={travel}
+ />
+ <span className="absolute bottom-3 left-3 text-[11px] text-white/60">
+ 10.23
+ </span>
+ </div>
+ <div className="relative flex-1 overflow-hidden bg-[#22C55E]">
+ <motion.span
+ key={cycle}
+ className="absolute top-1/2 size-10 -translate-y-1/2 rounded-full bg-[#0E1012]"
+ initial={{ left: "-90%" }}
+ animate={{ left: "100%" }}
+ transition={travel}
+ />
+ <span className="absolute bottom-3 left-3 text-[11px] text-[#0E1012]/70">
+ 10.24
+ </span>
+ </div>
+ </Frame>
+ );
+}
+
+function CursorWhip({ cycle, speed }: SceneProps) {
+ const d = (s: number) => s / speed;
+ return (
+ <Frame className="bg-[#F4F4F5]">
+ <motion.div
+ key={cycle}
+ className="absolute inset-0 flex"
+ style={{ width: "200%" }}
+ initial={{ x: "0%", filter: "blur(0px)" }}
+ animate={{
+ x: ["0%", "0%", "-50%"],
+ filter: ["blur(0px)", "blur(0px)", "blur(0px)"],
+ }}
+ transition={{
+ duration: d(1.9),
+ times: [0, 0.72, 1],
+ ease: ["linear", IN_OUT],
+ }}
+ >
+ <div className="relative flex flex-1 items-center justify-center">
+ <motion.span
+ className="rounded-[9px] bg-[#0E1012] px-3.5 py-1.5 text-caption font-medium text-white"
+ animate={{ scale: [1, 1, 0.94, 1] }}
+ transition={{ duration: d(1.2), times: [0, 0.75, 0.82, 1] }}
+ >
+ Share
+ </motion.span>
+ </div>
+ <div className="relative flex flex-1 items-center justify-center bg-[#A800B7]">
+ <span className={`text-[34px] text-white ${heavy}`}>Shared</span>
+ </div>
+ </motion.div>
+ <motion.svg
+ key={`c-${cycle}`}
+ viewBox="0 0 24 24"
+ className="absolute size-7 text-[#0E1012]"
+ initial={{ left: "60%", top: "115%" }}
+ animate={{
+ left: ["60%", "52%", "52%", "120%"],
+ top: ["115%", "48%", "48%", "40%"],
+ scale: [1, 1, 0.84, 1],
+ }}
+ transition={{
+ duration: d(1.9),
+ times: [0, 0.45, 0.62, 1],
+ ease: [EXPO, "linear", [0.5, 0, 0.9, 0.4]],
+ }}
+ >
+ <path
+ d="M5 3l14 7.5-6.2 1.8L10 19z"
+ fill="currentColor"
+ stroke="white"
+ strokeWidth="1.5"
+ strokeLinejoin="round"
+ />
+ </motion.svg>
+ </Frame>
+ );
+}
+
+function CreditCard() {
+ return (
+ <Frame className="flex flex-col items-center justify-center gap-1 bg-black">
+ <span className="text-[13px] font-medium text-white">Made with acme</span>
+ <span className="text-[10px] text-white/50">acme.dev</span>
+ </Frame>
+ );
+}
+
+function ParticleMark({ cycle, speed }: SceneProps) {
+ const cols = 9;
+ const rows = 12;
+ const cx = 4;
+ const cy = 5;
+ return (
+ <Frame className="bg-black">
+ <div
+ key={cycle}
+ className="absolute inset-x-4 top-6 grid gap-[7px]"
+ style={{ gridTemplateColumns: `repeat(${cols}, 1fr)` }}
+ >
+ {Array.from({ length: cols * rows }, (_, i) => {
+ const x = i % cols;
+ const y = Math.floor(i / cols);
+ const dist = Math.hypot(x - cx, y - cy);
+ const inside = dist < 2.8;
+ const push = Math.max(0, 3.2 - dist) * 6;
+ const angle = Math.atan2(y - cy, x - cx);
+ return (
+ <motion.span
+ key={i}
+ className={cn(
+ "aspect-square rounded-full",
+ inside ? "bg-white" : "bg-white/15",
+ )}
+ initial={{
+ x: Math.cos(angle) * push,
+ y: Math.sin(angle) * push,
+ scale: 0.4,
+ }}
+ animate={{ x: 0, y: 0, scale: inside ? 1 : 0.7 }}
+ transition={{
+ duration: 1.5 / speed,
+ ease: EXPO,
+ delay: (0.1 + dist * 0.04) / speed,
+ }}
+ />
+ );
+ })}
+ </div>
+ <span
+ className={`absolute inset-x-0 bottom-7 text-center text-[20px] text-white ${heavy}`}
+ >
+ ledger
+ </span>
+ </Frame>
+ );
+}
+
+function ShapeLetters({ cycle, speed }: SceneProps) {
+ const letters = "pulse".split("");
+ const shapes = [
+ "rounded-full",
+ "",
+ "rounded-t-full",
+ "rotate-45",
+ "rounded-full",
+ ];
+ return (
+ <Frame className="flex items-center justify-center bg-[#EDEEF0]">
+ <div key={cycle} className="flex items-end gap-0.5">
+ {letters.map((letter, i) => (
+ <span
+ key={letter + i}
+ className="relative flex h-9 w-[22px] items-end justify-center"
+ >
+ <motion.span
+ className={`text-[34px] text-[#0E1012] ${heavy}`}
+ initial={{ opacity: 1 }}
+ animate={{ opacity: [1, 1, 0, 0, 1] }}
+ transition={{
+ duration: 2 / speed,
+ times: [0, 0.2, 0.25, 0.7, 0.75],
+ ease: stepped(1),
+ delay: (i * 0.06) / speed,
+ }}
+ >
+ {letter}
+ </motion.span>
+ <motion.span
+ className={cn(
+ "absolute bottom-1 size-[18px]",
+ i === 2 ? "bg-[#22C55E]" : "bg-[#0E1012]",
+ shapes[i],
+ )}
+ initial={{ scale: 0 }}
+ animate={{ scale: [0, 0, 1, 1, 0] }}
+ transition={{
+ duration: 2 / speed,
+ times: [0, 0.2, 0.25, 0.7, 0.75],
+ ease: stepped(1),
+ delay: (i * 0.06) / speed,
+ }}
+ />
+ </span>
+ ))}
+ </div>
+ </Frame>
+ );
+}
+
+function LayeredMonogram({ speed }: SceneProps) {
+ return (
+ <Frame className="flex flex-col items-center justify-center gap-5 bg-[#A800B7]">
+ <span className="relative flex size-[78px] items-center justify-center">
+ <motion.span
+ className="absolute size-[70px] bg-[#F0ABFC]"
+ animate={{ rotate: [0, 90] }}
+ transition={{ duration: 2.4 / speed, repeat: Infinity, ease: IN_OUT }}
+ />
+ <motion.span
+ className="absolute size-[52px] rounded-full bg-[#0E1012]"
+ animate={{ scale: [1, 0.82, 1] }}
+ transition={{
+ duration: 3 / speed,
+ repeat: Infinity,
+ ease: "easeInOut",
+ }}
+ />
+ <motion.span
+ className="absolute size-[24px] rotate-45 bg-white"
+ animate={{ rotate: [45, 35, 55, 45] }}
+ transition={{
+ duration: 3.6 / speed,
+ repeat: Infinity,
+ ease: "easeInOut",
+ }}
+ />
+ </span>
+ <span className={`text-[24px] text-white ${heavy}`}>notes</span>
+ </Frame>
+ );
+}
+
+function def(
+ block: string,
+ surface: string,
+ dark: boolean,
+ duration: number,
+ render: SceneDef["render"],
+): SceneDef {
+ return { block, surface, dark, duration, render };
+}
+
+export const STORY_SET: SceneSet = [
+ {
+ 1: def("mask-reveal-up", "bg-[#0B0C0E]", true, 2.6, (p) => (
+ <MaskedTitle {...p} />
+ )),
+ 2: def("rolling-number", "bg-black", true, 2.4, (p) => (
+ <StatSlide {...p} />
+ )),
+ 3: def("animated-line-chart", "bg-black", true, 2.6, (p) => (
+ <ComparisonChart {...p} />
+ )),
+ 4: def("caption-word-pop", "bg-[#0B0C0E]", true, 2.2, (p) => (
+ <BeatCut {...p} />
+ )),
+ 5: def("lens-zoom", "bg-[#0B0C0E]", true, 2.8, (p) => (
+ <DriftPunch {...p} />
+ )),
+ 6: def("logo-enter", "bg-black", true, 3, () => <CreditCard />),
+ },
+ {
+ 1: def("matrix-decode", "bg-[#0B0C0E]", true, 2.4, (p) => (
+ <ScrambleTitle {...p} />
+ )),
+ 2: def("slot-machine-roll", "bg-[#0B0C0E]", true, 2.6, (p) => (
+ <Odometer {...p} />
+ )),
+ 3: def("animated-bar-chart", "bg-white", false, 2.2, (p) => (
+ <BaselineBars {...p} />
+ )),
+ 4: def("mask-reveal-up", "bg-[#0B0C0E]", true, 2.4, (p) => (
+ <PhraseMask {...p} />
+ )),
+ 5: def("slide-swap", "bg-[#0B0C0E]", true, 2.6, (p) => (
+ <AnchoredMatch {...p} />
+ )),
+ 6: def("logo-enter", "bg-black", true, 2.6, (p) => <ParticleMark {...p} />),
+ },
+ {
+ 1: def("spring-scale-in", "bg-[#EDEEF0]", false, 2.2, (p) => (
+ <SteppedShapes {...p} />
+ )),
+ 2: def("rolling-number", "bg-black", true, 2, (p) => (
+ <LinearPunch {...p} />
+ )),
+ 3: def("check-list", "bg-[#0B0C0E]", true, 2, (p) => (
+ <CascadeRows {...p} />
+ )),
+ 4: def("stretch-in", "bg-[#22C55E]", false, 1.8, (p) => (
+ <SlamWords {...p} />
+ )),
+ 5: def("push-through", "bg-black", true, 2.2, (p) => <SplitSeam {...p} />),
+ 6: def("bauhaus-build", "bg-[#EDEEF0]", false, 2.4, (p) => (
+ <ShapeLetters {...p} />
+ )),
+ },
+ {
+ 1: def("handwrite", "bg-[#FFE27A]", false, 3, (p) => <PushIn {...p} />),
+ 2: def("rolling-number", "bg-[#A800B7]", true, 3, (p) => (
+ <ClonedDigits {...p} />
+ )),
+ 3: def("animated-line-chart", "bg-white", false, 2.4, (p) => (
+ <DotMap {...p} />
+ )),
+ 4: def("typewriter", "bg-[#101214]", true, 2.2, (p) => (
+ <TerminalCaption {...p} />
+ )),
+ 5: def("whip-pan", "bg-[#F4F4F5]", false, 2.6, (p) => (
+ <CursorWhip {...p} />
+ )),
+ 6: def("logo-enter", "bg-[#A800B7]", true, 3.6, (p) => (
+ <LayeredMonogram {...p} />
+ )),
+ },
+];
diff --git a/app/(home)/components/landing/sections/hero/scenes/sets/types.ts b/app/(home)/components/landing/sections/hero/scenes/sets/types.ts
new file mode 100644
index 00000000..1523a7ce
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/scenes/sets/types.ts
@@ -0,0 +1,17 @@
+import type { ReactNode } from "react";
+
+export type SceneProps = { cycle: number; speed: number };
+
+export type SceneDef = {
+ block: string;
+ duration: number;
+ surface: string;
+ dark: boolean;
+ /**
+ * `active` is false while the scene is mounted ahead of time (hidden,
+ * waiting for its turn): live scenes stay paused then.
+ */
+ render: (props: SceneProps, active: boolean) => ReactNode;
+};
+
+export type SceneSet = Record<number, SceneDef>[];
diff --git a/app/(home)/components/landing/sections/hero/studio-pill.tsx b/app/(home)/components/landing/sections/hero/studio-pill.tsx
new file mode 100644
index 00000000..f80f17cc
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/studio-pill.tsx
@@ -0,0 +1,30 @@
+import { STUDIO_URL } from "@/config/site";
+import { MetalRing } from "../../ui/metal-ring";
+import { StudioAppIcon } from "../../ui/remocn-mark";
+
+/** "Remocn Studio is out" announcement capsule above the headline. */
+export function StudioPill() {
+ return (
+ <div className="hero-in inline-flex h-[52px] shrink-0 items-center gap-2.5 rounded-control bg-capsule px-1.5 md:h-11 md:pr-[5px]">
+ <StudioAppIcon size={36} radius={10} className="md:hidden" />
+ <StudioAppIcon size={32} radius={9} className="hidden md:flex" />
+ <p className="flex flex-col text-[14px] leading-[18px] md:flex-row md:gap-2.5 md:text-[15px]">
+ <span className="text-foreground">Remocn Studio is out</span>
+ <span className="text-muted-foreground">your agent, in an app</span>
+ </p>
+ <a
+ href={STUDIO_URL}
+ target="_blank"
+ rel="noopener noreferrer"
+ aria-label="Download Remocn Studio"
+ className="relative flex h-10 items-center gap-1.5 rounded-[11px] border border-metal px-3 text-[14px] leading-[18px] text-foreground shadow-[0_2px_10px_#A800B71F] outline-none transition-shadow duration-150 hover:shadow-[0_2px_14px_#A800B740] focus-visible:ring-3 focus-visible:ring-ring md:h-[34px]"
+ >
+ Download
+ <span aria-hidden="true" className="text-primary">
+ →
+ </span>
+ <MetalRing />
+ </a>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/ae-mark.tsx b/app/(home)/components/landing/sections/hero/tiles/ae-mark.tsx
new file mode 100644
index 00000000..549171be
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/ae-mark.tsx
@@ -0,0 +1,15 @@
+export function AfterEffectsMark({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0.3 24 23.4"
+ xmlns="http://www.w3.org/2000/svg"
+ className={className}
+ >
+ <rect x="1.5" y="2" width="21" height="20" fill="#9999FF" />
+ <path
+ d="M8.54 10.73c-.1-.31-.19-.61-.29-.92s-.19-.6-.27-.89c-.08-.28-.15-.54-.22-.78h-.02c-.09.43-.2.86-.34 1.29-.15.48-.3.98-.46 1.48-.13.51-.29.98-.44 1.4h2.54c-.06-.21-.14-.46-.23-.72-.09-.27-.18-.56-.27-.86zm8.58-.29c-.55-.03-1.07.26-1.330.76-.12.23-.19.47-.22.72h2.109c.26 0 .45 0 .57-.01.08-.01.16-.03.23-.08v-.1c0-.13-.021-.25-.061-.37-.178-.56-.708-.94-1.298-.92zM19.75.3H4.25C1.9.3 0 2.2 0 4.550v14.9c0 2.35 1.9 4.25 4.25 4.25h15.5c2.35 0 4.25-1.9 4.25-4.25V4.55C24 2.2 22.1.3 19.75.3zm-7.04 16.511h-2.09c-.07.01-.14-.041-.16-.11l-.82-2.4H5.92l-.76 2.36c-.02.09-.1.15-.19.14H3.09c-.11 0-.14-.06-.11-.18L6.2 7.39c.03-.1.06-.19.1-.31.04-.21.06-.43.06-.65-.01-.05.03-.1.08-.11h2.59c.07 0 .12.03.13.08l3.65 10.25c.03.11.001.161-.1.161zm7.851-3.991c-.021.189-.031.33-.041.42-.01.07-.069.13-.14.13-.06 0-.17.01-.33.021-.159.02-.35.029-.579.029-.23 0-.471-.04-.73-.04h-3.17c.039.31.14.62.31.89.181.271.431.48.729.601.4.17.841.26 1.281.25.35-.011.699-.04 1.039-.11.311-.039.61-.119.891-.23.05-.039.08-.02.08.08v1.531c0 .039-.01.08-.021.119-.021.03-.04.051-.069.07-.32.14-.65.24-1 .3-.471.09-.94.13-1.42.12-.761 0-1.4-.12-1.920-.35-.49-.211-.921-.541-1.261-.95-.319-.39-.55-.83-.69-1.31-.14-.471-.209-.961-.209-1.461 0-.539.08-1.070.25-1.590.16-.5.41-.96.75-1.37.33-.4.739-.72 1.209-.95.471-.23 1.03-.31 1.67-.31.531-.01 1.06.09 1.55.31.41.18.77.45 1.05.8.26.34.47.72.601 1.14.129.4.189.81.189 1.22 0 .24-.01.45-.019.64z"
+ fill="#00005B"
+ />
+ </svg>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/ae-tile.tsx b/app/(home)/components/landing/sections/hero/tiles/ae-tile.tsx
new file mode 100644
index 00000000..17c65bc5
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/ae-tile.tsx
@@ -0,0 +1,143 @@
+"use client";
+
+import { AbsoluteFill, Easing, interpolate, useCurrentFrame } from "remotion";
+import { AfterEffectsMark } from "./ae-mark";
+import {
+ aeDuration,
+ COMP_SIZE,
+ type HeroTilesConfig,
+ TILE_SIZE,
+} from "./config";
+
+const clamp = {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+} as const;
+
+const OFFSET = (COMP_SIZE - TILE_SIZE) / 2;
+
+function bounceAt(frame: number, period: number, height: number) {
+ const t = (frame % period) / period;
+ const air = 0.62;
+ if (t < air) {
+ const p = t / air;
+ return { lift: height * 4 * p * (1 - p), squash: 0 };
+ }
+ const land = (t - air) / (1 - air);
+ return {
+ lift: 0,
+ squash: Math.sin(Math.PI * Math.min(land * 2.2, 1)) * 0.06,
+ };
+}
+
+function Beachball({ frame }: { frame: number }) {
+ const size = TILE_SIZE * 0.36;
+ return (
+ <div
+ style={{
+ position: "absolute",
+ left: OFFSET + TILE_SIZE * 0.66,
+ top: OFFSET + TILE_SIZE * 0.62,
+ width: size,
+ height: size,
+ borderRadius: "50%",
+ background:
+ "conic-gradient(from 0deg, #FF3B30, #FF9500, #FFCC00, #34C759, #0A84FF, #BF5AF2, #FF3B30)",
+ transform: `rotate(${frame * 16}deg)`,
+ boxShadow: "0 0 0 4px #FFFFFF, 0 8px 18px #00000040",
+ }}
+ />
+ );
+}
+
+function StallBar({
+ frame,
+ total,
+ stallAt,
+}: {
+ frame: number;
+ total: number;
+ stallAt: number;
+}) {
+ const sprint = interpolate(frame, [0, total * 0.28], [0, stallAt], {
+ ...clamp,
+ easing: Easing.out(Easing.cubic),
+ });
+ const crawl = interpolate(frame, [total * 0.28, total], [0, 0.8], clamp);
+ const value = Math.min(sprint + crawl, 99.9);
+ return (
+ <div
+ style={{
+ position: "absolute",
+ left: TILE_SIZE * 0.14,
+ right: TILE_SIZE * 0.14,
+ bottom: TILE_SIZE * 0.12,
+ height: 14,
+ borderRadius: 7,
+ background: "#00005B99",
+ boxShadow: "inset 0 0 0 2px #9999FF66",
+ overflow: "hidden",
+ }}
+ >
+ <div
+ style={{
+ width: `${value}%`,
+ height: "100%",
+ borderRadius: 7,
+ background: "#9999FF",
+ }}
+ />
+ </div>
+ );
+}
+
+export function AeTileComposition({ config }: { config: HeroTilesConfig }) {
+ const raw = useCurrentFrame();
+ const total = aeDuration(config);
+ const frame = (raw + total - (config.ae.delay % total)) % total;
+ const { mode, period, bounce, tilt, stallAt } = config.ae;
+ const motion =
+ mode === "bounce"
+ ? bounceAt(frame, period, bounce * TILE_SIZE)
+ : { lift: 0, squash: 0 };
+ const dim = mode === "beachball" ? 0.82 : 1;
+
+ return (
+ <AbsoluteFill>
+ <div
+ style={{
+ position: "absolute",
+ left: OFFSET + TILE_SIZE * 0.1,
+ right: OFFSET + TILE_SIZE * 0.1,
+ top: OFFSET + TILE_SIZE * 1.04,
+ height: 24,
+ borderRadius: "50%",
+ background: "#00005B",
+ filter: "blur(14px)",
+ opacity: 0.32 * (1 - motion.lift / (TILE_SIZE * 0.6)),
+ transform: `scale(${1 - motion.lift / (TILE_SIZE * 1.2)})`,
+ }}
+ />
+ <div
+ style={{
+ position: "absolute",
+ left: OFFSET,
+ top: OFFSET,
+ width: TILE_SIZE,
+ height: TILE_SIZE,
+ borderRadius: TILE_SIZE * 0.18,
+ overflow: "hidden",
+ transformOrigin: "50% 100%",
+ transform: `translateY(${-motion.lift}px) rotate(${tilt}deg) scale(${1 + motion.squash}, ${1 - motion.squash})`,
+ filter: dim < 1 ? `brightness(${dim}) saturate(0.7)` : undefined,
+ }}
+ >
+ <AfterEffectsMark className="block size-full" />
+ {mode === "stalled" && (
+ <StallBar frame={frame} total={total} stallAt={stallAt} />
+ )}
+ </div>
+ {mode === "beachball" && <Beachball frame={frame} />}
+ </AbsoluteFill>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/clips.tsx b/app/(home)/components/landing/sections/hero/tiles/clips.tsx
new file mode 100644
index 00000000..141c352c
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/clips.tsx
@@ -0,0 +1,158 @@
+"use client";
+
+import {
+ type ComponentType,
+ type LazyExoticComponent,
+ lazy,
+ Suspense,
+} from "react";
+import { AbsoluteFill, Freeze, Sequence, useCurrentFrame } from "remotion";
+import { cn } from "@/lib/utils";
+import registry from "@/registry/__index__";
+import { previewManifest } from "@/registry/__manifest__";
+import { LANDING_SCENES } from "../../../scenes";
+import { type ClipEnd, type ClipSpec, TILE_SIZE } from "./config";
+
+type AnyComponent = ComponentType<Record<string, unknown>>;
+
+const loaded = new Map<string, AnyComponent>();
+const pending = new Map<string, Promise<AnyComponent>>();
+const lazyCache = new Map<string, LazyExoticComponent<AnyComponent>>();
+
+function previewOf(name: string) {
+ return LANDING_SCENES[name]?.preview ?? previewManifest[name];
+}
+
+function loaderOf(name: string) {
+ if (name in LANDING_SCENES) return LANDING_SCENES[name].load;
+ if (name in registry) return registry[name].load;
+ return undefined;
+}
+
+export function preloadClip(name: string) {
+ let promise = pending.get(name);
+ if (!promise) {
+ const load = loaderOf(name);
+ if (!load) return undefined;
+ promise = load().then(({ default: component }) => {
+ loaded.set(name, component);
+ return component;
+ });
+ pending.set(name, promise);
+ }
+ return promise;
+}
+
+function lazyFor(name: string) {
+ let component = lazyCache.get(name);
+ if (!component) {
+ component = lazy(() =>
+ (loaderOf(name) ?? registry[name].load)().then(
+ ({ default: loadedComponent }) => {
+ loaded.set(name, loadedComponent);
+ return { default: loadedComponent };
+ },
+ ),
+ );
+ lazyCache.set(name, component);
+ }
+ return component;
+}
+
+export const CATALOG = [
+ ...Object.keys(LANDING_SCENES),
+ ...Object.keys(previewManifest).filter((name) => name in registry),
+].sort();
+
+export function nativeDuration(name: string) {
+ return previewOf(name)?.durationInFrames ?? 90;
+}
+
+export function defaultBackground(name: string) {
+ const fill = previewOf(name)?.previewBackdrop;
+ if (fill && fill.type !== "image") return fill.value;
+ return "#0E1012";
+}
+
+export function defaultEnd(name: string): ClipEnd {
+ return name.startsWith("shader-") ? "run" : "hold";
+}
+
+function frameFor(end: ClipEnd, frame: number, native: number) {
+ if (end === "run") return frame;
+ if (end === "loop") return frame % native;
+ return Math.min(frame, native - 1);
+}
+
+type Box = { width: number; height: number };
+
+export function Clip({
+ spec,
+ frame: box = { width: TILE_SIZE, height: TILE_SIZE },
+ canvas,
+ anchor = "center",
+}: {
+ spec: ClipSpec;
+ frame?: Box;
+ canvas?: Box;
+ anchor?: "center" | "bottom-left";
+}) {
+ const local = useCurrentFrame();
+ const preview = previewOf(spec.name);
+ if (!preview || !loaderOf(spec.name)) {
+ return <AbsoluteFill style={{ background: spec.background }} />;
+ }
+ const Ready = loaded.get(spec.name);
+ const Component = Ready ?? lazyFor(spec.name);
+ const width = canvas?.width ?? preview.compositionWidth;
+ const height = canvas?.height ?? preview.compositionHeight;
+ const corner = anchor === "bottom-left";
+ const scale =
+ (corner
+ ? box.width / width
+ : Math.max(box.width / width, box.height / height)) * spec.zoom;
+ const native = preview.durationInFrames;
+ const frame = frameFor(spec.end, local + spec.start, native);
+
+ return (
+ <AbsoluteFill
+ style={{
+ background: spec.background,
+ color: spec.background === "transparent" ? "inherit" : "#0E1012",
+ overflow: "hidden",
+ }}
+ >
+ <div
+ style={{
+ position: "absolute",
+ left: corner ? 0 : (box.width - width) / 2,
+ top: corner ? box.height - height : (box.height - height) / 2,
+ width,
+ height,
+ transform: `scale(${scale})`,
+ transformOrigin: corner ? "bottom left" : undefined,
+ }}
+ className={cn(
+ corner && "[&>*>*]:!items-end [&>*>*]:!justify-start",
+ spec.background === "transparent" && "[&>*>*]:!bg-transparent",
+ )}
+ >
+ <Freeze frame={frame}>
+ <Sequence
+ width={width}
+ height={height}
+ durationInFrames={spec.end === "run" ? 100000 : native}
+ >
+ {Ready ? (
+ <Ready {...preview.defaults} {...spec.props} />
+ ) : (
+ <Suspense fallback={null}>
+ <Component {...preview.defaults} {...spec.props} />
+ </Suspense>
+ )}
+ </Sequence>
+ </Freeze>
+ </div>
+ </AbsoluteFill>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/config.ts b/app/(home)/components/landing/sections/hero/tiles/config.ts
new file mode 100644
index 00000000..489adc08
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/config.ts
@@ -0,0 +1,208 @@
+export const VIDEO_MODES = ["reel", "deck", "flip", "morph"] as const;
+export const AE_MODES = ["bounce", "beachball", "stalled", "static"] as const;
+export const CUTS = [
+ "zoom-blur",
+ "whip-pan",
+ "push-through",
+ "focus-pull",
+ "ripple-zoom",
+ "cut",
+] as const;
+export const TRANSITIONS = ["mixed", ...CUTS] as const;
+export const CLIP_ENDS = ["hold", "loop", "run"] as const;
+
+export type VideoMode = (typeof VIDEO_MODES)[number];
+export type AeMode = (typeof AE_MODES)[number];
+export type CutKind = (typeof CUTS)[number];
+export type TransitionKind = (typeof TRANSITIONS)[number];
+export type ClipEnd = (typeof CLIP_ENDS)[number];
+
+export type ClipSpec = {
+ name: string;
+ start: number;
+ zoom: number;
+ end: ClipEnd;
+ background: string;
+ radius: number;
+ cut: "auto" | CutKind;
+ props: Record<string, unknown>;
+};
+
+export type HeroTilesConfig = {
+ seed: number;
+ video: {
+ mode: VideoMode;
+ clips: ClipSpec[];
+ beat: number;
+ transition: TransitionKind;
+ transitionFrames: number;
+ tilt: number;
+ sway: number;
+ deckDepth: number;
+ morph: number;
+ };
+ ae: {
+ mode: AeMode;
+ period: number;
+ bounce: number;
+ tilt: number;
+ stallAt: number;
+ delay: number;
+ };
+};
+
+export const DEFAULT_CLIPS: ClipSpec[] = [
+ {
+ name: "shader-liquid-metal",
+ start: 0,
+ zoom: 1,
+ end: "run",
+ background: "#2E0727",
+ radius: 0.25,
+ cut: "auto",
+ props: {
+ colorBack: "#2E0727",
+ colorTint: "#FF5FD9",
+ repetition: 2,
+ distortion: 0.18,
+ speed: 0.7,
+ },
+ },
+ {
+ name: "soft-blur-in",
+ start: 0,
+ zoom: 1,
+ end: "hold",
+ background: "#0E1012",
+ radius: 0.5,
+ cut: "auto",
+ props: { text: "Aa", fontSize: 320, color: "#FAFAFA", blur: 24 },
+ },
+ {
+ name: "shader-grain-gradient",
+ start: 0,
+ zoom: 1,
+ end: "run",
+ background: "#12020F",
+ radius: 0.16,
+ cut: "auto",
+ props: {
+ colors: ["#A800B7", "#F472B6", "#3B0764"],
+ colorBack: "#12020F",
+ intensity: 0.35,
+ noise: 0.25,
+ },
+ },
+ {
+ name: "rolling-number",
+ start: 0,
+ zoom: 1,
+ end: "hold",
+ background: "#0E1012",
+ radius: 0.25,
+ cut: "auto",
+ props: { from: 0, to: 99, fontSize: 340, color: "#FAFAFA" },
+ },
+ {
+ name: "icon-sparkles",
+ start: 0,
+ zoom: 0.8,
+ end: "loop",
+ background: "#FDF4FF",
+ radius: 0.5,
+ cut: "auto",
+ props: { color: "#A800B7", strokeWidth: 1.8 },
+ },
+];
+
+export const DEFAULT_CONFIG: HeroTilesConfig = {
+ seed: 1,
+ video: {
+ mode: "reel",
+ clips: DEFAULT_CLIPS,
+ beat: 66,
+ transition: "mixed",
+ transitionFrames: 14,
+ tilt: -6,
+ sway: 4,
+ deckDepth: 2,
+ morph: 0.6,
+ },
+ ae: {
+ mode: "bounce",
+ period: 42,
+ bounce: 0.22,
+ tilt: 5,
+ stallAt: 99,
+ delay: 0,
+ },
+};
+
+export const FPS = 30;
+export const COMP_SIZE = 540;
+export const TILE_SIZE = 300;
+export const PLAYER_INSET = "-40%";
+
+export type Cut = {
+ kind: CutKind;
+ direction: "left" | "right" | "up" | "down";
+};
+
+export type Reel = {
+ clips: ClipSpec[];
+ cuts: Cut[];
+ beat: number;
+ transitionFrames: number;
+ durationInFrames: number;
+};
+
+function mulberry32(seed: number) {
+ let a = seed >>> 0;
+ return () => {
+ a = (a + 0x6d2b79f5) >>> 0;
+ let t = a;
+ t = Math.imul(t ^ (t >>> 15), t | 1);
+ t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
+ return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
+ };
+}
+
+const DIRECTIONS = ["left", "right", "up", "down"] as const;
+const MIXED: CutKind[] = [
+ "zoom-blur",
+ "whip-pan",
+ "push-through",
+ "focus-pull",
+];
+
+export function resolveReel(
+ config: HeroTilesConfig,
+ clips: ClipSpec[] = config.video.clips,
+): Reel {
+ const random = mulberry32(config.seed);
+ const list = clips.length > 0 ? clips : DEFAULT_CLIPS.slice(0, 1);
+ const cuts = list.map((clip): Cut => {
+ const roll = random();
+ const direction = DIRECTIONS[Math.floor(random() * 4)];
+ if (clip.cut !== "auto") return { kind: clip.cut, direction };
+ if (config.video.transition !== "mixed") {
+ return { kind: config.video.transition, direction };
+ }
+ return { kind: MIXED[Math.floor(roll * MIXED.length)], direction };
+ });
+ const transitionFrames = Math.min(
+ config.video.transitionFrames,
+ Math.floor(config.video.beat / 2),
+ );
+ return {
+ clips: list,
+ cuts,
+ beat: config.video.beat,
+ transitionFrames,
+ durationInFrames: list.length * config.video.beat,
+ };
+}
+
+export function aeDuration(config: HeroTilesConfig) {
+ return config.ae.period * 4;
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/hero-tiles.json b/app/(home)/components/landing/sections/hero/tiles/hero-tiles.json
new file mode 100644
index 00000000..216adb9b
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/hero-tiles.json
@@ -0,0 +1,153 @@
+{
+ "seed": 735670345,
+ "video": {
+ "mode": "reel",
+ "clips": [
+ {
+ "name": "soft-blur-in",
+ "start": 0,
+ "zoom": 0.95,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.28,
+ "cut": "cut",
+ "props": {
+ "text": "Aa",
+ "fontSize": 320,
+ "color": "#000",
+ "blur": 24
+ }
+ },
+ {
+ "name": "shader-grain-gradient",
+ "start": 0,
+ "zoom": 1,
+ "end": "run",
+ "background": "#12020F",
+ "radius": 0.16,
+ "cut": "zoom-blur",
+ "props": {
+ "colors": ["#A800B7", "#F472B6", "#3B0764"],
+ "colorBack": "#12020F",
+ "intensity": 0.35,
+ "noise": 0.25
+ }
+ },
+ {
+ "name": "logo-enter",
+ "start": 0,
+ "zoom": 1.65,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "cut",
+ "props": {}
+ },
+ {
+ "name": "word-stream",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "top-down-letters",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "word-push",
+ "start": 0,
+ "zoom": 0.8,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "path-ride",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#ff4d1a",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "gooey-morph",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#141318",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "fog-rise",
+ "start": 0,
+ "zoom": 0.5,
+ "end": "hold",
+ "background": "#ffffff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "trim-burst",
+ "start": 0,
+ "zoom": 1,
+ "end": "loop",
+ "background": "#002fa7",
+ "radius": 0.25,
+ "cut": "cut",
+ "props": {}
+ },
+ {
+ "name": "type-wall",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#2b3bff",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ },
+ {
+ "name": "kinetic-warp",
+ "start": 0,
+ "zoom": 1,
+ "end": "hold",
+ "background": "#0E1012",
+ "radius": 0.25,
+ "cut": "auto",
+ "props": {}
+ }
+ ],
+ "beat": 66,
+ "transition": "cut",
+ "transitionFrames": 14,
+ "tilt": -6,
+ "sway": 4,
+ "deckDepth": 2,
+ "morph": 0.6
+ },
+ "ae": {
+ "mode": "stalled",
+ "period": 50,
+ "bounce": 0.05,
+ "tilt": 2,
+ "stallAt": 99,
+ "delay": 0
+ }
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/hero-tiles.tsx b/app/(home)/components/landing/sections/hero/tiles/hero-tiles.tsx
new file mode 100644
index 00000000..82f630e1
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/hero-tiles.tsx
@@ -0,0 +1,63 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import { AfterEffectsMark } from "./ae-mark";
+import { aeDuration, type HeroTilesConfig, resolveReel } from "./config";
+import saved from "./hero-tiles.json";
+import { TilePlayer } from "./tile-player";
+
+const config = saved as HeroTilesConfig;
+const reel = resolveReel(config);
+const firstClip = reel.clips[0];
+
+const loadVideoTile = () =>
+ import("./video-tile").then((m) => ({ default: m.VideoTileComposition }));
+const loadAeTile = () =>
+ import("./ae-tile").then((m) => ({ default: m.AeTileComposition }));
+
+const PLACEHOLDER = "absolute inset-0 block [transform-origin:50%_50%]";
+
+export function HeroVideoTile({ className }: { className?: string }) {
+ return (
+ <TilePlayer
+ lazyComponent={loadVideoTile}
+ config={config}
+ durationInFrames={reel.durationInFrames}
+ stillFrame={Math.round(config.video.beat * 0.7)}
+ className={className}
+ placeholder={
+ <span
+ className={cn(
+ PLACEHOLDER,
+ "shadow-[0_1px_2px_#0E10120F,0_5px_10px_#0E101214,0_11px_22px_#0E101214]",
+ )}
+ style={{
+ background: firstClip.background,
+ borderRadius: `${firstClip.radius * 100}%`,
+ transform: `rotate(${config.video.tilt}deg)`,
+ }}
+ />
+ }
+ />
+ );
+}
+
+export function HeroAeTile({ className }: { className?: string }) {
+ return (
+ <TilePlayer
+ lazyComponent={loadAeTile}
+ config={config}
+ durationInFrames={aeDuration(config)}
+ stillFrame={Math.round(aeDuration(config) * 0.5)}
+ className={className}
+ placeholder={
+ <span
+ className={cn(PLACEHOLDER, "overflow-clip rounded-[18%]")}
+ style={{ transform: `rotate(${config.ae.tilt}deg)` }}
+ >
+ <AfterEffectsMark className="block size-full" />
+ </span>
+ }
+ />
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/tile-player.tsx b/app/(home)/components/landing/sections/hero/tiles/tile-player.tsx
new file mode 100644
index 00000000..8ad32a5b
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/tile-player.tsx
@@ -0,0 +1,120 @@
+"use client";
+
+import { Player, type PlayerRef } from "@remotion/player";
+import { useReducedMotion } from "motion/react";
+import {
+ type ComponentType,
+ type ReactNode,
+ useEffect,
+ useRef,
+ useState,
+} from "react";
+import { cn } from "@/lib/utils";
+import { COMP_SIZE, FPS, type HeroTilesConfig, PLAYER_INSET } from "./config";
+
+export type TilePlayback =
+ | "playing"
+ | "paused"
+ | "reduced-motion"
+ | "offscreen";
+
+type TileComponent = ComponentType<{ config: HeroTilesConfig }>;
+
+type Source =
+ | { component: TileComponent; lazyComponent?: never }
+ | {
+ lazyComponent: () => Promise<{ default: TileComponent }>;
+ component?: never;
+ };
+
+export function TilePlayer({
+ config,
+ durationInFrames,
+ stillFrame = 0,
+ respectReducedMotion = true,
+ placeholder,
+ onPlayback,
+ className,
+ ...source
+}: Source & {
+ config: HeroTilesConfig;
+ durationInFrames: number;
+ stillFrame?: number;
+ respectReducedMotion?: boolean;
+ placeholder?: ReactNode;
+ onPlayback?: (state: TilePlayback) => void;
+ className?: string;
+}) {
+ const playerRef = useRef<PlayerRef>(null);
+ const containerRef = useRef<HTMLSpanElement>(null);
+ const reducedMotion = (useReducedMotion() ?? false) && respectReducedMotion;
+ const [visible, setVisible] = useState(true);
+ const [mounted, setMounted] = useState(false);
+
+ useEffect(() => setMounted(true), []);
+
+ useEffect(() => {
+ const node = containerRef.current;
+ if (!node) return;
+ const observer = new IntersectionObserver(
+ ([entry]) => setVisible(entry.isIntersecting),
+ { rootMargin: "200px" },
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ useEffect(() => {
+ if (!mounted) return;
+ const player = playerRef.current;
+ if (reducedMotion || !visible) {
+ player?.pause();
+ if (reducedMotion) player?.seekTo(stillFrame);
+ onPlayback?.(reducedMotion ? "reduced-motion" : "offscreen");
+ return;
+ }
+ const ensure = () => {
+ const current = playerRef.current;
+ if (!current || document.hidden) return;
+ if (!current.isPlaying()) current.play();
+ onPlayback?.(current.isPlaying() ? "playing" : "paused");
+ };
+ ensure();
+ const id = window.setInterval(ensure, 400);
+ return () => window.clearInterval(id);
+ }, [mounted, reducedMotion, visible, stillFrame, onPlayback]);
+
+ const total = Math.max(durationInFrames, 1);
+
+ return (
+ <span
+ ref={containerRef}
+ className={cn("relative block shrink-0", className)}
+ >
+ {!mounted && placeholder}
+ {mounted && (
+ <span
+ className="pointer-events-none absolute block"
+ style={{ inset: PLAYER_INSET }}
+ >
+ <Player
+ ref={playerRef}
+ {...source}
+ inputProps={{ config }}
+ durationInFrames={total}
+ initialFrame={Math.min(stillFrame, total - 1)}
+ fps={FPS}
+ compositionWidth={COMP_SIZE}
+ compositionHeight={COMP_SIZE}
+ style={{ width: "100%", height: "100%", background: "transparent" }}
+ controls={false}
+ loop
+ initiallyMuted
+ numberOfSharedAudioTags={0}
+ acknowledgeRemotionLicense
+ />
+ </span>
+ )}
+ </span>
+ );
+}
diff --git a/app/(home)/components/landing/sections/hero/tiles/video-tile.tsx b/app/(home)/components/landing/sections/hero/tiles/video-tile.tsx
new file mode 100644
index 00000000..5369451e
--- /dev/null
+++ b/app/(home)/components/landing/sections/hero/tiles/video-tile.tsx
@@ -0,0 +1,392 @@
+"use client";
+
+import { linearTiming, TransitionSeries } from "@remotion/transitions";
+import { type CSSProperties, type ReactNode, useEffect } from "react";
+import {
+ AbsoluteFill,
+ Easing,
+ interpolate,
+ Sequence,
+ useCurrentFrame,
+} from "remotion";
+import { focusPull } from "@/registry/remocn/focus-pull";
+import { pushThrough } from "@/registry/remocn/push-through";
+import { rippleZoom } from "@/registry/remocn/ripple-zoom";
+import { whipPan } from "@/registry/remocn/whip-pan";
+import { zoomBlur } from "@/registry/remocn/zoom-blur";
+import { Clip, preloadClip } from "./clips";
+import {
+ COMP_SIZE,
+ type Cut,
+ type HeroTilesConfig,
+ type Reel,
+ resolveReel,
+ TILE_SIZE,
+} from "./config";
+
+const clamp = {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+} as const;
+
+const SHADOW =
+ "inset 0 3px 0 #FFFFFF59, 0 3px 6px #0E10120F, 0 14px 28px #0E101214, 0 32px 64px #0E101214";
+
+function cutCenters(reel: Reel) {
+ const half = Math.round(reel.transitionFrames / 2);
+ return Array.from(
+ { length: reel.clips.length + 1 },
+ (_, k) => k * reel.beat - half,
+ );
+}
+
+function swayAt(frame: number, centers: number[], amount: number) {
+ let last = centers[0];
+ for (const center of centers) if (center <= frame) last = center;
+ const t = Math.max(0, frame - last);
+ return amount * Math.sin((2 * Math.PI * t) / 16) * Math.exp(-t / 11);
+}
+
+function transition(cut: Cut, frames: number, key: string) {
+ const timing = linearTiming({ durationInFrames: frames });
+ switch (cut.kind) {
+ case "whip-pan":
+ return (
+ <TransitionSeries.Transition
+ key={key}
+ timing={timing}
+ presentation={whipPan({ direction: cut.direction, blur: 18 })}
+ />
+ );
+ case "zoom-blur":
+ return (
+ <TransitionSeries.Transition
+ key={key}
+ timing={timing}
+ presentation={zoomBlur({ blur: 14 })}
+ />
+ );
+ case "push-through":
+ return (
+ <TransitionSeries.Transition
+ key={key}
+ timing={timing}
+ presentation={pushThrough({})}
+ />
+ );
+ case "focus-pull":
+ return (
+ <TransitionSeries.Transition
+ key={key}
+ timing={timing}
+ presentation={focusPull({})}
+ />
+ );
+ case "ripple-zoom":
+ return (
+ <TransitionSeries.Transition
+ key={key}
+ timing={timing}
+ presentation={rippleZoom({})}
+ />
+ );
+ case "cut":
+ return (
+ <TransitionSeries.Transition
+ key={key}
+ timing={timing}
+ presentation={hardCut()}
+ />
+ );
+ }
+}
+
+function ReelContent({ reel }: { reel: Reel }) {
+ const tf = reel.transitionFrames;
+ const items: ReactNode[] = [];
+ const clips = [...reel.clips, reel.clips[0]];
+ clips.forEach((spec, i) => {
+ const last = i === clips.length - 1;
+ const first = i === 0;
+ const duration = last ? tf : first ? reel.beat : reel.beat + tf;
+ items.push(
+ <TransitionSeries.Sequence
+ key={`s-${i}`}
+ durationInFrames={Math.max(1, duration)}
+ >
+ {first ? (
+ <Sequence from={-tf}>
+ <Clip spec={spec} />
+ </Sequence>
+ ) : (
+ <Clip spec={spec} />
+ )}
+ </TransitionSeries.Sequence>,
+ );
+ if (!last && tf > 0) {
+ items.push(transition(reel.cuts[i], tf, `t-${i}`));
+ }
+ });
+ return <TransitionSeries>{items}</TransitionSeries>;
+}
+
+function hardCut() {
+ return {
+ component: ({
+ children,
+ presentationProgress,
+ presentationDirection,
+ }: {
+ children: ReactNode;
+ presentationProgress: number;
+ presentationDirection: "entering" | "exiting";
+ }) => {
+ const visible =
+ presentationDirection === "entering"
+ ? presentationProgress >= 0.5
+ : presentationProgress < 0.5;
+ return (
+ <AbsoluteFill style={{ opacity: visible ? 1 : 0 }}>
+ {children}
+ </AbsoluteFill>
+ );
+ },
+ props: {},
+ };
+}
+
+function HardCutContent({ reel, extend = 0 }: { reel: Reel; extend?: number }) {
+ const centers = cutCenters(reel);
+ return (
+ <>
+ {[...reel.clips, reel.clips[0]].map((spec, i) => (
+ <Sequence
+ key={`${spec.name}-${i}`}
+ from={centers[i]}
+ durationInFrames={reel.beat + extend}
+ >
+ <Clip spec={spec} />
+ </Sequence>
+ ))}
+ </>
+ );
+}
+
+function Shell({
+ radius,
+ style,
+ children,
+}: {
+ radius: number;
+ style?: CSSProperties;
+ children: ReactNode;
+}) {
+ return (
+ <div
+ style={{
+ position: "absolute",
+ left: (COMP_SIZE - TILE_SIZE) / 2,
+ top: (COMP_SIZE - TILE_SIZE) / 2,
+ width: TILE_SIZE,
+ height: TILE_SIZE,
+ borderRadius: radius * TILE_SIZE,
+ overflow: "hidden",
+ boxShadow: SHADOW,
+ isolation: "isolate",
+ ...style,
+ }}
+ >
+ {children}
+ <div
+ style={{
+ position: "absolute",
+ inset: 0,
+ borderRadius: "inherit",
+ boxShadow: "inset 0 3px 0 #FFFFFF59",
+ pointerEvents: "none",
+ }}
+ />
+ </div>
+ );
+}
+
+function ReelMode({ config, reel }: { config: HeroTilesConfig; reel: Reel }) {
+ const frame = useCurrentFrame();
+ const rotate =
+ config.video.tilt + swayAt(frame, cutCenters(reel), config.video.sway);
+ return (
+ <Shell
+ radius={reel.clips[0]?.radius ?? 0.25}
+ style={{ transform: `rotate(${rotate}deg)` }}
+ >
+ <ReelContent reel={reel} />
+ </Shell>
+ );
+}
+
+function MorphMode({ config, reel }: { config: HeroTilesConfig; reel: Reel }) {
+ const frame = useCurrentFrame();
+ const centers = cutCenters(reel);
+ const tf = Math.max(reel.transitionFrames, 1);
+ const shapes = [...reel.clips, reel.clips[0]].map((spec) => spec.radius);
+ let index = 0;
+ centers.forEach((center, k) => {
+ if (center <= frame) index = k;
+ });
+ const center = centers[Math.min(index + 1, centers.length - 1)];
+ const p = interpolate(frame, [center - tf / 2, center + tf / 2], [0, 1], {
+ ...clamp,
+ easing: Easing.inOut(Easing.cubic),
+ });
+ const from = shapes[index] ?? 0.25;
+ const to = shapes[Math.min(index + 1, shapes.length - 1)] ?? from;
+ const radius = from + (to - from) * p;
+ const squash = Math.sin(Math.PI * p) * 0.1 * config.video.morph;
+ const rotate = config.video.tilt + swayAt(frame, centers, config.video.sway);
+ return (
+ <Shell
+ radius={radius}
+ style={{
+ transform: `rotate(${rotate}deg) scale(${1 + squash}, ${1 - squash})`,
+ }}
+ >
+ <ReelContent reel={reel} />
+ </Shell>
+ );
+}
+
+function FlipMode({ config, reel }: { config: HeroTilesConfig; reel: Reel }) {
+ const frame = useCurrentFrame();
+ const centers = cutCenters(reel);
+ const half = Math.max(Math.round(reel.transitionFrames / 2), 1);
+ let angle = 0;
+ for (const center of centers) {
+ if (frame >= center - half && frame < center) {
+ angle = interpolate(frame, [center - half, center], [0, 90], {
+ ...clamp,
+ easing: Easing.in(Easing.cubic),
+ });
+ } else if (frame >= center && frame <= center + half) {
+ angle = interpolate(frame, [center, center + half], [-90, 0], {
+ ...clamp,
+ easing: Easing.out(Easing.back(1.6)),
+ });
+ }
+ }
+ const rotate = config.video.tilt + swayAt(frame, centers, config.video.sway);
+ return (
+ <AbsoluteFill style={{ perspective: 900 }}>
+ <Shell
+ radius={0.25}
+ style={{ transform: `rotate(${rotate}deg) rotateY(${angle}deg)` }}
+ >
+ <HardCutContent reel={reel} />
+ </Shell>
+ </AbsoluteFill>
+ );
+}
+
+function deckPose(slot: number, tilt: number) {
+ return {
+ rotate: tilt + slot * 7,
+ x: slot * 16,
+ y: slot * -10,
+ scale: 1 - slot * 0.07,
+ };
+}
+
+function DeckMode({ config, reel }: { config: HeroTilesConfig; reel: Reel }) {
+ const frame = useCurrentFrame();
+ const centers = cutCenters(reel);
+ const tf = Math.max(reel.transitionFrames, 1);
+ const depth = config.video.deckDepth;
+ const ordered = [...reel.clips, reel.clips[0]];
+ let index = 0;
+ centers.forEach((center, k) => {
+ if (center <= frame) index = k;
+ });
+ const p = interpolate(frame, [centers[index], centers[index] + tf], [0, 1], {
+ ...clamp,
+ easing: Easing.out(Easing.cubic),
+ });
+ const sway = swayAt(frame, centers, config.video.sway);
+ const at = (slot: number) => {
+ const a = deckPose(slot + 1, config.video.tilt);
+ const b = deckPose(slot, config.video.tilt);
+ return {
+ rotate: a.rotate + (b.rotate - a.rotate) * p,
+ x: a.x + (b.x - a.x) * p,
+ y: a.y + (b.y - a.y) * p,
+ scale: a.scale + (b.scale - a.scale) * p,
+ };
+ };
+ const transform = (pose: ReturnType<typeof at>, extra = 0) =>
+ `translate(${pose.x}px, ${pose.y}px) rotate(${pose.rotate + extra}deg) scale(${pose.scale})`;
+
+ const backs = Array.from({ length: depth }, (_, k) => depth - k);
+ const outgoing = index > 0 ? ordered[index - 1] : ordered[ordered.length - 2];
+ const fly = interpolate(
+ frame,
+ [centers[index], centers[index] + tf],
+ [0, 1],
+ {
+ ...clamp,
+ easing: Easing.in(Easing.quad),
+ },
+ );
+
+ return (
+ <AbsoluteFill>
+ {backs.map((slot) => {
+ const spec = ordered[(index + slot) % reel.clips.length];
+ return (
+ <Shell
+ key={`back-${slot}`}
+ radius={0.25}
+ style={{
+ transform: transform(at(slot)),
+ background: spec.background,
+ boxShadow: "0 3px 6px #0E10120D, 0 14px 28px #0E101210",
+ }}
+ >
+ <div />
+ </Shell>
+ );
+ })}
+ <Shell radius={0.25} style={{ transform: transform(at(0), sway) }}>
+ <HardCutContent reel={reel} extend={tf} />
+ </Shell>
+ {fly < 1 && (
+ <Shell
+ radius={0.25}
+ style={{
+ transform: `translate(${fly * 150}px, ${fly * -120}px) rotate(${config.video.tilt + fly * 28}deg) scale(${1 - fly * 0.1})`,
+ opacity: 1 - fly,
+ }}
+ >
+ <Sequence from={centers[index] - reel.beat}>
+ <Clip spec={outgoing} />
+ </Sequence>
+ </Shell>
+ )}
+ </AbsoluteFill>
+ );
+}
+
+export function VideoTileComposition({ config }: { config: HeroTilesConfig }) {
+ const reel = resolveReel(config);
+ const names = reel.clips.map((clip) => clip.name).join(",");
+ useEffect(() => {
+ for (const name of names.split(",")) preloadClip(name);
+ }, [names]);
+ switch (config.video.mode) {
+ case "reel":
+ return <ReelMode config={config} reel={reel} />;
+ case "morph":
+ return <MorphMode config={config} reel={reel} />;
+ case "flip":
+ return <FlipMode config={config} reel={reel} />;
+ case "deck":
+ return <DeckMode config={config} reel={reel} />;
+ }
+}
diff --git a/app/(home)/components/landing/sections/how-it-works.tsx b/app/(home)/components/landing/sections/how-it-works.tsx
new file mode 100644
index 00000000..2a4e910a
--- /dev/null
+++ b/app/(home)/components/landing/sections/how-it-works.tsx
@@ -0,0 +1,49 @@
+import { LandingButton } from "../ui/landing-button";
+import { SectionTitle } from "../ui/section-title";
+import { AgentSession } from "./how-it-works/agent-session";
+import { StepsLegend } from "./how-it-works/steps-legend";
+
+const SETUP_GUIDE_HREF = "/docs/guides/setup";
+
+export function HowItWorks() {
+ return (
+ <section
+ data-section="how-it-works"
+ className="pt-[72px] xl:pt-[120px] xl:pb-[140px]"
+ >
+ <div className="landing-container flex flex-col gap-8 xl:flex-row xl:items-center xl:gap-[60px]">
+ <div className="flex flex-col gap-[18px] md:gap-[22px] xl:w-[420px] xl:shrink-0 xl:pt-3">
+ <SectionTitle
+ title="How it works"
+ continuation="The whole setup is one session."
+ className="text-[34px]/[36px] text-wrap md:text-h2"
+ />
+ <p
+ data-reveal
+ className="text-ui leading-6 text-paragraph [--reveal-i:2] md:text-[18px] md:leading-[27px]"
+ >
+ An agent, an empty folder and a single prompt. You describe, it
+ builds, you watch it happen.
+ </p>
+ <StepsLegend />
+ <div data-reveal className="pt-1.5 [--reveal-i:6] md:pt-2">
+ <LandingButton
+ href={SETUP_GUIDE_HREF}
+ variant="secondary"
+ size="md"
+ meta="10 min"
+ arrow="→"
+ className="w-full md:w-auto"
+ data-track="cta_clicked"
+ data-cta="how_it_works_setup"
+ data-destination={SETUP_GUIDE_HREF}
+ >
+ Read the setup guide
+ </LandingButton>
+ </div>
+ </div>
+ <AgentSession />
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/how-it-works/agent-session.tsx b/app/(home)/components/landing/sections/how-it-works/agent-session.tsx
new file mode 100644
index 00000000..c35307c6
--- /dev/null
+++ b/app/(home)/components/landing/sections/how-it-works/agent-session.tsx
@@ -0,0 +1,174 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { ClaudeIcon } from "../../ui/brand-icons";
+import { SessionPlayer } from "./session-player";
+
+type SessionStep =
+ | { kind: "command"; text: string }
+ | {
+ kind: "prompt";
+ /** Rendered as one paragraph on desktop, one line each on mobile. */
+ lines: string[];
+ checks: string[];
+ }
+ | { kind: "preview"; status: string };
+
+const BLOCK_AT = ["[--at:300ms]", "[--at:1600ms]", "[--at:3400ms]"];
+
+const CHECK_AT = ["[--at:2100ms]", "[--at:2500ms]", "[--at:2900ms]"];
+
+const SESSION_STEPS: SessionStep[] = [
+ { kind: "command", text: "$ mkdir acme-launch && cd acme-launch && claude" },
+ {
+ kind: "prompt",
+ lines: [
+ "› Set up a new Remotion video project in this folder, then install the remocn agent skill:",
+ "npx skills add Remocn/remocn --yes.",
+ "When you're done, start the preview studio.",
+ ],
+ checks: [
+ "✓ Remotion project created",
+ "✓ remocn skill installed",
+ "✓ Preview studio running",
+ ],
+ },
+ { kind: "preview", status: "▸ localhost:3000 opened in your browser" },
+];
+
+/** The dark Claude Code window: title bar plus the three numbered blocks. */
+export function AgentSession() {
+ return (
+ <figure
+ aria-label="A Claude Code session that sets up remocn and opens a preview"
+ data-reveal="scale"
+ data-seq
+ className="flex w-full min-w-0 flex-col rounded-panel bg-dark-surface p-1.5 md:rounded-shell md:p-2 xl:grow"
+ >
+ <SessionTitleBar />
+ <ol>
+ {SESSION_STEPS.map((step, i) => (
+ <SessionBlock
+ key={step.kind}
+ index={i + 1}
+ accent={i === SESSION_STEPS.length - 1}
+ className={cn(
+ BLOCK_AT[i],
+ step.kind === "preview" &&
+ "px-2 pt-3.5 pb-2 md:px-5 md:pt-4 md:pb-5",
+ )}
+ >
+ <SessionStepBody step={step} />
+ </SessionBlock>
+ ))}
+ </ol>
+ </figure>
+ );
+}
+
+function SessionTitleBar() {
+ return (
+ <div className="flex h-10 shrink-0 items-center justify-between px-3 md:h-11 md:px-4">
+ <span aria-hidden="true" className="flex w-[42px] shrink-0 gap-1.5">
+ {[0, 1, 2].map((dot) => (
+ <span
+ key={dot}
+ className="size-[9px] shrink-0 rounded-full bg-[#3A3E42] md:size-2.5"
+ />
+ ))}
+ </span>
+ <span className="flex min-w-0 items-center gap-2">
+ <ClaudeIcon className="size-4 shrink-0" />
+ <span className="text-small leading-[18px] whitespace-nowrap text-[#FAFAFA]">
+ Claude Code
+ </span>
+ <span className="truncate font-mono text-mono text-dark-muted">
+ ~/acme-launch
+ </span>
+ </span>
+ <span aria-hidden="true" className="w-[42px] shrink-0" />
+ </div>
+ );
+}
+
+/**
+ * One numbered block of the session. A two-column grid: the badge, then the
+ * content; anything after the first content row (the player) spans both
+ * columns on mobile and stays in the content column on desktop.
+ */
+function SessionBlock({
+ index,
+ accent,
+ className,
+ children,
+}: {
+ index: number;
+ accent?: boolean;
+ className?: string;
+ children: ReactNode;
+}) {
+ return (
+ <li
+ className={cn(
+ "seq-in grid grid-cols-[22px_minmax(0,1fr)] items-start gap-x-3 gap-y-3 overflow-clip border-t border-dark-control p-3.5 md:gap-x-4 md:px-5 md:py-4",
+ className,
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className={`seq-pop flex size-[22px] shrink-0 items-center justify-center rounded-[7px] text-caption md:text-micro ${
+ accent
+ ? "ml-1.5 bg-primary text-white md:row-span-2 md:ml-0"
+ : "bg-[#2A2D30] text-[#FAFAFA]"
+ }`}
+ >
+ {index}
+ </span>
+ {children}
+ </li>
+ );
+}
+
+function SessionStepBody({ step }: { step: SessionStep }) {
+ switch (step.kind) {
+ case "command":
+ return (
+ <p className="seq-type font-mono text-mono leading-[22px] whitespace-nowrap text-dark-body [--at:450ms] [--dur:1000ms] [--steps:47] md:text-small md:leading-6">
+ {step.text}
+ </p>
+ );
+ case "prompt":
+ return (
+ <div className="flex min-w-0 flex-col gap-3 font-mono text-mono leading-5 md:text-small md:leading-6">
+ <p className="text-[#FAFAFA]">
+ {step.lines.map((line, i) => (
+ <span key={line} className="block md:inline">
+ {i > 0 && " "}
+ {line}
+ </span>
+ ))}
+ </p>
+ <ul className="text-[#8A949A]">
+ {step.checks.map((check, i) => (
+ <li
+ key={check}
+ className={cn("seq-in whitespace-nowrap", CHECK_AT[i])}
+ >
+ {check}
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+ case "preview":
+ return (
+ <>
+ <p className="seq-type self-center font-mono [--at:3500ms] [--dur:700ms] [--steps:39] text-mono leading-[18px] whitespace-nowrap text-primary-soft md:self-start md:text-small md:leading-[18px]">
+ {step.status}
+ </p>
+ <div className="seq-in col-span-2 [--at:4000ms] md:col-span-1 md:col-start-2">
+ <SessionPlayer />
+ </div>
+ </>
+ );
+ }
+}
diff --git a/app/(home)/components/landing/sections/how-it-works/session-player.tsx b/app/(home)/components/landing/sections/how-it-works/session-player.tsx
new file mode 100644
index 00000000..4eeda1f7
--- /dev/null
+++ b/app/(home)/components/landing/sections/how-it-works/session-player.tsx
@@ -0,0 +1,53 @@
+/** Timeline marks; the 1px ticks sit between them. */
+const MARKS = ["0s", "4s", "8s", "13s"] as const;
+const ACTIVE_MARK = "4s";
+
+/**
+ * The preview the agent opens in block 3: the violet shader with a title
+ * and a mini scrubber (play glyph, marked timeline with a selected range,
+ * timecode). Static mock, no playback.
+ */
+export function SessionPlayer() {
+ return (
+ <div
+ className="flex h-[190px] shrink-0 flex-col justify-end gap-2.5 overflow-clip rounded-cta bg-cover p-3.5 md:h-[200px] md:px-5 md:py-[18px]"
+ style={{
+ backgroundImage:
+ "linear-gradient(in oklab 0deg, #0A040E99 0%, #0A040E00 60%), url(/landing/shader-violet.png)",
+ backgroundPosition: "50%",
+ }}
+ >
+ <p className="seq-arrive text-[28px] leading-[28px] [--at:4300ms] font-medium tracking-display text-white md:text-[34px] md:leading-[34px]">
+ Ship it on Tuesday.
+ </p>
+ <div aria-hidden="true" className="flex items-center gap-2 md:gap-2.5">
+ <span className="size-0 shrink-0 border-y-[5px] border-l-8 border-y-transparent border-l-white" />
+ <div className="relative flex h-8 min-w-0 grow items-center justify-between overflow-clip rounded-[9px] bg-[#0E1012B8] px-2.5 text-mono tabular-nums leading-[14px] md:h-[34px] md:px-3 md:text-micro">
+ {MARKS.map((mark, i) => (
+ <Mark key={mark} label={mark} withTick={i > 0} />
+ ))}
+ <span className="seq-draw absolute top-1 left-[24%] origin-left [--at:4600ms] [--dur:900ms] h-6 w-[30%] rounded-[7px] border border-white/12 bg-white/14 md:left-[18%] md:h-[26px] md:w-[32%]">
+ <span className="absolute top-1/2 left-[3px] h-[11px] w-[3px] -translate-y-1/2 rounded-[2px] bg-[#FAFAFA]" />
+ <span className="absolute top-1/2 right-[3px] h-[11px] w-[3px] -translate-y-1/2 rounded-[2px] bg-[#FAFAFA]" />
+ </span>
+ </div>
+ <span className="shrink-0 text-mono leading-[14px] whitespace-nowrap text-white/80 tabular-nums md:text-micro">
+ 0:04 / 0:13
+ </span>
+ </div>
+ </div>
+ );
+}
+
+function Mark({ label, withTick }: { label: string; withTick: boolean }) {
+ return (
+ <>
+ {withTick && <span className="h-2.5 w-px shrink-0 bg-[#4A4E52]" />}
+ <span
+ className={label === ACTIVE_MARK ? "text-[#FAFAFA]" : "text-dark-body"}
+ >
+ {label}
+ </span>
+ </>
+ );
+}
diff --git a/app/(home)/components/landing/sections/how-it-works/steps-legend.tsx b/app/(home)/components/landing/sections/how-it-works/steps-legend.tsx
new file mode 100644
index 00000000..7963402e
--- /dev/null
+++ b/app/(home)/components/landing/sections/how-it-works/steps-legend.tsx
@@ -0,0 +1,34 @@
+const STEPS = [
+ "Open an agent in an empty folder",
+ "Paste one prompt",
+ "A player opens in your browser",
+] as const;
+
+/** Numbered 1-2-3 legend; the last step is the fuchsia "payoff" one. */
+export function StepsLegend() {
+ return (
+ <ol
+ data-reveal="stagger"
+ className="flex flex-col gap-3 pt-1 [--stagger-base:240ms] md:pt-2.5"
+ >
+ {STEPS.map((label, i) => {
+ const last = i === STEPS.length - 1;
+ return (
+ <li key={label} className="flex items-center gap-3">
+ <span
+ aria-hidden="true"
+ className={`flex size-[26px] shrink-0 items-center justify-center rounded-tile text-caption md:text-mono ${
+ last ? "bg-primary text-white" : "bg-foreground text-background"
+ }`}
+ >
+ {i + 1}
+ </span>
+ <span className="text-ui leading-[22px] text-foreground md:text-button-lg">
+ {label}
+ </span>
+ </li>
+ );
+ })}
+ </ol>
+ );
+}
diff --git a/app/(home)/components/landing/sections/sponsors-strip.tsx b/app/(home)/components/landing/sections/sponsors-strip.tsx
new file mode 100644
index 00000000..dc904601
--- /dev/null
+++ b/app/(home)/components/landing/sections/sponsors-strip.tsx
@@ -0,0 +1,93 @@
+import { activeSponsors, getLandingSponsors } from "@/config/sponsors";
+import { cn } from "@/lib/utils";
+import { SponsorCarousel } from "./sponsors-strip/sponsor-carousel";
+import {
+ PinnedSponsorCell,
+ SponsorButton,
+} from "./sponsors-strip/sponsor-cells";
+
+const pinned = activeSponsors.find((sponsor) => sponsor.tier === "legendary");
+const rotating = getLandingSponsors().filter(
+ (sponsor) => sponsor.id !== pinned?.id,
+);
+const teamCount = activeSponsors.length;
+
+const MOBILE_CELLS = [
+ "w-[150px] border-r border-secondary md:flex-1",
+ "w-40 border-r border-secondary md:flex-1",
+ "w-[150px] md:flex-1",
+];
+
+const DESKTOP_CELLS = Array.from(
+ { length: 3 },
+ () => "min-w-0 flex-1 overflow-clip",
+);
+
+/** Full-bleed hairline that fades out toward both page edges. */
+const HAIRLINE =
+ "pointer-events-none absolute inset-x-0 h-px bg-[linear-gradient(90deg_in_oklab,#E4E5E700_0%,#E4E5E7_22%,#E4E5E7_78%,#E4E5E700_100%)] max-lg:hidden dark:bg-[linear-gradient(90deg,transparent_0%,var(--color-secondary)_22%,var(--color-secondary)_78%,transparent_100%)]";
+
+function StripLead() {
+ return (
+ <div className="flex flex-col gap-0.5 lg:w-[180px] lg:shrink-0">
+ <p className="text-[15px] leading-5 font-medium text-foreground">
+ Sponsored by
+ </p>
+ <p className="text-caption text-muted-foreground">
+ {teamCount} teams keep it free
+ </p>
+ </div>
+ );
+}
+
+export function SponsorsStrip() {
+ return (
+ <section
+ data-section="sponsors-strip"
+ aria-label="Sponsors"
+ className="relative pt-14 lg:py-10"
+ >
+ <span
+ aria-hidden="true"
+ data-reveal="draw"
+ className={cn(HAIRLINE, "top-10")}
+ />
+ <span
+ aria-hidden="true"
+ data-reveal="draw"
+ className={cn(HAIRLINE, "top-[135px] [--reveal-i:1]")}
+ />
+
+ {/* Mobile / tablet: lead + button, then a swipeable bar of logos. */}
+ <div className="lg:hidden">
+ <div
+ data-reveal
+ className="landing-container flex items-center justify-between"
+ >
+ <StripLead />
+ <SponsorButton />
+ </div>
+ <div
+ data-reveal="stagger"
+ className="mt-4 flex h-20 overflow-x-auto border-y border-secondary [scrollbar-width:none] [&::-webkit-scrollbar]:hidden"
+ >
+ {pinned && <PinnedSponsorCell sponsor={pinned} />}
+ <SponsorCarousel sponsors={rotating} cellClassNames={MOBILE_CELLS} />
+ </div>
+ </div>
+
+ {/* Desktop: one 96px row inside the content column. */}
+ <div
+ data-reveal="stagger"
+ className="landing-container flex h-24 items-center max-lg:hidden"
+ >
+ <StripLead />
+ {pinned && <PinnedSponsorCell sponsor={pinned} />}
+ <SponsorCarousel sponsors={rotating} cellClassNames={DESKTOP_CELLS} />
+ <div className="ml-4 shrink-0">
+ <SponsorButton />
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/sponsors-strip/sponsor-carousel.tsx b/app/(home)/components/landing/sections/sponsors-strip/sponsor-carousel.tsx
new file mode 100644
index 00000000..767a6edc
--- /dev/null
+++ b/app/(home)/components/landing/sections/sponsors-strip/sponsor-carousel.tsx
@@ -0,0 +1,106 @@
+"use client";
+
+import { AnimatePresence, motion, useReducedMotion } from "motion/react";
+import Link from "next/link";
+import { useEffect, useRef, useState } from "react";
+import type { Sponsor } from "@/config/sponsors";
+import { cn } from "@/lib/utils";
+import { CELL } from "./sponsor-cells";
+import { SponsorLogo } from "./sponsor-logo";
+
+const STEP_MS = 2400;
+const WAVE_S = 0.125;
+const EASE = [0.25, 0.46, 0.45, 0.94] as const;
+
+// Transform strings, not `y`, so the swap runs off the main thread.
+const SWAP = {
+ initial: { opacity: 0, transform: "translateY(60%)", filter: "blur(2px)" },
+ animate: { opacity: 1, transform: "translateY(0%)", filter: "blur(0px)" },
+ exit: { opacity: 0, transform: "translateY(-50%)", filter: "blur(3px)" },
+};
+
+const FADE = {
+ initial: { opacity: 0 },
+ animate: { opacity: 1 },
+ exit: { opacity: 0 },
+};
+
+function dealColumns(sponsors: Sponsor[], count: number) {
+ return Array.from({ length: count }, (_, column) =>
+ sponsors.filter((_, index) => index % count === column),
+ );
+}
+
+export function SponsorCarousel({
+ sponsors,
+ cellClassNames,
+}: {
+ sponsors: Sponsor[];
+ cellClassNames: string[];
+}) {
+ const columns = dealColumns(sponsors, cellClassNames.length);
+ const [step, setStep] = useState(0);
+ const [held, setHeld] = useState(false);
+ const [inView, setInView] = useState(false);
+ const [pageVisible, setPageVisible] = useState(true);
+ const firstCell = useRef<HTMLAnchorElement>(null);
+ const reduced = useReducedMotion();
+ const motionSet = reduced ? FADE : SWAP;
+
+ useEffect(() => {
+ const node = firstCell.current;
+ if (!node) return;
+ const observer = new IntersectionObserver(
+ ([entry]) => setInView(entry.isIntersecting),
+ { rootMargin: "100px" },
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ useEffect(() => {
+ const sync = () => setPageVisible(document.visibilityState === "visible");
+ sync();
+ document.addEventListener("visibilitychange", sync);
+ return () => document.removeEventListener("visibilitychange", sync);
+ }, []);
+
+ useEffect(() => {
+ if (held || !inView || !pageVisible) return;
+ const timer = setInterval(() => setStep((value) => value + 1), STEP_MS);
+ return () => clearInterval(timer);
+ }, [held, inView, pageVisible]);
+
+ return columns.map((column, index) => {
+ const sponsor = column[step % column.length];
+ return (
+ <Link
+ key={column[0].id}
+ ref={index === 0 ? firstCell : undefined}
+ href={sponsor.website}
+ target="_blank"
+ rel="noreferrer"
+ onPointerEnter={() => setHeld(true)}
+ onPointerLeave={() => setHeld(false)}
+ onFocus={() => setHeld(true)}
+ onBlur={() => setHeld(false)}
+ className={cn(
+ CELL,
+ "relative h-[78px] overflow-clip lg:h-24",
+ cellClassNames[index],
+ )}
+ >
+ <AnimatePresence initial={false} mode="popLayout">
+ <motion.span
+ key={sponsor.id}
+ {...motionSet}
+ transition={{ duration: 0.5, ease: EASE, delay: index * WAVE_S }}
+ className="flex items-center justify-center"
+ >
+ <SponsorLogo sponsor={sponsor} />
+ </motion.span>
+ </AnimatePresence>
+ </Link>
+ );
+ });
+}
diff --git a/app/(home)/components/landing/sections/sponsors-strip/sponsor-cells.tsx b/app/(home)/components/landing/sections/sponsors-strip/sponsor-cells.tsx
new file mode 100644
index 00000000..1ba150b2
--- /dev/null
+++ b/app/(home)/components/landing/sections/sponsors-strip/sponsor-cells.tsx
@@ -0,0 +1,61 @@
+import { FavouriteIcon } from "@hugeicons/core-free-icons";
+import { HugeiconsIcon } from "@hugeicons/react";
+import Link from "next/link";
+import type { Sponsor } from "@/config/sponsors";
+import { cn } from "@/lib/utils";
+import { MetalRing } from "../../ui/metal-ring";
+import { SponsorLogo } from "./sponsor-logo";
+
+export const CELL =
+ "flex shrink-0 items-center justify-center outline-none transition-colors hover:bg-foreground/[0.025] focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring";
+
+/**
+ * The pinned top-tier slot: hairline sides, a Neon-green radial wash rising
+ * from the bottom, a blurred glow and a 2px green rule along the bottom edge.
+ */
+export function PinnedSponsorCell({ sponsor }: { sponsor: Sponsor }) {
+ return (
+ <Link
+ href={sponsor.website}
+ target="_blank"
+ rel="noreferrer"
+ className={cn(
+ CELL,
+ "relative h-[78px] w-40 overflow-clip border-r border-secondary bg-[radial-gradient(ellipse_70%_90%_at_50%_100%_in_oklab,#00E5993D_0%,#00E59914_45%,#FAFAFA00_100%)] lg:h-24 lg:w-[200px] lg:border-l",
+ )}
+ >
+ <SponsorLogo sponsor={sponsor} pinned />
+ <span
+ aria-hidden="true"
+ className="absolute top-[82px] left-10 h-6 w-[120px] rounded-full bg-neon opacity-50 blur-[14px] max-lg:hidden"
+ />
+ <span
+ aria-hidden="true"
+ className="absolute inset-x-0 bottom-0 h-0.5 bg-[linear-gradient(90deg_in_oklab,#00E59900_0%,#00E599_25%,#00E599_75%,#00E59900_100%)] lg:bottom-px lg:bg-[linear-gradient(180deg_in_oklab,#00E59900_0%,#00E599_25%,#00E599_75%,#00E59900_100%)]"
+ />
+ </Link>
+ );
+}
+
+/** "Sponsor" with a heart on the iridescent ring, linking to the sponsors page. */
+export function SponsorButton({ className }: { className?: string }) {
+ return (
+ <Link
+ href="/sponsors"
+ className={cn(
+ "relative flex h-[46px] shrink-0 items-center gap-2 rounded-[13px] border border-metal px-4 text-[14px] leading-[18px] text-foreground outline-none focus-visible:ring-3 focus-visible:ring-ring",
+ className,
+ )}
+ >
+ Sponsor
+ <HugeiconsIcon
+ icon={FavouriteIcon}
+ size={16}
+ strokeWidth={2}
+ aria-hidden="true"
+ className="shrink-0 text-primary"
+ />
+ <MetalRing />
+ </Link>
+ );
+}
diff --git a/app/(home)/components/landing/sections/sponsors-strip/sponsor-logo.tsx b/app/(home)/components/landing/sections/sponsors-strip/sponsor-logo.tsx
new file mode 100644
index 00000000..aa945bd9
--- /dev/null
+++ b/app/(home)/components/landing/sections/sponsors-strip/sponsor-logo.tsx
@@ -0,0 +1,57 @@
+import Image from "next/image";
+import type { Sponsor } from "@/config/sponsors";
+import { cn } from "@/lib/utils";
+
+/**
+ * Per-sponsor size fixes from the design (desktop / mobile). Everything else
+ * falls back to the defaults below.
+ */
+const ICON_SIZE: Record<string, string> = {
+ aceternity: "size-[18px] lg:size-5",
+};
+
+/**
+ * Sponsors with a `row` layout and a display name render as a small icon +
+ * the name set in Geist; the rest render their full logo at a fixed height.
+ */
+export function SponsorLogo({
+ sponsor,
+ pinned = false,
+}: {
+ sponsor: Sponsor;
+ pinned?: boolean;
+}) {
+ if (sponsor.layout === "row" && sponsor.displayName) {
+ return (
+ <span className="flex items-center gap-2">
+ <Image
+ src={sponsor.logoUrl}
+ alt=""
+ width={22}
+ height={22}
+ className={cn(
+ "shrink-0 rounded-tag dark:invert",
+ ICON_SIZE[sponsor.id] ?? "size-5 lg:size-[22px]",
+ )}
+ />
+ <span className="text-ui font-semibold tracking-[-0.03em] whitespace-nowrap text-foreground lg:text-[18px] lg:leading-[22px]">
+ {sponsor.displayName}
+ </span>
+ </span>
+ );
+ }
+
+ return (
+ <Image
+ src={sponsor.logoUrl}
+ alt={sponsor.name}
+ width={160}
+ height={pinned ? 30 : 24}
+ className={cn(
+ "w-auto max-w-none shrink-0 dark:invert",
+ pinned ? "h-[26px] lg:h-[30px]" : "h-[21px] lg:h-6",
+ )}
+ style={sponsor.logoScale ? { scale: sponsor.logoScale } : undefined}
+ />
+ );
+}
diff --git a/app/(home)/components/landing/sections/studio-pipeline.tsx b/app/(home)/components/landing/sections/studio-pipeline.tsx
new file mode 100644
index 00000000..a1a37f0a
--- /dev/null
+++ b/app/(home)/components/landing/sections/studio-pipeline.tsx
@@ -0,0 +1,19 @@
+import { PipelineStages } from "./studio-pipeline/pipeline-stages";
+import { StudioCopy } from "./studio-pipeline/studio-copy";
+
+export function StudioPipeline() {
+ return (
+ <section
+ data-section="studio-pipeline"
+ className="landing-container pt-[72px] xl:pt-0 xl:pb-[140px]"
+ >
+ <div
+ data-reveal="fade"
+ className="flex flex-col gap-8 overflow-clip rounded-shell bg-dark-surface px-[22px] pt-7 pb-[22px] md:gap-12 md:p-14 xl:flex-row xl:justify-between xl:gap-[60px] xl:rounded-[32px] xl:pl-[60px]"
+ >
+ <StudioCopy />
+ <PipelineStages />
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/studio-pipeline/pipeline-stages.tsx b/app/(home)/components/landing/sections/studio-pipeline/pipeline-stages.tsx
new file mode 100644
index 00000000..566fda25
--- /dev/null
+++ b/app/(home)/components/landing/sections/studio-pipeline/pipeline-stages.tsx
@@ -0,0 +1,151 @@
+import type { CSSProperties } from "react";
+import { cn } from "@/lib/utils";
+
+type Stage = {
+ name: string;
+ description: string;
+} & (
+ | { state: "done" }
+ | { state: "active"; progress: number }
+ | { state: "pending" }
+);
+
+const STAGES: Stage[] = [
+ { name: "Analysis", description: "Reads your site and repo", state: "done" },
+ { name: "Brand", description: "Pulls colors, type and logo", state: "done" },
+ { name: "Script", description: "Writes the beats and copy", state: "done" },
+ { name: "Motion", description: "Picks blocks for each beat", state: "done" },
+ {
+ name: "Build",
+ description: "Writes the Remotion project",
+ state: "active",
+ progress: 62,
+ },
+ {
+ name: "Choreography",
+ description: "Times every entrance",
+ state: "pending",
+ },
+ {
+ name: "Review",
+ description: "Watches it back, fixes issues",
+ state: "pending",
+ },
+];
+
+const ROW_AT = [
+ "[--at:200ms]",
+ "[--at:270ms]",
+ "[--at:340ms]",
+ "[--at:410ms]",
+ "[--at:480ms]",
+ "[--at:550ms]",
+ "[--at:620ms]",
+];
+
+/** Colours per state: [number, name, description]. The panel is always dark. */
+const TONE: Record<Stage["state"], [string, string, string]> = {
+ done: ["text-dark-muted", "text-white", "text-dark-muted"],
+ active: ["text-primary-soft", "text-white", "text-[#c4c9cc]"],
+ pending: ["text-dark-muted", "text-dark-subtle", "text-dark-muted"],
+};
+
+function StageLine({ stage, index }: { stage: Stage; index: number }) {
+ const [numberTone, nameTone, descriptionTone] = TONE[stage.state];
+ const status =
+ stage.state === "done" ? (
+ <span className="shrink-0 text-[12px] leading-[22px] text-success-soft md:leading-4">
+ done
+ </span>
+ ) : stage.state === "active" ? (
+ <span className="shrink-0 text-[12px] leading-[22px] text-primary-soft tabular-nums md:leading-4">
+ <span
+ aria-hidden="true"
+ className="seq-count [--at:900ms] [--dur:1600ms]"
+ style={{ "--count": stage.progress } as CSSProperties}
+ />
+ <span className="sr-only">{stage.progress}%</span>
+ </span>
+ ) : null;
+
+ return (
+ <div className="flex items-start gap-3 md:items-baseline md:gap-[18px]">
+ <span
+ aria-hidden="true"
+ className={`w-6 shrink-0 text-[12px] leading-[22px] tabular-nums md:w-7 md:leading-4 ${numberTone}`}
+ >
+ {String(index + 1).padStart(2, "0")}
+ </span>
+ <div className="flex min-w-0 flex-1 flex-col gap-0.5 md:contents">
+ <span
+ className={`text-[17px] leading-[22px] md:w-[150px] md:shrink-0 md:text-[18px] md:leading-6 ${nameTone}`}
+ >
+ {stage.name}
+ </span>
+ <span className={`text-[14px] leading-5 md:flex-1 ${descriptionTone}`}>
+ {stage.description}
+ </span>
+ </div>
+ {status}
+ </div>
+ );
+}
+
+function StageProgress({ name, value }: { name: string; value: number }) {
+ return (
+ <div
+ role="progressbar"
+ aria-label={`${name} progress`}
+ aria-valuemin={0}
+ aria-valuemax={100}
+ aria-valuenow={value}
+ className="h-[3px] shrink-0 overflow-hidden rounded-[2px] bg-white/8"
+ >
+ <div
+ className="seq-draw h-full origin-left bg-primary-soft [--at:900ms] [--dur:1600ms]"
+ style={{ width: `${value}%` }}
+ />
+ </div>
+ );
+}
+
+/** The seven Studio stages: done rows, the active row with progress, pending rows. */
+export function PipelineStages() {
+ return (
+ <ol
+ data-reveal="trigger"
+ data-seq
+ className="flex flex-col xl:w-[560px] xl:shrink-0"
+ >
+ {STAGES.map((stage, index) => {
+ if (stage.state === "active") {
+ return (
+ <li
+ key={stage.name}
+ className={cn(
+ "seq-in flex flex-col gap-3 rounded-control bg-[#1a1d20] px-3 py-3.5 md:-mx-4 md:px-4 md:py-[17px]",
+ ROW_AT[index],
+ )}
+ >
+ <StageLine stage={stage} index={index} />
+ <StageProgress name={stage.name} value={stage.progress} />
+ </li>
+ );
+ }
+ const afterActive = STAGES[index - 1]?.state === "active";
+ return (
+ <li
+ key={stage.name}
+ className={cn(
+ "seq-in border-dark-line px-3 py-3.5 last:pb-1 md:border-t md:px-0 md:py-[17px] md:last:pb-[17px]",
+ !afterActive && "border-t",
+ ROW_AT[index],
+ )}
+ >
+ <StageLine stage={stage} index={index} />
+ </li>
+ );
+ })}
+ </ol>
+ );
+}
diff --git a/app/(home)/components/landing/sections/studio-pipeline/studio-copy.tsx b/app/(home)/components/landing/sections/studio-pipeline/studio-copy.tsx
new file mode 100644
index 00000000..374aea46
--- /dev/null
+++ b/app/(home)/components/landing/sections/studio-pipeline/studio-copy.tsx
@@ -0,0 +1,54 @@
+import { STUDIO_URL } from "@/config/site";
+import { StudioDownloadButton } from "../../ui/download-button";
+import { LandingButton } from "../../ui/landing-button";
+import { StudioAppIcon } from "../../ui/remocn-mark";
+import { SectionTitle } from "../../ui/section-title";
+
+/** Left column of the Studio block: app badge, heading, pitch and CTAs. */
+export function StudioCopy() {
+ return (
+ <div className="flex flex-col gap-[26px] md:gap-12 xl:w-[480px] xl:shrink-0 xl:justify-between">
+ <div className="flex flex-col gap-[22px] md:gap-7">
+ <div className="flex items-center gap-3">
+ <StudioAppIcon
+ size={44}
+ radius={12}
+ markSize={0}
+ className="shadow-[inset_0_1px_0_#ffffff33]"
+ />
+ <div className="flex flex-col">
+ <p className="text-[15px] leading-5 font-medium text-white">
+ Remocn Studio
+ </p>
+ <p className="text-[13px] leading-[18px] text-[#9aa3a7]">
+ macOS & Linux · free
+ </p>
+ </div>
+ </div>
+ <SectionTitle
+ title="Seven stages."
+ continuation="You watch, it ships."
+ className="text-[34px]/[36px] text-white"
+ continuationClassName="text-dark-muted"
+ />
+ <p className="text-[16px] leading-6 text-[#9aa3a7] md:text-[17px] md:leading-[26px]">
+ The agent follows motion rules, checks every frame and fixes what
+ looks off. It runs on the Claude Code, Codex, Copilot or Grok plan you
+ already pay for.
+ </p>
+ </div>
+ <div className="flex flex-col gap-2.5 md:flex-row">
+ <StudioDownloadButton className="justify-center md:justify-start" />
+ <LandingButton
+ href={STUDIO_URL}
+ target="_blank"
+ rel="noreferrer"
+ variant="dark-raised"
+ size="studio"
+ >
+ See how it works
+ </LandingButton>
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/testimonials-wall.tsx b/app/(home)/components/landing/sections/testimonials-wall.tsx
new file mode 100644
index 00000000..9aea93f0
--- /dev/null
+++ b/app/(home)/components/landing/sections/testimonials-wall.tsx
@@ -0,0 +1,28 @@
+import { SectionTitle } from "../ui/section-title";
+import { WallColumns } from "./testimonials-wall/wall-columns";
+import { WallFooter } from "./testimonials-wall/wall-footer";
+import { XSpotlight } from "./testimonials-wall/x-spotlight";
+
+/** "Loved by builders": a clipped wall of X posts (desktop), a spotlight (mobile). */
+export function TestimonialsWall() {
+ return (
+ <section
+ data-section="testimonials-wall"
+ className="overflow-clip pt-[72px] lg:pt-5 lg:pb-[120px]"
+ >
+ <div className="lg:hidden">
+ <XSpotlight />
+ </div>
+
+ <div className="landing-container hidden flex-col items-center gap-12 lg:flex">
+ <SectionTitle
+ title="Loved by builders"
+ continuation="In their own words, on X."
+ align="center"
+ />
+ <WallColumns />
+ <WallFooter />
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/testimonials-wall/wall-columns.tsx b/app/(home)/components/landing/sections/testimonials-wall/wall-columns.tsx
new file mode 100644
index 00000000..cc00c79d
--- /dev/null
+++ b/app/(home)/components/landing/sections/testimonials-wall/wall-columns.tsx
@@ -0,0 +1,64 @@
+import { getXPost } from "@/config/x-posts";
+import { cn } from "@/lib/utils";
+import { XPostCard } from "./x-post-card";
+
+/** Handles per column, top to bottom, as laid out in the design. */
+const COLUMNS: string[][] = [
+ ["shadcn", "bhoomikacodes", "yesadok", "haydenbleasel"],
+ ["JNYBGR", "dingyi", "denicmarko", "milessy_bc"],
+ ["orcdev", "davidhaz", "guillaume_rygn", "bzagrodzki"],
+];
+
+const COLUMN_REVEAL = ["", "[--reveal-i:1]", "[--reveal-i:2]"];
+
+const COLUMN_MOTION = [
+ "[--marquee-duration:62s]",
+ "[--marquee-duration:74s] [animation-direction:reverse]",
+ "[--marquee-duration:56s]",
+];
+
+function ColumnCopy({
+ handles,
+ hidden,
+}: {
+ handles: string[];
+ hidden?: boolean;
+}) {
+ return (
+ <ul
+ aria-hidden={hidden || undefined}
+ inert={hidden}
+ className="flex flex-col gap-4 pb-4"
+ >
+ {handles.map((handle) => (
+ <li key={handle} className="flex flex-col">
+ <XPostCard post={getXPost(handle)} />
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+export function WallColumns() {
+ return (
+ <div className="group/wall relative flex h-[760px] w-full items-start gap-4 overflow-clip mask-[linear-gradient(to_bottom,transparent,#000_10%,#000_78%,transparent)]">
+ {COLUMNS.map((handles, column) => (
+ <div
+ key={handles[0]}
+ data-reveal
+ className={cn("min-w-0 flex-1", COLUMN_REVEAL[column])}
+ >
+ <div
+ className={cn(
+ "flex animate-marquee-y flex-col group-hover/wall:[animation-play-state:paused] group-focus-within/wall:[animation-play-state:paused] motion-reduce:animate-none",
+ COLUMN_MOTION[column],
+ )}
+ >
+ <ColumnCopy handles={handles} />
+ <ColumnCopy handles={handles} hidden />
+ </div>
+ </div>
+ ))}
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/testimonials-wall/wall-footer.tsx b/app/(home)/components/landing/sections/testimonials-wall/wall-footer.tsx
new file mode 100644
index 00000000..6a81a7f9
--- /dev/null
+++ b/app/(home)/components/landing/sections/testimonials-wall/wall-footer.tsx
@@ -0,0 +1,23 @@
+import { X_SEARCH_URL } from "@/config/x-posts";
+import { XLogoIcon } from "../../ui/brand-icons";
+import { LandingButton } from "../../ui/landing-button";
+
+export function WallFooter() {
+ return (
+ <div data-reveal className="-mt-5 flex items-center gap-4">
+ <LandingButton
+ href={X_SEARCH_URL}
+ target="_blank"
+ rel="noreferrer"
+ variant="secondary"
+ size="md"
+ >
+ <XLogoIcon className="size-3.5" />
+ Read all posts
+ </LandingButton>
+ <p className="text-[15px] text-muted-foreground leading-[18px]">
+ 123 builders have posted about remocn since April
+ </p>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/testimonials-wall/x-post-card.tsx b/app/(home)/components/landing/sections/testimonials-wall/x-post-card.tsx
new file mode 100644
index 00000000..fb2a6d2b
--- /dev/null
+++ b/app/(home)/components/landing/sections/testimonials-wall/x-post-card.tsx
@@ -0,0 +1,114 @@
+import Image from "next/image";
+import type { XPost } from "@/config/x-posts";
+import { cn } from "@/lib/utils";
+import { XLogoIcon } from "../../ui/brand-icons";
+
+const dateFormat = new Intl.DateTimeFormat("en-US", {
+ month: "short",
+ day: "numeric",
+ year: "numeric",
+ timeZone: "UTC",
+});
+
+const countFormat = new Intl.NumberFormat("en-US", {
+ notation: "compact",
+ maximumFractionDigits: 0,
+});
+
+function formatDate(iso: string) {
+ return dateFormat.format(new Date(`${iso}T00:00:00Z`));
+}
+
+function formatCount(value: number) {
+ return countFormat.format(value).toLowerCase();
+}
+
+/**
+ * One X post on the testimonials wall. The whole card links to the post.
+ * `featured` is the large lead card: bigger type, fuchsia glow, like/view counts.
+ */
+export function XPostCard({ post }: { post: XPost }) {
+ const featured = post.featured ?? false;
+ const showCounts = featured && (post.likes != null || post.views != null);
+
+ return (
+ // The link stays put; only the card inside lifts, so the hover can't
+ // slide out from under the cursor and flicker.
+ <a
+ href={post.url}
+ target="_blank"
+ rel="noreferrer"
+ className={cn(
+ "group flex flex-col outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary",
+ featured ? "rounded-[22px]" : "rounded-card",
+ )}
+ >
+ <div
+ className={cn(
+ "flex flex-col bg-card text-foreground ring-1 ring-hairline transition-[box-shadow,translate] duration-150 ease-[ease] group-hover:-translate-y-0.5 group-hover:ring-divider motion-reduce:group-hover:translate-y-0",
+ featured
+ ? "gap-[18px] rounded-[22px] p-6 shadow-[0_12px_32px_-18px_rgb(168_0_183/0.35)] group-hover:shadow-[0_16px_36px_-16px_rgb(168_0_183/0.45)]"
+ : "gap-3.5 rounded-card p-5 group-hover:shadow-[0_12px_32px_-18px_rgb(14_16_18/0.25)]",
+ )}
+ >
+ <div
+ className={cn("flex items-center", featured ? "gap-3" : "gap-2.5")}
+ >
+ <Image
+ src={post.avatar}
+ alt=""
+ width={featured ? 40 : 36}
+ height={featured ? 40 : 36}
+ className={cn(
+ "shrink-0 rounded-full object-cover",
+ featured ? "size-10" : "size-9",
+ )}
+ />
+ <div className="flex min-w-0 flex-1 flex-col">
+ <span className="font-medium text-[15px] leading-5">
+ {post.name}
+ </span>
+ <span className="text-[13px] text-muted-foreground leading-[18px]">
+ @{post.handle}
+ {post.role && `, ${post.role}`}
+ </span>
+ </div>
+ <XLogoIcon
+ className={cn(
+ "shrink-0 text-foreground",
+ featured ? "size-4" : "size-3.5",
+ )}
+ />
+ </div>
+
+ <p
+ className={cn(
+ featured
+ ? "text-[22px] leading-[30px] tracking-title"
+ : "text-[16px] leading-6",
+ )}
+ >
+ {post.text}
+ </p>
+
+ <div className="flex flex-wrap items-center gap-x-4 gap-y-1 text-mono text-muted-foreground tabular-nums">
+ <time dateTime={post.date}>{formatDate(post.date)}</time>
+ {showCounts && post.likes != null && (
+ <span className="text-primary">
+ <span aria-hidden="true">♥</span>
+ <span className="sr-only">Likes:</span> {formatCount(post.likes)}
+ </span>
+ )}
+ {showCounts && post.views != null && (
+ <span>{formatCount(post.views)} views</span>
+ )}
+ {post.translatedFrom && (
+ <span className="text-subtle">
+ translated from {post.translatedFrom}
+ </span>
+ )}
+ </div>
+ </div>
+ </a>
+ );
+}
diff --git a/app/(home)/components/landing/sections/testimonials-wall/x-spotlight.tsx b/app/(home)/components/landing/sections/testimonials-wall/x-spotlight.tsx
new file mode 100644
index 00000000..374f9a6e
--- /dev/null
+++ b/app/(home)/components/landing/sections/testimonials-wall/x-spotlight.tsx
@@ -0,0 +1,89 @@
+import Image from "next/image";
+import { getXPost, X_SPOTLIGHT } from "@/config/x-posts";
+
+const linkFocus =
+ "outline-none focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary";
+
+function capitalize(value: string) {
+ return value.charAt(0).toUpperCase() + value.slice(1);
+}
+
+/**
+ * Mobile take on the wall: one pulled quote, then a row of the people who
+ * posted. The active person is a pill, the rest are faded avatars; every item
+ * links to its post on X.
+ */
+export function XSpotlight() {
+ const active = getXPost(X_SPOTLIGHT.handle);
+
+ return (
+ <div data-reveal="stagger" className="flex flex-col items-center gap-7">
+ <h2 className="text-muted-foreground text-ui leading-6">
+ What builders say on X
+ </h2>
+
+ <blockquote cite={active.url} className="px-5 text-center">
+ <p className="text-[30px] text-foreground leading-[34px] tracking-heading">
+ “{X_SPOTLIGHT.quote}”
+ </p>
+ </blockquote>
+
+ <ul className="flex w-full items-center justify-center gap-2.5">
+ {X_SPOTLIGHT.row.map((handle) => {
+ const post = getXPost(handle);
+
+ if (handle === active.handle) {
+ return (
+ <li key={handle} className="shrink-0">
+ <a
+ href={post.url}
+ target="_blank"
+ rel="noreferrer"
+ className={`flex items-center gap-3 rounded-card bg-card py-1.5 pr-[18px] pl-1.5 ring-1 ring-hairline shadow-[0_10px_30px_-14px_rgb(14_16_18/0.25)] transition-shadow hover:ring-divider ${linkFocus}`}
+ >
+ <Image
+ src={post.avatar}
+ alt=""
+ width={46}
+ height={46}
+ className="size-[46px] shrink-0 rounded-[14px] object-cover"
+ />
+ <span className="flex flex-col">
+ <span className="whitespace-nowrap font-medium text-[15px] text-foreground leading-5">
+ {post.name}
+ </span>
+ {post.role && (
+ <span className="whitespace-nowrap text-muted-foreground text-small">
+ {capitalize(post.role)}
+ </span>
+ )}
+ </span>
+ </a>
+ </li>
+ );
+ }
+
+ return (
+ <li key={handle} className="shrink-0">
+ <a
+ href={post.url}
+ target="_blank"
+ rel="noreferrer"
+ aria-label={`${post.name} on X`}
+ className={`block rounded-[14px] opacity-45 transition-opacity hover:opacity-100 ${linkFocus}`}
+ >
+ <Image
+ src={post.avatar}
+ alt=""
+ width={46}
+ height={46}
+ className="size-[46px] rounded-[14px] object-cover"
+ />
+ </a>
+ </li>
+ );
+ })}
+ </ul>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside.tsx b/app/(home)/components/landing/sections/whats-inside.tsx
new file mode 100644
index 00000000..e039a246
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside.tsx
@@ -0,0 +1,97 @@
+import { COMPONENT_COUNT } from "@/config/site";
+import { SectionTitle } from "../ui/section-title";
+import { BackgroundsTile } from "./whats-inside/backgrounds-tile";
+import {
+ CaptionsVisual,
+ FamilyTile,
+ FiltersVisual,
+ TransitionsVisual,
+} from "./whats-inside/family-tile";
+import { InstallStrip } from "./whats-inside/install-strip";
+import { TypographyTile } from "./whats-inside/typography-tile";
+
+const FAMILY_HREF = {
+ typography: "/docs/typography",
+ transitions: "/docs/transitions",
+ captions: "/docs/captions/getting-started/introduction",
+ filters: "/docs/filters/getting-started/introduction",
+ backgrounds: "/docs/shaders/getting-started/introduction",
+} as const;
+
+const FAMILIES = [
+ {
+ href: FAMILY_HREF.transitions,
+ title: "Transitions",
+ description: "Cuts that don’t look like a slideshow.",
+ tone: "light",
+ visual: <TransitionsVisual />,
+ },
+ {
+ href: FAMILY_HREF.captions,
+ title: "Captions",
+ description: "Word-by-word subtitles timed to the voiceover.",
+ tone: "light",
+ visual: <CaptionsVisual />,
+ },
+ {
+ href: FAMILY_HREF.filters,
+ title: "Filters",
+ description: "Halftone, CRT and VHS looks over any scene.",
+ tone: "dark",
+ visual: <FiltersVisual />,
+ },
+] as const;
+
+/** "400+" style count: the registry size rounded down to the hundred. */
+const BLOCK_COUNT_LABEL = `${Math.floor(COMPONENT_COUNT / 100) * 100}+`;
+
+export function WhatsInside() {
+ return (
+ <section
+ data-section="whats-inside"
+ className="pt-[72px] xl:pt-10 xl:pb-[140px]"
+ >
+ <div className="landing-container flex flex-col gap-7 xl:gap-12">
+ <header className="flex flex-col gap-4 xl:flex-row xl:items-end xl:justify-between xl:gap-0">
+ <SectionTitle
+ title="There’s a block for that"
+ continuation="Five kinds of building blocks. Your agent puts them on the timeline."
+ className="text-[34px]/[36px] text-wrap md:text-h2"
+ continuationClassName="xl:w-[720px]"
+ />
+ <p
+ data-reveal
+ className="text-ui leading-6 text-paragraph [--reveal-i:2] md:max-w-[560px] md:text-[18px] md:leading-[27px] xl:w-[340px] xl:shrink-0"
+ >
+ Every remocn component belongs to one of these families. It composes
+ them one scene at a time.
+ </p>
+ </header>
+ <div className="flex flex-col gap-2.5 xl:gap-3">
+ <div
+ data-reveal="stagger"
+ data-seq
+ className="grid grid-cols-1 gap-2.5 md:grid-cols-3 xl:h-[660px] xl:grid-cols-[repeat(3,minmax(0,1fr))_372px] xl:grid-rows-[354px_294px] xl:gap-3"
+ >
+ <TypographyTile
+ href={FAMILY_HREF.typography}
+ className="md:col-span-3"
+ />
+ {FAMILIES.map((family) => (
+ <FamilyTile key={family.title} {...family} />
+ ))}
+ <BackgroundsTile
+ href={FAMILY_HREF.backgrounds}
+ className="md:col-span-3 xl:col-span-1 xl:col-start-4 xl:row-span-2 xl:row-start-1"
+ />
+ </div>
+ <InstallStrip
+ component="soft-blur-in"
+ browseHref="/docs/components"
+ browseLabel={`Browse ${BLOCK_COUNT_LABEL} blocks`}
+ />
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/backgrounds-tile.tsx b/app/(home)/components/landing/sections/whats-inside/backgrounds-tile.tsx
new file mode 100644
index 00000000..ac8c5af3
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/backgrounds-tile.tsx
@@ -0,0 +1,44 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { BentoClip } from "./bento-clip";
+
+/** Tall live shader tile for the Backgrounds (shaders) family. */
+export function BackgroundsTile({
+ href,
+ className,
+}: {
+ href: string;
+ className?: string;
+}) {
+ return (
+ <Link
+ href={href}
+ className={cn(
+ "group relative isolate flex h-[380px] flex-col justify-between overflow-clip rounded-panel px-6 pt-6 pb-[26px] outline-none focus-visible:ring-3 focus-visible:ring-ring xl:h-auto xl:rounded-shell xl:px-8 xl:py-[30px]",
+ className,
+ )}
+ >
+ <BentoClip slot="backgrounds" className="absolute inset-0 -z-10" />
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 -z-10 bg-[linear-gradient(in_oklab_0deg,#0A040EBF_0%,#0A040E00_45%)]"
+ />
+ {/* Hover lift: an opacity layer, not a `filter` over the live shader. */}
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 -z-10 bg-white opacity-0 transition-opacity duration-150 ease-[ease] group-hover:opacity-[0.07]"
+ />
+ <p className="text-caption text-primary-tint xl:text-micro">
+ Shaders, safe in 9:16
+ </p>
+ <div className="flex flex-col gap-2">
+ <h3 className="text-[34px] leading-9 tracking-heading text-white xl:text-[40px] xl:leading-[42px]">
+ Backgrounds that move.
+ </h3>
+ <p className="text-[15px] leading-[22px] text-[#E4E0E8]">
+ Fill any aspect ratio — they’re code, not footage.
+ </p>
+ </div>
+ </Link>
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/bento-clip.tsx b/app/(home)/components/landing/sections/whats-inside/bento-clip.tsx
new file mode 100644
index 00000000..576f5f11
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/bento-clip.tsx
@@ -0,0 +1,45 @@
+"use client";
+
+import { createContext, useContext } from "react";
+import { cn } from "@/lib/utils";
+import { CatalogCard } from "../../ui/catalog-card";
+import saved from "./bento.json";
+import { type BentoClips, type BentoSlot, DEFAULT_BENTO } from "./bento-clips";
+import { TypeRemix } from "./type-remix";
+
+export const SAVED_BENTO: BentoClips = {
+ ...DEFAULT_BENTO,
+ ...(saved as Partial<BentoClips>),
+};
+
+export const BentoClipsContext = createContext<BentoClips>(SAVED_BENTO);
+
+export function BentoClip({
+ slot,
+ className,
+}: {
+ slot: BentoSlot;
+ className?: string;
+}) {
+ const clips = useContext(BentoClipsContext);
+ return (
+ <div
+ aria-hidden="true"
+ className={cn("pointer-events-none relative overflow-clip", className)}
+ >
+ <CatalogCard spec={clips[slot]} />
+ </div>
+ );
+}
+
+export function BentoRemix({ className }: { className?: string }) {
+ const clips = useContext(BentoClipsContext);
+ return (
+ <div
+ aria-hidden="true"
+ className={cn("pointer-events-none relative overflow-clip", className)}
+ >
+ <TypeRemix specs={clips.typography} />
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/bento-clips.ts b/app/(home)/components/landing/sections/whats-inside/bento-clips.ts
new file mode 100644
index 00000000..8057ac6f
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/bento-clips.ts
@@ -0,0 +1,63 @@
+import type { ClipSpec } from "../hero/tiles/config";
+
+export const BENTO_SLOTS = [
+ "transitions",
+ "captions",
+ "filters",
+ "backgrounds",
+] as const;
+
+export type BentoSlot = (typeof BENTO_SLOTS)[number];
+
+export type BentoClips = Record<BentoSlot, ClipSpec> & {
+ typography: ClipSpec[];
+};
+
+function spec(
+ name: string,
+ background: string,
+ end: ClipSpec["end"],
+ props: Record<string, unknown> = {},
+): ClipSpec {
+ return {
+ name,
+ start: 0,
+ zoom: 1,
+ end,
+ background,
+ radius: 0.25,
+ cut: "auto",
+ props,
+ };
+}
+
+function word(name: string, text: string, props: Record<string, unknown> = {}) {
+ return spec(name, "transparent", "hold", {
+ text,
+ fontSize: 200,
+ fontWeight: 600,
+ color: "currentColor",
+ ...props,
+ });
+}
+
+export const DEFAULT_BENTO: BentoClips = {
+ typography: [
+ word("soft-blur-in", "Arrive.", { blur: 24 }),
+ word("per-character-rise", "Rise."),
+ word("mask-reveal-up", "Reveal."),
+ word("tracking-in", "Track."),
+ word("squeeze-in", "Squeeze."),
+ ],
+ transitions: spec("zoom-blur", "#141318", "hold"),
+ captions: spec("caption-karaoke", "#0E1012", "hold", {
+ fontSize: 88,
+ activeColor: "#E879F9",
+ }),
+ filters: spec("crt-wordmark", "#050505", "hold"),
+ backgrounds: spec("shader-mesh-gradient", "#3B0764", "run", {
+ colors: ["#A800B7", "#F5D0FE", "#3B0764", "#E879F9"],
+ distortion: 0.8,
+ swirl: 0.3,
+ }),
+};
diff --git a/app/(home)/components/landing/sections/whats-inside/bento.json b/app/(home)/components/landing/sections/whats-inside/bento.json
new file mode 100644
index 00000000..0967ef42
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/bento.json
@@ -0,0 +1 @@
+{}
diff --git a/app/(home)/components/landing/sections/whats-inside/copy-command-button.tsx b/app/(home)/components/landing/sections/whats-inside/copy-command-button.tsx
new file mode 100644
index 00000000..c707f020
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/copy-command-button.tsx
@@ -0,0 +1,64 @@
+"use client";
+
+import { Check, Copy } from "lucide-react";
+import { useEffect, useRef, useState } from "react";
+import { useTrackEvent } from "@/lib/analytics";
+import { cn } from "@/lib/utils";
+
+const ICON =
+ "absolute inset-0 size-full transition-[opacity,scale,filter] duration-200 ease-out motion-reduce:transition-opacity";
+
+/**
+ * Copies the install command. Icon-only on desktop, "Copy" pill on mobile.
+ */
+export function CopyCommandButton({
+ command,
+ component,
+}: {
+ command: string;
+ /** Registry name, for the `install_command_copied` event. */
+ component: string;
+}) {
+ const [copied, setCopied] = useState(false);
+ const timeout = useRef<ReturnType<typeof setTimeout>>(null);
+ const trackEvent = useTrackEvent();
+
+ useEffect(() => () => clearTimeout(timeout.current ?? undefined), []);
+
+ async function copy() {
+ try {
+ await navigator.clipboard.writeText(command);
+ } catch {
+ return;
+ }
+ setCopied(true);
+ trackEvent("install_command_copied", {
+ component,
+ package_manager: "npm",
+ surface: "landing",
+ });
+ clearTimeout(timeout.current ?? undefined);
+ timeout.current = setTimeout(() => setCopied(false), 1500);
+ }
+
+ return (
+ <button
+ type="button"
+ onClick={copy}
+ aria-label={copied ? "Copied" : "Copy install command"}
+ className="relative flex h-9 shrink-0 after:absolute after:-inset-1 lg:after:hidden items-center justify-center gap-1.5 rounded-[10px] bg-[#2A2D30] px-3 text-small leading-[18px] text-white transition-[background-color,color,transform] duration-150 ease-out outline-none hover:bg-[#33373A] active:translate-y-px focus-visible:ring-3 focus-visible:ring-ring lg:size-[30px] lg:rounded-tile lg:bg-dark-line lg:px-0 lg:text-dark-body lg:hover:bg-[#2E3236]"
+ >
+ <span aria-hidden="true" className="relative size-3.5 shrink-0">
+ <Copy
+ className={cn(ICON, copied && "scale-50 opacity-0 blur-[2px]")}
+ strokeWidth={2}
+ />
+ <Check
+ className={cn(ICON, !copied && "scale-50 opacity-0 blur-[2px]")}
+ strokeWidth={2}
+ />
+ </span>
+ <span className="lg:hidden">{copied ? "Copied" : "Copy"}</span>
+ </button>
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/family-tile.tsx b/app/(home)/components/landing/sections/whats-inside/family-tile.tsx
new file mode 100644
index 00000000..2e6af4f5
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/family-tile.tsx
@@ -0,0 +1,69 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { BentoClip } from "./bento-clip";
+
+/**
+ * One component family in the bento: a small visual on top, the family name
+ * and a one-liner at the bottom. The whole tile links to the family's docs.
+ */
+export function FamilyTile({
+ href,
+ title,
+ description,
+ tone = "light",
+ visual,
+ className,
+}: {
+ href: string;
+ title: string;
+ description: string;
+ tone?: "light" | "dark";
+ visual: ReactNode;
+ className?: string;
+}) {
+ return (
+ <Link
+ href={href}
+ className={cn(
+ "flex min-w-0 flex-col gap-7 rounded-panel p-[22px] transition-colors outline-none focus-visible:ring-3 focus-visible:ring-ring md:justify-between md:px-7 md:py-[26px] xl:rounded-shell",
+ tone === "light"
+ ? "bg-tile hover:bg-[#E9EAEC] dark:hover:bg-[#2A2D31]"
+ : "bg-dark-surface hover:bg-[#16181B]",
+ className,
+ )}
+ >
+ {visual}
+ <div className="flex flex-col gap-1.5">
+ <h3
+ className={`text-[21px] leading-[26px] tracking-title ${
+ tone === "light" ? "text-foreground" : "text-[#FAFAFA]"
+ }`}
+ >
+ {title}
+ </h3>
+ <p
+ className={`text-small leading-[21px] ${
+ tone === "light" ? "text-body-muted" : "text-dark-subtle"
+ }`}
+ >
+ {description}
+ </p>
+ </div>
+ </Link>
+ );
+}
+
+const FRAME = "h-[132px] w-full shrink-0 rounded-[14px]";
+
+export function TransitionsVisual() {
+ return <BentoClip slot="transitions" className={FRAME} />;
+}
+
+export function CaptionsVisual() {
+ return <BentoClip slot="captions" className={FRAME} />;
+}
+
+export function FiltersVisual() {
+ return <BentoClip slot="filters" className={FRAME} />;
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/install-strip.tsx b/app/(home)/components/landing/sections/whats-inside/install-strip.tsx
new file mode 100644
index 00000000..20ecf775
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/install-strip.tsx
@@ -0,0 +1,44 @@
+import { LandingButton } from "../../ui/landing-button";
+import { CopyCommandButton } from "./copy-command-button";
+
+/** Dark strip under the bento: a copyable install line + "Browse N+ blocks". */
+export function InstallStrip({
+ component,
+ browseHref,
+ browseLabel,
+}: {
+ component: string;
+ browseHref: string;
+ browseLabel: string;
+}) {
+ const command = `npx shadcn@latest add @remocn/${component}`;
+
+ return (
+ <div
+ data-reveal
+ data-seq
+ className="flex flex-col gap-2.5 rounded-[22px] bg-dark-surface p-2.5 lg:h-[76px] lg:flex-row lg:items-center lg:justify-between lg:gap-0 lg:py-0 lg:pr-3.5 lg:pl-7"
+ >
+ <div className="flex h-[52px] shrink-0 items-center gap-2.5 pr-1.5 pl-3 lg:h-auto lg:gap-3.5 lg:p-0">
+ <code className="flex min-w-0 grow items-center gap-2.5 overflow-clip font-mono text-[13px] leading-[18px] whitespace-nowrap lg:gap-3.5 lg:text-[15px]">
+ <span aria-hidden="true" className="shrink-0 text-dark-muted">
+ $
+ </span>
+ <span className="seq-type shrink-0 text-[#E6E8E9] [--at:350ms] [--dur:900ms] [--steps:42]">
+ {command}
+ </span>
+ </code>
+ <CopyCommandButton command={command} component={component} />
+ </div>
+ <LandingButton
+ href={browseHref}
+ variant="fuchsia"
+ size="md"
+ arrow="→"
+ className="h-[50px] w-full lg:w-auto"
+ >
+ {browseLabel}
+ </LandingButton>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/type-remix.tsx b/app/(home)/components/landing/sections/whats-inside/type-remix.tsx
new file mode 100644
index 00000000..2082e06b
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/type-remix.tsx
@@ -0,0 +1,78 @@
+"use client";
+
+import { AbsoluteFill, interpolate, Series, useCurrentFrame } from "remotion";
+import { LivePlayer } from "../../ui/catalog-card";
+import { Clip, nativeDuration } from "../hero/tiles/clips";
+import type { ClipSpec } from "../hero/tiles/config";
+
+const STRIP = { width: 1280, height: 300 };
+const HOLD = 24;
+const FADE = 6;
+
+function beatLength(spec: ClipSpec) {
+ return Math.max(nativeDuration(spec.name) - spec.start, 1) + HOLD;
+}
+
+function Beat({
+ spec,
+ length,
+ box,
+}: {
+ spec: ClipSpec;
+ length: number;
+ box: { width: number; height: number };
+}) {
+ const frame = useCurrentFrame();
+ const opacity = interpolate(frame, [length - FADE, length], [1, 0], {
+ extrapolateLeft: "clamp",
+ extrapolateRight: "clamp",
+ });
+ return (
+ <AbsoluteFill style={{ opacity }}>
+ <Clip
+ spec={{ ...spec, end: "hold" }}
+ frame={box}
+ canvas={STRIP}
+ anchor="bottom-left"
+ />
+ </AbsoluteFill>
+ );
+}
+
+function RemixScene({
+ specs,
+ width,
+ height,
+}: {
+ specs: ClipSpec[];
+ width: number;
+ height: number;
+}) {
+ return (
+ <Series>
+ {specs.map((spec, index) => {
+ const length = beatLength(spec);
+ return (
+ <Series.Sequence
+ key={`${spec.name}-${index}`}
+ durationInFrames={length}
+ >
+ <Beat spec={spec} length={length} box={{ width, height }} />
+ </Series.Sequence>
+ );
+ })}
+ </Series>
+ );
+}
+
+export function TypeRemix({ specs }: { specs: ClipSpec[] }) {
+ const total = specs.reduce((sum, spec) => sum + beatLength(spec), 0);
+ return (
+ <LivePlayer
+ component={RemixScene}
+ inputProps={{ specs }}
+ durationInFrames={total}
+ stillFrame={specs[0] ? beatLength(specs[0]) - HOLD : 0}
+ />
+ );
+}
diff --git a/app/(home)/components/landing/sections/whats-inside/typography-tile.tsx b/app/(home)/components/landing/sections/whats-inside/typography-tile.tsx
new file mode 100644
index 00000000..afbc4b75
--- /dev/null
+++ b/app/(home)/components/landing/sections/whats-inside/typography-tile.tsx
@@ -0,0 +1,31 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { BentoRemix } from "./bento-clip";
+
+export function TypographyTile({
+ href,
+ className,
+}: {
+ href: string;
+ className?: string;
+}) {
+ return (
+ <Link
+ href={href}
+ className={cn(
+ "flex flex-col justify-between gap-[18px] overflow-clip rounded-panel bg-tile px-[22px] pt-[22px] pb-6 transition-colors outline-none hover:bg-[#E9EAEC] focus-visible:ring-3 focus-visible:ring-ring lg:flex-row lg:items-stretch lg:gap-6 lg:px-9 lg:py-[30px] xl:rounded-shell dark:hover:bg-[#2A2D31]",
+ className,
+ )}
+ >
+ <BentoRemix className="h-[150px] min-w-0 lg:h-auto lg:min-h-[240px] lg:flex-1" />
+ <div className="flex flex-col gap-1 lg:w-[220px] lg:shrink-0 lg:justify-end lg:gap-1.5 lg:pb-2">
+ <h3 className="text-caption text-muted-foreground lg:text-micro">
+ Typography
+ </h3>
+ <p className="text-[15px] leading-[22px] text-paragraph">
+ Words that land with weight instead of just appearing.
+ </p>
+ </div>
+ </Link>
+ );
+}
diff --git a/app/(home)/components/landing/sections/why-remocn.tsx b/app/(home)/components/landing/sections/why-remocn.tsx
new file mode 100644
index 00000000..46c7c10a
--- /dev/null
+++ b/app/(home)/components/landing/sections/why-remocn.tsx
@@ -0,0 +1,44 @@
+import { SectionTitle } from "../ui/section-title";
+import { CompareCard, type CompareCardProps } from "./why-remocn/compare-card";
+import { Reasons } from "./why-remocn/reasons";
+
+const COMPARISON: CompareCardProps[] = [
+ {
+ label: "A motion designer",
+ value: ["$600, 2 weeks"],
+ caption: "And three rounds of “can we make it pop more”.",
+ tone: "muted",
+ },
+ {
+ label: "remocn + your agent",
+ value: ["1 prompt,", "1 afternoon"],
+ caption:
+ "The animation is already built and timed. You react to the result.",
+ tone: "shader",
+ },
+];
+
+export function WhyRemocn() {
+ return (
+ <section
+ data-section="why-remocn"
+ className="landing-container flex flex-col gap-7 pt-[72px] lg:gap-14 xl:pt-5 xl:pb-[140px]"
+ >
+ <SectionTitle
+ title="Why remocn"
+ continuation="Every other way costs you something."
+ className="text-[34px]/[36px] text-wrap md:items-center md:text-center"
+ />
+ <div
+ data-reveal="stagger"
+ data-seq
+ className="flex flex-col gap-2.5 lg:flex-row lg:gap-3"
+ >
+ {COMPARISON.map((card) => (
+ <CompareCard key={card.label} {...card} />
+ ))}
+ </div>
+ <Reasons />
+ </section>
+ );
+}
diff --git a/app/(home)/components/landing/sections/why-remocn/compare-card.tsx b/app/(home)/components/landing/sections/why-remocn/compare-card.tsx
new file mode 100644
index 00000000..fd2ebb65
--- /dev/null
+++ b/app/(home)/components/landing/sections/why-remocn/compare-card.tsx
@@ -0,0 +1,75 @@
+import type { CSSProperties } from "react";
+
+export type CompareCardProps = {
+ label: string;
+ /** Headline split into the lines it breaks into on mobile; one line on desktop. */
+ value: string[];
+ caption: string;
+ tone: "muted" | "shader";
+};
+
+const SHADER_BACKGROUND: CSSProperties = {
+ backgroundImage:
+ "linear-gradient(180deg in oklab, #07050700 0%, #07050700 35%, #070507e6 75%), url(/landing/shader-why.png)",
+ backgroundPosition: "50%, 50% 30%",
+ backgroundSize: "cover",
+};
+
+const TONE = {
+ muted: {
+ card: "bg-tile",
+ label: "text-muted-foreground",
+ value: "text-title-muted",
+ caption: "text-body-muted",
+ },
+ shader: {
+ card: "bg-[#070507]",
+ label: "text-primary-soft",
+ value: "text-white",
+ caption: "text-[#d4d8da]",
+ },
+} as const;
+
+/** One side of the "motion designer vs remocn" comparison. */
+export function CompareCard({ label, value, caption, tone }: CompareCardProps) {
+ const styles = TONE[tone];
+ return (
+ <div
+ className={`relative isolate flex h-[220px] min-w-0 flex-col justify-between overflow-clip rounded-panel p-6 lg:h-[300px] lg:flex-1 lg:basis-0 lg:rounded-shell lg:px-10 lg:py-9 ${styles.card}`}
+ >
+ {tone === "shader" && (
+ <span
+ aria-hidden="true"
+ className="bg-settle absolute inset-0 -z-10"
+ style={SHADER_BACKGROUND}
+ />
+ )}
+ <p className={`text-[13px] leading-4 lg:text-[12px] ${styles.label}`}>
+ {label}
+ </p>
+ <div className="flex flex-col gap-2 lg:gap-2.5">
+ <p
+ className={`relative w-fit text-[40px] leading-[42px] tracking-[-0.055em] xl:text-[56px] xl:leading-[58px] xl:whitespace-nowrap ${styles.value}`}
+ >
+ {value.map((line, index) => (
+ <span key={line} className="block xl:inline">
+ {index > 0 && " "}
+ {line}
+ </span>
+ ))}
+ {tone === "muted" && (
+ <span
+ aria-hidden="true"
+ className="seq-draw absolute inset-x-[-2%] top-[54%] h-[3px] origin-left rounded-full bg-current [--at:800ms] [--dur:900ms]"
+ />
+ )}
+ </p>
+ <p
+ className={`text-[16px] leading-[22px] lg:text-[17px] ${styles.caption}`}
+ >
+ {caption}
+ </p>
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/sections/why-remocn/reasons.tsx b/app/(home)/components/landing/sections/why-remocn/reasons.tsx
new file mode 100644
index 00000000..7f8d2e8d
--- /dev/null
+++ b/app/(home)/components/landing/sections/why-remocn/reasons.tsx
@@ -0,0 +1,45 @@
+type WhyReason = {
+ title: string;
+ body: string;
+};
+
+const WHY_REASONS: WhyReason[] = [
+ {
+ title: "No After Effects",
+ body: "Nothing to install, nothing to learn. If you can describe it, you can make it.",
+ },
+ {
+ title: "Not a screen recording",
+ body: "A cursor wandering across your app isn’t a demo. This looks shipped on purpose.",
+ },
+ {
+ title: "Yours to keep",
+ body: "The code copies into your repo. MIT, no runtime, no account, nothing to cancel.",
+ },
+ {
+ title: "Changes in seconds",
+ body: "Say what feels wrong and watch it change. No revision round, no queue.",
+ },
+];
+
+/** Four reasons under the comparison cards, each under a hairline rule. */
+export function Reasons() {
+ return (
+ <ul
+ data-reveal="stagger"
+ className="grid w-full grid-cols-1 gap-[22px] pt-2 md:grid-cols-2 md:gap-x-10 md:gap-y-8 xl:grid-cols-4 xl:gap-10"
+ >
+ {WHY_REASONS.map((reason) => (
+ <li
+ key={reason.title}
+ className="flex flex-col gap-1.5 border-t border-[#e3e5e6] pt-[18px] md:gap-2.5 md:pt-[22px] dark:border-divider"
+ >
+ <h3 className="text-[20px] leading-[26px] tracking-title text-foreground md:text-[22px] md:leading-7">
+ {reason.title}
+ </h3>
+ <p className="text-[16px] leading-6 text-body-muted">{reason.body}</p>
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/app/(home)/components/landing/ui/brand-icons.tsx b/app/(home)/components/landing/ui/brand-icons.tsx
new file mode 100644
index 00000000..6abb2540
--- /dev/null
+++ b/app/(home)/components/landing/ui/brand-icons.tsx
@@ -0,0 +1,201 @@
+import type { SVGProps } from "react";
+
+type IconProps = SVGProps<SVGSVGElement>;
+
+export function AppleIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="currentColor"
+ d="M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"
+ />
+ </svg>
+ );
+}
+
+export function LinuxIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="currentColor"
+ d="M12.504 0c-.155 0-.315.008-.48.021-4.226.333-3.105 4.807-3.17 6.298-.076 1.092-.3 1.953-1.05 3.02-.885 1.051-2.127 2.75-2.716 4.521-.278.832-.41 1.684-.287 2.489a.424.424 0 00-.11.135c-.26.268-.45.6-.663.839-.199.199-.485.267-.797.4-.313.136-.658.269-.864.68-.09.189-.136.394-.132.602 0 .199.027.4.055.536.058.399.116.728.04.97-.249.68-.28 1.145-.106 1.484.174.334.535.47.94.601.81.2 1.91.135 2.774.6.926.466 1.866.67 2.616.47.526-.116.97-.464 1.208-.946.587-.003 1.23-.269 2.26-.334.699-.058 1.574.267 2.577.2.025.134.063.198.114.333l.003.003c.391.778 1.113 1.132 1.884 1.071.771-.06 1.592-.536 2.257-1.306.631-.765 1.683-1.084 2.378-1.503.348-.199.629-.469.649-.853.023-.4-.2-.811-.714-1.376v-.097l-.003-.003c-.17-.2-.25-.535-.338-.926-.085-.401-.182-.786-.492-1.046h-.003c-.059-.054-.123-.067-.188-.135a.357.357 0 00-.19-.064c.431-1.278.264-2.55-.173-3.694-.533-1.41-1.465-2.638-2.175-3.483-.796-1.005-1.576-1.957-1.56-3.368.026-2.152.236-6.133-3.544-6.139zm.529 3.405h.013c.213 0 .396.062.584.198.19.135.33.332.438.533.105.259.158.459.166.724 0-.02.006-.04.006-.06v.105a.086.086 0 01-.004-.021l-.004-.024a1.807 1.807 0 01-.15.706.953.953 0 01-.213.335.71.71 0 00-.088-.042c-.104-.045-.198-.064-.284-.133a1.312 1.312 0 00-.22-.066c.05-.06.146-.133.183-.198.053-.128.082-.264.088-.402v-.02a1.21 1.21 0 00-.061-.4c-.045-.134-.101-.2-.183-.333-.084-.066-.167-.132-.267-.132h-.016c-.093 0-.176.03-.262.132a.8.8 0 00-.205.334 1.18 1.18 0 00-.09.4v.019c.002.089.008.179.02.267-.193-.067-.438-.135-.607-.202a1.635 1.635 0 01-.018-.2v-.02a1.772 1.772 0 01.15-.768c.082-.22.232-.406.43-.533a.985.985 0 01.594-.2zm-2.962.059h.036c.142 0 .27.048.399.135.146.129.264.288.344.465.09.199.14.4.153.667v.004c.007.134.006.2-.002.266v.08c-.03.007-.056.018-.083.024-.152.055-.274.135-.393.2.012-.09.013-.18.003-.267v-.015c-.012-.133-.04-.2-.082-.333a.613.613 0 00-.166-.267.248.248 0 00-.183-.064h-.021c-.071.006-.13.04-.186.132a.552.552 0 00-.12.27.944.944 0 00-.023.33v.015c.012.135.037.2.08.334.046.134.098.2.166.268.01.009.02.018.034.024-.07.057-.117.07-.176.136a.304.304 0 01-.131.068 2.62 2.62 0 01-.275-.402 1.772 1.772 0 01-.155-.667 1.759 1.759 0 01.08-.668 1.43 1.43 0 01.283-.535c.128-.133.26-.2.418-.2zm1.37 1.706c.332 0 .733.065 1.216.399.293.2.523.269 1.052.468h.003c.255.136.405.266.478.399v-.131a.571.571 0 01.016.47c-.123.31-.516.643-1.063.842v.002c-.268.135-.501.333-.775.465-.276.135-.588.292-1.012.267a1.139 1.139 0 01-.448-.067 3.566 3.566 0 01-.322-.198c-.195-.135-.363-.332-.612-.465v-.005h-.005c-.4-.246-.616-.512-.686-.71-.07-.268-.005-.47.193-.6.224-.135.38-.271.483-.336.104-.074.143-.102.176-.131h.002v-.003c.169-.202.436-.47.839-.601.139-.036.294-.065.466-.065zm2.8 2.142c.358 1.417 1.196 3.475 1.735 4.473.286.534.855 1.659 1.102 3.024.156-.005.33.018.513.064.646-1.671-.546-3.467-1.089-3.966-.22-.2-.232-.335-.123-.335.59.534 1.365 1.572 1.646 2.757.13.535.16 1.104.021 1.67.067.028.135.06.205.067 1.032.534 1.413.938 1.23 1.537v-.043c-.06-.003-.12 0-.18 0h-.016c.151-.467-.182-.825-1.065-1.224-.915-.4-1.646-.336-1.77.465-.008.043-.013.066-.018.135-.068.023-.139.053-.209.064-.43.268-.662.669-.793 1.187-.13.533-.17 1.156-.205 1.869v.003c-.02.334-.17.838-.319 1.35-1.5 1.072-3.58 1.538-5.348.334a2.645 2.645 0 00-.402-.533 1.45 1.45 0 00-.275-.333c.182 0 .338-.03.465-.067a.615.615 0 00.314-.334c.108-.267 0-.697-.345-1.163-.345-.467-.931-.995-1.788-1.521-.63-.4-.986-.87-1.15-1.396-.165-.534-.143-1.085-.015-1.645.245-1.07.873-2.11 1.274-2.763.107-.065.037.135-.408.974-.396.751-1.14 2.497-.122 3.854a8.123 8.123 0 01.647-2.876c.564-1.278 1.743-3.504 1.836-5.268.048.036.217.135.289.202.218.133.38.333.59.465.21.201.477.335.876.335.039.003.075.006.11.006.412 0 .73-.134.997-.268.29-.134.52-.334.74-.4h.005c.467-.135.835-.402 1.044-.7zm2.185 8.958c.037.6.343 1.245.882 1.377.588.134 1.434-.333 1.791-.765l.211-.01c.315-.007.577.01.847.268l.003.003c.208.199.305.53.391.876.085.4.154.78.409 1.066.486.527.645.906.636 1.14l.003-.007v.018l-.003-.012c-.015.262-.185.396-.498.595-.63.401-1.746.712-2.457 1.57-.618.737-1.37 1.14-2.036 1.191-.664.053-1.237-.2-1.574-.898l-.005-.003c-.21-.4-.12-1.025.056-1.69.176-.668.428-1.344.463-1.897.037-.714.076-1.335.195-1.814.12-.465.308-.797.641-.984l.045-.022zm-10.814.049h.01c.053 0 .105.005.157.014.376.055.706.333 1.023.752l.91 1.664.003.003c.243.533.754 1.064 1.189 1.637.434.598.77 1.131.729 1.57v.006c-.057.744-.48 1.148-1.125 1.294-.645.135-1.52.002-2.395-.464-.968-.536-2.118-.469-2.857-.602-.369-.066-.61-.2-.723-.4-.11-.2-.113-.602.123-1.23v-.004l.002-.003c.117-.334.03-.752-.027-1.118-.055-.401-.083-.71.043-.94.16-.334.396-.4.69-.533.294-.135.64-.202.915-.47h.002v-.002c.256-.268.445-.601.668-.838.19-.201.38-.336.663-.336zm7.159-9.074c-.435.201-.945.535-1.488.535-.542 0-.97-.267-1.28-.466-.154-.134-.28-.268-.373-.335-.164-.134-.144-.333-.074-.333.109.016.129.134.199.2.096.066.215.2.36.333.292.2.68.467 1.167.467.485 0 1.053-.267 1.398-.466.195-.135.445-.334.648-.467.156-.136.149-.267.279-.267.128.016.034.134-.147.332a8.097 8.097 0 01-.69.468zm-1.082-1.583V5.64c-.006-.02.013-.042.029-.05.074-.043.18-.027.26.004.063 0 .16.067.15.135-.006.049-.085.066-.135.066-.055 0-.092-.043-.141-.068-.052-.018-.146-.008-.163-.065zm-.551 0c-.02.058-.113.049-.166.066-.047.025-.086.068-.14.068-.05 0-.13-.02-.136-.068-.01-.066.088-.133.15-.133.08-.031.184-.047.259-.005.019.009.036.03.03.05v.02h.003z"
+ />
+ </svg>
+ );
+}
+
+/** Claude (Anthropic) sunburst, brand orange. */
+export function ClaudeIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="#D97757"
+ d="m4.714 15.956 4.717-2.647.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.696-.0729-2.337-.0971-2.265-.1214-.5707-.1215-.5343-.7042.055-.3522.48-.3218.686.061 1.518.1032 2.277.1578 1.651.0972 2.447.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.836l-2.55-1.688-1.336-.9714-.7225-.4918-.3643-.4614-.1578-1.008.6557-.7225.88.607.225.607.893.686 1.906 1.475 2.489 1.834.3643.303.1457-.1032.018-.0728-.164-.2733-1.354-2.447-1.445-2.489-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.134 6.7 0l.9957.134.419.364.6192 1.415 1.002 2.228 1.554 3.03.4553.899.2429.832.091.255h.1579v-.1457l.1275-1.706.237-2.095.2307-2.696.0789-.7589.376-.9107.747-.4918.583.2793.48.686-.668.443-.2853 1.852-.5586 2.902-.3643 1.943h.2125l.2429-.2429.983-1.305 1.651-2.064.7286-.8196.85-.9046.546-.4311h1.032l.759 1.129-.34 1.166-1.063 1.348-.8804 1.141-1.263 1.7-.7893 1.36.073.1093.188-.0183 2.853-.607 1.542-.2794 1.84-.3157.832.3886.91.395-.3278.807-1.967.486-2.307.4614-3.436.8136-.425.03.486.061 1.548.1457.662.0364h1.621l3.018.2247.789.522.474.6376-.79.486-1.214.6193-1.639-.3886-3.825-.9107-1.311-.3279h-.1822v.1093l1.093 1.069 2.003 1.809 2.507 2.331.1275.577-.3218.455-.34-.0486-2.204-1.657-.85-.7468-1.925-1.621h-.1275v.17l.4432.65 2.344 3.521.1214 1.081-.17.352-.6071.212-.6679-.1214-1.372-1.925L14.38 17.959l-1.141-1.943-.1397.079-.674 7.255-.3156.37-.7286.279-.6071-.4614-.3218-.7468.322-1.475.3886-1.925.3157-1.53.285-1.9.17-.6314-.0121-.0425-.1397.018-1.433 1.967-2.18 2.945-1.724 1.846-.4128.164-.7164-.3704.067-.6618.401-.5889 2.386-3.036 1.439-1.882.929-1.087-.0062-.1579h-.0546l-6.338 4.116-1.129.1457-.4857-.4554.061-.7467.231-.2429 1.906-1.311Z"
+ />
+ </svg>
+ );
+}
+
+/** Claude Code's pixel mascot, brand orange. */
+export function ClaudeCodeIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="#D97757"
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M20.998 10.949H24v3.102h-3v3.028h-1.487V20H18v-2.921h-1.487V20H15v-2.921H9V20H7.488v-2.921H6V20H4.487v-2.921H3V14.05H0V10.95h3V5h17.998v5.949zM6 10.949h1.488V8.102H6v2.847zm10.51 0H18V8.102h-1.49v2.847z"
+ />
+ </svg>
+ );
+}
+
+export function XLogoIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="currentColor"
+ d="M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"
+ />
+ </svg>
+ );
+}
+
+export function GitHubLogoIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="currentColor"
+ d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"
+ />
+ </svg>
+ );
+}
+
+/** OpenAI blossom (Codex). Simple Icons, CC0. */
+export function OpenAIIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="currentColor"
+ d="M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"
+ />
+ </svg>
+ );
+}
+
+/** Cursor cube. Simple Icons, CC0. */
+export function CursorIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="currentColor"
+ d="M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"
+ />
+ </svg>
+ );
+}
+
+/** Gemini sparkle in its blue-to-violet brand gradient. Simple Icons, CC0. */
+export function GeminiIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <defs>
+ <linearGradient id="gemini-sparkle" x1="0" y1="24" x2="24" y2="0">
+ <stop offset="0" stopColor="#1C7DFF" />
+ <stop offset="0.52" stopColor="#7A72F5" />
+ <stop offset="1" stopColor="#D96570" />
+ </linearGradient>
+ </defs>
+ <path
+ fill="url(#gemini-sparkle)"
+ d="M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"
+ />
+ </svg>
+ );
+}
+
+/** pnpm squares, brand orange. Simple Icons, CC0. */
+export function PnpmIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="#F69220"
+ d="M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM2 2h3.5v3.5H2zm8.25 0h3.498v3.5H10.25zm8.25 0H22v3.5h-3.5zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zm2 2H22v3.5h-3.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z"
+ />
+ </svg>
+ );
+}
+
+/** Yarn cat, brand blue. Simple Icons, CC0. */
+export function YarnIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="#2C8EBB"
+ d="M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06zm.006.7c-.507.016-1.001 1.519-1.001 1.519s-1.27-.204-2.266.871c-.199.218-.468.334-.746.44-.079.028-.176.023-.417.672-.371.991.625 2.094.625 2.094s-1.186.839-1.626 1.881c-.486 1.144-.338 2.261-.338 2.261s-.843.732-.899 1.487c-.051.663.139 1.2.343 1.515.227.343.51.176.51.176s-.561.653-.037.931c.477.25 1.283.394 1.71-.037.31-.31.371-1.001.486-1.283.028-.065.12.111.209.199.097.093.264.195.264.195s-.755.324-.445 1.066c.102.246.468.403 1.066.398.222-.005 2.664-.139 3.313-.296.375-.088.505-.283.505-.283s1.566-.431 2.998-1.357c.917-.598 1.293-.76 2.034-.936.612-.148.57-1.098-.241-1.084-.839.009-1.575.44-2.196.825-1.163.718-1.742.672-1.742.672l-.018-.032c-.079-.13.371-1.293-.134-2.678-.547-1.515-1.413-1.881-1.344-1.997.297-.5 1.038-1.297 1.334-2.78.176-.899.13-2.377-.269-3.151-.074-.144-.732.241-.732.241s-.616-1.371-.788-1.483a.271.271 0 0 0-.157-.046z"
+ />
+ </svg>
+ );
+}
+
+/** npm box, brand red. Simple Icons, CC0. */
+export function NpmIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" {...props}>
+ <path
+ fill="#CB3837"
+ d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"
+ />
+ </svg>
+ );
+}
+
+/** The Bun mascot, from bun.sh/logo.svg (shine and shadow layers dropped). */
+export function BunIcon(props: IconProps) {
+ return (
+ <svg viewBox="0 0 80 70" aria-hidden="true" {...props}>
+ <path
+ fill="#fbf0df"
+ d="M73 35.7c0 15.21-15.67 27.54-35 27.54S3 50.91 3 35.7C3 26.27 9 17.94 18.22 13S33.18 3 38 3s8.94 4.13 19.78 10C67 17.94 73 26.27 73 35.7Z"
+ />
+ <path
+ fill="#f6dece"
+ d="M73 35.7a21.67 21.67 0 0 0-.8-5.78c-2.73 33.3-43.35 34.9-59.32 24.94A40 40 0 0 0 38 63.24C57.3 63.24 73 50.89 73 35.7Z"
+ />
+ <path
+ fill="#ccbea7"
+ fillRule="evenodd"
+ d="M35.12 5.53A16.41 16.41 0 0 1 29.49 18c-.28.25-.06.73.3.59 3.37-1.31 7.92-5.23 6-13.14C35.71 5 35.12 5.12 35.12 5.53Zm2.27 0A16.24 16.24 0 0 1 39 19c-.12.35.31.65.55.36C41.74 16.56 43.65 11 37.93 5 37.64 4.74 37.19 5.14 37.39 5.49Zm2.76-.17A16.42 16.42 0 0 1 47 17.12a.33.33 0 0 0 .65.11c.92-3.49.4-9.44-7.17-12.53C40.08 4.54 39.82 5.08 40.15 5.32ZM21.69 15.76a16.94 16.94 0 0 0 10.47-9c.18-.36.75-.22.66.18-1.73 8-7.52 9.67-11.12 9.45C21.32 16.4 21.33 15.87 21.69 15.76Z"
+ />
+ <path
+ fill="#000"
+ d="M38 65.75C17.32 65.75.5 52.27.5 35.7c0-10 6.18-19.33 16.53-24.92 3-1.6 5.57-3.21 7.86-4.62 1.26-.78 2.45-1.51 3.6-2.19C32 1.89 35 .5 38 .5s5.62 1.2 8.9 3.14c1 .57 2 1.19 3.07 1.87 2.49 1.54 5.3 3.28 9 5.27C69.32 16.37 75.5 25.69 75.5 35.7 75.5 52.27 58.68 65.75 38 65.75ZM38 3c-2.42 0-5 1.25-8.25 3.13-1.13.66-2.3 1.39-3.54 2.15-2.33 1.44-5 3.07-8 4.7C8.69 18.13 3 26.62 3 35.7 3 50.89 18.7 63.25 38 63.25S73 50.89 73 35.7C73 26.62 67.31 18.13 57.78 13 54 11 51.05 9.12 48.66 7.64c-1.09-.67-2.09-1.29-3-1.84C42.63 4 40.42 3 38 3Z"
+ />
+ <path
+ fill="#b71422"
+ d="M45.05 43a8.93 8.93 0 0 1-2.92 4.71 6.81 6.81 0 0 1-4 1.88A6.84 6.84 0 0 1 34 47.71 8.93 8.93 0 0 1 31.12 43a.72.72 0 0 1 .8-.81h12.34a.72.72 0 0 1 .79.81Z"
+ />
+ <path
+ fill="#ff6164"
+ d="M34 47.79a6.91 6.91 0 0 0 4.12 1.9 6.91 6.91 0 0 0 4.11-1.9 10.63 10.63 0 0 0 1-1.07 6.83 6.83 0 0 0-4.9-2.31 6.15 6.15 0 0 0-5 2.78c.23.21.43.41.67.6Z"
+ />
+ <path
+ fill="#000"
+ d="M38.09 50.19a7.42 7.42 0 0 1-4.45-2 9.52 9.52 0 0 1-3.11-5.05 1.2 1.2 0 0 1 .26-1 1.41 1.41 0 0 1 1.13-.51h12.34a1.44 1.44 0 0 1 1.13.51 1.19 1.19 0 0 1 .25 1 9.52 9.52 0 0 1-3.11 5.05 7.42 7.42 0 0 1-4.44 2Zm-6.17-7.4c-.16 0-.2.07-.21.09a8.29 8.29 0 0 0 2.73 4.37A6.23 6.23 0 0 0 38.09 49a6.28 6.28 0 0 0 3.65-1.73 8.3 8.3 0 0 0 2.72-4.37.21.21 0 0 0-.2-.09Z"
+ />
+ <ellipse fill="#febbd0" cx="53.22" cy="40.18" rx="5.85" ry="3.44" />
+ <ellipse fill="#febbd0" cx="22.95" cy="40.18" rx="5.85" ry="3.44" />
+ <path
+ fill="#000"
+ fillRule="evenodd"
+ d="M25.7 38.8a5.51 5.51 0 1 0-5.5-5.51 5.51 5.51 0 0 0 5.5 5.51Zm24.77 0A5.51 5.51 0 1 0 45 33.29a5.5 5.5 0 0 0 5.47 5.51Z"
+ />
+ <path
+ fill="#fff"
+ fillRule="evenodd"
+ d="M24 33.64a2.07 2.07 0 1 0-2.06-2.07A2.07 2.07 0 0 0 24 33.64Zm24.77 0a2.07 2.07 0 1 0-2.06-2.07 2.07 2.07 0 0 0 2.06 2.07Z"
+ />
+ </svg>
+ );
+}
diff --git a/app/(home)/components/landing/ui/catalog-card.tsx b/app/(home)/components/landing/ui/catalog-card.tsx
new file mode 100644
index 00000000..4556767b
--- /dev/null
+++ b/app/(home)/components/landing/ui/catalog-card.tsx
@@ -0,0 +1,136 @@
+"use client";
+
+import { Player, type PlayerRef } from "@remotion/player";
+import { useReducedMotion } from "motion/react";
+import { type ComponentType, useEffect, useRef, useState } from "react";
+import { Clip, nativeDuration } from "../sections/hero/tiles/clips";
+import type { ClipSpec } from "../sections/hero/tiles/config";
+
+const FPS = 30;
+const HOLD_FRAMES = 45;
+const DENSITY = 2;
+
+type Sized = { width: number; height: number };
+
+export function LivePlayer<T extends Record<string, unknown>>({
+ component,
+ inputProps,
+ durationInFrames,
+ stillFrame,
+ background,
+ active = true,
+}: {
+ component: ComponentType<T & Sized>;
+ inputProps: T;
+ durationInFrames: number;
+ stillFrame: number;
+ background?: string;
+ /** False keeps it mounted but paused (prepared ahead of its turn). */
+ active?: boolean;
+}) {
+ const boxRef = useRef<HTMLDivElement>(null);
+ const playerRef = useRef<PlayerRef>(null);
+ const [size, setSize] = useState<Sized | null>(null);
+ const [visible, setVisible] = useState(true);
+ const reduced = useReducedMotion() ?? false;
+
+ useEffect(() => {
+ const node = boxRef.current;
+ if (!node) return;
+ const measure = () => {
+ const width = Math.round(node.offsetWidth * DENSITY);
+ const height = Math.round(node.offsetHeight * DENSITY);
+ if (!width || !height) return;
+ setSize((current) =>
+ current?.width === width && current.height === height
+ ? current
+ : { width, height },
+ );
+ };
+ measure();
+ const resize = new ResizeObserver(measure);
+ resize.observe(node);
+ const observer = new IntersectionObserver(
+ ([entry]) => setVisible(entry.isIntersecting),
+ {
+ rootMargin: "200px",
+ },
+ );
+ observer.observe(node);
+ return () => {
+ resize.disconnect();
+ observer.disconnect();
+ };
+ }, []);
+
+ // Every time it becomes active it starts over, as a fresh mount would.
+ useEffect(() => {
+ if (active) playerRef.current?.seekTo(0);
+ }, [active]);
+
+ useEffect(() => {
+ if (!size) return;
+ const player = playerRef.current;
+ if (reduced || !visible || !active) {
+ player?.pause();
+ if (reduced) player?.seekTo(stillFrame);
+ return;
+ }
+ const ensure = () => {
+ const current = playerRef.current;
+ if (current && !document.hidden && !current.isPlaying()) current.play();
+ };
+ ensure();
+ const id = window.setInterval(ensure, 400);
+ return () => window.clearInterval(id);
+ }, [size, reduced, visible, stillFrame, active]);
+
+ return (
+ <div ref={boxRef} className="absolute inset-0" style={{ background }}>
+ {size && (
+ <Player
+ ref={playerRef}
+ component={component}
+ inputProps={{ ...inputProps, ...size }}
+ durationInFrames={Math.max(durationInFrames, 1)}
+ fps={FPS}
+ compositionWidth={size.width}
+ compositionHeight={size.height}
+ style={{ width: "100%", height: "100%" }}
+ controls={false}
+ clickToPlay={false}
+ loop
+ initiallyMuted
+ numberOfSharedAudioTags={0}
+ acknowledgeRemotionLicense
+ />
+ )}
+ </div>
+ );
+}
+
+function CardScene({ spec, width, height }: { spec: ClipSpec } & Sized) {
+ return <Clip spec={spec} frame={{ width, height }} />;
+}
+
+export function CatalogCard({
+ spec,
+ active,
+}: {
+ spec: ClipSpec;
+ active?: boolean;
+}) {
+ const native = nativeDuration(spec.name);
+ return (
+ <LivePlayer
+ component={CardScene}
+ inputProps={{ spec }}
+ durationInFrames={
+ spec.end === "run" ? 300 : native - spec.start + HOLD_FRAMES
+ }
+ stillFrame={Math.round(native * 0.7)}
+ background={spec.background}
+ active={active}
+ />
+ );
+}
diff --git a/app/(home)/components/landing/ui/download-button.tsx b/app/(home)/components/landing/ui/download-button.tsx
new file mode 100644
index 00000000..053bd14f
--- /dev/null
+++ b/app/(home)/components/landing/ui/download-button.tsx
@@ -0,0 +1,53 @@
+import { STUDIO_URL } from "@/config/site";
+import { cn } from "@/lib/utils";
+import { AppleIcon, LinuxIcon } from "./brand-icons";
+
+/**
+ * "Download for free" with the macOS and Linux badges stacked on the left.
+ * The badges are concentric with the button: 15px radius minus the 10px
+ * inset leaves 5px.
+ * `tone="light"` is the white button on dark panels (Studio block),
+ * `tone="dark"` the ink one on light surfaces.
+ */
+export function StudioDownloadButton({
+ tone = "light",
+ className,
+}: {
+ tone?: "light" | "dark";
+ className?: string;
+}) {
+ const ring = tone === "light" ? "#FFFFFF" : "#0E1012";
+ return (
+ <a
+ href={STUDIO_URL}
+ target="_blank"
+ rel="noreferrer"
+ data-track="cta_clicked"
+ data-cta="studio_download"
+ data-destination={STUDIO_URL}
+ className={cn(
+ "inline-flex h-[52px] shrink-0 items-center gap-3 rounded-[15px] pr-[22px] pl-2.5 text-ui transition-[background-color,transform] duration-150 ease-out outline-none select-none active:translate-y-px focus-visible:ring-3 focus-visible:ring-ring",
+ tone === "light"
+ ? "bg-white text-[#0e1012] hover:bg-[#f4f4f5]"
+ : "bg-foreground text-background hover:bg-foreground/90",
+ className,
+ )}
+ >
+ <span className="flex items-center">
+ <span
+ className="flex size-8 items-center justify-center rounded-[5px] bg-[#0e1012] text-white"
+ style={{ boxShadow: `0 0 0 2px ${ring}` }}
+ >
+ <AppleIcon className="size-[15px]" />
+ </span>
+ <span
+ className="-ml-[9px] flex size-8 items-center justify-center rounded-[5px] bg-[#fde68a] text-[#0e1012]"
+ style={{ boxShadow: `0 0 0 2px ${ring}` }}
+ >
+ <LinuxIcon className="size-[17px]" />
+ </span>
+ </span>
+ Download for free
+ </a>
+ );
+}
diff --git a/app/(home)/components/landing/ui/landing-button.tsx b/app/(home)/components/landing/ui/landing-button.tsx
new file mode 100644
index 00000000..d9ff733d
--- /dev/null
+++ b/app/(home)/components/landing/ui/landing-button.tsx
@@ -0,0 +1,78 @@
+import { cva, type VariantProps } from "class-variance-authority";
+import Link from "next/link";
+import type { ComponentProps, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/**
+ * Landing buttons. Every button has a fill: ink (primary), secondary grey,
+ * light (on dark/shader panels), dark-raised (secondary on dark panels) and
+ * fuchsia (the single accent action). Arrows are a separate coloured glyph,
+ * passed via `arrow`.
+ */
+export const landingButtonVariants = cva(
+ "inline-flex shrink-0 items-center justify-center whitespace-nowrap font-sans transition-[background-color,box-shadow,transform] duration-150 ease-out outline-none select-none focus-visible:ring-3 focus-visible:ring-ring active:translate-y-px",
+ {
+ variants: {
+ variant: {
+ ink: "bg-foreground text-background hover:bg-foreground/90",
+ secondary:
+ "bg-secondary text-foreground hover:bg-[#dcdde0] dark:hover:bg-[#33363b]",
+ light: "bg-[#fafafa] text-[#0e1012] hover:bg-white",
+ "dark-raised": "bg-dark-control text-white hover:bg-[#272b2e]",
+ fuchsia: "bg-primary text-white hover:bg-primary/90",
+ },
+ size: {
+ lg: "h-[54px] gap-2.5 rounded-cta px-6 text-button-lg",
+ md: "h-12 gap-2.5 rounded-control px-5 text-ui",
+ nav: "h-[50px] gap-2 rounded-[13px] px-[18px] text-ui",
+ studio: "h-[52px] gap-3 rounded-[15px] px-[22px] text-ui",
+ },
+ },
+ defaultVariants: { variant: "ink", size: "lg" },
+ },
+);
+
+const ARROW_COLOR: Record<
+ NonNullable<VariantProps<typeof landingButtonVariants>["variant"]>,
+ string
+> = {
+ ink: "text-primary-soft dark:text-primary",
+ secondary: "text-primary",
+ light: "text-primary",
+ "dark-raised": "text-primary-soft",
+ fuchsia: "text-primary-tint",
+};
+
+type LandingButtonProps = Omit<ComponentProps<typeof Link>, "children"> &
+ VariantProps<typeof landingButtonVariants> & {
+ children: ReactNode;
+ /** Trailing glyph (usually "→"), tinted per variant. */
+ arrow?: ReactNode;
+ /** Muted trailing meta, e.g. "10 min". Sits before the arrow. */
+ meta?: ReactNode;
+ };
+
+export function LandingButton({
+ variant = "ink",
+ size,
+ className,
+ children,
+ arrow,
+ meta,
+ ...props
+}: LandingButtonProps) {
+ return (
+ <Link
+ className={cn(landingButtonVariants({ variant, size }), className)}
+ {...props}
+ >
+ {children}
+ {meta && <span className="text-muted-foreground">{meta}</span>}
+ {arrow && (
+ <span aria-hidden="true" className={ARROW_COLOR[variant ?? "ink"]}>
+ {arrow}
+ </span>
+ )}
+ </Link>
+ );
+}
diff --git a/app/(home)/components/landing/ui/live-silk.tsx b/app/(home)/components/landing/ui/live-silk.tsx
new file mode 100644
index 00000000..cfafd894
--- /dev/null
+++ b/app/(home)/components/landing/ui/live-silk.tsx
@@ -0,0 +1,68 @@
+"use client";
+
+import { type ComponentProps, useEffect, useRef, useState } from "react";
+import Silk from "@/components/Silk";
+import { cn } from "@/lib/utils";
+
+const RESTORE_DELAY_MS = 400;
+const MAX_RESTORES = 3;
+
+export function LiveSilk({
+ className,
+ ...props
+}: Omit<ComponentProps<typeof Silk>, "className"> & { className?: string }) {
+ const hostRef = useRef<HTMLDivElement>(null);
+ const [near, setNear] = useState(false);
+ const [introKey, setIntroKey] = useState(0);
+ const [generation, setGeneration] = useState(0);
+
+ useEffect(() => {
+ const host = hostRef.current;
+ if (!host) return;
+ // Mounted the first time it comes near and kept after that: Silk stops
+ // drawing off screen by itself, while unmounting would rebuild the WebGL
+ // context and recompile its shaders on every return (a ~400ms freeze).
+ // Coming back replays the intro instead, as a fresh mount used to.
+ let mounted = false;
+ let left = false;
+ const view = new IntersectionObserver(
+ ([entry]) => {
+ if (!entry.isIntersecting) {
+ left = mounted;
+ return;
+ }
+ if (left) setIntroKey((value) => value + 1);
+ mounted = true;
+ left = false;
+ setNear(true);
+ },
+ { rootMargin: "300px 0px" },
+ );
+ view.observe(host);
+
+ let timer = 0;
+ let restores = 0;
+ const onLost = () => {
+ if (restores >= MAX_RESTORES) return;
+ restores += 1;
+ window.clearTimeout(timer);
+ timer = window.setTimeout(
+ () => setGeneration((value) => value + 1),
+ RESTORE_DELAY_MS,
+ );
+ };
+ host.addEventListener("webglcontextlost", onLost, true);
+
+ return () => {
+ view.disconnect();
+ window.clearTimeout(timer);
+ host.removeEventListener("webglcontextlost", onLost, true);
+ };
+ }, []);
+
+ return (
+ <div ref={hostRef} aria-hidden="true" className={cn(className)}>
+ {near && <Silk key={generation} introKey={introKey} {...props} />}
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/ui/metal-ring.tsx b/app/(home)/components/landing/ui/metal-ring.tsx
new file mode 100644
index 00000000..6daec3d4
--- /dev/null
+++ b/app/(home)/components/landing/ui/metal-ring.tsx
@@ -0,0 +1,25 @@
+import { cn } from "@/lib/utils";
+
+/**
+ * The travelling ring for a `border-metal` element: fills its border, so pass
+ * the same width as the border (`border` → 1, `border-2` → 2). The host needs
+ * `relative` (or any positioning) and a border radius.
+ */
+export function MetalRing({
+ width = 1,
+ className,
+}: {
+ width?: 1 | 2;
+ className?: string;
+}) {
+ return (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "metal-ring",
+ width === 2 && "[--metal-width:2px]",
+ className,
+ )}
+ />
+ );
+}
diff --git a/app/(home)/components/landing/ui/pause-offscreen.tsx b/app/(home)/components/landing/ui/pause-offscreen.tsx
new file mode 100644
index 00000000..97aa9e5b
--- /dev/null
+++ b/app/(home)/components/landing/ui/pause-offscreen.tsx
@@ -0,0 +1,28 @@
+"use client";
+
+import { useEffect } from "react";
+
+/**
+ * Marks every `[data-section]` that's out of view with `data-offscreen`, which
+ * pauses its CSS loops (see globals.css; mark a new loop with `data-loop`).
+ * Off screen Chrome has no layer to hand a loop to the compositor, so it would
+ * tick every one of them on the main thread, every frame, for nothing.
+ */
+export function PauseOffscreen() {
+ useEffect(() => {
+ const observer = new IntersectionObserver(
+ (entries) => {
+ for (const entry of entries) {
+ entry.target.toggleAttribute("data-offscreen", !entry.isIntersecting);
+ }
+ },
+ { rootMargin: "150px 0px" },
+ );
+ for (const section of document.querySelectorAll("[data-section]")) {
+ observer.observe(section);
+ }
+ return () => observer.disconnect();
+ }, []);
+
+ return null;
+}
diff --git a/app/(home)/components/landing/ui/remocn-mark.tsx b/app/(home)/components/landing/ui/remocn-mark.tsx
new file mode 100644
index 00000000..a2a58a80
--- /dev/null
+++ b/app/(home)/components/landing/ui/remocn-mark.tsx
@@ -0,0 +1,75 @@
+import type { SVGProps } from "react";
+import { cn } from "@/lib/utils";
+
+const MARK_PATH =
+ "M 0.01 0.81 C 0.01 1.73, 0.36 2.79, 1.09 4.13 C 4.91 11.04, 13.45 17.16, 21.7 18.9 C 22.94 19.16, 23.18 19.16, 51.39 19.27 C 76.07 19.36, 80.02 19.4, 81.32 19.57 C 89.89 20.69, 96.2 24.68, 99.38 31.01 C 103.19 38.56, 102.53 50.1, 97.91 57.07 C 94.66 61.96, 89.68 64.99, 83.26 66 C 82.81 66.07, 70.18 66.83, 55.2 67.69 C 24.82 69.43, 27.03 69.23, 24.18 70.4 C 19.9 72.15, 14.84 75.7, 10.65 79.89 C 4.86 85.68, 1.3 91.91, 0.25 98.13 C 0.12 98.85, 0.08 103.13, 0.04 116.66 L 0 134.26 9.5 134.26 L 19 134.26 19.05 119.41 C 19.1 103.27, 19.08 103.82, 19.82 101.04 C 21.79 93.65, 27.86 88.75, 36.45 87.63 C 37.23 87.53, 39.41 87.5, 43.57 87.53 C 50.12 87.59, 50.75 87.65, 53.22 88.45 C 56.61 89.56, 59.67 91.86, 62.02 95.07 C 62.52 95.76, 69.35 103.85, 77.2 113.07 C 85.04 122.28, 91.63 130.04, 91.85 130.32 C 92.07 130.59, 92.5 131.34, 92.82 131.97 C 93.52 133.35, 94.11 133.93, 95.06 134.13 C 95.5 134.23, 98.97 134.26, 106.36 134.23 L 117.01 134.19 100.82 113.07 C 91.91 101.45, 84.52 91.78, 84.39 91.57 C 83.36 89.89, 83.66 87.53, 85.09 86 C 85.79 85.25, 86.36 84.94, 88.07 84.38 C 96.18 81.72, 104.15 76.62, 109.97 70.36 C 120.59 58.93, 124.06 44.32, 119.44 30.43 C 114.59 15.81, 101.93 4.02, 87.64 0.83 C 83.93 0.01, 88.09 0.08, 41.85 0.04 L 0.01 0 0.01 0.81 Z";
+
+/** The "r" glyph of the remocn logo. Inherits `currentColor`. */
+export function RemocnMark({ className, ...props }: SVGProps<SVGSVGElement>) {
+ return (
+ <svg
+ viewBox="0 0 124.06 134.26"
+ aria-hidden="true"
+ className={cn("shrink-0", className)}
+ {...props}
+ >
+ <path fill="currentColor" d={MARK_PATH} />
+ </svg>
+ );
+}
+
+/** Mark + "emocn" set in Manrope, as in the nav capsule and the footer. */
+export function RemocnWordmark({ className }: { className?: string }) {
+ return (
+ <span
+ className={cn(
+ "inline-flex items-baseline gap-px text-foreground",
+ className,
+ )}
+ >
+ <RemocnMark className="h-[17px] w-4" />
+ <span className="font-wordmark text-[22px] leading-[22px] font-semibold tracking-[-0.025em]">
+ emocn
+ </span>
+ </span>
+ );
+}
+
+/**
+ * Remocn Studio app icon: the violet shader tile with a white mark on top.
+ * Used by the hero studio pill, the composer's "Run in Remocn Studio" button
+ * and the Studio block.
+ */
+export function StudioAppIcon({
+ size = 32,
+ radius = 9,
+ markSize = 13,
+ className,
+}: {
+ size?: number;
+ radius?: number;
+ /** Width of the mark; pass 0 to render the bare tile. */
+ markSize?: number;
+ className?: string;
+}) {
+ return (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "flex shrink-0 items-center justify-center bg-cover text-white",
+ className,
+ )}
+ style={{
+ width: size,
+ height: size,
+ borderRadius: radius,
+ backgroundImage: "url(/landing/shader-violet.png)",
+ backgroundPosition: "25%",
+ }}
+ >
+ {markSize > 0 && (
+ <RemocnMark style={{ width: markSize, height: markSize * 1.08 }} />
+ )}
+ </span>
+ );
+}
diff --git a/app/(home)/components/landing/ui/reveal-scope.tsx b/app/(home)/components/landing/ui/reveal-scope.tsx
new file mode 100644
index 00000000..1e7854ff
--- /dev/null
+++ b/app/(home)/components/landing/ui/reveal-scope.tsx
@@ -0,0 +1,81 @@
+"use client";
+
+import { useEffect } from "react";
+
+const REVEAL_EDGE = 0.9;
+
+export function RevealScope() {
+ useEffect(() => {
+ const root = document.documentElement;
+ const fold = window.innerHeight;
+ const pending = new Set<Element>();
+
+ for (const node of document.querySelectorAll(
+ "[data-reveal]:not([data-shown])",
+ )) {
+ if (node.getBoundingClientRect().top < fold) {
+ node.setAttribute("data-shown", "static");
+ } else {
+ pending.add(node);
+ }
+ }
+
+ root.setAttribute("data-reveal-ready", "");
+
+ const show = (node: Element) => {
+ node.setAttribute("data-shown", "in");
+ reveal.unobserve(node);
+ screen.unobserve(node);
+ pending.delete(node);
+ };
+
+ const reveal = new IntersectionObserver(
+ (entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) show(entry.target);
+ }
+ },
+ { rootMargin: `0px 0px -${(1 - REVEAL_EDGE) * 100}% 0px` },
+ );
+ for (const node of pending) reveal.observe(node);
+
+ // Blocks near the bottom may never cross the reveal edge, so once the page
+ // end is reached every pending block on screen is shown. Tracked with
+ // observers, not a scroll listener: reading scrollY/scrollHeight on scroll
+ // forces a synchronous style + layout pass mid-frame.
+ const onScreen = new Set<Element>();
+ let atEnd = false;
+ const flush = () => {
+ if (!atEnd) return;
+ for (const node of pending) if (onScreen.has(node)) show(node);
+ };
+ const screen = new IntersectionObserver((entries) => {
+ for (const entry of entries) {
+ if (entry.isIntersecting) onScreen.add(entry.target);
+ else onScreen.delete(entry.target);
+ }
+ flush();
+ });
+ for (const node of pending) screen.observe(node);
+ const end = new IntersectionObserver(
+ ([entry]) => {
+ atEnd = entry.isIntersecting;
+ flush();
+ },
+ // 4px of slack below the viewport: the footer's bottom lands on a
+ // subpixel edge, so it would never count as fully visible otherwise.
+ { threshold: 1, rootMargin: "0px 0px 4px 0px" },
+ );
+ const footer = document.querySelector("footer");
+ if (footer) end.observe(footer);
+
+ return () => {
+ reveal.disconnect();
+ screen.disconnect();
+ end.disconnect();
+ root.removeAttribute("data-reveal-ready");
+ };
+ }, []);
+
+ return null;
+}
diff --git a/app/(home)/components/landing/ui/roll-player/roll-buttons.tsx b/app/(home)/components/landing/ui/roll-player/roll-buttons.tsx
new file mode 100644
index 00000000..338f485c
--- /dev/null
+++ b/app/(home)/components/landing/ui/roll-player/roll-buttons.tsx
@@ -0,0 +1,133 @@
+import { cn } from "@/lib/utils";
+
+export const SPEEDS = [0.5, 1, 2] as const;
+export type Speed = (typeof SPEEDS)[number];
+
+const formatSpeed = (speed: Speed) => `${speed}×`;
+
+export function formatTime(seconds: number) {
+ const s = Math.max(0, Math.floor(seconds));
+ return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
+}
+
+const RAISED_BUTTON =
+ "flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-dark-raised text-dark-body outline-none transition-colors duration-150 hover:text-[#fafafa] focus-visible:ring-2 focus-visible:ring-white/40";
+
+export function PlayButton({
+ playing,
+ ended,
+ label,
+ onClick,
+}: {
+ playing: boolean;
+ ended: boolean;
+ label: string;
+ onClick: () => void;
+}) {
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ aria-label={`${playing ? "Pause" : ended ? "Replay" : "Play"} ${label}`}
+ className="flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-[#fafafa] outline-none transition-[background-color,transform] duration-150 hover:bg-white focus-visible:ring-3 focus-visible:ring-white/40 active:translate-y-px"
+ >
+ {playing ? (
+ <span aria-hidden="true" className="flex gap-[3px]">
+ <span className="h-3 w-[3px] rounded-[1px] bg-dark-surface" />
+ <span className="h-3 w-[3px] rounded-[1px] bg-dark-surface" />
+ </span>
+ ) : (
+ <span
+ aria-hidden="true"
+ className="ml-0.5 size-0 border-y-[5px] border-l-8 border-y-transparent border-l-dark-surface"
+ />
+ )}
+ </button>
+ );
+}
+
+/**
+ * Playback speed: a segmented 0.5× / 1× / 2× from `md`, and a single button
+ * that cycles through them on narrow screens.
+ */
+export function SpeedControl({
+ speed,
+ onChange,
+}: {
+ speed: Speed;
+ onChange: (speed: Speed) => void;
+}) {
+ const next = SPEEDS[(SPEEDS.indexOf(speed) + 1) % SPEEDS.length];
+ return (
+ <>
+ <fieldset className="flex h-10 shrink-0 items-center gap-0.5 rounded-[10px] bg-dark-raised p-1 max-md:hidden">
+ <legend className="sr-only">Playback speed</legend>
+ {SPEEDS.map((option) => (
+ <button
+ key={option}
+ type="button"
+ aria-pressed={option === speed}
+ onClick={() => onChange(option)}
+ className={cn(
+ "h-8 rounded-[7px] px-2.5 text-mono tabular-nums outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-white/40",
+ option === speed
+ ? "bg-white/[0.12] text-[#fafafa]"
+ : "text-dark-body hover:text-[#fafafa]",
+ )}
+ >
+ {formatSpeed(option)}
+ </button>
+ ))}
+ </fieldset>
+ <button
+ type="button"
+ onClick={() => onChange(next)}
+ aria-label={`Playback speed ${formatSpeed(speed)}, switch to ${formatSpeed(next)}`}
+ className={cn(
+ RAISED_BUTTON,
+ "w-auto px-2.5 text-mono text-[#fafafa] tabular-nums md:hidden",
+ )}
+ >
+ {formatSpeed(speed)}
+ </button>
+ </>
+ );
+}
+
+function FullscreenIcon({ exit }: { exit: boolean }) {
+ // Four corners pointing out to enter, pointing in to exit.
+ const corners = exit
+ ? "M9 4v5H4M15 4v5h5M9 20v-5H4M15 20v-5h5"
+ : "M4 9V4h5M20 9V4h-5M4 15v5h5M20 15v5h-5";
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-[18px]">
+ <path
+ d={corners}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+export function FullscreenButton({
+ active,
+ onClick,
+}: {
+ active: boolean;
+ onClick: () => void;
+}) {
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ aria-label={active ? "Exit full screen" : "Full screen"}
+ className={RAISED_BUTTON}
+ >
+ <FullscreenIcon exit={active} />
+ </button>
+ );
+}
diff --git a/app/(home)/components/landing/ui/roll-player/roll-player.tsx b/app/(home)/components/landing/ui/roll-player/roll-player.tsx
new file mode 100644
index 00000000..080ab095
--- /dev/null
+++ b/app/(home)/components/landing/ui/roll-player/roll-player.tsx
@@ -0,0 +1,482 @@
+"use client";
+
+import {
+ type KeyboardEvent,
+ type ReactNode,
+ type PointerEvent as ReactPointerEvent,
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+} from "react";
+import { cn } from "@/lib/utils";
+import {
+ FullscreenButton,
+ formatTime,
+ PlayButton,
+ type Speed,
+ SpeedControl,
+} from "./roll-buttons";
+import {
+ type HandleSide,
+ RollTimeline,
+ type VisibleSeconds,
+} from "./roll-timeline";
+
+/** Roll speed at 1× in px/s (layout px): slow enough to read every name. */
+const PX_PER_SECOND = 56;
+/** Before the first measure: the design's 0:13 roll. */
+const FALLBACK_DURATION = 13;
+/** The frame's share of the timeline at 1× zoom, as in the design. */
+const BASE_FRAME = 0.26;
+/** How far the frame can zoom the roll out (smaller) and in (larger). */
+const ZOOM_MIN = 0.45;
+const ZOOM_MAX = 1.6;
+/** Handle keyboard step, as a zoom factor. */
+const ZOOM_STEP = 1.1;
+
+const clamp = (value: number, min: number, max: number) =>
+ Math.min(max, Math.max(min, value));
+
+/**
+ * A dark video player whose screen rolls its content upward, linearly, from
+ * the top until the `[data-roll-end]` element sits in the middle of the
+ * screen (the whole content when there's none).
+ *
+ * The frame on the timeline is the stretch of the roll in view. Dragging its
+ * handles stretches or squeezes it, and the roll zooms out or in by the same
+ * factor (twice as wide, half the size); the running time stays the same. Speed (0.5× / 1× / 2×) and full
+ * screen sit next to the timeline.
+ *
+ * Playback is a ref-held progress (0..1) written straight to `transform`, so
+ * React only re-renders when the shown second changes.
+ */
+export function RollPlayer({
+ label,
+ children,
+}: {
+ /** What's playing, for control labels: "credits" → "Pause credits". */
+ label: string;
+ children: ReactNode;
+}) {
+ const rootRef = useRef<HTMLDivElement>(null);
+ const screenRef = useRef<HTMLDivElement>(null);
+ const rollRef = useRef<HTMLDivElement>(null);
+ const trackRef = useRef<HTMLDivElement>(null);
+ const frameRef = useRef<HTMLDivElement>(null);
+ const brightRef = useRef<HTMLDivElement>(null);
+
+ const progress = useRef(0);
+ /** Layout px the roll travels at 1× zoom, and the screen's height. */
+ const shiftRef = useRef(0);
+ const screenHeightRef = useRef(0);
+ const durationRef = useRef(FALLBACK_DURATION);
+ const zoomRef = useRef(1);
+ const speedRef = useRef<Speed>(1);
+ const shownSecond = useRef(0);
+ const seeking = useRef(false);
+ const handleDrag = useRef<{
+ side: HandleSide;
+ startX: number;
+ startFrame: number;
+ } | null>(null);
+ const shownFrame = useRef(-1);
+
+ const [duration, setDuration] = useState(FALLBACK_DURATION);
+ const [current, setCurrent] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const [ended, setEnded] = useState(false);
+ const [inView, setInView] = useState(false);
+ const [pageVisible, setPageVisible] = useState(true);
+ const [speed, setSpeed] = useState<Speed>(1);
+ const [visible, setVisible] = useState<VisibleSeconds>({
+ now: FALLBACK_DURATION * BASE_FRAME,
+ min: 0,
+ max: FALLBACK_DURATION,
+ });
+ const [canFullscreen, setCanFullscreen] = useState(false);
+ const [fullscreen, setFullscreen] = useState(false);
+
+ /** The frame's share of the timeline: wider as the roll zooms out. */
+ const frameWidth = useCallback(() => BASE_FRAME / zoomRef.current, []);
+
+ const paint = useCallback(() => {
+ const p = progress.current;
+ const zoom = zoomRef.current;
+ const half = screenHeightRef.current / 2;
+ // The roll point at the screen's centre moves from half a screen down the
+ // roll to the end; scaling is around the roll's top centre.
+ if (rollRef.current) {
+ const y = half - zoom * (half + p * shiftRef.current);
+ rollRef.current.style.transform = `translate3d(0, ${y}px, 0) scale(${zoom})`;
+ }
+ // The frame travels the free part of the track; the bright copy of the
+ // ruler is clipped to exactly where the frame sits.
+ const width = frameWidth();
+ const left = p * (1 - width);
+ if (frameRef.current) {
+ if (width !== shownFrame.current) {
+ shownFrame.current = width;
+ frameRef.current.style.width = `${width * 100}%`;
+ }
+ frameRef.current.style.transform = `translateX(${(left / width) * 100}%)`;
+ }
+ if (brightRef.current) {
+ brightRef.current.style.clipPath = `inset(0 ${(1 - left - width) * 100}% 0 ${left * 100}%)`;
+ }
+ const second = Math.floor(p * durationRef.current);
+ if (second !== shownSecond.current) {
+ shownSecond.current = second;
+ setCurrent(second);
+ }
+ }, [frameWidth]);
+
+ const seek = useCallback(
+ (next: number) => {
+ progress.current = clamp(next, 0, 1);
+ setEnded(progress.current >= 1);
+ paint();
+ },
+ [paint],
+ );
+
+ const publishVisible = useCallback(() => {
+ const base = BASE_FRAME * durationRef.current;
+ setVisible({
+ now: frameWidth() * durationRef.current,
+ min: base / ZOOM_MAX,
+ max: base / ZOOM_MIN,
+ });
+ }, [frameWidth]);
+
+ const setZoom = useCallback(
+ (zoom: number) => {
+ zoomRef.current = clamp(zoom, ZOOM_MIN, ZOOM_MAX);
+ publishVisible();
+ paint();
+ },
+ [publishVisible, paint],
+ );
+
+ // Measure the roll: it travels until the end element is centred on screen.
+ useEffect(() => {
+ const screen = screenRef.current;
+ const roll = rollRef.current;
+ if (!screen || !roll) return;
+
+ const measure = () => {
+ const height = screen.clientHeight;
+ const end = roll.querySelector<HTMLElement>("[data-roll-end]");
+ const endCenter = end
+ ? end.offsetTop + end.offsetHeight / 2
+ : roll.offsetHeight - height / 2;
+ screenHeightRef.current = height;
+ shiftRef.current = Math.max(0, endCenter - height / 2);
+ durationRef.current = Math.max(1, shiftRef.current / PX_PER_SECOND);
+ setDuration(durationRef.current);
+ publishVisible();
+ paint();
+ };
+
+ measure();
+ const observer = new ResizeObserver(measure);
+ observer.observe(screen);
+ observer.observe(roll);
+ return () => observer.disconnect();
+ }, [publishVisible, paint]);
+
+ // Autoplay unless the user prefers reduced motion.
+ useEffect(() => {
+ const query = window.matchMedia("(prefers-reduced-motion: reduce)");
+ setPlaying(!query.matches);
+ const onChange = (event: MediaQueryListEvent) => {
+ if (event.matches) setPlaying(false);
+ };
+ query.addEventListener("change", onChange);
+ return () => query.removeEventListener("change", onChange);
+ }, []);
+
+ // Only roll while the screen is on screen and the tab is visible.
+ useEffect(() => {
+ const screen = screenRef.current;
+ if (!screen) return;
+ const observer = new IntersectionObserver(
+ ([entry]) => setInView(entry.isIntersecting),
+ { threshold: 0.35 },
+ );
+ observer.observe(screen);
+
+ const syncVisibility = () =>
+ setPageVisible(document.visibilityState === "visible");
+ syncVisibility();
+ document.addEventListener("visibilitychange", syncVisibility);
+ return () => {
+ observer.disconnect();
+ document.removeEventListener("visibilitychange", syncVisibility);
+ };
+ }, []);
+
+ // Full screen takes the whole player (screen and controls). Phones that
+ // can't put an element in full screen (iPhone Safari) get no button.
+ useEffect(() => {
+ setCanFullscreen(document.fullscreenEnabled);
+ const onChange = () =>
+ setFullscreen(document.fullscreenElement === rootRef.current);
+ document.addEventListener("fullscreenchange", onChange);
+ return () => document.removeEventListener("fullscreenchange", onChange);
+ }, []);
+
+ // Tabbing into a link on the roll pauses it and brings that link on screen.
+ useEffect(() => {
+ const screen = screenRef.current;
+ const roll = rollRef.current;
+ if (!screen || !roll) return;
+ const onFocusIn = (event: FocusEvent) => {
+ const shift = shiftRef.current;
+ if (shift === 0 || !(event.target instanceof Element)) return;
+ const target = event.target.getBoundingClientRect();
+ // Back to layout px: the roll is drawn scaled by the zoom.
+ const center =
+ (target.top - roll.getBoundingClientRect().top + target.height / 2) /
+ zoomRef.current;
+ setPlaying(false);
+ seek((center - screen.clientHeight / 2) / shift);
+ };
+ screen.addEventListener("focusin", onFocusIn);
+ return () => screen.removeEventListener("focusin", onFocusIn);
+ }, [seek]);
+
+ const running = playing && inView && pageVisible;
+
+ useEffect(() => {
+ if (!running) return;
+ let frame = 0;
+ let last = performance.now();
+ const tick = (now: number) => {
+ const dt = Math.min(0.1, (now - last) / 1000);
+ last = now;
+ if (!seeking.current) {
+ progress.current = Math.min(
+ 1,
+ progress.current + (dt * speedRef.current) / durationRef.current,
+ );
+ paint();
+ if (progress.current >= 1) {
+ setPlaying(false);
+ setEnded(true);
+ return;
+ }
+ }
+ frame = requestAnimationFrame(tick);
+ };
+ frame = requestAnimationFrame(tick);
+ return () => cancelAnimationFrame(frame);
+ }, [running, paint]);
+
+ const toggle = () => {
+ if (playing) {
+ setPlaying(false);
+ return;
+ }
+ if (progress.current >= 1) seek(0);
+ setPlaying(true);
+ };
+
+ const changeSpeed = (next: Speed) => {
+ speedRef.current = next;
+ setSpeed(next);
+ };
+
+ const toggleFullscreen = () => {
+ if (document.fullscreenElement) {
+ void document.exitFullscreen();
+ } else {
+ rootRef.current?.requestFullscreen().catch(() => {});
+ }
+ };
+
+ // Seeking: the pointer sets where the frame's centre is.
+ const pointerFraction = (clientX: number) => {
+ const rect = trackRef.current?.getBoundingClientRect();
+ return rect ? (clientX - rect.left) / rect.width : 0;
+ };
+
+ const seekToPointer = (clientX: number) => {
+ const width = frameWidth();
+ const x = pointerFraction(clientX);
+ seek(width >= 1 ? x : (x - width / 2) / (1 - width));
+ };
+
+ const onSeekPointerDown = (event: ReactPointerEvent<HTMLDivElement>) => {
+ if (event.button !== 0) return;
+ event.currentTarget.setPointerCapture(event.pointerId);
+ seeking.current = true;
+ seekToPointer(event.clientX);
+ };
+
+ const onSeekPointerMove = (event: ReactPointerEvent<HTMLDivElement>) => {
+ if (seeking.current) seekToPointer(event.clientX);
+ };
+
+ const onSeekPointerUp = (event: ReactPointerEvent<HTMLDivElement>) => {
+ seeking.current = false;
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
+ event.currentTarget.releasePointerCapture(event.pointerId);
+ }
+ };
+
+ const onSeekKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
+ const second = 1 / durationRef.current;
+ const steps: Record<string, number> = {
+ ArrowRight: second,
+ ArrowUp: second,
+ ArrowLeft: -second,
+ ArrowDown: -second,
+ PageUp: 5 * second,
+ PageDown: -5 * second,
+ };
+ if (event.key === "Home") seek(0);
+ else if (event.key === "End") seek(1);
+ else if (event.key in steps) seek(progress.current + steps[event.key]);
+ else return;
+ event.preventDefault();
+ };
+
+ // Dragging a handle: the frame sits at `p * (1 - width)`, so each unit of
+ // extra width moves its start edge by `-p` and its end edge by `1 - p`.
+ // Dividing the pointer's travel by that keeps the dragged handle under the
+ // pointer. Next to the end the frame is pinned to, that edge barely moves,
+ // so the drag stretches both sides evenly instead.
+ const onHandlePointerDown = (
+ side: HandleSide,
+ event: ReactPointerEvent<HTMLSpanElement>,
+ ) => {
+ if (event.button !== 0) return;
+ event.stopPropagation();
+ event.currentTarget.setPointerCapture(event.pointerId);
+ handleDrag.current = {
+ side,
+ startX: pointerFraction(event.clientX),
+ startFrame: frameWidth(),
+ };
+ };
+
+ const onHandlePointerMove = (
+ _: HandleSide,
+ event: ReactPointerEvent<HTMLSpanElement>,
+ ) => {
+ const drag = handleDrag.current;
+ if (!drag) return;
+ const delta = pointerFraction(event.clientX) - drag.startX;
+ const p = progress.current;
+ const rate = drag.side === "end" ? 1 - p : -p;
+ const width =
+ drag.startFrame +
+ (Math.abs(rate) < 0.15
+ ? (drag.side === "end" ? 2 : -2) * delta
+ : delta / rate);
+ if (width <= 0) return;
+ setZoom(BASE_FRAME / width);
+ };
+
+ const onHandlePointerUp = (
+ _: HandleSide,
+ event: ReactPointerEvent<HTMLSpanElement>,
+ ) => {
+ if (!handleDrag.current) return;
+ handleDrag.current = null;
+ if (event.currentTarget.hasPointerCapture(event.pointerId)) {
+ event.currentTarget.releasePointerCapture(event.pointerId);
+ }
+ sharpen();
+ };
+
+ // ArrowRight / Up widens the frame (more on screen, smaller).
+ const onHandleKeyDown = (event: KeyboardEvent<HTMLSpanElement>) => {
+ const steps: Record<string, number> = {
+ ArrowRight: 1 / ZOOM_STEP,
+ ArrowUp: 1 / ZOOM_STEP,
+ ArrowLeft: ZOOM_STEP,
+ ArrowDown: ZOOM_STEP,
+ };
+ if (event.key === "Home") setZoom(1);
+ else if (event.key in steps) setZoom(zoomRef.current * steps[event.key]);
+ else return;
+ event.preventDefault();
+ sharpen();
+ };
+
+ // A layer promoted with will-change keeps the raster scale it was first
+ // drawn at, so zoomed-in text would stay blurry. Dropping the hint for a
+ // frame makes the browser redraw it at the new scale.
+ const sharpen = () => {
+ const roll = rollRef.current;
+ if (!roll) return;
+ roll.style.willChange = "auto";
+ requestAnimationFrame(() => {
+ roll.style.willChange = "transform";
+ });
+ };
+
+ return (
+ <div
+ ref={rootRef}
+ className={cn(
+ "flex flex-col gap-2 bg-dark-surface p-2 sm:gap-3 sm:p-3",
+ fullscreen ? "h-full rounded-none" : "rounded-panel sm:rounded-shell",
+ )}
+ >
+ <div
+ ref={screenRef}
+ className={cn(
+ "relative overflow-clip rounded-card bg-[#060708]",
+ fullscreen ? "min-h-0 flex-1" : "h-[480px] lg:aspect-video lg:h-auto",
+ )}
+ >
+ <div className="absolute inset-0 [mask-image:linear-gradient(to_bottom,transparent,#000_56px,#000_calc(100%-56px),transparent)]">
+ <div
+ ref={rollRef}
+ className="relative origin-top will-change-transform"
+ >
+ {children}
+ </div>
+ </div>
+ </div>
+
+ {/* Phones: the timeline takes its own row above the buttons. */}
+ <div className="flex shrink-0 flex-wrap items-center gap-2 rounded-capsule bg-dark-surface p-3 sm:h-16 sm:flex-nowrap sm:gap-3 sm:py-0">
+ <PlayButton
+ playing={playing}
+ ended={ended}
+ label={label}
+ onClick={toggle}
+ />
+ <span className="shrink-0 text-mono text-dark-body tabular-nums max-sm:mr-auto">
+ {formatTime(current)} / {formatTime(Math.round(duration))}
+ </span>
+ <RollTimeline
+ className="max-sm:order-first max-sm:basis-full"
+ label={label}
+ current={current}
+ duration={duration}
+ visible={visible}
+ trackRef={trackRef}
+ frameRef={frameRef}
+ brightRef={brightRef}
+ onSeekKeyDown={onSeekKeyDown}
+ onSeekPointerDown={onSeekPointerDown}
+ onSeekPointerMove={onSeekPointerMove}
+ onSeekPointerUp={onSeekPointerUp}
+ onHandlePointerDown={onHandlePointerDown}
+ onHandlePointerMove={onHandlePointerMove}
+ onHandlePointerUp={onHandlePointerUp}
+ onHandleKeyDown={onHandleKeyDown}
+ />
+ <SpeedControl speed={speed} onChange={changeSpeed} />
+ {canFullscreen && (
+ <FullscreenButton active={fullscreen} onClick={toggleFullscreen} />
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/ui/roll-player/roll-timeline.tsx b/app/(home)/components/landing/ui/roll-player/roll-timeline.tsx
new file mode 100644
index 00000000..dc813634
--- /dev/null
+++ b/app/(home)/components/landing/ui/roll-player/roll-timeline.tsx
@@ -0,0 +1,223 @@
+"use client";
+
+import {
+ Fragment,
+ type KeyboardEvent,
+ type PointerEvent as ReactPointerEvent,
+ type Ref,
+} from "react";
+import { cn } from "@/lib/utils";
+import { formatTime } from "./roll-buttons";
+
+const LABEL_COUNT = 7;
+const TICKS_BETWEEN = 2;
+
+/** 0s … duration across seven evenly spaced labels, last one exact. */
+function rulerLabels(duration: number) {
+ return Array.from({ length: LABEL_COUNT }, (_, i) => ({
+ id: `label-${i}`,
+ value:
+ i === LABEL_COUNT - 1
+ ? Math.round(duration)
+ : Math.floor((i * duration) / (LABEL_COUNT - 1)),
+ }));
+}
+
+/** Labels and ticks; rendered twice (muted, then bright inside the frame). */
+function Ruler({
+ labels,
+ bright,
+}: {
+ labels: ReturnType<typeof rulerLabels>;
+ bright?: boolean;
+}) {
+ return labels.map((label, i) => (
+ <Fragment key={label.id}>
+ <span
+ className={cn(
+ "text-mono",
+ bright ? "text-[#fafafa]" : "text-dark-body",
+ )}
+ >
+ {label.value}s
+ </span>
+ {i < labels.length - 1 &&
+ Array.from({ length: TICKS_BETWEEN }, (_, t) => (
+ <span
+ key={t}
+ className={cn(
+ "h-3 w-px shrink-0",
+ bright ? "bg-[#4a4e52]" : "bg-[#3a3e42]",
+ )}
+ />
+ ))}
+ </Fragment>
+ ));
+}
+
+const RULER_ROW =
+ "absolute inset-0 flex items-center justify-between px-4 tabular-nums";
+
+export type HandleSide = "start" | "end";
+
+/** Seconds the frame spans: now, and at the zoom limits. */
+export type VisibleSeconds = { now: number; min: number; max: number };
+
+type HandlePointer = (
+ side: HandleSide,
+ event: ReactPointerEvent<HTMLSpanElement>,
+) => void;
+
+/**
+ * A grip on one edge of the frame. Wider than the bar it draws, so it's easy
+ * to catch; dragging it stretches or squeezes the frame (and with it how much
+ * of the roll fits on screen).
+ */
+function Handle({
+ side,
+ onPointerDown,
+ onPointerMove,
+ onPointerUp,
+ onKeyDown,
+ visible,
+}: {
+ side: HandleSide;
+ onPointerDown: HandlePointer;
+ onPointerMove: HandlePointer;
+ onPointerUp: HandlePointer;
+ /** Only one handle is a keyboard slider; the other is pointer-only. */
+ onKeyDown?: (event: KeyboardEvent<HTMLSpanElement>) => void;
+ visible: VisibleSeconds;
+}) {
+ const grip = {
+ onPointerDown: (event: ReactPointerEvent<HTMLSpanElement>) =>
+ onPointerDown(side, event),
+ onPointerMove: (event: ReactPointerEvent<HTMLSpanElement>) =>
+ onPointerMove(side, event),
+ onPointerUp: (event: ReactPointerEvent<HTMLSpanElement>) =>
+ onPointerUp(side, event),
+ onPointerCancel: (event: ReactPointerEvent<HTMLSpanElement>) =>
+ onPointerUp(side, event),
+ className: cn(
+ "group/handle pointer-events-auto absolute inset-y-0 flex w-3 cursor-ew-resize touch-none items-center justify-center rounded-[6px] outline-none focus-visible:ring-2 focus-visible:ring-white/50",
+ side === "start" ? "left-0" : "right-0",
+ ),
+ };
+ const bar = (
+ <span className="h-3.5 w-[3px] rounded-[2px] bg-[#fafafa] transition-transform duration-150 ease-out group-hover/handle:scale-y-125 group-active/handle:scale-y-125" />
+ );
+
+ if (!onKeyDown) {
+ return (
+ <span aria-hidden="true" {...grip}>
+ {bar}
+ </span>
+ );
+ }
+ return (
+ <span
+ role="slider"
+ tabIndex={0}
+ aria-label="Frame length"
+ aria-valuemin={Math.round(visible.min)}
+ aria-valuemax={Math.round(visible.max)}
+ aria-valuenow={Math.round(visible.now)}
+ aria-valuetext={`${visible.now.toFixed(1)} seconds in frame`}
+ onKeyDown={onKeyDown}
+ {...grip}
+ >
+ {bar}
+ </span>
+ );
+}
+
+export function RollTimeline({
+ className,
+ label,
+ current,
+ duration,
+ visible,
+ trackRef,
+ frameRef,
+ brightRef,
+ onSeekKeyDown,
+ onSeekPointerDown,
+ onSeekPointerMove,
+ onSeekPointerUp,
+ onHandlePointerDown,
+ onHandlePointerMove,
+ onHandlePointerUp,
+ onHandleKeyDown,
+}: {
+ className?: string;
+ label: string;
+ current: number;
+ duration: number;
+ visible: VisibleSeconds;
+ trackRef: Ref<HTMLDivElement>;
+ frameRef: Ref<HTMLDivElement>;
+ brightRef: Ref<HTMLDivElement>;
+ onSeekKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
+ onSeekPointerDown: (event: ReactPointerEvent<HTMLDivElement>) => void;
+ onSeekPointerMove: (event: ReactPointerEvent<HTMLDivElement>) => void;
+ onSeekPointerUp: (event: ReactPointerEvent<HTMLDivElement>) => void;
+ onHandlePointerDown: HandlePointer;
+ onHandlePointerMove: HandlePointer;
+ onHandlePointerUp: HandlePointer;
+ onHandleKeyDown: (event: KeyboardEvent<HTMLSpanElement>) => void;
+}) {
+ const labels = rulerLabels(duration);
+ const total = Math.round(duration);
+ const handle = {
+ onPointerDown: onHandlePointerDown,
+ onPointerMove: onHandlePointerMove,
+ onPointerUp: onHandlePointerUp,
+ visible,
+ };
+
+ return (
+ <div
+ className={cn(
+ "relative h-10 min-w-0 flex-1 overflow-clip rounded-[10px] bg-dark-raised select-none",
+ className,
+ )}
+ >
+ <div
+ ref={trackRef}
+ role="slider"
+ tabIndex={0}
+ aria-label={`Seek ${label}`}
+ aria-valuemin={0}
+ aria-valuemax={total}
+ aria-valuenow={Math.floor(current)}
+ aria-valuetext={`${formatTime(current)} of ${formatTime(total)}`}
+ onKeyDown={onSeekKeyDown}
+ onPointerDown={onSeekPointerDown}
+ onPointerMove={onSeekPointerMove}
+ onPointerUp={onSeekPointerUp}
+ onPointerCancel={onSeekPointerUp}
+ className={cn(
+ RULER_ROW,
+ "cursor-pointer touch-none rounded-[10px] outline-none focus-visible:ring-2 focus-visible:ring-white/40 focus-visible:ring-inset",
+ )}
+ >
+ <Ruler labels={labels} />
+ </div>
+ <div
+ ref={frameRef}
+ className="pointer-events-none absolute top-1 left-0 h-8 w-[26%] rounded-tile border border-white/10 bg-white/[0.12] will-change-transform"
+ >
+ <Handle side="start" {...handle} />
+ <Handle side="end" onKeyDown={onHandleKeyDown} {...handle} />
+ </div>
+ <div
+ ref={brightRef}
+ aria-hidden="true"
+ className={cn(RULER_ROW, "pointer-events-none")}
+ style={{ clipPath: "inset(0 74% 0 0)" }}
+ >
+ <Ruler labels={labels} bright />
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/components/landing/ui/section-title.tsx b/app/(home)/components/landing/ui/section-title.tsx
new file mode 100644
index 00000000..de931047
--- /dev/null
+++ b/app/(home)/components/landing/ui/section-title.tsx
@@ -0,0 +1,47 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/**
+ * Two-tone section heading: the first line in ink, the continuation in a
+ * muted grey, both at the h2 size (56/58, -0.045em).
+ */
+export function SectionTitle({
+ title,
+ continuation,
+ align = "left",
+ as: Tag = "h2",
+ className,
+ continuationClassName,
+}: {
+ title: ReactNode;
+ continuation?: ReactNode;
+ align?: "left" | "center";
+ as?: "h1" | "h2" | "h3";
+ className?: string;
+ continuationClassName?: string;
+}) {
+ return (
+ <Tag
+ className={cn(
+ // `text-[40px]/[42px]` sets line-height directly (not via
+ // --tw-leading), so `md:text-h2` can take it over at desktop.
+ "flex flex-col text-[40px]/[42px] tracking-heading text-balance text-foreground md:text-h2",
+ align === "center" && "items-center text-center",
+ className,
+ )}
+ >
+ <span data-reveal="text">{title}</span>
+ {continuation && (
+ <span
+ data-reveal="text"
+ className={cn(
+ "text-title-muted [--reveal-i:1]",
+ continuationClassName,
+ )}
+ >
+ {continuation}
+ </span>
+ )}
+ </Tag>
+ );
+}
diff --git a/app/(home)/components/mega-menu.tsx b/app/(home)/components/mega-menu.tsx
index 2526dda5..8aa21a32 100644
--- a/app/(home)/components/mega-menu.tsx
+++ b/app/(home)/components/mega-menu.tsx
@@ -80,7 +80,7 @@ export function MegaMenuPanel({
y: -6,
transition: reduced
? { duration: 0 }
- : { duration: 0.13, ease: "easeIn" },
+ : { duration: 0.13, ease: "easeOut" },
},
}}
className="origin-top rounded-[20px] bg-popover p-3 text-popover-foreground shadow-lg ring-1 ring-foreground/5 dark:ring-foreground/10"
@@ -197,7 +197,7 @@ function MenuRow({
onMouseEnter={onHover}
onFocus={onHover}
className={cn(
- "flex min-w-0 items-center rounded-lg px-3 text-sm font-medium transition-colors duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
+ "flex min-w-0 items-center rounded-lg px-3 text-sm font-medium transition-colors duration-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
hovered ? "bg-muted text-foreground" : "text-muted-foreground",
)}
>
diff --git a/app/(home)/components/section-heading.tsx b/app/(home)/components/section-heading.tsx
deleted file mode 100644
index f8487fec..00000000
--- a/app/(home)/components/section-heading.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import type { ReactNode } from "react";
-import { cn } from "@/lib/utils";
-import { FadeUp } from "./fade-up";
-
-/**
- * Canonical section header used across the landing page so the type
- * hierarchy stays consistent everywhere:
- * eyebrow (xs, muted, mono) → title (h2) → lead (body, muted)
- * An optional `action` slot sits inline on the right at desktop widths.
- */
-export function SectionHeading({
- title,
- lead,
- action,
- align = "start",
- animated = true,
- className,
-}: {
- eyebrow?: string;
- title: ReactNode;
- lead?: ReactNode;
- action?: ReactNode;
- align?: "start" | "center";
- animated?: boolean;
- className?: string;
-}) {
- const centered = align === "center";
-
- const content = (
- <div
- className={cn(
- "flex flex-col gap-6 sm:flex-row sm:items-end sm:justify-between",
- className,
- )}
- >
- <div
- className={cn(
- "max-w-2xl",
- centered && "mx-auto text-center sm:items-center",
- )}
- >
- {/*{eyebrow && (
- <p className="mb-3 font-mono text-xs font-medium text-muted-foreground">
- {eyebrow}
- </p>
- )}*/}
- <h2 className="text-3xl font-semibold tracking-tight text-balance text-foreground sm:text-4xl">
- {title}
- </h2>
- {lead && (
- <p className="mt-4 text-base leading-relaxed text-pretty text-muted-foreground sm:text-lg">
- {lead}
- </p>
- )}
- </div>
- {action && <div className="shrink-0">{action}</div>}
- </div>
- );
-
- return animated ? <FadeUp>{content}</FadeUp> : content;
-}
diff --git a/app/(home)/components/sections/faq.tsx b/app/(home)/components/sections/faq.tsx
deleted file mode 100644
index 2a596fbb..00000000
--- a/app/(home)/components/sections/faq.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { FAQ_ITEMS } from "@/config/landing";
-import { SUPPORT_EMAIL } from "@/config/site";
-import { cn } from "@/lib/utils";
-import { SectionHeading } from "../section-heading";
-
-const EYEBROW = "Questions";
-const TITLE = "Before you ask";
-const LEAD =
- "The things people want to know before they open a terminal for the first time.";
-
-export function Faq({ className }: { className?: string }) {
- return (
- <section id="faq" className={cn("relative py-14 sm:py-20", className)}>
- <div className="section">
- <SectionHeading
- eyebrow={EYEBROW}
- title={TITLE}
- lead={LEAD}
- animated={false}
- />
-
- <dl className="mt-10 max-w-2xl sm:mt-14">
- {FAQ_ITEMS.map((item, i) => (
- <div
- key={item.question}
- className={cn(
- "py-6 sm:py-7",
- i > 0 && "border-t border-border/60",
- )}
- >
- <dt className="text-base font-medium text-balance text-foreground sm:text-lg">
- {item.question}
- </dt>
- <dd className="mt-2 text-sm leading-relaxed text-pretty text-muted-foreground sm:text-base">
- {item.answer}
- </dd>
- </div>
- ))}
- </dl>
-
- <p className="mt-8 max-w-2xl border-t border-border/60 pt-8 text-sm text-muted-foreground sm:text-base">
- Still stuck?{" "}
- <a
- href={`mailto:${SUPPORT_EMAIL}`}
- className="text-foreground underline underline-offset-4 transition-colors hover:text-muted-foreground"
- >
- Email us
- </a>{" "}
- and we’ll walk you through it.
- </p>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/sections/final-cta.tsx b/app/(home)/components/sections/final-cta.tsx
deleted file mode 100644
index 98f8d2ce..00000000
--- a/app/(home)/components/sections/final-cta.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-"use client";
-
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import { Button } from "@/components/ui/button";
-import { GITHUB_URL } from "@/config/site";
-import { useTrackEvent } from "@/lib/analytics";
-
-export function FinalCTA() {
- const trackEvent = useTrackEvent();
-
- return (
- <section className="relative py-14 sm:py-28">
- <div className="section">
- <div className="surface-card relative overflow-hidden rounded-3xl px-6 py-12 text-center sm:px-12 sm:py-20">
- <h2 className="mx-auto max-w-2xl text-balance text-3xl font-semibold tracking-tight text-foreground sm:text-4xl md:text-5xl">
- Your product deserves better than a screen recording.
- </h2>
-
- <p className="mx-auto mt-5 max-w-xl text-base leading-relaxed text-muted-foreground sm:text-lg">
- An agent, an empty folder, ten minutes. It’s open source, all the
- way down.
- </p>
-
- <div className="mt-9 flex flex-col items-center justify-center gap-3 sm:flex-row">
- <Button
- size="lg"
- className="h-11 gap-2 rounded-full px-6 text-sm"
- render={
- <Link
- href="/docs/guides/setup"
- onClick={() =>
- trackEvent("cta_clicked", {
- cta: "final_cta",
- destination: "/docs/guides/setup",
- })
- }
- />
- }
- >
- Make your first video
- <ArrowRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- <Button
- variant="outline"
- size="lg"
- className="h-11 rounded-full px-6 text-sm"
- render={
- <Link href={GITHUB_URL} target="_blank" rel="noreferrer" />
- }
- >
- Star on GitHub
- </Button>
- </div>
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/sections/hero-scroll-video.tsx b/app/(home)/components/sections/hero-scroll-video.tsx
deleted file mode 100644
index eb2b6cee..00000000
--- a/app/(home)/components/sections/hero-scroll-video.tsx
+++ /dev/null
@@ -1,133 +0,0 @@
-"use client";
-
-import {
- motion,
- useReducedMotion,
- useScroll,
- useTransform,
-} from "motion/react";
-import { type RefObject, useEffect, useRef, useState } from "react";
-
-const REST_MAX_WIDTH = 1120;
-const REST_WIDTH_RATIO = 0.92;
-const CARD_ASPECT = 9 / 16;
-const REST_RADIUS = 24;
-const GROW_END = 0.28;
-const HOLD_END = 0.72;
-const SCRUB_MIN_WIDTH = 1024;
-
-type Viewport = { w: number; h: number };
-
-export function HeroScrollVideo() {
- const sectionRef = useRef<HTMLElement>(null);
- const [viewport, setViewport] = useState<Viewport | null>(null);
- const reduceMotion = useReducedMotion();
-
- useEffect(() => {
- const update = () =>
- setViewport({ w: window.innerWidth, h: window.innerHeight });
- update();
- window.addEventListener("resize", update);
- return () => window.removeEventListener("resize", update);
- }, []);
-
- if (reduceMotion) {
- return <StaticCard />;
- }
-
- const isNarrow = viewport !== null && viewport.w < SCRUB_MIN_WIDTH;
- const isWide = viewport !== null && !isNarrow;
-
- return (
- <>
- <div className="lg:hidden">
- {(viewport === null || isNarrow) && <StaticCard />}
- </div>
- <section
- ref={sectionRef}
- data-hero-zoom
- className="relative hidden h-[380vh] lg:block"
- >
- <div className="sticky top-0 flex h-screen w-full items-center justify-center overflow-hidden">
- {isWide ? (
- <ScrollStage sectionRef={sectionRef} viewport={viewport} />
- ) : (
- <div className="w-[min(92vw,1120px)]">
- <VideoCard className="aspect-video rounded-3xl border border-border" />
- </div>
- )}
- </div>
- </section>
- </>
- );
-}
-
-function StaticCard() {
- return (
- <div className="section">
- <div className="relative mt-8 flex w-full justify-center sm:mt-12">
- <div className="w-full max-w-[1120px]">
- <VideoCard className="aspect-video rounded-2xl sm:rounded-3xl" />
- </div>
- </div>
- </div>
- );
-}
-
-function ScrollStage({
- sectionRef,
- viewport,
-}: {
- sectionRef: RefObject<HTMLElement | null>;
- viewport: Viewport;
-}) {
- const { scrollYProgress } = useScroll({
- target: sectionRef,
- offset: ["start start", "end end"],
- });
-
- const restWidth = Math.min(viewport.w * REST_WIDTH_RATIO, REST_MAX_WIDTH);
- const restHeight = restWidth * CARD_ASPECT;
- const cover = Math.max(viewport.w / restWidth, viewport.h / restHeight);
- const keyframes = [0, GROW_END, HOLD_END, 1];
-
- const scale = useTransform(scrollYProgress, keyframes, [1, cover, cover, 1]);
- const borderRadius = useTransform(scrollYProgress, keyframes, [
- REST_RADIUS,
- 0,
- 0,
- REST_RADIUS,
- ]);
- const frameOpacity = useTransform(scrollYProgress, keyframes, [1, 0, 0, 1]);
-
- return (
- <motion.div
- style={{ width: restWidth, height: restHeight, scale, borderRadius }}
- className="relative overflow-hidden will-change-transform"
- >
- <VideoCard className="h-full w-full" />
- <motion.div
- aria-hidden
- style={{ borderRadius, opacity: frameOpacity }}
- className="pointer-events-none absolute inset-0 border border-border"
- />
- </motion.div>
- );
-}
-
-function VideoCard({ className }: { className?: string }) {
- return (
- <div className={`relative overflow-hidden ${className ?? ""}`}>
- <video
- src="https://cdn.remocn.dev/videos/hero-crt.mp4"
- autoPlay
- muted
- loop
- playsInline
- preload="metadata"
- poster="/hero-crt-poster.jpg"
- className="block h-full w-full object-cover"
- />
- </div>
- );
-}
diff --git a/app/(home)/components/sections/hero.tsx b/app/(home)/components/sections/hero.tsx
deleted file mode 100644
index 66e51421..00000000
--- a/app/(home)/components/sections/hero.tsx
+++ /dev/null
@@ -1,92 +0,0 @@
-"use client";
-
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import { Button } from "@/components/ui/button";
-import { useTrackEvent } from "@/lib/analytics";
-import { FadeUp } from "../fade-up";
-import { HeroBadge } from "../hero-badge";
-import { HeroTerminalBg } from "../hero-terminal-bg";
-import { HeroScrollVideo } from "./hero-scroll-video";
-
-export function Hero() {
- const trackEvent = useTrackEvent();
-
- return (
- <section className="relative isolate pt-8 pb-12 sm:pt-16 sm:pb-24">
- <div aria-hidden className="absolute inset-0 -z-10">
- <HeroTerminalBg />
- </div>
-
- <div className="section">
- <div className="flex flex-col items-center text-center">
- <FadeUp
- gate="landing-intro"
- delay={0.06}
- className="flex flex-col items-center"
- >
- <HeroBadge />
- <h1 className="max-w-3xl text-balance text-3xl font-semibold leading-[1.1] tracking-tight text-foreground sm:text-4xl md:text-5xl">
- You want the video,
- <br className="hidden sm:block" /> not the ordeal.
- </h1>
- </FadeUp>
-
- <FadeUp gate="landing-intro" delay={0.12}>
- <p className="mt-4 max-w-2xl text-balance text-base leading-relaxed text-foreground [text-shadow:0_0_10px_var(--background),0_0_20px_var(--background)] sm:text-lg">
- Describe your product to your AI agent. It builds the demo video
- from ready-made pieces while you watch in the browser.
- </p>
- </FadeUp>
-
- <FadeUp gate="landing-intro" delay={0.18}>
- <div className="mt-7 flex flex-col items-center gap-3 sm:flex-row">
- <Button
- size="lg"
- className="rounded-full"
- render={
- <Link
- href="/docs/guides/setup"
- onClick={() =>
- trackEvent("cta_clicked", {
- cta: "hero_start",
- destination: "/docs/guides/setup",
- })
- }
- />
- }
- >
- Make your first video
- <ArrowRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- <Button
- variant="secondary"
- size="lg"
- className="rounded-full font-medium"
- render={
- <Link
- href="/showcases"
- onClick={() =>
- trackEvent("cta_clicked", {
- cta: "hero_showcases",
- destination: "/showcases",
- })
- }
- />
- }
- >
- See what ships
- </Button>
- </div>
- </FadeUp>
- </div>
- </div>
-
- <HeroScrollVideo />
- </section>
- );
-}
diff --git a/app/(home)/components/sections/how-it-works-viz.tsx b/app/(home)/components/sections/how-it-works-viz.tsx
deleted file mode 100644
index 2176a851..00000000
--- a/app/(home)/components/sections/how-it-works-viz.tsx
+++ /dev/null
@@ -1,236 +0,0 @@
-"use client";
-
-import { motion, useReducedMotion } from "motion/react";
-import type { ReactNode } from "react";
-import { cn } from "@/lib/utils";
-
-type VizProps = { play: boolean };
-
-const LOOP = 6;
-
-function WindowFrame({
- label,
- children,
- className,
-}: {
- label: string;
- children: ReactNode;
- className?: string;
-}) {
- return (
- <div
- className={cn(
- "flex h-full w-full flex-col overflow-hidden rounded-xl border border-border bg-card",
- className,
- )}
- >
- <div className="flex items-center gap-1.5 border-b border-border px-2.5 py-2">
- <span className="flex gap-1" aria-hidden>
- <span className="size-1.5 rounded-full bg-foreground/15" />
- <span className="size-1.5 rounded-full bg-foreground/15" />
- <span className="size-1.5 rounded-full bg-foreground/15" />
- </span>
- <span className="truncate font-mono text-[10px] text-muted-foreground/70">
- {label}
- </span>
- </div>
- <div className="min-h-0 flex-1 p-3">{children}</div>
- </div>
- );
-}
-
-function Caret({ active }: { active: boolean }) {
- if (!active) {
- return <span className="inline-block h-3 w-[2px] bg-foreground/60" />;
- }
- return (
- <motion.span
- aria-hidden
- className="inline-block h-3 w-[2px] bg-foreground/60"
- animate={{ opacity: [1, 1, 0, 0] }}
- transition={{
- duration: 1.1,
- times: [0, 0.5, 0.5, 1],
- repeat: Number.POSITIVE_INFINITY,
- ease: "linear",
- }}
- />
- );
-}
-
-export function AgentWindowViz({ play }: VizProps) {
- const reduced = useReducedMotion();
- const active = play && !reduced;
-
- return (
- <WindowFrame label="~/demo-video">
- <div className="flex h-full flex-col justify-between">
- <div className="flex items-center gap-1.5 font-mono text-xs">
- <span className="text-muted-foreground/50">›</span>
- <Caret active={active} />
- </div>
- <p className="font-mono text-[10px] text-muted-foreground/45">
- empty folder
- </p>
- </div>
- </WindowFrame>
- );
-}
-
-const LOG_LINES = ["installing skill", "starting preview"];
-const PROMPT = "Set up a remocn project";
-
-export function PromptTypingViz({ play }: VizProps) {
- const reduced = useReducedMotion();
- const active = play && !reduced;
-
- if (!active) {
- return (
- <WindowFrame label="~/demo-video">
- <div className="flex h-full flex-col gap-2">
- <p className="font-mono text-xs text-foreground">› {PROMPT}</p>
- {LOG_LINES.map((line) => (
- <p
- key={line}
- className="font-mono text-[10px] text-muted-foreground/60"
- >
- {line}
- </p>
- ))}
- </div>
- </WindowFrame>
- );
- }
-
- return (
- <WindowFrame label="~/demo-video">
- <div className="flex h-full flex-col gap-2">
- <div className="flex items-center gap-1.5 font-mono text-xs">
- <span className="shrink-0 text-muted-foreground/50">›</span>
- <motion.span
- className="overflow-hidden whitespace-nowrap text-foreground will-change-[width]"
- animate={{
- width: [
- "0ch",
- `${PROMPT.length}ch`,
- `${PROMPT.length}ch`,
- `${PROMPT.length}ch`,
- ],
- }}
- transition={{
- duration: LOOP,
- times: [0, 0.32, 0.92, 1],
- repeat: Number.POSITIVE_INFINITY,
- ease: "linear",
- }}
- >
- {PROMPT}
- </motion.span>
- <Caret active />
- </div>
-
- <div className="flex flex-col gap-1.5">
- {LOG_LINES.map((line, i) => (
- <motion.p
- key={line}
- className="font-mono text-[10px] text-muted-foreground/60 will-change-[transform,opacity]"
- animate={{ opacity: [0, 0, 1, 1, 0], y: [4, 4, 0, 0, 0] }}
- transition={{
- duration: LOOP,
- times: [0, 0.42 + i * 0.12, 0.54 + i * 0.12, 0.92, 1],
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeOut",
- }}
- >
- {line}
- </motion.p>
- ))}
- </div>
- </div>
- </WindowFrame>
- );
-}
-
-function ChatBubble({ w }: { w: string }) {
- return (
- <span
- aria-hidden
- className="block h-1.5 rounded-full bg-foreground/10"
- style={{ width: w }}
- />
- );
-}
-
-function PlayerBody({ active }: { active: boolean }) {
- return (
- <div className="flex h-full flex-col justify-between rounded-lg bg-muted/40 p-2.5">
- <div className="flex flex-1 items-center justify-center">
- {active ? (
- <motion.span
- className="text-sm font-semibold tracking-tight text-foreground will-change-[transform,opacity]"
- animate={{ opacity: [0, 1, 1, 0], y: [8, 0, 0, -8] }}
- transition={{
- duration: LOOP,
- times: [0.5, 0.62, 0.88, 1],
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeInOut",
- }}
- >
- Your product
- </motion.span>
- ) : (
- <span className="text-sm font-semibold tracking-tight text-foreground">
- Your product
- </span>
- )}
- </div>
- <div className="h-1 w-full overflow-hidden rounded-full bg-foreground/10">
- {active ? (
- <motion.div
- className="h-full origin-left rounded-full bg-foreground/40 will-change-transform"
- animate={{ scaleX: [0, 0, 1, 0] }}
- transition={{
- duration: LOOP,
- times: [0, 0.5, 0.95, 1],
- repeat: Number.POSITIVE_INFINITY,
- ease: "linear",
- }}
- />
- ) : (
- <div className="h-full w-1/2 rounded-full bg-foreground/40" />
- )}
- </div>
- </div>
- );
-}
-
-export function PlayerRevealViz({ play }: VizProps) {
- const reduced = useReducedMotion();
- const active = play && !reduced;
-
- return (
- <WindowFrame label="localhost:3000">
- <div className="flex h-full gap-2">
- <motion.div
- className="flex shrink-0 flex-col gap-1.5 overflow-hidden will-change-[width]"
- style={active ? undefined : { width: "26%" }}
- initial={active ? { width: "58%" } : false}
- animate={active ? { width: ["58%", "58%", "26%", "26%"] } : undefined}
- transition={{
- duration: LOOP,
- times: [0, 0.34, 0.5, 1],
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeInOut",
- }}
- >
- <ChatBubble w="80%" />
- <ChatBubble w="55%" />
- <ChatBubble w="70%" />
- </motion.div>
- <div className="min-w-0 flex-1">
- <PlayerBody active={active} />
- </div>
- </div>
- </WindowFrame>
- );
-}
diff --git a/app/(home)/components/sections/how-it-works.tsx b/app/(home)/components/sections/how-it-works.tsx
deleted file mode 100644
index 2a161164..00000000
--- a/app/(home)/components/sections/how-it-works.tsx
+++ /dev/null
@@ -1,103 +0,0 @@
-"use client";
-
-import { ArrowRight } from "lucide-react";
-import { useInView } from "motion/react";
-import Link from "next/link";
-import { useRef } from "react";
-import { HOW_IT_WORKS_STEPS, type HowItWorksStep } from "@/config/landing";
-import { useTrackEvent } from "@/lib/analytics";
-import { cn } from "@/lib/utils";
-import { SectionHeading } from "../section-heading";
-import {
- AgentWindowViz,
- PlayerRevealViz,
- PromptTypingViz,
-} from "./how-it-works-viz";
-
-const EYEBROW = "How it works";
-const TITLE = "Two things: an agent and an empty folder.";
-const LEAD =
- "No editor to learn, no timeline to scrub. You describe, it builds, you watch it happen.";
-
-const VIZ = [AgentWindowViz, PromptTypingViz, PlayerRevealViz];
-
-function StepColumn({ step, index }: { step: HowItWorksStep; index: number }) {
- const ref = useRef<HTMLDivElement>(null);
- const inView = useInView(ref, { amount: 0.4 });
- const Viz = VIZ[index];
-
- return (
- <div
- ref={ref}
- className={cn(
- "flex flex-col gap-6 py-8 sm:gap-8 sm:py-10",
- index > 0 &&
- "border-t border-border/60 lg:border-t-0 lg:border-l lg:pl-8",
- index < HOW_IT_WORKS_STEPS.length - 1 && "lg:pr-8",
- )}
- >
- <span className="flex size-6 shrink-0 items-center justify-center rounded-full border border-border font-mono text-xs text-muted-foreground">
- {index + 1}
- </span>
-
- <div
- aria-hidden
- className="pointer-events-none aspect-[4/3] w-full select-none"
- >
- <Viz play={inView} />
- </div>
-
- <div className="mt-auto min-w-0">
- <h3 className="text-base font-semibold tracking-tight text-balance text-foreground sm:text-lg">
- {step.title}
- </h3>
- <p className="mt-2 text-sm leading-relaxed text-pretty text-muted-foreground sm:text-base">
- {step.detail}
- </p>
- </div>
- </div>
- );
-}
-
-export function HowItWorks({ className }: { className?: string }) {
- const trackEvent = useTrackEvent();
-
- return (
- <section
- id="how-it-works"
- className={cn("relative pt-6 pb-14 sm:pt-0 sm:pb-20", className)}
- >
- <div className="section">
- <SectionHeading
- eyebrow={EYEBROW}
- title={TITLE}
- lead={LEAD}
- animated={false}
- />
-
- <div className="mt-10 grid grid-cols-1 border-y border-border/60 sm:mt-10 lg:grid-cols-3">
- {HOW_IT_WORKS_STEPS.map((step, i) => (
- <StepColumn key={step.title} step={step} index={i} />
- ))}
- </div>
-
- <Link
- href="/docs/guides/setup"
- onClick={() =>
- trackEvent("cta_clicked", {
- cta: "how_it_works_setup",
- destination: "/docs/guides/setup",
- })
- }
- className="group relative mt-10 inline-flex items-center gap-1.5 text-sm text-muted-foreground transition-colors before:absolute before:inset-x-0 before:-inset-y-2 before:content-[''] hover:text-foreground sm:text-base"
- >
- First time? The setup guide takes ten minutes
- <ArrowRight
- aria-hidden
- className="size-4 transition-transform group-hover:translate-x-0.5 group-focus-visible:translate-x-0.5"
- />
- </Link>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/sections/landing-partners.tsx b/app/(home)/components/sections/landing-partners.tsx
deleted file mode 100644
index 7a93c5a6..00000000
--- a/app/(home)/components/sections/landing-partners.tsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import { getLandingSponsors } from "@/config/sponsors";
-import { SectionHeading } from "../section-heading";
-import { SponsorGrid } from "../sponsor-grid";
-
-export function LandingPartners() {
- const promoted = getLandingSponsors();
- if (promoted.length === 0) return null;
-
- return (
- <section id="partners" className="relative py-14 sm:py-20">
- <div className="section">
- <SectionHeading
- align="center"
- eyebrow="Sponsors"
- title="Backed by the community"
- lead="remocn is free and MIT-licensed. Sponsors keep the registry growing and the renders fast."
- animated={false}
- />
-
- <SponsorGrid
- sponsors={promoted}
- ctaHref="/sponsors"
- className="mx-auto mt-10 max-w-4xl"
- />
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/sections/shaders-viz.tsx b/app/(home)/components/sections/shaders-viz.tsx
deleted file mode 100644
index 6e266ef0..00000000
--- a/app/(home)/components/sections/shaders-viz.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-"use client";
-
-import { Player, type PlayerRef } from "@remotion/player";
-import { useReducedMotion } from "motion/react";
-import { useRef } from "react";
-import { shaderGrainGradientConfig } from "@/registry/remocn/shader-grain-gradient/config";
-import { useAutoplay } from "../use-autoplay";
-
-const SHADER_PREVIEW_WIDTH = 480;
-const SHADER_PREVIEW_HEIGHT = 270;
-const SHADER_PREVIEW_FPS = 20;
-
-const loadShaderGrainGradient = () =>
- import("@/registry/remocn/shader-grain-gradient").then((m) => ({
- default: m.ShaderGrainGradient,
- }));
-
-export function ShadersViz({ play }: { play: boolean }) {
- const reduced = useReducedMotion();
- const playerRef = useRef<PlayerRef>(null);
- const { containerRef } = useAutoplay(playerRef, play && !reduced);
-
- const durationInFrames = Math.round(
- (shaderGrainGradientConfig.durationInFrames * SHADER_PREVIEW_FPS) /
- shaderGrainGradientConfig.fps,
- );
-
- return (
- <div ref={containerRef} className="absolute inset-0 overflow-hidden">
- <div className="absolute top-1/2 left-1/2 aspect-video min-h-full min-w-full -translate-x-1/2 -translate-y-1/2">
- <Player
- ref={playerRef}
- lazyComponent={loadShaderGrainGradient}
- inputProps={{}}
- durationInFrames={durationInFrames}
- fps={SHADER_PREVIEW_FPS}
- compositionWidth={SHADER_PREVIEW_WIDTH}
- compositionHeight={SHADER_PREVIEW_HEIGHT}
- style={{ width: "100%", height: "100%" }}
- loop
- initiallyMuted
- acknowledgeRemotionLicense
- />
- </div>
- </div>
- );
-}
diff --git a/app/(home)/components/sections/testimonials.tsx b/app/(home)/components/sections/testimonials.tsx
deleted file mode 100644
index df93eaa5..00000000
--- a/app/(home)/components/sections/testimonials.tsx
+++ /dev/null
@@ -1,100 +0,0 @@
-import { COMPONENT_COUNT } from "@/config/site";
-import { type Testimonial, testimonials } from "@/config/testimonials";
-import { SectionHeading } from "../section-heading";
-
-const FACTS = [
- { value: String(COMPONENT_COUNT), label: "components" },
- { value: "MIT", label: "licensed" },
- { value: "Any", label: "coding agent" },
-];
-
-function TestimonialCard({
- authorAvatar,
- authorName,
- url,
- quote,
-}: Testimonial) {
- return (
- <a
- href={url}
- target="_blank"
- rel="noreferrer"
- className="surface-card surface-card-interactive flex w-80 shrink-0 flex-col gap-4 rounded-2xl p-5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
- >
- <div className="flex items-center gap-3">
- {/** biome-ignore lint/performance/noImgElement: remote unavatar.io avatars of arbitrary origin */}
- <img
- src={authorAvatar}
- alt={authorName}
- loading="lazy"
- className="size-10 rounded-full object-cover outline-1 -outline-offset-1 outline-black/10 dark:outline-white/10"
- />
- <span className="text-sm font-medium text-foreground">
- {authorName}
- </span>
- </div>
- <p className="text-sm leading-relaxed text-pretty text-muted-foreground">
- {quote}
- </p>
- </a>
- );
-}
-
-function MarqueeRow({
- items,
- reverse = false,
-}: {
- items: Testimonial[];
- reverse?: boolean;
-}) {
- return (
- <div className="group -my-3 flex overflow-hidden py-3">
- <div
- className="flex shrink-0 gap-4 pr-4 animate-marquee group-hover:[animation-play-state:paused] motion-reduce:[animation:none]"
- style={reverse ? { animationDirection: "reverse" } : undefined}
- >
- {items.map((t, i) => (
- <TestimonialCard key={`${t.authorName}-${i}`} {...t} />
- ))}
- <div aria-hidden inert className="contents">
- {items.map((t, i) => (
- <TestimonialCard key={`${t.authorName}-${i}-dup`} {...t} />
- ))}
- </div>
- </div>
- </div>
- );
-}
-
-export function Testimonials() {
- const topRow = testimonials;
- const bottomRow = [...testimonials].reverse();
-
- return (
- <section id="testimonials" className="relative py-14 sm:py-20">
- <div className="section">
- <SectionHeading
- align="center"
- eyebrow="Wall of love"
- title="Builders are shipping with remocn"
- lead="Builders who needed a demo video for their product and shipped one the same day."
- animated={false}
- />
-
- <dl className="mt-8 flex flex-wrap items-center justify-center gap-x-8 gap-y-3 text-sm sm:gap-x-12 sm:text-base">
- {FACTS.map((fact) => (
- <div key={fact.label} className="flex items-baseline gap-2">
- <dt className="font-semibold text-foreground">{fact.value}</dt>
- <dd className="text-muted-foreground">{fact.label}</dd>
- </div>
- ))}
- </dl>
- </div>
-
- <div className="marquee-edge-fade mt-9 -mb-3 flex flex-col gap-4 py-3">
- <MarqueeRow items={topRow} />
- <MarqueeRow items={bottomRow} reverse />
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/sections/transitions-viz.tsx b/app/(home)/components/sections/transitions-viz.tsx
deleted file mode 100644
index 341682b5..00000000
--- a/app/(home)/components/sections/transitions-viz.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-"use client";
-
-import { Player, type PlayerRef } from "@remotion/player";
-import { linearTiming, TransitionSeries } from "@remotion/transitions";
-import { useReducedMotion } from "motion/react";
-import { useRef } from "react";
-import { AbsoluteFill } from "remotion";
-import { zoomBlur } from "@/registry/remocn/zoom-blur";
-import { useAutoplay } from "../use-autoplay";
-
-const SCENE_FRAMES = 55;
-const TRANSITION_FRAMES = 18;
-const DURATION = SCENE_FRAMES * 2 - TRANSITION_FRAMES;
-const FPS = 30;
-
-// Bare zoomBlur between two empty color fills — the transition's own motion
-// is the whole preview, no scene content to distract from it.
-function BareTransitionScene() {
- return (
- <TransitionSeries>
- <TransitionSeries.Sequence durationInFrames={SCENE_FRAMES}>
- <AbsoluteFill style={{ background: "#26242e" }} />
- </TransitionSeries.Sequence>
- <TransitionSeries.Transition
- timing={linearTiming({ durationInFrames: TRANSITION_FRAMES })}
- presentation={zoomBlur()}
- />
- <TransitionSeries.Sequence durationInFrames={SCENE_FRAMES}>
- <AbsoluteFill style={{ background: "#141318" }} />
- </TransitionSeries.Sequence>
- </TransitionSeries>
- );
-}
-
-export function TransitionsViz({ play }: { play: boolean }) {
- const reduced = useReducedMotion();
- const playerRef = useRef<PlayerRef>(null);
- const { containerRef } = useAutoplay(playerRef, play && !reduced);
-
- return (
- <div ref={containerRef} className="absolute inset-0 overflow-hidden">
- <div className="absolute top-1/2 left-1/2 aspect-video min-h-full min-w-full -translate-x-1/2 -translate-y-1/2">
- <Player
- ref={playerRef}
- component={BareTransitionScene}
- inputProps={{}}
- durationInFrames={DURATION}
- fps={FPS}
- compositionWidth={1280}
- compositionHeight={720}
- style={{ width: "100%", height: "100%" }}
- loop
- initiallyMuted
- acknowledgeRemotionLicense
- />
- </div>
- </div>
- );
-}
diff --git a/app/(home)/components/sections/whats-inside.tsx b/app/(home)/components/sections/whats-inside.tsx
deleted file mode 100644
index 0758407d..00000000
--- a/app/(home)/components/sections/whats-inside.tsx
+++ /dev/null
@@ -1,436 +0,0 @@
-"use client";
-
-import {
- ArrowUpRight,
- Component,
- Shuffle,
- Sparkles,
- Type,
- Waves,
-} from "lucide-react";
-import {
- AnimatePresence,
- animate,
- motion,
- useInView,
- useMotionValue,
- useMotionValueEvent,
- useReducedMotion,
- useTransform,
-} from "motion/react";
-import dynamic from "next/dynamic";
-import Link from "next/link";
-import { type ComponentType, useEffect, useRef, useState } from "react";
-import { cn } from "@/lib/utils";
-import { SectionHeading } from "../section-heading";
-
-// The shader viz is the only scene that pulls @remotion/player + the shader
-// runtime. Load it client-only so that weight leaves the initial landing
-// bundle; the track labels and links stay server-rendered.
-const ShadersViz = dynamic(
- () => import("./shaders-viz").then((m) => ({ default: m.ShadersViz })),
- {
- ssr: false,
- loading: () => <div className="absolute inset-0 bg-muted/20" />,
- },
-);
-
-// Same deal for the transitions scene — a real registry transition
-// (zoomBlur in a TransitionSeries) playing in @remotion/player.
-const TransitionsViz = dynamic(
- () =>
- import("./transitions-viz").then((m) => ({ default: m.TransitionsViz })),
- {
- ssr: false,
- loading: () => <div className="absolute inset-0 bg-muted/20" />,
- },
-);
-
-const EYEBROW = "What’s inside";
-const TITLE = "Five kinds of building blocks";
-const LEAD =
- "Every remocn component belongs to one of these families. Your agent composes them on the timeline, one scene at a time.";
-
-const FPS = 30;
-
-interface VizProps {
- play: boolean;
-}
-
-function TypographyViz({ play }: VizProps) {
- const reduced = useReducedMotion();
- const letters = "Motion".split("");
-
- if (reduced || !play) {
- return (
- <span className="text-4xl font-semibold tracking-tight text-foreground sm:text-5xl">
- Motion
- </span>
- );
- }
-
- return (
- <div className="flex text-4xl font-semibold tracking-tight text-foreground sm:text-5xl">
- {letters.map((ch, i) => (
- <motion.span
- key={`${ch}-${i}`}
- className="will-change-[transform,opacity]"
- animate={{
- opacity: [0, 1, 1, 0],
- y: [18, 0, 0, -18],
- }}
- transition={{
- duration: 3.4,
- times: [0, 0.2, 0.78, 1],
- repeat: Number.POSITIVE_INFINITY,
- repeatDelay: 0.4,
- delay: i * 0.09,
- ease: "easeInOut",
- }}
- >
- {ch}
- </motion.span>
- ))}
- </div>
- );
-}
-
-function AnimatedIconsViz({ play }: VizProps) {
- const reduced = useReducedMotion();
- const active = play && !reduced;
- const times = [0, 0.5, 0.85, 1];
-
- return (
- <motion.svg
- viewBox="0 0 24 24"
- fill="none"
- stroke="currentColor"
- strokeWidth={1.5}
- strokeLinecap="round"
- strokeLinejoin="round"
- className="size-14 text-foreground"
- animate={
- active
- ? { scale: [0.9, 1, 1.08, 0.9], rotate: [-8, 0, 0, -8] }
- : undefined
- }
- transition={{
- duration: 3,
- times,
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeInOut",
- }}
- >
- <motion.path
- d="M12 2.5l2.9 5.9 6.5.9-4.7 4.6 1.1 6.5-5.8-3-5.8 3 1.1-6.5-4.7-4.6 6.5-.9z"
- animate={
- active
- ? { pathLength: [0, 1, 1, 0], opacity: [0, 1, 1, 0] }
- : { pathLength: 1, opacity: 1 }
- }
- transition={{
- duration: 3,
- times,
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeInOut",
- }}
- />
- </motion.svg>
- );
-}
-
-function UiPrimitivesViz({ play }: VizProps) {
- const reduced = useReducedMotion();
- const active = play && !reduced;
- const times = [0, 0.15, 0.85, 1];
-
- return (
- <div className="relative h-9 w-16 overflow-hidden rounded-full border border-border bg-muted">
- <motion.div
- aria-hidden
- className="absolute inset-0 bg-primary"
- animate={active ? { opacity: [0, 1, 1, 0] } : { opacity: 1 }}
- transition={{
- duration: 3,
- times,
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeInOut",
- }}
- />
- <motion.span
- className="absolute top-1 left-1 size-7 rounded-full bg-background"
- animate={active ? { x: [0, 28, 28, 0] } : { x: 28 }}
- transition={{
- duration: 3,
- times,
- repeat: Number.POSITIVE_INFINITY,
- ease: "easeInOut",
- }}
- />
- </div>
- );
-}
-
-interface Clip {
- title: string;
- description: string;
- href: string;
- icon: ComponentType<{ className?: string }>;
- Viz: ComponentType<VizProps>;
- /** Clip length in timeline seconds — sets its share of the track width. */
- seconds: number;
- /** Screen-studio-style saturated track color for the pill. */
- fill: string;
-}
-
-const CLIPS: Clip[] = [
- {
- title: "Typography",
- description:
- "Words that arrive with weight instead of just appearing on screen.",
- href: "/docs/typography",
- icon: Type,
- Viz: TypographyViz,
- seconds: 3.5,
- fill: "oklch(0.62 0.12 60)",
- },
- {
- title: "Shaders",
- description:
- "Backgrounds that move — the kind sitting behind every good hero shot.",
- href: "/docs/shaders/getting-started/introduction",
- icon: Waves,
- Viz: ShadersViz,
- seconds: 3,
- fill: "oklch(0.54 0.14 285)",
- },
- {
- title: "Transitions",
- description: "Cuts between scenes that don’t look like a slideshow.",
- href: "/docs/transitions",
- icon: Shuffle,
- Viz: TransitionsViz,
- seconds: 2,
- fill: "oklch(0.57 0.1 220)",
- },
- {
- title: "Animated Icons",
- description: "Icons that actually do the thing they stand for.",
- href: "/docs/icons/gallery",
- icon: Sparkles,
- Viz: AnimatedIconsViz,
- seconds: 2,
- fill: "oklch(0.58 0.1 150)",
- },
- {
- title: "UI Primitives",
- description:
- "Fake app screens — buttons, dialogs and menus that behave like the real thing.",
- href: "/docs/ui",
- icon: Component,
- Viz: UiPrimitivesViz,
- seconds: 2.5,
- fill: "oklch(0.54 0.13 330)",
- },
-];
-
-const TOTAL_SECONDS = CLIPS.reduce((sum, clip) => sum + clip.seconds, 0);
-/** Cumulative clip start times, as 0–1 fractions of the whole track. */
-const CLIP_STARTS = CLIPS.reduce<number[]>((starts, _, i) => {
- starts.push(
- i === 0 ? 0 : starts[i - 1] + CLIPS[i - 1].seconds / TOTAL_SECONDS,
- );
- return starts;
-}, []);
-
-function clipIndexAt(progress: number) {
- for (let i = CLIP_STARTS.length - 1; i >= 0; i--) {
- if (progress >= CLIP_STARTS[i]) return i;
- }
- return 0;
-}
-
-function formatTimecode(seconds: number) {
- const frames = Math.round(seconds * FPS);
- return `${Math.floor(frames / FPS)}:${String(frames % FPS).padStart(2, "0")}`;
-}
-
-const RULER_STEPS = 13;
-
-function TimelineRuler() {
- return (
- <div
- aria-hidden
- className="relative flex h-6 select-none items-end border-b border-border/60"
- >
- {Array.from({ length: RULER_STEPS + 1 }, (_, i) => {
- const seconds = (TOTAL_SECONDS / RULER_STEPS) * i;
- return (
- <div
- key={i}
- className="absolute bottom-0 flex flex-col items-start gap-1"
- style={{ left: `${(i / RULER_STEPS) * 100}%` }}
- >
- {i % 2 === 0 && i < RULER_STEPS && (
- <span className="font-mono text-[10px] leading-none text-muted-foreground/50 tabular-nums">
- {formatTimecode(seconds)}
- </span>
- )}
- <span
- className={cn("w-px bg-border", i % 2 === 0 ? "h-2" : "h-1")}
- />
- </div>
- );
- })}
- </div>
- );
-}
-
-export function WhatsInside() {
- const sectionRef = useRef<HTMLElement>(null);
- const inView = useInView(sectionRef, { amount: 0.3 });
- const reduced = useReducedMotion();
-
- const progress = useMotionValue(0);
- const playheadLeft = useTransform(progress, (v) => `${v * 100}%`);
- const [playheadIndex, setPlayheadIndex] = useState(0);
- const [hoverIndex, setHoverIndex] = useState<number | null>(null);
-
- useMotionValueEvent(progress, "change", (v) => {
- const idx = clipIndexAt(v);
- if (idx !== playheadIndex) setPlayheadIndex(idx);
- });
-
- useEffect(() => {
- if (!inView || reduced) return;
- const controls = animate(progress, [0, 1], {
- duration: TOTAL_SECONDS,
- ease: "linear",
- repeat: Number.POSITIVE_INFINITY,
- });
- return () => controls.stop();
- }, [inView, reduced, progress]);
-
- const activeIndex = hoverIndex ?? playheadIndex;
- const activeClip = CLIPS[activeIndex];
- const ActiveViz = activeClip.Viz;
-
- return (
- <section
- ref={sectionRef}
- id="whats-inside"
- className="relative py-14 sm:py-20 [content-visibility:auto] [contain-intrinsic-size:auto_760px]"
- >
- <div className="section">
- <SectionHeading
- eyebrow={EYEBROW}
- title={TITLE}
- lead={LEAD}
- animated={false}
- />
-
- {/* Monitor — the preview canvas above the timeline, editor-style. */}
- <div className="relative mt-10 h-56 overflow-hidden rounded-2xl border border-border bg-muted/20 sm:mt-12 sm:h-72">
- <AnimatePresence mode="wait" initial={false}>
- <motion.div
- key={activeClip.title}
- initial={reduced ? false : { opacity: 0 }}
- animate={{ opacity: 1 }}
- exit={reduced ? undefined : { opacity: 0 }}
- transition={{ duration: 0.18, ease: "easeOut" }}
- className="pointer-events-none absolute inset-0 flex select-none items-center justify-center"
- >
- <ActiveViz play={inView} />
- </motion.div>
- </AnimatePresence>
- </div>
-
- <div className="mt-6 overflow-x-auto">
- <div className="relative min-w-[640px]">
- <TimelineRuler />
-
- <div className="relative mt-2">
- {/* Playhead spans the ruler gap and the track. */}
- {!reduced && (
- <motion.div
- aria-hidden
- className="pointer-events-none absolute -top-8 bottom-0 z-10 flex flex-col items-center"
- style={{ left: playheadLeft }}
- >
- <span className="size-2 shrink-0 rounded-[2px] bg-primary" />
- <span className="w-px flex-1 bg-primary" />
- </motion.div>
- )}
-
- <div className="flex gap-1.5">
- {CLIPS.map((clip, i) => {
- const active = i === activeIndex;
- const Icon = clip.icon;
- return (
- <Link
- key={clip.title}
- href={clip.href}
- aria-label={`Explore ${clip.title}`}
- style={{
- flexGrow: clip.seconds,
- flexBasis: 0,
- backgroundColor: clip.fill,
- }}
- onMouseEnter={() => setHoverIndex(i)}
- onMouseLeave={() => setHoverIndex(null)}
- onFocus={() => setHoverIndex(i)}
- onBlur={() => setHoverIndex(null)}
- className={cn(
- "group relative flex h-12 min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden rounded-xl px-3 transition-[opacity,filter] duration-200 sm:h-14",
- "inset-shadow-[0_1px_0_--theme(--color-white/25%)]",
- active
- ? "opacity-100"
- : "opacity-55 saturate-75 hover:opacity-80",
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/60",
- )}
- >
- <span className="flex min-w-0 items-center gap-1.5">
- <Icon
- aria-hidden
- className="size-3.5 shrink-0 text-white/80"
- />
- <span className="truncate text-xs font-medium text-white">
- {clip.title}
- </span>
- </span>
- <span className="font-mono text-[10px] leading-none text-white/60 tabular-nums">
- {clip.seconds.toFixed(1)}s
- </span>
- </Link>
- );
- })}
- </div>
- </div>
-
- <div className="mt-4 flex min-h-12 items-start justify-between gap-4">
- <motion.p
- key={activeClip.title}
- initial={reduced ? false : { opacity: 0, y: 4 }}
- animate={{ opacity: 1, y: 0 }}
- transition={{ duration: 0.2, ease: "easeOut" }}
- className="max-w-xl text-sm leading-relaxed text-pretty text-muted-foreground"
- >
- <span className="font-medium text-foreground">
- {activeClip.title}
- </span>{" "}
- — {activeClip.description}
- </motion.p>
- <Link
- href={activeClip.href}
- className="inline-flex shrink-0 items-center gap-1 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
- >
- Explore
- <ArrowUpRight aria-hidden className="size-4" />
- </Link>
- </div>
- </div>
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/sections/why-remocn.tsx b/app/(home)/components/sections/why-remocn.tsx
deleted file mode 100644
index 1fdd46be..00000000
--- a/app/(home)/components/sections/why-remocn.tsx
+++ /dev/null
@@ -1,149 +0,0 @@
-"use client";
-
-import {
- Bot,
- Clapperboard,
- FileCode2,
- MonitorPlay,
- Wallet,
- Zap,
-} from "lucide-react";
-import {
- AnimatePresence,
- motion,
- type Transition,
- useReducedMotion,
-} from "motion/react";
-import { type ComponentType, type PointerEvent, useRef, useState } from "react";
-import { REASONS } from "@/config/landing";
-import { cn } from "@/lib/utils";
-import { SectionHeading } from "../section-heading";
-
-const EYEBROW = "Why remocn";
-const TITLE = "Every other way costs you something";
-const LEAD =
- "A designer’s invoice, a weekend in After Effects, or a screen recording you’re not proud of. remocn hands the animation to your agent already built.";
-
-const ICONS: ComponentType<{ className?: string }>[] = [
- Wallet,
- Clapperboard,
- Bot,
- MonitorPlay,
- FileCode2,
- Zap,
-];
-
-const HIGHLIGHT_INSET = 16;
-
-const MOVE: Transition = {
- type: "spring",
- stiffness: 420,
- damping: 34,
- mass: 0.6,
-};
-const FADE: Transition = { duration: 0.15, ease: [0.32, 0.72, 0, 1] };
-const EXIT: Transition = { duration: 0.12, ease: [0.32, 0.72, 0, 1] };
-
-type HighlightRect = { x: number; y: number; width: number; height: number };
-
-export function WhyRemocn({ className }: { className?: string }) {
- const gridRef = useRef<HTMLDivElement>(null);
- const activeRef = useRef(false);
- const [rect, setRect] = useState<HighlightRect | null>(null);
- const [enterId, setEnterId] = useState(0);
- const reduceMotion = useReducedMotion();
-
- const handleEnter = (event: PointerEvent<HTMLDivElement>) => {
- if (event.pointerType !== "mouse") return;
- const grid = gridRef.current;
- if (!grid) return;
-
- const item = event.currentTarget.getBoundingClientRect();
- const bounds = grid.getBoundingClientRect();
-
- if (!activeRef.current) {
- activeRef.current = true;
- setEnterId((id) => id + 1);
- }
-
- setRect({
- x: item.left - bounds.left - HIGHLIGHT_INSET,
- y: item.top - bounds.top - HIGHLIGHT_INSET,
- width: item.width + HIGHLIGHT_INSET * 2,
- height: item.height + HIGHLIGHT_INSET * 2,
- });
- };
-
- const handleLeave = () => {
- activeRef.current = false;
- setRect(null);
- };
-
- return (
- <section
- id="why-remocn"
- className={cn("relative py-14 sm:py-20", className)}
- >
- <div className="section">
- <SectionHeading
- eyebrow={EYEBROW}
- title={TITLE}
- lead={LEAD}
- animated={false}
- />
-
- <div
- ref={gridRef}
- onPointerLeave={handleLeave}
- className="relative isolate mt-12 grid grid-cols-1 gap-x-8 gap-y-10 sm:mt-16 sm:grid-cols-2 lg:grid-cols-3 lg:gap-x-12"
- >
- <AnimatePresence>
- {rect && (
- <motion.span
- key={enterId}
- aria-hidden
- className="pointer-events-none absolute top-0 left-0 -z-10 rounded-xl bg-muted"
- initial={{ ...rect, opacity: 0, scale: 0.96 }}
- animate={{ ...rect, opacity: 1, scale: 1 }}
- exit={{
- opacity: 0,
- scale: 0.96,
- transition: reduceMotion ? { duration: 0 } : EXIT,
- }}
- transition={
- reduceMotion
- ? { duration: 0 }
- : { default: MOVE, opacity: FADE, scale: FADE }
- }
- />
- )}
- </AnimatePresence>
-
- {REASONS.map((reason, i) => {
- const Icon = ICONS[i];
- return (
- <div
- key={reason.title}
- onPointerEnter={handleEnter}
- className="min-w-0"
- >
- <div className="flex items-center gap-2">
- <Icon
- aria-hidden
- className="size-4 shrink-0 text-muted-foreground"
- />
- <h3 className="text-base font-medium text-foreground">
- {reason.title}
- </h3>
- </div>
- <p className="mt-2 text-sm leading-relaxed text-pretty text-muted-foreground sm:text-base">
- {reason.detail}
- </p>
- </div>
- );
- })}
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/components/site-footer.tsx b/app/(home)/components/site-footer.tsx
index 27a013e5..a9fcc355 100644
--- a/app/(home)/components/site-footer.tsx
+++ b/app/(home)/components/site-footer.tsx
@@ -1,90 +1,48 @@
-import { ArrowUpRight } from "lucide-react";
import Link from "next/link";
-import {
- externalLinkProps,
- FOOTER_GROUPS,
- GITHUB_URL,
- SUPPORT_EMAIL,
- THREADS_URL,
- X_URL,
-} from "@/config/site";
-import { cn } from "@/lib/utils";
-import { GitHubIcon } from "./github-icon";
-import { HeaderLogo } from "./header-parts";
-import { ThreadsIcon } from "./threads-icon";
-import { XIcon } from "./x-icon";
-
-const SOCIALS = [
- { href: GITHUB_URL, label: "GitHub", Icon: GitHubIcon },
- { href: X_URL, label: "X", Icon: XIcon },
- { href: THREADS_URL, label: "Threads", Icon: ThreadsIcon },
-];
-
-const LINK_CLASS =
- "w-fit text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none";
+import { externalLinkProps, FOOTER_LINKS } from "@/config/site";
+import { LandingWordmark } from "./landing/header/landing-wordmark";
+/**
+ * Footer: wordmark + "MIT, built on Remotion" on the left, one flat row of
+ * links on the right (`lg`+). Below `lg` it stacks: a hairline on top, the
+ * wordmark with the tagline under it, and the links in a two-column grid.
+ */
export function SiteFooter() {
return (
- <div className="section">
- <footer className="border-t border-border pt-10 pb-[calc(3rem+env(safe-area-inset-bottom))] text-sm">
- <div className="flex flex-col gap-10 md:flex-row md:justify-between">
- <div className="flex flex-col items-start gap-4 md:max-w-64">
- <HeaderLogo />
- <p className="text-muted-foreground">
- Describe your product, get a demo video.
- </p>
- <div className="flex items-center gap-3">
- {SOCIALS.map(({ href, label, Icon }) => (
- <a
- key={href}
- href={href}
- target="_blank"
- rel="noreferrer"
- aria-label={label}
- className="rounded-full p-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
- >
- <Icon className="size-4" />
- </a>
- ))}
- </div>
- </div>
-
- <div className="grid grid-cols-2 gap-8 sm:grid-cols-3 md:gap-16">
- {FOOTER_GROUPS.map((group) => (
- <nav key={group.label} className="flex flex-col gap-3">
- <span className="font-medium text-foreground">
- {group.label}
- </span>
- {group.links.map((link) => (
- <Link
- key={link.href}
- href={link.href}
- {...externalLinkProps(link, "footer_external")}
- className={cn(
- LINK_CLASS,
- link.external && "inline-flex items-center gap-0.5",
- )}
- >
- {link.label}
- {link.external && (
- <ArrowUpRight className="size-3.5" aria-hidden="true" />
- )}
- </Link>
- ))}
- </nav>
- ))}
- </div>
+ <footer className="border-t border-border pt-8 pb-[calc(2.5rem+env(safe-area-inset-bottom))] lg:border-t-0 lg:pt-0 lg:pb-14">
+ <div
+ data-reveal="fade"
+ className="landing-container flex flex-col gap-6 lg:flex-row lg:items-center lg:justify-between"
+ >
+ <div className="flex flex-col gap-1.5 lg:flex-row lg:items-center lg:gap-5">
+ <Link
+ href="/"
+ aria-label="remocn home"
+ className="flex w-fit rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <LandingWordmark />
+ </Link>
+ <p className="text-small text-muted-foreground lg:text-mono">
+ MIT, built on Remotion
+ </p>
</div>
- <div className="mt-10 flex flex-col gap-1 border-t border-border pt-6 text-muted-foreground sm:flex-row sm:items-center sm:justify-between">
- <span suppressHydrationWarning>
- © {new Date().getFullYear()} remocn — MIT licensed
- </span>
- <a href={`mailto:${SUPPORT_EMAIL}`} className={LINK_CLASS}>
- {SUPPORT_EMAIL}
- </a>
- </div>
- </footer>
- </div>
+ <nav
+ aria-label="Footer"
+ className="grid grid-cols-[150px_150px] gap-x-7 gap-y-3.5 lg:flex lg:gap-7"
+ >
+ {FOOTER_LINKS.map((link) => (
+ <Link
+ key={link.href}
+ href={link.href}
+ {...externalLinkProps(link, "footer_external")}
+ className="relative -mx-2 w-fit rounded-full px-2 py-0 text-[15px] after:absolute after:inset-x-0 after:-inset-y-[7px] lg:after:hidden leading-5 text-body-muted outline-none transition-colors hover:bg-muted hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring lg:leading-[18px]"
+ >
+ {link.label}
+ </Link>
+ ))}
+ </nav>
+ </div>
+ </footer>
);
}
diff --git a/app/(home)/components/site-header.tsx b/app/(home)/components/site-header.tsx
index f5bccaa6..898e9e33 100644
--- a/app/(home)/components/site-header.tsx
+++ b/app/(home)/components/site-header.tsx
@@ -1,14 +1,104 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { DOCS_MENU_HREF } from "@/config/docs-directory";
import { NAV_LINKS } from "@/config/site";
-import { NavDesktop } from "./header-nav";
-import { HeaderActions, HeaderLogo } from "./header-parts";
-import { StickyHeaderShell } from "./sticky-header-shell";
+import { HEADER_LAYOUT, headerLayoutVars } from "@/lib/header-layout";
+import { cn } from "@/lib/utils";
+import { DocsDirectory } from "./landing/header/docs-directory";
+import { GitHubStarsLink } from "./landing/header/github-stars-link";
+import {
+ LandingMenu,
+ LandingMenuPanel,
+ LandingNav,
+} from "./landing/header/landing-nav";
+import { LandingWordmark } from "./landing/header/landing-wordmark";
+import { MobileMenu } from "./landing/header/mobile-menu";
+import { HeaderPill } from "./landing/header/pill-track";
+import { RegistryHealthBadge } from "./landing/header/registry-health-badge";
+import { landingButtonVariants } from "./landing/ui/landing-button";
-export function SiteHeader() {
+const GET_STARTED_HREF = "/docs/getting-started/introduction";
+
+const CAPSULE = "flex items-center bg-capsule";
+
+/**
+ * Site header: two capsules in normal flow (no fixed/scroll behaviour, no
+ * background of its own — the page behind it shows through). Desktop (`xl`):
+ * logo + nav capsule and GitHub / health / Get started capsule, 28px + 64px.
+ * `lg`: the right capsule keeps only Get started. Below `lg`: logo capsule,
+ * Get started and a menu button that opens the full-screen sheet. Desktop
+ * sizes come from `config/header-layout.json` (tuned in `/lab/header-layout`).
+ */
+export function SiteHeader({
+ mobileAction,
+}: {
+ /** Replaces Get started below `lg` (the docs put search there). */
+ mobileAction?: ReactNode;
+} = {}) {
return (
- <StickyHeaderShell>
- <HeaderLogo />
- <NavDesktop links={NAV_LINKS} />
- <HeaderActions cta />
- </StickyHeaderShell>
+ <header
+ data-site-header
+ className="relative z-40 overflow-x-clip"
+ style={headerLayoutVars(HEADER_LAYOUT)}
+ >
+ <LandingMenu className="group/header relative mx-auto flex w-full max-w-content items-center justify-between gap-4 px-4 xl:gap-2 py-3 md:px-10 lg:pt-(--hdr-top) lg:pb-0 xl:px-0">
+ <HeaderPill />
+ <div
+ className={cn(
+ CAPSULE,
+ "h-11 rounded-control px-3.5 lg:h-(--hdr-h) lg:gap-[23px] lg:rounded-(--hdr-r) lg:pr-[calc(var(--hdr-inset)+8px)] lg:pl-[calc(var(--hdr-inset)+15px)]",
+ )}
+ >
+ <Link
+ href="/"
+ aria-label="remocn home"
+ className="flex rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <LandingWordmark />
+ </Link>
+ <LandingNav links={NAV_LINKS} className="max-lg:hidden" />
+ </div>
+
+ <div
+ data-header-island
+ className={cn(
+ "flex items-center gap-2 lg:h-(--hdr-h) lg:gap-1.5 lg:rounded-(--hdr-r) lg:bg-capsule lg:p-[calc(var(--hdr-inset)-1px)]",
+ )}
+ >
+ <div className="flex items-center max-xl:hidden">
+ <GitHubStarsLink
+ pill="right"
+ className="relative h-(--hdr-item-h) rounded-(--hdr-item-r) px-[calc(var(--hdr-pad)+1px)] focus-visible:ring-primary"
+ />
+ <span
+ aria-hidden="true"
+ className="mx-[3px] h-5 w-px bg-border transition-opacity duration-150 group-data-[pill-zone=right]/header:opacity-0"
+ />
+ <RegistryHealthBadge />
+ </div>
+ <Link
+ href={GET_STARTED_HREF}
+ data-track="cta_clicked"
+ data-cta="get_started_header"
+ data-destination={GET_STARTED_HREF}
+ data-pill="behind"
+ className={cn(
+ landingButtonVariants({ variant: "ink", size: "nav" }),
+ mobileAction && "max-lg:hidden",
+ "relative h-11 rounded-control px-4 text-[15px] leading-[18px] font-medium lg:h-(--hdr-item-h) lg:rounded-(--hdr-item-r) lg:px-[calc(var(--hdr-pad)+5px)] lg:text-ui lg:font-normal",
+ )}
+ >
+ Get started
+ </Link>
+ {mobileAction && <div className="lg:hidden">{mobileAction}</div>}
+ <div className="lg:hidden">
+ <MobileMenu />
+ </div>
+ </div>
+ <LandingMenuPanel href={DOCS_MENU_HREF}>
+ <DocsDirectory />
+ </LandingMenuPanel>
+ </LandingMenu>
+ </header>
);
}
diff --git a/app/(home)/components/site-page/copy-text-button.tsx b/app/(home)/components/site-page/copy-text-button.tsx
new file mode 100644
index 00000000..b8bdf907
--- /dev/null
+++ b/app/(home)/components/site-page/copy-text-button.tsx
@@ -0,0 +1,59 @@
+"use client";
+
+import { type ReactNode, useEffect, useRef, useState } from "react";
+import { useTrackEvent } from "@/lib/analytics";
+
+/**
+ * Button that copies `text` and swaps its label to "Copied" for 1.5s.
+ * Pass `installComponent` to report an `install_command_copied` event.
+ */
+export function CopyTextButton({
+ text,
+ children,
+ copiedLabel = "Copied",
+ installComponent,
+ className,
+ "aria-label": ariaLabel,
+}: {
+ text: string;
+ children: ReactNode;
+ copiedLabel?: ReactNode;
+ installComponent?: string;
+ className?: string;
+ "aria-label"?: string;
+}) {
+ const [copied, setCopied] = useState(false);
+ const timeout = useRef<ReturnType<typeof setTimeout>>(null);
+ const trackEvent = useTrackEvent();
+
+ useEffect(() => () => clearTimeout(timeout.current ?? undefined), []);
+
+ async function copy() {
+ try {
+ await navigator.clipboard.writeText(text);
+ } catch {
+ return;
+ }
+ setCopied(true);
+ if (installComponent) {
+ trackEvent("install_command_copied", {
+ component: installComponent,
+ package_manager: "npm",
+ surface: "landing",
+ });
+ }
+ clearTimeout(timeout.current ?? undefined);
+ timeout.current = setTimeout(() => setCopied(false), 1500);
+ }
+
+ return (
+ <button
+ type="button"
+ onClick={copy}
+ aria-label={ariaLabel}
+ className={className}
+ >
+ <span aria-live="polite">{copied ? copiedLabel : children}</span>
+ </button>
+ );
+}
diff --git a/app/(home)/components/site-page/page-header.tsx b/app/(home)/components/site-page/page-header.tsx
new file mode 100644
index 00000000..59a9676c
--- /dev/null
+++ b/app/(home)/components/site-page/page-header.tsx
@@ -0,0 +1,63 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { SectionTitle } from "../landing/ui/section-title";
+
+/**
+ * Header of the standalone site pages (blog, showcases, legal, changelog,
+ * stars): a small eyebrow over a two-tone h1 on the left, the lead and the
+ * page actions in a 420px column on the right. Below `xl` it stacks.
+ */
+export function SitePageHeader({
+ eyebrow,
+ title,
+ continuation,
+ lead,
+ children,
+ className,
+ asideClassName,
+}: {
+ eyebrow: ReactNode;
+ title: ReactNode;
+ continuation?: ReactNode;
+ lead?: ReactNode;
+ /** Right column under the lead: buttons, meta. */
+ children?: ReactNode;
+ className?: string;
+ asideClassName?: string;
+}) {
+ return (
+ <header
+ className={cn(
+ "landing-container flex flex-col gap-5 pt-12 pb-8 md:pt-20 md:pb-12 xl:flex-row xl:items-end xl:justify-between xl:gap-10 xl:pt-28 xl:pb-14",
+ className,
+ )}
+ >
+ <div className="flex min-w-0 flex-col gap-5">
+ <p className="text-small text-muted-foreground">{eyebrow}</p>
+ <SectionTitle
+ as="h1"
+ title={title}
+ continuation={continuation}
+ continuationClassName="text-subtle"
+ />
+ </div>
+ {(lead || children) && (
+ <div
+ className={cn(
+ "flex flex-col gap-5 xl:w-[420px] xl:shrink-0",
+ asideClassName,
+ )}
+ >
+ {lead && (
+ <p className="text-ui leading-6 text-muted-foreground">{lead}</p>
+ )}
+ {children}
+ </div>
+ )}
+ </header>
+ );
+}
+
+/** Compact filled button used in page headers (40px desktop, 44px mobile). */
+export const pageHeaderButton =
+ "inline-flex h-11 shrink-0 items-center justify-center gap-2 rounded-control-sm px-4 text-[15px] leading-5 whitespace-nowrap outline-none transition-[background-color,box-shadow,translate] duration-150 ease-out focus-visible:ring-3 focus-visible:ring-ring active:translate-y-px xl:h-10 xl:text-small";
diff --git a/app/(home)/components/site-page/play-glyph.tsx b/app/(home)/components/site-page/play-glyph.tsx
new file mode 100644
index 00000000..bb6e7ddd
--- /dev/null
+++ b/app/(home)/components/site-page/play-glyph.tsx
@@ -0,0 +1,26 @@
+import { cn } from "@/lib/utils";
+
+/** Solid play triangle in ink, for the white play keys on dark stages. */
+export function PlayGlyph({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 8 10"
+ aria-hidden="true"
+ className={cn("h-2.5 w-2 shrink-0 fill-[#0e1012]", className)}
+ >
+ <path d="M0 0 8 5 0 10Z" />
+ </svg>
+ );
+}
+
+export function PauseGlyph({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 8 10"
+ aria-hidden="true"
+ className={cn("h-2.5 w-2 shrink-0 fill-[#0e1012]", className)}
+ >
+ <path d="M0 0h2.6v10H0zM5.4 0H8v10H5.4z" />
+ </svg>
+ );
+}
diff --git a/app/(home)/components/site-page/use-active-section.ts b/app/(home)/components/site-page/use-active-section.ts
new file mode 100644
index 00000000..cd1db526
--- /dev/null
+++ b/app/(home)/components/site-page/use-active-section.ts
@@ -0,0 +1,36 @@
+"use client";
+
+import { useEffect, useState } from "react";
+
+/**
+ * Id of the section currently being read: the last one whose top has crossed
+ * the upper third of the viewport. Falls back to the first id.
+ */
+export function useActiveSection(ids: readonly string[]) {
+ const [active, setActive] = useState(ids[0]);
+
+ useEffect(() => {
+ const nodes = ids
+ .map((id) => document.getElementById(id))
+ .filter((node): node is HTMLElement => node !== null);
+ if (nodes.length === 0) return;
+
+ const passed = new Set<string>();
+ const observer = new IntersectionObserver(
+ (entries) => {
+ for (const entry of entries) {
+ const above = entry.boundingClientRect.top < window.innerHeight / 3;
+ if (entry.isIntersecting || above) passed.add(entry.target.id);
+ if (!above) passed.delete(entry.target.id);
+ }
+ const current = ids.findLast((id) => passed.has(id));
+ setActive(current ?? ids[0]);
+ },
+ { rootMargin: "0px 0px -66% 0px", threshold: [0, 1] },
+ );
+ for (const node of nodes) observer.observe(node);
+ return () => observer.disconnect();
+ }, [ids]);
+
+ return active;
+}
diff --git a/app/(home)/components/site-page/use-loop-controls.ts b/app/(home)/components/site-page/use-loop-controls.ts
new file mode 100644
index 00000000..49d362f3
--- /dev/null
+++ b/app/(home)/components/site-page/use-loop-controls.ts
@@ -0,0 +1,44 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+
+/** Starts `true` so desktop doesn't flash native controls before mount. */
+function useHoverCapable() {
+ const [hoverCapable, setHoverCapable] = useState(true);
+
+ useEffect(() => {
+ const mql = window.matchMedia("(hover: hover)");
+ setHoverCapable(mql.matches);
+ const onChange = (event: MediaQueryListEvent) =>
+ setHoverCapable(event.matches);
+ mql.addEventListener("change", onChange);
+ return () => mql.removeEventListener("change", onChange);
+ }, []);
+
+ return hoverCapable;
+}
+
+/**
+ * Native controls for a muted autoplay loop: shown on hover or keyboard
+ * focus, and always on touch screens or with reduced motion, so the loop can
+ * be paused with any input.
+ */
+export function useLoopControls() {
+ const reducedMotion = usePrefersReducedMotion();
+ const hoverCapable = useHoverCapable();
+ const [hovered, setHovered] = useState(false);
+ const [focused, setFocused] = useState(false);
+
+ return {
+ reducedMotion,
+ videoProps: {
+ controls: !hoverCapable || hovered || focused || reducedMotion,
+ tabIndex: 0,
+ onPointerEnter: () => setHovered(true),
+ onPointerLeave: () => setHovered(false),
+ onFocus: () => setFocused(true),
+ onBlur: () => setFocused(false),
+ },
+ };
+}
diff --git a/app/(home)/components/sponsor-card.tsx b/app/(home)/components/sponsor-card.tsx
deleted file mode 100644
index f893a376..00000000
--- a/app/(home)/components/sponsor-card.tsx
+++ /dev/null
@@ -1,121 +0,0 @@
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import type { Sponsor, SponsorTier } from "@/config/sponsors";
-import { cn } from "@/lib/utils";
-
-export type LogoTreatment = "color" | "reveal" | "muted";
-
-export const TIER_LABEL: Record<SponsorTier, string> = {
- legendary: "Legendary",
- featured: "Featured",
- partner: "Partner",
- builder: "Builder",
-};
-
-export const TIER_STYLE: Record<
- SponsorTier,
- { span: string; logoArea: string; maxH: string; treatment: LogoTreatment }
-> = {
- legendary: {
- span: "col-span-2",
- logoArea: "min-h-24",
- maxH: "max-h-12",
- treatment: "color",
- },
- featured: {
- span: "col-span-2",
- logoArea: "min-h-20",
- maxH: "max-h-10",
- treatment: "color",
- },
- partner: {
- span: "col-span-1",
- logoArea: "min-h-16",
- maxH: "max-h-8",
- treatment: "reveal",
- },
- builder: {
- span: "col-span-1",
- logoArea: "min-h-16",
- maxH: "max-h-8",
- treatment: "muted",
- },
-};
-
-export function SponsorCard({
- sponsor,
- label,
- logoArea,
- maxH,
- treatment,
-}: {
- sponsor: Sponsor;
- label: string;
- logoArea: string;
- maxH: string;
- treatment: LogoTreatment;
-}) {
- return (
- <a
- href={sponsor.website}
- target="_blank"
- rel="noreferrer"
- className="group surface-card surface-card-interactive flex h-full flex-col rounded-2xl p-4 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
- >
- <div className={cn("grid flex-1 place-items-center py-2", logoArea)}>
- {/** biome-ignore lint/performance/noImgElement: sponsor logos are SVGs of arbitrary sizes */}
- <img
- src={sponsor.logoUrl}
- alt=""
- loading="lazy"
- className={cn(
- maxH,
- "w-auto max-w-full object-contain dark:[filter:grayscale(1)_brightness(0)_invert(1)]",
- treatment === "color" && "opacity-100",
- treatment === "reveal" &&
- "opacity-70 grayscale transition-[opacity,filter] duration-300 group-hover:opacity-100 group-hover:grayscale-0 dark:group-hover:[filter:grayscale(1)_brightness(0)_invert(1)]",
- treatment === "muted" &&
- "opacity-70 grayscale transition-opacity duration-300 group-hover:opacity-100",
- sponsor.customStyles,
- )}
- style={{ transform: `scale(${sponsor.logoScale ?? 1})` }}
- />
- </div>
- <div className="mt-3 flex items-baseline justify-between gap-3 border-t border-border/60 pt-3">
- <span className="truncate text-sm font-medium text-foreground">
- {sponsor.name}
- </span>
- <span className="shrink-0 text-xs text-muted-foreground">{label}</span>
- </div>
- </a>
- );
-}
-
-export function BecomeSponsorCard({
- href,
- className,
-}: {
- href: string;
- className?: string;
-}) {
- return (
- <Link
- href={href}
- className={cn(
- "group flex h-full min-h-24 flex-col items-center justify-center gap-1.5 rounded-2xl border border-dashed border-border p-4 text-center transition-colors duration-200 hover:border-foreground/30 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
- className,
- )}
- >
- <span className="flex items-center gap-1.5 text-sm font-medium text-foreground">
- Your logo here
- <ArrowRight
- className="size-3.5 transition-transform duration-200 group-hover:translate-x-0.5"
- aria-hidden="true"
- />
- </span>
- <span className="text-xs text-muted-foreground">
- From $10/mo — pick a tier
- </span>
- </Link>
- );
-}
diff --git a/app/(home)/components/sponsor-grid.tsx b/app/(home)/components/sponsor-grid.tsx
deleted file mode 100644
index 19424ac1..00000000
--- a/app/(home)/components/sponsor-grid.tsx
+++ /dev/null
@@ -1,124 +0,0 @@
-import type { Sponsor, SponsorTier } from "@/config/sponsors";
-import { cn } from "@/lib/utils";
-import {
- BecomeSponsorCard,
- SponsorCard,
- TIER_LABEL,
- TIER_STYLE,
-} from "./sponsor-card";
-
-const TIER_ORDER: SponsorTier[] = [
- "legendary",
- "featured",
- "partner",
- "builder",
-];
-
-const ROW_SIZES: Record<SponsorTier, number[]> = {
- legendary: [1],
- featured: [2, 3],
- partner: [3, 4, 2],
- builder: [3, 4, 2],
-};
-
-const MD_SPAN: Record<number, string> = {
- 1: "md:col-span-12",
- 2: "md:col-span-6",
- 3: "md:col-span-4",
- 4: "md:col-span-3",
-};
-
-function partition(count: number, sizes: number[]): number[] | null {
- const memo = new Map<number, number[] | null>();
- const solve = (rem: number): number[] | null => {
- if (rem === 0) return [];
- const cached = memo.get(rem);
- if (cached !== undefined) return cached;
- let result: number[] | null = null;
- for (const size of sizes) {
- if (size > rem) continue;
- const rest = solve(rem - size);
- if (rest) {
- result = [size, ...rest];
- break;
- }
- }
- memo.set(rem, result);
- return result;
- };
- return solve(count);
-}
-
-function packRows(count: number, sizes: number[]): number[] {
- return partition(count, sizes) ?? partition(count, [...sizes, 1]) ?? [count];
-}
-
-type Cell =
- | { kind: "sponsor"; sponsor: Sponsor }
- | { kind: "cta"; href: string };
-
-function layoutCells(sponsors: Sponsor[], ctaHref: string) {
- const groups = TIER_ORDER.map((tier) => ({
- tier,
- cells: sponsors
- .filter((s) => s.tier === tier)
- .map((sponsor): Cell => ({ kind: "sponsor", sponsor })),
- })).filter((g) => g.cells.length > 0);
-
- const last = groups.at(-1);
- if (last) last.cells.push({ kind: "cta", href: ctaHref });
- else
- groups.push({ tier: "builder", cells: [{ kind: "cta", href: ctaHref }] });
-
- return groups.flatMap(({ tier, cells }) => {
- const rows = packRows(cells.length, ROW_SIZES[tier]);
- let index = 0;
- return rows.flatMap((rowSize) => {
- const row = cells.slice(index, index + rowSize);
- index += rowSize;
- return row.map((cell) => ({
- cell,
- tier,
- mdSpan: MD_SPAN[rowSize] ?? "md:col-span-12",
- }));
- });
- });
-}
-
-export function SponsorGrid({
- sponsors,
- ctaHref,
- className,
-}: {
- sponsors: Sponsor[];
- ctaHref: string;
- className?: string;
-}) {
- return (
- <div className={cn("grid grid-cols-2 gap-3 md:grid-cols-12", className)}>
- {layoutCells(sponsors, ctaHref).map(({ cell, tier, mdSpan }) => {
- const style = TIER_STYLE[tier];
- if (cell.kind === "cta") {
- return (
- <BecomeSponsorCard
- key="cta"
- href={cell.href}
- className={cn("col-span-2", mdSpan)}
- />
- );
- }
- return (
- <div key={cell.sponsor.id} className={cn(style.span, mdSpan)}>
- <SponsorCard
- sponsor={cell.sponsor}
- label={TIER_LABEL[tier]}
- logoArea={style.logoArea}
- maxH={style.maxH}
- treatment={style.treatment}
- />
- </div>
- );
- })}
- </div>
- );
-}
diff --git a/app/(home)/components/stars-button.tsx b/app/(home)/components/stars-button.tsx
index b12691fb..214dfa2b 100644
--- a/app/(home)/components/stars-button.tsx
+++ b/app/(home)/components/stars-button.tsx
@@ -15,7 +15,7 @@ export function StarsButton({
data-cta="stars_header"
data-destination="/stars"
className={cn(
- "group inline-flex h-9 items-center gap-2 rounded-full border border-border px-3 text-sm font-medium transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
+ "group inline-flex h-9 items-center gap-2 rounded-full border border-border px-3 text-sm font-medium transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
className,
)}
{...props}
diff --git a/app/(home)/components/sticky-header-shell.tsx b/app/(home)/components/sticky-header-shell.tsx
deleted file mode 100644
index c29ed848..00000000
--- a/app/(home)/components/sticky-header-shell.tsx
+++ /dev/null
@@ -1,104 +0,0 @@
-"use client";
-
-import { animate, motion, useMotionValue } from "motion/react";
-import { type ReactNode, useEffect, useRef } from "react";
-import { StudioBar } from "@/components/studio-bar";
-import { useScroll } from "@/hooks/use-scroll";
-import { cn } from "@/lib/utils";
-
-const HEADER_HEIGHT = 64;
-const REVEAL_SPRING = {
- type: "spring",
- stiffness: 480,
- damping: 34,
- mass: 0.9,
-} as const;
-
-export function StickyHeaderShell({ children }: { children: ReactNode }) {
- const scrolled = useScroll();
- const headerRef = useRef<HTMLElement>(null);
- const y = useMotionValue(0);
- const prevPast = useRef<boolean | null>(null);
- const animating = useRef(false);
-
- useEffect(() => {
- let zoom: HTMLElement | null = null;
- let run = 0;
-
- const evaluate = () => {
- const height = headerRef.current?.offsetHeight ?? HEADER_HEIGHT;
- if (!zoom?.isConnected) {
- zoom = document.querySelector<HTMLElement>("[data-hero-zoom]");
- }
-
- if (!zoom) {
- y.set(0);
- prevPast.current = null;
- return;
- }
-
- const past = zoom.getBoundingClientRect().bottom <= window.innerHeight;
- const first = prevPast.current === null;
-
- if (!first && past !== prevPast.current) {
- animating.current = true;
- const id = ++run;
- const settle = () => {
- if (id !== run) return;
- animating.current = false;
- schedule();
- };
- animate(y, past ? 0 : -height, REVEAL_SPRING).then(settle, settle);
- } else if (past) {
- if (first) y.set(0);
- } else if (!animating.current) {
- y.set(-Math.min(window.scrollY, height));
- }
-
- prevPast.current = past;
- };
-
- let raf = 0;
- const schedule = () => {
- if (raf) return;
- raf = requestAnimationFrame(() => {
- raf = 0;
- evaluate();
- });
- };
-
- evaluate();
- window.addEventListener("scroll", schedule, { passive: true });
- window.addEventListener("resize", schedule);
- return () => {
- cancelAnimationFrame(raf);
- window.removeEventListener("scroll", schedule);
- window.removeEventListener("resize", schedule);
- };
- }, [y]);
-
- return (
- <>
- <motion.header
- ref={headerRef}
- style={{ y }}
- className="fixed inset-x-0 top-0 z-40"
- >
- <StudioBar collapsed={scrolled} />
- <div
- className={cn(
- "transition-[height,background-color,box-shadow] duration-300",
- scrolled
- ? "h-14 bg-background [box-shadow:var(--elevation-raised)]"
- : "h-16 bg-transparent shadow-none",
- )}
- >
- <div className="section flex h-full items-center justify-between">
- {children}
- </div>
- </div>
- </motion.header>
- <div aria-hidden className="h-26 in-data-[studio-bar=dismissed]:h-16" />
- </>
- );
-}
diff --git a/app/(home)/components/threads-icon.tsx b/app/(home)/components/threads-icon.tsx
deleted file mode 100644
index bbcc1add..00000000
--- a/app/(home)/components/threads-icon.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-export const ThreadsIcon = ({ className }: { className?: string }) => (
- <svg
- viewBox="0 0 24 24"
- className={className}
- fill="currentColor"
- role="img"
- aria-label="Threads"
- >
- <title>Threads</title>
- <path d="M18.263 11.097c-.03-3.486-1.92-5.586-5.111-5.586-2.13 0-3.922.963-4.863 2.499l2.062 1.438c.535-.843 1.272-1.543 2.628-1.543 1.528 0 2.318.85 2.544 2.431a15 15 0 0 0-2.236-.173c-4.125 0-6.068 1.867-6.068 4.336s1.943 3.99 4.804 3.99c3.139 0 5.013-2.115 5.781-4.735.798.361 1.348 1.204 1.348 2.47 0 3.387-3.907 5.232-7.22 5.232-4.885 0-8.077-3.207-8.077-8.424 0-6.392 4.223-10.487 9.9-10.487 3.808 0 5.69 1.671 6.97 3.914l2.108-1.475C21.44 2.078 18.331 0 13.663 0 6.227 0 1.168 5.277 1.168 12.934c0 7 4.953 11.066 10.856 11.066 4.878 0 9.809-2.846 9.809-7.716 0-2.545-1.46-4.231-3.569-5.187m-6.33 4.855c-1.077 0-2.026-.512-2.026-1.453 0-1.483 1.822-1.934 3.606-1.934.678 0 1.34.045 1.927.173-.422 1.927-1.671 3.215-3.508 3.214Z" />
- </svg>
-);
diff --git a/app/(home)/components/use-autoplay.ts b/app/(home)/components/use-autoplay.ts
index 1791b034..52900fce 100644
--- a/app/(home)/components/use-autoplay.ts
+++ b/app/(home)/components/use-autoplay.ts
@@ -1,7 +1,9 @@
import type { PlayerRef } from "@remotion/player";
import { useIntersectionObserver } from "@uidotdev/usehooks";
import { type RefObject, useCallback, useEffect, useRef } from "react";
+import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+/** Plays the player while it is near the viewport; never under reduced motion. */
export function useAutoplay(
playerRef: RefObject<PlayerRef | null>,
enabled = true,
@@ -12,6 +14,7 @@ export function useAutoplay(
rootMargin: "200px",
});
+ const reducedMotion = usePrefersReducedMotion();
const attached = useRef(false);
const containerRef = useCallback(
(node: Element | null) => {
@@ -22,6 +25,10 @@ export function useAutoplay(
);
useEffect(() => {
+ if (reducedMotion) {
+ playerRef.current?.pause();
+ return;
+ }
if (!enabled) return;
const visible = attached.current ? Boolean(entry?.isIntersecting) : true;
@@ -44,7 +51,7 @@ export function useAutoplay(
};
raf = requestAnimationFrame(tick);
return () => cancelAnimationFrame(raf);
- }, [enabled, entry, playerRef]);
+ }, [enabled, reducedMotion, entry, playerRef]);
return { containerRef };
}
diff --git a/app/(home)/components/x-icon.tsx b/app/(home)/components/x-icon.tsx
deleted file mode 100644
index a330a25d..00000000
--- a/app/(home)/components/x-icon.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-export const XIcon = ({ className }: { className?: string }) => (
- <svg
- viewBox="0 0 24 24"
- className={className}
- fill="currentColor"
- role="img"
- aria-label="X"
- >
- <title>X</title>
- <path d="M14.234 10.162 22.977 0h-2.072l-7.591 8.824L7.251 0H.258l9.168 13.343L.258 24H2.33l8.016-9.318L16.749 24h6.993zm-2.837 3.299-.929-1.329L3.076 1.56h3.182l5.965 8.532.929 1.329 7.754 11.09h-3.182z" />
- </svg>
-);
diff --git a/app/(home)/legal/components/legal-article.tsx b/app/(home)/legal/components/legal-article.tsx
new file mode 100644
index 00000000..493725ed
--- /dev/null
+++ b/app/(home)/legal/components/legal-article.tsx
@@ -0,0 +1,101 @@
+import {
+ LEGAL_INDEX,
+ LEGAL_INTRO,
+ LEGAL_PARTS,
+ type LegalItem,
+ type LegalSection,
+} from "../content";
+
+const BODY = "text-ui leading-6 text-body";
+const NUMBERS = new Map(LEGAL_INDEX.map((item) => [item.id, item.number]));
+
+/** The legal text: intro, then both parts with numbered sections. */
+export function LegalArticle() {
+ return (
+ <article className="min-w-0 xl:w-[680px] xl:shrink-0">
+ <div className="flex flex-col gap-4 pb-12 xl:gap-5 xl:pb-16">
+ <p className="text-[20px] leading-7 tracking-[-0.01em] text-foreground xl:text-[22px] xl:leading-8">
+ {LEGAL_INTRO.lead}
+ </p>
+ <p className={BODY}>{LEGAL_INTRO.body}</p>
+ </div>
+
+ {LEGAL_PARTS.map((part, index) => (
+ <section key={part.id} aria-labelledby={part.id}>
+ <div className="flex items-baseline justify-between gap-4 pb-8 xl:pb-10">
+ <h2
+ id={part.id}
+ className="scroll-mt-28 text-[34px] leading-9 tracking-heading text-foreground xl:scroll-mt-8 xl:text-[40px] xl:leading-11 xl:tracking-[-0.04em]"
+ >
+ {part.title}
+ </h2>
+ <span className="shrink-0 text-caption text-subtle">
+ part {index + 1} of {LEGAL_PARTS.length}
+ </span>
+ </div>
+ {part.sections.map((section) => (
+ <LegalBlock key={section.id} section={section} />
+ ))}
+ </section>
+ ))}
+ </article>
+ );
+}
+
+function LegalBlock({ section }: { section: LegalSection }) {
+ return (
+ <div className="flex flex-col gap-3.5 pb-12 xl:gap-4 xl:pb-14">
+ <div className="flex flex-col gap-1.5 xl:gap-2">
+ <span className="text-caption text-subtle tabular-nums">
+ {NUMBERS.get(section.id)}
+ </span>
+ <h3
+ id={section.id}
+ className="scroll-mt-28 text-[22px] leading-7 font-medium tracking-title text-foreground xl:scroll-mt-8 xl:text-[24px] xl:leading-[30px]"
+ >
+ {section.title}
+ </h3>
+ </div>
+ {section.body && <p className={BODY}>{section.body}</p>}
+ {section.items && <FactList items={section.items} />}
+ {section.rows && <ServiceRows rows={section.rows} />}
+ </div>
+ );
+}
+
+/** Facts: muted cards on desktop, one hairline card with rows below `xl`. */
+function FactList({ items }: { items: LegalItem[] }) {
+ return (
+ <ul className="flex flex-col rounded-card bg-surface px-[18px] py-1 shadow-[0_0_0_1px_var(--hairline)] xl:gap-2 xl:bg-transparent xl:px-0 xl:pt-2 xl:pb-0 xl:shadow-none">
+ {items.map((item, index) => (
+ <li
+ key={index}
+ className="flex flex-col gap-1.5 border-b border-hairline py-4 last:border-b-0 xl:rounded-card xl:border-b-0 xl:bg-surface-muted xl:px-[22px] xl:py-5"
+ >
+ <span className="text-ui leading-6 font-medium text-foreground">
+ {item.title}
+ </span>
+ <span className={BODY}>{item.body}</span>
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+function ServiceRows({ rows }: { rows: LegalItem[] }) {
+ return (
+ <dl className="flex flex-col rounded-card bg-surface px-[18px] py-1 shadow-[0_0_0_1px_var(--hairline)] xl:px-[22px]">
+ {rows.map((row, index) => (
+ <div
+ key={index}
+ className="flex flex-col gap-1 border-b border-hairline py-4 last:border-b-0 xl:flex-row xl:gap-5 xl:py-[18px]"
+ >
+ <dt className="text-ui leading-6 font-medium text-foreground xl:w-[120px] xl:shrink-0">
+ {row.title}
+ </dt>
+ <dd className={BODY}>{row.body}</dd>
+ </div>
+ ))}
+ </dl>
+ );
+}
diff --git a/app/(home)/legal/components/legal-contact.tsx b/app/(home)/legal/components/legal-contact.tsx
new file mode 100644
index 00000000..50d0fa24
--- /dev/null
+++ b/app/(home)/legal/components/legal-contact.tsx
@@ -0,0 +1,31 @@
+import { SUPPORT_EMAIL } from "@/config/site";
+import { cn } from "@/lib/utils";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+
+/**
+ * "If anything is unclear, email us": under the index on desktop, a card at
+ * the end of the article below `xl`.
+ */
+export function LegalContact({ className }: { className?: string }) {
+ return (
+ <div
+ className={cn(
+ "flex flex-col gap-3.5 rounded-card bg-surface p-5 shadow-[0_0_0_1px_var(--hairline)] xl:rounded-none xl:bg-transparent xl:px-2 xl:py-0 xl:shadow-none",
+ className,
+ )}
+ >
+ <p className="text-[15px] leading-[22px] text-muted-foreground xl:text-small">
+ If anything on this page is unclear, email us.
+ </p>
+ <a
+ href={`mailto:${SUPPORT_EMAIL}`}
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ "h-11 rounded-control-sm px-4 text-[15px] leading-5 xl:h-10 xl:self-start xl:text-small",
+ )}
+ >
+ {SUPPORT_EMAIL}
+ </a>
+ </div>
+ );
+}
diff --git a/app/(home)/legal/components/legal-contents-bar.tsx b/app/(home)/legal/components/legal-contents-bar.tsx
new file mode 100644
index 00000000..a01fae0c
--- /dev/null
+++ b/app/(home)/legal/components/legal-contents-bar.tsx
@@ -0,0 +1,123 @@
+"use client";
+
+import { ChevronDown } from "lucide-react";
+import { useEffect, useId, useRef, useState } from "react";
+import { cn } from "@/lib/utils";
+import { useActiveSection } from "../../components/site-page/use-active-section";
+import { LEGAL_INDEX } from "../content";
+
+const IDS = LEGAL_INDEX.map((item) => item.id);
+
+/**
+ * Below `xl`: a sticky "Contents" trigger showing the section in view. Opens
+ * the numbered index as a dropdown; picking an item jumps and closes it.
+ */
+export function LegalContentsBar({ className }: { className?: string }) {
+ const active = useActiveSection(IDS);
+ const [open, setOpen] = useState(false);
+ const rootRef = useRef<HTMLDivElement>(null);
+ const triggerRef = useRef<HTMLButtonElement>(null);
+ const listId = useId();
+ const current = LEGAL_INDEX.find((item) => item.id === active);
+
+ useEffect(() => {
+ if (!open) return;
+ const close = (event: PointerEvent | KeyboardEvent) => {
+ if (event instanceof KeyboardEvent) {
+ if (event.key !== "Escape") return;
+ setOpen(false);
+ if (rootRef.current?.contains(document.activeElement)) {
+ triggerRef.current?.focus();
+ }
+ return;
+ }
+ if (!rootRef.current?.contains(event.target as Node)) setOpen(false);
+ };
+ document.addEventListener("pointerdown", close);
+ document.addEventListener("keydown", close);
+ return () => {
+ document.removeEventListener("pointerdown", close);
+ document.removeEventListener("keydown", close);
+ };
+ }, [open]);
+
+ return (
+ <div
+ ref={rootRef}
+ className={cn(
+ "sticky top-0 z-30 border-y border-divider bg-background px-5 py-4 md:px-10",
+ className,
+ )}
+ >
+ <button
+ ref={triggerRef}
+ type="button"
+ aria-expanded={open}
+ aria-controls={listId}
+ onClick={() => setOpen((value) => !value)}
+ className="flex h-11 w-full items-center justify-between gap-3 rounded-control-sm bg-capsule pr-3 pl-3.5 outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <span className="flex min-w-0 items-center gap-2">
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-4 shrink-0 fill-none stroke-foreground stroke-[1.8] [stroke-linecap:round]"
+ >
+ <path d="M4 6h16M4 12h16M4 18h10" />
+ </svg>
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ Contents
+ </span>
+ </span>
+ <span className="flex min-w-0 items-center gap-1.5">
+ {current && (
+ <span className="truncate text-small leading-[18px] text-muted-foreground">
+ {current.number} {current.title}
+ </span>
+ )}
+ <ChevronDown
+ aria-hidden="true"
+ className={cn(
+ "size-3.5 shrink-0 text-foreground transition-transform duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] motion-reduce:transition-none",
+ open && "rotate-180",
+ )}
+ />
+ </span>
+ </button>
+
+ <ul
+ id={listId}
+ hidden={!open}
+ className="absolute inset-x-5 top-full mt-1 flex origin-top flex-col gap-0.5 rounded-card bg-surface p-2 shadow-[0_0_0_1px_var(--hairline),0_24px_48px_-32px_#0e10122e] transition-[opacity,translate,scale] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] starting:-translate-y-1 starting:scale-[0.98] starting:opacity-0 motion-reduce:starting:translate-none motion-reduce:starting:scale-100 md:inset-x-10"
+ >
+ {LEGAL_INDEX.map((item) => (
+ <li key={item.id}>
+ <a
+ href={`#${item.id}`}
+ onClick={() => setOpen(false)}
+ aria-current={item.id === active ? "location" : undefined}
+ className="flex h-11 items-center gap-2.5 rounded-control-sm px-3 outline-none hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <span
+ className={cn(
+ "w-[22px] shrink-0 text-caption",
+ item.id === active ? "text-primary" : "text-subtle",
+ )}
+ >
+ {item.number}
+ </span>
+ <span
+ className={cn(
+ "text-[15px] leading-5",
+ item.id === active ? "text-primary" : "text-body",
+ )}
+ >
+ {item.title}
+ </span>
+ </a>
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+}
diff --git a/app/(home)/legal/components/legal-hero.tsx b/app/(home)/legal/components/legal-hero.tsx
new file mode 100644
index 00000000..20fcc1a6
--- /dev/null
+++ b/app/(home)/legal/components/legal-hero.tsx
@@ -0,0 +1,54 @@
+import Image from "next/image";
+import { SUPPORT_EMAIL } from "@/config/site";
+import { SitePageHeader } from "../../components/site-page/page-header";
+import { LAST_UPDATED } from "../content";
+
+const META = [
+ { label: "last updated", value: LAST_UPDATED },
+ {
+ label: "questions",
+ value: (
+ <a
+ href={`mailto:${SUPPORT_EMAIL}`}
+ className="-mx-1.5 rounded-tile px-1.5 transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
+ >
+ {SUPPORT_EMAIL}
+ </a>
+ ),
+ },
+];
+
+/** "Privacy [satin chip] & Terms" over the muted line, meta on the right. */
+export function LegalHero() {
+ return (
+ <SitePageHeader
+ eyebrow="remocn.dev/legal"
+ title={
+ <span className="inline-flex flex-wrap items-center gap-2.5 md:gap-3.5">
+ Privacy
+ <Image
+ src="/legal/satin-chip.webp"
+ alt=""
+ width={48}
+ height={48}
+ priority
+ className="size-9 shrink-0 -rotate-6 rounded-[11px] shadow-[inset_0_1px_0_#ffffff59,0_2px_6px_#0e10121f] md:size-12 md:rounded-control"
+ />
+ &amp; Terms
+ </span>
+ }
+ continuation="How remocn handles your data."
+ className="gap-6 pb-6 md:gap-5"
+ asideClassName="xl:w-auto xl:pb-1.5"
+ >
+ <dl className="flex gap-8 xl:gap-10">
+ {META.map((item) => (
+ <div key={item.label} className="flex flex-col gap-1 xl:gap-1.5">
+ <dt className="text-caption text-subtle">{item.label}</dt>
+ <dd className="text-ui text-foreground">{item.value}</dd>
+ </div>
+ ))}
+ </dl>
+ </SitePageHeader>
+ );
+}
diff --git a/app/(home)/legal/components/legal-index.tsx b/app/(home)/legal/components/legal-index.tsx
new file mode 100644
index 00000000..2566b1de
--- /dev/null
+++ b/app/(home)/legal/components/legal-index.tsx
@@ -0,0 +1,76 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import { useActiveSection } from "../../components/site-page/use-active-section";
+import { LEGAL_INDEX, LEGAL_PARTS } from "../content";
+
+const IDS = LEGAL_INDEX.map((item) => item.id);
+
+/** Desktop sticky index: both parts, numbered, the section in view raised. */
+export function LegalIndex() {
+ const active = useActiveSection(IDS);
+ let offset = 0;
+
+ return (
+ <nav
+ aria-label="On this page"
+ className="flex flex-col gap-1 rounded-card bg-surface-muted p-2"
+ >
+ {LEGAL_PARTS.map((part, partIndex) => {
+ const items = LEGAL_INDEX.slice(offset, offset + part.sections.length);
+ offset += part.sections.length;
+ return (
+ <div key={part.id} className="flex flex-col gap-1">
+ <a
+ href={`#${part.id}`}
+ className={cn(
+ "flex items-center justify-between rounded-control-sm px-3.5 pb-2 outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ partIndex === 0 ? "pt-3" : "pt-6",
+ )}
+ >
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {part.title}
+ </span>
+ <span className="text-caption text-subtle tabular-nums">
+ {part.sections.length}
+ </span>
+ </a>
+ {items.map((item) => {
+ const current = item.id === active;
+ return (
+ <a
+ key={item.id}
+ href={`#${item.id}`}
+ aria-current={current ? "location" : undefined}
+ className={cn(
+ "flex h-10 shrink-0 items-center gap-2.5 rounded-control-sm px-3.5 outline-none transition-[background-color,box-shadow] duration-150 ease-out focus-visible:ring-2 focus-visible:ring-ring",
+ current
+ ? "bg-surface shadow-[0_0_0_1px_var(--hairline),0_1px_2px_#0e10120a] dark:bg-secondary dark:shadow-[inset_0_1px_0_#ffffff0f,0_0_0_1px_#ffffff0f]"
+ : "hover:bg-surface/70 dark:hover:bg-secondary/60",
+ )}
+ >
+ <span
+ className={cn(
+ "w-[22px] shrink-0 text-caption tabular-nums",
+ current ? "text-primary" : "text-subtle",
+ )}
+ >
+ {item.number}
+ </span>
+ <span
+ className={cn(
+ "truncate text-[15px] leading-5",
+ current ? "text-primary" : "text-body",
+ )}
+ >
+ {item.title}
+ </span>
+ </a>
+ );
+ })}
+ </div>
+ );
+ })}
+ </nav>
+ );
+}
diff --git a/app/(home)/legal/content.tsx b/app/(home)/legal/content.tsx
new file mode 100644
index 00000000..a704069a
--- /dev/null
+++ b/app/(home)/legal/content.tsx
@@ -0,0 +1,197 @@
+import type { ReactNode } from "react";
+import { GITHUB_URL, SUPPORT_EMAIL } from "@/config/site";
+
+export const LAST_UPDATED = "July 24, 2026";
+
+export type LegalItem = { title: ReactNode; body: ReactNode };
+
+export type LegalSection = {
+ id: string;
+ title: string;
+ /** Lead paragraph(s) under the section title. */
+ body?: ReactNode;
+ /** Bulleted facts, drawn as cards. */
+ items?: LegalItem[];
+ /** Name / description rows, drawn as a table card. */
+ rows?: LegalItem[];
+};
+
+export type LegalPart = {
+ id: string;
+ title: string;
+ sections: LegalSection[];
+};
+
+function A({ href, children }: { href: string; children: ReactNode }) {
+ return (
+ <a
+ href={href}
+ className="rounded-[2px] underline decoration-divider underline-offset-[3px] transition-colors hover:decoration-foreground focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none"
+ >
+ {children}
+ </a>
+ );
+}
+
+export const Mail = () => (
+ <A href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</A>
+);
+
+export const LEGAL_INTRO = {
+ lead: "How remocn handles your data, and the terms that apply when you use the site or buy something.",
+ body: (
+ <>
+ remocn (&ldquo;we&rdquo;) operates{" "}
+ <A href="https://remocn.dev">remocn.dev</A> — an open-source registry of
+ video components for Remotion. If anything on this page is unclear, email
+ us at <Mail />.
+ </>
+ ),
+};
+
+export const LEGAL_PARTS: LegalPart[] = [
+ {
+ id: "privacy",
+ title: "Privacy Policy",
+ sections: [
+ {
+ id: "what-we-collect",
+ title: "What we collect",
+ body: "The site has no accounts and no sign-up. You can browse the docs, copy components, and use everything on the site without giving us any personal data.",
+ items: [
+ {
+ title: "Usage analytics.",
+ body: (
+ <>
+ We use <A href="https://openpanel.dev">OpenPanel</A> to collect
+ anonymous usage data: pages visited, referrer, browser and
+ device type, and coarse location (country level). This tells us
+ which components people actually use. We do not use advertising
+ trackers, we do not build cross-site profiles, and we never sell
+ data.
+ </>
+ ),
+ },
+ {
+ title: "Local preferences.",
+ body: "Your theme choice (light or dark) is stored in your browser’s localStorage and never leaves your device.",
+ },
+ {
+ title: "Server logs.",
+ body: "Our hosting infrastructure keeps standard access logs (IP address, requested URL, timestamp) for security and operations. They are rotated automatically and not used for anything else.",
+ },
+ ],
+ },
+ {
+ id: "payments",
+ title: "Payments",
+ body: (
+ <>
+ Paid products are sold through <A href="https://creem.io">Creem</A>,
+ our merchant of record. Creem runs the checkout and handles payment
+ processing, invoicing, and taxes. Your card details go directly to
+ Creem and its payment processors — they never touch our servers.
+ After a purchase we receive only what is needed to deliver it: your
+ email address, the product, and the order details. How Creem handles
+ your data is described in{" "}
+ <A href="https://www.creem.io/privacy">Creem’s privacy policy</A>.
+ </>
+ ),
+ },
+ {
+ id: "third-party-services",
+ title: "Third-party services",
+ rows: [
+ {
+ title: <A href="https://openpanel.dev">OpenPanel</A>,
+ body: "Anonymous usage analytics.",
+ },
+ {
+ title: <A href="https://creem.io">Creem</A>,
+ body: "Checkout and payments, as merchant of record.",
+ },
+ {
+ title: <A href={GITHUB_URL}>GitHub</A>,
+ body: "Source code, issues, and sponsorships. Anything you do there is governed by GitHub’s own terms.",
+ },
+ ],
+ },
+ {
+ id: "your-data",
+ title: "Your data",
+ body: (
+ <>
+ We keep order emails for as long as we need them to provide support
+ and meet legal obligations. To ask what we hold about you, or to
+ have it deleted, email <Mail /> and we will sort it out.
+ </>
+ ),
+ },
+ ],
+ },
+ {
+ id: "terms",
+ title: "Terms of Service",
+ sections: [
+ {
+ id: "free-components",
+ title: "The site and free components",
+ body: (
+ <>
+ The free components in the registry are released under the{" "}
+ <A href={`${GITHUB_URL}/blob/main/LICENSE`}>MIT license</A>. You can
+ copy them, modify them, and ship them in personal or commercial
+ projects without attribution. The site and the components are
+ provided &ldquo;as is&rdquo;, without warranty of any kind.
+ </>
+ ),
+ },
+ {
+ id: "paid-products",
+ title: "Paid products",
+ body: "Some products are paid. Unless a product states otherwise at purchase, buying it grants you a non-exclusive license to use it in any number of your own projects, commercial ones included. What it does not grant is the right to redistribute or resell the product itself — for example republishing the components in another registry, template marketplace, or paid bundle.",
+ },
+ {
+ id: "purchases-and-refunds",
+ title: "Purchases and refunds",
+ body: (
+ <>
+ Purchases are processed by Creem as merchant of record, so the sale
+ itself is also subject to the terms Creem presents at checkout. If a
+ product is broken or not as described, email <Mail /> within 14 days
+ of purchase and we will fix it or refund you.
+ </>
+ ),
+ },
+ {
+ id: "liability",
+ title: "Liability",
+ body: "To the maximum extent permitted by law, we are not liable for indirect or consequential damages arising from your use of the site or its products, and our total liability is limited to the amount you paid us in the twelve months before the claim. Free products come with no liability at all — they are yours to own, audit, and modify.",
+ },
+ {
+ id: "changes",
+ title: "Changes",
+ body: "We may update this page as the project evolves — for example when new products or services launch. The date at the top reflects the latest revision, and continued use of the site after a change means you accept it.",
+ },
+ {
+ id: "contact",
+ title: "Contact",
+ body: (
+ <>
+ For anything related to privacy, purchases, or these terms: <Mail />
+ .
+ </>
+ ),
+ },
+ ],
+ },
+];
+
+/** Flat, numbered list of sections (01–10) for the index and the article. */
+export const LEGAL_INDEX = LEGAL_PARTS.flatMap((part) => part.sections).map(
+ (section, index) => ({
+ id: section.id,
+ title: section.title,
+ number: String(index + 1).padStart(2, "0"),
+ }),
+);
diff --git a/app/(home)/legal/page.tsx b/app/(home)/legal/page.tsx
index 0e7868ce..d1aba4fe 100644
--- a/app/(home)/legal/page.tsx
+++ b/app/(home)/legal/page.tsx
@@ -1,5 +1,9 @@
import type { Metadata } from "next";
-import { GITHUB_URL, SUPPORT_EMAIL } from "@/config/site";
+import { LegalArticle } from "./components/legal-article";
+import { LegalContact } from "./components/legal-contact";
+import { LegalContentsBar } from "./components/legal-contents-bar";
+import { LegalHero } from "./components/legal-hero";
+import { LegalIndex } from "./components/legal-index";
const DESCRIPTION =
"How remocn handles your data, and the terms that apply to the site, the free components, and paid products.";
@@ -32,164 +36,24 @@ export const metadata: Metadata = {
},
};
-const LAST_UPDATED = "July 24, 2026";
-
export default function LegalPage() {
return (
<>
- <section className="pt-24 pb-10 sm:pt-28">
- <div className="section">
- <h1 className="text-4xl font-semibold leading-[1.05] tracking-tight text-foreground sm:text-5xl">
- Privacy & Terms
- </h1>
- <p className="mt-4 max-w-2xl text-balance text-base leading-relaxed text-muted-foreground sm:text-lg">
- How remocn handles your data, and the terms that apply when you use
- the site or buy something. Last updated {LAST_UPDATED}.
- </p>
- </div>
- </section>
-
- <section className="pb-24">
- <div className="section">
- <div className="typeset typeset-docs max-w-3xl">
- <p>
- remocn (&ldquo;we&rdquo;) operates{" "}
- <a href="https://remocn.dev">remocn.dev</a> — an open-source
- registry of video components for Remotion. If anything on this
- page is unclear, email us at{" "}
- <a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a>.
- </p>
-
- <h2 id="privacy">Privacy Policy</h2>
-
- <h3>What we collect</h3>
- <p>
- The site has no accounts and no sign-up. You can browse the docs,
- copy components, and use everything on the site without giving us
- any personal data.
- </p>
- <ul>
- <li>
- <strong>Usage analytics.</strong> We use{" "}
- <a href="https://openpanel.dev">OpenPanel</a> to collect
- anonymous usage data: pages visited, referrer, browser and
- device type, and coarse location (country level). This tells us
- which components people actually use. We do not use advertising
- trackers, we do not build cross-site profiles, and we never sell
- data.
- </li>
- <li>
- <strong>Local preferences.</strong> Your theme choice (light or
- dark) is stored in your browser&apos;s localStorage and never
- leaves your device.
- </li>
- <li>
- <strong>Server logs.</strong> Our hosting infrastructure keeps
- standard access logs (IP address, requested URL, timestamp) for
- security and operations. They are rotated automatically and not
- used for anything else.
- </li>
- </ul>
-
- <h3>Payments</h3>
- <p>
- Paid products are sold through{" "}
- <a href="https://creem.io">Creem</a>, our merchant of record.
- Creem runs the checkout and handles payment processing, invoicing,
- and taxes. Your card details go directly to Creem and its payment
- processors — they never touch our servers. After a purchase we
- receive only what is needed to deliver it: your email address, the
- product, and the order details. How Creem handles your data is
- described in{" "}
- <a href="https://www.creem.io/privacy">
- Creem&apos;s privacy policy
- </a>
- .
- </p>
-
- <h3>Third-party services</h3>
- <ul>
- <li>
- <a href="https://openpanel.dev">OpenPanel</a> — anonymous usage
- analytics.
- </li>
- <li>
- <a href="https://creem.io">Creem</a> — checkout and payments, as
- merchant of record.
- </li>
- <li>
- <a href={GITHUB_URL}>GitHub</a> — source code, issues, and
- sponsorships. Anything you do there is governed by GitHub&apos;s
- own terms.
- </li>
- </ul>
-
- <h3>Your data</h3>
- <p>
- We keep order emails for as long as we need them to provide
- support and meet legal obligations. To ask what we hold about you,
- or to have it deleted, email{" "}
- <a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a> and we
- will sort it out.
- </p>
-
- <h2 id="terms">Terms of Service</h2>
-
- <h3>The site and free components</h3>
- <p>
- The free components in the registry are released under the{" "}
- <a href={`${GITHUB_URL}/blob/main/LICENSE`}>MIT license</a>. You
- can copy them, modify them, and ship them in personal or
- commercial projects without attribution. The site and the
- components are provided &ldquo;as is&rdquo;, without warranty of
- any kind.
- </p>
-
- <h3>Paid products</h3>
- <p>
- Some products are paid. Unless a product states otherwise at
- purchase, buying it grants you a non-exclusive license to use it
- in any number of your own projects, commercial ones included. What
- it does not grant is the right to redistribute or resell the
- product itself — for example republishing the components in
- another registry, template marketplace, or paid bundle.
- </p>
-
- <h3>Purchases and refunds</h3>
- <p>
- Purchases are processed by Creem as merchant of record, so the
- sale itself is also subject to the terms Creem presents at
- checkout. If a product is broken or not as described, email{" "}
- <a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a> within 14
- days of purchase and we will fix it or refund you.
- </p>
-
- <h3>Liability</h3>
- <p>
- To the maximum extent permitted by law, we are not liable for
- indirect or consequential damages arising from your use of the
- site or its products, and our total liability is limited to the
- amount you paid us in the twelve months before the claim. Free
- products come with no liability at all — they are yours to own,
- audit, and modify.
- </p>
-
- <h3>Changes</h3>
- <p>
- We may update this page as the project evolves — for example when
- new products or services launch. The date at the top reflects the
- latest revision, and continued use of the site after a change
- means you accept it.
- </p>
-
- <h3>Contact</h3>
- <p>
- For anything related to privacy, purchases, or these terms:{" "}
- <a href={`mailto:${SUPPORT_EMAIL}`}>{SUPPORT_EMAIL}</a>.
- </p>
+ <LegalHero />
+
+ <div className="pb-[72px] xl:pb-section">
+ <LegalContentsBar className="xl:hidden" />
+ <div className="landing-container pt-8 xl:pt-0">
+ <div className="xl:flex xl:gap-[120px] xl:border-t xl:border-divider xl:pt-14">
+ <aside className="hidden w-[300px] shrink-0 flex-col gap-7 self-start xl:sticky xl:top-8 xl:flex">
+ <LegalIndex />
+ <LegalContact />
+ </aside>
+ <LegalArticle />
</div>
+ <LegalContact className="xl:hidden" />
</div>
- </section>
+ </div>
</>
);
}
diff --git a/app/(home)/page.tsx b/app/(home)/page.tsx
index 46e3d562..53b071f3 100644
--- a/app/(home)/page.tsx
+++ b/app/(home)/page.tsx
@@ -1,12 +1,14 @@
import type { Metadata } from "next";
-import { Faq } from "./components/sections/faq";
-import { FinalCTA } from "./components/sections/final-cta";
-import { Hero } from "./components/sections/hero";
-import { HowItWorks } from "./components/sections/how-it-works";
-import { LandingPartners } from "./components/sections/landing-partners";
-import { Testimonials } from "./components/sections/testimonials";
-import { WhatsInside } from "./components/sections/whats-inside";
-import { WhyRemocn } from "./components/sections/why-remocn";
+import { FinalCta } from "./components/landing/sections/final-cta";
+import { Hero } from "./components/landing/sections/hero";
+import { HowItWorks } from "./components/landing/sections/how-it-works";
+import { SponsorsStrip } from "./components/landing/sections/sponsors-strip";
+import { StudioPipeline } from "./components/landing/sections/studio-pipeline";
+import { TestimonialsWall } from "./components/landing/sections/testimonials-wall";
+import { WhatsInside } from "./components/landing/sections/whats-inside";
+import { WhyRemocn } from "./components/landing/sections/why-remocn";
+import { PauseOffscreen } from "./components/landing/ui/pause-offscreen";
+import { RevealScope } from "./components/landing/ui/reveal-scope";
export const metadata: Metadata = {
alternates: { canonical: "/" },
@@ -16,13 +18,15 @@ export default function Page() {
return (
<>
<Hero />
+ <SponsorsStrip />
<HowItWorks />
- <WhyRemocn />
<WhatsInside />
- <Testimonials />
- <Faq />
- <LandingPartners />
- <FinalCTA />
+ <StudioPipeline />
+ <WhyRemocn />
+ <TestimonialsWall />
+ <FinalCta />
+ <RevealScope />
+ <PauseOffscreen />
</>
);
}
diff --git a/app/(home)/showcases/[slug]/page.tsx b/app/(home)/showcases/[slug]/page.tsx
index c6f58ca3..917bd36b 100644
--- a/app/(home)/showcases/[slug]/page.tsx
+++ b/app/(home)/showcases/[slug]/page.tsx
@@ -1,94 +1,163 @@
-import { ArrowLeft } from "lucide-react";
import type { Metadata } from "next";
import Link from "next/link";
import { notFound } from "next/navigation";
-import { Button } from "@/components/ui/button";
-import { getShowcase, getShowcases } from "@/lib/showcases";
-import { GitHubIcon } from "../../components/github-icon";
-import { ShowcaseAuthor } from "../components/showcase-author";
-import { ShowcaseComponents } from "../components/showcase-components";
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+import { pageHeaderButton } from "../../components/site-page/page-header";
+import { ShowcaseDetails } from "../components/showcase-details";
import { ShowcaseVideo } from "../components/showcase-video";
+import { getReel } from "../lib/reel";
type PageProps = { params: Promise<{ slug: string }> };
+async function getClip(slug: string) {
+ const { clips } = await getReel();
+ const index = clips.findIndex((clip) => clip.slug === slug);
+ if (index === -1) return null;
+ return {
+ clip: clips[index],
+ index,
+ count: clips.length,
+ prev: clips[index - 1] ?? null,
+ next: clips[index + 1] ?? null,
+ };
+}
+
export async function generateStaticParams() {
- const showcases = await getShowcases();
- return showcases.map((showcase) => ({ slug: showcase.slug }));
+ const { clips } = await getReel();
+ return clips.map((clip) => ({ slug: clip.slug }));
}
export async function generateMetadata({
params,
}: PageProps): Promise<Metadata> {
const { slug } = await params;
- const showcase = await getShowcase(slug);
- if (!showcase) return {};
-
- const title = `${showcase.title} · remocn`;
+ const found = await getClip(slug);
+ if (!found) return {};
+ const { clip } = found;
+ const title = `${clip.title} · remocn`;
return {
- title: showcase.title,
- alternates: { canonical: `/showcases/${showcase.slug}` },
+ title: clip.title,
+ alternates: { canonical: `/showcases/${clip.slug}` },
openGraph: {
type: "article",
- url: `/showcases/${showcase.slug}`,
+ url: `/showcases/${clip.slug}`,
siteName: "Remocn",
title,
locale: "en_US",
- images: [{ url: showcase.posterUrl, alt: showcase.title }],
+ images: [{ url: clip.poster, alt: clip.title }],
},
twitter: {
card: "summary_large_image",
title,
- images: [showcase.posterUrl],
+ images: [clip.poster],
},
};
}
+const NAV_BUTTON = cn(
+ landingButtonVariants({ variant: "secondary" }),
+ pageHeaderButton,
+);
+
export default async function ShowcasePage({ params }: PageProps) {
const { slug } = await params;
- const showcase = await getShowcase(slug);
- if (!showcase) notFound();
+ const found = await getClip(slug);
+ if (!found) notFound();
+ const { clip, index, count, prev, next } = found;
return (
- <section className="pt-10 pb-24 sm:pt-14">
- <div className="section flex flex-col gap-8">
- <Link
- href="/showcases"
- className="inline-flex w-fit items-center gap-1.5 text-sm font-medium text-muted-foreground transition-colors hover:text-foreground"
- >
- <ArrowLeft className="size-4" aria-hidden="true" />
+ <>
+ <header className="landing-container flex flex-col gap-5 pt-12 pb-8 md:pt-20 md:pb-12 xl:pt-24 xl:pb-12">
+ <Link href="/showcases" className={cn(NAV_BUTTON, "self-start")}>
+ <span aria-hidden="true" className="text-primary">
+ ←
+ </span>
Showcases
</Link>
+ <p className="pt-3 text-small text-muted-foreground tabular-nums">
+ Clip {String(index + 1).padStart(2, "0")} of {count},{" "}
+ {formatDuration(clip.start)} to{" "}
+ {formatDuration(clip.start + clip.duration)} on the reel
+ </p>
+ <h1 className="text-[40px] leading-[42px] tracking-heading text-balance text-foreground md:text-h2">
+ {clip.title}
+ </h1>
+ <p className="flex items-center gap-2.5">
+ {/* biome-ignore lint/performance/noImgElement: remote showcase avatars of arbitrary origin */}
+ <img
+ src={clip.author.avatarUrl}
+ alt=""
+ width={24}
+ height={24}
+ referrerPolicy="no-referrer"
+ className="size-6 shrink-0 rounded-full bg-muted object-cover"
+ />
+ {clip.author.url ? (
+ <a
+ href={clip.author.url}
+ target="_blank"
+ rel="noreferrer"
+ className="-mx-1 rounded-tag px-1 text-small text-body outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {clip.author.name}
+ </a>
+ ) : (
+ <span className="text-small text-body">{clip.author.name}</span>
+ )}
+ <time
+ dateTime={clip.iso}
+ className="text-caption text-muted-foreground"
+ >
+ {clip.dateLabel}
+ </time>
+ </p>
+ </header>
- <div className="flex flex-col gap-4">
- <h1 className="text-3xl font-semibold leading-tight tracking-tight text-foreground sm:text-4xl">
- {showcase.title}
- </h1>
- <div className="flex flex-wrap items-center justify-between gap-x-6 gap-y-3">
- <ShowcaseAuthor author={showcase.author} linked />
- {showcase.githubUrl ? (
- <Button
- variant="outline"
- className="h-9 gap-2 rounded-full px-4 text-sm"
- render={
- <Link
- href={showcase.githubUrl}
- target="_blank"
- rel="noreferrer"
- />
- }
- >
- <GitHubIcon data-icon="inline-start" className="size-4" />
- View source
- </Button>
- ) : null}
+ <div className="landing-container flex flex-col gap-6 pb-[72px] xl:flex-row xl:pb-section">
+ <div className="flex min-w-0 grow flex-col gap-6">
+ <div className="rounded-panel bg-dark-surface p-2.5 xl:rounded-shell dark:bg-surface dark:shadow-[0_0_0_1px_var(--hairline)]">
+ <ShowcaseVideo
+ src={clip.video}
+ poster={clip.poster}
+ label={clip.title}
+ />
</div>
+ <nav aria-label="Reel" className="flex justify-between gap-3">
+ {prev ? (
+ <Link
+ href={`/showcases/${prev.slug}`}
+ className={cn(NAV_BUTTON, "min-w-0 shrink")}
+ >
+ <span aria-hidden="true" className="text-muted-foreground">
+ ←
+ </span>
+ <span className="max-w-[24ch] min-w-0 truncate">
+ {prev.title}
+ </span>
+ </Link>
+ ) : (
+ <span />
+ )}
+ {next && (
+ <Link
+ href={`/showcases/${next.slug}`}
+ className={cn(NAV_BUTTON, "min-w-0 shrink")}
+ >
+ <span className="max-w-[24ch] min-w-0 truncate">
+ {next.title}
+ </span>
+ <span aria-hidden="true" className="text-muted-foreground">
+ →
+ </span>
+ </Link>
+ )}
+ </nav>
</div>
-
- <ShowcaseVideo src={showcase.videoUrl} poster={showcase.posterUrl} />
-
- <ShowcaseComponents components={showcase.components} />
+ <ShowcaseDetails clip={clip} />
</div>
- </section>
+ </>
);
}
diff --git a/app/(home)/showcases/components/reel/clip-list.tsx b/app/(home)/showcases/components/reel/clip-list.tsx
new file mode 100644
index 00000000..7c38ac57
--- /dev/null
+++ b/app/(home)/showcases/components/reel/clip-list.tsx
@@ -0,0 +1,168 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import type { ReelClip } from "../../lib/reel-types";
+
+/**
+ * Every clip with its in and out on the reel, what it was built with and
+ * its source. A row's thumbnail cues the clip in the editor above; the
+ * title opens the showcase. Below `xl` the rows hang off a vertical rail.
+ */
+export function ClipList({
+ clips,
+ index,
+ onSelect,
+}: {
+ clips: ReelClip[];
+ index: number;
+ onSelect: (index: number) => void;
+}) {
+ return (
+ <section
+ aria-labelledby="clip-list"
+ className="landing-container flex flex-col gap-7 py-[72px] xl:gap-0 xl:pt-24 xl:pb-section"
+ >
+ <div className="flex flex-col gap-2 xl:flex-row xl:items-end xl:justify-between xl:border-b xl:border-divider xl:pb-5">
+ <h2
+ id="clip-list"
+ className="text-[34px] leading-9 tracking-heading text-foreground xl:text-quote xl:tracking-title"
+ >
+ Clip list
+ </h2>
+ <p className="text-small text-muted-foreground">
+ in and out on the reel, built with, source
+ </p>
+ </div>
+
+ <ol className="relative flex flex-col gap-7 xl:gap-0">
+ <li
+ aria-hidden="true"
+ className="absolute top-[29px] bottom-[60px] left-[5px] w-0.5 bg-divider xl:hidden"
+ />
+ {clips.map((clip, i) => (
+ <ClipRow
+ key={clip.slug}
+ clip={clip}
+ number={String(i + 1).padStart(2, "0")}
+ selected={i === index}
+ onSelect={() => onSelect(i)}
+ />
+ ))}
+ </ol>
+ </section>
+ );
+}
+
+function ClipRow({
+ clip,
+ number,
+ selected,
+ onSelect,
+}: {
+ clip: ReelClip;
+ number: string;
+ selected: boolean;
+ onSelect: () => void;
+}) {
+ const [first, ...rest] = clip.components;
+ const range = `${formatDuration(clip.start)} to ${formatDuration(clip.start + clip.duration)}`;
+
+ return (
+ <li className="relative flex gap-3.5 xl:h-[84px] xl:items-center xl:gap-0 xl:border-b xl:border-divider">
+ {/* Rail dot (mobile) */}
+ <span className="flex w-3 shrink-0 justify-center pt-[23px] xl:hidden">
+ <span
+ className={cn(
+ "size-3 rounded-full border-2",
+ selected
+ ? "border-primary bg-primary"
+ : "border-subtle-line bg-background",
+ )}
+ />
+ </span>
+ <span
+ className={cn(
+ "hidden w-12 shrink-0 text-caption tabular-nums xl:block",
+ selected ? "text-primary" : "text-subtle",
+ )}
+ >
+ {number}
+ </span>
+
+ <div className="flex min-w-0 grow flex-col gap-3 xl:contents">
+ <div className="flex items-center gap-3 xl:contents">
+ <span className="shrink-0 xl:w-[136px]">
+ <button
+ type="button"
+ onClick={onSelect}
+ aria-label={`Cue ${clip.title} in the reel`}
+ className={cn(
+ "block h-[58px] w-[104px] overflow-hidden rounded-tile bg-dark-surface outline-none transition-shadow duration-150 focus-visible:ring-3 focus-visible:ring-ring",
+ selected && "shadow-[0_0_0_2px_var(--color-primary)]",
+ )}
+ >
+ {/* biome-ignore lint/performance/noImgElement: remote showcase posters of arbitrary origin */}
+ <img
+ src={clip.poster}
+ alt=""
+ loading="lazy"
+ className="size-full object-cover"
+ />
+ </button>
+ </span>
+ <div className="flex min-w-0 flex-col gap-1 xl:w-[400px] xl:shrink-0 xl:pr-6">
+ <span className="flex gap-2 text-caption tabular-nums xl:hidden">
+ <span className={selected ? "text-foreground" : "text-subtle"}>
+ {number}
+ </span>
+ <span className="text-muted-foreground">{range}</span>
+ </span>
+ <Link
+ href={`/showcases/${clip.slug}`}
+ className="-mx-1 w-fit rounded-tag px-1 text-[17px] leading-[22px] tracking-title text-foreground outline-none transition-colors hover:bg-muted focus-visible:ring-2 focus-visible:ring-ring xl:text-lead xl:leading-[26px]"
+ >
+ {clip.title}
+ </Link>
+ </div>
+ </div>
+
+ <div className="flex items-center justify-between gap-3 xl:contents">
+ <span className="flex min-w-0 items-center gap-2 xl:w-[240px] xl:shrink-0">
+ {first && (
+ <Link
+ href={first.href}
+ className="relative flex h-7 min-w-0 items-center rounded-tile border border-hairline bg-surface px-2.5 text-caption text-foreground outline-none transition-colors hover:bg-muted after:absolute after:inset-x-0 after:-inset-y-2 focus-visible:ring-2 focus-visible:ring-ring xl:border-0 xl:bg-surface-muted xl:hover:bg-secondary"
+ >
+ <span className="truncate">{first.name}</span>
+ </Link>
+ )}
+ {rest.length > 0 && (
+ <span className="shrink-0 text-caption text-subtle">
+ +{rest.length}
+ </span>
+ )}
+ </span>
+ <span className="hidden w-[180px] shrink-0 text-caption text-muted-foreground tabular-nums xl:block">
+ {range}
+ </span>
+ <span className="flex shrink-0 justify-end xl:grow">
+ {clip.githubUrl ? (
+ <a
+ href={clip.githubUrl}
+ target="_blank"
+ rel="noreferrer"
+ className="flex h-11 items-center rounded-control-sm bg-secondary px-4 text-small text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-3 focus-visible:ring-ring xl:h-8 xl:rounded-[10px] xl:px-3 dark:hover:bg-[#33363b]"
+ >
+ Source
+ </a>
+ ) : (
+ <span className="flex h-11 items-center text-small text-subtle xl:h-8">
+ No source
+ </span>
+ )}
+ </span>
+ </div>
+ </div>
+ </li>
+ );
+}
diff --git a/app/(home)/showcases/components/reel/inspector.tsx b/app/(home)/showcases/components/reel/inspector.tsx
new file mode 100644
index 00000000..ad4a9845
--- /dev/null
+++ b/app/(home)/showcases/components/reel/inspector.tsx
@@ -0,0 +1,133 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import { GitHubLogoIcon } from "../../../components/landing/ui/brand-icons";
+import { CopyTextButton } from "../../../components/site-page/copy-text-button";
+import { installCommand, type ReelClip } from "../../lib/reel-types";
+
+const BUTTON =
+ "inline-flex h-11 shrink-0 items-center justify-center gap-2 rounded-control px-2 text-[15px] leading-5 whitespace-nowrap xl:px-[18px] outline-none transition-[background-color,box-shadow,translate] duration-150 ease-out focus-visible:ring-3 focus-visible:ring-white/40 active:translate-y-px max-xl:flex-1";
+
+/**
+ * Details of the clip under the playhead: where it sits on the reel, who
+ * made it, the components it was built with and how to install them.
+ */
+export function Inspector({
+ clip,
+ number,
+ count,
+}: {
+ clip: ReelClip;
+ number: string;
+ count: number;
+}) {
+ const command = installCommand(clip);
+
+ return (
+ <div className="flex min-w-0 grow flex-col justify-between gap-5 px-1.5 pt-1.5 pb-2 xl:gap-6 xl:px-1 xl:pt-2 xl:pb-1">
+ <div className="flex flex-col gap-2.5 xl:gap-3.5">
+ <p className="text-caption text-dark-subtle tabular-nums">
+ {number} of {count}, {formatDuration(clip.start)} to{" "}
+ {formatDuration(clip.start + clip.duration)}
+ </p>
+ <h2 className="text-[28px] leading-8 tracking-heading text-[#fafafa] text-balance xl:text-[36px] xl:leading-10">
+ {clip.title}
+ </h2>
+ <p className="flex items-center gap-2.5">
+ {/* biome-ignore lint/performance/noImgElement: remote showcase avatars of arbitrary origin */}
+ <img
+ src={clip.author.avatarUrl}
+ alt=""
+ width={24}
+ height={24}
+ loading="lazy"
+ referrerPolicy="no-referrer"
+ className="size-6 shrink-0 rounded-full bg-dark-raised object-cover"
+ />
+ {clip.author.url ? (
+ <a
+ href={clip.author.url}
+ target="_blank"
+ rel="noreferrer"
+ className="-mx-1 rounded-tag px-1 text-small text-dark-body outline-none transition-colors hover:bg-white/8 hover:text-white focus-visible:ring-2 focus-visible:ring-white/40"
+ >
+ {clip.author.name}
+ </a>
+ ) : (
+ <span className="text-small text-dark-body">
+ {clip.author.name}
+ </span>
+ )}
+ <time dateTime={clip.iso} className="text-caption text-dark-subtle">
+ {clip.dateLabel}
+ </time>
+ </p>
+ </div>
+
+ <div className="flex flex-col gap-2.5">
+ {clip.components.length > 0 && (
+ <>
+ <p className="text-caption text-dark-subtle">Built with</p>
+ <ul className="flex flex-wrap gap-2">
+ {clip.components.map((component) => (
+ <li key={`${component.name}-${component.href}`}>
+ <Link
+ href={component.href}
+ className={cn(
+ "relative flex h-9 items-center rounded-control-sm bg-dark-raised px-3 text-[#fafafa] outline-none transition-colors hover:bg-[#25282b] after:absolute after:inset-x-0 after:-inset-y-1 focus-visible:ring-2 focus-visible:ring-white/40",
+ component.registryName
+ ? "font-mono text-mono"
+ : "text-caption",
+ )}
+ >
+ {component.registryName ?? component.name}
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </>
+ )}
+ {command && (
+ <div className="flex h-12 items-center gap-2 rounded-control bg-dark-raised pr-1.5 pl-3.5 xl:pl-4">
+ <code className="min-w-0 grow truncate font-mono text-mono text-[#fafafa] xl:text-caption">
+ {command}
+ </code>
+ <CopyTextButton
+ text={command}
+ installComponent={clip.components[0]?.registryName ?? undefined}
+ aria-label="Copy install command"
+ className="relative flex h-9 shrink-0 items-center rounded-[10px] bg-[#2a2e31] px-3 text-small text-[#fafafa] outline-none transition-colors after:absolute after:inset-x-0 after:-inset-y-1 hover:bg-[#33373a] focus-visible:ring-2 focus-visible:ring-white/40"
+ >
+ Copy
+ </CopyTextButton>
+ </div>
+ )}
+ <div className="flex gap-2 pt-1.5 xl:gap-2.5 xl:pt-2.5">
+ <Link
+ href={`/showcases/${clip.slug}`}
+ className={cn(BUTTON, "bg-white text-[#0e1012] hover:bg-[#ececee]")}
+ >
+ Open showcase
+ <span aria-hidden="true" className="text-primary">
+ →
+ </span>
+ </Link>
+ {clip.githubUrl && (
+ <a
+ href={clip.githubUrl}
+ target="_blank"
+ rel="noreferrer"
+ className={cn(
+ BUTTON,
+ "bg-[#25282b] text-[#fafafa] hover:bg-[#2e3236]",
+ )}
+ >
+ <GitHubLogoIcon className="size-4" />
+ View source
+ </a>
+ )}
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/showcases/components/reel/monitor.tsx b/app/(home)/showcases/components/reel/monitor.tsx
new file mode 100644
index 00000000..fffce751
--- /dev/null
+++ b/app/(home)/showcases/components/reel/monitor.tsx
@@ -0,0 +1,44 @@
+import type { RefObject, SyntheticEvent } from "react";
+import { formatDuration } from "@/lib/video-duration";
+import type { ReelClip } from "../../lib/reel-types";
+
+/** The selected clip on screen, with its position in the reel. */
+export function Monitor({
+ clip,
+ number,
+ time,
+ videoRef,
+ videoProps,
+ onToggle,
+}: {
+ clip: ReelClip;
+ number: string;
+ time: number;
+ videoRef: RefObject<HTMLVideoElement | null>;
+ videoProps: {
+ onLoadedMetadata: () => void;
+ onEnded: () => void;
+ onTimeUpdate: (event: SyntheticEvent<HTMLVideoElement>) => void;
+ };
+ onToggle: () => void;
+}) {
+ return (
+ <div className="relative aspect-video w-full shrink-0 overflow-hidden rounded-[14px] bg-dark-raised md:rounded-cta xl:h-[405px] xl:w-[720px]">
+ <video
+ ref={videoRef}
+ src={clip.video}
+ poster={clip.poster}
+ aria-label={clip.title}
+ playsInline
+ preload="metadata"
+ onClick={onToggle}
+ className="size-full cursor-pointer object-cover"
+ {...videoProps}
+ />
+ <span className="pointer-events-none absolute top-2.5 left-2.5 flex h-6 items-center gap-1.5 rounded-tag bg-[#0e1012b8] px-2 text-caption text-[#fafafa] tabular-nums md:top-3 md:left-3">
+ <span className="size-1.5 rounded-full bg-primary-bright" />
+ clip {number}, {formatDuration(time)} / {formatDuration(clip.duration)}
+ </span>
+ </div>
+ );
+}
diff --git a/app/(home)/showcases/components/reel/showcase-reel.tsx b/app/(home)/showcases/components/reel/showcase-reel.tsx
new file mode 100644
index 00000000..101f6a35
--- /dev/null
+++ b/app/(home)/showcases/components/reel/showcase-reel.tsx
@@ -0,0 +1,76 @@
+"use client";
+
+import { useCallback } from "react";
+import type { Reel } from "../../lib/reel-types";
+import { ClipList } from "./clip-list";
+import { Inspector } from "./inspector";
+import { Monitor } from "./monitor";
+import { Timeline } from "./timeline";
+import { useReelPlayer } from "./use-reel-player";
+
+/**
+ * The showcases editor: monitor and inspector over the reel timeline, and
+ * the clip list under it. All clips play back to back through one player.
+ */
+export function ShowcaseReel({ reel }: { reel: Reel }) {
+ const player = useReelPlayer(reel.clips);
+ const number = String(player.index + 1).padStart(2, "0");
+ const { select } = player;
+
+ // Cueing from the list brings the editor back into view.
+ const cueFromList = useCallback(
+ (index: number) => {
+ select(index);
+ document.getElementById("reel-editor")?.scrollIntoView({
+ block: "start",
+ behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches
+ ? "auto"
+ : "smooth",
+ });
+ },
+ [select],
+ );
+
+ return (
+ <>
+ <section
+ id="reel-editor"
+ aria-label="Showcase reel"
+ className="landing-container scroll-mt-6"
+ >
+ <div className="flex flex-col gap-3 rounded-panel bg-dark-surface p-2.5 md:gap-6 md:p-6 xl:rounded-shell dark:bg-surface dark:shadow-[0_0_0_1px_var(--hairline)]">
+ <div className="flex flex-col gap-3 md:gap-6 xl:flex-row">
+ <Monitor
+ clip={player.clip}
+ number={number}
+ time={player.time}
+ videoRef={player.videoRef}
+ videoProps={player.videoProps}
+ onToggle={player.toggle}
+ />
+ <Inspector
+ clip={player.clip}
+ number={number}
+ count={reel.clips.length}
+ />
+ </div>
+ <Timeline
+ reel={reel}
+ index={player.index}
+ reelTime={player.reelTime}
+ playing={player.playing}
+ onToggle={player.toggle}
+ onSelect={select}
+ onSeek={player.seek}
+ />
+ </div>
+ </section>
+
+ <ClipList
+ clips={reel.clips}
+ index={player.index}
+ onSelect={cueFromList}
+ />
+ </>
+ );
+}
diff --git a/app/(home)/showcases/components/reel/timeline.tsx b/app/(home)/showcases/components/reel/timeline.tsx
new file mode 100644
index 00000000..55ae545d
--- /dev/null
+++ b/app/(home)/showcases/components/reel/timeline.tsx
@@ -0,0 +1,283 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import {
+ PauseGlyph,
+ PlayGlyph,
+} from "../../../components/site-page/play-glyph";
+import type { Reel } from "../../lib/reel-types";
+import { SUBMIT_SHOWCASE_URL } from "../showcases-header";
+
+/** Thumbnail strip scale: 2px per second, like the editor's zoomed-in view. */
+const STRIP_PX_PER_SECOND = 2;
+const STRIP_MIN_WIDTH = 40;
+const LABEL_STEPS_MIN = [1, 2, 5, 10, 15, 30, 60];
+/** Minimum px between ruler labels. */
+const LABEL_GAP = 96;
+const LABEL_GAP_COMPACT = 44;
+/** Room kept free at the ruler end (for the total, shown from `md`). */
+const END_GAP = 72;
+const END_GAP_COMPACT = 36;
+const COMPACT_RULER = 400;
+
+const LABEL_COLUMN = "w-[146px] shrink-0 pr-2 md:w-[150px]";
+
+/**
+ * Reel timeline: play key and time, a ruler with the playhead, the clip
+ * strip (scrolls), and one row per most-used component showing which clips
+ * used it. Ruler and rows fit the whole reel into the available width.
+ */
+export function Timeline({
+ reel,
+ index,
+ reelTime,
+ playing,
+ onToggle,
+ onSelect,
+ onSeek,
+}: {
+ reel: Reel;
+ index: number;
+ reelTime: number;
+ playing: boolean;
+ onToggle: () => void;
+ onSelect: (index: number) => void;
+ onSeek: (seconds: number) => void;
+}) {
+ const { clips, total, tracks } = reel;
+ const clip = clips[index];
+ const rulerRef = useRef<HTMLDivElement>(null);
+ const stripRef = useRef<HTMLDivElement>(null);
+ const [rulerWidth, setRulerWidth] = useState(0);
+ const pct = (seconds: number) => `${(seconds / total) * 100}%`;
+
+ useEffect(() => {
+ const ruler = rulerRef.current;
+ if (!ruler) return;
+ const observer = new ResizeObserver(([entry]) =>
+ setRulerWidth(entry.contentRect.width),
+ );
+ observer.observe(ruler);
+ return () => observer.disconnect();
+ }, []);
+
+ // Keep the selected clip inside the strip's visible window.
+ useEffect(() => {
+ const strip = stripRef.current;
+ const thumb = strip?.querySelector<HTMLElement>(`[data-clip="${index}"]`);
+ if (!strip || !thumb) return;
+ const left = thumb.offsetLeft - strip.offsetLeft;
+ const right = left + thumb.offsetWidth;
+ if (
+ left < strip.scrollLeft ||
+ right > strip.scrollLeft + strip.clientWidth
+ ) {
+ strip.scrollTo({
+ left: left - strip.clientWidth / 3,
+ behavior: window.matchMedia("(prefers-reduced-motion: reduce)").matches
+ ? "auto"
+ : "smooth",
+ });
+ }
+ }, [index]);
+
+ const compact = rulerWidth > 0 && rulerWidth < COMPACT_RULER;
+ const gap = compact ? LABEL_GAP_COMPACT : LABEL_GAP;
+ const step =
+ LABEL_STEPS_MIN.find(
+ (minutes) =>
+ rulerWidth === 0 || (minutes * 60 * rulerWidth) / total >= gap,
+ ) ?? 60;
+ const labels: number[] = [];
+ const endRoom =
+ rulerWidth > 0
+ ? ((compact ? END_GAP_COMPACT : END_GAP) / rulerWidth) * total
+ : 0;
+ for (let t = 0; t < total - endRoom; t += step * 60) labels.push(t);
+
+ return (
+ <div className="relative flex flex-col gap-2.5 overflow-hidden rounded-cta bg-dark-raised p-3 md:gap-1.5 md:rounded-capsule">
+ {/* Transport + ruler */}
+ <div className="flex h-9 items-center md:h-10">
+ <div className={cn(LABEL_COLUMN, "flex items-center gap-2.5")}>
+ <button
+ type="button"
+ onClick={onToggle}
+ aria-label={playing ? "Pause the reel" : "Play the reel"}
+ className="relative flex size-9 shrink-0 items-center justify-center rounded-[9px] bg-[#fafafa] outline-none transition-[background-color,translate] duration-150 ease-out after:absolute after:-inset-1 hover:bg-white focus-visible:ring-3 focus-visible:ring-white/40 active:translate-y-px md:size-8"
+ >
+ {playing ? <PauseGlyph /> : <PlayGlyph />}
+ </button>
+ <span className="text-caption text-[#fafafa] tabular-nums">
+ {formatDuration(reelTime)}
+ </span>
+ </div>
+ <div
+ ref={rulerRef}
+ className="relative h-8 min-w-0 grow rounded-tile bg-[#25282b] md:h-10 md:rounded-[10px]"
+ >
+ {labels.map((t) => (
+ <span
+ key={t}
+ aria-hidden="true"
+ className="absolute top-2 ml-1 text-caption text-dark-body tabular-nums md:top-3 md:ml-2"
+ style={{ left: pct(t) }}
+ >
+ {formatDuration(t)}
+ </span>
+ ))}
+ <span
+ aria-hidden="true"
+ className="absolute top-2 right-2 hidden text-caption text-dark-subtle tabular-nums md:top-3 md:block"
+ >
+ {formatDuration(total)}
+ </span>
+ <span
+ aria-hidden="true"
+ className="absolute top-0 h-3.5 w-3 -translate-x-1/2 rounded-t-[3px] rounded-b-md bg-primary-soft"
+ style={{ left: pct(reelTime) }}
+ />
+ <input
+ type="range"
+ min={0}
+ max={total}
+ step={1}
+ value={reelTime}
+ aria-label="Position on the reel"
+ aria-valuetext={`${formatDuration(reelTime)} of ${formatDuration(total)}`}
+ onChange={(event) => onSeek(Number(event.currentTarget.value))}
+ className="seek-range absolute inset-0 size-full rounded-[inherit] opacity-0 focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60"
+ />
+ </div>
+ </div>
+
+ {/* Clip strip */}
+ <div className="flex flex-col gap-2 md:h-16 md:flex-row md:items-center md:gap-0">
+ <div
+ className={cn(
+ LABEL_COLUMN,
+ "flex items-baseline gap-2 md:flex-col md:gap-0.5",
+ )}
+ >
+ <span className="text-small text-[#fafafa]">Showcases</span>
+ <span className="text-caption text-dark-subtle">
+ {clips.length} clips
+ </span>
+ </div>
+ <div
+ ref={stripRef}
+ className="relative flex min-w-0 grow gap-[3px] overflow-x-auto p-[3px] [scrollbar-width:none] md:gap-0.5 [&::-webkit-scrollbar]:hidden"
+ >
+ {clips.map((item, i) => (
+ <button
+ key={item.slug}
+ type="button"
+ data-clip={i}
+ onClick={() => onSelect(i)}
+ aria-label={`Cue ${item.title}`}
+ aria-current={i === index ? "true" : undefined}
+ className={cn(
+ "h-14 shrink-0 overflow-hidden rounded-tag bg-dark-surface outline-none transition-[box-shadow,opacity] duration-150 focus-visible:ring-2 focus-visible:ring-white/60",
+ i === index
+ ? "shadow-[0_0_0_2px_var(--color-primary-soft)]"
+ : "opacity-80 hover:opacity-100",
+ )}
+ style={{
+ width: Math.max(
+ STRIP_MIN_WIDTH,
+ Math.round(item.duration * STRIP_PX_PER_SECOND),
+ ),
+ }}
+ >
+ {/* biome-ignore lint/performance/noImgElement: remote showcase posters of arbitrary origin */}
+ <img
+ src={item.poster}
+ alt=""
+ loading="lazy"
+ className="size-full object-cover"
+ />
+ </button>
+ ))}
+ <a
+ href={SUBMIT_SHOWCASE_URL}
+ className="flex h-14 w-24 shrink-0 items-center justify-center gap-1.5 rounded-tag border border-dashed border-white/22 text-caption text-dark-body outline-none transition-colors hover:bg-white/5 focus-visible:ring-2 focus-visible:ring-white/60 md:w-[84px]"
+ >
+ <span aria-hidden="true" className="text-ui text-primary-soft">
+ +
+ </span>
+ Your video
+ </a>
+ </div>
+ </div>
+
+ {/* Component rows */}
+ {tracks.length > 0 && (
+ <ul
+ aria-label="Most used components"
+ className="relative flex flex-col gap-0.5 border-t border-dark-border pt-1.5"
+ >
+ <li
+ aria-hidden="true"
+ className="pointer-events-none absolute inset-y-0 right-0 left-[146px] md:left-[150px]"
+ >
+ <span
+ className="absolute inset-y-0 w-0.5 -translate-x-1/2 bg-primary-soft"
+ style={{ left: pct(reelTime) }}
+ />
+ </li>
+ {tracks.map((track) => {
+ const lit = clip.components.some((c) => c.name === track.name);
+ return (
+ <li key={track.name} className="flex h-7 items-center">
+ <span
+ className={cn(
+ LABEL_COLUMN,
+ "flex justify-between gap-2 text-caption md:pr-3.5",
+ )}
+ >
+ <span
+ className={cn(
+ "truncate",
+ lit ? "text-[#fafafa]" : "text-dark-body",
+ )}
+ >
+ {track.name}
+ </span>
+ <span
+ className={cn(
+ "tabular-nums",
+ lit
+ ? "text-dark-body md:text-primary-soft"
+ : "text-dark-subtle",
+ )}
+ >
+ {track.count}
+ </span>
+ </span>
+ <span aria-hidden="true" className="relative h-7 min-w-0 grow">
+ {clips.map((item, i) =>
+ item.components.some((c) => c.name === track.name) ? (
+ <span
+ key={item.slug}
+ className={cn(
+ "absolute top-[7px] h-3.5 min-w-[3px] rounded-[3px] md:top-1.5 md:h-4 md:rounded-sm",
+ i === index ? "bg-primary-bright" : "bg-white/14",
+ )}
+ style={{
+ left: pct(item.start),
+ width: `calc(${pct(item.duration)} - 2px)`,
+ }}
+ />
+ ) : null,
+ )}
+ </span>
+ </li>
+ );
+ })}
+ </ul>
+ )}
+ </div>
+ );
+}
diff --git a/app/(home)/showcases/components/reel/use-reel-player.ts b/app/(home)/showcases/components/reel/use-reel-player.ts
new file mode 100644
index 00000000..e284b946
--- /dev/null
+++ b/app/(home)/showcases/components/reel/use-reel-player.ts
@@ -0,0 +1,119 @@
+"use client";
+
+import {
+ type SyntheticEvent,
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+} from "react";
+import type { ReelClip } from "../../lib/reel-types";
+
+/**
+ * Plays the reel through one <video>: the selected clip, its time, and the
+ * play intent that carries across clips (a clip ending starts the next one).
+ */
+export function useReelPlayer(clips: ReelClip[]) {
+ const videoRef = useRef<HTMLVideoElement>(null);
+ const [index, setIndex] = useState(0);
+ const [time, setTime] = useState(0);
+ const [playing, setPlaying] = useState(false);
+ const playingRef = useRef(false);
+ const pendingSeek = useRef(0);
+
+ const setIntent = useCallback((value: boolean) => {
+ playingRef.current = value;
+ setPlaying(value);
+ }, []);
+
+ const play = useCallback(() => {
+ const video = videoRef.current;
+ if (!video) return;
+ video.play().catch(() => setIntent(false));
+ }, [setIntent]);
+
+ /** Jump to clip `next`, `at` seconds in. */
+ const select = useCallback(
+ (next: number, at = 0) => {
+ const video = videoRef.current;
+ setTime(at);
+ if (next === index && video) {
+ video.currentTime = at;
+ return;
+ }
+ pendingSeek.current = at;
+ setIndex(next);
+ },
+ [index],
+ );
+
+ /** Jump to a position on the whole reel. */
+ const seek = useCallback(
+ (seconds: number) => {
+ const target = clips.findIndex(
+ (clip) => seconds < clip.start + clip.duration,
+ );
+ const next = target === -1 ? clips.length - 1 : target;
+ select(next, Math.max(0, seconds - clips[next].start));
+ },
+ [clips, select],
+ );
+
+ const toggle = useCallback(() => {
+ const video = videoRef.current;
+ if (!video) return;
+ if (playingRef.current) {
+ setIntent(false);
+ video.pause();
+ } else {
+ setIntent(true);
+ play();
+ }
+ }, [play, setIntent]);
+
+ // A new clip's source is in: restore the requested offset, keep playing.
+ const onLoadedMetadata = useCallback(() => {
+ const video = videoRef.current;
+ if (!video) return;
+ if (pendingSeek.current > 0) video.currentTime = pendingSeek.current;
+ pendingSeek.current = 0;
+ if (playingRef.current) play();
+ }, [play]);
+
+ const onEnded = useCallback(() => {
+ if (index < clips.length - 1) select(index + 1);
+ else setIntent(false);
+ }, [clips.length, index, select, setIntent]);
+
+ // Never keep playing in a background tab or behind a closed lid.
+ useEffect(() => {
+ const onHide = () => {
+ if (document.hidden && playingRef.current) {
+ setIntent(false);
+ videoRef.current?.pause();
+ }
+ };
+ document.addEventListener("visibilitychange", onHide);
+ return () => document.removeEventListener("visibilitychange", onHide);
+ }, [setIntent]);
+
+ const clip = clips[index];
+
+ return {
+ videoRef,
+ index,
+ clip,
+ time,
+ reelTime: clip.start + time,
+ playing,
+ select,
+ seek,
+ toggle,
+ videoProps: {
+ onLoadedMetadata,
+ onEnded,
+ onTimeUpdate: (event: SyntheticEvent<HTMLVideoElement>) =>
+ setTime(event.currentTarget.currentTime),
+ },
+ };
+}
diff --git a/app/(home)/showcases/components/showcase-author.tsx b/app/(home)/showcases/components/showcase-author.tsx
deleted file mode 100644
index 01528496..00000000
--- a/app/(home)/showcases/components/showcase-author.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import type { Showcase } from "@/lib/showcases";
-import { cn } from "@/lib/utils";
-
-export function ShowcaseAuthor({
- author,
- linked = false,
- className,
-}: {
- author: Showcase["author"];
- linked?: boolean;
- className?: string;
-}) {
- const body = (
- <>
- {/** biome-ignore lint/performance/noImgElement: remote showcase avatars of arbitrary origin */}
- <img
- src={author.avatarUrl}
- alt=""
- width={24}
- height={24}
- loading="lazy"
- referrerPolicy="no-referrer"
- className="size-6 shrink-0 rounded-full bg-muted object-cover"
- />
- <span className="truncate">{author.name}</span>
- </>
- );
-
- const shared = cn(
- "inline-flex min-w-0 items-center gap-2 text-sm text-muted-foreground",
- className,
- );
-
- if (linked && author.url) {
- return (
- <a
- href={author.url}
- target="_blank"
- rel="noreferrer"
- className={cn(shared, "transition-colors hover:text-foreground")}
- >
- {body}
- </a>
- );
- }
-
- return <span className={shared}>{body}</span>;
-}
diff --git a/app/(home)/showcases/components/showcase-components.tsx b/app/(home)/showcases/components/showcase-components.tsx
deleted file mode 100644
index e12bfe3c..00000000
--- a/app/(home)/showcases/components/showcase-components.tsx
+++ /dev/null
@@ -1,54 +0,0 @@
-import { ArrowUpRight } from "lucide-react";
-import Link from "next/link";
-import type { ShowcaseComponent } from "@/lib/showcases";
-
-const chipClassName =
- "inline-flex items-center gap-1.5 rounded-full border border-border bg-muted px-3 py-1.5 text-sm font-medium text-foreground transition-colors hover:border-foreground/20";
-
-function ComponentChip({ component }: { component: ShowcaseComponent }) {
- if (component.url.startsWith("/")) {
- return (
- <Link href={component.url} className={chipClassName}>
- {component.name}
- </Link>
- );
- }
-
- return (
- <a
- href={component.url}
- target="_blank"
- rel="noreferrer"
- className={chipClassName}
- >
- {component.name}
- <ArrowUpRight
- className="size-3.5 text-muted-foreground"
- aria-hidden="true"
- />
- </a>
- );
-}
-
-export function ShowcaseComponents({
- components,
-}: {
- components: ShowcaseComponent[];
-}) {
- if (components.length === 0) return null;
-
- return (
- <section className="flex flex-col gap-3">
- <h2 className="text-sm font-semibold text-muted-foreground">
- Built with
- </h2>
- <ul className="flex flex-wrap gap-2">
- {components.map((component) => (
- <li key={`${component.name}-${component.url}`}>
- <ComponentChip component={component} />
- </li>
- ))}
- </ul>
- </section>
- );
-}
diff --git a/app/(home)/showcases/components/showcase-details.tsx b/app/(home)/showcases/components/showcase-details.tsx
new file mode 100644
index 00000000..f96dd014
--- /dev/null
+++ b/app/(home)/showcases/components/showcase-details.tsx
@@ -0,0 +1,74 @@
+import Link from "next/link";
+import { cn } from "@/lib/utils";
+import { GitHubLogoIcon } from "../../components/landing/ui/brand-icons";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+import { CopyTextButton } from "../../components/site-page/copy-text-button";
+import { pageHeaderButton } from "../../components/site-page/page-header";
+import { installCommand, type ReelClip } from "../lib/reel-types";
+
+/** Side card of a showcase page: components, install command, source. */
+export function ShowcaseDetails({ clip }: { clip: ReelClip }) {
+ const command = installCommand(clip);
+
+ return (
+ <aside className="flex flex-col gap-5 rounded-card bg-surface-muted p-5 md:p-6 xl:w-[396px] xl:shrink-0 xl:self-start">
+ {clip.components.length > 0 && (
+ <div className="flex flex-col gap-2.5">
+ <p className="text-caption text-muted-foreground">Built with</p>
+ <ul className="flex flex-wrap gap-2">
+ {clip.components.map((component) => (
+ <li key={`${component.name}-${component.href}`}>
+ <Link
+ href={component.href}
+ className={cn(
+ "relative flex h-8 items-center rounded-tile bg-surface px-2.5 text-foreground shadow-[0_0_0_1px_var(--hairline)] outline-none transition-colors after:absolute after:inset-x-0 after:-inset-y-1 hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring",
+ component.registryName
+ ? "font-mono text-mono"
+ : "text-caption",
+ )}
+ >
+ {component.registryName ?? component.name}
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+
+ {command && (
+ <div className="flex h-12 items-center gap-2 rounded-control bg-surface pr-1.5 pl-4 shadow-[0_0_0_1px_var(--hairline)]">
+ <code className="min-w-0 grow truncate font-mono text-mono text-foreground">
+ {command}
+ </code>
+ <CopyTextButton
+ text={command}
+ installComponent={clip.components[0]?.registryName ?? undefined}
+ aria-label="Copy install command"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ "relative h-9 rounded-[10px] px-3 text-small after:absolute after:inset-x-0 after:-inset-y-1",
+ )}
+ >
+ Copy
+ </CopyTextButton>
+ </div>
+ )}
+
+ {clip.githubUrl && (
+ <a
+ href={clip.githubUrl}
+ target="_blank"
+ rel="noreferrer"
+ className={cn(
+ landingButtonVariants({ variant: "ink" }),
+ pageHeaderButton,
+ "self-start",
+ )}
+ >
+ <GitHubLogoIcon className="size-4" />
+ View source
+ </a>
+ )}
+ </aside>
+ );
+}
diff --git a/app/(home)/showcases/components/showcase-grid.tsx b/app/(home)/showcases/components/showcase-grid.tsx
deleted file mode 100644
index 0fd4b8c9..00000000
--- a/app/(home)/showcases/components/showcase-grid.tsx
+++ /dev/null
@@ -1,129 +0,0 @@
-"use client";
-
-import Link from "next/link";
-import { useEffect, useRef, useState } from "react";
-import type { Showcase } from "@/lib/showcases";
-import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
-import { ShowcaseAuthor } from "./showcase-author";
-import { useHoverCapable } from "./use-hover-capable";
-
-const ACTIVE_THRESHOLD = 0.5;
-
-export function ShowcaseGrid({ showcases }: { showcases: Showcase[] }) {
- const containerRef = useRef<HTMLDivElement>(null);
- const hoverCapable = useHoverCapable();
- const reducedMotion = usePrefersReducedMotion();
- const [hoveredSlug, setHoveredSlug] = useState<string | null>(null);
- const [visibleSlug, setVisibleSlug] = useState<string | null>(null);
-
- useEffect(() => {
- const root = containerRef.current;
- if (!root || hoverCapable || typeof IntersectionObserver === "undefined") {
- return;
- }
-
- const ratios = new Map<string, number>();
- const observer = new IntersectionObserver(
- (records) => {
- for (const record of records) {
- const slug = record.target.getAttribute("data-showcase-slug");
- if (slug) ratios.set(slug, record.intersectionRatio);
- }
- let best: string | null = null;
- let bestRatio = ACTIVE_THRESHOLD;
- for (const [slug, ratio] of ratios) {
- if (ratio > bestRatio) {
- bestRatio = ratio;
- best = slug;
- }
- }
- setVisibleSlug(best);
- },
- { threshold: [0, 0.25, 0.5, 0.75, 1] },
- );
-
- for (const frame of root.querySelectorAll("[data-showcase-slug]")) {
- observer.observe(frame);
- }
- return () => observer.disconnect();
- }, [hoverCapable]);
-
- const playingSlug = hoverCapable ? hoveredSlug : visibleSlug;
-
- return (
- <div
- ref={containerRef}
- className="grid gap-x-6 gap-y-10 sm:grid-cols-2 lg:grid-cols-3"
- >
- {showcases.map((showcase) => (
- <ShowcaseCard
- key={showcase.slug}
- showcase={showcase}
- playing={!reducedMotion && showcase.slug === playingSlug}
- onHover={(hovered) =>
- setHoveredSlug((prev) =>
- hovered ? showcase.slug : prev === showcase.slug ? null : prev,
- )
- }
- />
- ))}
- </div>
- );
-}
-
-function ShowcaseCard({
- showcase,
- playing,
- onHover,
-}: {
- showcase: Showcase;
- playing: boolean;
- onHover: (hovered: boolean) => void;
-}) {
- const videoRef = useRef<HTMLVideoElement>(null);
-
- useEffect(() => {
- const video = videoRef.current;
- if (!video) return;
- if (playing) {
- void video.play().catch(() => {});
- return;
- }
- video.pause();
- video.currentTime = 0;
- }, [playing]);
-
- return (
- <Link
- href={`/showcases/${showcase.slug}`}
- onPointerEnter={() => onHover(true)}
- onPointerLeave={() => onHover(false)}
- onFocus={() => onHover(true)}
- onBlur={() => onHover(false)}
- className="group flex min-w-0 flex-col gap-4 focus-visible:outline-none"
- >
- <div
- data-showcase-slug={showcase.slug}
- className="surface-card aspect-video w-full overflow-hidden rounded-2xl transition-[box-shadow] duration-150 ease-out group-hover:[box-shadow:var(--elevation-raised-hover)] group-focus-visible:[box-shadow:var(--elevation-raised-highlighted)]"
- >
- <video
- ref={videoRef}
- src={showcase.videoUrl}
- poster={showcase.posterUrl}
- muted
- loop
- playsInline
- preload="none"
- className="size-full object-cover"
- />
- </div>
-
- <div className="flex min-w-0 flex-col gap-2">
- <h2 className="text-base font-medium leading-snug text-foreground">
- {showcase.title}
- </h2>
- <ShowcaseAuthor author={showcase.author} />
- </div>
- </Link>
- );
-}
diff --git a/app/(home)/showcases/components/showcase-video.tsx b/app/(home)/showcases/components/showcase-video.tsx
index e5db7d11..1e864a57 100644
--- a/app/(home)/showcases/components/showcase-video.tsx
+++ b/app/(home)/showcases/components/showcase-video.tsx
@@ -1,21 +1,22 @@
"use client";
-import { useEffect, useRef, useState } from "react";
-import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
-import { useHoverCapable } from "./use-hover-capable";
+import { useEffect, useRef } from "react";
+import { useLoopControls } from "../../components/site-page/use-loop-controls";
export function ShowcaseVideo({
src,
poster,
+ label,
}: {
src: string;
poster: string;
+ label: string;
}) {
const videoRef = useRef<HTMLVideoElement>(null);
- const reducedMotion = usePrefersReducedMotion();
- const hoverCapable = useHoverCapable();
- const [hovered, setHovered] = useState(false);
+ const { reducedMotion, videoProps } = useLoopControls();
+ // Loops only while on screen, and comes back only if it was playing when
+ // it left; reduced motion leaves it on the poster.
useEffect(() => {
const video = videoRef.current;
if (!video) return;
@@ -23,23 +24,35 @@ export function ShowcaseVideo({
video.pause();
return;
}
- void video.play().catch(() => {});
+ let resume = true;
+ let visible = false;
+ const observer = new IntersectionObserver(([entry]) => {
+ if (entry.isIntersecting) {
+ visible = true;
+ if (resume) void video.play().catch(() => {});
+ } else if (visible) {
+ visible = false;
+ resume = !video.paused;
+ video.pause();
+ }
+ });
+ observer.observe(video);
+ return () => observer.disconnect();
}, [reducedMotion]);
return (
- <div className="surface-card aspect-video w-full overflow-hidden rounded-2xl">
+ <div className="aspect-video w-full overflow-hidden rounded-[14px] bg-dark-raised md:rounded-cta">
<video
ref={videoRef}
src={src}
poster={poster}
- controls={!hoverCapable || hovered || reducedMotion}
- onPointerEnter={() => setHovered(true)}
- onPointerLeave={() => setHovered(false)}
+ aria-label={label}
muted
loop
playsInline
preload="metadata"
- className="size-full object-cover"
+ className="size-full object-cover outline-none focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-white/60"
+ {...videoProps}
/>
</div>
);
diff --git a/app/(home)/showcases/components/showcases-header.tsx b/app/(home)/showcases/components/showcases-header.tsx
new file mode 100644
index 00000000..707b9f5b
--- /dev/null
+++ b/app/(home)/showcases/components/showcases-header.tsx
@@ -0,0 +1,63 @@
+import { SUPPORT_EMAIL } from "@/config/site";
+import { cn } from "@/lib/utils";
+import { formatDuration } from "@/lib/video-duration";
+import { landingButtonVariants } from "../../components/landing/ui/landing-button";
+import {
+ pageHeaderButton,
+ SitePageHeader,
+} from "../../components/site-page/page-header";
+
+export const SHOWCASES_DESCRIPTION =
+ "Videos made with remocn, real products and launches, animated with copy-paste Remotion components. Scrub the reel, see which blocks each one used.";
+
+/** Where new showcase videos are sent until there is a submission form. */
+export const SUBMIT_SHOWCASE_URL = `mailto:${SUPPORT_EMAIL}?subject=${encodeURIComponent("Showcase submission")}`;
+
+const BUTTON = "max-xl:h-12 max-xl:flex-1";
+
+export function ShowcasesHeader({
+ clips,
+ total,
+}: {
+ clips: number;
+ total: number;
+}) {
+ return (
+ <SitePageHeader
+ eyebrow={`Showcases, ${clips} clips, ${formatDuration(total)} total`}
+ title="Made with remocn."
+ continuation="Every launch on one timeline."
+ lead={SHOWCASES_DESCRIPTION}
+ className="xl:pt-24 xl:pb-12"
+ >
+ <div className="flex gap-2.5">
+ <a
+ href={SUBMIT_SHOWCASE_URL}
+ className={cn(
+ landingButtonVariants({ variant: "ink" }),
+ pageHeaderButton,
+ BUTTON,
+ )}
+ >
+ Submit your video
+ <span
+ aria-hidden="true"
+ className="text-primary-soft dark:text-primary"
+ >
+ →
+ </span>
+ </a>
+ <a
+ href="/docs/getting-started/introduction"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ pageHeaderButton,
+ BUTTON,
+ )}
+ >
+ Start building
+ </a>
+ </div>
+ </SitePageHeader>
+ );
+}
diff --git a/app/(home)/showcases/components/showcases-hero.tsx b/app/(home)/showcases/components/showcases-hero.tsx
deleted file mode 100644
index 6c7ac8c4..00000000
--- a/app/(home)/showcases/components/showcases-hero.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import { Button } from "@/components/ui/button";
-import { FadeUp } from "../../components/fade-up";
-
-export const SHOWCASES_DESCRIPTION =
- "Videos made with remocn — real products and launches, animated with copy-paste Remotion components.";
-
-export function ShowcasesHero() {
- return (
- <section className="pt-10 pb-10 sm:pt-14 sm:pb-12">
- <div className="section">
- <div className="flex flex-col items-center text-center">
- <FadeUp delay={0.06}>
- <p className="mb-3 font-mono text-xs font-medium text-muted-foreground">
- Showcases
- </p>
- </FadeUp>
- <FadeUp delay={0.1}>
- <h1 className="max-w-3xl text-balance text-4xl font-semibold leading-[1.05] tracking-tight text-foreground sm:text-6xl">
- Made with remocn
- </h1>
- </FadeUp>
- <FadeUp delay={0.16}>
- <p className="mt-6 max-w-2xl text-balance text-base leading-relaxed text-muted-foreground sm:text-lg">
- {SHOWCASES_DESCRIPTION}
- </p>
- </FadeUp>
- <FadeUp delay={0.22}>
- <Button
- variant="outline"
- size="lg"
- className="mt-8 h-11 gap-2 rounded-full px-5 text-sm"
- render={<Link href="/docs/getting-started/introduction" />}
- >
- Start building
- <ArrowRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- </FadeUp>
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/showcases/components/use-hover-capable.ts b/app/(home)/showcases/components/use-hover-capable.ts
deleted file mode 100644
index ce74ad84..00000000
--- a/app/(home)/showcases/components/use-hover-capable.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-"use client";
-
-import { useEffect, useState } from "react";
-
-export function useHoverCapable() {
- const [hoverCapable, setHoverCapable] = useState(false);
-
- useEffect(() => {
- if (typeof window === "undefined" || !window.matchMedia) return;
- const mql = window.matchMedia("(hover: hover)");
- setHoverCapable(mql.matches);
- const onChange = (event: MediaQueryListEvent) =>
- setHoverCapable(event.matches);
- mql.addEventListener("change", onChange);
- return () => mql.removeEventListener("change", onChange);
- }, []);
-
- return hoverCapable;
-}
diff --git a/app/(home)/showcases/lib/docs-urls.ts b/app/(home)/showcases/lib/docs-urls.ts
new file mode 100644
index 00000000..7e22ec7c
--- /dev/null
+++ b/app/(home)/showcases/lib/docs-urls.ts
@@ -0,0 +1,40 @@
+import { readdir, readFile } from "node:fs/promises";
+import path from "node:path";
+
+const DOCS_DIR = path.join(process.cwd(), "content/docs");
+const COMPONENT_LINE = /^component:\s*["']?([\w-]+)["']?\s*$/m;
+
+let pending: Promise<Map<string, string>> | null = null;
+
+/**
+ * Registry name → docs page URL, read from the `component:` frontmatter of
+ * `content/docs`. Read from disk instead of the docs loader so the showcase
+ * routes don't pull every docs MDX module into their bundle. Empty when the
+ * folder isn't available.
+ */
+export function getDocsUrlsByComponent(): Promise<Map<string, string>> {
+ pending ??= readDocsUrls().catch(() => new Map());
+ return pending;
+}
+
+async function readDocsUrls() {
+ const files = await readdir(DOCS_DIR, { recursive: true });
+ const urls = new Map<string, string>();
+ await Promise.all(
+ files
+ .filter((file) => file.endsWith(".mdx"))
+ .map(async (file) => {
+ const source = await readFile(path.join(DOCS_DIR, file), "utf8");
+ const frontmatter = source.match(/^---\n([\s\S]*?)\n---/)?.[1];
+ const name = frontmatter?.match(COMPONENT_LINE)?.[1];
+ if (!name || urls.has(name)) return;
+ const slug = file
+ .replace(/\.mdx$/, "")
+ .split(path.sep)
+ .filter((part) => part !== "index")
+ .join("/");
+ urls.set(name, `/docs/${slug}`);
+ }),
+ );
+ return urls;
+}
diff --git a/app/(home)/showcases/lib/reel-types.ts b/app/(home)/showcases/lib/reel-types.ts
new file mode 100644
index 00000000..594deedb
--- /dev/null
+++ b/app/(home)/showcases/lib/reel-types.ts
@@ -0,0 +1,43 @@
+/** Client-safe shapes of the showcase reel (no server imports). */
+
+export type ReelComponent = {
+ /** Display name from the showcase, e.g. "Focus Pull". */
+ name: string;
+ /** Registry item, when the component is installable, e.g. "focus-pull". */
+ registryName: string | null;
+ /** Docs page on this site, or the showcase's own link. */
+ href: string;
+};
+
+export type ReelClip = {
+ slug: string;
+ title: string;
+ video: string;
+ poster: string;
+ author: { name: string; avatarUrl: string; url: string | null };
+ iso: string;
+ dateLabel: string;
+ githubUrl: string | null;
+ components: ReelComponent[];
+ /** Seconds from the start of the reel. */
+ start: number;
+ duration: number;
+};
+
+export type ReelTrack = { name: string; count: number };
+
+export type Reel = {
+ clips: ReelClip[];
+ /** Seconds, all clips end to end. */
+ total: number;
+ /** Most used components, one timeline row each. */
+ tracks: ReelTrack[];
+};
+
+/** Install command for every installable component of a clip. */
+export function installCommand(clip: ReelClip): string | null {
+ const names = clip.components.flatMap((component) =>
+ component.registryName ? [`@remocn/${component.registryName}`] : [],
+ );
+ return names.length > 0 ? `npx shadcn add ${names.join(" ")}` : null;
+}
diff --git a/app/(home)/showcases/lib/reel.ts b/app/(home)/showcases/lib/reel.ts
new file mode 100644
index 00000000..b4658533
--- /dev/null
+++ b/app/(home)/showcases/lib/reel.ts
@@ -0,0 +1,89 @@
+import { cache } from "react";
+import { getShowcases, type Showcase } from "@/lib/showcases";
+import { getVideoDuration } from "@/lib/video-duration";
+import remocnRegistry from "@/registry/remocn/registry.json";
+import remocnIconsRegistry from "@/registry/remocn-icons/registry.json";
+import remocnUiRegistry from "@/registry/remocn-ui/registry.json";
+import { getDocsUrlsByComponent } from "./docs-urls";
+import type { Reel, ReelClip, ReelComponent, ReelTrack } from "./reel-types";
+
+export * from "./reel-types";
+
+const TRACK_LIMIT = 8;
+/** Used for a clip whose file can't be measured, so the reel stays whole. */
+const FALLBACK_DURATION = 30;
+
+const REGISTRY_NAMES = new Set(
+ [remocnRegistry, remocnUiRegistry, remocnIconsRegistry].flatMap((registry) =>
+ registry.items.map((item) => item.name),
+ ),
+);
+
+export const showcaseDateFormatter = new Intl.DateTimeFormat("en-US", {
+ timeZone: "UTC",
+ year: "numeric",
+ month: "short",
+ day: "numeric",
+});
+
+function toComponent(
+ component: Showcase["components"][number],
+ docs: Map<string, string>,
+): ReelComponent {
+ const slug = component.url.replace(/\/+$/, "").split("/").pop() ?? "";
+ const registryName = REGISTRY_NAMES.has(slug) ? slug : null;
+ return {
+ name: component.name,
+ registryName,
+ href: (registryName && docs.get(registryName)) ?? component.url,
+ };
+}
+
+/** Rows for the most used components, most used first. */
+function topTracks(clips: ReelClip[]): ReelTrack[] {
+ const counts = new Map<string, number>();
+ for (const clip of clips) {
+ for (const name of new Set(clip.components.map((c) => c.name))) {
+ counts.set(name, (counts.get(name) ?? 0) + 1);
+ }
+ }
+ return [...counts]
+ .map(([name, count]) => ({ name, count }))
+ .sort((a, b) => b.count - a.count)
+ .slice(0, TRACK_LIMIT);
+}
+
+/**
+ * Every showcase laid end to end on one reel, in the manager's order, with
+ * clip lengths read from the video files.
+ */
+export const getReel = cache(async (): Promise<Reel> => {
+ const showcases = await getShowcases();
+ const durations = await Promise.all(
+ showcases.map((showcase) => getVideoDuration(showcase.videoUrl)),
+ );
+ const docs = await getDocsUrlsByComponent();
+
+ let start = 0;
+ const clips = showcases.map((showcase, index): ReelClip => {
+ const duration = durations[index] ?? FALLBACK_DURATION;
+ const createdAt = new Date(showcase.createdAt);
+ const clip: ReelClip = {
+ slug: showcase.slug,
+ title: showcase.title,
+ video: showcase.videoUrl,
+ poster: showcase.posterUrl,
+ author: showcase.author,
+ iso: createdAt.toISOString().slice(0, 10),
+ dateLabel: showcaseDateFormatter.format(createdAt),
+ githubUrl: showcase.githubUrl ?? null,
+ components: showcase.components.map((c) => toComponent(c, docs)),
+ start,
+ duration,
+ };
+ start += duration;
+ return clip;
+ });
+
+ return { clips, total: start, tracks: topTracks(clips) };
+});
diff --git a/app/(home)/showcases/page.tsx b/app/(home)/showcases/page.tsx
index 9f330b24..94e91dc3 100644
--- a/app/(home)/showcases/page.tsx
+++ b/app/(home)/showcases/page.tsx
@@ -1,14 +1,14 @@
import type { Metadata } from "next";
-import { getShowcases } from "@/lib/showcases";
-import { ShowcaseGrid } from "./components/showcase-grid";
+import { ShowcaseReel } from "./components/reel/showcase-reel";
import {
SHOWCASES_DESCRIPTION as DESCRIPTION,
- ShowcasesHero,
-} from "./components/showcases-hero";
+ ShowcasesHeader,
+} from "./components/showcases-header";
+import { getReel } from "./lib/reel";
export async function generateMetadata(): Promise<Metadata> {
- const showcases = await getShowcases();
- const shareImage = showcases[0]?.posterUrl ?? "/hero.png";
+ const { clips } = await getReel();
+ const shareImage = clips[0]?.poster ?? "/hero.png";
return {
title: "Showcases",
@@ -33,25 +33,20 @@ export async function generateMetadata(): Promise<Metadata> {
}
export default async function ShowcasesPage() {
- const showcases = await getShowcases();
+ const reel = await getReel();
return (
<>
- <ShowcasesHero />
-
- <section className="pb-24">
- <div className="section">
- {showcases.length > 0 ? (
- <ShowcaseGrid showcases={showcases} />
- ) : (
- <div className="surface-card rounded-2xl px-6 py-20 text-center">
- <p className="text-sm text-muted-foreground">
- No showcases yet — the first videos are on their way.
- </p>
- </div>
- )}
+ <ShowcasesHeader clips={reel.clips.length} total={reel.total} />
+ {reel.clips.length > 0 ? (
+ <ShowcaseReel reel={reel} />
+ ) : (
+ <div className="landing-container pb-section">
+ <p className="rounded-card bg-surface-muted px-6 py-20 text-center text-small text-muted-foreground">
+ No showcases yet. The first videos are on their way.
+ </p>
</div>
- </section>
+ )}
</>
);
}
diff --git a/app/(home)/sponsors/components/credits.tsx b/app/(home)/sponsors/components/credits.tsx
new file mode 100644
index 00000000..42be6c95
--- /dev/null
+++ b/app/(home)/sponsors/components/credits.tsx
@@ -0,0 +1,30 @@
+import { RollPlayer } from "../../components/landing/ui/roll-player/roll-player";
+import { SectionTitle } from "../../components/landing/ui/section-title";
+import { getCreditGroups } from "./credits/credit-groups";
+import { CreditsRoll } from "./credits/credits-roll";
+
+/** "The people keeping remocn alive": sponsors as a film's end credits. */
+export function CreditsSection() {
+ return (
+ <section
+ id="sponsors"
+ data-section="sponsors-credits"
+ className="landing-container flex flex-col gap-10 pb-20 md:gap-14 md:pb-24"
+ >
+ <div className="flex flex-col gap-4 md:flex-row md:items-end md:justify-between">
+ <SectionTitle
+ title="The people keeping"
+ continuation="remocn alive."
+ continuationClassName="text-subtle"
+ />
+ <p className="text-[16px] leading-6 text-muted-foreground md:w-[400px] md:shrink-0 md:pb-1.5">
+ The wonderful people and companies powering their videos with remocn.
+ </p>
+ </div>
+
+ <RollPlayer label="credits">
+ <CreditsRoll groups={getCreditGroups()} />
+ </RollPlayer>
+ </section>
+ );
+}
diff --git a/app/(home)/sponsors/components/credits/credit-entry.tsx b/app/(home)/sponsors/components/credits/credit-entry.tsx
new file mode 100644
index 00000000..a7f784e0
--- /dev/null
+++ b/app/(home)/sponsors/components/credits/credit-entry.tsx
@@ -0,0 +1,81 @@
+import Image from "next/image";
+import { cn } from "@/lib/utils";
+import type { CreditEntry as Entry } from "./credit-groups";
+
+/** Wordmark heights from the design; everything else sits at 24px. */
+const WORDMARK_HEIGHT: Record<string, string> = {
+ neon: "h-10",
+ vidrush: "h-7",
+ reactbits: "h-[21px]",
+ reactvideoeditor: "h-[26px]",
+};
+
+const MARK_SIZE: Record<string, string> = {
+ aceternity: "size-[25px]",
+};
+
+const LINK =
+ "-mx-2 inline-flex h-10 items-center rounded-tile px-2 outline-none transition-colors duration-150 hover:bg-white/[0.06] focus-visible:ring-2 focus-visible:ring-white/40";
+
+function EntryContent({ entry }: { entry: Entry }) {
+ const { logo } = entry;
+
+ if (entry.kind === "name" || !logo) {
+ return (
+ <span className="text-[17px] leading-[22px] text-dark-subtle transition-colors duration-150 group-hover:text-[#fafafa]">
+ {entry.name}
+ </span>
+ );
+ }
+
+ if (entry.kind === "mark") {
+ return (
+ <span className="flex items-center gap-[9px]">
+ <Image
+ src={logo.src}
+ alt=""
+ width={28}
+ height={28}
+ className={cn(
+ "shrink-0 object-cover",
+ logo.avatar ? "rounded-full" : "rounded-tag",
+ logo.invert && "invert",
+ MARK_SIZE[entry.id] ?? "size-7",
+ )}
+ />
+ <span className="text-[20px] leading-7 font-semibold tracking-[-0.03em] whitespace-nowrap text-[#fafafa]">
+ {entry.name}
+ </span>
+ </span>
+ );
+ }
+
+ return (
+ <Image
+ src={logo.src}
+ alt={entry.name}
+ width={160}
+ height={40}
+ className={cn(
+ "w-auto max-w-none shrink-0",
+ logo.invert && "invert",
+ WORDMARK_HEIGHT[entry.id] ?? "h-6",
+ )}
+ />
+ );
+}
+
+/** One credited sponsor: its logo (or name) linking out in a new tab. */
+export function CreditEntry({ entry }: { entry: Entry }) {
+ return (
+ <a
+ href={entry.website}
+ target="_blank"
+ rel="noreferrer"
+ className={cn("group", LINK)}
+ >
+ <EntryContent entry={entry} />
+ <span className="sr-only"> (opens in a new tab)</span>
+ </a>
+ );
+}
diff --git a/app/(home)/sponsors/components/credits/credit-groups.ts b/app/(home)/sponsors/components/credits/credit-groups.ts
new file mode 100644
index 00000000..d0a121fe
--- /dev/null
+++ b/app/(home)/sponsors/components/credits/credit-groups.ts
@@ -0,0 +1,95 @@
+import { existsSync } from "node:fs";
+import path from "node:path";
+import {
+ activeSponsors,
+ formerSponsors,
+ type Sponsor,
+ type SponsorTier,
+} from "@/config/sponsors";
+
+export type CreditLogo = {
+ src: string;
+ /** No `-dark` variant on disk: whiten the light logo with a filter. */
+ invert: boolean;
+ /** Photo avatars (builders) render round and unfiltered. */
+ avatar: boolean;
+};
+
+export type CreditEntry = {
+ id: string;
+ name: string;
+ website: string;
+ /** Icon + name (row sponsors, avatars), full wordmark, or name only. */
+ kind: "mark" | "wordmark" | "name";
+ logo?: CreditLogo;
+};
+
+export type CreditGroup = {
+ id: string;
+ role: string;
+ placement: string;
+ entries: CreditEntry[];
+};
+
+const ROLES: { tier: SponsorTier; role: string; placement: string }[] = [
+ { tier: "legendary", role: "Legendary", placement: "landing and docs" },
+ { tier: "featured", role: "Featured", placement: "landing and docs" },
+ { tier: "partner", role: "Partners", placement: "sponsors page" },
+ { tier: "builder", role: "Builder", placement: "repository README" },
+];
+
+/** `/sponsors/neon.svg` → `/sponsors/neon-dark.svg` when that file exists. */
+function darkVariant(logoUrl: string): string | null {
+ if (!logoUrl.startsWith("/")) return null;
+ const ext = path.extname(logoUrl);
+ const dark = `${logoUrl.slice(0, -ext.length)}-dark${ext}`;
+ return existsSync(path.join(process.cwd(), "public", dark)) ? dark : null;
+}
+
+function toLogo(sponsor: Sponsor): CreditLogo | undefined {
+ if (!sponsor.logoUrl) return undefined;
+ if (/\.jpe?g$/i.test(sponsor.logoUrl)) {
+ return { src: sponsor.logoUrl, invert: false, avatar: true };
+ }
+ const dark = darkVariant(sponsor.logoUrl);
+ return { src: dark ?? sponsor.logoUrl, invert: !dark, avatar: false };
+}
+
+function toEntry(sponsor: Sponsor): CreditEntry {
+ const logo = toLogo(sponsor);
+ const kind = !logo
+ ? "name"
+ : sponsor.displayName && (sponsor.layout === "row" || logo.avatar)
+ ? "mark"
+ : "wordmark";
+ return {
+ id: sponsor.id,
+ name: sponsor.displayName ?? sponsor.name,
+ website: sponsor.website,
+ kind,
+ logo,
+ };
+}
+
+export function getCreditGroups(): CreditGroup[] {
+ const groups: CreditGroup[] = ROLES.map(({ tier, role, placement }) => ({
+ id: tier,
+ role,
+ placement,
+ entries: activeSponsors.filter((s) => s.tier === tier).map(toEntry),
+ }));
+
+ groups.push({
+ id: "former",
+ role: "Special thanks",
+ placement: "former sponsors",
+ entries: formerSponsors.map((sponsor) => ({
+ id: sponsor.id,
+ name: sponsor.displayName ?? sponsor.name,
+ website: sponsor.website,
+ kind: "name",
+ })),
+ });
+
+ return groups.filter((group) => group.entries.length > 0);
+}
diff --git a/app/(home)/sponsors/components/credits/credits-roll.tsx b/app/(home)/sponsors/components/credits/credits-roll.tsx
new file mode 100644
index 00000000..274ea6a0
--- /dev/null
+++ b/app/(home)/sponsors/components/credits/credits-roll.tsx
@@ -0,0 +1,59 @@
+import { LandingButton } from "../../../components/landing/ui/landing-button";
+import { CreditEntry } from "./credit-entry";
+import type { CreditGroup } from "./credit-groups";
+
+/**
+ * The film's end credits: a title card, one row per sponsor tier (role on the
+ * left, names on the right) and the end card. Real text and links, so the full
+ * list reads the same to screen readers whatever the roll is doing.
+ */
+export function CreditsRoll({ groups }: { groups: CreditGroup[] }) {
+ return (
+ <div className="flex flex-col items-center gap-14 px-5 pt-[72px] pb-24 sm:px-8 md:pt-[88px]">
+ <div className="flex flex-col items-center gap-2.5 text-center">
+ <p className="text-caption text-dark-subtle">End credits</p>
+ <h3 className="text-[32px] leading-9 tracking-[-0.04em] text-[#fafafa] md:text-[40px] md:leading-11">
+ Made possible by
+ </h3>
+ </div>
+
+ <dl className="flex w-full max-w-[720px] flex-col gap-10">
+ {groups.map((group) => (
+ <div
+ key={group.id}
+ className="flex flex-col items-center sm:grid sm:grid-cols-2 sm:items-start sm:gap-x-16"
+ >
+ <dt className="mb-2 flex flex-col items-center justify-center text-center sm:col-start-1 sm:mb-0 sm:h-10 sm:items-end sm:text-right">
+ <span className="text-[17px] leading-[22px] text-[#fafafa]">
+ {group.role}
+ </span>
+ <span className="text-caption text-dark-subtle">
+ {group.placement}
+ </span>
+ </dt>
+ {group.entries.map((entry) => (
+ <dd
+ key={entry.id}
+ className="flex h-10 items-center sm:col-start-2"
+ >
+ <CreditEntry entry={entry} />
+ </dd>
+ ))}
+ </div>
+ ))}
+ </dl>
+
+ <div
+ data-roll-end
+ className="flex flex-col items-center gap-5 pt-6 text-center"
+ >
+ <p className="text-[22px] leading-7 tracking-[-0.03em] text-balance text-[#fafafa] md:text-[28px] md:leading-[34px]">
+ Your name could roll here next.
+ </p>
+ <LandingButton href="#tiers" variant="light" size="md" arrow="→">
+ Become a sponsor
+ </LandingButton>
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/hero.tsx b/app/(home)/sponsors/components/hero.tsx
new file mode 100644
index 00000000..ae6c4796
--- /dev/null
+++ b/app/(home)/sponsors/components/hero.tsx
@@ -0,0 +1,29 @@
+import { SectionTitle } from "../../components/landing/ui/section-title";
+import { HeroActions } from "./hero/hero-actions";
+
+export function SponsorsHero() {
+ return (
+ <section
+ data-section="sponsors-hero"
+ className="landing-container flex flex-col gap-6 pt-12 pb-14 md:pt-20 md:pb-16 xl:gap-10 xl:pt-28 xl:pb-[72px]"
+ >
+ <p className="text-caption text-primary">Sponsors</p>
+ <div className="flex flex-col gap-6 md:gap-8 xl:flex-row xl:items-end xl:justify-between">
+ <SectionTitle
+ as="h1"
+ title="Support the"
+ continuation="future of video."
+ className="text-[52px]/[52px] tracking-display md:text-[72px]/[72px] xl:w-[740px] xl:shrink-0 xl:text-[96px]/[96px]"
+ continuationClassName="text-subtle xl:leading-[100px]"
+ />
+ <div className="flex flex-col gap-6 md:max-w-[440px] md:gap-7 xl:w-[440px] xl:shrink-0 xl:pb-2">
+ <p className="text-[20px] leading-7 text-body">
+ remocn is open-source and free. Your sponsorship helps us spend more
+ time building premium animations and keeping the project alive.
+ </p>
+ <HeroActions />
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/sponsors/components/hero/hero-actions.tsx b/app/(home)/sponsors/components/hero/hero-actions.tsx
new file mode 100644
index 00000000..4a5a9067
--- /dev/null
+++ b/app/(home)/sponsors/components/hero/hero-actions.tsx
@@ -0,0 +1,31 @@
+import { OPENPANEL_DASHBOARD_URL } from "@/lib/sponsor-traffic";
+import { LandingButton } from "../../../components/landing/ui/landing-button";
+import { OpenPanelMark } from "./openpanel-mark";
+
+const BUTTON = "h-[52px] w-full md:h-12 md:w-auto";
+
+/** "Become a sponsor" and the live-traffic link (dashboard or the section). */
+export function HeroActions() {
+ const external = OPENPANEL_DASHBOARD_URL
+ ? { target: "_blank", rel: "noreferrer" }
+ : {};
+
+ return (
+ <div className="flex flex-col gap-2.5 pt-1 md:flex-row md:items-center md:pt-0">
+ <LandingButton href="#tiers" size="md" arrow="→" className={BUTTON}>
+ Become a sponsor
+ </LandingButton>
+ <LandingButton
+ href={OPENPANEL_DASHBOARD_URL ?? "#traffic"}
+ {...external}
+ variant="secondary"
+ size="md"
+ arrow={<span className="text-muted-foreground">↗</span>}
+ className={`${BUTTON} gap-2 px-[18px]`}
+ >
+ <OpenPanelMark className="h-[13px] w-[22px] shrink-0" />
+ See our live traffic
+ </LandingButton>
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/hero/openpanel-mark.tsx b/app/(home)/sponsors/components/hero/openpanel-mark.tsx
new file mode 100644
index 00000000..9c6b5d60
--- /dev/null
+++ b/app/(home)/sponsors/components/hero/openpanel-mark.tsx
@@ -0,0 +1,20 @@
+/** OpenPanel logo mark, drawn in `currentColor`. */
+export function OpenPanelMark({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 61 35"
+ xmlns="http://www.w3.org/2000/svg"
+ fill="currentColor"
+ aria-hidden="true"
+ className={className}
+ >
+ <rect x="34.03" y="0.37" width="10.35" height="34.23" rx="5.17" />
+ <rect x="49.95" y="0.37" width="10.35" height="17.51" rx="5.17" />
+ <path
+ fillRule="evenodd"
+ clipRule="evenodd"
+ d="M14.212 0C6.363 0 0 6.363 0 14.212V20.02C0 27.869 6.363 34.232 14.212 34.232C22.061 34.232 28.424 27.869 28.424 20.02V14.212C28.424 6.363 22.061 0 14.212 0ZM14.238 8.36C11.381 8.36 9.064 10.676 9.064 13.534V20.697C9.064 23.555 11.381 25.871 14.238 25.871C17.095 25.871 19.412 23.555 19.412 20.697V13.534C19.412 10.676 17.095 8.36 14.238 8.36Z"
+ />
+ </svg>
+ );
+}
diff --git a/app/(home)/sponsors/components/sections/hero.tsx b/app/(home)/sponsors/components/sections/hero.tsx
deleted file mode 100644
index 877fa380..00000000
--- a/app/(home)/sponsors/components/sections/hero.tsx
+++ /dev/null
@@ -1,108 +0,0 @@
-import { ArrowRight, ArrowUpRight } from "lucide-react";
-import Link from "next/link";
-import { Button } from "@/components/ui/button";
-import { FadeUp } from "../../../components/fade-up";
-import { HeroTerminalBg } from "../../../components/hero-terminal-bg";
-
-const OPENPANEL_DASHBOARD_URL = "https://op.kapish.dev/share/overview/hRpldJ";
-const INTRO_GATE = "sponsors-intro";
-
-function OpenPanelLogo({ className }: { className?: string }) {
- return (
- <svg
- viewBox="0 0 61 35"
- xmlns="http://www.w3.org/2000/svg"
- fill="currentColor"
- className={className}
- aria-hidden="true"
- >
- <rect
- x="34.0269"
- y="0.368164"
- width="10.3474"
- height="34.2258"
- rx="5.17372"
- />
- <rect
- x="49.9458"
- y="0.368164"
- width="10.3474"
- height="17.5109"
- rx="5.17372"
- />
- <path
- fillRule="evenodd"
- clipRule="evenodd"
- d="M14.212 0C6.36293 0 0 6.36293 0 14.212V20.02C0 27.8691 6.36293 34.232 14.212 34.232C22.0611 34.232 28.424 27.8691 28.424 20.02V14.212C28.424 6.36293 22.0611 0 14.212 0ZM14.2379 8.35999C11.3805 8.35999 9.06419 10.6763 9.06419 13.5337V20.6971C9.06419 23.5545 11.3805 25.8708 14.2379 25.8708C17.0953 25.8708 19.4116 23.5545 19.4116 20.6971V13.5337C19.4116 10.6763 17.0953 8.35999 14.2379 8.35999Z"
- />
- </svg>
- );
-}
-
-export function Hero() {
- return (
- <section className="relative isolate pt-20 pb-4 sm:pt-24 sm:pb-6">
- <div aria-hidden className="absolute inset-0 -z-10">
- <HeroTerminalBg />
- </div>
- <div className="section">
- <div className="flex flex-col items-center text-center">
- <FadeUp gate={INTRO_GATE} delay={0.06}>
- <p className="mb-3 font-mono text-xs font-medium text-muted-foreground [text-shadow:0_0_10px_var(--background),0_0_20px_var(--background)]">
- Sponsors
- </p>
- </FadeUp>
- <FadeUp gate={INTRO_GATE} delay={0.1}>
- <h1 className="max-w-3xl text-balance text-4xl font-semibold leading-[1.05] tracking-tight text-foreground sm:text-5xl">
- Support the future of video
- </h1>
- </FadeUp>
- <FadeUp gate={INTRO_GATE} delay={0.16}>
- <p className="mt-6 max-w-2xl text-pretty text-base leading-relaxed text-foreground [text-shadow:0_0_10px_var(--background),0_0_20px_var(--background)] sm:text-lg">
- remocn is open-source and free. Your sponsorship helps us spend
- more time building premium animations and keeping the project
- alive.
- </p>
- </FadeUp>
- <FadeUp gate={INTRO_GATE} delay={0.22}>
- <div className="mt-8 flex flex-col items-center gap-3 sm:flex-row">
- <Button
- size="lg"
- className="h-11 gap-2 rounded-full px-6 text-sm"
- render={<Link href="#tiers" />}
- >
- Become a sponsor
- <ArrowRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- <Button
- variant="secondary"
- size="lg"
- className="h-11 gap-2 rounded-full px-5 text-sm font-medium"
- render={
- // biome-ignore lint/a11y/useAnchorContent: Base UI render prop merges the button children into this anchor
- <a
- href={OPENPANEL_DASHBOARD_URL}
- target="_blank"
- rel="noreferrer"
- />
- }
- >
- <OpenPanelLogo className="h-4 w-auto" />
- See our live traffic
- <ArrowUpRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- </div>
- </FadeUp>
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/sponsors/components/sections/tiers.tsx b/app/(home)/sponsors/components/sections/tiers.tsx
deleted file mode 100644
index 645e1656..00000000
--- a/app/(home)/sponsors/components/sections/tiers.tsx
+++ /dev/null
@@ -1,160 +0,0 @@
-"use client";
-
-import { ArrowRight, Check } from "lucide-react";
-import { motion, useReducedMotion } from "motion/react";
-import { useState } from "react";
-import { Badge } from "@/components/ui/badge";
-import { Button } from "@/components/ui/button";
-import { Separator } from "@/components/ui/separator";
-import { SPRING_SOFT } from "@/config/site";
-import { type BillingMode, type Tier, tiers } from "@/config/sponsors";
-import { cn } from "@/lib/utils";
-
-function BillingToggle({
- value,
- onChange,
-}: {
- value: BillingMode;
- onChange: (v: BillingMode) => void;
-}) {
- const reduced = useReducedMotion();
- const options: { id: BillingMode; label: string }[] = [
- { id: "monthly", label: "Monthly" },
- { id: "one-time", label: "One-time" },
- ];
-
- return (
- <div className="inline-flex rounded-full border border-border bg-card p-1">
- {options.map((opt) => {
- const active = opt.id === value;
- return (
- <Button
- key={opt.id}
- variant="ghost"
- type="button"
- aria-pressed={active}
- onClick={() => onChange(opt.id)}
- className={cn(
- "relative rounded-full px-5 text-sm font-medium transition-colors duration-200 before:absolute before:inset-x-0 before:-inset-y-2 before:content-['']",
- active
- ? "text-background"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- {active && (
- <motion.div
- layoutId="billing-thumb"
- className="absolute inset-0 rounded-full bg-foreground"
- transition={reduced ? { duration: 0 } : SPRING_SOFT}
- />
- )}
- <span className="relative">{opt.label}</span>
- </Button>
- );
- })}
- </div>
- );
-}
-
-function TierCard({
- tier,
- billingMode,
-}: {
- tier: Tier;
- billingMode: BillingMode;
-}) {
- const reduced = useReducedMotion();
- const checkoutUrl =
- billingMode === "monthly" ? tier.monthlyUrl : tier.oneTimeUrl;
- const priceSuffix = billingMode === "monthly" ? "/mo" : "one-time";
-
- return (
- <article
- className={cn(
- "surface-card flex h-full flex-col rounded-3xl p-8",
- tier.highlighted && "surface-card-highlighted",
- )}
- >
- <div className="flex items-start justify-between gap-3">
- <div>
- <h3 className="text-lg font-semibold tracking-tight text-foreground">
- {tier.name}
- </h3>
- <p className="mt-1 text-sm text-muted-foreground">{tier.tagline}</p>
- </div>
- {tier.badge && <Badge variant="secondary">{tier.badge}</Badge>}
- </div>
-
- <div className="mt-6 overflow-hidden">
- <motion.div
- key={billingMode}
- initial={{ opacity: 0, y: 8 }}
- animate={{ opacity: 1, y: 0 }}
- transition={reduced ? { duration: 0 } : SPRING_SOFT}
- className="flex items-baseline gap-2"
- >
- <span className="text-4xl font-semibold tracking-tight tabular-nums text-foreground">
- ${tier.price}
- </span>
- <span className="text-sm text-muted-foreground">{priceSuffix}</span>
- </motion.div>
- </div>
-
- <Separator className="my-6 bg-border" />
-
- <ul className="flex flex-col gap-3">
- {tier.perks.map((perk) => (
- <li
- key={perk}
- className="flex items-start gap-3 text-sm text-muted-foreground"
- >
- <Check
- className="mt-[3px] size-3.5 shrink-0 text-foreground"
- aria-hidden="true"
- />
- <span>{perk}</span>
- </li>
- ))}
- </ul>
-
- <div className="mt-auto pt-10">
- <Button
- variant={tier.highlighted ? "default" : "outline"}
- size="lg"
- className="h-11 w-full gap-2 rounded-full"
- render={
- // biome-ignore lint/a11y/useAnchorContent: Base UI render prop merges the button children into this anchor
- <a href={checkoutUrl} target="_blank" rel="noreferrer" />
- }
- >
- Become a {tier.name}
- <ArrowRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- </div>
- </article>
- );
-}
-
-export function Tiers() {
- const [billingMode, setBillingMode] = useState<BillingMode>("monthly");
-
- return (
- <section id="tiers" className="relative py-12 sm:py-16">
- <div className="section">
- <div className="mb-8 flex justify-center">
- <BillingToggle value={billingMode} onChange={setBillingMode} />
- </div>
-
- <div className="grid gap-6 md:grid-cols-3">
- {tiers.map((tier) => (
- <TierCard key={tier.id} tier={tier} billingMode={billingMode} />
- ))}
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/sponsors/components/sections/wall-of-love.tsx b/app/(home)/sponsors/components/sections/wall-of-love.tsx
deleted file mode 100644
index a7940081..00000000
--- a/app/(home)/sponsors/components/sections/wall-of-love.tsx
+++ /dev/null
@@ -1,77 +0,0 @@
-import { ArrowRight } from "lucide-react";
-import Link from "next/link";
-import { Button } from "@/components/ui/button";
-import { activeSponsors, formerSponsors } from "@/config/sponsors";
-import { SectionHeading } from "../../../components/section-heading";
-import { SponsorCard } from "../../../components/sponsor-card";
-import { SponsorGrid } from "../../../components/sponsor-grid";
-
-export function WallOfLove() {
- const isEmpty = activeSponsors.length === 0;
-
- return (
- <section id="sponsors" className="relative py-12 sm:py-16">
- <div className="section">
- <SectionHeading
- eyebrow="Sponsors"
- title="The people keeping remocn alive"
- lead="The wonderful people and companies powering their videos with remocn."
- animated={false}
- className="mb-8 sm:mb-10"
- />
-
- {isEmpty ? (
- <div className="surface-card flex flex-col items-center justify-center gap-6 rounded-3xl px-8 py-16 text-center">
- <p className="max-w-md text-pretty text-lg text-foreground">
- Be the first to support remocn. Your logo could live right here.
- </p>
- <Button
- size="lg"
- className="h-11 gap-2 rounded-full px-6 text-sm"
- render={<Link href="#tiers" />}
- >
- Become a sponsor
- <ArrowRight
- data-icon="inline-end"
- className="size-4"
- aria-hidden="true"
- />
- </Button>
- </div>
- ) : (
- <SponsorGrid sponsors={activeSponsors} ctaHref="#tiers" />
- )}
- </div>
- </section>
- );
-}
-
-export function FormerSponsors() {
- if (formerSponsors.length === 0) return null;
-
- return (
- <section id="wall-of-love" className="relative py-12 sm:py-16">
- <div className="section">
- <SectionHeading
- eyebrow="Wall of love"
- title="Wall of love"
- lead="Sponsors who backed remocn along the way. Thank you — this project got here with your help."
- animated={false}
- className="mb-8 sm:mb-10"
- />
- <div className="grid grid-cols-2 gap-3 lg:grid-cols-4">
- {formerSponsors.map((s) => (
- <SponsorCard
- key={s.id}
- sponsor={s}
- label="Former"
- logoArea="min-h-14"
- maxH="max-h-8"
- treatment="muted"
- />
- ))}
- </div>
- </div>
- </section>
- );
-}
diff --git a/app/(home)/sponsors/components/tiers.tsx b/app/(home)/sponsors/components/tiers.tsx
new file mode 100644
index 00000000..71490f25
--- /dev/null
+++ b/app/(home)/sponsors/components/tiers.tsx
@@ -0,0 +1,21 @@
+import { tiers } from "@/config/sponsors";
+import { TierCard } from "./tiers/tier-card";
+
+export function TiersSection() {
+ return (
+ <section
+ id="tiers"
+ data-section="sponsors-tiers"
+ className="landing-container flex scroll-mt-24 flex-col gap-5 py-[72px] xl:gap-6 xl:pt-6 xl:pb-[120px]"
+ >
+ <h2 className="text-caption text-muted-foreground">
+ Three monthly tiers, billed through Creem
+ </h2>
+ <div className="grid gap-4 lg:grid-cols-3">
+ {tiers.map((tier) => (
+ <TierCard key={tier.id} tier={tier} />
+ ))}
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/sponsors/components/tiers/tier-button.tsx b/app/(home)/sponsors/components/tiers/tier-button.tsx
new file mode 100644
index 00000000..1d7efb25
--- /dev/null
+++ b/app/(home)/sponsors/components/tiers/tier-button.tsx
@@ -0,0 +1,45 @@
+import type { Tier } from "@/config/sponsors";
+import { LandingButton } from "../../../components/landing/ui/landing-button";
+import { MetalRing } from "../../../components/landing/ui/metal-ring";
+
+const LABEL: Record<Tier["id"], string> = {
+ builder: "Become a Builder",
+ partner: "Become a Partner",
+ featured: "Become a Featured sponsor",
+};
+
+/** Creem monthly checkout. Grey on light cards, metal-ringed on the dark one. */
+export function TierButton({ tier }: { tier: Tier }) {
+ const link = {
+ href: tier.monthlyUrl,
+ target: "_blank",
+ rel: "noreferrer",
+ };
+
+ if (!tier.highlighted) {
+ return (
+ <LandingButton
+ {...link}
+ variant="secondary"
+ size="md"
+ arrow={<span className="text-muted-foreground">→</span>}
+ className="w-full"
+ >
+ {LABEL[tier.id]}
+ </LandingButton>
+ );
+ }
+
+ return (
+ <a
+ {...link}
+ className="relative flex h-12 w-full shrink-0 items-center justify-center gap-2.5 rounded-cta border-2 border-metal text-ui text-foreground shadow-[0_1px_2px_#0000004D,0_8px_20px_-10px_#00000099] outline-none transition-transform duration-150 ease-out focus-visible:ring-3 focus-visible:ring-ring active:translate-y-px"
+ >
+ {LABEL[tier.id]}
+ <span aria-hidden="true" className="text-primary">
+ →
+ </span>
+ <MetalRing width={2} />
+ </a>
+ );
+}
diff --git a/app/(home)/sponsors/components/tiers/tier-card.tsx b/app/(home)/sponsors/components/tiers/tier-card.tsx
new file mode 100644
index 00000000..2ef60c7c
--- /dev/null
+++ b/app/(home)/sponsors/components/tiers/tier-card.tsx
@@ -0,0 +1,106 @@
+import type { CSSProperties } from "react";
+import type { Tier } from "@/config/sponsors";
+import { cn } from "@/lib/utils";
+import { TierButton } from "./tier-button";
+
+/** Dark Featured card: ink fading into the magenta shader at the bottom. */
+const FEATURED_BACKGROUND: CSSProperties = {
+ backgroundImage:
+ "linear-gradient(in oklab 180deg, #0E1012 0%, #0E1012 70%, #0E1012B3 86%, #0E101240 100%), url(/landing/shader-magenta.png)",
+ backgroundPosition: "50%, 50% 100%",
+ backgroundSize: "cover",
+};
+
+export function TierCard({ tier }: { tier: Tier }) {
+ const dark = tier.highlighted;
+
+ return (
+ <article
+ style={dark ? FEATURED_BACKGROUND : undefined}
+ className={cn(
+ "flex min-w-0 flex-col gap-6 rounded-panel p-6 xl:gap-7 xl:p-8",
+ dark
+ ? "overflow-clip bg-dark-surface shadow-[0_1px_2px_#0E10121A,0_12px_24px_-12px_#0E101214]"
+ : "bg-card ring-1 ring-hairline",
+ )}
+ >
+ <div className="flex items-start justify-between gap-3">
+ <div className="flex flex-col gap-1">
+ <h3
+ className={cn(
+ "text-[20px] leading-[26px] font-medium tracking-title",
+ dark ? "text-white" : "text-foreground",
+ )}
+ >
+ {tier.name}
+ </h3>
+ <p
+ className={cn(
+ "text-small",
+ dark ? "text-white/72" : "text-muted-foreground",
+ )}
+ >
+ {tier.tagline}
+ </p>
+ </div>
+ {tier.badge && (
+ <span className="flex h-[26px] shrink-0 items-center rounded-tile bg-primary px-2.5 text-caption font-medium text-white">
+ {tier.badge}
+ </span>
+ )}
+ </div>
+
+ <p className="flex items-baseline gap-1.5">
+ <span
+ className={cn(
+ "text-[52px] leading-[54px] tracking-heading tabular-nums xl:text-[56px] xl:leading-[58px]",
+ dark ? "text-white" : "text-foreground",
+ )}
+ >
+ ${tier.price}
+ </span>
+ <span
+ className={cn(
+ "text-ui",
+ dark ? "text-white/72" : "text-muted-foreground",
+ )}
+ >
+ /mo
+ </span>
+ </p>
+
+ <hr
+ className={cn(
+ "h-px shrink-0 border-0",
+ dark ? "bg-white/16" : "bg-divider",
+ )}
+ />
+
+ <ul className="flex grow flex-col gap-3">
+ {tier.perks.map((perk) => (
+ <li key={perk} className="flex items-start gap-3">
+ <span
+ aria-hidden="true"
+ className={cn(
+ "w-3.5 shrink-0 text-[14px] leading-[22px] xl:leading-5",
+ dark ? "text-primary-soft" : "text-foreground",
+ )}
+ >
+ ✓
+ </span>
+ <span
+ className={cn(
+ "text-[16px] leading-[22px] xl:text-[15px] xl:leading-5",
+ dark ? "text-white/88" : "text-body",
+ )}
+ >
+ {perk}
+ </span>
+ </li>
+ ))}
+ </ul>
+
+ <TierButton tier={tier} />
+ </article>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic.tsx b/app/(home)/sponsors/components/traffic.tsx
new file mode 100644
index 00000000..158f58cc
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic.tsx
@@ -0,0 +1,57 @@
+import { getSponsorTrafficForPage } from "@/lib/sponsor-traffic";
+import { SectionTitle } from "../../components/landing/ui/section-title";
+import { BarList } from "./traffic/bar-list";
+import { DevicesCard } from "./traffic/devices-card";
+import { formatCountry } from "./traffic/format";
+import { StatsColumn } from "./traffic/stats-column";
+import { VisitorsCard } from "./traffic/visitors-card";
+
+export async function TrafficSection() {
+ const traffic = await getSponsorTrafficForPage();
+ if (!traffic) return null;
+
+ const countries = traffic.countries.map((row) => ({
+ ...row,
+ name: formatCountry(row.name),
+ }));
+
+ return (
+ <section
+ id="traffic"
+ data-section="sponsors-traffic"
+ className="landing-container flex flex-col gap-8 pt-6 pb-20 md:gap-10 xl:pb-[120px]"
+ >
+ <div className="flex flex-col gap-5 xl:flex-row xl:items-end xl:justify-between xl:gap-10">
+ <div className="flex flex-col gap-4">
+ <p className="text-caption text-primary">
+ Live traffic, last 30 days
+ </p>
+ <SectionTitle
+ title="Your logo, in front of"
+ continuation="people who ship video."
+ continuationClassName="text-subtle"
+ />
+ </div>
+ <p className="text-ui leading-6 text-muted-foreground md:max-w-[400px] xl:w-[400px] xl:shrink-0 xl:pb-1.5">
+ Numbers come straight from our public OpenPanel dashboard. Nothing
+ rounded up for the pitch.
+ </p>
+ </div>
+ <div className="flex flex-col gap-3 lg:flex-row">
+ <VisitorsCard traffic={traffic} />
+ <StatsColumn traffic={traffic} />
+ </div>
+ <div className="grid gap-3 md:grid-cols-2 xl:grid-cols-3">
+ <BarList
+ title="Where they come from"
+ rows={traffic.referrers}
+ tone="fuchsia"
+ />
+ <BarList title="Top countries" rows={countries} tone="neutral" />
+ <div className="grid md:col-span-2 xl:col-span-1">
+ <DevicesCard devices={traffic.devices} />
+ </div>
+ </div>
+ </section>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic/bar-list.tsx b/app/(home)/sponsors/components/traffic/bar-list.tsx
new file mode 100644
index 00000000..c07ece43
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/bar-list.tsx
@@ -0,0 +1,50 @@
+import type { TrafficRow } from "@/lib/sponsor-traffic";
+import { cn } from "@/lib/utils";
+import { CARD, CardHeader } from "./card";
+import { formatNumber } from "./format";
+
+const BAR_TONE = {
+ fuchsia: "bg-primary-wash",
+ neutral: "bg-surface-muted",
+} as const;
+
+/** Ranked rows with a bar sized against the leader, values right-aligned. */
+export function BarList({
+ title,
+ rows,
+ tone,
+}: {
+ title: string;
+ rows: TrafficRow[];
+ tone: keyof typeof BAR_TONE;
+}) {
+ const max = Math.max(...rows.map((row) => row.sessions), 1);
+ return (
+ <div className={cn(CARD, "flex min-w-0 flex-col gap-4 px-6 pt-5 pb-6")}>
+ <CardHeader title={title} hint="sessions" />
+ <ol className="flex flex-col gap-1.5">
+ {rows.map((row) => (
+ <li
+ key={row.name}
+ className="relative flex h-8 items-center justify-between gap-3 px-2.5"
+ >
+ <span
+ aria-hidden="true"
+ className={cn(
+ "absolute inset-y-0 left-0 rounded-tile",
+ BAR_TONE[tone],
+ )}
+ style={{ width: `${(row.sessions / max) * 100}%` }}
+ />
+ <span className="relative truncate text-small text-foreground">
+ {row.name}
+ </span>
+ <span className="relative text-caption text-body tabular-nums">
+ {formatNumber(row.sessions)}
+ </span>
+ </li>
+ ))}
+ </ol>
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic/card.tsx b/app/(home)/sponsors/components/traffic/card.tsx
new file mode 100644
index 00000000..d507f846
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/card.tsx
@@ -0,0 +1,24 @@
+import type { ReactNode } from "react";
+
+/** White card with the 6% hairline, shared by every traffic panel. */
+export const CARD = "rounded-card border border-hairline bg-card";
+
+/** Muted card title with a mono hint on the right ("sessions"). */
+export function CardHeader({
+ title,
+ hint,
+ className,
+}: {
+ title: ReactNode;
+ hint?: ReactNode;
+ className?: string;
+}) {
+ return (
+ <div className="flex items-baseline justify-between gap-3">
+ <h3 className={className ?? "text-small text-muted-foreground"}>
+ {title}
+ </h3>
+ {hint && <span className="text-caption text-subtle">{hint}</span>}
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic/curve.ts b/app/(home)/sponsors/components/traffic/curve.ts
new file mode 100644
index 00000000..55011ec4
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/curve.ts
@@ -0,0 +1,39 @@
+export type Point = { x: number; y: number };
+
+/** Evenly spaced points across `width`, `y` mapped by the caller. */
+export function spread(
+ values: number[],
+ width: number,
+ toY: (value: number) => number,
+): Point[] {
+ const step = width / Math.max(values.length - 1, 1);
+ return values.map((value, i) => ({ x: i * step, y: toY(value) }));
+}
+
+const round = (n: number) => Math.round(n * 10) / 10;
+
+/** Catmull-Rom spline through every point, as cubic Bézier segments. */
+export function smoothPath(points: Point[]) {
+ if (points.length === 0) return "";
+ const [first] = points;
+ let d = `M${round(first.x)},${round(first.y)}`;
+ for (let i = 0; i < points.length - 1; i++) {
+ const p0 = points[i - 1] ?? points[i];
+ const p1 = points[i];
+ const p2 = points[i + 1];
+ const p3 = points[i + 2] ?? p2;
+ const c1x = p1.x + (p2.x - p0.x) / 6;
+ const c1y = p1.y + (p2.y - p0.y) / 6;
+ const c2x = p2.x - (p3.x - p1.x) / 6;
+ const c2y = p2.y - (p3.y - p1.y) / 6;
+ d += ` C${round(c1x)},${round(c1y)} ${round(c2x)},${round(c2y)} ${round(p2.x)},${round(p2.y)}`;
+ }
+ return d;
+}
+
+/** The line closed down to `baseline`, for the area fill. */
+export function areaPath(points: Point[], baseline: number) {
+ if (points.length === 0) return "";
+ const last = points[points.length - 1];
+ return `${smoothPath(points)} L${round(last.x)},${baseline} L${round(points[0].x)},${baseline} Z`;
+}
diff --git a/app/(home)/sponsors/components/traffic/devices-card.tsx b/app/(home)/sponsors/components/traffic/devices-card.tsx
new file mode 100644
index 00000000..7acbb591
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/devices-card.tsx
@@ -0,0 +1,127 @@
+import {
+ OPENPANEL_DASHBOARD_URL,
+ type TrafficRow,
+} from "@/lib/sponsor-traffic";
+import { cn } from "@/lib/utils";
+import { landingButtonVariants } from "../../../components/landing/ui/landing-button";
+import { CARD, CardHeader } from "./card";
+import { formatNumber } from "./format";
+
+const RADIUS = 60;
+const CIRCUMFERENCE = 2 * Math.PI * RADIUS;
+/** Gap between ring segments, in px along the stroke. */
+const SEGMENT_GAP = 2;
+
+/** Ring and legend colours, in device order (desktop, mobile, tablet). */
+const SWATCHES = [
+ { stroke: "stroke-primary", fill: "bg-primary" },
+ { stroke: "stroke-foreground", fill: "bg-foreground" },
+ { stroke: "stroke-secondary", fill: "bg-secondary" },
+];
+
+const capitalize = (value: string) =>
+ value.charAt(0).toUpperCase() + value.slice(1);
+
+export function DevicesCard({ devices }: { devices: TrafficRow[] }) {
+ const total = devices.reduce((sum, row) => sum + row.sessions, 0) || 1;
+ const top = devices[0];
+ const dashboardUrl = OPENPANEL_DASHBOARD_URL;
+ let offset = 0;
+ const segments = devices.map((row, i) => {
+ const length = (row.sessions / total) * CIRCUMFERENCE;
+ const segment = { ...SWATCHES[i % SWATCHES.length], length, offset };
+ offset += length;
+ return segment;
+ });
+
+ return (
+ <div
+ className={cn(
+ CARD,
+ "flex min-w-0 flex-col justify-between gap-4 px-6 pt-5 pb-6",
+ )}
+ >
+ <CardHeader title="Devices" hint="sessions" />
+ <div className={cn("flex items-center gap-6", !dashboardUrl && "grow")}>
+ <div className="relative size-[136px] shrink-0">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 136 136"
+ className="absolute inset-0 size-full"
+ >
+ <circle
+ cx="68"
+ cy="68"
+ r={RADIUS}
+ fill="none"
+ strokeWidth="14"
+ className="stroke-surface-muted"
+ />
+ {segments.map(
+ (segment) =>
+ segment.length > SEGMENT_GAP && (
+ <circle
+ key={segment.offset}
+ cx="68"
+ cy="68"
+ r={RADIUS}
+ transform="rotate(-90 68 68)"
+ fill="none"
+ strokeWidth="14"
+ strokeDasharray={`${segment.length - SEGMENT_GAP} ${CIRCUMFERENCE}`}
+ strokeDashoffset={-segment.offset}
+ className={segment.stroke}
+ />
+ ),
+ )}
+ </svg>
+ {top && (
+ <p className="absolute inset-x-0 top-[46px] flex flex-col items-center">
+ <span className="text-[26px]/[28px] tracking-[-0.03em] text-foreground">
+ {Math.round((top.sessions / total) * 100)}%
+ </span>
+ <span className="text-caption text-subtle">
+ on {top.name.toLowerCase()}
+ </span>
+ </p>
+ )}
+ </div>
+ <ul className="flex grow flex-col gap-2.5">
+ {devices.map((row, i) => (
+ <li key={row.name} className="flex items-center gap-2">
+ <span
+ aria-hidden="true"
+ className={cn(
+ "size-2 shrink-0 rounded-[2px]",
+ SWATCHES[i % SWATCHES.length].fill,
+ )}
+ />
+ <span className="grow text-small text-foreground">
+ {capitalize(row.name)}
+ </span>
+ <span className="text-caption text-body tabular-nums">
+ {formatNumber(row.sessions)}
+ </span>
+ </li>
+ ))}
+ </ul>
+ </div>
+ {dashboardUrl && (
+ <a
+ href={dashboardUrl}
+ target="_blank"
+ rel="noopener noreferrer"
+ className={cn(
+ landingButtonVariants({ variant: "secondary" }),
+ "h-11 w-full gap-2 rounded-control-sm px-4 text-small md:h-10",
+ )}
+ >
+ Open the live dashboard
+ <span aria-hidden="true" className="text-muted-foreground">
+ ↗
+ </span>
+ </a>
+ )}
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic/format.ts b/app/(home)/sponsors/components/traffic/format.ts
new file mode 100644
index 00000000..bf77b3c8
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/format.ts
@@ -0,0 +1,56 @@
+const number = new Intl.NumberFormat("en-US");
+const ratio = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 });
+const shortDate = new Intl.DateTimeFormat("en-US", {
+ month: "short",
+ day: "numeric",
+ timeZone: "UTC",
+});
+const weekdayDate = new Intl.DateTimeFormat("en-US", {
+ weekday: "short",
+ month: "short",
+ day: "numeric",
+ timeZone: "UTC",
+});
+const countryNames = new Intl.DisplayNames(["en"], { type: "region" });
+
+export const formatNumber = (value: number) => number.format(value);
+
+export const formatRatio = (value: number) => ratio.format(value);
+
+/** OpenPanel days come as `YYYY-MM-DD`, sometimes with a time part. */
+function parseDay(value: string) {
+ const date = new Date(`${value.slice(0, 10)}T00:00:00Z`);
+ return Number.isNaN(date.getTime()) ? null : date;
+}
+
+/** "Sep 24" */
+export function formatDay(value: string) {
+ const date = parseDay(value);
+ return date ? shortDate.format(date) : value;
+}
+
+/** "Sun, Oct 18" */
+export function formatWeekday(value: string) {
+ const date = parseDay(value);
+ return date ? weekdayDate.format(date) : value;
+}
+
+/** 475 → "7m 55s" */
+export function formatDuration(totalSeconds: number) {
+ const seconds = Math.round(totalSeconds);
+ const h = Math.floor(seconds / 3600);
+ const m = Math.floor((seconds % 3600) / 60);
+ const s = seconds % 60;
+ if (h > 0) return `${h}h ${m}m`;
+ if (m > 0) return `${m}m ${s}s`;
+ return `${s}s`;
+}
+
+/** ISO 3166 code → English name ("US" → "United States"). */
+export function formatCountry(code: string) {
+ try {
+ return countryNames.of(code.toUpperCase()) ?? code;
+ } catch {
+ return code;
+ }
+}
diff --git a/app/(home)/sponsors/components/traffic/stats-column.tsx b/app/(home)/sponsors/components/traffic/stats-column.tsx
new file mode 100644
index 00000000..9885f953
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/stats-column.tsx
@@ -0,0 +1,94 @@
+import type { SponsorTraffic } from "@/lib/sponsor-traffic";
+import { cn } from "@/lib/utils";
+import { CARD, CardHeader } from "./card";
+import { areaPath, smoothPath, spread } from "./curve";
+import { formatDuration, formatNumber, formatRatio } from "./format";
+
+const SPARK_W = 320;
+const SPARK_H = 56;
+const SPARK_PAD = 6;
+
+/** Visitors per day, min-to-max fitted into the strip under Pageviews. */
+function Sparkline({ values }: { values: number[] }) {
+ const min = Math.min(...values);
+ const span = Math.max(...values) - min || 1;
+ const points = spread(
+ values,
+ SPARK_W,
+ (v) => SPARK_PAD + (1 - (v - min) / span) * (SPARK_H - SPARK_PAD * 2),
+ );
+ return (
+ <svg
+ aria-hidden="true"
+ viewBox={`0 0 ${SPARK_W} ${SPARK_H}`}
+ preserveAspectRatio="none"
+ className="h-14 w-full shrink-0 text-foreground"
+ >
+ <defs>
+ <linearGradient id="pageviews-spark" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="0%" stopColor="currentColor" stopOpacity="0.12" />
+ <stop offset="100%" stopColor="currentColor" stopOpacity="0" />
+ </linearGradient>
+ </defs>
+ <path d={areaPath(points, SPARK_H)} fill="url(#pageviews-spark)" />
+ <path
+ d={smoothPath(points)}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={1.5}
+ vectorEffect="non-scaling-stroke"
+ />
+ </svg>
+ );
+}
+
+function SmallStat({ label, value }: { label: string; value: string }) {
+ return (
+ <div className={cn(CARD, "flex flex-1 flex-col gap-1 px-5 py-4")}>
+ <h3 className="text-small text-muted-foreground">{label}</h3>
+ <p className="text-[26px]/[32px] tracking-[-0.03em] text-foreground tabular-nums">
+ {value}
+ </p>
+ </div>
+ );
+}
+
+export function StatsColumn({ traffic }: { traffic: SponsorTraffic }) {
+ return (
+ <div className="flex flex-col gap-3 lg:w-[400px] lg:shrink-0">
+ <div className={cn(CARD, "flex flex-col gap-3 overflow-clip px-6 pt-5")}>
+ <CardHeader
+ title="Pageviews"
+ hint={`${formatRatio(traffic.viewsPerSession)} per session`}
+ />
+ <p className="text-[32px]/[36px] tracking-[-0.04em] text-foreground tabular-nums">
+ {formatNumber(traffic.pageviews)}
+ </p>
+ <Sparkline values={traffic.series.map((point) => point.visitors)} />
+ </div>
+ <div className="flex grow flex-col justify-between gap-4 rounded-card bg-dark-surface px-6 py-5">
+ <div className="flex items-baseline justify-between gap-3">
+ <h3 className="text-small text-dark-subtle">Registry installs</h3>
+ <span className="font-mono text-mono text-primary-soft">
+ registry_install
+ </span>
+ </div>
+ <div className="flex flex-col gap-1">
+ <p className="text-[40px]/[44px] tracking-[-0.045em] text-[#fafafa] tabular-nums">
+ {formatNumber(traffic.registryInstalls)}
+ </p>
+ <p className="font-mono text-mono text-dark-subtle">
+ npx shadcn add @remocn/…
+ </p>
+ </div>
+ </div>
+ <div className="flex gap-3">
+ <SmallStat label="Sessions" value={formatNumber(traffic.sessions)} />
+ <SmallStat
+ label="Avg session"
+ value={formatDuration(traffic.avgSessionDuration)}
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic/visitors-card.tsx b/app/(home)/sponsors/components/traffic/visitors-card.tsx
new file mode 100644
index 00000000..7d81d826
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/visitors-card.tsx
@@ -0,0 +1,60 @@
+import type { SponsorTraffic } from "@/lib/sponsor-traffic";
+import { cn } from "@/lib/utils";
+import { CARD } from "./card";
+import { formatDay, formatNumber, formatWeekday } from "./format";
+import { type ChartPoint, VisitorsChart } from "./visitors-chart";
+
+/** A label every 7 days from the start, plus the last day. */
+function tickIndices(count: number) {
+ const last = count - 1;
+ const ticks: number[] = [];
+ for (let i = 0; i <= last - 4; i += 7) ticks.push(i);
+ if (last > 0) ticks.push(last);
+ return ticks;
+}
+
+export function VisitorsCard({ traffic }: { traffic: SponsorTraffic }) {
+ const { series, range, uniqueVisitors } = traffic;
+ const rangeLabel = `${formatDay(range.start)} to ${formatDay(range.end)}`;
+ const points: ChartPoint[] = series.map((point) => ({
+ label: formatWeekday(point.date),
+ visitors: point.visitors,
+ valueLabel: `${formatNumber(point.visitors)} ${point.visitors === 1 ? "visitor" : "visitors"}`,
+ }));
+
+ return (
+ <div
+ className={cn(CARD, "flex min-w-0 flex-1 flex-col gap-5 px-6 pt-6 pb-5")}
+ >
+ <div className="flex flex-wrap items-start justify-between gap-3">
+ <div className="flex flex-col gap-1.5">
+ <h3 className="text-small text-muted-foreground">Unique visitors</h3>
+ <p className="text-[48px]/[48px] tracking-[-0.045em] text-foreground tabular-nums">
+ {formatNumber(uniqueVisitors)}
+ </p>
+ </div>
+ <p className="flex h-8 items-center gap-2 rounded-control-sm bg-surface-muted px-3">
+ <span
+ aria-hidden="true"
+ className="size-1.5 shrink-0 rounded-full bg-success"
+ />
+ <span className="text-caption text-body tabular-nums">
+ {rangeLabel}
+ </span>
+ </p>
+ </div>
+ <VisitorsChart
+ points={points}
+ summary={`Unique visitors per day, ${rangeLabel}: ${formatNumber(uniqueVisitors)} in total.`}
+ />
+ <div
+ aria-hidden="true"
+ className="flex justify-between text-caption text-subtle tabular-nums"
+ >
+ {tickIndices(series.length).map((i) => (
+ <span key={series[i].date}>{formatDay(series[i].date)}</span>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/components/traffic/visitors-chart.tsx b/app/(home)/sponsors/components/traffic/visitors-chart.tsx
new file mode 100644
index 00000000..b6256127
--- /dev/null
+++ b/app/(home)/sponsors/components/traffic/visitors-chart.tsx
@@ -0,0 +1,148 @@
+"use client";
+
+import { type PointerEvent, useId, useState } from "react";
+import { areaPath, smoothPath, spread } from "./curve";
+
+export type ChartPoint = {
+ /** "Sun, Oct 18" */
+ label: string;
+ visitors: number;
+ /** "614 visitors" */
+ valueLabel: string;
+};
+
+// Plot space, stretched to the box. The baseline sits 6px above the bottom
+// and the busiest day peaks at y=20.5, like the design.
+const VIEW_W = 760;
+const VIEW_H = 220;
+const BASELINE = 214;
+const PEAK_Y = 20.5;
+
+const pctY = (y: number) => `${(y / VIEW_H) * 100}%`;
+const pctX = (x: number) => (x / VIEW_W) * 100;
+
+/** 1, 2 or 5 × 10ⁿ, close to `value`. */
+function niceStep(value: number) {
+ const power = 10 ** Math.floor(Math.log10(value));
+ const f = value / power;
+ return (f < 1.5 ? 1 : f < 3 ? 2 : f < 7 ? 5 : 10) * power;
+}
+
+const DASH_X =
+ "repeating-linear-gradient(90deg, color-mix(in oklab, var(--color-foreground) 10%, transparent) 0 3px, transparent 3px 8px)";
+const DASH_Y =
+ "repeating-linear-gradient(180deg, color-mix(in oklab, var(--color-primary) 35%, transparent) 0 2px, transparent 2px 5px)";
+
+export function VisitorsChart({
+ points,
+ summary,
+}: {
+ points: ChartPoint[];
+ /** Accessible description of the whole chart. */
+ summary: string;
+}) {
+ const gradientId = `visitors-fill-${useId().replace(/[^\w-]/g, "")}`;
+ const values = points.map((p) => p.visitors);
+ const max = Math.max(...values, 0);
+ const yMax = max > 0 ? (max * BASELINE) / (BASELINE - PEAK_Y) : 1;
+ const toY = (v: number) => BASELINE - (v / yMax) * BASELINE;
+ const plotted = spread(values, VIEW_W, toY);
+
+ const step = max > 0 ? niceStep(max / 3) : 0;
+ const grid: number[] = [];
+ for (let v = step; step > 0 && v <= max; v += step) grid.push(toY(v));
+
+ const peak = values.indexOf(max);
+ const [hovered, setHovered] = useState<number | null>(null);
+ const active = hovered ?? peak;
+ const point = points[active];
+ const at = plotted[active];
+
+ const track = (event: PointerEvent<HTMLDivElement>) => {
+ const box = event.currentTarget.getBoundingClientRect();
+ const ratio = Math.min(
+ Math.max((event.clientX - box.left) / box.width, 0),
+ 1,
+ );
+ setHovered(Math.round(ratio * (points.length - 1)));
+ };
+
+ if (!point || !at) return null;
+ const x = pctX(at.x);
+ const flip = x < 50;
+
+ return (
+ <div
+ role="img"
+ aria-label={summary}
+ onPointerDown={track}
+ onPointerMove={track}
+ onPointerLeave={() => setHovered(null)}
+ className="relative h-[180px] w-full shrink-0 touch-pan-y select-none md:h-[220px]"
+ >
+ {grid.map((y) => (
+ <div
+ key={y}
+ aria-hidden="true"
+ className="absolute inset-x-0 h-px"
+ style={{ top: pctY(y), backgroundImage: DASH_X }}
+ />
+ ))}
+ <div
+ aria-hidden="true"
+ className="absolute inset-x-0 h-px bg-foreground/14"
+ style={{ top: pctY(BASELINE) }}
+ />
+ <svg
+ aria-hidden="true"
+ viewBox={`0 0 ${VIEW_W} ${VIEW_H}`}
+ preserveAspectRatio="none"
+ className="absolute inset-0 size-full overflow-visible"
+ >
+ <defs>
+ <linearGradient id={gradientId} x1="0" y1="0" x2="0" y2="1">
+ <stop offset="0%" stopColor="#C026D3" stopOpacity="0.28" />
+ <stop offset="100%" stopColor="#C026D3" stopOpacity="0" />
+ </linearGradient>
+ </defs>
+ <path d={areaPath(plotted, BASELINE)} fill={`url(#${gradientId})`} />
+ <path
+ d={smoothPath(plotted)}
+ fill="none"
+ className="stroke-primary"
+ strokeWidth={2}
+ vectorEffect="non-scaling-stroke"
+ />
+ </svg>
+ <div
+ aria-hidden="true"
+ className="absolute w-px -translate-x-1/2"
+ style={{
+ left: `${x}%`,
+ top: pctY(at.y),
+ bottom: pctY(VIEW_H - BASELINE),
+ backgroundImage: DASH_Y,
+ }}
+ />
+ <div
+ aria-hidden="true"
+ className="absolute size-3 -translate-x-1/2 -translate-y-1/2 rounded-full border-2 border-primary bg-card"
+ style={{ left: `${x}%`, top: pctY(at.y) }}
+ />
+ <div
+ aria-hidden="true"
+ className="pointer-events-none absolute top-1 flex flex-col gap-0.5 rounded-control-sm bg-dark-surface px-3 py-2 whitespace-nowrap dark:bg-secondary dark:shadow-[0_0_0_1px_var(--color-hairline)]"
+ style={
+ flip
+ ? { left: `calc(${x}% + 16px)` }
+ : { right: `calc(${100 - x}% + 16px)` }
+ }
+ >
+ <span className="text-caption text-dark-subtle">{point.label}</span>
+ <span className="text-small text-[#fafafa] tabular-nums">
+ {point.valueLabel}
+ </span>
+ </div>
+ </div>
+ );
+}
diff --git a/app/(home)/sponsors/page.tsx b/app/(home)/sponsors/page.tsx
index 1fe187db..842d1292 100644
--- a/app/(home)/sponsors/page.tsx
+++ b/app/(home)/sponsors/page.tsx
@@ -1,10 +1,11 @@
import type { Metadata } from "next";
-import { Hero } from "./components/sections/hero";
-import { Tiers } from "./components/sections/tiers";
-import { FormerSponsors, WallOfLove } from "./components/sections/wall-of-love";
+import { CreditsSection } from "./components/credits";
+import { SponsorsHero } from "./components/hero";
+import { TiersSection } from "./components/tiers";
+import { TrafficSection } from "./components/traffic";
const DESCRIPTION =
- "Support remocn and keep the components free and open source. Back the project monthly or one-time, from a name in the README to your logo on the landing page.";
+ "Support remocn and keep the components free and open source. Back the project monthly, from a name in the README to your logo on the landing page.";
export const metadata: Metadata = {
title: "Sponsors",
@@ -32,16 +33,10 @@ export const metadata: Metadata = {
export default function SponsorsPage() {
return (
<>
- <Hero />
- <Tiers />
- <div aria-hidden className="section">
- <div className="divider-soft h-px" />
- </div>
- <WallOfLove />
- <div aria-hidden className="section">
- <div className="divider-soft h-px" />
- </div>
- <FormerSponsors />
+ <SponsorsHero />
+ <TrafficSection />
+ <TiersSection />
+ <CreditsSection />
</>
);
}
diff --git a/app/(home)/stars/components/stargazers-deprecated-notice.tsx b/app/(home)/stars/components/stargazers-deprecated-notice.tsx
deleted file mode 100644
index 3b87ac40..00000000
--- a/app/(home)/stars/components/stargazers-deprecated-notice.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { ArrowUpRight } from "lucide-react";
-import Link from "next/link";
-import { buttonVariants } from "@/components/ui/button";
-import {
- Empty,
- EmptyContent,
- EmptyDescription,
- EmptyHeader,
- EmptyMedia,
- EmptyTitle,
-} from "@/components/ui/empty";
-import { cn } from "@/lib/utils";
-
-const STARWALL_URL = "https://starwall.radiumcoders.com/";
-const AUTHOR_X_URL = "https://x.com/radiumcoders";
-
-export function StargazersDeprecatedNotice() {
- return (
- <div className="flex min-h-[70vh] flex-col items-center justify-center">
- <Empty className="max-w-xl gap-6">
- <EmptyHeader className="max-w-md gap-3">
- <EmptyMedia className="mb-1">
- <GitHubIcon className="size-10 text-muted-foreground" />
- </EmptyMedia>
- <EmptyTitle className="text-2xl tracking-tight text-balance sm:text-3xl">
- GitHub turned off the public stargazers API
- </EmptyTitle>
- <EmptyDescription className="max-w-[52ch] text-base text-pretty">
- Reading stargazers now requires authentication, so this tool can no
- longer build your video.{" "}
- <Link href={STARWALL_URL} target="_blank" rel="noreferrer">
- Starwall
- </Link>{" "}
- by Jay does it for you.
- </EmptyDescription>
- </EmptyHeader>
-
- <EmptyContent className="gap-3">
- <Link
- href={STARWALL_URL}
- target="_blank"
- rel="noreferrer"
- className={cn(
- buttonVariants({ size: "lg" }),
- "w-full py-2 pr-3 pl-4",
- )}
- >
- Open Starwall
- <ArrowUpRight className="size-4" />
- </Link>
-
- <p className="text-sm text-muted-foreground">
- Starwall is built entirely by{" "}
- <Link
- href={AUTHOR_X_URL}
- target="_blank"
- rel="noreferrer"
- className="inline-flex items-center gap-1 font-medium text-foreground underline underline-offset-4 hover:text-primary"
- >
- @radiumcoders
- </Link>
- </p>
- </EmptyContent>
- </Empty>
- </div>
- );
-}
-
-const GitHubIcon = ({ className }: { className?: string }) => (
- <svg
- viewBox="0 0 24 24"
- className={cn("shrink-0", className)}
- fill="currentColor"
- role="img"
- aria-label="GitHub"
- >
- <title>GitHub</title>
- <path d="M12 .5C5.65.5.5 5.65.5 12c0 5.08 3.29 9.39 7.86 10.91.58.11.79-.25.79-.56 0-.27-.01-1-.02-1.96-3.2.69-3.87-1.54-3.87-1.54-.52-1.33-1.28-1.69-1.28-1.69-1.05-.72.08-.7.08-.7 1.16.08 1.77 1.19 1.77 1.19 1.03 1.77 2.7 1.26 3.36.96.1-.75.4-1.26.73-1.55-2.55-.29-5.24-1.28-5.24-5.71 0-1.26.45-2.29 1.19-3.1-.12-.29-.52-1.47.11-3.06 0 0 .97-.31 3.18 1.18a11 11 0 0 1 5.79 0c2.21-1.49 3.18-1.18 3.18-1.18.63 1.59.23 2.77.11 3.06.74.81 1.19 1.84 1.19 3.1 0 4.44-2.7 5.41-5.27 5.7.41.36.78 1.06.78 2.14 0 1.55-.01 2.8-.01 3.18 0 .31.21.68.8.56C20.21 21.39 23.5 17.08 23.5 12 23.5 5.65 18.35.5 12 .5Z" />
- </svg>
-);
diff --git a/app/(home)/stars/page.tsx b/app/(home)/stars/page.tsx
index 7c7c45e1..af663881 100644
--- a/app/(home)/stars/page.tsx
+++ b/app/(home)/stars/page.tsx
@@ -1,5 +1,13 @@
import type { Metadata } from "next";
-import { StargazersDeprecatedNotice } from "./components/stargazers-deprecated-notice";
+import Link from "next/link";
+import { LandingButton } from "../components/landing/ui/landing-button";
+import {
+ pageHeaderButton,
+ SitePageHeader,
+} from "../components/site-page/page-header";
+
+const STARWALL_URL = "https://starwall.radiumcoders.com/";
+const AUTHOR_X_URL = "https://x.com/radiumcoders";
export const metadata: Metadata = {
title: "GitHub Stars Video Generator",
@@ -14,14 +22,49 @@ export const metadata: Metadata = {
export default function StarsPage() {
return (
- <section className="relative overflow-hidden pt-10 pb-16 sm:pt-16 sm:pb-24">
- <div aria-hidden className="absolute inset-0 -z-10">
- <div className="absolute inset-0 bg-grid-fade" />
- </div>
-
- <div className="section">
- <StargazersDeprecatedNotice />
+ <SitePageHeader
+ eyebrow="GitHub stars video"
+ title="GitHub turned off"
+ continuation="the public stargazers API."
+ lead={
+ <>
+ Reading stargazers now requires authentication, so this tool can no
+ longer build your video.{" "}
+ <Link
+ href={STARWALL_URL}
+ target="_blank"
+ rel="noreferrer"
+ className="-mx-1 rounded-tag px-1 text-foreground transition-colors hover:bg-muted"
+ >
+ Starwall
+ </Link>{" "}
+ by Jay does it for you.
+ </>
+ }
+ className="pb-16 md:pb-24 xl:pb-[120px]"
+ >
+ <div className="flex flex-col gap-4">
+ <LandingButton
+ href={STARWALL_URL}
+ target="_blank"
+ rel="noreferrer"
+ arrow="↗"
+ className={`${pageHeaderButton} w-full md:w-fit`}
+ >
+ Open Starwall
+ </LandingButton>
+ <p className="text-small text-muted-foreground">
+ Starwall is built entirely by{" "}
+ <Link
+ href={AUTHOR_X_URL}
+ target="_blank"
+ rel="noreferrer"
+ className="-mx-1 rounded-tag px-1 text-foreground transition-colors hover:bg-muted"
+ >
+ @radiumcoders
+ </Link>
+ </p>
</div>
- </section>
+ </SitePageHeader>
);
}
diff --git a/app/api/lab/docs-layout/route.ts b/app/api/lab/docs-layout/route.ts
new file mode 100644
index 00000000..16afee32
--- /dev/null
+++ b/app/api/lab/docs-layout/route.ts
@@ -0,0 +1,16 @@
+import { writeFile } from "node:fs/promises";
+import path from "node:path";
+import { type NextRequest, NextResponse } from "next/server";
+
+const TARGET = path.join(process.cwd(), "config", "docs-layout.json");
+
+export async function POST(request: NextRequest) {
+ if (process.env.NODE_ENV === "production") {
+ return new NextResponse("Not found", { status: 404 });
+ }
+
+ const body = await request.json();
+ await writeFile(TARGET, `${JSON.stringify(body, null, 2)}\n`, "utf8");
+
+ return NextResponse.json({ path: path.relative(process.cwd(), TARGET) });
+}
diff --git a/app/api/lab/header-layout/route.ts b/app/api/lab/header-layout/route.ts
new file mode 100644
index 00000000..f87c84b6
--- /dev/null
+++ b/app/api/lab/header-layout/route.ts
@@ -0,0 +1,16 @@
+import { writeFile } from "node:fs/promises";
+import path from "node:path";
+import { type NextRequest, NextResponse } from "next/server";
+
+const TARGET = path.join(process.cwd(), "config", "header-layout.json");
+
+export async function POST(request: NextRequest) {
+ if (process.env.NODE_ENV === "production") {
+ return new NextResponse("Not found", { status: 404 });
+ }
+
+ const body = await request.json();
+ await writeFile(TARGET, `${JSON.stringify(body, null, 2)}\n`, "utf8");
+
+ return NextResponse.json({ path: path.relative(process.cwd(), TARGET) });
+}
diff --git a/app/api/lab/hero-scenes/route.ts b/app/api/lab/hero-scenes/route.ts
new file mode 100644
index 00000000..608e543c
--- /dev/null
+++ b/app/api/lab/hero-scenes/route.ts
@@ -0,0 +1,26 @@
+import { writeFile } from "node:fs/promises";
+import path from "node:path";
+import { type NextRequest, NextResponse } from "next/server";
+
+const TARGET = path.join(
+ process.cwd(),
+ "app",
+ "(home)",
+ "components",
+ "landing",
+ "sections",
+ "hero",
+ "scenes",
+ "hero-scenes.json",
+);
+
+export async function POST(request: NextRequest) {
+ if (process.env.NODE_ENV === "production") {
+ return new NextResponse("Not found", { status: 404 });
+ }
+
+ const body = await request.json();
+ await writeFile(TARGET, `${JSON.stringify(body, null, 2)}\n`, "utf8");
+
+ return NextResponse.json({ path: path.relative(process.cwd(), TARGET) });
+}
diff --git a/app/api/lab/hero-tiles/route.ts b/app/api/lab/hero-tiles/route.ts
new file mode 100644
index 00000000..9288762e
--- /dev/null
+++ b/app/api/lab/hero-tiles/route.ts
@@ -0,0 +1,26 @@
+import { writeFile } from "node:fs/promises";
+import path from "node:path";
+import { type NextRequest, NextResponse } from "next/server";
+
+const TARGET = path.join(
+ process.cwd(),
+ "app",
+ "(home)",
+ "components",
+ "landing",
+ "sections",
+ "hero",
+ "tiles",
+ "hero-tiles.json",
+);
+
+export async function POST(request: NextRequest) {
+ if (process.env.NODE_ENV === "production") {
+ return new NextResponse("Not found", { status: 404 });
+ }
+
+ const body = await request.json();
+ await writeFile(TARGET, `${JSON.stringify(body, null, 2)}\n`, "utf8");
+
+ return NextResponse.json({ path: path.relative(process.cwd(), TARGET) });
+}
diff --git a/app/api/lab/whats-inside/route.ts b/app/api/lab/whats-inside/route.ts
new file mode 100644
index 00000000..e1db56f4
--- /dev/null
+++ b/app/api/lab/whats-inside/route.ts
@@ -0,0 +1,25 @@
+import { writeFile } from "node:fs/promises";
+import path from "node:path";
+import { type NextRequest, NextResponse } from "next/server";
+
+const TARGET = path.join(
+ process.cwd(),
+ "app",
+ "(home)",
+ "components",
+ "landing",
+ "sections",
+ "whats-inside",
+ "bento.json",
+);
+
+export async function POST(request: NextRequest) {
+ if (process.env.NODE_ENV === "production") {
+ return new NextResponse("Not found", { status: 404 });
+ }
+
+ const body = await request.json();
+ await writeFile(TARGET, `${JSON.stringify(body, null, 2)}\n`, "utf8");
+
+ return NextResponse.json({ path: path.relative(process.cwd(), TARGET) });
+}
diff --git a/app/docs/[[...slug]]/page.tsx b/app/docs/[[...slug]]/page.tsx
index 21968721..7fc3c750 100644
--- a/app/docs/[[...slug]]/page.tsx
+++ b/app/docs/[[...slug]]/page.tsx
@@ -1,10 +1,17 @@
-import { DocsDescription, DocsPage, DocsTitle } from "fumadocs-ui/page";
import { notFound } from "next/navigation";
-import { CopyMarkdownButton } from "@/components/docs/copy-markdown-button";
-import { DocsAdRail } from "@/components/docs/docs-ad-rail";
+import { DocsRail, RailCards } from "@/components/docs/shell/docs-rail";
+import { MobilePageBar } from "@/components/docs/shell/mobile-page-bar";
+import { getPageContext } from "@/components/docs/shell/page-context";
+import { PageFooter } from "@/components/docs/shell/page-footer";
+import { PageHeader } from "@/components/docs/shell/page-header";
+import { getPageLinks } from "@/components/docs/shell/page-links";
import { getMDXComponents } from "@/mdx-components";
import { source } from "@/source";
+/**
+ * One docs page inside `DocsShell`: the mobile page bar, the article (header,
+ * MDX body, prev/next + edit row) and the right rail.
+ */
export default async function Page(props: {
params: Promise<{ slug?: string[] }>;
}) {
@@ -14,31 +21,32 @@ export default async function Page(props: {
const data = page.data;
const MDX = data.body;
- const isIcons = params.slug?.[0] === "icons";
+ const { crumbs, previous, next } = getPageContext(page.url);
+ const links = params.slug?.length ? getPageLinks(page.url) : undefined;
return (
- <DocsPage
- breadcrumb={{ enabled: false }}
- tableOfContent={{ enabled: true, component: <DocsAdRail /> }}
- tableOfContentPopover={{ enabled: false }}
- footer={{ enabled: !isIcons }}
- className={isIcons ? "max-w-none" : undefined}
- >
- <div className="flex items-center justify-between gap-4">
- <DocsTitle className="text-3xl font-semibold tracking-tight text-balance md:text-4xl">
- {data.title}
- </DocsTitle>
- {params.slug?.length ? (
- <CopyMarkdownButton url={`${page.url}.md`} className="shrink-0" />
- ) : null}
+ <>
+ <MobilePageBar crumbs={crumbs} />
+ <div className="flex flex-1">
+ <article className="flex min-w-0 flex-1 flex-col px-5 pt-7 pb-14 lg:px-10 lg:pt-9 lg:pb-16 xl:mx-auto xl:w-full xl:max-w-(--docs-article-max) xl:px-(--docs-article-pad)">
+ <PageHeader
+ title={data.title}
+ description={data.description}
+ links={links}
+ />
+ <div className="typeset typeset-docs mt-6 flex-1 lg:mt-8 [&_:is(h2,h3,h4)[id]]:scroll-mt-20 xl:[&_:is(h2,h3,h4)[id]]:scroll-mt-6">
+ <MDX components={getMDXComponents()} />
+ </div>
+ <PageFooter
+ previous={previous}
+ next={next}
+ sourcePath={`content/docs/${page.path}`}
+ />
+ <RailCards />
+ </article>
+ <DocsRail />
</div>
- <DocsDescription className="mb-0 max-w-xl text-pretty text-base text-muted-foreground md:text-lg">
- {data.description}
- </DocsDescription>
- <div className="typeset typeset-docs mt-8 flex-1">
- <MDX components={getMDXComponents()} />
- </div>
- </DocsPage>
+ </>
);
}
diff --git a/app/docs/layout.tsx b/app/docs/layout.tsx
index 3fbad808..345175e4 100644
--- a/app/docs/layout.tsx
+++ b/app/docs/layout.tsx
@@ -1,61 +1,63 @@
import { RootProvider } from "fumadocs-ui/provider/next";
import type { ReactNode } from "react";
-import { DocsHeader } from "@/components/docs/docs-header";
+import { PageShell } from "@/app/(home)/components/page-shell";
+import { SiteFooter } from "@/app/(home)/components/site-footer";
+import { SiteHeader } from "@/app/(home)/components/site-header";
import { DocsShell } from "@/components/docs/docs-shell";
-import { DocsTabsBar } from "@/components/docs/docs-tabs-bar";
-import { splitDocsTree } from "@/lib/docs-tabs";
-import { withNewBadges } from "@/lib/with-new-badges";
-import remocnRegistry from "@/registry/remocn/registry.json";
+import { HeaderSearch } from "@/components/docs/shell/header-search";
+import {
+ buildSidebarModel,
+ type SidebarModel,
+} from "@/components/docs/shell/sidebar-model";
+import { DOCS_LAYOUT, docsLayoutVars } from "@/lib/docs-layout";
+import { DOCS_TABS, type DocsTabId, splitDocsTree } from "@/lib/docs-tabs";
import iconsRegistry from "@/registry/remocn-icons/registry.json";
-import templatesRegistry from "@/registry/remocn-templates/registry.json";
-import uiRegistry from "@/registry/remocn-ui/registry.json";
import { source } from "@/source";
-const componentCount = [
- ...remocnRegistry.items,
- ...uiRegistry.items,
- ...iconsRegistry.items,
- ...templatesRegistry.items,
-].filter((item) => item.type === "registry:component").length;
+const iconCount = iconsRegistry.items.filter(
+ (item) => item.type === "registry:component",
+).length;
-export default async function Layout({ children }: { children: ReactNode }) {
- // Decorate the shared page tree with the animated "NEW" sidebar badge (see
- // `withNewBadges`), then split it into the Components / Primitives tab trees
- // (see `splitDocsTree`). Both run on the server; `DocsShell` picks the tree
- // matching the active tab by pathname so each category owns its own sidebar.
- const {
- components,
- primitives,
- shaders,
- filters,
- captions,
- templates,
- icons,
- } = splitDocsTree(withNewBadges(source.pageTree));
+export default function Layout({ children }: { children: ReactNode }) {
+ // Split the page tree into one tree per library and flatten each into a
+ // plain sidebar model on the server; the shell picks one by pathname.
+ const trees = splitDocsTree(source.pageTree);
+ const models = Object.fromEntries(
+ DOCS_TABS.map((tab) => [
+ tab.id,
+ buildSidebarModel(tab.id, tab.label, trees[tab.id], {
+ icons: iconCount,
+ }),
+ ]),
+ ) as Record<DocsTabId, SidebarModel>;
return (
- // fumadocs search + sidebar context lives here (docs-only) instead of the
- // root layout, so non-docs routes never compile fumadocs-ui. `theme.enabled:
- // false` defers to the root next-themes ThemeProvider — no double provider.
+ // fumadocs search context lives here (docs-only) instead of the root
+ // layout, so non-docs routes never compile fumadocs-ui. `theme.enabled:
+ // false` defers to the root next-themes ThemeProvider.
<RootProvider theme={{ enabled: false }}>
- {/* Custom remocn chrome: the main header (logo + site nav + actions), then
- a thin bar holding the Components/Primitives switcher. Both are static
- (non-sticky) and content-aligned so they track the docs grid — logo
- over the sidebar, tabs starting at the article column's left edge. */}
- <DocsHeader />
- <DocsTabsBar />
- <DocsShell
- componentsTree={components}
- primitivesTree={primitives}
- shadersTree={shaders}
- filtersTree={filters}
- captionsTree={captions}
- templatesTree={templates}
- iconsTree={icons}
- componentCount={componentCount}
- >
- {children}
- </DocsShell>
+ <PageShell>
+ {/* Frame sizes as CSS variables (`lib/docs-layout.ts`); `contents`
+ keeps the flex column of the page shell intact. The docs layout
+ lab finds this element and rewrites the variables live. */}
+ <div
+ data-docs-layout
+ className="contents"
+ style={docsLayoutVars(DOCS_LAYOUT)}
+ >
+ {/* The docs grid is wider than the landing column: at `xl` the
+ shared header stretches to the docs frame (`lib/docs-layout.ts`), and sits
+ 20px from the top like the docs artboards (28px on the landing). */}
+ <div className="lg:[&>header>div]:pt-5 xl:[&>header>div]:max-w-(--docs-frame) xl:[&>header>div]:px-(--docs-gutter)">
+ <SiteHeader mobileAction={<HeaderSearch />} />
+ </div>
+ <DocsShell models={models}>{children}</DocsShell>
+ {/* Same frame for the footer, with the docs' hairline on top. */}
+ <div className="border-hairline lg:border-t lg:pt-7 lg:[&>footer]:pb-8 xl:[&_.landing-container]:max-w-(--docs-frame) xl:[&_.landing-container]:px-(--docs-gutter)">
+ <SiteFooter />
+ </div>
+ </div>
+ </PageShell>
</RootProvider>
);
}
diff --git a/app/fonts/PaperMono-OFL.txt b/app/fonts/PaperMono-OFL.txt
new file mode 100644
index 00000000..00aff856
--- /dev/null
+++ b/app/fonts/PaperMono-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2025 The Paper-Mono.Git Project Authors (https://github.com/paper-design/paper-mono.git)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+https://openfontlicense.org
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
\ No newline at end of file
diff --git a/app/fonts/PaperMono-Variable.woff2 b/app/fonts/PaperMono-Variable.woff2
new file mode 100644
index 00000000..4e45300e
Binary files /dev/null and b/app/fonts/PaperMono-Variable.woff2 differ
diff --git a/app/globals.css b/app/globals.css
index ac30f5a5..84d1512d 100644
--- a/app/globals.css
+++ b/app/globals.css
@@ -11,9 +11,94 @@
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
- --font-sans: var(--font-sans);
- --font-mono: var(--font-geist-mono);
- --font-heading: var(--font-sans);
+ --font-sans: var(--font-geist-sans);
+ --font-mono: var(--font-paper-mono);
+ --font-heading: var(--font-geist-sans);
+ --font-wordmark: var(--font-manrope);
+
+ /* Design system (Paper "Remocn · Component Ideas" → Design system page).
+ Surfaces and text roles that shadcn's palette has no slot for. */
+ --color-surface: var(--surface);
+ --color-surface-muted: var(--surface-muted);
+ --color-surface-sunken: var(--surface-sunken);
+ --color-tile: var(--tile);
+ --color-capsule: var(--capsule);
+ --color-hairline: var(--hairline);
+ --color-divider: var(--divider);
+ --color-foreground-nav: var(--foreground-nav);
+ --color-body: var(--body);
+ --color-body-muted: var(--body-muted);
+ --color-paragraph: var(--paragraph);
+ --color-title-muted: var(--title-muted);
+ --color-subtle: var(--subtle);
+ /* `subtle` is a text tone (4.5:1 on every surface); dots, ticks, strokes
+ and borders that used it keep the paler value here. */
+ --color-subtle-line: var(--subtle-line);
+ --color-inverse: var(--inverse);
+ --color-primary-strong: var(--primary-strong);
+ --color-primary-bright: var(--primary-bright);
+ --color-primary-soft: var(--primary-soft);
+ --color-primary-tint: var(--primary-tint);
+ --color-primary-wash: var(--primary-wash);
+ /* Always-dark blocks (terminal, studio pipeline, install strip) keep the
+ same palette in both themes. */
+ --color-dark-surface: #0e1012;
+ --color-dark-raised: #1a1c1e;
+ --color-dark-control: #1e2124;
+ --color-dark-line: #23272a;
+ --color-dark-border: rgb(255 255 255 / 8%);
+ --color-dark-body: #b8bec2;
+ --color-dark-muted: #7d8a8f;
+ --color-dark-subtle: #9aa3a7;
+ --color-success: #22c55e;
+ --color-success-soft: #86efac;
+ --color-neon: #00e599;
+ --color-claude: #d97757;
+
+ --text-micro: 11px;
+ --text-micro--line-height: 14px;
+ --text-mono: 12px;
+ --text-mono--line-height: 16px;
+ --text-caption: 13px;
+ --text-caption--line-height: 16px;
+ --text-small: 14px;
+ --text-small--line-height: 20px;
+ --text-ui: 16px;
+ --text-ui--line-height: 20px;
+ --text-button-lg: 17px;
+ --text-button-lg--line-height: 22px;
+ --text-lead: 20px;
+ --text-lead--line-height: 28px;
+ --text-quote: 26px;
+ --text-quote--line-height: 36px;
+ --text-h3: 48px;
+ --text-h3--line-height: 50px;
+ --text-h3--letter-spacing: -0.045em;
+ --text-h2: 56px;
+ --text-h2--line-height: 58px;
+ --text-h2--letter-spacing: -0.045em;
+ --text-display: 124px;
+ --text-display--line-height: 124px;
+ --text-display--letter-spacing: -0.05em;
+
+ --tracking-display: -0.05em;
+ --tracking-heading: -0.045em;
+ --tracking-title: -0.02em;
+
+ --radius-tag: 6px;
+ --radius-tile: 8px;
+ --radius-control-sm: 12px;
+ --radius-control: 14px;
+ --radius-cta: 16px;
+ --radius-capsule: 18px;
+ --radius-card: 20px;
+ --radius-panel: 24px;
+ --radius-shell: 28px;
+
+ --spacing-gutter: 100px;
+ --spacing-section: 120px;
+ --container-content: 1240px;
+ --container-prose: 640px;
--color-sidebar-ring: var(--sidebar-ring);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
@@ -63,45 +148,76 @@
transform: translateX(-50%);
}
}
+ --animate-marquee-y: marquee-y var(--marquee-duration, 60s) linear infinite;
+ @keyframes marquee-y {
+ from {
+ transform: translateY(0);
+ }
+ to {
+ transform: translateY(-50%);
+ }
+ }
}
:root {
- --background: oklch(1 0 0);
- --foreground: oklch(0.148 0.004 228.8);
- --card: oklch(1 0 0);
- --card-foreground: oklch(0.148 0.004 228.8);
- --popover: oklch(1 0 0);
- --popover-foreground: oklch(0.148 0.004 228.8);
- --primary: oklch(0.518 0.253 323.949);
- --primary-foreground: oklch(0.977 0.017 320.058);
- --secondary: oklch(0.963 0.002 197.1);
- --secondary-foreground: oklch(0.218 0.008 223.9);
- --muted: oklch(0.963 0.002 197.1);
- --muted-foreground: oklch(0.56 0.021 213.5);
- --accent: oklch(0.963 0.002 197.1);
- --accent-foreground: oklch(0.218 0.008 223.9);
+ --background: #fafafa;
+ --foreground: #0e1012;
+ --card: #ffffff;
+ --card-foreground: #0e1012;
+ --popover: #ffffff;
+ --popover-foreground: #0e1012;
+ --primary: #a800b7;
+ --primary-foreground: #ffffff;
+ --secondary: #e4e5e7;
+ --secondary-foreground: #0e1012;
+ --muted: #f4f4f5;
+ --muted-foreground: #57646a;
+ --accent: #f4f4f5;
+ --accent-foreground: #0e1012;
--destructive: oklch(0.577 0.245 27.325);
- --border: oklch(0.925 0.005 214.3);
- --input: oklch(0.925 0.005 214.3);
- --ring: oklch(0.723 0.014 214.4);
+ --border: rgb(14 16 18 / 12%);
+ --input: rgb(14 16 18 / 12%);
+ /* Focus rings draw at full opacity: 5.9:1 on the page (3:1 is the floor). */
+ --ring: #57646a;
--chart-1: oklch(0.872 0.007 219.6);
--chart-2: oklch(0.56 0.021 213.5);
--chart-3: oklch(0.45 0.017 213.2);
--chart-4: oklch(0.378 0.015 216);
--chart-5: oklch(0.275 0.011 216.9);
--radius: 0.625rem;
- --sidebar: oklch(0.987 0.002 197.1);
- --sidebar-foreground: oklch(0.148 0.004 228.8);
- --sidebar-primary: oklch(0.591 0.293 322.896);
- --sidebar-primary-foreground: oklch(0.977 0.017 320.058);
- --sidebar-accent: oklch(0.963 0.002 197.1);
- --sidebar-accent-foreground: oklch(0.218 0.008 223.9);
- --sidebar-border: oklch(0.925 0.005 214.3);
- --sidebar-ring: oklch(0.723 0.014 214.4);
- --code: oklch(0.963 0.002 197.1);
- --code-foreground: oklch(0.148 0.004 228.8);
- --code-highlight: oklch(0.93 0.004 214.3);
- --code-number: oklch(0.56 0.021 213.5);
+ --sidebar: #fafafa;
+ --sidebar-foreground: #0e1012;
+ --sidebar-primary: #a800b7;
+ --sidebar-primary-foreground: #ffffff;
+ --sidebar-accent: #f4f4f5;
+ --sidebar-accent-foreground: #0e1012;
+ --sidebar-border: rgb(14 16 18 / 12%);
+ --sidebar-ring: #9aa3a7;
+ --code: #f4f4f5;
+ --code-foreground: #0e1012;
+ --code-highlight: #e4e5e7;
+ --code-number: #6b7a80;
+
+ --surface: #ffffff;
+ --surface-muted: #f4f4f5;
+ --surface-sunken: #f2f2f4;
+ --tile: #eff0f1;
+ --capsule: rgb(226 226 229 / 75%);
+ --hairline: rgb(14 16 18 / 6%);
+ --divider: rgb(14 16 18 / 12%);
+ --foreground-nav: #1a1c1e;
+ --body: #2a2e31;
+ --body-muted: #4a5054;
+ --paragraph: #3a3f43;
+ --title-muted: #818a8e;
+ --subtle: #646d71;
+ --subtle-line: #9aa3a7;
+ --inverse: #fafafa;
+ --primary-strong: #86198f;
+ --primary-bright: #c026d3;
+ --primary-soft: #f0abfc;
+ --primary-tint: #f5d0fe;
+ --primary-wash: #fbe8fd;
--elevation-raised:
0 0 0 1px rgb(0 0 0 / 0.05), 0 1px 3px rgb(0 0 0 / 0.05), 0 4px 10px -4px
@@ -122,41 +238,62 @@
}
.dark {
- --background: oklch(0.148 0.004 228.8);
- --foreground: oklch(0.987 0.002 197.1);
- --card: oklch(0.175 0.005 225);
- --card-foreground: oklch(0.987 0.002 197.1);
- --popover: oklch(0.19 0.006 225);
- --popover-foreground: oklch(0.987 0.002 197.1);
- --primary: oklch(0.452 0.211 324.591);
- --primary-foreground: oklch(0.977 0.017 320.058);
- --secondary: oklch(0.225 0.008 224);
- --secondary-foreground: oklch(0.985 0 0);
- --muted: oklch(0.205 0.007 225);
- --muted-foreground: oklch(0.723 0.014 214.4);
- --accent: oklch(0.225 0.008 224);
- --accent-foreground: oklch(0.987 0.002 197.1);
+ --background: #0c0d0f;
+ --foreground: #f4f4f5;
+ --card: #151719;
+ --card-foreground: #f4f4f5;
+ --popover: #1b1d20;
+ --popover-foreground: #f4f4f5;
+ --primary: #d946ef;
+ --primary-foreground: #0e1012;
+ --secondary: #2a2d31;
+ --secondary-foreground: #f4f4f5;
+ --muted: #1b1d20;
+ --muted-foreground: #8b979c;
+ --accent: #2a2d31;
+ --accent-foreground: #f4f4f5;
--destructive: oklch(0.704 0.191 22.216);
- --border: oklch(1 0 0 / 10%);
- --input: oklch(1 0 0 / 15%);
- --ring: oklch(0.56 0.021 213.5);
+ --border: rgb(255 255 255 / 12%);
+ --input: rgb(255 255 255 / 15%);
+ --ring: #8b979c;
--chart-1: oklch(0.872 0.007 219.6);
--chart-2: oklch(0.56 0.021 213.5);
--chart-3: oklch(0.45 0.017 213.2);
--chart-4: oklch(0.378 0.015 216);
--chart-5: oklch(0.275 0.011 216.9);
- --sidebar: oklch(0.148 0.004 228.8);
- --sidebar-foreground: oklch(0.987 0.002 197.1);
- --sidebar-primary: oklch(0.667 0.295 322.15);
- --sidebar-primary-foreground: oklch(0.977 0.017 320.058);
- --sidebar-accent: oklch(0.205 0.007 225);
- --sidebar-accent-foreground: oklch(0.987 0.002 197.1);
- --sidebar-border: oklch(1 0 0 / 10%);
- --sidebar-ring: oklch(0.56 0.021 213.5);
- --code: oklch(0.13 0.004 228.8);
- --code-foreground: oklch(0.987 0.002 197.1);
- --code-highlight: oklch(0.225 0.008 224);
- --code-number: oklch(0.56 0.021 213.5);
+ --sidebar: #0c0d0f;
+ --sidebar-foreground: #f4f4f5;
+ --sidebar-primary: #d946ef;
+ --sidebar-primary-foreground: #0e1012;
+ --sidebar-accent: #1b1d20;
+ --sidebar-accent-foreground: #f4f4f5;
+ --sidebar-border: rgb(255 255 255 / 12%);
+ --sidebar-ring: #626c70;
+ --code: #101214;
+ --code-foreground: #f4f4f5;
+ --code-highlight: #1b1d20;
+ --code-number: #626c70;
+
+ --surface: #151719;
+ --surface-muted: #1b1d20;
+ --surface-sunken: #101214;
+ --tile: #151719;
+ --capsule: rgb(38 40 44 / 75%);
+ --hairline: rgb(255 255 255 / 7%);
+ --divider: rgb(255 255 255 / 12%);
+ --foreground-nav: #f4f4f5;
+ --body: #c8cdd0;
+ --body-muted: #a3acb0;
+ --paragraph: #c8cdd0;
+ --title-muted: #626c70;
+ --subtle: #7e868a;
+ --subtle-line: #626c70;
+ --inverse: #0e1012;
+ --primary-strong: #f0abfc;
+ --primary-bright: #e879f9;
+ --primary-soft: #f0abfc;
+ --primary-tint: rgb(217 70 239 / 18%);
+ --primary-wash: rgb(217 70 239 / 10%);
--elevation-raised: 0 0 0 1px rgb(255 255 255 / 0.09);
--elevation-raised-hover: 0 0 0 1px rgb(255 255 255 / 0.14);
@@ -174,17 +311,27 @@
* {
@apply border-border outline-ring/50;
}
+ /* Inner scroll areas (sidebar, rail, code, rows) scroll without a visible
+ bar; the page's own scrollbar stays. */
+ *:not(html) {
+ scrollbar-width: none;
+ }
+ *:not(html)::-webkit-scrollbar {
+ display: none;
+ }
body {
@apply bg-background text-foreground;
- font-feature-settings: "cv11", "ss01";
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
}
html {
@apply font-sans;
font-synthesis: none;
- scroll-behavior: smooth;
scroll-padding-top: 80px;
+
+ @media (prefers-reduced-motion: no-preference) {
+ scroll-behavior: smooth;
+ }
}
}
@@ -196,6 +343,11 @@
@apply mx-auto w-full max-w-6xl px-4 sm:px-6 min-[1440px]:max-w-5xl;
}
+/* Landing container: 1240px content inside the 100px desktop gutter. */
+.landing-container {
+ @apply mx-auto w-full max-w-content px-5 md:px-10 xl:px-0;
+}
+
.control-surface {
@apply bg-muted;
box-shadow:
@@ -274,11 +426,6 @@
);
}
-[data-rehype-pretty-code-figure] pre {
- scrollbar-width: thin;
- scrollbar-color: color-mix(in oklab, currentColor 25%, transparent)
- transparent;
-}
.typeset figure.shiki {
/* biome-ignore lint/complexity/noImportantStyles: overrides shiki's own inline background/border/shadow, which outrank this class in specificity */
background-color: var(--muted) !important;
@@ -293,11 +440,6 @@
/* biome-ignore lint/complexity/noImportantStyles: see above */
background-color: transparent !important;
}
-.typeset figure.shiki pre {
- scrollbar-width: thin;
- scrollbar-color: color-mix(in oklab, currentColor 25%, transparent)
- transparent;
-}
[data-rehype-pretty-code-figure] {
position: relative;
@@ -391,102 +533,754 @@
);
}
-#nd-sidebar a,
-#nd-sidebar-mobile a {
- font-size: 0.8125rem;
- letter-spacing: -0.01em;
+/*
+ * Iridescent metal border that slowly travels around the contour. Two parts:
+ * `border-metal` paints the face (padding box) and leaves the border
+ * transparent; `<MetalRing />` (`metal-ring`) fills the border with the ring:
+ * <a class="relative border-metal border rounded-[11px]">… <MetalRing /></a>
+ * <a class="relative border-metal border-2 rounded-[14px]">… <MetalRing width={2} /></a>
+ * The ring is a conic gradient on a square layer that spins with `rotate`,
+ * masked to the border, so the motion runs on the compositor (animating the
+ * gradient's angle would repaint on the main thread every frame).
+ * The face lifts slightly on hover in both themes; override the
+ * `--metal-face-*` / `--metal-hover-*` variables for a one-off.
+ */
+@keyframes metal-spin {
+ to {
+ rotate: 360deg;
+ }
}
-#nd-sidebar p,
-#nd-sidebar-mobile p {
- text-transform: uppercase;
- letter-spacing: 0.08em;
- font-size: 0.6875rem;
- font-weight: 600;
- color: var(--muted-foreground);
+@utility metal-ring {
+ position: absolute;
+ inset: calc(-1 * var(--metal-width, 1px));
+ z-index: -1;
+ padding: var(--metal-width, 1px);
+ border-radius: inherit;
+ overflow: clip;
+ pointer-events: none;
+ mask:
+ linear-gradient(#000 0 0) content-box exclude,
+ linear-gradient(#000 0 0);
+
+ &::before {
+ content: "";
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ /* A square at least as wide as the diagonal, so the corners stay covered. */
+ width: 150%;
+ min-height: 150%;
+ aspect-ratio: 1;
+ translate: -50% -50%;
+ background: conic-gradient(
+ from 200deg in oklab,
+ #ffffff 0%,
+ #b47bbe 10%,
+ #f7eef9 20%,
+ #3a1f40 30%,
+ #e879f9 40%,
+ #ffffff 50%,
+ #8a5a93 60%,
+ #f5d0fe 70%,
+ #2e1633 80%,
+ #c026d3 90%,
+ #ffffff 100%
+ );
+ animation: metal-spin 6s linear infinite;
+ }
+
+ @media (prefers-reduced-motion: reduce) {
+ &::before {
+ animation: none;
+ }
+ }
}
-#nd-sidebar a[data-active],
-#nd-sidebar-mobile a[data-active] {
- padding-block: 0.375rem;
- color: var(--foreground);
- transition: color 150ms ease;
+@utility border-metal {
+ --metal-face-from: #ffffff;
+ --metal-face-to: #f6f7f8;
+ --metal-hover-from: #fdfafe;
+ --metal-hover-to: #f3eef5;
+ isolation: isolate;
+ border-color: transparent;
+ background: linear-gradient(
+ 180deg,
+ var(--metal-face-from),
+ var(--metal-face-to)
+ )
+ padding-box;
+
+ @variant dark {
+ --metal-face-from: #1b1d20;
+ --metal-face-to: #151719;
+ --metal-hover-from: #26292d;
+ --metal-hover-to: #1d1f23;
+ }
+
+ @media (hover: hover) {
+ &:hover {
+ --metal-face-from: var(--metal-hover-from);
+ --metal-face-to: var(--metal-hover-to);
+ }
+ }
}
-#nd-sidebar a[data-active]:hover,
-#nd-sidebar-mobile a[data-active]:hover {
- color: var(--foreground);
- background-color: transparent;
+
+/* Text caret in the hero composer: hard on/off, like an editor. */
+@keyframes caret-blink {
+ 0%,
+ 100% {
+ opacity: 1;
+ }
+ 50% {
+ opacity: 0;
+ }
}
-#nd-sidebar a[data-active="true"],
-#nd-sidebar-mobile a[data-active="true"] {
- position: relative;
- font-weight: 500;
- color: var(--foreground);
- background-color: color-mix(in oklab, var(--accent) 80%, transparent);
+@theme {
+ --ease-tile-out: cubic-bezier(0.22, 1, 0.36, 1);
+ /* Picked-chip tiles move an inner layer with `transform`, never
+ `background-position`, so the loops stay on the compositor. */
+ --animate-tile-drift: tile-drift 5s ease-in-out infinite alternate;
+ --animate-tile-pan: tile-pan 5s ease-in-out infinite alternate;
+ --animate-tile-blur-in: tile-blur-in 2.8s var(--ease-tile-out) infinite;
+ --animate-tile-type: tile-type 2.8s steps(1) infinite;
+ --animate-tile-roll: tile-roll 3.6s var(--ease-tile-out) infinite;
+ --animate-tile-zoom: tile-zoom 2.6s var(--ease-tile-out) infinite;
+ --animate-tile-whip: tile-whip 3s cubic-bezier(0.65, 0, 0.35, 1) infinite;
+ --animate-tile-glitch: tile-glitch 2.4s steps(1) infinite;
+ --animate-tile-karaoke: tile-karaoke 2.4s linear infinite;
+ --animate-tile-grow: tile-grow 2.6s var(--ease-tile-out) infinite;
+ --animate-tile-line: tile-line 2.4s steps(4) infinite;
+ --animate-tile-pop: tile-pop 2.6s cubic-bezier(0.34, 1.56, 0.64, 1) infinite;
+ --animate-tile-scanline: tile-scanline 0.6s linear infinite;
+ --animate-tile-flicker: tile-flicker 3s steps(1) infinite;
+ --animate-tile-cursor: tile-cursor 2.8s var(--ease-tile-out) infinite;
+ --animate-tile-draw: tile-draw 2.6s var(--ease-tile-out) infinite;
+
+ /* Same path as `background-position: 0% 30%` → `100% 70%` on a 260%
+ wide 1280×600 image: the layer is 260% × 121.875% of the tile. */
+ @keyframes tile-drift {
+ from {
+ transform: translate(0, -5.38%);
+ }
+ to {
+ transform: translate(-61.54%, -12.56%);
+ }
+ }
+ @keyframes tile-pan {
+ from {
+ transform: translateX(0);
+ }
+ to {
+ transform: translateX(-50%);
+ }
+ }
+ @keyframes tile-blur-in {
+ 0% {
+ opacity: 0;
+ filter: blur(4px);
+ transform: translateY(3px);
+ }
+ 40%,
+ 85% {
+ opacity: 1;
+ filter: blur(0);
+ transform: translateY(0);
+ }
+ 100% {
+ opacity: 0;
+ filter: blur(2px);
+ transform: translateY(0);
+ }
+ }
+ @keyframes tile-type {
+ 0% {
+ clip-path: inset(0 100% 0 0);
+ }
+ 14% {
+ clip-path: inset(0 52% 0 0);
+ }
+ 28%,
+ 90% {
+ clip-path: inset(0 0 0 0);
+ }
+ 100% {
+ clip-path: inset(0 100% 0 0);
+ }
+ }
+ @keyframes tile-roll {
+ 0%,
+ 22% {
+ transform: translateY(0);
+ }
+ 33%,
+ 55% {
+ transform: translateY(-26px);
+ }
+ 66%,
+ 88% {
+ transform: translateY(-52px);
+ }
+ 100% {
+ transform: translateY(-78px);
+ }
+ }
+ @keyframes tile-zoom {
+ 0% {
+ opacity: 0;
+ filter: blur(3px);
+ transform: scale(0.3);
+ }
+ 45%,
+ 85% {
+ opacity: 1;
+ filter: blur(0);
+ transform: scale(1);
+ }
+ 100% {
+ opacity: 0;
+ filter: blur(3px);
+ transform: scale(1.6);
+ }
+ }
+ @keyframes tile-whip {
+ 0%,
+ 30% {
+ transform: translateX(0);
+ filter: blur(0);
+ }
+ 40% {
+ filter: blur(1.5px);
+ }
+ 50%,
+ 80% {
+ transform: translateX(-33.333%);
+ filter: blur(0);
+ }
+ 90% {
+ filter: blur(1.5px);
+ }
+ 100% {
+ transform: translateX(-66.666%);
+ filter: blur(0);
+ }
+ }
+ @keyframes tile-glitch {
+ 0%,
+ 58% {
+ transform: translateX(0);
+ }
+ 60% {
+ transform: translateX(3px);
+ }
+ 63% {
+ transform: translateX(-2px);
+ }
+ 66% {
+ transform: translateX(1px);
+ }
+ 69%,
+ 100% {
+ transform: translateX(0);
+ }
+ }
+ @keyframes tile-karaoke {
+ from {
+ transform: translateX(-50%);
+ }
+ to {
+ transform: translateX(0);
+ }
+ }
+ @keyframes tile-grow {
+ 0% {
+ transform: scaleY(0);
+ }
+ 35%,
+ 85% {
+ transform: scaleY(1);
+ }
+ 100% {
+ transform: scaleY(0);
+ }
+ }
+ @keyframes tile-line {
+ 0% {
+ transform: scaleX(0);
+ }
+ 50%,
+ 90% {
+ transform: scaleX(1);
+ }
+ 100% {
+ transform: scaleX(0);
+ }
+ }
+ @keyframes tile-pop {
+ 0% {
+ opacity: 0;
+ transform: scale(0.4);
+ }
+ 30%,
+ 85% {
+ opacity: 1;
+ transform: scale(1);
+ }
+ 100% {
+ opacity: 0;
+ transform: scale(1);
+ }
+ }
+ @keyframes tile-scan {
+ from {
+ background-position: 0 0;
+ }
+ to {
+ background-position: 0 4px;
+ }
+ }
+ @keyframes tile-scanline {
+ to {
+ transform: translateY(4px);
+ }
+ }
+ @keyframes tile-flicker {
+ 0%,
+ 70% {
+ opacity: 1;
+ }
+ 72% {
+ opacity: 0.6;
+ }
+ 74%,
+ 100% {
+ opacity: 1;
+ }
+ }
+ @keyframes tile-cursor {
+ 0% {
+ transform: translate(-6px, 5px) scale(1);
+ }
+ 40% {
+ transform: translate(1px, -1px) scale(1);
+ }
+ 48% {
+ transform: translate(1px, -1px) scale(0.8);
+ }
+ 56%,
+ 85% {
+ transform: translate(1px, -1px) scale(1);
+ }
+ 100% {
+ transform: translate(-6px, 5px) scale(1);
+ }
+ }
+ @keyframes tile-draw {
+ 0% {
+ stroke-dashoffset: 1;
+ opacity: 1;
+ }
+ 40%,
+ 85% {
+ stroke-dashoffset: 0;
+ opacity: 1;
+ }
+ 100% {
+ stroke-dashoffset: 0;
+ opacity: 0;
+ }
+ }
+}
+
+figure[data-paused] [data-tile],
+figure[data-paused] [data-tile] * {
+ animation-play-state: paused;
}
-#nd-sidebar a[data-active="true"]:hover,
-#nd-sidebar-mobile a[data-active="true"]:hover {
- background-color: color-mix(in oklab, var(--accent) 80%, transparent);
+
+@keyframes scene-drift {
+ from {
+ background-position:
+ 0 0,
+ 15% 35%;
+ }
+ to {
+ background-position:
+ 0 0,
+ 85% 65%;
+ }
}
-#nd-sidebar a[data-active="true"]::before,
-#nd-sidebar-mobile a[data-active="true"]::before {
- content: "";
- position: absolute;
- inset-inline-start: 0;
- inset-block: 0.3rem;
- width: 2px;
- border-radius: 1px;
- background-color: var(--foreground);
+
+@keyframes scene-float {
+ 0%,
+ 100% {
+ translate: 0 0;
+ rotate: 0deg;
+ }
+ 25% {
+ translate: calc(var(--float-amp) * 0.6) calc(var(--float-amp) * -1);
+ rotate: var(--float-tilt);
+ }
+ 50% {
+ translate: calc(var(--float-amp) * -0.4) calc(var(--float-amp) * -0.3);
+ rotate: 0deg;
+ }
+ 75% {
+ translate: calc(var(--float-amp) * -0.7) calc(var(--float-amp) * 0.8);
+ rotate: calc(var(--float-tilt) * -1);
+ }
+}
+
+@theme {
+ --ease-reveal: cubic-bezier(0.19, 1, 0.22, 1);
+}
+
+@property --reveal-i {
+ syntax: "<number>";
+ inherits: false;
+ initial-value: 0;
+}
+
+@property --count {
+ syntax: "<integer>";
+ inherits: false;
+ initial-value: 0;
+}
+
+@keyframes reveal-rise {
+ from {
+ opacity: 0;
+ translate: 0 20px;
+ }
+}
+
+@keyframes reveal-nudge {
+ from {
+ opacity: 0;
+ translate: 0 8px;
+ }
+}
+
+@keyframes reveal-text {
+ from {
+ opacity: 0;
+ translate: 0 12px;
+ filter: blur(6px);
+ }
+}
+
+@keyframes reveal-fade {
+ from {
+ opacity: 0;
+ }
+}
+
+@keyframes reveal-scale {
+ from {
+ opacity: 0;
+ translate: 0 14px;
+ scale: 0.97;
+ }
+}
+
+@keyframes reveal-draw {
+ from {
+ scale: 0 1;
+ }
+}
+
+@keyframes reveal-pop {
+ from {
+ opacity: 0;
+ scale: 0.8;
+ }
+}
+
+@keyframes reveal-type {
+ from {
+ clip-path: inset(0 100% 0 0);
+ }
+ to {
+ clip-path: inset(0);
+ }
+}
+
+@keyframes reveal-arrive {
+ from {
+ opacity: 0;
+ translate: 0 0.3em;
+ filter: blur(16px);
+ }
+}
+
+@keyframes reveal-settle {
+ from {
+ scale: 1.12;
+ }
+}
+
+@keyframes count-up {
+ from {
+ --count: 0;
+ }
+}
+
+.hero-in {
+ animation: reveal-text 1000ms var(--ease-reveal) backwards;
+ animation-delay: calc(var(--reveal-i) * 90ms + 80ms);
+}
+
+.hero-in.hero-rise {
+ animation-name: reveal-rise;
+}
+
+:root[data-reveal-ready]
+ [data-reveal]:not(
+ [data-shown],
+ [data-reveal="trigger"],
+ [data-reveal="stagger"],
+ [data-reveal="draw"]
+ ) {
+ opacity: 0;
+}
+
+/*
+ * Sections out of view pause their loops (see PauseOffscreen). Loops are
+ * listed by name rather than `*`: toggling the attribute then restyles only
+ * these few elements instead of the whole section subtree mid-scroll.
+ */
+[data-section][data-offscreen]
+ :is([data-loop], .animate-marquee-y, .animate-marquee),
+[data-section][data-offscreen] .metal-ring::before {
+ /* biome-ignore lint/complexity/noImportantStyles: some loops set `animation` inline (scene-float), which only !important can pause */
+ animation-play-state: paused !important;
+}
+
+/*
+ * Loops inside a block that hasn't revealed yet wait for it. Chrome won't hand
+ * an animation to the compositor when it starts under a static `opacity: 0`,
+ * and never retries, so it would tick on the main thread for good. Resuming
+ * together with the reveal animation lets it composite.
+ */
+:root[data-reveal-ready]
+ [data-reveal]:not([data-shown])
+ :is(.animate-marquee-y, .animate-marquee),
+:root[data-reveal-ready] [data-reveal]:not([data-shown]) .metal-ring::before {
+ animation-play-state: paused;
+}
+
+:root[data-reveal-ready] [data-reveal="draw"]:not([data-shown]) {
+ scale: 0 1;
+}
+
+:root[data-reveal-ready] [data-reveal="stagger"]:not([data-shown]) > * {
+ opacity: 0;
+}
+
+[data-shown="in"] {
+ animation: reveal-rise 900ms var(--ease-reveal) backwards;
+ animation-delay: calc(var(--reveal-i) * 80ms);
+}
+
+[data-shown="in"][data-reveal="text"] {
+ animation-name: reveal-text;
+ animation-duration: 1000ms;
+}
+
+[data-shown="in"][data-reveal="fade"] {
+ animation-name: reveal-fade;
+ animation-duration: 700ms;
+}
+
+[data-shown="in"][data-reveal="scale"] {
+ animation-name: reveal-scale;
+}
+
+[data-shown="in"][data-reveal="draw"] {
+ animation-name: reveal-draw;
+ animation-duration: 1200ms;
+}
+
+[data-shown="in"]:is([data-reveal="trigger"], [data-reveal="stagger"]) {
+ animation: none;
+}
+
+[data-shown="in"][data-reveal="stagger"] > * {
+ animation: reveal-rise 900ms var(--ease-reveal) backwards;
+ animation-delay: calc(var(--stagger-i, 0) * 70ms + var(--stagger-base, 0ms));
+}
+
+[data-reveal="stagger"] > :nth-child(2) {
+ --stagger-i: 1;
+}
+[data-reveal="stagger"] > :nth-child(3) {
+ --stagger-i: 2;
+}
+[data-reveal="stagger"] > :nth-child(4) {
+ --stagger-i: 3;
+}
+[data-reveal="stagger"] > :nth-child(5) {
+ --stagger-i: 4;
+}
+[data-reveal="stagger"] > :nth-child(6) {
+ --stagger-i: 5;
+}
+[data-reveal="stagger"] > :nth-child(7) {
+ --stagger-i: 6;
+}
+[data-reveal="stagger"] > :nth-child(8) {
+ --stagger-i: 7;
+}
+
+[data-seq][data-shown="in"] .seq-in {
+ animation: reveal-nudge 600ms var(--ease-reveal) var(--at, 0s) backwards;
+}
+
+[data-seq][data-shown="in"] .seq-type {
+ animation: reveal-type var(--dur, 900ms) steps(var(--steps, 30)) var(--at, 0s)
+ backwards;
+}
+
+[data-seq][data-shown="in"] .seq-pop {
+ animation: reveal-pop 500ms cubic-bezier(0.34, 1.4, 0.64, 1) var(--at, 0s)
+ backwards;
+}
+
+[data-seq][data-shown="in"] .seq-draw {
+ animation: reveal-draw var(--dur, 1400ms) var(--ease-reveal) var(--at, 0s)
+ backwards;
+}
+
+[data-seq][data-shown="in"] .seq-arrive {
+ animation: reveal-arrive 1300ms var(--ease-reveal) var(--at, 0s) backwards;
+}
+
+[data-seq][data-shown="in"] .bg-settle {
+ animation: reveal-settle 1800ms var(--ease-reveal) backwards;
+}
+
+:root[data-reveal-ready]
+ [data-seq]:not([data-shown])
+ :is(.seq-in, .seq-pop, .seq-arrive) {
+ opacity: 0;
+}
+
+:root[data-reveal-ready] [data-seq]:not([data-shown]) .seq-type {
+ clip-path: inset(0 100% 0 0);
+}
+
+:root[data-reveal-ready] [data-seq]:not([data-shown]) .seq-draw {
+ scale: 0 1;
+}
+
+.seq-count {
+ counter-reset: count var(--count);
+}
+
+.seq-count::after {
+ content: counter(count) "%";
+}
+
+[data-seq][data-shown="in"] .seq-count {
+ animation: count-up var(--dur, 1400ms) var(--ease-reveal) var(--at, 0s)
+ backwards;
}
@media (prefers-reduced-motion: reduce) {
- #nd-sidebar a[data-active],
- #nd-sidebar-mobile a[data-active] {
- transition: none;
+ .hero-in,
+ [data-shown="in"][data-reveal]:not(
+ [data-reveal="trigger"],
+ [data-reveal="stagger"]
+ ),
+ [data-shown="in"][data-reveal="stagger"] > *,
+ [data-seq][data-shown="in"]
+ :is(.seq-in, .seq-type, .seq-pop, .seq-draw, .seq-arrive) {
+ animation-name: reveal-fade;
+ animation-duration: 500ms;
+ animation-timing-function: ease;
+ }
+
+ :root[data-reveal-ready] [data-reveal="draw"]:not([data-shown]) {
+ scale: none;
+ opacity: 0;
+ }
+
+ [data-seq][data-shown="in"] :is(.seq-count, .bg-settle) {
+ animation: none;
}
}
-#nd-sidebar a.w-full,
-#nd-sidebar-mobile a.w-full,
-#nd-sidebar [data-radix-scroll-area-viewport] button.w-full,
-#nd-sidebar-mobile [data-radix-scroll-area-viewport] button.w-full {
- font-size: 0.8125rem;
- letter-spacing: -0.01em;
- font-weight: 500;
- margin-top: 0.25rem;
+.disclosure {
+ interpolate-size: allow-keywords;
}
-#nd-sidebar [data-radix-scroll-area-viewport] a.w-full + div,
-#nd-sidebar [data-radix-scroll-area-viewport] button.w-full + div,
-#nd-sidebar-mobile [data-radix-scroll-area-viewport] a.w-full + div,
-#nd-sidebar-mobile [data-radix-scroll-area-viewport] button.w-full + div {
- padding-bottom: 1rem;
+/* The transition on each state is the one that runs into it: closing (base
+ rule) is shorter and simpler than opening. Both are transitions, so a
+ click mid-way reverses from where the panel is. */
+.disclosure::details-content {
+ block-size: 0;
+ opacity: 0;
+ overflow-y: clip;
+ transition:
+ block-size 200ms cubic-bezier(0.25, 1, 0.5, 1),
+ opacity 150ms ease,
+ content-visibility 200ms allow-discrete;
}
-#nd-sidebar [data-radix-scroll-area-viewport] a.w-full + div::before,
-#nd-sidebar [data-radix-scroll-area-viewport] button.w-full + div::before,
-#nd-sidebar-mobile [data-radix-scroll-area-viewport] a.w-full + div::before,
-#nd-sidebar-mobile
- [data-radix-scroll-area-viewport]
- button.w-full
- + div::before {
- bottom: 1.25rem;
+
+.disclosure[open]::details-content {
+ block-size: auto;
+ opacity: 1;
+ transition:
+ block-size 260ms cubic-bezier(0.25, 1, 0.5, 1),
+ opacity 200ms ease,
+ content-visibility 260ms allow-discrete;
}
-#nd-sidebar a.w-full svg[data-icon],
-#nd-sidebar button.w-full svg[data-icon],
-#nd-sidebar-mobile a.w-full svg[data-icon],
-#nd-sidebar-mobile button.w-full svg[data-icon] {
- width: 0.875rem;
- height: 0.875rem;
- opacity: 0.7;
+@media (prefers-reduced-motion: reduce) {
+ .disclosure::details-content,
+ .disclosure[open]::details-content {
+ transition:
+ opacity 150ms ease,
+ content-visibility 150ms allow-discrete;
+ }
}
-#nd-sidebar [data-radix-scroll-area-viewport],
-#nd-sidebar-mobile [data-radix-scroll-area-viewport] {
- padding-bottom: 2rem;
+/* Header item size (`config/header-layout.json`). Unlayered, so it wins over
+ the items' own `text-ui`; the mobile header keeps its sizes. */
+@media (width >= 64rem) {
+ [data-site-header] [data-pill] {
+ font-size: var(--hdr-text);
+ }
}
-#nd-sidebar [data-active="true"] svg {
- color: var(--foreground);
+/* Invisible native seek bar over a drawn ruler. The thumb needs a real size:
+ Chrome maps a click on a zero-width thumb's track to the minimum, so every
+ seek jumped to 0. Its width is twice the ruler's side inset, which makes the
+ thumb's centre travel exactly where the drawn playhead does. */
+@utility seek-range {
+ appearance: none;
+ background: transparent;
+ cursor: pointer;
+ &::-webkit-slider-thumb {
+ appearance: none;
+ width: var(--seek-thumb, 1px);
+ height: 24px;
+ opacity: 0;
+ }
+ &::-moz-range-thumb {
+ width: var(--seek-thumb, 1px);
+ height: 24px;
+ border: 0;
+ opacity: 0;
+ }
+}
+
+/* The fumadocs ⌘K search dialog opens from a keyboard shortcut, so it opens
+ and closes without animation. Its overlay and panel read these theme
+ variables; with `none`, Radix's presence check unmounts them at once. */
+:root {
+ --animate-fd-dialog-in: none;
+ --animate-fd-dialog-out: none;
+ --animate-fd-fade-in: none;
+ --animate-fd-fade-out: none;
}
diff --git a/app/lab/_components/clip-editor.tsx b/app/lab/_components/clip-editor.tsx
new file mode 100644
index 00000000..25d0d07a
--- /dev/null
+++ b/app/lab/_components/clip-editor.tsx
@@ -0,0 +1,343 @@
+"use client";
+
+import { useMemo, useState } from "react";
+import {
+ CATALOG,
+ defaultBackground,
+ defaultEnd,
+ nativeDuration,
+} from "@/app/(home)/components/landing/sections/hero/tiles/clips";
+import {
+ CLIP_ENDS,
+ type ClipSpec,
+ CUTS,
+} from "@/app/(home)/components/landing/sections/hero/tiles/config";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+import { Slider } from "@/components/ui/slider";
+import { cn } from "@/lib/utils";
+
+export function Segmented<T extends string>({
+ options,
+ value,
+ onChange,
+}: {
+ options: readonly T[];
+ value: T;
+ onChange: (value: T) => void;
+}) {
+ return (
+ <div className="flex flex-wrap gap-0.5 rounded-lg bg-muted p-0.5">
+ {options.map((option) => (
+ <button
+ key={option}
+ type="button"
+ onClick={() => onChange(option)}
+ className={cn(
+ "flex-1 rounded-md px-2 py-1.5 text-xs whitespace-nowrap transition-colors",
+ option === value
+ ? "bg-background text-foreground shadow-sm"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ {option}
+ </button>
+ ))}
+ </div>
+ );
+}
+
+export function Range({
+ id,
+ label,
+ value,
+ min,
+ max,
+ step,
+ onChange,
+}: {
+ id: string;
+ label: string;
+ value: number;
+ min: number;
+ max: number;
+ step: number;
+ onChange: (value: number) => void;
+}) {
+ return (
+ <div className="py-1">
+ <div className="mb-1.5 flex items-baseline justify-between gap-3">
+ <Label htmlFor={id} className="text-xs text-muted-foreground">
+ {label}
+ </Label>
+ <span className="font-mono text-xs tabular-nums text-foreground">
+ {value}
+ </span>
+ </div>
+ <Slider
+ id={id}
+ value={value}
+ min={min}
+ max={max}
+ step={step}
+ onValueChange={(next) => onChange(Array.isArray(next) ? next[0] : next)}
+ />
+ </div>
+ );
+}
+
+export function newClip(name: string): ClipSpec {
+ return {
+ name,
+ start: 0,
+ zoom: 1,
+ end: defaultEnd(name),
+ background: defaultBackground(name),
+ radius: 0.25,
+ cut: "auto",
+ props: {},
+ };
+}
+
+export function PropsEditor({
+ value,
+ onChange,
+}: {
+ value: Record<string, unknown>;
+ onChange: (value: Record<string, unknown>) => void;
+}) {
+ const [text, setText] = useState(() => JSON.stringify(value, null, 2));
+ const [error, setError] = useState(false);
+ return (
+ <div className="flex flex-col gap-1">
+ <Label className="text-xs text-muted-foreground">
+ Props over the docs defaults (JSON)
+ </Label>
+ <textarea
+ value={text}
+ spellCheck={false}
+ onChange={(event) => setText(event.target.value)}
+ onBlur={() => {
+ try {
+ const parsed = JSON.parse(text || "{}");
+ setError(false);
+ onChange(parsed);
+ } catch {
+ setError(true);
+ }
+ }}
+ className={cn(
+ "min-h-20 rounded-md border bg-background p-2 font-mono text-[11px] leading-relaxed text-foreground outline-none",
+ error ? "border-destructive" : "border-border",
+ )}
+ />
+ </div>
+ );
+}
+
+export function ClipRow({
+ clip,
+ index,
+ count,
+ label,
+ open,
+ solo,
+ reel = true,
+ onToggle,
+ onSolo,
+ onMove,
+ onRemove,
+ onChange,
+}: {
+ clip: ClipSpec;
+ index: number;
+ count: number;
+ label?: string;
+ open: boolean;
+ solo?: boolean;
+ reel?: boolean;
+ onToggle: () => void;
+ onSolo?: () => void;
+ onMove?: (delta: number) => void;
+ onRemove?: () => void;
+ onChange: (patch: Partial<ClipSpec>) => void;
+}) {
+ const native = nativeDuration(clip.name);
+ const id = `clip-${index}`;
+ return (
+ <div className="rounded-lg border border-border">
+ <div className="flex items-center gap-1 p-1.5">
+ <button
+ type="button"
+ onClick={onToggle}
+ className="flex min-w-0 flex-1 items-center gap-2 rounded-md px-1.5 py-1 text-left hover:bg-muted"
+ >
+ <span
+ className="size-4 shrink-0 rounded-[4px] border border-border"
+ style={{ background: clip.background }}
+ />
+ <span className="font-mono text-[11px] text-muted-foreground">
+ {label ?? index + 1}
+ </span>
+ <span className="truncate text-xs text-foreground">{clip.name}</span>
+ </button>
+ {onSolo && (
+ <Button
+ size="xs"
+ variant={solo ? "default" : "ghost"}
+ onClick={onSolo}
+ >
+ Solo
+ </Button>
+ )}
+ {onMove && (
+ <>
+ <Button
+ size="xs"
+ variant="ghost"
+ disabled={index === 0}
+ onClick={() => onMove(-1)}
+ >
+ Up
+ </Button>
+ <Button
+ size="xs"
+ variant="ghost"
+ disabled={index === count - 1}
+ onClick={() => onMove(1)}
+ >
+ Down
+ </Button>
+ </>
+ )}
+ {onRemove && (
+ <Button size="xs" variant="ghost" onClick={onRemove}>
+ Remove
+ </Button>
+ )}
+ </div>
+ {open && (
+ <div className="flex flex-col gap-2 border-t border-border p-2.5">
+ <Range
+ id={`${id}-start`}
+ label={`Start frame (of ${native})`}
+ value={clip.start}
+ min={0}
+ max={Math.max(native - 1, 0)}
+ step={1}
+ onChange={(start) => onChange({ start })}
+ />
+ <Range
+ id={`${id}-zoom`}
+ label="Zoom"
+ value={clip.zoom}
+ min={0.3}
+ max={4}
+ step={0.05}
+ onChange={(zoom) => onChange({ zoom })}
+ />
+ {reel && (
+ <Range
+ id={`${id}-radius`}
+ label="Shape radius (morph)"
+ value={clip.radius}
+ min={0}
+ max={0.5}
+ step={0.01}
+ onChange={(radius) => onChange({ radius })}
+ />
+ )}
+ <Label className="text-xs text-muted-foreground">
+ After its timeline ends
+ </Label>
+ <Segmented
+ options={CLIP_ENDS}
+ value={clip.end}
+ onChange={(end) => onChange({ end })}
+ />
+ {reel && (
+ <>
+ <Label className="text-xs text-muted-foreground">
+ Cut into the next clip
+ </Label>
+ <Segmented
+ options={["auto", ...CUTS] as const}
+ value={clip.cut}
+ onChange={(cut) => onChange({ cut })}
+ />
+ </>
+ )}
+ <div className="flex items-center justify-between gap-2">
+ <Label
+ htmlFor={`${id}-bg`}
+ className="text-xs text-muted-foreground"
+ >
+ Background
+ </Label>
+ <div className="flex items-center gap-2">
+ <input
+ id={`${id}-bg`}
+ type="color"
+ value={
+ /^#[0-9a-f]{6}$/i.test(clip.background)
+ ? clip.background
+ : "#0E1012"
+ }
+ onChange={(event) =>
+ onChange({ background: event.target.value })
+ }
+ className="size-7 cursor-pointer rounded border border-border bg-transparent"
+ />
+ <span className="font-mono text-[11px] text-muted-foreground">
+ {clip.background}
+ </span>
+ </div>
+ </div>
+ <PropsEditor
+ key={clip.name}
+ value={clip.props}
+ onChange={(props) => onChange({ props })}
+ />
+ </div>
+ )}
+ </div>
+ );
+}
+
+export function CatalogPicker({ onAdd }: { onAdd: (name: string) => void }) {
+ const [query, setQuery] = useState("");
+ const results = useMemo(() => {
+ const words = query.toLowerCase().split(/\s+/).filter(Boolean);
+ return CATALOG.filter((name) => words.every((word) => name.includes(word)));
+ }, [query]);
+ return (
+ <div className="flex flex-col gap-2">
+ <input
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ placeholder={`Search ${CATALOG.length} catalog items`}
+ className="h-8 rounded-md border border-border bg-background px-2.5 text-xs outline-none focus:border-foreground/30"
+ />
+ <div className="flex max-h-56 flex-col overflow-y-auto rounded-md border border-border">
+ {results.map((name) => (
+ <button
+ key={name}
+ type="button"
+ onClick={() => onAdd(name)}
+ className="flex items-center justify-between gap-2 px-2.5 py-1.5 text-left text-xs text-foreground hover:bg-muted"
+ >
+ <span className="truncate">{name}</span>
+ <span className="font-mono text-[10px] text-muted-foreground">
+ {nativeDuration(name)}f
+ </span>
+ </button>
+ ))}
+ {results.length === 0 && (
+ <span className="px-2.5 py-2 text-xs text-muted-foreground">
+ Nothing matches
+ </span>
+ )}
+ </div>
+ </div>
+ );
+}
diff --git a/app/lab/docs-layout/docs-layout-lab.tsx b/app/lab/docs-layout/docs-layout-lab.tsx
new file mode 100644
index 00000000..6ae138b0
--- /dev/null
+++ b/app/lab/docs-layout/docs-layout-lab.tsx
@@ -0,0 +1,332 @@
+"use client";
+
+import { useCallback, useEffect, useRef, useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+import {
+ DOCS_LAYOUT,
+ type DocsLayout,
+ docsLayoutVars,
+} from "@/lib/docs-layout";
+import { cn } from "@/lib/utils";
+
+const VIEWPORTS = [1280, 1440, 1728, 1920, 2560] as const;
+const PREVIEW_HEIGHT = 900;
+
+type Control = {
+ key: keyof DocsLayout;
+ label: string;
+ min: number;
+ max: number;
+ step: number;
+ hint?: string;
+};
+
+const CONTROLS: Control[] = [
+ { key: "frame", label: "Frame max width", min: 1200, max: 2400, step: 8 },
+ { key: "gutter", label: "Frame side padding", min: 16, max: 96, step: 4 },
+ { key: "sidebar", label: "Sidebar width", min: 220, max: 360, step: 4 },
+ { key: "rail", label: "Right rail width", min: 240, max: 400, step: 4 },
+ {
+ key: "articlePadding",
+ label: "Article side padding",
+ min: 24,
+ max: 120,
+ step: 4,
+ },
+ {
+ key: "articleMax",
+ label: "Article max width",
+ min: 0,
+ max: 1200,
+ step: 10,
+ hint: "0 = fills the column",
+ },
+];
+
+type Measure = {
+ article: number;
+ frame: number;
+ /** Rail content left edge minus the Healthy badge's (0 = aligned). */
+ railOffset: number | null;
+};
+
+/** Writes the layout into the docs page inside the iframe and measures it. */
+function applyAndMeasure(
+ frame: HTMLIFrameElement,
+ layout: DocsLayout,
+): Measure | null {
+ const doc = frame.contentDocument;
+ const root = doc?.querySelector<HTMLElement>("[data-docs-layout]");
+ if (!doc || !root) return null;
+ for (const [name, value] of Object.entries(docsLayoutVars(layout))) {
+ root.style.setProperty(name, String(value));
+ }
+ const left = (el: Element | null | undefined) =>
+ el ? el.getBoundingClientRect().left : null;
+ const health = [...doc.querySelectorAll("header button")].find((el) =>
+ /Healthy|Degraded|Unhealthy/.test(el.textContent ?? ""),
+ );
+ const rail = doc.querySelector("[data-docs-rail] > :first-child");
+ const article = doc.querySelector("article");
+ const shell = doc.querySelector("header > div");
+ const healthLeft = left(health);
+ const railLeft = left(rail);
+ return {
+ article: Math.round(article?.getBoundingClientRect().width ?? 0),
+ frame: Math.round(shell?.getBoundingClientRect().width ?? 0),
+ railOffset:
+ healthLeft !== null && railLeft !== null
+ ? Math.round(railLeft - healthLeft)
+ : null,
+ };
+}
+
+function Preview({
+ width,
+ url,
+ layout,
+ onMeasure,
+}: {
+ width: number;
+ url: string;
+ layout: DocsLayout;
+ onMeasure: (width: number, measure: Measure | null) => void;
+}) {
+ const boxRef = useRef<HTMLDivElement>(null);
+ const frameRef = useRef<HTMLIFrameElement>(null);
+ const [scale, setScale] = useState(0.5);
+ const [loaded, setLoaded] = useState(0);
+
+ useEffect(() => {
+ const box = boxRef.current;
+ if (!box) return;
+ const fit = () => setScale(Math.min(1, box.clientWidth / width));
+ fit();
+ const observer = new ResizeObserver(fit);
+ observer.observe(box);
+ return () => observer.disconnect();
+ }, [width]);
+
+ // Re-apply after every change, a load, and the page's own late layout
+ // (fonts, client navigation inside the frame).
+ useEffect(() => {
+ const frame = frameRef.current;
+ if (!frame || !loaded) return;
+ const run = () => onMeasure(width, applyAndMeasure(frame, layout));
+ run();
+ const late = window.setTimeout(run, 400);
+ return () => window.clearTimeout(late);
+ }, [layout, loaded, width, onMeasure]);
+
+ return (
+ <div ref={boxRef} className="w-full">
+ <div
+ className="relative overflow-hidden rounded-xl border border-border bg-background"
+ style={{ height: PREVIEW_HEIGHT * scale }}
+ >
+ <iframe
+ ref={frameRef}
+ title={`Docs at ${width}px`}
+ src={url}
+ onLoad={() => setLoaded((n) => n + 1)}
+ className="absolute top-0 left-0 origin-top-left border-0"
+ style={{
+ width,
+ height: PREVIEW_HEIGHT,
+ transform: `scale(${scale})`,
+ }}
+ />
+ </div>
+ </div>
+ );
+}
+
+export function DocsLayoutLab() {
+ const [layout, setLayout] = useState<DocsLayout>(DOCS_LAYOUT);
+ const [url, setUrl] = useState("/docs/typography/soft-blur-in");
+ const [draftUrl, setDraftUrl] = useState(url);
+ const [widths, setWidths] = useState<number[]>([1440, 1728]);
+ const [measures, setMeasures] = useState<Record<number, Measure | null>>({});
+ const [written, setWritten] = useState<string | null>(null);
+
+ const onMeasure = useCallback((width: number, measure: Measure | null) => {
+ setMeasures((prev) => ({ ...prev, [width]: measure }));
+ }, []);
+
+ const set = (key: keyof DocsLayout, value: number) =>
+ setLayout((prev) => ({ ...prev, [key]: value }));
+
+ const alignRail = () => {
+ const offset = widths
+ .map((w) => measures[w]?.railOffset)
+ .find((value) => typeof value === "number");
+ if (typeof offset === "number") set("rail", layout.rail + offset);
+ };
+
+ const save = async () => {
+ const response = await fetch("/api/lab/docs-layout", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(layout),
+ });
+ const body = (await response.json().catch(() => ({}))) as {
+ path?: string;
+ };
+ setWritten(body.path ?? "write failed");
+ };
+
+ const toggleWidth = (width: number) =>
+ setWidths((prev) =>
+ prev.includes(width)
+ ? prev.filter((w) => w !== width)
+ : [...prev, width].sort((a, b) => a - b),
+ );
+
+ const changed = (Object.keys(layout) as (keyof DocsLayout)[]).some(
+ (key) => layout[key] !== DOCS_LAYOUT[key],
+ );
+
+ return (
+ <div className="flex min-h-screen gap-4 bg-muted p-4">
+ <main className="flex min-w-0 flex-1 flex-col gap-5">
+ {widths.length === 0 && (
+ <p className="text-sm text-muted-foreground">
+ Pick a viewport width in the panel.
+ </p>
+ )}
+ {widths.map((width) => {
+ const m = measures[width];
+ return (
+ <section key={width} className="flex flex-col gap-2">
+ <div className="flex items-center gap-3 font-mono text-xs text-muted-foreground">
+ <span className="text-foreground">{width}px viewport</span>
+ {m && (
+ <>
+ <span>frame {m.frame}px</span>
+ <span>article {m.article}px</span>
+ <span
+ className={cn(
+ m.railOffset === 0
+ ? "text-emerald-600"
+ : "text-amber-600",
+ )}
+ >
+ Rail vs Healthy{" "}
+ {m.railOffset === null
+ ? "n/a"
+ : m.railOffset === 0
+ ? "aligned"
+ : `${m.railOffset > 0 ? "+" : ""}${m.railOffset}px`}
+ </span>
+ </>
+ )}
+ </div>
+ <Preview
+ width={width}
+ url={url}
+ layout={layout}
+ onMeasure={onMeasure}
+ />
+ </section>
+ );
+ })}
+ </main>
+
+ <aside className="sticky top-4 flex h-fit max-h-[calc(100vh-2rem)] w-[320px] shrink-0 flex-col gap-4 overflow-y-auto rounded-2xl border border-border bg-background p-4 shadow-xl">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs font-semibold">Docs layout</Label>
+ <div className="flex gap-2">
+ <Button
+ size="sm"
+ variant="ghost"
+ disabled={!changed}
+ onClick={() => setLayout(DOCS_LAYOUT)}
+ >
+ Reset
+ </Button>
+ <Button size="sm" onClick={save}>
+ Save
+ </Button>
+ </div>
+ </div>
+ {written && (
+ <p className="font-mono text-[11px] text-muted-foreground">
+ wrote {written}
+ </p>
+ )}
+
+ <div className="flex flex-col gap-2">
+ <Label className="text-xs text-muted-foreground">Viewports</Label>
+ <div className="flex flex-wrap gap-1.5">
+ {VIEWPORTS.map((width) => (
+ <button
+ key={width}
+ type="button"
+ onClick={() => toggleWidth(width)}
+ className={cn(
+ "rounded-md border px-2 py-1 font-mono text-[11px]",
+ widths.includes(width)
+ ? "border-foreground bg-foreground text-background"
+ : "border-border text-muted-foreground",
+ )}
+ >
+ {width}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ <form
+ className="flex flex-col gap-2"
+ onSubmit={(event) => {
+ event.preventDefault();
+ setUrl(draftUrl);
+ }}
+ >
+ <Label className="text-xs text-muted-foreground">Page</Label>
+ <input
+ value={draftUrl}
+ onChange={(event) => setDraftUrl(event.target.value)}
+ className="h-8 rounded-md border border-border bg-background px-2 font-mono text-xs"
+ />
+ </form>
+
+ {CONTROLS.map((control) => (
+ <div key={control.key} className="flex flex-col gap-1.5">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs">{control.label}</Label>
+ <span className="font-mono text-xs tabular-nums">
+ {control.key === "articleMax" && layout.articleMax === 0
+ ? "none"
+ : `${layout[control.key]}px`}
+ </span>
+ </div>
+ <input
+ type="range"
+ min={control.min}
+ max={control.max}
+ step={control.step}
+ value={layout[control.key]}
+ onChange={(event) => set(control.key, Number(event.target.value))}
+ className="accent-foreground"
+ />
+ {control.hint && (
+ <span className="text-[11px] text-muted-foreground">
+ {control.hint}
+ </span>
+ )}
+ </div>
+ ))}
+
+ <Button size="sm" variant="secondary" onClick={alignRail}>
+ Align rail to Healthy
+ </Button>
+ <p className="text-[11px] leading-4 text-muted-foreground">
+ Changes the rail width so its cards start where the Healthy badge
+ does. Save writes config/docs-layout.json, which the docs read.
+ </p>
+ </aside>
+ </div>
+ );
+}
diff --git a/app/lab/docs-layout/page.tsx b/app/lab/docs-layout/page.tsx
new file mode 100644
index 00000000..9d4c5d29
--- /dev/null
+++ b/app/lab/docs-layout/page.tsx
@@ -0,0 +1,11 @@
+import type { Metadata } from "next";
+import { DocsLayoutLab } from "./docs-layout-lab";
+
+export const metadata: Metadata = {
+ title: "Docs layout lab",
+ robots: { index: false, follow: false },
+};
+
+export default function Page() {
+ return <DocsLayoutLab />;
+}
diff --git a/app/lab/header-layout/header-layout-lab.tsx b/app/lab/header-layout/header-layout-lab.tsx
new file mode 100644
index 00000000..2441f194
--- /dev/null
+++ b/app/lab/header-layout/header-layout-lab.tsx
@@ -0,0 +1,314 @@
+"use client";
+
+import { useCallback, useEffect, useRef, useState } from "react";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+import {
+ HEADER_LAYOUT,
+ type HeaderLayout,
+ headerLayoutVars,
+} from "@/lib/header-layout";
+import { cn } from "@/lib/utils";
+
+const VIEWPORTS = [1024, 1280, 1440, 1728] as const;
+const PAGES = [
+ { label: "Landing", url: "/" },
+ { label: "Docs", url: "/docs/typography/soft-blur-in" },
+] as const;
+const PREVIEW_HEIGHT = 380;
+
+type Control = {
+ key: keyof HeaderLayout;
+ label: string;
+ min: number;
+ max: number;
+ step: number;
+};
+
+const CONTROLS: Control[] = [
+ { key: "height", label: "Capsule height", min: 40, max: 72, step: 1 },
+ { key: "itemHeight", label: "Item height", min: 28, max: 60, step: 1 },
+ { key: "radius", label: "Capsule radius", min: 8, max: 32, step: 1 },
+ { key: "itemRadius", label: "Item radius", min: 4, max: 24, step: 1 },
+ { key: "top", label: "Space above", min: 0, max: 48, step: 2 },
+ { key: "itemPadding", label: "Item side padding", min: 8, max: 20, step: 1 },
+ { key: "text", label: "Item text", min: 13, max: 17, step: 0.5 },
+ { key: "wordmark", label: "Wordmark", min: 16, max: 24, step: 0.5 },
+];
+
+type Measure = {
+ /** Header block height: where the page content starts. */
+ block: number;
+ capsule: number;
+ item: number;
+};
+
+/** Writes the layout into the header inside the iframe and measures it. */
+function applyAndMeasure(
+ frame: HTMLIFrameElement,
+ layout: HeaderLayout,
+): Measure | null {
+ const doc = frame.contentDocument;
+ const header = doc?.querySelector<HTMLElement>("[data-site-header]");
+ if (!doc || !header) return null;
+ for (const [name, value] of Object.entries(headerLayoutVars(layout))) {
+ header.style.setProperty(name, String(value));
+ }
+ const height = (el: Element | null | undefined) =>
+ Math.round(el?.getBoundingClientRect().height ?? 0);
+ return {
+ block: height(header),
+ capsule: height(header.querySelector(":scope > div > div")),
+ item: height(header.querySelector('[data-pill="nav"]')),
+ };
+}
+
+function Preview({
+ width,
+ url,
+ layout,
+ onMeasure,
+}: {
+ width: number;
+ url: string;
+ layout: HeaderLayout;
+ onMeasure: (key: string, measure: Measure | null) => void;
+}) {
+ const boxRef = useRef<HTMLDivElement>(null);
+ const frameRef = useRef<HTMLIFrameElement>(null);
+ const [scale, setScale] = useState(0.5);
+ const [loaded, setLoaded] = useState(0);
+ const key = `${url}@${width}`;
+
+ useEffect(() => {
+ const box = boxRef.current;
+ if (!box) return;
+ const fit = () => setScale(Math.min(1, box.clientWidth / width));
+ fit();
+ const observer = new ResizeObserver(fit);
+ observer.observe(box);
+ return () => observer.disconnect();
+ }, [width]);
+
+ // Re-apply after every change, a load, and the page's own late layout.
+ useEffect(() => {
+ const frame = frameRef.current;
+ if (!frame || !loaded) return;
+ const run = () => onMeasure(key, applyAndMeasure(frame, layout));
+ run();
+ const late = window.setTimeout(run, 400);
+ return () => window.clearTimeout(late);
+ }, [layout, loaded, key, onMeasure]);
+
+ return (
+ <div ref={boxRef} className="w-full">
+ <div
+ className="relative overflow-hidden rounded-xl border border-border bg-background"
+ style={{ height: PREVIEW_HEIGHT * scale }}
+ >
+ <iframe
+ ref={frameRef}
+ title={`${url} at ${width}px`}
+ src={url}
+ onLoad={() => setLoaded((n) => n + 1)}
+ className="absolute top-0 left-0 origin-top-left border-0"
+ style={{
+ width,
+ height: PREVIEW_HEIGHT,
+ transform: `scale(${scale})`,
+ }}
+ />
+ </div>
+ </div>
+ );
+}
+
+export function HeaderLayoutLab() {
+ const [layout, setLayout] = useState<HeaderLayout>(HEADER_LAYOUT);
+ const [pages, setPages] = useState<string[]>(PAGES.map((p) => p.url));
+ const [widths, setWidths] = useState<number[]>([1440]);
+ const [keepInset, setKeepInset] = useState(true);
+ const [measures, setMeasures] = useState<Record<string, Measure | null>>({});
+ const [written, setWritten] = useState<string | null>(null);
+
+ const onMeasure = useCallback((key: string, measure: Measure | null) => {
+ setMeasures((prev) => ({ ...prev, [key]: measure }));
+ }, []);
+
+ const set = (key: keyof HeaderLayout, value: number) =>
+ setLayout((prev) => {
+ const next = { ...prev, [key]: value };
+ // Capsule height drags the items along so the inset around them holds.
+ if (key === "height" && keepInset) {
+ next.itemHeight = Math.max(28, value - (prev.height - prev.itemHeight));
+ }
+ return next;
+ });
+
+ const save = async () => {
+ const response = await fetch("/api/lab/header-layout", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(layout),
+ });
+ const body = (await response.json().catch(() => ({}))) as {
+ path?: string;
+ };
+ setWritten(body.path ?? "write failed");
+ };
+
+ const toggle = <T,>(list: T[], value: T) =>
+ list.includes(value) ? list.filter((v) => v !== value) : [...list, value];
+
+ const changed = (Object.keys(layout) as (keyof HeaderLayout)[]).some(
+ (key) => layout[key] !== HEADER_LAYOUT[key],
+ );
+ const inset =
+ (layout.height - Math.min(layout.itemHeight, layout.height - 4)) / 2;
+
+ return (
+ <div className="flex min-h-screen gap-4 bg-muted p-4">
+ <main className="flex min-w-0 flex-1 flex-col gap-5">
+ {(widths.length === 0 || pages.length === 0) && (
+ <p className="text-sm text-muted-foreground">
+ Pick a page and a viewport width in the panel.
+ </p>
+ )}
+ {pages.flatMap((url) =>
+ [...widths]
+ .sort((a, b) => a - b)
+ .map((width) => {
+ const m = measures[`${url}@${width}`];
+ return (
+ <section
+ key={`${url}@${width}`}
+ className="flex flex-col gap-2"
+ >
+ <div className="flex items-center gap-3 font-mono text-xs text-muted-foreground">
+ <span className="text-foreground">
+ {url} · {width}px
+ </span>
+ {m && (
+ <>
+ <span>capsule {m.capsule}px</span>
+ <span>item {m.item}px</span>
+ <span>header block {m.block}px</span>
+ </>
+ )}
+ </div>
+ <Preview
+ width={width}
+ url={url}
+ layout={layout}
+ onMeasure={onMeasure}
+ />
+ </section>
+ );
+ }),
+ )}
+ </main>
+
+ <aside className="sticky top-4 flex h-fit max-h-[calc(100vh-2rem)] w-[320px] shrink-0 flex-col gap-4 overflow-y-auto rounded-2xl border border-border bg-background p-4 shadow-xl">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs font-semibold">Header layout</Label>
+ <div className="flex gap-2">
+ <Button
+ size="sm"
+ variant="ghost"
+ disabled={!changed}
+ onClick={() => setLayout(HEADER_LAYOUT)}
+ >
+ Reset
+ </Button>
+ <Button size="sm" onClick={save}>
+ Save
+ </Button>
+ </div>
+ </div>
+ {written && (
+ <p className="font-mono text-[11px] text-muted-foreground">
+ wrote {written}
+ </p>
+ )}
+
+ <div className="flex flex-col gap-2">
+ <Label className="text-xs text-muted-foreground">Pages</Label>
+ <div className="flex flex-wrap gap-1.5">
+ {PAGES.map((page) => (
+ <button
+ key={page.url}
+ type="button"
+ onClick={() => setPages((prev) => toggle(prev, page.url))}
+ className={cn(
+ "rounded-md border px-2 py-1 font-mono text-[11px]",
+ pages.includes(page.url)
+ ? "border-foreground bg-foreground text-background"
+ : "border-border text-muted-foreground",
+ )}
+ >
+ {page.label}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-2">
+ <Label className="text-xs text-muted-foreground">Viewports</Label>
+ <div className="flex flex-wrap gap-1.5">
+ {VIEWPORTS.map((width) => (
+ <button
+ key={width}
+ type="button"
+ onClick={() => setWidths((prev) => toggle(prev, width))}
+ className={cn(
+ "rounded-md border px-2 py-1 font-mono text-[11px]",
+ widths.includes(width)
+ ? "border-foreground bg-foreground text-background"
+ : "border-border text-muted-foreground",
+ )}
+ >
+ {width}
+ </button>
+ ))}
+ </div>
+ </div>
+
+ {CONTROLS.map((control) => (
+ <div key={control.key} className="flex flex-col gap-1.5">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs">{control.label}</Label>
+ <span className="font-mono text-xs tabular-nums">
+ {layout[control.key]}px
+ </span>
+ </div>
+ <input
+ type="range"
+ min={control.min}
+ max={control.max}
+ step={control.step}
+ value={layout[control.key]}
+ onChange={(event) => set(control.key, Number(event.target.value))}
+ className="accent-foreground"
+ />
+ </div>
+ ))}
+
+ <label className="flex items-center gap-2 text-xs">
+ <input
+ type="checkbox"
+ checked={keepInset}
+ onChange={(event) => setKeepInset(event.target.checked)}
+ className="accent-foreground"
+ />
+ Item height follows capsule height
+ </label>
+ <p className="text-[11px] leading-4 text-muted-foreground">
+ Inset around items: {inset}px. Hover the previews to check the pill
+ and the Docs menu. Save writes config/header-layout.json, which the
+ header reads. Desktop only; the mobile header keeps its sizes, and the
+ docs keep their own 20px above.
+ </p>
+ </aside>
+ </div>
+ );
+}
diff --git a/app/lab/header-layout/page.tsx b/app/lab/header-layout/page.tsx
new file mode 100644
index 00000000..9ae0d9cc
--- /dev/null
+++ b/app/lab/header-layout/page.tsx
@@ -0,0 +1,11 @@
+import type { Metadata } from "next";
+import { HeaderLayoutLab } from "./header-layout-lab";
+
+export const metadata: Metadata = {
+ title: "Header layout lab",
+ robots: { index: false, follow: false },
+};
+
+export default function Page() {
+ return <HeaderLayoutLab />;
+}
diff --git a/app/lab/hero-scenes/hero-scenes-lab.tsx b/app/lab/hero-scenes/hero-scenes-lab.tsx
new file mode 100644
index 00000000..81df901e
--- /dev/null
+++ b/app/lab/hero-scenes/hero-scenes-lab.tsx
@@ -0,0 +1,391 @@
+"use client";
+
+import { useState } from "react";
+import { ComposerStatus } from "@/app/(home)/components/landing/sections/hero/composer-status";
+import { PromptComposer } from "@/app/(home)/components/landing/sections/hero/prompt-composer";
+import {
+ CONTENT_MODES,
+ DEFAULT_SCENES_CONFIG,
+ SCENE_SET_OPTIONS,
+ type ScenesConfig,
+ SWAP_TRANSITIONS,
+} from "@/app/(home)/components/landing/sections/hero/scenes/config";
+import saved from "@/app/(home)/components/landing/sections/hero/scenes/hero-scenes.json";
+import { DEFAULT_LIVE_CLIPS } from "@/app/(home)/components/landing/sections/hero/scenes/live-clips";
+import { SceneField } from "@/app/(home)/components/landing/sections/hero/scenes/scene-field";
+import { SCENE_SETS } from "@/app/(home)/components/landing/sections/hero/scenes/sets";
+import { liveSet } from "@/app/(home)/components/landing/sections/hero/scenes/sets/live";
+import type { ClipSpec } from "@/app/(home)/components/landing/sections/hero/tiles/config";
+import {
+ CatalogPicker,
+ ClipRow,
+ newClip,
+} from "@/app/lab/_components/clip-editor";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+import { Slider } from "@/components/ui/slider";
+import { cn } from "@/lib/utils";
+
+type Group = Exclude<keyof ScenesConfig, "live">;
+
+const PROMPTS = ["Acme", "Ledger", "Pulse", "Notes"];
+const SLOT_FORMATS = ["16:9", "1:1", "16:9", "1:1", "16:9", "9:16"];
+
+function SlotEditor({
+ clips,
+ prompt,
+ onPrompt,
+ pinned,
+ onPinned,
+ onChange,
+}: {
+ clips: ClipSpec[][];
+ prompt: number;
+ onPrompt: (prompt: number) => void;
+ pinned: boolean;
+ onPinned: (pinned: boolean) => void;
+ onChange: (clips: ClipSpec[][]) => void;
+}) {
+ const [slot, setSlot] = useState(0);
+ const [open, setOpen] = useState<number | null>(null);
+ const slots = clips[prompt] ?? [];
+
+ const update = (index: number, next: ClipSpec) =>
+ onChange(
+ clips.map((row, p) =>
+ p === prompt ? row.map((clip, i) => (i === index ? next : clip)) : row,
+ ),
+ );
+
+ return (
+ <div className="flex flex-col gap-2 rounded-xl border border-border p-2.5">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs font-semibold">Cards per prompt</Label>
+ <Button
+ size="xs"
+ variant={pinned ? "default" : "ghost"}
+ onClick={() => onPinned(!pinned)}
+ >
+ {pinned ? "Showing this prompt" : "Following composer"}
+ </Button>
+ </div>
+ <div className="flex gap-0.5 rounded-lg bg-muted p-0.5">
+ {PROMPTS.map((name, i) => (
+ <button
+ key={name}
+ type="button"
+ onClick={() => onPrompt(i)}
+ className={cn(
+ "flex-1 rounded-md px-2 py-1.5 text-xs transition-colors",
+ i === prompt
+ ? "bg-background text-foreground shadow-sm"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ {name}
+ </button>
+ ))}
+ </div>
+ {slots.map((clip, i) => (
+ <div
+ key={`${prompt}-${i}`}
+ className={cn("rounded-lg", slot === i && "ring-2 ring-primary/40")}
+ >
+ <ClipRow
+ clip={clip}
+ index={i}
+ count={slots.length}
+ label={`${i + 1} ${SLOT_FORMATS[i]}`}
+ open={open === i}
+ reel={false}
+ onToggle={() => {
+ setSlot(i);
+ setOpen(open === i ? null : i);
+ }}
+ onChange={(patch) => update(i, { ...clip, ...patch })}
+ />
+ </div>
+ ))}
+ <Label className="mt-1 text-xs text-muted-foreground">
+ Put into slot {slot + 1} ({SLOT_FORMATS[slot]})
+ </Label>
+ <CatalogPicker
+ onAdd={(name) => {
+ update(slot, newClip(name));
+ setOpen(slot);
+ }}
+ />
+ </div>
+ );
+}
+
+const KNOBS: {
+ group: Group;
+ key: string;
+ label: string;
+ min: number;
+ max: number;
+ step: number;
+}[] = [
+ {
+ group: "frame",
+ key: "float",
+ label: "Float distance (px)",
+ min: 0,
+ max: 14,
+ step: 0.5,
+ },
+ {
+ group: "frame",
+ key: "floatPeriod",
+ label: "Float period (s)",
+ min: 4,
+ max: 16,
+ step: 0.5,
+ },
+ {
+ group: "frame",
+ key: "floatTilt",
+ label: "Float tilt (deg)",
+ min: 0,
+ max: 3,
+ step: 0.1,
+ },
+ {
+ group: "frame",
+ key: "parallax",
+ label: "Cursor parallax (px)",
+ min: 0,
+ max: 40,
+ step: 1,
+ },
+ {
+ group: "frame",
+ key: "depthSpread",
+ label: "Depth spread",
+ min: 0,
+ max: 1,
+ step: 0.05,
+ },
+ {
+ group: "swap",
+ key: "stagger",
+ label: "Stagger between cards (ms)",
+ min: 0,
+ max: 500,
+ step: 10,
+ },
+ {
+ group: "swap",
+ key: "duration",
+ label: "Pass time (ms)",
+ min: 200,
+ max: 1600,
+ step: 10,
+ },
+ {
+ group: "swap",
+ key: "cell",
+ label: "Dither dot grid (px)",
+ min: 2,
+ max: 8,
+ step: 1,
+ },
+ {
+ group: "swap",
+ key: "band",
+ label: "Dither band width",
+ min: 0.08,
+ max: 0.6,
+ step: 0.01,
+ },
+ {
+ group: "swap",
+ key: "passes",
+ label: "Working passes before reveal",
+ min: 0,
+ max: 3,
+ step: 1,
+ },
+ {
+ group: "swap",
+ key: "dim",
+ label: "Dim other scenes",
+ min: 0,
+ max: 0.6,
+ step: 0.05,
+ },
+ {
+ group: "play",
+ key: "speed",
+ label: "Playback speed",
+ min: 0.5,
+ max: 2,
+ step: 0.05,
+ },
+ {
+ group: "play",
+ key: "loopGap",
+ label: "Pause between loops (s)",
+ min: 0.2,
+ max: 4,
+ step: 0.1,
+ },
+];
+
+function Segmented<T extends string>({
+ options,
+ value,
+ onChange,
+}: {
+ options: readonly T[];
+ value: T;
+ onChange: (value: T) => void;
+}) {
+ return (
+ <div className="flex gap-0.5 rounded-lg bg-muted p-0.5">
+ {options.map((option) => (
+ <button
+ key={option}
+ type="button"
+ onClick={() => onChange(option)}
+ className={cn(
+ "flex-1 rounded-md px-2 py-1.5 text-xs transition-colors",
+ option === value
+ ? "bg-background text-foreground shadow-sm"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ {option}
+ </button>
+ ))}
+ </div>
+ );
+}
+
+export function HeroScenesLab() {
+ const [config, setConfig] = useState<ScenesConfig>(() => ({
+ ...DEFAULT_SCENES_CONFIG,
+ ...(saved as Partial<ScenesConfig>),
+ live: (saved as Partial<ScenesConfig>).live ?? DEFAULT_LIVE_CLIPS,
+ }));
+ const [prompt, setPrompt] = useState(0);
+ const [pinned, setPinned] = useState(true);
+ const [panel, setPanel] = useState(true);
+ const [written, setWritten] = useState<string | null>(null);
+
+ const set = <G extends Group>(group: G, patch: Partial<ScenesConfig[G]>) =>
+ setConfig((prev) => ({ ...prev, [group]: { ...prev[group], ...patch } }));
+
+ const save = async () => {
+ const json = JSON.stringify(config, null, 2);
+ await navigator.clipboard?.writeText(json).catch(() => undefined);
+ const response = await fetch("/api/lab/hero-scenes", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: json,
+ });
+ const body = (await response.json().catch(() => ({}))) as { path?: string };
+ setWritten(body.path ?? "write failed");
+ };
+
+ return (
+ <div className="min-h-screen bg-background">
+ <div className="relative mx-auto flex w-full max-w-[1440px] flex-col overflow-x-clip pt-[130px] pb-[320px]">
+ <SceneField
+ config={config}
+ set={
+ config.swap.set === "live"
+ ? liveSet(config.live)
+ : SCENE_SETS[config.swap.set]
+ }
+ pinned={config.swap.set === "live" && pinned ? prompt : undefined}
+ />
+ <PromptComposer />
+ <ComposerStatus />
+ </div>
+
+ <div className="fixed right-4 bottom-4 z-50 flex flex-col items-end gap-2">
+ {panel && (
+ <div className="flex max-h-[85vh] w-[400px] flex-col gap-4 overflow-y-auto rounded-2xl border border-border bg-background/95 p-4 shadow-xl backdrop-blur">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs font-semibold">Scenes lab</Label>
+ <Button size="sm" onClick={save}>
+ Save
+ </Button>
+ </div>
+ {written && (
+ <p className="font-mono text-[11px] text-muted-foreground">
+ wrote {written}
+ </p>
+ )}
+ <Label className="text-xs text-muted-foreground">Scene set</Label>
+ <Segmented
+ options={SCENE_SET_OPTIONS}
+ value={config.swap.set}
+ onChange={(value) => set("swap", { set: value })}
+ />
+ {config.swap.set === "live" && (
+ <SlotEditor
+ clips={config.live}
+ prompt={prompt}
+ onPrompt={(next) => {
+ setPrompt(next);
+ setPinned(true);
+ }}
+ pinned={pinned}
+ onPinned={setPinned}
+ onChange={(live) => setConfig((prev) => ({ ...prev, live }))}
+ />
+ )}
+ <Label className="text-xs text-muted-foreground">Content</Label>
+ <Segmented
+ options={CONTENT_MODES}
+ value={config.swap.mode}
+ onChange={(mode) => set("swap", { mode })}
+ />
+ <Label className="text-xs text-muted-foreground">
+ Swap transition
+ </Label>
+ <Segmented
+ options={SWAP_TRANSITIONS}
+ value={config.swap.transition}
+ onChange={(transition) => set("swap", { transition })}
+ />
+ {KNOBS.map((knob) => {
+ const value = (config[knob.group] as Record<string, number>)[
+ knob.key
+ ];
+ return (
+ <div key={`${knob.group}-${knob.key}`} className="py-0.5">
+ <div className="mb-1.5 flex items-baseline justify-between gap-3">
+ <Label className="text-xs text-muted-foreground">
+ {knob.label}
+ </Label>
+ <span className="font-mono text-xs tabular-nums">
+ {value}
+ </span>
+ </div>
+ <Slider
+ value={value}
+ min={knob.min}
+ max={knob.max}
+ step={knob.step}
+ onValueChange={(next) =>
+ set(knob.group, {
+ [knob.key]: Array.isArray(next) ? next[0] : next,
+ })
+ }
+ />
+ </div>
+ );
+ })}
+ </div>
+ )}
+ <Button size="sm" variant="secondary" onClick={() => setPanel(!panel)}>
+ {panel ? "Hide panel" : "Show panel"}
+ </Button>
+ </div>
+ </div>
+ );
+}
diff --git a/app/lab/hero-scenes/page.tsx b/app/lab/hero-scenes/page.tsx
new file mode 100644
index 00000000..49843553
--- /dev/null
+++ b/app/lab/hero-scenes/page.tsx
@@ -0,0 +1,11 @@
+import type { Metadata } from "next";
+import { HeroScenesLab } from "./hero-scenes-lab";
+
+export const metadata: Metadata = {
+ title: "Hero scenes lab",
+ robots: { index: false, follow: false },
+};
+
+export default function Page() {
+ return <HeroScenesLab />;
+}
diff --git a/app/lab/hero-tiles/hero-tiles-lab.tsx b/app/lab/hero-tiles/hero-tiles-lab.tsx
new file mode 100644
index 00000000..713eca8f
--- /dev/null
+++ b/app/lab/hero-tiles/hero-tiles-lab.tsx
@@ -0,0 +1,411 @@
+"use client";
+
+import { useEffect, useState } from "react";
+import {
+ HeroHeadline,
+ TILE_SLOT,
+} from "@/app/(home)/components/landing/sections/hero/hero-headline";
+import { AeTileComposition } from "@/app/(home)/components/landing/sections/hero/tiles/ae-tile";
+import {
+ AE_MODES,
+ aeDuration,
+ type ClipSpec,
+ DEFAULT_CONFIG,
+ type HeroTilesConfig,
+ resolveReel,
+ TRANSITIONS,
+ VIDEO_MODES,
+} from "@/app/(home)/components/landing/sections/hero/tiles/config";
+import saved from "@/app/(home)/components/landing/sections/hero/tiles/hero-tiles.json";
+import {
+ type TilePlayback,
+ TilePlayer,
+} from "@/app/(home)/components/landing/sections/hero/tiles/tile-player";
+import { VideoTileComposition } from "@/app/(home)/components/landing/sections/hero/tiles/video-tile";
+import {
+ CatalogPicker,
+ ClipRow,
+ newClip,
+ Range,
+ Segmented,
+} from "@/app/lab/_components/clip-editor";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+
+const RAIL_KEY = "lab:hero-tiles:rail:v2";
+
+type Section = "video" | "ae";
+
+type Knob = {
+ section: Section;
+ key: string;
+ label: string;
+ min: number;
+ max: number;
+ step: number;
+};
+
+const KNOBS: Knob[] = [
+ {
+ section: "video",
+ key: "beat",
+ label: "Beat (frames)",
+ min: 36,
+ max: 150,
+ step: 2,
+ },
+ {
+ section: "video",
+ key: "transitionFrames",
+ label: "Cut length (frames)",
+ min: 0,
+ max: 24,
+ step: 1,
+ },
+ {
+ section: "video",
+ key: "tilt",
+ label: "Rest tilt (deg)",
+ min: -12,
+ max: 0,
+ step: 0.5,
+ },
+ {
+ section: "video",
+ key: "sway",
+ label: "Sway on cut (deg)",
+ min: 0,
+ max: 10,
+ step: 0.5,
+ },
+ {
+ section: "video",
+ key: "deckDepth",
+ label: "Deck depth",
+ min: 1,
+ max: 3,
+ step: 1,
+ },
+ {
+ section: "video",
+ key: "morph",
+ label: "Morph squash",
+ min: 0,
+ max: 1,
+ step: 0.05,
+ },
+ {
+ section: "ae",
+ key: "period",
+ label: "Period (frames)",
+ min: 24,
+ max: 90,
+ step: 2,
+ },
+ {
+ section: "ae",
+ key: "bounce",
+ label: "Bounce height",
+ min: 0,
+ max: 0.35,
+ step: 0.01,
+ },
+ {
+ section: "ae",
+ key: "tilt",
+ label: "Rest tilt (deg)",
+ min: 0,
+ max: 10,
+ step: 0.5,
+ },
+ {
+ section: "ae",
+ key: "stallAt",
+ label: "Stall at (%)",
+ min: 80,
+ max: 99,
+ step: 1,
+ },
+ {
+ section: "ae",
+ key: "delay",
+ label: "Delay vs video (frames)",
+ min: 0,
+ max: 120,
+ step: 2,
+ },
+];
+
+function readRail(): HeroTilesConfig[] {
+ try {
+ return JSON.parse(localStorage.getItem(RAIL_KEY) ?? "[]");
+ } catch {
+ return [];
+ }
+}
+
+export function HeroTilesLab() {
+ const [config, setConfig] = useState<HeroTilesConfig>(() => ({
+ ...DEFAULT_CONFIG,
+ ...(saved as HeroTilesConfig),
+ }));
+ const [rail, setRail] = useState<HeroTilesConfig[]>([]);
+ const [written, setWritten] = useState<string | null>(null);
+ const [videoState, setVideoState] = useState<TilePlayback>("paused");
+ const [aeState, setAeState] = useState<TilePlayback>("paused");
+ const [openIndex, setOpenIndex] = useState<number | null>(null);
+ const [soloIndex, setSoloIndex] = useState<number | null>(null);
+
+ useEffect(() => setRail(readRail()), []);
+
+ const clips = config.video.clips;
+ const solo = soloIndex !== null ? clips[soloIndex] : undefined;
+ const previewConfig: HeroTilesConfig = solo
+ ? {
+ ...config,
+ video: { ...config.video, clips: [solo], transitionFrames: 0 },
+ }
+ : config;
+ const reel = resolveReel(previewConfig);
+
+ const setVideo = (patch: Partial<HeroTilesConfig["video"]>) =>
+ setConfig((prev) => ({ ...prev, video: { ...prev.video, ...patch } }));
+ const setAe = (patch: Partial<HeroTilesConfig["ae"]>) =>
+ setConfig((prev) => ({ ...prev, ae: { ...prev.ae, ...patch } }));
+ const setClips = (update: (clips: ClipSpec[]) => ClipSpec[]) =>
+ setConfig((prev) => ({
+ ...prev,
+ video: { ...prev.video, clips: update(prev.video.clips) },
+ }));
+
+ const moveClip = (index: number, delta: number) => {
+ const target = index + delta;
+ setClips((list) => {
+ const next = [...list];
+ [next[index], next[target]] = [next[target], next[index]];
+ return next;
+ });
+ setOpenIndex((open) =>
+ open === index ? target : open === target ? index : open,
+ );
+ setSoloIndex((s) => (s === index ? target : s === target ? index : s));
+ };
+
+ const removeClip = (index: number) => {
+ setClips((list) => list.filter((_, i) => i !== index));
+ setOpenIndex(null);
+ setSoloIndex(null);
+ };
+
+ const reseed = () =>
+ setConfig((prev) => ({
+ ...prev,
+ seed: Math.floor(Math.random() * 2 ** 31),
+ }));
+
+ const save = async () => {
+ const json = JSON.stringify(config, null, 2);
+ await navigator.clipboard?.writeText(json).catch(() => undefined);
+ const nextRail = [
+ config,
+ ...rail.filter((c) => JSON.stringify(c) !== JSON.stringify(config)),
+ ].slice(0, 12);
+ setRail(nextRail);
+ localStorage.setItem(RAIL_KEY, JSON.stringify(nextRail));
+ const response = await fetch("/api/lab/hero-tiles", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: json,
+ });
+ const body = (await response.json().catch(() => ({}))) as { path?: string };
+ setWritten(body.path ?? "write failed");
+ };
+
+ return (
+ <div className="flex min-h-screen bg-background">
+ <div className="relative flex min-h-screen flex-1 flex-col items-center justify-center gap-10 px-6">
+ <button
+ type="button"
+ aria-label="New variation"
+ onClick={reseed}
+ className="absolute inset-0 cursor-pointer outline-none"
+ />
+ <div className="pointer-events-none relative flex flex-col items-center gap-6">
+ <HeroHeadline
+ videoTile={
+ <TilePlayer
+ component={VideoTileComposition}
+ config={previewConfig}
+ durationInFrames={reel.durationInFrames}
+ respectReducedMotion={false}
+ onPlayback={setVideoState}
+ className={TILE_SLOT}
+ />
+ }
+ aeTile={
+ <TilePlayer
+ component={AeTileComposition}
+ config={config}
+ durationInFrames={aeDuration(config)}
+ respectReducedMotion={false}
+ onPlayback={setAeState}
+ className={TILE_SLOT}
+ />
+ }
+ />
+ <span className="font-mono text-xs text-muted-foreground">
+ {solo
+ ? `solo ${solo.name}`
+ : `seed ${config.seed}, ${reel.cuts
+ .slice(0, -1)
+ .map((c) => c.kind)
+ .join(", ")}, click for new cuts`}
+ </span>
+ <span className="font-mono text-xs text-muted-foreground">
+ video {videoState}, ae {aeState}
+ </span>
+ </div>
+ </div>
+
+ <aside className="sticky top-0 flex h-screen w-[400px] shrink-0 flex-col gap-5 overflow-y-auto border-l border-border bg-background/95 p-4">
+ <div className="flex items-center justify-between gap-2">
+ <span className="font-mono text-xs text-muted-foreground">
+ seed {config.seed}
+ </span>
+ <div className="flex gap-2">
+ <Button size="sm" variant="secondary" onClick={reseed}>
+ New cuts
+ </Button>
+ <Button size="sm" onClick={save}>
+ Save
+ </Button>
+ </div>
+ </div>
+ {written && (
+ <p className="font-mono text-[11px] text-muted-foreground">
+ wrote {written}
+ </p>
+ )}
+
+ <section className="flex flex-col gap-2">
+ <div className="flex items-center justify-between">
+ <Label className="text-xs font-semibold">
+ Clip ({clips.length}, {(reel.durationInFrames / 30).toFixed(1)}s
+ loop)
+ </Label>
+ <Button
+ size="xs"
+ variant="ghost"
+ onClick={() => {
+ setClips(() => DEFAULT_CONFIG.video.clips);
+ setOpenIndex(null);
+ setSoloIndex(null);
+ }}
+ >
+ Reset
+ </Button>
+ </div>
+ {clips.map((clip, index) => (
+ <ClipRow
+ key={`${clip.name}-${index}`}
+ clip={clip}
+ index={index}
+ count={clips.length}
+ open={openIndex === index}
+ solo={soloIndex === index}
+ onToggle={() => setOpenIndex(openIndex === index ? null : index)}
+ onSolo={() => setSoloIndex(soloIndex === index ? null : index)}
+ onMove={(delta) => moveClip(index, delta)}
+ onRemove={() => removeClip(index)}
+ onChange={(patch) =>
+ setClips((list) =>
+ list.map((c, i) => (i === index ? { ...c, ...patch } : c)),
+ )
+ }
+ />
+ ))}
+ <Label className="mt-2 text-xs text-muted-foreground">
+ Add from the catalog
+ </Label>
+ <CatalogPicker
+ onAdd={(name) => {
+ setClips((list) => [...list, newClip(name)]);
+ setOpenIndex(clips.length);
+ }}
+ />
+ </section>
+
+ <section className="flex flex-col gap-2">
+ <Label className="text-xs font-semibold">Video tile</Label>
+ <Segmented
+ options={VIDEO_MODES}
+ value={config.video.mode}
+ onChange={(mode) => setVideo({ mode })}
+ />
+ <Label className="text-xs text-muted-foreground">
+ Cuts set to auto
+ </Label>
+ <Segmented
+ options={TRANSITIONS}
+ value={config.video.transition}
+ onChange={(transition) => setVideo({ transition })}
+ />
+ {KNOBS.filter((k) => k.section === "video").map((knob) => (
+ <Range
+ key={knob.key}
+ id={`video-${knob.key}`}
+ label={knob.label}
+ value={config.video[knob.key as "beat"]}
+ min={knob.min}
+ max={knob.max}
+ step={knob.step}
+ onChange={(value) => setVideo({ [knob.key]: value })}
+ />
+ ))}
+ </section>
+
+ <section className="flex flex-col gap-2">
+ <Label className="text-xs font-semibold">After Effects tile</Label>
+ <Segmented
+ options={AE_MODES}
+ value={config.ae.mode}
+ onChange={(mode) => setAe({ mode })}
+ />
+ {KNOBS.filter((k) => k.section === "ae").map((knob) => (
+ <Range
+ key={knob.key}
+ id={`ae-${knob.key}`}
+ label={knob.label}
+ value={config.ae[knob.key as "period"]}
+ min={knob.min}
+ max={knob.max}
+ step={knob.step}
+ onChange={(value) => setAe({ [knob.key]: value })}
+ />
+ ))}
+ </section>
+
+ {rail.length > 0 && (
+ <section className="flex flex-col gap-2">
+ <Label className="text-xs font-semibold">Saved</Label>
+ {rail.map((item, i) => (
+ <button
+ key={`${item.seed}-${i}`}
+ type="button"
+ onClick={() => {
+ setConfig(item);
+ setOpenIndex(null);
+ setSoloIndex(null);
+ }}
+ className="rounded-md bg-muted px-2.5 py-2 text-left font-mono text-[11px] text-muted-foreground hover:text-foreground"
+ >
+ {item.video.mode} / {item.ae.mode},{" "}
+ {item.video.clips.map((c) => c.name).join(", ")}
+ </button>
+ ))}
+ </section>
+ )}
+ </aside>
+ </div>
+ );
+}
diff --git a/app/lab/hero-tiles/page.tsx b/app/lab/hero-tiles/page.tsx
new file mode 100644
index 00000000..eb23dabc
--- /dev/null
+++ b/app/lab/hero-tiles/page.tsx
@@ -0,0 +1,11 @@
+import type { Metadata } from "next";
+import { HeroTilesLab } from "./hero-tiles-lab";
+
+export const metadata: Metadata = {
+ title: "Hero tiles lab",
+ robots: { index: false, follow: false },
+};
+
+export default function Page() {
+ return <HeroTilesLab />;
+}
diff --git a/app/lab/whats-inside/bento-lab.tsx b/app/lab/whats-inside/bento-lab.tsx
new file mode 100644
index 00000000..78b6198f
--- /dev/null
+++ b/app/lab/whats-inside/bento-lab.tsx
@@ -0,0 +1,193 @@
+"use client";
+
+import { type ReactNode, useState } from "react";
+import type { ClipSpec } from "@/app/(home)/components/landing/sections/hero/tiles/config";
+import {
+ BentoClipsContext,
+ SAVED_BENTO,
+} from "@/app/(home)/components/landing/sections/whats-inside/bento-clip";
+import {
+ BENTO_SLOTS,
+ type BentoClips,
+ type BentoSlot,
+ DEFAULT_BENTO,
+} from "@/app/(home)/components/landing/sections/whats-inside/bento-clips";
+import {
+ CatalogPicker,
+ ClipRow,
+ newClip,
+} from "@/app/lab/_components/clip-editor";
+import { Button } from "@/components/ui/button";
+import { Label } from "@/components/ui/label";
+import { cn } from "@/lib/utils";
+
+type Target = BentoSlot | "typography";
+
+const SLOT_LABELS: Record<BentoSlot, string> = {
+ transitions: "Transitions",
+ captions: "Captions",
+ filters: "Filters",
+ backgrounds: "Backgrounds",
+};
+
+function remixWord(name: string): ClipSpec {
+ return {
+ ...newClip(name),
+ background: "transparent",
+ props: { text: "Arrive.", fontSize: 200, color: "currentColor" },
+ };
+}
+
+export function BentoLab({ children }: { children: ReactNode }) {
+ const [clips, setClips] = useState<BentoClips>(SAVED_BENTO);
+ const [target, setTarget] = useState<Target>("typography");
+ const [open, setOpen] = useState<string | null>(null);
+ const [panel, setPanel] = useState(true);
+ const [written, setWritten] = useState<string | null>(null);
+
+ const setRemix = (typography: ClipSpec[]) =>
+ setClips((prev) => ({ ...prev, typography }));
+
+ const save = async () => {
+ const json = JSON.stringify(clips, null, 2);
+ await navigator.clipboard?.writeText(json).catch(() => undefined);
+ const response = await fetch("/api/lab/whats-inside", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: json,
+ });
+ const body = (await response.json().catch(() => ({}))) as { path?: string };
+ setWritten(body.path ?? "write failed");
+ };
+
+ const add = (name: string) => {
+ if (target === "typography") {
+ setRemix([...clips.typography, remixWord(name)]);
+ setOpen(`typography-${clips.typography.length}`);
+ return;
+ }
+ setClips((prev) => ({ ...prev, [target]: newClip(name) }));
+ setOpen(target);
+ };
+
+ return (
+ <div className="min-h-screen bg-background py-20">
+ <BentoClipsContext value={clips}>{children}</BentoClipsContext>
+
+ <div className="fixed right-4 bottom-4 z-50 flex flex-col items-end gap-2">
+ {panel && (
+ <div className="flex max-h-[85vh] w-[400px] flex-col gap-3 overflow-y-auto rounded-2xl border border-border bg-background/95 p-4 shadow-xl backdrop-blur">
+ <div className="flex items-center justify-between gap-2">
+ <Label className="text-xs font-semibold">Bento lab</Label>
+ <div className="flex gap-1">
+ <Button
+ size="sm"
+ variant="ghost"
+ onClick={() => setClips(DEFAULT_BENTO)}
+ >
+ Defaults
+ </Button>
+ <Button size="sm" onClick={save}>
+ Save
+ </Button>
+ </div>
+ </div>
+ {written && (
+ <p className="font-mono text-[11px] text-muted-foreground">
+ wrote {written}
+ </p>
+ )}
+
+ <button
+ type="button"
+ onClick={() => setTarget("typography")}
+ className={cn(
+ "rounded-md text-left text-xs font-semibold",
+ target === "typography"
+ ? "text-primary"
+ : "text-muted-foreground",
+ )}
+ >
+ Typography remix, in play order
+ </button>
+ {clips.typography.map((clip, index) => {
+ const key = `typography-${index}`;
+ return (
+ <ClipRow
+ key={key}
+ clip={clip}
+ index={index}
+ count={clips.typography.length}
+ open={open === key}
+ reel={false}
+ onToggle={() => {
+ setTarget("typography");
+ setOpen(open === key ? null : key);
+ }}
+ onMove={(delta) => {
+ const next = [...clips.typography];
+ const [moved] = next.splice(index, 1);
+ next.splice(index + delta, 0, moved);
+ setRemix(next);
+ }}
+ onRemove={() =>
+ setRemix(clips.typography.filter((_, i) => i !== index))
+ }
+ onChange={(patch) =>
+ setRemix(
+ clips.typography.map((item, i) =>
+ i === index ? { ...item, ...patch } : item,
+ ),
+ )
+ }
+ />
+ );
+ })}
+
+ <Label className="mt-2 text-xs font-semibold text-muted-foreground">
+ Tiles
+ </Label>
+ {BENTO_SLOTS.map((id, index) => (
+ <div
+ key={id}
+ className={cn(
+ "rounded-lg",
+ target === id && "ring-2 ring-primary/40",
+ )}
+ >
+ <ClipRow
+ clip={clips[id]}
+ index={index}
+ count={BENTO_SLOTS.length}
+ label={SLOT_LABELS[id]}
+ open={open === id}
+ reel={false}
+ onToggle={() => {
+ setTarget(id);
+ setOpen(open === id ? null : id);
+ }}
+ onChange={(patch) =>
+ setClips((prev) => ({
+ ...prev,
+ [id]: { ...prev[id], ...patch },
+ }))
+ }
+ />
+ </div>
+ ))}
+
+ <Label className="mt-1 text-xs text-muted-foreground">
+ {target === "typography"
+ ? "Add to the typography remix"
+ : `Put into ${SLOT_LABELS[target]}`}
+ </Label>
+ <CatalogPicker onAdd={add} />
+ </div>
+ )}
+ <Button size="sm" variant="secondary" onClick={() => setPanel(!panel)}>
+ {panel ? "Hide panel" : "Show panel"}
+ </Button>
+ </div>
+ </div>
+ );
+}
diff --git a/app/lab/whats-inside/page.tsx b/app/lab/whats-inside/page.tsx
new file mode 100644
index 00000000..5a4bac2c
--- /dev/null
+++ b/app/lab/whats-inside/page.tsx
@@ -0,0 +1,16 @@
+import type { Metadata } from "next";
+import { WhatsInside } from "@/app/(home)/components/landing/sections/whats-inside";
+import { BentoLab } from "./bento-lab";
+
+export const metadata: Metadata = {
+ title: "What's inside lab",
+ robots: { index: false, follow: false },
+};
+
+export default function Page() {
+ return (
+ <BentoLab>
+ <WhatsInside />
+ </BentoLab>
+ );
+}
diff --git a/app/layout.tsx b/app/layout.tsx
index 4e380c26..0048bd3a 100644
--- a/app/layout.tsx
+++ b/app/layout.tsx
@@ -1,25 +1,34 @@
+import { GeistSans } from "geist/font/sans";
import type { Metadata } from "next";
-import { Geist, Geist_Mono, Manrope } from "next/font/google";
+import { Geist_Mono, Manrope } from "next/font/google";
+import localFont from "next/font/local";
import { ThemeProvider } from "next-themes";
import { NuqsAdapter } from "nuqs/adapters/next/app";
import "./globals.css";
import { OpenPanelComponent } from "@openpanel/nextjs";
-import { STUDIO_BAR_SCRIPT } from "@/lib/studio-bar";
import { cn } from "@/lib/utils";
import { ThemeShortcut } from "./theme-shortcut";
-const inter = Manrope({ subsets: ["latin"], variable: "--font-sans" });
+const manrope = Manrope({ subsets: ["latin"], variable: "--font-manrope" });
-const geistSans = Geist({
- variable: "--font-geist-sans",
- subsets: ["latin"],
-});
+// The `geist` package ships the full Geist charset; the Google Fonts build
+// lacks glyphs like "→" that the design uses throughout.
+const geistSans = GeistSans;
const geistMono = Geist_Mono({
variable: "--font-geist-mono",
subsets: ["latin"],
});
+// Paper Mono (SIL OFL 1.1, see ./fonts/PaperMono-OFL.txt) is the only mono
+// face in the design system: commands, code, paths and `@remocn/...` names.
+const paperMono = localFont({
+ src: "./fonts/PaperMono-Variable.woff2",
+ variable: "--font-paper-mono",
+ weight: "100 800",
+ display: "swap",
+});
+
const SITE_URL = "https://remocn.dev";
const SITE_TITLE = "Remocn - Make a product demo video with your AI agent";
const SITE_DESCRIPTION =
@@ -65,22 +74,18 @@ export default function RootLayout({
return (
<html
lang="en"
+ data-scroll-behavior="smooth"
suppressHydrationWarning
className={cn(
"h-full",
"antialiased",
geistSans.variable,
geistMono.variable,
+ paperMono.variable,
"font-sans",
- inter.variable,
+ manrope.variable,
)}
>
- <head>
- <script
- // biome-ignore lint/security/noDangerouslySetInnerHtml: restores the dismissed studio bar before first paint
- dangerouslySetInnerHTML={{ __html: STUDIO_BAR_SCRIPT }}
- />
- </head>
<body className="min-h-full flex flex-col">
<NuqsAdapter>
<ThemeProvider
diff --git a/app/not-found-video.tsx b/app/not-found-video.tsx
index 07e4a88a..13962d83 100644
--- a/app/not-found-video.tsx
+++ b/app/not-found-video.tsx
@@ -17,6 +17,8 @@ function Clip({
}) {
const videoRef = useRef<HTMLVideoElement>(null);
+ // The other theme's clip is `display: none` and never intersects, so only
+ // the visible one plays (and it picks up again after a theme switch).
useEffect(() => {
const video = videoRef.current;
if (!video) return;
@@ -24,7 +26,12 @@ function Clip({
video.pause();
return;
}
- void video.play().catch(() => {});
+ const observer = new IntersectionObserver(([entry]) => {
+ if (entry.isIntersecting) void video.play().catch(() => {});
+ else video.pause();
+ });
+ observer.observe(video);
+ return () => observer.disconnect();
}, [paused]);
return (
@@ -32,8 +39,6 @@ function Clip({
ref={videoRef}
src={`/not-found-${theme}.mp4`}
poster={`/not-found-${theme}.jpg`}
- aria-label="404"
- autoPlay
muted
loop
playsInline
@@ -48,7 +53,7 @@ export function NotFoundVideo() {
const reducedMotion = usePrefersReducedMotion();
return (
- <div className="relative size-full overflow-hidden">
+ <div aria-hidden="true" className="absolute inset-0 overflow-hidden">
<Clip theme="light" className="dark:hidden" paused={reducedMotion} />
<Clip theme="dark" className="hidden dark:block" paused={reducedMotion} />
</div>
diff --git a/app/not-found.tsx b/app/not-found.tsx
index ec6ca9f3..33d55548 100644
--- a/app/not-found.tsx
+++ b/app/not-found.tsx
@@ -1,10 +1,9 @@
import type { Metadata } from "next";
-import Link from "next/link";
-import { FadeUp } from "@/app/(home)/components/fade-up";
+import { LandingButton } from "@/app/(home)/components/landing/ui/landing-button";
+import { SectionTitle } from "@/app/(home)/components/landing/ui/section-title";
import { PageShell } from "@/app/(home)/components/page-shell";
import { SiteFooter } from "@/app/(home)/components/site-footer";
import { SiteHeader } from "@/app/(home)/components/site-header";
-import { Button } from "@/components/ui/button";
import { NotFoundVideo } from "./not-found-video";
export const metadata: Metadata = {
@@ -12,63 +11,49 @@ export const metadata: Metadata = {
robots: { index: false, follow: true },
};
+const BUTTON = "h-12 w-full md:w-auto";
+
export default function NotFound() {
return (
- <PageShell className="h-dvh min-h-0 overflow-hidden">
- <div className="shrink-0">
- <SiteHeader />
- </div>
+ <PageShell className="min-h-dvh">
+ <SiteHeader />
- <main className="relative isolate flex min-h-0 flex-1 flex-col">
+ <main className="relative isolate flex flex-1 flex-col">
<div aria-hidden className="absolute inset-0 -z-10">
<div className="absolute inset-0 bg-grid-fade" />
</div>
- <div className="min-h-0 flex-1">
+ <div className="relative min-h-[200px] flex-1">
<NotFoundVideo />
</div>
- <div className="section shrink-0 pt-4 pb-6 sm:pt-6 sm:pb-8">
- <div className="mx-auto flex max-w-2xl flex-col items-center text-center">
- <FadeUp delay={0.08}>
- <h1 className="text-balance text-3xl font-semibold leading-[1.1] tracking-tight text-foreground sm:text-4xl">
- This page doesn't exist
- </h1>
- </FadeUp>
-
- <FadeUp delay={0.14}>
- <p className="mt-3 text-balance text-base leading-relaxed text-muted-foreground sm:text-lg">
- The link is broken, or the page moved. The components, docs and
- showcases are all still where you left them.
- </p>
- </FadeUp>
-
- <FadeUp delay={0.2}>
- <div className="mt-6 flex flex-col items-center gap-3 sm:flex-row">
- <Button
- size="lg"
- className="rounded-full"
- render={<Link href="/" />}
- >
- Back home
- </Button>
- <Button
- variant="secondary"
- size="lg"
- className="rounded-full font-medium"
- render={<Link href="/docs/typography" />}
- >
- Browse components
- </Button>
- </div>
- </FadeUp>
+ <div className="landing-container flex shrink-0 flex-col items-center gap-4 pt-4 pb-10 text-center md:gap-5 md:pt-6 md:pb-14">
+ <SectionTitle
+ as="h1"
+ align="center"
+ title="This page doesn’t exist"
+ />
+ <p className="max-w-[560px] text-ui leading-6 text-muted-foreground text-balance md:text-lead md:leading-7">
+ The link is broken, or the page moved. The components, docs and
+ showcases are all still where you left them.
+ </p>
+ <div className="flex w-full flex-col gap-2.5 pt-2 md:w-auto md:flex-row">
+ <LandingButton href="/" size="md" arrow="→" className={BUTTON}>
+ Back home
+ </LandingButton>
+ <LandingButton
+ href="/docs/typography"
+ variant="secondary"
+ size="md"
+ className={BUTTON}
+ >
+ Browse components
+ </LandingButton>
</div>
</div>
</main>
- <div className="shrink-0">
- <SiteFooter />
- </div>
+ <SiteFooter />
</PageShell>
);
}
diff --git a/app/typeset.css b/app/typeset.css
index a2a68c6b..d395e2e2 100644
--- a/app/typeset.css
+++ b/app/typeset.css
@@ -6,8 +6,9 @@
* 1. Every escape-hatch guard also excludes .not-prose: fumadocs internals
* (tabs, cards, code block chrome) and the existing doc widgets opt out
* via not-prose in markup we cannot or do not want to change.
- * 2. The .typeset-docs preset block at the end of the file holds the docs
- * surface rhythm variables.
+ * 2. The .typeset-docs block at the end of the file holds the docs article
+ * styles (rhythm, headings, inline code, tables) and the CodeFrame token
+ * rules.
*/
@layer components {
@@ -99,8 +100,6 @@
font-size: 0.8125em;
line-height: 1.5;
font-weight: 500;
- letter-spacing: 0.08em;
- text-transform: uppercase;
color: var(--typeset-muted);
margin-block-start: calc(var(--typeset-flow) / 0.8125);
}
@@ -311,9 +310,6 @@
border-radius: var(--radius, 0.5em);
padding: 0.75em 1em;
overflow-x: auto;
- scrollbar-width: thin;
- scrollbar-color: color-mix(in oklab, currentColor 25%, transparent)
- transparent;
margin-block-start: calc(var(--typeset-flow) / 0.875);
margin-block-end: 0;
}
@@ -516,10 +512,179 @@
}
}
+/*
+ * Docs article (Paper "Docs Shell — V1 Refined"): 16/26 body copy in the body
+ * colour, 26/32 medium section headings 48px below the previous block, 20px
+ * between blocks (24px on phones), inline code as a small white chip. Custom
+ * MDX blocks are `not-prose` and follow the same rhythm through
+ * `components/docs/blocks/spacing.ts`.
+ */
@layer components {
.typeset-docs {
--typeset-size: 1em;
- --typeset-leading: 1.75;
- --typeset-flow: 1.25em;
+ --typeset-leading: 1.625;
+ --typeset-flow: 20px;
+ font-size: 1rem;
+ color: var(--color-body);
+
+ @media (max-width: 47.999rem) {
+ --typeset-leading: 1.5;
+ --typeset-flow: 24px;
+ }
+ }
+
+ .typeset-docs
+ *:not(
+ :where(
+ .not-typeset,
+ .not-prose,
+ [data-not-typeset],
+ .not-typeset *,
+ .not-prose *,
+ [data-not-typeset] *
+ )
+ ) {
+ &:where(h2, h3, h4) {
+ font-weight: 500;
+ letter-spacing: -0.02em;
+ scroll-margin-block-start: 96px;
+ }
+ &:where(h2) {
+ font-size: 26px;
+ line-height: 32px;
+ margin-block-start: 48px;
+ }
+ &:where(h3) {
+ font-size: 20px;
+ line-height: 28px;
+ margin-block-start: 32px;
+ }
+ &:where(h4) {
+ font-size: 17px;
+ line-height: 24px;
+ margin-block-start: 24px;
+ }
+ &:where(h2 + *) {
+ margin-block-start: 16px;
+
+ @media (max-width: 47.999rem) {
+ margin-block-start: 14px;
+ }
+ }
+ &:where(h3 + *, h4 + *) {
+ margin-block-start: 12px;
+ }
+
+ &:where(strong, b) {
+ color: var(--color-foreground);
+ font-weight: 500;
+ }
+
+ &:where(a) {
+ color: var(--color-foreground);
+ text-decoration-color: var(--color-divider);
+ text-underline-offset: 3px;
+ border-radius: 4px;
+ transition: text-decoration-color 150ms ease-out;
+ }
+ &:where(a:hover) {
+ text-decoration-color: var(--color-foreground);
+ }
+
+ &:where(:not(pre) > code) {
+ background-color: var(--color-surface);
+ box-shadow: 0 0 0 1px var(--color-hairline);
+ color: var(--color-foreground);
+ font-size: 0.8125em;
+ border-radius: var(--radius-tag);
+ padding: 0.15em 0.4em;
+ box-decoration-break: clone;
+ }
+
+ &:where(ul, ol) {
+ padding-inline-start: 1.25em;
+ }
+ &:where(li) {
+ margin-block-start: 6px;
+ padding-inline-start: 0.25em;
+ }
+ &:where(ul > li)::marker,
+ &:where(ol > li)::marker {
+ color: var(--color-subtle);
+ }
+
+ &:where(blockquote) {
+ border-inline-start-color: var(--color-divider);
+ color: var(--color-muted-foreground);
+ }
+ &:where(hr) {
+ border-block-start-color: var(--color-hairline);
+ margin-block-start: 48px;
+ }
+ }
+
+ /* Markdown tables sit in a card like the props table. */
+ .typeset-docs .docs-table {
+ margin-block-start: var(--typeset-flow);
+ overflow-x: auto;
+ border: 1px solid var(--color-hairline);
+ border-radius: var(--radius-card);
+ background-color: var(--color-surface);
+
+ & table {
+ width: 100%;
+ margin: 0;
+ border: 0;
+ font-size: 14px;
+ line-height: 21px;
+ }
+ & thead th {
+ height: 40px;
+ padding: 0 20px;
+ background-color: var(--color-surface-muted);
+ color: var(--color-foreground);
+ font-size: 13px;
+ line-height: 16px;
+ font-weight: 500;
+ }
+ & :is(tbody, tfoot) :is(td, th) {
+ padding: 14px 20px;
+ border-block-start: 1px solid var(--color-hairline);
+ }
+ & :is(th, td):first-child {
+ padding-inline-start: 20px;
+ }
+ }
+
+ .typeset-docs > :where(:first-child) {
+ margin-block-start: 0;
+ }
+}
+
+/*
+ * Code inside `CodeFrame` (components/docs/blocks/code-frame.tsx) always uses
+ * the dark Vesper tokens, one 22px line per row and no line numbers. The
+ * !important flags outrank the theme-switching shiki rules in globals.css
+ * (important declarations in a layer beat unlayered ones).
+ */
+@layer components {
+ [data-code-frame] code {
+ display: grid;
+ font-family: var(--font-mono);
+ font-variant-ligatures: none;
+ }
+ [data-code-frame] [data-line] {
+ display: block;
+ width: auto;
+ /* biome-ignore lint/complexity/noImportantStyles: outranks the unlayered [data-line] padding in globals.css */
+ padding-block: 0 !important;
+ }
+ [data-code-frame] [data-line] span {
+ /* biome-ignore lint/complexity/noImportantStyles: outranks the theme-switching shiki colours in globals.css */
+ color: var(--shiki-dark, #fafafa) !important;
+ }
+ [data-code-frame] [data-line]:empty::before,
+ [data-code-frame] .line:empty::before {
+ content: " ";
}
}
diff --git a/bun.lock b/bun.lock
index 3b5eee1e..ae38584c 100644
--- a/bun.lock
+++ b/bun.lock
@@ -34,6 +34,7 @@
"fumadocs-core": "^16.7.10",
"fumadocs-mdx": "^14.2.11",
"fumadocs-ui": "^16.7.10",
+ "geist": "1.8.2",
"jotai": "^2.19.1",
"json5": "^2.2.3",
"lucide-react": "^1.7.0",
@@ -1021,6 +1022,8 @@
"fuzzysort": ["[email protected]", "", {}, "sha512-sR9BNCjBg6LNgwvxlBd0sBABvQitkLzoVY9MYYROQVX/FvfJ4Mai9LsGhDgd8qYdds0bY77VzYd5iuB+v5rwQQ=="],
+ "geist": ["[email protected]", "", { "peerDependencies": { "next": ">=13.2.0" } }, "sha512-fRF4sbJ9qcCxPb35cVtKBAwYlTt1IbU9nkbPi0a+xyZqPIjCJ2BY8ekGhx6/SGSZKrR7/UuL57r/eeDQ1Xy11g=="],
+
"gensync": ["[email protected]", "", {}, "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg=="],
"get-east-asian-width": ["[email protected]", "", {}, "sha512-CQ+bEO+Tva/qlmw24dCejulK5pMzVnUOFOijVogd3KQs07HnRIgp8TGipvCCRT06xeYEbpbgwaCxglFyiuIcmA=="],
diff --git a/components/Silk.tsx b/components/Silk.tsx
new file mode 100644
index 00000000..4fb99597
--- /dev/null
+++ b/components/Silk.tsx
@@ -0,0 +1,762 @@
+"use client";
+
+import { type CSSProperties, useEffect, useRef } from "react";
+
+export interface SilkProps {
+ speed?: number;
+ scale?: number;
+ color?: string;
+ sheenColor?: string;
+ noiseIntensity?: number;
+ rotation?: number;
+ sheen?: number;
+ depth?: number;
+ glow?: number;
+ ripple?: number;
+ wave?: number;
+ variation?: number;
+ mouseInteraction?: boolean;
+ interactionStrength?: number;
+ clickRipple?: boolean;
+ intro?: boolean;
+ /** Change it to play the intro again without rebuilding the WebGL context. */
+ introKey?: number;
+ fade?: number;
+ lightMode?: boolean;
+ paused?: boolean;
+ dpr?: number;
+ className?: string;
+ style?: CSSProperties;
+}
+
+interface Settings {
+ speed: number;
+ scale: number;
+ color: string;
+ sheenColor: string;
+ noiseIntensity: number;
+ rotation: number;
+ sheen: number;
+ depth: number;
+ glow: number;
+ ripple: number;
+ wave: number;
+ variation: number;
+ mouseInteraction: boolean;
+ interactionStrength: number;
+ clickRipple: boolean;
+ intro: boolean;
+ introKey?: number;
+ fade: number;
+ lightMode: boolean;
+ paused: boolean;
+ dpr?: number;
+}
+
+type Uniforms = Record<string, WebGLUniformLocation | null>;
+
+interface Program {
+ program: WebGLProgram;
+ uniforms: Uniforms;
+}
+
+interface Wave {
+ x: number;
+ y: number;
+ age: number;
+}
+
+const VERTEX = `#version 300 es
+in vec2 aPosition;
+void main() {
+ gl_Position = vec4(aPosition, 0.0, 1.0);
+}`;
+
+const SILK = `
+uniform vec2 uView;
+uniform float uScale;
+uniform float uRotation;
+uniform float uTime;
+uniform float uWave;
+uniform float uRipple;
+uniform float uFold;
+uniform vec2 uShift;
+uniform vec4 uPointer;
+uniform vec2 uDrag;
+uniform vec4 uWaves[4];
+
+const float e = 2.71828182845904523536;
+
+float noise(vec2 texCoord) {
+ float G = e;
+ vec2 r = (G * sin(G * texCoord));
+ return fract(r.x * r.y * (1.0 + texCoord.x));
+}
+
+vec2 rotateUvs(vec2 uv, float angle) {
+ float c = cos(angle);
+ float s = sin(angle);
+ mat2 rot = mat2(c, -s, s, c);
+ return rot * uv;
+}
+
+vec2 bend(vec2 uv) {
+ vec2 aspect = vec2(uView.x / uView.y, 1.0);
+ vec2 offset = (uv - uPointer.xy) * aspect;
+ float touch = uPointer.z * exp(-dot(offset, offset) / (uPointer.w * uPointer.w));
+ uv -= uDrag * touch;
+ for (int i = 0; i < 4; i++) {
+ vec4 wave = uWaves[i];
+ if (wave.w <= 0.0) continue;
+ vec2 q = (uv - wave.xy) * aspect;
+ float dist = length(q);
+ float front = dist - wave.z;
+ float ring = exp(-front * front * 60.0) * wave.w;
+ uv += q / max(dist, 0.0001) / aspect * ring * 0.034 * sin(front * 34.0);
+ }
+ return uv;
+}
+
+float silk(vec2 vUv) {
+ vec2 uv = rotateUvs(vUv * uScale, uRotation);
+ vec2 tex = uv * uScale + uShift;
+ float tOffset = uTime;
+ tex.y += 0.03 * uWave * sin(8.0 * tex.x - tOffset);
+ return 0.6 + 0.4 * uFold * sin(5.0 * (tex.x + tex.y + cos(3.0 * tex.x + 5.0 * tex.y) + 0.02 * tOffset) + uRipple * sin(20.0 * (tex.x + tex.y - 0.1 * tOffset)));
+}
+`;
+
+const FIELD = `#version 300 es
+precision highp float;
+${SILK}
+out vec4 outColor;
+
+void main() {
+ vec2 vUv = gl_FragCoord.xy / uView;
+ float pattern = silk(bend(vUv));
+ float n = clamp((pattern - 0.2) / 0.8, 0.0, 1.0);
+ outColor = vec4(pow(n, 6.0), 0.0, 0.0, 1.0);
+}`;
+
+const COMPOSITE = `#version 300 es
+precision highp float;
+${SILK}
+uniform sampler2D uBloom;
+uniform vec3 uColor;
+uniform vec3 uSheenColor;
+uniform float uNoiseIntensity;
+uniform float uDepth;
+uniform float uSheen;
+uniform float uGlow;
+uniform float uLightMode;
+uniform vec3 uLight;
+uniform vec2 uStep;
+uniform float uPresence;
+uniform float uFade;
+out vec4 outColor;
+
+float smootherstep01(float t) {
+ t = clamp(t, 0.0, 1.0);
+ return t * t * t * (t * (t * 6.0 - 15.0) + 10.0);
+}
+
+vec3 softClip(vec3 c) {
+ vec3 over = max(c - 0.75, 0.0);
+ return min(c, 0.75) + 0.25 * (1.0 - exp(-over * 4.0));
+}
+
+void main() {
+ vec2 vUv = gl_FragCoord.xy / uView;
+ vec2 coord = bend(vUv);
+ float pattern = silk(coord);
+ float rnd = noise(gl_FragCoord.xy);
+ float n = clamp((pattern - 0.2) / 0.8, 0.0, 1.0);
+
+ float gx = silk(coord + vec2(uStep.x, 0.0)) - pattern;
+ float gy = silk(coord + vec2(0.0, uStep.y)) - pattern;
+ vec3 normal = normalize(vec3(-gx * 26.0, -gy * 26.0, 1.0));
+ vec3 toLight = normalize(vec3(uLight.xy, 0.85));
+ float relief = 1.0 + (dot(normal, toLight) - toLight.z) * 1.8 * uDepth;
+ vec3 halfway = normalize(toLight + vec3(0.0, 0.0, 1.0));
+ float gloss = pow(max(dot(normal, halfway), 0.0), 48.0) * smoothstep(0.25, 0.85, n);
+ float crest = pow(n, 5.0);
+ float shine = (gloss * 0.85 + crest * 0.4) * uSheen * (1.0 + uLight.z * 0.6);
+
+ float bloom = 0.0;
+ if (uGlow > 0.0) {
+ bloom += textureLod(uBloom, vUv, 1.0).r * 0.35;
+ bloom += textureLod(uBloom, vUv, 2.0).r * 0.3;
+ bloom += textureLod(uBloom, vUv, 3.0).r * 0.2;
+ bloom += textureLod(uBloom, vUv, 4.0).r * 0.15;
+ }
+
+ vec3 result;
+ if (uLightMode > 0.5) {
+ float fold = smoothstep(0.28, 0.9, pattern);
+ float specular = smoothstep(0.72, 0.98, pattern);
+ vec3 shadowColor = uColor * (0.72 - 0.12 * uDepth);
+ vec3 bodyColor = min(uColor * 1.18, vec3(1.0));
+ vec3 lightBase = mix(shadowColor, bodyColor, fold) * mix(1.0, relief, 0.6);
+ lightBase = mix(lightBase, vec3(1.0), clamp(specular * 0.92 + shine * 0.22 + bloom * uGlow * 0.2, 0.0, 1.0));
+ float fineNoise = noise(gl_FragCoord.xy * 0.63 + vec2(17.0, 41.0));
+ float grainSignal = (rnd + fineNoise - 1.0);
+ float grainStrength = clamp(uNoiseIntensity * 0.038, 0.0, 0.16);
+ result = clamp(lightBase + grainSignal * grainStrength, 0.0, 1.0);
+ } else {
+ float grain = rnd / 15.0 * uNoiseIntensity;
+ float floorValue = mix(0.2, 0.03, uDepth);
+ float curve = uDepth > 0.0 ? pow(n, 1.0 + 1.4 * uDepth) : n;
+ float shade = uDepth > 0.0 ? floorValue + (1.0 - floorValue) * curve : pattern;
+ vec3 tone = mix(uColor, pow(uColor, vec3(1.45)), (1.0 - n) * uDepth);
+ vec3 lit = tone * shade * relief - vec3(grain);
+ vec3 tint = mix(uColor, uSheenColor, 0.8);
+ vec3 extra = tint * (shine + bloom * uGlow * 0.55);
+ float blend = clamp((uSheen + uGlow) * 4.0, 0.0, 1.0);
+ result = mix(clamp(lit, 0.0, 1.0), clamp(softClip(lit + extra), 0.0, 1.0), blend);
+ }
+
+ float edge = uFade * 0.5;
+ float mask = 1.0;
+ if (edge > 0.0) {
+ mask = smootherstep01(vUv.x / edge) * smootherstep01((1.0 - vUv.x) / edge);
+ mask *= smootherstep01(vUv.y / edge) * smootherstep01((1.0 - vUv.y) / edge);
+ }
+ float alpha = uPresence * mask;
+ outColor = vec4(result * alpha, alpha);
+}`;
+
+const INTRO_SECONDS = 2.2;
+const INTRO_RUSH = 1.6;
+const WAVE_LIFE = 1.6;
+const DEFAULT_LIGHT = [-0.55, 0.7];
+const LIGHT_TILT = Math.hypot(DEFAULT_LIGHT[0], DEFAULT_LIGHT[1]);
+
+const clamp = (value: number, min: number, max: number) =>
+ Math.min(max, Math.max(min, value));
+
+const ease = (t: number) => t * t * t * (t * (t * 6 - 15) + 10);
+
+const variationShift = (variation: number): number[] => {
+ const n = Number(variation) || 0;
+ if (!n) return [0, 0];
+ const wave = (k: number) => {
+ const v = Math.sin(n * 12.9898 + k * 78.233) * 43758.5453;
+ return v - Math.floor(v) - 0.5;
+ };
+ return [wave(1) * 6, wave(2) * 6];
+};
+
+const compile = (gl: WebGL2RenderingContext, type: number, source: string) => {
+ const shader = gl.createShader(type);
+ if (!shader) return null;
+ gl.shaderSource(shader, source);
+ gl.compileShader(shader);
+ if (gl.getShaderParameter(shader, gl.COMPILE_STATUS)) return shader;
+ gl.deleteShader(shader);
+ return null;
+};
+
+const link = (
+ gl: WebGL2RenderingContext,
+ fragmentSource: string,
+): Program | null => {
+ const vertex = compile(gl, gl.VERTEX_SHADER, VERTEX);
+ const fragment = compile(gl, gl.FRAGMENT_SHADER, fragmentSource);
+ const program = gl.createProgram();
+ if (!vertex || !fragment || !program) return null;
+ gl.attachShader(program, vertex);
+ gl.attachShader(program, fragment);
+ gl.bindAttribLocation(program, 0, "aPosition");
+ gl.linkProgram(program);
+ gl.deleteShader(vertex);
+ gl.deleteShader(fragment);
+ if (!gl.getProgramParameter(program, gl.LINK_STATUS)) {
+ gl.deleteProgram(program);
+ return null;
+ }
+ const uniforms: Uniforms = {};
+ const count = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);
+ for (let i = 0; i < count; i++) {
+ const info = gl.getActiveUniform(program, i);
+ if (info)
+ uniforms[info.name.replace(/\[0\]$/, "")] = gl.getUniformLocation(
+ program,
+ info.name,
+ );
+ }
+ return { program, uniforms };
+};
+
+const Silk = ({
+ speed = 5,
+ scale = 1,
+ color = "#7B7481",
+ sheenColor = "#ffffff",
+ noiseIntensity = 1.5,
+ rotation = 0,
+ sheen = 0.5,
+ depth = 0.5,
+ glow = 0.3,
+ ripple = 1,
+ wave = 1,
+ variation = 0,
+ mouseInteraction = true,
+ interactionStrength = 1,
+ clickRipple = true,
+ intro = true,
+ introKey,
+ fade = 0,
+ lightMode = false,
+ paused = false,
+ dpr,
+ className = "",
+ style,
+}: SilkProps) => {
+ const containerRef = useRef<HTMLDivElement>(null);
+ const canvasRef = useRef<HTMLCanvasElement>(null);
+ const wakeRef = useRef<(() => void) | null>(null);
+ const settingsRef = useRef<Settings>(null as unknown as Settings);
+ settingsRef.current = {
+ speed,
+ scale,
+ color: String(color),
+ sheenColor: String(sheenColor),
+ noiseIntensity: Math.max(0, noiseIntensity),
+ rotation,
+ sheen: Math.max(0, sheen),
+ depth: clamp(depth, 0, 1),
+ glow: Math.max(0, glow),
+ ripple: Math.max(0, ripple),
+ wave: Math.max(0, wave),
+ variation,
+ mouseInteraction,
+ interactionStrength: Math.max(0, interactionStrength),
+ clickRipple,
+ intro,
+ introKey,
+ fade: clamp(fade, 0, 1),
+ lightMode,
+ paused,
+ dpr,
+ };
+
+ useEffect(() => {
+ const container = containerRef.current;
+ const canvas = canvasRef.current;
+ const gl = canvas?.getContext("webgl2", {
+ alpha: true,
+ premultipliedAlpha: true,
+ antialias: false,
+ depth: false,
+ stencil: false,
+ powerPreference: "high-performance",
+ });
+ if (!container || !canvas || !gl) return undefined;
+
+ const fieldProgram = link(gl, FIELD);
+ const compositeProgram = link(gl, COMPOSITE);
+ if (!fieldProgram || !compositeProgram) return undefined;
+
+ const buffer = gl.createBuffer();
+ const vao = gl.createVertexArray();
+ gl.bindVertexArray(vao);
+ gl.bindBuffer(gl.ARRAY_BUFFER, buffer);
+ gl.bufferData(
+ gl.ARRAY_BUFFER,
+ new Float32Array([-1, -1, 3, -1, -1, 3]),
+ gl.STATIC_DRAW,
+ );
+ gl.enableVertexAttribArray(0);
+ gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0);
+
+ const texture = gl.createTexture();
+ const framebuffer = gl.createFramebuffer();
+ const target = { width: 0, height: 0 };
+ const sizeTarget = (width: number, height: number) => {
+ if (target.width === width && target.height === height) return;
+ target.width = width;
+ target.height = height;
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.texImage2D(
+ gl.TEXTURE_2D,
+ 0,
+ gl.RGBA8,
+ width,
+ height,
+ 0,
+ gl.RGBA,
+ gl.UNSIGNED_BYTE,
+ null,
+ );
+ gl.texParameteri(
+ gl.TEXTURE_2D,
+ gl.TEXTURE_MIN_FILTER,
+ gl.LINEAR_MIPMAP_LINEAR,
+ );
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);
+ gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.framebufferTexture2D(
+ gl.FRAMEBUFFER,
+ gl.COLOR_ATTACHMENT0,
+ gl.TEXTURE_2D,
+ texture,
+ 0,
+ );
+ };
+
+ const probe = document
+ .createElement("canvas")
+ .getContext("2d", { willReadFrequently: true });
+ const colorCache = new Map<string, number[]>();
+ const toRgb = (value: string): number[] => {
+ if (colorCache.has(value)) return colorCache.get(value) as number[];
+ let rgb = [1, 1, 1];
+ if (probe) {
+ probe.clearRect(0, 0, 1, 1);
+ probe.fillStyle = "#ffffff";
+ probe.fillStyle = value;
+ probe.fillRect(0, 0, 1, 1);
+ const [r, g, b] = probe.getImageData(0, 0, 1, 1).data;
+ rgb = [r / 255, g / 255, b / 255];
+ }
+ colorCache.set(value, rgb);
+ return rgb;
+ };
+
+ const reduce =
+ window.matchMedia?.("(prefers-reduced-motion: reduce)").matches ?? false;
+ const view = { width: 1, height: 1, ratio: 1 };
+ const pointer = { x: 0, y: 0, inside: false };
+ const waves: Wave[] = [];
+ const waveData = new Float32Array(16);
+ const state = {
+ flow: 0,
+ intro: settingsRef.current.intro && !reduce ? 0 : 1,
+ touch: 0,
+ x: 0,
+ y: 0,
+ dragX: 0,
+ dragY: 0,
+ lightX: DEFAULT_LIGHT[0],
+ lightY: DEFAULT_LIGHT[1],
+ };
+ let raf = 0;
+ let last = 0;
+ let visible = true;
+
+ const setShared = (
+ uniforms: Uniforms,
+ width: number,
+ height: number,
+ s: Settings,
+ unfold: number,
+ ) => {
+ const [shiftX, shiftY] = variationShift(s.variation);
+ gl.uniform2f(uniforms.uView, width, height);
+ gl.uniform1f(uniforms.uScale, s.scale);
+ gl.uniform1f(uniforms.uRotation, s.rotation);
+ gl.uniform1f(uniforms.uTime, state.flow - INTRO_RUSH * (1 - unfold));
+ gl.uniform1f(uniforms.uWave, s.wave);
+ gl.uniform1f(uniforms.uRipple, s.ripple);
+ gl.uniform1f(uniforms.uFold, 0.25 + 0.75 * unfold);
+ gl.uniform2f(uniforms.uShift, shiftX, shiftY);
+ gl.uniform4f(
+ uniforms.uPointer,
+ state.x / view.width,
+ 1 - state.y / view.height,
+ state.touch * s.interactionStrength,
+ 0.32,
+ );
+ gl.uniform2f(uniforms.uDrag, state.dragX, state.dragY);
+ gl.uniform4fv(uniforms.uWaves, waveData);
+ };
+
+ const render = () => {
+ const s = settingsRef.current;
+ const unfold = ease(state.intro);
+ const presence = 1 - (1 - state.intro) ** 3;
+ gl.bindVertexArray(vao);
+
+ waveData.fill(0);
+ waves.slice(-4).forEach((item, index) => {
+ waveData.set(
+ [
+ item.x,
+ item.y,
+ item.age * 0.6,
+ Math.exp(-item.age / (WAVE_LIFE * 0.45)),
+ ],
+ index * 4,
+ );
+ });
+
+ if (s.glow > 0) {
+ sizeTarget(
+ Math.max(1, Math.round(canvas.width / 4)),
+ Math.max(1, Math.round(canvas.height / 4)),
+ );
+ gl.bindFramebuffer(gl.FRAMEBUFFER, framebuffer);
+ gl.viewport(0, 0, target.width, target.height);
+ // biome-ignore lint/correctness/useHookAtTopLevel: WebGL useProgram, not a React hook
+ gl.useProgram(fieldProgram.program);
+ setShared(
+ fieldProgram.uniforms,
+ target.width,
+ target.height,
+ s,
+ unfold,
+ );
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.generateMipmap(gl.TEXTURE_2D);
+ }
+
+ const c = compositeProgram.uniforms;
+ gl.bindFramebuffer(gl.FRAMEBUFFER, null);
+ gl.viewport(0, 0, canvas.width, canvas.height);
+ // biome-ignore lint/correctness/useHookAtTopLevel: WebGL useProgram, not a React hook
+ gl.useProgram(compositeProgram.program);
+ setShared(c, canvas.width, canvas.height, s, unfold);
+ gl.uniform3fv(c.uColor, toRgb(s.color));
+ gl.uniform3fv(c.uSheenColor, toRgb(s.sheenColor));
+ gl.uniform1f(c.uNoiseIntensity, s.noiseIntensity);
+ gl.uniform1f(c.uDepth, s.depth);
+ gl.uniform1f(c.uSheen, s.sheen);
+ gl.uniform1f(c.uGlow, s.glow);
+ gl.uniform1f(c.uLightMode, s.lightMode ? 1 : 0);
+ gl.uniform3f(
+ c.uLight,
+ state.lightX,
+ state.lightY,
+ state.touch * s.interactionStrength,
+ );
+ gl.uniform2f(
+ c.uStep,
+ view.ratio / canvas.width,
+ view.ratio / canvas.height,
+ );
+ gl.uniform1f(c.uPresence, presence);
+ gl.uniform1f(c.uFade, s.fade);
+ gl.activeTexture(gl.TEXTURE0);
+ gl.bindTexture(gl.TEXTURE_2D, texture);
+ gl.uniform1i(c.uBloom, 0);
+ gl.drawArrays(gl.TRIANGLES, 0, 3);
+ };
+
+ const frame = (now: number) => {
+ raf = 0;
+ if (!visible || document.hidden) return;
+ const s = settingsRef.current;
+ const dt = last ? Math.min(0.05, (now - last) / 1000) : 1 / 60;
+ last = now;
+ const flowing = !s.paused && !reduce && s.speed !== 0;
+ if (flowing) state.flow += dt * 0.1 * s.speed;
+ if (!s.intro || reduce) state.intro = 1;
+ else if (state.intro < 1)
+ state.intro = Math.min(1, state.intro + dt / INTRO_SECONDS);
+
+ const engaged = s.mouseInteraction && pointer.inside && !reduce;
+ if (engaged && state.touch < 0.01) {
+ state.x = pointer.x;
+ state.y = pointer.y;
+ }
+ const follow = 1 - Math.exp(-dt * 10);
+ const prevX = state.x;
+ const prevY = state.y;
+ state.x += (pointer.x - state.x) * follow;
+ state.y += (pointer.y - state.y) * follow;
+ const velX = (state.x - prevX) / Math.max(dt, 0.001) / view.height;
+ const velY = (state.y - prevY) / Math.max(dt, 0.001) / view.height;
+ const dragBlend = 1 - Math.exp(-dt * 4);
+ state.dragX +=
+ (clamp(velX * 0.03, -0.06, 0.06) - state.dragX) * dragBlend;
+ state.dragY +=
+ (clamp(-velY * 0.03, -0.06, 0.06) - state.dragY) * dragBlend;
+ state.touch +=
+ ((engaged ? 1 : 0) - state.touch) *
+ (1 - Math.exp(-dt * (engaged ? 3.5 : 1.4)));
+
+ let lightGoalX = DEFAULT_LIGHT[0];
+ let lightGoalY = DEFAULT_LIGHT[1];
+ if (engaged) {
+ const aimX =
+ (pointer.x / view.width - 0.5) * (view.width / view.height);
+ const aimY = 0.5 - pointer.y / view.height;
+ const reach = Math.hypot(aimX, aimY);
+ if (reach > 0.04) {
+ lightGoalX = (aimX / reach) * LIGHT_TILT;
+ lightGoalY = (aimY / reach) * LIGHT_TILT;
+ } else {
+ lightGoalX = state.lightX;
+ lightGoalY = state.lightY;
+ }
+ }
+ const lightFollow = 1 - Math.exp(-dt * 3);
+ state.lightX += (lightGoalX - state.lightX) * lightFollow;
+ state.lightY += (lightGoalY - state.lightY) * lightFollow;
+
+ for (let i = waves.length - 1; i >= 0; i--) {
+ waves[i].age += dt;
+ if (waves[i].age > WAVE_LIFE * 2.5) waves.splice(i, 1);
+ }
+
+ render();
+
+ const settling =
+ state.intro < 1 ||
+ waves.length > 0 ||
+ Math.abs((engaged ? 1 : 0) - state.touch) > 0.002 ||
+ Math.abs(state.dragX) + Math.abs(state.dragY) > 0.0002 ||
+ Math.abs(pointer.x - state.x) + Math.abs(pointer.y - state.y) > 0.3 ||
+ Math.abs(lightGoalX - state.lightX) +
+ Math.abs(lightGoalY - state.lightY) >
+ 0.001;
+ if (flowing || settling) raf = requestAnimationFrame(frame);
+ else last = 0;
+ };
+
+ const wake = () => {
+ if (!raf && visible && !document.hidden)
+ raf = requestAnimationFrame(frame);
+ };
+
+ const resize = () => {
+ const s = settingsRef.current;
+ const width = Math.max(1, container.clientWidth);
+ const height = Math.max(1, container.clientHeight);
+ const ratio = Math.min(s.dpr || window.devicePixelRatio || 1, 2);
+ view.width = width;
+ view.height = height;
+ view.ratio = ratio;
+ canvas.width = Math.max(1, Math.round(width * ratio));
+ canvas.height = Math.max(1, Math.round(height * ratio));
+ if (!raf) render();
+ wake();
+ };
+
+ const locate = (event: PointerEvent) => {
+ const rect = container.getBoundingClientRect();
+ const x = event.clientX - rect.left;
+ const y = event.clientY - rect.top;
+ return {
+ x,
+ y,
+ inside: x >= 0 && y >= 0 && x <= rect.width && y <= rect.height,
+ };
+ };
+
+ const onPointerMove = (event: PointerEvent) => {
+ const point = locate(event);
+ pointer.x = point.x;
+ pointer.y = point.y;
+ pointer.inside = point.inside;
+ wake();
+ };
+
+ const onPointerDown = (event: PointerEvent) => {
+ const s = settingsRef.current;
+ if (!s.clickRipple || reduce) return;
+ const point = locate(event);
+ if (!point.inside) return;
+ waves.push({
+ x: point.x / view.width,
+ y: 1 - point.y / view.height,
+ age: 0,
+ });
+ if (waves.length > 4) waves.shift();
+ wake();
+ };
+
+ const onPointerLeave = () => {
+ pointer.inside = false;
+ wake();
+ };
+
+ const onVisibility = () => {
+ last = 0;
+ wake();
+ };
+
+ const resizeObserver = new ResizeObserver(resize);
+ resizeObserver.observe(container);
+ const intersection = new IntersectionObserver((entries) => {
+ visible = entries.some((entry) => entry.isIntersecting);
+ if (visible) {
+ last = 0;
+ wake();
+ }
+ });
+ intersection.observe(container);
+ window.addEventListener("pointermove", onPointerMove, { passive: true });
+ window.addEventListener("pointerdown", onPointerDown, { passive: true });
+ document.documentElement.addEventListener("pointerleave", onPointerLeave);
+ document.addEventListener("visibilitychange", onVisibility);
+ resize();
+
+ let lastDpr = settingsRef.current.dpr;
+ let lastIntroKey = settingsRef.current.introKey;
+ wakeRef.current = () => {
+ const s = settingsRef.current;
+ if (s.introKey !== lastIntroKey) {
+ lastIntroKey = s.introKey;
+ if (s.intro && !reduce) state.intro = 0;
+ last = 0;
+ }
+ if (s.dpr !== lastDpr) {
+ lastDpr = s.dpr;
+ resize();
+ return;
+ }
+ if (!raf) render();
+ wake();
+ };
+
+ return () => {
+ cancelAnimationFrame(raf);
+ wakeRef.current = null;
+ resizeObserver.disconnect();
+ intersection.disconnect();
+ window.removeEventListener("pointermove", onPointerMove);
+ window.removeEventListener("pointerdown", onPointerDown);
+ document.documentElement.removeEventListener(
+ "pointerleave",
+ onPointerLeave,
+ );
+ document.removeEventListener("visibilitychange", onVisibility);
+ gl.deleteTexture(texture);
+ gl.deleteFramebuffer(framebuffer);
+ gl.deleteProgram(fieldProgram.program);
+ gl.deleteProgram(compositeProgram.program);
+ gl.deleteBuffer(buffer);
+ gl.deleteVertexArray(vao);
+ queueMicrotask(() => {
+ if (!canvas.isConnected) {
+ gl.getExtension("WEBGL_lose_context")?.loseContext();
+ }
+ });
+ };
+ }, []);
+
+ useEffect(() => {
+ wakeRef.current?.();
+ });
+
+ return (
+ <div
+ ref={containerRef}
+ className={`relative w-full h-full overflow-hidden ${className}`}
+ style={style}
+ >
+ {/* biome-ignore lint/a11y/noAriaHiddenOnFocusable: decorative canvas, never focusable */}
+ <canvas
+ ref={canvasRef}
+ className="absolute inset-0 block w-full h-full"
+ aria-hidden="true"
+ />
+ </div>
+ );
+};
+
+export default Silk;
diff --git a/components/changelog/changelog-hero.tsx b/components/changelog/changelog-hero.tsx
deleted file mode 100644
index b0f37b94..00000000
--- a/components/changelog/changelog-hero.tsx
+++ /dev/null
@@ -1,48 +0,0 @@
-import Link from "next/link";
-import { cn } from "@/lib/utils";
-
-const VIEWS = [
- { href: "/changelog", label: "Text" },
- { href: "/changelog/video", label: "Video" },
-] as const;
-
-export function ChangelogHero({ active }: { active: "text" | "video" }) {
- const activeHref = active === "text" ? "/changelog" : "/changelog/video";
-
- return (
- <section className="pt-24 pb-10 sm:pt-28">
- <div className="section">
- <h1 className="text-4xl font-semibold leading-[1.05] tracking-tight text-foreground sm:text-5xl">
- Changelog
- </h1>
- <p className="mt-4 max-w-2xl text-balance text-base leading-relaxed text-muted-foreground sm:text-lg">
- New components, transitions, shaders, and icons as they ship.
- </p>
-
- <nav
- aria-label="Changelog view"
- className="mt-8 flex items-center gap-1"
- >
- {VIEWS.map((view) => {
- const isActive = view.href === activeHref;
- return (
- <Link
- key={view.href}
- href={view.href}
- aria-current={isActive ? "page" : undefined}
- className={cn(
- "rounded-full px-3.5 py-1.5 text-sm font-medium transition-colors",
- isActive
- ? "bg-muted text-foreground"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- {view.label}
- </Link>
- );
- })}
- </nav>
- </div>
- </section>
- );
-}
diff --git a/components/docs/agent-menu.tsx b/components/docs/agent-menu.tsx
new file mode 100644
index 00000000..d1db1206
--- /dev/null
+++ b/components/docs/agent-menu.tsx
@@ -0,0 +1,85 @@
+"use client";
+
+import { Menu } from "@base-ui/react/menu";
+import type { ReactNode } from "react";
+import { ArrowUpRightIcon } from "./shell/docs-icons";
+
+const ITEM =
+ "flex h-9 items-center gap-2.5 rounded-[10px] px-2.5 text-small text-foreground outline-none select-none data-highlighted:bg-surface-muted";
+
+/** The dropdown both agent menus share: "Copy page" and "Open in". */
+export function AgentMenuPopup({ children }: { children: ReactNode }) {
+ return (
+ <Menu.Portal>
+ <Menu.Positioner
+ side="bottom"
+ align="end"
+ sideOffset={8}
+ className="z-50"
+ >
+ <Menu.Popup className="flex min-w-[220px] origin-(--transform-origin) flex-col gap-0.5 rounded-cta bg-surface p-1.5 shadow-[0_0_0_1px_var(--color-hairline),0_16px_40px_-16px_#0E101240] outline-none transition-[opacity,scale] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] data-ending-style:scale-[0.98] data-ending-style:opacity-0 data-ending-style:duration-100 data-starting-style:scale-[0.98] data-starting-style:opacity-0 motion-reduce:data-ending-style:scale-100 motion-reduce:data-starting-style:scale-100 dark:shadow-[0_0_0_1px_var(--color-hairline),0_16px_40px_-16px_#00000080]">
+ {children}
+ </Menu.Popup>
+ </Menu.Positioner>
+ </Menu.Portal>
+ );
+}
+
+function ItemIcon({ children }: { children: ReactNode }) {
+ return (
+ <span className="flex size-4 shrink-0 items-center justify-center">
+ {children}
+ </span>
+ );
+}
+
+/** An external hand-off: icon, label and the outbound arrow. */
+export function AgentMenuLink({
+ href,
+ icon,
+ onClick,
+ children,
+}: {
+ href: string;
+ icon: ReactNode;
+ onClick?: () => void;
+ children: ReactNode;
+}) {
+ return (
+ <Menu.LinkItem
+ href={href}
+ target="_blank"
+ rel="noreferrer"
+ onClick={onClick}
+ className={ITEM}
+ >
+ <ItemIcon>{icon}</ItemIcon>
+ <span className="flex-1">{children}</span>
+ <ArrowUpRightIcon className="size-3 shrink-0 text-subtle" />
+ </Menu.LinkItem>
+ );
+}
+
+/** An in-page action (copy), styled like the links. */
+export function AgentMenuAction({
+ icon,
+ onClick,
+ closeOnClick = true,
+ children,
+}: {
+ icon: ReactNode;
+ onClick: () => void;
+ closeOnClick?: boolean;
+ children: ReactNode;
+}) {
+ return (
+ <Menu.Item onClick={onClick} closeOnClick={closeOnClick} className={ITEM}>
+ <ItemIcon>{icon}</ItemIcon>
+ <span className="flex-1">{children}</span>
+ </Menu.Item>
+ );
+}
+
+export function AgentMenuSeparator() {
+ return <Menu.Separator className="mx-2.5 my-1 h-px bg-hairline" />;
+}
diff --git a/components/docs/block-preview.tsx b/components/docs/block-preview.tsx
index cd35382e..74c791b2 100644
--- a/components/docs/block-preview.tsx
+++ b/components/docs/block-preview.tsx
@@ -1,53 +1,36 @@
"use client";
-import { CodeBlock } from "@/components/docs/code-block";
-import { PreviewStage } from "@/lib/ui-preview-internals";
+import { DocsPlayer } from "./blocks/player/docs-player";
+import { UnknownBlock } from "./blocks/player/player-fallback";
+import { BLOCK_SPACING } from "./blocks/spacing";
import { blockExamples } from "./examples/blocks";
+const NO_PROPS = {};
/**
- * Controls-free preview for composition blocks. A THIN wrapper over
- * `PreviewStage` (`lib/ui-preview-internals.tsx` — owns lazy-mount + autoplay)
- * plus the shared `CodeBlock`: the live scene Player above, the copyable scene
- * snippet below. No Tabs, no customizer, no nuqs, no controls.
- *
- * Replaces both the vestigial `LiveExample` and `UiComponentPreview` for the
- * blocks tier — blocks have no `registry[name]` config and no honored knobs, so
- * the heavier ui-tier widget does not apply (see §0B.7).
+ * Composition blocks: the live scene and its copyable snippet behind the
+ * Preview / Code tabs. Blocks have no registry config, so no customizer.
*/
-
-/** Shared "Unknown component" fallback — matches the existing docs widgets. */
-function UnknownComponent({ name }: { name: string }) {
- return (
- <div className="not-prose mb-6 rounded-lg border border-fd-border p-4 text-sm text-fd-muted-foreground">
- Unknown block: <code>{name}</code>
- </div>
- );
-}
-
export function BlockPreview({ name }: { name: string }) {
const entry = blockExamples[name];
-
- if (!entry) {
- return <UnknownComponent name={name} />;
- }
+ if (!entry) return <UnknownBlock kind="block" name={name} />;
// The code field may be a string or a zero-arg function; normalize to string.
const code = typeof entry.code === "function" ? entry.code() : entry.code;
return (
- <div className="not-prose mb-6 flex w-full flex-col gap-4">
- <PreviewStage
- name={name}
- Component={entry.Component}
- inputProps={{}}
- durationInFrames={entry.durationInFrames}
- fps={entry.fps}
- compositionWidth={entry.width}
- compositionHeight={entry.height}
- previewBackdrop={entry.previewBackdrop}
- />
-
- <CodeBlock code={code} />
- </div>
+ <DocsPlayer
+ name={name}
+ code={code}
+ className={BLOCK_SPACING}
+ composition={{
+ Component: entry.Component,
+ inputProps: NO_PROPS,
+ durationInFrames: entry.durationInFrames,
+ fps: entry.fps,
+ compositionWidth: entry.width,
+ compositionHeight: entry.height,
+ previewBackdrop: entry.previewBackdrop,
+ }}
+ />
);
}
diff --git a/components/docs/blocks/code-frame.tsx b/components/docs/blocks/code-frame.tsx
new file mode 100644
index 00000000..fcdd4085
--- /dev/null
+++ b/components/docs/blocks/code-frame.tsx
@@ -0,0 +1,53 @@
+import type { ReactNode } from "react";
+import { CopyButton } from "@/components/docs/copy-button";
+import { cn } from "@/lib/utils";
+
+/** Scrolling `<pre>` inside a `CodeFrame`: Paper Mono 13/22, no line numbers. */
+export const CODE_PRE =
+ "min-w-0 overflow-x-auto overscroll-x-contain pt-[18px] pr-5 pb-5 pl-[18px] font-mono text-caption leading-[22px] outline-none focus-visible:ring-2 focus-visible:ring-white/60 focus-visible:ring-inset max-md:pt-4 max-md:pb-[18px] max-md:pr-[18px]";
+
+/**
+ * The always-dark code block: language label and Copy in a 44px header, the
+ * highlighted body below, and a fade on the right edge where long lines run
+ * out of view. Shared by MDX code fences and the generated preview snippet.
+ * Token colours come from the Vesper palette (see `app/typeset.css`).
+ */
+export function CodeFrame({
+ lang,
+ code,
+ children,
+ className,
+ bodyClassName,
+}: {
+ lang?: string;
+ code: string;
+ children: ReactNode;
+ className?: string;
+ bodyClassName?: string;
+}) {
+ return (
+ <div
+ data-code-frame=""
+ className={cn(
+ "not-prose relative flex flex-col overflow-hidden rounded-card border border-transparent bg-dark-surface text-[#fafafa] dark:border-hairline dark:bg-surface-sunken",
+ className,
+ )}
+ >
+ <div className="flex h-11 shrink-0 items-center justify-between border-b border-dark-border pr-2 pl-[18px] max-md:h-14 max-md:pr-1.5">
+ <span className="text-mono text-dark-subtle">{lang ?? "text"}</span>
+ <CopyButton
+ value={code}
+ variant="dark"
+ className="max-md:h-11 max-md:px-3.5 max-md:text-caption"
+ />
+ </div>
+ <div className={cn("relative min-h-0 flex-1", bodyClassName)}>
+ {children}
+ <div
+ aria-hidden="true"
+ className="pointer-events-none absolute inset-y-0 right-0 w-14 bg-linear-to-r from-transparent to-dark-surface max-md:w-12 dark:to-surface-sunken"
+ />
+ </div>
+ </div>
+ );
+}
diff --git a/components/docs/blocks/controls/boolean-control.tsx b/components/docs/blocks/controls/boolean-control.tsx
new file mode 100644
index 00000000..5406f30f
--- /dev/null
+++ b/components/docs/blocks/controls/boolean-control.tsx
@@ -0,0 +1,32 @@
+"use client";
+
+import { Switch } from "@base-ui/react/switch";
+import { cn } from "@/lib/utils";
+import { CONTROL, CONTROL_LABEL } from "./control-styles";
+
+/** Boolean prop: the whole tile toggles; the switch lights up fuchsia when on. */
+export function BooleanControl({
+ id,
+ label,
+ value,
+ onChange,
+}: {
+ id: string;
+ label: string;
+ value: boolean;
+ onChange: (value: boolean) => void;
+}) {
+ return (
+ <label htmlFor={id} className={cn(CONTROL, "cursor-pointer")}>
+ <span className={CONTROL_LABEL}>{label}</span>
+ <Switch.Root
+ id={id}
+ checked={value}
+ onCheckedChange={onChange}
+ className="group/switch relative h-5 w-[34px] shrink-0 cursor-pointer rounded-full bg-[#34383c] outline-none transition-colors duration-150 focus-visible:ring-2 focus-visible:ring-primary-bright focus-visible:ring-offset-1 focus-visible:ring-offset-dark-surface data-checked:bg-primary"
+ >
+ <Switch.Thumb className="absolute top-0.5 left-0.5 size-4 rounded-full bg-[#fafafa] transition-transform duration-150 ease-[cubic-bezier(0.19,1,0.22,1)] data-checked:translate-x-3.5 motion-reduce:transition-none" />
+ </Switch.Root>
+ </label>
+ );
+}
diff --git a/components/docs/blocks/controls/color-control.tsx b/components/docs/blocks/controls/color-control.tsx
new file mode 100644
index 00000000..d113f1c7
--- /dev/null
+++ b/components/docs/blocks/controls/color-control.tsx
@@ -0,0 +1,47 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import {
+ CONTROL,
+ CONTROL_FOCUS,
+ CONTROL_LABEL,
+ CONTROL_VALUE,
+} from "./control-styles";
+
+/** Color prop: hex readout and a swatch that opens the native picker. */
+export function ColorControl({
+ id,
+ label,
+ value,
+ onChange,
+}: {
+ id: string;
+ label: string;
+ value: string;
+ onChange: (value: string) => void;
+}) {
+ return (
+ <div className={cn(CONTROL, CONTROL_FOCUS, "pr-2")}>
+ <label htmlFor={id} className={cn(CONTROL_LABEL, "cursor-pointer")}>
+ {label}
+ </label>
+ <span className="flex items-center gap-2.5">
+ <span className={cn(CONTROL_VALUE, "tabular-nums")}>
+ {value.toUpperCase()}
+ </span>
+ <span
+ className="relative size-5 shrink-0 overflow-hidden rounded-[5px] border border-white/15"
+ style={{ backgroundColor: value }}
+ >
+ <input
+ id={id}
+ type="color"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ className="absolute inset-0 size-full cursor-pointer opacity-0"
+ />
+ </span>
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/blocks/controls/control-styles.ts b/components/docs/blocks/controls/control-styles.ts
new file mode 100644
index 00000000..0f3586b0
--- /dev/null
+++ b/components/docs/blocks/controls/control-styles.ts
@@ -0,0 +1,21 @@
+/**
+ * Shared surfaces for the customizer controls on the dark player panel: a
+ * 36px tile (44px on phones) with the label on the left and the value on the
+ * right, a lighter fill on hover and a fuchsia ring while editing.
+ */
+export const CONTROL =
+ "relative flex h-9 min-w-0 items-center justify-between gap-3 overflow-hidden rounded-tile bg-white/5 px-3 text-caption leading-[17px] font-medium transition-colors duration-150 hover:bg-white/8 max-md:h-11 max-md:text-small max-md:leading-[18px]";
+
+export const CONTROL_FOCUS =
+ "focus-within:ring-[1.5px] focus-within:ring-primary-bright focus-within:ring-inset";
+
+export const CONTROL_LABEL = "shrink-0 text-white/70";
+
+export const CONTROL_VALUE = "text-[#fafafa]";
+
+/** Decimal places implied by a step (0.01 → 2), so 0.9 reads as 0.90. */
+export function formatStep(value: number, step: number) {
+ const dot = String(step).indexOf(".");
+ const decimals = dot === -1 ? 0 : String(step).length - dot - 1;
+ return value.toFixed(decimals);
+}
diff --git a/components/docs/blocks/controls/number-control.tsx b/components/docs/blocks/controls/number-control.tsx
new file mode 100644
index 00000000..7a3d3857
--- /dev/null
+++ b/components/docs/blocks/controls/number-control.tsx
@@ -0,0 +1,62 @@
+"use client";
+
+import { NumberField } from "@base-ui/react/number-field";
+import { CursorGrowIcon } from "@/components/ui/number-field";
+import { cn } from "@/lib/utils";
+import {
+ CONTROL,
+ CONTROL_FOCUS,
+ CONTROL_LABEL,
+ CONTROL_VALUE,
+} from "./control-styles";
+
+/**
+ * Unbounded number prop: type the value, or drag the label left and right to
+ * scrub it.
+ */
+export function NumberControl({
+ id,
+ label,
+ value,
+ min,
+ max,
+ step,
+ onChange,
+}: {
+ id: string;
+ label: string;
+ value: number;
+ min: number;
+ max: number;
+ step: number;
+ onChange: (value: number) => void;
+}) {
+ return (
+ <NumberField.Root
+ id={id}
+ value={value}
+ min={min}
+ max={max}
+ step={step}
+ onValueChange={(next) => {
+ if (next !== null) onChange(next);
+ }}
+ className={cn(CONTROL, CONTROL_FOCUS)}
+ >
+ <NumberField.ScrubArea className="flex cursor-ew-resize">
+ <label htmlFor={id} className={cn(CONTROL_LABEL, "cursor-ew-resize")}>
+ {label}
+ </label>
+ <NumberField.ScrubAreaCursor className="drop-shadow-[0_1px_1px_#0008]">
+ <CursorGrowIcon />
+ </NumberField.ScrubAreaCursor>
+ </NumberField.ScrubArea>
+ <NumberField.Input
+ className={cn(
+ CONTROL_VALUE,
+ "min-w-0 flex-1 bg-transparent text-right tabular-nums caret-primary-soft outline-none max-md:text-base",
+ )}
+ />
+ </NumberField.Root>
+ );
+}
diff --git a/components/docs/blocks/controls/select-control.tsx b/components/docs/blocks/controls/select-control.tsx
new file mode 100644
index 00000000..7946ba06
--- /dev/null
+++ b/components/docs/blocks/controls/select-control.tsx
@@ -0,0 +1,98 @@
+"use client";
+
+import { Select } from "@base-ui/react/select";
+import { cn } from "@/lib/utils";
+import { CONTROL, CONTROL_LABEL, CONTROL_VALUE } from "./control-styles";
+
+function Chevron() {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-3 shrink-0 text-dark-subtle transition-transform duration-150 group-data-popup-open/select:rotate-180"
+ >
+ <path
+ d="m6 9 6 6 6-6"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2.2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+/** Enum prop: the tile opens a dark list of options under it. */
+export function SelectControl({
+ id,
+ label,
+ value,
+ options,
+ onChange,
+}: {
+ id: string;
+ label: string;
+ value: string;
+ options: string[];
+ onChange: (value: string) => void;
+}) {
+ return (
+ <Select.Root
+ value={value}
+ onValueChange={(next) => {
+ if (next !== null) onChange(next as string);
+ }}
+ >
+ <Select.Trigger
+ id={id}
+ className={cn(
+ CONTROL,
+ "group/select w-full cursor-pointer outline-none focus-visible:ring-[1.5px] focus-visible:ring-primary-bright focus-visible:ring-inset data-popup-open:bg-white/8",
+ )}
+ >
+ <span className={CONTROL_LABEL}>{label}</span>
+ <span className="flex min-w-0 items-center gap-2">
+ <Select.Value className={cn(CONTROL_VALUE, "truncate")} />
+ <Chevron />
+ </span>
+ </Select.Trigger>
+ <Select.Portal>
+ <Select.Positioner
+ side="bottom"
+ sideOffset={6}
+ alignItemWithTrigger={false}
+ className="z-50 outline-none"
+ >
+ <Select.Popup className="flex max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) flex-col gap-0.5 overflow-y-auto rounded-control-sm border border-dark-border bg-dark-raised p-1 shadow-[0_12px_24px_-8px_rgb(0_0_0/60%)] outline-none transition-[opacity,transform] duration-150 ease-[cubic-bezier(0.19,1,0.22,1)] data-ending-style:scale-98 data-ending-style:opacity-0 data-ending-style:duration-100 data-ending-style:ease-[ease] data-starting-style:scale-98 data-starting-style:opacity-0 motion-reduce:transition-opacity">
+ {options.map((option) => (
+ <Select.Item
+ key={option}
+ value={option}
+ className="flex h-8 shrink-0 cursor-pointer items-center justify-between gap-3 rounded-tile px-2.5 text-caption text-[#c9cdd0] outline-none select-none data-highlighted:bg-white/8 data-selected:text-[#f4f4f5] max-md:h-11 max-md:text-small"
+ >
+ <Select.ItemText>{option}</Select.ItemText>
+ <Select.ItemIndicator>
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-[13px] text-[#f4f4f5]"
+ >
+ <path
+ d="M20 6 9 17l-5-5"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2.2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </Select.ItemIndicator>
+ </Select.Item>
+ ))}
+ </Select.Popup>
+ </Select.Positioner>
+ </Select.Portal>
+ </Select.Root>
+ );
+}
diff --git a/components/docs/blocks/controls/slider-control.tsx b/components/docs/blocks/controls/slider-control.tsx
new file mode 100644
index 00000000..f378188c
--- /dev/null
+++ b/components/docs/blocks/controls/slider-control.tsx
@@ -0,0 +1,197 @@
+"use client";
+
+import {
+ type KeyboardEvent,
+ type PointerEvent,
+ useLayoutEffect,
+ useRef,
+ useState,
+} from "react";
+import { cn } from "@/lib/utils";
+import { CONTROL, CONTROL_LABEL, formatStep } from "./control-styles";
+
+const TICKS = [10, 20, 30, 40, 50, 60, 70, 80, 90];
+
+const clamp = (v: number, lo: number, hi: number) =>
+ Math.min(Math.max(v, lo), hi);
+
+/**
+ * A bounded number as a fill slider: the whole tile is the track, the fill
+ * ends in a thin handle line, and ticks appear while it is hovered or dragged.
+ * Arrows step, Shift + arrow or Page Up / Down step ten times, Home / End
+ * jump to the limits.
+ */
+export function SliderControl({
+ label,
+ value,
+ min,
+ max,
+ step,
+ onChange,
+}: {
+ label: string;
+ value: number;
+ min: number;
+ max: number;
+ step: number;
+ onChange: (value: number) => void;
+}) {
+ const trackRef = useRef<HTMLDivElement>(null);
+ const labelRef = useRef<HTMLSpanElement>(null);
+ const valueRef = useRef<HTMLSpanElement>(null);
+ const [dragging, setDragging] = useState(false);
+ const percent = ((clamp(value, min, max) - min) / (max - min || 1)) * 100;
+
+ // Where the label ends and the value starts, in % of the track, so the
+ // handle line can step aside instead of striking through the text.
+ const [clear, setClear] = useState({ from: 0, to: 100 });
+ useLayoutEffect(() => {
+ const track = trackRef.current;
+ if (!track) return;
+ const measure = () => {
+ const width = track.offsetWidth;
+ const label = labelRef.current;
+ const val = valueRef.current;
+ if (!width || !label || !val) return;
+ const from = ((label.offsetLeft + label.offsetWidth + 8) / width) * 100;
+ const to = ((val.offsetLeft - 8) / width) * 100;
+ setClear((prev) =>
+ prev.from === from && prev.to === to ? prev : { from, to },
+ );
+ };
+ measure();
+ const observer = new ResizeObserver(measure);
+ observer.observe(track);
+ if (valueRef.current) observer.observe(valueRef.current);
+ return () => observer.disconnect();
+ }, []);
+ const overText = percent < clear.from || percent > clear.to;
+
+ const commit = (raw: number) => {
+ const snapped = Math.round((raw - min) / step) * step + min;
+ const next = Number(clamp(snapped, min, max).toFixed(10));
+ if (next !== value) onChange(next);
+ };
+
+ const fromPointer = (clientX: number) => {
+ const box = trackRef.current?.getBoundingClientRect();
+ if (!box || box.width === 0) return;
+ commit(min + ((clientX - box.left) / box.width) * (max - min));
+ };
+
+ const grab = (event: PointerEvent<HTMLDivElement>) => {
+ event.currentTarget.setPointerCapture(event.pointerId);
+ event.currentTarget.focus({ preventScroll: true });
+ setDragging(true);
+ fromPointer(event.clientX);
+ };
+
+ // A finger on a full-width tile is usually scrolling the page, so touch
+ // only takes over once it moves sideways (or lifts as a tap).
+ const touchStart = useRef<number | null>(null);
+ const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {
+ if (event.pointerType === "touch") {
+ touchStart.current = event.clientX;
+ return;
+ }
+ event.preventDefault();
+ grab(event);
+ };
+ const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {
+ if (dragging) {
+ fromPointer(event.clientX);
+ } else if (
+ touchStart.current !== null &&
+ Math.abs(event.clientX - touchStart.current) > 6
+ ) {
+ touchStart.current = null;
+ grab(event);
+ }
+ };
+ const onPointerUp = (event: PointerEvent<HTMLDivElement>) => {
+ if (touchStart.current !== null) fromPointer(event.clientX);
+ touchStart.current = null;
+ setDragging(false);
+ };
+ const onPointerCancel = () => {
+ touchStart.current = null;
+ setDragging(false);
+ };
+
+ const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
+ const by = event.shiftKey ? step * 10 : step;
+ const next: Record<string, number> = {
+ ArrowRight: value + by,
+ ArrowUp: value + by,
+ ArrowLeft: value - by,
+ ArrowDown: value - by,
+ PageUp: value + step * 10,
+ PageDown: value - step * 10,
+ Home: min,
+ End: max,
+ };
+ if (!(event.key in next)) return;
+ event.preventDefault();
+ commit(next[event.key]);
+ };
+
+ const display = formatStep(value, step);
+
+ return (
+ <div
+ ref={trackRef}
+ role="slider"
+ tabIndex={0}
+ aria-label={label}
+ aria-valuemin={min}
+ aria-valuemax={max}
+ aria-valuenow={value}
+ aria-valuetext={display}
+ data-dragging={dragging || undefined}
+ onPointerDown={onPointerDown}
+ onPointerMove={onPointerMove}
+ onPointerUp={onPointerUp}
+ onPointerCancel={onPointerCancel}
+ onKeyDown={onKeyDown}
+ className={cn(
+ CONTROL,
+ "group/slider cursor-ew-resize touch-pan-y outline-none select-none focus-visible:ring-[1.5px] focus-visible:ring-primary-bright focus-visible:ring-inset",
+ )}
+ >
+ <span aria-hidden="true" className="pointer-events-none absolute inset-0">
+ {TICKS.filter((tick) => tick > clear.from && tick < clear.to).map(
+ (tick) => (
+ <span
+ key={tick}
+ className="absolute top-1/2 h-2 w-px -translate-y-1/2 rounded-full bg-white/15 opacity-0 transition-opacity duration-150 group-hover/slider:opacity-100 group-data-dragging/slider:opacity-100"
+ style={{ left: `${tick}%` }}
+ />
+ ),
+ )}
+ <span
+ className="absolute inset-y-0 left-0 bg-white/11 transition-colors duration-150 group-hover/slider:bg-white/13 group-data-dragging/slider:bg-white/18"
+ style={{ width: `${percent}%` }}
+ />
+ <span
+ className={cn(
+ "absolute top-2 h-5 w-[3px] -translate-x-1/2 rounded-full bg-white/50 transition-[background-color,opacity] duration-150 group-data-dragging/slider:bg-[#fafafa] max-md:top-3",
+ overText && "opacity-0",
+ )}
+ style={{ left: `max(1.5px, ${percent}%)` }}
+ />
+ </span>
+ <span
+ ref={labelRef}
+ className={cn(CONTROL_LABEL, "pointer-events-none relative")}
+ >
+ {label}
+ </span>
+ <span
+ ref={valueRef}
+ className="pointer-events-none relative text-[#fafafa] tabular-nums"
+ >
+ {display}
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/blocks/controls/text-control.tsx b/components/docs/blocks/controls/text-control.tsx
new file mode 100644
index 00000000..3e7c44cf
--- /dev/null
+++ b/components/docs/blocks/controls/text-control.tsx
@@ -0,0 +1,77 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import {
+ CONTROL,
+ CONTROL_FOCUS,
+ CONTROL_LABEL,
+ CONTROL_VALUE,
+} from "./control-styles";
+
+/** Values longer than this get the multi-line field (transcripts, prose). */
+export const LONG_TEXT = 120;
+
+/**
+ * Text prop: an inline field for short copy, a labeled textarea for long copy
+ * such as caption transcripts.
+ */
+export function TextControl({
+ id,
+ label,
+ value,
+ long,
+ onChange,
+}: {
+ id: string;
+ label: string;
+ value: string;
+ long?: boolean;
+ onChange: (value: string) => void;
+}) {
+ if (long) {
+ return (
+ <div
+ className={cn(
+ CONTROL,
+ CONTROL_FOCUS,
+ "h-auto flex-col items-stretch gap-2 py-3 max-md:h-auto",
+ )}
+ >
+ <label htmlFor={id} className={CONTROL_LABEL}>
+ {label}
+ </label>
+ <textarea
+ id={id}
+ rows={3}
+ spellCheck={false}
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ className={cn(
+ CONTROL_VALUE,
+ "field-sizing-content min-h-[60px] w-full resize-none bg-transparent text-caption leading-5 font-normal caret-primary-soft outline-none max-md:text-base",
+ )}
+ />
+ </div>
+ );
+ }
+
+ return (
+ <div className={cn(CONTROL, CONTROL_FOCUS)}>
+ <label htmlFor={id} className={CONTROL_LABEL}>
+ {label}
+ </label>
+ <input
+ id={id}
+ type="text"
+ spellCheck={false}
+ autoComplete="off"
+ value={value}
+ onChange={(e) => onChange(e.target.value)}
+ className={cn(
+ CONTROL_VALUE,
+ "min-w-0 flex-1 truncate bg-transparent text-right caret-primary-soft outline-none max-md:text-base",
+ )}
+ />
+ </div>
+ );
+}
diff --git a/components/docs/blocks/customize-panel.tsx b/components/docs/blocks/customize-panel.tsx
new file mode 100644
index 00000000..f7e4c843
--- /dev/null
+++ b/components/docs/blocks/customize-panel.tsx
@@ -0,0 +1,153 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { CopyButton } from "@/components/docs/copy-button";
+import { useTrackEvent } from "@/lib/analytics";
+import type { ControlConfig } from "@/lib/customizer-config";
+import { ComponentCustomizer } from "../component-customizer";
+
+const CHIP =
+ "flex h-8 shrink-0 cursor-pointer items-center gap-1.5 rounded-tile bg-white/5 px-3 text-caption font-medium text-white/70 outline-none transition-colors duration-150 hover:bg-white/10 hover:text-[#fafafa] focus-visible:ring-2 focus-visible:ring-white/40 disabled:cursor-default disabled:opacity-40 disabled:hover:bg-white/5 disabled:hover:text-white/70 max-md:h-11 max-md:flex-1 max-md:justify-center max-md:rounded-[10px] max-md:bg-white/8";
+
+function Icon({ d }: { d: string[] }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-[13px] shrink-0 text-[#c9cdd0]"
+ >
+ {d.map((path) => (
+ <path
+ key={path}
+ d={path}
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ ))}
+ </svg>
+ );
+}
+
+function SlidersIcon() {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="size-3.5 shrink-0 text-dark-subtle"
+ >
+ <g
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ >
+ <path d="M4 7h10M18 7h2M4 17h4M12 17h8" />
+ <circle cx="16" cy="7" r="2" />
+ <circle cx="10" cy="17" r="2" />
+ </g>
+ </svg>
+ );
+}
+
+/**
+ * "Customize" section of the player: prop count, reset, a share link that
+ * carries the current values in the URL, copy of the generated code, and the
+ * grouped controls.
+ */
+export function CustomizePanel({
+ name,
+ controls,
+ values,
+ code,
+ isDefault,
+ onChange,
+ onReset,
+}: {
+ name: string;
+ controls: ControlConfig;
+ values: Record<string, unknown>;
+ code: string;
+ isDefault: boolean;
+ onChange: (key: string, value: unknown) => void;
+ onReset: () => void;
+}) {
+ const trackEvent = useTrackEvent();
+ const [shared, setShared] = useState(false);
+ const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
+ useEffect(
+ () => () => {
+ if (timer.current) clearTimeout(timer.current);
+ },
+ [],
+ );
+
+ const share = async () => {
+ const ok = await navigator.clipboard.writeText(window.location.href).then(
+ () => true,
+ () => false,
+ );
+ if (!ok) return;
+ setShared(true);
+ trackEvent("customized_link_shared", { component: name });
+ if (timer.current) clearTimeout(timer.current);
+ timer.current = setTimeout(() => setShared(false), 1500);
+ };
+
+ const count = Object.keys(controls).length;
+
+ return (
+ <div className="flex flex-col gap-2 max-md:border-t max-md:border-white/6 max-md:pt-2.5">
+ <div className="flex h-[34px] shrink-0 items-center justify-between gap-3 pr-1 pl-2 max-md:h-auto max-md:flex-col max-md:items-stretch max-md:gap-2 max-md:p-0">
+ <div className="flex items-center gap-2.5 max-md:h-7 max-md:px-1.5">
+ <SlidersIcon />
+ <span className="text-small text-[#fafafa] max-md:text-[15px]">
+ Customize
+ </span>
+ <span className="text-mono text-dark-subtle tabular-nums max-md:text-caption">
+ {count} {count === 1 ? "prop" : "props"}
+ </span>
+ </div>
+ <div className="flex items-center gap-1.5">
+ <button
+ type="button"
+ onClick={onReset}
+ disabled={isDefault}
+ className={CHIP}
+ >
+ <Icon d={["M3 12a9 9 0 1 0 3-6.7L3 8", "M3 3v5h5"]} />
+ Reset
+ </button>
+ <button type="button" onClick={share} className={CHIP}>
+ <Icon
+ d={[
+ "M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1",
+ "M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1",
+ ]}
+ />
+ {/* Both labels share one cell so the chip keeps its width. */}
+ <span className="grid text-center">
+ <span aria-live="polite" className="col-start-1 row-start-1">
+ {shared ? "Copied" : "Share link"}
+ </span>
+ <span
+ aria-hidden="true"
+ className="invisible col-start-1 row-start-1"
+ >
+ {shared ? "Share link" : "Copied"}
+ </span>
+ </span>
+ </button>
+ <CopyButton value={code} label="Copy code" variant="light" />
+ </div>
+ </div>
+ <ComponentCustomizer
+ controls={controls}
+ values={values}
+ onChange={onChange}
+ />
+ </div>
+ );
+}
diff --git a/components/docs/blocks/player/docs-player.tsx b/components/docs/blocks/player/docs-player.tsx
new file mode 100644
index 00000000..338bfe56
--- /dev/null
+++ b/components/docs/blocks/player/docs-player.tsx
@@ -0,0 +1,112 @@
+"use client";
+
+import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
+import type { PlayerRef } from "@remotion/player";
+import { type ReactNode, useCallback, useRef, useState } from "react";
+import { CodeBlock } from "@/components/docs/code-block";
+import { cn } from "@/lib/utils";
+import { PlayerBar } from "./player-bar";
+import { PlayerStage, type StageComposition } from "./player-stage";
+
+const TAB =
+ "flex h-7 cursor-pointer items-center rounded-[9px] px-3 text-caption text-dark-subtle outline-none transition-[color] duration-150 hover:text-[#fafafa] focus-visible:ring-2 focus-visible:ring-white/40 max-md:relative max-md:after:absolute max-md:after:inset-x-0 max-md:after:-inset-y-[3px] data-active:bg-[#2b2e31] data-active:text-[#fafafa] max-md:h-[38px] max-md:text-small max-md:leading-[18px] dark:data-active:bg-secondary";
+
+/**
+ * The dark docs player: an optional Preview / Code toolbar (with page actions
+ * on the right), the live Remotion stage, its transport bar, and whatever the
+ * caller stacks below (the customize panel). Light and dark themes share the
+ * same always-dark surface; dark mode only lifts it onto the card colour.
+ */
+export function DocsPlayer({
+ name,
+ composition,
+ code,
+ actions,
+ children,
+ className,
+}: {
+ name: string;
+ composition: StageComposition;
+ /** Snippet for the Code tab; without it the toolbar only shows `actions`. */
+ code?: string;
+ actions?: ReactNode;
+ children?: ReactNode;
+ className?: string;
+}) {
+ const playerRef = useRef<PlayerRef | null>(null);
+ const [mounted, setMounted] = useState(false);
+ const mount = useCallback(() => setMounted(true), []);
+ const title = name.replaceAll("-", " ");
+ const label = `${title} preview`;
+
+ const preview = (
+ <>
+ <PlayerStage
+ name={title}
+ composition={composition}
+ playerRef={playerRef}
+ mounted={mounted}
+ onMount={mount}
+ />
+ <PlayerBar
+ label={label}
+ playerRef={playerRef}
+ mounted={mounted}
+ onMount={mount}
+ durationInFrames={composition.durationInFrames}
+ fps={composition.fps}
+ />
+ </>
+ );
+
+ return (
+ <section
+ aria-label={label}
+ className={cn(
+ "not-prose flex flex-col gap-2 rounded-card border border-transparent bg-dark-surface p-2 text-[#fafafa] dark:border-hairline dark:bg-surface",
+ className,
+ )}
+ >
+ {code ? (
+ <TabsPrimitive.Root
+ defaultValue="preview"
+ className="@container flex flex-col gap-2"
+ >
+ <div className="flex items-center justify-between gap-1.5 px-1 max-md:px-0">
+ <TabsPrimitive.List className="flex items-center gap-0.5 rounded-control-sm bg-dark-raised p-[3px] dark:bg-surface-muted">
+ <TabsPrimitive.Tab value="preview" className={TAB}>
+ Preview
+ </TabsPrimitive.Tab>
+ <TabsPrimitive.Tab value="code" className={TAB}>
+ Code
+ </TabsPrimitive.Tab>
+ </TabsPrimitive.List>
+ {actions}
+ </div>
+ <TabsPrimitive.Panel
+ value="preview"
+ keepMounted
+ className="flex flex-col gap-2 outline-none"
+ >
+ {preview}
+ </TabsPrimitive.Panel>
+ <TabsPrimitive.Panel value="code" className="outline-none">
+ <CodeBlock
+ code={code}
+ className="h-[calc(56.25cqw+60px)] rounded-control-sm border-dark-border max-md:h-auto max-md:max-h-96"
+ bodyClassName="overflow-y-auto"
+ />
+ </TabsPrimitive.Panel>
+ </TabsPrimitive.Root>
+ ) : (
+ <>
+ {actions ? (
+ <div className="flex items-center justify-end px-1">{actions}</div>
+ ) : null}
+ {preview}
+ </>
+ )}
+ {children}
+ </section>
+ );
+}
diff --git a/components/docs/blocks/player/player-bar.tsx b/components/docs/blocks/player/player-bar.tsx
new file mode 100644
index 00000000..19e60d05
--- /dev/null
+++ b/components/docs/blocks/player/player-bar.tsx
@@ -0,0 +1,255 @@
+"use client";
+
+import type { CallbackListener, PlayerRef } from "@remotion/player";
+import {
+ type KeyboardEvent,
+ type PointerEvent,
+ type RefObject,
+ useCallback,
+ useEffect,
+ useRef,
+ useState,
+} from "react";
+import { formatTime } from "@/app/(home)/components/landing/ui/roll-player/roll-buttons";
+import { PlayerRuler } from "./player-ruler";
+
+function PlayKey({
+ playing,
+ label,
+ onClick,
+}: {
+ playing: boolean;
+ label: string;
+ onClick: () => void;
+}) {
+ return (
+ <button
+ type="button"
+ onClick={onClick}
+ aria-label={`${playing ? "Pause" : "Play"} ${label}`}
+ className="flex size-10 shrink-0 cursor-pointer items-center justify-center rounded-control-sm bg-white text-dark-surface outline-none transition-transform duration-150 focus-visible:ring-2 focus-visible:ring-white/50 active:translate-y-px max-md:size-11"
+ >
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-3.5">
+ {playing ? (
+ <path d="M7 4h3.5v16H7zM13.5 4H17v16h-3.5z" fill="currentColor" />
+ ) : (
+ <path d="M6 3.5v17l14.5-8.5Z" fill="currentColor" />
+ )}
+ </svg>
+ </button>
+ );
+}
+
+/**
+ * Transport under the stage: play/pause, elapsed time and the seek ruler.
+ * Listens to the Remotion Player's own events, so clicking the stage or the
+ * space bar stay in sync with the button.
+ */
+export function PlayerBar({
+ label,
+ playerRef,
+ mounted,
+ onMount,
+ durationInFrames,
+ fps,
+}: {
+ label: string;
+ playerRef: RefObject<PlayerRef | null>;
+ mounted: boolean;
+ onMount: () => void;
+ durationInFrames: number;
+ fps: number;
+}) {
+ const [playing, setPlaying] = useState(false);
+ const [second, setSecond] = useState(0);
+ const wantsPlay = useRef(false);
+ const trackRef = useRef<HTMLDivElement>(null);
+ const frameRef = useRef<HTMLDivElement>(null);
+ const brightRef = useRef<HTMLDivElement>(null);
+ const headRef = useRef<HTMLDivElement>(null);
+ const lastFrame = Math.max(durationInFrames - 1, 1);
+ const duration = durationInFrames / fps;
+
+ const paint = useCallback(
+ (frame: number) => {
+ const progress = Math.min(Math.max(frame / lastFrame, 0), 1);
+ const clip = `inset(0 ${(1 - progress) * 100}% 0 0 round 8px)`;
+ if (frameRef.current) frameRef.current.style.clipPath = clip;
+ if (brightRef.current) brightRef.current.style.clipPath = clip;
+ if (headRef.current) {
+ headRef.current.style.transform = `translateX(${progress * 100}%)`;
+ }
+ setSecond(Math.floor(frame / fps));
+ },
+ [lastFrame, fps],
+ );
+
+ useEffect(() => {
+ if (!mounted) return;
+ let raf = 0;
+ let detach: (() => void) | null = null;
+
+ const attach = () => {
+ const player = playerRef.current;
+ if (!player) {
+ raf = requestAnimationFrame(attach);
+ return;
+ }
+ // Frames land at the clip's fps (30), which steps the playhead ~20px at
+ // a time on a wide ruler; while playing it glides between them on
+ // display refresh, never more than one frame ahead.
+ let glide = 0;
+ let last = { frame: player.getCurrentFrame(), at: performance.now() };
+ const step = () => {
+ const ahead = Math.min(((performance.now() - last.at) / 1000) * fps, 1);
+ paint(Math.min(last.frame + ahead, lastFrame));
+ glide = requestAnimationFrame(step);
+ };
+ const stop = () => {
+ cancelAnimationFrame(glide);
+ glide = 0;
+ };
+ const onFrame: CallbackListener<"frameupdate"> = (e) => {
+ last = { frame: e.detail.frame, at: performance.now() };
+ if (!glide) paint(e.detail.frame);
+ };
+ const onSeek: CallbackListener<"seeked"> = (e) => {
+ last = { frame: e.detail.frame, at: performance.now() };
+ paint(e.detail.frame);
+ };
+ const onPlay = () => {
+ setPlaying(true);
+ last = { frame: player.getCurrentFrame(), at: performance.now() };
+ if (!glide) glide = requestAnimationFrame(step);
+ };
+ const onPause = () => {
+ setPlaying(false);
+ stop();
+ paint(player.getCurrentFrame());
+ };
+ player.addEventListener("frameupdate", onFrame);
+ player.addEventListener("seeked", onSeek);
+ player.addEventListener("play", onPlay);
+ player.addEventListener("pause", onPause);
+ player.addEventListener("ended", onPause);
+ if (player.isPlaying()) onPlay();
+ else paint(player.getCurrentFrame());
+ if (wantsPlay.current) {
+ wantsPlay.current = false;
+ player.play();
+ }
+ detach = () => {
+ stop();
+ player.removeEventListener("frameupdate", onFrame);
+ player.removeEventListener("seeked", onSeek);
+ player.removeEventListener("play", onPlay);
+ player.removeEventListener("pause", onPause);
+ player.removeEventListener("ended", onPause);
+ };
+ };
+ attach();
+ return () => {
+ cancelAnimationFrame(raf);
+ detach?.();
+ };
+ }, [mounted, playerRef, paint, fps, lastFrame]);
+
+ const toggle = () => {
+ if (!mounted) {
+ wantsPlay.current = true;
+ onMount();
+ return;
+ }
+ const player = playerRef.current;
+ if (!player) return;
+ // Autoplay runs muted; an explicit play brings template soundtracks in.
+ if (!player.isPlaying() && player.isMuted()) player.unmute();
+ player.toggle();
+ };
+
+ const seekTo = (frame: number) => {
+ const player = playerRef.current;
+ if (!player) return;
+ const target = Math.round(Math.min(Math.max(frame, 0), lastFrame));
+ player.seekTo(target);
+ paint(target);
+ };
+
+ // Scrubbing pauses playback and resumes it on release if it was running.
+ const scrub = useRef<{ resume: boolean } | null>(null);
+ // Measured on the head's parent: the head itself is translated by the
+ // progress, so its own box drifts right as the clip plays.
+ const frameAt = (clientX: number) => {
+ const box = headRef.current?.parentElement?.getBoundingClientRect();
+ if (!box || box.width === 0) return 0;
+ return ((clientX - box.left) / box.width) * lastFrame;
+ };
+ const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {
+ if (!mounted) onMount();
+ const player = playerRef.current;
+ if (!player) return;
+ event.currentTarget.setPointerCapture(event.pointerId);
+ scrub.current = { resume: player.isPlaying() };
+ player.pause();
+ seekTo(frameAt(event.clientX));
+ };
+ const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {
+ if (scrub.current) seekTo(frameAt(event.clientX));
+ };
+ const onPointerUp = () => {
+ if (scrub.current?.resume) playerRef.current?.play();
+ scrub.current = null;
+ };
+
+ const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {
+ if (event.key === " ") {
+ event.preventDefault();
+ toggle();
+ return;
+ }
+ const player = playerRef.current;
+ if (!player) return;
+ const frame = player.getCurrentFrame();
+ const stepBy = event.shiftKey ? 1 : fps;
+ const next: Record<string, number> = {
+ ArrowRight: frame + stepBy,
+ ArrowUp: frame + stepBy,
+ ArrowLeft: frame - stepBy,
+ ArrowDown: frame - stepBy,
+ Home: 0,
+ End: lastFrame,
+ };
+ if (!(event.key in next)) return;
+ event.preventDefault();
+ seekTo(next[event.key]);
+ };
+
+ const time = (
+ <span className="shrink-0 text-mono text-[#fafafa] tabular-nums max-md:text-caption">
+ {formatTime(second)} / {formatTime(duration)}
+ </span>
+ );
+
+ return (
+ <div className="flex flex-col gap-1.5 py-1.5 max-md:pt-1 max-md:pb-0.5">
+ <div className="flex items-center gap-2">
+ <PlayKey playing={playing} label={label} onClick={toggle} />
+ <span className="contents max-md:hidden">{time}</span>
+ <PlayerRuler
+ label={label}
+ duration={duration}
+ current={second}
+ trackRef={trackRef}
+ frameRef={frameRef}
+ brightRef={brightRef}
+ headRef={headRef}
+ onKeyDown={onKeyDown}
+ onPointerDown={onPointerDown}
+ onPointerMove={onPointerMove}
+ onPointerUp={onPointerUp}
+ />
+ </div>
+ <div className="flex items-center px-1 md:hidden">{time}</div>
+ </div>
+ );
+}
diff --git a/components/docs/blocks/player/player-fallback.tsx b/components/docs/blocks/player/player-fallback.tsx
new file mode 100644
index 00000000..54ab8499
--- /dev/null
+++ b/components/docs/blocks/player/player-fallback.tsx
@@ -0,0 +1,30 @@
+import { cn } from "@/lib/utils";
+
+/**
+ * Same footprint as the player shell while its config chunk loads: toolbar,
+ * stage and transport. Only the customize panel below arrives later.
+ */
+export function PlayerFallback({ className }: { className?: string }) {
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ "flex flex-col gap-2 rounded-card border border-transparent bg-dark-surface p-2 dark:border-hairline dark:bg-surface",
+ className,
+ )}
+ >
+ <div className="h-[34px] max-md:h-11" />
+ <div className="aspect-video w-full rounded-control-sm bg-black" />
+ <div className="h-[52px] max-md:h-[72px]" />
+ </div>
+ );
+}
+
+/** Shown when MDX names something the registry or examples don't have. */
+export function UnknownBlock({ kind, name }: { kind: string; name: string }) {
+ return (
+ <div className="not-prose mt-5 rounded-cta bg-surface-muted px-4 py-3.5 text-small text-body first:mt-0">
+ Unknown {kind}: <code className="font-mono text-caption">{name}</code>
+ </div>
+ );
+}
diff --git a/components/docs/blocks/player/player-ruler.tsx b/components/docs/blocks/player/player-ruler.tsx
new file mode 100644
index 00000000..3db50c5e
--- /dev/null
+++ b/components/docs/blocks/player/player-ruler.tsx
@@ -0,0 +1,164 @@
+"use client";
+
+import type { KeyboardEvent, PointerEvent, Ref } from "react";
+import { formatTime } from "@/app/(home)/components/landing/ui/roll-player/roll-buttons";
+import { cn } from "@/lib/utils";
+
+/** Labels sit 6px inside the frame's travel so "0s" clears the frame edge. */
+const MARKS_BOX = "absolute inset-y-0 inset-x-1.5";
+const CLIP_START = "inset(0 100% 0 0)";
+
+const LABEL_STEPS = [1, 2, 5, 10, 15, 30, 60];
+const MAX_LABELS = 6;
+
+type Mark = { at: number; label?: string; phone?: boolean; desktop?: boolean };
+
+const seconds = (value: number) =>
+ `${Number.isInteger(value) ? value : value.toFixed(1).replace(/\.0$/, "")}s`;
+
+/**
+ * Second labels on a round step that fits the clip (0s, 1s, 2s … and the exact
+ * end), with ticks at thirds of a step on desktop and halves on phones.
+ */
+function rulerMarks(duration: number): Mark[] {
+ const step =
+ LABEL_STEPS.find((s) => duration / s <= MAX_LABELS) ?? LABEL_STEPS.at(-1);
+ if (!step || duration <= 0) return [];
+ const marks: Mark[] = [];
+ for (let t = 0; t < duration - step * 0.4; t += step) {
+ marks.push({ at: t, label: seconds(t) });
+ }
+ marks.push({ at: duration, label: seconds(duration) });
+
+ for (let t = 0; t + step <= duration; t += step) {
+ marks.push(
+ { at: t + step / 3, desktop: true },
+ { at: t + (step * 2) / 3, desktop: true },
+ { at: t + step / 2, phone: true },
+ );
+ }
+ // A short last stretch (3s → 3.5s) gets one centred tick when it has room.
+ const rest = duration % step;
+ if (rest >= step * 0.6) {
+ marks.push({ at: duration - rest / 2 });
+ }
+ return marks;
+}
+
+function Marks({
+ marks,
+ duration,
+ bright,
+}: {
+ marks: Mark[];
+ duration: number;
+ bright?: boolean;
+}) {
+ return marks.map((mark) => {
+ const pct = (mark.at / duration) * 100;
+ if (mark.label) {
+ return (
+ <span
+ key={`l-${mark.at}`}
+ className={cn(
+ "absolute top-1/2 text-mono tabular-nums max-md:text-caption",
+ bright ? "text-[#fafafa]" : "text-dark-subtle",
+ )}
+ style={{ left: `${pct}%`, transform: `translate(-${pct}%, -50%)` }}
+ >
+ {mark.label}
+ </span>
+ );
+ }
+ return (
+ <span
+ key={`t-${mark.at}`}
+ className={cn(
+ "absolute top-1/2 h-2.5 w-px -translate-x-1/2 -translate-y-1/2",
+ bright ? "bg-white/30" : "bg-white/14",
+ mark.desktop && "max-md:hidden",
+ mark.phone && "md:hidden",
+ )}
+ style={{ left: `${pct}%` }}
+ />
+ );
+ });
+}
+
+/**
+ * The seek track: second labels and ticks, a soft frame from the start up to
+ * the playhead with the labels inside it lit, and the white playhead itself.
+ * Progress is written straight to the DOM by the bar (`frameRef`, `brightRef`,
+ * `headRef`); `trackRef` is the seek target so playback never re-renders React.
+ */
+export function PlayerRuler({
+ label,
+ trackRef,
+ duration,
+ current,
+ frameRef,
+ brightRef,
+ headRef,
+ onKeyDown,
+ onPointerDown,
+ onPointerMove,
+ onPointerUp,
+}: {
+ label: string;
+ trackRef: Ref<HTMLDivElement>;
+ duration: number;
+ current: number;
+ frameRef: Ref<HTMLDivElement>;
+ brightRef: Ref<HTMLDivElement>;
+ headRef: Ref<HTMLDivElement>;
+ onKeyDown: (event: KeyboardEvent<HTMLDivElement>) => void;
+ onPointerDown: (event: PointerEvent<HTMLDivElement>) => void;
+ onPointerMove: (event: PointerEvent<HTMLDivElement>) => void;
+ onPointerUp: (event: PointerEvent<HTMLDivElement>) => void;
+}) {
+ const marks = rulerMarks(duration);
+ const total = Math.max(duration, 0);
+
+ return (
+ <div
+ role="slider"
+ tabIndex={0}
+ aria-label={`Seek ${label}`}
+ aria-valuemin={0}
+ aria-valuemax={Math.round(total * 10) / 10}
+ aria-valuenow={Math.round(current * 10) / 10}
+ aria-valuetext={`${formatTime(current)} of ${formatTime(total)}`}
+ onKeyDown={onKeyDown}
+ onPointerDown={onPointerDown}
+ onPointerMove={onPointerMove}
+ onPointerUp={onPointerUp}
+ onPointerCancel={onPointerUp}
+ ref={trackRef}
+ className="relative h-10 min-w-0 flex-1 cursor-pointer touch-none overflow-clip rounded-control-sm bg-dark-raised outline-none select-none focus-visible:ring-2 focus-visible:ring-white/40 max-md:h-11 dark:bg-surface-muted"
+ >
+ <div className="pointer-events-none absolute inset-y-0 right-2 left-2 max-md:inset-x-1.5">
+ <div className={MARKS_BOX}>
+ <Marks marks={marks} duration={total} />
+ </div>
+ <div
+ ref={frameRef}
+ className="absolute inset-x-0 top-1 h-8 rounded-tile border border-white/10 bg-white/6 max-md:top-1.5"
+ style={{ clipPath: CLIP_START }}
+ />
+ <div
+ ref={brightRef}
+ aria-hidden="true"
+ className="absolute inset-0"
+ style={{ clipPath: CLIP_START }}
+ >
+ <div className={MARKS_BOX}>
+ <Marks marks={marks} duration={total} bright />
+ </div>
+ </div>
+ <div ref={headRef} className="absolute inset-0 will-change-transform">
+ <span className="absolute top-1.5 left-0 h-7 w-[3px] -translate-x-1/2 rounded-[2px] bg-white max-md:top-2" />
+ </div>
+ </div>
+ </div>
+ );
+}
diff --git a/components/docs/blocks/player/player-stage.tsx b/components/docs/blocks/player/player-stage.tsx
new file mode 100644
index 00000000..d50f309e
--- /dev/null
+++ b/components/docs/blocks/player/player-stage.tsx
@@ -0,0 +1,196 @@
+"use client";
+
+import { Player, type PlayerRef } from "@remotion/player";
+import { type RefObject, useEffect, useMemo, useRef, useState } from "react";
+import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+import { cn } from "@/lib/utils";
+import { Backdrop, type BackdropFill } from "@/registry/remocn/backdrop";
+
+// biome-ignore lint/suspicious/noExplicitAny: dynamically-loaded Remotion composition, props shape varies per component
+type AnyComposition = React.ComponentType<any>;
+
+export type StageComposition = {
+ Component?: AnyComposition;
+ load?: () => Promise<{ default: AnyComposition }>;
+ inputProps: Record<string, unknown>;
+ durationInFrames: number;
+ fps: number;
+ compositionWidth: number;
+ compositionHeight: number;
+ previewBackdrop?: BackdropFill;
+};
+
+/**
+ * The 16:9 stage of the docs player. The Remotion Player mounts once the stage
+ * nears the viewport (or on the first play), starts on its own unless the
+ * reader prefers reduced motion, and pauses while scrolled away. It renders
+ * without Remotion's own controls: the bar below drives it through `playerRef`.
+ */
+export function PlayerStage({
+ name,
+ composition,
+ playerRef,
+ mounted,
+ onMount,
+ className,
+}: {
+ name: string;
+ composition: StageComposition;
+ playerRef: RefObject<PlayerRef | null>;
+ mounted: boolean;
+ onMount: () => void;
+ className?: string;
+}) {
+ const {
+ Component,
+ load,
+ inputProps,
+ durationInFrames,
+ fps,
+ compositionWidth,
+ compositionHeight,
+ previewBackdrop,
+ } = composition;
+ const frameRef = useRef<HTMLDivElement>(null);
+ const reducedMotion = usePrefersReducedMotion();
+
+ useEffect(() => {
+ if (mounted) return;
+ const el = frameRef.current;
+ if (!el || typeof IntersectionObserver === "undefined") return;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ if (entries.some((entry) => entry.isIntersecting)) {
+ onMount();
+ observer.disconnect();
+ }
+ },
+ { rootMargin: "200px 0px" },
+ );
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, [mounted, onMount]);
+
+ // `<Player autoPlay>` can mount a tick before its handle is ready and stall
+ // on the first frame, so play() is driven through the ref on the next
+ // animation frame, with one retry.
+ useEffect(() => {
+ if (!mounted || reducedMotion) return;
+ let raf2 = 0;
+ const raf1 = requestAnimationFrame(() => {
+ playerRef.current?.play();
+ raf2 = requestAnimationFrame(() => {
+ if (playerRef.current && !playerRef.current.isPlaying()) {
+ playerRef.current.play();
+ }
+ });
+ });
+ return () => {
+ cancelAnimationFrame(raf1);
+ if (raf2) cancelAnimationFrame(raf2);
+ };
+ }, [mounted, reducedMotion, playerRef]);
+
+ // Pause while off screen, resume only what this observer paused.
+ const pausedByStage = useRef(false);
+ useEffect(() => {
+ if (!mounted) return;
+ const el = frameRef.current;
+ if (!el || typeof IntersectionObserver === "undefined") return;
+ const observer = new IntersectionObserver(
+ (entries) => {
+ const visible = entries.some((entry) => entry.isIntersecting);
+ const player = playerRef.current;
+ if (!player) return;
+ if (visible && pausedByStage.current) {
+ pausedByStage.current = false;
+ player.play();
+ } else if (!visible && player.isPlaying()) {
+ pausedByStage.current = true;
+ player.pause();
+ }
+ },
+ { rootMargin: "100px 0px" },
+ );
+ observer.observe(el);
+ return () => observer.disconnect();
+ }, [mounted, playerRef]);
+
+ // The stage wears the composition's backdrop while its chunk loads, and the
+ // first frame fades in over it instead of cutting in from black.
+ const [loaded, setLoaded] = useState(false);
+ const compProps = useMemo<
+ | { lazyComponent: () => Promise<{ default: AnyComposition }> }
+ | { component: AnyComposition }
+ >(() => {
+ const wrap = (Inner: AnyComposition) => (p: Record<string, unknown>) =>
+ previewBackdrop ? (
+ <Backdrop fill={previewBackdrop} padding={0} radius={0} shadow="">
+ <Inner {...p} />
+ </Backdrop>
+ ) : (
+ <Inner {...p} />
+ );
+
+ if (load) {
+ return {
+ lazyComponent: () =>
+ load().then(({ default: Inner }) => {
+ setLoaded(true);
+ return { default: wrap(Inner) };
+ }),
+ };
+ }
+ return { component: wrap(Component ?? (() => null)) };
+ }, [Component, load, previewBackdrop]);
+
+ const poster =
+ previewBackdrop && previewBackdrop.type !== "image"
+ ? previewBackdrop.value
+ : undefined;
+
+ return (
+ <div
+ ref={frameRef}
+ style={poster ? { background: poster } : undefined}
+ className={cn(
+ "aspect-video w-full overflow-hidden rounded-control-sm bg-black",
+ className,
+ )}
+ >
+ {mounted ? (
+ <div
+ className={cn(
+ "size-full transition-opacity duration-200 ease-[ease]",
+ load && !loaded && "opacity-0",
+ )}
+ >
+ <Player
+ ref={playerRef}
+ {...compProps}
+ inputProps={inputProps}
+ durationInFrames={durationInFrames}
+ fps={fps}
+ compositionWidth={compositionWidth}
+ compositionHeight={compositionHeight}
+ style={{ width: "100%", height: "100%" }}
+ controls={false}
+ clickToPlay
+ loop
+ // Previews are silent; muted playback starts without a user gesture.
+ initiallyMuted
+ numberOfSharedAudioTags={0}
+ acknowledgeRemotionLicense
+ />
+ </div>
+ ) : (
+ <button
+ type="button"
+ onClick={onMount}
+ aria-label={`Load preview of ${name}`}
+ className="size-full cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-white/40 focus-visible:ring-inset"
+ />
+ )}
+ </div>
+ );
+}
diff --git a/components/docs/blocks/spacing.ts b/components/docs/blocks/spacing.ts
new file mode 100644
index 00000000..2c89bafb
--- /dev/null
+++ b/components/docs/blocks/spacing.ts
@@ -0,0 +1,7 @@
+/**
+ * Vertical rhythm for MDX blocks that opt out of typeset (`not-prose`): the
+ * article flow between blocks (20px, 24px on phones), a tighter gap under a
+ * heading, none at the top. Mirrors `.typeset-docs` in `app/typeset.css`.
+ */
+export const BLOCK_SPACING =
+ "mt-5 max-md:mt-6 first:mt-0 [:is(h2,h3)+&]:mt-4 max-md:[:is(h2,h3)+&]:mt-3.5";
diff --git a/components/docs/blocks/use-customizer.ts b/components/docs/blocks/use-customizer.ts
new file mode 100644
index 00000000..70a44017
--- /dev/null
+++ b/components/docs/blocks/use-customizer.ts
@@ -0,0 +1,71 @@
+"use client";
+
+import { useQueryStates } from "nuqs";
+import { useEffect, useMemo, useRef } from "react";
+import { useTrackEvent } from "@/lib/analytics";
+import { type ControlConfig, getDefaults } from "@/lib/customizer-config";
+import { buildParsers } from "@/lib/ui-preview-internals";
+
+/**
+ * Customizer state shared by the animation and ui previews: URL-synced values
+ * (nuqs, one query param per control), reset, and the analytics the docs
+ * widgets have always sent. Customize events are debounced per prop so a
+ * slider drag reports once, not on every step.
+ */
+export function useCustomizer(name: string, controls: ControlConfig) {
+ const trackEvent = useTrackEvent();
+ const { parsers, urlKeys } = useMemo(
+ () => buildParsers(name, controls),
+ [name, controls],
+ );
+ const defaults = useMemo(() => getDefaults(controls), [controls]);
+
+ const [values, setValues] = useQueryStates(parsers, {
+ urlKeys,
+ clearOnDefault: true,
+ shallow: true,
+ });
+
+ const isDefault = useMemo(
+ () => Object.entries(defaults).every(([k, v]) => values[k] === v),
+ [defaults, values],
+ );
+
+ useEffect(() => {
+ trackEvent("docs_component_viewed", { component: name });
+ }, [name, trackEvent]);
+
+ const timers = useRef<Map<string, ReturnType<typeof setTimeout>>>(new Map());
+ useEffect(() => {
+ const pending = timers.current;
+ return () => {
+ for (const timer of pending.values()) clearTimeout(timer);
+ pending.clear();
+ };
+ }, []);
+
+ const change = (key: string, value: unknown) => {
+ setValues((prev) => ({ ...prev, [key]: value }));
+ const existing = timers.current.get(key);
+ if (existing) clearTimeout(existing);
+ timers.current.set(
+ key,
+ setTimeout(() => {
+ trackEvent("component_customized", { component: name, prop: key });
+ timers.current.delete(key);
+ }, 500),
+ );
+ };
+
+ const reset = () => {
+ setValues(null);
+ trackEvent("customizer_reset", { component: name });
+ };
+
+ return {
+ values: values as Record<string, unknown>,
+ isDefault,
+ change,
+ reset,
+ };
+}
diff --git a/components/docs/callout.tsx b/components/docs/callout.tsx
index b8447dfd..c533ad62 100644
--- a/components/docs/callout.tsx
+++ b/components/docs/callout.tsx
@@ -1,53 +1,45 @@
-import { AlertTriangleIcon, InfoIcon } from "lucide-react";
+import { InfoIcon, TriangleAlertIcon } from "lucide-react";
import type { ReactNode } from "react";
-import { MINT, PEACH } from "@/config/site";
import { cn } from "@/lib/utils";
+import { BLOCK_SPACING } from "./blocks/spacing";
-function CalloutBase({
+/**
+ * Muted aside with an icon tile. Inline code and links inside get the same
+ * treatment as in prose, since callouts opt out of typeset.
+ */
+function Callout({
icon,
title,
children,
- accent,
- className,
}: {
icon: ReactNode;
title?: string;
children: ReactNode;
- /** Pastel accent that tints the border + icon (matches the landing palette). */
- accent?: string;
- className?: string;
}) {
return (
- <div
+ <aside
className={cn(
- "surface-card not-prose my-6 flex max-w-3xl gap-3 rounded-2xl px-4 py-3 text-sm",
- className,
+ "not-prose flex items-start gap-3.5 rounded-cta bg-surface-muted py-3.5 pr-[18px] pl-3.5",
+ BLOCK_SPACING,
)}
- style={
- accent
- ? {
- borderColor: `color-mix(in oklab, ${accent} 40%, var(--color-border))`,
- }
- : undefined
- }
>
+ <span className="flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-surface text-foreground">
+ {icon}
+ </span>
<div
- className="mt-0.5 shrink-0 text-muted-foreground"
- style={
- accent
- ? {
- color: `color-mix(in oklab, ${accent} 72%, var(--color-foreground))`,
- }
- : undefined
- }
+ className={cn(
+ "min-w-0 flex-1 pt-[7px] text-small leading-[22px] text-body",
+ "[&_p+p]:mt-2",
+ "[&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-[3px] [&_a:hover]:decoration-foreground",
+ "[&_code]:box-decoration-clone [&_code]:rounded-tag [&_code]:bg-surface [&_code]:px-1.5 [&_code]:py-px [&_code]:font-mono [&_code]:text-[12.5px] [&_code]:text-foreground [&_code]:shadow-[0_0_0_1px_var(--color-hairline)]",
+ )}
>
- {icon}
- </div>
- <div className="flex-1 space-y-1 leading-relaxed">
- {title && <div className="font-medium text-foreground">{title}</div>}
- <div className="text-muted-foreground [&>p]:m-0">{children}</div>
+ {title ? (
+ <p className="mb-0.5 font-medium text-foreground">{title}</p>
+ ) : null}
+ {children}
</div>
- </div>
+ </aside>
);
}
@@ -59,13 +51,12 @@ export function Note({
children: ReactNode;
}) {
return (
- <CalloutBase
- icon={<InfoIcon className="size-4" />}
+ <Callout
+ icon={<InfoIcon className="size-[18px]" strokeWidth={1.8} />}
title={title}
- accent={MINT}
>
{children}
- </CalloutBase>
+ </Callout>
);
}
@@ -77,12 +68,11 @@ export function Warning({
children: ReactNode;
}) {
return (
- <CalloutBase
- icon={<AlertTriangleIcon className="size-4" />}
+ <Callout
+ icon={<TriangleAlertIcon className="size-[18px]" strokeWidth={1.8} />}
title={title}
- accent={PEACH}
>
{children}
- </CalloutBase>
+ </Callout>
);
}
diff --git a/components/docs/code-block-command.tsx b/components/docs/code-block-command.tsx
index e4348ee1..1a846b71 100644
--- a/components/docs/code-block-command.tsx
+++ b/components/docs/code-block-command.tsx
@@ -3,11 +3,20 @@
import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
import { useAtom } from "jotai";
import { atomWithStorage } from "jotai/utils";
-import { TerminalIcon, TextAlignStartIcon } from "lucide-react";
-import { useMemo } from "react";
+import { type ReactNode, useMemo } from "react";
+import {
+ BunIcon,
+ ClaudeIcon,
+ GeminiIcon,
+ NpmIcon,
+ OpenAIIcon,
+ PnpmIcon,
+ YarnIcon,
+} from "@/app/(home)/components/landing/ui/brand-icons";
import { useTrackEvent } from "@/lib/analytics";
import { cn } from "@/lib/utils";
import { CopyButton } from "./copy-button";
+import { OpenInAgent } from "./open-in-agent";
export type PackageManager = "prompt" | "pnpm" | "yarn" | "npm" | "bun";
@@ -20,22 +29,56 @@ export function usePackageManager() {
return useAtom(packageManagerAtom);
}
+const AGENTS = [
+ ["claude", ClaudeIcon],
+ ["openai", OpenAIIcon],
+ ["gemini", GeminiIcon],
+] as const;
+
+/** The prompt goes to any agent, so its tab shows a few of them stacked. */
+function AgentStack() {
+ return (
+ <span className="flex items-center">
+ {AGENTS.map(([name, Icon], i) => (
+ <span
+ key={name}
+ className={cn(
+ "flex size-4 items-center justify-center rounded-full bg-surface shadow-[0_0_0_1.5px_var(--color-surface-muted)] dark:bg-secondary",
+ i > 0 && "-ml-1",
+ )}
+ >
+ <Icon className="size-2.5 text-foreground" />
+ </span>
+ ))}
+ </span>
+ );
+}
+
+const TAB_ICON: Record<PackageManager, ReactNode> = {
+ prompt: <AgentStack />,
+ pnpm: <PnpmIcon className="size-3.5" />,
+ yarn: <YarnIcon className="size-3.5" />,
+ npm: <NpmIcon className="size-3.5" />,
+ bun: <BunIcon className="size-3.5" />,
+};
+
export interface CodeBlockCommandProps {
prompt?: string;
pnpm?: string;
yarn?: string;
npm?: string;
bun?: string;
+ /** Registry name sent with the copy event; omitted events are not tracked. */
component?: string;
- /**
- * Surface treatment. `muted` (default) is the filled gray slab used in docs.
- * `outline` is a lighter bordered terminal that sits softer on light cards.
- * `plain` is border- and background-less, for hosts that own the surface
- * (e.g. a FramePanel).
- */
- variant?: "muted" | "outline" | "plain";
+ /** Card heading ("Installation"); without it the tabs lead the row. */
+ title?: string;
}
+/**
+ * Install card: package-manager tabs over a single command line with Copy.
+ * The chosen manager persists across pages (localStorage) so every install
+ * block on the site follows the reader's pick.
+ */
export function CodeBlockCommand({
prompt,
pnpm,
@@ -43,147 +86,102 @@ export function CodeBlockCommand({
npm,
bun,
component,
- variant = "muted",
+ title,
}: CodeBlockCommandProps) {
const [packageManager, setPackageManager] = usePackageManager();
const trackEvent = useTrackEvent();
const tabs = useMemo(
- () => ({ prompt, pnpm, yarn, npm, bun }),
+ () =>
+ Object.entries({ prompt, pnpm, yarn, npm, bun }).filter(
+ (entry): entry is [PackageManager, string] => !!entry[1],
+ ),
[prompt, pnpm, yarn, npm, bun],
);
-
- const tabsFiltered = useMemo(
- () => Object.entries(tabs).filter(([, value]) => !!value),
- [tabs],
- );
-
- const activeCommand = tabs[packageManager] || "";
+ const active = tabs.find(([key]) => key === packageManager) ?? tabs[0];
+ const [activeKey, activeCommand] = active ?? ["npm", ""];
return (
- <div
- className={cn(
- "not-prose relative overflow-hidden rounded-xl",
- variant === "outline" && "border border-border bg-card",
- variant === "muted" && "bg-muted",
- )}
+ <TabsPrimitive.Root
+ value={activeKey}
+ onValueChange={(value) => setPackageManager(value as PackageManager)}
+ className="not-prose flex flex-col gap-1 rounded-card border border-hairline bg-surface-muted p-1.5 max-md:gap-1.5"
>
- <TabsPrimitive.Root
- value={packageManager}
- onValueChange={(value) => setPackageManager(value as PackageManager)}
- className="flex flex-col"
+ <div
+ className={cn(
+ "flex items-center justify-between gap-3 py-1.5 pr-2 pl-3 max-md:flex-col max-md:items-stretch max-md:gap-1.5 max-md:p-0",
+ !title && "justify-end max-md:pt-0",
+ )}
>
- <div className="px-4 shadow-[inset_0_-1px_0_0] shadow-border">
- <TabsPrimitive.List className="relative z-0 flex h-10 w-fit items-center gap-1 [&_svg]:me-2 [&_svg]:size-4 [&_svg]:text-muted-foreground">
- {getIconForPackageManager(packageManager)}
-
- {tabsFiltered.map(([key]) => (
- <TabsPrimitive.Tab
- key={key}
- value={key}
- className={cn(
- "relative h-7 rounded-md px-2 font-mono text-sm font-medium whitespace-nowrap transition-colors outline-none",
- "text-muted-foreground hover:text-foreground",
- "data-active:text-foreground",
- "focus-visible:ring-2 focus-visible:ring-ring/40",
- )}
- >
- {key}
- </TabsPrimitive.Tab>
- ))}
-
- <TabsPrimitive.Indicator
+ {title ? (
+ <span className="text-small font-medium text-foreground max-md:flex max-md:h-9 max-md:items-center max-md:px-2.5 max-md:text-[15px] max-md:leading-5">
+ {title}
+ </span>
+ ) : null}
+ <TabsPrimitive.List className="flex items-center gap-0.5 max-md:rounded-control-sm max-md:bg-secondary max-md:p-[3px]">
+ {tabs.map(([key]) => (
+ <TabsPrimitive.Tab
+ key={key}
+ value={key}
className={cn(
- "absolute bottom-0 left-0 -z-1",
- "w-(--active-tab-width) translate-x-(--active-tab-left)",
- "h-0.5 rounded-none bg-foreground",
- "transition-[width,translate] duration-200 ease-out",
+ "flex h-[26px] cursor-pointer items-center justify-center gap-1.5 rounded-tile px-2 text-caption text-muted-foreground outline-none transition-colors duration-150",
+ "hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",
+ "data-active:bg-surface data-active:text-foreground data-active:shadow-[0_1px_2px_rgb(14_16_18/8%)]",
+ "dark:data-active:bg-secondary dark:data-active:shadow-[inset_0_1px_0_rgb(255_255_255/6%),0_0_0_1px_rgb(255_255_255/6%)]",
+ "max-md:relative max-md:h-[38px] max-md:flex-1 max-md:rounded-[9px] max-md:px-0 max-md:before:absolute max-md:before:-inset-y-[3px] max-md:before:inset-x-0 dark:max-md:data-active:bg-surface",
)}
- />
- </TabsPrimitive.List>
- </div>
+ >
+ {TAB_ICON[key]}
+ {key}
+ </TabsPrimitive.Tab>
+ ))}
+ </TabsPrimitive.List>
+ </div>
- {tabsFiltered.map(([key, value]) => (
- <TabsPrimitive.Panel key={key} value={key} className="outline-none">
+ <div className="flex h-14 shrink-0 items-center gap-3 rounded-control bg-surface pr-2.5 pl-[18px] max-md:h-[60px] max-md:gap-2 max-md:pr-2 max-md:pl-4 dark:bg-surface-sunken">
+ {tabs.map(([key, value]) => (
+ <TabsPrimitive.Panel
+ key={key}
+ value={key}
+ className="relative min-w-0 flex-1 outline-none"
+ >
<pre
- // biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable code must be keyboard-focusable
+ // biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable command must be keyboard-focusable
tabIndex={0}
- className="overflow-x-auto overscroll-x-contain p-4"
+ className={cn(
+ "no-scrollbar overflow-x-auto overscroll-x-contain py-3 pr-6 text-small text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring max-md:text-caption max-md:leading-5",
+ // The prompt is prose for an agent, not a shell command.
+ key === "prompt" ? "font-sans" : "font-mono",
+ )}
>
- <code
- data-slot="code-block"
- data-language="bash"
- className="font-mono text-sm leading-none text-muted-foreground"
- >
+ <code data-language="bash">
{key !== "prompt" && <span className="select-none">$ </span>}
{value}
</code>
</pre>
+ <span
+ aria-hidden="true"
+ className="pointer-events-none absolute inset-y-0 right-0 w-7 bg-linear-to-r from-transparent to-surface dark:to-surface-sunken"
+ />
</TabsPrimitive.Panel>
))}
- </TabsPrimitive.Root>
-
- <CopyButton
- value={activeCommand}
- className="absolute top-2 right-2 z-10"
- onCopy={() => {
- if (!component) return;
- trackEvent("install_command_copied", {
- component,
- package_manager: packageManager,
- surface: "docs",
- });
- }}
- />
- </div>
- );
-}
-
-function getIconForPackageManager(manager: PackageManager) {
- switch (manager) {
- case "prompt":
- return <TextAlignStartIcon />;
- case "pnpm":
- return (
- <svg viewBox="0 0 24 24" aria-hidden="true">
- <title>pnpm</title>
- <path
- d="M0 0v7.5h7.5V0zm8.25 0v7.5h7.498V0zm8.25 0v7.5H24V0zM8.25 8.25v7.5h7.498v-7.5zm8.25 0v7.5H24v-7.5zM0 16.5V24h7.5v-7.5zm8.25 0V24h7.498v-7.5zm8.25 0V24H24v-7.5z"
- fill="currentColor"
- />
- </svg>
- );
- case "yarn":
- return (
- <svg viewBox="0 0 24 24" aria-hidden="true">
- <title>yarn</title>
- <path
- d="M12 0C5.375 0 0 5.375 0 12s5.375 12 12 12 12-5.375 12-12S18.625 0 12 0zm.768 4.105c.183 0 .363.053.525.157.125.083.287.185.755 1.154.31-.088.468-.042.551-.019.204.056.366.19.463.375.477.917.542 2.553.334 3.605-.241 1.232-.755 2.029-1.131 2.576.324.329.778.899 1.117 1.825.278.774.31 1.478.273 2.015a5.51 5.51 0 0 0 .602-.329c.593-.366 1.487-.917 2.553-.931.714-.009 1.269.445 1.353 1.103a1.23 1.23 0 0 1-.945 1.362c-.649.158-.95.278-1.821.843-1.232.797-2.539 1.242-3.012 1.39a1.686 1.686 0 0 1-.704.343c-.737.181-3.266.315-3.466.315h-.046c-.783 0-1.214-.241-1.45-.491-.658.329-1.51.19-2.122-.134a1.078 1.078 0 0 1-.58-1.153 1.243 1.243 0 0 1-.153-.195c-.162-.25-.528-.936-.454-1.946.056-.723.556-1.367.88-1.71a5.522 5.522 0 0 1 .408-2.256c.306-.727.885-1.348 1.32-1.737-.32-.537-.644-1.367-.329-2.21.227-.602.412-.936.82-1.08h-.005c.199-.074.389-.153.486-.259a3.418 3.418 0 0 1 2.298-1.103c.037-.093.079-.185.125-.283.31-.658.639-1.029 1.024-1.168a.94.94 0 0 1 .328-.06z"
- fill="currentColor"
+ {activeKey === "prompt" ? (
+ <OpenInAgent prompt={activeCommand} component={component} />
+ ) : (
+ <CopyButton
+ value={activeCommand}
+ variant="ink"
+ onCopy={() => {
+ if (!component) return;
+ trackEvent("install_command_copied", {
+ component,
+ package_manager: activeKey,
+ surface: "docs",
+ });
+ }}
/>
- </svg>
- );
- case "npm":
- return (
- <svg viewBox="0 0 24 24" aria-hidden="true">
- <title>npm</title>
- <path
- d="M1.763 0C.786 0 0 .786 0 1.763v20.474C0 23.214.786 24 1.763 24h20.474c.977 0 1.763-.786 1.763-1.763V1.763C24 .786 23.214 0 22.237 0zM5.13 5.323l13.837.019-.009 13.836h-3.464l.01-10.382h-3.456L12.04 19.17H5.113z"
- fill="currentColor"
- />
- </svg>
- );
- case "bun":
- return (
- <svg viewBox="0 0 24 24" aria-hidden="true">
- <title>bun</title>
- <path
- d="M12 22.596c6.628 0 12-4.338 12-9.688 0-3.318-2.057-6.248-5.219-7.986-1.286-.715-2.297-1.357-3.139-1.89C14.058 2.025 13.08 1.404 12 1.404c-1.097 0-2.334.785-3.966 1.821a49.92 49.92 0 0 1-2.816 1.697C2.057 6.66 0 9.59 0 12.908c0 5.35 5.372 9.687 12 9.687v.001ZM10.599 4.715c.334-.759.503-1.58.498-2.409 0-.145.202-.187.23-.029.658 2.783-.902 4.162-2.057 4.624-.124.048-.199-.121-.103-.209a5.763 5.763 0 0 0 1.432-1.977Zm2.058-.102a5.82 5.82 0 0 0-.782-2.306v-.016c-.069-.123.086-.263.185-.172 1.962 2.111 1.307 4.067.556 5.051-.082.103-.23-.003-.189-.126a5.85 5.85 0 0 0 .23-2.431Zm1.776-.561a5.727 5.727 0 0 0-1.612-1.806v-.014c-.112-.085-.024-.274.114-.218 2.595 1.087 2.774 3.18 2.459 4.407a.116.116 0 0 1-.049.071.11.11 0 0 1-.153-.026.122.122 0 0 1-.022-.083 5.891 5.891 0 0 0-.737-2.331Zm-5.087.561c-.617.546-1.282.76-2.063 1-.117 0-.195-.078-.156-.181 1.752-.909 2.376-1.649 2.999-2.778 0 0 .155-.118.188.085 0 .304-.349 1.329-.968 1.874Zm4.945 11.237a2.957 2.957 0 0 1-.937 1.553c-.346.346-.8.565-1.286.62a2.178 2.178 0 0 1-1.327-.62 2.955 2.955 0 0 1-.925-1.553.244.244 0 0 1 .064-.198.234.234 0 0 1 .193-.069h3.965a.226.226 0 0 1 .19.07c.05.053.073.125.063.197Zm-5.458-2.176a1.862 1.862 0 0 1-2.384-.245 1.98 1.98 0 0 1-.233-2.447c.207-.319.503-.566.848-.713a1.84 1.84 0 0 1 1.092-.11c.366.075.703.261.967.531a1.98 1.98 0 0 1 .408 2.114 1.931 1.931 0 0 1-.698.869v.001Zm8.495.005a1.86 1.86 0 0 1-2.381-.253 1.964 1.964 0 0 1-.547-1.366c0-.384.11-.76.32-1.079.207-.319.503-.567.849-.713a1.844 1.844 0 0 1 1.093-.108c.367.076.704.262.968.534a1.98 1.98 0 0 1 .4 2.117 1.932 1.932 0 0 1-.702.868Z"
- fill="currentColor"
- />
- </svg>
- );
- default:
- return <TerminalIcon />;
- }
+ )}
+ </div>
+ </TabsPrimitive.Root>
+ );
}
diff --git a/components/docs/code-block.tsx b/components/docs/code-block.tsx
index 1d283fa0..4222d276 100644
--- a/components/docs/code-block.tsx
+++ b/components/docs/code-block.tsx
@@ -3,7 +3,7 @@
import { DynamicCodeBlock } from "fumadocs-ui/components/dynamic-codeblock";
import type { ComponentProps } from "react";
import type { ShikiTransformer } from "shiki";
-import { CopyButton } from "@/components/docs/copy-button";
+import { CODE_PRE, CodeFrame } from "@/components/docs/blocks/code-frame";
import { cn } from "@/lib/utils";
const transformers: ShikiTransformer[] = [
@@ -11,11 +11,6 @@ const transformers: ShikiTransformer[] = [
pre(node) {
node.properties.style = undefined;
},
- code(node) {
- if (this.source.split("\n").length > 1) {
- node.properties["data-line-numbers"] = "";
- }
- },
line(node) {
node.properties["data-line"] = "";
},
@@ -24,42 +19,39 @@ const transformers: ShikiTransformer[] = [
function Pre({ className, ...props }: ComponentProps<"pre">) {
return (
- <pre
- className={cn(
- "no-scrollbar min-w-0 overflow-x-auto px-4 py-3.5 outline-none has-data-line-numbers:px-0",
- className,
- )}
- {...props}
- />
+ // biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable code must be keyboard-focusable
+ <pre tabIndex={0} className={cn(CODE_PRE, className)} {...props} />
);
}
+/** Client-highlighted code (generated snippets) in the shared dark frame. */
export function CodeBlock({
code,
lang = "tsx",
className,
+ bodyClassName,
}: {
code: string;
lang?: string;
className?: string;
+ bodyClassName?: string;
}) {
return (
- <div data-rehype-pretty-code-figure="" className={className}>
- <CopyButton value={code} className="absolute top-3 right-2 z-10" />
+ <CodeFrame
+ lang={lang}
+ code={code}
+ className={className}
+ bodyClassName={bodyClassName}
+ >
<DynamicCodeBlock
lang={lang}
code={code}
options={{
- themes: {
- light: "github-light-default",
- dark: "vesper",
- },
+ themes: { light: "github-light-default", dark: "vesper" },
transformers,
- components: {
- pre: Pre,
- },
+ components: { pre: Pre },
}}
/>
- </div>
+ </CodeFrame>
);
}
diff --git a/components/docs/code-icons.tsx b/components/docs/code-icons.tsx
deleted file mode 100644
index 199e6e62..00000000
--- a/components/docs/code-icons.tsx
+++ /dev/null
@@ -1,45 +0,0 @@
-import { FileIcon } from "lucide-react";
-import type { ComponentProps } from "react";
-
-function TypeScriptIcon(props: ComponentProps<"svg">) {
- return (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 24 24"
- fill="currentColor"
- {...props}
- >
- <path d="M1.125 0C.502 0 0 .502 0 1.125v21.75C0 23.498.502 24 1.125 24h21.75c.623 0 1.125-.502 1.125-1.125V1.125C24 .502 23.498 0 22.875 0zm17.363 9.75c.612 0 1.154.037 1.627.111a6.38 6.38 0 0 1 1.306.34v2.458a3.95 3.95 0 0 0-.643-.361 5.093 5.093 0 0 0-.717-.26 5.453 5.453 0 0 0-1.426-.2c-.3 0-.573.028-.819.086a2.1 2.1 0 0 0-.623.242c-.17.104-.3.229-.393.374a.888.888 0 0 0-.14.49c0 .196.053.373.156.529.104.156.252.304.443.444s.423.276.696.41c.273.135.582.274.926.416.47.197.892.407 1.266.628.374.222.695.473.963.753.268.279.472.598.614.957.142.359.214.776.214 1.253 0 .657-.125 1.21-.373 1.656a3.033 3.033 0 0 1-1.012 1.085 4.38 4.38 0 0 1-1.487.596c-.566.12-1.163.18-1.79.18a9.916 9.916 0 0 1-1.84-.164 5.544 5.544 0 0 1-1.512-.493v-2.63a5.033 5.033 0 0 0 3.237 1.2c.333 0 .624-.03.872-.09.249-.06.456-.144.623-.25.166-.108.29-.234.373-.38a1.023 1.023 0 0 0-.074-1.089 2.12 2.12 0 0 0-.537-.5 5.597 5.597 0 0 0-.807-.444 27.72 27.72 0 0 0-1.007-.436c-.918-.383-1.602-.852-2.053-1.405-.45-.553-.676-1.222-.676-2.005 0-.614.123-1.141.369-1.582.246-.441.58-.804 1.004-1.089a4.494 4.494 0 0 1 1.47-.629 7.536 7.536 0 0 1 1.77-.201zm-15.113.188h9.563v2.166H9.506v9.646H6.789v-9.646H3.375z" />
- </svg>
- );
-}
-
-function BashIcon(props: ComponentProps<"svg">) {
- return (
- <svg
- xmlns="http://www.w3.org/2000/svg"
- viewBox="0 0 24 24"
- fill="currentColor"
- {...props}
- >
- <path d="M21.038 4.9 13.461.402a2.86 2.86 0 0 0-2.923.001L2.961 4.9A3.023 3.023 0 0 0 1.5 7.503v8.995c0 1.073.557 2.066 1.462 2.603l7.577 4.497a2.86 2.86 0 0 0 2.922 0l7.577-4.497a3.023 3.023 0 0 0 1.462-2.603V7.503A3.021 3.021 0 0 0 21.038 4.9zM15.17 18.946l.013.646c.001.078-.05.167-.111.198l-.383.22c-.061.031-.111-.007-.112-.085l-.007-.635c-.328.136-.66.169-.872.084-.04-.016-.057-.075-.041-.142l.139-.584a.24.24 0 0 1 .069-.121.163.163 0 0 1 .036-.026c.022-.011.043-.014.062-.006.229.077.521.041.802-.101.357-.181.596-.545.592-.907-.003-.328-.181-.465-.613-.468-.55.001-1.064-.107-1.072-.917-.007-.667.34-1.361.889-1.8l-.007-.652c-.001-.08.048-.168.111-.2l.37-.236c.061-.031.111.007.112.087l.006.653c.273-.109.511-.138.726-.088.047.012.067.076.048.151l-.144.578a.255.255 0 0 1-.065.116.161.161 0 0 1-.038.028.083.083 0 0 1-.057.009c-.098-.022-.332-.073-.699.113-.385.195-.52.53-.517.778.003.297.155.387.681.396.7.012 1.003.318 1.01 1.023.007.689-.362 1.433-.928 1.888zm3.973-1.087c0 .06-.008.116-.058.145l-1.916 1.164c-.05.029-.09.004-.09-.056v-.494c0-.06.037-.093.087-.122l1.887-1.129c.05-.029.09-.004.09.056v.436zm1.316-11.062-7.168 4.427c-.894.523-1.553 1.109-1.553 2.187v8.833c0 .645.26 1.063.66 1.184a2.304 2.304 0 0 1-.398.039c-.42 0-.833-.114-1.197-.33L3.226 18.64a2.494 2.494 0 0 1-1.201-2.142V7.503c0-.881.46-1.702 1.201-2.142L10.803.863a2.342 2.342 0 0 1 2.394 0l7.577 4.498a2.479 2.479 0 0 1 1.164 1.732c-.252-.536-.818-.682-1.479-.296z" />
- </svg>
- );
-}
-
-export function getIconForLanguage(language: string) {
- switch (language) {
- case "js":
- case "jsx":
- case "ts":
- case "tsx":
- case "typescript":
- return <TypeScriptIcon />;
- case "bash":
- case "sh":
- case "zsh":
- return <BashIcon />;
- default:
- return <FileIcon />;
- }
-}
diff --git a/components/docs/component-card-grid.tsx b/components/docs/component-card-grid.tsx
index 7d858131..9422d587 100644
--- a/components/docs/component-card-grid.tsx
+++ b/components/docs/component-card-grid.tsx
@@ -1,18 +1,35 @@
+import { cn } from "@/lib/utils";
import { ComponentCard } from "./component-card";
export interface CardItem {
name: string;
- description: string;
+ description?: string;
status: "stable" | "soon";
href?: string;
+ /** Registry name to preview; defaults to the last segment of `href`. */
+ component?: string;
+ isNew?: boolean;
}
-export function ComponentCardGrid({ items }: { items: CardItem[] }) {
+export function ComponentCardGrid({
+ items,
+ className,
+}: {
+ items: CardItem[];
+ className?: string;
+}) {
return (
- <div className="not-prose my-8 grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
+ <ul
+ className={cn(
+ "not-prose my-8 grid grid-cols-2 gap-2.5 sm:grid-cols-3 sm:gap-5",
+ className,
+ )}
+ >
{items.map((item) => (
- <ComponentCard key={item.name} item={item} />
+ <li key={item.href ?? item.name}>
+ <ComponentCard item={item} />
+ </li>
))}
- </div>
+ </ul>
);
}
diff --git a/components/docs/component-card.tsx b/components/docs/component-card.tsx
index bb0abe08..af5280bd 100644
--- a/components/docs/component-card.tsx
+++ b/components/docs/component-card.tsx
@@ -1,53 +1,222 @@
"use client";
import { Player, type PlayerRef } from "@remotion/player";
+import { useIntersectionObserver } from "@uidotdev/usehooks";
import Link from "next/link";
-import { useRef } from "react";
+import { useEffect, useRef, useState } from "react";
import { useAutoplay } from "@/app/(home)/components/use-autoplay";
+import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
import { cn } from "@/lib/utils";
import registry from "@/registry/__index__";
import { previewManifest } from "@/registry/__manifest__";
import type { CardItem } from "./component-card-grid";
+/** How much of the thumbnail the zoomed content may take, and the cap. */
+const FIT_WIDTH = 0.8;
+const FIT_HEIGHT = 0.72;
+const MAX_ZOOM = 3.5;
+/** Points of the animation (0..1) whose drawn content the zoom must fit. */
+const SAMPLE_AT = [0.3, 0.5, 0.7, 0.9];
+/** Where a card rests when the reader prefers reduced motion. */
+const STILL_AT = 0.7;
+
+/**
+ * Bounds of what's actually drawn inside a player: visible text and graphics,
+ * skipping anything that covers the whole frame (scene backgrounds).
+ */
+function contentBounds(root: HTMLElement): DOMRect | null {
+ const frame = root.getBoundingClientRect();
+ let left = Number.POSITIVE_INFINITY;
+ let top = Number.POSITIVE_INFINITY;
+ let right = Number.NEGATIVE_INFINITY;
+ let bottom = Number.NEGATIVE_INFINITY;
+ const add = (rect: DOMRect) => {
+ if (rect.width < 1 || rect.height < 1) return;
+ if (rect.width > frame.width * 0.92 && rect.height > frame.height * 0.92)
+ return;
+ left = Math.min(left, rect.left);
+ top = Math.min(top, rect.top);
+ right = Math.max(right, rect.right);
+ bottom = Math.max(bottom, rect.bottom);
+ };
+ const visible = (el: Element) =>
+ !("checkVisibility" in el) ||
+ el.checkVisibility({ opacityProperty: true, visibilityProperty: true });
+
+ const walker = document.createTreeWalker(root, NodeFilter.SHOW_TEXT);
+ const range = document.createRange();
+ for (let node = walker.nextNode(); node; node = walker.nextNode()) {
+ if (!node.textContent?.trim() || !node.parentElement) continue;
+ if (!visible(node.parentElement)) continue;
+ range.selectNodeContents(node);
+ add(range.getBoundingClientRect());
+ }
+ for (const el of root.querySelectorAll("svg, img, canvas, video")) {
+ if (el.closest("svg") !== el && el.tagName !== "svg" && el.closest("svg"))
+ continue;
+ if (visible(el)) add(el.getBoundingClientRect());
+ }
+ if (!Number.isFinite(left)) return null;
+ return new DOMRect(left, top, right - left, bottom - top);
+}
+
function slugFromHref(href?: string) {
if (!href) return undefined;
return href.split("/").filter(Boolean).pop();
}
-function PreviewPlaceholder() {
- return <div className="size-full bg-muted/40" />;
-}
-
-function CardPreview({ item }: { item: CardItem }) {
- const slug = slugFromHref(item.href);
- const entry = slug ? registry[slug] : undefined;
- const preview = slug ? previewManifest[slug] : undefined;
+/**
+ * Live preview, cover-cropped into the card's thumbnail. The Player mounts the
+ * first time the card nears the viewport (a category index has dozens of
+ * them) and only plays while it stays there. With reduced motion it holds a
+ * still frame instead.
+ */
+function CardPreview({ name }: { name?: string }) {
+ const entry = name ? registry[name] : undefined;
+ const preview = name ? previewManifest[name] : undefined;
const playerRef = useRef<PlayerRef>(null);
+ const reducedMotion = usePrefersReducedMotion();
+ const { containerRef } = useAutoplay(playerRef, !reducedMotion);
+ const [mountRef, intersection] = useIntersectionObserver({
+ threshold: 0,
+ root: null,
+ rootMargin: "400px",
+ });
+ const [mounted, setMounted] = useState(false);
+ const zoomRef = useRef<HTMLDivElement>(null);
+ const fit = preview?.card?.fit !== false;
+ // Measuring seeks through the clip at its unzoomed size; a veil in the
+ // tile colour hides that and lifts once the zoom is set.
+ const [fitted, setFitted] = useState(false);
- const { containerRef } = useAutoplay(playerRef);
+ useEffect(() => {
+ if (intersection?.isIntersecting) setMounted(true);
+ }, [intersection]);
- if (!entry || !preview) {
- return (
- <div className="size-full">
- <PreviewPlaceholder />
- </div>
+ useEffect(() => {
+ if (!mounted || !reducedMotion || !preview) return;
+ const player = playerRef.current;
+ player?.pause();
+ player?.seekTo(Math.round((preview.durationInFrames - 1) * STILL_AT));
+ }, [mounted, reducedMotion, preview]);
+
+ // Zoom the drawn content to fill the tile: the compositions are laid out
+ // for a 1280×720 frame, so text would otherwise be a few pixels tall here.
+ // Measured once, as the union over a few frames of the animation so a
+ // word that grows or slides later isn't cropped.
+ useEffect(() => {
+ if (!mounted || !fit || !preview) return;
+ const frames = SAMPLE_AT.map((at) =>
+ Math.round((preview.durationInFrames - 1) * at),
);
- }
+ let cancelled = false;
+ let tries = 0;
+ const nextFrame = () =>
+ new Promise<void>((resolve) =>
+ requestAnimationFrame(() => requestAnimationFrame(() => resolve())),
+ );
+ const measure = async () => {
+ const player = playerRef.current;
+ const zoomBox = zoomRef.current;
+ const root = player?.getContainerNode();
+ const tile = zoomBox?.parentElement?.parentElement;
+ if (cancelled || !player || !zoomBox || !root || !tile) return;
+ let union: DOMRect | null = null;
+ for (const frame of frames) {
+ player.seekTo(frame);
+ await nextFrame();
+ if (cancelled) return;
+ const rect = contentBounds(root);
+ if (!rect) continue;
+ union = union
+ ? new DOMRect(
+ Math.min(union.left, rect.left),
+ Math.min(union.top, rect.top),
+ Math.max(union.right, rect.right) -
+ Math.min(union.left, rect.left),
+ Math.max(union.bottom, rect.bottom) -
+ Math.min(union.top, rect.top),
+ )
+ : rect;
+ }
+ player.seekTo(
+ reducedMotion
+ ? Math.round((preview.durationInFrames - 1) * STILL_AT)
+ : 0,
+ );
+ if (!union) {
+ if (++tries < 20) window.setTimeout(measure, 150);
+ else setFitted(true);
+ return;
+ }
+ const box = tile.getBoundingClientRect();
+ const zoom = Math.min(
+ MAX_ZOOM,
+ (box.width * FIT_WIDTH) / union.width,
+ (box.height * FIT_HEIGHT) / union.height,
+ );
+ setFitted(true);
+ if (zoom < 1.1) return;
+ const own = zoomBox.getBoundingClientRect();
+ const cx = union.left + union.width / 2;
+ const cy = union.top + union.height / 2;
+ zoomBox.style.transformOrigin = `${cx - own.left}px ${cy - own.top}px`;
+ zoomBox.style.transform = `translate(${box.left + box.width / 2 - cx}px, ${box.top + box.height / 2 - cy}px) scale(${zoom})`;
+ };
+ const start = window.setTimeout(measure, 300);
+ return () => {
+ cancelled = true;
+ window.clearTimeout(start);
+ };
+ }, [mounted, fit, preview, reducedMotion]);
+
+ if (!entry || !preview) return null;
+ const cardProps = { ...preview.defaults, ...preview.card?.props };
+ const backdrop =
+ preview.card?.backdrop && preview.previewBackdrop?.type === "color"
+ ? preview.previewBackdrop.value
+ : undefined;
return (
- <div ref={containerRef} className="size-full">
- <Player
- ref={playerRef}
- lazyComponent={entry.load}
- inputProps={preview.defaults}
- durationInFrames={preview.durationInFrames}
- fps={preview.fps}
- compositionWidth={preview.compositionWidth}
- compositionHeight={preview.compositionHeight}
- style={{ width: "100%", height: "100%", backgroundColor: "#f5f5f5" }}
- controls={false}
- loop
- acknowledgeRemotionLicense
+ <div
+ ref={mountRef}
+ className="absolute inset-0 bg-[#f4f4f5]"
+ style={backdrop ? { background: backdrop } : undefined}
+ >
+ {mounted && (
+ <div
+ ref={containerRef}
+ className="absolute top-0 left-1/2 h-full min-w-full -translate-x-1/2"
+ style={{
+ aspectRatio: `${preview.compositionWidth} / ${preview.compositionHeight}`,
+ }}
+ >
+ <div ref={zoomRef} className="size-full">
+ <Player
+ ref={playerRef}
+ lazyComponent={entry.load}
+ inputProps={cardProps}
+ durationInFrames={preview.durationInFrames}
+ fps={preview.fps}
+ compositionWidth={preview.compositionWidth}
+ compositionHeight={preview.compositionHeight}
+ style={{ width: "100%", height: "100%" }}
+ controls={false}
+ clickToPlay={false}
+ loop
+ initiallyMuted
+ numberOfSharedAudioTags={0}
+ acknowledgeRemotionLicense
+ />
+ </div>
+ </div>
+ )}
+ <span
+ aria-hidden="true"
+ className={cn(
+ "pointer-events-none absolute inset-0 bg-inherit transition-opacity duration-200 ease-[ease]",
+ (!fit || fitted) && "opacity-0",
+ )}
/>
</div>
);
@@ -56,34 +225,49 @@ function CardPreview({ item }: { item: CardItem }) {
function CardBody({ item }: { item: CardItem }) {
return (
<>
- <div className="surface-card aspect-video w-full overflow-hidden rounded-xl transition-[transform,box-shadow] group-hover/card:-translate-y-0.5 group-hover/card:[box-shadow:var(--elevation-raised-hover)] group-focus-visible/card:-translate-y-0.5 group-focus-visible/card:[box-shadow:var(--elevation-raised-hover)]">
- <CardPreview item={item} />
- </div>
- <div className="flex items-center justify-between gap-2">
- <h3 className="text-sm font-medium tracking-tight text-foreground">
- {item.name}
- </h3>
- {item.status === "soon" && (
- <span className="rounded bg-foreground/5 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wider text-foreground/60">
- Soon
+ <span
+ aria-hidden="true"
+ className="relative block h-[104px] shrink-0 overflow-hidden rounded-[13px] bg-[#f4f4f5] sm:h-[140px] sm:rounded-control"
+ >
+ <CardPreview name={item.component ?? slugFromHref(item.href)} />
+ </span>
+ <span className="flex flex-col gap-1 px-[7px] pt-2.5 sm:gap-1.5 sm:px-2 sm:pt-3">
+ <span className="flex items-center justify-between gap-2">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {item.name}
</span>
- )}
- </div>
- <p className="text-sm leading-relaxed text-muted-foreground">
- {item.description}
- </p>
+ {item.status === "soon" ? (
+ <span className="shrink-0 rounded-tag bg-surface-muted px-1.5 py-0.5 text-micro leading-[14px] font-medium text-muted-foreground">
+ Soon
+ </span>
+ ) : (
+ item.isNew && (
+ <span className="shrink-0 rounded-tag bg-primary-tint px-1.5 py-0.5 text-micro leading-[14px] font-medium text-primary-strong dark:text-primary-soft">
+ New
+ </span>
+ )
+ )}
+ </span>
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {item.description}
+ </span>
+ </span>
</>
);
}
+const card =
+ "group/card flex h-full flex-col rounded-capsule bg-surface px-[5px] pt-[5px] pb-3.5 shadow-[0_0_0_1px_var(--color-hairline)] sm:rounded-card sm:p-1.5 sm:pb-4";
+
+/** Component tile of the category indexes: live preview, title, one-liner. */
export function ComponentCard({ item }: { item: CardItem }) {
if (item.status === "stable" && item.href) {
return (
<Link
href={item.href}
className={cn(
- "group/card flex h-full flex-col gap-2 rounded-2xl outline-none",
- "focus-visible:ring-2 focus-visible:ring-ring/40",
+ card,
+ "outline-none transition-shadow duration-150 hover:shadow-[0_0_0_1px_var(--color-divider)] focus-visible:ring-3 focus-visible:ring-ring",
)}
>
<CardBody item={item} />
@@ -92,7 +276,7 @@ export function ComponentCard({ item }: { item: CardItem }) {
}
return (
- <div className="group/card flex h-full flex-col gap-2 rounded-2xl opacity-60">
+ <div className={cn(card, "opacity-60")}>
<CardBody item={item} />
</div>
);
diff --git a/components/docs/component-customizer.tsx b/components/docs/component-customizer.tsx
index 4dbee56e..c4a3b3f4 100644
--- a/components/docs/component-customizer.tsx
+++ b/components/docs/component-customizer.tsx
@@ -1,107 +1,71 @@
"use client";
-import { Select as SelectPrimitive } from "@base-ui/react/select";
-import { ChevronDownIcon } from "lucide-react";
-import { ElasticSlider } from "@/components/ui/elastic-slider";
-import { Label } from "@/components/ui/label";
-import {
- NumberField,
- NumberFieldInput,
- NumberFieldScrubArea,
-} from "@/components/ui/number-field";
-import { SelectContent, SelectItem } from "@/components/ui/select";
-import { Switch } from "@/components/ui/switch";
+import { type CSSProperties, useState, useSyncExternalStore } from "react";
import type { ControlConfig, ControlType } from "@/lib/customizer-config";
import { cn } from "@/lib/utils";
+import { BooleanControl } from "./blocks/controls/boolean-control";
+import { ColorControl } from "./blocks/controls/color-control";
+import { NumberControl } from "./blocks/controls/number-control";
+import { SelectControl } from "./blocks/controls/select-control";
+import { SliderControl } from "./blocks/controls/slider-control";
+import { LONG_TEXT, TextControl } from "./blocks/controls/text-control";
-/** Shared pill surface so every non-slider control matches the elastic slider. */
-const PILL =
- "flex h-9 items-center gap-3 rounded-xl control-surface px-3 text-sm transition-colors";
+type Group = { id: "content" | "timing" | "style"; title: string };
-/** Strip trailing zeros so the value reads like the reference (1, 0.8, 0.1). */
-function formatNumber(v: number) {
- return String(v);
+const GROUPS: Group[] = [
+ { id: "content", title: "Content" },
+ { id: "timing", title: "Timing" },
+ { id: "style", title: "Style" },
+];
+
+/** Keys or labels that describe when and how fast things move. */
+const TIMING =
+ /speed|frame|duration|delay|interval|accelerat|stagger|hold|loop|timing|tempo|\(ms\)|seconds|fps|pause/i;
+
+function groupOf(key: string, ctrl: ControlType): Group["id"] {
+ if (ctrl.type === "text") return "content";
+ if (TIMING.test(key) || TIMING.test(ctrl.label)) return "timing";
+ return "style";
}
-function SelectPill({
- id,
- ctrl,
- value,
- onChange,
-}: {
- id: string;
- ctrl: Extract<ControlType, { type: "select" }>;
- value: string;
- onChange: (value: string) => void;
-}) {
- return (
- <SelectPrimitive.Root
- value={value}
- // base-ui types the value as `string | null` (null on deselect); the
- // customizer never deselects, but guard it so a null can't leak out.
- onValueChange={(v) => {
- if (v !== null) onChange(v as string);
- }}
- >
- <SelectPrimitive.Trigger
- id={id}
- className={cn(
- PILL,
- "control-surface-interactive w-full justify-between outline-none hover:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring/40",
- )}
- >
- <span className="font-medium text-muted-foreground">{ctrl.label}</span>
- <span className="flex items-center gap-1 font-medium text-foreground">
- <SelectPrimitive.Value />
- {/* Raw primitive instead of the SelectTrigger wrapper so the chevron
- sits beside the value inside our custom pill layout. */}
- <SelectPrimitive.Icon
- render={
- <ChevronDownIcon className="size-4 text-muted-foreground" />
- }
- />
- </span>
- </SelectPrimitive.Trigger>
- <SelectContent alignItemWithTrigger={false}>
- {ctrl.options.map((opt) => (
- <SelectItem key={opt} value={opt}>
- {opt}
- </SelectItem>
- ))}
- </SelectContent>
- </SelectPrimitive.Root>
- );
+const isLong = (ctrl: ControlType) =>
+ ctrl.type === "text" && ctrl.default.length > LONG_TEXT;
+
+/**
+ * Flex slot per control. Short copy is sized to its label and value so it
+ * never truncates, word lists take the slack, transcripts get their own row.
+ */
+function slot(ctrl: ControlType): {
+ className?: string;
+ style?: CSSProperties;
+} {
+ if (isLong(ctrl)) return { className: "basis-full" };
+ if (ctrl.type === "text" && ctrl.default.length > 40) {
+ return { className: "flex-[3_1_260px]" };
+ }
+ if (ctrl.type === "text") {
+ const width = (ctrl.label.length + ctrl.default.length) * 7 + 40;
+ return { style: { flex: `1 1 ${width}px` } };
+ }
+ if (ctrl.type === "select") {
+ const longest = Math.max(...ctrl.options.map((option) => option.length));
+ const width = (ctrl.label.length + longest) * 7.5 + 64;
+ return { style: { flex: `1 1 ${Math.max(width, 160)}px` } };
+ }
+ return { className: "flex-[1_1_160px]" };
}
-function NumberInputPill({
- id,
- ctrl,
- value,
- onChange,
-}: {
- id: string;
- ctrl: Extract<ControlType, { type: "number-input" }>;
- value: number;
- onChange: (value: number) => void;
-}) {
- return (
- <NumberField
- id={id}
- value={value}
- onValueChange={(v) => {
- if (v !== null) onChange(v);
- }}
- min={ctrl.min}
- max={ctrl.max}
- step={ctrl.step}
- className={cn(PILL, "flex-row justify-between")}
- >
- <NumberFieldScrubArea
- label={ctrl.label}
- className="shrink-0 text-muted-foreground"
- />
- <NumberFieldInput className="h-auto min-w-0 flex-1 rounded-none px-0 text-right font-mono text-base font-medium leading-none text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/40 sm:h-auto sm:text-sm" />
- </NumberField>
+/** Phones collapse every group but the first until the reader opens one. */
+const PHONE = "(max-width: 767px)";
+function usePhone() {
+ return useSyncExternalStore(
+ (notify) => {
+ const query = window.matchMedia(PHONE);
+ query.addEventListener("change", notify);
+ return () => query.removeEventListener("change", notify);
+ },
+ () => window.matchMedia(PHONE).matches,
+ () => false,
);
}
@@ -119,103 +83,65 @@ function Control({
switch (ctrl.type) {
case "number":
return (
- <ElasticSlider
+ <SliderControl
label={ctrl.label}
value={value as number}
- onValueChange={onChange}
min={ctrl.min}
max={ctrl.max}
step={ctrl.step}
- formatValue={formatNumber}
+ onChange={onChange}
/>
);
-
case "number-input":
return (
- <NumberInputPill
+ <NumberControl
id={id}
- ctrl={ctrl}
+ label={ctrl.label}
value={value as number}
+ min={ctrl.min}
+ max={ctrl.max}
+ step={ctrl.step}
onChange={onChange}
/>
);
-
case "select":
return (
- <SelectPill
+ <SelectControl
id={id}
- ctrl={ctrl}
+ label={ctrl.label}
value={value as string}
+ options={ctrl.options}
onChange={onChange}
/>
);
-
case "boolean":
return (
- <label
- htmlFor={id}
- className={cn(
- PILL,
- "control-surface-interactive cursor-pointer justify-between",
- )}
- >
- <span className="font-medium text-muted-foreground">
- {ctrl.label}
- </span>
- <Switch
- id={id}
- checked={value as boolean}
- onCheckedChange={onChange}
- />
- </label>
+ <BooleanControl
+ id={id}
+ label={ctrl.label}
+ value={value as boolean}
+ onChange={onChange}
+ />
);
-
case "color":
return (
- <div className={cn(PILL, "justify-between")}>
- <Label htmlFor={id} className="font-medium text-muted-foreground">
- {ctrl.label}
- </Label>
- {/* The native input fills the swatch box, so it is directly
- clickable — no wrapping <label> (which would double-label it). */}
- <span className="flex items-center gap-2">
- <span className="font-mono text-sm font-medium uppercase text-foreground">
- {value as string}
- </span>
- <span className="relative inline-flex size-5 shrink-0 overflow-hidden rounded-lg border border-border/60">
- <input
- id={id}
- type="color"
- value={value as string}
- onChange={(e) => onChange(e.target.value)}
- className="absolute top-1/2 left-1/2 size-[200%] -translate-x-1/2 -translate-y-1/2 cursor-pointer border-0 bg-transparent p-0"
- />
- </span>
- </span>
- </div>
+ <ColorControl
+ id={id}
+ label={ctrl.label}
+ value={value as string}
+ onChange={onChange}
+ />
);
-
case "text":
return (
- <div className={PILL}>
- <Label
- htmlFor={id}
- className="shrink-0 font-medium text-muted-foreground"
- >
- {ctrl.label}
- </Label>
- <input
- id={id}
- type="text"
- spellCheck={false}
- autoComplete="off"
- value={value as string}
- onChange={(e) => onChange(e.target.value)}
- className="min-w-0 flex-1 bg-transparent text-right font-mono text-base font-medium text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/40 placeholder:text-muted-foreground/50 sm:text-sm"
- />
- </div>
+ <TextControl
+ id={id}
+ label={ctrl.label}
+ value={value as string}
+ long={isLong(ctrl)}
+ onChange={onChange}
+ />
);
-
default: {
// Compile-time exhaustiveness: adding a new ControlType errors here.
const _exhaustive: never = ctrl;
@@ -225,6 +151,34 @@ function Control({
}
}
+function GroupChevron({ open, auto }: { open: boolean; auto: boolean }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn(
+ "size-3 shrink-0 text-white/40 transition-transform duration-150 max-md:size-3.5",
+ !open && "-rotate-90",
+ auto && "max-md:-rotate-90",
+ )}
+ >
+ <path
+ d="M6 9l6 6 6-6"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2.5"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+/**
+ * Every prop the preview honours, grouped by intent (content, timing, style)
+ * into collapsible sections. Controls flow three to a row on desktop and
+ * stack on phones; long text takes a full row.
+ */
export function ComponentCustomizer({
controls,
values,
@@ -234,17 +188,74 @@ export function ComponentCustomizer({
values: Record<string, unknown>;
onChange: (key: string, value: unknown) => void;
}) {
+ const phone = usePhone();
+ const [open, setOpen] = useState<Partial<Record<Group["id"], boolean>>>({});
+
+ const groups = GROUPS.map((group) => ({
+ ...group,
+ entries: Object.entries(controls).filter(
+ ([key, ctrl]) => groupOf(key, ctrl) === group.id,
+ ),
+ })).filter((group) => group.entries.length > 0);
+
return (
- <div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-3">
- {Object.entries(controls).map(([key, ctrl]) => (
- <Control
- key={key}
- id={`ctrl-${key}`}
- ctrl={ctrl}
- value={values[key]}
- onChange={(value) => onChange(key, value)}
- />
- ))}
+ <div className="flex flex-col">
+ {groups.map((group, index) => {
+ const chosen = open[group.id];
+ // Undecided groups follow the layout: open on desktop, first-only on phones.
+ const autoCollapsed = chosen === undefined && index > 0;
+ const expanded = chosen ?? !(phone && index > 0);
+ const panelId = `customize-${group.id}`;
+ return (
+ <section
+ key={group.id}
+ aria-label={group.title}
+ className={cn(
+ "flex flex-col pb-2 max-md:gap-1.5",
+ index > 0 && "border-t border-white/6",
+ )}
+ >
+ <button
+ type="button"
+ aria-expanded={expanded}
+ aria-controls={panelId}
+ onClick={() =>
+ setOpen((prev) => ({ ...prev, [group.id]: !expanded }))
+ }
+ className="flex h-9 shrink-0 cursor-pointer items-center justify-between rounded-tile px-0.5 text-caption leading-[17px] font-semibold text-white/70 outline-none hover:text-[#fafafa] focus-visible:ring-2 focus-visible:ring-white/40 max-md:h-11 max-md:px-1.5 max-md:text-small max-md:leading-[18px]"
+ >
+ {group.title}
+ <GroupChevron open={chosen ?? true} auto={autoCollapsed} />
+ </button>
+ <div
+ id={panelId}
+ className={cn(
+ "flex flex-wrap gap-1.5",
+ chosen === false && "hidden",
+ autoCollapsed && "max-md:hidden",
+ )}
+ >
+ {group.entries.map(([key, ctrl]) => {
+ const { className, style } = slot(ctrl);
+ return (
+ <div
+ key={key}
+ style={style}
+ className={cn("min-w-0 max-md:basis-full!", className)}
+ >
+ <Control
+ id={`ctrl-${key}`}
+ ctrl={ctrl}
+ value={values[key]}
+ onChange={(value) => onChange(key, value)}
+ />
+ </div>
+ );
+ })}
+ </div>
+ </section>
+ );
+ })}
</div>
);
}
diff --git a/components/docs/component-example.tsx b/components/docs/component-example.tsx
index 35055f38..f82a45d4 100644
--- a/components/docs/component-example.tsx
+++ b/components/docs/component-example.tsx
@@ -1,38 +1,29 @@
"use client";
-import { Suspense } from "react";
-import { PreviewStage } from "@/lib/ui-preview-internals";
+import { DocsPlayer } from "./blocks/player/docs-player";
+import { UnknownBlock } from "./blocks/player/player-fallback";
+import { BLOCK_SPACING } from "./blocks/spacing";
import { examples } from "./examples";
+const NO_PROPS = {};
+/** A fixed recipe scene in the docs player, without toolbar or customizer. */
export function ComponentExample({ name }: { name: string }) {
const entry = examples[`${name}-example`];
-
- if (!entry) {
- return (
- <div className="not-prose mb-6 rounded-lg border border-fd-border p-4 text-sm text-fd-muted-foreground">
- Unknown example: <code>{name}</code>
- </div>
- );
- }
+ if (!entry) return <UnknownBlock kind="example" name={name} />;
return (
- <Suspense
- fallback={
- <div className="not-prose mb-6 aspect-[1.9/1] w-full animate-pulse rounded-2xl bg-muted" />
- }
- >
- <div className="not-prose mb-6">
- <PreviewStage
- name={`${name}-example`}
- Component={entry.Component}
- inputProps={{}}
- durationInFrames={entry.durationInFrames}
- fps={entry.fps}
- compositionWidth={entry.width}
- compositionHeight={entry.height}
- previewBackdrop={entry.previewBackdrop}
- />
- </div>
- </Suspense>
+ <DocsPlayer
+ name={`${name}-example`}
+ className={BLOCK_SPACING}
+ composition={{
+ Component: entry.Component,
+ inputProps: NO_PROPS,
+ durationInFrames: entry.durationInFrames,
+ fps: entry.fps,
+ compositionWidth: entry.width,
+ compositionHeight: entry.height,
+ previewBackdrop: entry.previewBackdrop,
+ }}
+ />
);
}
diff --git a/components/docs/component-preview.tsx b/components/docs/component-preview.tsx
index 8b1f5cc4..a33e3c05 100644
--- a/components/docs/component-preview.tsx
+++ b/components/docs/component-preview.tsx
@@ -1,26 +1,15 @@
"use client";
import type { StudioElementPayload } from "@remotion/studio-protocol";
-import { CheckIcon, LinkIcon, RotateCcwIcon } from "lucide-react";
-import { useQueryStates } from "nuqs";
-import { Suspense, use, useEffect, useMemo, useRef, useState } from "react";
-import { CodeBlock } from "@/components/docs/code-block";
-import { Button } from "@/components/ui/button";
-import {
- Frame,
- FrameHeader,
- FramePanel,
- FrameTitle,
-} from "@/components/ui/frame";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { useTrackEvent } from "@/lib/analytics";
-import {
- getDefaults,
- type ResolvedComponentConfig,
-} from "@/lib/customizer-config";
-import { buildParsers, PreviewStage } from "@/lib/ui-preview-internals";
+import { Suspense, use, useMemo } from "react";
+import type { ResolvedComponentConfig } from "@/lib/customizer-config";
+import { cn } from "@/lib/utils";
import registry, { loadComponentConfig } from "@/registry/__index__";
-import { ComponentCustomizer } from "./component-customizer";
+import { CustomizePanel } from "./blocks/customize-panel";
+import { DocsPlayer } from "./blocks/player/docs-player";
+import { PlayerFallback, UnknownBlock } from "./blocks/player/player-fallback";
+import { BLOCK_SPACING } from "./blocks/spacing";
+import { useCustomizer } from "./blocks/use-customizer";
import { StudioActions } from "./studio-actions";
export function ComponentPreview({
@@ -31,23 +20,14 @@ export function ComponentPreview({
studioElement?: StudioElementPayload;
}) {
const entry = registry[name];
-
- if (!entry) {
- return (
- <div className="not-prose mb-6 rounded-lg border border-fd-border p-4 text-sm text-fd-muted-foreground">
- Unknown component: <code>{name}</code>
- </div>
- );
- }
+ if (!entry) return <UnknownBlock kind="component" name={name} />;
return (
- <Suspense
- fallback={
- <div className="not-prose mb-6 aspect-[1.9/1] w-full animate-pulse rounded-2xl bg-muted" />
- }
- >
- <Preview name={name} load={entry.load} studioElement={studioElement} />
- </Suspense>
+ <div className={cn("not-prose", BLOCK_SPACING)}>
+ <Suspense fallback={<PlayerFallback />}>
+ <Preview name={name} load={entry.load} studioElement={studioElement} />
+ </Suspense>
+ </div>
);
}
@@ -64,147 +44,44 @@ function Preview({
// Suspends until this component's config chunk resolves, then returns
// synchronously from the cached promise. No other config is fetched.
const config = use(loadComponentConfig(name));
- const trackEvent = useTrackEvent();
- const { parsers, urlKeys } = useMemo(
- () => buildParsers(name, config.controls),
- [name, config.controls],
- );
- const defaults = useMemo(
- () => getDefaults(config.controls),
- [config.controls],
+ const { values, isDefault, change, reset } = useCustomizer(
+ name,
+ config.controls,
);
-
- const [values, setValues] = useQueryStates(parsers, {
- urlKeys,
- clearOnDefault: true,
- shallow: true,
- });
-
- const isDefault = useMemo(
- () => Object.entries(defaults).every(([k, v]) => values[k] === v),
- [defaults, values],
- );
-
const code = useMemo(() => generateCode(config, values), [config, values]);
- const [copied, setCopied] = useState(false);
- const handleCopyLink = () => {
- if (typeof window === "undefined") return;
- navigator.clipboard.writeText(window.location.href);
- setCopied(true);
- trackEvent("customized_link_shared", { component: name });
- setTimeout(() => setCopied(false), 1500);
- };
-
- const handleReset = () => {
- setValues(null);
- trackEvent("customizer_reset", { component: name });
- };
-
- useEffect(() => {
- trackEvent("docs_component_viewed", { component: name });
- }, [name, trackEvent]);
-
- const customizeTimers = useRef<Map<string, ReturnType<typeof setTimeout>>>(
- new Map(),
- );
- useEffect(() => {
- const timers = customizeTimers.current;
- return () => {
- for (const timer of timers.values()) clearTimeout(timer);
- timers.clear();
- };
- }, []);
- const handleCustomizeChange = (key: string, value: unknown) => {
- setValues((prev) => ({ ...prev, [key]: value }));
- const existing = customizeTimers.current.get(key);
- if (existing) clearTimeout(existing);
- customizeTimers.current.set(
- key,
- setTimeout(() => {
- trackEvent("component_customized", { component: name, prop: key });
- customizeTimers.current.delete(key);
- }, 500),
- );
- };
-
return (
- <div className="not-prose mb-6 flex w-full flex-col gap-4">
- <Frame>
- <Tabs defaultValue="preview" className="gap-0">
- <FrameHeader className="flex-row items-center justify-between gap-3 px-2 py-2">
- <TabsList>
- <TabsTrigger value="preview">Preview</TabsTrigger>
- <TabsTrigger value="code">Code</TabsTrigger>
- </TabsList>
- {studioElement ? (
- <StudioActions name={name} payload={studioElement} />
- ) : null}
- </FrameHeader>
- <FramePanel className="overflow-hidden p-0">
- <TabsContent value="preview" className="mt-0">
- <PreviewStage
- name={name}
- load={load}
- inputProps={values}
- durationInFrames={
- config.getDurationInFrames?.(values) ??
- config.durationInFrames
- }
- fps={config.fps}
- compositionWidth={config.compositionWidth}
- compositionHeight={config.compositionHeight}
- previewBackdrop={config.previewBackdrop}
- className="rounded-none"
- />
- </TabsContent>
- <TabsContent value="code" className="mt-0">
- <CodeBlock code={code} />
- </TabsContent>
- </FramePanel>
- </Tabs>
- </Frame>
-
- <Frame className="mt-2">
- <FrameHeader className="flex-row items-center justify-between px-3 py-2">
- <FrameTitle>Customize</FrameTitle>
- <div className="flex items-center gap-1">
- <Button
- variant="outline"
- size="icon-sm"
- onClick={handleCopyLink}
- aria-label="Copy share link"
- title="Copy share link"
- className="relative text-muted-foreground before:absolute before:-inset-x-0.5 before:-inset-y-1.5 before:content-[''] hover:text-foreground"
- >
- {copied ? (
- <CheckIcon className="size-3.5" />
- ) : (
- <LinkIcon className="size-3.5" />
- )}
- </Button>
- <Button
- variant="outline"
- size="icon-sm"
- onClick={handleReset}
- disabled={isDefault}
- aria-label="Reset to defaults"
- title="Reset to defaults"
- className="relative text-muted-foreground before:absolute before:-inset-x-0.5 before:-inset-y-1.5 before:content-[''] hover:text-foreground disabled:opacity-40"
- >
- <RotateCcwIcon className="size-3.5" />
- </Button>
- </div>
- </FrameHeader>
- <FramePanel className="p-3">
- <ComponentCustomizer
- controls={config.controls}
- values={values as Record<string, unknown>}
- onChange={handleCustomizeChange}
- />
- </FramePanel>
- </Frame>
- </div>
+ <DocsPlayer
+ name={name}
+ code={code}
+ actions={
+ studioElement ? (
+ <StudioActions name={name} payload={studioElement} />
+ ) : null
+ }
+ composition={{
+ load,
+ inputProps: values,
+ durationInFrames:
+ config.getDurationInFrames?.(values) ?? config.durationInFrames,
+ fps: config.fps,
+ compositionWidth: config.compositionWidth,
+ compositionHeight: config.compositionHeight,
+ previewBackdrop: config.previewBackdrop,
+ }}
+ >
+ {Object.keys(config.controls).length > 0 ? (
+ <CustomizePanel
+ name={name}
+ controls={config.controls}
+ values={values}
+ code={code}
+ isDefault={isDefault}
+ onChange={change}
+ onReset={reset}
+ />
+ ) : null}
+ </DocsPlayer>
);
}
@@ -215,7 +92,9 @@ function generateCode(
if (config.snippet) return config.snippet(props);
const propsString = Object.entries(props)
.map(([k, v]) => {
- if (typeof v === "string") return ` ${k}="${v}"`;
+ // A JSX string attribute can't escape a quote; multi-line text reads better
+ // as an expression too.
+ if (typeof v === "string" && !/["\n]/.test(v)) return ` ${k}="${v}"`;
return ` ${k}={${JSON.stringify(v)}}`;
})
.join("\n");
diff --git a/components/docs/copy-button.tsx b/components/docs/copy-button.tsx
index 88e5b266..918e929e 100644
--- a/components/docs/copy-button.tsx
+++ b/components/docs/copy-button.tsx
@@ -1,39 +1,120 @@
"use client";
-import { Check, Copy } from "lucide-react";
-import { useState } from "react";
-import { Button } from "@/components/ui/button";
+import { useEffect, useRef, useState } from "react";
import { cn } from "@/lib/utils";
+/**
+ * Labeled copy action used by every docs code surface. `dark` sits in the
+ * header of the always-dark code block, `ink` is the filled button beside an
+ * install command, `light` is the bright chip on the dark player panel.
+ */
+const VARIANTS = {
+ dark: "h-[30px] gap-1.5 rounded-control-sm bg-dark-raised px-2.5 font-sans text-mono text-[#fafafa] hover:bg-[#25282b] focus-visible:ring-white/40 dark:bg-secondary dark:hover:bg-[#33363b]",
+ ink: "h-[34px] gap-1.5 rounded-[10px] bg-foreground px-3 text-caption text-inverse hover:bg-foreground/85 focus-visible:ring-ring max-md:h-11 max-md:rounded-control-sm max-md:px-3.5 max-md:text-small",
+ light:
+ "h-8 gap-1.5 rounded-tile bg-[#fafafa] px-3 text-caption font-medium text-dark-surface hover:bg-white focus-visible:ring-white/40 dark:bg-[#f4f4f5] max-md:h-11 max-md:flex-1 max-md:justify-center max-md:rounded-[10px]",
+} as const;
+
+export type CopyButtonVariant = keyof typeof VARIANTS;
+
+export function CopyIcon({ className }: { className?: string }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn("size-3.5 shrink-0", className)}
+ >
+ <rect
+ x="8"
+ y="8"
+ width="12"
+ height="12"
+ rx="2.5"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ />
+ <path
+ d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
+function CheckIcon() {
+ return (
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-3.5 shrink-0">
+ <path
+ d="M20 6 9 17l-5-5"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2.2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ );
+}
+
export function CopyButton({
value,
+ label = "Copy",
+ variant = "dark",
className,
onCopy,
}: {
value: string;
+ label?: string;
+ variant?: CopyButtonVariant;
className?: string;
onCopy?: () => void;
}) {
const [copied, setCopied] = useState(false);
+ const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
+
+ useEffect(
+ () => () => {
+ if (timer.current) clearTimeout(timer.current);
+ },
+ [],
+ );
return (
- <Button
+ <button
+ type="button"
data-slot="copy-button"
- variant="outline"
- size="icon-xs"
- aria-label="Copy to clipboard"
- onClick={() => {
- navigator.clipboard.writeText(value);
+ onClick={async () => {
+ const ok = await navigator.clipboard.writeText(value).then(
+ () => true,
+ () => false,
+ );
+ if (!ok) return;
setCopied(true);
onCopy?.();
- setTimeout(() => setCopied(false), 1500);
+ if (timer.current) clearTimeout(timer.current);
+ timer.current = setTimeout(() => setCopied(false), 1500);
}}
className={cn(
- "relative border-fd-border bg-fd-background text-fd-muted-foreground before:absolute before:-inset-2.5 before:content-[''] hover:bg-fd-accent hover:text-fd-accent-foreground",
+ "inline-flex shrink-0 cursor-pointer items-center whitespace-nowrap outline-none transition-colors duration-150 focus-visible:ring-2",
+ VARIANTS[variant],
className,
)}
>
- {copied ? <Check className="size-3.5" /> : <Copy className="size-3.5" />}
- </Button>
+ {copied ? <CheckIcon /> : <CopyIcon />}
+ {/* Both labels share one cell so the button keeps its width. */}
+ <span className="grid text-center">
+ <span aria-live="polite" className="col-start-1 row-start-1">
+ {copied ? "Copied" : label}
+ </span>
+ <span aria-hidden="true" className="invisible col-start-1 row-start-1">
+ {copied ? label : "Copied"}
+ </span>
+ </span>
+ </button>
);
}
diff --git a/components/docs/copy-markdown-button.tsx b/components/docs/copy-markdown-button.tsx
index d9409b03..b93a96d4 100644
--- a/components/docs/copy-markdown-button.tsx
+++ b/components/docs/copy-markdown-button.tsx
@@ -1,13 +1,42 @@
"use client";
-import { Check, Copy } from "lucide-react";
import { useState } from "react";
-import { Button } from "@/components/ui/button";
import { useTrackEvent } from "@/lib/analytics";
import { cn } from "@/lib/utils";
+import { CheckIcon, CopyIcon } from "./shell/docs-icons";
type CopyState = "idle" | "loading" | "copied";
+/**
+ * Hands the clipboard a pending `.md` fetch instead of awaiting it first:
+ * Safari drops the click's user activation across an `await`, so a write
+ * made after the fetch resolves is rejected.
+ */
+async function copyFromUrl(url: string): Promise<boolean> {
+ const text = fetch(url).then((res) => {
+ if (!res.ok) throw new Error(`${res.status}`);
+ return res.text();
+ });
+ try {
+ if (typeof ClipboardItem !== "undefined") {
+ const blob = text.then((t) => new Blob([t], { type: "text/plain" }));
+ await navigator.clipboard.write([
+ new ClipboardItem({ "text/plain": blob }),
+ ]);
+ } else {
+ await navigator.clipboard.writeText(await text);
+ }
+ return true;
+ } catch {
+ return false;
+ }
+}
+
+/**
+ * "Copy page": fetches the page's `.md` twin and puts it on the clipboard.
+ * Desktop sits on the breadcrumb row (32px); below `lg` it is the 44px
+ * button under the description.
+ */
export function CopyMarkdownButton({
url,
className,
@@ -21,36 +50,38 @@ export function CopyMarkdownButton({
const handleCopy = async () => {
if (state !== "idle") return;
setState("loading");
- const text = await fetch(url)
- .then((res) => (res.ok ? res.text() : null))
- .catch(() => null);
- if (text === null) {
+ if (!(await copyFromUrl(url))) {
setState("idle");
return;
}
- await navigator.clipboard.writeText(text).catch(() => undefined);
setState("copied");
trackEvent("docs_markdown_copied", { page: url });
setTimeout(() => setState("idle"), 1500);
};
+ const copied = state === "copied";
+ const Icon = copied ? CheckIcon : CopyIcon;
+
return (
- <Button
- variant="outline"
- size="sm"
+ <button
+ type="button"
onClick={handleCopy}
- disabled={state === "loading"}
+ aria-busy={state === "loading"}
className={cn(
- "w-fit gap-1.5 rounded-full text-xs text-muted-foreground hover:text-foreground",
+ "inline-flex h-11 w-fit shrink-0 items-center gap-2 rounded-control-sm bg-secondary pr-3.5 pl-3 text-[15px] leading-5 text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-2 focus-visible:ring-ring dark:hover:bg-[#33363b] lg:h-8 lg:gap-[7px] lg:rounded-[10px] lg:pr-3 lg:pl-[11px] lg:text-small",
className,
)}
>
- {state === "copied" ? (
- <Check className="size-3.5" />
- ) : (
- <Copy className="size-3.5" />
- )}
- Copy as Markdown
- </Button>
+ <Icon className="size-4 lg:size-3.5" />
+ {/* Both labels share one cell so "Copied" keeps the button's width. */}
+ <span className="grid">
+ <span aria-live="polite" className="col-start-1 row-start-1 text-left">
+ {copied ? "Copied" : "Copy page"}
+ </span>
+ <span aria-hidden="true" className="invisible col-start-1 row-start-1">
+ Copy page
+ </span>
+ </span>
+ </button>
);
}
diff --git a/components/docs/dependencies.tsx b/components/docs/dependencies.tsx
index 7ebf2ec6..4261cc43 100644
--- a/components/docs/dependencies.tsx
+++ b/components/docs/dependencies.tsx
@@ -1,14 +1,21 @@
+import { cn } from "@/lib/utils";
+import { BLOCK_SPACING } from "./blocks/spacing";
+
+/** Packages a component needs beyond Remotion, as quiet mono tags. */
export function Dependencies({ items }: { items: string[] }) {
if (items.length === 0) return null;
return (
- <div className="not-prose my-4 flex max-w-3xl flex-wrap items-center gap-2">
- <span className="text-xs font-medium text-muted-foreground">
- Requires
- </span>
+ <div
+ className={cn(
+ "not-prose flex flex-wrap items-center gap-1.5",
+ BLOCK_SPACING,
+ )}
+ >
+ <span className="mr-1 text-caption text-muted-foreground">Requires</span>
{items.map((item) => (
<code
key={item}
- className="rounded-lg border border-border bg-muted/40 px-2 py-0.5 font-mono text-xs text-foreground"
+ className="flex h-6 items-center rounded-tag bg-surface px-[7px] font-mono text-mono text-foreground shadow-[0_0_0_1px_var(--color-hairline)]"
>
{item}
</code>
diff --git a/components/docs/docs-ad-rail.tsx b/components/docs/docs-ad-rail.tsx
deleted file mode 100644
index b25f5884..00000000
--- a/components/docs/docs-ad-rail.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-"use client";
-
-import { DocsSponsor } from "./docs-sponsor";
-
-export function DocsAdRail() {
- return (
- <aside
- id="nd-toc"
- className="sticky top-(--fd-docs-row-1) flex h-[calc(var(--fd-docs-height)-var(--fd-docs-row-1))] w-(--fd-toc-width) flex-col gap-4 overflow-y-auto [grid-area:toc] pt-12 ps-4 pe-4 pb-6 max-xl:hidden"
- >
- <DocsSponsor />
- </aside>
- );
-}
diff --git a/components/docs/docs-header.tsx b/components/docs/docs-header.tsx
deleted file mode 100644
index d0a4c0af..00000000
--- a/components/docs/docs-header.tsx
+++ /dev/null
@@ -1,59 +0,0 @@
-import { NavDesktop } from "@/app/(home)/components/header-nav";
-import {
- HeaderActions,
- HeaderLogo,
-} from "@/app/(home)/components/header-parts";
-import { StudioBar } from "@/components/studio-bar";
-import { NAV_LINKS } from "@/config/site";
-
-/**
- * Static, content-aligned header for the docs. Unlike `SiteHeader` it never
- * sticks, never listens to scroll, and never morphs into a pill.
- *
- * The inner container mirrors Fumadocs' docs grid cell for cell so the header
- * chrome shares one vertical with the content below: the logo cell is the
- * sidebar column (`--fd-sidebar-width`), the right actions cell is the TOC
- * column (`--fd-toc-width`, xl+ only, like the rail itself), and the middle
- * cell reproduces the page block between them — `max-w-[900px] mx-auto` with
- * the page's own px-4/md:px-6/xl:px-8 — so the nav's first label starts on the
- * article title's left edge at every viewport. Below xl the TOC cell is gone
- * and the actions render inside the middle block, on the article's right edge.
- * The CSS vars are redeclared here because this header renders above (outside)
- * DocsLayout, so its variables aren't in scope. The logo cell keeps `px-4` at
- * every breakpoint so the logo lands at 16px — flush with the sidebar content's
- * `p-4` and the tab labels below it. `-ml-4` pulls the first nav item's label
- * flush with the article text while its ghost-button background bleeds back
- * into the gutter. The Components/Primitives switcher lives in the thin
- * `DocsTabsBar` rendered directly below this header.
- *
- * The 97rem / 268px / 900px literals mirror fumadocs-ui 16.7 grid defaults —
- * `var(--fd-layout-width, 97rem)`, `md:layout:[--fd-sidebar-width:268px]`,
- * `xl:layout:[--fd-toc-width:268px]`, and the page's `max-w-[900px]`. They must
- * stay inline (Tailwind JIT can't read JS constants); if a fumadocs upgrade
- * changes those defaults, re-sync the values below.
- */
-export function DocsHeader() {
- return (
- <>
- <StudioBar />
- <header className="relative z-40 h-16 w-full border-b border-border bg-background/70 backdrop-blur-xl">
- <div className="mx-auto flex h-16 w-full max-w-(--fd-layout-width) items-center [--fd-layout-width:97rem] md:[--fd-sidebar-width:268px] xl:[--fd-toc-width:268px]">
- <div className="flex shrink-0 items-center px-6 md:w-(--fd-sidebar-width)">
- <HeaderLogo />
- </div>
- <div className="flex min-w-0 flex-1 items-center">
- <div className="mx-auto flex w-full max-w-[900px] items-center justify-between px-4 md:px-6 xl:px-8">
- <NavDesktop links={NAV_LINKS} className="-ml-4" />
- <div className="xl:hidden">
- <HeaderActions />
- </div>
- </div>
- </div>
- <div className="hidden shrink-0 items-center justify-end pe-4 xl:flex xl:w-(--fd-toc-width)">
- <HeaderActions />
- </div>
- </div>
- </header>
- </>
- );
-}
diff --git a/components/docs/docs-search-trigger.tsx b/components/docs/docs-search-trigger.tsx
index a5bbbedc..dca63032 100644
--- a/components/docs/docs-search-trigger.tsx
+++ b/components/docs/docs-search-trigger.tsx
@@ -1,31 +1,42 @@
"use client";
import { useSearchContext } from "fumadocs-ui/contexts/search";
-import { Search } from "lucide-react";
+import { cn } from "@/lib/utils";
+import { SearchIcon } from "./shell/docs-icons";
+/**
+ * "Search docs ⌘K" capsule at the top of the sidebar. Opens the fumadocs
+ * search dialog (the hotkey itself is bound by `RootProvider`).
+ */
export function DocsSearchTrigger({
- count,
- hideIfDisabled,
+ className,
+ onOpen,
}: {
- count: number;
- hideIfDisabled?: boolean;
+ className?: string;
+ /** Runs before the dialog opens (the mobile sheet closes itself). */
+ onOpen?: () => void;
}) {
const { enabled, setOpenSearch } = useSearchContext();
- if (hideIfDisabled && !enabled) return null;
+ if (!enabled) return null;
return (
<button
type="button"
data-search-full=""
- aria-label="Open Search"
- onClick={() => setOpenSearch(true)}
- className="inline-flex h-9 w-full items-center gap-2 rounded-xl bg-muted px-3 text-sm font-medium text-muted-foreground control-surface control-surface-interactive outline-none transition-colors hover:bg-muted/70 focus-visible:ring-2 focus-visible:ring-ring/40"
+ onClick={() => {
+ onOpen?.();
+ setOpenSearch(true);
+ }}
+ className={cn(
+ "flex h-10 w-full shrink-0 items-center gap-2.5 rounded-control-sm bg-capsule pr-2 pl-3 text-left text-small text-muted-foreground outline-none transition-colors hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring",
+ className,
+ )}
>
- <Search className="size-4" />
- Search
- <span className="ms-auto text-xs tabular-nums text-muted-foreground/70">
- {count} components
- </span>
+ <SearchIcon className="size-4 shrink-0" />
+ <span className="flex-1">Search docs</span>
+ <kbd className="flex h-6 items-center rounded-tag border border-divider bg-surface px-[7px] font-sans text-micro text-muted-foreground pointer-coarse:hidden">
+ ⌘K
+ </kbd>
</button>
);
}
diff --git a/components/docs/docs-shell.tsx b/components/docs/docs-shell.tsx
index 7671222a..79220e6f 100644
--- a/components/docs/docs-shell.tsx
+++ b/components/docs/docs-shell.tsx
@@ -1,116 +1,64 @@
"use client";
-import type { Root } from "fumadocs-core/page-tree";
-import { DocsLayout } from "fumadocs-ui/layouts/docs";
-import { SearchTrigger } from "fumadocs-ui/layouts/shared/slots/search-trigger";
import { usePathname } from "next/navigation";
-import { type ReactNode, useMemo } from "react";
-import { DocsSearchTrigger } from "@/components/docs/docs-search-trigger";
-import { getActiveDocsTab } from "@/lib/docs-tabs";
-import { baseOptions } from "@/lib/layout.shared";
+import {
+ createContext,
+ type ReactNode,
+ useContext,
+ useMemo,
+ useState,
+} from "react";
+import { type DocsTabId, getActiveDocsTab } from "@/lib/docs-tabs";
+import { DocsSidebar } from "./shell/docs-sidebar";
+import { SectionsSheet } from "./shell/sections-sheet";
+import type { SidebarModel } from "./shell/sidebar-model";
+
+type ShellState = { openSections: () => void };
+
+const ShellContext = createContext<ShellState | null>(null);
+
+/** Lets the mobile page bar open the sections sheet the shell owns. */
+export function useDocsShell(): ShellState {
+ const value = useContext(ShellContext);
+ if (!value) throw new Error("useDocsShell must be used inside DocsShell");
+ return value;
+}
/**
- * Renders the Fumadocs `DocsLayout` with the sidebar tree that matches the
- * active docs tab. Both trees are built once on the server (in `app/docs/layout`)
- * and handed down; this client shell only picks between them by pathname, so the
- * Each docs category gets its own sidebar without moving files or changing
- * URLs. The page body arrives as server-rendered `children`,
- * so the RSC boundary stays intact — only the layout chrome is client-rendered.
- *
- * The `DocsLayout` props mirror the previous server layout: the custom
- * `DocsHeader` above owns the only top nav (`nav` disabled), search renders in
- * the sidebar header, and the theme switch / collapse trigger / sidebar footer
- * are suppressed. The decorative grid scopes a dotted backdrop to the content
- * column for visual continuity with the landing hero.
- *
- * `containerProps` sets `--fd-banner-height` to the sticky `DocsTabsBar` height
- * (h-11 = 2.75rem). fumadocs derives `--fd-docs-row-1: var(--fd-banner-height, 0px)`
- * and sticks the sidebar/TOC at `top-(--fd-docs-row-1)`, dropping them just below
- * the pinned tab bar instead of letting the bar overlap the sidebar top.
- *
- * On the icons tab the sidebar is disabled, but fumadocs still reserves the
- * `--fd-sidebar-width` (268px at md) gutter on the layout, indenting the article
- * away from the header/tab left edge. Forcing `--fd-sidebar-width:0px` (important,
- * to beat the sidebar slot's `md:layout:[--fd-sidebar-width:268px]`) collapses that
- * gutter so the content aligns flush-left under the logo and tabs.
- *
- * The grid's own `--fd-layout-width` is left at the fumadocs default (97rem) — the
- * chrome (DocsHeader/DocsTabsBar) is pinned to the same 97rem so everything shares
- * one centered block. (Forcing a narrower 1400px here only enlarged the side
- * gutters, pushing the sidebar inward.)
+ * Docs frame between the site header and footer: the sticky sidebar on the
+ * left (from `lg`) and the page (article + right rail, rendered by the page
+ * itself). Every library's sidebar model is built once on the server; the
+ * shell picks the one matching the current path, so the library switcher only
+ * has to navigate. Below `lg` the same model renders in the sections sheet.
*/
export function DocsShell({
- componentsTree,
- primitivesTree,
- shadersTree,
- filtersTree,
- captionsTree,
- templatesTree,
- iconsTree,
- componentCount,
+ models,
children,
}: {
- componentsTree: Root;
- primitivesTree: Root;
- shadersTree: Root;
- filtersTree: Root;
- captionsTree: Root;
- templatesTree: Root;
- iconsTree: Root;
- componentCount: number;
+ models: Record<DocsTabId, SidebarModel>;
children: ReactNode;
}) {
- const searchTriggerFull = useMemo(() => {
- function SearchTriggerFull({
- hideIfDisabled,
- }: {
- hideIfDisabled?: boolean;
- }) {
- return (
- <DocsSearchTrigger
- count={componentCount}
- hideIfDisabled={hideIfDisabled}
- />
- );
- }
- return SearchTriggerFull;
- }, [componentCount]);
const pathname = usePathname();
- const activeTab = getActiveDocsTab(pathname);
- const isIcons = activeTab === "icons";
- const trees: Record<typeof activeTab, Root> = {
- components: componentsTree,
- primitives: primitivesTree,
- shaders: shadersTree,
- filters: filtersTree,
- captions: captionsTree,
- templates: templatesTree,
- icons: iconsTree,
- };
- const tree = trees[activeTab];
+ const tab = getActiveDocsTab(pathname);
+ const model = models[tab];
+ const [sectionsOpen, setSectionsOpen] = useState(false);
+ const value = useMemo<ShellState>(
+ () => ({ openSections: () => setSectionsOpen(true) }),
+ [],
+ );
return (
- <DocsLayout
- tree={tree}
- {...baseOptions()}
- nav={{ enabled: false }}
- searchToggle={{ enabled: true }}
- slots={{
- searchTrigger: { sm: SearchTrigger, full: searchTriggerFull },
- }}
- themeSwitch={{ enabled: false }}
- sidebar={{ collapsible: false, enabled: !isIcons }}
- containerProps={{
- className: isIcons
- ? "[--fd-banner-height:2.75rem] [--fd-sidebar-width:0px]!"
- : "[--fd-banner-height:2.75rem]",
- }}
- >
- <div
- aria-hidden
- className="pointer-events-none -z-10 h-[360px] w-full self-start [grid-area:main] bg-grid-fade"
+ <ShellContext.Provider value={value}>
+ <div className="mx-auto flex w-full max-w-(--docs-frame) flex-1 items-stretch lg:px-(--docs-gutter)">
+ <DocsSidebar model={model} activeUrl={pathname} />
+ <div className="flex min-w-0 flex-1 flex-col">{children}</div>
+ </div>
+ <SectionsSheet
+ open={sectionsOpen}
+ onOpenChange={setSectionsOpen}
+ model={model}
+ activeUrl={pathname}
/>
- {children}
- </DocsLayout>
+ </ShellContext.Provider>
);
}
diff --git a/components/docs/docs-sponsor.tsx b/components/docs/docs-sponsor.tsx
deleted file mode 100644
index b8d5a443..00000000
--- a/components/docs/docs-sponsor.tsx
+++ /dev/null
@@ -1,68 +0,0 @@
-import { ArrowUpRight } from "lucide-react";
-import Link from "next/link";
-import type React from "react";
-import {
- Frame,
- FrameHeader,
- FramePanel,
- FrameTitle,
-} from "@/components/ui/frame";
-import { getDocsSponsors } from "@/config/sponsors";
-import { cn } from "@/lib/utils";
-
-export const DocsSponsor: React.FC = () => {
- const featuredSponsors = getDocsSponsors();
-
- return (
- <Frame className="w-full">
- <FrameHeader className="flex-row items-center justify-between gap-2 px-3 py-2">
- <FrameTitle className="text-sm">Sponsors</FrameTitle>
- <Link
- href="/sponsors"
- className="inline-flex items-center gap-1 text-[10px] font-medium text-muted-foreground transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none"
- >
- Become a sponsor
- <ArrowUpRight className="size-3.5" aria-hidden="true" />
- </Link>
- </FrameHeader>
-
- <FramePanel className="flex flex-col gap-1 p-2">
- {/* <span className="text-xs font-medium text-muted-foreground">Gold</span> */}
-
- {featuredSponsors.length > 0 ? (
- <div className="flex flex-col gap-2">
- {featuredSponsors.map((sponsor) => (
- <a
- key={sponsor.id}
- href={sponsor.website}
- target="_blank"
- rel="noreferrer"
- className="group flex items-center justify-center gap-3 rounded-md surface-card px-3 py-2.5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
- >
- {/** biome-ignore lint/performance/noImgElement: sponsor logos are SVGs of arbitrary sizes */}
- <img
- src={sponsor.logoUrl}
- alt={sponsor.name}
- className={cn(
- "max-h-6 w-auto shrink-0 object-contain opacity-80 grayscale transition-all duration-300 dark:[filter:grayscale(1)_brightness(0)_invert(1)] ",
- sponsor.customStyles,
- )}
- style={{ transform: `scale(${sponsor.logoScale ?? 1})` }}
- />
- {sponsor.displayName && (
- <span className="text-xs font-bold text-text transition-colors group-hover:text-foreground">
- {sponsor.displayName}
- </span>
- )}
- </a>
- ))}
- </div>
- ) : (
- <span className="rounded-md surface-card px-3 py-2.5 text-xs font-medium text-muted-foreground">
- Your logo here
- </span>
- )}
- </FramePanel>
- </Frame>
- );
-};
diff --git a/components/docs/docs-tabs-bar.tsx b/components/docs/docs-tabs-bar.tsx
deleted file mode 100644
index 07c947dd..00000000
--- a/components/docs/docs-tabs-bar.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-import { DocsTabs } from "@/components/docs/docs-tabs";
-
-/**
- * Thin secondary bar sitting directly below {@link DocsHeader}, holding the
- * Components | Primitives switcher. It is `sticky top-0` so it stays pinned to
- * the top while the page scrolls; the (non-sticky) main header scrolls away
- * above it, and the bar pins exactly as the header scrolls out. `DocsShell` sets
- * the DocsLayout `--fd-banner-height` to this bar's height so the sticky sidebar
- * lands just below the pinned bar instead of under it.
- *
- * The tabs sit at the far left, aligned with the sidebar's content padding: the
- * centered block carries `px-4` (the sidebar's `p-4` = 16px) and `-ml-3` cancels
- * the first tab's own `px-3` so its label lands flush at 16px — directly above
- * the sidebar content's left edge. `items-stretch` lets the tabs fill the bar's
- * height so the active underline lands on its bottom border.
- *
- * The 97rem literal mirrors fumadocs-ui 16.7's docs-grid default
- * (`var(--fd-layout-width, 97rem)`), so this bar shares the same centered block
- * as the docs content and `DocsHeader` (Tailwind JIT can't read JS constants).
- */
-export function DocsTabsBar() {
- return (
- <div className="sticky top-0 z-30 h-11 w-full border-b border-border bg-background/70 backdrop-blur-xl">
- <div className="mx-auto flex h-11 w-full max-w-(--fd-layout-width) items-stretch px-6 [--fd-layout-width:97rem]">
- <DocsTabs className="-ml-3" />
- </div>
- </div>
- );
-}
diff --git a/components/docs/docs-tabs.tsx b/components/docs/docs-tabs.tsx
deleted file mode 100644
index 9f4572d7..00000000
--- a/components/docs/docs-tabs.tsx
+++ /dev/null
@@ -1,49 +0,0 @@
-"use client";
-
-import Link from "next/link";
-import { usePathname } from "next/navigation";
-import { DOCS_TABS, getActiveDocsTab } from "@/lib/docs-tabs";
-import { cn } from "@/lib/utils";
-
-/**
- * Category switcher for the docs. Rendered inside the thin
- * `DocsTabsBar` below the main header. The active tab is derived from the current
- * path (the ui section maps to Primitives, see {@link getActiveDocsTab}) and
- * carries an underline pinned to the bar's bottom border via `bottom-0`. The nav
- * stretches to its parent's height (no hardcoded height), so the underline tracks
- * whatever bar it sits in. Each tab is a plain link; switching navigates to that
- * tab's landing page and `DocsShell` swaps the sidebar tree for the new path.
- */
-export function DocsTabs({ className }: { className?: string }) {
- const pathname = usePathname();
- const active = getActiveDocsTab(pathname);
-
- return (
- <nav className={cn("flex items-stretch gap-1", className)}>
- {DOCS_TABS.map((tab) => {
- const isActive = tab.id === active;
- return (
- <Link
- key={tab.id}
- href={tab.href}
- aria-current={isActive ? "page" : undefined}
- className={cn(
- "relative flex items-center px-3 text-sm font-medium transition-colors focus-visible:text-foreground focus-visible:outline-none",
- isActive
- ? "text-foreground"
- : "text-muted-foreground hover:text-foreground",
- )}
- >
- {tab.label}
- {isActive && (
- <span
- aria-hidden
- className="absolute inset-x-3 bottom-0 h-0.5 rounded-full bg-foreground"
- />
- )}
- </Link>
- );
- })}
- </nav>
- );
-}
diff --git a/components/docs/examples/rolodex-flip-example.tsx b/components/docs/examples/rolodex-flip-example.tsx
index 269fd992..fb07c4ae 100644
--- a/components/docs/examples/rolodex-flip-example.tsx
+++ b/components/docs/examples/rolodex-flip-example.tsx
@@ -9,9 +9,11 @@ const MONO_FONT =
export function RolodexFlipExampleScene({
interval,
flipDuration,
+ color = "#f2f2f2",
}: {
interval?: number;
flipDuration?: number;
+ color?: string;
}) {
return (
<AbsoluteFill
@@ -23,7 +25,7 @@ export function RolodexFlipExampleScene({
<span style={{ fontFamily: MONO_FONT, fontSize: 36 }}>
<span style={{ color: "#6f6c7a" }}>$ </span>
<span style={{ color: "#8a8794" }}>npx shadcn add </span>
- <span style={{ color: "#f2f2f2" }}>
+ <span style={{ color }}>
<RolodexFlip
items={["button", "dialog", "command", "tabs", "chart-area"]}
interval={interval}
diff --git a/components/docs/examples/value-swap-example.tsx b/components/docs/examples/value-swap-example.tsx
index fddcc971..d0bbc830 100644
--- a/components/docs/examples/value-swap-example.tsx
+++ b/components/docs/examples/value-swap-example.tsx
@@ -10,10 +10,12 @@ export function ValueSwapExampleScene({
duration,
distance,
direction,
+ color = "#f2f2f2",
}: {
duration?: number;
distance?: number;
direction?: "up" | "down";
+ color?: string;
}) {
return (
<AbsoluteFill
@@ -27,7 +29,7 @@ export function ValueSwapExampleScene({
fontFamily: FONT_FAMILY,
fontSize: 40,
fontWeight: 600,
- color: "#f2f2f2",
+ color,
}}
>
<ValueSwap
diff --git a/components/docs/guide-video.tsx b/components/docs/guide-video.tsx
index 9baa6dcd..b1fdcad9 100644
--- a/components/docs/guide-video.tsx
+++ b/components/docs/guide-video.tsx
@@ -1,50 +1,203 @@
"use client";
import { useEffect, useRef, useState } from "react";
+import {
+ guidePanel,
+ PauseIcon,
+ PlayIcon,
+} from "@/components/docs/guides/guide-ui";
import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+import { cn } from "@/lib/utils";
+/**
+ * Hero player of a video guide: the finished video on a dark stage, a
+ * play key and a time ruler with a scrubbable playhead.
+ * Plays muted on loop while on screen; reduced motion keeps it paused.
+ */
export function GuideVideo({
src,
poster,
label,
+ duration: durationHint = 35,
+ fps = 30,
}: {
src: string;
poster?: string;
label?: string;
+ /** Seconds, used for the ruler until the video's metadata loads. */
+ duration?: number;
+ fps?: number;
}) {
const videoRef = useRef<HTMLVideoElement>(null);
const reducedMotion = usePrefersReducedMotion();
- const [hovered, setHovered] = useState(false);
+ const [playing, setPlaying] = useState(false);
+ const [time, setTime] = useState(0);
+ const [duration, setDuration] = useState(durationHint);
+ const userPaused = useRef(false);
+ const headRef = useRef<HTMLSpanElement>(null);
+ // Autoplay only while the player is on screen, never under reduced motion,
+ // and not again once the reader has paused it.
useEffect(() => {
const video = videoRef.current;
if (!video) return;
if (reducedMotion) {
video.pause();
- } else {
- void video.play().catch(() => {});
+ return;
}
+ const observer = new IntersectionObserver(
+ ([entry]) => {
+ if (!entry.isIntersecting) video.pause();
+ else if (!userPaused.current) void video.play().catch(() => {});
+ },
+ { threshold: 0.25 },
+ );
+ observer.observe(video);
+ return () => observer.disconnect();
}, [reducedMotion]);
+ // timeupdate fires ~4 times a second, so the playhead would step; while
+ // playing it follows the video every frame without re-rendering.
+ useEffect(() => {
+ const video = videoRef.current;
+ const head = headRef.current;
+ if (!playing || !video || !head || duration <= 0) return;
+ let raf = 0;
+ const follow = () => {
+ head.style.left = rulerLeft(Math.min(video.currentTime / duration, 1));
+ raf = requestAnimationFrame(follow);
+ };
+ raf = requestAnimationFrame(follow);
+ return () => cancelAnimationFrame(raf);
+ }, [playing, duration]);
+
+ const toggle = () => {
+ const video = videoRef.current;
+ if (!video) return;
+ userPaused.current = !video.paused;
+ if (video.paused) void video.play().catch(() => {});
+ else video.pause();
+ };
+
+ const progress = duration > 0 ? Math.min(time / duration, 1) : 0;
+ const marks = rulerMarks(duration);
+
return (
- <div className="surface-card not-prose mb-6 aspect-video w-full overflow-hidden rounded-2xl">
- <video
- ref={videoRef}
- src={src}
- poster={poster}
- aria-label={label}
- controls={hovered || reducedMotion}
- tabIndex={0}
- onPointerEnter={() => setHovered(true)}
- onPointerLeave={() => setHovered(false)}
- onFocus={() => setHovered(true)}
- onBlur={() => setHovered(false)}
- muted
- loop
- playsInline
- preload="metadata"
- className="size-full object-cover"
- />
+ <div
+ className={cn(
+ "not-prose mt-6 flex flex-col gap-2 rounded-card p-2",
+ guidePanel,
+ )}
+ >
+ <div className="aspect-video overflow-hidden rounded-control-sm bg-black">
+ <video
+ ref={videoRef}
+ src={src}
+ poster={poster}
+ aria-label={label}
+ muted
+ loop
+ playsInline
+ preload="metadata"
+ onPlay={() => setPlaying(true)}
+ onPause={() => setPlaying(false)}
+ onTimeUpdate={(e) => setTime(e.currentTarget.currentTime)}
+ onLoadedMetadata={(e) => {
+ if (Number.isFinite(e.currentTarget.duration)) {
+ setDuration(e.currentTarget.duration);
+ }
+ }}
+ className="size-full object-cover"
+ />
+ </div>
+
+ <div className="flex flex-wrap items-center gap-2 py-1.5 sm:flex-nowrap">
+ <button
+ type="button"
+ onClick={toggle}
+ aria-label={playing ? "Pause video" : "Play video"}
+ className="flex size-10 shrink-0 items-center justify-center rounded-control-sm bg-white text-[#0e1012] transition-colors hover:bg-[#ececee] focus-visible:ring-3 focus-visible:ring-white/40 focus-visible:outline-none"
+ >
+ {playing ? <PauseIcon /> : <PlayIcon />}
+ </button>
+ <span className="shrink-0 font-sans text-caption text-[#fafafa] tabular-nums">
+ {formatTime(time)} / {formatTime(duration)}
+ </span>
+
+ <div className="relative order-last h-10 basis-full rounded-control-sm bg-dark-raised sm:order-none sm:grow sm:basis-0">
+ {marks.map((mark) => (
+ <span
+ key={mark.t}
+ aria-hidden="true"
+ className={cn(
+ "absolute top-1/2 -translate-y-1/2",
+ mark.label
+ ? "text-caption text-dark-subtle"
+ : "h-2.5 w-px bg-white/14",
+ mark.edge === "end" && "-translate-x-full",
+ !mark.edge && "-translate-x-1/2",
+ )}
+ style={{ left: rulerLeft(mark.t / duration) }}
+ >
+ {mark.label}
+ </span>
+ ))}
+ <span
+ ref={headRef}
+ aria-hidden="true"
+ className="absolute top-1.5 h-7 w-[3px] -translate-x-1/2 rounded-[2px] bg-white"
+ style={{ left: rulerLeft(progress) }}
+ />
+ <input
+ type="range"
+ min={0}
+ max={duration}
+ step={1 / fps}
+ value={time}
+ aria-label="Seek"
+ aria-valuetext={formatTime(time)}
+ onChange={(e) => {
+ const video = videoRef.current;
+ const next = Number(e.currentTarget.value);
+ if (video) video.currentTime = next;
+ setTime(next);
+ }}
+ className="seek-range absolute inset-0 size-full rounded-control-sm opacity-0 [--seek-thumb:28px] focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/60"
+ />
+ </div>
+ </div>
</div>
);
}
+
+/** 14px inner padding on both ends of the ruler. */
+function rulerLeft(fraction: number) {
+ return `calc(14px + (100% - 28px) * ${fraction})`;
+}
+
+/** Labels every 10s plus the end, with a tick every ~5s between them. */
+function rulerMarks(duration: number) {
+ const end = Math.round(duration);
+ const stops: number[] = [];
+ for (let t = 0; t < end; t += 10) stops.push(t);
+ if (end - stops[stops.length - 1] < 3) stops.pop();
+ stops.push(end);
+
+ const marks: { t: number; label?: string; edge?: "start" | "end" }[] = [];
+ stops.forEach((t, i) => {
+ const edge = i === 0 ? "start" : i === stops.length - 1 ? "end" : undefined;
+ marks.push({ t, label: `${t}s`, edge });
+ const next = stops[i + 1];
+ if (next === undefined) return;
+ const ticks = Math.max(1, Math.round((next - t) / 5));
+ for (let k = 1; k <= ticks; k++) {
+ marks.push({ t: t + ((next - t) * k) / (ticks + 1) });
+ }
+ });
+ return marks.map((m) => ({ ...m, t: Math.min(m.t, duration) }));
+}
+
+function formatTime(seconds: number) {
+ const s = Math.max(0, Math.round(seconds));
+ return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
+}
diff --git a/components/docs/guides/beat-thumbs.tsx b/components/docs/guides/beat-thumbs.tsx
new file mode 100644
index 00000000..3bf1f851
--- /dev/null
+++ b/components/docs/guides/beat-thumbs.tsx
@@ -0,0 +1,182 @@
+import type { CSSProperties } from "react";
+import { cn } from "@/lib/utils";
+
+/**
+ * Tiny frames that hint at what each beat looks like. Always dark, like the
+ * videos themselves (#141318 is the recipes' default background).
+ */
+export type BeatLook =
+ | "lines"
+ | "swirl"
+ | "slide"
+ | "words"
+ | "montage"
+ | "stack"
+ | "terminal"
+ | "logo"
+ | "line"
+ | "tease"
+ | "reveal"
+ | "date"
+ | "screen"
+ | "number";
+
+const bar = "h-1 shrink-0 rounded-[2px]";
+const ink = "bg-[#EDEBE6]";
+const MONTAGE: CSSProperties["backgroundImage"][] = [
+ "linear-gradient(180deg, #3B2F5C, #141318)",
+ "linear-gradient(160deg, #1F4E5A, #141318)",
+ "linear-gradient(200deg, #5A2D4E, #2A1F3D)",
+ "linear-gradient(180deg, #2E3A1E, #141318)",
+ "linear-gradient(140deg, #4A3A6E, #1C1A2A)",
+ "linear-gradient(180deg, #6B5A3A, #141318)",
+];
+
+export function BeatThumb({ look }: { look: BeatLook }) {
+ const frame =
+ "flex h-[58px] shrink-0 items-center justify-center overflow-hidden rounded-tile bg-[#141318]";
+
+ switch (look) {
+ case "lines":
+ return (
+ <div className={cn(frame, "flex-col gap-[5px]")}>
+ <span className={cn(bar, ink, "w-[34px]")} />
+ <span className={cn(bar, "w-6 bg-[#EDEBE6]/50")} />
+ </div>
+ );
+ case "swirl":
+ return (
+ <div className={frame}>
+ <span
+ className="size-[30px] rounded-full"
+ style={{
+ backgroundImage:
+ "conic-gradient(from 40deg, #C6F43280, #7C5CC4 33%, #141318 67%, #C6F43280)",
+ }}
+ />
+ </div>
+ );
+ case "slide":
+ return (
+ <div className={cn(frame, "gap-[3px]")}>
+ <span className={cn(bar, "w-1.5 bg-[#EDEBE6]/20")} />
+ <span className={cn(bar, ink, "w-[30px]")} />
+ </div>
+ );
+ case "words":
+ return (
+ <div className={cn(frame, "gap-1")}>
+ <span className={cn(bar, ink, "w-2.5")} />
+ <span className={cn(bar, ink, "w-1.5")} />
+ <span className={cn(bar, ink, "w-3.5")} />
+ <span className={cn(bar, "w-2.5 bg-[#EDEBE6]/40")} />
+ </div>
+ );
+ case "montage":
+ return (
+ <div className={cn(frame, "items-stretch justify-start gap-0.5")}>
+ {MONTAGE.map((backgroundImage) => (
+ <span
+ key={String(backgroundImage)}
+ className="grow basis-0"
+ style={{ backgroundImage }}
+ />
+ ))}
+ </div>
+ );
+ case "stack":
+ return (
+ <div className={cn(frame, "flex-col items-start gap-[5px] pl-[22px]")}>
+ <span className={cn(bar, ink, "w-10")} />
+ <span className={cn(bar, ink, "w-[30px]")} />
+ <span className={cn(bar, "w-9 bg-[#EDEBE6]/40")} />
+ </div>
+ );
+ case "terminal":
+ return (
+ <div className={cn(frame, "gap-1")}>
+ <svg
+ width="10"
+ height="10"
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className="shrink-0"
+ >
+ <path
+ d="m6 6 7 6-7 6"
+ fill="none"
+ stroke="#EDEBE699"
+ strokeWidth="3"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ <span className={cn(bar, ink, "w-[34px]")} />
+ <span className="h-3 w-1.5 shrink-0 rounded-[1px] bg-[#D4F25C]" />
+ </div>
+ );
+ case "logo":
+ return (
+ <div
+ className={cn(frame, "flex-col gap-1.5")}
+ style={{
+ backgroundImage:
+ "radial-gradient(circle at 50% 45%, #7C5CC455 0%, #14131800 60%)",
+ }}
+ >
+ <span className="size-4 shrink-0 rounded-[5px] border-2 border-[#EDEBE6]" />
+ <span className="h-[3px] w-6 shrink-0 rounded-[2px] bg-[#EDEBE6]/50" />
+ </div>
+ );
+ case "line":
+ return (
+ <div className={frame}>
+ <span className={cn(bar, ink, "w-12")} />
+ </div>
+ );
+ case "tease":
+ return (
+ <div className={cn(frame, "gap-1.5")}>
+ <span className={cn(bar, "w-3.5 bg-[#EDEBE6]/20")} />
+ <span className={cn(bar, ink, "w-11")} />
+ </div>
+ );
+ case "reveal":
+ return (
+ <div
+ className={cn(frame, "flex-col gap-[5px]")}
+ style={{
+ backgroundImage:
+ "radial-gradient(circle at 30% 35%, #7C5CC455 0%, #14131800 50%), radial-gradient(circle at 75% 75%, #C6F43226 0%, #14131800 45%)",
+ }}
+ >
+ <span className="h-2 w-14 shrink-0 rounded-[3px] bg-[#F5F4F0]" />
+ <span className="h-[3px] w-10 shrink-0 rounded-[2px] bg-[#EDEBE6]/50" />
+ </div>
+ );
+ case "date":
+ return (
+ <div className={frame}>
+ <span className="h-2.5 w-[52px] shrink-0 rounded-[3px] bg-[#F5F4F0]" />
+ </div>
+ );
+ case "screen":
+ return (
+ <div className={frame}>
+ <span className="flex h-[34px] w-[52px] flex-col gap-1 rounded-[4px] bg-[#EDEBE6]/12 p-1.5">
+ <span className="h-[3px] w-6 rounded-[2px] bg-[#EDEBE6]/60" />
+ <span className="h-[3px] w-9 rounded-[2px] bg-[#EDEBE6]/30" />
+ <span className="mt-auto h-1.5 w-4 self-end rounded-[2px] bg-[#D4F25C]" />
+ </span>
+ </div>
+ );
+ case "number":
+ return (
+ <div className={frame}>
+ <span className="text-[20px] leading-none font-semibold tracking-[-0.03em] text-[#F5F4F0]">
+ 18
+ </span>
+ </div>
+ );
+ }
+}
diff --git a/components/docs/guides/director-notes.tsx b/components/docs/guides/director-notes.tsx
new file mode 100644
index 00000000..9748a52a
--- /dev/null
+++ b/components/docs/guides/director-notes.tsx
@@ -0,0 +1,75 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { GuideButton, guideCard } from "./guide-ui";
+import { findLink, listItems, textOf, unquote } from "./mdx-children";
+
+const HEX = /#[0-9a-f]{6}\b/i;
+
+/**
+ * Directing notes as a chat thread: each list item is one message you'd
+ * send the agent. A hex colour in a note gets a swatch; `swatches` adds one
+ * by item index (e.g. the accent colour).
+ */
+export function GuideNotes({
+ children,
+ swatches = {},
+}: {
+ children: ReactNode;
+ swatches?: Record<number, string>;
+}) {
+ const items = listItems(children);
+
+ return (
+ <ul className="not-prose mt-4 flex flex-col items-end gap-2 rounded-card bg-surface-muted p-3 sm:p-5">
+ {items.map((item, index) => {
+ const swatch = swatches[index] ?? textOf(item).match(HEX)?.[0];
+ const round = swatches[index] !== undefined;
+ return (
+ <li
+ key={index}
+ className={cn(
+ "flex max-w-[92%] items-center gap-2 rounded-t-capsule rounded-br-tag rounded-bl-capsule px-4 py-2.5 text-[15px] leading-[22px] text-foreground",
+ guideCard,
+ )}
+ >
+ <span>{unquote(item)}</span>
+ {swatch && (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "size-4 shrink-0 shadow-[inset_0_0_0_1px_var(--color-hairline)]",
+ round ? "rounded-full" : "rounded-[5px]",
+ )}
+ style={{ backgroundColor: swatch }}
+ />
+ )}
+ </li>
+ );
+ })}
+ </ul>
+ );
+}
+
+/**
+ * "More vocabulary: [Page](/docs/…)." as a quiet line plus a button.
+ * Children: one markdown paragraph with a single link.
+ */
+export function GuideMoreLink({ children }: { children: ReactNode }) {
+ const link = findLink(children);
+ const href = typeof link?.props.href === "string" ? link.props.href : "#";
+ const label = textOf(link?.props.children);
+ const lead = textOf(children)
+ .replace(label, "")
+ .replace(/[\s:.]+$/, "");
+
+ return (
+ <div className="not-prose mt-3 flex flex-col gap-2 px-1 sm:flex-row sm:items-center sm:justify-between">
+ <span className="text-[15px] leading-[22px] text-muted-foreground">
+ {lead}
+ </span>
+ <GuideButton href={href} className="h-11 w-full sm:h-9 sm:w-auto">
+ {label}
+ </GuideButton>
+ </div>
+ );
+}
diff --git a/components/docs/guides/guide-copy-button.tsx b/components/docs/guides/guide-copy-button.tsx
new file mode 100644
index 00000000..e822e9b2
--- /dev/null
+++ b/components/docs/guides/guide-copy-button.tsx
@@ -0,0 +1,64 @@
+"use client";
+
+import { useEffect, useRef, useState } from "react";
+import { cn } from "@/lib/utils";
+import { CheckIcon, CopyIcon } from "./guide-ui";
+
+const variants = {
+ /** Header of a dark prompt panel. */
+ panel:
+ "h-[30px] gap-1.5 rounded-control-sm bg-dark-raised px-2.5 text-mono text-inverse hover:bg-dark-control dark:text-foreground",
+ /** Grey filled button on light cards. */
+ secondary:
+ "h-10 gap-2.5 rounded-control-sm bg-secondary pr-3 pl-3.5 text-small leading-[18px] font-medium text-foreground hover:bg-[#dcdde0] dark:hover:bg-[#33363b]",
+} as const;
+
+export function GuideCopyButton({
+ value,
+ label = "Copy",
+ variant = "panel",
+ className,
+}: {
+ value: string;
+ label?: string;
+ variant?: keyof typeof variants;
+ className?: string;
+}) {
+ const [copied, setCopied] = useState(false);
+ const timer = useRef<ReturnType<typeof setTimeout>>(undefined);
+
+ useEffect(() => () => clearTimeout(timer.current), []);
+
+ return (
+ <button
+ type="button"
+ onClick={() => {
+ void navigator.clipboard.writeText(value).then(() => {
+ setCopied(true);
+ clearTimeout(timer.current);
+ timer.current = setTimeout(() => setCopied(false), 1500);
+ });
+ }}
+ className={cn(
+ "inline-flex shrink-0 items-center justify-center font-sans whitespace-nowrap transition-colors duration-150 outline-none select-none focus-visible:ring-3 focus-visible:ring-ring",
+ variants[variant],
+ className,
+ )}
+ >
+ {copied ? (
+ <CheckIcon size={variant === "panel" ? 13 : 14} />
+ ) : (
+ <CopyIcon size={variant === "panel" ? 13 : 14} />
+ )}
+ {/* Both labels share one cell, so the button keeps its width. */}
+ <span className="grid">
+ <span aria-hidden="true" className="invisible col-start-1 row-start-1">
+ Copied
+ </span>
+ <span aria-live="polite" className="col-start-1 row-start-1">
+ {copied ? "Copied" : label}
+ </span>
+ </span>
+ </button>
+ );
+}
diff --git a/components/docs/guides/guide-ui.tsx b/components/docs/guides/guide-ui.tsx
new file mode 100644
index 00000000..f9d39bcb
--- /dev/null
+++ b/components/docs/guides/guide-ui.tsx
@@ -0,0 +1,226 @@
+import Link from "next/link";
+import type { ReactNode, SVGProps } from "react";
+import { landingButtonVariants } from "@/app/(home)/components/landing/ui/landing-button";
+import { cn } from "@/lib/utils";
+
+/**
+ * Shared atoms for the guide blocks: surfaces, the small guide buttons and
+ * the stroke icons the artboards repeat. Every guide block sits outside
+ * typeset (`not-prose`) and owns its own top margin.
+ */
+
+/** White card with the 1px hairline ring used across the guide artboards. */
+export const guideCard = "bg-surface shadow-[0_0_0_1px_var(--color-hairline)]";
+
+/** Always-dark panel (players, prompts): ink in light, code-black + ring in dark. */
+export const guidePanel =
+ "bg-dark-surface dark:bg-surface-sunken dark:shadow-[0_0_0_1px_var(--color-hairline)]";
+
+/**
+ * Grey count after a section heading: `## The storyboard<GuideCount n={8} />`.
+ * Fumadocs copies heading children into the TOC, so it hides inside `nav`.
+ */
+export function GuideCount({ n }: { n: number }) {
+ return (
+ <span
+ className="ml-2.5 font-normal text-subtle in-[nav]:hidden"
+ aria-hidden="true"
+ >
+ {n}
+ </span>
+ );
+}
+
+const guideButtonSize =
+ "h-10 gap-2.5 rounded-control-sm px-4 text-small leading-[18px] font-medium";
+const guideButtonSizeSm =
+ "h-9 gap-2 rounded-control-sm px-3.5 text-small leading-[18px] font-medium";
+
+export function GuideButton({
+ href,
+ children,
+ variant = "secondary",
+ size = "sm",
+ icon = "right",
+ className,
+}: {
+ href: string;
+ children: ReactNode;
+ variant?: "ink" | "secondary";
+ size?: "sm" | "md";
+ icon?: "right" | "down";
+ className?: string;
+}) {
+ return (
+ <Link
+ href={href}
+ className={cn(
+ landingButtonVariants({ variant }),
+ size === "md" ? guideButtonSize : guideButtonSizeSm,
+ className,
+ )}
+ >
+ {children}
+ {icon === "down" ? (
+ <ArrowDownIcon
+ className={
+ variant === "ink"
+ ? "text-primary-soft dark:text-primary"
+ : undefined
+ }
+ />
+ ) : (
+ <ArrowRightIcon
+ className={
+ variant === "ink"
+ ? "text-primary-soft dark:text-primary"
+ : undefined
+ }
+ />
+ )}
+ </Link>
+ );
+}
+
+function Icon({
+ children,
+ size = 14,
+ strokeWidth = 2,
+ className,
+ ...props
+}: SVGProps<SVGSVGElement> & { size?: number }) {
+ return (
+ <svg
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ aria-hidden="true"
+ className={cn("shrink-0", className)}
+ {...props}
+ >
+ {children}
+ </svg>
+ );
+}
+
+type IconProps = SVGProps<SVGSVGElement> & { size?: number };
+
+export function ArrowRightIcon(props: IconProps) {
+ return (
+ <Icon {...props}>
+ <path d="M5 12h14M13 6l6 6-6 6" />
+ </Icon>
+ );
+}
+
+export function ArrowDownIcon(props: IconProps) {
+ return (
+ <Icon {...props}>
+ <path d="M12 5v14M6 13l6 6 6-6" />
+ </Icon>
+ );
+}
+
+export function CopyIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={1.8} {...props}>
+ <rect x="8" y="8" width="12" height="12" rx="2.5" />
+ <path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" />
+ </Icon>
+ );
+}
+
+export function CheckIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={2.6} {...props}>
+ <path d="m5 12.5 4.5 4.5L19 7.5" />
+ </Icon>
+ );
+}
+
+export function PlayIcon({ size = 14, className }: IconProps) {
+ return (
+ <svg
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn("shrink-0", className)}
+ >
+ <path d="M6 3.5v17l14.5-8.5Z" fill="currentColor" />
+ </svg>
+ );
+}
+
+export function PauseIcon({ size = 14, className }: IconProps) {
+ return (
+ <svg
+ width={size}
+ height={size}
+ viewBox="0 0 24 24"
+ aria-hidden="true"
+ className={cn("shrink-0", className)}
+ >
+ <rect x="6" y="4" width="4" height="16" rx="1" fill="currentColor" />
+ <rect x="14" y="4" width="4" height="16" rx="1" fill="currentColor" />
+ </svg>
+ );
+}
+
+export function FilmIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={1.8} {...props}>
+ <rect x="3" y="5" width="18" height="14" rx="2.5" />
+ <path d="M8 5v14M16 5v14" />
+ </Icon>
+ );
+}
+
+export function ImageIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={1.8} {...props}>
+ <path d="M4 16l4.5-4.5a2 2 0 0 1 2.8 0L16 16M14 14l1.5-1.5a2 2 0 0 1 2.8 0L20 14" />
+ <rect x="3" y="4" width="18" height="16" rx="3" />
+ <circle cx="9" cy="8.5" r="1.5" fill="currentColor" stroke="none" />
+ </Icon>
+ );
+}
+
+export function DownloadIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={1.8} {...props}>
+ <path d="M12 4v11M7 10l5 5 5-5M5 20h14" />
+ </Icon>
+ );
+}
+
+export function FlagIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={2.2} {...props}>
+ <path d="M5 21V4M5 4h11l-2 4 2 4H5" />
+ </Icon>
+ );
+}
+
+export function LockIcon(props: IconProps) {
+ return (
+ <Icon {...props}>
+ <rect x="5" y="10" width="14" height="10" rx="2" />
+ <path d="M8 10V7a4 4 0 0 1 8 0v3" />
+ </Icon>
+ );
+}
+
+export function ShieldIcon(props: IconProps) {
+ return (
+ <Icon strokeWidth={1.8} {...props}>
+ <path d="M12 3 5 6v5c0 4.5 3 8 7 10 4-2 7-5.5 7-10V6Z" />
+ <path d="m9 12 2 2 4-4" />
+ </Icon>
+ );
+}
diff --git a/components/docs/guides/mdx-children.ts b/components/docs/guides/mdx-children.ts
new file mode 100644
index 00000000..46102726
--- /dev/null
+++ b/components/docs/guides/mdx-children.ts
@@ -0,0 +1,142 @@
+import {
+ Children,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+
+/**
+ * Reads plain markdown passed as children to a guide block. The guides keep
+ * their content as markdown (so `/docs/guides/*.md` and "Copy page" stay
+ * readable) and the blocks only re-lay it out. MDX renders lists, `strong`,
+ * `em` and paragraphs as intrinsic elements; fenced code arrives as a
+ * rehype-pretty-code tree whose `code` element carries the source in
+ * `__raw__` (see `source.config.ts`).
+ */
+
+type Props = { children?: ReactNode; [key: string]: unknown };
+type El = ReactElement<Props>;
+
+function isEl(node: ReactNode): node is El {
+ return isValidElement(node);
+}
+
+function isType(node: ReactNode, type: string): node is El {
+ return isEl(node) && node.type === type;
+}
+
+/** Depth-first search for the first element of an intrinsic `type`. */
+export function findElement(node: ReactNode, type: string): El | undefined {
+ for (const child of Children.toArray(node)) {
+ if (isType(child, type)) return child;
+ if (isEl(child)) {
+ const found = findElement(child.props.children, type);
+ if (found) return found;
+ }
+ }
+ return undefined;
+}
+
+/**
+ * First link inside `node`. Fumadocs maps `a` to its own Link component, so
+ * links are matched by their `href` prop rather than by type.
+ */
+export function findLink(node: ReactNode): El | undefined {
+ for (const child of Children.toArray(node)) {
+ if (!isEl(child)) continue;
+ if (typeof child.props.href === "string") return child;
+ const found = findLink(child.props.children);
+ if (found) return found;
+ }
+ return undefined;
+}
+
+/** Source of the first fenced code block inside `node`. */
+export function findRaw(node: ReactNode): string | undefined {
+ for (const child of Children.toArray(node)) {
+ if (!isEl(child)) continue;
+ if (typeof child.props.__raw__ === "string") return child.props.__raw__;
+ const found = findRaw(child.props.children);
+ if (found) return found;
+ }
+ return undefined;
+}
+
+/** Plain text of a node tree. */
+export function textOf(node: ReactNode): string {
+ return Children.toArray(node)
+ .map((child) => {
+ if (typeof child === "string" || typeof child === "number") {
+ return String(child);
+ }
+ return isEl(child) ? textOf(child.props.children) : "";
+ })
+ .join("");
+}
+
+/** Children of each `li` of the first list (`ul` or `ol`) inside `node`. */
+export function listItems(node: ReactNode): ReactNode[][] {
+ const list = findElement(node, "ol") ?? findElement(node, "ul");
+ if (!list) return [];
+ return Children.toArray(list.props.children)
+ .filter((child) => isType(child, "li"))
+ .map((li) => {
+ const content = Children.toArray((li as El).props.children);
+ // Loose lists wrap the item in a paragraph; unwrap it.
+ if (content.length === 1 && isType(content[0], "p")) {
+ return Children.toArray((content[0] as El).props.children);
+ }
+ return content;
+ });
+}
+
+/** Paragraphs (`p` children) directly inside `node`. */
+export function paragraphs(node: ReactNode): ReactNode[][] {
+ return Children.toArray(node)
+ .filter((child) => isType(child, "p"))
+ .map((p) => Children.toArray((p as El).props.children));
+}
+
+const LEAD_SEPARATOR = /^\s*(?:—|-|:)\s*/;
+
+/**
+ * Splits `**Lead** — rest` into its parts. An `em` right after the lead
+ * becomes a `tag` (e.g. `**Accent color** _optional_ — …`).
+ */
+export function splitLead(item: ReactNode[]): {
+ lead: ReactNode;
+ tag?: ReactNode;
+ rest: ReactNode[];
+} {
+ const nodes = item.filter(
+ (node, index) => !(index === 0 && typeof node === "string" && !node.trim()),
+ );
+ const first = nodes[0];
+ if (!isType(first, "strong")) return { lead: null, rest: nodes };
+
+ let rest = nodes.slice(1);
+ let tag: ReactNode;
+ const next = rest.find((node) => !(typeof node === "string" && !node.trim()));
+ if (isType(next, "em")) {
+ tag = next.props.children;
+ rest = rest.slice(rest.indexOf(next) + 1);
+ }
+ const [head, ...tail] = rest;
+ if (typeof head === "string") {
+ const trimmed = head.replace(LEAD_SEPARATOR, "");
+ rest = trimmed ? [trimmed, ...tail] : tail;
+ }
+ return { lead: first.props.children, tag, rest };
+}
+
+/** Strips one pair of wrapping straight or curly quotes from a text line. */
+export function unquote(nodes: ReactNode[]): ReactNode[] {
+ const out = [...nodes];
+ const first = out[0];
+ if (typeof first === "string") out[0] = first.replace(/^\s*["“]/, "");
+ const last = out[out.length - 1];
+ if (typeof last === "string") {
+ out[out.length - 1] = last.replace(/["”]\s*$/, "");
+ }
+ return out;
+}
diff --git a/components/docs/guides/note.tsx b/components/docs/guides/note.tsx
new file mode 100644
index 00000000..de347f38
--- /dev/null
+++ b/components/docs/guides/note.tsx
@@ -0,0 +1,87 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard, ImageIcon, ShieldIcon } from "./guide-ui";
+
+const icons = {
+ image: <ImageIcon size={18} />,
+ shield: <ShieldIcon size={18} />,
+ mute: (
+ <svg
+ width="18"
+ height="18"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ aria-hidden="true"
+ >
+ <path d="M4 9.5v5h3.5L12 18.5v-13L7.5 9.5Z" />
+ <path d="m16 9.5 5 5M21 9.5l-5 5" />
+ </svg>
+ ),
+};
+
+const tones = {
+ /** Grey well, the default side note. */
+ muted: {
+ box: "bg-surface-muted",
+ icon: cn("rounded-[10px]", guideCard),
+ },
+ /** White card with a grey icon tile. */
+ card: {
+ box: guideCard,
+ icon: "rounded-control-sm bg-surface-muted",
+ },
+ /** The page's single accent note. */
+ accent: {
+ box: "bg-primary-wash",
+ icon: cn("rounded-[10px]", guideCard),
+ },
+};
+
+/**
+ * Side note with an icon. Children are markdown paragraphs: the first reads
+ * as body copy, later ones are quieter follow-ups.
+ */
+export function GuideNote({
+ children,
+ title,
+ icon = "image",
+ tone = "muted",
+ className,
+}: {
+ children: ReactNode;
+ title?: string;
+ icon?: keyof typeof icons;
+ tone?: keyof typeof tones;
+ className?: string;
+}) {
+ return (
+ <aside
+ className={cn(
+ "not-prose mt-4 flex flex-col items-start gap-4 rounded-cta py-4 pr-[18px] pl-4 sm:flex-row",
+ tones[tone].box,
+ className,
+ )}
+ >
+ <span
+ className={cn(
+ "flex size-9 shrink-0 items-center justify-center text-foreground",
+ tones[tone].icon,
+ )}
+ >
+ {icons[icon]}
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-1.5 text-[15px] leading-[22px] text-body [&_a]:font-medium [&_a]:text-foreground [&_a]:hover:underline [&_a]:underline-offset-4 [&_code]:font-mono [&_code]:text-caption [&_code]:text-foreground [&>p+p]:text-muted-foreground [&_strong]:font-medium [&_strong]:text-foreground">
+ {title && (
+ <span className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </span>
+ )}
+ {children}
+ </div>
+ </aside>
+ );
+}
diff --git a/components/docs/guides/practice/brand-brief.tsx b/components/docs/guides/practice/brand-brief.tsx
new file mode 100644
index 00000000..7e888c78
--- /dev/null
+++ b/components/docs/guides/practice/brand-brief.tsx
@@ -0,0 +1,145 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { GuideCopyButton } from "../guide-copy-button";
+import { guideCard, guidePanel } from "../guide-ui";
+import { textOf } from "../mdx-children";
+import { TIDEPOOL, TidepoolMark } from "./brand-frames";
+
+type Field = {
+ label: string;
+ value: string;
+ swatch?: string;
+ tile?: ReactNode;
+};
+
+const FIELDS: Field[] = [
+ {
+ label: "Product",
+ value: `${TIDEPOOL.name} — a calm inbox for support teams`,
+ },
+ {
+ label: "Background, light",
+ value: TIDEPOOL.background,
+ swatch: TIDEPOOL.background,
+ },
+ {
+ label: "Text color",
+ value: TIDEPOOL.text,
+ swatch: TIDEPOOL.text,
+ },
+ {
+ label: "Accent color, used sparingly",
+ value: TIDEPOOL.accent,
+ swatch: TIDEPOOL.accent,
+ },
+ {
+ label: "Font mood",
+ value: "Clean and geometric",
+ tile: (
+ <span className="text-[15px] leading-[18px] font-semibold tracking-title">
+ Aa
+ </span>
+ ),
+ },
+ {
+ label: "Logo",
+ value: "tidepool.svg",
+ tile: <TidepoolMark size={18} />,
+ },
+ { label: "Copy tone", value: "Plain and confident, no exclamation marks" },
+];
+
+/**
+ * The brand brief: a filled-in example next to the prompt that saves it.
+ * Children: the prompt (a `GuidePrompt` around the fence).
+ */
+export function GuideBrandBrief({ children }: { children: ReactNode }) {
+ return (
+ <div className="not-prose mt-4 flex flex-col gap-4 sm:flex-row sm:items-stretch [&>figure]:mt-0 [&>figure]:min-w-0 sm:[&>figure]:grow sm:[&>figure]:basis-0">
+ <section
+ aria-label="A filled-in brand brief, for example"
+ className={cn(
+ "flex shrink-0 flex-col rounded-card p-1.5 sm:w-[296px]",
+ guideCard,
+ )}
+ >
+ <header className="flex h-11 shrink-0 items-center justify-between pr-3 pl-3.5">
+ <span className="text-small font-medium text-foreground">
+ Filled in, for example
+ </span>
+ <span className="flex h-6 items-center rounded-tile bg-surface-muted px-2 font-mono text-mono text-body">
+ BRAND.md
+ </span>
+ </header>
+ <ul className="flex grow flex-col gap-0.5 rounded-control bg-surface-muted p-1.5">
+ {FIELDS.map((field) => (
+ <li
+ key={field.label}
+ className="flex items-center gap-3 rounded-tile bg-surface px-3 py-2.5"
+ >
+ {(field.swatch || field.tile) && (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "flex size-8 shrink-0 items-center justify-center rounded-tile text-foreground",
+ field.swatch
+ ? "shadow-[inset_0_0_0_1px_var(--color-divider)]"
+ : "bg-surface-muted",
+ )}
+ style={
+ field.swatch ? { backgroundColor: field.swatch } : undefined
+ }
+ >
+ {field.tile}
+ </span>
+ )}
+ <span className="flex min-w-0 flex-col gap-0.5">
+ <span className="text-caption text-muted-foreground">
+ {field.label}
+ </span>
+ <span className="text-small text-foreground">
+ {field.value}
+ </span>
+ </span>
+ </li>
+ ))}
+ </ul>
+ </section>
+ {children}
+ </div>
+ );
+}
+
+/**
+ * "From then on…" line with the one sentence to start every prompt with.
+ * Children: one markdown paragraph whose bold part is the sentence.
+ */
+export function GuideBrandLine({ children }: { children: ReactNode }) {
+ const full = textOf(children);
+ const line = full.match(/"([^"]+)"/)?.[1] ?? "";
+ const lead = full.replace(/\s*"[^"]+"\.?\s*$/, "");
+
+ return (
+ <div
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-3 rounded-card p-2 sm:flex-row sm:items-center sm:gap-[18px] sm:pl-5",
+ guideCard,
+ )}
+ >
+ <p className="grow px-2 pt-2 text-[15px] leading-[22px] text-body sm:p-0">
+ {lead}
+ </p>
+ <span
+ className={cn(
+ "flex h-12 shrink-0 items-center justify-between gap-3 rounded-control-sm pr-1.5 pl-[18px]",
+ guidePanel,
+ )}
+ >
+ <code className="font-mono text-caption leading-[18px] text-[#e4e5e7]">
+ {line}
+ </code>
+ <GuideCopyButton value={line} className="h-9 rounded-tag" />
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/brand-frames.tsx b/components/docs/guides/practice/brand-frames.tsx
new file mode 100644
index 00000000..515e669e
--- /dev/null
+++ b/components/docs/guides/practice/brand-frames.tsx
@@ -0,0 +1,102 @@
+import { cn } from "@/lib/utils";
+
+/** The example brand used across this guide (a made-up product). */
+export const TIDEPOOL = {
+ name: "Tidepool",
+ line: "A calm inbox for support teams",
+ background: "#F6F4EF",
+ text: "#1B1F23",
+ accent: "#2F5BFF",
+};
+
+const DEFAULT_LOOK = {
+ background: "#141318",
+ text: "#F4F2EC",
+ accent: "#D4F25C",
+};
+
+/** Tidepool's wave mark. */
+export function TidepoolMark({ size = 16 }: { size?: number }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 16 16" aria-hidden="true">
+ <circle cx="8" cy="8" r="7" fill={TIDEPOOL.accent} />
+ <path
+ d="M3.5 9.2c1.5-1.4 3-1.4 4.5 0s3 1.4 4.5 0"
+ fill="none"
+ stroke="#fff"
+ strokeWidth="1.6"
+ strokeLinecap="round"
+ />
+ </svg>
+ );
+}
+
+/** One beat, twice: remocn's default look, then the same frame on brand. */
+export function GuideBrandFrames() {
+ return (
+ <ul className="not-prose mt-6 grid gap-4 pt-2 sm:grid-cols-2">
+ <Frame
+ caption="remocn default"
+ hex={DEFAULT_LOOK.background}
+ look={DEFAULT_LOOK}
+ className="dark:shadow-[0_0_0_1px_var(--color-hairline)]"
+ />
+ <Frame
+ caption="Same frame, with your brand brief"
+ hex={TIDEPOOL.background}
+ look={TIDEPOOL}
+ mark
+ className="shadow-[0_0_0_1px_var(--color-hairline)]"
+ />
+ </ul>
+ );
+}
+
+function Frame({
+ caption,
+ hex,
+ look,
+ mark,
+ className,
+}: {
+ caption: string;
+ hex: string;
+ look: { background: string; text: string; accent: string };
+ mark?: boolean;
+ className?: string;
+}) {
+ return (
+ <li className="flex flex-col gap-3">
+ <div
+ aria-hidden="true"
+ className={cn(
+ "relative flex aspect-[360/203] flex-col items-start justify-center gap-2.5 overflow-hidden rounded-card px-8",
+ className,
+ )}
+ style={{ backgroundColor: look.background, color: look.text }}
+ >
+ <span className="flex items-center gap-[7px] text-caption opacity-60">
+ {mark && <TidepoolMark />}
+ Introducing
+ </span>
+ <span className="flex items-baseline gap-[9px] text-[34px] leading-[38px] font-semibold tracking-[-0.04em]">
+ Meet <span style={{ color: look.accent }}>{TIDEPOOL.name}</span>
+ </span>
+ <span className="text-small opacity-70">{TIDEPOOL.line}</span>
+ <span className="absolute bottom-3 left-3 flex h-6 items-center rounded-tile px-2 text-mono">
+ <span
+ className="absolute inset-0 rounded-tile opacity-10"
+ style={{ backgroundColor: look.text }}
+ />
+ <span className="relative">Beat 2</span>
+ </span>
+ </div>
+ <div className="flex items-baseline justify-between px-1">
+ <span className="text-small font-medium text-foreground">
+ {caption}
+ </span>
+ <span className="text-mono text-muted-foreground">{hex}</span>
+ </div>
+ </li>
+ );
+}
diff --git a/components/docs/guides/practice/built-rules.tsx b/components/docs/guides/practice/built-rules.tsx
new file mode 100644
index 00000000..65b5fc95
--- /dev/null
+++ b/components/docs/guides/practice/built-rules.tsx
@@ -0,0 +1,125 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+import { frameTile, inkChip } from "./frame";
+
+type RuleArt = "one-idea" | "two-seconds" | "beat-count";
+
+/**
+ * The three rules of a beat as illustrated cards. Children: a markdown list
+ * of `**Rule** — explanation`; `art` picks the picture for each item.
+ */
+export function BuiltRules({
+ children,
+ art,
+}: {
+ children: ReactNode;
+ art: RuleArt[];
+}) {
+ const items = listItems(children).map(splitLead);
+
+ return (
+ <ul className="not-prose mt-4 grid gap-3 sm:grid-cols-3">
+ {items.map((item, index) => (
+ <li
+ key={index}
+ className={cn("flex flex-col rounded-card p-2", guideCard)}
+ >
+ <RuleArtwork art={art[index]} />
+ <div className="flex flex-col gap-1 px-3 pt-3.5 pb-3">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {item.lead}
+ </span>
+ <span className="text-small text-muted-foreground [&_a]:text-inherit [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4 [&_a]:hover:text-foreground">
+ {item.rest}
+ </span>
+ </div>
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+const well = "flex h-24 shrink-0 rounded-control-sm bg-surface-muted";
+
+function RuleArtwork({ art }: { art?: RuleArt }) {
+ if (art === "one-idea") {
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(well, "items-center justify-center gap-2.5")}
+ >
+ <span
+ className={cn(
+ "flex h-9 w-16 items-center justify-center rounded-tag",
+ frameTile,
+ )}
+ >
+ <span className="h-1 w-8 rounded-[2px] bg-[#FAFAFA]" />
+ </span>
+ <span className="text-caption text-muted-foreground line-through">
+ and
+ </span>
+ <span
+ className={cn(
+ "flex h-9 w-16 items-center justify-center rounded-tag",
+ frameTile,
+ )}
+ >
+ <span className="h-1 w-6 rounded-[2px] bg-[#FAFAFA]" />
+ </span>
+ </div>
+ );
+ }
+ if (art === "two-seconds") {
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(well, "flex-col justify-center gap-2 px-4")}
+ >
+ <div className="flex gap-1">
+ <span
+ className={cn(
+ "flex h-8 w-[124px] shrink-0 items-center rounded-tile pl-2.5 text-mono",
+ inkChip,
+ )}
+ >
+ Read once
+ </span>
+ <span className="flex h-8 w-[60px] shrink-0 items-center rounded-tile bg-secondary pl-2 text-mono text-subtle line-through dark:text-muted-foreground">
+ twice
+ </span>
+ </div>
+ <div className="flex text-mono">
+ <span className="w-[124px] shrink-0 text-muted-foreground">0 s</span>
+ <span className="font-medium text-foreground">2 s</span>
+ </div>
+ </div>
+ );
+ }
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(well, "flex-col justify-center gap-2 px-4")}
+ >
+ <div className="flex gap-1">
+ {Array.from({ length: 10 }, (_, i) => (
+ <span
+ key={i}
+ className={cn(
+ "h-8 w-[15px] shrink-0 rounded-[5px]",
+ i < 5 ? "bg-foreground" : "bg-foreground/26",
+ )}
+ />
+ ))}
+ </div>
+ <div className="flex w-[186px] text-mono">
+ <span className="w-[91px] shrink-0 text-right font-medium text-foreground">
+ 5
+ </span>
+ <span className="grow text-right text-muted-foreground">10</span>
+ </div>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/built-skeleton.tsx b/components/docs/guides/practice/built-skeleton.tsx
new file mode 100644
index 00000000..36158860
--- /dev/null
+++ b/components/docs/guides/practice/built-skeleton.tsx
@@ -0,0 +1,125 @@
+import {
+ Children,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+import { frameTile } from "./frame";
+
+type Act = { range: string; beats: number };
+
+/** Bar lengths of the tiny frames, one per beat across the whole video. */
+const BAR_WIDTHS = [44, 32, 38, 48, 28, 42, 34, 52];
+
+/**
+ * The three-act skeleton: acts drawn as runs of beat frames, the acts'
+ * meaning underneath and a rule of thumb. Children: a markdown list of
+ * `**Act** — meaning`, then a `**Question?** answer` paragraph.
+ */
+export function BuiltSkeleton({
+ children,
+ acts,
+}: {
+ children: ReactNode;
+ acts: Act[];
+}) {
+ const items = listItems(children).map(splitLead);
+ const note = Children.toArray(children).find(
+ (child): child is ReactElement<{ children?: ReactNode }> =>
+ isValidElement(child) && child.type === "p",
+ );
+ let beat = 0;
+
+ return (
+ <div
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-6 rounded-card p-4 sm:p-6",
+ guideCard,
+ )}
+ >
+ <div
+ aria-hidden="true"
+ className="flex flex-col gap-5 sm:flex-row sm:gap-4"
+ >
+ {acts.map((act, index) => (
+ <div
+ key={act.range}
+ style={{ flexGrow: act.beats }}
+ className="flex basis-0 flex-col gap-2.5"
+ >
+ <div className="flex items-baseline justify-between gap-0.5 sm:flex-col sm:items-start">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {items[index]?.lead}
+ </span>
+ <span className="text-caption text-subtle">{act.range}</span>
+ </div>
+ <span className="h-1.5 rounded-[3px] bg-secondary" />
+ <div className="flex gap-1.5">
+ {Array.from({ length: act.beats }, () => {
+ beat += 1;
+ const last = beat === BAR_WIDTHS.length;
+ return (
+ <span
+ key={beat}
+ className={cn(
+ "flex h-[52px] max-w-[78px] min-w-0 flex-1 flex-col justify-between rounded-tile px-[9px] pt-[9px] pb-[7px]",
+ frameTile,
+ )}
+ >
+ <span
+ className={cn(
+ "h-1 max-w-full rounded-[2px]",
+ last ? "bg-primary-soft" : "bg-[#FAFAFA]",
+ )}
+ style={{ width: BAR_WIDTHS[beat - 1] ?? 36 }}
+ />
+ <span className="text-mono leading-[14px] text-dark-subtle">
+ {beat}
+ </span>
+ </span>
+ );
+ })}
+ </div>
+ </div>
+ ))}
+ </div>
+
+ <ol className="grid gap-4 border-t border-hairline pt-5 sm:grid-cols-3 sm:gap-5">
+ {items.map((item, index) => (
+ <li key={index} className="flex flex-col gap-1 text-small">
+ <span className="font-medium text-foreground">{item.lead}</span>
+ <span className="text-muted-foreground">{item.rest}</span>
+ </li>
+ ))}
+ </ol>
+
+ {note && <RuleOfThumb>{note.props.children}</RuleOfThumb>}
+ </div>
+ );
+}
+
+function RuleOfThumb({ children }: { children: ReactNode }) {
+ const nodes = Children.toArray(children);
+ const [first, ...rest] = nodes;
+ const hasTitle = isValidElement(first) && first.type === "strong";
+
+ return (
+ <p className="flex flex-col gap-0.5 rounded-control-sm bg-surface-muted px-4 py-3.5 text-small text-body">
+ {hasTitle && (
+ <span className="font-medium text-foreground">
+ {(first as ReactElement<{ children?: ReactNode }>).props.children}
+ </span>
+ )}
+ <span>
+ {hasTitle
+ ? rest.map((node) =>
+ typeof node === "string" ? node.replace(/^\s+/, "") : node,
+ )
+ : nodes}
+ </span>
+ </p>
+ );
+}
diff --git a/components/docs/guides/practice/built-vocabulary.tsx b/components/docs/guides/practice/built-vocabulary.tsx
new file mode 100644
index 00000000..990053dd
--- /dev/null
+++ b/components/docs/guides/practice/built-vocabulary.tsx
@@ -0,0 +1,208 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+import { frameTile } from "./frame";
+
+type VocabArt =
+ | "headline"
+ | "stack"
+ | "background"
+ | "cut"
+ | "terminal"
+ | "app"
+ | "logo"
+ | "counter";
+
+/**
+ * Plain words that map to what remocn builds, as a grid of tiny frames.
+ * Children: a markdown list of `**"phrase"** — what it is`; `art` picks a
+ * frame per item.
+ */
+export function BuiltVocabulary({
+ children,
+ art,
+}: {
+ children: ReactNode;
+ art: VocabArt[];
+}) {
+ const items = listItems(children).map(splitLead);
+
+ return (
+ <ul className="not-prose mt-4 grid grid-cols-2 gap-3 sm:grid-cols-4">
+ {items.map((item, index) => (
+ <li
+ key={index}
+ className={cn("flex flex-col rounded-card p-2", guideCard)}
+ >
+ <VocabFrame art={art[index]} />
+ <div className="flex flex-col gap-1 px-2 pt-3 pb-2">
+ <span className="text-small font-medium text-foreground">
+ {item.lead}
+ </span>
+ {item.rest.length > 0 && (
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {item.rest}
+ </span>
+ )}
+ </div>
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+const frame = "flex h-[92px] shrink-0 overflow-hidden rounded-control-sm";
+
+function VocabFrame({ art }: { art?: VocabArt }) {
+ switch (art) {
+ case "headline":
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ frame,
+ frameTile,
+ "items-center justify-center gap-1.5",
+ )}
+ >
+ <span className="text-[22px] leading-[26px] font-semibold tracking-[-0.03em] text-[#FAFAFA]">
+ Ship
+ </span>
+ <span className="pt-3.5 text-[22px] leading-[26px] font-semibold tracking-[-0.03em] text-[#FAFAFA]/40">
+ it.
+ </span>
+ </div>
+ );
+ case "stack":
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ frame,
+ frameTile,
+ "flex-col justify-center gap-[7px] pl-7",
+ )}
+ >
+ <span className="h-1.5 w-[84px] rounded-[3px] bg-[#FAFAFA]" />
+ <span className="h-1.5 w-16 rounded-[3px] bg-[#FAFAFA]" />
+ <span className="h-1.5 w-24 rounded-[3px] bg-[#FAFAFA]/35" />
+ </div>
+ );
+ case "background":
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(frame, frameTile)}
+ style={{
+ backgroundImage:
+ "radial-gradient(ellipse 70% 60% at 30% 70%, #E879F9 0%, #A21CAF55 40%, transparent 70%), radial-gradient(ellipse 60% 70% at 75% 25%, #7C3AED 0%, #4C1D9555 45%, transparent 75%), linear-gradient(135deg, #2E1065, #0E1012)",
+ }}
+ />
+ );
+ case "cut":
+ return (
+ <div aria-hidden="true" className={cn(frame, "bg-surface-muted")}>
+ <span
+ className={cn("flex flex-1 items-center justify-center", frameTile)}
+ >
+ <span className="h-1.5 w-9 rounded-[3px] bg-[#FAFAFA]" />
+ </span>
+ <span className="flex flex-1 items-center justify-center bg-primary-tint">
+ <span className="h-1.5 w-[30px] rounded-[3px] bg-dark-surface dark:bg-foreground" />
+ </span>
+ </div>
+ );
+ case "terminal":
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(frame, frameTile, "flex-col gap-[18px] px-3 py-2.5")}
+ >
+ <span className="flex gap-1">
+ <span className="size-1.5 rounded-full bg-[#FAFAFA]/25" />
+ <span className="size-1.5 rounded-full bg-[#FAFAFA]/25" />
+ <span className="size-1.5 rounded-full bg-[#FAFAFA]/25" />
+ </span>
+ <span className="flex items-center gap-0.5 font-mono text-mono whitespace-nowrap text-[#E4E5E7]">
+ $ npx shadcn add
+ <span className="h-3.5 w-[7px] shrink-0 rounded-[1px] bg-primary-soft" />
+ </span>
+ </div>
+ );
+ case "app":
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ frame,
+ "relative items-center justify-center bg-surface-muted",
+ )}
+ >
+ <span className="flex w-28 flex-col gap-2 rounded-[10px] bg-surface p-2.5 shadow-[0_0_0_1px_rgb(14_16_18/8%),0_4px_12px_rgb(14_16_18/6%)] dark:shadow-[0_0_0_1px_var(--color-divider)]">
+ <span className="h-[5px] w-14 rounded-[3px] bg-secondary" />
+ <span className="h-[5px] w-20 rounded-[3px] bg-secondary" />
+ <span
+ className={cn(
+ "flex h-[22px] w-14 items-center justify-center rounded-[7px] text-micro leading-3 font-medium",
+ "bg-dark-surface text-[#FAFAFA] dark:bg-foreground dark:text-background",
+ )}
+ >
+ Save
+ </span>
+ </span>
+ <svg
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ className="absolute top-14 left-[calc(50%+8px)]"
+ >
+ <path
+ d="M5 3l14 8-6 2-3 6L5 3Z"
+ fill="#0E1012"
+ stroke="#FFFFFF"
+ strokeWidth="1.5"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </div>
+ );
+ case "logo":
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(frame, frameTile, "items-center justify-center")}
+ >
+ <svg width="52" height="52" viewBox="0 0 52 52">
+ <path
+ d="M26 6 A20 20 0 1 1 7.2 32.8"
+ fill="none"
+ stroke="#FAFAFA"
+ strokeWidth="4"
+ strokeLinecap="round"
+ />
+ <path
+ d="M19 17v18M19 17h8a6 6 0 0 1 0 12h-8M27 29l6 6"
+ fill="none"
+ stroke="rgb(250 250 250 / 30%)"
+ strokeWidth="4"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ <circle cx="7.2" cy="32.8" r="4" fill="#F0ABFC" />
+ </svg>
+ </div>
+ );
+ default:
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(frame, frameTile, "items-center justify-center")}
+ >
+ <span className="text-[34px] leading-[38px] font-semibold tracking-[-0.04em] text-[#FAFAFA]">
+ 110+
+ </span>
+ </div>
+ );
+ }
+}
diff --git a/components/docs/guides/practice/clapper-icon.tsx b/components/docs/guides/practice/clapper-icon.tsx
new file mode 100644
index 00000000..6355c64f
--- /dev/null
+++ b/components/docs/guides/practice/clapper-icon.tsx
@@ -0,0 +1,19 @@
+/** Film clapperboard, for hand-offs to the directing guide. */
+export function ClapperIcon() {
+ return (
+ <svg
+ aria-hidden="true"
+ width="18"
+ height="18"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.7"
+ strokeLinejoin="round"
+ >
+ <path d="M4 10h16v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9Z" />
+ <path d="M4 10 3.4 6.6a1 1 0 0 1 .8-1.2l13.8-2.4a1 1 0 0 1 1.2.8L19.6 7 4 10Z" />
+ <path d="m8.5 5 2.5 3.3M13.5 4.1 16 7.4" strokeLinecap="round" />
+ </svg>
+ );
+}
diff --git a/components/docs/guides/practice/consistency-strip.tsx b/components/docs/guides/practice/consistency-strip.tsx
new file mode 100644
index 00000000..0b540e34
--- /dev/null
+++ b/components/docs/guides/practice/consistency-strip.tsx
@@ -0,0 +1,110 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { TIDEPOOL } from "./brand-frames";
+
+type Tile = {
+ background: string;
+ text: string;
+ accent: string;
+ widths: [number, number];
+ align?: string;
+ ring?: boolean;
+};
+
+const ONE_LOOK: Tile[] = [
+ { ...TIDEPOOL, widths: [56, 34], ring: true },
+ { ...TIDEPOOL, widths: [44, 60], ring: true },
+ { ...TIDEPOOL, widths: [64, 28], ring: true },
+];
+
+const THREE_LOOKS: Tile[] = [
+ {
+ background: "#141318",
+ text: "#F4F2EC",
+ accent: "#D4F25C",
+ widths: [56, 34],
+ },
+ {
+ background: "#FFE7D6",
+ text: "#7A2E12",
+ accent: "#E8590C",
+ widths: [44, 60],
+ align: "items-center",
+ },
+ {
+ background: "#0F2A2A",
+ text: "#DDF3EE",
+ accent: "#3FD0B0",
+ widths: [64, 28],
+ align: "justify-end pb-3",
+ },
+];
+
+/**
+ * "Consistency compounds": three videos in one look next to three videos
+ * in three looks. Children: the sentence (one markdown paragraph).
+ */
+export function GuideConsistency({ children }: { children: ReactNode }) {
+ return (
+ <figure
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-3.5 rounded-card p-5",
+ guideCard,
+ )}
+ >
+ <figcaption className="text-ui leading-6 text-body [&_p]:m-0">
+ {children}
+ </figcaption>
+ <div className="flex flex-col gap-4 sm:flex-row">
+ <Group tiles={ONE_LOOK} label="One look, a channel" strong />
+ <Group tiles={THREE_LOOKS} label="Three looks, three experiments" />
+ </div>
+ </figure>
+ );
+}
+
+function Group({
+ tiles,
+ label,
+ strong,
+}: {
+ tiles: Tile[];
+ label: string;
+ strong?: boolean;
+}) {
+ return (
+ <div className="flex min-w-0 grow basis-0 flex-col gap-2.5">
+ <div aria-hidden="true" className="grid grid-cols-3 gap-2">
+ {tiles.map((tile, index) => (
+ <span
+ key={index}
+ className={cn(
+ "flex h-[61px] flex-col justify-center gap-[5px] rounded-tile px-3",
+ tile.align,
+ tile.ring && "shadow-[0_0_0_1px_var(--color-hairline)]",
+ )}
+ style={{ backgroundColor: tile.background }}
+ >
+ <span
+ className="h-[7px] max-w-full rounded-[4px]"
+ style={{ width: tile.widths[0], backgroundColor: tile.text }}
+ />
+ <span
+ className="h-[7px] max-w-full rounded-[4px]"
+ style={{ width: tile.widths[1], backgroundColor: tile.accent }}
+ />
+ </span>
+ ))}
+ </div>
+ <span
+ className={cn(
+ "text-small font-medium",
+ strong ? "text-foreground" : "text-muted-foreground",
+ )}
+ >
+ {label}
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/cta-card.tsx b/components/docs/guides/practice/cta-card.tsx
new file mode 100644
index 00000000..e63729da
--- /dev/null
+++ b/components/docs/guides/practice/cta-card.tsx
@@ -0,0 +1,66 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { GuideButton, guideCard } from "../guide-ui";
+import { findLink, paragraphs, textOf } from "../mdx-children";
+
+/**
+ * White card that hands off to another guide: icon tile, a title line, a
+ * quieter sub line and an ink button. Children: markdown paragraphs — the
+ * title, the sub line, and a last paragraph holding only the link, which
+ * becomes the button.
+ */
+export function GuideCtaCard({
+ icon,
+ children,
+}: {
+ /** Glyph for the 44px tile; defaults to a 9:16 + 1:1 frame pair. */
+ icon?: ReactNode;
+ children: ReactNode;
+}) {
+ const all = paragraphs(children);
+ const link = findLink(children);
+ const [title = [], sub = []] = all.filter((p) => !findLink(p));
+ const href = typeof link?.props.href === "string" ? link.props.href : "#";
+ const label = textOf(link?.props.children);
+
+ return (
+ <div
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-4 rounded-card py-[18px] pr-[18px] pl-5 sm:flex-row sm:items-center sm:gap-[18px]",
+ guideCard,
+ )}
+ >
+ <div className="flex grow items-center gap-[18px]">
+ <span className="flex size-11 shrink-0 items-center justify-center gap-[3px] rounded-control-sm bg-surface-muted text-foreground">
+ {icon ?? <FormatsGlyph />}
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-0.5">
+ <p className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </p>
+ {sub.length > 0 && (
+ <p className="text-small text-muted-foreground">{sub}</p>
+ )}
+ </div>
+ </div>
+ <GuideButton
+ href={href}
+ variant="ink"
+ size="md"
+ className="h-11 w-full sm:h-10 sm:w-auto"
+ >
+ {label}
+ </GuideButton>
+ </div>
+ );
+}
+
+/** A vertical and a square frame side by side. */
+function FormatsGlyph() {
+ return (
+ <>
+ <span className="h-4 w-[9px] rounded-[2px] border-[1.8px] border-current" />
+ <span className="size-3.5 rounded-[2px] border-[1.8px] border-current" />
+ </>
+ );
+}
diff --git a/components/docs/guides/practice/definition-table.tsx b/components/docs/guides/practice/definition-table.tsx
new file mode 100644
index 00000000..7e1b3a70
--- /dev/null
+++ b/components/docs/guides/practice/definition-table.tsx
@@ -0,0 +1,66 @@
+import type { CSSProperties, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+
+const TRAILING_QUOTE = /^([\s\S]*?:)\s*("[^"]+")\s*$/;
+
+/**
+ * Term + explanation rows on a white card. Children: a markdown list of
+ * `**Term** — explanation`. When an explanation ends with `…: "A quote."`,
+ * the quote is lifted into a grey pill under the text — the sentence you
+ * would actually type to the agent.
+ */
+export function GuideDefinitions({
+ children,
+ termWidth = 200,
+}: {
+ children: ReactNode;
+ /** Width of the term column on desktop, in px. */
+ termWidth?: number;
+}) {
+ const items = listItems(children).map(splitLead);
+
+ return (
+ <dl
+ className={cn(
+ "not-prose mt-4 flex flex-col rounded-card p-1.5",
+ guideCard,
+ )}
+ >
+ {items.map((item, index) => {
+ const { text, quote } = liftQuote(item.rest);
+ return (
+ <div
+ key={index}
+ className="flex flex-col gap-1.5 rounded-control px-3.5 py-3.5 sm:flex-row sm:items-start sm:gap-4 sm:py-4"
+ >
+ <dt
+ className="shrink-0 text-[15px] leading-[22px] font-medium text-foreground sm:w-[var(--term)]"
+ style={{ "--term": `${termWidth}px` } as CSSProperties}
+ >
+ {item.lead}
+ </dt>
+ <dd className="flex min-w-0 grow flex-col items-start gap-2.5 text-[15px] leading-[22px] text-body [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4 [&_a]:hover:decoration-foreground">
+ <span>{text}</span>
+ {quote && (
+ <q className="rounded-tile bg-secondary px-3 py-1.5 text-small text-foreground [quotes:none]">
+ {quote}
+ </q>
+ )}
+ </dd>
+ </div>
+ );
+ })}
+ </dl>
+ );
+}
+
+/** Splits a trailing `: "quote"` off the last text node. */
+function liftQuote(nodes: ReactNode[]): { text: ReactNode[]; quote?: string } {
+ const last = nodes[nodes.length - 1];
+ if (typeof last !== "string") return { text: nodes };
+ const match = TRAILING_QUOTE.exec(last);
+ if (!match) return { text: nodes };
+ return { text: [...nodes.slice(0, -1), match[1]], quote: match[2] };
+}
diff --git a/components/docs/guides/practice/directing-finish.tsx b/components/docs/guides/practice/directing-finish.tsx
new file mode 100644
index 00000000..9fbf6ec2
--- /dev/null
+++ b/components/docs/guides/practice/directing-finish.tsx
@@ -0,0 +1,80 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+
+/**
+ * The last asks, as command pills with what you get back. Children: a
+ * markdown list of `**"Ask."** — result`; the first item is the main one.
+ */
+export function DirectingFinish({ children }: { children: ReactNode }) {
+ const items = listItems(children).map(splitLead);
+
+ return (
+ <ul
+ className={cn(
+ "not-prose mt-4 flex flex-col rounded-card p-1.5",
+ guideCard,
+ )}
+ >
+ {items.map((item, index) => {
+ const main = index === 0;
+ return (
+ <li
+ key={index}
+ className="flex flex-col gap-2.5 px-3 py-3.5 sm:min-h-16 sm:flex-row sm:items-center sm:gap-4 sm:py-2"
+ >
+ <span className="sm:w-[340px] sm:shrink-0">
+ <span
+ className={cn(
+ "inline-flex h-9 items-center gap-2 rounded-control-sm px-3.5 text-small font-medium",
+ main
+ ? "bg-dark-surface text-[#FAFAFA] dark:bg-foreground dark:text-background"
+ : "bg-secondary text-foreground",
+ )}
+ >
+ {main ? (
+ <svg
+ aria-hidden="true"
+ width="13"
+ height="13"
+ viewBox="0 0 24 24"
+ >
+ <path d="M7 4.5v15l13-7.5-13-7.5Z" fill="#F0ABFC" />
+ </svg>
+ ) : (
+ <svg
+ aria-hidden="true"
+ width="13"
+ height="13"
+ viewBox="0 0 24 24"
+ >
+ <rect
+ x="7"
+ y="3"
+ width="10"
+ height="18"
+ rx="2.5"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ />
+ </svg>
+ )}
+ {item.lead}
+ </span>
+ </span>
+ <span
+ className={cn(
+ "text-small [&_code]:mx-0.5 [&_code]:rounded-tag [&_code]:bg-surface-muted [&_code]:px-1.5 [&_code]:py-0.5 [&_code]:font-mono [&_code]:text-mono [&_code]:text-foreground",
+ main ? "text-body" : "text-muted-foreground",
+ )}
+ >
+ {item.rest}
+ </span>
+ </li>
+ );
+ })}
+ </ul>
+ );
+}
diff --git a/components/docs/guides/practice/directing-loop.tsx b/components/docs/guides/practice/directing-loop.tsx
new file mode 100644
index 00000000..41be6b6d
--- /dev/null
+++ b/components/docs/guides/practice/directing-loop.tsx
@@ -0,0 +1,187 @@
+import {
+ Children,
+ Fragment,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+import { cn } from "@/lib/utils";
+import { ArrowRightIcon, guideCard } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+import { frameTile } from "./frame";
+
+const ART = [WatchArt, NotesArt, MessageArt];
+
+/**
+ * The directing loop: watch, note beat by beat, send one message, then
+ * back to watching. Children: a markdown ordered list of `**Step** — what
+ * to do`, then a `**Watch again** — …` paragraph for the loop-back label.
+ */
+export function DirectingLoop({ children }: { children: ReactNode }) {
+ const steps = listItems(children).map(splitLead);
+ const again = Children.toArray(children).find(
+ (child): child is ReactElement<{ children?: ReactNode }> =>
+ isValidElement(child) && child.type === "p",
+ );
+ const loop = again ? splitLead(Children.toArray(again.props.children)) : null;
+
+ return (
+ <div className="not-prose mt-4 flex flex-col">
+ <ol className="flex flex-col items-stretch sm:flex-row">
+ {steps.map((step, index) => {
+ const Art = ART[index] ?? WatchArt;
+ return (
+ <Fragment key={index}>
+ {index > 0 && (
+ <li
+ aria-hidden="true"
+ className="flex h-7 shrink-0 items-center justify-center text-subtle sm:h-auto sm:w-8 sm:items-start sm:pt-[38px]"
+ >
+ <ArrowRightIcon size={16} className="rotate-90 sm:rotate-0" />
+ </li>
+ )}
+ <li
+ className={cn(
+ "flex min-w-0 flex-1 gap-3 rounded-card p-2 sm:flex-col sm:gap-0",
+ guideCard,
+ )}
+ >
+ <Art />
+ <div className="flex min-w-0 flex-col gap-1.5 py-1 pr-1 sm:px-3 sm:pt-3.5 sm:pb-3">
+ <span className="flex items-center gap-2">
+ <span className="flex size-[22px] shrink-0 items-center justify-center rounded-full bg-secondary text-mono font-medium text-foreground">
+ {index + 1}
+ </span>
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {step.lead}
+ </span>
+ </span>
+ <span className="text-small text-muted-foreground">
+ {step.rest}
+ </span>
+ </div>
+ </li>
+ </Fragment>
+ );
+ })}
+ </ol>
+
+ {loop && (
+ <div className="relative flex h-11 items-end justify-center">
+ <span
+ aria-hidden="true"
+ className="absolute top-0 hidden h-7 rounded-b-control border-2 border-t-0 border-secondary sm:block"
+ style={{
+ left: "calc((100% - 64px) / 6)",
+ right: "calc((100% - 64px) / 6)",
+ }}
+ />
+ <svg
+ aria-hidden="true"
+ width="12"
+ height="12"
+ viewBox="0 0 24 24"
+ className="absolute -top-0.5 hidden text-subtle sm:block"
+ style={{ left: "calc((100% - 64px) / 6 - 5px)" }}
+ >
+ <path
+ d="M12 20V5M5 11l7-7 7 7"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="3"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ <p className="relative flex h-[30px] items-center gap-1.5 rounded-[10px] bg-secondary px-3 text-caption">
+ <svg
+ aria-hidden="true"
+ width="13"
+ height="13"
+ viewBox="0 0 24 24"
+ className="shrink-0 text-foreground"
+ >
+ <path
+ d="M20 12a8 8 0 1 1-2.3-5.7M20 4v5h-5"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ <span className="font-medium text-foreground">{loop.lead}</span>
+ <span className="text-muted-foreground">{loop.rest}</span>
+ </p>
+ </div>
+ )}
+ </div>
+ );
+}
+
+const well =
+ "flex h-[76px] w-[120px] shrink-0 items-center justify-center rounded-control-sm bg-surface-muted sm:w-auto";
+
+function WatchArt() {
+ return (
+ <div aria-hidden="true" className={well}>
+ <span
+ className={cn(
+ "flex h-10 w-[100px] items-center gap-2.5 rounded-control-sm px-3 sm:w-[168px]",
+ frameTile,
+ )}
+ >
+ <svg width="12" height="12" viewBox="0 0 24 24" className="shrink-0">
+ <path d="M7 4.5v15l13-7.5-13-7.5Z" fill="#FAFAFA" />
+ </svg>
+ <span className="h-2 grow rounded-[4px] bg-[#FAFAFA]" />
+ </span>
+ </div>
+ );
+}
+
+function NotesArt() {
+ return (
+ <div aria-hidden="true" className={cn(well, "gap-1 sm:gap-1.5")}>
+ {[1, 2, 3, 4, 5].map((n) => (
+ <span
+ key={n}
+ className={cn(
+ "flex size-4 items-center justify-center rounded-[5px] text-[9px] sm:size-7 sm:rounded-tile sm:text-mono",
+ n % 2
+ ? "bg-primary-tint font-semibold text-foreground"
+ : "bg-secondary font-medium text-muted-foreground",
+ )}
+ >
+ {n}
+ </span>
+ ))}
+ </div>
+ );
+}
+
+function MessageArt() {
+ return (
+ <div aria-hidden="true" className={well}>
+ <span className="flex w-[100px] items-end gap-2.5 rounded-control-sm bg-surface pt-2.5 pr-2 pb-2 pl-3 shadow-[0_0_0_1px_rgb(14_16_18/8%)] sm:w-[168px] dark:shadow-[0_0_0_1px_var(--color-divider)]">
+ <span className="flex grow flex-col gap-[5px]">
+ <span className="h-[5px] w-full max-w-24 rounded-[3px] bg-secondary" />
+ <span className="h-[5px] w-4/5 max-w-20 rounded-[3px] bg-secondary" />
+ <span className="h-[5px] w-3/5 max-w-14 rounded-[3px] bg-secondary" />
+ </span>
+ <span className="flex size-6 shrink-0 items-center justify-center rounded-control-sm bg-dark-surface dark:bg-foreground">
+ <svg width="12" height="12" viewBox="0 0 24 24">
+ <path
+ d="M12 19V5M6 11l6-6 6 6"
+ fill="none"
+ stroke="#F0ABFC"
+ strokeWidth="2.4"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ </span>
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/directing-options.tsx b/components/docs/guides/practice/directing-options.tsx
new file mode 100644
index 00000000..38e0e35a
--- /dev/null
+++ b/components/docs/guides/practice/directing-options.tsx
@@ -0,0 +1,97 @@
+import type { CSSProperties, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { ArrowRightIcon, CheckIcon, guideCard } from "../guide-ui";
+import { paragraphs } from "../mdx-children";
+
+/** Two shader stills for the variants (stand-ins for real renders). */
+const STILLS: CSSProperties[] = [
+ {
+ backgroundImage:
+ "radial-gradient(ellipse 80% 70% at 20% 80%, #DB2777 0%, transparent 60%), radial-gradient(ellipse 70% 80% at 85% 20%, #F472B6aa 0%, transparent 55%), linear-gradient(160deg, #831843, #1E0B1A)",
+ },
+ {
+ backgroundImage:
+ "radial-gradient(ellipse 60% 60% at 30% 70%, #E879F9 0%, #A21CAF55 40%, transparent 70%), radial-gradient(ellipse 60% 70% at 78% 28%, #7C3AED 0%, transparent 70%), linear-gradient(135deg, #2E1065, #0E1012)",
+ },
+];
+
+/**
+ * Asking for variants: your one-line ask, then the two openings it
+ * produces with one picked. Children: one markdown paragraph, the ask.
+ */
+export function DirectingOptions({
+ children,
+ labels = ["Opening A", "Opening B"],
+ picked = 1,
+}: {
+ children: ReactNode;
+ labels?: [string, string];
+ picked?: 0 | 1;
+}) {
+ const [ask = []] = paragraphs(children);
+
+ return (
+ <div
+ className={cn(
+ "not-prose mt-4 flex flex-col items-center gap-3 rounded-card p-4 sm:flex-row sm:justify-between sm:gap-4 sm:p-5",
+ guideCard,
+ )}
+ >
+ <p className="w-full rounded-t-control rounded-br-control rounded-bl-[4px] bg-dark-surface px-3.5 py-3 text-[15px] leading-[22px] font-medium text-[#FAFAFA] sm:w-[250px] sm:shrink-0 dark:bg-foreground dark:text-background">
+ {ask}
+ </p>
+ <ArrowRightIcon
+ size={18}
+ className="shrink-0 rotate-90 text-subtle sm:rotate-0"
+ />
+ <ul className="grid w-full grid-cols-2 gap-3 sm:flex sm:w-auto">
+ {labels.map((label, index) => {
+ const chosen = index === picked;
+ return (
+ <li key={label} className="flex min-w-0 flex-col gap-2 sm:w-44">
+ <span
+ aria-hidden="true"
+ className={cn(
+ "relative aspect-video overflow-hidden rounded-control-sm bg-dark-surface",
+ chosen &&
+ "shadow-[0_0_0_2px_var(--color-surface),0_0_0_4px_var(--color-foreground)]",
+ )}
+ >
+ <span
+ className="absolute inset-0 opacity-85"
+ style={STILLS[index]}
+ />
+ <span
+ className={cn(
+ "absolute h-2 w-1/2 rounded-[4px] bg-[#FAFAFA]",
+ chosen ? "top-[40%] left-1/4" : "top-[44%] left-[9%]",
+ )}
+ />
+ {chosen && (
+ <span className="absolute top-[55%] left-[36%] h-1.5 w-[27%] rounded-[3px] bg-[#FAFAFA]/55" />
+ )}
+ </span>
+ <span className="flex h-6 items-center gap-2 text-caption">
+ <span
+ className={
+ chosen
+ ? "font-medium text-foreground"
+ : "text-muted-foreground"
+ }
+ >
+ {label}
+ </span>
+ {chosen && (
+ <span className="flex h-[22px] items-center gap-1 rounded-[7px] bg-dark-surface px-2 text-mono text-[#FAFAFA] dark:bg-foreground dark:text-background">
+ <CheckIcon size={11} strokeWidth={3} />
+ Pick one
+ </span>
+ )}
+ </span>
+ </li>
+ );
+ })}
+ </ul>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/directing-phrases.tsx b/components/docs/guides/practice/directing-phrases.tsx
new file mode 100644
index 00000000..1a13323a
--- /dev/null
+++ b/components/docs/guides/practice/directing-phrases.tsx
@@ -0,0 +1,58 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead, textOf } from "../mdx-children";
+
+/**
+ * Words to say to your agent: each phrase as a pill, an optional synonym
+ * pill and a short gloss. Children: a markdown list of
+ * `**"Phrase"** / "synonym" — gloss` (synonym and gloss both optional).
+ */
+export function DirectingPhrases({ children }: { children: ReactNode }) {
+ const items = listItems(children).map((item) => {
+ const { lead, rest } = splitLead(item);
+ const tail = textOf(rest).trim();
+ const [alt, gloss] = tail.startsWith("/")
+ ? splitOnce(tail.slice(1), " — ")
+ : [undefined, tail];
+ return { lead, alt: alt?.trim(), gloss: gloss?.trim() };
+ });
+
+ return (
+ <ul
+ className={cn(
+ "not-prose mt-4 flex flex-col rounded-card p-1.5",
+ guideCard,
+ )}
+ >
+ {items.map((item, index) => (
+ <li
+ key={index}
+ className="flex flex-col gap-2 px-3 py-3 sm:min-h-14 sm:flex-row sm:items-center sm:gap-4 sm:py-2"
+ >
+ <span className="flex flex-wrap items-center gap-1.5 sm:w-[340px] sm:shrink-0">
+ <span className="flex min-h-8 items-center rounded-[10px] bg-secondary px-3 py-1.5 text-small font-medium text-foreground">
+ {item.lead}
+ </span>
+ {item.alt && (
+ <span className="flex min-h-8 items-center rounded-[10px] bg-surface-muted px-3 py-1.5 text-small text-body">
+ {item.alt}
+ </span>
+ )}
+ </span>
+ {item.gloss && (
+ <span className="text-small text-muted-foreground">
+ {item.gloss}
+ </span>
+ )}
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+function splitOnce(value: string, separator: string): [string, string?] {
+ const index = value.indexOf(separator);
+ if (index === -1) return [value];
+ return [value.slice(0, index), value.slice(index + separator.length)];
+}
diff --git a/components/docs/guides/practice/directing-redirect.tsx b/components/docs/guides/practice/directing-redirect.tsx
new file mode 100644
index 00000000..af745559
--- /dev/null
+++ b/components/docs/guides/practice/directing-redirect.tsx
@@ -0,0 +1,189 @@
+import {
+ Children,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems, splitLead, textOf } from "../mdx-children";
+import { frameTile } from "./frame";
+
+/** Beat order shown in each panel: details keep it, structure scrambles it. */
+const ORDERS: (number | null)[][] = [
+ [1, 2, 3, 4, 5],
+ [3, 1, 5, 2, null],
+];
+
+/**
+ * Redirect or restart, side by side. Children: a markdown list of two
+ * items, `**Case** — what's wrong. → **Action**, short note. Optional
+ * extra sentence.`, then a closing paragraph shown as the footnote.
+ */
+export function DirectingRedirect({ children }: { children: ReactNode }) {
+ const cases = listItems(children).map((item) => {
+ const { lead, rest } = splitLead(item);
+ const [what = "", how = ""] = textOf(rest).split("→");
+ const match = /^\s*([^,.]+)[,.]?\s*([^.]*)\.?\s*(.*)$/.exec(how) ?? [];
+ return {
+ lead,
+ what: what.trim(),
+ action: match[1]?.trim(),
+ note: match[2]?.trim(),
+ extra: match[3]?.trim(),
+ };
+ });
+ const footnote = Children.toArray(children).find(
+ (child): child is ReactElement<{ children?: ReactNode }> =>
+ isValidElement(child) && child.type === "p",
+ );
+
+ return (
+ <div
+ className={cn("not-prose mt-4 flex flex-col rounded-card p-2", guideCard)}
+ >
+ <ul className="grid gap-2 sm:grid-cols-2">
+ {cases.map((item, index) => (
+ <li
+ key={index}
+ className="flex flex-col gap-4 rounded-control-sm bg-surface-muted p-4 sm:p-5"
+ >
+ <BeatRow
+ order={ORDERS[index] ?? ORDERS[0]}
+ focus={index === 0 ? 3 : undefined}
+ />
+ <div className="flex flex-col gap-1">
+ <span className="text-button-lg leading-6 font-medium text-foreground">
+ {item.lead}
+ </span>
+ <span className="text-small text-muted-foreground">
+ {item.what}
+ </span>
+ </div>
+ {item.action && (
+ <span className="flex items-center gap-2.5 text-small text-body">
+ <ActionPill restart={index > 0}>{item.action}</ActionPill>
+ {item.note}
+ </span>
+ )}
+ {item.extra && (
+ <span className="text-small text-body">{item.extra}</span>
+ )}
+ </li>
+ ))}
+ </ul>
+ {footnote && (
+ <p className="flex items-center gap-2.5 px-3 pt-3.5 pb-2 text-small text-muted-foreground">
+ <svg
+ aria-hidden="true"
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ className="shrink-0"
+ >
+ <circle
+ cx="12"
+ cy="12"
+ r="9"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ />
+ <path
+ d="M12 7v5l3 2"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ <span>{footnote.props.children}</span>
+ </p>
+ )}
+ </div>
+ );
+}
+
+function BeatRow({
+ order,
+ focus,
+}: {
+ order: (number | null)[];
+ focus?: number;
+}) {
+ return (
+ <span aria-hidden="true" className="flex gap-1.5">
+ {order.map((beat, i) =>
+ beat === null ? (
+ <span
+ key={i}
+ className="flex h-[30px] w-11 items-center justify-center rounded-[7px] border-[1.5px] border-dashed border-foreground/22 text-mono leading-3 text-subtle"
+ >
+ ?
+ </span>
+ ) : (
+ <span
+ key={i}
+ className={cn(
+ "flex h-[30px] w-11 items-end rounded-[7px] pb-1 pl-1.5 text-mono leading-3",
+ frameTile,
+ beat === focus
+ ? "text-[#FAFAFA] shadow-[0_0_0_2px_var(--color-surface-muted),0_0_0_4px_var(--color-primary-soft)] dark:shadow-[0_0_0_2px_var(--color-surface-muted),0_0_0_4px_var(--color-primary-soft)]"
+ : "text-dark-subtle",
+ )}
+ >
+ {beat}
+ </span>
+ ),
+ )}
+ </span>
+ );
+}
+
+function ActionPill({
+ restart,
+ children,
+}: {
+ restart: boolean;
+ children: ReactNode;
+}) {
+ return (
+ <span
+ className={cn(
+ "flex h-8 shrink-0 items-center gap-1.5 rounded-[10px] px-3 font-medium",
+ restart
+ ? "bg-dark-surface text-[#FAFAFA] dark:bg-foreground dark:text-background"
+ : "bg-secondary text-foreground",
+ )}
+ >
+ {restart ? (
+ <svg aria-hidden="true" width="13" height="13" viewBox="0 0 24 24">
+ <path
+ d="M4 12a8 8 0 1 0 2.3-5.7M4 4v5h5"
+ fill="none"
+ stroke="#F0ABFC"
+ strokeWidth="2.2"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ ) : (
+ <svg
+ aria-hidden="true"
+ width="13"
+ height="13"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ >
+ <path d="M4 7h10M18 7h2M4 17h2M10 17h10" strokeLinecap="round" />
+ <circle cx="16" cy="7" r="2.2" />
+ <circle cx="8" cy="17" r="2.2" />
+ </svg>
+ )}
+ {children}
+ </span>
+ );
+}
diff --git a/components/docs/guides/practice/export-pipeline.tsx b/components/docs/guides/practice/export-pipeline.tsx
new file mode 100644
index 00000000..4f81dc4f
--- /dev/null
+++ b/components/docs/guides/practice/export-pipeline.tsx
@@ -0,0 +1,164 @@
+import { Fragment, type ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import {
+ ArrowDownIcon,
+ ArrowRightIcon,
+ guideCard,
+ guidePanel,
+ PlayIcon,
+} from "../guide-ui";
+
+/** Poster of the launch video, the clip every guide uses as its example. */
+const PREVIEW_POSTER = "https://cdn.remocn.dev/posters/intoducing-remocn.png";
+
+type Stage = { title: string; text: string; art: ReactNode };
+
+const STAGES: Stage[] = [
+ {
+ title: "Preview",
+ text: "Plays in your browser, but it isn't a file yet",
+ art: <PreviewArt />,
+ },
+ {
+ title: "Render",
+ text: "Frame by frame, a few minutes for thirty seconds",
+ art: <RenderArt />,
+ },
+ {
+ title: "A real mp4",
+ text: "Your agent tells you the full path",
+ art: <FileArt />,
+ },
+];
+
+/** Preview → render → mp4: what the one prompt does, as three stages. */
+export function GuideExportPipeline() {
+ return (
+ <ol className="not-prose mt-5 flex flex-col sm:flex-row">
+ {STAGES.map((stage, index) => (
+ <Fragment key={stage.title}>
+ {index > 0 && (
+ <li
+ aria-hidden="true"
+ className="flex h-8 shrink-0 items-center justify-center text-subtle sm:h-auto sm:w-8 sm:pb-[60px]"
+ >
+ <ArrowDownIcon size={16} className="sm:hidden" />
+ <ArrowRightIcon size={16} className="hidden sm:block" />
+ </li>
+ )}
+ <li
+ className={cn(
+ "flex min-w-0 flex-col rounded-card p-1.5 sm:basis-0 sm:grow",
+ guideCard,
+ )}
+ >
+ {stage.art}
+ <div className="flex flex-col gap-1 px-3 pt-3.5 pb-3">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {stage.title}
+ </span>
+ <span className="text-small text-muted-foreground">
+ {stage.text}
+ </span>
+ </div>
+ </li>
+ </Fragment>
+ ))}
+ </ol>
+ );
+}
+
+function PreviewArt() {
+ return (
+ <div
+ aria-hidden="true"
+ className={cn("flex flex-col gap-2 rounded-control p-2", guidePanel)}
+ >
+ <span
+ className="aspect-[196/110] rounded-tag bg-cover bg-center"
+ style={{ backgroundImage: `url(${PREVIEW_POSTER})` }}
+ />
+ <span className="flex h-7 shrink-0 items-center gap-2">
+ <span className="flex size-7 shrink-0 items-center justify-center rounded-tag bg-[#fafafa] text-[#0e1012]">
+ <PlayIcon size={11} />
+ </span>
+ <span className="flex h-7 grow items-center rounded-tag bg-dark-raised px-1">
+ <span className="h-5 w-[62px] rounded-[3px] bg-[#fafafa]/22" />
+ <span className="h-5 w-[3px] rounded-[2px] bg-[#fafafa]" />
+ </span>
+ </span>
+ </div>
+ );
+}
+
+/** Frames already drawn; the next one is mid-render. */
+const DONE = 13;
+
+function RenderArt() {
+ return (
+ <div
+ className={cn(
+ "flex h-[162px] shrink-0 flex-col justify-center gap-3 rounded-control px-3.5",
+ guidePanel,
+ )}
+ >
+ <span aria-hidden="true" className="grid grid-cols-8 gap-1">
+ {Array.from({ length: 24 }, (_, i) => (
+ <span
+ key={i}
+ className={cn(
+ "h-[13px] rounded-[3px]",
+ i < DONE
+ ? "bg-[#fafafa]"
+ : i === DONE
+ ? "bg-primary-soft"
+ : "bg-[#2a2d30]",
+ )}
+ />
+ ))}
+ </span>
+ <span className="text-caption text-[#c9ced1]">
+ Drawing frame 584 of 1,050
+ </span>
+ </div>
+ );
+}
+
+function FileArt() {
+ return (
+ <div className="flex h-[162px] shrink-0 flex-col justify-center gap-3 rounded-control bg-surface-muted px-3.5">
+ <span className="flex items-center gap-2.5">
+ <span
+ aria-hidden="true"
+ className={cn(
+ "relative flex h-[46px] w-[38px] shrink-0 items-end justify-center rounded-[7px] pb-[7px] text-[9px] leading-[10px] font-semibold text-[#fafafa]",
+ guidePanel,
+ )}
+ >
+ <svg
+ width="14"
+ height="14"
+ viewBox="0 0 14 14"
+ className="absolute top-3 left-3"
+ >
+ <path d="M3 1.5v11l9-5.5z" fill="#F0ABFC" />
+ </svg>
+ mp4
+ </span>
+ <span className="flex min-w-0 flex-col gap-0.5">
+ <span className="truncate font-mono text-caption leading-[18px] text-foreground">
+ launch-video.mp4
+ </span>
+ <span className="text-caption text-muted-foreground">
+ About 15 MB
+ </span>
+ </span>
+ </span>
+ <span className="rounded-tile bg-surface px-2.5 py-2 font-mono text-mono leading-[17px] break-all text-body dark:bg-surface-sunken dark:shadow-[0_0_0_1px_var(--color-hairline)]">
+ ~/my-video/out/
+ <br />
+ launch-video.mp4
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/format-frames.tsx b/components/docs/guides/practice/format-frames.tsx
new file mode 100644
index 00000000..8da7727c
--- /dev/null
+++ b/components/docs/guides/practice/format-frames.tsx
@@ -0,0 +1,151 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/** Shader still used as the hero visual of the example frame. */
+const SHADER = "/landing/shader-violet.png";
+
+const title = "font-semibold tracking-[-0.04em] text-[#F4F2EC]";
+const accent = "text-[#D4F25C]";
+
+/** The same "Meet remocn" beat as 16:9, 9:16 and 1:1. */
+export function GuideFormatFrames() {
+ return (
+ <ul className="not-prose mt-6 flex flex-wrap items-start gap-4 pt-2 sm:flex-nowrap">
+ <Format
+ className="basis-full sm:basis-0 sm:grow-[373]"
+ label="16:9 horizontal"
+ note="YouTube, X, your landing page"
+ >
+ <div className="flex h-[210px] flex-col justify-center gap-3.5 px-[26px]">
+ <span
+ className={cn(title, "flex gap-1.5 text-[22px] leading-[26px]")}
+ >
+ Meet <span className={accent}>remocn</span>
+ </span>
+ <span className="flex gap-2.5">
+ <Still className="h-[88px] max-w-[155px] grow basis-0 rounded-tile" />
+ <Lines
+ className="h-[88px] max-w-[155px] grow basis-0 gap-1.5 rounded-tile px-3"
+ bar="h-1.5"
+ widths={[96, 70, 110]}
+ />
+ </span>
+ </div>
+ </Format>
+ <Format
+ className="w-[118px] shrink-0 sm:w-0 sm:grow-[118]"
+ label="9:16 vertical"
+ note="Reels, Shorts, TikTok"
+ >
+ <div className="relative flex h-[210px] flex-col items-center justify-center gap-2">
+ <span
+ className={cn(
+ title,
+ "flex flex-col items-center text-ui leading-[18px]",
+ )}
+ >
+ Meet <span className={accent}>remocn</span>
+ </span>
+ <Still className="h-[42px] w-[84px] rounded-tag" />
+ <Lines
+ className="h-[42px] w-[84px] gap-1 rounded-tag px-[9px]"
+ bar="h-1"
+ widths={[52, 38, 60]}
+ />
+ {/* Platform UI covers the top and bottom edges of a vertical video. */}
+ <span
+ aria-hidden="true"
+ className="absolute inset-x-0 top-0 h-[30px] bg-[#F5D0FE]/16"
+ />
+ <span
+ aria-hidden="true"
+ className="absolute inset-x-0 bottom-0 h-9 bg-[#F5D0FE]/16"
+ />
+ </div>
+ </Format>
+ <Format
+ className="min-w-0 grow basis-0 sm:grow-[210]"
+ label="1:1 square"
+ note="Some feeds"
+ >
+ <div className="flex h-[210px] flex-col justify-center gap-3 px-[18px]">
+ <span
+ className={cn(title, "flex gap-[5px] text-[19px] leading-[22px]")}
+ >
+ Meet <span className={accent}>remocn</span>
+ </span>
+ <span className="flex gap-2">
+ <Still className="h-16 max-w-[83px] grow basis-0 rounded-[7px]" />
+ <Lines
+ className="h-16 max-w-[83px] grow basis-0 gap-[5px] rounded-[7px] px-[9px]"
+ bar="h-[5px]"
+ widths={[52, 38, 60]}
+ />
+ </span>
+ </div>
+ </Format>
+ </ul>
+ );
+}
+
+function Format({
+ label,
+ note,
+ className,
+ children,
+}: {
+ label: string;
+ note: string;
+ className?: string;
+ children: ReactNode;
+}) {
+ return (
+ <li className={cn("flex flex-col gap-3", className)}>
+ <div
+ aria-hidden="true"
+ className="overflow-hidden rounded-cta bg-[#141318] dark:shadow-[0_0_0_1px_var(--color-hairline)]"
+ >
+ {children}
+ </div>
+ <div className="flex flex-col gap-0.5 px-1">
+ <span className="text-small font-medium text-foreground">{label}</span>
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {note}
+ </span>
+ </div>
+ </li>
+ );
+}
+
+function Still({ className }: { className?: string }) {
+ return (
+ <span
+ className={cn("block bg-cover bg-center", className)}
+ style={{ backgroundImage: `url(${SHADER})` }}
+ />
+ );
+}
+
+/** Three text lines, the middle one in the accent colour. */
+function Lines({
+ className,
+ bar,
+ widths,
+}: {
+ className?: string;
+ bar: string;
+ widths: [number, number, number];
+}) {
+ const tones = ["bg-[#F4F2EC]/70", "bg-[#D4F25C]", "bg-[#F4F2EC]/30"];
+ return (
+ <span className={cn("flex flex-col justify-center bg-white/7", className)}>
+ {widths.map((width, index) => (
+ <span
+ key={tones[index]}
+ className={cn("max-w-full rounded-[3px]", bar, tones[index])}
+ style={{ width }}
+ />
+ ))}
+ </span>
+ );
+}
diff --git a/components/docs/guides/practice/frame.ts b/components/docs/guides/practice/frame.ts
new file mode 100644
index 00000000..87a7ca39
--- /dev/null
+++ b/components/docs/guides/practice/frame.ts
@@ -0,0 +1,12 @@
+/**
+ * Shared surfaces for the practice-guide illustrations.
+ *
+ * - `frameTile`: a tiny video frame. Always ink; in dark mode it keeps the
+ * ink fill and gains a divider ring so it reads against the card.
+ * - `inkChip`: a solid "on" element (a highlighted chip, a filled bar).
+ * Ink in light, flips to the foreground colour in dark.
+ */
+export const frameTile =
+ "bg-dark-surface dark:shadow-[0_0_0_1px_var(--color-divider)]";
+
+export const inkChip = "bg-foreground text-background";
diff --git a/components/docs/guides/practice/music-timeline.tsx b/components/docs/guides/practice/music-timeline.tsx
new file mode 100644
index 00000000..eb99cbb3
--- /dev/null
+++ b/components/docs/guides/practice/music-timeline.tsx
@@ -0,0 +1,106 @@
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+
+/** The launch video's beats, weighted by their length on screen. */
+const BEATS: { label: string; weight: number }[] = [
+ { label: "Pain", weight: 76 },
+ { label: "Reveal", weight: 57 },
+ { label: "Tagline", weight: 57 },
+ { label: "Positioning", weight: 86 },
+ { label: "Montage", weight: 145 },
+ { label: "Value", weight: 95 },
+ { label: "Install", weight: 76 },
+ { label: "Outro", weight: 76 },
+];
+
+/** Bar heights (px) of the music bed; the last eight are the fade-out. */
+const WAVE = [
+ 6, 16, 30, 28, 25, 16, 11, 21, 19, 24, 15, 8, 10, 18, 19, 28, 37, 38, 28, 21,
+ 29, 23, 36, 28, 19, 10, 7, 14, 14, 26, 30, 24, 22, 15, 18, 28, 39, 36, 28, 22,
+ 14, 12, 23, 26, 21, 21, 14, 17, 20, 24, 40, 32, 32, 29, 17, 22, 21, 32, 31,
+ 22, 17, 6, 14, 21, 28, 30, 32, 29, 21, 27, 26, 39, 37, 33, 22, 10, 12, 20, 18,
+ 24, 16, 11, 10, 24, 25, 34, 36, 37, 25, 22, 20, 17, 14, 12, 9, 6,
+];
+const FADE_FROM = WAVE.length - 8;
+
+const RULER = [
+ { label: "0 s", span: 10 },
+ { label: "10 s", span: 10 },
+ { label: "20 s", span: 10 },
+ { label: "30 s", span: 5 },
+];
+
+/** A video track with one music bed underneath it, fading over the outro. */
+export function GuideMusicTimeline() {
+ return (
+ <figure
+ className={cn(
+ "not-prose mt-6 flex flex-col gap-2.5 rounded-card px-4 pt-[18px] pb-5 sm:px-5",
+ guideCard,
+ )}
+ >
+ <figcaption className="flex flex-col gap-0.5 pb-1.5 sm:flex-row sm:items-baseline sm:justify-between">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ Same video, one track underneath
+ </span>
+ <span className="text-caption text-muted-foreground">
+ Launch video, about 35 s
+ </span>
+ </figcaption>
+
+ <div
+ aria-hidden="true"
+ className="-mx-4 overflow-x-auto px-4 sm:mx-0 sm:overflow-visible sm:px-0"
+ >
+ <div className="flex min-w-[560px] flex-col gap-2.5">
+ <div className="flex text-mono text-subtle">
+ {RULER.map((mark) => (
+ <span
+ key={mark.label}
+ style={{ flexGrow: mark.span }}
+ className="basis-0"
+ >
+ {mark.label}
+ </span>
+ ))}
+ <span>35 s</span>
+ </div>
+ <div className="flex gap-1">
+ {BEATS.map((beat) => (
+ <span
+ key={beat.label}
+ style={{ flexGrow: beat.weight }}
+ className="flex h-11 basis-0 items-center overflow-hidden rounded-tile bg-[#141318] px-2 text-mono whitespace-nowrap text-[#F4F2EC] dark:bg-secondary dark:text-foreground"
+ >
+ {beat.label}
+ </span>
+ ))}
+ </div>
+ <div className="flex h-[60px] items-center gap-[2px] rounded-tile bg-surface-muted px-3">
+ {WAVE.map((height, index) => (
+ <span
+ key={index}
+ style={{ height }}
+ className={cn(
+ "max-w-[5px] min-w-0 grow basis-0 rounded-[3px]",
+ index < FADE_FROM ? "bg-foreground" : "bg-subtle-line",
+ )}
+ />
+ ))}
+ </div>
+ </div>
+ </div>
+
+ <div className="flex flex-col gap-1.5 pt-1 text-caption leading-[18px] text-body sm:flex-row sm:items-start sm:justify-between">
+ <span className="flex items-start gap-2">
+ <span className="mt-1 size-2.5 shrink-0 rounded-[3px] bg-foreground" />
+ Music bed under the whole video, quiet enough to never compete
+ </span>
+ <span className="flex shrink-0 items-start gap-2">
+ <span className="mt-1 size-2.5 shrink-0 rounded-[3px] bg-subtle-line" />
+ Fades out over the outro
+ </span>
+ </div>
+ </figure>
+ );
+}
diff --git a/components/docs/guides/practice/note-card.tsx b/components/docs/guides/practice/note-card.tsx
new file mode 100644
index 00000000..e6a0afba
--- /dev/null
+++ b/components/docs/guides/practice/note-card.tsx
@@ -0,0 +1,92 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+
+const icons = {
+ shield: (
+ <>
+ <path
+ d="M12 3 4.5 6v5.5c0 4.6 3.2 8.3 7.5 9.5 4.3-1.2 7.5-4.9 7.5-9.5V6L12 3Z"
+ strokeLinejoin="round"
+ />
+ <path
+ d="m8.8 12.2 2.3 2.3 4.4-4.6"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </>
+ ),
+ mute: (
+ <>
+ <path d="M11 5 6 9H3v6h3l5 4V5Z" strokeLinejoin="round" />
+ <path d="m16 9 5 6M21 9l-5 6" strokeLinecap="round" />
+ </>
+ ),
+};
+
+const tones = {
+ /** The page's single accent: a rule that has no exceptions. */
+ accent: {
+ box: "bg-primary-wash",
+ tile: "bg-surface",
+ title: "text-[18px] leading-6 tracking-[-0.01em]",
+ },
+ /** A quieter aside on a white card. */
+ card: {
+ box: guideCard,
+ tile: "bg-surface-muted",
+ title: "text-ui leading-[22px]",
+ },
+};
+
+/**
+ * A titled note with a 44px icon tile. Children: one markdown paragraph,
+ * the body under the title.
+ */
+export function GuideNoteCard({
+ title,
+ icon,
+ tone = "card",
+ children,
+}: {
+ title: string;
+ icon: keyof typeof icons;
+ tone?: keyof typeof tones;
+ children: ReactNode;
+}) {
+ return (
+ <aside
+ className={cn(
+ "not-prose mt-4 flex flex-col items-start gap-4 rounded-card py-5 pr-6 pl-5 sm:flex-row sm:gap-[18px]",
+ tones[tone].box,
+ )}
+ >
+ <span
+ className={cn(
+ "flex size-11 shrink-0 items-center justify-center rounded-control-sm text-foreground",
+ tones[tone].tile,
+ )}
+ >
+ <svg
+ width="20"
+ height="20"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ aria-hidden="true"
+ >
+ {icons[icon]}
+ </svg>
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-1">
+ <span className={cn("font-medium text-foreground", tones[tone].title)}>
+ {title}
+ </span>
+ <div className="text-[15px] leading-6 text-body [&_p]:m-0">
+ {children}
+ </div>
+ </div>
+ </aside>
+ );
+}
diff --git a/components/docs/guides/practice/phrase-list.tsx b/components/docs/guides/practice/phrase-list.tsx
new file mode 100644
index 00000000..fccf2289
--- /dev/null
+++ b/components/docs/guides/practice/phrase-list.tsx
@@ -0,0 +1,48 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { listItems } from "../mdx-children";
+
+const pill =
+ "inline-flex items-center rounded-tile bg-secondary px-3 py-1.5 text-small text-foreground";
+
+/**
+ * Sentences to say to the agent, one grey pill per line on a white card.
+ * Children: a markdown list of quoted sentences.
+ */
+export function GuidePhrases({ children }: { children: ReactNode }) {
+ return (
+ <ul
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-0.5 rounded-card p-2 sm:p-3",
+ guideCard,
+ )}
+ >
+ {listItems(children).map((item, index) => (
+ <li key={index} className="flex min-h-12 items-center px-1.5 py-1">
+ <span className={pill}>{item}</span>
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+/** One sentence to say to the agent, as a standalone grey pill. */
+export function GuideQuote({ children }: { children: ReactNode }) {
+ return (
+ <p className="not-prose mt-4 flex">
+ <span className="inline-flex min-h-9 items-center rounded-[10px] bg-secondary px-3.5 py-2 text-[15px] leading-5 text-foreground [&_p]:m-0">
+ {children}
+ </span>
+ </p>
+ );
+}
+
+/** A single line said louder than the paragraphs around it. */
+export function GuidePullLine({ children }: { children: ReactNode }) {
+ return (
+ <p className="not-prose mt-4 px-1 pt-1 text-lead tracking-[-0.01em] text-foreground [&_p]:m-0">
+ {children}
+ </p>
+ );
+}
diff --git a/components/docs/guides/practice/track-sources.tsx b/components/docs/guides/practice/track-sources.tsx
new file mode 100644
index 00000000..9aa95115
--- /dev/null
+++ b/components/docs/guides/practice/track-sources.tsx
@@ -0,0 +1,114 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { findLink, listItems, textOf } from "../mdx-children";
+
+/** Wordmarks for the libraries the guide recommends, keyed by host. */
+const LOGOS: { host: string; mark: ReactNode }[] = [
+ {
+ host: "pixabay.com",
+ mark: (
+ <>
+ <svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true">
+ <rect width="30" height="30" rx="8" fill="#2EC66D" />
+ <path
+ d="M11 22V9h5.2a4.3 4.3 0 0 1 0 8.6H11"
+ fill="none"
+ stroke="#fff"
+ strokeWidth="2.6"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ <span className="text-[#2EC66D]">pixabay</span>
+ </>
+ ),
+ },
+ {
+ host: "uppbeat.io",
+ mark: (
+ <>
+ <svg width="30" height="30" viewBox="0 0 30 30" aria-hidden="true">
+ <rect width="30" height="30" rx="15" fill="#F2386C" />
+ <path
+ d="M10 9v7a5 5 0 0 0 10 0V9"
+ fill="none"
+ stroke="#fff"
+ strokeWidth="2.6"
+ strokeLinecap="round"
+ />
+ </svg>
+ <span className="text-foreground">uppbeat</span>
+ </>
+ ),
+ },
+ {
+ host: "youtube.com",
+ mark: (
+ <>
+ <svg width="40" height="28" viewBox="0 0 40 28" aria-hidden="true">
+ <rect width="40" height="28" rx="8" fill="#FF0033" />
+ <path d="M16 8.5v11l9.5-5.5z" fill="#fff" />
+ </svg>
+ <span className="tracking-[-0.04em] text-foreground">YouTube</span>
+ </>
+ ),
+ },
+];
+
+/**
+ * Where to get a track: one card per library. Children: a markdown list of
+ * `[Library](url) — what the license is`.
+ */
+export function GuideTrackSources({ children }: { children: ReactNode }) {
+ const items = listItems(children).map((item) => {
+ const link = findLink(item);
+ const href = typeof link?.props.href === "string" ? link.props.href : "#";
+ const name = textOf(link?.props.children);
+ const note = textOf(item)
+ .replace(name, "")
+ .replace(/^\s*—\s*/, "")
+ .trim();
+ return { href, name, note };
+ });
+
+ return (
+ <ul className="not-prose mt-4 grid gap-3 sm:grid-cols-3 sm:gap-5">
+ {items.map((item) => {
+ const logo = LOGOS.find((entry) => item.href.includes(entry.host));
+ return (
+ <li key={item.href}>
+ <a
+ href={item.href}
+ target="_blank"
+ rel="noreferrer"
+ className={cn(
+ "flex h-full items-center gap-3 rounded-card p-1.5 transition-shadow hover:shadow-[0_0_0_1px_var(--color-divider)] focus-visible:ring-3 focus-visible:ring-ring focus-visible:outline-none sm:flex-col sm:items-stretch sm:gap-0",
+ guideCard,
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className="flex h-14 w-[132px] shrink-0 items-center justify-center gap-2 rounded-control bg-surface-muted text-[17px] leading-lead font-bold tracking-[-0.03em] sm:h-[104px] sm:w-auto sm:text-[22px] [&_svg]:max-sm:scale-75"
+ >
+ {logo?.mark}
+ </span>
+ <span className="flex flex-col gap-1 py-2 pr-2 sm:px-3 sm:pt-3.5 sm:pb-3">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {item.name}
+ </span>
+ <span className="text-small text-muted-foreground">
+ {capitalize(item.note)}
+ </span>
+ </span>
+ </a>
+ </li>
+ );
+ })}
+ </ul>
+ );
+}
+
+function capitalize(value: string) {
+ return value.charAt(0).toUpperCase() + value.slice(1);
+}
diff --git a/components/docs/guides/practice/two-second-test.tsx b/components/docs/guides/practice/two-second-test.tsx
new file mode 100644
index 00000000..3afdfa1c
--- /dev/null
+++ b/components/docs/guides/practice/two-second-test.tsx
@@ -0,0 +1,92 @@
+import { cn } from "@/lib/utils";
+import { CheckIcon, guideCard } from "../guide-ui";
+import { inkChip } from "./frame";
+
+type Line = { text: string; seconds: number };
+
+/** The two-second budget as a track: 2 s fills 75% of the bar area. */
+const TRACK = 75;
+
+/**
+ * The two-second test drawn out: each line's speaking time against a 2 s
+ * track, with a verdict. Lines and timings are illustrative examples.
+ */
+export function WordsTwoSecondTest({ lines }: { lines: Line[] }) {
+ return (
+ <div
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-[18px] rounded-card p-4 sm:p-6",
+ guideCard,
+ )}
+ >
+ <div aria-hidden="true" className="flex items-center gap-5">
+ <span className="hidden w-[250px] shrink-0 text-caption text-muted-foreground sm:block">
+ At speaking pace
+ </span>
+ <span
+ className="flex justify-between text-mono text-subtle"
+ style={{ width: `calc(min(320px, 100% - 96px) * ${TRACK / 100})` }}
+ >
+ <span>0 s</span>
+ <span>1 s</span>
+ <span className="font-medium text-foreground">2 s</span>
+ </span>
+ </div>
+ <ul className="flex flex-col gap-[18px]">
+ {lines.map((line) => {
+ const fits = line.seconds <= 2;
+ const fill = (Math.min(line.seconds, 2) / 2) * 100;
+ const over = Math.max(line.seconds - 2, 0) / 2;
+ return (
+ <li
+ key={line.text}
+ className="flex flex-col gap-2.5 sm:flex-row sm:items-center sm:gap-5"
+ >
+ <span
+ className={cn(
+ "text-[15px] leading-5 sm:w-[250px] sm:shrink-0",
+ fits
+ ? "font-medium text-foreground"
+ : "text-muted-foreground",
+ )}
+ >
+ “{line.text}”
+ </span>
+ <span className="flex items-center gap-5">
+ <span
+ aria-hidden="true"
+ className="flex grow items-center gap-1 sm:w-[320px] sm:grow-0"
+ >
+ <span
+ className="flex h-3.5 shrink-0 rounded-[7px] bg-surface-muted"
+ style={{ width: `${TRACK}%` }}
+ >
+ <span
+ className={cn("h-3.5 rounded-[7px]", inkChip)}
+ style={{ width: `${fill}%` }}
+ />
+ </span>
+ {over > 0 && (
+ <span
+ className="h-3.5 shrink-0 rounded-[7px] bg-primary-tint"
+ style={{ width: `calc(${TRACK * over}% - 4px)` }}
+ />
+ )}
+ </span>
+ <span
+ className={cn(
+ "flex h-7 shrink-0 items-center gap-1.5 rounded-[9px] px-2.5 text-caption font-medium",
+ fits ? "bg-secondary text-foreground" : inkChip,
+ )}
+ >
+ {fits && <CheckIcon size={11} strokeWidth={3} />}
+ {fits ? "Fits" : "Tighten it"}
+ </span>
+ </span>
+ </li>
+ );
+ })}
+ </ul>
+ </div>
+ );
+}
diff --git a/components/docs/guides/practice/words-formulas.tsx b/components/docs/guides/practice/words-formulas.tsx
new file mode 100644
index 00000000..a682b847
--- /dev/null
+++ b/components/docs/guides/practice/words-formulas.tsx
@@ -0,0 +1,82 @@
+import {
+ Children,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "../guide-ui";
+import { splitLead, textOf } from "../mdx-children";
+import { frameTile } from "./frame";
+
+type El = ReactElement<{ children?: ReactNode }>;
+
+/**
+ * Formulas for common beats: each formula's rule on the left, its example
+ * lines as frames on the right. Children: markdown pairs of a
+ * `**Beat** — rule` paragraph and an optional blockquote of examples
+ * separated by ` / ` (a `<BLANK>` example renders as a blank chip).
+ */
+export function WordsFormulas({ children }: { children: ReactNode }) {
+ const formulas: { lead: ReactNode; rest: ReactNode[]; examples: string[] }[] =
+ [];
+ for (const child of Children.toArray(children)) {
+ if (!isValidElement(child)) continue;
+ const el = child as El;
+ if (el.type === "p") {
+ const { lead, rest } = splitLead(Children.toArray(el.props.children));
+ formulas.push({ lead, rest, examples: [] });
+ } else if (el.type === "blockquote" && formulas.length > 0) {
+ formulas[formulas.length - 1].examples = textOf(el.props.children)
+ .split(" / ")
+ .map((line) => line.trim().replace(/^["“]|["”]$/g, ""))
+ .filter(Boolean);
+ }
+ }
+
+ return (
+ <ul className="not-prose mt-4 flex flex-col gap-2.5">
+ {formulas.map((formula, index) => (
+ <li
+ key={index}
+ className={cn(
+ "flex flex-col gap-2 rounded-card p-2 sm:flex-row",
+ guideCard,
+ )}
+ >
+ <div className="flex flex-col gap-1.5 px-3 pt-3 pb-1 sm:w-[248px] sm:shrink-0 sm:py-3.5">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {formula.lead}
+ </span>
+ <span className="text-small text-muted-foreground">
+ {formula.rest}
+ </span>
+ </div>
+ {formula.examples.length > 0 && (
+ <div className="grid grow grid-cols-2 gap-3 rounded-control-sm bg-surface-muted p-4 sm:flex sm:items-center">
+ {formula.examples.map((line) => (
+ <span
+ key={line}
+ className={cn(
+ "flex h-[76px] items-center justify-center rounded-tile p-2 text-center sm:w-[136px] sm:shrink-0",
+ frameTile,
+ )}
+ >
+ {/^<.+>$/.test(line) ? (
+ <span className="flex h-6 items-center rounded-tag bg-primary-soft/16 px-1.5 font-mono text-mono text-primary-soft">
+ {line}
+ </span>
+ ) : (
+ <span className="text-caption font-semibold text-[#FAFAFA]">
+ {line}
+ </span>
+ )}
+ </span>
+ ))}
+ </div>
+ )}
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/components/docs/guides/practice/words-rules.tsx b/components/docs/guides/practice/words-rules.tsx
new file mode 100644
index 00000000..5bf28f16
--- /dev/null
+++ b/components/docs/guides/practice/words-rules.tsx
@@ -0,0 +1,168 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { CheckIcon, guideCard, ShieldIcon } from "../guide-ui";
+import { listItems, splitLead } from "../mdx-children";
+import { frameTile } from "./frame";
+
+type Pair = { dont: string; do: string };
+type RuleIcon = "lines" | "shield" | "mic";
+
+/**
+ * The writing rules. The first `pairs.length` items get a don't/do pair of
+ * frames; the rest become small cards with `icons`. Children: a markdown
+ * list of `**Rule** — explanation`.
+ */
+export function WordsRules({
+ children,
+ pairs,
+ icons,
+}: {
+ children: ReactNode;
+ pairs: Pair[];
+ icons: RuleIcon[];
+}) {
+ const items = listItems(children).map(splitLead);
+ const paired = items.slice(0, pairs.length);
+ const small = items.slice(pairs.length);
+
+ return (
+ <div className="not-prose mt-4 flex flex-col gap-3.5">
+ <ul className="flex flex-col gap-3.5">
+ {paired.map((item, index) => (
+ <li
+ key={index}
+ className={cn(
+ "flex flex-col gap-2 rounded-card p-2 sm:flex-row",
+ guideCard,
+ )}
+ >
+ <div className="flex flex-col gap-1.5 px-3 pt-3 pb-1 sm:w-56 sm:shrink-0 sm:py-3.5">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {item.lead}
+ </span>
+ <span className="text-small text-muted-foreground">
+ {item.rest}
+ </span>
+ </div>
+ <PairFrame kind="dont">{pairs[index].dont}</PairFrame>
+ <PairFrame kind="do">{pairs[index].do}</PairFrame>
+ </li>
+ ))}
+ </ul>
+ <ul className="flex flex-col gap-3 sm:grid sm:grid-cols-3 sm:gap-3.5">
+ {small.map((item, index) => (
+ <li
+ key={index}
+ className={cn(
+ "flex gap-3 rounded-card p-4 sm:flex-col sm:p-5",
+ guideCard,
+ )}
+ >
+ <span className="flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-surface-muted text-foreground">
+ <RuleGlyph icon={icons[index]} />
+ </span>
+ <span className="flex flex-col gap-1 pt-2 sm:pt-0">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {item.lead}
+ </span>
+ {item.rest.length > 0 && (
+ <span className="text-small text-muted-foreground">
+ {item.rest}
+ </span>
+ )}
+ </span>
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+}
+
+function PairFrame({
+ kind,
+ children,
+}: {
+ kind: "do" | "dont";
+ children: string;
+}) {
+ const dont = kind === "dont";
+ return (
+ <div
+ className={cn(
+ "relative flex h-[135px] items-center justify-center rounded-control-sm px-5 text-center sm:w-60 sm:shrink-0",
+ frameTile,
+ )}
+ >
+ <span
+ className={cn(
+ "absolute top-2.5 left-2.5 flex h-[22px] items-center gap-1 rounded-[7px] px-2 text-mono",
+ dont
+ ? "bg-white/10 text-dark-subtle"
+ : "bg-[#FAFAFA] font-medium text-[#0E1012]",
+ )}
+ >
+ {dont ? (
+ <svg aria-hidden="true" width="10" height="10" viewBox="0 0 24 24">
+ <path
+ d="M6 6l12 12M18 6 6 18"
+ fill="none"
+ stroke="#9AA3A7"
+ strokeWidth="3"
+ strokeLinecap="round"
+ />
+ </svg>
+ ) : (
+ <CheckIcon size={10} strokeWidth={3} />
+ )}
+ {dont ? "Don't" : "Do"}
+ </span>
+ <span
+ className={cn(
+ "font-semibold",
+ dont && "text-[#FAFAFA]/55 line-through",
+ !dont && "text-[#FAFAFA]",
+ dont && children.length > 30
+ ? "text-small leading-[19px]"
+ : "text-lead leading-6 tracking-title",
+ )}
+ >
+ {children}
+ </span>
+ </div>
+ );
+}
+
+function RuleGlyph({ icon }: { icon?: RuleIcon }) {
+ if (icon === "shield") return <ShieldIcon size={16} strokeWidth={2} />;
+ if (icon === "mic") {
+ return (
+ <svg
+ aria-hidden="true"
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ >
+ <rect x="9" y="3" width="6" height="11" rx="3" />
+ <path d="M5 11a7 7 0 0 0 14 0M12 18v3" />
+ </svg>
+ );
+ }
+ return (
+ <svg
+ aria-hidden="true"
+ width="16"
+ height="16"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="2"
+ strokeLinecap="round"
+ >
+ <path d="M4 7h16M4 17h10" />
+ </svg>
+ );
+}
diff --git a/components/docs/guides/prompt-block.tsx b/components/docs/guides/prompt-block.tsx
new file mode 100644
index 00000000..d4a8f42b
--- /dev/null
+++ b/components/docs/guides/prompt-block.tsx
@@ -0,0 +1,113 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { GuideCopyButton } from "./guide-copy-button";
+import { guidePanel } from "./guide-ui";
+import { findElement, findRaw } from "./mdx-children";
+
+/**
+ * A prompt to paste into the agent. Wraps a fenced code block in the MDX
+ * (so the markdown export keeps the fence) and re-renders it as the dark
+ * prompt panel: `<BLANKS>` become pink chips, `marks` words turn warm
+ * orange (the code theme's string colour).
+ */
+export function GuidePrompt({
+ children,
+ copyLabel = "Copy prompt",
+ marks = [],
+ highlight: highlightBlanks = true,
+ size = "md",
+ wrap = false,
+ id,
+ className,
+}: {
+ children: ReactNode;
+ copyLabel?: string;
+ /** Exact substrings set in orange, e.g. `["In beat 1"]`. */
+ marks?: string[];
+ /** Set `false` when the `<…>` slots are a template, not blanks to fill. */
+ highlight?: boolean;
+ /** `lg`: a single short line set large (15px). */
+ size?: "md" | "lg";
+ /** Wrap long lines instead of scrolling sideways. */
+ wrap?: boolean;
+ id?: string;
+ className?: string;
+}) {
+ const raw = (findRaw(children) ?? "").replace(/\n$/, "");
+ const pre = findElement(children, "pre");
+ const language =
+ (typeof pre?.props["data-language"] === "string"
+ ? pre.props["data-language"]
+ : undefined) ?? "text";
+
+ return (
+ <figure
+ id={id}
+ className={cn(
+ "not-prose mt-5 flex scroll-mt-24 flex-col overflow-hidden rounded-card",
+ guidePanel,
+ className,
+ )}
+ >
+ <figcaption className="flex h-11 shrink-0 items-center justify-between border-b border-dark-border pr-2 pl-[18px]">
+ <span className="font-mono text-mono text-dark-subtle">{language}</span>
+ <GuideCopyButton value={raw} label={copyLabel} />
+ </figcaption>
+ <pre
+ // biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable prompt must be keyboard-focusable
+ tabIndex={0}
+ className={cn(
+ "overflow-x-auto pr-5 font-mono outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
+ size === "lg"
+ ? "pt-[22px] pb-6 pl-[22px] text-[15px] leading-[26px] text-[#fafafa]"
+ : "pt-[18px] pb-5 pl-[18px] text-caption leading-[22px] text-[#D9DBDE]",
+ )}
+ >
+ <code className={wrap ? "whitespace-pre-wrap" : "whitespace-pre"}>
+ {highlightBlanks || marks.length
+ ? highlight(raw, marks, highlightBlanks)
+ : raw}
+ </code>
+ </pre>
+ </figure>
+ );
+}
+
+const BLANK = /(<[A-Z][^<>\n]*>)/;
+
+function highlight(
+ source: string,
+ marks: string[],
+ blanks: boolean,
+): ReactNode[] {
+ const markRe = marks.length
+ ? new RegExp(`(${marks.map(escapeRegExp).join("|")})`)
+ : null;
+ const parts = blanks ? source.split(BLANK) : [source];
+ return parts.flatMap((part, index) => {
+ if (index % 2 === 1) {
+ return (
+ <span
+ key={index}
+ className="rounded-[5px] bg-primary-tint px-1 py-0.5 text-primary-strong [box-decoration-break:clone]"
+ >
+ {part}
+ </span>
+ );
+ }
+ if (!markRe) return part;
+ return part.split(markRe).map((chunk, j) =>
+ j % 2 === 1 ? (
+ <span key={`${index}-${j}`} className="text-[#FFC799]">
+ {chunk}
+ </span>
+ ) : (
+ chunk
+ ),
+ );
+ });
+}
+
+function escapeRegExp(value: string) {
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
+}
diff --git a/components/docs/guides/render-card.tsx b/components/docs/guides/render-card.tsx
new file mode 100644
index 00000000..b502472e
--- /dev/null
+++ b/components/docs/guides/render-card.tsx
@@ -0,0 +1,66 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { GuideCopyButton } from "./guide-copy-button";
+import { DownloadIcon, GuideButton, guideCard } from "./guide-ui";
+import { findLink, textOf } from "./mdx-children";
+
+/**
+ * "Get the file": the one sentence that renders the video, with a copy
+ * button. Children: the follow-up line (markdown).
+ */
+export function GuideRenderCard({
+ prompt,
+ children,
+}: {
+ prompt: string;
+ children: ReactNode;
+}) {
+ return (
+ <div
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-4 rounded-card py-[18px] pr-[18px] pl-5 sm:flex-row sm:items-center sm:gap-[18px]",
+ guideCard,
+ )}
+ >
+ <div className="flex grow items-start gap-[18px] sm:items-center">
+ <span className="flex size-11 shrink-0 items-center justify-center rounded-control-sm bg-surface-muted text-foreground">
+ <DownloadIcon size={20} />
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-0.5">
+ <p className="flex flex-col text-ui leading-[22px] sm:flex-row sm:gap-1.5">
+ <span className="text-muted-foreground">Ask your agent:</span>
+ <span className="font-medium text-foreground">“{prompt}”</span>
+ </p>
+ <div className="text-small text-muted-foreground [&_code]:mx-0.5 [&_code]:font-mono [&_code]:text-mono [&_code]:text-foreground [&_p]:m-0">
+ {children}
+ </div>
+ </div>
+ </div>
+ <GuideCopyButton
+ value={prompt}
+ variant="secondary"
+ className="w-full sm:w-auto"
+ />
+ </div>
+ );
+}
+
+/**
+ * Grey callout with a button to a related page. Children: one markdown
+ * paragraph; its link becomes the button and reads as plain text inline.
+ */
+export function GuideCallout({ children }: { children: ReactNode }) {
+ const link = findLink(children);
+ const href = typeof link?.props.href === "string" ? link.props.href : "#";
+
+ return (
+ <div className="not-prose mt-4 flex flex-col gap-3 rounded-cta bg-surface-muted py-3.5 pr-3.5 pl-4 sm:flex-row sm:items-center sm:gap-4">
+ <div className="grow text-[15px] leading-[22px] text-body [&_a]:text-inherit [&_a]:underline-offset-4 [&_a]:hover:underline [&_p]:m-0">
+ {children}
+ </div>
+ <GuideButton href={href} className="w-full sm:w-auto">
+ {textOf(link?.props.children)}
+ </GuideButton>
+ </div>
+ );
+}
diff --git a/components/docs/guides/setup/agent-picker.tsx b/components/docs/guides/setup/agent-picker.tsx
new file mode 100644
index 00000000..977b3759
--- /dev/null
+++ b/components/docs/guides/setup/agent-picker.tsx
@@ -0,0 +1,98 @@
+import type { ReactNode } from "react";
+import { ClaudeCodeIcon } from "@/app/(home)/components/landing/ui/brand-icons";
+import { cn } from "@/lib/utils";
+import { CheckIcon, guideCard } from "../guide-ui";
+
+type Agent = {
+ name: string;
+ note: string;
+ icon: ReactNode;
+ recommended?: boolean;
+};
+
+const AGENTS: Agent[] = [
+ {
+ name: "Claude Code",
+ note: "Recommended",
+ recommended: true,
+ icon: <ClaudeCodeIcon width={22} height={22} />,
+ },
+ { name: "ChatGPT", note: "Also works", icon: <ChatGptGlyph /> },
+ { name: "opencode", note: "Also works", icon: <OpencodeGlyph /> },
+];
+
+/** The agents the guides are written for, Claude Code marked as the pick. */
+export function GuideAgentPicker() {
+ return (
+ <ul className="flex flex-col gap-2 sm:flex-row sm:flex-wrap">
+ {AGENTS.map((agent) => (
+ <li
+ key={agent.name}
+ className={cn(
+ "flex h-[60px] items-center gap-3 rounded-control bg-surface px-3 sm:w-[200px]",
+ agent.recommended
+ ? "shadow-[0_0_0_1.5px_var(--color-foreground)]"
+ : guideCard,
+ )}
+ >
+ <span
+ className={cn(
+ "flex size-9 shrink-0 items-center justify-center rounded-[10px] text-foreground",
+ agent.recommended ? "bg-claude/12" : "bg-surface-muted",
+ )}
+ >
+ {agent.icon}
+ </span>
+ <span className="flex grow flex-col">
+ <span className="text-small font-medium text-foreground">
+ {agent.name}
+ </span>
+ <span className="text-mono text-muted-foreground">
+ {agent.note}
+ </span>
+ </span>
+ {agent.recommended && (
+ <span className="flex size-5 shrink-0 items-center justify-center rounded-full bg-foreground text-background">
+ <CheckIcon size={11} strokeWidth={3} />
+ </span>
+ )}
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+function ChatGptGlyph() {
+ return (
+ <svg
+ width="22"
+ height="22"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.7"
+ aria-hidden="true"
+ >
+ {[0, 60, 120, 180, 240, 300].map((angle) => (
+ <rect
+ key={angle}
+ x="9.2"
+ y="2.6"
+ width="5.6"
+ height="11.4"
+ rx="2.8"
+ transform={`rotate(${angle} 12 12)`}
+ />
+ ))}
+ </svg>
+ );
+}
+
+function OpencodeGlyph() {
+ return (
+ <svg width="16" height="20" viewBox="0 6 24 30" aria-hidden="true">
+ <path d="M18 12H6V30H18V12ZM24 36H0V6H24V36Z" fill="currentColor" />
+ <path d="M18 30H6V18H18V30Z" fill="currentColor" opacity="0.32" />
+ </svg>
+ );
+}
diff --git a/components/docs/guides/setup/checklist.tsx b/components/docs/guides/setup/checklist.tsx
new file mode 100644
index 00000000..f1e3d523
--- /dev/null
+++ b/components/docs/guides/setup/checklist.tsx
@@ -0,0 +1,131 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { CheckIcon, FlagIcon, guideCard } from "../guide-ui";
+
+/**
+ * The one-time setup as a checklist card: a header with progress, then
+ * `GuideStep`s. Steps are illustrative (the page can't know your setup),
+ * so the progress mirrors the artboard: the first step done, the second
+ * in progress.
+ */
+export function GuideChecklist({
+ title,
+ description,
+ done,
+ total,
+ children,
+}: {
+ title: string;
+ description: string;
+ done: number;
+ total: number;
+ children: ReactNode;
+}) {
+ return (
+ <section
+ aria-label={title}
+ className={cn(
+ "not-prose mt-6 flex flex-col gap-1 rounded-panel p-2",
+ guideCard,
+ )}
+ >
+ <header className="flex items-start justify-between gap-4 pt-3.5 pr-4 pb-2.5 pl-3 sm:items-center sm:pl-5">
+ <div className="flex flex-col gap-0.5">
+ <h2 className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </h2>
+ <p className="text-small text-muted-foreground">{description}</p>
+ </div>
+ <div className="flex flex-col-reverse items-end gap-1.5 sm:flex-row sm:items-center sm:gap-3">
+ <span className="text-small text-muted-foreground">
+ {done} of {total} done
+ </span>
+ <span
+ aria-hidden="true"
+ className="flex gap-1 rounded-[10px] bg-surface-muted p-1"
+ >
+ {Array.from({ length: total }, (_, i) => (
+ <span
+ key={i}
+ className={cn(
+ "h-3 w-10 rounded-tag",
+ i < done ? "bg-foreground" : "bg-secondary",
+ )}
+ />
+ ))}
+ </span>
+ </div>
+ </header>
+ <ol className="flex flex-col gap-1">{children}</ol>
+ </section>
+ );
+}
+
+const stepTone = {
+ done: "bg-surface-muted",
+ current:
+ "bg-surface shadow-[0_0_0_1px_rgb(14_16_18/10%)] dark:shadow-[0_0_0_1px_var(--color-divider)]",
+ next: "bg-surface-muted",
+};
+
+/**
+ * One checklist step. Children are markdown: the first paragraph is the
+ * step's description, anything after it (prompts, pickers) follows below.
+ */
+export function GuideStep({
+ state,
+ step,
+ title,
+ children,
+}: {
+ state: keyof typeof stepTone;
+ step?: number;
+ title: string;
+ children: ReactNode;
+}) {
+ return (
+ <li
+ className={cn(
+ "grid grid-cols-[28px_1fr] items-center gap-x-3 gap-y-3.5 rounded-cta p-3 sm:items-start sm:gap-x-4 sm:p-5",
+ stepTone[state],
+ )}
+ >
+ <StepMark state={state} step={step} />
+ <h3 className="text-ui leading-[22px] font-medium text-foreground sm:pt-[3px]">
+ {title}
+ </h3>
+ <div className="col-span-2 flex min-w-0 flex-col gap-3.5 sm:col-span-1 sm:col-start-2 -mt-2.5 [&>figure]:mt-1 [&>figure:first-child]:mt-3.5 [&>p]:text-[15px] [&>p]:leading-[22px] [&>p]:text-body [&>p_a]:text-foreground [&>p_a]:underline [&>p_a]:decoration-divider [&>p_a]:underline-offset-4 [&>p_a]:hover:decoration-foreground">
+ {children}
+ </div>
+ </li>
+ );
+}
+
+function StepMark({
+ state,
+ step,
+}: {
+ state: keyof typeof stepTone;
+ step?: number;
+}) {
+ if (state === "done") {
+ return (
+ <span className="flex size-7 items-center justify-center rounded-full bg-foreground text-background">
+ <CheckIcon size={14} />
+ <span className="sr-only">Done</span>
+ </span>
+ );
+ }
+ if (state === "current") {
+ return (
+ <span className="flex size-7 items-center justify-center rounded-full bg-primary-tint text-small leading-4 font-semibold text-primary-strong">
+ {step}
+ </span>
+ );
+ }
+ return (
+ <span className="flex size-7 items-center justify-center rounded-full bg-secondary text-muted-foreground">
+ <FlagIcon size={14} />
+ </span>
+ );
+}
diff --git a/components/docs/guides/setup/studio-preview.tsx b/components/docs/guides/setup/studio-preview.tsx
new file mode 100644
index 00000000..471b4772
--- /dev/null
+++ b/components/docs/guides/setup/studio-preview.tsx
@@ -0,0 +1,118 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { GuideButton, LockIcon, PlayIcon } from "../guide-ui";
+import { findLink, paragraphs, textOf } from "../mdx-children";
+
+/**
+ * "Or use the plugin" aside inside a setup step. Children: two markdown
+ * paragraphs (the alternative, then how to start); the first link becomes
+ * the button.
+ */
+export function GuidePluginAside({ children }: { children: ReactNode }) {
+ const [lead = [], body = []] = paragraphs(children);
+ const link = findLink(children);
+ const href = typeof link?.props.href === "string" ? link.props.href : "#";
+
+ return (
+ <div className="flex flex-col gap-3 rounded-control bg-surface-muted py-3.5 pr-3.5 pl-4 sm:flex-row sm:items-center sm:gap-3.5">
+ <div className="flex grow flex-col gap-1.5 text-small">
+ <p className="text-muted-foreground [&_a]:text-inherit [&_strong]:mr-1 [&_strong]:font-medium [&_strong]:text-foreground">
+ {lead}
+ </p>
+ <p className="text-body [&_code]:mx-0.5 [&_code]:inline-flex [&_code]:h-6 [&_code]:items-center [&_code]:rounded-tag [&_code]:bg-surface [&_code]:px-[7px] [&_code]:font-mono [&_code]:text-[12.5px] [&_code]:leading-4 [&_code]:text-foreground [&_code]:shadow-[0_0_0_1px_var(--color-hairline)]">
+ {body}
+ </p>
+ </div>
+ <GuideButton href={href} className="h-11 w-full sm:h-9 sm:w-auto">
+ {capitalize(textOf(link?.props.children))}
+ </GuideButton>
+ </div>
+ );
+}
+
+function capitalize(value: string) {
+ return value.charAt(0).toUpperCase() + value.slice(1);
+}
+
+/** The empty Remotion Studio tab you see once setup worked. */
+export function GuideStudioPreview() {
+ return (
+ <figure
+ aria-label="Remotion Studio open in a browser tab, with an empty video player"
+ className={cn(
+ "flex flex-col overflow-hidden rounded-control bg-surface shadow-[0_0_0_1px_rgb(14_16_18/10%),0_12px_32px_-12px_rgb(14_16_18/5%)] dark:shadow-[0_0_0_1px_var(--color-divider)]",
+ )}
+ >
+ <div className="flex h-11 shrink-0 items-center gap-3 border-b border-hairline px-3.5">
+ <span aria-hidden="true" className="hidden shrink-0 gap-1.5 sm:flex">
+ <span className="size-2.5 rounded-full bg-secondary" />
+ <span className="size-2.5 rounded-full bg-secondary" />
+ <span className="size-2.5 rounded-full bg-secondary" />
+ </span>
+ <span className="flex h-7 shrink-0 items-center gap-[7px] rounded-tile bg-surface-muted px-2.5 text-mono text-foreground">
+ <span
+ className="size-3 rounded-[4px]"
+ style={{
+ backgroundImage: "linear-gradient(135deg, #4FA3FF, #0B57D0)",
+ }}
+ />
+ Remotion Studio
+ </span>
+ <span className="flex h-7 min-w-0 grow items-center gap-1.5 rounded-tile bg-surface-muted px-2.5 text-mono text-muted-foreground">
+ <LockIcon size={11} className="text-subtle" />
+ <span className="truncate">localhost:3000</span>
+ </span>
+ </div>
+ <div
+ aria-hidden="true"
+ className="flex h-[180px] bg-[#202024] sm:h-[290px]"
+ >
+ <div className="flex w-[88px] shrink-0 flex-col gap-2 bg-[#18181B] p-3 sm:w-[132px]">
+ <span className="text-micro font-medium text-white/60">
+ Compositions
+ </span>
+ <span className="h-[22px] rounded-[5px] bg-white/6" />
+ <span className="h-1.5 w-[70px] max-w-full rounded-[3px] bg-white/6" />
+ </div>
+ <div className="flex grow flex-col">
+ <div className="flex grow items-center justify-center px-3">
+ <span className="flex aspect-video w-full max-w-[320px] items-center justify-center rounded-[4px] bg-black shadow-[0_0_0_1px_rgb(255_255_255/8%)]">
+ <span className="flex size-10 items-center justify-center rounded-full bg-white/8 text-white/70">
+ <PlayIcon />
+ </span>
+ </span>
+ </div>
+ <div className="flex h-14 shrink-0 flex-col gap-2 bg-[#18181B] px-3 py-2.5">
+ <span className="flex items-center gap-2 text-micro text-white/60">
+ <PlayIcon size={10} />
+ 0:00
+ </span>
+ <span className="h-3.5 rounded-[4px] bg-white/4" />
+ </div>
+ </div>
+ </div>
+ </figure>
+ );
+}
+
+/** Closing row of the last setup step: one line and the way out. */
+export function GuideReadyRow({ children }: { children: ReactNode }) {
+ const link = findLink(children);
+ const href = typeof link?.props.href === "string" ? link.props.href : "#";
+ const label = textOf(link?.props.children);
+ const lead = textOf(children).replace(label, "").trim();
+
+ return (
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between sm:gap-4">
+ <p className="text-small text-muted-foreground">{lead}</p>
+ <GuideButton
+ href={href}
+ variant="ink"
+ size="md"
+ className="h-11 w-full sm:h-10 sm:w-auto"
+ >
+ {label}
+ </GuideButton>
+ </div>
+ );
+}
diff --git a/components/docs/guides/storyboard-preview.tsx b/components/docs/guides/storyboard-preview.tsx
new file mode 100644
index 00000000..f12a56da
--- /dev/null
+++ b/components/docs/guides/storyboard-preview.tsx
@@ -0,0 +1,208 @@
+import type { CSSProperties, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { FilmIcon, guidePanel } from "./guide-ui";
+
+export type PreviewFrame =
+ | { line: string }
+ | { name: string; sub?: string }
+ | { big: string }
+ | { logo: string }
+ | { screen: string };
+
+export type PreviewBeat = {
+ label: string;
+ seconds: number;
+ frame: PreviewFrame;
+};
+
+const SPROCKETS: CSSProperties = {
+ backgroundImage:
+ "repeating-linear-gradient(90deg, rgb(255 255 255 / 12%) 0 10px, transparent 10px 23px)",
+};
+
+/**
+ * Hero for guides without a finished video: the beats laid out as a film
+ * strip on the dark stage, with the same bar as the player underneath.
+ */
+export function GuideStoryboardPreview({
+ beats,
+ fps = 30,
+}: {
+ beats: PreviewBeat[];
+ fps?: number;
+}) {
+ const total = beats.reduce((sum, beat) => sum + beat.seconds, 0);
+
+ return (
+ <div
+ className={cn(
+ "not-prose mt-6 flex flex-col gap-2 rounded-card p-2",
+ guidePanel,
+ )}
+ >
+ <div
+ className="relative flex flex-col justify-center overflow-hidden rounded-control-sm bg-[#141318] pt-[60px] pb-6 sm:aspect-video sm:py-0"
+ style={{
+ backgroundImage:
+ "radial-gradient(circle at 50% 42%, #2A2238 0%, #141318 62%)",
+ }}
+ >
+ <span className="absolute top-[18px] left-5 flex h-7 items-center gap-2 rounded-[9px] bg-white/6 px-2.5 text-caption text-[#F5F4F0]">
+ <FilmIcon size={13} />
+ Storyboard preview
+ </span>
+ <div className="overflow-x-auto">
+ <div className="mx-auto flex w-max min-w-full flex-col sm:w-full">
+ <div className="flex flex-col gap-2 bg-[#0B0A0E] px-[18px] py-3">
+ <span
+ aria-hidden="true"
+ className="mx-1 h-[7px]"
+ style={SPROCKETS}
+ />
+ <span className="flex justify-center gap-2.5">
+ {beats.map((beat) => (
+ <Frame key={beat.label} frame={beat.frame} />
+ ))}
+ </span>
+ <span
+ aria-hidden="true"
+ className="mx-1 h-[7px]"
+ style={SPROCKETS}
+ />
+ </div>
+ <div className="flex justify-center gap-2.5 px-[18px] pt-3.5">
+ {beats.map((beat, index) => (
+ <span
+ key={beat.label}
+ className="flex w-[124px] min-w-0 shrink-0 flex-col gap-0.5 text-mono sm:shrink"
+ >
+ <span className="flex gap-1.5">
+ <span className="text-white/55">{index + 1}</span>
+ <span className="font-medium text-[#F5F4F0]">
+ {beat.label}
+ </span>
+ </span>
+ <span className="pl-[13px] text-white/55">
+ ~{beat.seconds} s
+ </span>
+ </span>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div className="flex flex-wrap items-center gap-2 py-1.5 sm:flex-nowrap">
+ <span className="flex size-10 shrink-0 items-center justify-center rounded-control-sm bg-dark-raised text-[#F5F4F0]">
+ <FilmIcon size={15} />
+ </span>
+ <span className="shrink-0 text-caption text-[#fafafa] tabular-nums">
+ {Math.floor(total / 60)}:{String(total % 60).padStart(2, "0")}
+ </span>
+ <span className="ml-auto shrink-0 text-caption text-dark-subtle sm:order-last sm:ml-0">
+ {total * fps} frames, {fps} fps
+ </span>
+ <span
+ aria-hidden="true"
+ className="order-last flex h-10 basis-full gap-[3px] rounded-control-sm bg-dark-raised p-1 sm:order-none sm:grow sm:basis-0"
+ >
+ {beats.map((beat, index) => (
+ <span
+ key={beat.label}
+ style={{ flexGrow: beat.seconds }}
+ className="flex basis-0 items-center rounded-tile bg-white/8 pl-2.5 text-mono text-dark-subtle"
+ >
+ {index + 1}
+ </span>
+ ))}
+ </span>
+ </div>
+ </div>
+ );
+}
+
+function Frame({ frame }: { frame: PreviewFrame }): ReactNode {
+ const box =
+ "flex h-[70px] w-[124px] min-w-0 shrink-0 sm:shrink flex-col items-center justify-center rounded-[4px] bg-[#19181E] p-2 text-center text-[#F5F4F0]";
+
+ if ("line" in frame) {
+ return (
+ <span className={cn(box, "text-micro font-medium text-[#EDEBE6]")}>
+ {frame.line}
+ </span>
+ );
+ }
+ if ("name" in frame) {
+ return (
+ <span
+ className={cn(box, "gap-[3px] p-1.5")}
+ style={{
+ backgroundImage:
+ "radial-gradient(circle at 30% 30%, #7C5CC466 0%, #19181E00 55%), radial-gradient(circle at 78% 80%, #C6F43233 0%, #19181E00 45%)",
+ }}
+ >
+ <span className="text-[18px] leading-5 font-semibold tracking-[-0.03em]">
+ {frame.name}
+ </span>
+ {frame.sub && (
+ <span className="text-[7px] leading-[9px] text-[#EDEBE6]/70">
+ {frame.sub}
+ </span>
+ )}
+ </span>
+ );
+ }
+ if ("screen" in frame) {
+ return (
+ <span className={cn(box, "items-stretch gap-1 p-2.5")}>
+ <span className="flex grow flex-col gap-1 rounded-[3px] bg-[#EDEBE6]/10 p-1.5">
+ <span className="h-[3px] w-1/2 rounded-[2px] bg-[#EDEBE6]/60" />
+ <span className="h-[3px] w-3/4 rounded-[2px] bg-[#EDEBE6]/30" />
+ <span className="mt-auto h-1.5 w-1/4 self-end rounded-[2px] bg-[#D4F25C]" />
+ </span>
+ <span className="truncate text-[9px] leading-[11px] text-[#EDEBE6]/70">
+ {frame.screen}
+ </span>
+ </span>
+ );
+ }
+ if ("big" in frame) {
+ return (
+ <span
+ className={cn(
+ box,
+ "text-[18px] leading-5 font-semibold tracking-[-0.03em]",
+ )}
+ >
+ {frame.big}
+ </span>
+ );
+ }
+ return (
+ <span className={cn(box, "gap-[5px]")}>
+ <svg width="22" height="23" viewBox="0 0 16 17" aria-hidden="true">
+ <rect
+ x="1"
+ y="1"
+ width="14"
+ height="15"
+ rx="4"
+ fill="none"
+ stroke="#F5F4F0"
+ strokeWidth="1.6"
+ />
+ <path
+ d="M5.5 12.5V5h3a2.2 2.2 0 0 1 0 4.4h-3M8.5 9.4l2.4 3.1"
+ fill="none"
+ stroke="#F5F4F0"
+ strokeWidth="1.6"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ />
+ </svg>
+ <span className="text-[9px] leading-[11px] text-[#EDEBE6]/70">
+ {frame.logo}
+ </span>
+ </span>
+ );
+}
diff --git a/components/docs/guides/storyboard.tsx b/components/docs/guides/storyboard.tsx
new file mode 100644
index 00000000..5ae5f8f8
--- /dev/null
+++ b/components/docs/guides/storyboard.tsx
@@ -0,0 +1,101 @@
+import type { CSSProperties, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { type BeatLook, BeatThumb } from "./beat-thumbs";
+import { guideCard } from "./guide-ui";
+import { listItems, splitLead } from "./mdx-children";
+
+export type Beat = { label: string; seconds: number; look: BeatLook };
+
+/**
+ * The beat strip: one card per beat, width proportional to its length, on
+ * a 5-second ruler. Scrolls sideways on phones.
+ */
+export function GuideStoryboard({ beats }: { beats: Beat[] }) {
+ const total = beats.reduce((sum, beat) => sum + beat.seconds, 0);
+ const end = Math.ceil(total / 5) * 5;
+ const ticks = Array.from({ length: end / 5 + 1 }, (_, i) => i * 5);
+
+ return (
+ <div className="not-prose relative mt-4">
+ <p className="text-caption text-muted-foreground sm:absolute sm:right-0 sm:-top-[35px]">
+ Block width follows the estimated length of each beat
+ </p>
+ <div className="-mx-5 mt-3 overflow-x-auto px-5 pb-1 sm:mx-0 sm:mt-0 sm:overflow-visible sm:px-0 sm:pb-0">
+ <div className="flex w-max flex-col gap-2 sm:w-full">
+ <ol className="flex gap-1">
+ {beats.map((beat, index) => (
+ <li
+ key={beat.label}
+ style={{ "--s": beat.seconds } as CSSProperties}
+ className={cn(
+ "flex h-[136px] w-[calc(var(--s)*24px)] min-w-[70px] shrink-0 flex-col justify-between rounded-control p-1.5 sm:w-0 sm:min-w-fit sm:grow-[var(--s)]",
+ guideCard,
+ )}
+ >
+ <BeatThumb look={beat.look} />
+ <div className="flex flex-col gap-0.5 px-1 pb-[3px]">
+ <div className="flex items-center justify-between text-mono">
+ <span className="text-subtle">{index + 1}</span>
+ <span className="text-muted-foreground">
+ ~{beat.seconds} s
+ </span>
+ </div>
+ <span className="text-caption leading-[18px] font-medium whitespace-nowrap text-foreground">
+ {beat.label}
+ </span>
+ </div>
+ </li>
+ ))}
+ </ol>
+ <div
+ aria-hidden="true"
+ className="flex justify-between text-mono text-subtle"
+ >
+ {ticks.map((t) => (
+ <span key={t}>{t}s</span>
+ ))}
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+/**
+ * The numbered beat list. Children: a markdown ordered list of
+ * `**Beat name** — what happens`.
+ */
+export function GuideBeatList({ children }: { children: ReactNode }) {
+ const items = listItems(children).map(splitLead);
+
+ return (
+ <ol
+ className={cn(
+ "not-prose mt-4 flex flex-col rounded-card p-1.5",
+ guideCard,
+ )}
+ >
+ {items.map((item, index) => (
+ <li
+ key={index}
+ className="flex min-h-[52px] gap-4 rounded-control p-3.5 sm:items-center"
+ >
+ <span
+ aria-hidden="true"
+ className="w-5 shrink-0 text-small text-subtle"
+ >
+ {index + 1}
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-1 sm:flex-row sm:items-center sm:gap-4">
+ <span className="shrink-0 text-[15px] leading-5 font-medium text-foreground sm:w-[140px]">
+ {item.lead}
+ </span>
+ <span className="text-small text-body [&_a]:font-medium [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4 [&_code]:font-mono [&_code]:text-caption">
+ {item.rest}
+ </span>
+ </div>
+ </li>
+ ))}
+ </ol>
+ );
+}
diff --git a/components/docs/guides/video-facts.tsx b/components/docs/guides/video-facts.tsx
new file mode 100644
index 00000000..41bc205e
--- /dev/null
+++ b/components/docs/guides/video-facts.tsx
@@ -0,0 +1,47 @@
+import { Fragment } from "react";
+import { GuideButton } from "./guide-ui";
+
+type Fact = { value: string; label: string };
+
+/** Key numbers under a guide's hero player, plus a jump to the prompt. */
+export function GuideFacts({
+ facts,
+ jumpTo = "#the-prompt",
+}: {
+ facts: Fact[];
+ jumpTo?: string;
+}) {
+ return (
+ <div className="not-prose mt-3 flex flex-col gap-4 px-1 pt-1 sm:flex-row sm:items-center sm:justify-between">
+ <div className="flex items-start gap-2.5 sm:items-center sm:gap-9">
+ {facts.map((fact, index) => (
+ <Fragment key={fact.label}>
+ {index > 0 && (
+ <span
+ aria-hidden="true"
+ className="h-10 w-px shrink-0 bg-divider sm:h-9"
+ />
+ )}
+ <div className="flex min-w-0 grow basis-0 flex-col gap-0.5 sm:grow-0 sm:basis-auto">
+ <span className="text-[18px] leading-6 font-medium tracking-title whitespace-nowrap text-foreground sm:text-[22px] sm:leading-lead">
+ {fact.value}
+ </span>
+ <span className="text-caption text-muted-foreground">
+ {fact.label}
+ </span>
+ </div>
+ </Fragment>
+ ))}
+ </div>
+ <GuideButton
+ href={jumpTo}
+ variant="ink"
+ size="md"
+ icon="down"
+ className="h-12 sm:h-10"
+ >
+ Jump to the prompt
+ </GuideButton>
+ </div>
+ );
+}
diff --git a/components/docs/guides/words-form.tsx b/components/docs/guides/words-form.tsx
new file mode 100644
index 00000000..d1433204
--- /dev/null
+++ b/components/docs/guides/words-form.tsx
@@ -0,0 +1,130 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { guideCard } from "./guide-ui";
+import { listItems, splitLead } from "./mdx-children";
+
+/** What a filled-in blank looks like, shown next to its label. */
+export type WordsExample =
+ | string[]
+ | { stack: string[] }
+ | { code: string }
+ | { color: string; note: string }
+ /** No sample yet: show the prompt's blank(s) instead. */
+ | { blank: string[] };
+
+/**
+ * "Your words": the blanks of a recipe as a filled-in form. Children: a
+ * markdown list of `**Label** _optional_ — hint`; `examples` holds one
+ * sample value per item, in the same order.
+ */
+export function GuideWords({
+ children,
+ examples,
+}: {
+ children: ReactNode;
+ examples: WordsExample[];
+}) {
+ const items = listItems(children).map(splitLead);
+
+ return (
+ <dl
+ className={cn(
+ "not-prose mt-4 flex flex-col gap-0.5 rounded-card p-2",
+ guideCard,
+ )}
+ >
+ {items.map((item, index) => (
+ <div
+ key={index}
+ className="flex flex-col gap-2 px-2.5 py-2.5 sm:flex-row sm:items-start sm:gap-6 sm:pr-2.5 sm:pl-3.5"
+ >
+ <dt className="flex shrink-0 flex-col gap-0.5 sm:w-[216px] sm:pt-3">
+ <span className="flex items-center gap-2">
+ <span className="text-small font-medium text-foreground">
+ {item.lead}
+ </span>
+ {item.tag && (
+ <span className="text-caption leading-[18px] text-subtle dark:text-muted-foreground">
+ {item.tag}
+ </span>
+ )}
+ </span>
+ {item.rest.length > 0 && (
+ <span className="text-caption leading-[18px] text-muted-foreground [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-2">
+ {item.rest}
+ </span>
+ )}
+ </dt>
+ <dd className="min-w-0 grow">
+ <Example value={examples[index]} />
+ </dd>
+ </div>
+ ))}
+ </dl>
+ );
+}
+
+const chip =
+ "flex min-h-8 items-center rounded-tag bg-primary-wash px-2.5 py-1.5 text-small text-foreground dark:bg-primary-tint dark:text-primary-soft";
+
+function Example({ value }: { value?: WordsExample }) {
+ if (!value) return null;
+ const well = "rounded-control-sm bg-surface-muted p-1.5";
+
+ if ("color" in value) {
+ return (
+ <div className={cn(well, "flex min-h-11 items-center gap-2.5")}>
+ <span
+ aria-hidden="true"
+ className="size-8 shrink-0 rounded-tag shadow-[inset_0_0_0_1px_var(--color-hairline)]"
+ style={{ backgroundColor: value.color }}
+ />
+ <span className="text-small text-subtle dark:text-muted-foreground">
+ {value.note}
+ </span>
+ </div>
+ );
+ }
+ if ("blank" in value) {
+ return (
+ <ul className={cn(well, "flex min-h-11 flex-wrap items-center gap-1.5")}>
+ {value.blank.map((text) => (
+ <li
+ key={text}
+ className="flex min-h-8 items-center rounded-tag bg-primary-tint px-2 font-mono text-caption leading-5 text-primary-strong"
+ >
+ {text}
+ </li>
+ ))}
+ </ul>
+ );
+ }
+ if ("code" in value) {
+ return (
+ <div className={cn(well, "flex min-h-11 items-center")}>
+ <span
+ className={cn(chip, "font-mono text-caption leading-5 break-all")}
+ >
+ {value.code}
+ </span>
+ </div>
+ );
+ }
+ const stacked = !Array.isArray(value);
+ const values = Array.isArray(value) ? value : value.stack;
+ return (
+ <ul
+ className={cn(
+ well,
+ "flex gap-1.5",
+ stacked ? "flex-col items-start" : "min-h-11 flex-wrap items-center",
+ )}
+ >
+ {values.map((text) => (
+ <li key={text} className={chip}>
+ {text}
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/components/docs/icons-gallery.tsx b/components/docs/icons-gallery.tsx
index fcb686b6..dc945078 100644
--- a/components/docs/icons-gallery.tsx
+++ b/components/docs/icons-gallery.tsx
@@ -2,10 +2,17 @@
import { Player, type PlayerRef } from "@remotion/player";
import { installInStudio, setStudioDragData } from "@remotion/studio-protocol";
-import { Check, Copy, Loader2, Search } from "lucide-react";
import type { ComponentType } from "react";
import { useEffect, useMemo, useRef, useState } from "react";
import { AbsoluteFill } from "remotion";
+import { CopyIcon } from "@/components/docs/copy-button";
+import { FilterChip } from "@/components/docs/index/filter-chip";
+import { FilterField } from "@/components/docs/index/filter-field";
+import {
+ ICONS,
+ type IconCategory,
+ type IconEntry,
+} from "@/components/docs/index/icons/icons";
import { Remotion } from "@/components/ui/svgs/remotion";
import {
getCachedStudioElement,
@@ -18,819 +25,141 @@ import {
type PreviewManifestEntry,
previewManifest,
} from "@/registry/__manifest__";
-import { ActivityIconStatic } from "@/registry/remocn-icons/icon-activity";
-import { AlertTriangleIconStatic } from "@/registry/remocn-icons/icon-alert-triangle";
-import { ArrowDownIconStatic } from "@/registry/remocn-icons/icon-arrow-down";
-import { ArrowLeftIconStatic } from "@/registry/remocn-icons/icon-arrow-left";
-import { ArrowRightIconStatic } from "@/registry/remocn-icons/icon-arrow-right";
-import { ArrowUpIconStatic } from "@/registry/remocn-icons/icon-arrow-up";
-import { AtSignIconStatic } from "@/registry/remocn-icons/icon-at-sign";
-import { AwardIconStatic } from "@/registry/remocn-icons/icon-award";
-import { BarChart3IconStatic } from "@/registry/remocn-icons/icon-bar-chart-3";
-import { BellIconStatic } from "@/registry/remocn-icons/icon-bell";
-import { BookmarkIconStatic } from "@/registry/remocn-icons/icon-bookmark";
-import { CalendarIconStatic } from "@/registry/remocn-icons/icon-calendar";
-import { CameraIconStatic } from "@/registry/remocn-icons/icon-camera";
-import { CheckIconStatic } from "@/registry/remocn-icons/icon-check";
-import { CheckCircleIconStatic } from "@/registry/remocn-icons/icon-check-circle";
-import { ChevronDownIconStatic } from "@/registry/remocn-icons/icon-chevron-down";
-import { ChevronLeftIconStatic } from "@/registry/remocn-icons/icon-chevron-left";
-import { ChevronRightIconStatic } from "@/registry/remocn-icons/icon-chevron-right";
-import { ChevronUpIconStatic } from "@/registry/remocn-icons/icon-chevron-up";
-import { ClockIconStatic } from "@/registry/remocn-icons/icon-clock";
-import { CloudIconStatic } from "@/registry/remocn-icons/icon-cloud";
-import { CodeIconStatic } from "@/registry/remocn-icons/icon-code";
-import { CopyIconStatic } from "@/registry/remocn-icons/icon-copy";
-import { CreditCardIconStatic } from "@/registry/remocn-icons/icon-credit-card";
-import { CrownIconStatic } from "@/registry/remocn-icons/icon-crown";
-import { DatabaseIconStatic } from "@/registry/remocn-icons/icon-database";
-import { DollarSignIconStatic } from "@/registry/remocn-icons/icon-dollar-sign";
-import { DownloadIconStatic } from "@/registry/remocn-icons/icon-download";
-import { ExternalLinkIconStatic } from "@/registry/remocn-icons/icon-external-link";
-import { EyeIconStatic } from "@/registry/remocn-icons/icon-eye";
-import { EyeOffIconStatic } from "@/registry/remocn-icons/icon-eye-off";
-import { FileTextIconStatic } from "@/registry/remocn-icons/icon-file-text";
-import { FilterIconStatic } from "@/registry/remocn-icons/icon-filter";
-import { FlameIconStatic } from "@/registry/remocn-icons/icon-flame";
-import { FolderIconStatic } from "@/registry/remocn-icons/icon-folder";
-import { GemIconStatic } from "@/registry/remocn-icons/icon-gem";
-import { GiftIconStatic } from "@/registry/remocn-icons/icon-gift";
-import { GlobeIconStatic } from "@/registry/remocn-icons/icon-globe";
-import { HeartIconStatic } from "@/registry/remocn-icons/icon-heart";
-import { HelpCircleIconStatic } from "@/registry/remocn-icons/icon-help-circle";
-import { HomeIconStatic } from "@/registry/remocn-icons/icon-home";
-import { ImageIconStatic } from "@/registry/remocn-icons/icon-image";
-import { InboxIconStatic } from "@/registry/remocn-icons/icon-inbox";
-import { InfoIconStatic } from "@/registry/remocn-icons/icon-info";
-import { KeyIconStatic } from "@/registry/remocn-icons/icon-key";
-import { LayoutGridIconStatic } from "@/registry/remocn-icons/icon-layout-grid";
-import { LinkIconStatic } from "@/registry/remocn-icons/icon-link";
-import { LoaderIconStatic } from "@/registry/remocn-icons/icon-loader";
-import { LockIconStatic } from "@/registry/remocn-icons/icon-lock";
-import { LogOutIconStatic } from "@/registry/remocn-icons/icon-log-out";
-import { MailIconStatic } from "@/registry/remocn-icons/icon-mail";
-import { MaximizeIconStatic } from "@/registry/remocn-icons/icon-maximize";
-import { MenuIconStatic } from "@/registry/remocn-icons/icon-menu";
-import { MessageCircleIconStatic } from "@/registry/remocn-icons/icon-message-circle";
-import { MicIconStatic } from "@/registry/remocn-icons/icon-mic";
-import { MonitorIconStatic } from "@/registry/remocn-icons/icon-monitor";
-import { MoonIconStatic } from "@/registry/remocn-icons/icon-moon";
-import { MoreHorizontalIconStatic } from "@/registry/remocn-icons/icon-more-horizontal";
-import { PackageIconStatic } from "@/registry/remocn-icons/icon-package";
-import { PartyPopperIconStatic } from "@/registry/remocn-icons/icon-party-popper";
-import { PauseIconStatic } from "@/registry/remocn-icons/icon-pause";
-import { PencilIconStatic } from "@/registry/remocn-icons/icon-pencil";
-import { PhoneIconStatic } from "@/registry/remocn-icons/icon-phone";
-import { PlayIconStatic } from "@/registry/remocn-icons/icon-play";
-import { PlusIconStatic } from "@/registry/remocn-icons/icon-plus";
-import { PlusCircleIconStatic } from "@/registry/remocn-icons/icon-plus-circle";
-import { RefreshCwIconStatic } from "@/registry/remocn-icons/icon-refresh-cw";
-import { RocketIconStatic } from "@/registry/remocn-icons/icon-rocket";
-import { SaveIconStatic } from "@/registry/remocn-icons/icon-save";
-import { SearchIconStatic } from "@/registry/remocn-icons/icon-search";
-import { SendIconStatic } from "@/registry/remocn-icons/icon-send";
-import { SettingsIconStatic } from "@/registry/remocn-icons/icon-settings";
-import { Share2IconStatic } from "@/registry/remocn-icons/icon-share-2";
-import { ShieldIconStatic } from "@/registry/remocn-icons/icon-shield";
-import { ShoppingCartIconStatic } from "@/registry/remocn-icons/icon-shopping-cart";
-import { SkipForwardIconStatic } from "@/registry/remocn-icons/icon-skip-forward";
-import { SmartphoneIconStatic } from "@/registry/remocn-icons/icon-smartphone";
-import { SparklesIconStatic } from "@/registry/remocn-icons/icon-sparkles";
-import { StarIconStatic } from "@/registry/remocn-icons/icon-star";
-import { SunIconStatic } from "@/registry/remocn-icons/icon-sun";
-import { TagIconStatic } from "@/registry/remocn-icons/icon-tag";
-import { TargetIconStatic } from "@/registry/remocn-icons/icon-target";
-import { TerminalIconStatic } from "@/registry/remocn-icons/icon-terminal";
-import { ThumbsUpIconStatic } from "@/registry/remocn-icons/icon-thumbs-up";
-import { TimerIconStatic } from "@/registry/remocn-icons/icon-timer";
-import { TrashIconStatic } from "@/registry/remocn-icons/icon-trash";
-import { TrendingDownIconStatic } from "@/registry/remocn-icons/icon-trending-down";
-import { TrendingUpIconStatic } from "@/registry/remocn-icons/icon-trending-up";
-import { TrophyIconStatic } from "@/registry/remocn-icons/icon-trophy";
-import { UploadIconStatic } from "@/registry/remocn-icons/icon-upload";
-import { UserIconStatic } from "@/registry/remocn-icons/icon-user";
-import { UserPlusIconStatic } from "@/registry/remocn-icons/icon-user-plus";
-import { UsersIconStatic } from "@/registry/remocn-icons/icon-users";
-import { VideoIconStatic } from "@/registry/remocn-icons/icon-video";
-import { Volume2IconStatic } from "@/registry/remocn-icons/icon-volume-2";
-import { VolumeXIconStatic } from "@/registry/remocn-icons/icon-volume-x";
-import { WalletIconStatic } from "@/registry/remocn-icons/icon-wallet";
-import { XIconStatic } from "@/registry/remocn-icons/icon-x";
-import { XCircleIconStatic } from "@/registry/remocn-icons/icon-x-circle";
-import { ZapIconStatic } from "@/registry/remocn-icons/icon-zap";
-
-export type IconCategory =
- | "Status & feedback"
- | "Actions & UI"
- | "Media & playback"
- | "People & communication"
- | "Time & planning"
- | "Files & dev"
- | "Devices & theme"
- | "Commerce"
- | "Charts & data"
- | "Emotion & accents"
- | "Arrows & navigation";
-export interface IconEntry {
- name: string;
- label: string;
- category: IconCategory;
- Static: ComponentType<{
- size?: number;
- strokeWidth?: number;
- className?: string;
- }>;
-}
-
-export const ICONS: IconEntry[] = [
- {
- name: "icon-check",
- label: "Check",
- category: "Status & feedback",
- Static: CheckIconStatic,
- },
- {
- name: "icon-check-circle",
- label: "Check Circle",
- category: "Status & feedback",
- Static: CheckCircleIconStatic,
- },
- {
- name: "icon-x",
- label: "X",
- category: "Status & feedback",
- Static: XIconStatic,
- },
- {
- name: "icon-activity",
- label: "Activity",
- category: "Charts & data",
- Static: ActivityIconStatic,
- },
- {
- name: "icon-alert-triangle",
- label: "Alert Triangle",
- category: "Status & feedback",
- Static: AlertTriangleIconStatic,
- },
- {
- name: "icon-info",
- label: "Info",
- category: "Status & feedback",
- Static: InfoIconStatic,
- },
- {
- name: "icon-loader",
- label: "Loader",
- category: "Status & feedback",
- Static: LoaderIconStatic,
- },
- {
- name: "icon-refresh-cw",
- label: "Refresh Cw",
- category: "Status & feedback",
- Static: RefreshCwIconStatic,
- },
- {
- name: "icon-shield",
- label: "Shield",
- category: "Status & feedback",
- Static: ShieldIconStatic,
- },
- {
- name: "icon-help-circle",
- label: "Help Circle",
- category: "Status & feedback",
- Static: HelpCircleIconStatic,
- },
- {
- name: "icon-plus-circle",
- label: "Plus Circle",
- category: "Status & feedback",
- Static: PlusCircleIconStatic,
- },
- {
- name: "icon-x-circle",
- label: "X Circle",
- category: "Status & feedback",
- Static: XCircleIconStatic,
- },
- {
- name: "icon-calendar",
- label: "Calendar",
- category: "Time & planning",
- Static: CalendarIconStatic,
- },
- {
- name: "icon-clock",
- label: "Clock",
- category: "Time & planning",
- Static: ClockIconStatic,
- },
- {
- name: "icon-timer",
- label: "Timer",
- category: "Time & planning",
- Static: TimerIconStatic,
- },
- {
- name: "icon-home",
- label: "Home",
- category: "Files & dev",
- Static: HomeIconStatic,
- },
- {
- name: "icon-folder",
- label: "Folder",
- category: "Files & dev",
- Static: FolderIconStatic,
- },
- {
- name: "icon-file-text",
- label: "File Text",
- category: "Files & dev",
- Static: FileTextIconStatic,
- },
- {
- name: "icon-code",
- label: "Code",
- category: "Files & dev",
- Static: CodeIconStatic,
- },
- {
- name: "icon-terminal",
- label: "Terminal",
- category: "Files & dev",
- Static: TerminalIconStatic,
- },
- {
- name: "icon-database",
- label: "Database",
- category: "Files & dev",
- Static: DatabaseIconStatic,
- },
- {
- name: "icon-cloud",
- label: "Cloud",
- category: "Files & dev",
- Static: CloudIconStatic,
- },
- {
- name: "icon-globe",
- label: "Globe",
- category: "Files & dev",
- Static: GlobeIconStatic,
- },
- {
- name: "icon-monitor",
- label: "Monitor",
- category: "Devices & theme",
- Static: MonitorIconStatic,
- },
- {
- name: "icon-smartphone",
- label: "Smartphone",
- category: "Devices & theme",
- Static: SmartphoneIconStatic,
- },
- {
- name: "icon-sun",
- label: "Sun",
- category: "Devices & theme",
- Static: SunIconStatic,
- },
- {
- name: "icon-moon",
- label: "Moon",
- category: "Devices & theme",
- Static: MoonIconStatic,
- },
- {
- name: "icon-shopping-cart",
- label: "Shopping Cart",
- category: "Commerce",
- Static: ShoppingCartIconStatic,
- },
- {
- name: "icon-credit-card",
- label: "Credit Card",
- category: "Commerce",
- Static: CreditCardIconStatic,
- },
- {
- name: "icon-dollar-sign",
- label: "Dollar Sign",
- category: "Commerce",
- Static: DollarSignIconStatic,
- },
- {
- name: "icon-tag",
- label: "Tag",
- category: "Commerce",
- Static: TagIconStatic,
- },
- {
- name: "icon-package",
- label: "Package",
- category: "Commerce",
- Static: PackageIconStatic,
- },
- {
- name: "icon-gift",
- label: "Gift",
- category: "Commerce",
- Static: GiftIconStatic,
- },
- {
- name: "icon-wallet",
- label: "Wallet",
- category: "Commerce",
- Static: WalletIconStatic,
- },
- {
- name: "icon-bar-chart-3",
- label: "Bar Chart 3",
- category: "Charts & data",
- Static: BarChart3IconStatic,
- },
- {
- name: "icon-target",
- label: "Target",
- category: "Charts & data",
- Static: TargetIconStatic,
- },
- {
- name: "icon-trending-down",
- label: "Trending Down",
- category: "Charts & data",
- Static: TrendingDownIconStatic,
- },
- {
- name: "icon-trending-up",
- label: "Trending Up",
- category: "Charts & data",
- Static: TrendingUpIconStatic,
- },
- {
- name: "icon-search",
- label: "Search",
- category: "Actions & UI",
- Static: SearchIconStatic,
- },
- {
- name: "icon-bell",
- label: "Bell",
- category: "Actions & UI",
- Static: BellIconStatic,
- },
- {
- name: "icon-download",
- label: "Download",
- category: "Actions & UI",
- Static: DownloadIconStatic,
- },
- {
- name: "icon-upload",
- label: "Upload",
- category: "Actions & UI",
- Static: UploadIconStatic,
- },
- {
- name: "icon-copy",
- label: "Copy",
- category: "Actions & UI",
- Static: CopyIconStatic,
- },
- {
- name: "icon-settings",
- label: "Settings",
- category: "Actions & UI",
- Static: SettingsIconStatic,
- },
- {
- name: "icon-trash",
- label: "Trash",
- category: "Actions & UI",
- Static: TrashIconStatic,
- },
- {
- name: "icon-plus",
- label: "Plus",
- category: "Actions & UI",
- Static: PlusIconStatic,
- },
- {
- name: "icon-send",
- label: "Send",
- category: "Actions & UI",
- Static: SendIconStatic,
- },
- {
- name: "icon-menu",
- label: "Menu",
- category: "Actions & UI",
- Static: MenuIconStatic,
- },
- {
- name: "icon-more-horizontal",
- label: "More Horizontal",
- category: "Actions & UI",
- Static: MoreHorizontalIconStatic,
- },
- {
- name: "icon-maximize",
- label: "Maximize",
- category: "Actions & UI",
- Static: MaximizeIconStatic,
- },
- {
- name: "icon-layout-grid",
- label: "Layout Grid",
- category: "Actions & UI",
- Static: LayoutGridIconStatic,
- },
- {
- name: "icon-pencil",
- label: "Pencil",
- category: "Actions & UI",
- Static: PencilIconStatic,
- },
- {
- name: "icon-share-2",
- label: "Share 2",
- category: "Actions & UI",
- Static: Share2IconStatic,
- },
- {
- name: "icon-filter",
- label: "Filter",
- category: "Actions & UI",
- Static: FilterIconStatic,
- },
- {
- name: "icon-eye",
- label: "Eye",
- category: "Actions & UI",
- Static: EyeIconStatic,
- },
- {
- name: "icon-eye-off",
- label: "Eye Off",
- category: "Actions & UI",
- Static: EyeOffIconStatic,
- },
- {
- name: "icon-save",
- label: "Save",
- category: "Actions & UI",
- Static: SaveIconStatic,
- },
- {
- name: "icon-link",
- label: "Link",
- category: "Actions & UI",
- Static: LinkIconStatic,
- },
- {
- name: "icon-bookmark",
- label: "Bookmark",
- category: "Actions & UI",
- Static: BookmarkIconStatic,
- },
- {
- name: "icon-lock",
- label: "Lock",
- category: "Actions & UI",
- Static: LockIconStatic,
- },
- {
- name: "icon-key",
- label: "Key",
- category: "Actions & UI",
- Static: KeyIconStatic,
- },
- {
- name: "icon-log-out",
- label: "Log Out",
- category: "Actions & UI",
- Static: LogOutIconStatic,
- },
- {
- name: "icon-play",
- label: "Play",
- category: "Media & playback",
- Static: PlayIconStatic,
- },
- {
- name: "icon-pause",
- label: "Pause",
- category: "Media & playback",
- Static: PauseIconStatic,
- },
- {
- name: "icon-skip-forward",
- label: "Skip Forward",
- category: "Media & playback",
- Static: SkipForwardIconStatic,
- },
- {
- name: "icon-volume-2",
- label: "Volume 2",
- category: "Media & playback",
- Static: Volume2IconStatic,
- },
- {
- name: "icon-volume-x",
- label: "Volume X",
- category: "Media & playback",
- Static: VolumeXIconStatic,
- },
- {
- name: "icon-mic",
- label: "Mic",
- category: "Media & playback",
- Static: MicIconStatic,
- },
- {
- name: "icon-video",
- label: "Video",
- category: "Media & playback",
- Static: VideoIconStatic,
- },
- {
- name: "icon-camera",
- label: "Camera",
- category: "Media & playback",
- Static: CameraIconStatic,
- },
- {
- name: "icon-image",
- label: "Image",
- category: "Media & playback",
- Static: ImageIconStatic,
- },
- {
- name: "icon-user",
- label: "User",
- category: "People & communication",
- Static: UserIconStatic,
- },
- {
- name: "icon-users",
- label: "Users",
- category: "People & communication",
- Static: UsersIconStatic,
- },
- {
- name: "icon-user-plus",
- label: "User Plus",
- category: "People & communication",
- Static: UserPlusIconStatic,
- },
- {
- name: "icon-mail",
- label: "Mail",
- category: "People & communication",
- Static: MailIconStatic,
- },
- {
- name: "icon-message-circle",
- label: "Message Circle",
- category: "People & communication",
- Static: MessageCircleIconStatic,
- },
- {
- name: "icon-phone",
- label: "Phone",
- category: "People & communication",
- Static: PhoneIconStatic,
- },
- {
- name: "icon-at-sign",
- label: "At Sign",
- category: "People & communication",
- Static: AtSignIconStatic,
- },
- {
- name: "icon-inbox",
- label: "Inbox",
- category: "People & communication",
- Static: InboxIconStatic,
- },
- {
- name: "icon-heart",
- label: "Heart",
- category: "Emotion & accents",
- Static: HeartIconStatic,
- },
- {
- name: "icon-rocket",
- label: "Rocket",
- category: "Emotion & accents",
- Static: RocketIconStatic,
- },
- {
- name: "icon-trophy",
- label: "Trophy",
- category: "Emotion & accents",
- Static: TrophyIconStatic,
- },
- {
- name: "icon-award",
- label: "Award",
- category: "Emotion & accents",
- Static: AwardIconStatic,
- },
- {
- name: "icon-crown",
- label: "Crown",
- category: "Emotion & accents",
- Static: CrownIconStatic,
- },
- {
- name: "icon-gem",
- label: "Gem",
- category: "Emotion & accents",
- Static: GemIconStatic,
- },
- {
- name: "icon-star",
- label: "Star",
- category: "Emotion & accents",
- Static: StarIconStatic,
- },
- {
- name: "icon-sparkles",
- label: "Sparkles",
- category: "Emotion & accents",
- Static: SparklesIconStatic,
- },
- {
- name: "icon-zap",
- label: "Zap",
- category: "Emotion & accents",
- Static: ZapIconStatic,
- },
- {
- name: "icon-flame",
- label: "Flame",
- category: "Emotion & accents",
- Static: FlameIconStatic,
- },
- {
- name: "icon-thumbs-up",
- label: "Thumbs Up",
- category: "Emotion & accents",
- Static: ThumbsUpIconStatic,
- },
- {
- name: "icon-party-popper",
- label: "Party Popper",
- category: "Emotion & accents",
- Static: PartyPopperIconStatic,
- },
- {
- name: "icon-arrow-right",
- label: "Arrow Right",
- category: "Arrows & navigation",
- Static: ArrowRightIconStatic,
- },
- {
- name: "icon-arrow-left",
- label: "Arrow Left",
- category: "Arrows & navigation",
- Static: ArrowLeftIconStatic,
- },
- {
- name: "icon-arrow-up",
- label: "Arrow Up",
- category: "Arrows & navigation",
- Static: ArrowUpIconStatic,
- },
- {
- name: "icon-arrow-down",
- label: "Arrow Down",
- category: "Arrows & navigation",
- Static: ArrowDownIconStatic,
- },
- {
- name: "icon-external-link",
- label: "External Link",
- category: "Arrows & navigation",
- Static: ExternalLinkIconStatic,
- },
- {
- name: "icon-chevron-up",
- label: "Chevron Up",
- category: "Arrows & navigation",
- Static: ChevronUpIconStatic,
- },
- {
- name: "icon-chevron-down",
- label: "Chevron Down",
- category: "Arrows & navigation",
- Static: ChevronDownIconStatic,
- },
- {
- name: "icon-chevron-left",
- label: "Chevron Left",
- category: "Arrows & navigation",
- Static: ChevronLeftIconStatic,
- },
- {
- name: "icon-chevron-right",
- label: "Chevron Right",
- category: "Arrows & navigation",
- Static: ChevronRightIconStatic,
- },
-];
+/** Tiles shown before "Show all" when no filter narrows the grid. */
+const PAGE_SIZE = 48;
+const MEDIA_SIZE = 32;
+const GLYPH_SIZE = 26;
+const COMPOSITION_SIZE = 80;
+const COMPOSITION_GLYPH = 64;
-const CATEGORY_ORDER: IconCategory[] = [
- "Status & feedback",
- "Actions & UI",
- "Media & playback",
- "People & communication",
- "Time & planning",
- "Files & dev",
- "Devices & theme",
- "Commerce",
- "Charts & data",
- "Emotion & accents",
- "Arrows & navigation",
-];
+/** Phones get the 44px chip height the other index filter bars use. */
+const chip = "max-sm:h-11 max-sm:rounded-control-sm max-sm:px-3.5";
-const MEDIA_SIZE = 80;
-const GLYPH_SIZE = 48;
-const COMPOSITION_SIZE = 80;
+/** Categories with their icon counts, largest first. */
+const CATEGORIES = Object.entries(
+ ICONS.reduce<Record<string, number>>((counts, icon) => {
+ counts[icon.category] = (counts[icon.category] ?? 0) + 1;
+ return counts;
+ }, {}),
+)
+ .map(([category, count]) => ({ category: category as IconCategory, count }))
+ .sort((a, b) => b.count - a.count);
+/**
+ * The icon gallery: search, category chips and a tile grid. Hovering or
+ * focusing a tile plays its motion; clicking copies the install command; the
+ * corner button adds the icon to a running Remotion Studio.
+ */
export function IconsGallery() {
const [query, setQuery] = useState("");
+ const [category, setCategory] = useState<IconCategory | null>(null);
+ const [expanded, setExpanded] = useState(false);
const [active, setActive] = useState<string | null>(null);
const filtered = useMemo(() => {
const q = query.trim().toLowerCase();
- if (!q) return ICONS;
return ICONS.filter(
(icon) =>
- icon.label.toLowerCase().includes(q) ||
- icon.name.toLowerCase().includes(q),
+ (!category || icon.category === category) &&
+ (!q ||
+ icon.label.toLowerCase().includes(q) ||
+ icon.name.toLowerCase().includes(q)),
);
- }, [query]);
+ }, [query, category]);
- const groups = useMemo(
- () =>
- CATEGORY_ORDER.map((category) => ({
- category,
- icons: filtered.filter((icon) => icon.category === category),
- })).filter((group) => group.icons.length > 0),
- [filtered],
- );
+ const narrowed = Boolean(query.trim() || category);
+ const visible =
+ narrowed || expanded ? filtered : filtered.slice(0, PAGE_SIZE);
return (
- <div className="not-prose flex flex-col gap-8">
- <div className="relative max-w-xs">
- <Search className="pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" />
- <input
- type="search"
- aria-label="Filter icons"
- value={query}
- onChange={(event) => setQuery(event.target.value)}
- placeholder="Filter icons…"
- className="w-full rounded-lg border border-fd-border bg-fd-background py-2 pr-3 pl-9 text-sm text-foreground outline-none focus-visible:ring-2 focus-visible:ring-ring/40"
- />
- </div>
+ <div className="not-prose mt-4 flex flex-col gap-4" data-not-typeset>
+ <FilterField
+ aria-label="Search icons"
+ placeholder={`Search ${ICONS.length} icons`}
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ className="h-11 sm:h-12"
+ />
+ <fieldset className="-mx-5 my-0 flex min-w-0 gap-1.5 border-0 py-0 overflow-x-auto px-5 [scrollbar-width:none] sm:mx-0 sm:flex-wrap sm:overflow-visible sm:px-0">
+ <legend className="sr-only">Icon categories</legend>
+ <FilterChip
+ active={!category}
+ count={ICONS.length}
+ onClick={() => setCategory(null)}
+ className={chip}
+ >
+ All
+ </FilterChip>
+ {CATEGORIES.map((item) => (
+ <FilterChip
+ key={item.category}
+ active={category === item.category}
+ count={item.count}
+ onClick={() =>
+ setCategory((current) =>
+ current === item.category ? null : item.category,
+ )
+ }
+ className={chip}
+ >
+ {item.category}
+ </FilterChip>
+ ))}
+ </fieldset>
- {groups.length === 0 ? (
- <p className="text-sm text-muted-foreground">
- {ICONS.length === 0
- ? "Icons are coming soon."
- : "No icons match your filter."}
+ {visible.length === 0 ? (
+ <p className="py-10 text-center text-small text-muted-foreground">
+ No icons match your search.
</p>
) : (
- groups.map((group) => (
- <section key={group.category} className="flex flex-col gap-3">
- <h3 className="sticky top-11 z-20 bg-background py-2 text-sm font-medium text-muted-foreground">
- {group.category}
- </h3>
- <div className="grid grid-cols-[repeat(auto-fill,minmax(132px,1fr))] gap-3">
- {group.icons.map((icon) => (
- <IconTile
- key={icon.name}
- icon={icon}
- active={active === icon.name}
- onActivate={() => setActive(icon.name)}
- onDeactivate={() =>
- setActive((current) =>
- current === icon.name ? null : current,
- )
- }
- />
- ))}
- </div>
- </section>
- ))
+ <ul className="grid grid-cols-4 gap-2 pt-1 sm:grid-cols-6">
+ {visible.map((icon) => (
+ <li key={icon.name}>
+ <IconTile
+ icon={icon}
+ active={active === icon.name}
+ onActivate={() => setActive(icon.name)}
+ onDeactivate={() =>
+ setActive((current) =>
+ current === icon.name ? null : current,
+ )
+ }
+ />
+ </li>
+ ))}
+ </ul>
)}
+
+ <div className="flex flex-col items-center gap-3 pt-2 sm:flex-row sm:justify-between">
+ <p
+ className="text-small text-muted-foreground tabular-nums"
+ aria-live="polite"
+ >
+ Showing {visible.length} of{" "}
+ {narrowed ? filtered.length : ICONS.length}
+ </p>
+ {!narrowed && filtered.length > PAGE_SIZE && (
+ <button
+ type="button"
+ aria-expanded={expanded}
+ onClick={() => setExpanded((open) => !open)}
+ className="flex h-11 w-full items-center justify-center gap-2 rounded-control-sm bg-secondary px-4 text-small font-medium text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-3 focus-visible:ring-ring sm:h-10 sm:w-auto dark:hover:bg-[#33363b]"
+ >
+ {expanded ? "Show fewer" : `Show all ${ICONS.length} icons`}
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className={cn(
+ "size-3.5 fill-none stroke-current stroke-2 [stroke-linecap:round] [stroke-linejoin:round]",
+ expanded && "rotate-180",
+ )}
+ >
+ <path d="m6 9 6 6 6-6" />
+ </svg>
+ </button>
+ )}
+ </div>
</div>
);
}
@@ -855,11 +184,13 @@ function IconTile({
const command = `npx shadcn@latest add @remocn/${icon.name}`;
const playing = active && !reducedMotion && Boolean(entry && preview);
const Static = icon.Static;
+ const label = icon.name.replace(/^icon-/, "");
const handleCopy = () => {
- navigator.clipboard.writeText(command);
- setCopied(true);
- setTimeout(() => setCopied(false), 1500);
+ void navigator.clipboard.writeText(command).then(() => {
+ setCopied(true);
+ setTimeout(() => setCopied(false), 1500);
+ });
};
const handleActivate = () => {
@@ -904,12 +235,14 @@ function IconTile({
title={command}
aria-label={`Copy install command for ${icon.label}`}
className={cn(
- "surface-card surface-card-interactive relative flex aspect-square w-full flex-col items-center justify-center gap-2 rounded-xl p-3 text-muted-foreground transition-[color,box-shadow]",
- "hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
+ "flex h-[104px] w-full flex-col items-center justify-center gap-3 rounded-control border border-hairline bg-surface px-1 text-muted-foreground outline-none transition-[border-color,box-shadow,color] duration-150",
+ "hover:border-divider hover:text-foreground hover:shadow-[0_8px_20px_rgb(14_16_18/10%),0_1px_2px_rgb(14_16_18/8%)] focus-visible:ring-3 focus-visible:ring-ring dark:hover:shadow-[0_8px_20px_rgb(0_0_0/45%)]",
+ active && "border-divider text-foreground",
)}
>
<span
- className="flex items-center justify-center"
+ aria-hidden="true"
+ className="flex items-center justify-center text-foreground"
style={{ width: MEDIA_SIZE, height: MEDIA_SIZE }}
>
{playing && entry && preview ? (
@@ -918,32 +251,51 @@ function IconTile({
<Static size={GLYPH_SIZE} strokeWidth={2} />
)}
</span>
- <span className="max-w-full truncate text-xs">{icon.label}</span>
- <span className="absolute top-1.5 right-1.5 opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">
- {copied ? (
- <Check className="size-3.5" />
- ) : (
- <Copy className="size-3.5" />
- )}
+ <span className="max-w-full text-center text-caption leading-4 [overflow-wrap:anywhere]">
+ {label}
</span>
</button>
+ <span
+ aria-hidden="true"
+ className="pointer-events-none absolute top-2 right-2 flex size-[22px] items-center justify-center rounded-tag bg-secondary text-foreground opacity-0 transition-opacity group-focus-within:opacity-100 group-hover:opacity-100"
+ >
+ {copied ? (
+ <svg
+ viewBox="0 0 24 24"
+ className="size-[11px] fill-none stroke-current stroke-[2.4] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="M20 6 9 17l-5-5" />
+ </svg>
+ ) : (
+ <CopyIcon className="size-[11px]" />
+ )}
+ </span>
+ <span className="sr-only" aria-live="polite">
+ {copied ? `Copied install command for ${icon.label}` : ""}
+ </span>
<button
type="button"
onClick={handleInstall}
aria-label={`Add ${icon.label} to Remotion Studio`}
title="Add to Remotion Studio"
- className="absolute top-1.5 left-1.5 rounded-md p-0.5 text-muted-foreground opacity-0 transition-opacity hover:text-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40 group-hover:opacity-100"
+ className="absolute top-2 left-2 flex size-[22px] items-center justify-center rounded-tag text-muted-foreground opacity-0 outline-none transition-opacity before:absolute before:-inset-1 group-hover:opacity-100 hover:bg-secondary hover:text-foreground focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:hidden"
>
{installing ? (
- <Loader2 className="size-3.5 animate-spin" />
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3 animate-spin fill-none stroke-current stroke-[2.4] [stroke-linecap:round]"
+ >
+ <path d="M21 12a9 9 0 1 1-6.2-8.56" />
+ </svg>
) : (
- <Remotion className="size-3.5" />
+ <Remotion className="size-3" />
)}
</button>
{installError ? (
<span
title={installError}
- className="absolute inset-x-1.5 bottom-1.5 truncate rounded-md bg-background/90 px-1.5 py-0.5 text-[10px] text-muted-foreground"
+ className="absolute inset-x-1.5 bottom-1.5 truncate rounded-tag bg-background/90 px-1.5 py-0.5 text-micro text-muted-foreground"
>
{installError}
</span>
@@ -970,7 +322,7 @@ function IconPlayer({
<AbsoluteFill
style={{ alignItems: "center", justifyContent: "center" }}
>
- <Icon size={GLYPH_SIZE} />
+ <Icon size={COMPOSITION_GLYPH} />
</AbsoluteFill>
),
};
diff --git a/components/docs/index/category/category-browser.tsx b/components/docs/index/category/category-browser.tsx
new file mode 100644
index 00000000..f467140f
--- /dev/null
+++ b/components/docs/index/category/category-browser.tsx
@@ -0,0 +1,182 @@
+"use client";
+
+import { type ReactNode, useDeferredValue, useState } from "react";
+import { ComponentCardGrid } from "@/components/docs/component-card-grid";
+import type { DocEntry } from "../data";
+import { FilterChip } from "../filter-chip";
+import { FilterField } from "../filter-field";
+import { IndexSection } from "../index-section";
+
+export type BrowserEntry = DocEntry & { order: number };
+
+export type BrowserGroup = {
+ id: string;
+ title: string;
+ /** The group's MDX heading (+ lead), rendered on the server. */
+ heading: ReactNode;
+ entries: BrowserEntry[];
+};
+
+type Order = "sidebar" | "alphabetical";
+
+const ORDERS: { value: Order; label: string }[] = [
+ { value: "sidebar", label: "Sidebar order" },
+ { value: "alphabetical", label: "A to Z" },
+];
+
+function matches(entry: DocEntry, query: string) {
+ if (!query) return true;
+ const haystack =
+ `${entry.title} ${entry.description ?? ""} ${entry.url}`.toLowerCase();
+ return query
+ .toLowerCase()
+ .split(/\s+/)
+ .every((word) => haystack.includes(word));
+}
+
+function sortEntries(entries: BrowserEntry[], order: Order) {
+ return [...entries].sort((a, b) =>
+ order === "alphabetical"
+ ? a.title.localeCompare(b.title)
+ : a.order - b.order,
+ );
+}
+
+/**
+ * Client half of `CategoryIndex`: filter by text, narrow to one group with the
+ * chips, switch between sidebar and alphabetical order. Groups left empty by
+ * a filter disappear; counts follow the filter.
+ */
+export function CategoryBrowser({
+ groups,
+ noun,
+}: {
+ groups: BrowserGroup[];
+ noun: string;
+}) {
+ const [query, setQuery] = useState("");
+ const [order, setOrder] = useState<Order>("sidebar");
+ const [active, setActive] = useState<string | null>(null);
+ const deferredQuery = useDeferredValue(query.trim());
+ const total = new Set(groups.flatMap((g) => g.entries.map((e) => e.url)))
+ .size;
+
+ const visible = groups
+ .filter((group) => !active || group.id === active)
+ .map((group) => ({
+ ...group,
+ entries: sortEntries(
+ group.entries.filter((entry) => matches(entry, deferredQuery)),
+ order,
+ ),
+ }))
+ .filter((group) => group.entries.length);
+ const shown = new Set(
+ visible.flatMap((group) => group.entries.map((entry) => entry.url)),
+ ).size;
+
+ return (
+ <div className="not-prose mt-6 flex flex-col sm:mt-7" data-not-typeset>
+ <div className="flex flex-col gap-2.5 sm:gap-3">
+ <div className="flex flex-col gap-2.5 sm:flex-row">
+ <FilterField
+ aria-label={`Filter ${noun}`}
+ placeholder={`Filter ${total} ${noun} by name or effect`}
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ />
+ <label className="relative flex h-11 w-fit shrink-0 items-center gap-2 rounded-control bg-secondary px-3.5 text-[15px] leading-5 text-foreground transition-colors focus-within:ring-3 focus-within:ring-ring hover:bg-[#dcdde0] dark:hover:bg-[#33363b]">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-foreground stroke-2 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="M7 4v16M3 16l4 4 4-4M17 20V4M13 8l4-4 4 4" />
+ </svg>
+ <span aria-hidden="true">
+ {ORDERS.find((option) => option.value === order)?.label}
+ </span>
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-muted-foreground stroke-2 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="m6 9 6 6 6-6" />
+ </svg>
+ <select
+ aria-label="Order"
+ value={order}
+ onChange={(event) => setOrder(event.target.value as Order)}
+ className="absolute inset-0 cursor-pointer appearance-none opacity-0"
+ >
+ {ORDERS.map((option) => (
+ <option key={option.value} value={option.value}>
+ {option.label}
+ </option>
+ ))}
+ </select>
+ </label>
+ </div>
+ {groups.length > 1 && (
+ <div className="-mx-5 flex gap-2 overflow-x-auto px-5 pt-1 [scrollbar-width:none] sm:mx-0 sm:flex-wrap sm:overflow-visible sm:px-0 sm:pt-0">
+ <FilterChip
+ active={!active}
+ count={total}
+ leading="Aa"
+ onClick={() => setActive(null)}
+ className="max-sm:h-11 max-sm:rounded-control-sm"
+ >
+ All
+ </FilterChip>
+ {groups.map((group) => (
+ <FilterChip
+ key={group.id}
+ active={active === group.id}
+ count={group.entries.length}
+ onClick={() =>
+ setActive((current) =>
+ current === group.id ? null : group.id,
+ )
+ }
+ className="max-sm:h-11 max-sm:rounded-control-sm max-sm:px-3.5"
+ >
+ {group.title}
+ </FilterChip>
+ ))}
+ </div>
+ )}
+ </div>
+
+ <p className="sr-only" aria-live="polite">
+ Showing {shown} of {total} {noun}
+ </p>
+
+ {visible.map((group) => (
+ <IndexSection
+ key={group.id}
+ heading={group.heading}
+ count={group.heading ? group.entries.length : undefined}
+ className="mt-10 first:mt-10 sm:mt-12 sm:first:mt-12"
+ >
+ <ComponentCardGrid
+ className="my-0"
+ items={group.entries.map((entry) => ({
+ name: entry.title,
+ description: entry.description,
+ status: "stable",
+ href: entry.url,
+ component: entry.component,
+ isNew: entry.isNew,
+ }))}
+ />
+ </IndexSection>
+ ))}
+
+ {!visible.length && (
+ <p className="mt-10 rounded-card bg-surface px-5 py-8 text-center text-small text-muted-foreground shadow-[0_0_0_1px_var(--color-hairline)]">
+ No {noun} match “{deferredQuery}”.
+ </p>
+ )}
+ </div>
+ );
+}
diff --git a/components/docs/index/category/category-index.tsx b/components/docs/index/category/category-index.tsx
new file mode 100644
index 00000000..afd00c23
--- /dev/null
+++ b/components/docs/index/category/category-index.tsx
@@ -0,0 +1,124 @@
+import {
+ Children,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+import {
+ type DocEntry,
+ getComponentEntries,
+ getEntry,
+ loadDocsSource,
+} from "../data";
+import { type BrowserGroup, CategoryBrowser } from "./category-browser";
+import { ComponentGroup, type ComponentGroupProps } from "./component-group";
+
+/** Plain text of an MDX node (the heading's label). */
+function textOf(node: ReactNode): string {
+ if (typeof node === "string" || typeof node === "number") return `${node}`;
+ if (Array.isArray(node)) return node.map(textOf).join("");
+ if (isValidElement<{ children?: ReactNode }>(node)) {
+ return textOf(node.props.children);
+ }
+ return "";
+}
+
+/** The `id` fumadocs put on the group's MDX heading. */
+function idOf(node: ReactNode): string | undefined {
+ for (const child of Children.toArray(node)) {
+ if (isValidElement<{ id?: string }>(child) && child.props.id) {
+ return child.props.id;
+ }
+ }
+ return undefined;
+}
+
+/**
+ * A component category index: a filter bar (search, order, group chips) over
+ * the category's components, grouped by the `<ComponentGroup>` children.
+ * Titles, descriptions, "new" tags and the sidebar order come from the pages;
+ * any component page not listed in a group lands in a trailing "More" group so
+ * the index can never silently miss one. Without groups it is one flat grid.
+ *
+ * ```mdx
+ * <CategoryIndex section="/docs/typography">
+ *
+ * <ComponentGroup items={["soft-blur-in", "tracking-in"]}>
+ *
+ * ## Reveals
+ *
+ * </ComponentGroup>
+ *
+ * </CategoryIndex>
+ * ```
+ */
+export async function CategoryIndex({
+ section,
+ noun = "components",
+ children,
+}: {
+ /** Docs url of the category, e.g. "/docs/typography". */
+ section: string;
+ /** What the filter placeholder calls the items. */
+ noun?: string;
+ children?: ReactNode;
+}) {
+ await loadDocsSource();
+ const sectionEntries = getComponentEntries(section);
+ const order = new Map(
+ sectionEntries.map((entry, index) => [entry.url, index]),
+ );
+ const listed = new Set<string>();
+
+ const groups: (Omit<BrowserGroup, "entries"> & { entries: DocEntry[] })[] =
+ Children.toArray(children)
+ .filter(
+ (child): child is ReactElement<ComponentGroupProps> =>
+ isValidElement(child) && child.type === ComponentGroup,
+ )
+ .map((child, index) => {
+ const entries = child.props.items
+ .map((item) =>
+ getEntry(item.startsWith("/") ? item : `${section}/${item}`),
+ )
+ .filter((entry): entry is DocEntry => Boolean(entry));
+ for (const entry of entries) listed.add(entry.url);
+ return {
+ id: idOf(child.props.children) ?? `group-${index}`,
+ title: textOf(
+ Children.toArray(child.props.children).find(
+ (node) => isValidElement<{ id?: string }>(node) && node.props.id,
+ ),
+ ),
+ heading: <>{child.props.children}</>,
+ entries,
+ };
+ });
+
+ const rest = sectionEntries.filter((entry) => !listed.has(entry.url));
+ if (rest.length) {
+ groups.push({
+ id: groups.length ? "more" : "all",
+ title: groups.length ? "More" : "",
+ heading: groups.length ? (
+ <h2 key="more" id="more">
+ More
+ </h2>
+ ) : null,
+ entries: rest,
+ });
+ }
+
+ return (
+ <CategoryBrowser
+ groups={groups.map((group) => ({
+ ...group,
+ entries: group.entries.map((entry) => ({
+ ...entry,
+ order: order.get(entry.url) ?? Number.MAX_SAFE_INTEGER,
+ })),
+ }))}
+ noun={noun}
+ />
+ );
+}
diff --git a/components/docs/index/category/component-group.tsx b/components/docs/index/category/component-group.tsx
new file mode 100644
index 00000000..08a16290
--- /dev/null
+++ b/components/docs/index/category/component-group.tsx
@@ -0,0 +1,19 @@
+import type { ReactNode } from "react";
+
+export type ComponentGroupProps = {
+ /**
+ * Pages in this group: slugs inside the category (`"soft-blur-in"`) or full
+ * docs urls for a page that lives elsewhere.
+ */
+ items: string[];
+ /** The group's `##` heading and an optional lead paragraph, in MDX. */
+ children: ReactNode;
+};
+
+/**
+ * Declares one group of a `<CategoryIndex>`. It renders nothing by itself:
+ * `CategoryIndex` reads its props and lays the groups out.
+ */
+export function ComponentGroup(_props: ComponentGroupProps) {
+ return null;
+}
diff --git a/components/docs/index/data.ts b/components/docs/index/data.ts
new file mode 100644
index 00000000..e609974e
--- /dev/null
+++ b/components/docs/index/data.ts
@@ -0,0 +1,267 @@
+import type { Folder, Item, Node } from "fumadocs-core/page-tree";
+import type { ReactNode } from "react";
+import { NEW_BADGE_PATHS } from "@/config/site";
+import { DOCS_TABS, type DocsTabId } from "@/lib/docs-tabs";
+import iconsRegistry from "@/registry/remocn-icons/registry.json";
+import type { source as docsSourceType } from "@/source";
+
+/**
+ * Read-only queries over the fumadocs page tree that the docs index screens
+ * (docs home, category indexes, library overviews) render from. Everything a
+ * card shows (titles, descriptions, counts, "new" tags, order) is derived here
+ * so the index MDX never restates data that already lives in the content.
+ */
+
+export type DocEntry = {
+ url: string;
+ title: string;
+ description?: string;
+ /** Registry name from the page's `component` frontmatter. */
+ component?: string;
+ isNew: boolean;
+};
+
+type DocsSource = typeof docsSourceType;
+export type DocPage = ReturnType<DocsSource["getPages"]>[number];
+
+// `@/source` must never be imported statically from here: the index MDX pages
+// render these helpers, and `@/source` imports the MDX pages, so a static
+// import evaluates `source` while `.source/server` is still initialising
+// (500 on every route that loads the docs collection first, e.g. the RSS
+// feed). Components load it once per render with `await loadDocsSource()`.
+let loaded: DocsSource | undefined;
+let pageMap: Map<string, DocPage> | undefined;
+
+/** Await before calling any helper below (server components only). */
+export async function loadDocsSource(): Promise<DocsSource> {
+ loaded ??= (await import("@/source")).source;
+ return loaded;
+}
+
+/** The fumadocs source, once `loadDocsSource()` has resolved. */
+export function docsSource(): DocsSource {
+ if (!loaded) {
+ throw new Error("Call `await loadDocsSource()` before reading docs data.");
+ }
+ return loaded;
+}
+
+function pagesByUrl() {
+ pageMap ??= new Map(
+ docsSource()
+ .getPages()
+ .map((page) => [page.url, page]),
+ );
+ return pageMap;
+}
+
+/** Raw fumadocs page (all frontmatter) by docs url. */
+export function getPage(url: string): DocPage | undefined {
+ return pagesByUrl().get(url);
+}
+
+export function getEntry(url: string): DocEntry | undefined {
+ const page = pagesByUrl().get(url);
+ if (!page) return undefined;
+ return {
+ url: page.url,
+ title: page.data.title,
+ description: page.data.description,
+ component: page.data.component,
+ isNew: NEW_BADGE_PATHS.has(page.url),
+ };
+}
+
+/** Every page item under a node, in sidebar order (folder index first). */
+function itemsOf(node: Node): Item[] {
+ if (node.type === "page") return [node];
+ if (node.type === "folder") {
+ return [
+ ...(node.index ? [node.index] : []),
+ ...node.children.flatMap(itemsOf),
+ ];
+ }
+ return [];
+}
+
+function folderUrl(folder: Folder): string | undefined {
+ return folder.index?.url ?? itemsOf(folder)[0]?.url;
+}
+
+/** Top-level folder whose pages live under `prefix` (e.g. "/docs/typography"). */
+export function getSection(prefix: string): Folder | undefined {
+ return docsSource().pageTree.children.find(
+ (node): node is Folder =>
+ node.type === "folder" &&
+ itemsOf(node).some(
+ (item) => item.url === prefix || item.url.startsWith(`${prefix}/`),
+ ),
+ );
+}
+
+/** Pages of a section that document a registry component, in sidebar order. */
+export function getComponentEntries(prefix: string): DocEntry[] {
+ const folder = getSection(prefix);
+ if (!folder) return [];
+ return itemsOf(folder)
+ .map((item) => getEntry(item.url))
+ .filter((entry): entry is DocEntry => Boolean(entry?.component));
+}
+
+/** All pages of a section in sidebar order, components or not. */
+export function getSectionEntries(prefix: string): DocEntry[] {
+ const folder = getSection(prefix);
+ if (!folder) return [];
+ return itemsOf(folder)
+ .map((item) => getEntry(item.url))
+ .filter((entry): entry is DocEntry => Boolean(entry));
+}
+
+/** "New" when the whole section is new, "3 new" when part of it is. */
+export function newLabel(entries: DocEntry[]): string | undefined {
+ const fresh = entries.filter((entry) => entry.isNew).length;
+ if (!fresh) return undefined;
+ return fresh === entries.length ? "New" : `${fresh} new`;
+}
+
+/** Library tabs: everything in the sidebar switcher except Components and Templates. */
+const LIBRARY_TABS: DocsTabId[] = [
+ "primitives",
+ "shaders",
+ "filters",
+ "captions",
+ "icons",
+];
+
+const TAB_PREFIX: Record<DocsTabId, string> = {
+ components: "/docs",
+ primitives: "/docs/ui",
+ shaders: "/docs/shaders",
+ filters: "/docs/filters",
+ captions: "/docs/captions",
+ templates: "/docs/templates",
+ icons: "/docs/icons",
+};
+
+const ICON_COUNT = iconsRegistry.items.filter((item) =>
+ item.name.startsWith("icon-"),
+).length;
+
+export type Category = {
+ url: string;
+ title: string;
+ description?: string;
+ icon: ReactNode;
+ count: number;
+ newLabel?: string;
+};
+
+/**
+ * Component categories of the docs home: every top-level section that holds
+ * component pages and is not a library tab, in sidebar (root meta.json) order.
+ */
+export function getCategories(): Category[] {
+ const libraryPrefixes = LIBRARY_TABS.map((id) => TAB_PREFIX[id]);
+ return docsSource().pageTree.children.flatMap((node) => {
+ if (node.type !== "folder") return [];
+ const url = folderUrl(node);
+ if (
+ !url ||
+ libraryPrefixes.some(
+ (prefix) => url === prefix || url.startsWith(`${prefix}/`),
+ )
+ ) {
+ return [];
+ }
+ const entries = itemsOf(node)
+ .map((item) => getEntry(item.url))
+ .filter((entry): entry is DocEntry => Boolean(entry?.component));
+ if (!entries.length) return [];
+ // Sections list "index" in meta.json, so the index page is the first item
+ // rather than `folder.index`.
+ const first = getEntry(url);
+ const index = first?.component ? undefined : first;
+ return [
+ {
+ url,
+ title: typeof node.name === "string" ? node.name : (index?.title ?? ""),
+ description: index?.description,
+ icon: node.icon,
+ count: entries.length,
+ newLabel: newLabel(entries),
+ },
+ ];
+ });
+}
+
+export type Library = {
+ id: DocsTabId;
+ label: string;
+ href: string;
+ count: number;
+};
+
+/** Library tabs with their component counts (icons count the icon registry). */
+export function getLibraries(): Library[] {
+ return DOCS_TABS.filter((tab) => LIBRARY_TABS.includes(tab.id)).map(
+ (tab) => ({
+ id: tab.id,
+ label: tab.label,
+ href: tab.href,
+ count:
+ tab.id === "icons"
+ ? ICON_COUNT
+ : getComponentEntries(TAB_PREFIX[tab.id]).length,
+ }),
+ );
+}
+
+export type EntryGroup = { title: string; entries: DocEntry[] };
+
+/**
+ * A section split at its meta.json `---Label---` separators, e.g. the guides
+ * section's "Videos" and "Practices". Pages before the first separator are
+ * returned under an empty title.
+ */
+export function getSeparatedGroups(prefix: string): EntryGroup[] {
+ const folder = getSection(prefix);
+ if (!folder) return [];
+ const groups: EntryGroup[] = [{ title: "", entries: [] }];
+ for (const node of folder.children) {
+ if (node.type === "separator") {
+ groups.push({
+ title: typeof node.name === "string" ? node.name : "",
+ entries: [],
+ });
+ continue;
+ }
+ for (const item of itemsOf(node)) {
+ const entry = getEntry(item.url);
+ if (entry) groups[groups.length - 1].entries.push(entry);
+ }
+ }
+ return groups;
+}
+
+export type GuideMedia = {
+ /** Approximate runtime in seconds, read from the "~30-second" description. */
+ seconds?: number;
+ poster?: string;
+ video?: string;
+};
+
+/** The finished video a guide page opens with (its `<GuideVideo>`), if any. */
+export async function getGuideMedia(url: string): Promise<GuideMedia> {
+ const page = pagesByUrl().get(url);
+ if (!page) return {};
+ const data = page.data as typeof page.data & {
+ getText: (type: "raw" | "processed") => Promise<string>;
+ };
+ const raw = await data.getText("raw");
+ const seconds = /~(\d+)-second/.exec(page.data.description ?? "")?.[1];
+ return {
+ seconds: seconds ? Number(seconds) : undefined,
+ poster: /<GuideVideo[^>]*\bposter="([^"]+)"/.exec(raw)?.[1],
+ video: /<GuideVideo[^>]*\bsrc="([^"]+)"/.exec(raw)?.[1],
+ };
+}
diff --git a/components/docs/index/filter-chip.tsx b/components/docs/index/filter-chip.tsx
new file mode 100644
index 00000000..8e9b9042
--- /dev/null
+++ b/components/docs/index/filter-chip.tsx
@@ -0,0 +1,61 @@
+import type { ComponentProps, ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/**
+ * Filter chip with a trailing count, shared by every index screen that narrows
+ * a grid (category groups, library vibes, icon groups). Pressed = ink fill.
+ */
+export function FilterChip({
+ active,
+ count,
+ leading,
+ className,
+ children,
+ ...props
+}: ComponentProps<"button"> & {
+ active?: boolean;
+ count?: number;
+ /** Optional glyph tile before the label (the "Aa" of the All chip). */
+ leading?: ReactNode;
+}) {
+ return (
+ <button
+ type="button"
+ aria-pressed={active}
+ className={cn(
+ "inline-flex h-[34px] shrink-0 items-center gap-2 rounded-[10px] px-3 text-[15px] leading-[18px] outline-none transition-colors duration-150 select-none focus-visible:ring-3 focus-visible:ring-ring",
+ active
+ ? "bg-foreground text-inverse"
+ : "bg-[#f1f1f3] text-foreground hover:bg-secondary dark:bg-secondary dark:hover:bg-[#33363b]",
+ leading && "pl-1",
+ className,
+ )}
+ {...props}
+ >
+ {leading && (
+ <span
+ aria-hidden="true"
+ className={cn(
+ "flex size-[26px] items-center justify-center rounded-[7px] text-mono leading-[14px] font-semibold",
+ active ? "bg-background text-foreground" : "bg-surface",
+ )}
+ >
+ {leading}
+ </span>
+ )}
+ {children}
+ {count !== undefined && (
+ <span
+ className={cn(
+ "text-caption leading-4 tabular-nums",
+ active
+ ? "text-primary-soft dark:text-primary"
+ : "text-subtle dark:text-muted-foreground",
+ )}
+ >
+ {count}
+ </span>
+ )}
+ </button>
+ );
+}
diff --git a/components/docs/index/filter-field.tsx b/components/docs/index/filter-field.tsx
new file mode 100644
index 00000000..c36b2a2f
--- /dev/null
+++ b/components/docs/index/filter-field.tsx
@@ -0,0 +1,59 @@
+"use client";
+
+import { type ComponentProps, useEffect, useRef } from "react";
+import { cn } from "@/lib/utils";
+
+/**
+ * Search input of the index filter bars. Pressing "/" anywhere on the page
+ * (outside another field) focuses it, as the key hint promises.
+ */
+export function FilterField({
+ className,
+ ...props
+}: Omit<ComponentProps<"input">, "type">) {
+ const ref = useRef<HTMLInputElement>(null);
+
+ useEffect(() => {
+ const onKey = (event: KeyboardEvent) => {
+ if (event.key !== "/" || event.metaKey || event.ctrlKey) return;
+ const target = event.target as HTMLElement | null;
+ if (target?.closest("input, textarea, select, [contenteditable]")) return;
+ event.preventDefault();
+ ref.current?.focus();
+ };
+ window.addEventListener("keydown", onKey);
+ return () => window.removeEventListener("keydown", onKey);
+ }, []);
+
+ return (
+ <label
+ className={cn(
+ "flex h-11 min-w-0 grow items-center gap-2.5 rounded-control bg-surface px-3.5 shadow-[0_0_0_1px_var(--color-divider)] transition-shadow focus-within:shadow-[0_0_0_1px_var(--color-subtle)]",
+ className,
+ )}
+ >
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-4 shrink-0 fill-none stroke-muted-foreground stroke-2 [stroke-linecap:round]"
+ >
+ <circle cx="11" cy="11" r="7" />
+ <path d="m20 20-3.5-3.5" />
+ </svg>
+ <input
+ ref={ref}
+ type="search"
+ autoComplete="off"
+ spellCheck={false}
+ className="min-w-0 grow bg-transparent text-base leading-5 text-foreground outline-none placeholder:text-subtle sm:text-[15px] [&::-webkit-search-cancel-button]:hidden"
+ {...props}
+ />
+ <span
+ aria-hidden="true"
+ className="flex size-6 shrink-0 items-center justify-center rounded-tag bg-surface-muted font-sans text-mono leading-4 text-muted-foreground max-sm:hidden"
+ >
+ /
+ </span>
+ </label>
+ );
+}
diff --git a/components/docs/index/guides/guide-practices.tsx b/components/docs/index/guides/guide-practices.tsx
new file mode 100644
index 00000000..5ed288c3
--- /dev/null
+++ b/components/docs/index/guides/guide-practices.tsx
@@ -0,0 +1,52 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { getSeparatedGroups, loadDocsSource } from "../data";
+import { IndexSection, indexCard } from "../index-section";
+
+/**
+ * "The practices": the guides section's "Practices" group as one list card,
+ * title column + description, in sidebar order.
+ */
+export async function GuidePractices({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const practices =
+ getSeparatedGroups("/docs/guides").find(
+ (group) => group.title === "Practices",
+ )?.entries ?? [];
+
+ return (
+ <IndexSection
+ heading={children}
+ count={practices.length}
+ className="mt-8 sm:mt-12"
+ >
+ <ul className={cn(indexCard, "flex flex-col p-1.5")}>
+ {practices.map((entry) => (
+ <li key={entry.url}>
+ <Link
+ href={entry.url}
+ className="flex items-center gap-3 rounded-control py-3 pr-3 pl-3.5 outline-none transition-colors duration-150 hover:bg-surface-muted focus-visible:ring-3 focus-visible:ring-ring sm:min-h-[68px] sm:gap-4 sm:px-3.5"
+ >
+ <span className="flex min-w-0 grow flex-col gap-0.5 sm:flex-row sm:items-center sm:gap-4">
+ <span className="text-[15px] leading-5 font-medium text-foreground sm:w-[220px] sm:shrink-0">
+ {entry.title}
+ </span>
+ <span className="text-small text-muted-foreground sm:line-clamp-2">
+ {entry.description}
+ </span>
+ </span>
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-subtle-line stroke-2 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="m9 6 6 6-6 6" />
+ </svg>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/guides/guide-videos.tsx b/components/docs/index/guides/guide-videos.tsx
new file mode 100644
index 00000000..362067bb
--- /dev/null
+++ b/components/docs/index/guides/guide-videos.tsx
@@ -0,0 +1,77 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { getGuideMedia, getSeparatedGroups, loadDocsSource } from "../data";
+import { IndexSection, indexCard, indexCardLink } from "../index-section";
+import { FallbackArt, VIDEO_ART } from "./video-art";
+
+/**
+ * "The videos": one card per guide in the guides section's "Videos" group,
+ * fronted by the guide's own video poster (or still art until it has one).
+ */
+export async function GuideVideos({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const videos =
+ getSeparatedGroups("/docs/guides").find((group) => group.title === "Videos")
+ ?.entries ?? [];
+ const media = await Promise.all(
+ videos.map((entry) => getGuideMedia(entry.url)),
+ );
+
+ return (
+ <IndexSection
+ heading={children}
+ count={videos.length}
+ className="mt-8 sm:mt-11"
+ >
+ <ul className="grid gap-3 sm:grid-cols-2 sm:gap-5">
+ {videos.map((entry, index) => {
+ const { poster, seconds } = media[index];
+ const slug = entry.url.split("/").pop() ?? "";
+ return (
+ <li key={entry.url}>
+ <Link
+ href={entry.url}
+ className={cn(
+ indexCard,
+ indexCardLink,
+ "group/video flex h-full flex-col rounded-[18px] p-[5px] pb-4 sm:rounded-card sm:p-1.5 sm:pb-4",
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className="relative block aspect-[346/196] overflow-hidden rounded-control bg-dark-surface"
+ >
+ {poster ? (
+ // biome-ignore lint/performance/noImgElement: remote CDN poster, sized by its box
+ <img
+ src={poster}
+ alt=""
+ loading="lazy"
+ className="absolute inset-0 size-full object-cover transition-transform duration-200 ease-[cubic-bezier(0.19,1,0.22,1)] group-hover/video:scale-[1.02] motion-reduce:transition-none motion-reduce:group-hover/video:scale-100"
+ />
+ ) : (
+ (VIDEO_ART[slug] ?? <FallbackArt title={entry.title} />)
+ )}
+ {seconds && (
+ <span className="absolute bottom-3 left-3 flex h-[26px] items-center rounded-tile bg-[#0e1012b8] px-[9px] text-mono leading-4 font-medium text-[#fafafa]">
+ ~{seconds} s
+ </span>
+ )}
+ </span>
+ <span className="flex flex-col gap-1.5 px-2.5 pt-3.5">
+ <span className="text-button-lg leading-[22px] font-medium text-foreground">
+ {entry.title}
+ </span>
+ <span className="line-clamp-2 text-small text-muted-foreground">
+ {entry.description}
+ </span>
+ </span>
+ </Link>
+ </li>
+ );
+ })}
+ </ul>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/guides/setup-card.tsx b/components/docs/index/guides/setup-card.tsx
new file mode 100644
index 00000000..3aeff046
--- /dev/null
+++ b/components/docs/index/guides/setup-card.tsx
@@ -0,0 +1,58 @@
+import type { ReactNode } from "react";
+import { LandingButton } from "@/app/(home)/components/landing/ui/landing-button";
+import { cn } from "@/lib/utils";
+import { getEntry, loadDocsSource } from "../data";
+import { indexCard } from "../index-section";
+
+/**
+ * "First time here?" callout that sends newcomers to the guides setup page.
+ * The title and line are MDX; the target is the setup page from the tree.
+ */
+export async function SetupCard({
+ title,
+ children,
+}: {
+ title: string;
+ children: ReactNode;
+}) {
+ await loadDocsSource();
+ const setup = getEntry("/docs/guides/setup");
+ if (!setup) return null;
+
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ indexCard,
+ "not-prose mt-8 flex flex-col gap-3.5 p-4 sm:mt-5 sm:flex-row sm:items-center sm:gap-[18px] sm:py-[18px] sm:pr-[18px] sm:pl-5",
+ )}
+ >
+ <div className="flex grow items-start gap-3.5 sm:items-center sm:gap-[18px]">
+ <span
+ aria-hidden="true"
+ className="flex size-11 shrink-0 items-center justify-center rounded-control-sm bg-surface-muted"
+ >
+ <svg
+ viewBox="0 0 24 24"
+ className="size-5 fill-none stroke-foreground stroke-[1.8] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="M4 17V7a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10M2 19h20M8 9l3 3-3 3M13 15h3" />
+ </svg>
+ </span>
+ <div className="flex grow flex-col gap-0.5">
+ <p className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </p>
+ <div className="text-small text-muted-foreground">{children}</div>
+ </div>
+ </div>
+ <LandingButton
+ href={setup.url}
+ arrow="→"
+ className="h-12 w-full rounded-control text-ui leading-5 font-medium sm:h-10 sm:w-auto sm:rounded-control-sm sm:px-4 sm:text-small sm:leading-[18px]"
+ >
+ Start {setup.title.toLowerCase()}
+ </LandingButton>
+ </div>
+ );
+}
diff --git a/components/docs/index/guides/video-art.tsx b/components/docs/index/guides/video-art.tsx
new file mode 100644
index 00000000..123fa879
--- /dev/null
+++ b/components/docs/index/guides/video-art.tsx
@@ -0,0 +1,53 @@
+import type { ReactNode } from "react";
+
+/**
+ * Still artwork for guides whose page has no finished video (and therefore no
+ * poster) yet. Keyed by guide slug; anything missing falls back to its title.
+ */
+export const VIDEO_ART: Record<string, ReactNode> = {
+ teaser: (
+ <span className="flex size-full items-center justify-center bg-dark-surface">
+ <span className="absolute inset-0 bg-[url(/landing/shader-magenta.png)] bg-cover bg-center opacity-85" />
+ <span className="relative text-[28px] leading-[34px] font-semibold tracking-[-0.03em] text-[#fafafa]">
+ something is coming
+ </span>
+ </span>
+ ),
+ "product-demo": (
+ <span className="flex size-full items-center justify-center bg-dark-surface">
+ <span className="absolute inset-0 bg-[url(/bg.jpg)] bg-cover bg-center opacity-80" />
+ <span className="relative flex items-center gap-2 text-lead leading-[26px] tracking-title text-[#fafafa]">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-[18px] fill-none stroke-current stroke-[1.8] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <rect x="2" y="6" width="14" height="12" rx="2" />
+ <path d="m16 10 6-3v10l-6-3" />
+ </svg>
+ Remocn Studio
+ </span>
+ </span>
+ ),
+ "changelog-video": (
+ <span className="flex size-full flex-col justify-center gap-2 bg-[#f4f4f5] pl-10 text-lead leading-[26px] font-semibold tracking-title text-[#0e1012]">
+ {["New components", "Improvements", "Fixes"].map((line, index) => (
+ <span
+ key={line}
+ className="flex items-center gap-2.5"
+ style={{ opacity: [1, 0.45, 0.18][index] }}
+ >
+ <span className="size-2 rounded-full bg-current" />
+ {line}
+ </span>
+ ))}
+ </span>
+ ),
+};
+
+export function FallbackArt({ title }: { title: string }) {
+ return (
+ <span className="flex size-full items-center justify-center bg-surface-muted text-lead font-semibold tracking-title text-foreground">
+ {title}
+ </span>
+ );
+}
diff --git a/components/docs/index/home/category-list.tsx b/components/docs/index/home/category-list.tsx
new file mode 100644
index 00000000..6a63c949
--- /dev/null
+++ b/components/docs/index/home/category-list.tsx
@@ -0,0 +1,73 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { getCategories, loadDocsSource } from "../data";
+import { IndexSection, indexCard } from "../index-section";
+import { NewTag } from "../new-tag";
+
+/**
+ * "Components": every component category with its sidebar icon, description,
+ * component count and "new" tag, in sidebar order.
+ */
+export async function CategoryList({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const categories = getCategories();
+
+ return (
+ <IndexSection heading={children} count={categories.length}>
+ <ul className={cn(indexCard, "flex flex-col p-1 sm:p-1.5")}>
+ {categories.map((category) => (
+ <li key={category.url}>
+ <Link
+ href={category.url}
+ className="group/row flex min-h-[68px] items-center gap-3.5 rounded-control px-3 py-3 outline-none transition-colors duration-150 hover:bg-surface-muted focus-visible:ring-3 focus-visible:ring-ring"
+ >
+ <span
+ aria-hidden="true"
+ className="flex size-10 shrink-0 items-center justify-center rounded-[10px] bg-surface-muted text-body transition-colors group-hover/row:bg-surface [&_svg]:size-4"
+ >
+ {category.icon ?? <FallbackIcon />}
+ </span>
+ <span className="flex min-w-0 grow flex-col gap-0.5">
+ <span className="flex items-center gap-2">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {category.title}
+ </span>
+ {category.newLabel && <NewTag>{category.newLabel}</NewTag>}
+ </span>
+ {category.description && (
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {category.description}
+ </span>
+ )}
+ </span>
+ <span className="w-8 shrink-0 text-right text-mono leading-4 text-subtle tabular-nums">
+ {category.count}
+ </span>
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-subtle-line stroke-2 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="m9 6 6 6-6 6" />
+ </svg>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </IndexSection>
+ );
+}
+
+/** For a section whose meta.json sets no icon. */
+function FallbackIcon() {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ className="fill-none stroke-current stroke-[1.7] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <rect x="3" y="4" width="18" height="16" rx="3" />
+ <path d="m10 9 5 3-5 3z" />
+ </svg>
+ );
+}
diff --git a/components/docs/index/home/guides-feature.tsx b/components/docs/index/home/guides-feature.tsx
new file mode 100644
index 00000000..69baa61d
--- /dev/null
+++ b/components/docs/index/home/guides-feature.tsx
@@ -0,0 +1,106 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { LandingButton } from "@/app/(home)/components/landing/ui/landing-button";
+import { cn } from "@/lib/utils";
+import {
+ getEntry,
+ getGuideMedia,
+ getSeparatedGroups,
+ loadDocsSource,
+} from "../data";
+import { IndexSection, indexCard } from "../index-section";
+
+const button =
+ "h-12 w-full rounded-control-sm px-4 text-[15px] leading-[18px] font-medium sm:h-10 sm:w-auto sm:text-small";
+
+/**
+ * "Make a video": the guides section as one card, fronted by the poster of a
+ * featured guide's finished video. Counts come from the guides page tree.
+ */
+export async function GuidesFeature({
+ guide,
+ children,
+}: {
+ /** Guide whose video poster fronts the card, e.g. "showcase-reel". */
+ guide: string;
+ children: ReactNode;
+}) {
+ await loadDocsSource();
+ const groups = getSeparatedGroups("/docs/guides");
+ const pages = groups.flatMap((group) => group.entries);
+ const guides = pages.filter((entry) => entry.url !== "/docs/guides");
+ const videos = groups.find((group) => group.title === "Videos")?.entries;
+ const index = getEntry("/docs/guides");
+ const setup = getEntry("/docs/guides/setup");
+ const featured = getEntry(`/docs/guides/${guide}`);
+ const media = featured ? await getGuideMedia(featured.url) : {};
+
+ return (
+ <IndexSection heading={children} count={guides.length}>
+ <div
+ className={cn(
+ indexCard,
+ "flex flex-col gap-1 p-2 sm:flex-row sm:gap-6 sm:py-2 sm:pr-7 sm:pl-2",
+ )}
+ >
+ {featured && (
+ <Link
+ href={featured.url}
+ className="group/poster relative h-[196px] shrink-0 overflow-hidden rounded-control-sm bg-dark-surface outline-none focus-visible:ring-3 focus-visible:ring-ring sm:h-[236px] sm:w-[300px]"
+ >
+ {media.poster && (
+ // biome-ignore lint/performance/noImgElement: remote CDN poster, sized by its box
+ <img
+ src={media.poster}
+ alt=""
+ loading="lazy"
+ className="absolute inset-0 size-full object-cover transition-transform duration-200 ease-[cubic-bezier(0.19,1,0.22,1)] group-hover/poster:scale-[1.02] motion-reduce:transition-none motion-reduce:group-hover/poster:scale-100"
+ />
+ )}
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 bg-[linear-gradient(180deg,#0e101200_30%,#0e1012d9_100%)]"
+ />
+ <span className="absolute bottom-4 left-4 flex flex-col gap-1 sm:bottom-[18px] sm:left-[18px]">
+ {media.seconds && (
+ <span className="text-caption leading-4 text-[#fafafab8] sm:text-mono">
+ ~{media.seconds} seconds
+ </span>
+ )}
+ <span className="text-[22px] leading-[26px] font-medium tracking-title text-[#fafafa]">
+ {featured.title}
+ </span>
+ </span>
+ </Link>
+ )}
+ <div className="flex grow flex-col justify-between gap-[18px] px-2.5 pt-3.5 pb-2.5 sm:px-0 sm:py-5">
+ <div className="flex flex-col gap-2 sm:gap-2.5">
+ <h3 className="text-[20px] leading-[26px] font-medium tracking-title text-foreground">
+ {index?.title}
+ </h3>
+ <p className="text-[15px] leading-[22px] text-muted-foreground">
+ {index?.description}. Your AI agent builds the video, you direct
+ it.
+ </p>
+ </div>
+ <div className="flex flex-col gap-2 sm:flex-row sm:items-center sm:gap-3">
+ {setup && (
+ <LandingButton href={setup.url} arrow="→" className={button}>
+ Start with setup
+ </LandingButton>
+ )}
+ {videos && (
+ <LandingButton
+ href="/docs/guides#the-videos"
+ variant="secondary"
+ className={button}
+ >
+ Browse {videos.length} videos
+ </LandingButton>
+ )}
+ </div>
+ </div>
+ </div>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/home/library-tiles.tsx b/components/docs/index/home/library-tiles.tsx
new file mode 100644
index 00000000..e8939ab4
--- /dev/null
+++ b/components/docs/index/home/library-tiles.tsx
@@ -0,0 +1,106 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import type { DocsTabId } from "@/lib/docs-tabs";
+import { cn } from "@/lib/utils";
+import { getLibraries, loadDocsSource } from "../data";
+import { IndexSection, indexCardLink } from "../index-section";
+
+const ICON_PATHS = [
+ "M22 12h-4l-3 9L9 3l-3 9H2",
+ "M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9M10.3 21a1.94 1.94 0 0 0 3.4 0",
+ "M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8M8 12a4 4 0 1 0 8 0 4 4 0 1 0-8 0",
+ "M12 20V10M18 20V4M6 20v-4",
+ "M5 12h14M12 5l7 7-7 7",
+ "M6 8a6 6 0 1 0 12 0A6 6 0 1 0 6 8M15.5 13.5 17 22l-5-3-5 3 1.5-8.5",
+];
+
+/** Still artwork for each library tile (decoration only). */
+const ART: Partial<Record<DocsTabId, ReactNode>> = {
+ primitives: (
+ <span className="flex size-full flex-col items-center justify-center gap-2 bg-surface-muted">
+ <span className="flex h-[22px] w-10 items-center justify-end rounded-full bg-foreground p-[3px]">
+ <span className="size-4 rounded-full bg-surface" />
+ </span>
+ <span className="flex h-[22px] items-center rounded-[7px] bg-secondary px-2 text-micro leading-[14px] text-foreground">
+ Button
+ </span>
+ </span>
+ ),
+ shaders: (
+ <span className="block size-full bg-[url(/landing/shader-violet.png)] bg-cover bg-[30%_50%]" />
+ ),
+ filters: (
+ <span className="relative block size-full bg-dark-surface">
+ <span className="absolute inset-0 bg-[url(/reel/reel-2.jpg)] bg-cover bg-center grayscale-100 contrast-140" />
+ <span className="absolute inset-0 bg-[radial-gradient(circle_farthest-corner_at_50%_50%,#0e101200_45%,#0e1012bf_100%)]" />
+ <span className="absolute inset-x-0 top-[38px] h-2.5 bg-[#fafafa2e]" />
+ <span className="absolute inset-x-0 top-14 h-[3px] bg-[#fafafa1f]" />
+ </span>
+ ),
+ captions: (
+ <span className="flex size-full flex-col items-center justify-end gap-0.5 bg-dark-surface pb-4 text-caption leading-4 font-semibold">
+ <span className="text-[#fafafa8c]">in sync with</span>
+ <span className="flex items-baseline gap-1 text-[#fafafa]">
+ a real
+ <span className="rounded-[4px] bg-primary-soft px-1 text-[#0e1012]">
+ voice
+ </span>
+ </span>
+ </span>
+ ),
+ icons: (
+ <span className="flex size-full flex-wrap content-center justify-center gap-x-3.5 gap-y-3 bg-surface-muted px-3.5">
+ {ICON_PATHS.map((d) => (
+ <svg
+ key={d}
+ viewBox="0 0 24 24"
+ className="size-5 fill-none stroke-foreground stroke-[1.8] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d={d} />
+ </svg>
+ ))}
+ </span>
+ ),
+};
+
+/**
+ * "Libraries": one tile per library tab of the sidebar switcher, with its
+ * component count. Scrolls sideways on narrow screens.
+ */
+export async function LibraryTiles({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const libraries = getLibraries();
+
+ return (
+ <IndexSection heading={children} count={libraries.length}>
+ <ul className="-mx-5 flex gap-3 overflow-x-auto px-5 py-px [scrollbar-width:none] sm:mx-0 sm:grid sm:grid-cols-5 sm:gap-3.5 sm:overflow-visible sm:px-0">
+ {libraries.map((library) => (
+ <li key={library.id} className="w-[136px] shrink-0 sm:w-auto">
+ <Link
+ href={library.href}
+ className={cn(
+ "flex flex-col rounded-cta bg-surface p-1.5 shadow-[0_0_0_1px_var(--color-hairline)]",
+ indexCardLink,
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className="block h-24 overflow-hidden rounded-[10px]"
+ >
+ {ART[library.id]}
+ </span>
+ <span className="flex items-baseline justify-between gap-2 px-1.5 pt-2.5 pb-1">
+ <span className="text-small leading-[18px] font-medium text-foreground">
+ {library.label}
+ </span>
+ <span className="text-mono leading-4 text-subtle tabular-nums">
+ {library.count}
+ </span>
+ </span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/home/start-here.tsx b/components/docs/index/home/start-here.tsx
new file mode 100644
index 00000000..d1511477
--- /dev/null
+++ b/components/docs/index/home/start-here.tsx
@@ -0,0 +1,53 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { getSectionEntries, loadDocsSource } from "../data";
+import { IndexSection, indexCard, indexCardLink } from "../index-section";
+
+/** The command the Installation card previews. */
+const INSTALL_EXAMPLE = "npx shadcn@latest add @remocn/soft-blur-in";
+
+/**
+ * "Start here": one numbered card per Getting Started page, titles and
+ * descriptions read from the pages themselves.
+ */
+export async function StartHere({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const entries = getSectionEntries("/docs/getting-started");
+
+ return (
+ <IndexSection heading={children} count={entries.length}>
+ <ol className="grid gap-2.5 sm:grid-cols-2 sm:gap-x-5 sm:gap-y-4">
+ {entries.map((entry, index) => (
+ <li key={entry.url}>
+ <Link
+ href={entry.url}
+ className={cn(
+ indexCard,
+ indexCardLink,
+ "flex h-full flex-col gap-2 p-5 sm:min-h-[140px]",
+ )}
+ >
+ <span className="flex items-center justify-between gap-3">
+ <span className="text-ui leading-[22px] font-medium text-foreground">
+ {entry.title}
+ </span>
+ <span className="text-mono leading-4 text-subtle tabular-nums">
+ {String(index + 1).padStart(2, "0")}
+ </span>
+ </span>
+ <span className="line-clamp-3 text-small text-muted-foreground">
+ {entry.description}
+ </span>
+ {entry.url.endsWith("/installation") && (
+ <code className="mt-1 flex h-8 items-center overflow-hidden rounded-[10px] bg-surface-muted px-2.5 font-mono text-micro leading-4 whitespace-nowrap text-body">
+ {INSTALL_EXAMPLE}
+ </code>
+ )}
+ </Link>
+ </li>
+ ))}
+ </ol>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/icons/icons-section.tsx b/components/docs/index/icons/icons-section.tsx
new file mode 100644
index 00000000..334ff15b
--- /dev/null
+++ b/components/docs/index/icons/icons-section.tsx
@@ -0,0 +1,12 @@
+import type { ReactNode } from "react";
+import { IndexSection } from "../index-section";
+import { ICONS } from "./icons";
+
+/** "Gallery" header with the icon count; the `<IconsGallery />` follows it. */
+export function IconsSection({ children }: { children: ReactNode }) {
+ return (
+ <IndexSection heading={children} count={ICONS.length}>
+ {null}
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/icons/icons.ts b/components/docs/index/icons/icons.ts
new file mode 100644
index 00000000..e6948a5a
--- /dev/null
+++ b/components/docs/index/icons/icons.ts
@@ -0,0 +1,746 @@
+import type { ComponentType } from "react";
+import { ActivityIconStatic } from "@/registry/remocn-icons/icon-activity";
+import { AlertTriangleIconStatic } from "@/registry/remocn-icons/icon-alert-triangle";
+import { ArrowDownIconStatic } from "@/registry/remocn-icons/icon-arrow-down";
+import { ArrowLeftIconStatic } from "@/registry/remocn-icons/icon-arrow-left";
+import { ArrowRightIconStatic } from "@/registry/remocn-icons/icon-arrow-right";
+import { ArrowUpIconStatic } from "@/registry/remocn-icons/icon-arrow-up";
+import { AtSignIconStatic } from "@/registry/remocn-icons/icon-at-sign";
+import { AwardIconStatic } from "@/registry/remocn-icons/icon-award";
+import { BarChart3IconStatic } from "@/registry/remocn-icons/icon-bar-chart-3";
+import { BellIconStatic } from "@/registry/remocn-icons/icon-bell";
+import { BookmarkIconStatic } from "@/registry/remocn-icons/icon-bookmark";
+import { CalendarIconStatic } from "@/registry/remocn-icons/icon-calendar";
+import { CameraIconStatic } from "@/registry/remocn-icons/icon-camera";
+import { CheckIconStatic } from "@/registry/remocn-icons/icon-check";
+import { CheckCircleIconStatic } from "@/registry/remocn-icons/icon-check-circle";
+import { ChevronDownIconStatic } from "@/registry/remocn-icons/icon-chevron-down";
+import { ChevronLeftIconStatic } from "@/registry/remocn-icons/icon-chevron-left";
+import { ChevronRightIconStatic } from "@/registry/remocn-icons/icon-chevron-right";
+import { ChevronUpIconStatic } from "@/registry/remocn-icons/icon-chevron-up";
+import { ClockIconStatic } from "@/registry/remocn-icons/icon-clock";
+import { CloudIconStatic } from "@/registry/remocn-icons/icon-cloud";
+import { CodeIconStatic } from "@/registry/remocn-icons/icon-code";
+import { CopyIconStatic } from "@/registry/remocn-icons/icon-copy";
+import { CreditCardIconStatic } from "@/registry/remocn-icons/icon-credit-card";
+import { CrownIconStatic } from "@/registry/remocn-icons/icon-crown";
+import { DatabaseIconStatic } from "@/registry/remocn-icons/icon-database";
+import { DollarSignIconStatic } from "@/registry/remocn-icons/icon-dollar-sign";
+import { DownloadIconStatic } from "@/registry/remocn-icons/icon-download";
+import { ExternalLinkIconStatic } from "@/registry/remocn-icons/icon-external-link";
+import { EyeIconStatic } from "@/registry/remocn-icons/icon-eye";
+import { EyeOffIconStatic } from "@/registry/remocn-icons/icon-eye-off";
+import { FileTextIconStatic } from "@/registry/remocn-icons/icon-file-text";
+import { FilterIconStatic } from "@/registry/remocn-icons/icon-filter";
+import { FlameIconStatic } from "@/registry/remocn-icons/icon-flame";
+import { FolderIconStatic } from "@/registry/remocn-icons/icon-folder";
+import { GemIconStatic } from "@/registry/remocn-icons/icon-gem";
+import { GiftIconStatic } from "@/registry/remocn-icons/icon-gift";
+import { GlobeIconStatic } from "@/registry/remocn-icons/icon-globe";
+import { HeartIconStatic } from "@/registry/remocn-icons/icon-heart";
+import { HelpCircleIconStatic } from "@/registry/remocn-icons/icon-help-circle";
+import { HomeIconStatic } from "@/registry/remocn-icons/icon-home";
+import { ImageIconStatic } from "@/registry/remocn-icons/icon-image";
+import { InboxIconStatic } from "@/registry/remocn-icons/icon-inbox";
+import { InfoIconStatic } from "@/registry/remocn-icons/icon-info";
+import { KeyIconStatic } from "@/registry/remocn-icons/icon-key";
+import { LayoutGridIconStatic } from "@/registry/remocn-icons/icon-layout-grid";
+import { LinkIconStatic } from "@/registry/remocn-icons/icon-link";
+import { LoaderIconStatic } from "@/registry/remocn-icons/icon-loader";
+import { LockIconStatic } from "@/registry/remocn-icons/icon-lock";
+import { LogOutIconStatic } from "@/registry/remocn-icons/icon-log-out";
+import { MailIconStatic } from "@/registry/remocn-icons/icon-mail";
+import { MaximizeIconStatic } from "@/registry/remocn-icons/icon-maximize";
+import { MenuIconStatic } from "@/registry/remocn-icons/icon-menu";
+import { MessageCircleIconStatic } from "@/registry/remocn-icons/icon-message-circle";
+import { MicIconStatic } from "@/registry/remocn-icons/icon-mic";
+import { MonitorIconStatic } from "@/registry/remocn-icons/icon-monitor";
+import { MoonIconStatic } from "@/registry/remocn-icons/icon-moon";
+import { MoreHorizontalIconStatic } from "@/registry/remocn-icons/icon-more-horizontal";
+import { PackageIconStatic } from "@/registry/remocn-icons/icon-package";
+import { PartyPopperIconStatic } from "@/registry/remocn-icons/icon-party-popper";
+import { PauseIconStatic } from "@/registry/remocn-icons/icon-pause";
+import { PencilIconStatic } from "@/registry/remocn-icons/icon-pencil";
+import { PhoneIconStatic } from "@/registry/remocn-icons/icon-phone";
+import { PlayIconStatic } from "@/registry/remocn-icons/icon-play";
+import { PlusIconStatic } from "@/registry/remocn-icons/icon-plus";
+import { PlusCircleIconStatic } from "@/registry/remocn-icons/icon-plus-circle";
+import { RefreshCwIconStatic } from "@/registry/remocn-icons/icon-refresh-cw";
+import { RocketIconStatic } from "@/registry/remocn-icons/icon-rocket";
+import { SaveIconStatic } from "@/registry/remocn-icons/icon-save";
+import { SearchIconStatic } from "@/registry/remocn-icons/icon-search";
+import { SendIconStatic } from "@/registry/remocn-icons/icon-send";
+import { SettingsIconStatic } from "@/registry/remocn-icons/icon-settings";
+import { Share2IconStatic } from "@/registry/remocn-icons/icon-share-2";
+import { ShieldIconStatic } from "@/registry/remocn-icons/icon-shield";
+import { ShoppingCartIconStatic } from "@/registry/remocn-icons/icon-shopping-cart";
+import { SkipForwardIconStatic } from "@/registry/remocn-icons/icon-skip-forward";
+import { SmartphoneIconStatic } from "@/registry/remocn-icons/icon-smartphone";
+import { SparklesIconStatic } from "@/registry/remocn-icons/icon-sparkles";
+import { StarIconStatic } from "@/registry/remocn-icons/icon-star";
+import { SunIconStatic } from "@/registry/remocn-icons/icon-sun";
+import { TagIconStatic } from "@/registry/remocn-icons/icon-tag";
+import { TargetIconStatic } from "@/registry/remocn-icons/icon-target";
+import { TerminalIconStatic } from "@/registry/remocn-icons/icon-terminal";
+import { ThumbsUpIconStatic } from "@/registry/remocn-icons/icon-thumbs-up";
+import { TimerIconStatic } from "@/registry/remocn-icons/icon-timer";
+import { TrashIconStatic } from "@/registry/remocn-icons/icon-trash";
+import { TrendingDownIconStatic } from "@/registry/remocn-icons/icon-trending-down";
+import { TrendingUpIconStatic } from "@/registry/remocn-icons/icon-trending-up";
+import { TrophyIconStatic } from "@/registry/remocn-icons/icon-trophy";
+import { UploadIconStatic } from "@/registry/remocn-icons/icon-upload";
+import { UserIconStatic } from "@/registry/remocn-icons/icon-user";
+import { UserPlusIconStatic } from "@/registry/remocn-icons/icon-user-plus";
+import { UsersIconStatic } from "@/registry/remocn-icons/icon-users";
+import { VideoIconStatic } from "@/registry/remocn-icons/icon-video";
+import { Volume2IconStatic } from "@/registry/remocn-icons/icon-volume-2";
+import { VolumeXIconStatic } from "@/registry/remocn-icons/icon-volume-x";
+import { WalletIconStatic } from "@/registry/remocn-icons/icon-wallet";
+import { XIconStatic } from "@/registry/remocn-icons/icon-x";
+import { XCircleIconStatic } from "@/registry/remocn-icons/icon-x-circle";
+import { ZapIconStatic } from "@/registry/remocn-icons/icon-zap";
+
+/**
+ * Every remocn icon with its gallery label and category. Hand-kept beside the
+ * icon registry: the static glyph components are imported per icon.
+ */
+export type IconCategory =
+ | "Status & feedback"
+ | "Actions & UI"
+ | "Media & playback"
+ | "People & communication"
+ | "Time & planning"
+ | "Files & dev"
+ | "Devices & theme"
+ | "Commerce"
+ | "Charts & data"
+ | "Emotion & accents"
+ | "Arrows & navigation";
+
+export interface IconEntry {
+ name: string;
+ label: string;
+ category: IconCategory;
+ Static: ComponentType<{
+ size?: number;
+ strokeWidth?: number;
+ className?: string;
+ }>;
+}
+
+export const ICONS: IconEntry[] = [
+ {
+ name: "icon-check",
+ label: "Check",
+ category: "Status & feedback",
+ Static: CheckIconStatic,
+ },
+ {
+ name: "icon-check-circle",
+ label: "Check Circle",
+ category: "Status & feedback",
+ Static: CheckCircleIconStatic,
+ },
+ {
+ name: "icon-x",
+ label: "X",
+ category: "Status & feedback",
+ Static: XIconStatic,
+ },
+ {
+ name: "icon-activity",
+ label: "Activity",
+ category: "Charts & data",
+ Static: ActivityIconStatic,
+ },
+ {
+ name: "icon-alert-triangle",
+ label: "Alert Triangle",
+ category: "Status & feedback",
+ Static: AlertTriangleIconStatic,
+ },
+ {
+ name: "icon-info",
+ label: "Info",
+ category: "Status & feedback",
+ Static: InfoIconStatic,
+ },
+ {
+ name: "icon-loader",
+ label: "Loader",
+ category: "Status & feedback",
+ Static: LoaderIconStatic,
+ },
+ {
+ name: "icon-refresh-cw",
+ label: "Refresh Cw",
+ category: "Status & feedback",
+ Static: RefreshCwIconStatic,
+ },
+ {
+ name: "icon-shield",
+ label: "Shield",
+ category: "Status & feedback",
+ Static: ShieldIconStatic,
+ },
+ {
+ name: "icon-help-circle",
+ label: "Help Circle",
+ category: "Status & feedback",
+ Static: HelpCircleIconStatic,
+ },
+ {
+ name: "icon-plus-circle",
+ label: "Plus Circle",
+ category: "Status & feedback",
+ Static: PlusCircleIconStatic,
+ },
+ {
+ name: "icon-x-circle",
+ label: "X Circle",
+ category: "Status & feedback",
+ Static: XCircleIconStatic,
+ },
+ {
+ name: "icon-calendar",
+ label: "Calendar",
+ category: "Time & planning",
+ Static: CalendarIconStatic,
+ },
+ {
+ name: "icon-clock",
+ label: "Clock",
+ category: "Time & planning",
+ Static: ClockIconStatic,
+ },
+ {
+ name: "icon-timer",
+ label: "Timer",
+ category: "Time & planning",
+ Static: TimerIconStatic,
+ },
+ {
+ name: "icon-home",
+ label: "Home",
+ category: "Files & dev",
+ Static: HomeIconStatic,
+ },
+ {
+ name: "icon-folder",
+ label: "Folder",
+ category: "Files & dev",
+ Static: FolderIconStatic,
+ },
+ {
+ name: "icon-file-text",
+ label: "File Text",
+ category: "Files & dev",
+ Static: FileTextIconStatic,
+ },
+ {
+ name: "icon-code",
+ label: "Code",
+ category: "Files & dev",
+ Static: CodeIconStatic,
+ },
+ {
+ name: "icon-terminal",
+ label: "Terminal",
+ category: "Files & dev",
+ Static: TerminalIconStatic,
+ },
+ {
+ name: "icon-database",
+ label: "Database",
+ category: "Files & dev",
+ Static: DatabaseIconStatic,
+ },
+ {
+ name: "icon-cloud",
+ label: "Cloud",
+ category: "Files & dev",
+ Static: CloudIconStatic,
+ },
+ {
+ name: "icon-globe",
+ label: "Globe",
+ category: "Files & dev",
+ Static: GlobeIconStatic,
+ },
+ {
+ name: "icon-monitor",
+ label: "Monitor",
+ category: "Devices & theme",
+ Static: MonitorIconStatic,
+ },
+ {
+ name: "icon-smartphone",
+ label: "Smartphone",
+ category: "Devices & theme",
+ Static: SmartphoneIconStatic,
+ },
+ {
+ name: "icon-sun",
+ label: "Sun",
+ category: "Devices & theme",
+ Static: SunIconStatic,
+ },
+ {
+ name: "icon-moon",
+ label: "Moon",
+ category: "Devices & theme",
+ Static: MoonIconStatic,
+ },
+ {
+ name: "icon-shopping-cart",
+ label: "Shopping Cart",
+ category: "Commerce",
+ Static: ShoppingCartIconStatic,
+ },
+ {
+ name: "icon-credit-card",
+ label: "Credit Card",
+ category: "Commerce",
+ Static: CreditCardIconStatic,
+ },
+ {
+ name: "icon-dollar-sign",
+ label: "Dollar Sign",
+ category: "Commerce",
+ Static: DollarSignIconStatic,
+ },
+ {
+ name: "icon-tag",
+ label: "Tag",
+ category: "Commerce",
+ Static: TagIconStatic,
+ },
+ {
+ name: "icon-package",
+ label: "Package",
+ category: "Commerce",
+ Static: PackageIconStatic,
+ },
+ {
+ name: "icon-gift",
+ label: "Gift",
+ category: "Commerce",
+ Static: GiftIconStatic,
+ },
+ {
+ name: "icon-wallet",
+ label: "Wallet",
+ category: "Commerce",
+ Static: WalletIconStatic,
+ },
+ {
+ name: "icon-bar-chart-3",
+ label: "Bar Chart 3",
+ category: "Charts & data",
+ Static: BarChart3IconStatic,
+ },
+ {
+ name: "icon-target",
+ label: "Target",
+ category: "Charts & data",
+ Static: TargetIconStatic,
+ },
+ {
+ name: "icon-trending-down",
+ label: "Trending Down",
+ category: "Charts & data",
+ Static: TrendingDownIconStatic,
+ },
+ {
+ name: "icon-trending-up",
+ label: "Trending Up",
+ category: "Charts & data",
+ Static: TrendingUpIconStatic,
+ },
+ {
+ name: "icon-search",
+ label: "Search",
+ category: "Actions & UI",
+ Static: SearchIconStatic,
+ },
+ {
+ name: "icon-bell",
+ label: "Bell",
+ category: "Actions & UI",
+ Static: BellIconStatic,
+ },
+ {
+ name: "icon-download",
+ label: "Download",
+ category: "Actions & UI",
+ Static: DownloadIconStatic,
+ },
+ {
+ name: "icon-upload",
+ label: "Upload",
+ category: "Actions & UI",
+ Static: UploadIconStatic,
+ },
+ {
+ name: "icon-copy",
+ label: "Copy",
+ category: "Actions & UI",
+ Static: CopyIconStatic,
+ },
+ {
+ name: "icon-settings",
+ label: "Settings",
+ category: "Actions & UI",
+ Static: SettingsIconStatic,
+ },
+ {
+ name: "icon-trash",
+ label: "Trash",
+ category: "Actions & UI",
+ Static: TrashIconStatic,
+ },
+ {
+ name: "icon-plus",
+ label: "Plus",
+ category: "Actions & UI",
+ Static: PlusIconStatic,
+ },
+ {
+ name: "icon-send",
+ label: "Send",
+ category: "Actions & UI",
+ Static: SendIconStatic,
+ },
+ {
+ name: "icon-menu",
+ label: "Menu",
+ category: "Actions & UI",
+ Static: MenuIconStatic,
+ },
+ {
+ name: "icon-more-horizontal",
+ label: "More Horizontal",
+ category: "Actions & UI",
+ Static: MoreHorizontalIconStatic,
+ },
+ {
+ name: "icon-maximize",
+ label: "Maximize",
+ category: "Actions & UI",
+ Static: MaximizeIconStatic,
+ },
+ {
+ name: "icon-layout-grid",
+ label: "Layout Grid",
+ category: "Actions & UI",
+ Static: LayoutGridIconStatic,
+ },
+ {
+ name: "icon-pencil",
+ label: "Pencil",
+ category: "Actions & UI",
+ Static: PencilIconStatic,
+ },
+ {
+ name: "icon-share-2",
+ label: "Share 2",
+ category: "Actions & UI",
+ Static: Share2IconStatic,
+ },
+ {
+ name: "icon-filter",
+ label: "Filter",
+ category: "Actions & UI",
+ Static: FilterIconStatic,
+ },
+ {
+ name: "icon-eye",
+ label: "Eye",
+ category: "Actions & UI",
+ Static: EyeIconStatic,
+ },
+ {
+ name: "icon-eye-off",
+ label: "Eye Off",
+ category: "Actions & UI",
+ Static: EyeOffIconStatic,
+ },
+ {
+ name: "icon-save",
+ label: "Save",
+ category: "Actions & UI",
+ Static: SaveIconStatic,
+ },
+ {
+ name: "icon-link",
+ label: "Link",
+ category: "Actions & UI",
+ Static: LinkIconStatic,
+ },
+ {
+ name: "icon-bookmark",
+ label: "Bookmark",
+ category: "Actions & UI",
+ Static: BookmarkIconStatic,
+ },
+ {
+ name: "icon-lock",
+ label: "Lock",
+ category: "Actions & UI",
+ Static: LockIconStatic,
+ },
+ {
+ name: "icon-key",
+ label: "Key",
+ category: "Actions & UI",
+ Static: KeyIconStatic,
+ },
+ {
+ name: "icon-log-out",
+ label: "Log Out",
+ category: "Actions & UI",
+ Static: LogOutIconStatic,
+ },
+ {
+ name: "icon-play",
+ label: "Play",
+ category: "Media & playback",
+ Static: PlayIconStatic,
+ },
+ {
+ name: "icon-pause",
+ label: "Pause",
+ category: "Media & playback",
+ Static: PauseIconStatic,
+ },
+ {
+ name: "icon-skip-forward",
+ label: "Skip Forward",
+ category: "Media & playback",
+ Static: SkipForwardIconStatic,
+ },
+ {
+ name: "icon-volume-2",
+ label: "Volume 2",
+ category: "Media & playback",
+ Static: Volume2IconStatic,
+ },
+ {
+ name: "icon-volume-x",
+ label: "Volume X",
+ category: "Media & playback",
+ Static: VolumeXIconStatic,
+ },
+ {
+ name: "icon-mic",
+ label: "Mic",
+ category: "Media & playback",
+ Static: MicIconStatic,
+ },
+ {
+ name: "icon-video",
+ label: "Video",
+ category: "Media & playback",
+ Static: VideoIconStatic,
+ },
+ {
+ name: "icon-camera",
+ label: "Camera",
+ category: "Media & playback",
+ Static: CameraIconStatic,
+ },
+ {
+ name: "icon-image",
+ label: "Image",
+ category: "Media & playback",
+ Static: ImageIconStatic,
+ },
+ {
+ name: "icon-user",
+ label: "User",
+ category: "People & communication",
+ Static: UserIconStatic,
+ },
+ {
+ name: "icon-users",
+ label: "Users",
+ category: "People & communication",
+ Static: UsersIconStatic,
+ },
+ {
+ name: "icon-user-plus",
+ label: "User Plus",
+ category: "People & communication",
+ Static: UserPlusIconStatic,
+ },
+ {
+ name: "icon-mail",
+ label: "Mail",
+ category: "People & communication",
+ Static: MailIconStatic,
+ },
+ {
+ name: "icon-message-circle",
+ label: "Message Circle",
+ category: "People & communication",
+ Static: MessageCircleIconStatic,
+ },
+ {
+ name: "icon-phone",
+ label: "Phone",
+ category: "People & communication",
+ Static: PhoneIconStatic,
+ },
+ {
+ name: "icon-at-sign",
+ label: "At Sign",
+ category: "People & communication",
+ Static: AtSignIconStatic,
+ },
+ {
+ name: "icon-inbox",
+ label: "Inbox",
+ category: "People & communication",
+ Static: InboxIconStatic,
+ },
+ {
+ name: "icon-heart",
+ label: "Heart",
+ category: "Emotion & accents",
+ Static: HeartIconStatic,
+ },
+ {
+ name: "icon-rocket",
+ label: "Rocket",
+ category: "Emotion & accents",
+ Static: RocketIconStatic,
+ },
+ {
+ name: "icon-trophy",
+ label: "Trophy",
+ category: "Emotion & accents",
+ Static: TrophyIconStatic,
+ },
+ {
+ name: "icon-award",
+ label: "Award",
+ category: "Emotion & accents",
+ Static: AwardIconStatic,
+ },
+ {
+ name: "icon-crown",
+ label: "Crown",
+ category: "Emotion & accents",
+ Static: CrownIconStatic,
+ },
+ {
+ name: "icon-gem",
+ label: "Gem",
+ category: "Emotion & accents",
+ Static: GemIconStatic,
+ },
+ {
+ name: "icon-star",
+ label: "Star",
+ category: "Emotion & accents",
+ Static: StarIconStatic,
+ },
+ {
+ name: "icon-sparkles",
+ label: "Sparkles",
+ category: "Emotion & accents",
+ Static: SparklesIconStatic,
+ },
+ {
+ name: "icon-zap",
+ label: "Zap",
+ category: "Emotion & accents",
+ Static: ZapIconStatic,
+ },
+ {
+ name: "icon-flame",
+ label: "Flame",
+ category: "Emotion & accents",
+ Static: FlameIconStatic,
+ },
+ {
+ name: "icon-thumbs-up",
+ label: "Thumbs Up",
+ category: "Emotion & accents",
+ Static: ThumbsUpIconStatic,
+ },
+ {
+ name: "icon-party-popper",
+ label: "Party Popper",
+ category: "Emotion & accents",
+ Static: PartyPopperIconStatic,
+ },
+ {
+ name: "icon-arrow-right",
+ label: "Arrow Right",
+ category: "Arrows & navigation",
+ Static: ArrowRightIconStatic,
+ },
+ {
+ name: "icon-arrow-left",
+ label: "Arrow Left",
+ category: "Arrows & navigation",
+ Static: ArrowLeftIconStatic,
+ },
+ {
+ name: "icon-arrow-up",
+ label: "Arrow Up",
+ category: "Arrows & navigation",
+ Static: ArrowUpIconStatic,
+ },
+ {
+ name: "icon-arrow-down",
+ label: "Arrow Down",
+ category: "Arrows & navigation",
+ Static: ArrowDownIconStatic,
+ },
+ {
+ name: "icon-external-link",
+ label: "External Link",
+ category: "Arrows & navigation",
+ Static: ExternalLinkIconStatic,
+ },
+ {
+ name: "icon-chevron-up",
+ label: "Chevron Up",
+ category: "Arrows & navigation",
+ Static: ChevronUpIconStatic,
+ },
+ {
+ name: "icon-chevron-down",
+ label: "Chevron Down",
+ category: "Arrows & navigation",
+ Static: ChevronDownIconStatic,
+ },
+ {
+ name: "icon-chevron-left",
+ label: "Chevron Left",
+ category: "Arrows & navigation",
+ Static: ChevronLeftIconStatic,
+ },
+ {
+ name: "icon-chevron-right",
+ label: "Chevron Right",
+ category: "Arrows & navigation",
+ Static: ChevronRightIconStatic,
+ },
+];
+
+export const CATEGORY_ORDER: IconCategory[] = [
+ "Status & feedback",
+ "Actions & UI",
+ "Media & playback",
+ "People & communication",
+ "Time & planning",
+ "Files & dev",
+ "Devices & theme",
+ "Commerce",
+ "Charts & data",
+ "Emotion & accents",
+ "Arrows & navigation",
+];
diff --git a/components/docs/index/index-section.tsx b/components/docs/index/index-section.tsx
new file mode 100644
index 00000000..e066466d
--- /dev/null
+++ b/components/docs/index/index-section.tsx
@@ -0,0 +1,65 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/** Hairline card surface shared by every index-screen card. */
+export const indexCard =
+ "rounded-card bg-surface shadow-[0_0_0_1px_var(--color-hairline)]";
+
+/** Hover + focus affordance for cards that are links. */
+export const indexCardLink =
+ "outline-none transition-[box-shadow] duration-150 hover:shadow-[0_0_0_1px_var(--color-divider)] focus-visible:ring-3 focus-visible:ring-ring";
+
+/**
+ * An index-screen section. The MDX `##` heading arrives as `heading` (so it
+ * keeps its anchor and its table-of-contents entry) and is restyled to the
+ * quote size with a muted count after it. A paragraph written right under the
+ * heading becomes the section's lead line.
+ *
+ * ```mdx
+ * <StartHere>
+ *
+ * ## Start here
+ *
+ * </StartHere>
+ * ```
+ */
+export function IndexSection({
+ heading,
+ count,
+ className,
+ children,
+}: {
+ heading: ReactNode;
+ count?: number;
+ className?: string;
+ children: ReactNode;
+}) {
+ return (
+ <section
+ data-not-typeset
+ className={cn(
+ "not-prose mt-12 flex flex-col gap-3.5 first:mt-2 sm:gap-4",
+ className,
+ )}
+ >
+ {heading && (
+ <div
+ className={cn(
+ "flex flex-wrap items-baseline gap-x-2.5 gap-y-1.5",
+ "[&_h2]:order-1 [&_h2]:m-0 [&_h2]:font-sans [&_h2]:text-quote [&_h2]:leading-8 [&_h2]:font-medium [&_h2]:tracking-title [&_h2]:text-foreground [&_h2_a]:text-inherit [&_h2_a]:no-underline [&_h2>svg]:hidden",
+ "[&_p]:order-3 [&_p]:m-0 [&_p]:basis-full [&_p]:text-[15px] [&_p]:leading-[24px] [&_p]:text-body sm:[&_p]:text-ui sm:[&_p]:leading-[26px]",
+ "[&_p_a]:text-foreground [&_p_a]:underline [&_p_a]:decoration-divider [&_p_a]:underline-offset-4",
+ )}
+ >
+ {heading}
+ {count !== undefined && (
+ <span className="order-2 font-sans text-quote leading-8 tracking-title text-subtle tabular-nums">
+ {count}
+ </span>
+ )}
+ </div>
+ )}
+ {children}
+ </section>
+ );
+}
diff --git a/components/docs/index/introduction/compare-table.tsx b/components/docs/index/introduction/compare-table.tsx
new file mode 100644
index 00000000..e8e84ed2
--- /dev/null
+++ b/components/docs/index/introduction/compare-table.tsx
@@ -0,0 +1,106 @@
+import { Fragment, type ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { Glyph } from "./glyph";
+import { childrenOf, findAll } from "./mdx-tree";
+
+function Check() {
+ return (
+ <span className="flex size-[22px] shrink-0 items-center justify-center rounded-[7px] bg-foreground">
+ <Glyph
+ name="check"
+ strokeWidth={3}
+ className="size-3 text-primary-soft dark:text-primary"
+ />
+ </span>
+ );
+}
+
+/**
+ * "remocn vs raw Remotion": reads a three-column markdown table (aspect, raw
+ * Remotion, Remotion + remocn) from its MDX children and lays it out with the
+ * remocn column raised as a card. Phones get one stacked block per row.
+ */
+export function CompareTable({ children }: { children: ReactNode }) {
+ const [head, ...rows] = findAll(children, "tr").map((tr) =>
+ [...findAll(tr, "th"), ...findAll(tr, "td")].map(childrenOf),
+ );
+ if (!head) return null;
+ const [, rawLabel, remocnLabel] = head;
+
+ return (
+ <div data-not-typeset className={cn("not-prose", BLOCK_SPACING)}>
+ {/* Desktop: label / raw / remocn columns, laid out row by row so a
+ screen reader reads each aspect with both of its answers. */}
+ <div
+ className="grid grid-cols-[150px_minmax(0,1fr)_334px] rounded-panel bg-surface-muted p-1.5 max-md:hidden"
+ style={{ gridTemplateRows: `52px repeat(${rows.length}, 68px)` }}
+ >
+ <span
+ aria-hidden="true"
+ className="col-start-3 row-span-full rounded-capsule bg-surface shadow-[0_1px_2px_#0e10120f,0_6px_20px_#0e10120d] dark:shadow-[0_0_0_1px_var(--color-hairline)]"
+ />
+ <span
+ className="col-start-2 flex items-center px-3.5 text-small leading-5 text-muted-foreground"
+ style={{ gridRowStart: 1 }}
+ >
+ {rawLabel}
+ </span>
+ <span
+ className="col-start-3 flex items-center px-4 text-small leading-5 font-semibold text-foreground"
+ style={{ gridRowStart: 1 }}
+ >
+ {remocnLabel}
+ </span>
+ {rows.map(([label, raw, remocn], index) => (
+ <Fragment key={index}>
+ <span
+ className="col-start-1 flex items-center border-t border-divider px-3.5 text-small leading-5 font-medium text-foreground"
+ style={{ gridRowStart: index + 2 }}
+ >
+ {label}
+ </span>
+ <span
+ className="col-start-2 flex items-center border-t border-divider px-3.5 text-small leading-5 text-muted-foreground"
+ style={{ gridRowStart: index + 2 }}
+ >
+ {raw}
+ </span>
+ <span
+ className="col-start-3 flex items-center gap-3 border-t border-hairline px-4 text-small leading-5 text-foreground"
+ style={{ gridRowStart: index + 2 }}
+ >
+ <Check />
+ <span>{remocn}</span>
+ </span>
+ </Fragment>
+ ))}
+ </div>
+ {/* Phones: one block per row. */}
+ <div className="flex flex-col gap-1.5 rounded-panel bg-surface-muted p-1.5 md:hidden">
+ {rows.map(([label, raw, remocn], index) => (
+ <div
+ key={index}
+ className="flex flex-col gap-2 px-3 pt-3.5 pb-2 not-first:border-t not-first:border-divider"
+ >
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {label}
+ </span>
+ <span className="flex gap-2 px-0.5">
+ <span className="w-24 shrink-0 text-caption leading-5 text-muted-foreground">
+ {rawLabel}
+ </span>
+ <span className="min-w-0 grow text-small leading-5 text-body">
+ {raw}
+ </span>
+ </span>
+ <span className="flex items-start gap-3 rounded-control bg-surface p-3 text-small leading-5 text-foreground shadow-[0_1px_2px_#0e10120f]">
+ <Check />
+ <span className="min-w-0 grow">{remocn}</span>
+ </span>
+ </div>
+ ))}
+ </div>
+ </div>
+ );
+}
diff --git a/components/docs/index/introduction/faq.tsx b/components/docs/index/introduction/faq.tsx
new file mode 100644
index 00000000..40833d8a
--- /dev/null
+++ b/components/docs/index/introduction/faq.tsx
@@ -0,0 +1,46 @@
+import type { ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { Glyph } from "./glyph";
+import { findAll, inlineOf, splitLead } from "./mdx-tree";
+
+/**
+ * FAQ accordion. Reads MDX paragraphs written as `**Question?**` followed by
+ * the answer on the next line, and renders each as a native disclosure (the
+ * first one open), so it works without JavaScript and stays keyboard-friendly.
+ */
+export function Faq({ children }: { children: ReactNode }) {
+ const items = findAll(children, "p").map((p) => splitLead(inlineOf(p)));
+
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ "not-prose flex flex-col gap-0.5 rounded-card border border-hairline bg-surface p-1.5",
+ BLOCK_SPACING,
+ )}
+ >
+ {items.map((item, index) => (
+ <details
+ key={item.title}
+ open={index === 0}
+ className="disclosure group/faq relative rounded-control transition-colors duration-200 before:pointer-events-none before:absolute before:inset-x-0 before:-top-px before:h-px before:bg-hairline before:transition-opacity before:duration-200 first:before:hidden open:bg-surface-muted open:before:opacity-0 [[open]+&]:before:opacity-0"
+ >
+ <summary className="flex min-h-[60px] cursor-pointer transition-[min-height,padding] duration-[260ms] ease-[cubic-bezier(0.25,1,0.5,1)] motion-reduce:transition-none list-none items-center justify-between gap-4 rounded-control py-3.5 pr-4 pl-[18px] text-ui leading-[22px] font-medium text-foreground outline-none select-none focus-visible:ring-3 focus-visible:ring-ring group-open/faq:min-h-0 group-open/faq:pt-4 group-open/faq:pb-2 [&::-webkit-details-marker]:hidden">
+ {item.title}
+ <span className="flex size-[30px] shrink-0 items-center justify-center rounded-[9px] bg-surface-muted text-muted-foreground group-open/faq:bg-surface group-open/faq:text-foreground">
+ <Glyph
+ name="chevron"
+ strokeWidth={2}
+ className="size-3.5 transition-transform duration-[260ms] ease-[cubic-bezier(0.25,1,0.5,1)] group-open/faq:rotate-180 motion-reduce:transition-none"
+ />
+ </span>
+ </summary>
+ <p className="max-w-[620px] pr-4 pb-5 pl-[18px] text-[15px] leading-6 text-body [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4">
+ {item.body}
+ </p>
+ </details>
+ ))}
+ </div>
+ );
+}
diff --git a/components/docs/index/introduction/glyph.tsx b/components/docs/index/introduction/glyph.tsx
new file mode 100644
index 00000000..0e92c9ba
--- /dev/null
+++ b/components/docs/index/introduction/glyph.tsx
@@ -0,0 +1,135 @@
+import { cn } from "@/lib/utils";
+
+/** The 24px line glyphs of the introduction screen, drawn in currentColor. */
+const GLYPHS = {
+ components: (
+ <>
+ <rect x="3.5" y="3.5" width="7" height="7" rx="1.8" />
+ <rect x="13.5" y="3.5" width="7" height="7" rx="1.8" />
+ <rect x="3.5" y="13.5" width="7" height="7" rx="1.8" />
+ <path d="M17 13.5v7M13.5 17h7" />
+ </>
+ ),
+ grid: (
+ <>
+ <rect x="3.5" y="3.5" width="7" height="7" rx="1.8" />
+ <rect x="13.5" y="3.5" width="7" height="7" rx="1.8" />
+ <rect x="3.5" y="13.5" width="7" height="7" rx="1.8" />
+ <rect x="13.5" y="13.5" width="7" height="7" rx="1.8" />
+ </>
+ ),
+ sparkle: (
+ <>
+ <path d="M12 3.5c.6 3.9 2.6 5.9 6.5 6.5-3.9.6-5.9 2.6-6.5 6.5-.6-3.9-2.6-5.9-6.5-6.5 3.9-.6 5.9-2.6 6.5-6.5Z" />
+ <path
+ d="M18.5 15.5c.3 1.6 1 2.3 2.5 2.5-1.5.3-2.2 1-2.5 2.5-.3-1.5-1-2.2-2.5-2.5 1.5-.2 2.2-.9 2.5-2.5Z"
+ fill="currentColor"
+ />
+ </>
+ ),
+ folder: (
+ <>
+ <path d="M3.5 7.5a2 2 0 0 1 2-2h4l2 2.5h7a2 2 0 0 1 2 2v7.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z" />
+ <path d="m9 14 2 2 4-4" />
+ </>
+ ),
+ terminal: (
+ <>
+ <rect x="3" y="4.5" width="18" height="15" rx="3" />
+ <path d="m7 10 3 2.5L7 15M12.5 15H17" />
+ </>
+ ),
+ play: (
+ <>
+ <rect x="3" y="5" width="18" height="14" rx="3" />
+ <path d="M10 9.5v5l4.5-2.5Z" fill="currentColor" />
+ </>
+ ),
+ timer: (
+ <>
+ <circle cx="12" cy="13" r="7.5" />
+ <path d="M12 9.5V13l2.5 1.5M10 3h4" />
+ </>
+ ),
+ search: (
+ <>
+ <circle cx="11" cy="11" r="6.5" />
+ <path d="m16 16 4 4" />
+ </>
+ ),
+ info: (
+ <>
+ <circle cx="12" cy="12" r="8.5" />
+ <path d="M12 11v5M12 7.8v.2" />
+ </>
+ ),
+ arrow: <path d="M5 12h14M13 6l6 6-6 6" />,
+ check: <path d="m5 12.5 4.5 4.5L19 7.5" />,
+ cross: <path d="M6 6l12 12M18 6 6 18" />,
+ chevron: <path d="m6 9 6 6 6-6" />,
+ editor: (
+ <>
+ <rect x="3.5" y="5" width="17" height="14" rx="2.5" />
+ <path d="M3.5 14h17M8 14v5M13 14v5" />
+ </>
+ ),
+ cloud: (
+ <path d="M7 18.5a4.5 4.5 0 0 1-.6-9 6 6 0 0 1 11.4 1.6A3.8 3.8 0 0 1 17.5 18.5Z" />
+ ),
+ fork: (
+ <>
+ <circle cx="7" cy="5.5" r="2" />
+ <circle cx="17" cy="5.5" r="2" />
+ <circle cx="12" cy="18.5" r="2" />
+ <path d="M7 7.5v1.5a3 3 0 0 0 3 3h4a3 3 0 0 0 3-3V7.5M12 12v4.5" />
+ </>
+ ),
+ chat: (
+ <path d="M20 12a7.5 7.5 0 0 1-11 6.6L4.5 20l1.3-4.3A7.5 7.5 0 1 1 20 12Z" />
+ ),
+} as const;
+
+export type GlyphName = keyof typeof GLYPHS;
+
+export function Glyph({
+ name,
+ className,
+ strokeWidth = 1.8,
+}: {
+ name: GlyphName;
+ className?: string;
+ strokeWidth?: number;
+}) {
+ return (
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ className={cn("size-[18px] shrink-0", className)}
+ >
+ {GLYPHS[name]}
+ </svg>
+ );
+}
+
+/** A glyph struck through, for the "What remocn is not" cards. */
+export function StruckGlyph({ name }: { name: GlyphName }) {
+ return (
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ fill="none"
+ strokeWidth={1.8}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ className="size-[18px] shrink-0"
+ >
+ <g className="stroke-muted-foreground">{GLYPHS[name]}</g>
+ <path d="M4 20 20 4" strokeWidth={2} className="stroke-foreground" />
+ </svg>
+ );
+}
diff --git a/components/docs/index/introduction/mdx-tree.ts b/components/docs/index/introduction/mdx-tree.ts
new file mode 100644
index 00000000..0dfd0b2f
--- /dev/null
+++ b/components/docs/index/introduction/mdx-tree.ts
@@ -0,0 +1,76 @@
+import {
+ Children,
+ isValidElement,
+ type ReactElement,
+ type ReactNode,
+} from "react";
+
+/**
+ * Helpers for blocks that restyle plain MDX markdown passed as children (a
+ * list, a table, bold-led paragraphs). The markdown stays in the `.mdx` file,
+ * so `/docs/**.md` keeps it verbatim for agents, while the block reads its
+ * structure here and lays it out as cards.
+ */
+
+type Props = { children?: ReactNode; href?: string };
+export type MdxElement = ReactElement<Props>;
+
+export function isTag(node: ReactNode, tag: string): node is MdxElement {
+ return isValidElement(node) && node.type === tag;
+}
+
+export function childrenOf(node: ReactNode): ReactNode[] {
+ if (!isValidElement<Props>(node)) return [];
+ return Children.toArray(node.props.children);
+}
+
+/** Every descendant element of the given tag, depth first, in order. */
+export function findAll(node: ReactNode, tag: string): MdxElement[] {
+ const found: MdxElement[] = [];
+ const visit = (current: ReactNode) => {
+ for (const child of Children.toArray(current)) {
+ if (isTag(child, tag)) {
+ found.push(child);
+ continue;
+ }
+ if (isValidElement<Props>(child)) visit(child.props.children);
+ }
+ };
+ visit(node);
+ return found;
+}
+
+export function textOf(node: ReactNode): string {
+ if (typeof node === "string" || typeof node === "number") return `${node}`;
+ if (Array.isArray(node)) return node.map(textOf).join("");
+ if (isValidElement<Props>(node)) return textOf(node.props.children);
+ return "";
+}
+
+/**
+ * Splits a bold-led item (`**Title.** body`) into its title text and the rest
+ * of its nodes, with the separating whitespace or leading ": " trimmed.
+ */
+export function splitLead(nodes: ReactNode[]): {
+ title: string;
+ body: ReactNode[];
+} {
+ const [first, ...rest] = nodes;
+ if (!isTag(first, "strong")) return { title: "", body: nodes };
+ const body = [...rest];
+ if (typeof body[0] === "string") {
+ const trimmed = body[0].replace(/^[\s:]+/, "");
+ if (trimmed) body[0] = trimmed;
+ else body.shift();
+ }
+ return { title: textOf(first).replace(/[.:]\s*$/, ""), body };
+}
+
+/** Inline content of a list item or paragraph, unwrapping a lone `<p>`. */
+export function inlineOf(node: ReactNode): ReactNode[] {
+ const nodes = childrenOf(node).filter(
+ (child) => !(typeof child === "string" && !child.trim()),
+ );
+ if (nodes.length === 1 && isTag(nodes[0], "p")) return inlineOf(nodes[0]);
+ return nodes;
+}
diff --git a/components/docs/index/introduction/next-links.tsx b/components/docs/index/introduction/next-links.tsx
new file mode 100644
index 00000000..a1d87bf5
--- /dev/null
+++ b/components/docs/index/introduction/next-links.tsx
@@ -0,0 +1,72 @@
+import Link from "next/link";
+import { isValidElement, type ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { indexCardLink } from "../index-section";
+import { Glyph, type GlyphName } from "./glyph";
+import { childrenOf, findAll, inlineOf, textOf } from "./mdx-tree";
+
+/**
+ * "What's next": reads a markdown list of `[Title](href): description` items
+ * and renders each as a link card. Glyphs are matched by order.
+ */
+export function NextLinks({
+ icons,
+ children,
+}: {
+ icons: GlyphName[];
+ children: ReactNode;
+}) {
+ const items = findAll(children, "li").flatMap((li) => {
+ const [link, ...rest] = inlineOf(li);
+ // The MDX link renders through the docs `a` component, so match on href.
+ const href = isValidElement<{ href?: string }>(link)
+ ? link.props.href
+ : undefined;
+ if (!href) return [];
+ const description = textOf(rest).replace(/^[\s:]+/, "");
+ return [
+ {
+ href,
+ title: textOf(childrenOf(link)),
+ description: description.charAt(0).toUpperCase() + description.slice(1),
+ },
+ ];
+ });
+
+ return (
+ <ul
+ className={cn(
+ "not-prose grid gap-2.5 pt-0.5 md:grid-cols-2 md:gap-3 md:pt-1",
+ BLOCK_SPACING,
+ )}
+ >
+ {items.map((item, index) => (
+ <li key={item.href}>
+ <Link
+ href={item.href}
+ className={cn(
+ "group/next flex min-h-[76px] items-center gap-3.5 rounded-card bg-surface shadow-[0_0_0_1px_var(--color-hairline)] px-4 py-3.5 md:min-h-[92px]",
+ indexCardLink,
+ )}
+ >
+ <span className="flex size-10 shrink-0 items-center justify-center rounded-control-sm bg-surface-muted text-foreground">
+ <Glyph name={icons[index] ?? "arrow"} />
+ </span>
+ <span className="flex min-w-0 grow flex-col gap-0.5">
+ <span className="text-ui leading-[22px] font-medium text-foreground">
+ {item.title}
+ </span>
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {item.description}
+ </span>
+ </span>
+ <span className="flex size-8 shrink-0 items-center justify-center rounded-[10px] bg-secondary text-foreground transition-transform duration-150 group-hover/next:translate-x-0.5 motion-reduce:transition-none motion-reduce:group-hover/next:translate-x-0">
+ <Glyph name="arrow" strokeWidth={2} className="size-3.5" />
+ </span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/components/docs/index/introduction/not-cards.tsx b/components/docs/index/introduction/not-cards.tsx
new file mode 100644
index 00000000..2e133983
--- /dev/null
+++ b/components/docs/index/introduction/not-cards.tsx
@@ -0,0 +1,49 @@
+import type { ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { type GlyphName, StruckGlyph } from "./glyph";
+import { findAll, inlineOf, splitLead } from "./mdx-tree";
+
+/**
+ * "What remocn is not": restyles a markdown list of `**Not X.** why` items
+ * as a 2×2 grid of muted cards, each with a struck-through glyph. The list
+ * stays plain markdown in the MDX file.
+ */
+export function NotCards({
+ icons,
+ children,
+}: {
+ /** One glyph per list item, in order. */
+ icons: GlyphName[];
+ children: ReactNode;
+}) {
+ const items = findAll(children, "li").map((li) => splitLead(inlineOf(li)));
+
+ return (
+ <ul
+ className={cn(
+ "not-prose grid gap-2.5 pt-0.5 md:grid-cols-2 md:gap-3 md:pt-1",
+ BLOCK_SPACING,
+ )}
+ >
+ {items.map((item, index) => (
+ <li
+ key={item.title}
+ className="flex gap-3.5 rounded-card bg-surface-muted p-[18px] md:flex-col md:px-5 md:pt-5 md:pb-[22px]"
+ >
+ <span className="flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-surface">
+ <StruckGlyph name={icons[index] ?? "info"} />
+ </span>
+ <span className="flex flex-col gap-1.5">
+ <span className="text-ui leading-[22px] font-semibold text-foreground">
+ {item.title}
+ </span>
+ <span className="text-small leading-[22px] text-body [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4">
+ {item.body}
+ </span>
+ </span>
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/components/docs/index/introduction/overview.tsx b/components/docs/index/introduction/overview.tsx
new file mode 100644
index 00000000..fe768370
--- /dev/null
+++ b/components/docs/index/introduction/overview.tsx
@@ -0,0 +1,102 @@
+import type { ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { CodeBlockCommand } from "@/components/docs/code-block-command";
+import { convertNpmCommand } from "@/lib/convert-npm-command";
+import { cn } from "@/lib/utils";
+import { Glyph, type GlyphName } from "./glyph";
+
+/** The three "what remocn is" pillars, one bordered strip (stacked on phones). */
+export function Pillars({ children }: { children: ReactNode }) {
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ "not-prose flex flex-col rounded-card border border-hairline bg-surface md:flex-row",
+ BLOCK_SPACING,
+ )}
+ >
+ {children}
+ </div>
+ );
+}
+
+export function Pillar({
+ icon,
+ title,
+ path,
+ children,
+}: {
+ icon: GlyphName;
+ title: string;
+ /** Optional mono path chip under the copy. */
+ path?: string;
+ children: ReactNode;
+}) {
+ return (
+ <div className="flex basis-0 gap-3.5 p-[18px] not-first:border-t not-first:border-hairline md:grow md:flex-col md:px-[22px] md:pt-[22px] md:pb-6 md:not-first:border-t-0 md:not-first:border-l">
+ <span className="flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-surface-muted text-foreground">
+ <Glyph name={icon} />
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-1 md:gap-1.5">
+ <h3 className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </h3>
+ <div className="text-small leading-[22px] text-body [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4 [&_code]:font-mono [&_code]:text-[0.92em]">
+ {children}
+ </div>
+ {path && (
+ <code className="mt-1.5 flex h-7 w-fit items-center rounded-tile bg-surface-muted px-2.5 font-mono text-mono leading-4 text-foreground md:mt-1 md:h-[26px] md:px-[9px]">
+ {path}
+ </code>
+ )}
+ </div>
+ </div>
+ );
+}
+
+/** "Add your first component": the shared install card, retitled. */
+export function FirstComponent({ name }: { name: string }) {
+ return (
+ <div className={cn("not-prose", BLOCK_SPACING)}>
+ <CodeBlockCommand
+ title="Add your first component"
+ component={name}
+ prompt={`Add the @remocn/${name} component to my project.`}
+ {...convertNpmCommand(`npx shadcn@latest add @remocn/${name}`)}
+ />
+ </div>
+ );
+}
+
+/** A muted one-line aside led by a small glyph. */
+export function Aside({
+ icon = "search",
+ children,
+}: {
+ icon?: GlyphName;
+ children: ReactNode;
+}) {
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ "not-prose flex items-start gap-2.5 px-1 py-0.5 text-small leading-5 text-muted-foreground",
+ BLOCK_SPACING,
+ "md:mt-3.5",
+ icon === "info" && "text-caption leading-5",
+ )}
+ >
+ <Glyph
+ name={icon}
+ strokeWidth={icon === "info" ? 1.9 : 1.8}
+ className={cn(
+ "mt-0.5 size-4",
+ icon === "info" ? "text-subtle" : "text-muted-foreground",
+ )}
+ />
+ <div className="[&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4">
+ {children}
+ </div>
+ </div>
+ );
+}
diff --git a/components/docs/index/introduction/quick-start.tsx b/components/docs/index/introduction/quick-start.tsx
new file mode 100644
index 00000000..55400ecb
--- /dev/null
+++ b/components/docs/index/introduction/quick-start.tsx
@@ -0,0 +1,100 @@
+import type { ReactNode } from "react";
+import { LandingButton } from "@/app/(home)/components/landing/ui/landing-button";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { CopyButton } from "@/components/docs/copy-button";
+import { cn } from "@/lib/utils";
+import { getEntry, loadDocsSource } from "../data";
+
+/** Numbered quick-start steps joined by a rail. */
+export function QuickStart({ children }: { children: ReactNode }) {
+ return (
+ <ol
+ data-not-typeset
+ className={cn("not-prose flex flex-col pt-1 md:pt-1.5", BLOCK_SPACING)}
+ >
+ {children}
+ </ol>
+ );
+}
+
+/**
+ * One quick-start step: title, a short note (MDX children) and the command to
+ * run, with a copy button. Multi-line commands are separated by "\n".
+ */
+export function Step({
+ n,
+ title,
+ command,
+ children,
+}: {
+ n: number;
+ title: string;
+ command: string;
+ children?: ReactNode;
+}) {
+ const lines = command.split("\n");
+ return (
+ <li className="group/step flex gap-3 md:gap-4">
+ <span className="flex w-8 shrink-0 flex-col items-center gap-1.5">
+ <span className="flex size-8 shrink-0 items-center justify-center rounded-[10px] bg-foreground text-small leading-4 font-medium text-inverse">
+ {n}
+ </span>
+ <span className="w-0.5 grow rounded-[1px] bg-secondary group-last/step:hidden" />
+ </span>
+ <div className="flex min-w-0 grow flex-col gap-3 pb-7">
+ <div className="flex flex-col gap-0.5 pt-[5px]">
+ <h3 className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </h3>
+ {children && (
+ <div className="text-small leading-[22px] text-muted-foreground [&_a]:text-foreground [&_a]:underline [&_a]:decoration-divider [&_a]:underline-offset-4 [&_code]:font-mono [&_code]:text-[0.92em] [&_p]:m-0">
+ {children}
+ </div>
+ )}
+ </div>
+ <div className="flex min-h-[52px] items-center gap-3 rounded-control border border-hairline bg-surface py-2 pr-2 pl-4">
+ <pre className="min-w-0 grow overflow-x-auto font-mono text-small leading-6 text-foreground [scrollbar-width:none] max-md:[mask-image:linear-gradient(90deg,#000_80%,transparent)]">
+ {lines.map((line) => (
+ <span key={line} className="block whitespace-pre">
+ {line.startsWith("/") ? line : `$ ${line}`}
+ </span>
+ ))}
+ </pre>
+ <CopyButton
+ value={command}
+ variant="ink"
+ className="md:bg-secondary md:text-foreground md:hover:bg-[#dcdde0] md:dark:hover:bg-[#33363b]"
+ />
+ </div>
+ </div>
+ </li>
+ );
+}
+
+/** Closing card pointing at the full Installation page. */
+export async function InstallationLink({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const page = getEntry("/docs/getting-started/installation");
+ if (!page) return null;
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ "not-prose flex flex-col items-start gap-4 rounded-card bg-surface-muted p-4 md:flex-row md:items-center md:justify-between md:gap-6 md:py-4 md:pr-4 md:pl-5",
+ BLOCK_SPACING,
+ )}
+ >
+ <div className="max-w-[520px] text-small leading-[22px] text-body [&_p]:m-0">
+ {children}
+ </div>
+ <LandingButton
+ href={page.url}
+ variant="secondary"
+ arrow={<span className="text-foreground">→</span>}
+ className="h-10 rounded-control-sm px-4 text-small"
+ >
+ {page.title}
+ </LandingButton>
+ </div>
+ );
+}
diff --git a/components/docs/index/introduction/remotion.tsx b/components/docs/index/introduction/remotion.tsx
new file mode 100644
index 00000000..b1b415d5
--- /dev/null
+++ b/components/docs/index/introduction/remotion.tsx
@@ -0,0 +1,216 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { getEntry, loadDocsSource } from "../data";
+import { indexCardLink } from "../index-section";
+import { Glyph } from "./glyph";
+
+const bar = "shrink-0 rounded-[3px]";
+
+/** Still artwork per part, keyed by the docs page it links to. */
+const PARTS: { url: string; label: string; art: ReactNode }[] = [
+ {
+ url: "/docs/typography/soft-blur-in",
+ label: "Blur-in headline",
+ art: (
+ <span className="flex size-full items-center justify-center gap-[5px] text-[19px] leading-6 font-semibold tracking-[-0.03em] text-[#fafafa]">
+ Ship
+ <span className="opacity-70 blur-[1.5px]">faster</span>
+ </span>
+ ),
+ },
+ {
+ url: "/docs/transitions/push-through",
+ label: "Push transition",
+ art: (
+ <span className="relative block size-full">
+ <span className="absolute inset-y-0 left-0 flex w-[38%] flex-col justify-center gap-[7px] bg-dark-raised pl-2">
+ <span className={cn(bar, "h-1.5 w-10 bg-[#3a3d42]")} />
+ <span className={cn(bar, "h-1.5 w-7 bg-[#3a3d42]")} />
+ </span>
+ <span className="absolute inset-y-0 right-0 left-[38%] flex flex-col justify-center gap-[7px] bg-[#e9eaec] pl-[18px]">
+ <span
+ className={cn(bar, "h-2 w-[58px] rounded-[4px] bg-[#0e1012]")}
+ />
+ <span className={cn(bar, "h-1.5 w-10 bg-[#c9cdd0]")} />
+ <span className={cn(bar, "h-1.5 w-12 bg-[#c9cdd0]")} />
+ </span>
+ </span>
+ ),
+ },
+ {
+ url: "/docs/shaders/components/shader-mesh-gradient",
+ label: "Moving background",
+ art: (
+ <span className="relative block size-full">
+ <span className="absolute -top-10 -left-[30px] size-[130px] rounded-full bg-primary-soft opacity-55 blur-[28px]" />
+ <span className="absolute top-10 left-20 size-[120px] rounded-full bg-[#6b7a80] opacity-70 blur-[30px]" />
+ <span className="absolute -top-2.5 left-[60px] size-[70px] rounded-full bg-[#fafafa] opacity-18 blur-[20px]" />
+ </span>
+ ),
+ },
+ {
+ url: "/docs/ui-blocks/terminal-simulator",
+ label: "Typing terminal",
+ art: (
+ <span className="flex size-full flex-col gap-3 p-3 font-mono text-micro leading-[14px]">
+ <span className="flex gap-[5px]">
+ <span className="size-[7px] rounded-full bg-[#3a3d42]" />
+ <span className="size-[7px] rounded-full bg-[#3a3d42]" />
+ <span className="size-[7px] rounded-full bg-[#3a3d42]" />
+ </span>
+ <span className="flex flex-col gap-1.5">
+ <span className="text-[#8b979c]">~/launch</span>
+ <span className="flex items-center gap-[3px] text-[#fafafa]">
+ $ npm run bu
+ <span className="h-[13px] w-1.5 rounded-[1px] bg-[#fafafa]" />
+ </span>
+ </span>
+ </span>
+ ),
+ },
+];
+
+/** "The parts every product video needs": four still tiles, each a component page. */
+export async function PartTiles() {
+ await loadDocsSource();
+ return (
+ <ul
+ className={cn(
+ "not-prose grid grid-cols-2 gap-2.5 pt-0.5 md:grid-cols-4 md:gap-3 md:pt-1",
+ BLOCK_SPACING,
+ )}
+ >
+ {PARTS.filter((part) => getEntry(part.url)).map((part) => (
+ <li key={part.url}>
+ <Link
+ href={part.url}
+ className={cn(
+ "flex flex-col gap-2.5 rounded-card bg-surface shadow-[0_0_0_1px_var(--color-hairline)] px-1.5 pt-1.5 pb-3",
+ indexCardLink,
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className="block h-[104px] overflow-hidden rounded-control bg-dark-surface md:h-28 dark:shadow-[inset_0_0_0_1px_var(--color-hairline)]"
+ >
+ {part.art}
+ </span>
+ <span className="px-2 text-small leading-5 font-medium text-foreground">
+ {part.label}
+ </span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ );
+}
+
+/** Remotion APIs the components use (ink, checked) and the trap they avoid. */
+export function ApiChips({
+ uses,
+ avoids,
+ avoidsNote,
+}: {
+ uses: string[];
+ avoids: string;
+ avoidsNote: string;
+}) {
+ return (
+ <div
+ className={cn(
+ "not-prose flex flex-wrap gap-2 pb-4 [:is(p)+&]:mt-3",
+ BLOCK_SPACING,
+ )}
+ >
+ {uses.map((api) => (
+ <span
+ key={api}
+ className="flex h-9 items-center gap-2 rounded-[10px] bg-foreground px-3.5 font-mono text-caption leading-4 text-inverse"
+ >
+ <Glyph
+ name="check"
+ strokeWidth={2.2}
+ className="size-3.5 text-primary-soft dark:text-primary"
+ />
+ {api}
+ </span>
+ ))}
+ <span className="flex h-9 items-center gap-2 rounded-[10px] bg-secondary px-3.5 text-caption leading-4 text-muted-foreground">
+ <Glyph name="cross" strokeWidth={2} className="size-3.5" />
+ <code className="font-mono">{avoids}</code>
+ {avoidsNote}
+ </span>
+ </div>
+ );
+}
+
+/**
+ * "The agent skill is the other half": an always-dark band (a raised surface in
+ * dark mode) with the skill's four steps and the before/after line.
+ */
+export function AgentSkillPanel({
+ title,
+ lead,
+ steps,
+ from,
+ to,
+}: {
+ title: string;
+ lead: string;
+ steps: string[];
+ from: string;
+ to: string;
+}) {
+ return (
+ <section
+ data-not-typeset
+ aria-label={title}
+ className={cn(
+ "not-prose flex flex-col gap-5 rounded-panel bg-dark-surface px-5 pt-6 pb-5 md:px-6 md:pt-[26px] md:pb-6 dark:border dark:border-hairline dark:bg-surface",
+ BLOCK_SPACING,
+ )}
+ >
+ <div className="flex flex-col gap-1.5">
+ <h3 className="text-lead leading-[26px] font-medium tracking-title text-[#fafafa] dark:text-foreground">
+ {title}
+ </h3>
+ <p className="text-small leading-[22px] text-[#8b979c]">{lead}</p>
+ </div>
+ <ol className="grid grid-cols-2 gap-2 md:grid-cols-4">
+ {steps.map((step, index) => (
+ <li
+ key={step}
+ className="flex flex-col gap-[18px] rounded-control bg-dark-raised p-3.5 dark:bg-surface-muted"
+ >
+ <span className="flex size-[26px] items-center justify-center rounded-tile bg-[#2a2d31] text-caption leading-4 font-medium text-[#fafafa] dark:text-foreground">
+ {index + 1}
+ </span>
+ <span className="text-small leading-5 text-[#e4e5e7] dark:text-body">
+ {step}
+ </span>
+ </li>
+ ))}
+ </ol>
+ <div className="flex flex-col items-start gap-3 pt-0.5 md:flex-row md:items-center">
+ <span className="text-small leading-5 text-[#c8cdd0]">
+ The skill is the difference between
+ </span>
+ <span className="flex items-center gap-3">
+ <span className="flex h-8 shrink-0 items-center rounded-[10px] bg-[#2a2d31] px-3 text-caption leading-4 text-[#8b979c]">
+ “{from}”
+ </span>
+ <Glyph
+ name="arrow"
+ strokeWidth={2}
+ className="size-4 text-primary-soft dark:text-[#8b979c]"
+ />
+ </span>
+ <span className="flex h-8 shrink-0 items-center rounded-[10px] bg-[#fafafa] px-3 text-caption leading-4 font-medium text-[#0e1012] dark:bg-[#f4f4f5]">
+ {to}
+ </span>
+ </div>
+ </section>
+ );
+}
diff --git a/components/docs/index/introduction/runtime.tsx b/components/docs/index/introduction/runtime.tsx
new file mode 100644
index 00000000..f0a96434
--- /dev/null
+++ b/components/docs/index/introduction/runtime.tsx
@@ -0,0 +1,219 @@
+import { Fragment, type ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { Glyph, type GlyphName } from "./glyph";
+
+/** The shadcn workflow as three mono chips joined by arrows (a column on phones). */
+export function FileFlow({ steps }: { steps: string[] }) {
+ return (
+ <div
+ className={cn(
+ "not-prose flex flex-col items-start gap-2 pt-0.5 md:flex-row md:items-center",
+ BLOCK_SPACING,
+ )}
+ >
+ {steps.map((step, index) => (
+ <Fragment key={step}>
+ {index > 0 && (
+ <Glyph
+ name="arrow"
+ strokeWidth={2}
+ className="size-4 rotate-90 text-subtle max-md:ml-2.5 md:rotate-0"
+ />
+ )}
+ <code className="flex h-9 max-w-full shrink-0 items-center rounded-[10px] bg-secondary px-3 font-mono text-caption leading-4 whitespace-nowrap text-foreground">
+ {step}
+ </code>
+ </Fragment>
+ ))}
+ </div>
+ );
+}
+
+function Pill({ children }: { children: ReactNode }) {
+ return (
+ <span className="absolute top-3 left-3 flex h-[26px] items-center rounded-tile bg-surface px-[9px] text-mono leading-4 text-muted-foreground">
+ {children}
+ </span>
+ );
+}
+
+function ApiTag({ ok, children }: { ok?: boolean; children: ReactNode }) {
+ return (
+ <span
+ className={cn(
+ "flex h-[30px] items-center gap-1.5 rounded-tile px-2.5 font-mono text-mono leading-4",
+ ok
+ ? "bg-foreground text-inverse"
+ : "bg-secondary text-muted-foreground",
+ )}
+ >
+ <Glyph
+ name={ok ? "check" : "cross"}
+ strokeWidth={ok ? 2.6 : 2.4}
+ className={cn(
+ "size-3",
+ ok ? "text-primary-soft dark:text-primary" : "text-muted-foreground",
+ )}
+ />
+ {children}
+ </span>
+ );
+}
+
+function RuntimeCard({
+ visual,
+ title,
+ text,
+ tags,
+}: {
+ visual: ReactNode;
+ title: string;
+ text: string;
+ tags: ReactNode;
+}) {
+ return (
+ <div className="flex min-w-0 flex-col rounded-card border border-hairline bg-surface p-1.5">
+ <div className="relative h-[184px] shrink-0 overflow-hidden rounded-control bg-surface-muted">
+ {visual}
+ </div>
+ <div className="flex flex-col gap-3 px-3.5 pt-3.5 pb-3">
+ <div className="flex flex-col gap-1">
+ <h4 className="text-ui leading-[22px] font-medium text-foreground">
+ {title}
+ </h4>
+ <p className="text-small leading-5 text-body">{text}</p>
+ </div>
+ <div className="flex flex-wrap gap-1.5">{tags}</div>
+ </div>
+ </div>
+ );
+}
+
+const button =
+ "flex h-[34px] w-[84px] items-center justify-center rounded-[10px] bg-foreground text-caption leading-4 text-inverse";
+
+/** Frames of the scripted button: blurred and faint before, crisp at the playhead. */
+const FRAMES = [
+ { at: "13%", style: "opacity-22 blur-[2px]" },
+ { at: "50%", style: "opacity-60 blur-[0.8px]" },
+ { at: "87%", style: "" },
+];
+
+/**
+ * "What changes is the runtime": the same button in the browser (driven by a
+ * click) and in the renderer (a pure function of the frame).
+ */
+export function RuntimeDiff() {
+ return (
+ <div
+ data-not-typeset
+ className={cn("not-prose flex flex-col gap-3 pt-2", BLOCK_SPACING)}
+ >
+ <div className="flex flex-col gap-1 md:flex-row md:items-baseline md:justify-between">
+ <h3 className="text-[18px] leading-6 font-medium tracking-[-0.01em] text-foreground">
+ What changes is the runtime
+ </h3>
+ <p className="text-small leading-5 text-muted-foreground">
+ Same button, two runtimes
+ </p>
+ </div>
+ <div className="grid gap-3 md:grid-cols-2">
+ <RuntimeCard
+ title="A shadcn button"
+ text="Responds to a click."
+ visual={
+ <>
+ <Pill>In the browser</Pill>
+ <span className="absolute inset-0 flex items-center justify-center">
+ <span className="relative flex h-10 items-center rounded-control-sm bg-foreground px-[18px] text-small leading-5 text-inverse">
+ Continue
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="absolute top-[28px] left-[68px] size-[22px] fill-surface stroke-foreground stroke-[1.6] [stroke-linejoin:round]"
+ >
+ <path d="M5 3.5 19 11l-6.2 1.6L10 19Z" />
+ </svg>
+ </span>
+ </span>
+ </>
+ }
+ tags={
+ <>
+ <ApiTag>useState</ApiTag>
+ <ApiTag>onClick</ApiTag>
+ <ApiTag>transition</ApiTag>
+ </>
+ }
+ />
+ <RuntimeCard
+ title="A remocn button"
+ text="Same pixels for the same frame, every time."
+ visual={
+ <>
+ <Pill>In the renderer</Pill>
+ <span className="absolute inset-x-3.5 top-[62px] h-[34px]">
+ {FRAMES.map((frame) => (
+ <span
+ key={frame.at}
+ style={{ left: frame.at }}
+ className={cn(
+ "absolute -translate-x-1/2",
+ button,
+ frame.style,
+ )}
+ >
+ Continue
+ </span>
+ ))}
+ </span>
+ <span className="absolute inset-x-3.5 top-[116px] h-6 rounded-tile bg-secondary">
+ <span className="absolute inset-y-0 left-0 w-1/2 rounded-tile bg-[#d2d4d7] dark:bg-[#3a3d42]" />
+ <span className="absolute top-1.5 left-[13%] h-3 w-1 rounded-[2px] bg-foreground" />
+ <span className="absolute top-1.5 left-[87%] h-3 w-1 rounded-[2px] bg-muted-foreground" />
+ <span className="absolute -top-[5px] left-1/2 h-[34px] w-2 -translate-x-1/2 rounded-[4px] bg-primary shadow-[0_0_0_3px_var(--color-surface-muted)]" />
+ </span>
+ <span className="absolute inset-x-3.5 top-[150px] text-mono leading-4">
+ <span className="absolute left-[13%] -translate-x-1/2 text-muted-foreground">
+ 0
+ </span>
+ <span className="absolute left-1/2 -translate-x-1/2 font-medium text-primary">
+ 30
+ </span>
+ <span className="absolute left-[87%] -translate-x-1/2 text-muted-foreground">
+ 60
+ </span>
+ </span>
+ </>
+ }
+ tags={<ApiTag ok>useCurrentFrame()</ApiTag>}
+ />
+ </div>
+ </div>
+ );
+}
+
+/** A tinted note led by a glyph tile, e.g. the frame-timing reminder. */
+export function IconNote({
+ icon,
+ children,
+}: {
+ icon: GlyphName;
+ children: ReactNode;
+}) {
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ "not-prose flex items-center gap-3.5 rounded-cta bg-surface-muted py-3.5 pr-[18px] pl-3.5 text-small leading-[22px] text-body max-md:items-start md:mt-3",
+ BLOCK_SPACING,
+ )}
+ >
+ <span className="flex size-9 shrink-0 items-center justify-center rounded-[10px] bg-surface text-foreground">
+ <Glyph name={icon} />
+ </span>
+ <div className="[&_code]:font-mono [&_code]:text-[0.9em]">{children}</div>
+ </div>
+ );
+}
diff --git a/components/docs/index/introduction/tiers.tsx b/components/docs/index/introduction/tiers.tsx
new file mode 100644
index 00000000..864a76b4
--- /dev/null
+++ b/components/docs/index/introduction/tiers.tsx
@@ -0,0 +1,171 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
+import { cn } from "@/lib/utils";
+import { getEntry, loadDocsSource } from "../data";
+
+/** Tier artwork (decoration only). */
+const ART: Record<"remocn" | "remocn-ui", ReactNode> = {
+ remocn: (
+ <span className="relative block size-full">
+ <span className="absolute top-4 left-4 flex h-[92px] w-[42%] items-center justify-center gap-0.5 rounded-control-sm bg-dark-surface text-[30px] dark:border dark:border-hairline leading-[34px] font-semibold tracking-[-0.04em] text-[#fafafa]">
+ Hel
+ <span className="translate-y-1.5 opacity-30">lo</span>
+ </span>
+ <span className="absolute top-4 right-4 left-[calc(42%+26px)] h-[92px] rounded-control-sm bg-[linear-gradient(135deg,#1a1c1e_0%,#3a3d42_45%,#f0abfc_100%)]" />
+ <span className="absolute top-[118px] left-4 flex h-[42px] w-16 items-center justify-center rounded-control-sm bg-surface">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-6 fill-none stroke-2 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <circle cx="12" cy="12" r="9" className="stroke-secondary" />
+ <path
+ d="M12 3a9 9 0 0 1 9 9a9 9 0 0 1-4 7.5M8 12.5l3 3 5-6"
+ className="stroke-foreground"
+ />
+ </svg>
+ </span>
+ <span className="absolute top-[118px] left-[90px] h-[42px] w-24 overflow-hidden rounded-control-sm bg-dark-raised dark:border dark:border-hairline">
+ <span className="absolute inset-y-0 left-11 w-[60px] bg-[#fafafa]" />
+ </span>
+ <span className="absolute top-[118px] right-4 left-[196px] flex h-[42px] items-center gap-2 rounded-control-sm bg-surface px-2.5 max-md:hidden">
+ <span className="size-[22px] shrink-0 rounded-full bg-secondary" />
+ <span className="flex flex-col gap-1">
+ <span className="h-[5px] w-[62px] rounded-[3px] bg-foreground" />
+ <span className="h-[5px] w-11 rounded-[3px] bg-[#c9cdd0] dark:bg-[#3a3d42]" />
+ </span>
+ </span>
+ </span>
+ ),
+ "remocn-ui": (
+ <span className="relative block size-full text-mono leading-4">
+ <span className="absolute top-7 left-4 flex w-[120px] max-md:w-[104px] flex-col gap-1 rounded-control-sm bg-surface p-1 shadow-[0_1px_2px_#0e10120f]">
+ <span className="flex h-7 items-center justify-between rounded-tile bg-surface-muted px-2 text-foreground">
+ Monthly
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3 fill-none stroke-foreground stroke-[2.4] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="m5 12.5 4.5 4.5L19 7.5" />
+ </svg>
+ </span>
+ <span className="flex h-7 items-center px-2 text-muted-foreground">
+ Yearly
+ </span>
+ </span>
+ <span className="absolute top-[116px] left-4 flex h-9 w-[120px] max-md:w-[104px] items-center justify-center rounded-[10px] bg-secondary text-caption text-foreground">
+ Cancel
+ </span>
+ <span className="absolute top-4 right-4 flex h-36 w-[184px] flex-col gap-2.5 rounded-control bg-surface p-3.5 shadow-[0_1px_2px_#0e10120f,0_8px_24px_#0e10120f]">
+ <span className="text-caption font-medium text-foreground">
+ Invite your team
+ </span>
+ <span className="flex h-[30px] items-center gap-0.5 rounded-tile bg-surface-muted px-2.5 text-body">
+ <span className="h-3.5 w-[1.5px] bg-foreground" />
+ </span>
+ <span className="flex items-center gap-2 text-body">
+ <span className="flex size-4 items-center justify-center rounded-[5px] bg-foreground">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-2.5 fill-none stroke-inverse stroke-3 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="m5 12.5 4.5 4.5L19 7.5" />
+ </svg>
+ </span>
+ Send a copy to me
+ </span>
+ <span className="flex justify-end">
+ <span className="flex h-7 items-center rounded-tile bg-foreground px-3 text-inverse">
+ Send invite
+ </span>
+ </span>
+ </span>
+ </span>
+ ),
+};
+
+/** The two component tiers side by side (stacked on phones). */
+export function Tiers({ children }: { children: ReactNode }) {
+ return (
+ <div
+ data-not-typeset
+ className={cn(
+ "not-prose grid gap-3 pt-0.5 md:grid-cols-2 md:pt-1",
+ BLOCK_SPACING,
+ )}
+ >
+ {children}
+ </div>
+ );
+}
+
+/**
+ * One tier card: artwork, name with its registry, an optional description and
+ * chips linking to docs pages (labels default to the page titles).
+ */
+export async function Tier({
+ name,
+ registry,
+ links,
+ children,
+}: {
+ name: string;
+ registry: "remocn" | "remocn-ui";
+ links: { href: string; label?: string }[];
+ children?: ReactNode;
+}) {
+ await loadDocsSource();
+ return (
+ <div className="flex min-w-0 flex-col rounded-card border border-hairline bg-surface p-1.5">
+ <div
+ aria-hidden="true"
+ className="h-44 shrink-0 overflow-hidden rounded-control bg-surface-muted"
+ >
+ {ART[registry]}
+ </div>
+ <div className="flex flex-col gap-3 px-3.5 pt-3.5 pb-3">
+ <div className="flex items-center gap-2">
+ <h3 className="text-ui leading-[22px] font-medium text-foreground">
+ {name}
+ </h3>
+ <code className="flex h-6 items-center rounded-[7px] bg-surface-muted px-2 font-mono text-mono leading-4 text-muted-foreground">
+ {registry}
+ </code>
+ </div>
+ {children && (
+ <div className="text-small leading-[22px] text-body [&_p]:m-0">
+ {children}
+ </div>
+ )}
+ <ul
+ className={cn(
+ "flex flex-wrap",
+ registry === "remocn-ui" ? "gap-[5px]" : "gap-1.5",
+ )}
+ >
+ {links.map((link) => {
+ const label = link.label ?? getEntry(link.href)?.title;
+ if (!label) return null;
+ return (
+ <li key={link.href}>
+ <Link
+ href={link.href}
+ className={cn(
+ "flex h-7 items-center rounded-tile bg-surface-muted text-caption leading-4 text-body outline-none transition-colors hover:bg-secondary focus-visible:ring-3 focus-visible:ring-ring",
+ registry === "remocn-ui" ? "px-[9px]" : "px-2.5",
+ )}
+ >
+ {label}
+ </Link>
+ </li>
+ );
+ })}
+ </ul>
+ </div>
+ </div>
+ );
+}
diff --git a/components/docs/index/libraries/caption-hero.tsx b/components/docs/index/libraries/caption-hero.tsx
new file mode 100644
index 00000000..194d6cd8
--- /dev/null
+++ b/components/docs/index/libraries/caption-hero.tsx
@@ -0,0 +1,158 @@
+"use client";
+
+import { memo, useCallback, useState } from "react";
+import { previewCaptions } from "@/components/docs/examples/caption-fixture";
+import { cn } from "@/lib/utils";
+import registry from "@/registry/__index__";
+import { previewManifest } from "@/registry/__manifest__";
+import { HeroTag } from "./hero-pill";
+import { HeroPlayer } from "./hero-player";
+
+const ROWS = 6;
+const COMPOSITION = { width: 1280, height: 720 };
+
+const VideoPlayer = memo(function VideoPlayer({
+ slug,
+ onFrame,
+}: {
+ slug: string;
+ onFrame: (frame: number) => void;
+}) {
+ const entry = registry[slug];
+ const preview = previewManifest[slug];
+ if (!entry || !preview) return null;
+ return (
+ <HeroPlayer
+ load={entry.load}
+ inputProps={preview.defaults}
+ durationInFrames={preview.durationInFrames}
+ fps={preview.fps}
+ stillFrame={Math.round(preview.durationInFrames * 0.45)}
+ composition={COMPOSITION}
+ onFrame={onFrame}
+ />
+ );
+});
+
+function timecode(ms: number) {
+ const minutes = Math.floor(ms / 60000);
+ const seconds = ((ms % 60000) / 1000).toFixed(2).padStart(5, "0");
+ return `${minutes}:${seconds}`;
+}
+
+/**
+ * Captions overview hero: a caption style playing over footage, next to the
+ * transcript it reads. The table follows the player, highlighting the word
+ * being spoken, so the link between `captions.json` and the video is visible.
+ */
+export function CaptionHero({
+ name,
+ photo,
+}: {
+ /** Registry name of the caption style that plays. */
+ name: string;
+ /** Footage behind the caption. */
+ photo: string;
+}) {
+ const preview = previewManifest[name];
+ const fps = preview?.fps ?? 30;
+ const words = previewCaptions(
+ typeof preview?.defaults.captions === "string"
+ ? preview.defaults.captions
+ : undefined,
+ );
+ const [frame, setFrame] = useState(
+ Math.round((preview?.durationInFrames ?? 0) * 0.45),
+ );
+ const onFrame = useCallback((next: number) => setFrame(next), []);
+
+ const ms = (frame / fps) * 1000;
+ let active = words.findLastIndex((word) => word.startMs <= ms);
+ if (active === -1) active = 0;
+ const start = Math.min(
+ Math.max(active - Math.floor(ROWS / 2) + 1, 0),
+ Math.max(words.length - ROWS, 0),
+ );
+ const rows = words.slice(start, start + ROWS);
+
+ return (
+ <figure className="not-prose mt-2 flex flex-col overflow-hidden rounded-card bg-dark-surface sm:h-80 sm:flex-row">
+ <div className="relative h-[220px] shrink-0 overflow-hidden sm:h-full sm:w-[62%]">
+ {/* biome-ignore lint/performance/noImgElement: decorative footage under a transparent player */}
+ <img
+ src={photo}
+ alt=""
+ className="absolute inset-0 size-full object-cover"
+ />
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 bg-[linear-gradient(180deg,#0e10121a_30%,#0e1012bf_100%)]"
+ />
+ <VideoPlayer slug={name} onFrame={onFrame} />
+ <HeroTag className="absolute top-4 left-4 bg-[#0e101299] tabular-nums sm:top-5 sm:left-5">
+ {timecode(ms)}
+ </HeroTag>
+ </div>
+ <figcaption className="flex grow flex-col gap-[3px] bg-[#16181a] px-3 py-4 sm:px-4 sm:py-5">
+ <span className="flex items-center justify-between px-2 pb-2.5 text-mono leading-4">
+ <span className="font-mono text-[#fafafa]">captions.json</span>
+ <span className="text-dark-subtle">{words.length} words</span>
+ </span>
+ <span className="flex h-6 items-center px-2 font-mono text-micro leading-[14px] text-[#8b979c]">
+ <span className="grow">text</span>
+ <span className="w-16 text-right">startMs</span>
+ <span className="w-16 text-right">endMs</span>
+ </span>
+ <ol aria-label="Transcript">
+ {rows.map((word, index) => {
+ const position = start + index;
+ const state =
+ position === active
+ ? "active"
+ : position < active
+ ? "spoken"
+ : "upcoming";
+ return (
+ <li
+ key={`${position}-${word.startMs}`}
+ aria-current={state === "active" ? "true" : undefined}
+ className={cn(
+ "flex h-8 items-center rounded-[10px] px-2 font-mono text-mono leading-4 tabular-nums sm:h-[34px]",
+ state === "active" && "bg-[#26292c]",
+ )}
+ >
+ <span
+ className={cn(
+ "grow truncate",
+ state === "active"
+ ? "text-[#fde047]"
+ : state === "spoken"
+ ? "text-[#e4e5e7]"
+ : "text-[#8b979c]",
+ )}
+ >
+ "{word.text.trim()}"
+ </span>
+ {[word.startMs, word.endMs].map((value, column) => (
+ <span
+ key={column}
+ className={cn(
+ "w-16 shrink-0 text-right",
+ state === "active"
+ ? "text-[#e4e5e7]"
+ : state === "spoken"
+ ? "text-dark-subtle"
+ : "text-[#8b979c]",
+ )}
+ >
+ {value}
+ </span>
+ ))}
+ </li>
+ );
+ })}
+ </ol>
+ </figcaption>
+ </figure>
+ );
+}
diff --git a/components/docs/index/libraries/filter-hero-scene.tsx b/components/docs/index/libraries/filter-hero-scene.tsx
new file mode 100644
index 00000000..12b6afc0
--- /dev/null
+++ b/components/docs/index/libraries/filter-hero-scene.tsx
@@ -0,0 +1,22 @@
+"use client";
+
+import { AbsoluteFill } from "remotion";
+import { VhsFilter } from "@/registry/remocn/vhs-filter";
+import { PhotoScene } from "./filter-photo-scenes";
+
+/**
+ * Before/after composition: the raw photo, with the filtered photo revealed
+ * right of `split` (a 0–1 fraction of the width).
+ */
+export function FilterSplitScene({ split }: { split: number }) {
+ return (
+ <AbsoluteFill>
+ <PhotoScene />
+ <AbsoluteFill style={{ clipPath: `inset(0 0 0 ${split * 100}%)` }}>
+ <VhsFilter>
+ <PhotoScene />
+ </VhsFilter>
+ </AbsoluteFill>
+ </AbsoluteFill>
+ );
+}
diff --git a/components/docs/index/libraries/filter-hero-section.tsx b/components/docs/index/libraries/filter-hero-section.tsx
new file mode 100644
index 00000000..06b7c6bb
--- /dev/null
+++ b/components/docs/index/libraries/filter-hero-section.tsx
@@ -0,0 +1,21 @@
+import { loadDocsSource } from "../data";
+import { FilterHero } from "./filter-hero";
+import { getLibraryItems } from "./library-data";
+
+/** Server entry for {@link FilterHero}: counts the filters from the page tree. */
+export async function FiltersHero({
+ filterLabel,
+ tags,
+}: {
+ filterLabel: string;
+ tags?: string[];
+}) {
+ await loadDocsSource();
+ return (
+ <FilterHero
+ count={getLibraryItems("/docs/filters").length}
+ filterLabel={filterLabel}
+ tags={tags}
+ />
+ );
+}
diff --git a/components/docs/index/libraries/filter-hero.tsx b/components/docs/index/libraries/filter-hero.tsx
new file mode 100644
index 00000000..9ec766aa
--- /dev/null
+++ b/components/docs/index/libraries/filter-hero.tsx
@@ -0,0 +1,86 @@
+"use client";
+
+import { useState } from "react";
+import { HeroPill, HeroTag } from "./hero-pill";
+import { HeroPlayer } from "./hero-player";
+
+const loadScene = () =>
+ import("./filter-hero-scene").then((m) => ({ default: m.FilterSplitScene }));
+
+/**
+ * Filters overview hero: one frame, source on the left and the same frame
+ * through a filter on the right. The handle drags the split (a range input,
+ * so it also works from the keyboard).
+ */
+export function FilterHero({
+ count,
+ filterLabel,
+ tags = [],
+}: {
+ count: number;
+ /** Label over the filtered half, e.g. "<VhsFilter>". */
+ filterLabel: string;
+ tags?: string[];
+}) {
+ const [split, setSplit] = useState(0.5);
+
+ return (
+ <figure className="not-prose group/split relative mt-2 h-60 overflow-hidden rounded-card bg-dark-surface select-none sm:h-80">
+ <HeroPlayer
+ load={loadScene}
+ inputProps={{ split }}
+ durationInFrames={90}
+ stillFrame={30}
+ />
+ <span
+ aria-hidden="true"
+ className="pointer-events-none absolute inset-y-0 w-1 -translate-x-1/2 bg-white"
+ style={{ left: `${split * 100}%` }}
+ />
+ <span
+ aria-hidden="true"
+ className="pointer-events-none absolute top-1/2 flex size-10 -translate-1/2 items-center justify-center rounded-full bg-white shadow-[0_2px_8px_#0e10124d] group-has-[input:focus-visible]/split:ring-3 group-has-[input:focus-visible]/split:ring-ring/60"
+ style={{ left: `${split * 100}%` }}
+ >
+ <svg
+ viewBox="0 0 24 24"
+ className="size-[18px] fill-none stroke-[#0e1012] stroke-2 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="M9 7l-5 5 5 5M15 7l5 5-5 5" />
+ </svg>
+ </span>
+ <input
+ type="range"
+ min={0}
+ max={1}
+ step={0.01}
+ value={split}
+ onChange={(event) =>
+ setSplit(Math.min(Math.max(Number(event.target.value), 0.05), 0.95))
+ }
+ aria-label="Compare the source frame with the filtered frame"
+ className="seek-range absolute inset-0 size-full cursor-ew-resize touch-pan-y opacity-0 [--seek-thumb:2px]"
+ />
+ <HeroTag className="pointer-events-none absolute top-4 left-4 bg-[#0e101280] sm:top-5 sm:left-5">
+ source
+ </HeroTag>
+ <HeroTag
+ mono
+ className="pointer-events-none absolute top-4 right-4 bg-[#0e101280] sm:top-5 sm:right-5"
+ >
+ {filterLabel}
+ </HeroTag>
+ <figcaption className="pointer-events-none absolute bottom-4 left-4 flex flex-wrap gap-2 sm:bottom-5 sm:left-5">
+ <HeroPill lead>{count} filters</HeroPill>
+ {tags.map((tag) => (
+ <span
+ key={tag}
+ className="flex h-8 items-center rounded-[10px] bg-[#0e10128c] px-3 text-caption leading-4 text-white"
+ >
+ {tag}
+ </span>
+ ))}
+ </figcaption>
+ </figure>
+ );
+}
diff --git a/components/docs/index/libraries/filter-photo-scenes.tsx b/components/docs/index/libraries/filter-photo-scenes.tsx
new file mode 100644
index 00000000..556744cd
--- /dev/null
+++ b/components/docs/index/libraries/filter-photo-scenes.tsx
@@ -0,0 +1,87 @@
+"use client";
+
+import type { ComponentType, ReactNode } from "react";
+import { AbsoluteFill, Img } from "remotion";
+
+/** The frame every filter tile runs through: one landscape, so tiles compare. */
+export const FILTER_PHOTO = "/reel/reel-5.jpg";
+
+export function PhotoScene() {
+ return (
+ <AbsoluteFill style={{ background: "#0e1012" }}>
+ <Img
+ src={FILTER_PHOTO}
+ style={{ width: "100%", height: "100%", objectFit: "cover" }}
+ />
+ </AbsoluteFill>
+ );
+}
+
+type FilterProps = Record<string, unknown> & { children?: ReactNode };
+type Loader = () => Promise<{ default: ComponentType<FilterProps> }>;
+
+/** Wrap a filter component around the shared photo. */
+function overPhoto<P>(
+ Filter: ComponentType<P & { children?: ReactNode }>,
+ extra?: Partial<P>,
+): ComponentType<FilterProps> {
+ return function FilteredPhoto(props: FilterProps) {
+ const Any = Filter as ComponentType<FilterProps>;
+ return (
+ <Any {...extra} {...props}>
+ <PhotoScene />
+ </Any>
+ );
+ };
+}
+
+/** Region the pixelate tile hides, in 1280×720 composition pixels. */
+const PIXELATE_REGION = [{ x: 420, y: 150, width: 440, height: 300 }];
+
+/**
+ * Filter tiles run each filter over {@link PhotoScene} instead of its docs demo
+ * scene, so the gallery reads as one frame through every look. A filter
+ * missing here falls back to its registry demo.
+ */
+export const FILTER_PHOTO_LOADERS: Record<string, Loader> = {
+ "camera-lens": () =>
+ import("@/registry/remocn/camera-lens").then((m) => ({
+ default: overPhoto(m.CameraLens),
+ })),
+ "security-cam": () =>
+ import("@/registry/remocn/security-cam").then((m) => ({
+ default: overPhoto(m.SecurityCam),
+ })),
+ hologram: () =>
+ import("@/registry/remocn/hologram").then((m) => ({
+ default: overPhoto(m.Hologram),
+ })),
+ "vhs-filter": () =>
+ import("@/registry/remocn/vhs-filter").then((m) => ({
+ default: overPhoto(m.VhsFilter),
+ })),
+ "crt-screen": () =>
+ import("@/registry/remocn/crt-screen").then((m) => ({
+ default: overPhoto(m.CrtScreen),
+ })),
+ "sustained-glitch": () =>
+ import("@/registry/remocn/sustained-glitch").then((m) => ({
+ default: overPhoto(m.SustainedGlitch),
+ })),
+ "pixelate-region": () =>
+ import("@/registry/remocn/pixelate-region").then((m) => ({
+ default: overPhoto(m.PixelateRegion, { regions: PIXELATE_REGION }),
+ })),
+ "ascii-render": () =>
+ import("@/registry/remocn/ascii-render").then((m) => ({
+ default: overPhoto(m.AsciiRender),
+ })),
+ "halftone-print": () =>
+ import("@/registry/remocn/halftone-print").then((m) => ({
+ default: overPhoto(m.HalftonePrint),
+ })),
+ "underwater-ripple": () =>
+ import("@/registry/remocn/underwater-ripple").then((m) => ({
+ default: overPhoto(m.UnderwaterRipple),
+ })),
+};
diff --git a/components/docs/index/libraries/hero-pill.tsx b/components/docs/index/libraries/hero-pill.tsx
new file mode 100644
index 00000000..8789700b
--- /dev/null
+++ b/components/docs/index/libraries/hero-pill.tsx
@@ -0,0 +1,45 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/** Pills laid over a hero frame: a light lead pill, glassy ones after it. */
+export function HeroPill({
+ lead,
+ children,
+}: {
+ lead?: boolean;
+ children: ReactNode;
+}) {
+ return (
+ <span
+ className={cn(
+ "flex h-8 items-center rounded-[10px] px-3 text-caption leading-4",
+ lead ? "bg-white text-[#0e1012]" : "bg-white/16 text-white",
+ )}
+ >
+ {children}
+ </span>
+ );
+}
+
+/** Small dark label in a hero corner (file names, timecodes, frame counts). */
+export function HeroTag({
+ mono,
+ className,
+ children,
+}: {
+ mono?: boolean;
+ className?: string;
+ children: ReactNode;
+}) {
+ return (
+ <span
+ className={cn(
+ "flex h-7 items-center rounded-tile bg-[#0e101273] px-[9px] text-mono leading-4 text-[#fafafa] sm:px-2.5",
+ mono ? "font-mono" : "font-sans",
+ className,
+ )}
+ >
+ {children}
+ </span>
+ );
+}
diff --git a/components/docs/index/libraries/hero-player.tsx b/components/docs/index/libraries/hero-player.tsx
new file mode 100644
index 00000000..b6ee9666
--- /dev/null
+++ b/components/docs/index/libraries/hero-player.tsx
@@ -0,0 +1,143 @@
+"use client";
+
+import { Player, type PlayerRef } from "@remotion/player";
+import {
+ type ComponentType,
+ type RefObject,
+ useEffect,
+ useRef,
+ useState,
+} from "react";
+import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+import { useInView } from "./use-in-view";
+
+const DENSITY = 1.5;
+
+type Sized = { width: number; height: number };
+// biome-ignore lint/suspicious/noExplicitAny: loaded Remotion composition, props vary
+type AnyComponent = ComponentType<any>;
+
+/**
+ * A full-bleed looping preview for a library hero. The composition is sized to
+ * the box (so shaders and filters fill it edge to edge, no letterbox), plays
+ * while on screen and holds a still under reduced motion.
+ */
+export function HeroPlayer({
+ load,
+ inputProps,
+ durationInFrames,
+ fps = 30,
+ stillFrame = 0,
+ composition,
+ playerRef: externalRef,
+ onFrame,
+}: {
+ load: () => Promise<{ default: AnyComponent }>;
+ inputProps: Record<string, unknown>;
+ durationInFrames: number;
+ fps?: number;
+ stillFrame?: number;
+ /**
+ * Fixed composition size, covered into the box instead of sized to it (for
+ * components whose type scale is tuned to their composition, like captions).
+ * Expects a box narrower than the composition's aspect.
+ */
+ composition?: Sized;
+ playerRef?: RefObject<PlayerRef | null>;
+ onFrame?: (frame: number) => void;
+}) {
+ const boxRef = useRef<HTMLDivElement>(null);
+ const ownRef = useRef<PlayerRef>(null);
+ const playerRef = externalRef ?? ownRef;
+ const [size, setSize] = useState<Sized | null>(null);
+ const inView = useInView(boxRef, "0px");
+ const reduced = usePrefersReducedMotion();
+
+ useEffect(() => {
+ const node = boxRef.current;
+ if (!node) return;
+ const measure = () => {
+ const width = Math.round(node.offsetWidth * DENSITY);
+ const height = Math.round(node.offsetHeight * DENSITY);
+ if (!width || !height) return;
+ setSize((current) =>
+ current?.width === width && current.height === height
+ ? current
+ : { width, height },
+ );
+ };
+ measure();
+ const observer = new ResizeObserver(measure);
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ // play() is a no-op until the lazy composition has loaded, so keep nudging
+ // while the hero is on screen (same approach as the landing players).
+ useEffect(() => {
+ const player = playerRef.current;
+ if (!size) return;
+ if (!inView || reduced) {
+ player?.pause();
+ if (reduced) player?.seekTo(stillFrame);
+ return;
+ }
+ const ensure = () => {
+ const current = playerRef.current;
+ if (current && !document.hidden && !current.isPlaying()) current.play();
+ };
+ ensure();
+ const id = window.setInterval(ensure, 400);
+ return () => window.clearInterval(id);
+ }, [inView, reduced, size, stillFrame, playerRef]);
+
+ useEffect(() => {
+ const player = playerRef.current;
+ if (!size || !player || !onFrame) return;
+ const listener: Parameters<PlayerRef["addEventListener"]>[1] = (event) =>
+ onFrame((event as CustomEvent<{ frame: number }>).detail.frame);
+ player.addEventListener("frameupdate", listener);
+ player.addEventListener("seeked", listener);
+ return () => {
+ player.removeEventListener("frameupdate", listener);
+ player.removeEventListener("seeked", listener);
+ };
+ }, [onFrame, size, playerRef]);
+
+ return (
+ <div ref={boxRef} className="absolute inset-0">
+ {size && (
+ <div
+ className={
+ composition
+ ? "absolute top-0 left-1/2 h-full -translate-x-1/2"
+ : "absolute inset-0"
+ }
+ style={
+ composition
+ ? { aspectRatio: `${composition.width} / ${composition.height}` }
+ : undefined
+ }
+ >
+ <Player
+ ref={playerRef}
+ lazyComponent={load}
+ inputProps={inputProps}
+ durationInFrames={durationInFrames}
+ fps={fps}
+ compositionWidth={composition?.width ?? size.width}
+ compositionHeight={composition?.height ?? size.height}
+ initialFrame={stillFrame}
+ style={{ width: "100%", height: "100%", background: "transparent" }}
+ controls={false}
+ clickToPlay={false}
+ loop
+ initiallyMuted
+ numberOfSharedAudioTags={0}
+ acknowledgeRemotionLicense
+ />
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/components/docs/index/libraries/how-it-works.tsx b/components/docs/index/libraries/how-it-works.tsx
new file mode 100644
index 00000000..177beb07
--- /dev/null
+++ b/components/docs/index/libraries/how-it-works.tsx
@@ -0,0 +1,44 @@
+import type { ReactNode } from "react";
+import { IndexSection } from "../index-section";
+
+export type Step = { title: string; body: string };
+
+/**
+ * "How it works" of a library overview: the MDX heading and lead, then one
+ * numbered card per step. Install, code and callout blocks follow in MDX.
+ */
+export function HowItWorks({
+ steps,
+ children,
+}: {
+ steps: Step[];
+ children: ReactNode;
+}) {
+ return (
+ <IndexSection heading={children} className="[&_p]:max-w-[680px]">
+ <ol className="flex flex-col gap-2.5 pt-1 sm:grid sm:grid-cols-3 sm:gap-3.5">
+ {steps.map((step, index) => (
+ <li
+ key={step.title}
+ className="flex gap-3.5 rounded-card border border-hairline bg-surface p-[18px] sm:flex-col sm:gap-3 sm:p-5"
+ >
+ <span
+ aria-hidden="true"
+ className="flex size-7 shrink-0 items-center justify-center rounded-tile bg-surface-muted text-caption leading-4 text-foreground tabular-nums sm:text-mono"
+ >
+ {index + 1}
+ </span>
+ <span className="flex min-w-0 grow flex-col gap-1 sm:gap-3">
+ <span className="text-ui leading-[22px] font-medium text-foreground">
+ {step.title}
+ </span>
+ <span className="text-small leading-[21px] text-muted-foreground">
+ {step.body}
+ </span>
+ </span>
+ </li>
+ ))}
+ </ol>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/libraries/library-data.ts b/components/docs/index/libraries/library-data.ts
new file mode 100644
index 00000000..7f430ce6
--- /dev/null
+++ b/components/docs/index/libraries/library-data.ts
@@ -0,0 +1,29 @@
+import { getComponentEntries, getPage } from "../data";
+
+/** One tile of a library gallery: a component page and its vibe. */
+export type LibraryItem = {
+ /** Registry name, also the key into `registry/__index__` and the manifest. */
+ slug: string;
+ title: string;
+ url: string;
+ vibe?: string;
+};
+
+/**
+ * Component pages of a library tab (shaders, filters, captions) in sidebar
+ * order, each with the `vibe` its page declares in frontmatter.
+ */
+export function getLibraryItems(prefix: string): LibraryItem[] {
+ return getComponentEntries(prefix).flatMap((entry) =>
+ entry.component
+ ? [
+ {
+ slug: entry.component,
+ title: entry.title,
+ url: entry.url,
+ vibe: getPage(entry.url)?.data.vibe,
+ },
+ ]
+ : [],
+ );
+}
diff --git a/components/docs/index/libraries/library-gallery.tsx b/components/docs/index/libraries/library-gallery.tsx
new file mode 100644
index 00000000..ff9e8844
--- /dev/null
+++ b/components/docs/index/libraries/library-gallery.tsx
@@ -0,0 +1,48 @@
+import type { ReactNode } from "react";
+import { loadDocsSource } from "../data";
+import { IndexSection } from "../index-section";
+import { getLibraryItems } from "./library-data";
+import { LibraryGrid } from "./library-grid";
+import type { LibraryKind } from "./tile-preview";
+
+const PREFIX: Record<LibraryKind, string> = {
+ shader: "/docs/shaders",
+ filter: "/docs/filters",
+ caption: "/docs/captions",
+};
+
+/**
+ * "All shaders" (filters, caption styles): every component page of the
+ * library with its vibe, from the page tree. The MDX heading and lead line
+ * arrive as children.
+ *
+ * ```mdx
+ * <LibraryGallery kind="shader">
+ *
+ * ## All shaders
+ *
+ * Defaults are deliberately muted.
+ *
+ * </LibraryGallery>
+ * ```
+ */
+export async function LibraryGallery({
+ kind,
+ children,
+}: {
+ kind: LibraryKind;
+ children: ReactNode;
+}) {
+ await loadDocsSource();
+ const items = getLibraryItems(PREFIX[kind]);
+
+ return (
+ <IndexSection
+ heading={children}
+ count={items.length}
+ className="[&_p]:max-w-[680px]"
+ >
+ <LibraryGrid items={items} kind={kind} />
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/libraries/library-grid.tsx b/components/docs/index/libraries/library-grid.tsx
new file mode 100644
index 00000000..244b951e
--- /dev/null
+++ b/components/docs/index/libraries/library-grid.tsx
@@ -0,0 +1,140 @@
+"use client";
+
+import Link from "next/link";
+import { useMemo, useState } from "react";
+import { cn } from "@/lib/utils";
+import { FilterChip } from "../filter-chip";
+import type { LibraryItem } from "./library-data";
+import { type LibraryKind, TilePreview } from "./tile-preview";
+
+/** Footage behind the caption tiles, cycled so neighbours differ. */
+const CAPTION_PHOTOS = [1, 3, 5, 4, 6, 2].map((n) => `/reel/reel-${n}.jpg`);
+
+const capitalize = (value: string) =>
+ value.charAt(0).toUpperCase() + value.slice(1);
+
+/**
+ * The "All shaders / filters / caption styles" grid: vibe chips (All first,
+ * then by count) that narrow a grid of preview tiles. Each tile plays on hover.
+ */
+export function LibraryGrid({
+ items,
+ kind,
+}: {
+ items: LibraryItem[];
+ kind: LibraryKind;
+}) {
+ const [vibe, setVibe] = useState<string | null>(null);
+ const [hovered, setHovered] = useState<string | null>(null);
+
+ // Vibes by count, ties in the order they first appear in the sidebar.
+ const vibes = useMemo(() => {
+ const counts = new Map<string, number>();
+ for (const item of items) {
+ if (item.vibe) counts.set(item.vibe, (counts.get(item.vibe) ?? 0) + 1);
+ }
+ return [...counts].sort((a, b) => b[1] - a[1]);
+ }, [items]);
+
+ const shown = vibe ? items.filter((item) => item.vibe === vibe) : items;
+ const wide = kind === "filter";
+
+ const chip = (active: boolean) =>
+ cn(
+ "text-small leading-5 max-sm:h-11 max-sm:rounded-control-sm max-sm:px-3.5",
+ !active && "bg-secondary hover:bg-[#dcdde0]",
+ );
+
+ return (
+ <>
+ <fieldset className="-mx-5 flex min-w-0 gap-2 overflow-x-auto border-0 px-5 py-1 [scrollbar-width:none] sm:mx-0 sm:flex-wrap sm:px-0">
+ <legend className="sr-only">Filter by vibe</legend>
+ <FilterChip
+ active={vibe === null}
+ count={items.length}
+ onClick={() => setVibe(null)}
+ className={chip(vibe === null)}
+ >
+ All
+ </FilterChip>
+ {vibes.map(([name, count]) => (
+ <FilterChip
+ key={name}
+ active={vibe === name}
+ count={count}
+ onClick={() => setVibe(vibe === name ? null : name)}
+ className={chip(vibe === name)}
+ >
+ {capitalize(name)}
+ </FilterChip>
+ ))}
+ </fieldset>
+ <ul
+ className={cn(
+ "grid grid-cols-2 gap-2.5 sm:gap-3.5",
+ wide ? "sm:grid-cols-2" : "sm:grid-cols-3",
+ )}
+ >
+ {shown.map((item) => (
+ <li key={item.slug}>
+ <Link
+ href={item.url}
+ onPointerEnter={() => setHovered(item.slug)}
+ onPointerLeave={() => setHovered(null)}
+ onFocus={() => setHovered(item.slug)}
+ onBlur={() => setHovered(null)}
+ className="group/tile flex h-full flex-col rounded-capsule bg-surface px-[5px] pt-[5px] pb-3 shadow-[0_0_0_1px_var(--color-hairline)] outline-none transition-shadow duration-150 hover:shadow-[0_0_0_1px_var(--color-divider)] focus-visible:ring-3 focus-visible:ring-ring sm:rounded-cta sm:p-1.5"
+ >
+ <span
+ className={cn(
+ "relative block overflow-hidden rounded-[13px] bg-dark-surface sm:rounded-[10px]",
+ wide ? "aspect-video" : "aspect-[222/140]",
+ )}
+ >
+ {kind === "caption" && (
+ // biome-ignore lint/performance/noImgElement: decorative footage under a transparent player
+ <img
+ src={
+ CAPTION_PHOTOS[
+ items.indexOf(item) % CAPTION_PHOTOS.length
+ ]
+ }
+ alt=""
+ loading="lazy"
+ className="absolute inset-0 size-full object-cover"
+ />
+ )}
+ {kind === "caption" && (
+ <span
+ aria-hidden="true"
+ className="absolute inset-0 bg-[linear-gradient(180deg,#0e101240_0%,#0e1012b3_100%)]"
+ />
+ )}
+ <TilePreview
+ slug={item.slug}
+ kind={kind}
+ playing={hovered === item.slug}
+ />
+ </span>
+ <span
+ className={cn(
+ "flex flex-col gap-0.5 px-[7px] pt-2.5 sm:flex-row sm:items-center sm:justify-between sm:gap-3 sm:px-2 sm:pt-0",
+ wide ? "sm:h-11" : "sm:h-10",
+ )}
+ >
+ <span className="text-[15px] leading-5 font-medium text-foreground sm:text-small">
+ {item.title}
+ </span>
+ {item.vibe && (
+ <span className="text-caption leading-[18px] text-subtle sm:leading-4">
+ {item.vibe}
+ </span>
+ )}
+ </span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </>
+ );
+}
diff --git a/components/docs/index/libraries/registry-hero-player.tsx b/components/docs/index/libraries/registry-hero-player.tsx
new file mode 100644
index 00000000..2e0e94a4
--- /dev/null
+++ b/components/docs/index/libraries/registry-hero-player.tsx
@@ -0,0 +1,28 @@
+"use client";
+
+import registry from "@/registry/__index__";
+import { previewManifest } from "@/registry/__manifest__";
+import { HeroPlayer } from "./hero-player";
+
+/** Hero preview of a registry component with its manifest defaults. */
+export function RegistryHeroPlayer({
+ slug,
+ inputProps,
+}: {
+ slug: string;
+ /** Overrides on top of the component's preview defaults. */
+ inputProps?: Record<string, unknown>;
+}) {
+ const entry = registry[slug];
+ const preview = previewManifest[slug];
+ if (!entry || !preview) return null;
+ return (
+ <HeroPlayer
+ load={entry.load}
+ inputProps={{ ...preview.defaults, ...inputProps }}
+ durationInFrames={preview.durationInFrames}
+ fps={preview.fps}
+ stillFrame={Math.round(preview.durationInFrames * 0.45)}
+ />
+ );
+}
diff --git a/components/docs/index/libraries/runtime-command.tsx b/components/docs/index/libraries/runtime-command.tsx
new file mode 100644
index 00000000..7d9dc4f8
--- /dev/null
+++ b/components/docs/index/libraries/runtime-command.tsx
@@ -0,0 +1,19 @@
+import type { ReactNode } from "react";
+
+/** A one-line prerequisite: a sentence followed by the command it asks for. */
+export function RuntimeCommand({
+ command,
+ children,
+}: {
+ command: string;
+ children: ReactNode;
+}) {
+ return (
+ <div className="not-prose mt-4 flex flex-wrap items-center gap-2.5 pl-1 text-small text-muted-foreground [&_p]:m-0">
+ {children}
+ <code className="flex h-[30px] shrink-0 items-center rounded-tile bg-capsule px-2.5 font-mono text-mono leading-4 text-body">
+ {command}
+ </code>
+ </div>
+ );
+}
diff --git a/components/docs/index/libraries/shader-hero.tsx b/components/docs/index/libraries/shader-hero.tsx
new file mode 100644
index 00000000..44a1e90b
--- /dev/null
+++ b/components/docs/index/libraries/shader-hero.tsx
@@ -0,0 +1,61 @@
+import { previewManifest } from "@/registry/__manifest__";
+import { loadDocsSource } from "../data";
+import { HeroPill, HeroTag } from "./hero-pill";
+import { getLibraryItems } from "./library-data";
+import { RegistryHeroPlayer } from "./registry-hero-player";
+
+/**
+ * Shaders overview hero: one shader running full-bleed with a line of copy on
+ * top, to show the shader is only the backdrop.
+ */
+export async function ShaderHero({
+ name,
+ props,
+ title,
+ subtitle,
+ tags = [],
+}: {
+ /** Registry name of the shader that runs behind the copy. */
+ name: string;
+ /** Shader props on top of its preview defaults. */
+ props?: Record<string, unknown>;
+ title: string;
+ subtitle: string;
+ tags?: string[];
+}) {
+ await loadDocsSource();
+ const count = getLibraryItems("/docs/shaders").length;
+ const preview = previewManifest[name];
+
+ return (
+ <figure className="not-prose relative mt-2 flex h-[340px] flex-col justify-between gap-7 overflow-hidden rounded-card bg-dark-surface p-3.5 sm:h-80 sm:p-5">
+ <RegistryHeroPlayer slug={name} inputProps={props} />
+ <span
+ aria-hidden="true"
+ className="pointer-events-none absolute inset-0 bg-[linear-gradient(180deg,#0e101200_40%,#0e10128c_100%)]"
+ />
+ <div className="relative flex items-center justify-between gap-2">
+ <HeroTag mono>{name}</HeroTag>
+ {preview && (
+ <HeroTag className="text-[#fafafabf] max-sm:text-caption">
+ {preview.durationInFrames} frames, {preview.fps} fps
+ </HeroTag>
+ )}
+ </div>
+ <figcaption className="relative flex flex-col items-center gap-2 text-center">
+ <span className="text-[32px] leading-9 font-medium tracking-heading text-white sm:text-[44px] sm:leading-[48px]">
+ {title}
+ </span>
+ <span className="text-[15px] leading-[22px] text-white/78 sm:text-ui sm:leading-6">
+ {subtitle}
+ </span>
+ </figcaption>
+ <div className="relative flex flex-wrap gap-2">
+ <HeroPill lead>{count} shaders</HeroPill>
+ {tags.map((tag) => (
+ <HeroPill key={tag}>{tag}</HeroPill>
+ ))}
+ </div>
+ </figure>
+ );
+}
diff --git a/components/docs/index/libraries/tile-preview.tsx b/components/docs/index/libraries/tile-preview.tsx
new file mode 100644
index 00000000..139d5361
--- /dev/null
+++ b/components/docs/index/libraries/tile-preview.tsx
@@ -0,0 +1,84 @@
+"use client";
+
+import { Player, type PlayerRef } from "@remotion/player";
+import { useEffect, useRef } from "react";
+import { usePrefersReducedMotion } from "@/lib/use-prefers-reduced-motion";
+import registry from "@/registry/__index__";
+import { previewManifest } from "@/registry/__manifest__";
+import { FILTER_PHOTO_LOADERS } from "./filter-photo-scenes";
+import { useInView } from "./use-in-view";
+
+export type LibraryKind = "shader" | "filter" | "caption";
+
+/**
+ * A gallery tile's preview: a paused Remotion still that plays while the tile
+ * is hovered or focused (never under reduced motion, where the still stays).
+ * The player only exists while the tile is near the viewport, which keeps a
+ * long grid of WebGL shaders under the browser's context limit. Covers its
+ * box at 16:9, cropping the sides of narrower tiles.
+ */
+export function TilePreview({
+ slug,
+ kind,
+ playing,
+}: {
+ slug: string;
+ kind: LibraryKind;
+ playing: boolean;
+}) {
+ const boxRef = useRef<HTMLDivElement>(null);
+ const playerRef = useRef<PlayerRef>(null);
+ const inView = useInView(boxRef);
+ const reduced = usePrefersReducedMotion();
+ const preview = previewManifest[slug];
+ const load =
+ (kind === "filter" ? FILTER_PHOTO_LOADERS[slug] : undefined) ??
+ registry[slug]?.load;
+ const still = preview ? Math.round(preview.durationInFrames * 0.45) : 0;
+
+ useEffect(() => {
+ const player = playerRef.current;
+ if (!inView || !player) return;
+ if (playing && !reduced) {
+ player.play();
+ } else {
+ player.pause();
+ player.seekTo(still);
+ }
+ }, [playing, reduced, still, inView]);
+
+ const backdrop =
+ kind === "shader" && preview?.previewBackdrop?.type === "color"
+ ? preview.previewBackdrop.value
+ : undefined;
+
+ return (
+ <div
+ ref={boxRef}
+ className="absolute inset-0"
+ style={{ background: backdrop }}
+ >
+ {inView && preview && load && (
+ <div className="absolute top-0 left-1/2 aspect-video h-full -translate-x-1/2">
+ <Player
+ ref={playerRef}
+ lazyComponent={load}
+ inputProps={preview.defaults}
+ durationInFrames={preview.durationInFrames}
+ fps={preview.fps}
+ compositionWidth={preview.compositionWidth}
+ compositionHeight={preview.compositionHeight}
+ initialFrame={still}
+ style={{ width: "100%", height: "100%", background: "transparent" }}
+ controls={false}
+ clickToPlay={false}
+ loop
+ initiallyMuted
+ numberOfSharedAudioTags={0}
+ acknowledgeRemotionLicense
+ />
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/components/docs/index/libraries/transcript-sources.tsx b/components/docs/index/libraries/transcript-sources.tsx
new file mode 100644
index 00000000..e078ae6c
--- /dev/null
+++ b/components/docs/index/libraries/transcript-sources.tsx
@@ -0,0 +1,52 @@
+export type TranscriptSource = {
+ title: string;
+ body: string;
+ /** Package or helper that produces the Caption[] from this source. */
+ code: string;
+};
+
+/** Captions overview: the speech-to-text sources that feed a caption. */
+export function TranscriptSources({
+ title,
+ note,
+ sources,
+}: {
+ title: string;
+ note?: string;
+ sources: TranscriptSource[];
+}) {
+ return (
+ <div className="not-prose mt-4 flex flex-col rounded-card border border-hairline bg-surface p-2">
+ <div className="flex min-h-11 flex-wrap items-center justify-between gap-x-4 gap-y-0.5 px-3 py-2">
+ <span className="text-[15px] leading-[22px] font-medium text-foreground">
+ {title}
+ </span>
+ {note && (
+ <span className="text-caption leading-4 text-muted-foreground">
+ {note}
+ </span>
+ )}
+ </div>
+ <ul>
+ {sources.map((source) => (
+ <li
+ key={source.title}
+ className="flex flex-col gap-2 border-t border-hairline px-3 py-3 sm:min-h-[60px] sm:flex-row sm:items-center sm:gap-4 sm:py-2"
+ >
+ <span className="flex grow flex-col gap-0.5">
+ <span className="text-small font-medium text-foreground">
+ {source.title}
+ </span>
+ <span className="text-caption leading-[18px] text-muted-foreground">
+ {source.body}
+ </span>
+ </span>
+ <code className="flex h-[30px] w-fit shrink-0 items-center rounded-tile bg-surface-muted px-2.5 font-mono text-mono leading-4 text-body">
+ {source.code}
+ </code>
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+}
diff --git a/components/docs/index/libraries/use-in-view.ts b/components/docs/index/libraries/use-in-view.ts
new file mode 100644
index 00000000..8e5e942f
--- /dev/null
+++ b/components/docs/index/libraries/use-in-view.ts
@@ -0,0 +1,24 @@
+"use client";
+
+import { type RefObject, useEffect, useState } from "react";
+
+/** True while the element is within `margin` of the viewport. */
+export function useInView(
+ ref: RefObject<Element | null>,
+ margin = "100px",
+): boolean {
+ const [inView, setInView] = useState(false);
+
+ useEffect(() => {
+ const node = ref.current;
+ if (!node) return;
+ const observer = new IntersectionObserver(
+ ([entry]) => setInView(entry.isIntersecting),
+ { rootMargin: margin },
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, [ref, margin]);
+
+ return inView;
+}
diff --git a/components/docs/index/new-tag.tsx b/components/docs/index/new-tag.tsx
new file mode 100644
index 00000000..c5563446
--- /dev/null
+++ b/components/docs/index/new-tag.tsx
@@ -0,0 +1,10 @@
+import type { ReactNode } from "react";
+
+/** Small fuchsia "New" / "6 new" tag next to a title. */
+export function NewTag({ children }: { children: ReactNode }) {
+ return (
+ <span className="shrink-0 rounded-tag bg-primary-tint px-1.5 py-0.5 text-micro leading-[14px] font-medium text-primary-strong dark:text-primary-soft">
+ {children}
+ </span>
+ );
+}
diff --git a/components/docs/index/primitives/atom-cards.tsx b/components/docs/index/primitives/atom-cards.tsx
new file mode 100644
index 00000000..15d3dc75
--- /dev/null
+++ b/components/docs/index/primitives/atom-cards.tsx
@@ -0,0 +1,85 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { LandingButton } from "@/app/(home)/components/landing/ui/landing-button";
+import { IndexSection } from "../index-section";
+
+/**
+ * "Two kinds of atom" header: the MDX heading + lead (children) with a link to
+ * the full concepts page beside the heading. The cards follow in `AtomCards`.
+ */
+export function AtomsSection({
+ concepts,
+ children,
+}: {
+ concepts: string;
+ children: ReactNode;
+}) {
+ return (
+ <IndexSection heading={children} className="relative">
+ <LandingButton
+ href={concepts}
+ variant="secondary"
+ arrow="→"
+ className="h-11 w-full rounded-[10px] px-3 text-small font-normal sm:absolute sm:top-0 sm:right-0 sm:h-8 sm:w-auto [&>span:last-child]:text-foreground"
+ >
+ Read concepts
+ </LandingButton>
+ </IndexSection>
+ );
+}
+
+export function AtomCards({ children }: { children: ReactNode }) {
+ return (
+ <div data-not-typeset className="not-prose mt-5 grid gap-3 sm:grid-cols-2">
+ {children}
+ </div>
+ );
+}
+
+export function AtomCard({
+ title,
+ meta,
+ code,
+ items,
+ children,
+}: {
+ title: string;
+ /** Short note on how timing reaches it, e.g. "Snap or smooth". */
+ meta: string;
+ /** One-line example of how it is driven. */
+ code: string;
+ /** remocn-ui component names of this shape. */
+ items: string[];
+ children: ReactNode;
+}) {
+ return (
+ <div className="flex flex-col gap-3.5 rounded-card border border-hairline bg-surface p-5">
+ <div className="flex items-center justify-between gap-3">
+ <h3 className="text-[18px] leading-6 font-medium text-foreground">
+ {title}
+ </h3>
+ <span className="text-caption leading-4 text-muted-foreground">
+ {meta}
+ </span>
+ </div>
+ <div className="text-small leading-[22px] text-body [&_code]:font-mono [&_code]:text-[0.9em] [&_p]:m-0">
+ {children}
+ </div>
+ <code className="flex h-10 items-center overflow-x-auto rounded-control-sm bg-surface-muted px-3 font-mono text-caption leading-4 whitespace-nowrap text-foreground">
+ {code}
+ </code>
+ <ul className="flex flex-wrap gap-1.5">
+ {items.map((name) => (
+ <li key={name}>
+ <Link
+ href={`/docs/ui/components/${name}`}
+ className="flex h-7 items-center rounded-tile bg-secondary px-2.5 text-small text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-3 focus-visible:ring-ring dark:hover:bg-[#33363b]"
+ >
+ {name}
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </div>
+ );
+}
diff --git a/components/docs/index/primitives/block-art.tsx b/components/docs/index/primitives/block-art.tsx
new file mode 100644
index 00000000..bfb694a4
--- /dev/null
+++ b/components/docs/index/primitives/block-art.tsx
@@ -0,0 +1,234 @@
+import type { ReactNode } from "react";
+
+/**
+ * Still artwork for the block tiles, keyed by registry name. Blocks are dark
+ * scenes, so these use fixed colours that read the same in both themes.
+ */
+const CURSOR_PATH = "M4 3l15 7.5-6.5 1.8L9.5 19Z";
+const CHECK_PATH = "m5 12.5 4.5 4.5L19 7.5";
+const bubble = "flex h-7 shrink-0 items-center px-3 text-micro leading-[14px]";
+
+export const BLOCK_ART: Record<string, { bg: string; art: ReactNode }> = {
+ "chat-flow": {
+ bg: "bg-[#0e1012]",
+ art: (
+ <span className="flex size-full flex-col justify-center gap-[7px] px-10">
+ <span
+ className={`${bubble} self-start rounded-control bg-[#2a2e31] text-[#fafafa]`}
+ >
+ Did the new build ship?
+ </span>
+ <span
+ className={`${bubble} self-end rounded-control bg-[#fafafa] text-[#0e1012]`}
+ >
+ Live since 9:40, all green
+ </span>
+ <span className="flex h-7 items-center gap-1 self-start rounded-control bg-[#2a2e31] px-3">
+ <span className="size-1.5 rounded-full bg-[#9aa3a7]" />
+ <span className="size-1.5 rounded-full bg-[#fafafa]" />
+ <span className="size-1.5 rounded-full bg-[#9aa3a7]" />
+ </span>
+ </span>
+ ),
+ },
+ "telegram-chat-flow": {
+ bg: "bg-[#17212b]",
+ art: (
+ <span className="flex size-full flex-col justify-center gap-[7px] px-10">
+ <span
+ className={`${bubble} self-start rounded-t-control-sm rounded-br-control-sm rounded-bl-[4px] bg-[#182533] text-[#fafafa]`}
+ >
+ Can you send the deck?
+ </span>
+ <span
+ className={`${bubble} gap-1.5 self-end rounded-t-control-sm rounded-br-[4px] rounded-bl-control-sm bg-[#2b5278] pr-2.5 text-[#fafafa]`}
+ >
+ Sent, check your inbox
+ <svg
+ viewBox="0 0 28 20"
+ className="h-2.5 w-3.5 fill-none stroke-[#6ab3f3] stroke-[2.5] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d="m2 10 5 5L17 4M11 14l1.5 1.5L23 4" />
+ </svg>
+ </span>
+ <span className="flex h-[22px] items-center gap-1 self-end rounded-[11px] bg-[#22303e] px-2 text-micro leading-[14px] text-[#fafafa]">
+ <svg viewBox="0 0 24 24" className="size-[11px] fill-[#f87171]">
+ <path d="M12 20s-7.5-4.6-7.5-10A4.5 4.5 0 0 1 12 7a4.5 4.5 0 0 1 7.5 3c0 5.4-7.5 10-7.5 10Z" />
+ </svg>
+ 2
+ </span>
+ </span>
+ ),
+ },
+ "imessage-chat-flow": {
+ bg: "bg-black",
+ art: (
+ <span className="flex size-full flex-col justify-center gap-1.5 px-10">
+ <span
+ className={`${bubble} self-start rounded-control bg-[#3a3a3c] text-white`}
+ >
+ Dinner at 8?
+ </span>
+ <span
+ className={`${bubble} self-end rounded-control bg-[#0a84ff] text-white`}
+ >
+ Perfect, I will book it
+ </span>
+ <span className="self-end text-[9px] leading-3 text-[#8e8e93]">
+ Delivered
+ </span>
+ </span>
+ ),
+ },
+ "signup-flow": {
+ bg: "bg-[#0e1012]",
+ art: (
+ <span className="relative flex size-full items-center justify-center">
+ <span className="flex w-[168px] flex-col gap-1.5 rounded-control-sm bg-white p-3 text-[9px] leading-3 text-[#0e1012]">
+ <span className="text-micro leading-[14px] font-medium">
+ Create your account
+ </span>
+ <span className="flex h-[22px] items-center rounded-tag border border-[#e4e5e7] px-[7px]">
+ </span>
+ <span className="flex h-[22px] items-center rounded-tag border-[1.5px] border-[#0e1012] px-[7px]">
+ ••••••••
+ </span>
+ <span className="flex h-6 items-center justify-center rounded-tag bg-[#0e1012] text-[#fafafa]">
+ Sign up
+ </span>
+ </span>
+ <svg
+ viewBox="0 0 24 24"
+ className="absolute top-[112px] left-[calc(50%+53px)] size-[18px] fill-white stroke-[#0e1012] stroke-[1.5] [stroke-linejoin:round]"
+ >
+ <path d={CURSOR_PATH} />
+ </svg>
+ </span>
+ ),
+ },
+ "checkout-flow": {
+ bg: "bg-[#0e1012]",
+ art: (
+ <span className="flex size-full items-center justify-center">
+ <span className="flex w-44 flex-col gap-1.5 rounded-control-sm bg-white p-3 text-[9px] leading-3 text-[#0e1012]">
+ <span className="flex gap-0.5 rounded-[7px] bg-[#f4f4f5] p-0.5">
+ <span className="flex h-[18px] grow basis-0 items-center justify-center text-[#5f6b70]">
+ Monthly
+ </span>
+ <span className="flex h-[18px] grow basis-0 items-center justify-center rounded-[5px] bg-white shadow-[0_1px_2px_rgb(14_16_18/12%)]">
+ Yearly
+ </span>
+ </span>
+ <span className="flex h-[22px] items-center rounded-tag border border-[#e4e5e7] px-[7px] tabular-nums">
+ 4242 4242 4242 4242
+ </span>
+ <span className="flex items-center gap-[5px] text-[#2a2e31]">
+ <span className="flex size-[11px] items-center justify-center rounded-[3px] bg-[#0e1012]">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-[7px] fill-none stroke-white stroke-4 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d={CHECK_PATH} />
+ </svg>
+ </span>
+ I agree to the terms
+ </span>
+ <span className="flex h-6 items-center justify-center rounded-tag bg-[#0e1012] text-[#fafafa]">
+ Pay $96
+ </span>
+ </span>
+ </span>
+ ),
+ },
+ "onboarding-stepper-flow": {
+ bg: "bg-[#0e1012]",
+ art: (
+ <span className="flex size-full flex-col items-center justify-center gap-3">
+ <span className="flex items-center gap-1.5 text-[10px] leading-3 font-medium">
+ <span className="flex size-5 items-center justify-center rounded-full bg-[#fafafa]">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-2.5 fill-none stroke-[#0e1012] stroke-[3.5] [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d={CHECK_PATH} />
+ </svg>
+ </span>
+ <span className="h-1 w-7 rounded-[2px] bg-[#fafafa]" />
+ <span className="flex size-5 items-center justify-center rounded-full bg-[#fafafa] text-[#0e1012]">
+ 2
+ </span>
+ <span className="h-1 w-7 rounded-[2px] bg-[#2a2e31]" />
+ <span className="flex size-5 items-center justify-center rounded-full bg-[#2a2e31] font-normal text-[#9aa3a7]">
+ 3
+ </span>
+ </span>
+ <span className="flex w-[168px] flex-col gap-1.5 rounded-[10px] bg-[#1a1c1e] p-2.5">
+ <span className="text-[10px] leading-3 font-medium text-[#fafafa]">
+ Name your workspace
+ </span>
+ <span className="flex h-[22px] items-center rounded-tag bg-[#2a2e31] px-[7px] text-[9px] leading-3 text-[#fafafa]">
+ Northwind Studio
+ </span>
+ </span>
+ </span>
+ ),
+ },
+ "ai-prompt-flow": {
+ bg: "bg-[#0e1012]",
+ art: (
+ <span className="flex size-full flex-col items-center justify-center gap-2">
+ <span className="flex h-[34px] w-[220px] items-center gap-2 rounded-[10px] bg-[#1a1c1e] pr-[5px] pl-2.5">
+ <span className="grow text-[10px] leading-3 text-[#fafafa]">
+ Summarize this week's releases
+ </span>
+ <span className="flex size-6 items-center justify-center rounded-[7px] bg-[#fafafa]">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-3 fill-none stroke-3 [stroke-linecap:round]"
+ >
+ <circle cx="12" cy="12" r="8" className="stroke-[#0e1012]/25" />
+ <path d="M12 4a8 8 0 0 1 8 8" className="stroke-[#0e1012]" />
+ </svg>
+ </span>
+ </span>
+ <span className="flex w-[220px] flex-col gap-[5px] rounded-[10px] bg-[#1a1c1e] p-2.5">
+ <span className="h-[7px] w-[180px] rounded-[4px] bg-[#2a2e31]" />
+ <span className="h-[7px] w-[150px] rounded-[4px] bg-[#2a2e31]" />
+ <span className="h-[7px] w-[110px] rounded-[4px] bg-[#2a2e31]" />
+ </span>
+ </span>
+ ),
+ },
+ "settings-toggle-flow": {
+ bg: "bg-[#0e1012]",
+ art: (
+ <span className="flex size-full items-center justify-center">
+ <span className="flex w-[236px] gap-3 rounded-control-sm bg-white p-3 text-[9px] leading-3 text-[#0e1012]">
+ <span className="flex w-[62px] shrink-0 flex-col gap-1.5">
+ <span className="font-medium">General</span>
+ <span className="text-[#5f6b70]">Billing</span>
+ <span className="text-[#5f6b70]">Team</span>
+ </span>
+ <span className="flex grow flex-col gap-2">
+ <span className="flex items-center justify-between">
+ Notifications
+ <span className="flex h-3.5 w-6 justify-end rounded-[7px] bg-[#0e1012] p-0.5">
+ <span className="size-2.5 rounded-full bg-white" />
+ </span>
+ </span>
+ <span className="flex items-center justify-between">
+ Region
+ <span className="flex h-4 items-center rounded-[4px] border border-[#e4e5e7] px-[5px] text-[8px] leading-[10px]">
+ eu-west
+ </span>
+ </span>
+ <span className="flex h-[18px] items-center self-end rounded-[5px] bg-[#0e1012] px-2 text-[8px] leading-[10px] text-[#fafafa]">
+ Save
+ </span>
+ </span>
+ </span>
+ </span>
+ ),
+ },
+};
diff --git a/components/docs/index/primitives/component-art.tsx b/components/docs/index/primitives/component-art.tsx
new file mode 100644
index 00000000..2d4cdef7
--- /dev/null
+++ b/components/docs/index/primitives/component-art.tsx
@@ -0,0 +1,160 @@
+import type { ReactNode } from "react";
+
+/**
+ * Still artwork for the featured primitive tiles, keyed by registry name.
+ * Decoration only: tokens keep it right in light and dark.
+ */
+const CURSOR_PATH = "M4 3l15 7.5-6.5 1.8L9.5 19Z";
+const CHECK_PATH = "m5 12.5 4.5 4.5L19 7.5";
+const popover =
+ "bg-surface shadow-[0_4px_14px_rgb(14_16_18/10%),0_0_0_1px_rgb(14_16_18/6%)] dark:shadow-[0_4px_14px_rgb(0_0_0/40%),0_0_0_1px_var(--color-hairline)]";
+
+export const COMPONENT_ART: Record<string, ReactNode> = {
+ cursor: (
+ <span className="relative flex size-full items-center justify-center">
+ <span className="flex h-[30px] items-center rounded-[9px] bg-secondary px-3.5 text-mono leading-4 text-foreground">
+ Get started
+ </span>
+ <span className="absolute top-[58px] left-[calc(50%+11px)] size-[26px] rounded-full border-2 border-foreground/18" />
+ <svg
+ viewBox="0 0 24 24"
+ className="absolute top-[66px] left-[calc(50%+19px)] size-[22px] fill-foreground stroke-surface stroke-[1.5] [stroke-linejoin:round]"
+ >
+ <path d={CURSOR_PATH} />
+ </svg>
+ </span>
+ ),
+ "command-menu": (
+ <span className="flex size-full items-center justify-center">
+ <span
+ className={`flex w-32 flex-col gap-[3px] rounded-[10px] p-[5px] ${popover}`}
+ >
+ <span className="flex h-5 items-center gap-[5px] px-[5px] text-[10px] leading-3 text-foreground">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-[9px] fill-none stroke-muted-foreground stroke-[2.5] [stroke-linecap:round]"
+ >
+ <circle cx="11" cy="11" r="6.5" />
+ <path d="m16 16 4 4" />
+ </svg>
+ dep
+ <span className="h-2.5 w-[1.5px] bg-foreground" />
+ </span>
+ <span className="flex h-[18px] items-center rounded-[5px] bg-surface-muted px-1.5 text-[10px] leading-3 text-foreground">
+ Deploy to production
+ </span>
+ <span className="flex h-[18px] items-center px-1.5 text-[10px] leading-3 text-muted-foreground">
+ Deploy preview
+ </span>
+ <span className="flex h-[18px] items-center px-1.5 text-[10px] leading-3 text-muted-foreground">
+ Dependencies
+ </span>
+ </span>
+ </span>
+ ),
+ toast: (
+ <span className="flex size-full flex-col items-center justify-end pb-3.5">
+ <span
+ className={`flex h-9 w-[134px] items-center gap-[7px] rounded-[10px] px-[9px] ${popover}`}
+ >
+ <span className="flex size-4 shrink-0 items-center justify-center rounded-tile bg-success">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-2.5 fill-none stroke-white stroke-3 [stroke-linecap:round] [stroke-linejoin:round]"
+ >
+ <path d={CHECK_PATH} />
+ </svg>
+ </span>
+ <span className="flex flex-col">
+ <span className="text-[10px] leading-3 font-medium text-foreground">
+ Changes saved
+ </span>
+ <span className="text-[9px] leading-[11px] text-muted-foreground">
+ Synced just now
+ </span>
+ </span>
+ </span>
+ </span>
+ ),
+ dialog: (
+ <span className="flex size-full items-center justify-center bg-[#d9dadd] dark:bg-[#26292d]">
+ <span className="flex w-[124px] flex-col gap-1.5 rounded-[10px] bg-surface p-2.5 shadow-[0_6px_18px_rgb(14_16_18/14%)]">
+ <span className="text-[10px] leading-3 font-medium text-foreground">
+ Delete project?
+ </span>
+ <span className="text-[9px] leading-[11px] text-muted-foreground">
+ This cannot be undone.
+ </span>
+ <span className="flex justify-end gap-1 pt-0.5 text-[9px] leading-[11px]">
+ <span className="flex h-[18px] items-center rounded-[5px] bg-secondary px-[7px] text-foreground">
+ Cancel
+ </span>
+ <span className="flex h-[18px] items-center rounded-[5px] bg-foreground px-[7px] text-background">
+ Delete
+ </span>
+ </span>
+ </span>
+ </span>
+ ),
+ switch: (
+ <span className="flex size-full flex-col items-center justify-center gap-2.5">
+ <span className="flex items-center gap-2.5">
+ <span className="flex h-6 w-10 items-center justify-end rounded-control-sm bg-foreground p-[3px]">
+ <span className="size-[18px] rounded-full bg-surface" />
+ </span>
+ <span className="w-[72px] text-micro leading-[14px] text-foreground">
+ Auto deploy
+ </span>
+ </span>
+ <span className="flex items-center gap-2.5">
+ <span className="flex h-6 w-10 items-center rounded-control-sm bg-[#d2d4d7] p-[3px] dark:bg-[#3a3e43]">
+ <span className="size-[18px] rounded-full bg-surface" />
+ </span>
+ <span className="w-[72px] text-micro leading-[14px] text-muted-foreground">
+ Email digest
+ </span>
+ </span>
+ </span>
+ ),
+ slider: (
+ <span className="flex size-full flex-col items-center justify-center gap-2">
+ <span className="flex w-[120px] justify-between text-micro leading-[14px]">
+ <span className="text-foreground">Volume</span>
+ <span className="text-muted-foreground">64</span>
+ </span>
+ <span className="relative h-5 w-[120px]">
+ <span className="absolute inset-x-0 top-[5px] h-2.5 rounded-[5px] bg-[#d2d4d7] dark:bg-[#3a3e43]" />
+ <span className="absolute top-[5px] left-0 h-2.5 w-[77px] rounded-[5px] bg-foreground" />
+ <span className="absolute top-0 left-[67px] size-5 rounded-full bg-surface shadow-[0_1px_3px_rgb(14_16_18/25%),0_0_0_1px_rgb(14_16_18/8%)]" />
+ </span>
+ </span>
+ ),
+ tooltip: (
+ <span className="flex size-full flex-col items-center justify-center gap-1.5">
+ <span className="flex h-[22px] items-center rounded-tag bg-foreground px-2 text-[10px] leading-3 text-background">
+ Copy to clipboard
+ </span>
+ <span className="flex size-8 items-center justify-center rounded-[9px] bg-secondary">
+ <svg
+ viewBox="0 0 24 24"
+ className="size-3.5 fill-none stroke-foreground stroke-[1.8]"
+ >
+ <rect x="8" y="8" width="12" height="12" rx="2.5" />
+ <path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" />
+ </svg>
+ </span>
+ </span>
+ ),
+ "typing-indicator": (
+ <span className="flex size-full flex-col items-start justify-center gap-1.5 pl-[22px]">
+ <span className="flex h-[26px] items-center rounded-[13px] bg-surface px-2.5 text-[10px] leading-3 text-foreground">
+ Is the build green?
+ </span>
+ <span className="flex h-[26px] items-center gap-1 rounded-[13px] bg-surface px-2.5">
+ <span className="size-1.5 rounded-full bg-subtle-line" />
+ <span className="size-1.5 -translate-y-[3px] rounded-full bg-foreground" />
+ <span className="size-1.5 rounded-full bg-subtle-line" />
+ </span>
+ </span>
+ ),
+};
diff --git a/components/docs/index/primitives/data.ts b/components/docs/index/primitives/data.ts
new file mode 100644
index 00000000..7a383623
--- /dev/null
+++ b/components/docs/index/primitives/data.ts
@@ -0,0 +1,29 @@
+import { type DocEntry, getComponentEntries, getPage } from "../data";
+
+export type UiEntry = DocEntry & {
+ slug: string;
+ /** Frontmatter `length`: frames of own motion, or "state-driven". */
+ length?: number | string;
+};
+
+/**
+ * remocn-ui pages under one sub-folder of the Primitives tab
+ * ("components" or "blocks"), in sidebar order, with their `length`.
+ */
+export function getUiEntries(folder: "components" | "blocks"): UiEntry[] {
+ const prefix = `/docs/ui/${folder}/`;
+ return getComponentEntries("/docs/ui")
+ .filter((entry) => entry.url.startsWith(prefix))
+ .map((entry) => ({
+ ...entry,
+ slug: entry.url.slice(prefix.length),
+ length: getPage(entry.url)?.data.length,
+ }));
+}
+
+/** "CheckoutFlow" → "Checkout Flow"; titles that already have spaces pass. */
+export function spacedTitle(title: string): string {
+ return title.includes(" ")
+ ? title
+ : title.replace(/([a-z])([A-Z])/g, "$1 $2");
+}
diff --git a/components/docs/index/primitives/install-writes.tsx b/components/docs/index/primitives/install-writes.tsx
new file mode 100644
index 00000000..982fa728
--- /dev/null
+++ b/components/docs/index/primitives/install-writes.tsx
@@ -0,0 +1,58 @@
+import uiRegistry from "@/registry/remocn-ui/registry.json";
+
+type RegistryFile = { target?: string };
+type RegistryItem = { name: string; files?: RegistryFile[] };
+
+const items = uiRegistry.items as RegistryItem[];
+
+function firstTarget(name: string): string | undefined {
+ return items.find((item) => item.name === name)?.files?.[0]?.target;
+}
+
+const FILE_ICON = "M6 3.5h8l4 4v13H6Z";
+const FOLDER_ICON =
+ "M3.5 6.5a2 2 0 0 1 2-2h4l2 2.5h7a2 2 0 0 1 2 2v8.5a2 2 0 0 1-2 2h-13a2 2 0 0 1-2-2Z";
+
+/**
+ * What `shadcn add` writes for one primitive: its component file and the
+ * shared remocn-ui core folder, both read from the registry.
+ */
+export function InstallWrites({ name }: { name: string }) {
+ const component = firstTarget(name);
+ const core = firstTarget("remocn-ui")?.replace(/[^/]+$/, "");
+ const rows = [
+ component && { path: component, icon: FILE_ICON },
+ core && { path: core, icon: FOLDER_ICON, note: "shared core" },
+ ].filter(Boolean) as { path: string; icon: string; note?: string }[];
+
+ return (
+ <ul
+ data-not-typeset
+ className="not-prose mt-3 grid gap-2 sm:grid-cols-2"
+ aria-label="Files it writes"
+ >
+ {rows.map((row) => (
+ <li
+ key={row.path}
+ className="flex h-11 min-w-0 items-center gap-2.5 rounded-control-sm border border-hairline bg-surface px-3.5"
+ >
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-muted-foreground stroke-[1.8] [stroke-linejoin:round]"
+ >
+ <path d={row.icon} />
+ </svg>
+ <code className="truncate font-mono text-mono leading-4 text-foreground">
+ {row.path}
+ </code>
+ {row.note && (
+ <span className="shrink-0 text-caption leading-4 text-muted-foreground">
+ {row.note}
+ </span>
+ )}
+ </li>
+ ))}
+ </ul>
+ );
+}
diff --git a/components/docs/index/primitives/runtime-rules.tsx b/components/docs/index/primitives/runtime-rules.tsx
new file mode 100644
index 00000000..903e9fc6
--- /dev/null
+++ b/components/docs/index/primitives/runtime-rules.tsx
@@ -0,0 +1,44 @@
+/**
+ * The chip row under "What makes this different": the browser-UI wiring a
+ * primitive never uses, struck out, then the one thing it reads.
+ */
+export function RuntimeRules({ not, only }: { not: string[]; only: string }) {
+ return (
+ <ul
+ data-not-typeset
+ className="not-prose mt-5 flex flex-wrap gap-2"
+ aria-label="What a primitive reads"
+ >
+ {not.map((name) => (
+ <li
+ key={name}
+ className="flex h-9 items-center gap-2 rounded-[10px] bg-secondary px-3.5"
+ >
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-muted-foreground stroke-2 [stroke-linecap:round]"
+ >
+ <path d="M6 6l12 12M18 6 6 18" />
+ </svg>
+ <span className="sr-only">Not</span>
+ <code className="font-mono text-caption leading-4 text-foreground">
+ {name}
+ </code>
+ </li>
+ ))}
+ <li className="flex h-9 items-center gap-2 rounded-[10px] bg-foreground px-3.5">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-3.5 shrink-0 fill-none stroke-primary-soft stroke-2 [stroke-linecap:round] [stroke-linejoin:round] dark:stroke-primary"
+ >
+ <path d="m5 12.5 4.5 4.5L19 7.5" />
+ </svg>
+ <code className="font-mono text-caption leading-4 text-background">
+ {only}
+ </code>
+ </li>
+ </ul>
+ );
+}
diff --git a/components/docs/index/primitives/timeline-demo.tsx b/components/docs/index/primitives/timeline-demo.tsx
new file mode 100644
index 00000000..77f02b71
--- /dev/null
+++ b/components/docs/index/primitives/timeline-demo.tsx
@@ -0,0 +1,157 @@
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+
+/** Still illustration of a Button's authored timeline (60 frames at 30 fps). */
+const TOTAL = 60;
+const CURRENT = 30;
+
+type Step = { at: number; label: string; state: string; button: ReactNode };
+
+const STEPS: Step[] = [
+ {
+ at: 0,
+ label: "At frame 0",
+ state: "Idle",
+ button: (
+ <span className="flex h-10 w-32 items-center justify-center rounded-control-sm bg-foreground text-small font-medium text-background">
+ Continue
+ </span>
+ ),
+ },
+ {
+ at: 12,
+ label: "At frame 12",
+ state: "Hover",
+ button: (
+ <span className="flex h-10 w-32 items-center justify-center rounded-control-sm bg-[#2a2e31] text-small font-medium text-[#fafafa] shadow-[0_0_0_4px_rgb(14_16_18/8%)] dark:bg-[#d4d7da] dark:text-[#0e1012] dark:shadow-[0_0_0_4px_rgb(255_255_255/12%)]">
+ Continue
+ </span>
+ ),
+ },
+ {
+ at: CURRENT,
+ label: "At frame 30",
+ state: "Press",
+ button: (
+ <span className="flex h-[37px] w-[120px] items-center justify-center rounded-[11px] bg-black text-caption font-medium text-[#fafafa] dark:bg-white dark:text-[#0e1012]">
+ Continue
+ </span>
+ ),
+ },
+ {
+ at: 48,
+ label: "At frame 48, duration 6",
+ state: "Loading",
+ button: (
+ <span className="flex h-10 w-32 items-center justify-center gap-2 rounded-control-sm bg-foreground text-small font-medium text-background opacity-85">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-4 fill-none stroke-[2.5] [stroke-linecap:round]"
+ >
+ <circle
+ cx="12"
+ cy="12"
+ r="8.5"
+ className="stroke-current opacity-25"
+ />
+ <path d="M12 3.5a8.5 8.5 0 0 1 8.5 8.5" className="stroke-current" />
+ </svg>
+ <span className="opacity-70">Continue</span>
+ </span>
+ ),
+ },
+];
+
+/** Horizontal position of a frame on the scrubber (8px inset each side). */
+function at(frame: number) {
+ return `calc(${frame / TOTAL} * (100% - 16px) + 8px)`;
+}
+
+export function TimelineDemo() {
+ return (
+ <figure className="not-prose mt-2 flex flex-col gap-1 rounded-card border border-hairline bg-surface-muted p-1.5">
+ <figcaption className="flex items-center justify-between gap-3 py-1.5 pr-2 pl-3">
+ <span className="text-caption font-medium text-foreground sm:text-small">
+ One button, four authored steps
+ </span>
+ <span className="shrink-0 text-mono leading-4 text-muted-foreground sm:text-caption">
+ {TOTAL} frames, 30 fps
+ </span>
+ </figcaption>
+ <ol className="grid grid-cols-2 gap-1.5 sm:grid-cols-4">
+ {STEPS.map((step) => {
+ const current = step.at === CURRENT;
+ return (
+ <li
+ key={step.at}
+ aria-current={current ? "step" : undefined}
+ className={cn(
+ "flex h-[156px] flex-col justify-between rounded-control p-3.5",
+ current
+ ? "bg-surface shadow-[0_1px_2px_rgb(14_16_18/10%),0_0_0_1px_rgb(14_16_18/4%)] dark:shadow-[0_0_0_1px_var(--color-hairline)]"
+ : "bg-surface/55",
+ )}
+ >
+ <span className="flex flex-col gap-0.5">
+ <span
+ className={cn(
+ "text-caption leading-4",
+ current ? "text-primary" : "text-muted-foreground",
+ )}
+ >
+ {step.label}
+ </span>
+ <span className="text-small font-medium text-foreground">
+ {step.state}
+ </span>
+ </span>
+ <span aria-hidden="true" className="self-center">
+ {step.button}
+ </span>
+ </li>
+ );
+ })}
+ </ol>
+ <div
+ aria-hidden="true"
+ className="flex flex-col gap-2 px-3 pt-3.5 pb-2.5"
+ >
+ <div className="relative h-7 rounded-tile bg-secondary">
+ <span
+ className="absolute inset-y-0 left-0 rounded-tile bg-[#d2d4d7] dark:bg-[#3a3e43]"
+ style={{ width: at(CURRENT) }}
+ />
+ {STEPS.filter((step) => step.at !== CURRENT).map((step) => (
+ <span
+ key={step.at}
+ className={cn(
+ "absolute top-2 h-3 w-1 -translate-x-1/2 rounded-[2px]",
+ step.at < CURRENT ? "bg-foreground" : "bg-muted-foreground",
+ )}
+ style={{ left: at(step.at) }}
+ />
+ ))}
+ <span
+ className="absolute -top-[5px] h-[38px] w-2 -translate-x-1/2 rounded-[4px] bg-primary shadow-[0_0_0_3px_var(--color-surface-muted)]"
+ style={{ left: at(CURRENT) }}
+ />
+ </div>
+ <div className="relative h-4">
+ {[0, 12, CURRENT, 48, TOTAL].map((frame) => (
+ <span
+ key={frame}
+ className={cn(
+ "absolute top-0 -translate-x-1/2 text-mono leading-4 tabular-nums",
+ frame === CURRENT ? "text-primary" : "text-muted-foreground",
+ )}
+ style={{ left: at(frame) }}
+ >
+ {frame}
+ </span>
+ ))}
+ </div>
+ </div>
+ </figure>
+ );
+}
diff --git a/components/docs/index/primitives/ui-blocks.tsx b/components/docs/index/primitives/ui-blocks.tsx
new file mode 100644
index 00000000..f77d5b9a
--- /dev/null
+++ b/components/docs/index/primitives/ui-blocks.tsx
@@ -0,0 +1,61 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { loadDocsSource } from "../data";
+import { IndexSection, indexCardLink } from "../index-section";
+import { BLOCK_ART } from "./block-art";
+import { getUiEntries, spacedTitle } from "./data";
+
+/** "Blocks": every remocn-ui block with its own length from frontmatter. */
+export async function UiBlocks({ children }: { children: ReactNode }) {
+ await loadDocsSource();
+ const entries = getUiEntries("blocks");
+
+ return (
+ <IndexSection heading={children} count={entries.length}>
+ <ul className="grid gap-3 pt-1 sm:grid-cols-2">
+ {entries.map((entry) => {
+ const art = BLOCK_ART[entry.slug];
+ return (
+ <li key={entry.slug}>
+ <Link
+ href={entry.url}
+ className={cn(
+ "flex h-full flex-col rounded-card bg-surface shadow-[0_0_0_1px_var(--color-hairline)] p-1.5",
+ indexCardLink,
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className={cn(
+ "block h-[168px] shrink-0 overflow-hidden rounded-control",
+ art?.bg ?? "bg-[#0e1012]",
+ )}
+ >
+ {art?.art}
+ </span>
+ <span className="flex flex-col gap-1 px-2.5 pt-3 pb-1">
+ <span className="flex items-center justify-between gap-3">
+ <span className="text-[15px] leading-5 font-medium text-foreground">
+ {spacedTitle(entry.title)}
+ </span>
+ {entry.length !== undefined && (
+ <span className="shrink-0 text-caption leading-4 text-muted-foreground">
+ {typeof entry.length === "number"
+ ? `${entry.length} frames`
+ : entry.length}
+ </span>
+ )}
+ </span>
+ <span className="line-clamp-2 text-caption leading-[18px] text-muted-foreground">
+ {entry.description}
+ </span>
+ </span>
+ </Link>
+ </li>
+ );
+ })}
+ </ul>
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/primitives/ui-components.tsx b/components/docs/index/primitives/ui-components.tsx
new file mode 100644
index 00000000..09e2fd64
--- /dev/null
+++ b/components/docs/index/primitives/ui-components.tsx
@@ -0,0 +1,82 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { cn } from "@/lib/utils";
+import { loadDocsSource } from "../data";
+import { IndexSection, indexCardLink } from "../index-section";
+import { COMPONENT_ART } from "./component-art";
+import { getUiEntries } from "./data";
+
+/**
+ * "Components": every remocn-ui primitive. The ones named in `featured` get a
+ * still preview tile, the rest follow as an alphabetical name grid.
+ */
+export async function UiComponents({
+ featured,
+ children,
+}: {
+ /** Registry names to show as preview tiles, in this order. */
+ featured: string[];
+ children: ReactNode;
+}) {
+ await loadDocsSource();
+ const entries = getUiEntries("components");
+ const tiles = featured
+ .map((slug) => entries.find((entry) => entry.slug === slug))
+ .filter((entry) => entry !== undefined);
+ const rest = entries
+ .filter((entry) => !featured.includes(entry.slug))
+ .sort((a, b) => a.slug.localeCompare(b.slug));
+
+ return (
+ <IndexSection heading={children} count={entries.length}>
+ <ul className="grid grid-cols-2 gap-2.5 pt-1 sm:grid-cols-4 sm:gap-3">
+ {tiles.map((entry) => (
+ <li key={entry.slug}>
+ <Link
+ href={entry.url}
+ className={cn(
+ "flex h-full flex-col rounded-cta bg-surface shadow-[0_0_0_1px_var(--color-hairline)] p-1.5 sm:h-[202px]",
+ indexCardLink,
+ )}
+ >
+ <span
+ aria-hidden="true"
+ className="block h-[116px] shrink-0 overflow-hidden rounded-[10px] bg-surface-muted"
+ >
+ {COMPONENT_ART[entry.slug]}
+ </span>
+ <span className="flex flex-col gap-0.5 px-2 pt-2.5 pb-1">
+ <span className="text-small font-medium text-foreground">
+ {entry.title}
+ </span>
+ <span className="line-clamp-3 text-mono leading-4 text-muted-foreground sm:line-clamp-2">
+ {entry.description}
+ </span>
+ </span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ {rest.length > 0 && (
+ <div className="flex flex-col gap-2.5 pt-2">
+ <p className="text-caption leading-4 text-muted-foreground">
+ And {rest.length} more, alphabetical
+ </p>
+ <ul className="grid grid-cols-2 gap-2 sm:grid-cols-4">
+ {rest.map((entry) => (
+ <li key={entry.slug}>
+ <Link
+ href={entry.url}
+ title={entry.title}
+ className="flex h-9 items-center rounded-[10px] border border-hairline bg-surface px-3 font-mono text-[13px] leading-4 text-foreground outline-none transition-colors duration-150 hover:bg-surface-muted focus-visible:ring-3 focus-visible:ring-ring"
+ >
+ <span className="truncate">{entry.slug}</span>
+ </Link>
+ </li>
+ ))}
+ </ul>
+ </div>
+ )}
+ </IndexSection>
+ );
+}
diff --git a/components/docs/index/templates/template-card.tsx b/components/docs/index/templates/template-card.tsx
new file mode 100644
index 00000000..861ffc92
--- /dev/null
+++ b/components/docs/index/templates/template-card.tsx
@@ -0,0 +1,164 @@
+import Link from "next/link";
+import type { ReactNode } from "react";
+import { CopyButton } from "@/components/docs/copy-button";
+import { cn } from "@/lib/utils";
+import { previewManifest } from "@/registry/__manifest__";
+import templatesRegistry from "@/registry/remocn-templates/registry.json";
+import { docsSource, getEntry, getPage, loadDocsSource } from "../data";
+import { TemplatePoster } from "./template-poster";
+
+type RegistryItem = { name: string; registryDependencies?: string[] };
+
+/** Docs page of a registry component, by its `component` frontmatter. */
+function componentUrl(dep: string): string | undefined {
+ const name = dep.replace("@remocn/", "");
+ return docsSource()
+ .getPages()
+ .find((page) => page.data.component === name)?.url;
+}
+
+function formatRate(fps: number): string {
+ return Number.isInteger(fps) ? String(fps) : fps.toFixed(2);
+}
+
+function formatClock(seconds: number): string {
+ const whole = Math.round(seconds);
+ return `${Math.floor(whole / 60)}:${String(whole % 60).padStart(2, "0")}`;
+}
+
+/**
+ * One template: live poster, title linking to its page, vibe tag,
+ * description, playback specs from the preview manifest, what is inside
+ * (editorial `inside` chips plus its remocn registry dependencies) and the
+ * install command. The MDX `##` heading is kept (visually hidden) so the
+ * template stays in the table of contents.
+ */
+export async function TemplateCard({
+ name,
+ inside = [],
+ still,
+ children,
+}: {
+ /** Registry name, e.g. "release-teaser". */
+ name: string;
+ inside?: string[];
+ /** Frame the poster rests on; defaults to 45% through. */
+ still?: number;
+ children: ReactNode;
+}) {
+ await loadDocsSource();
+ const url = `/docs/templates/${name}`;
+ const entry = getEntry(url);
+ const vibe = getPage(`/docs/templates/${name}`)?.data.vibe;
+ const preview = previewManifest[name];
+ const deps =
+ (templatesRegistry.items as RegistryItem[]).find(
+ (item) => item.name === name,
+ )?.registryDependencies ?? [];
+ const seconds = preview ? preview.durationInFrames / preview.fps : 0;
+ const command = `npx shadcn@latest add @remocn/${name}`;
+
+ const specs = preview
+ ? [
+ { label: "Duration", value: `${seconds.toFixed(1)} s` },
+ {
+ label: "Format",
+ value: `${preview.compositionWidth}×${preview.compositionHeight}`,
+ },
+ { label: "Frames", value: String(preview.durationInFrames) },
+ { label: "Frame rate", value: formatRate(preview.fps) },
+ ]
+ : [];
+
+ return (
+ <article
+ data-not-typeset
+ className="not-prose mt-5 flex scroll-mt-28 flex-col gap-1.5 rounded-card border border-hairline bg-surface p-1.5 [&_h2]:sr-only"
+ >
+ {children}
+ <TemplatePoster
+ name={name}
+ still={still ?? Math.round((preview?.durationInFrames ?? 0) * 0.45)}
+ duration={formatClock(seconds)}
+ />
+ <div className="flex flex-col gap-4 px-2 pt-3 pb-1 sm:flex-row sm:gap-6 sm:px-3 sm:pt-3.5 sm:pb-2">
+ <div className="flex grow flex-col gap-1.5">
+ <div className="flex items-center gap-2.5">
+ <Link
+ href={url}
+ className="rounded-tag text-[22px] leading-7 font-medium tracking-title text-foreground outline-none hover:underline hover:decoration-divider hover:underline-offset-4 focus-visible:ring-3 focus-visible:ring-ring"
+ >
+ {entry?.title ?? name}
+ </Link>
+ {vibe && (
+ <span className="flex h-[22px] items-center rounded-tag bg-surface-muted px-2 text-micro leading-[14px] text-muted-foreground capitalize">
+ {vibe}
+ </span>
+ )}
+ </div>
+ <p className="text-small leading-[22px] text-body">
+ {entry?.description}
+ </p>
+ </div>
+ <dl className="grid shrink-0 grid-cols-2 content-start gap-1.5 sm:w-[232px]">
+ {specs.map((spec) => (
+ <div
+ key={spec.label}
+ className="flex flex-col gap-0.5 rounded-[10px] bg-surface-muted px-2.5 py-2"
+ >
+ <dt className="text-caption leading-4 text-muted-foreground">
+ {spec.label}
+ </dt>
+ <dd className="text-small font-medium text-foreground tabular-nums">
+ {spec.value}
+ </dd>
+ </div>
+ ))}
+ </dl>
+ </div>
+ {inside.length + deps.length > 0 && (
+ <div className="flex flex-wrap items-center gap-1.5 px-2 pt-1 pb-2.5 sm:px-3">
+ <span className="pr-1 text-caption leading-4 text-muted-foreground">
+ Inside
+ </span>
+ {inside.map((label) => (
+ <span
+ key={label}
+ className="flex h-7 items-center rounded-tile bg-secondary px-2.5 text-caption leading-4 text-foreground"
+ >
+ {label}
+ </span>
+ ))}
+ {deps.map((dep) => {
+ const href = componentUrl(dep);
+ const chip =
+ "flex h-7 items-center rounded-tile bg-secondary px-2.5 font-mono text-mono leading-4 text-foreground";
+ return href ? (
+ <Link
+ key={dep}
+ href={href}
+ className={cn(
+ chip,
+ "outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-3 focus-visible:ring-ring dark:hover:bg-[#33363b]",
+ )}
+ >
+ {dep}
+ </Link>
+ ) : (
+ <span key={dep} className={chip}>
+ {dep}
+ </span>
+ );
+ })}
+ </div>
+ )}
+ <div className="flex min-h-[52px] items-center gap-3 rounded-control bg-surface-muted py-2 pr-2 pl-4">
+ <code className="min-w-0 grow truncate font-mono text-small text-foreground">
+ <span aria-hidden="true">$ </span>
+ {command}
+ </code>
+ <CopyButton value={command} variant="ink" />
+ </div>
+ </article>
+ );
+}
diff --git a/components/docs/index/templates/template-poster.tsx b/components/docs/index/templates/template-poster.tsx
new file mode 100644
index 00000000..96750527
--- /dev/null
+++ b/components/docs/index/templates/template-poster.tsx
@@ -0,0 +1,112 @@
+"use client";
+
+import { Player, type PlayerRef } from "@remotion/player";
+import { useEffect, useRef, useState } from "react";
+import registry from "@/registry/__index__";
+import { previewManifest } from "@/registry/__manifest__";
+
+/**
+ * A template's live Remotion player, mounted once it nears the viewport and
+ * parked on a still frame until "Play preview" is pressed. Pauses off screen.
+ */
+export function TemplatePoster({
+ name,
+ still,
+ duration,
+}: {
+ name: string;
+ /** Frame shown before playback. */
+ still: number;
+ /** "0:16" style runtime label. */
+ duration: string;
+}) {
+ const boxRef = useRef<HTMLDivElement>(null);
+ const playerRef = useRef<PlayerRef>(null);
+ const [near, setNear] = useState(false);
+ const [playing, setPlaying] = useState(false);
+ const entry = registry[name];
+ const preview = previewManifest[name];
+
+ useEffect(() => {
+ const node = boxRef.current;
+ if (!node) return;
+ const observer = new IntersectionObserver(
+ ([hit]) => {
+ if (hit.isIntersecting) setNear(true);
+ else playerRef.current?.pause();
+ },
+ { rootMargin: "400px" },
+ );
+ observer.observe(node);
+ return () => observer.disconnect();
+ }, []);
+
+ // Wire play/pause state once the player has mounted.
+ useEffect(() => {
+ const player = playerRef.current;
+ if (!near || !player) return;
+ const onPlay = () => setPlaying(true);
+ const onPause = () => setPlaying(false);
+ player.addEventListener("play", onPlay);
+ player.addEventListener("pause", onPause);
+ return () => {
+ player.removeEventListener("play", onPlay);
+ player.removeEventListener("pause", onPause);
+ };
+ }, [near]);
+
+ const toggle = () => {
+ const player = playerRef.current;
+ if (!player) return;
+ if (player.isPlaying()) player.pause();
+ else player.play();
+ };
+
+ return (
+ <div
+ ref={boxRef}
+ className="relative aspect-video w-full shrink-0 overflow-hidden rounded-control bg-[#0a0a0b]"
+ >
+ {near && entry && preview && (
+ <Player
+ ref={playerRef}
+ lazyComponent={entry.load}
+ inputProps={preview.defaults}
+ durationInFrames={preview.durationInFrames}
+ fps={preview.fps}
+ compositionWidth={preview.compositionWidth}
+ compositionHeight={preview.compositionHeight}
+ initialFrame={still}
+ controls={false}
+ clickToPlay={false}
+ loop
+ initiallyMuted
+ acknowledgeRemotionLicense
+ style={{ width: "100%", height: "100%" }}
+ />
+ )}
+ <button
+ type="button"
+ onClick={toggle}
+ disabled={!near}
+ className="absolute bottom-3 left-3 flex h-11 items-center gap-2 rounded-control-sm bg-[#fafafa] pr-3.5 pl-2 text-ui sm:bottom-4 sm:left-4 sm:h-9 sm:pl-1.5 sm:text-small text-[#0e1012] outline-none transition-colors hover:bg-white focus-visible:ring-3 focus-visible:ring-white/50"
+ >
+ <span className="flex size-[26px] items-center justify-center rounded-tile bg-[#0e1012]">
+ <svg
+ aria-hidden="true"
+ viewBox="0 0 24 24"
+ className="size-2.5 fill-primary-soft"
+ >
+ <path
+ d={playing ? "M6 4h4v16H6zM14 4h4v16h-4z" : "M7 4.5v15l12-7.5Z"}
+ />
+ </svg>
+ </span>
+ {playing ? "Pause preview" : "Play preview"}
+ </button>
+ <span className="absolute right-3 bottom-3 flex h-7 sm:right-4 sm:bottom-4 items-center rounded-tile bg-[#0e1012b3] px-2.5 text-mono leading-4 text-[#fafafa] tabular-nums">
+ {duration}
+ </span>
+ </div>
+ );
+}
diff --git a/components/docs/index/templates/template-steps.tsx b/components/docs/index/templates/template-steps.tsx
new file mode 100644
index 00000000..635385c2
--- /dev/null
+++ b/components/docs/index/templates/template-steps.tsx
@@ -0,0 +1,33 @@
+import type { ReactNode } from "react";
+
+/** The three numbered "how it works" cards above the template list. */
+export function TemplateSteps({ children }: { children: ReactNode }) {
+ return (
+ <ol data-not-typeset className="not-prose mt-2 grid gap-2 sm:grid-cols-3">
+ {children}
+ </ol>
+ );
+}
+
+export function TemplateStep({
+ n,
+ title,
+ children,
+}: {
+ n: number;
+ title: string;
+ children: ReactNode;
+}) {
+ return (
+ <li className="flex flex-col gap-2 rounded-cta border border-hairline bg-surface p-4">
+ <span className="text-caption leading-4 whitespace-pre text-muted-foreground">
+ {n}
+ {" "}
+ {title}
+ </span>
+ <span className="text-small text-foreground [&_code]:font-mono [&_code]:text-[0.9em] [&_p]:m-0">
+ {children}
+ </span>
+ </li>
+ );
+}
diff --git a/components/docs/install-all.tsx b/components/docs/install-all.tsx
index 85c4b599..7dda8f40 100644
--- a/components/docs/install-all.tsx
+++ b/components/docs/install-all.tsx
@@ -1,19 +1,17 @@
-import { Frame, FramePanel } from "@/components/ui/frame";
import { INSTALL_ALL_COMMAND } from "@/config/site";
import { convertNpmCommand } from "@/lib/convert-npm-command";
+import { cn } from "@/lib/utils";
+import { BLOCK_SPACING } from "./blocks/spacing";
import { CodeBlockCommand } from "./code-block-command";
export function InstallAll() {
return (
- <Frame className="my-6">
- <FramePanel className="overflow-hidden p-0">
- <CodeBlockCommand
- component="all"
- variant="plain"
- prompt="Add every remocn component to my project."
- {...convertNpmCommand(INSTALL_ALL_COMMAND)}
- />
- </FramePanel>
- </Frame>
+ <div className={cn("not-prose", BLOCK_SPACING)}>
+ <CodeBlockCommand
+ component="all"
+ prompt="Add every remocn component to my project."
+ {...convertNpmCommand(INSTALL_ALL_COMMAND)}
+ />
+ </div>
);
}
diff --git a/components/docs/install-block.tsx b/components/docs/install-block.tsx
index 1ccb09fb..1a1ed431 100644
--- a/components/docs/install-block.tsx
+++ b/components/docs/install-block.tsx
@@ -1,27 +1,21 @@
-import {
- Frame,
- FrameHeader,
- FramePanel,
- FrameTitle,
-} from "@/components/ui/frame";
import { convertNpmCommand } from "@/lib/convert-npm-command";
+import { cn } from "@/lib/utils";
+import { BLOCK_SPACING } from "./blocks/spacing";
import { CodeBlockCommand } from "./code-block-command";
export function InstallBlock({ name }: { name: string }) {
const npmCommand = `npx shadcn@latest add @remocn/${name}`;
return (
- <Frame id="installation" className="my-6">
- <FrameHeader className="flex-row items-center px-3 py-2.5">
- <FrameTitle>Installation</FrameTitle>
- </FrameHeader>
- <FramePanel className="overflow-hidden p-0">
- <CodeBlockCommand
- component={name}
- variant="plain"
- prompt={`Add the @remocn/${name} component to my project.`}
- {...convertNpmCommand(npmCommand)}
- />
- </FramePanel>
- </Frame>
+ <div
+ id="installation"
+ className={cn("not-prose scroll-mt-24", BLOCK_SPACING)}
+ >
+ <CodeBlockCommand
+ title="Installation"
+ component={name}
+ prompt={`Add the @remocn/${name} component to my project.`}
+ {...convertNpmCommand(npmCommand)}
+ />
+ </div>
);
}
diff --git a/components/docs/new-badge.tsx b/components/docs/new-badge.tsx
index 99555fb8..e73f1021 100644
--- a/components/docs/new-badge.tsx
+++ b/components/docs/new-badge.tsx
@@ -1,15 +1,24 @@
import { cn } from "@/lib/utils";
-export function NewBadge({ className }: { className?: string }) {
+/**
+ * Pink sidebar tag: "New" on a page, "N new" on a category holding several
+ * pages from `NEW_BADGE_PATHS`.
+ */
+export function NewBadge({
+ count = 1,
+ className,
+}: {
+ count?: number;
+ className?: string;
+}) {
return (
<span
className={cn(
- "ms-auto rounded-full bg-primary/10 px-1.5 py-px text-[10px] font-medium leading-[1.45]",
- "text-primary dark:bg-primary/20 dark:text-[color-mix(in_oklab,var(--primary)_55%,white)]",
+ "shrink-0 rounded-tag bg-primary-tint px-1.5 py-0.5 text-micro font-medium text-primary-strong",
className,
)}
>
- New
+ {count > 1 ? `${count} new` : "New"}
</span>
);
}
diff --git a/components/docs/open-in-agent.tsx b/components/docs/open-in-agent.tsx
new file mode 100644
index 00000000..c6a17ff2
--- /dev/null
+++ b/components/docs/open-in-agent.tsx
@@ -0,0 +1,129 @@
+"use client";
+
+import { Menu } from "@base-ui/react/menu";
+import { useEffect, useRef, useState } from "react";
+import {
+ ClaudeIcon,
+ CursorIcon,
+ OpenAIIcon,
+} from "@/app/(home)/components/landing/ui/brand-icons";
+import { useTrackEvent } from "@/lib/analytics";
+import {
+ AgentMenuAction,
+ AgentMenuLink,
+ AgentMenuPopup,
+ AgentMenuSeparator,
+} from "./agent-menu";
+import { CopyIcon } from "./copy-button";
+import { ChevronIcon } from "./shell/docs-icons";
+
+type Agent = "claude" | "chatgpt" | "cursor";
+
+/** Each agent's "new chat with this text in the composer" link. */
+const AGENTS: {
+ id: Agent;
+ label: string;
+ icon: React.ReactNode;
+ href: (text: string) => string;
+}[] = [
+ {
+ id: "claude",
+ label: "Claude",
+ icon: <ClaudeIcon className="size-4" />,
+ href: (text) => `https://claude.ai/new?q=${encodeURIComponent(text)}`,
+ },
+ {
+ id: "chatgpt",
+ label: "ChatGPT",
+ icon: <OpenAIIcon className="size-4 text-foreground" />,
+ href: (text) => `https://chatgpt.com/?q=${encodeURIComponent(text)}`,
+ },
+ {
+ // Opens the Cursor app's chat with the prompt filled in, for review.
+ id: "cursor",
+ label: "Cursor",
+ icon: <CursorIcon className="size-4 text-foreground" />,
+ href: (text) =>
+ `https://cursor.com/link/prompt?text=${encodeURIComponent(text)}`,
+ },
+];
+
+/**
+ * "Open in" for an install prompt: a menu of agents, each opening a new chat
+ * with the prompt already in the composer, plus a plain copy.
+ */
+export function OpenInAgent({
+ prompt,
+ component,
+}: {
+ prompt: string;
+ /** Registry name sent with the events; omitted events are not tracked. */
+ component?: string;
+}) {
+ const trackEvent = useTrackEvent();
+ const [open, setOpen] = useState(false);
+ const [copied, setCopied] = useState(false);
+ const closeTimer = useRef<ReturnType<typeof setTimeout>>(undefined);
+
+ useEffect(() => () => clearTimeout(closeTimer.current), []);
+
+ const copy = async () => {
+ const ok = await navigator.clipboard.writeText(prompt).then(
+ () => true,
+ () => false,
+ );
+ if (!ok) return;
+ setCopied(true);
+ if (component) {
+ trackEvent("install_command_copied", {
+ component,
+ package_manager: "prompt",
+ surface: "docs",
+ });
+ }
+ clearTimeout(closeTimer.current);
+ closeTimer.current = setTimeout(() => setOpen(false), 700);
+ };
+
+ return (
+ <Menu.Root
+ open={open}
+ onOpenChange={(next) => {
+ setOpen(next);
+ if (next) setCopied(false);
+ }}
+ >
+ <Menu.Trigger className="group flex h-[34px] shrink-0 cursor-pointer items-center gap-1.5 rounded-[10px] bg-foreground pr-2.5 pl-3 text-caption text-inverse outline-none transition-colors hover:bg-foreground/85 focus-visible:ring-2 focus-visible:ring-ring data-popup-open:bg-foreground/85 max-md:h-11 max-md:rounded-control-sm max-md:pl-3.5 max-md:text-small">
+ Open in
+ <ChevronIcon className="size-3 rotate-90 transition-[rotate] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] group-data-popup-open:-rotate-90 motion-reduce:transition-none" />
+ </Menu.Trigger>
+ <AgentMenuPopup>
+ {AGENTS.map((agent) => (
+ <AgentMenuLink
+ key={agent.id}
+ href={agent.href(prompt)}
+ icon={agent.icon}
+ onClick={() => {
+ if (!component) return;
+ trackEvent("install_prompt_opened", {
+ component,
+ agent: agent.id,
+ surface: "docs",
+ });
+ }}
+ >
+ {agent.label}
+ </AgentMenuLink>
+ ))}
+ <AgentMenuSeparator />
+ <AgentMenuAction
+ icon={<CopyIcon className="size-3.5" />}
+ onClick={copy}
+ closeOnClick={false}
+ >
+ {copied ? "Copied" : "Copy prompt"}
+ </AgentMenuAction>
+ </AgentMenuPopup>
+ </Menu.Root>
+ );
+}
diff --git a/components/docs/props-table.tsx b/components/docs/props-table.tsx
index 135f5b1c..106e39c6 100644
--- a/components/docs/props-table.tsx
+++ b/components/docs/props-table.tsx
@@ -1,9 +1,5 @@
-import {
- Frame,
- FrameHeader,
- FramePanel,
- FrameTitle,
-} from "@/components/ui/frame";
+import { cn } from "@/lib/utils";
+import { BLOCK_SPACING } from "./blocks/spacing";
export interface PropDef {
name: string;
@@ -13,6 +9,101 @@ export interface PropDef {
description: string;
}
+function Required() {
+ return (
+ <span className="ml-2 inline-flex h-5 items-center rounded-tag bg-surface-muted px-1.5 font-sans text-micro text-muted-foreground">
+ required
+ </span>
+ );
+}
+
+/** Desktop: prop name on the left, type and default over the description. */
+function PropsGrid({ rows }: { rows: PropDef[] }) {
+ return (
+ <div className="overflow-hidden rounded-card border border-hairline bg-surface max-md:hidden">
+ <table className="w-full border-collapse text-left">
+ <thead>
+ <tr className="h-10 border-b border-hairline bg-surface-muted text-caption font-medium text-foreground">
+ <th scope="col" className="w-[190px] pl-5 font-medium">
+ Prop
+ </th>
+ <th scope="col" className="w-[90px] font-medium">
+ Type
+ </th>
+ <th scope="col" className="pr-5 font-medium">
+ Default
+ </th>
+ </tr>
+ </thead>
+ <tbody>
+ {rows.map((row) => (
+ <tr
+ key={row.name}
+ className="border-b border-hairline align-top last:border-b-0"
+ >
+ <th
+ scope="row"
+ className="py-3.5 pr-4 pl-5 font-mono text-caption leading-5 font-normal break-all text-foreground"
+ >
+ {row.name}
+ {row.required ? <Required /> : null}
+ </th>
+ <td colSpan={2} className="py-3.5 pr-5">
+ <div className="flex font-mono text-caption leading-5">
+ <span className="w-[90px] shrink-0 text-foreground">
+ {row.type}
+ </span>
+ <span className="min-w-0 text-muted-foreground">
+ {row.default ?? "—"}
+ </span>
+ </div>
+ <p className="mt-1 text-small leading-[21px] text-body">
+ {row.description}
+ </p>
+ </td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ );
+}
+
+/** Phones: one card per prop, type as a tag, default under the description. */
+function PropsCards({ rows }: { rows: PropDef[] }) {
+ return (
+ <ul className="flex flex-col gap-2 md:hidden">
+ {rows.map((row) => (
+ <li
+ key={row.name}
+ className="flex flex-col gap-2 rounded-cta border border-hairline bg-surface px-4 pt-3.5 pb-4"
+ >
+ <div className="flex items-start justify-between gap-3">
+ <span className="min-w-0 font-mono text-caption leading-5 break-all text-foreground">
+ {row.name}
+ {row.required ? <Required /> : null}
+ </span>
+ <span className="max-w-[60%] shrink-0 rounded-tag bg-surface-muted px-[7px] py-[3px] font-mono text-mono wrap-anywhere text-body">
+ {row.type}
+ </span>
+ </div>
+ <p className="text-small leading-[21px] text-body">
+ {row.description}
+ </p>
+ {row.default ? (
+ <p className="flex flex-wrap items-baseline gap-x-2 gap-y-0.5 text-caption leading-[18px] text-muted-foreground">
+ Default
+ <code className="font-mono text-mono leading-[18px]">
+ {row.default}
+ </code>
+ </p>
+ ) : null}
+ </li>
+ ))}
+ </ul>
+ );
+}
+
export function PropsTable({
rows,
title,
@@ -21,85 +112,21 @@ export function PropsTable({
title?: string;
}) {
return (
- <Frame
- id={title ? title.toLowerCase() : undefined}
- className="not-prose my-6 max-w-4xl"
- >
- {title && (
- <FrameHeader className="flex-row items-center px-3 py-2.5">
- <FrameTitle>{title}</FrameTitle>
- </FrameHeader>
+ <div
+ id={title ? title.toLowerCase().replace(/\s+/g, "-") : undefined}
+ className={cn(
+ "not-prose scroll-mt-24",
+ title ? "mt-12 first:mt-0" : BLOCK_SPACING,
)}
- <FramePanel className="overflow-hidden p-0">
- <div
- // biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable table must be keyboard-focusable
- tabIndex={0}
- className="overflow-x-auto"
- >
- <table className="w-full border-collapse text-sm">
- <thead>
- <tr className="border-b border-border/60">
- <th className="px-4 py-2.5 text-left font-medium text-foreground">
- Prop
- </th>
- <th className="px-4 py-2.5 text-left font-medium text-foreground">
- Type
- </th>
- <th className="px-4 py-2.5 text-left font-medium text-foreground">
- Default
- </th>
- <th className="px-4 py-2.5 text-left font-medium text-foreground">
- Description
- </th>
- </tr>
- </thead>
- <tbody>
- {rows.map((row, i) => (
- <tr
- key={row.name}
- className={
- i === rows.length - 1
- ? "align-top transition-colors hover:bg-muted/40"
- : "border-b border-border/40 align-top transition-colors hover:bg-muted/40"
- }
- >
- <td className="px-4 py-3 align-top">
- <div className="flex items-center gap-1.5">
- <code className="font-mono text-xs text-foreground">
- {row.name}
- </code>
- {row.required && (
- <span className="rounded bg-foreground/5 px-1.5 py-0.5 font-mono text-[10px] font-medium text-foreground/70">
- required
- </span>
- )}
- </div>
- </td>
- <td className="px-4 py-3 align-top">
- <code className="font-mono text-xs text-muted-foreground/90">
- {row.type}
- </code>
- </td>
- <td className="px-4 py-3 align-top">
- {row.default ? (
- <code className="rounded bg-muted px-1.5 py-0.5 font-mono text-xs text-foreground">
- {row.default}
- </code>
- ) : (
- <span className="font-mono text-xs text-muted-foreground/60">
- —
- </span>
- )}
- </td>
- <td className="px-4 py-3 text-muted-foreground">
- {row.description}
- </td>
- </tr>
- ))}
- </tbody>
- </table>
- </div>
- </FramePanel>
- </Frame>
+ >
+ {title ? (
+ <h2 className="mb-4 flex items-baseline gap-2.5 text-quote leading-8 font-medium tracking-title text-foreground max-md:mb-3.5">
+ {title}
+ <span className="font-normal text-subtle">{rows.length}</span>
+ </h2>
+ ) : null}
+ <PropsGrid rows={rows} />
+ <PropsCards rows={rows} />
+ </div>
);
}
diff --git a/components/docs/shell/agents-link.tsx b/components/docs/shell/agents-link.tsx
new file mode 100644
index 00000000..1625e037
--- /dev/null
+++ b/components/docs/shell/agents-link.tsx
@@ -0,0 +1,22 @@
+import { cn } from "@/lib/utils";
+import { ArrowUpRightIcon } from "./docs-icons";
+
+const HREF = "/llms-components.txt";
+
+/** "for agents /llms-components.txt" at the foot of the sidebar. */
+export function AgentsLink({ className }: { className?: string }) {
+ return (
+ <div className={cn("flex flex-wrap items-center gap-2", className)}>
+ <span className="text-caption text-muted-foreground">for agents</span>
+ <a
+ href={HREF}
+ target="_blank"
+ rel="noreferrer"
+ className="flex h-[26px] items-center gap-1.5 rounded-tag bg-surface-muted px-2.5 font-mono text-mono text-body outline-none transition-colors hover:bg-secondary hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {HREF}
+ <ArrowUpRightIcon className="size-3 text-muted-foreground" />
+ </a>
+ </div>
+ );
+}
diff --git a/components/docs/shell/docs-icons.tsx b/components/docs/shell/docs-icons.tsx
new file mode 100644
index 00000000..83170301
--- /dev/null
+++ b/components/docs/shell/docs-icons.tsx
@@ -0,0 +1,327 @@
+import type { ReactNode, SVGProps } from "react";
+import type { DocsTabId } from "@/lib/docs-tabs";
+
+/**
+ * Line icons from the docs shell artboard: one per library (the switcher) and
+ * one per sidebar category. All stroke `currentColor`, so the row decides the
+ * colour (foreground when open or active, body otherwise).
+ */
+function Icon({
+ children,
+ strokeWidth = 1.7,
+ ...props
+}: SVGProps<SVGSVGElement> & { children: ReactNode }) {
+ return (
+ <svg
+ viewBox="0 0 24 24"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth={strokeWidth}
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ aria-hidden="true"
+ {...props}
+ >
+ {children}
+ </svg>
+ );
+}
+
+type IconProps = { className?: string; strokeWidth?: number };
+
+const TAB_PATHS: Record<DocsTabId, ReactNode> = {
+ components: (
+ <>
+ <rect x="3.5" y="3.5" width="7" height="7" rx="2" />
+ <rect x="13.5" y="3.5" width="7" height="7" rx="2" />
+ <rect x="3.5" y="13.5" width="7" height="7" rx="2" />
+ <rect x="13.5" y="13.5" width="7" height="7" rx="2" />
+ </>
+ ),
+ primitives: (
+ <>
+ <rect x="2.5" y="7" width="19" height="10" rx="5" />
+ <circle cx="16.5" cy="12" r="3" />
+ </>
+ ),
+ shaders: (
+ <>
+ <circle cx="12" cy="12" r="8.5" />
+ <path d="M5 7.5c3 1.5 5 4.5 5.5 9M9.5 3.8c3.5 2 6 5.5 6.5 10.5M15.5 4.3c2 2.2 3.2 5 3.4 8" />
+ </>
+ ),
+ filters: (
+ <>
+ <path d="M4 7h9M17 7h3M4 17h3M11 17h9" />
+ <circle cx="15" cy="7" r="2" />
+ <circle cx="9" cy="17" r="2" />
+ </>
+ ),
+ captions: (
+ <>
+ <path d="M5.5 4h13A2.5 2.5 0 0 1 21 6.5v8a2.5 2.5 0 0 1-2.5 2.5H11l-4.5 3.5V17h-1A2.5 2.5 0 0 1 3 14.5v-8A2.5 2.5 0 0 1 5.5 4Z" />
+ <path d="M7.5 9h9M7.5 12.5h6" />
+ </>
+ ),
+ templates: (
+ <>
+ <rect x="3" y="4" width="18" height="16" rx="2.5" />
+ <path d="M7 4v16M17 4v16M3 9h4M3 15h4M17 9h4M17 15h4" />
+ </>
+ ),
+ icons: (
+ <>
+ <path d="M12 3c.7 4.3 2.7 6.3 7 7-4.3.7-6.3 2.7-7 7-.7-4.3-2.7-6.3-7-7 4.3-.7 6.3-2.7 7-7Z" />
+ <path d="M18.5 15.5c.3 1.9 1.1 2.7 3 3-1.9.3-2.7 1.1-3 3-.3-1.9-1.1-2.7-3-3 1.9-.3 2.7-1.1 3-3Z" />
+ </>
+ ),
+};
+
+/** Category icons, keyed by folder slug (`primitives:` for that library). */
+const GROUP_PATHS: Record<string, ReactNode> = {
+ "getting-started": (
+ <>
+ <path d="M12 15c-1.5-1.5-3-3-3-3s2.5-7 9-8c-1 6.5-8 9-8 9" />
+ <path d="M9 12H5l3-4h4M12 15v4l4-3v-4" />
+ <path d="M6.5 16.5C5 17 4.5 19.5 4.5 19.5S7 19 7.5 17.5" />
+ </>
+ ),
+ guides: (
+ <>
+ <path d="M12 6.5C10 5 7 4.5 3.5 5v13c3.5-.5 6.5 0 8.5 1.5 2-1.5 5-2 8.5-1.5V5C17 4.5 14 5 12 6.5Z" />
+ <path d="M12 6.5v13" />
+ </>
+ ),
+ craft: (
+ <>
+ <path d="m4 20 11-11" />
+ <path d="m13 7 2-2 4 4-2 2" />
+ <path d="M18 3v2M21 6h-2M7 4v2M6 5h2M19 15v2M18 16h2" />
+ </>
+ ),
+ layout: (
+ <>
+ <rect x="3.5" y="3.5" width="17" height="17" rx="3" />
+ <path d="M3.5 9.5h17M10 9.5v11" />
+ </>
+ ),
+ typography: (
+ <>
+ <path d="M4 7V5h11v2M9.5 5v14M7.5 19h4" />
+ <path d="M14 12v-1.5h6V12M17 10.5V19M15.5 19h3" />
+ </>
+ ),
+ "ui-blocks": (
+ <>
+ <rect x="3.5" y="3.5" width="7" height="9" rx="2" />
+ <rect x="13.5" y="3.5" width="7" height="5" rx="2" />
+ <rect x="13.5" y="11.5" width="7" height="9" rx="2" />
+ <rect x="3.5" y="15.5" width="7" height="5" rx="2" />
+ </>
+ ),
+ ai: (
+ <>
+ <rect x="5" y="5" width="14" height="14" rx="3" />
+ <path d="M9 2.5V5M15 2.5V5M9 19v2.5M15 19v2.5M2.5 9H5M2.5 15H5M19 9h2.5M19 15h2.5" />
+ <path d="M9.5 14.5 11 9.5h1l1.5 5M10 13h2.5M15.5 9.5v5" />
+ </>
+ ),
+ transitions: (
+ <>
+ <rect x="3" y="5" width="8" height="14" rx="2" />
+ <path d="M15 5h4a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-4" />
+ <path d="m13 9 3 3-3 3" />
+ </>
+ ),
+ social: (
+ <>
+ <circle cx="18" cy="5.5" r="2.5" />
+ <circle cx="6" cy="12" r="2.5" />
+ <circle cx="18" cy="18.5" r="2.5" />
+ <path d="m8.2 10.8 7.6-4.1M8.2 13.2l7.6 4.1" />
+ </>
+ ),
+ templates: (
+ <>
+ <rect x="3" y="5" width="18" height="14" rx="3" />
+ <path d="m10 9.5 4.5 2.5-4.5 2.5Z" />
+ </>
+ ),
+ effects: (
+ <>
+ <path d="M10 3.5c.6 3.6 2.4 5.4 6 6-3.6.6-5.4 2.4-6 6-.6-3.6-2.4-5.4-6-6 3.6-.6 5.4-2.4 6-6Z" />
+ <path d="M17.5 14.5c.3 1.7 1.2 2.7 3 3-1.8.3-2.7 1.3-3 3-.3-1.7-1.2-2.7-3-3 1.8-.3 2.7-1.3 3-3Z" />
+ </>
+ ),
+ "motion-graphics": (
+ <>
+ <circle cx="7.5" cy="7.5" r="4" />
+ <rect x="13" y="13" width="8" height="8" rx="1.5" />
+ <path d="M17 3.5 21 10h-8Z" />
+ <path d="m3.5 20.5 6-6" />
+ </>
+ ),
+ "logo-stings": (
+ <>
+ <circle cx="12" cy="9" r="5.5" />
+ <path d="m8.5 13.5-1.5 7 5-2.5 5 2.5-1.5-7" />
+ </>
+ ),
+ "camera-physics": (
+ <>
+ <rect x="2.5" y="6" width="13" height="12" rx="2.5" />
+ <path d="m15.5 10.5 6-3.5v10l-6-3.5" />
+ </>
+ ),
+ "graphic-looks": (
+ <>
+ <path d="M12 3a9 9 0 1 0 0 18c1.2 0 2-.8 2-1.8 0-1.3-1-1.7-1-2.7 0-1 .8-1.5 1.8-1.5H17a4 4 0 0 0 4-4C21 6.6 17 3 12 3Z" />
+ <circle cx="7.5" cy="11" r="1" />
+ <circle cx="10" cy="7" r="1" />
+ <circle cx="15" cy="7.5" r="1" />
+ </>
+ ),
+ compositions: (
+ <>
+ <path d="m12 3.5 9 4.5-9 4.5-9-4.5Z" />
+ <path d="m3 12 9 4.5 9-4.5M3 16l9 4.5 9-4.5" />
+ </>
+ ),
+ "primitives:components": (
+ <>
+ <rect x="3.5" y="5" width="17" height="14" rx="3" />
+ <path d="M7.5 10h5M7.5 14h9" />
+ </>
+ ),
+ "primitives:blocks": (
+ <>
+ <rect x="3.5" y="3.5" width="8" height="10" rx="2" />
+ <rect x="14.5" y="3.5" width="6" height="6" rx="2" />
+ <rect x="14.5" y="12.5" width="6" height="8" rx="2" />
+ <rect x="3.5" y="16.5" width="8" height="4" rx="2" />
+ </>
+ ),
+};
+
+export function TabIcon({
+ tab,
+ className,
+ strokeWidth = 1.5,
+}: IconProps & { tab: DocsTabId }) {
+ return (
+ <Icon className={className} strokeWidth={strokeWidth}>
+ {TAB_PATHS[tab]}
+ </Icon>
+ );
+}
+
+/** Category icon; unknown folders fall back to their library's icon. */
+export function GroupIcon({
+ tab,
+ group,
+ className,
+}: IconProps & { tab: DocsTabId; group: string }) {
+ const paths =
+ GROUP_PATHS[`${tab}:${group}`] ?? GROUP_PATHS[group] ?? TAB_PATHS[tab];
+ return <Icon className={className}>{paths}</Icon>;
+}
+
+export function ChevronIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ <path d="m9 6 6 6-6 6" />
+ </Icon>
+ );
+}
+
+export function ArrowUpRightIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ <path d="M7 17 17 7M8 7h9v9" />
+ </Icon>
+ );
+}
+
+export function ArrowIcon({
+ className,
+ direction = "right",
+}: IconProps & { direction?: "left" | "right" }) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ {direction === "right" ? (
+ <path d="M5 12h14M13 6l6 6-6 6" />
+ ) : (
+ <path d="M19 12H5M11 6l-6 6 6 6" />
+ )}
+ </Icon>
+ );
+}
+
+export function SearchIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ <circle cx="11" cy="11" r="7" />
+ <path d="m20 20-3.5-3.5" />
+ </Icon>
+ );
+}
+
+export function CopyIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={1.8}>
+ <rect x="8" y="8" width="12" height="12" rx="2.5" />
+ <path d="M16 8V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h2" />
+ </Icon>
+ );
+}
+
+export function CheckIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ <path d="m5 12.5 4.5 4.5L19 7.5" />
+ </Icon>
+ );
+}
+
+export function PencilIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={1.8}>
+ <path d="M4 20h4L19 9l-4-4L4 16Z" />
+ <path d="m13.5 6.5 4 4" />
+ </Icon>
+ );
+}
+
+export function FilterIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ <path d="M4 6h16M7 12h10M10 18h4" />
+ </Icon>
+ );
+}
+
+export function SidebarIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={1.8}>
+ <rect x="3" y="4" width="18" height="16" rx="3" />
+ <path d="M9 4v16" />
+ </Icon>
+ );
+}
+
+export function CloseIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={2}>
+ <path d="M6 6l12 12M18 6 6 18" />
+ </Icon>
+ );
+}
+
+export function MarkdownIcon({ className }: IconProps) {
+ return (
+ <Icon className={className} strokeWidth={1.8}>
+ <rect x="2.5" y="5.5" width="19" height="13" rx="2.5" />
+ <path d="M6.5 15V9l2.5 3 2.5-3v6M15.5 9v6M13.5 13l2 2 2-2" />
+ </Icon>
+ );
+}
diff --git a/components/docs/shell/docs-rail.tsx b/components/docs/shell/docs-rail.tsx
new file mode 100644
index 00000000..5fa3e391
--- /dev/null
+++ b/components/docs/shell/docs-rail.tsx
@@ -0,0 +1,30 @@
+import { SponsorsCard } from "./sponsors-card";
+import { StudioPromo } from "./studio-promo";
+
+/**
+ * Right rail (`xl`+): the Studio card and the sponsors credits, sticking to
+ * the top while the article scrolls.
+ */
+export function DocsRail() {
+ return (
+ <div className="hidden w-(--docs-rail) shrink-0 xl:block">
+ <div
+ data-docs-rail
+ className="sticky top-0 flex max-h-svh flex-col gap-7 overflow-y-auto pt-10 pb-10 pl-8"
+ >
+ <StudioPromo />
+ <SponsorsCard />
+ </div>
+ </div>
+ );
+}
+
+/** The rail's two cards, under the article below `xl`. */
+export function RailCards() {
+ return (
+ <div className="flex flex-col gap-3 pt-8 xl:hidden">
+ <StudioPromo />
+ <SponsorsCard />
+ </div>
+ );
+}
diff --git a/components/docs/shell/docs-sidebar.tsx b/components/docs/shell/docs-sidebar.tsx
new file mode 100644
index 00000000..20d0d827
--- /dev/null
+++ b/components/docs/shell/docs-sidebar.tsx
@@ -0,0 +1,55 @@
+"use client";
+
+import { useEffect, useRef } from "react";
+import { AgentsLink } from "./agents-link";
+import { LibrarySwitcher } from "./library-switcher";
+import type { SidebarModel } from "./sidebar-model";
+import { SidebarTree } from "./sidebar-tree";
+
+/**
+ * Desktop sidebar (`lg`+): library switcher (its label shows as a tooltip on
+ * hover), the category tree and the agents link. Search lives on ⌘K. The
+ * content sticks to the top; the switcher stays put, only the tree scrolls.
+ */
+export function DocsSidebar({
+ model,
+ activeUrl,
+}: {
+ model: SidebarModel;
+ activeUrl: string;
+}) {
+ const scroller = useRef<HTMLDivElement>(null);
+
+ // Bring the current page into view when the tree is longer than the screen.
+ useEffect(() => {
+ const el = scroller.current;
+ const current = el?.querySelector<HTMLElement>(
+ `a[href="${CSS.escape(activeUrl)}"]`,
+ );
+ if (!el || !current) return;
+ const top =
+ current.getBoundingClientRect().top -
+ el.getBoundingClientRect().top +
+ el.scrollTop;
+ if (top > el.scrollTop + el.clientHeight - 80 || top < el.scrollTop) {
+ el.scrollTop = top - el.clientHeight / 3;
+ }
+ }, [activeUrl]);
+
+ return (
+ <aside className="hidden w-(--docs-sidebar) shrink-0 lg:block">
+ <div className="sticky top-0 flex h-svh flex-col pr-4">
+ <div className="shrink-0 pt-6 pb-2">
+ <LibrarySwitcher active={model.tab} />
+ </div>
+ <div
+ ref={scroller}
+ className="flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto overscroll-contain pt-3 pb-10 [mask-image:linear-gradient(to_bottom,transparent,#000_12px)]"
+ >
+ <SidebarTree model={model} activeUrl={activeUrl} />
+ <AgentsLink className="pt-2" />
+ </div>
+ </div>
+ </aside>
+ );
+}
diff --git a/components/docs/shell/header-search.tsx b/components/docs/shell/header-search.tsx
new file mode 100644
index 00000000..8c21bbc4
--- /dev/null
+++ b/components/docs/shell/header-search.tsx
@@ -0,0 +1,26 @@
+"use client";
+
+import { useSearchContext } from "fumadocs-ui/contexts/search";
+import { SearchIcon } from "./docs-icons";
+
+/**
+ * "Search" capsule that takes Get started's place in the docs header on
+ * phones and tablets, where the sidebar's search field is tucked away.
+ */
+export function HeaderSearch() {
+ const { enabled, setOpenSearch } = useSearchContext();
+ if (!enabled) return null;
+
+ return (
+ <button
+ type="button"
+ onClick={() => setOpenSearch(true)}
+ className="flex h-11 items-center gap-2 rounded-control bg-capsule px-3.5 outline-none transition-colors hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <SearchIcon className="size-4 shrink-0 text-foreground" />
+ <span className="text-[15px] leading-[18px] text-muted-foreground">
+ Search
+ </span>
+ </button>
+ );
+}
diff --git a/components/docs/shell/library-switcher.tsx b/components/docs/shell/library-switcher.tsx
new file mode 100644
index 00000000..f403fab0
--- /dev/null
+++ b/components/docs/shell/library-switcher.tsx
@@ -0,0 +1,98 @@
+"use client";
+
+import Link from "next/link";
+import { useCallback, useRef, useState } from "react";
+import { DOCS_TABS, type DocsTabId } from "@/lib/docs-tabs";
+import { cn } from "@/lib/utils";
+import { TabIcon } from "./docs-icons";
+import { SwitcherTip, type TipState } from "./switcher-tip";
+
+const TIP_GAP = 28;
+
+/**
+ * Icon row that replaces the old tabs bar: one segment per library. Each is a
+ * link to the library's landing page; the shell then swaps the sidebar tree
+ * for the new path. `size="lg"` is the mobile sections sheet.
+ */
+export function LibrarySwitcher({
+ active,
+ size = "md",
+ onNavigate,
+}: {
+ active: DocsTabId;
+ size?: "md" | "lg";
+ onNavigate?: () => void;
+}) {
+ const lg = size === "lg";
+ const navRef = useRef<HTMLElement>(null);
+ const [tip, setTip] = useState<TipState | null>(null);
+ const hideTip = useCallback(() => setTip(null), []);
+
+ const point = (label: string, keyboard = false) => {
+ if (lg) return;
+ const rect = navRef.current?.getBoundingClientRect();
+ if (!rect) return;
+ setTip({
+ label,
+ left: rect.right + TIP_GAP,
+ top: rect.top + rect.height / 2,
+ keyboard,
+ });
+ };
+
+ return (
+ <nav
+ ref={navRef}
+ aria-label="Libraries"
+ onPointerLeave={hideTip}
+ onBlur={(event) => {
+ if (!event.currentTarget.contains(event.relatedTarget)) hideTip();
+ }}
+ onKeyDown={(event) => {
+ if (event.key === "Escape") hideTip();
+ }}
+ className={cn(
+ "flex w-full shrink-0 items-center bg-capsule p-1",
+ lg ? "gap-1 rounded-control" : "h-10 gap-0.5 rounded-control-sm",
+ )}
+ >
+ {DOCS_TABS.map((tab) => {
+ const isActive = tab.id === active;
+ return (
+ <Link
+ key={tab.id}
+ href={tab.href}
+ title={lg ? tab.label : undefined}
+ aria-label={tab.label}
+ aria-current={isActive ? "page" : undefined}
+ onClick={onNavigate}
+ onPointerEnter={(event) => {
+ if (event.pointerType === "mouse") point(tab.label);
+ }}
+ onFocus={(event) => {
+ if (event.currentTarget.matches(":focus-visible"))
+ point(tab.label, true);
+ }}
+ className={cn(
+ "flex min-w-0 flex-1 basis-0 items-center justify-center outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ // In the sheet the hit area grows into the capsule's padding.
+ lg
+ ? "relative h-9 rounded-[10px] before:absolute before:-inset-x-0.5 before:-inset-y-1"
+ : "h-8 rounded-tile",
+ isActive
+ ? "bg-surface text-foreground shadow-[0_1px_2px_#0E10121A,0_0_0_1px_#0E10120A] dark:bg-secondary dark:shadow-[inset_0_1px_0_#FFFFFF0F,0_0_0_1px_#FFFFFF0F]"
+ : "text-muted-foreground hover:bg-surface/60 hover:text-foreground dark:hover:bg-secondary/60",
+ )}
+ >
+ <TabIcon
+ tab={tab.id}
+ className={lg ? "size-4" : "size-[18px]"}
+ strokeWidth={lg ? 1.8 : 1.5}
+ />
+ </Link>
+ );
+ })}
+ {!lg && <SwitcherTip tip={tip} onDismiss={hideTip} />}
+ </nav>
+ );
+}
diff --git a/components/docs/shell/mobile-page-bar.tsx b/components/docs/shell/mobile-page-bar.tsx
new file mode 100644
index 00000000..e83b1b27
--- /dev/null
+++ b/components/docs/shell/mobile-page-bar.tsx
@@ -0,0 +1,37 @@
+"use client";
+
+import { useDocsShell } from "@/components/docs/docs-shell";
+import { SidebarIcon } from "./docs-icons";
+import type { Crumb } from "./page-context";
+
+/**
+ * Docs page bar below `lg`: the sections trigger (sidebar icon + section ›
+ * page) that opens the sections sheet. Sticks to the top while reading.
+ */
+export function MobilePageBar({ crumbs }: { crumbs: Crumb[] }) {
+ const { openSections } = useDocsShell();
+ const page = crumbs.at(-1)?.label;
+ const section = crumbs.length > 1 ? crumbs.at(-2)?.label : undefined;
+
+ return (
+ <div className="sticky top-0 z-30 flex items-center gap-2 border-b border-hairline bg-surface-muted px-4 pt-2 pb-3 lg:hidden">
+ <button
+ type="button"
+ onClick={openSections}
+ aria-haspopup="dialog"
+ className="relative flex h-[38px] min-w-0 items-center gap-1.5 rounded-control-sm bg-surface pr-3 pl-2.5 text-small leading-[18px] shadow-[0_0_0_1px_var(--color-hairline)] outline-none transition-colors hover:bg-surface/70 focus-visible:ring-2 focus-visible:ring-ring after:absolute after:-inset-y-1 after:inset-x-0 lg:hidden"
+ >
+ <SidebarIcon className="size-4 shrink-0 text-foreground" />
+ <span className="sr-only">Docs sections:</span>
+ {section && (
+ <span className="min-w-0 truncate text-muted-foreground">
+ {section}
+ </span>
+ )}
+ <span className="max-w-[55vw] shrink-0 truncate font-medium text-foreground">
+ {page}
+ </span>
+ </button>
+ </div>
+ );
+}
diff --git a/components/docs/shell/page-actions.tsx b/components/docs/shell/page-actions.tsx
new file mode 100644
index 00000000..4dabf98b
--- /dev/null
+++ b/components/docs/shell/page-actions.tsx
@@ -0,0 +1,107 @@
+"use client";
+
+import { Menu } from "@base-ui/react/menu";
+import { useEffect, useRef } from "react";
+import {
+ ClaudeIcon,
+ OpenAIIcon,
+} from "@/app/(home)/components/landing/ui/brand-icons";
+import { AgentMenuLink, AgentMenuPopup } from "@/components/docs/agent-menu";
+import { CopyMarkdownButton } from "@/components/docs/copy-markdown-button";
+import { cn } from "@/lib/utils";
+import { ChevronIcon, MarkdownIcon } from "./docs-icons";
+import type { PageLinks } from "./page-links";
+
+/**
+ * From `xl`, shifts the actions so their left edge lines up with the header's
+ * right island. The island's width follows live data (stars, health label),
+ * so the 9px it sits at with today's data is corrected by measuring.
+ */
+function useAlignToIsland(enabled: boolean) {
+ const ref = useRef<HTMLDivElement>(null);
+ useEffect(() => {
+ const el = ref.current;
+ if (!enabled || !el) return;
+ const wide = window.matchMedia("(min-width: 80rem)");
+ const align = () => {
+ const island = document.querySelector("[data-header-island]");
+ if (!wide.matches || !island) {
+ el.style.translate = "";
+ return;
+ }
+ const shift = Number.parseFloat(getComputedStyle(el).translate) || 0;
+ const natural = el.getBoundingClientRect().left - shift;
+ el.style.translate = `${island.getBoundingClientRect().left - natural}px`;
+ };
+ align();
+ const observer = new ResizeObserver(align);
+ observer.observe(el.parentElement ?? el);
+ const island = document.querySelector("[data-header-island]");
+ if (island) observer.observe(island);
+ return () => observer.disconnect();
+ }, [enabled]);
+ return ref;
+}
+
+/**
+ * "Copy page" with a menu beside it: the button copies the page's markdown,
+ * the chevron opens the agent hand-offs (Open in Claude / ChatGPT, View as
+ * Markdown). 32px on the breadcrumb row from `lg`, 44px under the
+ * description below it.
+ */
+export function PageActions({
+ links,
+ alignToHeader = false,
+ className,
+}: {
+ links: PageLinks;
+ /** Line the left edge up with the header's GitHub island (from `xl`). */
+ alignToHeader?: boolean;
+ className?: string;
+}) {
+ const ref = useAlignToIsland(alignToHeader);
+ return (
+ <div
+ ref={ref}
+ className={cn(
+ "inline-flex w-fit shrink-0 items-stretch",
+ alignToHeader && "xl:translate-x-[9px]",
+ className,
+ )}
+ >
+ <CopyMarkdownButton
+ url={links.markdown}
+ className="rounded-r-none lg:rounded-r-none"
+ />
+ <span aria-hidden="true" className="w-px bg-foreground/10" />
+ <Menu.Root>
+ <Menu.Trigger
+ aria-label="More page actions"
+ className="group flex w-10 items-center justify-center rounded-r-control-sm bg-secondary text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-2 focus-visible:ring-ring data-popup-open:bg-[#dcdde0] lg:w-7 lg:rounded-r-[10px] dark:hover:bg-[#33363b] dark:data-popup-open:bg-[#33363b]"
+ >
+ <ChevronIcon className="size-3.5 rotate-90 transition-[rotate] duration-150 ease-[cubic-bezier(0.23,1,0.32,1)] group-data-popup-open:-rotate-90 motion-reduce:transition-none" />
+ </Menu.Trigger>
+ <AgentMenuPopup>
+ <AgentMenuLink
+ href={links.claude}
+ icon={<ClaudeIcon className="size-4" />}
+ >
+ Open in Claude
+ </AgentMenuLink>
+ <AgentMenuLink
+ href={links.chatgpt}
+ icon={<OpenAIIcon className="size-4 text-foreground" />}
+ >
+ Open in ChatGPT
+ </AgentMenuLink>
+ <AgentMenuLink
+ href={links.markdown}
+ icon={<MarkdownIcon className="size-3.5" />}
+ >
+ View as Markdown
+ </AgentMenuLink>
+ </AgentMenuPopup>
+ </Menu.Root>
+ </div>
+ );
+}
diff --git a/components/docs/shell/page-context.ts b/components/docs/shell/page-context.ts
new file mode 100644
index 00000000..1bf625de
--- /dev/null
+++ b/components/docs/shell/page-context.ts
@@ -0,0 +1,74 @@
+import {
+ findNeighbour,
+ findPath,
+ flattenTree,
+ type Item,
+ type Node,
+} from "fumadocs-core/page-tree";
+import { DOCS_TABS, getActiveDocsTab, splitDocsTree } from "@/lib/docs-tabs";
+import { source } from "@/source";
+
+export type Crumb = { label: string; href?: string };
+
+export type PageNeighbour = { name: string; url: string };
+
+export type PageContext = {
+ crumbs: Crumb[];
+ previous?: PageNeighbour;
+ next?: PageNeighbour;
+};
+
+const label = (node: Node | Item): string =>
+ typeof node.name === "string" ? node.name : "";
+
+/** A folder's landing page: its `index`, or the child every sibling nests under. */
+function folderHref(folder: Node): string | undefined {
+ if (folder.type !== "folder") return undefined;
+ if (folder.index) return folder.index.url;
+ const pages = folder.children.filter((n): n is Item => n.type === "page");
+ return pages.find((p) => pages.every((o) => o.url.startsWith(p.url)))?.url;
+}
+
+const toNeighbour = (item?: Item): PageNeighbour | undefined =>
+ item ? { name: label(item), url: item.url } : undefined;
+
+/**
+ * Breadcrumb and prev/next for a docs page, both scoped to the page's own
+ * library tree (the same split the sidebar shows), so neighbours never jump
+ * into another library. Pages outside every
+ * tree (the docs home) get a lone "Docs" crumb and point at the first page.
+ */
+export function getPageContext(url: string): PageContext {
+ const tabId = getActiveDocsTab(url);
+ const tab = DOCS_TABS.find((t) => t.id === tabId);
+ const tree = splitDocsTree(source.pageTree)[tabId];
+ const path = findPath(
+ tree.children,
+ (node) => node.type === "page" && node.url === url,
+ );
+
+ if (!path || !tab) {
+ return {
+ crumbs: [{ label: "Docs" }],
+ next: toNeighbour(flattenTree(tree.children)[0]),
+ };
+ }
+
+ // `Typography › Inline Word Roll`: the nearest folder (or the library when
+ // the page sits at its root), then the page. A category's own landing page
+ // reads `Components › Typography` instead of repeating its name.
+ const page = path.at(-1);
+ const parent = path.findLast((node) => node.type === "folder");
+ const crumbs: Crumb[] =
+ parent && folderHref(parent) !== url
+ ? [{ label: label(parent), href: folderHref(parent) }]
+ : [{ label: tab.label, href: tab.href }];
+ if (page) crumbs.push({ label: label(page) });
+
+ const { previous, next } = findNeighbour(tree, url);
+ return {
+ crumbs,
+ previous: toNeighbour(previous),
+ next: toNeighbour(next),
+ };
+}
diff --git a/components/docs/shell/page-footer.tsx b/components/docs/shell/page-footer.tsx
new file mode 100644
index 00000000..2d9709e9
--- /dev/null
+++ b/components/docs/shell/page-footer.tsx
@@ -0,0 +1,77 @@
+import Link from "next/link";
+import { GITHUB_URL } from "@/config/site";
+import { cn } from "@/lib/utils";
+import { ArrowIcon, PencilIcon } from "./docs-icons";
+import type { PageNeighbour } from "./page-context";
+
+function NeighbourCard({
+ page,
+ direction,
+}: {
+ page: PageNeighbour;
+ direction: "previous" | "next";
+}) {
+ const next = direction === "next";
+ return (
+ <Link
+ href={page.url}
+ className={cn(
+ "flex min-w-0 flex-col gap-1.5 rounded-cta border border-hairline bg-surface px-4 py-3.5 outline-none transition-colors hover:border-divider hover:bg-surface-muted focus-visible:ring-2 focus-visible:ring-ring lg:rounded-card lg:px-5 lg:py-4",
+ next && "col-start-2 items-end text-right",
+ )}
+ >
+ <span className="flex items-center gap-1.5 text-caption text-muted-foreground">
+ {!next && <ArrowIcon direction="left" className="size-3" />}
+ {next ? "Next" : "Previous"}
+ {next && <ArrowIcon className="size-3" />}
+ </span>
+ <span className="text-ui leading-[22px] font-medium text-foreground">
+ {page.name}
+ </span>
+ </Link>
+ );
+}
+
+/**
+ * Article foot: previous / next within the library, then "Edit this page on
+ * GitHub" with the source path. Mobile turns the edit link into a button and
+ * puts the path under it.
+ */
+export function PageFooter({
+ previous,
+ next,
+ sourcePath,
+}: {
+ previous?: PageNeighbour;
+ next?: PageNeighbour;
+ sourcePath: string;
+}) {
+ const editUrl = `${GITHUB_URL}/edit/main/${sourcePath}`;
+ return (
+ <footer className="flex flex-col gap-4 pt-6 lg:gap-5 lg:pt-11">
+ {(previous || next) && (
+ <nav
+ aria-label="Pagination"
+ className="grid grid-cols-2 gap-2 lg:gap-3"
+ >
+ {previous && <NeighbourCard page={previous} direction="previous" />}
+ {next && <NeighbourCard page={next} direction="next" />}
+ </nav>
+ )}
+ <div className="flex flex-col gap-2 lg:flex-row lg:items-center lg:justify-between lg:px-1">
+ <a
+ href={editUrl}
+ target="_blank"
+ rel="noreferrer"
+ className="flex h-11 w-fit items-center gap-2 rounded-control-sm bg-secondary px-3.5 text-small text-foreground outline-none transition-colors hover:bg-[#dcdde0] focus-visible:ring-2 focus-visible:ring-ring dark:hover:bg-[#33363b] lg:-mx-2 lg:h-8 lg:rounded-tile lg:bg-transparent lg:px-2 lg:text-muted-foreground lg:hover:bg-capsule lg:hover:text-foreground lg:dark:hover:bg-capsule"
+ >
+ <PencilIcon className="size-3.5" />
+ Edit this page on GitHub
+ </a>
+ <span className="truncate pl-1 font-mono text-mono text-subtle lg:pl-0">
+ {sourcePath}
+ </span>
+ </div>
+ </footer>
+ );
+}
diff --git a/components/docs/shell/page-header.tsx b/components/docs/shell/page-header.tsx
new file mode 100644
index 00000000..dc07b0fa
--- /dev/null
+++ b/components/docs/shell/page-header.tsx
@@ -0,0 +1,36 @@
+import { PageActions } from "./page-actions";
+import type { PageLinks } from "./page-links";
+
+/**
+ * Article head: the page actions ("Copy page" + agent menu) above the title
+ * on desktop, the title and the description. Below `lg` the actions drop
+ * under the description.
+ */
+export function PageHeader({
+ title,
+ description,
+ links,
+}: {
+ title: string;
+ description?: string;
+ links?: PageLinks;
+}) {
+ return (
+ <header className="flex flex-col gap-3 lg:gap-3.5 lg:pb-3">
+ {links && (
+ <div className="hidden min-h-8 justify-end lg:flex">
+ <PageActions links={links} alignToHeader />
+ </div>
+ )}
+ <h1 className="text-[34px] leading-9 font-medium tracking-heading text-balance text-foreground lg:text-h3 lg:leading-[52px]">
+ {title}
+ </h1>
+ {description && (
+ <p className="max-w-[620px] text-lg leading-[26px] text-pretty text-muted-foreground lg:text-lead lg:leading-7">
+ {description}
+ </p>
+ )}
+ {links && <PageActions links={links} className="lg:hidden" />}
+ </header>
+ );
+}
diff --git a/components/docs/shell/page-links.ts b/components/docs/shell/page-links.ts
new file mode 100644
index 00000000..07a9ba31
--- /dev/null
+++ b/components/docs/shell/page-links.ts
@@ -0,0 +1,23 @@
+const SITE_URL = "https://remocn.dev";
+
+export type PageLinks = {
+ markdown: string;
+ claude: string;
+ chatgpt: string;
+};
+
+/**
+ * Agent hand-offs for a docs page: the `.md` twin served by
+ * the `/llms.md` route (rewritten in next.config), and Claude / ChatGPT chats primed to read it.
+ */
+export function getPageLinks(url: string): PageLinks {
+ const markdown = `${url}.md`;
+ const prompt = encodeURIComponent(
+ `Read ${SITE_URL}${markdown}, I want to ask questions about it.`,
+ );
+ return {
+ markdown,
+ claude: `https://claude.ai/new?q=${prompt}`,
+ chatgpt: `https://chatgpt.com/?hints=search&q=${prompt}`,
+ };
+}
diff --git a/components/docs/shell/sections-sheet.tsx b/components/docs/shell/sections-sheet.tsx
new file mode 100644
index 00000000..00783312
--- /dev/null
+++ b/components/docs/shell/sections-sheet.tsx
@@ -0,0 +1,78 @@
+"use client";
+
+import { DocsSearchTrigger } from "@/components/docs/docs-search-trigger";
+import {
+ Sheet,
+ SheetClose,
+ SheetContent,
+ SheetTitle,
+} from "@/components/ui/sheet";
+import { cn } from "@/lib/utils";
+import { AgentsLink } from "./agents-link";
+import { CloseIcon } from "./docs-icons";
+import { LibrarySwitcher } from "./library-switcher";
+import type { SidebarModel } from "./sidebar-model";
+import { SidebarTree } from "./sidebar-tree";
+
+/**
+ * Mobile sidebar: a full-screen sheet opened from the docs page bar. Same
+ * library switcher and tree as the desktop sidebar, at touch sizes and
+ * without category icons. Following any link closes it.
+ */
+export function SectionsSheet({
+ open,
+ onOpenChange,
+ model,
+ activeUrl,
+}: {
+ open: boolean;
+ onOpenChange: (open: boolean) => void;
+ model: SidebarModel;
+ activeUrl: string;
+}) {
+ const close = () => onOpenChange(false);
+
+ return (
+ <Sheet open={open} onOpenChange={onOpenChange}>
+ <SheetContent
+ side="left"
+ showCloseButton={false}
+ // Full-width, so it slides in whole from the trigger's side instead
+ // of fading over the page (a fade double-exposes both layouts).
+ // Reduced motion keeps only a short fade.
+ className={cn(
+ "border-0 bg-background shadow-none data-[side=left]:w-full data-[side=left]:border-r-0 data-[side=left]:sm:max-w-none",
+ "transition-[translate,opacity] duration-300 ease-[cubic-bezier(0.32,0.72,0,1)] data-ending-style:duration-200 data-starting-style:opacity-100 data-ending-style:opacity-100 data-[side=left]:data-starting-style:-translate-x-full data-[side=left]:data-ending-style:-translate-x-full",
+ "motion-reduce:duration-150 motion-reduce:ease-out motion-reduce:data-ending-style:duration-100 motion-reduce:data-starting-style:opacity-0 motion-reduce:data-ending-style:opacity-0 motion-reduce:data-[side=left]:data-starting-style:translate-x-0 motion-reduce:data-[side=left]:data-ending-style:translate-x-0",
+ )}
+ >
+ <div className="flex items-center justify-between px-4 pt-4 pb-3">
+ <SheetTitle className="text-button-lg font-medium text-foreground">
+ Docs
+ </SheetTitle>
+ <SheetClose
+ aria-label="Close sections"
+ className="flex size-11 items-center justify-center rounded-control-sm bg-capsule text-foreground outline-none transition-colors hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ <CloseIcon className="size-4" />
+ </SheetClose>
+ </div>
+ <div className="flex flex-1 flex-col overflow-y-auto pb-[calc(1.5rem+env(safe-area-inset-bottom))]">
+ <div className="flex flex-col gap-3 px-4">
+ <LibrarySwitcher active={model.tab} size="lg" onNavigate={close} />
+ <DocsSearchTrigger className="h-11" onOpen={close} />
+ </div>
+ <div className="px-4 pt-4 pb-6">
+ <SidebarTree
+ model={model}
+ activeUrl={activeUrl}
+ size="lg"
+ onNavigate={close}
+ />
+ </div>
+ <AgentsLink className="px-4" />
+ </div>
+ </SheetContent>
+ </Sheet>
+ );
+}
diff --git a/components/docs/shell/sidebar-group.tsx b/components/docs/shell/sidebar-group.tsx
new file mode 100644
index 00000000..a6c60999
--- /dev/null
+++ b/components/docs/shell/sidebar-group.tsx
@@ -0,0 +1,326 @@
+"use client";
+
+import Link from "next/link";
+import { useEffect, useId, useState } from "react";
+import { NewBadge } from "@/components/docs/new-badge";
+import type { DocsTabId } from "@/lib/docs-tabs";
+import { cn } from "@/lib/utils";
+import { ChevronIcon, FilterIcon, GroupIcon } from "./docs-icons";
+import type { SidebarGroup as Group, SidebarEntry } from "./sidebar-model";
+
+/** Long categories show their first few pages and a "Show all" row. */
+const PREVIEW = 7;
+const TRUNCATE_OVER = 24;
+/** Categories this big get a filter field when open. */
+const FILTER_FROM = 10;
+
+export type SidebarSize = "md" | "lg";
+
+const ROW = {
+ md: "h-[34px] gap-2.5 rounded-[10px] px-2.5 text-small",
+ lg: "h-10 gap-2.5 text-[15px] leading-5 font-medium text-foreground",
+};
+
+const ITEM = {
+ md: "h-8 pr-2.5 text-small",
+ lg: "h-[38px] pr-2.5 text-[15px] leading-5",
+};
+
+function visibleEntries(
+ entries: SidebarEntry[],
+ query: string,
+ expanded: boolean,
+ activeUrl: string,
+): { list: SidebarEntry[]; truncated: boolean } {
+ const q = query.trim().toLowerCase();
+ if (q) {
+ return {
+ list: entries.filter(
+ (e) => e.kind === "page" && e.name.toLowerCase().includes(q),
+ ),
+ truncated: false,
+ };
+ }
+ const pages = entries.filter((e) => e.kind === "page");
+ const activeAt = pages.findIndex(
+ (e) => e.kind === "page" && e.url === activeUrl,
+ );
+ if (expanded || pages.length <= TRUNCATE_OVER || activeAt >= PREVIEW) {
+ return { list: entries, truncated: false };
+ }
+ const list: SidebarEntry[] = [];
+ let shown = 0;
+ for (const entry of entries) {
+ if (shown === PREVIEW) break;
+ list.push(entry);
+ if (entry.kind === "page") shown++;
+ }
+ return { list, truncated: true };
+}
+
+function EntryRow({
+ entry,
+ activeUrl,
+ size,
+ plain,
+ onNavigate,
+}: {
+ entry: SidebarEntry;
+ activeUrl: string;
+ size: SidebarSize;
+ plain: boolean;
+ onNavigate?: () => void;
+}) {
+ if (entry.kind === "label") {
+ return (
+ <span
+ className={cn(
+ "flex h-[30px] items-center text-caption text-subtle",
+ plain ? "pl-9" : "border-l border-divider",
+ !plain && (size === "md" ? "pl-[18px]" : "pl-3.5"),
+ )}
+ >
+ {entry.name}
+ </span>
+ );
+ }
+
+ const active = entry.url === activeUrl;
+ return (
+ <Link
+ href={entry.url}
+ aria-current={active ? "page" : undefined}
+ onClick={onNavigate}
+ className={cn(
+ "flex shrink-0 items-center gap-1.5 outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
+ ITEM[size],
+ plain
+ ? "rounded-[10px] pl-9 hover:bg-capsule"
+ : active
+ ? cn(
+ "border-l-2 border-primary",
+ size === "md" ? "pl-[17px]" : "pl-[13px]",
+ )
+ : cn(
+ "rounded-r-tile border-l border-divider hover:bg-capsule",
+ size === "md" ? "pl-[18px]" : "pl-3.5",
+ ),
+ active
+ ? "font-medium text-foreground"
+ : "text-muted-foreground hover:text-foreground",
+ )}
+ >
+ <span className="min-w-0 truncate">{entry.name}</span>
+ {entry.isNew && <NewBadge />}
+ </Link>
+ );
+}
+
+/**
+ * One sidebar category: the row (icon, name, "N new", count, chevron) and,
+ * when open, its pages behind a hairline rail. The open category holding the
+ * current page gets a filter field and, past `TRUNCATE_OVER` pages, shows
+ * only the first `PREVIEW` with a "Show all" row.
+ */
+export function SidebarGroup({
+ group,
+ tab,
+ activeUrl,
+ size = "md",
+ onNavigate,
+}: {
+ group: Group;
+ tab: DocsTabId;
+ activeUrl: string;
+ size?: SidebarSize;
+ onNavigate?: () => void;
+}) {
+ const containsActive =
+ group.indexUrl === activeUrl ||
+ group.entries.some((e) => e.kind === "page" && e.url === activeUrl);
+ const pinned = group.pinned && size === "md";
+ const [open, setOpen] = useState(containsActive || pinned);
+ const [expanded, setExpanded] = useState(false);
+ const [query, setQuery] = useState("");
+ const listId = useId();
+
+ useEffect(() => {
+ if (containsActive) setOpen(true);
+ }, [containsActive]);
+
+ const { list, truncated } = visibleEntries(
+ group.entries,
+ query,
+ expanded,
+ activeUrl,
+ );
+ const lit = open || containsActive;
+ const plain = pinned && !containsActive;
+ const pageCount = group.entries.filter((e) => e.kind === "page").length;
+ const showFilter = open && pageCount >= FILTER_FROM;
+
+ const head = (
+ <>
+ {size === "md" && (
+ <GroupIcon
+ tab={tab}
+ group={group.id}
+ className={cn(
+ "size-4 shrink-0",
+ lit || pinned ? "text-foreground" : "text-body",
+ )}
+ />
+ )}
+ <span
+ className={cn(
+ "flex min-w-0 flex-1 items-center gap-[7px]",
+ size === "md" &&
+ (lit || pinned ? "font-medium text-foreground" : "text-body"),
+ )}
+ >
+ <span className="truncate">{group.name}</span>
+ {group.newCount > 0 && <NewBadge count={group.newCount} />}
+ </span>
+ {(group.showCount || size === "lg") && (
+ <span
+ className={cn(
+ "w-7 shrink-0 text-right tabular-nums",
+ size === "md" ? "text-mono" : "text-caption",
+ lit ? "text-muted-foreground" : "text-subtle",
+ )}
+ >
+ {group.count}
+ </span>
+ )}
+ </>
+ );
+
+ const chevron = (
+ <ChevronIcon
+ className={cn(
+ "size-3.5 shrink-0",
+ open && "rotate-90",
+ lit ? "text-foreground" : "text-subtle",
+ )}
+ />
+ );
+
+ const toggle = () => setOpen((value) => !value);
+
+ return (
+ <div className={cn("flex flex-col", open && "gap-1 pb-1.5")}>
+ {pinned ? (
+ <div className={cn("flex items-center", ROW[size])}>{head}</div>
+ ) : group.indexUrl ? (
+ <div
+ className={cn(
+ "flex items-center",
+ ROW[size],
+ size === "md" && "hover:bg-capsule",
+ )}
+ >
+ <Link
+ href={group.indexUrl}
+ onClick={() => {
+ setOpen(true);
+ onNavigate?.();
+ }}
+ aria-current={group.indexUrl === activeUrl ? "page" : undefined}
+ className="flex min-w-0 flex-1 items-center gap-2.5 self-stretch rounded-tile outline-none focus-visible:ring-2 focus-visible:ring-ring"
+ >
+ {head}
+ </Link>
+ <button
+ type="button"
+ onClick={toggle}
+ aria-expanded={open}
+ aria-controls={listId}
+ aria-label={`${open ? "Collapse" : "Expand"} ${group.name}`}
+ className={cn(
+ "relative flex size-3.5 shrink-0 items-center justify-center rounded-tag outline-none before:absolute before:rounded-tag before:content-[''] focus-visible:ring-2 focus-visible:ring-ring [&>svg]:relative",
+ // The sheet's chevron gets a 44px touch target.
+ size === "md"
+ ? "before:-inset-[5px] hover:before:bg-secondary"
+ : "before:-inset-[15px]",
+ )}
+ >
+ {chevron}
+ </button>
+ </div>
+ ) : (
+ <button
+ type="button"
+ onClick={toggle}
+ aria-expanded={open}
+ aria-controls={listId}
+ className={cn(
+ "flex w-full items-center text-left outline-none focus-visible:ring-2 focus-visible:ring-ring",
+ ROW[size],
+ size === "md" && "hover:bg-capsule",
+ )}
+ >
+ {head}
+ {chevron}
+ </button>
+ )}
+
+ {open && (
+ <div
+ id={listId}
+ className={cn(
+ "flex flex-col gap-1.5",
+ !plain && (size === "md" ? "pl-[17px]" : "pl-0.5"),
+ )}
+ >
+ {showFilter && (
+ <label className="flex h-8 shrink-0 items-center gap-2 rounded-[10px] border border-divider bg-surface px-2.5 focus-within:ring-2 focus-within:ring-ring">
+ <FilterIcon className="size-3.5 shrink-0 text-subtle" />
+ <input
+ type="search"
+ value={query}
+ onChange={(event) => setQuery(event.target.value)}
+ placeholder={`Filter ${pageCount} in ${group.name}`}
+ aria-label={`Filter ${group.name}`}
+ className={cn(
+ "min-w-0 flex-1 bg-transparent text-foreground outline-none placeholder:text-subtle dark:placeholder:text-muted-foreground",
+ size === "md" ? "text-caption" : "text-base",
+ )}
+ />
+ </label>
+ )}
+ <div className="flex flex-col">
+ {list.map((entry, i) => (
+ <EntryRow
+ key={entry.kind === "page" ? entry.url : `${entry.name}-${i}`}
+ entry={entry}
+ activeUrl={activeUrl}
+ size={size}
+ plain={plain}
+ onNavigate={onNavigate}
+ />
+ ))}
+ {query && list.length === 0 && (
+ <span className="flex h-8 items-center border-l border-divider pl-[18px] text-caption text-subtle">
+ Nothing matches
+ </span>
+ )}
+ {truncated && (
+ <button
+ type="button"
+ onClick={() => setExpanded(true)}
+ className="flex h-8 shrink-0 items-center gap-1.5 rounded-r-tile border-l border-divider pr-2.5 pl-[18px] text-left outline-none hover:bg-capsule focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset"
+ >
+ <span className="text-caption text-foreground">
+ Show all {group.count}
+ </span>
+ <span className="text-micro text-subtle dark:text-muted-foreground">
+ {group.count - PREVIEW} more
+ </span>
+ </button>
+ )}
+ </div>
+ </div>
+ )}
+ </div>
+ );
+}
diff --git a/components/docs/shell/sidebar-model.ts b/components/docs/shell/sidebar-model.ts
new file mode 100644
index 00000000..2daa6d64
--- /dev/null
+++ b/components/docs/shell/sidebar-model.ts
@@ -0,0 +1,154 @@
+import type { Folder, Item, Node, Root } from "fumadocs-core/page-tree";
+import { NEW_BADGE_PATHS } from "@/config/site";
+import type { DocsTabId } from "@/lib/docs-tabs";
+
+/**
+ * Plain, serialisable view of one library's sidebar. Built on the server from
+ * the fumadocs page tree (after `splitDocsTree`), so the client sidebar only
+ * gets strings and numbers: names for filtering, urls for the active state,
+ * counts and "new" flags for the row badges.
+ */
+export type SidebarEntry =
+ | { kind: "page"; name: string; url: string; isNew: boolean }
+ | { kind: "label"; name: string };
+
+export type SidebarGroup = {
+ /** Folder slug (`typography`, `getting-started`), keys the row icon. */
+ id: string;
+ name: string;
+ /** Category landing page (`/docs/typography`), when the folder has one. */
+ indexUrl?: string;
+ entries: SidebarEntry[];
+ /** Pages in the group, the folder index excluded. */
+ count: number;
+ /** How many of those pages are listed in `NEW_BADGE_PATHS`. */
+ newCount: number;
+ /** "Getting started" stays open; it and "Overview" carry no count. */
+ pinned: boolean;
+ showCount: boolean;
+};
+
+export type SidebarModel = { tab: DocsTabId; groups: SidebarGroup[] };
+
+const PINNED = "getting-started";
+
+function pageName(item: Item): string {
+ return typeof item.name === "string" ? item.name : item.url;
+}
+
+function pagesOf(folder: Folder): Item[] {
+ const out: Item[] = [];
+ const walk = (node: Node) => {
+ if (node.type === "page") out.push(node);
+ else if (node.type === "folder") {
+ if (node.index) out.push(node.index);
+ node.children.forEach(walk);
+ }
+ };
+ walk(folder);
+ return out;
+}
+
+/**
+ * The folder's url base: the segments every page shares
+ * (`/docs/typography` + `/docs/typography/a` → `/docs/typography`), or the
+ * lone page's directory.
+ */
+function folderBase(folder: Folder): string {
+ const urls = pagesOf(folder).map((p) => p.url.split("/"));
+ if (urls.length === 0) return "";
+ if (urls.length === 1) return urls[0].slice(0, -1).join("/");
+ const common: string[] = [];
+ for (const [i, segment] of urls[0].entries()) {
+ if (urls.some((u) => u[i] !== segment)) break;
+ common.push(segment);
+ }
+ return common.join("/");
+}
+
+function toEntries(nodes: Node[], skipUrl?: string): SidebarEntry[] {
+ return nodes.flatMap((node): SidebarEntry[] => {
+ if (node.type === "separator") {
+ return typeof node.name === "string"
+ ? [{ kind: "label", name: node.name }]
+ : [];
+ }
+ if (node.type === "folder") {
+ // Nested folders flatten into a labelled run, like the guides' separators.
+ const inner = toEntries(
+ node.index ? [node.index, ...node.children] : node.children,
+ );
+ return typeof node.name === "string"
+ ? [{ kind: "label", name: node.name }, ...inner]
+ : inner;
+ }
+ if (node.url === skipUrl) return [];
+ return [
+ {
+ kind: "page",
+ name: pageName(node),
+ url: node.url,
+ isNew: NEW_BADGE_PATHS.has(node.url),
+ },
+ ];
+ });
+}
+
+function toGroup(folder: Folder): SidebarGroup {
+ const base = folderBase(folder);
+ const id = base.split("/").at(-1) ?? "";
+ const indexUrl =
+ folder.index?.url ??
+ folder.children.find((n): n is Item => n.type === "page" && n.url === base)
+ ?.url;
+ const entries = toEntries(folder.children, indexUrl);
+ const pages = entries.filter((e) => e.kind === "page");
+ return {
+ id,
+ name: typeof folder.name === "string" ? folder.name : id,
+ indexUrl,
+ entries,
+ count: pages.length,
+ newCount: pages.filter((e) => e.kind === "page" && e.isNew).length,
+ pinned: id === PINNED,
+ showCount: id !== PINNED,
+ };
+}
+
+/**
+ * Turns one tab's tree into sidebar groups. Loose root pages (Primitives'
+ * Introduction / Concepts / Installation, the template pages, the icon
+ * gallery) collect into one leading group: "Overview" when the tab also has
+ * folders, the library name when the loose pages are the whole tab.
+ */
+export function buildSidebarModel(
+ tab: DocsTabId,
+ label: string,
+ tree: Root,
+ counts: Partial<Record<string, number>> = {},
+): SidebarModel {
+ const loose = tree.children.filter((n): n is Item => n.type === "page");
+ const folders = tree.children.filter((n): n is Folder => n.type === "folder");
+ const groups = folders.map(toGroup);
+
+ if (loose.length > 0) {
+ const entries = toEntries(loose);
+ groups.unshift({
+ id: tab,
+ name: folders.length > 0 ? "Overview" : label,
+ entries,
+ count: entries.length,
+ newCount: entries.filter((e) => e.kind === "page" && e.isNew).length,
+ pinned: false,
+ showCount: folders.length === 0,
+ });
+ }
+
+ return {
+ tab,
+ groups: groups.map((group) => ({
+ ...group,
+ count: counts[group.id] ?? group.count,
+ })),
+ };
+}
diff --git a/components/docs/shell/sidebar-tree.tsx b/components/docs/shell/sidebar-tree.tsx
new file mode 100644
index 00000000..08110e4e
--- /dev/null
+++ b/components/docs/shell/sidebar-tree.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { cn } from "@/lib/utils";
+import { SidebarGroup, type SidebarSize } from "./sidebar-group";
+import type { SidebarModel } from "./sidebar-model";
+
+/**
+ * The category list. On desktop "Getting started" sits in its own block above
+ * the rest, spaced like any two categories; in the mobile sheet every group
+ * is one flat list.
+ */
+export function SidebarTree({
+ model,
+ activeUrl,
+ size = "md",
+ onNavigate,
+}: {
+ model: SidebarModel;
+ activeUrl: string;
+ size?: SidebarSize;
+ onNavigate?: () => void;
+}) {
+ const split = size === "md";
+ const pinned = split ? model.groups.filter((g) => g.pinned) : [];
+ const rest = split ? model.groups.filter((g) => !g.pinned) : model.groups;
+
+ const render = (group: SidebarModel["groups"][number]) => (
+ <SidebarGroup
+ key={`${model.tab}:${group.id}`}
+ group={group}
+ tab={model.tab}
+ activeUrl={activeUrl}
+ size={size}
+ onNavigate={onNavigate}
+ />
+ );
+
+ return (
+ <nav aria-label="Docs" className="flex flex-col gap-0.5">
+ {pinned.map(render)}
+ {rest.length > 0 && (
+ <div className={cn("flex flex-col", split && "gap-0.5")}>
+ {rest.map(render)}
+ </div>
+ )}
+ </nav>
+ );
+}
diff --git a/components/docs/shell/sponsors-card.tsx b/components/docs/shell/sponsors-card.tsx
new file mode 100644
index 00000000..749a6c6f
--- /dev/null
+++ b/components/docs/shell/sponsors-card.tsx
@@ -0,0 +1,122 @@
+import { existsSync, readFileSync } from "node:fs";
+import path from "node:path";
+import Image from "next/image";
+import Link from "next/link";
+import { getDocsSponsors, type Sponsor } from "@/config/sponsors";
+import { cn } from "@/lib/utils";
+import { ArrowIcon } from "./docs-icons";
+
+/** Wordmark heights (px) from the rail artboard; the rest sit at 16px. */
+const WORDMARK_HEIGHT: Record<string, number> = {
+ neon: 22,
+ vidrush: 14,
+};
+
+/**
+ * Width of a local logo drawn `height` px tall, from the SVG viewBox or the
+ * PNG header, so the image's size attributes match what's drawn (next/image
+ * warns otherwise).
+ */
+function widthAt(src: string, height: number): number {
+ if (src.startsWith("/") && src.endsWith(".png")) {
+ const png = readFileSync(path.join(process.cwd(), "public", src));
+ return Math.round((height * png.readUInt32BE(16)) / png.readUInt32BE(20));
+ }
+ if (src.startsWith("/") && src.endsWith(".svg")) {
+ const svg = readFileSync(path.join(process.cwd(), "public", src), "utf8");
+ const box =
+ /viewBox="[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)"/.exec(svg);
+ if (box) return Math.round((height * Number(box[1])) / Number(box[2]));
+ }
+ return height * 5;
+}
+
+/** The card is always dark: prefer a `-dark` logo, else whiten the light one. */
+function darkLogo(sponsor: Sponsor): { src: string; invert: boolean } {
+ const { logoUrl } = sponsor;
+ if (logoUrl.startsWith("/")) {
+ const ext = path.extname(logoUrl);
+ const dark = `${logoUrl.slice(0, -ext.length)}-dark${ext}`;
+ if (existsSync(path.join(process.cwd(), "public", dark))) {
+ return { src: dark, invert: false };
+ }
+ }
+ return { src: logoUrl, invert: true };
+}
+
+function SponsorLogo({ sponsor }: { sponsor: Sponsor }) {
+ const logo = darkLogo(sponsor);
+ const mark = sponsor.displayName && sponsor.layout === "row";
+ const height = mark ? 15 : (WORDMARK_HEIGHT[sponsor.id] ?? 16);
+ const width = mark ? 15 : widthAt(logo.src, height);
+ return (
+ <a
+ href={sponsor.website}
+ target="_blank"
+ rel="noreferrer"
+ className="-mx-1.5 flex h-6 items-center gap-[7px] rounded-tag px-1.5 outline-none transition-colors hover:bg-white/[0.06] focus-visible:ring-2 focus-visible:ring-white/40"
+ >
+ <Image
+ src={logo.src}
+ alt={mark ? "" : sponsor.name}
+ // Tiny logos: resizing them only rounds the ratio off. The box is
+ // pinned to the exact attribute size so the drawn ratio matches.
+ unoptimized
+ width={width}
+ height={height}
+ style={{ width, height }}
+ className={cn(
+ "shrink-0",
+ mark && "rounded-[4px]",
+ logo.invert && "invert",
+ )}
+ />
+ {mark && (
+ <span className="text-mono leading-[15px] font-semibold tracking-title text-[#FAFAFA]">
+ {sponsor.displayName}
+ </span>
+ )}
+ </a>
+ );
+}
+
+/**
+ * "End credits / Made possible by": the sponsors placed in the docs (see
+ * `getDocsSponsors`) as a mini credits card, with "Roll your name in" to
+ * /sponsors. Ink on light pages, the night surface on dark ones.
+ */
+export function SponsorsCard({ className }: { className?: string }) {
+ const sponsors = getDocsSponsors();
+ return (
+ <aside
+ aria-label="Sponsors"
+ className={cn(
+ "flex flex-col gap-4 rounded-capsule bg-dark-surface px-2.5 pt-[18px] pb-2.5 xl:gap-3.5 xl:pt-4 dark:border dark:border-hairline dark:bg-surface",
+ className,
+ )}
+ >
+ <div className="flex flex-col items-center gap-0.5 text-center">
+ <p className="text-caption text-[#8B979C] xl:text-mono">End credits</p>
+ <p className="text-ui leading-[22px] text-[#FAFAFA] xl:text-[15px] xl:leading-5">
+ Made possible by
+ </p>
+ </div>
+ {sponsors.length > 0 && (
+ <ul className="flex flex-wrap items-center justify-center gap-x-[22px] gap-y-3.5 px-3 xl:flex-col xl:flex-nowrap xl:gap-3 xl:px-0 xl:py-1">
+ {sponsors.map((sponsor) => (
+ <li key={sponsor.id} className="flex">
+ <SponsorLogo sponsor={sponsor} />
+ </li>
+ ))}
+ </ul>
+ )}
+ <Link
+ href="/sponsors"
+ className="flex h-11 items-center justify-center gap-1.5 rounded-[10px] bg-[#FAFAFA] text-small leading-[18px] text-[#0E1012] outline-none transition-colors hover:bg-white focus-visible:ring-2 focus-visible:ring-white/40 xl:h-8 xl:rounded-tile xl:text-mono dark:bg-[#F4F4F5]"
+ >
+ Roll your name in
+ <ArrowIcon className="size-3" />
+ </Link>
+ </aside>
+ );
+}
diff --git a/components/docs/shell/studio-promo.tsx b/components/docs/shell/studio-promo.tsx
new file mode 100644
index 00000000..7e9c0e70
--- /dev/null
+++ b/components/docs/shell/studio-promo.tsx
@@ -0,0 +1,109 @@
+import {
+ AppleIcon,
+ LinuxIcon,
+} from "@/app/(home)/components/landing/ui/brand-icons";
+import { StudioAppIcon } from "@/app/(home)/components/landing/ui/remocn-mark";
+import { STUDIO_URL } from "@/config/site";
+import { cn } from "@/lib/utils";
+
+/** Tiny Studio window: chat column on the left, the dark stage on the right. */
+function MiniWindow({ className }: { className?: string }) {
+ return (
+ <div
+ aria-hidden="true"
+ className={cn(
+ "flex shrink-0 flex-col gap-1.5 rounded-[10px] bg-surface-muted p-2",
+ className,
+ )}
+ >
+ <div className="flex gap-1">
+ {[0, 1, 2].map((dot) => (
+ <span key={dot} className="size-1.5 rounded-full bg-divider" />
+ ))}
+ </div>
+ <div className="flex flex-1 gap-1.5 max-xl:flex-col">
+ <div className="flex w-16 shrink-0 flex-col gap-1 pt-0.5">
+ <span className="h-3 w-14 rounded-[4px] bg-surface dark:bg-secondary" />
+ <span className="h-3 w-[42px] rounded-[4px] bg-primary-tint" />
+ <span className="h-3 w-[50px] rounded-[4px] bg-surface max-xl:hidden dark:bg-secondary" />
+ </div>
+ <div className="flex flex-1 flex-col justify-between rounded-tag bg-dark-surface p-1.5">
+ <div className="flex flex-1 items-center justify-center">
+ <span className="rounded-[3px] border border-[#F0ABFC] px-1 py-0.5">
+ <span className="block h-[5px] w-9 rounded-[2px] bg-[#F5F5F5]" />
+ </span>
+ </div>
+ <div className="flex items-center gap-1">
+ <span className="size-1.5 rounded-[2px] bg-white" />
+ <span className="h-[3px] flex-1 rounded-[2px] bg-white/14" />
+ </div>
+ </div>
+ </div>
+ </div>
+ );
+}
+
+/**
+ * Compact "Download for free" for the rail: ink on light, near-white on dark,
+ * with the macOS / Linux badges ringed in the button colour. Badge corners
+ * follow the button's: 12px minus the inset (8px below `xl`, 5px from it).
+ */
+function DownloadButton() {
+ const badge =
+ "flex size-[26px] items-center justify-center rounded-[4px] shadow-[0_0_0_1.5px_#0E1012] xl:rounded-[7px] dark:shadow-[0_0_0_1.5px_#F4F4F5]";
+ return (
+ <a
+ href={STUDIO_URL}
+ target="_blank"
+ rel="noreferrer"
+ data-track="cta_clicked"
+ data-cta="studio_download_docs"
+ data-destination={STUDIO_URL}
+ className="mt-1 flex h-11 w-fit shrink-0 items-center gap-[9px] rounded-control-sm bg-[#0E1012] pr-3.5 pl-2 text-caption text-white outline-none transition-colors hover:bg-[#0E1012]/90 focus-visible:ring-2 focus-visible:ring-ring xl:mt-0 xl:h-9 xl:pl-[5px] dark:bg-[#F4F4F5] dark:text-[#0E1012] dark:hover:bg-white"
+ >
+ <span className="relative flex h-[26px] w-[45px] shrink-0">
+ <span className={cn(badge, "absolute left-0 bg-white text-[#0E1012]")}>
+ <AppleIcon className="size-3" />
+ </span>
+ <span
+ className={cn(
+ badge,
+ "absolute left-[19px] bg-[#FDE68A] text-[#0E1012]",
+ )}
+ >
+ <LinuxIcon className="size-3.5" />
+ </span>
+ </span>
+ Download for free
+ </a>
+ );
+}
+
+/**
+ * Remocn Studio card. Rail (desktop): window on top, copy below. Under the
+ * article on smaller screens it turns into a row.
+ */
+export function StudioPromo({ className }: { className?: string }) {
+ return (
+ <aside
+ aria-label="Remocn Studio"
+ className={cn(
+ "flex gap-3.5 rounded-capsule border border-hairline bg-surface p-2 xl:flex-col xl:gap-2.5",
+ className,
+ )}
+ >
+ <MiniWindow className="w-28 xl:h-24 xl:w-auto" />
+ <div className="flex min-w-0 flex-1 flex-col gap-1.5 pt-1 pr-1 pb-0.5 xl:px-1.5 xl:pt-0 xl:pb-0">
+ <p className="flex items-center gap-2 text-small leading-[18px] font-medium text-foreground">
+ <StudioAppIcon size={20} radius={5} markSize={12} />
+ Remocn Studio
+ </p>
+ <p className="text-caption leading-[19px] text-muted-foreground">
+ Describe a video in chat, click the thing that looks wrong, and export
+ an mp4 without touching a terminal.
+ </p>
+ <DownloadButton />
+ </div>
+ </aside>
+ );
+}
diff --git a/components/docs/shell/switcher-tip.tsx b/components/docs/shell/switcher-tip.tsx
new file mode 100644
index 00000000..1a1eb58e
--- /dev/null
+++ b/components/docs/shell/switcher-tip.tsx
@@ -0,0 +1,97 @@
+"use client";
+
+import { AnimatePresence, motion, useReducedMotion } from "motion/react";
+import { useEffect, useState } from "react";
+import { createPortal } from "react-dom";
+
+/** `keyboard`: opened by focus, so it appears and swaps without motion. */
+export type TipState = {
+ label: string;
+ left: number;
+ top: number;
+ keyboard?: boolean;
+};
+
+const EASE_OUT = [0.23, 1, 0.32, 1] as const;
+const INSTANT = { duration: 0 };
+
+export function SwitcherTip({
+ tip,
+ onDismiss,
+}: {
+ tip: TipState | null;
+ onDismiss: () => void;
+}) {
+ const reduced = useReducedMotion() ?? false;
+ const open = tip !== null;
+ const instant = tip?.keyboard ?? false;
+ const [mounted, setMounted] = useState(false);
+
+ useEffect(() => setMounted(true), []);
+
+ useEffect(() => {
+ if (!open) return;
+ window.addEventListener("scroll", onDismiss, {
+ capture: true,
+ passive: true,
+ });
+ return () =>
+ window.removeEventListener("scroll", onDismiss, { capture: true });
+ }, [open, onDismiss]);
+
+ if (!mounted) return null;
+
+ return createPortal(
+ <AnimatePresence>
+ {tip && (
+ <motion.div
+ aria-hidden="true"
+ // Full transform strings run off the main thread, which the docs
+ // player keeps busy.
+ initial={{
+ opacity: 0,
+ transform: reduced ? "translateX(0px)" : "translateX(-6px)",
+ }}
+ animate={{ opacity: 1, transform: "translateX(0px)" }}
+ exit={{ opacity: 0, transition: { duration: 0.1, ease: "easeOut" } }}
+ transition={instant ? INSTANT : { duration: 0.18, ease: EASE_OUT }}
+ style={{ left: tip.left, top: tip.top }}
+ className="pointer-events-none fixed z-50 -translate-y-1/2"
+ >
+ <motion.div
+ layout={!reduced}
+ transition={{
+ layout: instant ? INSTANT : { duration: 0.2, ease: EASE_OUT },
+ }}
+ style={{ borderRadius: 10 }}
+ className="flex h-[34px] items-center overflow-hidden border border-divider bg-surface px-3.5 text-small whitespace-nowrap text-foreground shadow-[0_1px_2px_#0E10120F]"
+ >
+ <AnimatePresence mode="popLayout" initial={false}>
+ <motion.span
+ key={tip.label}
+ layout={reduced ? false : "position"}
+ initial={
+ reduced
+ ? { opacity: 0 }
+ : { opacity: 0, y: 6, filter: "blur(2px)" }
+ }
+ animate={{ opacity: 1, y: 0, filter: "blur(0px)" }}
+ exit={
+ reduced
+ ? { opacity: 0 }
+ : { opacity: 0, y: -6, filter: "blur(2px)" }
+ }
+ transition={
+ instant ? INSTANT : { duration: 0.16, ease: EASE_OUT }
+ }
+ >
+ {tip.label}
+ </motion.span>
+ </AnimatePresence>
+ </motion.div>
+ </motion.div>
+ )}
+ </AnimatePresence>,
+ document.body,
+ );
+}
diff --git a/components/docs/studio-actions.tsx b/components/docs/studio-actions.tsx
index 85c2c9a3..63bf75d5 100644
--- a/components/docs/studio-actions.tsx
+++ b/components/docs/studio-actions.tsx
@@ -6,14 +6,26 @@ import {
type StudioElementPayload,
setStudioDragData,
} from "@remotion/studio-protocol";
-import { GripVerticalIcon, Loader2Icon } from "lucide-react";
+import { Loader2Icon } from "lucide-react";
import { useEffect, useLayoutEffect, useRef, useState } from "react";
-import { Button } from "@/components/ui/button";
-import { Remotion } from "@/components/ui/svgs/remotion";
import { useTrackEvent } from "@/lib/analytics";
+import { cn } from "@/lib/utils";
type Status = "idle" | "pending" | "success" | "error";
+/** Raised button on the dark player toolbar. */
+const STUDIO_BUTTON =
+ "flex h-[34px] shrink-0 cursor-pointer items-center rounded-control-sm border border-dark-border bg-dark-raised text-caption whitespace-nowrap text-[#fafafa] outline-none transition-colors duration-150 hover:bg-[#25282b] focus-visible:ring-2 focus-visible:ring-white/40 disabled:cursor-default dark:border-hairline dark:bg-secondary dark:hover:bg-[#33363b]";
+
+const GRIP_DOTS = [
+ [9, 6],
+ [15, 6],
+ [9, 12],
+ [15, 12],
+ [9, 18],
+ [15, 18],
+] as const;
+
export function StudioActions({
name,
payload,
@@ -67,43 +79,60 @@ export function StudioActions({
};
return (
- <div className="flex min-w-0 items-center gap-1.5">
- {message ? (
- <output
- aria-live="polite"
- className="truncate text-xs text-muted-foreground"
- >
- {message}
- </output>
- ) : null}
- <Button
- variant="outline"
- size="sm"
+ <div className="flex min-w-0 items-center gap-1">
+ <output
+ aria-live="polite"
+ className="truncate text-mono text-dark-subtle max-md:sr-only"
+ >
+ {message}
+ </output>
+ <button
+ type="button"
onClick={handleInstall}
disabled={status === "pending"}
- className="text-muted-foreground hover:text-foreground"
+ className={cn(STUDIO_BUTTON, "gap-2 px-3 max-md:h-11 max-md:gap-[7px]")}
>
{status === "pending" ? (
- <Loader2Icon className="size-3.5 animate-spin" />
+ <Loader2Icon className="size-3.5 animate-spin motion-reduce:animate-[spin_2s_linear_infinite]" />
) : (
- <Remotion className="size-3.5" />
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-3.5">
+ <path
+ d="M7 4.5v15l12.5-7.5Z"
+ fill="none"
+ stroke="currentColor"
+ strokeWidth="1.8"
+ strokeLinejoin="round"
+ />
+ </svg>
)}
{status === "success"
? "Sent to Remotion Studio"
: "Add to Remotion Studio"}
- </Button>
+ </button>
{isEmbeddedInStudio === false ? (
- <Button
- variant="outline"
- size="icon-sm"
+ <button
+ type="button"
draggable
onDragStart={handleDragStart}
aria-label="Drag into Remotion Studio"
title="Drag into Remotion Studio"
- className="cursor-grab text-muted-foreground hover:text-foreground active:cursor-grabbing"
+ className={cn(
+ STUDIO_BUTTON,
+ "w-[34px] cursor-grab justify-center text-dark-subtle active:cursor-grabbing max-md:hidden",
+ )}
>
- <GripVerticalIcon className="size-3.5" />
- </Button>
+ <svg viewBox="0 0 24 24" aria-hidden="true" className="size-3.5">
+ {GRIP_DOTS.map(([cx, cy]) => (
+ <circle
+ key={`${cx}-${cy}`}
+ cx={cx}
+ cy={cy}
+ r="1.5"
+ fill="currentColor"
+ />
+ ))}
+ </svg>
+ </button>
) : null}
</div>
);
diff --git a/components/docs/ui-component-preview.tsx b/components/docs/ui-component-preview.tsx
index 56b02473..513973e7 100644
--- a/components/docs/ui-component-preview.tsx
+++ b/components/docs/ui-component-preview.tsx
@@ -1,22 +1,14 @@
"use client";
-import { CheckIcon, LinkIcon, RotateCcwIcon } from "lucide-react";
-import { useQueryStates } from "nuqs";
-import { Suspense, use, useEffect, useMemo, useRef, useState } from "react";
-import { CodeBlock } from "@/components/docs/code-block";
-import { Button } from "@/components/ui/button";
-import {
- Frame,
- FrameHeader,
- FramePanel,
- FrameTitle,
-} from "@/components/ui/frame";
-import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
-import { useTrackEvent } from "@/lib/analytics";
-import { type ControlConfig, getDefaults } from "@/lib/customizer-config";
-import { buildParsers, PreviewStage } from "@/lib/ui-preview-internals";
+import { Suspense, use, useMemo } from "react";
+import type { ControlConfig } from "@/lib/customizer-config";
+import { cn } from "@/lib/utils";
import registry, { loadComponentConfig } from "@/registry/__index__";
-import { ComponentCustomizer } from "./component-customizer";
+import { CustomizePanel } from "./blocks/customize-panel";
+import { DocsPlayer } from "./blocks/player/docs-player";
+import { PlayerFallback, UnknownBlock } from "./blocks/player/player-fallback";
+import { BLOCK_SPACING } from "./blocks/spacing";
+import { useCustomizer } from "./blocks/use-customizer";
import {
loadUiScene,
UI_PREVIEW_TIMING,
@@ -24,34 +16,23 @@ import {
type UiPreviewTiming,
} from "./examples/ui-preview-scenes";
-/** Shared "Unknown component" fallback — matches the existing docs widgets. */
-function UnknownComponent({ name }: { name: string }) {
- return (
- <div className="not-prose mb-6 rounded-lg border border-fd-border p-4 text-sm text-fd-muted-foreground">
- Unknown component: <code>{name}</code>
- </div>
- );
-}
-
export function UiComponentPreview({ name }: { name: string }) {
const timing = UI_PREVIEW_TIMING[name];
const entry = registry[name];
- // Q1 — join the example timing with the registry config (controls) and a lazy
- // scene loader. The scene (component + honored list + code template) is fetched
- // inside `UiPreview` via `use()`. Any miss here → the shared Unknown fallback.
+ // Join the example timing with the registry config (controls) and a lazy
+ // scene loader. The scene (component + honored list + code template) is
+ // fetched inside `UiPreview` via `use()`.
if (!timing || !entry || !(name in UI_SCENE_LOADERS)) {
- return <UnknownComponent name={name} />;
+ return <UnknownBlock kind="component" name={name} />;
}
return (
- <Suspense
- fallback={
- <div className="not-prose mb-6 aspect-[1.9/1] w-full animate-pulse rounded-2xl bg-muted" />
- }
- >
- <UiPreview name={name} timing={timing} />
- </Suspense>
+ <div className={cn("not-prose", BLOCK_SPACING)}>
+ <Suspense fallback={<PlayerFallback />}>
+ <UiPreview name={name} timing={timing} />
+ </Suspense>
+ </div>
);
}
@@ -62,16 +43,14 @@ function UiPreview({
name: string;
timing: UiPreviewTiming;
}) {
- // Suspends on first render until this component's scene chunk resolves, then
- // returns synchronously from the cached promise. Gives us the scene component,
- // its honored-control list, and its code template — no other scene is fetched.
+ // Suspends on first render until this component's scene chunk resolves:
+ // the scene component, its honored-control list and its code template.
const scene = use(loadUiScene(name));
const controls: ControlConfig = use(loadComponentConfig(name)).controls;
const honored = scene.controls;
- const trackEvent = useTrackEvent();
- // visibleControls = config.controls ∩ honored[name]. This drops state/speed
- // and every structural-but-unthreaded knob — no global blacklist needed.
+ // config.controls ∩ honored: drops state/speed and every structural knob
+ // the scene doesn't thread through.
const visibleControls = useMemo(
() =>
Object.fromEntries(
@@ -80,148 +59,41 @@ function UiPreview({
[controls, honored],
);
- const hasControls = Object.keys(visibleControls).length > 0;
-
- const { parsers, urlKeys } = useMemo(
- () => buildParsers(name, visibleControls),
- [name, visibleControls],
+ const { values, isDefault, change, reset } = useCustomizer(
+ name,
+ visibleControls,
);
- const defaults = useMemo(
- () => getDefaults(visibleControls),
- [visibleControls],
- );
-
- const [values, setValues] = useQueryStates(parsers, {
- urlKeys,
- clearOnDefault: true,
- shallow: true,
- });
- const isDefault = useMemo(
- () => Object.entries(defaults).every(([k, v]) => values[k] === v),
- [defaults, values],
- );
-
- // Honored-only code (Q4): the scene's own template interpolates ONLY honored
- // keys, ONLY when a value differs from its default, and NEVER emits a prop the
- // component ignores. The same `values` feeds the Player → guaranteed parity.
+ // The scene's template interpolates only honored keys that differ from
+ // their default; the same `values` feed the Player, so code and preview match.
const code = useMemo(() => scene.code(values), [scene, values]);
- const [copied, setCopied] = useState(false);
- const handleCopyLink = () => {
- if (typeof window === "undefined") return;
- navigator.clipboard.writeText(window.location.href);
- setCopied(true);
- trackEvent("customized_link_shared", { component: name });
- setTimeout(() => setCopied(false), 1500);
- };
-
- const handleReset = () => {
- setValues(null);
- trackEvent("customizer_reset", { component: name });
- };
-
- useEffect(() => {
- trackEvent("docs_component_viewed", { component: name });
- }, [name, trackEvent]);
-
- const customizeTimers = useRef<Map<string, ReturnType<typeof setTimeout>>>(
- new Map(),
- );
- useEffect(() => {
- const timers = customizeTimers.current;
- return () => {
- for (const timer of timers.values()) clearTimeout(timer);
- timers.clear();
- };
- }, []);
- const handleCustomizeChange = (key: string, value: unknown) => {
- setValues((prev) => ({ ...prev, [key]: value }));
- const existing = customizeTimers.current.get(key);
- if (existing) clearTimeout(existing);
- customizeTimers.current.set(
- key,
- setTimeout(() => {
- trackEvent("component_customized", { component: name, prop: key });
- customizeTimers.current.delete(key);
- }, 500),
- );
- };
-
return (
- <div className="not-prose mb-6 flex w-full flex-col gap-4">
- <Frame>
- <Tabs defaultValue="preview" className="gap-0">
- <FrameHeader className="flex-row items-center px-2 py-2">
- <TabsList>
- <TabsTrigger value="preview">Preview</TabsTrigger>
- <TabsTrigger value="code">Code</TabsTrigger>
- </TabsList>
- </FrameHeader>
- <FramePanel className="overflow-hidden p-0">
- <TabsContent value="preview" className="mt-0">
- <PreviewStage
- name={name}
- Component={scene.Scene}
- inputProps={values}
- // D2 — timing is sourced from the EXAMPLE, not the config.
- durationInFrames={timing.durationInFrames}
- fps={timing.fps}
- compositionWidth={timing.width}
- compositionHeight={timing.height}
- previewBackdrop={timing.previewBackdrop}
- className="rounded-none"
- />
- </TabsContent>
- <TabsContent value="code" className="mt-0">
- <CodeBlock code={code} />
- </TabsContent>
- </FramePanel>
- </Tabs>
- </Frame>
-
- {/* Empty-panel collapse (Q5): no honored controls → only the Tabs. */}
- {hasControls && (
- <Frame className="mt-2">
- <FrameHeader className="flex-row items-center justify-between px-3 py-2">
- <FrameTitle>Customize</FrameTitle>
- <div className="flex items-center gap-1">
- <Button
- variant="outline"
- size="icon-sm"
- onClick={handleCopyLink}
- aria-label="Copy share link"
- title="Copy share link"
- className="text-muted-foreground hover:text-foreground"
- >
- {copied ? (
- <CheckIcon className="size-3.5" />
- ) : (
- <LinkIcon className="size-3.5" />
- )}
- </Button>
- <Button
- variant="outline"
- size="icon-sm"
- onClick={handleReset}
- disabled={isDefault}
- aria-label="Reset to defaults"
- title="Reset to defaults"
- className="text-muted-foreground hover:text-foreground disabled:opacity-40"
- >
- <RotateCcwIcon className="size-3.5" />
- </Button>
- </div>
- </FrameHeader>
- <FramePanel className="p-3">
- <ComponentCustomizer
- controls={visibleControls}
- values={values as Record<string, unknown>}
- onChange={handleCustomizeChange}
- />
- </FramePanel>
- </Frame>
- )}
- </div>
+ <DocsPlayer
+ name={name}
+ code={code}
+ composition={{
+ Component: scene.Scene,
+ inputProps: values,
+ // Timing is sourced from the example, not the config.
+ durationInFrames: timing.durationInFrames,
+ fps: timing.fps,
+ compositionWidth: timing.width,
+ compositionHeight: timing.height,
+ previewBackdrop: timing.previewBackdrop,
+ }}
+ >
+ {Object.keys(visibleControls).length > 0 ? (
+ <CustomizePanel
+ name={name}
+ controls={visibleControls}
+ values={values}
+ code={code}
+ isDefault={isDefault}
+ onChange={change}
+ onReset={reset}
+ />
+ ) : null}
+ </DocsPlayer>
);
}
diff --git a/components/shimmering-text.tsx b/components/shimmering-text.tsx
index 4e84208a..a808c7a2 100644
--- a/components/shimmering-text.tsx
+++ b/components/shimmering-text.tsx
@@ -1,7 +1,7 @@
"use client";
import type { Variants } from "motion/react";
-import { motion } from "motion/react";
+import { motion, useReducedMotion } from "motion/react";
import * as React from "react";
import { cn } from "@/lib/utils";
@@ -29,6 +29,8 @@ export function ShimmeringText({
className,
...props
}: ShimmeringTextProps) {
+ const reducedMotion = useReducedMotion() ?? false;
+ const stopped = isStopped || reducedMotion;
const createCharVariants = React.useCallback(
(charIndex: number): Variants => ({
running: {
@@ -67,7 +69,7 @@ export function ShimmeringText({
key={i}
className="inline-block whitespace-pre"
initial="stopped"
- animate={isStopped ? "stopped" : "running"}
+ animate={stopped ? "stopped" : "running"}
variants={createCharVariants(i)}
aria-hidden
>
diff --git a/components/studio-bar.tsx b/components/studio-bar.tsx
deleted file mode 100644
index f5e5b295..00000000
--- a/components/studio-bar.tsx
+++ /dev/null
@@ -1,63 +0,0 @@
-"use client";
-
-import { ArrowRight, X } from "lucide-react";
-import { NewBadge } from "@/components/docs/new-badge";
-import { STUDIO_URL } from "@/config/site";
-import { STUDIO_BAR_STORAGE_KEY } from "@/lib/studio-bar";
-import { cn } from "@/lib/utils";
-
-function dismiss() {
- document.documentElement.dataset.studioBar = "dismissed";
- try {
- localStorage.setItem(STUDIO_BAR_STORAGE_KEY, "dismissed");
- } catch {
- return;
- }
-}
-
-export function StudioBar({ collapsed = false }: { collapsed?: boolean }) {
- return (
- <div
- inert={collapsed}
- className={cn(
- "grid grid-rows-[1fr] bg-muted transition-[grid-template-rows] duration-300 ease-out in-data-[studio-bar=dismissed]:hidden",
- collapsed && "grid-rows-[0fr]",
- )}
- >
- <div className="overflow-hidden">
- <div className="section relative flex h-10 items-center justify-center">
- <a
- href={STUDIO_URL}
- target="_blank"
- rel="noreferrer"
- data-track="cta_clicked"
- data-cta="studio_bar"
- data-destination={STUDIO_URL}
- className="group inline-flex min-w-0 items-center mx-8 gap-2 rounded-full px-2 text-[13px] text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50"
- >
- <NewBadge className="ms-0" />
- <span className="font-medium text-foreground">Remocn Studio</span>
- <span className="hidden md:inline">
- Your agent builds the video, you tune it
- </span>
- <span className="inline-flex items-center gap-1 font-medium text-foreground underline-offset-4 group-hover:underline group-focus-visible:underline">
- Get the app
- <ArrowRight
- className="size-3.5 transition-transform duration-150 ease-out group-hover:translate-x-0.5"
- aria-hidden="true"
- />
- </span>
- </a>
- <button
- type="button"
- onClick={dismiss}
- aria-label="Dismiss"
- className="absolute right-2 inline-flex size-8 items-center justify-center rounded-full text-muted-foreground transition-[color,background-color] duration-150 ease-out before:absolute before:-inset-1 hover:bg-foreground/5 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/50 sm:right-4"
- >
- <X className="size-4" aria-hidden="true" />
- </button>
- </div>
- </div>
- </div>
- );
-}
diff --git a/components/ui/accordion.tsx b/components/ui/accordion.tsx
index 2df916ed..b0d8e9fe 100644
--- a/components/ui/accordion.tsx
+++ b/components/ui/accordion.tsx
@@ -35,7 +35,7 @@ function AccordionTrigger({
<AccordionPrimitive.Trigger
data-slot="accordion-trigger"
className={cn(
- "group/accordion-trigger relative flex flex-1 items-start justify-between gap-6 border border-transparent p-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/40 aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
+ "group/accordion-trigger relative flex flex-1 items-start justify-between gap-6 border border-transparent p-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring aria-disabled:pointer-events-none aria-disabled:opacity-50 **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 **:data-[slot=accordion-trigger-icon]:text-muted-foreground",
className,
)}
{...props}
diff --git a/components/ui/badge.tsx b/components/ui/badge.tsx
index 6cd84de5..15262793 100644
--- a/components/ui/badge.tsx
+++ b/components/ui/badge.tsx
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const badgeVariants = cva(
- "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-3xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
+ "group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-3xl border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
{
variants: {
variant: {
diff --git a/components/ui/bubble.tsx b/components/ui/bubble.tsx
index 7d8dfd59..9a524517 100644
--- a/components/ui/bubble.tsx
+++ b/components/ui/bubble.tsx
@@ -72,7 +72,7 @@ function BubbleContent({
props: mergeProps<"div">(
{
className: cn(
- "w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3.5 py-2.5 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/30",
+ "w-fit max-w-full min-w-0 overflow-hidden rounded-3xl border border-transparent px-3.5 py-2.5 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring",
className,
),
},
diff --git a/components/ui/button.tsx b/components/ui/button.tsx
index 3a864009..40b034d2 100644
--- a/components/ui/button.tsx
+++ b/components/ui/button.tsx
@@ -5,7 +5,7 @@ import { Spinner } from "@/components/ui/spinner";
import { cn } from "@/lib/utils";
const buttonVariants = cva(
- "group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 active:not-aria-[haspopup]:translate-y-px active:not-aria-[haspopup]:inset-shadow-[0_1px_2px_--theme(--color-black/8%)] dark:active:not-aria-[haspopup]:inset-shadow-[0_1px_2px_--theme(--color-black/25%)] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/button inline-flex shrink-0 items-center justify-center rounded-4xl border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring active:not-aria-[haspopup]:translate-y-px active:not-aria-[haspopup]:inset-shadow-[0_1px_2px_--theme(--color-black/8%)] dark:active:not-aria-[haspopup]:inset-shadow-[0_1px_2px_--theme(--color-black/25%)] disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
diff --git a/components/ui/checkbox.tsx b/components/ui/checkbox.tsx
index 8aeb4b19..c548bb88 100644
--- a/components/ui/checkbox.tsx
+++ b/components/ui/checkbox.tsx
@@ -9,7 +9,7 @@ function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
<CheckboxPrimitive.Root
data-slot="checkbox"
className={cn(
- "peer relative flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-transparent bg-input/90 transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
+ "peer relative flex size-4 shrink-0 items-center justify-center rounded-[5px] border border-transparent bg-input/90 transition-shadow outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
className,
)}
{...props}
diff --git a/components/ui/combobox.tsx b/components/ui/combobox.tsx
index 6eabbf88..2b0ae86a 100644
--- a/components/ui/combobox.tsx
+++ b/components/ui/combobox.tsx
@@ -223,7 +223,7 @@ function ComboboxChips({
<ComboboxPrimitive.Chips
data-slot="combobox-chips"
className={cn(
- "flex min-h-9 flex-wrap items-center gap-1.5 rounded-3xl border border-transparent bg-input/50 bg-clip-padding px-3 py-1.5 text-sm transition-[color,box-shadow,background-color] focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/30 has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
+ "flex min-h-9 flex-wrap items-center gap-1.5 rounded-3xl border border-transparent bg-input/50 bg-clip-padding px-3 py-1.5 text-sm transition-[color,box-shadow,background-color] focus-within:border-ring focus-within:ring-3 focus-within:ring-ring has-aria-invalid:border-destructive has-aria-invalid:ring-3 has-aria-invalid:ring-destructive/20 has-data-[slot=combobox-chip]:px-1.5 dark:has-aria-invalid:border-destructive/50 dark:has-aria-invalid:ring-destructive/40",
className,
)}
{...props}
diff --git a/components/ui/elastic-slider.tsx b/components/ui/elastic-slider.tsx
deleted file mode 100644
index 4ec90578..00000000
--- a/components/ui/elastic-slider.tsx
+++ /dev/null
@@ -1,564 +0,0 @@
-"use client";
-
-import {
- animate,
- motion,
- useMotionValue,
- useReducedMotion,
- useTransform,
-} from "motion/react";
-import {
- useCallback,
- useEffect,
- useLayoutEffect,
- useRef,
- useState,
-} from "react";
-import { useControllableState } from "@/lib/use-controllable-state";
-import { cn } from "@/lib/utils";
-
-// Drag detection & rubber band
-const CLICK_THRESHOLD = 3;
-const DEAD_ZONE = 32;
-const MAX_CURSOR_RANGE = 200;
-const MAX_STRETCH = 8;
-
-// Layout offsets used by the "handle dodges label/value" calculation.
-const HANDLE_BUFFER = 8;
-const LABEL_OFFSET = 12 + 4;
-const VALUE_OFFSET = 12 - 8;
-
-function clamp(v: number, lo: number, hi: number) {
- return Math.max(lo, Math.min(hi, v));
-}
-
-function decimalsForStep(step: number): number {
- const s = step.toString();
- const dot = s.indexOf(".");
- return dot === -1 ? 0 : s.length - dot - 1;
-}
-
-function roundValue(val: number, step: number): number {
- const raw = Math.round(val / step) * step;
- return parseFloat(raw.toFixed(decimalsForStep(step)));
-}
-
-// Magnetic snap to the nearest decile when within 3.125% of it.
-function snapToDecile(rawValue: number, min: number, max: number): number {
- const normalized = (rawValue - min) / (max - min);
- const nearest = Math.round(normalized * 10) / 10;
- if (Math.abs(normalized - nearest) <= 0.03125) {
- return min + nearest * (max - min);
- }
- return rawValue;
-}
-
-export type ElasticSliderProps = {
- /** Label shown inside the track. */
- label: string;
-
- /** Controlled value. Use together with `onValueChange` */
- value?: number;
- /** Initial value for uncontrolled mode. Falls back to `min` */
- defaultValue?: number;
- /** Called with the new value on drag, click, or key press. */
- onValueChange?: (value: number) => void;
-
- /**
- * Minimum value.
- * @defaultValue 0 */
- min?: number;
- /**
- * Maximum value.
- * @defaultValue 1 */
- max?: number;
- /**
- * Smallest increment.
- * @defaultValue 0.01 */
- step?: number;
- /** Format the displayed value. Defaults to `value.toFixed(...)` based on `step` */
- formatValue?: (value: number) => string;
-
- className?: string;
- /** Accessible name. Falls back to `label` */
- "aria-label"?: string;
-};
-
-export function ElasticSlider({
- label,
-
- value: valueProp,
- defaultValue,
- onValueChange,
-
- min = 0,
- max = 1,
- step = 0.01,
- formatValue,
-
- className,
- "aria-label": ariaLabel,
-}: ElasticSliderProps) {
- const [value = min, setValue] = useControllableState<number>({
- prop: valueProp,
- defaultProp: defaultValue ?? min,
- onChange: onValueChange,
- });
-
- const shouldReduceMotion = useReducedMotion();
-
- const wrapperRef = useRef<HTMLDivElement>(null);
- const trackRef = useRef<HTMLDivElement>(null);
- const labelRef = useRef<HTMLSpanElement>(null);
- const valueRef = useRef<HTMLSpanElement>(null);
-
- const [isInteracting, setIsInteracting] = useState(false);
- const [isDragging, setIsDragging] = useState(false);
- const [isHovered, setIsHovered] = useState(false);
- /** Ring only for Tab focus or keyboard value nudges, not pointer press/drag. */
- const [keyboardFocusRing, setKeyboardFocusRing] = useState(false);
-
- // Pointer session state — mutable, does not trigger re-renders.
- const pointerDownPos = useRef<{ x: number; y: number } | null>(null);
- const pendingPointerFocusRef = useRef(false);
- const isClickRef = useRef(true);
- const animRef = useRef<ReturnType<typeof animate> | null>(null);
- const wrapperRectRef = useRef<DOMRect | null>(null);
- const scaleRef = useRef(1);
-
- const percentage = ((value - min) / (max - min)) * 100;
- const isActive = isInteracting || isHovered;
- const displayValue = formatValue
- ? formatValue(value)
- : value.toFixed(decimalsForStep(step));
-
- // Fill + handle driven by a single motion value for imperative updates.
- const fillPercent = useMotionValue(percentage);
- const fillWidth = useTransform(fillPercent, (pct) => `${pct}%`);
- const handleLeft = useTransform(
- fillPercent,
- (pct) => `max(4px, calc(${pct}% - 8px))`,
- );
-
- // Rubber band: widens the track and pulls it left when dragged past bounds.
- const rubberStretch = useMotionValue(0);
- const rubberWidth = useTransform(
- rubberStretch,
- (s) => `calc(100% + ${Math.abs(s)}px)`,
- );
- const rubberX = useTransform(rubberStretch, (s) => (s < 0 ? s : 0));
-
- // Sync from props when not interacting and no spring is in flight.
- useEffect(() => {
- if (!isInteracting && !animRef.current) {
- fillPercent.jump(percentage);
- }
- }, [percentage, isInteracting, fillPercent]);
-
- const positionToValue = useCallback(
- (clientX: number) => {
- const rect = wrapperRectRef.current;
- if (!rect) return min;
-
- const sceneX = (clientX - rect.left) / scaleRef.current;
- const nativeWidth = wrapperRef.current?.offsetWidth ?? rect.width;
- const percent = clamp(sceneX / nativeWidth, 0, 1);
-
- return clamp(min + percent * (max - min), min, max);
- },
- [min, max],
- );
-
- const percentFromValue = useCallback(
- (v: number) => ((v - min) / (max - min)) * 100,
- [min, max],
- );
-
- // Animate fill to a target percent, or jump instantly when the user prefers
- // reduced motion. Position still updates — only the spring is skipped.
- const animateFillTo = useCallback(
- (targetPercent: number) => {
- animRef.current?.stop();
-
- if (shouldReduceMotion) {
- fillPercent.jump(targetPercent);
- animRef.current = null;
- return;
- }
-
- animRef.current = animate(fillPercent, targetPercent, {
- type: "spring",
- stiffness: 300,
- damping: 25,
- mass: 0.8,
- onComplete: () => {
- animRef.current = null;
- },
- });
- },
- [fillPercent, shouldReduceMotion],
- );
-
- const computeRubberStretch = useCallback((clientX: number, sign: number) => {
- const rect = wrapperRectRef.current;
- if (!rect) return 0;
-
- const distancePast = sign < 0 ? rect.left - clientX : clientX - rect.right;
- const overflow = Math.max(0, distancePast - DEAD_ZONE);
-
- return (
- sign * MAX_STRETCH * Math.sqrt(Math.min(overflow / MAX_CURSOR_RANGE, 1))
- );
- }, []);
-
- const handlePointerDown = useCallback((e: React.PointerEvent) => {
- e.preventDefault();
- (e.target as HTMLElement).setPointerCapture(e.pointerId);
-
- pointerDownPos.current = { x: e.clientX, y: e.clientY };
-
- isClickRef.current = true;
-
- setIsInteracting(true);
-
- pendingPointerFocusRef.current = true;
- setKeyboardFocusRing(false);
-
- // Pointer interactions should move focus to the slider so subsequent
- // keyboard input is received and focus styles match the active state.
- trackRef.current?.focus({ preventScroll: true });
- requestAnimationFrame(() => {
- pendingPointerFocusRef.current = false;
- });
-
- // Snapshot the wrapper rect so later math is immune to layout shifts.
- const wrapper = wrapperRef.current;
- if (wrapper) {
- const rect = wrapper.getBoundingClientRect();
- wrapperRectRef.current = rect;
- scaleRef.current = rect.width / wrapper.offsetWidth;
- }
- }, []);
-
- const handlePointerMove = useCallback(
- (e: React.PointerEvent) => {
- if (!isInteracting || !pointerDownPos.current) return;
-
- const dx = e.clientX - pointerDownPos.current.x;
- const dy = e.clientY - pointerDownPos.current.y;
-
- if (isClickRef.current && Math.hypot(dx, dy) > CLICK_THRESHOLD) {
- isClickRef.current = false;
- setIsDragging(true);
- }
-
- if (isClickRef.current) return;
-
- const rect = wrapperRectRef.current;
- if (rect && !shouldReduceMotion) {
- if (e.clientX < rect.left) {
- rubberStretch.jump(computeRubberStretch(e.clientX, -1));
- } else if (e.clientX > rect.right) {
- rubberStretch.jump(computeRubberStretch(e.clientX, 1));
- } else {
- rubberStretch.jump(0);
- }
- }
-
- const newValue = positionToValue(e.clientX);
- animRef.current?.stop();
- animRef.current = null;
- fillPercent.jump(percentFromValue(newValue));
- setValue(roundValue(newValue, step));
- },
- [
- isInteracting,
- positionToValue,
- percentFromValue,
- setValue,
- step,
- fillPercent,
- rubberStretch,
- computeRubberStretch,
- shouldReduceMotion,
- ],
- );
-
- const handlePointerUp = useCallback(
- (e: React.PointerEvent) => {
- if (!isInteracting) return;
-
- if (isClickRef.current) {
- // Coarse sliders (≤10 positions) snap to the nearest step;
- // continuous sliders keep the decile-magnetic behavior.
- const rawValue = positionToValue(e.clientX);
- const discreteSteps = (max - min) / step;
- const snapped =
- discreteSteps <= 10
- ? clamp(min + Math.round((rawValue - min) / step) * step, min, max)
- : snapToDecile(rawValue, min, max);
-
- animateFillTo(percentFromValue(snapped));
- setValue(roundValue(snapped, step));
- }
-
- if (!shouldReduceMotion && rubberStretch.get() !== 0) {
- animate(rubberStretch, 0, {
- type: "spring",
- visualDuration: 0.35,
- bounce: 0.15,
- });
- }
-
- setIsInteracting(false);
- setIsDragging(false);
- pointerDownPos.current = null;
- },
- [
- isInteracting,
- positionToValue,
- percentFromValue,
- setValue,
- min,
- max,
- step,
- animateFillTo,
- rubberStretch,
- shouldReduceMotion,
- ],
- );
-
- const handleKeyDown = useCallback(
- (e: React.KeyboardEvent) => {
- // Shift + Arrow is a Figma-style fast nudge: jumps by 10x the step,
- // independent of the WAI-ARIA Page step (which scales with range).
- const arrowStep = e.shiftKey ? step * 10 : step;
-
- let next: number | null = null;
-
- switch (e.key) {
- case "ArrowRight":
- case "ArrowUp":
- next = value + arrowStep;
- break;
-
- case "ArrowLeft":
- case "ArrowDown":
- next = value - arrowStep;
- break;
-
- case "Home":
- next = min;
- break;
-
- case "End":
- next = max;
- break;
-
- default:
- return;
- }
-
- e.preventDefault();
-
- setKeyboardFocusRing(true);
-
- const snapped = roundValue(clamp(next, min, max), step);
- animateFillTo(percentFromValue(snapped));
- setValue(snapped);
- },
- [value, min, max, step, animateFillTo, percentFromValue, setValue],
- );
-
- const handleTrackFocus = useCallback(() => {
- if (!pendingPointerFocusRef.current) {
- setKeyboardFocusRing(true);
- }
- }, []);
-
- const handleTrackBlur = useCallback(() => {
- setKeyboardFocusRing(false);
- }, []);
-
- // Measure label + value to derive "dodge" thresholds so the handle fades
- // when it would overlap either text.
- const [dodge, setDodge] = useState({ left: 38, right: 72 });
-
- useLayoutEffect(() => {
- const wrapper = wrapperRef.current;
- if (!wrapper) return;
-
- const measure = () => {
- const trackWidth = wrapper.offsetWidth;
- if (trackWidth <= 0) return;
-
- const labelEl = labelRef.current;
- const valueEl = valueRef.current;
-
- const left = labelEl
- ? ((LABEL_OFFSET + labelEl.offsetWidth + HANDLE_BUFFER) / trackWidth) *
- 100
- : 38;
-
- const right = valueEl
- ? ((trackWidth - VALUE_OFFSET - valueEl.offsetWidth - HANDLE_BUFFER) /
- trackWidth) *
- 100
- : 72;
-
- setDodge((prev) => {
- return prev.left === left && prev.right === right
- ? prev
- : { left, right };
- });
- };
-
- measure();
-
- const observer = new ResizeObserver(measure);
- observer.observe(wrapper);
-
- if (labelRef.current) observer.observe(labelRef.current);
- if (valueRef.current) observer.observe(valueRef.current);
-
- return () => observer.disconnect();
- }, []);
-
- const valueDodge = percentage < dodge.left || percentage > dodge.right;
- const handleOpacity = !isActive
- ? 0
- : valueDodge
- ? 0.1
- : isDragging
- ? 0.8
- : 0.5;
-
- const discreteSteps = (max - min) / step;
- const hashMarkCount = discreteSteps <= 10 ? discreteSteps - 1 : 9;
-
- const hashMarkPct = (i: number) => {
- return discreteSteps <= 10
- ? (((i + 1) * step) / (max - min)) * 100
- : (i + 1) * 10;
- };
-
- return (
- <div
- ref={wrapperRef}
- data-slot="elastic-slider"
- className={cn(
- "[--elastic-slider-height:--spacing(9)] [--elastic-slider-radius:var(--radius-xl)]",
- "[--elastic-slider-bg:var(--muted)]",
- "[--elastic-slider-fill:var(--muted-foreground)]/10",
- "[--elastic-slider-fill-active:var(--muted-foreground)]/20",
- "[--elastic-slider-hash:var(--muted-foreground)]/30",
- "[--elastic-slider-handle:var(--foreground)]",
- "[--elastic-slider-label:var(--muted-foreground)]",
- "[--elastic-slider-focus:var(--foreground)]",
- "relative h-(--elastic-slider-height)",
- className,
- )}
- >
- <motion.div
- ref={trackRef}
- role="slider"
- tabIndex={0}
- data-slot="elastic-slider-track"
- data-active={isActive}
- data-focus-visible={keyboardFocusRing}
- aria-label={ariaLabel ?? label}
- aria-orientation="horizontal"
- aria-valuemin={min}
- aria-valuemax={max}
- aria-valuenow={value}
- aria-valuetext={displayValue}
- className={cn(
- "group/elastic-slider absolute inset-0 cursor-pointer touch-none overflow-hidden rounded-xl bg-(--elastic-slider-bg) outline-none select-none",
- "data-[focus-visible=true]:ring-2 data-[focus-visible=true]:ring-ring/50 data-[focus-visible=true]:ring-offset-1 data-[focus-visible=true]:ring-offset-background control-surface control-surface-interactive",
- )}
- style={{ width: rubberWidth, x: rubberX }}
- onPointerDown={handlePointerDown}
- onPointerMove={handlePointerMove}
- onPointerUp={handlePointerUp}
- onFocus={handleTrackFocus}
- onBlur={handleTrackBlur}
- onKeyDown={handleKeyDown}
- onMouseEnter={() => setIsHovered(true)}
- onMouseLeave={() => setIsHovered(false)}
- >
- <div
- data-slot="elastic-slider-hash-marks"
- aria-hidden="true"
- className="pointer-events-none absolute inset-0"
- >
- {Array.from({ length: hashMarkCount }, (_, i) => (
- <div
- key={i}
- className={cn(
- "absolute top-1/2 h-2 w-px -translate-x-1/2 -translate-y-1/2 rounded-full transition-colors duration-200",
- "bg-transparent group-data-[active=true]/elastic-slider:bg-(--elastic-slider-hash)",
- )}
- style={{ left: `${hashMarkPct(i)}%` }}
- />
- ))}
- </div>
-
- <motion.div
- data-slot="elastic-slider-fill"
- aria-hidden="true"
- className={cn(
- "pointer-events-none absolute inset-y-0 left-0 transition-colors",
- "bg-(--elastic-slider-fill) group-data-[active=true]/elastic-slider:bg-(--elastic-slider-fill-active)",
- )}
- style={{ width: fillWidth }}
- />
-
- <motion.div
- data-slot="elastic-slider-handle"
- aria-hidden="true"
- className="pointer-events-none absolute top-1/2 h-5 w-1 rounded-full bg-(--elastic-slider-handle)"
- style={{ left: handleLeft, y: "-50%" }}
- animate={{
- opacity: handleOpacity,
- scaleX: isActive ? 1 : 0.25,
- scaleY: isActive && valueDodge ? 0.75 : 1,
- }}
- transition={
- shouldReduceMotion
- ? { duration: 0 }
- : {
- scaleX: {
- type: "spring",
- visualDuration: 0.25,
- bounce: 0.15,
- },
- scaleY: { type: "spring", visualDuration: 0.2, bounce: 0.1 },
- opacity: { duration: 0.15 },
- }
- }
- />
-
- <span
- ref={labelRef}
- data-slot="elastic-slider-label"
- aria-hidden="true"
- className="pointer-events-none absolute top-1/2 left-3 inline-flex -translate-y-1/2 items-center text-sm/none font-medium text-(--elastic-slider-label) transition-colors"
- >
- {label}
- </span>
-
- <span
- ref={valueRef}
- data-slot="elastic-slider-value"
- aria-hidden="true"
- className={cn(
- "pointer-events-none absolute top-1/2 right-3 -translate-y-1/2 font-mono text-sm/none font-medium transition-colors",
- "text-(--elastic-slider-label) group-data-[active=true]/elastic-slider:text-(--elastic-slider-focus)",
- )}
- >
- {displayValue}
- </span>
- </motion.div>
- </div>
- );
-}
diff --git a/components/ui/frame.tsx b/components/ui/frame.tsx
deleted file mode 100644
index 5ae62ac4..00000000
--- a/components/ui/frame.tsx
+++ /dev/null
@@ -1,81 +0,0 @@
-import type * as React from "react";
-import { cn } from "@/lib/utils";
-
-function Frame({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- className={cn(
- "relative flex flex-col rounded-2xl bg-secondary/72 p-1 dark:bg-secondary",
- "*:[[data-slot=frame-panel]+[data-slot=frame-panel]]:mt-1",
- className,
- )}
- data-slot="frame"
- {...props}
- />
- );
-}
-
-function FramePanel({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- className={cn(
- "relative rounded-xl border bg-background bg-clip-padding p-5 dark:border-border/60",
- className,
- )}
- data-slot="frame-panel"
- {...props}
- />
- );
-}
-
-function FrameHeader({ className, ...props }: React.ComponentProps<"header">) {
- return (
- <header
- className={cn("flex flex-col px-5 py-4", className)}
- data-slot="frame-panel-header"
- {...props}
- />
- );
-}
-
-function FrameTitle({ className, ...props }: React.ComponentProps<"div">) {
- return (
- <div
- className={cn("font-heading font-semibold text-xl", className)}
- data-slot="frame-panel-title"
- {...props}
- />
- );
-}
-
-function FrameDescription({
- className,
- ...props
-}: React.ComponentProps<"div">) {
- return (
- <div
- className={cn("text-muted-foreground text-sm", className)}
- data-slot="frame-panel-description"
- {...props}
- />
- );
-}
-
-function FrameFooter({ className, ...props }: React.ComponentProps<"footer">) {
- return (
- <footer
- className={cn("px-5 py-4", className)}
- data-slot="frame-panel-footer"
- {...props}
- />
- );
-}
-
-export {
- Frame,
- FramePanel,
- FrameHeader,
- FrameTitle,
- FrameDescription,
- FrameFooter,
-};
diff --git a/components/ui/input.tsx b/components/ui/input.tsx
index d590a776..8562bb73 100644
--- a/components/ui/input.tsx
+++ b/components/ui/input.tsx
@@ -9,7 +9,7 @@ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
type={type}
data-slot="input"
className={cn(
- "h-9 w-full min-w-0 rounded-3xl border border-transparent bg-input/50 px-3 py-1 text-base transition-[color,box-shadow,background-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
+ "h-9 w-full min-w-0 rounded-3xl border border-transparent bg-input/50 px-3 py-1 text-base transition-[color,box-shadow,background-color] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
className,
)}
{...props}
diff --git a/components/ui/item.tsx b/components/ui/item.tsx
index 5f443ebc..bc01bf48 100644
--- a/components/ui/item.tsx
+++ b/components/ui/item.tsx
@@ -34,7 +34,7 @@ function ItemSeparator({
}
const itemVariants = cva(
- "group/item flex w-full flex-wrap items-center rounded-2xl border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted",
+ "group/item flex w-full flex-wrap items-center rounded-2xl border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring [a]:transition-colors [a]:hover:bg-muted",
{
variants: {
variant: {
diff --git a/components/ui/native-select.tsx b/components/ui/native-select.tsx
index e89a1b84..507ff7ef 100644
--- a/components/ui/native-select.tsx
+++ b/components/ui/native-select.tsx
@@ -23,7 +23,7 @@ function NativeSelect({
<select
data-slot="native-select"
data-size={size}
- className="h-9 w-full min-w-0 appearance-none rounded-3xl border border-transparent bg-input/50 py-1 pr-8 pl-3 text-sm transition-[color,box-shadow,background-color] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-8 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
+ className="h-9 w-full min-w-0 appearance-none rounded-3xl border border-transparent bg-input/50 py-1 pr-8 pl-3 text-sm transition-[color,box-shadow,background-color] outline-none select-none selection:bg-primary selection:text-primary-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:pointer-events-none disabled:cursor-not-allowed aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=sm]:h-8 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40"
{...props}
/>
<ChevronDownIcon
diff --git a/components/ui/radio-group.tsx b/components/ui/radio-group.tsx
index aa776997..f1051ea8 100644
--- a/components/ui/radio-group.tsx
+++ b/components/ui/radio-group.tsx
@@ -20,7 +20,7 @@ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
<RadioPrimitive.Root
data-slot="radio-group-item"
className={cn(
- "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-transparent bg-input/90 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
+ "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-transparent bg-input/90 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
className,
)}
{...props}
diff --git a/components/ui/scroll-area.tsx b/components/ui/scroll-area.tsx
index 817fd38f..b3664d17 100644
--- a/components/ui/scroll-area.tsx
+++ b/components/ui/scroll-area.tsx
@@ -17,7 +17,7 @@ function ScrollArea({
>
<ScrollAreaPrimitive.Viewport
data-slot="scroll-area-viewport"
- className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:outline-1"
>
{children}
</ScrollAreaPrimitive.Viewport>
diff --git a/components/ui/select.tsx b/components/ui/select.tsx
index f2d81bed..48f44d3f 100644
--- a/components/ui/select.tsx
+++ b/components/ui/select.tsx
@@ -40,7 +40,7 @@ function SelectTrigger({
data-slot="select-trigger"
data-size={size}
className={cn(
- "flex w-fit items-center justify-between gap-1.5 rounded-3xl border border-transparent bg-input/50 px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow,background-color] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "flex w-fit items-center justify-between gap-1.5 rounded-3xl border border-transparent bg-input/50 px-3 py-2 text-sm whitespace-nowrap transition-[color,box-shadow,background-color] outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-placeholder:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
className,
)}
{...props}
diff --git a/components/ui/slider.tsx b/components/ui/slider.tsx
index cb5ff1a3..af3eec7a 100644
--- a/components/ui/slider.tsx
+++ b/components/ui/slider.tsx
@@ -41,7 +41,7 @@ function Slider({
<SliderPrimitive.Thumb
data-slot="slider-thumb"
key={index}
- className="block h-4 w-6 shrink-0 rounded-full bg-white shadow-md ring-1 ring-black/10 transition-[color,box-shadow,background-color] select-none not-dark:bg-clip-padding hover:ring-4 hover:ring-ring/30 focus-visible:ring-4 focus-visible:ring-ring/30 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-vertical:h-6 data-vertical:w-4"
+ className="block h-4 w-6 shrink-0 rounded-full bg-white shadow-md ring-1 ring-black/10 transition-[color,box-shadow,background-color] select-none not-dark:bg-clip-padding hover:ring-4 hover:ring-ring/30 focus-visible:ring-4 focus-visible:ring-ring focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50 data-vertical:h-6 data-vertical:w-4"
/>
))}
</SliderPrimitive.Control>
diff --git a/components/ui/switch.tsx b/components/ui/switch.tsx
index 383c7160..93b8c079 100644
--- a/components/ui/switch.tsx
+++ b/components/ui/switch.tsx
@@ -16,7 +16,7 @@ function Switch({
data-slot="switch"
data-size={size}
className={cn(
- "peer group/switch relative inline-flex shrink-0 items-center rounded-full border-2 transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-5 data-[size=default]:w-11 data-[size=sm]:h-4 data-[size=sm]:w-7 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-unchecked:border-transparent data-unchecked:bg-input/90 data-disabled:cursor-not-allowed data-disabled:opacity-50",
+ "peer group/switch relative inline-flex shrink-0 items-center rounded-full border-2 transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-5 data-[size=default]:w-11 data-[size=sm]:h-4 data-[size=sm]:w-7 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-unchecked:border-transparent data-unchecked:bg-input/90 data-disabled:cursor-not-allowed data-disabled:opacity-50",
className,
)}
{...props}
diff --git a/components/ui/tabs.tsx b/components/ui/tabs.tsx
index 5ea8dbf6..ac89d7d8 100644
--- a/components/ui/tabs.tsx
+++ b/components/ui/tabs.tsx
@@ -58,7 +58,7 @@ function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
<TabsPrimitive.Tab
data-slot="tabs-trigger"
className={cn(
- "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-2 rounded-full border border-transparent! px-3 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:rounded-2xl group-data-vertical/tabs:px-3 group-data-vertical/tabs:py-1.5 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-2 rounded-full border border-transparent! px-3 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start group-data-vertical/tabs:rounded-2xl group-data-vertical/tabs:px-3 group-data-vertical/tabs:py-1.5 hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 aria-disabled:pointer-events-none aria-disabled:opacity-50 dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
"group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
"data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
"after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
diff --git a/components/ui/textarea.tsx b/components/ui/textarea.tsx
index 9d13183a..d9b89251 100644
--- a/components/ui/textarea.tsx
+++ b/components/ui/textarea.tsx
@@ -7,7 +7,7 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
<textarea
data-slot="textarea"
className={cn(
- "flex field-sizing-content min-h-16 w-full resize-none rounded-2xl border border-transparent bg-input/50 px-3 py-3 text-base transition-[color,box-shadow,background-color] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
+ "flex field-sizing-content min-h-16 w-full resize-none rounded-2xl border border-transparent bg-input/50 px-3 py-3 text-base transition-[color,box-shadow,background-color] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
className,
)}
{...props}
diff --git a/components/ui/toggle.tsx b/components/ui/toggle.tsx
index 4364ac7e..8ff9692c 100644
--- a/components/ui/toggle.tsx
+++ b/components/ui/toggle.tsx
@@ -6,7 +6,7 @@ import { cva, type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils";
const toggleVariants = cva(
- "group/toggle inline-flex items-center justify-center gap-1 rounded-3xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/30 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
+ "group/toggle inline-flex items-center justify-center gap-1 rounded-3xl text-sm font-medium whitespace-nowrap transition-colors outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
{
variants: {
variant: {
diff --git a/config/docs-directory.ts b/config/docs-directory.ts
new file mode 100644
index 00000000..b75bd170
--- /dev/null
+++ b/config/docs-directory.ts
@@ -0,0 +1,99 @@
+export const DOCS_MENU_HREF = "/docs/getting-started/introduction";
+
+export const START_HERE = [
+ {
+ href: "/docs/getting-started/introduction",
+ description: "What remocn is and how the pieces fit",
+ },
+ {
+ href: "/docs/getting-started/installation",
+ description: "Add components with the shadcn CLI",
+ },
+ {
+ href: "/docs/getting-started/agent-skill",
+ description: "Teach your agent the whole catalog",
+ },
+ {
+ href: "/docs/getting-started/plugin",
+ description: "One command in Claude Code or Codex",
+ },
+];
+
+export const CRAFT = [
+ "/docs/craft/design-defaults",
+ "/docs/craft/motion-principles",
+ "/docs/craft/anti-patterns",
+];
+
+export const GUIDES = {
+ index: "/docs/guides",
+ setup: "/docs/guides/setup",
+ videos: [
+ "/docs/guides/launch-video",
+ "/docs/guides/feature-announcement",
+ "/docs/guides/product-demo",
+ "/docs/guides/teaser",
+ "/docs/guides/showcase-reel",
+ "/docs/guides/changelog-video",
+ ],
+ practices: [
+ "/docs/guides/directing-your-agent",
+ "/docs/guides/words-on-screen",
+ "/docs/guides/one-video-three-formats",
+ ],
+};
+
+export const CATEGORIES = [
+ { segment: "typography", label: "Typography", href: "/docs/typography" },
+ { segment: "ui", label: "UI", href: "/docs/ui" },
+ { segment: "transitions", label: "Transitions", href: "/docs/transitions" },
+ {
+ segment: "captions",
+ label: "Captions",
+ href: "/docs/captions/getting-started/introduction",
+ },
+ {
+ segment: "shaders",
+ label: "Shaders",
+ href: "/docs/shaders/getting-started/introduction",
+ },
+ {
+ segment: "motion-graphics",
+ label: "Motion graphics",
+ href: "/docs/motion-graphics",
+ },
+ { segment: "ui-blocks", label: "UI blocks", href: "/docs/ui-blocks" },
+ { segment: "effects", label: "Effects", href: "/docs/effects" },
+ {
+ segment: "filters",
+ label: "Filters",
+ href: "/docs/filters/getting-started/introduction",
+ },
+ { segment: "social", label: "Social", href: "/docs/social" },
+ { segment: "layout", label: "Layout", href: "/docs/layout" },
+ {
+ segment: "compositions",
+ label: "Compositions",
+ href: "/docs/compositions",
+ },
+ { segment: "icons", label: "Icons", href: "/docs/icons/gallery" },
+];
+
+export const AGENTS = [
+ { href: "/docs/ai/claude-code", mark: "claude" },
+ { href: "/docs/ai/claude-chat", mark: "claude" },
+ { href: "/docs/ai/chat-gpt", mark: "openai" },
+ { href: "/docs/ai/v0", mark: "v0" },
+ { href: "/docs/ai/opencode", mark: "opencode" },
+ { href: "/docs/ai/agent-run", mark: "agent-run" },
+] as const;
+
+export type AgentMark = (typeof AGENTS)[number]["mark"];
+
+export const TEMPLATES = [
+ "/docs/templates/release-teaser",
+ "/docs/templates/launch-anything",
+ "/docs/templates/brand-guidelines",
+ "/docs/templates/workflow-console",
+ "/docs/templates/fomo-limit-orders",
+];
diff --git a/config/docs-layout.json b/config/docs-layout.json
new file mode 100644
index 00000000..ee853a90
--- /dev/null
+++ b/config/docs-layout.json
@@ -0,0 +1,8 @@
+{
+ "frame": 1352,
+ "gutter": 16,
+ "sidebar": 252,
+ "rail": 252,
+ "articlePadding": 24,
+ "articleMax": 0
+}
diff --git a/config/header-layout.json b/config/header-layout.json
new file mode 100644
index 00000000..f8f61a7d
--- /dev/null
+++ b/config/header-layout.json
@@ -0,0 +1,10 @@
+{
+ "height": 47,
+ "itemHeight": 30,
+ "radius": 14,
+ "itemRadius": 10,
+ "top": 22,
+ "itemPadding": 13,
+ "text": 14,
+ "wordmark": 19
+}
diff --git a/config/site.ts b/config/site.ts
index 1fb7c990..7e9ff5fa 100644
--- a/config/site.ts
+++ b/config/site.ts
@@ -50,6 +50,13 @@ export type NavLink = {
/** Hidden on mobile (matches the existing `hidden sm:inline` pattern). */
smOnly?: boolean;
external?: boolean;
+ /** Small pink tag after the label (e.g. "New" on Studio). */
+ badge?: string;
+ /**
+ * Path prefix that marks this link as the current page. Defaults to `href`;
+ * `null` never marks it (deep links into a section another link owns).
+ */
+ current?: string | null;
};
export function externalLinkProps(link: NavLink, cta: CtaId) {
@@ -65,11 +72,17 @@ export function externalLinkProps(link: NavLink, cta: CtaId) {
// Единый источник топ-навигации для landing / sponsors / docs.
export const NAV_LINKS: NavLink[] = [
- { href: "/docs/typography", label: "Components" },
- { href: "/docs/shaders/getting-started/introduction", label: "Shaders" },
+ // Every docs page highlights Docs, Components and Templates included.
+ {
+ href: "/docs/getting-started/introduction",
+ label: "Docs",
+ current: "/docs",
+ },
+ { href: "/docs/typography", label: "Components", current: null },
+ { href: "/docs/templates", label: "Templates", current: null },
{ href: "/showcases", label: "Showcases" },
- { href: "/blog", label: "Blog" },
{ href: "/sponsors", label: "Sponsors" },
+ { href: STUDIO_URL, label: "Studio", external: true, badge: "New" },
];
/**
@@ -94,35 +107,12 @@ export const NEW_BADGE_PATHS = new Set<string>([
"/docs/typography/period-drop",
]);
-export type FooterGroup = {
- label: string;
- links: NavLink[];
-};
-
-export const FOOTER_GROUPS: FooterGroup[] = [
- {
- label: "Registry",
- links: [
- { href: "/docs/typography", label: "Components" },
- { href: "/docs/shaders/getting-started/introduction", label: "Shaders" },
- { href: "/docs/icons/gallery", label: "Icons" },
- ],
- },
- {
- label: "Learn",
- links: [
- { href: "/docs/getting-started/introduction", label: "Docs" },
- { href: "/blog", label: "Blog" },
- { href: "/changelog", label: "Changelog" },
- ],
- },
- {
- label: "Project",
- links: [
- { href: STUDIO_URL, label: "Studio", external: true },
- { href: "/showcases", label: "Showcases" },
- { href: "/sponsors", label: "Sponsors" },
- { href: "/legal", label: "Privacy & Terms" },
- ],
- },
+// Flat footer row: site pages first, then the external profiles.
+export const FOOTER_LINKS: NavLink[] = [
+ { href: "/docs/getting-started/introduction", label: "Docs" },
+ { href: "/changelog", label: "Changelog" },
+ { href: STUDIO_URL, label: "Studio", external: true },
+ { href: "/sponsors", label: "Sponsors" },
+ { href: GITHUB_URL, label: "GitHub", external: true },
+ { href: X_URL, label: "X", external: true },
];
diff --git a/config/sponsors.ts b/config/sponsors.ts
index 35853da6..d46e7b27 100644
--- a/config/sponsors.ts
+++ b/config/sponsors.ts
@@ -277,8 +277,6 @@ export function getDocsSponsors(): Sponsor[] {
return getSponsorsFor("docs");
}
-export type BillingMode = "monthly" | "one-time";
-
export type Tier = {
id: "builder" | "partner" | "featured";
price: number;
@@ -287,8 +285,8 @@ export type Tier = {
perks: string[];
highlighted: boolean;
badge?: string;
+ /** Creem checkout for the monthly subscription. */
monthlyUrl: string;
- oneTimeUrl: string;
};
export const tiers: Tier[] = [
@@ -304,7 +302,6 @@ export const tiers: Tier[] = [
],
highlighted: false,
monthlyUrl: "https://www.creem.io/payment/prod_6fpKhXCzk9KkbA4FSUzGIU",
- oneTimeUrl: "https://www.creem.io/payment/prod_1C3cCbVoYsDPJrdlDhrhSG",
},
{
id: "partner",
@@ -319,7 +316,6 @@ export const tiers: Tier[] = [
],
highlighted: false,
monthlyUrl: "https://www.creem.io/payment/prod_6tdCLqKgSA14P0IEVZ2GaG",
- oneTimeUrl: "https://www.creem.io/payment/prod_2sb9zG2oJn232utqh5TN1S",
},
{
id: "featured",
@@ -334,6 +330,5 @@ export const tiers: Tier[] = [
highlighted: true,
badge: "Front page",
monthlyUrl: "https://www.creem.io/payment/prod_1PtwNGZVHfXZgChBSCwmJA",
- oneTimeUrl: "https://www.creem.io/payment/prod_66n8fHDfCVmwSNswCHL5OH",
},
];
diff --git a/config/x-posts.ts b/config/x-posts.ts
new file mode 100644
index 00000000..e0a64379
--- /dev/null
+++ b/config/x-posts.ts
@@ -0,0 +1,169 @@
+/**
+ * Posts about remocn on X, shown on the landing "Loved by builders" wall.
+ * Texts are trimmed to the part about remocn (leading @-replies and t.co
+ * links removed); non-English posts are shown in translation.
+ */
+export type XPost = {
+ name: string;
+ /** X handle without the leading "@". Also the avatar file name. */
+ handle: string;
+ /** `/testimonials/<handle>.jpg` */
+ avatar: string;
+ /** Who they are, shown after the handle ("creator of Remotion"). */
+ role?: string;
+ /** ISO date (YYYY-MM-DD) the post was published. */
+ date: string;
+ text: string;
+ url: string;
+ likes?: number;
+ views?: number;
+ /** Original language when `text` is a translation, e.g. "Chinese". */
+ translatedFrom?: string;
+ /** The large first card on the wall. */
+ featured?: boolean;
+};
+
+/** Every post on X that mentions remocn. */
+export const X_SEARCH_URL = "https://x.com/search?q=remocn";
+
+export const X_POSTS: XPost[] = [
+ {
+ name: "shadcn",
+ handle: "shadcn",
+ avatar: "/testimonials/shadcn.jpg",
+ date: "2026-07-04",
+ text: "Woah thank you for the incredible video @_remocn and @kapish_dima. Amazing project.",
+ url: "https://x.com/shadcn/status/2073425845520150962",
+ likes: 954,
+ views: 103976,
+ featured: true,
+ },
+ {
+ name: "Bhoomika",
+ handle: "bhoomikacodes",
+ avatar: "/testimonials/bhoomikacodes.jpg",
+ date: "2026-09-06",
+ text: "they have a 2-step setup where you enter the prompt to llm and it sets up the whole thing. and that's it. setup done. this is SOOO accessible. such small product decisions can make a HUGE difference in adoption.",
+ url: "https://x.com/bhoomikacodes/status/2096584954381582559",
+ likes: 14,
+ views: 1088,
+ },
+ {
+ name: "Sadok",
+ handle: "yesadok",
+ avatar: "/testimonials/yesadok.jpg",
+ date: "2026-10-01",
+ text: "setting up a custom pipeline without dealing with after effects is huge",
+ url: "https://x.com/yesadok/status/2105713523812909471",
+ likes: 1,
+ views: 397,
+ },
+ {
+ name: "Hayden",
+ handle: "haydenbleasel",
+ avatar: "/testimonials/haydenbleasel.jpg",
+ date: "2026-07-14",
+ text: "i did indeed! remocn is fantastic",
+ url: "https://x.com/haydenbleasel/status/2076891122459447495",
+ likes: 3,
+ views: 257,
+ },
+ {
+ name: "Jonny Burger",
+ handle: "JNYBGR",
+ avatar: "/testimonials/JNYBGR.jpg",
+ role: "creator of Remotion",
+ date: "2026-08-27",
+ text: 'I struggled a bit with the shimmer animation. Googled "remotion shimmer animation" and found this component by @_remocn! Love that the Remotion ecosystem is thriving also through the work of others 😍',
+ url: "https://x.com/JNYBGR/status/2093053965055201298",
+ likes: 5,
+ views: 1890,
+ },
+ {
+ name: "Ding",
+ handle: "dingyi",
+ avatar: "/testimonials/dingyi.jpg",
+ date: "2026-08-06",
+ text: "This component library is really handy. A video is basically a stack of animations, and this one lets an agent build product promo videos, with lots of great effects built in.",
+ url: "https://x.com/dingyi/status/2085334350925890001",
+ likes: 150,
+ views: 32845,
+ translatedFrom: "Chinese",
+ },
+ {
+ name: "Marko Denic",
+ handle: "denicmarko",
+ avatar: "/testimonials/denicmarko.jpg",
+ date: "2026-08-05",
+ text: "Great tool Dima! I love it.",
+ url: "https://x.com/denicmarko/status/2085019217665970582",
+ likes: 3,
+ views: 196,
+ },
+ {
+ name: "Miles S.",
+ handle: "milessy_bc",
+ avatar: "/testimonials/milessy_bc.jpg",
+ date: "2026-07-27",
+ text: "editing video in code got way less painful",
+ url: "https://x.com/milessy_bc/status/2081823913672085660",
+ likes: 1,
+ views: 22,
+ },
+ {
+ name: "OrcDev",
+ handle: "orcdev",
+ avatar: "/testimonials/orcdev.jpg",
+ date: "2026-08-14",
+ text: "Remocn is one of my favorite projects. I'm already making all my new project introductions / demo videos with Remocn, and I've even started editing intros for my long form videos with it.",
+ url: "https://x.com/orcdev/status/2088256522685972520",
+ likes: 15,
+ views: 2029,
+ },
+ {
+ name: "David Haz",
+ handle: "davidhaz",
+ avatar: "/testimonials/davidhaz.jpg",
+ role: "creator of React Bits",
+ date: "2026-08-02",
+ text: "Let’s go! The videos that will come out of this 🤌 Remocn takes it to the next level 🚀",
+ url: "https://x.com/davidhaz/status/2084019572609368468",
+ likes: 52,
+ views: 6570,
+ },
+ {
+ name: "code w/Guillaume",
+ handle: "guillaume_rygn",
+ avatar: "/testimonials/guillaume_rygn.jpg",
+ date: "2026-09-09",
+ text: "Found the shadcn of Remotion to ship a demo video without After Effects. Layout, type, UI blocks, transitions, every motion component is there and it's really clean! Let your agent do it, or direct it yourself!",
+ url: "https://x.com/guillaume_rygn/status/2097581401755308460",
+ likes: 349,
+ views: 22165,
+ translatedFrom: "French",
+ },
+ {
+ name: "Bart",
+ handle: "bzagrodzki",
+ avatar: "/testimonials/bzagrodzki.jpg",
+ date: "2026-10-07",
+ text: "I just one-shotted launch video for my new product with remocn. btw, launching in 20 minutes 👀",
+ url: "https://x.com/bzagrodzki/status/2107885759298675095",
+ likes: 1,
+ views: 33,
+ },
+];
+
+/** Mobile spotlight: one pulled quote plus a row of the people behind it. */
+export const X_SPOTLIGHT = {
+ handle: "JNYBGR",
+ quote:
+ "Love that the Remotion ecosystem is thriving also through the work of others.",
+ row: ["shadcn", "orcdev", "JNYBGR", "davidhaz", "dingyi"],
+};
+
+export function getXPost(handle: string): XPost {
+ const post = X_POSTS.find((p) => p.handle === handle);
+ if (!post) throw new Error(`Unknown X post handle: ${handle}`);
+ return post;
+}
diff --git a/content/docs/ai/index.mdx b/content/docs/ai/index.mdx
index bb1549be..8a8a40f1 100644
--- a/content/docs/ai/index.mdx
+++ b/content/docs/ai/index.mdx
@@ -3,61 +3,44 @@ title: AI
description: Animated AI tool interfaces — chat composers and CLI welcome screens that type a prompt, and an agent run that streams the answer
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+import { ComponentGroup } from "@/components/docs/index/category/component-group";
+
Recreations of the interfaces people open every day to talk to AI. The chat composers and coding-agent CLIs type a prompt on the timeline and share the same `useTypewriter` hook and `caret` primitive. Agent Run is brand-neutral and shows what happens after Enter — tool calls and a streamed answer.
+<CategoryIndex section="/docs/ai">
+
+<ComponentGroup
+ items={[
+ "claude-chat",
+ "chat-gpt",
+ "v0",
+ ]}
+>
+
## Chat composers
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "ClaudeChat",
- description: "Claude chat input — types a prompt and the waveform button morphs into a send button",
- status: "stable",
- href: "/docs/ai/claude-chat",
- },
- {
- name: "ChatGPT",
- description: "ChatGPT composer — types a prompt, morphs the voice button to send, and fades the suggestion chips",
- status: "stable",
- href: "/docs/ai/chat-gpt",
- },
- {
- name: "v0",
- description: "Vercel v0 composer — types into the dark textarea and morphs the mic button into a send button",
- status: "stable",
- href: "/docs/ai/v0",
- },
+ "claude-code",
+ "opencode",
]}
-/>
+>
## Coding agents
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "ClaudeCode",
- description: "Claude Code CLI welcome screen — types a command into the terminal prompt with a block cursor",
- status: "stable",
- href: "/docs/ai/claude-code",
- },
- {
- name: "OpenCode",
- description: "OpenCode TUI welcome screen — types a query into the input below the wordmark",
- status: "stable",
- href: "/docs/ai/opencode",
- },
+ "agent-run",
]}
-/>
+>
## Agent runs
-<ComponentCardGrid
- items={[
- {
- name: "AgentRun",
- description: "Brand-neutral agent run — tool calls resolve against a real-seconds timer, then the markdown answer streams in bursts",
- status: "stable",
- href: "/docs/ai/agent-run",
- },
- ]}
-/>
+</ComponentGroup>
+
+</CategoryIndex>
diff --git a/content/docs/captions/getting-started/introduction.mdx b/content/docs/captions/getting-started/introduction.mdx
index aabf6583..c4185ccc 100644
--- a/content/docs/captions/getting-started/introduction.mdx
+++ b/content/docs/captions/getting-started/introduction.mdx
@@ -3,34 +3,94 @@ title: Introduction
description: Subtitles rendered from a timed transcript, word by word, in sync with a real voiceover
---
-A caption takes a transcript with a start and end time on every word and turns it into an animated text block that follows the voice. It groups the words into short pages, shows one page at a time, and animates the word being spoken right now.
+import { CaptionHero } from "@/components/docs/index/libraries/caption-hero";
+import { HowItWorks } from "@/components/docs/index/libraries/how-it-works";
+import { LibraryGallery } from "@/components/docs/index/libraries/library-gallery";
+import { RuntimeCommand } from "@/components/docs/index/libraries/runtime-command";
+import { TranscriptSources } from "@/components/docs/index/libraries/transcript-sources";
-```tsx
+<CaptionHero name="caption-karaoke" photo="/reel/reel-3.jpg" />
+
+<HowItWorks
+ steps={[
+ {
+ title: "Get a transcript",
+ body: "Transcribe once, outside the video, with whichever speech-to-text you already use.",
+ },
+ {
+ title: "Save it as JSON",
+ body: "Every source ends in the same Caption[] array. Keep it next to your composition.",
+ },
+ {
+ title: "Pick a style",
+ body: "Every style shares the same base props, so switching looks is a one-line change.",
+ },
+ ]}
+>
+
+## How it works
+
+A caption takes a transcript with a start and end time on every word and turns it into a text block that follows the voice. It groups words into short pages, shows one page at a time and animates the word being spoken.
+
+</HowItWorks>
+
+<TranscriptSources
+ title="Where the transcript comes from"
+ note="Each ends in the same Caption[]"
+ sources={[
+ {
+ title: "whisper.cpp, locally",
+ body: "Free and offline. Transcribes a 16 kHz WAV file.",
+ code: "@remotion/install-whisper-cpp",
+ },
+ {
+ title: "OpenAI Whisper API",
+ body: "Request verbose JSON with word timestamps.",
+ code: "@remotion/openai-whisper",
+ },
+ {
+ title: "ElevenLabs",
+ body: "The Speech-to-Text response or a segmented export.",
+ code: "@remotion/elevenlabs",
+ },
+ {
+ title: "Existing subtitles",
+ body: "Parse an .srt file. Lines are timed, not single words.",
+ code: "parseSrt()",
+ },
+ ]}
+/>
+
+<RuntimeCommand command="npx remotion add @remotion/captions">
+ Install the caption runtime first, so it matches your Remotion version:
+</RuntimeCommand>
+
+<InstallBlock name="caption-karaoke" />
+
+```tsx title="subtitles.tsx"
import captions from "./captions.json";
import { CaptionKaraoke } from "@/components/remocn/caption-karaoke";
export const Subtitles = () => <CaptionKaraoke captions={captions} />;
```
-## Captions are not typography
+<Note title="Works in Remotion Studio">
+Remotion Studio 4.0.535 and newer can transcribe a video and caption it for you. Every style here is a Studio caption style: add the remocn library while Studio is running and pick a look in the Styles tab of Generate captions.
+</Note>
-[Word Stream](/docs/typography/word-stream), [Typewriter](/docs/typography/typewriter) and [Per-Word Crossfade](/docs/typography/per-word-crossfade) animate text you script yourself, on timing they invent. A caption has no timing of its own: every word lands when the speaker says it, because the transcript says so. That is what `length: transcript-driven` means in the docs metadata.
+<LibraryGallery kind="caption">
-Reach for typography when the words are on-screen copy. Reach for a caption when the words are someone talking.
+## All caption styles
-## Installation
+Every tile reads the same transcript and shows the word being spoken right now.
-Install the caption runtime with the Remotion CLI first. It installs the version that matches your `remotion`, which is why the registry items do not pin it.
+</LibraryGallery>
-```bash
-npx remotion add @remotion/captions
-```
+## Captions are not typography
-Then add a caption style.
+[Word Stream](/docs/typography/word-stream), [Typewriter](/docs/typography/typewriter) and [Per-Word Crossfade](/docs/typography/per-word-crossfade) animate text you script yourself, on timing they invent. A caption has no timing of its own: every word lands when the speaker says it, because the transcript says so. That is what `length: transcript-driven` means in the docs metadata.
-```bash
-npx shadcn@latest add @remocn/caption-karaoke
-```
+Reach for typography when the words are on-screen copy. Reach for a caption when the words are someone talking.
## The shared API
diff --git a/content/docs/components.mdx b/content/docs/components.mdx
index ad9ccf78..7662031a 100644
--- a/content/docs/components.mdx
+++ b/content/docs/components.mdx
@@ -1,610 +1,35 @@
---
-title: Components
-description: Every component in remocn, grouped by category
+title: Documentation
+description: Every component in remocn, grouped by category. Browse by category or jump straight to the one you need.
---
-A complete index of every component in remocn. Browse by category or jump straight to the one you need.
+import { CategoryList } from "@/components/docs/index/home/category-list";
+import { GuidesFeature } from "@/components/docs/index/home/guides-feature";
+import { LibraryTiles } from "@/components/docs/index/home/library-tiles";
+import { StartHere } from "@/components/docs/index/home/start-here";
-## Layout
+<StartHere>
-Scene scaffolding — backgrounds and camera wrappers.
+## Start here
-<ComponentCardGrid
- items={[
- {
- name: "Backdrop",
- description: "Full-frame fill with an optional rounded, shadowed content frame for any scene",
- status: "stable",
- href: "/docs/layout/backdrop",
- },
- {
- name: "Drift",
- description: "Wrap any scene in a slow camera push-in so no frame is ever static",
- status: "stable",
- href: "/docs/layout/drift",
- },
- ]}
-/>
+</StartHere>
-## Typography
+<GuidesFeature guide="showcase-reel">
-Text effects, reveals, and kinetic type.
+## Make a video
-### Reveals
+</GuidesFeature>
-<ComponentCardGrid
- items={[
- {
- name: "SoftBlurIn",
- description: "Per-character fade-in with a gentle blur and upward motion",
- status: "stable",
- href: "/docs/typography/soft-blur-in",
- },
- {
- name: "PerCharacterRise",
- description: "Letters slide up from below with no blur — crisp and kinetic",
- status: "stable",
- href: "/docs/typography/per-character-rise",
- },
- {
- name: "BottomUpLetters",
- description: "Letters rise from below in a pronounced staircase, one symbol at a time",
- status: "stable",
- href: "/docs/typography/bottom-up-letters",
- },
- {
- name: "TopDownLetters",
- description: "Letters descend from above in a pronounced staircase, one symbol at a time",
- status: "stable",
- href: "/docs/typography/top-down-letters",
- },
- {
- name: "Handwrite",
- description: "Letters laid down one pose at a time, each with its own slant and baseline wobble",
- status: "stable",
- href: "/docs/typography/handwrite",
- },
- {
- name: "SpringScaleIn",
- description: "Words pop in with a soft overshoot scale, like a spring settling",
- status: "stable",
- href: "/docs/typography/spring-scale-in",
- },
- {
- name: "MicroScaleFade",
- description: "A calm, tiny scale pop for subtle premium polish",
- status: "stable",
- href: "/docs/typography/micro-scale-fade",
- },
- {
- name: "ScaleDownFade",
- description: "Subtle premium settle-in with a restrained scale-down fade on exit",
- status: "stable",
- href: "/docs/typography/scale-down-fade",
- },
- {
- name: "BlurOutUp",
- description: "Words arrive clean and depart upward with increasing blur",
- status: "stable",
- href: "/docs/typography/blur-out-up",
- },
- {
- name: "FocusBlurResolve",
- description: "A premium focus pull from heavy blur to crisp text, then a soft blur-out exit",
- status: "stable",
- href: "/docs/typography/focus-blur-resolve",
- },
- {
- name: "LineByLineSlide",
- description: "Each line slides in from the left with a staggered flow",
- status: "stable",
- href: "/docs/typography/line-by-line-slide",
- },
- {
- name: "StaggeredFadeUp",
- description: "Words rise from below with a soft cascading delay",
- status: "stable",
- href: "/docs/typography/staggered-fade-up",
- },
- {
- name: "MaskRevealUp",
- description: "Lines reveal upward with a soft masked feel and compact stagger",
- status: "stable",
- href: "/docs/typography/mask-reveal-up",
- },
- {
- name: "TrackingIn",
- description: "Letter-spacing collapses from wide to normal with a spring snap",
- status: "stable",
- href: "/docs/typography/tracking-in",
- },
- ]}
-/>
+<CategoryList>
-### Highlights
+## Components
-<ComponentCardGrid
- items={[
- {
- name: "InlineHighlight",
- description: "Animates one word inside a sentence from a base color to a brand color",
- status: "stable",
- href: "/docs/typography/inline-highlight",
- },
- {
- name: "MarkerHighlight",
- description: "Marker bar sweeps in behind a phrase, optionally inverting the text color",
- status: "stable",
- href: "/docs/typography/marker-highlight",
- },
- {
- name: "InkUnderline",
- description: "A hand-dragged ink stroke that draws itself across in a few stop-motion poses",
- status: "stable",
- href: "/docs/typography/ink-underline",
- },
- {
- name: "ShimmerSweep",
- description: "Bright gradient sweeps across dim text, lighting it up",
- status: "stable",
- href: "/docs/typography/shimmer-sweep",
- },
- ]}
-/>
+</CategoryList>
-### Dynamic Text
+<LibraryTiles>
-<ComponentCardGrid
- items={[
- {
- name: "Typewriter",
- description: "Character-by-character text reveal with a deterministic blinking cursor",
- status: "stable",
- href: "/docs/typography/typewriter",
- },
- {
- name: "HandCount",
- description: "A number that counts up in stop-motion poses, rewritten by hand at every pose",
- status: "stable",
- href: "/docs/typography/hand-count",
- },
- {
- name: "SlotMachineRoll",
- description: "Numbers and characters roll into place like a casino reel",
- status: "stable",
- href: "/docs/typography/slot-machine-roll",
- },
- {
- name: "RolodexFlip",
- description: "Cycle a word through a list of values with a 3D rolodex card flip",
- status: "stable",
- href: "/docs/typography/rolodex-flip",
- },
- {
- name: "ValueSwap",
- description: "Swap a value in place with a vertical slide so the layout never shifts",
- status: "stable",
- href: "/docs/typography/value-swap",
- },
- ]}
-/>
+## Libraries
-### Hero & Display
+Each has its own tab in the sidebar switcher, with an introduction and its own component list.
-<ComponentCardGrid
- items={[
- {
- name: "InfiniteMarquee",
- description: "Endlessly scrolling horizontal text band",
- status: "stable",
- href: "/docs/typography/infinite-marquee",
- },
- {
- name: "PerspectiveMarquee",
- description: "Marquee tilted into 3D space with depth fade",
- status: "stable",
- href: "/docs/typography/perspective-marquee",
- },
- ]}
-/>
-
-### Tech & Glitch
-
-<ComponentCardGrid
- items={[
- {
- name: "MatrixDecode",
- description: "Random characters scramble and resolve into the target string",
- status: "stable",
- href: "/docs/typography/matrix-decode",
- },
- {
- name: "RGBGlitchText",
- description: "Three-channel RGB split with a brief horizontal jitter",
- status: "stable",
- href: "/docs/typography/rgb-glitch-text",
- },
- ]}
-/>
-
-### Text Transitions
-
-<ComponentCardGrid
- items={[
- {
- name: "PerWordCrossfade",
- description: "One phrase fades out as the next fades in, word by word",
- status: "stable",
- href: "/docs/typography/per-word-crossfade",
- },
- {
- name: "FadeThrough",
- description: "Old text fades out as new fades in, Material-style",
- status: "stable",
- href: "/docs/typography/fade-through",
- },
- {
- name: "SharedAxisY",
- description: "Per-word hard-cut staircase for sharp editorial swaps",
- status: "stable",
- href: "/docs/typography/shared-axis-y",
- },
- {
- name: "SharedAxisZ",
- description: "Scale-based depth transition for focus shifts",
- status: "stable",
- href: "/docs/typography/shared-axis-z",
- },
- ]}
-/>
-
-### Kinetic
-
-<ComponentCardGrid
- items={[
- {
- name: "ShortSlideRight",
- description: "The whole phrase glides in from the left while words reveal in sequence",
- status: "stable",
- href: "/docs/typography/short-slide-right",
- },
- {
- name: "KineticCenterBuild",
- description: "Words enter from the right and push the line until the phrase locks centered",
- status: "stable",
- href: "/docs/typography/kinetic-center-build",
- },
- {
- name: "ShortSlideDown",
- description: "Words drop in from above and stack into a centered composition",
- status: "stable",
- href: "/docs/typography/short-slide-down",
- },
- ]}
-/>
-
-## UI Blocks
-
-Pre-assembled interface elements: code editors, layouts, charts, and workflow visualizations.
-
-### Code & CLI
-
-<ComponentCardGrid
- items={[
- {
- name: "GlassCodeBlock",
- description: "Premium frosted-glass code window with rim light and traffic-light controls",
- status: "stable",
- href: "/docs/ui-blocks/glass-code-block",
- },
- {
- name: "TerminalSimulator",
- description: "CLI build simulation with chunked log output and step-function scrolling",
- status: "stable",
- href: "/docs/ui-blocks/terminal-simulator",
- },
- {
- name: "TerminalCursorZoom",
- description: "Camera rides the typing cursor, dollying across a terminal as a command types at high zoom",
- status: "stable",
- href: "/docs/ui-blocks/terminal-cursor-zoom",
- },
- ]}
-/>
-
-### Data & System
-
-<ComponentCardGrid
- items={[
- {
- name: "AnimatedLineChart",
- description: "SVG line chart drawn left-to-right via stroke-dashoffset",
- status: "stable",
- href: "/docs/ui-blocks/animated-line-chart",
- },
- {
- name: "AnimatedBarChart",
- description: "Bars spring up from the baseline with deterministic stagger",
- status: "stable",
- href: "/docs/ui-blocks/animated-bar-chart",
- },
- ]}
-/>
-
-### Paper & Scrapbook
-
-<ComponentCardGrid
- items={[
- {
- name: "CheckList",
- description: "A handwritten checklist that writes itself out, then ticks and strikes through every done item",
- status: "stable",
- href: "/docs/ui-blocks/check-list",
- },
- {
- name: "PaperSticker",
- description: "A taped paper chip that slaps onto the scene over two stop-motion poses",
- status: "stable",
- href: "/docs/ui-blocks/paper-sticker",
- },
- {
- name: "Polaroid",
- description: "An instant-photo frame with a handwritten caption for video, images, or live compositions",
- status: "stable",
- href: "/docs/ui-blocks/polaroid",
- },
- {
- name: "Reel",
- description: "A fixed centered card where images stack on the z-axis and each blooms open over the last",
- status: "stable",
- href: "/docs/ui-blocks/reel",
- },
- ]}
-/>
-
-## Transitions
-
-Scene transitions, camera moves, and stylized wipes.
-
-### Camera Motion
-
-<ComponentCardGrid
- items={[
- {
- name: "WhipPan",
- description: "Whip the camera sideways with motion blur so both scenes fly through in one move",
- status: "stable",
- href: "/docs/transitions/whip-pan",
- },
- {
- name: "PushThrough",
- description: "Dolly through the outgoing scene while the next one approaches from the depth",
- status: "stable",
- href: "/docs/transitions/push-through",
- },
- {
- name: "FocusPull",
- description: "Rack focus from one scene to the next through a soft defocus breath",
- status: "stable",
- href: "/docs/transitions/focus-pull",
- },
- {
- name: "ZoomBlur",
- description: "Push the outgoing scene through the viewer while the incoming one resolves out of blur",
- status: "stable",
- href: "/docs/transitions/zoom-blur",
- },
- {
- name: "PageTurn",
- description: "The exiting scene swings up and away like a notebook page in stop-motion poses",
- status: "stable",
- href: "/docs/transitions/page-turn",
- },
- ]}
-/>
-
-### Shader
-
-<ComponentCardGrid
- items={[
- {
- name: "SwirlDissolve",
- description: "Unwind a swirl shader open and wind it shut to reveal the next scene",
- status: "stable",
- href: "/docs/transitions/swirl-dissolve",
- },
- {
- name: "DitherDissolve",
- description: "Dissolve one scene into the next through a drifting field of dither pixels",
- status: "stable",
- href: "/docs/transitions/dither-dissolve",
- },
- {
- name: "PerlinDissolve",
- description: "Sweep a perlin-noise threshold across the frame to dissolve into the next scene",
- status: "stable",
- href: "/docs/transitions/perlin-dissolve",
- },
- {
- name: "SmokeDissolve",
- description: "Expand a smoke ring outward across the frame to reveal the next scene",
- status: "stable",
- href: "/docs/transitions/smoke-dissolve",
- },
- {
- name: "GrainDissolve",
- description: "Disintegrate the outgoing scene into soft grainy shapes and condense the next out of the noise",
- status: "stable",
- href: "/docs/transitions/grain-dissolve",
- },
- {
- name: "WaveWipe",
- description: "Sweep a grainy wave up across the frame and reveal the next scene from below",
- status: "stable",
- href: "/docs/transitions/wave-wipe",
- },
- {
- name: "RippleZoom",
- description: "Fly the camera through the center of grainy ripple rings while the next scene approaches from the depth",
- status: "stable",
- href: "/docs/transitions/ripple-zoom",
- },
- {
- name: "WarpDissolve",
- description: "Melt the outgoing scene into a folding domain-warp field that straightens into the next",
- status: "stable",
- href: "/docs/transitions/warp-dissolve",
- },
- ]}
-/>
-
-### Stylized
-
-<ComponentCardGrid
- items={[
- {
- name: "AsciiDissolve",
- description: "Dissolve one scene into the next through a drifting field of ASCII glyphs",
- status: "stable",
- href: "/docs/transitions/ascii-dissolve",
- },
- {
- name: "CaretWipe",
- description: "Sweep a typing caret across the frame, wiping the outgoing scene into the next",
- status: "stable",
- href: "/docs/transitions/caret-wipe",
- },
- {
- name: "IconScatter",
- description: "Scatter a field of icons over the cut, hiding the scene swap at the field's peak",
- status: "stable",
- href: "/docs/transitions/icon-scatter",
- },
- {
- name: "GlitchCut",
- description: "Tear a hard cut into displaced slices with channel split and corrupted blocks",
- status: "stable",
- href: "/docs/transitions/glitch-cut",
- },
- {
- name: "EmberBurn",
- description: "Set the outgoing frame on fire so it boils, chars, and blows away as sparks that carry its own colour",
- status: "stable",
- href: "/docs/transitions/ember-burn",
- },
- {
- name: "ParticleDissolve",
- description: "Grind the frame into drifting grey dust and let the next scene coalesce back out of it",
- status: "stable",
- href: "/docs/transitions/particle-dissolve",
- },
- {
- name: "GridWave",
- description: "Send a wave across the frame that raises the picture into solid blocks and sets them down carrying the next scene",
- status: "stable",
- href: "/docs/transitions/grid-wave",
- },
- {
- name: "Displacement",
- description: "Shear the frame into a grid of offset colour-fringed tiles and settle them back on the next scene",
- status: "stable",
- href: "/docs/transitions/displacement",
- },
- ]}
-/>
-
-### Scene Sequencers
-
-Sequencers rather than presentations — they own the whole run of scenes and the boundary between them.
-
-<ComponentCardGrid
- items={[
- {
- name: "SlideSwapScenes",
- description: "Shove one scene off the canvas and spring the next in from the opposite edge",
- status: "stable",
- href: "/docs/transitions/slide-swap",
- },
- {
- name: "SpringSettleScenes",
- description: "Shrink a scene away as one group, hold the stage empty for a beat, then land the next from above",
- status: "stable",
- href: "/docs/transitions/spring-settle",
- },
- ]}
-/>
-
-## Effects
-
-Physical overlays and hand-made motion.
-
-<ComponentCardGrid
- items={[
- {
- name: "PaperWobble",
- description: "Per-pose reshoot jitter that makes any content feel hand-placed on a desk",
- status: "stable",
- href: "/docs/effects/paper-wobble",
- },
- {
- name: "InkArrow",
- description: "A hand-drawn arrow that draws itself from one point to another, head popping on the final pose",
- status: "stable",
- href: "/docs/effects/ink-arrow",
- },
- {
- name: "ScribbleCircle",
- description: "A brush circle that sweeps itself around a region of the frame, opening thin and closing thick",
- status: "stable",
- href: "/docs/effects/scribble-circle",
- },
- {
- name: "CrumpleToss",
- description: "Crushes an element into a ball of paper and throws it out of frame",
- status: "stable",
- href: "/docs/effects/crumple-toss",
- },
- {
- name: "Confetti",
- description: "A one-shot burst of paper confetti for milestone and celebration beats",
- status: "stable",
- href: "/docs/effects/confetti",
- },
- ]}
-/>
-
-## Compositions
-
-Full scenes built by composing primitives and UI blocks.
-
-### Hero & Outro
-
-<ComponentCardGrid
- items={[
- {
- name: "EcosystemConstellation",
- description: "Central logo orbited by integration satellites with pulsing data lines",
- status: "stable",
- href: "/docs/compositions/ecosystem-constellation",
- },
- {
- name: "InfiniteBentoPan",
- description: "Camera diagonally drifts across an oversized bento grid behind a soft vignette",
- status: "stable",
- href: "/docs/compositions/infinite-bento-pan",
- },
- ]}
-/>
-
-### Product Showcases
-
-<ComponentCardGrid
- items={[
- {
- name: "LiveCodeCompilation",
- description: "Split-screen where typed code on the left snaps a live UI preview on the right",
- status: "stable",
- href: "/docs/compositions/live-code-compilation",
- },
- ]}
-/>
+</LibraryTiles>
diff --git a/content/docs/compositions/index.mdx b/content/docs/compositions/index.mdx
index 5fce6421..e0547baa 100644
--- a/content/docs/compositions/index.mdx
+++ b/content/docs/compositions/index.mdx
@@ -3,36 +3,32 @@ title: Compositions
description: Full scenes built by composing primitives and UI blocks
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+import { ComponentGroup } from "@/components/docs/index/category/component-group";
+
Higher-level templates that combine multiple primitives, UI blocks, and transitions into finished shots: heroes, product showcases, and journeys.
-## Hero & Outro
+<CategoryIndex section="/docs/compositions">
-<ComponentCardGrid
+<ComponentGroup
items={[
- {
- name: "EcosystemConstellation",
- description: "Central logo orbited by integration satellites with pulsing data lines",
- status: "stable",
- href: "/docs/compositions/ecosystem-constellation",
- },
- {
- name: "InfiniteBentoPan",
- description: "Camera diagonally drifts across an oversized bento grid behind a soft vignette",
- status: "stable",
- href: "/docs/compositions/infinite-bento-pan",
- },
+ "ecosystem-constellation",
+ "infinite-bento-pan",
]}
-/>
+>
-## Product Showcases
+## Hero & Outro
+
+</ComponentGroup>
-<ComponentCardGrid
+<ComponentGroup
items={[
- {
- name: "LiveCodeCompilation",
- description: "Split-screen where typed code on the left snaps a live UI preview on the right",
- status: "stable",
- href: "/docs/compositions/live-code-compilation",
- },
+ "live-code-compilation",
]}
-/>
+>
+
+## Product Showcases
+
+</ComponentGroup>
+
+</CategoryIndex>
diff --git a/content/docs/effects/index.mdx b/content/docs/effects/index.mdx
index 8dfd94d3..d3edd3bc 100644
--- a/content/docs/effects/index.mdx
+++ b/content/docs/effects/index.mdx
@@ -3,39 +3,8 @@ title: Effects
description: Reusable Remotion effect overlays for celebratory and atmospheric moments
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+
Drop-in effect overlays you compose on top of any scene — fire them on a frame and let them play out.
-<ComponentCardGrid
- items={[
- {
- name: "Keystroke",
- description: "Physical keycaps that press a shortcut in real order and spring back, on the frame the UI reacts",
- status: "stable",
- href: "/docs/effects/keystroke",
- },
- {
- name: "Cursor Gravity",
- description: "A soft triangular cursor extracts a hidden button from the screen edge with elastic tugs",
- status: "stable",
- href: "/docs/effects/cursor-gravity",
- },
- {
- name: "Radial Burst",
- description: "A sculptural intro — twisting ribbons fold into a tilted ring and sweep outward with contour echoes",
- status: "stable",
- href: "/docs/effects/radial-burst",
- },
- {
- name: "TV Power Off",
- description: "Collapses a scene into a glowing line and a phosphor dot the way a tube switches off, leaving the frame dead black",
- status: "stable",
- href: "/docs/effects/tv-power-off",
- },
- {
- name: "Confetti",
- description: "Deterministic confetti burst — seeded particles with gravity, spin, and flutter, fired on any frame",
- status: "stable",
- href: "/docs/effects/confetti",
- },
- ]}
-/>
+<CategoryIndex section="/docs/effects" />
diff --git a/content/docs/filters/getting-started/introduction.mdx b/content/docs/filters/getting-started/introduction.mdx
index cd44e815..af2056c9 100644
--- a/content/docs/filters/getting-started/introduction.mdx
+++ b/content/docs/filters/getting-started/introduction.mdx
@@ -3,9 +3,38 @@ title: Introduction
description: Pixel-level treatments you hold over a whole scene, built on the experimental html-in-canvas browser API
---
-A filter wraps a scene and re-reads its pixels every frame. Put your scene inside one and it comes out as tape footage, as a CRT display, as halftone print — the treatment stays on for as long as the scene runs.
-
-```tsx
+import { FiltersHero } from "@/components/docs/index/libraries/filter-hero-section";
+import { HowItWorks } from "@/components/docs/index/libraries/how-it-works";
+import { LibraryGallery } from "@/components/docs/index/libraries/library-gallery";
+
+<FiltersHero filterLabel="<VhsFilter>" tags={["Sustained, no progress"]} />
+
+<HowItWorks
+ steps={[
+ {
+ title: "Wrap the scene",
+ body: "Put your scene inside the filter. No progress to drive, no second scene, no state to pass.",
+ },
+ {
+ title: "It holds, never drifts",
+ body: "Motion inside is a pure function of the frame. Frame 600 looks like frame 60, detail elsewhere.",
+ },
+ {
+ title: "Nest to stack looks",
+ body: "The innermost filter runs first. Keep the one that bends geometry outermost.",
+ },
+ ]}
+>
+
+## How it works
+
+A filter wraps a scene and re-reads its pixels every frame. Put your scene inside one and it comes out as tape footage, as a CRT display, as halftone print, for as long as the scene runs.
+
+</HowItWorks>
+
+<InstallBlock name="vhs-filter" />
+
+```tsx title="scene.tsx"
import { VhsFilter } from "@/components/remocn/vhs-filter";
export const Scene = () => (
@@ -15,32 +44,16 @@ export const Scene = () => (
);
```
-## Filters are not transitions
-
-Both categories sit on the same html-in-canvas foundation, but they answer different questions.
-
-A transition covers a cut. It has a progress, it runs between two scenes, and it is over in a dozen frames. A filter has no progress and no second scene: it is a look, and it lasts exactly as long as the scene it wraps. That is what `length: sustained` means in the docs metadata — budget no frames for a filter and pass it no `state`, just wrap the scene and let it run.
-
-Reach for a transition when the effect should live at the edit. Reach for a filter when the effect is the scene's material.
-
-## What a filter can do that CSS cannot
-
-A CSS `filter` can only work with the colour already under each pixel: blur it, tint it, raise its contrast. It cannot read somewhere else. Every filter here does exactly that — it writes each output pixel from a *different* source coordinate.
-
-That is the whole reason the category needs a browser API instead of a stylesheet. Chroma that bleeds sideways off an edge, a frame curved around a CRT's glass, a cell that collapses to the average colour of everything inside it, a picture seen through moving water — none of them are reachable by blending what is already in place.
-
-## Motion, and why it never drifts
-
-A filter has to be able to sit on a scene for its whole duration, so whatever moves inside it — tape wobble, ripple phase, noise — is a pure function of the current frame. It oscillates and never trends: come back at frame 600 and the look is the same as at frame 60, with the detail in a different place.
-
-That also makes the output deterministic. Nothing is simulated forward from a previous frame and no wall-clock time is read, so parallel and server-side renders produce identical pixels.
-
-## Browser support
+<Note title="Filters are not transitions">
+A transition covers a cut: it has a progress, runs between two scenes and is over in a dozen frames. A filter has no progress and no second scene. It is a look, and it lasts exactly as long as the scene it wraps, which is what `length: sustained` means in the docs metadata. Reach for a filter when the effect is the scene's material.
+</Note>
<CanvasFilterNote />
-## Composing filters
+<LibraryGallery kind="filter">
+
+## All filters
-Filters wrap, so they nest, and the innermost one is applied first. Each level costs another capture and another shader pass, so keep stacks shallow and put the filter that changes geometry — a warp, a curvature — outermost, where it can bend everything the inner ones produced.
+Every tile is the same frame, run through a different filter.
-Browse the individual filters in the sidebar to preview each one and grab its install command.
+</LibraryGallery>
diff --git a/content/docs/getting-started/introduction.mdx b/content/docs/getting-started/introduction.mdx
index a3f362ab..3c5cfbd1 100644
--- a/content/docs/getting-started/introduction.mdx
+++ b/content/docs/getting-started/introduction.mdx
@@ -1,70 +1,98 @@
---
title: Introduction
-description: What remocn is — a shadcn-style component registry for Remotion plus an agent skill. Copy-paste video components, MIT, code lives in your repo.
+description: "What remocn is: a shadcn-style component registry for Remotion plus an agent skill. Copy-paste video components, MIT, code lives in your repo."
---
-remocn is shadcn for Remotion. It is a registry of copy-paste video components (text animations, transitions, backgrounds, UI blocks, icons) that you add to a [Remotion](https://www.remotion.dev) project with the shadcn CLI, plus an [agent skill](/docs/getting-started/agent-skill) that teaches AI coding agents how to compose a video from them. Everything is MIT, and the code lands in your repo, not in `node_modules`.
+import { CompareTable } from "@/components/docs/index/introduction/compare-table";
+import { Faq } from "@/components/docs/index/introduction/faq";
+import { NextLinks } from "@/components/docs/index/introduction/next-links";
+import { NotCards } from "@/components/docs/index/introduction/not-cards";
+import { Aside, FirstComponent, Pillar, Pillars } from "@/components/docs/index/introduction/overview";
+import { InstallationLink, QuickStart, Step } from "@/components/docs/index/introduction/quick-start";
+import { AgentSkillPanel, ApiChips, PartTiles } from "@/components/docs/index/introduction/remotion";
+import { FileFlow, IconNote, RuntimeDiff } from "@/components/docs/index/introduction/runtime";
+import { Tier, Tiers } from "@/components/docs/index/introduction/tiers";
-If you searched for "remotion shadcn" or "shadcn remotion", this is the thing you were looking for.
+<Pillars>
+ <Pillar icon="components" title="Copy-paste components">Text animations, transitions, backgrounds, UI blocks and icons, added to a [Remotion](https://www.remotion.dev) project with the shadcn CLI.</Pillar>
+ <Pillar icon="sparkle" title="Plus an agent skill">Teaches AI coding agents how to compose a video from those components.</Pillar>
+ <Pillar icon="folder" title="MIT, code in your repo" path="components/remocn/">Everything is MIT. Files are copied into your repo, where you own and edit them.</Pillar>
+</Pillars>
-```bash
-npx shadcn@latest add @remocn/soft-blur-in
-```
+<FirstComponent name="soft-blur-in" />
+
+<Aside>If you searched for “remotion shadcn” or “shadcn remotion”, this is the thing you were looking for.</Aside>
## If you know shadcn/ui
-The workflow is the one you already use. There is a `components.json`, there is `npx shadcn add`, and each component is a `.tsx` file copied into `components/remocn/` that you own and edit. remocn is a namespaced registry, so components are addressed as `@remocn/<name>`.
+The workflow is the one you already use. remocn is a namespaced registry, so components are addressed by name and copied in as files you own and edit.
-What changes is the runtime. A shadcn button responds to a click. A remocn component is a pure function of `useCurrentFrame()`: it renders the same pixels for the same frame every time, which is what Remotion's headless renderer needs. There is no `useState`, no event handler, no CSS transition. Timing is expressed in frames, and every component page tells you how many frames its motion takes so you can budget a `Sequence`.
+<FileFlow steps={["components.json", "npx shadcn add @remocn/<name>", "components/remocn/<name>.tsx"]} />
-remocn ships two tiers of components:
+<RuntimeDiff />
-- **Animation tier** (`remocn`): text reveals, scene transitions, shader and canvas backgrounds, UI-block simulations, icons that draw themselves in.
-- **UI tier** (`remocn-ui`): familiar shadcn primitives (Button, Input, Checkbox, Select, Dialog) rebuilt so their states are [scripted on the timeline](/docs/ui) instead of driven by the user.
+<IconNote icon="timer">Timing is expressed in frames. Every component page tells you how many frames its motion takes, so you can budget a Sequence.</IconNote>
## If you know Remotion
-`npx create-video` gives you a blank canvas and the right APIs. remocn gives you the parts that every product video needs and that you would otherwise rebuild each time: a blur-in for the headline, a push transition between scenes, a background that moves, a terminal that types. Each one already uses `interpolate()` and `spring()` correctly and avoids the traps that break deterministic rendering, such as `Math.random()` inside a frame.
+A fresh Remotion project gives you a blank canvas and the right APIs. remocn gives you the parts every product video needs, which you would otherwise rebuild each time.
-The agent skill is the other half. It reads the [component index](/docs/components) live from this site, picks components by their use and avoid signals, budgets the timeline, and composes scenes in a consistent style. If you build videos with Claude Code, Cursor or a similar agent, the skill is the difference between "generate a Remotion video" and a video that looks shipped.
+<PartTiles />
-## What remocn is not
+Each one already uses the Remotion APIs correctly and avoids the traps that break deterministic rendering.
-- **Not After Effects or a video editor.** There is no timeline UI to drag things around in. You write or prompt code, and Remotion Studio previews the result.
-- **Not a hosted service.** Nothing runs on remocn servers. No account, no runtime, no usage limits. Rendering happens on your machine or wherever you run Remotion.
-- **Not a fork of Remotion.** Remotion is a prerequisite, and remocn is a set of components written against its public API. Remotion keeps [its own license](https://www.remotion.dev/docs/license); remocn's own code is MIT.
-- **Not only AI chat components.** The [AI section](/docs/ai) recreates chat composers and CLI screens because product demos need them often, but it is one category among text, transitions, backgrounds, layout, UI blocks and templates.
+<ApiChips uses={["interpolate()", "spring()"]} avoids="Math.random()" avoidsNote="inside a frame" />
-remocn is an independent project. It is not affiliated with shadcn or with Remotion; it builds on the shadcn CLI and the Remotion library.
+<AgentSkillPanel
+ title="The agent skill is the other half"
+ lead="For anyone who builds videos with Claude Code, Cursor or a similar agent."
+ steps={[
+ "Reads the component index live from this site",
+ "Picks components by their use and avoid signals",
+ "Budgets the timeline",
+ "Composes scenes in a consistent style",
+ ]}
+ from="generate a Remotion video"
+ to="a video that looks shipped"
+/>
-## Quick start
+## Two tiers of components
-You need a Remotion project. If you do not have one:
+remocn ships two tiers of components. Both install the same way, as files in your repo.
-```bash
-npx create-video@latest
-```
+<Tiers>
+<Tier name="Animation tier" registry="remocn" links={[{ href: "/docs/shaders/getting-started/introduction", label: "Shader and canvas backgrounds" }, { href: "/docs/typography", label: "Text reveals" }, { href: "/docs/transitions", label: "Scene transitions" }, { href: "/docs/ui-blocks", label: "UI-block simulations" }, { href: "/docs/icons/gallery", label: "Icons that draw themselves in" }]} />
+<Tier name="UI tier" registry="remocn-ui" links={[{ href: "/docs/ui/components/button" }, { href: "/docs/ui/components/input" }, { href: "/docs/ui/components/checkbox" }, { href: "/docs/ui/components/select" }, { href: "/docs/ui/components/dialog" }]}>Familiar shadcn primitives rebuilt so their states are [scripted on the timeline](/docs/ui) instead of driven by the user.</Tier>
+</Tiers>
-Then initialize shadcn (if the project has no `components.json`) and add a component:
+## What remocn is not
-```bash
-npx shadcn@latest init
-npx shadcn@latest add @remocn/soft-blur-in
-```
+<NotCards icons={["editor", "cloud", "fork", "chat"]}>
-If you work through an AI agent, install the skill too:
+- **Not After Effects or a video editor.** There is no timeline UI to drag things around in. You write or prompt code, and Remotion Studio previews the result.
+- **Not a hosted service.** Nothing runs on remocn servers. No account, no runtime, no usage limits. Rendering happens on your machine or wherever you run Remotion.
+- **Not a fork of Remotion.** Remotion is a prerequisite, and remocn is a set of components written against its public API. Remotion keeps [its own license](https://www.remotion.dev/docs/license); remocn's own code is MIT.
+- **Not only AI chat components.** The [AI section](/docs/ai) recreates chat composers and CLI screens because product demos need them often, but it is one category among text, transitions, backgrounds, layout, UI blocks and templates.
+
+</NotCards>
-```bash
-npx skills add Remocn/remocn --skill remocn --yes
-```
+<Aside icon="info">remocn is an independent project. It is not affiliated with shadcn or with Remotion; it builds on the shadcn CLI and the Remotion library.</Aside>
-In Claude Code or Codex, the [plugin](/docs/getting-started/plugin) goes further: it carries the skill
-plus a `/remocn:video` workflow that plans, builds and checks a whole video from a one-line brief.
+## Quick start
-The [Installation](/docs/getting-started/installation) page covers the full flow, including the one-shot command that installs every component and the Add to Studio button for a running Remotion Studio.
+<QuickStart>
+ <Step n={1} title="Start from a Remotion project" command="npx create-video@latest">You need one. If you do not have it yet, create it:</Step>
+ <Step n={2} title="Initialize shadcn and add a component" command={"npx shadcn@latest init\nnpx shadcn@latest add @remocn/soft-blur-in"}>Run init only if the project has no `components.json` yet.</Step>
+ <Step n={3} title="Install the agent skill" command="npx skills add Remocn/remocn --skill remocn --yes">Optional. Do it if you work through an AI agent.</Step>
+ <Step n={4} title="Go further with the plugin in Claude Code or Codex" command="/remocn:video">The [plugin](/docs/getting-started/plugin) carries the skill plus a workflow that plans, builds and checks a whole video from a one-line brief.</Step>
+</QuickStart>
+
+<InstallationLink>The Installation page covers the full flow, including the one-shot command that installs every component and the Add to Studio button for a running Remotion Studio.</InstallationLink>
## remocn vs raw Remotion
+<CompareTable>
+
| | Raw Remotion | Remotion + remocn |
|---|---|---|
| Starting point | Empty composition | Composition plus a catalog of ready components |
@@ -73,10 +101,14 @@ The [Installation](/docs/getting-started/installation) page covers the full flow
| AI agents | Generic Remotion knowledge | Skill with catalog access, timing rules and scene recipes |
| Dependency | Remotion | Remotion, same as before. remocn adds no runtime |
-Nothing here replaces Remotion. If you already have a component library of your own, remocn is a set of files to borrow from; if you are starting from a blank `create-video`, it is the fastest way to a first scene.
+</CompareTable>
+
+Nothing here replaces Remotion. If you already have a component library of your own, remocn is a set of files to borrow from; if you are starting from a blank project, it is the fastest way to a first scene.
## FAQ
+<Faq>
+
**Do I need to know how to code?**
Not necessarily, if you work through an AI coding agent. The [guides](/docs/guides) walk through building a video with prompts. Without an agent, you need to be comfortable with React and TypeScript.
@@ -92,9 +124,15 @@ The skill installs through [skills.sh](https://skills.sh) into agents that load
**Is this the official shadcn registry for Remotion?**
No. It is a community registry that uses the shadcn CLI and registry format. shadcn and Remotion are separate projects with their own maintainers.
+</Faq>
+
## What's next
+<NextLinks icons={["terminal", "sparkle", "grid", "play"]}>
+
- [Installation](/docs/getting-started/installation): add remocn to an existing Remotion project
- [Agent Skill](/docs/getting-started/agent-skill): teach your AI agent to compose videos with remocn
- [Components](/docs/components): every component, grouped by category
- [Homepage](/): see the kind of video remocn is built for
+
+</NextLinks>
diff --git a/content/docs/guides/changelog-video.mdx b/content/docs/guides/changelog-video.mdx
index cce478ae..d1f75e5c 100644
--- a/content/docs/guides/changelog-video.mdx
+++ b/content/docs/guides/changelog-video.mdx
@@ -3,31 +3,95 @@ title: Changelog video
description: A ~25-second release update for the weeks that ship several small things — same open, same pace, every release
---
+import { GuideNotes, GuideMoreLink } from "@/components/docs/guides/director-notes";
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideNote } from "@/components/docs/guides/note";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideRenderCard } from "@/components/docs/guides/render-card";
+import { GuideBeatList, GuideStoryboard } from "@/components/docs/guides/storyboard";
+import { GuideStoryboardPreview } from "@/components/docs/guides/storyboard-preview";
+import { GuideFacts } from "@/components/docs/guides/video-facts";
+import { GuideWords } from "@/components/docs/guides/words-form";
+
+<GuideStoryboardPreview
+ beats={[
+ { label: "The stamp", seconds: 4, frame: { name: "<PRODUCT NAME>", sub: "<VERSION OR DATE>" } },
+ { label: "Item one", seconds: 5, frame: { line: "<CHANGE 1> — <PAYOFF 1>" } },
+ { label: "Item two", seconds: 5, frame: { line: "<CHANGE 2> — <PAYOFF 2>" } },
+ { label: "Item three", seconds: 5, frame: { line: "<CHANGE 3> — <PAYOFF 3>" } },
+ { label: "The nudge", seconds: 3, frame: { line: "Full changelog at <CHANGELOG URL>" } },
+ { label: "The lockup", seconds: 3, frame: { logo: "<CLOSING LINE>" } },
+ ]}
+/>
+
+<GuideFacts
+ facts={[
+ { value: "~25 s", label: "running time" },
+ { value: "6 beats", label: "same frame every release" },
+ { value: "1920×1080", label: "30 fps, landscape" },
+ ]}
+/>
+
Not every release deserves a launch. Most weeks ship three or four small improvements — a fix, a speedup, a new option — and that's exactly what this video carries. About twenty-five seconds, no big reveal, posted on a rhythm: weekly, monthly, every release. It's the lightweight sibling of the [Feature announcement](/docs/guides/feature-announcement) — when one change deserves the spotlight, use that recipe; when the week shipped several small things, use this one.
-## The storyboard
+## The storyboard<GuideCount n={6} />
+
+<GuideStoryboard
+ beats={[
+ { label: "Stamp", seconds: 4, look: "reveal" },
+ { label: "Item one", seconds: 5, look: "lines" },
+ { label: "Item two", seconds: 5, look: "lines" },
+ { label: "Item three", seconds: 5, look: "lines" },
+ { label: "Nudge", seconds: 3, look: "line" },
+ { label: "Lockup", seconds: 3, look: "logo" },
+ ]}
+/>
+
+<GuideBeatList>
-1. **The stamp** — your product name and the date or version land together, like a postmark. This is the recurring open viewers learn to recognize.
-2. **Item one** — the change's name and one line on what it does.
-3. **Item two** — same shape, next change.
-4. **Item three** — same shape again. If a change is visual, show it instead of describing it.
-5. **The nudge** — one line pointing to the full changelog.
-6. **The lockup** — your logo, one short closing line.
+1. **The stamp** — Your product name and the date or version land together, like a postmark. This is the recurring open viewers learn to recognize.
+2. **Item one** — The change's name and one line on what it does.
+3. **Item two** — Same shape, next change.
+4. **Item three** — Same shape again. If a change is visual, show it instead of describing it.
+5. **The nudge** — One line pointing to the full changelog.
+6. **The lockup** — Your logo, one short closing line.
+
+</GuideBeatList>
The value of this video isn't any single edition — it's the rhythm. Same open, same pace, every release. By the third one, viewers recognize your update in the feed before they read a word. So resist redesigning it each time; change the items, keep the frame.
-## Your words
+## Your words<GuideCount n={5} />
+
+<GuideWords
+ examples={[
+ { blank: ["<PRODUCT NAME>"] },
+ { blank: ["<VERSION OR DATE>"] },
+ { blank: ["<CHANGE 1> — <PAYOFF 1>", "<CHANGE 2> — <PAYOFF 2>", "<CHANGE 3> — <PAYOFF 3>"] },
+ { blank: ["<CHANGELOG URL>"] },
+ { blank: ["<CLOSING LINE>"] },
+ ]}
+>
- **Product name**
-- **Version or date** — whatever you stamp releases with
-- **Three or four changes** — each a name plus a one-line payoff, six words or fewer
+- **Version or date** — Whatever you stamp releases with
+- **Three or four changes** — Each a name plus a one-line payoff, six words or fewer
- **Changelog URL**
- **Closing line** — e.g. "Shipping weekly"
+</GuideWords>
+
+<GuideNote icon="image">
+
Struggling with the payoff lines? [Words on screen](/docs/guides/words-on-screen) is the cheat sheet.
+</GuideNote>
+
## The prompt
+Paste it into your agent with your words in place of the highlighted blanks.
+
+<GuidePrompt>
+
```text
I'm making a changelog video with remocn (remocn.dev).
@@ -55,17 +119,31 @@ whole video. Keep motion restrained and identical across the item beats —
this is a stamp, not a show. Use my copy exactly as written.
```
+</GuidePrompt>
+
## Directing the result
+<GuideNotes>
+
- "Item two runs long — tighten it."
- "Hold the stamp a beat longer."
- "Change three is visual — show the screen instead of the words."
- "The items feel different from each other — make the motion identical."
+</GuideNotes>
+
+<GuideMoreLink>
+
More directing vocabulary: [Directing your agent](/docs/guides/directing-your-agent).
+</GuideMoreLink>
+
Next release, don't start over — ask your agent to reuse this video and swap the version and the items.
## Get the file
-Ask your agent: **"Render the video."** You'll get an `.mp4` in the project folder, ready to post.
+<GuideRenderCard prompt="Render the video.">
+
+You'll get an `.mp4` in the project folder, ready to post.
+
+</GuideRenderCard>
diff --git a/content/docs/guides/directing-your-agent.mdx b/content/docs/guides/directing-your-agent.mdx
index d4ae453a..5e28ef7e 100644
--- a/content/docs/guides/directing-your-agent.mdx
+++ b/content/docs/guides/directing-your-agent.mdx
@@ -3,13 +3,32 @@ title: Directing your agent
description: The first cut is a draft — how to get from there to the video you meant
---
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { DirectingFinish } from "@/components/docs/guides/practice/directing-finish";
+import { DirectingLoop } from "@/components/docs/guides/practice/directing-loop";
+import { DirectingOptions } from "@/components/docs/guides/practice/directing-options";
+import { DirectingPhrases } from "@/components/docs/guides/practice/directing-phrases";
+import { DirectingRedirect } from "@/components/docs/guides/practice/directing-redirect";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+
Your agent's first cut will be roughly right and specifically wrong. That's not failure — that's where directing starts. You watch, you say what's off in plain sentences, you watch again. Two or three rounds is normal.
## The loop
-1. Watch the whole video once, start to finish, without commenting.
-2. Go beat by beat and say what's wrong, referring to beats by number.
-3. Put several notes in one message — one sentence per note.
+<DirectingLoop>
+
+1. **Watch** — Watch the whole video once, start to finish, without commenting.
+2. **Note beat by beat** — Go beat by beat and say what's wrong, referring to beats by number.
+3. **One message** — Put several notes in one message — one sentence per note.
+
+**Watch again** — two or three rounds is normal
+
+</DirectingLoop>
+
+<GuidePrompt
+ copyLabel="Copy"
+ marks={["In beat 1", "In beat 3", "beat 5"]}
+>
```text
In beat 1, hold each line longer — I can't finish reading.
@@ -17,33 +36,61 @@ In beat 3, the background is too loud, calm it down.
Cut beat 5 entirely.
```
-## Pacing words
+</GuidePrompt>
+
+## Pacing words<GuideCount n={4} />
+
+<DirectingPhrases>
- **"Hold it longer"** / "it goes by too fast"
-- **"Tighter"** — cut the dead air between beats
-- **"Let it breathe"** — add a pause after a big moment
+- **"Tighter"** — Cut the dead air between beats
+- **"Let it breathe"** — Add a pause after a big moment
- **"Make the whole thing two seconds shorter"**
-## Motion words
+</DirectingPhrases>
+
+## Motion words<GuideCount n={5} />
+
+<DirectingPhrases>
+
+- **"Snappier"** — Faster, more decisive movement
+- **"Softer"** / "calmer" — Less travel, less drama
+- **"Come in from the left"** — Or right, or below
+- **"Less bouncy"** — When things wobble too much
+- **"The background is too loud"** — Dim it or slow it down
-- **"Snappier"** — faster, more decisive movement
-- **"Softer"** / "calmer" — less travel, less drama
-- **"Come in from the left"** (or right, or below)
-- **"Less bouncy"** — when things wobble too much
-- **"The background is too loud"** — dim it or slow it down
+</DirectingPhrases>
## Asking for options
-When you can't name what's wrong, don't try — ask for variants instead: *"Show me two different openings for beat 1."* Watch both, pick one, move on.
+When you can't name what's wrong, don't try — ask for variants instead.
+
+<DirectingOptions>
+
+"Show me two different openings for beat 1."
+
+</DirectingOptions>
+
+Watch both, pick one, move on.
## Redirect or restart
The one judgment call that saves the most time:
-- **The details are wrong** — pacing, a color, one beat's motion → direct, with the words above.
-- **The structure is wrong** — wrong story, wrong order, wrong number of beats → don't patch it. Rewrite your beat list and prompt again from scratch. Rebuilding structure through comments is always slower than restating it.
+<DirectingRedirect>
+
+- **The details are wrong** — Pacing, a color, one beat's motion. → **Direct**, with the words above.
+- **The structure is wrong** — Wrong story, wrong order, wrong number of beats. → **Restart**, don't patch it. Rewrite your beat list and prompt again from scratch.
+
+Rebuilding structure through comments is always slower than restating it.
+
+</DirectingRedirect>
## Finishing
-- **"Render the video."** — you get an `.mp4` in the project folder.
-- Need another shape? Ask: *"Render a vertical version too."*
+<DirectingFinish>
+
+- **"Render the video."** — You get an `.mp4` in the project folder.
+- **"Render a vertical version too."** — Need another shape? Ask.
+
+</DirectingFinish>
diff --git a/content/docs/guides/exporting-your-video.mdx b/content/docs/guides/exporting-your-video.mdx
index 153253ba..99302b12 100644
--- a/content/docs/guides/exporting-your-video.mdx
+++ b/content/docs/guides/exporting-your-video.mdx
@@ -3,19 +3,29 @@ title: Exporting your video
description: The preview in your browser is not a file yet — one prompt turns it into an mp4 you can post
---
+import { GuideCtaCard } from "@/components/docs/guides/practice/cta-card";
+import { GuideExportPipeline } from "@/components/docs/guides/practice/export-pipeline";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+
The preview studio plays your video, but it isn't a file. Nothing to upload, nothing to send. Rendering fixes that: it turns the preview into a real mp4, and it's one prompt.
## The one move
When the video looks right in the player, paste:
+<GuidePrompt copyLabel="Copy" size="lg">
+
```text
Render the video to an mp4 in the project folder, and tell me the full path
to the file when it's done.
```
+</GuidePrompt>
+
That's it. Your agent runs the render and tells you where the file landed.
+<GuideExportPipeline />
+
## What to expect
Rendering builds the file frame by frame — every frame of your video gets drawn and encoded. A thirty-second video takes a few minutes, longer than the video itself. That's normal, not a sign something is stuck. Let it finish; your agent will report back with the path.
@@ -24,7 +34,15 @@ Rendering builds the file frame by frame — every frame of your video gets draw
The mp4 is ready to upload as-is. X, YouTube and LinkedIn all take the horizontal file directly — no conversion, no export settings, no editor in between.
-Posting to Shorts, Reels or TikTok too? Those want a vertical cut of the same video: [One video, three formats](/docs/guides/one-video-three-formats).
+<GuideCtaCard>
+
+Posting to Shorts, Reels or TikTok too?
+
+Those want a vertical cut of the same video.
+
+[One video, three formats](/docs/guides/one-video-three-formats)
+
+</GuideCtaCard>
## Changed something after rendering?
diff --git a/content/docs/guides/feature-announcement.mdx b/content/docs/guides/feature-announcement.mdx
index 7a2f94d7..21a33807 100644
--- a/content/docs/guides/feature-announcement.mdx
+++ b/content/docs/guides/feature-announcement.mdx
@@ -3,43 +3,104 @@ title: Feature announcement
description: A ~40-second release video that shows the feature working — the one we shipped remocn/ui with
---
+import { GuideNotes, GuideMoreLink } from "@/components/docs/guides/director-notes";
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideNote } from "@/components/docs/guides/note";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideRenderCard } from "@/components/docs/guides/render-card";
+import { GuideBeatList, GuideStoryboard } from "@/components/docs/guides/storyboard";
+import { GuideFacts } from "@/components/docs/guides/video-facts";
+import { GuideWords } from "@/components/docs/guides/words-form";
+
<GuideVideo
src="https://cdn.remocn.dev/videos/remocn-ui.mp4"
poster="https://cdn.remocn.dev/posters/remocn-ui.png"
+ label="The remocn/ui feature announcement"
+ duration={40}
+/>
+
+<GuideFacts
+ facts={[
+ { value: "~40 s", label: "running time" },
+ { value: "8 beats", label: "the demo gets the most time" },
+ { value: "1920×1080", label: "30 fps, landscape" },
+ ]}
/>
This is the video we announced remocn/ui with. A launch video sells the whole product; a feature announcement sells one release — and it earns its runtime by showing the feature work, not by talking about it. Eight beats, about forty seconds, and the demo beat gets the most screen time.
-## The storyboard
+## The storyboard<GuideCount n={8} />
+
+<GuideStoryboard
+ beats={[
+ { label: "Moments", seconds: 6, look: "words" },
+ { label: "Reveal", seconds: 4, look: "swirl" },
+ { label: "Mechanism", seconds: 4, look: "slide" },
+ { label: "Demo", seconds: 10, look: "screen" },
+ { label: "Breadth", seconds: 5, look: "montage" },
+ { label: "Value", seconds: 4, look: "stack" },
+ { label: "Install", seconds: 4, look: "terminal" },
+ { label: "Outro", seconds: 3, look: "logo" },
+ ]}
+/>
+
+<GuideBeatList>
-1. **The moments** — three quick situations your users know, swapping in one spot, then the problem lands in one line.
+1. **The moments** — Three quick situations your users know, swapping in one spot, then the problem lands in one line.
2. **The reveal** — "Meet &lt;Feature&gt;", with your one-line promise.
-3. **The mechanism** — the single idea behind the feature, one calm beat.
-4. **The demo** — the feature acting on camera: a fake app screen doing the real thing. The longest part of the video.
-5. **The breadth** — a fast montage of what else ships in this release.
-6. **The value** — three claims stack up.
-7. **The install** — a terminal types your command or call to action.
-8. **The outro** — your logo, one quiet closing line.
+3. **The mechanism** — The single idea behind the feature, one calm beat.
+4. **The demo** — The feature acting on camera: a fake app screen doing the real thing. The longest part of the video.
+5. **The breadth** — A fast montage of what else ships in this release.
+6. **The value** — Three claims stack up.
+7. **The install** — A terminal types your command or call to action.
+8. **The outro** — Your logo, one quiet closing line.
-## Your words
+</GuideBeatList>
+
+## Your words<GuideCount n={10} />
Ten blanks:
+<GuideWords
+ examples={[
+ { blank: ["<FEATURE NAME>"] },
+ { blank: ["<MOMENT 1>", "<MOMENT 2>", "<MOMENT 3>"] },
+ { blank: ["<PROBLEM LINE>"] },
+ { blank: ["<PROMISE LINE>"] },
+ { blank: ["<MECHANISM LINE>"] },
+ { blank: ["<DEMO ACTIONS>"] },
+ { blank: ["<OTHER ITEMS>"] },
+ { blank: ["<THREE CLAIMS>"] },
+ { blank: ["<COMMAND OR CTA>"] },
+ { blank: ["<CLOSING LINE>"] },
+ ]}
+>
+
- **Feature name**
-- **Three moments** — situations where users need it, two to four words each
-- **Problem line** — the claim that lands after the moments
-- **Promise line** — what changes now, one sentence
-- **Mechanism line** — how it works, one plain sentence
-- **Demo actions** — two or three things we should watch happen ("a dialog opens, a menu filters, a form fills itself")
-- **What else ships** — three to six short names; skip this beat if the release is one thing
+- **Three moments** — Situations where users need it, two to four words each
+- **Problem line** — The claim that lands after the moments
+- **Promise line** — What changes now, one sentence
+- **Mechanism line** — How it works, one plain sentence
+- **Demo actions** — Two or three things we should watch happen ("a dialog opens, a menu filters, a form fills itself")
+- **What else ships** — Three to six short names; skip this beat if the release is one thing
- **Three value claims**
- **Install command or CTA**
- **Closing line**
+</GuideWords>
+
+<GuideNote icon="image">
+
Struggling with the lines? [Words on screen](/docs/guides/words-on-screen) is the cheat sheet.
+</GuideNote>
+
## The prompt
+Paste it into your agent with your words in place of the highlighted blanks.
+
+<GuidePrompt>
+
```text
I'm making a feature announcement video with remocn (remocn.dev).
@@ -67,15 +128,29 @@ entire video with a radial scrim. Keep transitions restrained — crossfades,
plus one signature transition at the reveal. Use my copy exactly as written.
```
+</GuidePrompt>
+
## Directing the result
+<GuideNotes>
+
- "The demo is too fast — I can't follow what the screen does."
- "Give the reveal more room to breathe."
- "Cut the breadth montage — this release is one thing."
- "The hook moments should swap faster."
+</GuideNotes>
+
+<GuideMoreLink>
+
More directing vocabulary: [Directing your agent](/docs/guides/directing-your-agent).
+</GuideMoreLink>
+
## Get the file
-Ask your agent: **"Render the video."** You'll get an `.mp4` in the project folder, ready to post.
+<GuideRenderCard prompt="Render the video.">
+
+You'll get an `.mp4` in the project folder, ready to post.
+
+</GuideRenderCard>
diff --git a/content/docs/guides/how-a-video-is-built.mdx b/content/docs/guides/how-a-video-is-built.mdx
index 2e674c0a..df4191f3 100644
--- a/content/docs/guides/how-a-video-is-built.mdx
+++ b/content/docs/guides/how-a-video-is-built.mdx
@@ -3,40 +3,66 @@ title: How a video is built
description: Think in beats — the one mental model behind every video you'll make
---
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { BuiltRules } from "@/components/docs/guides/practice/built-rules";
+import { BuiltSkeleton } from "@/components/docs/guides/practice/built-skeleton";
+import { BuiltVocabulary } from "@/components/docs/guides/practice/built-vocabulary";
+import { ClapperIcon } from "@/components/docs/guides/practice/clapper-icon";
+import { GuideCtaCard } from "@/components/docs/guides/practice/cta-card";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+
Every video in these guides — and every video you'll invent yourself — is built the same way: as a list of beats.
## Beats
-A beat is one idea on screen. A line of text landing. A feature name over a background. A logo drawing itself on. When the idea changes, the beat changes.
+A beat is one idea on screen. A line of text landing. A feature name over a background. A logo drawing itself on. When the idea changes, the beat changes. Three rules cover most of it:
+
+<BuiltRules art={["one-idea", "two-seconds", "beat-count"]}>
-Three rules cover most of it:
+- **One idea per beat** — If describing a beat needs the word "and", it's two beats.
+- **~2 seconds** — A text beat lives about two seconds — long enough to read once, not twice.
+- **5 to 10 beats** — A video is five to ten beats. The [launch video](/docs/guides/launch-video) is eight.
-- **One idea per beat.** If describing a beat needs the word "and", it's two beats.
-- **A text beat lives about two seconds** — long enough to read once, not twice.
-- **A video is five to ten beats.** The [launch video](/docs/guides/launch-video) is eight.
+</BuiltRules>
## The skeleton
Every video that works has the same three acts:
-1. **Hook** — why anyone should care: a pain, a bold claim, a question.
-2. **Body** — what it is: features, value, proof.
-3. **Close** — what to do next: a command, a URL, a date.
+<BuiltSkeleton
+ acts={[
+ { range: "1–2 beats", beats: 2 },
+ { range: "3–5 beats", beats: 5 },
+ { range: "1 beat", beats: 1 },
+ ]}
+>
+
+1. **Hook** — Why anyone should care: a pain, a bold claim, a question.
+2. **Body** — What it is: features, value, proof.
+3. **Close** — What to do next: a command, a URL, a date.
-Not sure what beats to write? One or two hook beats, three to five body beats, one close beat. That's a video.
+**Not sure what beats to write?** One or two hook beats, three to five body beats, one close beat. That's a video.
-## The vocabulary
+</BuiltSkeleton>
+
+## The vocabulary<GuideCount n={8} />
When you describe a beat to your agent, plain words work — and some plain words map especially well to what remocn can build:
-- **"an animated headline"** — a line of text that enters with motion
-- **"lines that stack up"** — claims appearing one after another
-- **"a living background"** — slow, animated color behind everything
-- **"a hard cut" / "a scene change"** — how one beat hands over to the next
-- **"a terminal that types"** — a command line typing itself out
-- **"a fake app screen"** — an interface with buttons, menus, and dialogs that act
+<BuiltVocabulary
+ art={["headline", "stack", "background", "cut", "terminal", "app", "logo", "counter"]}
+>
+
+- **"an animated headline"** — A line of text that enters with motion
+- **"lines that stack up"** — Claims appearing one after another
+- **"a living background"** — Slow, animated color behind everything
+- **"a hard cut" / "a scene change"** — How one beat hands over to the next
+- **"a terminal that types"** — A command line typing itself out
+- **"a fake app screen"** — An interface with buttons, menus, and dialogs that act
- **"a logo that draws itself on"**
-- **"a counter"** — a number counting up to a milestone
+- **"a counter"** — A number counting up to a milestone
+
+</BuiltVocabulary>
You never need to know what any of these are called internally. Your agent does.
@@ -44,6 +70,11 @@ You never need to know what any of these are called internally. Your agent does.
Write your video as a numbered list of beats — one line each, your copy in quotes. That list is 80% of a prompt; add a format line and a style line and it's done:
+<GuidePrompt
+ copyLabel="Copy"
+ marks={["an animated headline", "three lines that stack up", "a terminal that types"]}
+>
+
```text
Build a ~15-second, 1920×1080, 30fps video in this Remotion project,
using remocn components:
@@ -55,4 +86,14 @@ using remocn components:
Style: dark background, one accent color <HEX>, calm pacing.
```
-When the first cut plays, switch hats: you're the director now — see [Directing your agent](/docs/guides/directing-your-agent).
+</GuidePrompt>
+
+<GuideCtaCard icon={<ClapperIcon />}>
+
+When the first cut plays, switch hats
+
+You're the director now.
+
+[Directing your agent](/docs/guides/directing-your-agent)
+
+</GuideCtaCard>
diff --git a/content/docs/guides/index.mdx b/content/docs/guides/index.mdx
index 2b6253db..055aa015 100644
--- a/content/docs/guides/index.mdx
+++ b/content/docs/guides/index.mdx
@@ -3,27 +3,24 @@ title: Guides
description: Finished videos you can make yours — pick one, fill in your words, paste a prompt
---
+import { GuidePractices } from "@/components/docs/index/guides/guide-practices";
+import { GuideVideos } from "@/components/docs/index/guides/guide-videos";
+import { SetupCard } from "@/components/docs/index/guides/setup-card";
+
Each guide starts from a finished video and ends with your version of it. You don't write code and you don't learn a video editor. Your AI agent builds the video — you direct it: pick a guide, fill in your product's words, paste the prompt.
-First time here? Do the one-time [Setup](/docs/guides/setup) — about ten minutes, all copy-paste.
+<SetupCard title="First time here?">Do the one-time setup — about ten minutes, all copy-paste.</SetupCard>
+
+<GuideVideos>
## The videos
-- [Launch video](/docs/guides/launch-video) — the ~35-second video we launched remocn with, rebuilt around your product.
-- [Feature announcement](/docs/guides/feature-announcement) — a ~40-second release video that shows your feature working on camera.
-- [Showcase reel](/docs/guides/showcase-reel) — a fast reel where every item in a collection gets its own beat.
-- [Teaser](/docs/guides/teaser) — the ~15-second pre-launch video: something is coming, here is its name, here is the date.
-- [Product demo](/docs/guides/product-demo) — a ~50-second video where your product is on camera doing its job, one flow start to finish.
-- [Changelog video](/docs/guides/changelog-video) — a ~25-second release update on a rhythm viewers learn to recognize.
+</GuideVideos>
+
+<GuidePractices>
## The practices
-Recipes tell you what to make. Practices make you better at every one of them:
+Recipes tell you what to make. Practices make you better at every one of them.
-- [How a video is built](/docs/guides/how-a-video-is-built) — think in beats, and write your own videos beyond the recipes
-- [Directing your agent](/docs/guides/directing-your-agent) — from the first cut to the video you meant
-- [Words on screen](/docs/guides/words-on-screen) — lines people can read in two seconds
-- [Your brand](/docs/guides/your-brand) — hand your brand over once, stay on-brand forever
-- [Music and sound](/docs/guides/music-and-sound) — a music bed is the cheapest upgrade that makes a video feel finished
-- [One video, three formats](/docs/guides/one-video-three-formats) — finish the horizontal video, then re-cut it to vertical and square
-- [Exporting your video](/docs/guides/exporting-your-video) — one prompt turns the browser preview into an mp4 you can post
+</GuidePractices>
diff --git a/content/docs/guides/launch-video.mdx b/content/docs/guides/launch-video.mdx
index 02d37aa5..9b4126f2 100644
--- a/content/docs/guides/launch-video.mdx
+++ b/content/docs/guides/launch-video.mdx
@@ -3,44 +3,104 @@ title: Launch video
description: The ~35-second launch video we made for remocn itself — with your product in it
---
+import { GuideNotes, GuideMoreLink } from "@/components/docs/guides/director-notes";
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideNote } from "@/components/docs/guides/note";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideRenderCard } from "@/components/docs/guides/render-card";
+import { GuideBeatList, GuideStoryboard } from "@/components/docs/guides/storyboard";
+import { GuideFacts } from "@/components/docs/guides/video-facts";
+import { GuideWords } from "@/components/docs/guides/words-form";
+
<GuideVideo
src="https://cdn.remocn.dev/videos/intoducing-remocn.mp4"
poster="https://cdn.remocn.dev/posters/intoducing-remocn.png"
+ label="The remocn launch video"
+ duration={35}
+/>
+
+<GuideFacts
+ facts={[
+ { value: "~35 s", label: "running time" },
+ { value: "8 beats", label: "built from remocn components" },
+ { value: "1920×1080", label: "30 fps, landscape" },
+ ]}
/>
This is the video we launched remocn with. Eight beats, thirty-five seconds, built entirely from remocn components. Below is everything you need to make the same video for your product.
-## The storyboard
+## The storyboard<GuideCount n={8} />
+
+<GuideStoryboard
+ beats={[
+ { label: "Pain", seconds: 4, look: "lines" },
+ { label: "Reveal", seconds: 3, look: "swirl" },
+ { label: "Tagline", seconds: 3, look: "slide" },
+ { label: "Positioning", seconds: 4, look: "words" },
+ { label: "Montage", seconds: 6, look: "montage" },
+ { label: "Value", seconds: 5, look: "stack" },
+ { label: "Install", seconds: 5, look: "terminal" },
+ { label: "Outro", seconds: 4, look: "logo" },
+ ]}
+/>
+
+<GuideBeatList>
-1. **The pain** — two short lines land one after the other, naming the problem you solve.
+1. **The pain** — Two short lines land one after the other, naming the problem you solve.
2. **The reveal** — "Meet &lt;Product&gt;", uncovered by a swirl of color.
-3. **The tagline** — your one-liner slides in.
+3. **The tagline** — Your one-liner slides in.
4. **The positioning** — "Like X, for Y" assembles itself word by word.
-5. **The montage** — six fast cuts: a feature name over a different animated background each time.
-6. **The value** — three claims stack up, line by line.
-7. **The install** — a terminal types out your install command or call to action.
-8. **The outro** — your logo draws itself on, with one quiet closing line.
+5. **The montage** — Six fast cuts: a feature name over a different animated background each time.
+6. **The value** — Three claims stack up, line by line.
+7. **The install** — A terminal types out your install command or call to action.
+8. **The outro** — Your logo draws itself on, with one quiet closing line.
-## Your words
+</GuideBeatList>
+
+## Your words<GuideCount n={9} />
This is the whole creative work — nine blanks:
+<GuideWords
+ examples={[
+ ["remocn"],
+ { stack: ["Every launch needs a video", "Yours shouldn't take a week"] },
+ ["Cinematic video components for React"],
+ ["Like shadcn/ui, for video"],
+ ["Typography", "Transitions", "Shaders", "UI primitives", "Captions", "Logo stings"],
+ ["110+ components", "One command to install", "The code is yours"],
+ { code: "npx shadcn add @remocn/shader-swirl" },
+ ["Open source, all the way down"],
+ { color: "#D4F25C", note: "Leave empty for the default lime" },
+ ]}
+>
+
- **Product name**
-- **Two pain lines** — six words or fewer each; they're on screen for about two seconds
-- **Tagline** — one line
-- **Positioning** — the "Like X, for Y" sentence
-- **Six feature labels** — one or two words each
-- **Three value claims** — short, concrete, no adjectives you can't prove
-- **Install command or CTA** — whatever you want typed on screen
-- **Closing line** — e.g. "Open source, all the way down"
-- **Accent color** — one hex value; optional, the default lime looks good
+- **Two pain lines** — Six words or fewer each; they're on screen for about two seconds
+- **Tagline** — One line
+- **Positioning** — The "Like X, for Y" sentence
+- **Six feature labels** — One or two words each
+- **Three value claims** — Short, concrete, no adjectives you can't prove
+- **Install command or CTA** — Whatever you want typed on screen
+- **Closing line**
+- **Accent color** _optional_ — One hex value; the default lime looks good
+
+</GuideWords>
+
+<GuideNote icon="image">
Have a logo? Drop the SVG into the project folder and mention the file name in the prompt. No logo — your agent will use the product name as a wordmark.
Struggling with the lines? [Words on screen](/docs/guides/words-on-screen) is the cheat sheet.
+</GuideNote>
+
## The prompt
+Paste it into your agent with your words in place of the highlighted blanks.
+
+<GuidePrompt>
+
```text
I'm making a product launch video with remocn (remocn.dev).
@@ -71,18 +131,32 @@ covers (swirl, dithering), not plain crossfades. Use my copy exactly as
written.
```
+</GuidePrompt>
+
## Directing the result
The first cut won't be the final one — that's normal. Direct with plain sentences:
+<GuideNotes>
+
- "The pain lines go by too fast — hold each one longer."
- "Cut the montage to four beats."
- "Use my brand background #0B0B0F instead."
- "The tagline should come in from the left."
- "Make the outro two seconds shorter."
+</GuideNotes>
+
+<GuideMoreLink>
+
More directing vocabulary: [Directing your agent](/docs/guides/directing-your-agent).
+</GuideMoreLink>
+
## Get the file
-Ask your agent: **"Render the video."** You'll get an `.mp4` in the project folder, ready to post.
+<GuideRenderCard prompt="Render the video.">
+
+You'll get an `.mp4` in the project folder, ready to post.
+
+</GuideRenderCard>
diff --git a/content/docs/guides/music-and-sound.mdx b/content/docs/guides/music-and-sound.mdx
index 92ecf463..1f046ec9 100644
--- a/content/docs/guides/music-and-sound.mdx
+++ b/content/docs/guides/music-and-sound.mdx
@@ -3,41 +3,69 @@ title: Music and sound
description: The recipes produce silent videos — a music bed is the cheapest upgrade that makes one feel finished
---
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideDefinitions } from "@/components/docs/guides/practice/definition-table";
+import { GuideMusicTimeline } from "@/components/docs/guides/practice/music-timeline";
+import { GuideNoteCard } from "@/components/docs/guides/practice/note-card";
+import { GuidePhrases, GuidePullLine } from "@/components/docs/guides/practice/phrase-list";
+import { GuideTrackSources } from "@/components/docs/guides/practice/track-sources";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+
Every recipe on this site produces a silent video. That's on purpose — the cut has to work on its own first. But once it does, a music bed is the single cheapest upgrade left: same video, one track underneath, and it suddenly feels finished.
-## Where to get a track
+<GuideMusicTimeline />
+
+## Where to get a track<GuideCount n={3} />
Use a royalty-free library, not a song you like:
+<GuideTrackSources>
+
- [Pixabay Music](https://pixabay.com/music/) — free, no attribution required
- [Uppbeat](https://uppbeat.io) — free tier with attribution, curated for creators
- [YouTube Audio Library](https://studio.youtube.com) — free, inside YouTube Studio
-One rule, no exceptions: before you publish, check that the track's license allows commercial use. A product video is commercial use even if the product is free.
+</GuideTrackSources>
+
+<GuideNoteCard tone="accent" icon="shield" title="One rule, no exceptions">
+
+Before you publish, check that the track's license allows commercial use. A product video is commercial use even if the product is free.
+
+</GuideNoteCard>
## What kind of track works
-- **Instrumental.** Vocals fight your words on screen — and your words win the video, so the vocals just lose.
-- **Steady energy.** A track that builds and drops fights your cut. Pick one that holds a level.
-- **Match the mood to the video.** A launch wants drive. A changelog wants calm. A showcase reel wants pulse. If you can imagine the video over the track, it fits.
+<GuideDefinitions>
+
+- **Instrumental** — Vocals fight your words on screen — and your words win the video, so the vocals just lose.
+- **Steady energy** — A track that builds and drops fights your cut. Pick one that holds a level.
+- **Match the mood to the video** — A launch wants drive. A changelog wants calm. A showcase reel wants pulse. If you can imagine the video over the track, it fits.
-Thirty seconds of the right track beats three minutes of a great one.
+</GuideDefinitions>
+
+<GuidePullLine>Thirty seconds of the right track beats three minutes of a great one.</GuidePullLine>
## Handing it to your agent
Drop the audio file into the project folder, then paste:
+<GuidePrompt copyLabel="Copy">
+
```text
There's an audio file in the project folder: <FILE NAME>. Add it as background
music under the whole video. Keep it quiet enough that it never competes with
the screen, and fade it out over the outro so the video ends clean.
```
+</GuidePrompt>
+
That's the whole job. Your agent handles the volume, the timing and the fade.
-## Directing the sound
+## Directing the sound<GuideCount n={5} />
+
+Sound takes the same plain sentences as the cut — see [Directing your agent](/docs/guides/directing-your-agent)
-Sound takes the same plain sentences as the cut — see [Directing your agent](/docs/guides/directing-your-agent):
+<GuidePhrases>
- "Start the music on beat 2, not from the first frame."
- "Duck the music under the demo, bring it back after."
@@ -45,8 +73,14 @@ Sound takes the same plain sentences as the cut — see [Directing your agent](/
- "End the fade exactly with the logo."
- "Try a harder cut — stop the music dead on the last beat instead of fading."
+</GuidePhrases>
+
Watch with sound on, say what's off, watch again. Two rounds is normal.
## When to skip sound
-Most feeds autoplay muted. The version of your video most people see is the silent one — which is why every recipe builds the silent version first. Sound is polish on top, not a crutch: if a beat only works with music under it, fix the beat. Then add the track for everyone who taps unmute.
+<GuideNoteCard icon="mute" title="Most feeds autoplay muted">
+
+The version of your video most people see is the silent one — which is why every recipe builds the silent version first. Sound is polish on top, not a crutch: if a beat only works with music under it, fix the beat. Then add the track for everyone who taps unmute.
+
+</GuideNoteCard>
diff --git a/content/docs/guides/one-video-three-formats.mdx b/content/docs/guides/one-video-three-formats.mdx
index dd6c0300..92b6758b 100644
--- a/content/docs/guides/one-video-three-formats.mdx
+++ b/content/docs/guides/one-video-three-formats.mdx
@@ -3,8 +3,16 @@ title: One video, three formats
description: Every recipe builds a horizontal video — Reels, Shorts and TikTok want vertical, and you re-cut instead of rebuilding
---
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideDefinitions } from "@/components/docs/guides/practice/definition-table";
+import { GuideFormatFrames } from "@/components/docs/guides/practice/format-frames";
+import { GuideQuote } from "@/components/docs/guides/practice/phrase-list";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+
Every recipe on this site builds a horizontal video — 16:9, the shape of YouTube, X and your landing page. But Reels, Shorts and TikTok want vertical (9:16), and some feeds like square (1:1). You don't make three videos. You make one, then re-cut it.
+<GuideFormatFrames />
+
## Finish horizontal first
Direct the horizontal version all the way to done — the words, the pacing, the brand, everything. Formats are the last step, not a fork. If you branch early, every note you give afterwards has to be given three times.
@@ -13,23 +21,35 @@ Direct the horizontal version all the way to done — the words, the pacing, the
When the horizontal version is the one you'd publish, the whole ask is one sentence:
+<GuidePrompt copyLabel="Copy" size="lg">
+
```text
Make a vertical 9:16 version of this video, keeping every beat.
```
+</GuidePrompt>
+
Your agent reflows the same video into the new shape. Same words, same order, same timing — a taller stage.
-## What breaks in vertical
+## What breaks in vertical<GuideCount n={3} />
A vertical frame is narrow, and a few things won't survive the move. Watch for them and direct in plain sentences:
-- **Long lines wrap or shrink.** A line that sat comfortably across a wide frame now breaks in half or gets small. Don't ask for a smaller font — shorten the line. [Words on screen](/docs/guides/words-on-screen) has the rules; vertical just enforces them harder.
-- **Side-by-side layouts stack.** Anything that sat left-and-right should now sit top-and-bottom. Say it directly: "Stack the two panels vertically."
-- **Keep the important content in the middle.** Platform UI — captions, buttons, your own handle — covers the top and bottom edges of a vertical video. Tell your agent: "Keep text and logos in the middle of the frame, away from the top and bottom edges."
+<GuideDefinitions>
+
+- **Long lines wrap or shrink** — A line that sat comfortably across a wide frame now breaks in half or gets small. Don't ask for a smaller font — shorten the line. [Words on screen](/docs/guides/words-on-screen) has the rules; vertical just enforces them harder.
+- **Side-by-side layouts stack** — Anything that sat left-and-right should now sit top-and-bottom. Say it directly: "Stack the two panels vertically."
+- **Keep the important content in the middle** — Platform UI — captions, buttons, your own handle — covers the top and bottom edges of a vertical video. Tell your agent: "Keep text and logos in the middle of the frame, away from the top and bottom edges."
+
+</GuideDefinitions>
## Square
-Same move, one line: "Make a square 1:1 version, keeping every beat." Square sits between the two shapes and mostly just works.
+Same move, one line:
+
+<GuideQuote>"Make a square 1:1 version, keeping every beat."</GuideQuote>
+
+Square sits between the two shapes and mostly just works.
## Watch each one through
diff --git a/content/docs/guides/product-demo.mdx b/content/docs/guides/product-demo.mdx
index df2e881f..b9bbece2 100644
--- a/content/docs/guides/product-demo.mdx
+++ b/content/docs/guides/product-demo.mdx
@@ -3,38 +3,110 @@ title: Product demo
description: A ~50-second video where your product is on camera doing its job — one flow, start to finish
---
+import { GuideNotes, GuideMoreLink } from "@/components/docs/guides/director-notes";
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideNote } from "@/components/docs/guides/note";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideRenderCard } from "@/components/docs/guides/render-card";
+import { GuideBeatList, GuideStoryboard } from "@/components/docs/guides/storyboard";
+import { GuideStoryboardPreview } from "@/components/docs/guides/storyboard-preview";
+import { GuideFacts } from "@/components/docs/guides/video-facts";
+import { GuideWords } from "@/components/docs/guides/words-form";
+
+<GuideStoryboardPreview
+ beats={[
+ { label: "The setup", seconds: 4, frame: { line: "<SETUP LINE>" } },
+ { label: "The screen", seconds: 5, frame: { screen: "<PRODUCT NAME>" } },
+ { label: "Step one", seconds: 10, frame: { screen: "<FLOW STEP 1>" } },
+ { label: "Step two", seconds: 10, frame: { screen: "<FLOW STEP 2>" } },
+ { label: "Step three", seconds: 10, frame: { screen: "<FLOW STEP 3>" } },
+ { label: "The payoff", seconds: 6, frame: { line: "<PAYOFF LINE>" } },
+ { label: "The close", seconds: 5, frame: { logo: "<INSTALL COMMAND OR URL>" } },
+ ]}
+/>
+
+<GuideFacts
+ facts={[
+ { value: "~50 s", label: "running time" },
+ { value: "7 beats", label: "one flow, three steps" },
+ { value: "1920×1080", label: "30 fps, landscape" },
+ ]}
+/>
+
This is the video where your product does the talking. A recreated app screen acts out your core flow — something is clicked, the UI responds, the result lands — pixel-perfect and scripted, which is why it looks better than any screen recording. No cursor hunting for a button, no loading spinners, no stray notifications. In the [Feature announcement](/docs/guides/feature-announcement) this is one beat called the demo; here that beat grows into the whole video.
-## The storyboard
+## The storyboard<GuideCount n={7} />
+
+<GuideStoryboard
+ beats={[
+ { label: "Setup", seconds: 4, look: "line" },
+ { label: "Screen", seconds: 5, look: "screen" },
+ { label: "Step one", seconds: 10, look: "screen" },
+ { label: "Step two", seconds: 10, look: "screen" },
+ { label: "Step three", seconds: 10, look: "screen" },
+ { label: "Payoff", seconds: 6, look: "reveal" },
+ { label: "Close", seconds: 5, look: "terminal" },
+ ]}
+/>
+
+<GuideBeatList>
-1. **The setup** — one line naming who this is for and the job to be done.
-2. **The screen appears** — your app UI slides in, calm, no action yet. Let the viewer see where they are.
-3. **Step one** — the flow begins: something is clicked or typed, the UI responds.
-4. **Step two** — the next step of the same flow, given room to be seen.
-5. **Step three** — the last step; the flow completes on camera.
-6. **The payoff** — the outcome on screen, plus one line saying what just happened in the user's terms.
-7. **The close** — a terminal types your install command or URL, then your logo.
+1. **The setup** — One line naming who this is for and the job to be done.
+2. **The screen appears** — Your app UI slides in, calm, no action yet. Let the viewer see where they are.
+3. **Step one** — The flow begins: something is clicked or typed, the UI responds.
+4. **Step two** — The next step of the same flow, given room to be seen.
+5. **Step three** — The last step; the flow completes on camera.
+6. **The payoff** — The outcome on screen, plus one line saying what just happened in the user's terms.
+7. **The close** — A terminal types your install command or URL, then your logo.
+
+</GuideBeatList>
The three flow steps are most of the runtime. Everything else frames them.
-## Your words
+## Your words<GuideCount n={7} />
+
+<GuideWords
+ examples={[
+ { blank: ["<PRODUCT NAME>"] },
+ { blank: ["<SETUP LINE>"] },
+ { blank: ["<FLOW STEP 1>", "<FLOW STEP 2>", "<FLOW STEP 3>"] },
+ { blank: ["<PAYOFF LINE>"] },
+ { blank: ["<INSTALL COMMAND OR URL>"] },
+ { blank: ["<CLOSING LINE>"] },
+ { color: "#D4F25C", note: "Leave empty for the default lime" },
+ ]}
+>
- **Product name**
-- **Setup line** — who this is for and the job, one sentence
-- **The one flow** — told as three steps, each a short sentence describing what happens on screen ("the user pastes a link", "a preview builds itself", "the share button lights up")
-- **Payoff line** — what the user just got, in their words
-- **Install command or URL** — one, not both
+- **Setup line** — Who this is for and the job, one sentence
+- **The one flow** — Told as three steps, each a short sentence describing what happens on screen ("the user pastes a link", "a preview builds itself", "the share button lights up")
+- **Payoff line** — What the user just got, in their words
+- **Install command or URL** — One, not both
- **Closing line**
-- **Accent color** — one hex value; optional, the default lime looks good
+- **Accent color** _optional_ — One hex value; the default lime looks good
+
+</GuideWords>
Pick one flow. A demo that shows three features demos none — the viewer should finish the video able to retell the flow from memory. If your product has three flows worth showing, that's three videos.
+<GuideNote icon="image">
+
Have a logo? Drop the SVG into the project folder and mention the file name in the prompt. No logo — your agent will use the product name as a wordmark.
+<GuideNote icon="image">
+
Struggling with the lines? [Words on screen](/docs/guides/words-on-screen) is the cheat sheet.
+</GuideNote>
+
+</GuideNote>
+
## The prompt
+Paste it into your agent with your words in place of the highlighted blanks.
+
+<GuidePrompt>
+
```text
I'm making a product demo video with remocn (remocn.dev).
@@ -62,16 +134,30 @@ text, one accent color <ACCENT COLOR>, Manrope. Keep transitions restrained
— the screen holds still, the flow moves. Use my copy exactly as written.
```
+</GuidePrompt>
+
## Directing the result
+<GuideNotes>
+
- "Step two goes by too fast — I can't see what was clicked."
- "The screen should look more like my app — here's a screenshot."
- "Hold the payoff longer before the close."
- "The typing is too quick — slow it to a human pace."
- "Cut straight from the setup line to the screen."
+</GuideNotes>
+
+<GuideMoreLink>
+
More directing vocabulary: [Directing your agent](/docs/guides/directing-your-agent).
+</GuideMoreLink>
+
## Get the file
-Ask your agent: **"Render the video."** You'll get an `.mp4` in the project folder, ready to post.
+<GuideRenderCard prompt="Render the video.">
+
+You'll get an `.mp4` in the project folder, ready to post.
+
+</GuideRenderCard>
diff --git a/content/docs/guides/setup.mdx b/content/docs/guides/setup.mdx
index ce6ca4f0..1a8f2efa 100644
--- a/content/docs/guides/setup.mdx
+++ b/content/docs/guides/setup.mdx
@@ -3,11 +3,26 @@ title: Setup
description: One-time setup for making videos with an AI agent — about ten minutes
---
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideAgentPicker } from "@/components/docs/guides/setup/agent-picker";
+import { GuideChecklist, GuideStep } from "@/components/docs/guides/setup/checklist";
+import { GuidePluginAside, GuideReadyRow, GuideStudioPreview } from "@/components/docs/guides/setup/studio-preview";
+
You need two things: an AI coding agent and an empty folder.
-**1. Get an agent.** We recommend [Claude Code](/docs/ai/claude-code) — also works with [ChatGPT](/docs/ai/chat-gpt), [opencode](/docs/ai/opencode) and others.
+<GuideChecklist title="One-time setup" description="About ten minutes, all copy-paste." done={1} total={2}>
+
+<GuideStep state="done" title="Get an agent">
+
+We recommend [Claude Code](/docs/ai/claude-code) — also works with [ChatGPT](/docs/ai/chat-gpt), [opencode](/docs/ai/opencode) and others.
+
+<GuideAgentPicker />
+
+</GuideStep>
-**2. Open the agent in an empty folder and paste:**
+<GuideStep state="current" step={2} title="Open the agent in an empty folder and paste:">
+
+<GuidePrompt>
```text
Set up a new Remotion video project in this folder, then install the remocn
@@ -15,7 +30,30 @@ agent skill: npx skills add Remocn/remocn --yes. When you're done, start the
preview studio so I can watch the video while we work.
```
-In Claude Code or Codex you can install the [remocn plugin](/docs/getting-started/plugin) instead of
-the skill, then start any video with `/remocn:video` and a one-line brief.
+</GuidePrompt>
+
+<GuidePluginAside>
+
+**Or use the [plugin](/docs/getting-started/plugin)** in Claude Code or Codex, instead of the skill.
+
+Then start any video with `/remocn:video` and a one-line brief.
+
+</GuidePluginAside>
+
+</GuideStep>
+
+<GuideStep state="next" title="You're ready">
+
+When a browser tab opens with an empty video player, you're ready. Pick a guide and make it yours.
+
+<GuideStudioPreview />
+
+<GuideReadyRow>
+
+Finished videos you can make yours — pick one, fill in your words, paste a prompt. [Pick a guide](/docs/guides)
+
+</GuideReadyRow>
+
+</GuideStep>
-When a browser tab opens with an empty video player, you're ready. Pick a [guide](/docs/guides) and make it yours.
+</GuideChecklist>
diff --git a/content/docs/guides/showcase-reel.mdx b/content/docs/guides/showcase-reel.mdx
index f427e795..1537e862 100644
--- a/content/docs/guides/showcase-reel.mdx
+++ b/content/docs/guides/showcase-reel.mdx
@@ -3,37 +3,94 @@ title: Showcase reel
description: A fast ~30-second reel where every item in a collection gets its own beat — the one we shipped the typography wave with
---
+import { GuideNotes, GuideMoreLink } from "@/components/docs/guides/director-notes";
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideNote } from "@/components/docs/guides/note";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideRenderCard } from "@/components/docs/guides/render-card";
+import { GuideBeatList, GuideStoryboard } from "@/components/docs/guides/storyboard";
+import { GuideFacts } from "@/components/docs/guides/video-facts";
+import { GuideWords } from "@/components/docs/guides/words-form";
+
<GuideVideo
src="https://cdn.remocn.dev/videos/typography.mp4"
poster="https://cdn.remocn.dev/posters/typography.png"
+ label="The typography wave showcase reel"
+ duration={30}
/>
-This is the video we shipped eighteen new text animations with. The trick that carries it: nothing is described — every item gets two seconds of stage and demonstrates itself. If you have a collection — templates, integrations, themes, effects — this recipe turns the list into a reel.
-
-## The storyboard
+<GuideFacts
+ facts={[
+ { value: "~30 s", label: "running time" },
+ { value: "7 beats", label: "the reel is most of it" },
+ { value: "1920×1080", label: "30 fps, landscape" },
+ ]}
+/>
-1. **The hook** — one line on why this collection matters.
-2. **The number** — the count lands big. In ours, "18 new text animations".
-3. **The reel** — the heart of the video: one item per beat, a small counter ticking in a corner while items change, each item named with its own motion. If your items are visual, each one demonstrates itself.
-4. **The mechanism** — one line on the property every item shares.
-5. **The value** — two or three claims stack up.
-6. **The close** — a terminal types your command or link.
-7. **The lockup** — your logo and a closing line.
+This is the video we shipped eighteen new text animations with. The trick that carries it: nothing is described — every item gets two seconds of stage and demonstrates itself. If you have a collection — templates, integrations, themes, effects — this recipe turns the list into a reel.
-## Your words
+## The storyboard<GuideCount n={7} />
+
+<GuideStoryboard
+ beats={[
+ { label: "Hook", seconds: 3, look: "slide" },
+ { label: "Number", seconds: 3, look: "number" },
+ { label: "Reel", seconds: 14, look: "montage" },
+ { label: "Mechanism", seconds: 3, look: "line" },
+ { label: "Value", seconds: 3, look: "stack" },
+ { label: "Close", seconds: 2, look: "terminal" },
+ { label: "Lockup", seconds: 2, look: "logo" },
+ ]}
+/>
-- **The collection** — what the things are, and the count
+<GuideBeatList>
+
+1. **The hook** — One line on why this collection matters.
+2. **The number** — The count lands big. In ours, "18 new text animations".
+3. **The reel** — The heart of the video: one item per beat, a small counter ticking in a corner while items change, each item named with its own motion. If your items are visual, each one demonstrates itself.
+4. **The mechanism** — One line on the property every item shares.
+5. **The value** — Two or three claims stack up.
+6. **The close** — A terminal types your command or link.
+7. **The lockup** — Your logo and a closing line.
+
+</GuideBeatList>
+
+## Your words<GuideCount n={7} />
+
+<GuideWords
+ examples={[
+ { blank: ["<N>", "<THINGS>"] },
+ { blank: ["<HOOK LINE>"] },
+ { blank: ["<ITEM LIST>"] },
+ { blank: ["<MECHANISM LINE>"] },
+ { blank: ["<CLAIMS>"] },
+ { blank: ["<COMMAND OR LINK>"] },
+ { blank: ["<CLOSING LINE>"] },
+ ]}
+>
+
+- **The collection** — What the things are, and the count
- **Hook line**
-- **The items** — six to eighteen names, one or two words each. Fewer than six? Make a [Feature announcement](/docs/guides/feature-announcement) instead.
-- **Mechanism line** — the property every item shares
+- **The items** — Six to eighteen names, one or two words each. Fewer than six? Make a [Feature announcement](/docs/guides/feature-announcement) instead.
+- **Mechanism line** — The property every item shares
- **Two or three value claims**
- **Command or link**
- **Closing line**
+</GuideWords>
+
+<GuideNote icon="image">
+
Struggling with the lines? [Words on screen](/docs/guides/words-on-screen) is the cheat sheet.
+</GuideNote>
+
## The prompt
+Paste it into your agent with your words in place of the highlighted blanks.
+
+<GuidePrompt>
+
```text
I'm making a showcase reel with remocn (remocn.dev).
@@ -60,15 +117,29 @@ video. Keep the reel snappy — no long holds, effect after effect. Use my copy
exactly as written.
```
+</GuidePrompt>
+
## Directing the result
+<GuideNotes>
+
- "The reel drags in the middle — tighten items six through ten."
- "The counter is too prominent — smaller and dimmer."
- "Item four moves like item three — give it a different motion."
- "Hold the number beat a little longer."
+</GuideNotes>
+
+<GuideMoreLink>
+
More directing vocabulary: [Directing your agent](/docs/guides/directing-your-agent).
+</GuideMoreLink>
+
## Get the file
-Ask your agent: **"Render the video."** You'll get an `.mp4` in the project folder, ready to post.
+<GuideRenderCard prompt="Render the video.">
+
+You'll get an `.mp4` in the project folder, ready to post.
+
+</GuideRenderCard>
diff --git a/content/docs/guides/teaser.mdx b/content/docs/guides/teaser.mdx
index c7f17249..23782326 100644
--- a/content/docs/guides/teaser.mdx
+++ b/content/docs/guides/teaser.mdx
@@ -3,35 +3,102 @@ title: Teaser
description: The ~15-second pre-launch video — something is coming, here is its name, here is the date
---
+import { GuideNotes, GuideMoreLink } from "@/components/docs/guides/director-notes";
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { GuideNote } from "@/components/docs/guides/note";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+import { GuideCallout, GuideRenderCard } from "@/components/docs/guides/render-card";
+import { GuideBeatList, GuideStoryboard } from "@/components/docs/guides/storyboard";
+import { GuideStoryboardPreview } from "@/components/docs/guides/storyboard-preview";
+import { GuideFacts } from "@/components/docs/guides/video-facts";
+import { GuideWords } from "@/components/docs/guides/words-form";
+
+<GuideStoryboardPreview
+ beats={[
+ { label: "The itch", seconds: 3, frame: { line: "Every launch needs a video" } },
+ { label: "The tease", seconds: 3, frame: { line: "Yours shouldn't take a week" } },
+ { label: "The reveal", seconds: 4, frame: { name: "remocn", sub: "Cinematic video components for React" } },
+ { label: "The date", seconds: 3, frame: { big: "March 12" } },
+ { label: "The lockup", seconds: 2, frame: { logo: "remocn.dev" } },
+ ]}
+/>
+
+<GuideFacts
+ facts={[
+ { value: "~15 s", label: "running time" },
+ { value: "5 beats", label: "five is the ceiling" },
+ { value: "1920×1080", label: "30 fps, landscape" },
+ ]}
+/>
+
The teaser is the shortest video in these guides. Fifteen seconds, one job: something is coming, here is its name, here is the date or the waitlist link. You make it before launch day — when there's nothing to demo yet and the whole point is the itch. Short is the feature: a fifteen-second teaser loops well in a feed and earns rewatches. Resist adding beats.
-## The storyboard
+## The storyboard<GuideCount n={5} />
+
+<GuideStoryboard
+ beats={[
+ { label: "The itch", seconds: 3, look: "line" },
+ { label: "The tease", seconds: 3, look: "tease" },
+ { label: "The reveal", seconds: 4, look: "reveal" },
+ { label: "The date", seconds: 3, look: "date" },
+ { label: "The lockup", seconds: 2, look: "logo" },
+ ]}
+/>
+
+<GuideBeatList>
+
+1. **The itch** — One line naming the problem or the hunger. No product yet.
+2. **The tease** — A second line promising something is coming. Still no name.
+3. **The reveal** — The product name lands, with one quiet line on what it is.
+4. **The date** — The launch date, or "Join the waitlist", big and alone.
+5. **The lockup** — Your logo or wordmark and the URL.
+
+</GuideBeatList>
-1. **The itch** — one line naming the problem or the hunger. No product yet.
-2. **The tease** — a second line promising something is coming. Still no name.
-3. **The reveal** — the product name lands, with one quiet line on what it is.
-4. **The date** — the launch date, or "Join the waitlist", big and alone.
-5. **The lockup** — your logo or wordmark and the URL.
+<GuideCallout>
Five beats is the ceiling. If you're tempted to add a sixth, you're making a [Launch video](/docs/guides/launch-video) — save it for launch day.
-## Your words
+</GuideCallout>
+
+## Your words<GuideCount n={6} />
Six blanks, and most of them are one line:
+<GuideWords
+ examples={[
+ ["remocn"],
+ { stack: ["Every launch needs a video", "Yours shouldn't take a week"] },
+ ["Cinematic video components for React"],
+ ["March 12"],
+ ["remocn.dev"],
+ { color: "#D4F25C", note: "Leave empty for the default lime" },
+ ]}
+>
+
- **Product name**
-- **Two tease lines** — six words or fewer each; the first names the itch, the second promises relief
-- **What-it-is line** — one plain line for under the name
+- **Two tease lines** — Six words or fewer each; the first names the itch, the second promises relief
+- **What-it-is line** — One plain line for under the name
- **The date or CTA** — "March 12" or "Join the waitlist"
- **The URL**
-- **Accent color** — one hex value; optional, the default lime looks good
+- **Accent color** _optional_ — One hex value; the default lime looks good
+
+</GuideWords>
+
+<GuideNote icon="image">
Have a logo? Drop the SVG into the project folder and mention the file name in the prompt. No logo — your agent will use the product name as a wordmark.
Struggling with the lines? [Words on screen](/docs/guides/words-on-screen) is the cheat sheet.
+</GuideNote>
+
## The prompt
+Paste it into your agent with your words in place of the highlighted blanks.
+
+<GuidePrompt>
+
```text
I'm making a pre-launch teaser with remocn (remocn.dev).
@@ -54,15 +121,29 @@ entire video with a radial scrim for readability. Five beats, no filler —
each beat holds just long enough to read. Use my copy exactly as written.
```
+</GuidePrompt>
+
## Directing the result
+<GuideNotes swatches={{ 2: "#D4F25C" }}>
+
- "The tease lines go by too fast — hold each one longer."
- "The reveal should hit harder — bigger, faster in."
- "Put the date in the accent color."
- "Tighten it to twelve seconds."
+</GuideNotes>
+
+<GuideMoreLink>
+
More directing vocabulary: [Directing your agent](/docs/guides/directing-your-agent).
+</GuideMoreLink>
+
## Get the file
-Ask your agent: **"Render the video."** You'll get an `.mp4` in the project folder, ready to post.
+<GuideRenderCard prompt="Render the video.">
+
+You'll get an `.mp4` in the project folder, ready to post.
+
+</GuideRenderCard>
diff --git a/content/docs/guides/words-on-screen.mdx b/content/docs/guides/words-on-screen.mdx
index 1a8d4bd2..f63c106f 100644
--- a/content/docs/guides/words-on-screen.mdx
+++ b/content/docs/guides/words-on-screen.mdx
@@ -3,37 +3,66 @@ title: Words on screen
description: Video copy is not website copy — how to write lines people can read in two seconds
---
+import { GuideCount } from "@/components/docs/guides/guide-ui";
+import { WordsFormulas } from "@/components/docs/guides/practice/words-formulas";
+import { WordsRules } from "@/components/docs/guides/practice/words-rules";
+import { WordsTwoSecondTest } from "@/components/docs/guides/practice/two-second-test";
+
On a landing page the reader controls the clock — they can reread. In a video the line is gone in two seconds. Writing for the screen is its own small craft, and this page is all of it.
-## The rules
+## The rules<GuideCount n={6} />
+
+<WordsRules
+ pairs={[
+ { dont: "Every launch needs a video, yours shouldn't take a week", do: "Yours shouldn't take a week" },
+ { dont: "Incredibly simple", do: "Ships in one command" },
+ { dont: "A huge library", do: "110+ components" },
+ ]}
+ icons={["lines", "shield", "mic"]}
+>
+
+- **Six words or fewer** — If a line doesn't fit, it's two beats — or it's too clever.
+- **Verbs over adjectives** — "Ships in one command" beats "incredibly simple".
+- **Concrete over grand** — Numbers, commands, names: "110+ components", not "a huge library".
+- **One idea per line** — Split sentences; don't compress them.
+- **No adjectives you can't prove**
+- **Read it aloud once** — If you stumble, the viewer will too.
+
+</WordsRules>
-- **Six words or fewer.** If a line doesn't fit, it's two beats — or it's too clever.
-- **One idea per line.** Split sentences; don't compress them.
-- **Verbs over adjectives.** "Ships in one command" beats "incredibly simple".
-- **Concrete over grand.** Numbers, commands, names: "110+ components", not "a huge library".
-- **No adjectives you can't prove.**
-- **Read it aloud once.** If you stumble, the viewer will too.
+## Formulas for common beats<GuideCount n={5} />
-## Formulas for common beats
+<WordsFormulas>
-**Pain lines** — name the problem in the viewer's words, not yours; the second line twists or promises a way out:
+**Pain lines** — Name the problem in the viewer's words, not yours; the second line twists or promises a way out.
> "Every launch needs a video" / "Yours shouldn't take a week"
-**Taglines** — what it is plus who it's for, zero filler:
+**Taglines** — What it is plus who it's for, zero filler.
> "Cinematic video components for React"
-**Positioning** — borrow a shape people already know; nothing transfers a mental model faster:
+**Positioning** — Borrow a shape people already know; nothing transfers a mental model faster.
> "Like shadcn/ui, for video"
-**Value claims** — three, each concrete, each provable:
+**Value claims** — Three, each concrete, each provable.
> "110+ components" / "One command to install" / "The code is yours"
-**The close** — the single shortest next action. A command *or* a URL — one, not both.
+**The close** — The single shortest next action. A command *or* a URL — one, not both.
+
+> &lt;YOUR CTA&gt;
+
+</WordsFormulas>
## The two-second test
Whatever you're filling in — a worksheet, a prompt, a rewrite — say each line out loud at speaking pace. Longer than two seconds to say? Tighten it.
+
+<WordsTwoSecondTest
+ lines={[
+ { text: "Yours shouldn't take a week", seconds: 1.4 },
+ { text: "Every launch needs a video, yours shouldn't take a week", seconds: 2.6 },
+ ]}
+/>
diff --git a/content/docs/guides/your-brand.mdx b/content/docs/guides/your-brand.mdx
index 71e97dab..c87a157b 100644
--- a/content/docs/guides/your-brand.mdx
+++ b/content/docs/guides/your-brand.mdx
@@ -3,12 +3,24 @@ title: Your brand
description: Hand your brand to the agent once — every video after that comes out looking like yours
---
+import { GuideBrandBrief, GuideBrandLine } from "@/components/docs/guides/practice/brand-brief";
+import { GuideBrandFrames } from "@/components/docs/guides/practice/brand-frames";
+import { GuideConsistency } from "@/components/docs/guides/practice/consistency-strip";
+import { GuideDefinitions } from "@/components/docs/guides/practice/definition-table";
+import { GuidePrompt } from "@/components/docs/guides/prompt-block";
+
The recipes default to remocn's look — a warm dark background and one lime accent. Your videos should look like your product instead. Do it once: write a brand brief, have your agent save it in the project, and reference it forever.
+<GuideBrandFrames />
+
## The brand brief
Fill this in and paste it to your agent:
+<GuideBrandBrief>
+
+<GuidePrompt copyLabel="Copy" highlight={false} wrap>
+
```text
Save this as BRAND.md in the project and use it for every video we make here:
@@ -23,18 +35,35 @@ Save this as BRAND.md in the project and use it for every video we make here:
- Copy tone: <e.g. plain and confident, no exclamation marks>
```
+</GuidePrompt>
+
+</GuideBrandBrief>
+
+<GuideBrandLine>
+
From then on, start every new video prompt with one line: **"Use the brand brief."**
+</GuideBrandLine>
+
## Picking the values
-- **Background** — your app's or landing page's background is usually right. Dark backgrounds forgive more.
-- **One accent, used sparingly.** If everything is accented, nothing is.
-- **Text color** — off-white on dark, near-black on light. Pure white on pure black reads harsh on video.
-- **Font mood** — you don't have to name a font; describe the mood and your agent picks one. If you know your font's name, name it.
-- **Logo** — an SVG beats a PNG: it scales cleanly and can be drawn on.
+<GuideDefinitions>
+
+- **Background** — Your app's or landing page's background is usually right. Dark backgrounds forgive more.
+- **One accent, used sparingly** — If everything is accented, nothing is.
+- **Text color** — Off-white on dark, near-black on light. Pure white on pure black reads harsh on video.
+- **Font mood** — You don't have to name a font; describe the mood and your agent picks one. If you know your font's name, name it.
+- **Logo** — An SVG beats a PNG: it scales cleanly and can be drawn on.
+
+</GuideDefinitions>
## Staying on brand
- Open every new video prompt with "Use the brand brief."
- Rebranded? Ask your agent to update `BRAND.md` — every video after that follows.
-- Consistency compounds: three videos with one look read as a channel; three looks read as three experiments.
+
+<GuideConsistency>
+
+Consistency compounds: three videos with one look read as a channel; three looks read as three experiments.
+
+</GuideConsistency>
diff --git a/content/docs/icons/gallery.mdx b/content/docs/icons/gallery.mdx
index 5f874de9..16fbb6c9 100644
--- a/content/docs/icons/gallery.mdx
+++ b/content/docs/icons/gallery.mdx
@@ -3,15 +3,18 @@ title: Gallery
description: Browse every remocn icon, hover to play its motion, and copy the install command
---
+import { IconsSection } from "@/components/docs/index/icons/icons-section";
-Icon paths are derived from [Lucide](https://lucide.dev), licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE), and re-authored from scratch for deterministic Remotion video.
-
-Install any icon by name — swap `icon-check` for the one you want from the gallery below.
+Icon paths are derived from [Lucide](https://lucide.dev), licensed under the [ISC License](https://github.com/lucide-icons/lucide/blob/main/LICENSE), and re-authored from scratch for deterministic Remotion video. Install any icon by name: swap `icon-check` for the one you want from the gallery below.
<InstallBlock name="icon-check" />
+<IconsSection>
+
## Gallery
-Hover or focus a tile to play its animation, then click to copy the install command
+Hover or focus a tile to play its animation, then click to copy the install command.
+
+</IconsSection>
<IconsGallery />
diff --git a/content/docs/layout/index.mdx b/content/docs/layout/index.mdx
index 0fe5ea4e..83da9351 100644
--- a/content/docs/layout/index.mdx
+++ b/content/docs/layout/index.mdx
@@ -3,33 +3,8 @@ title: Layout
description: Scene framing and fill components for Remotion compositions
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+
Layout primitives that handle full-frame fills, content framing, and padding — the structural layer every Remotion composition needs before adding animation.
-<ComponentCardGrid
- items={[
- {
- name: "Backdrop",
- description: "Full-frame fill (color, gradient, image, or live animated React element) with an optional rounded, shadowed content frame inset by padding",
- status: "stable",
- href: "/docs/layout/backdrop",
- },
- {
- name: "Drift",
- description: "A restrained linear camera creep that keeps a static scene alive without becoming the subject",
- status: "stable",
- href: "/docs/layout/drift",
- },
- {
- name: "Chat to Preview Layout",
- description: "A two-column handoff where an agent conversation yields the frame to the product it created",
- status: "stable",
- href: "/docs/layout/chat-to-preview-layout",
- },
- {
- name: "Stage",
- description: "A perspective studio plane with an integrated operator camera that can travel across long screenshots and live scenes",
- status: "stable",
- href: "/docs/layout/stage",
- },
- ]}
-/>
+<CategoryIndex section="/docs/layout" />
diff --git a/content/docs/motion-graphics/index.mdx b/content/docs/motion-graphics/index.mdx
index cc425978..910680fb 100644
--- a/content/docs/motion-graphics/index.mdx
+++ b/content/docs/motion-graphics/index.mdx
@@ -3,45 +3,8 @@ title: Motion Graphics
description: Flat geometric motion-graphics pieces for openers, section breaks, and pattern beds
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+
Brand-agnostic geometry built the way motion designers build shape layers — drop one over any scene, recolor it, and let it play out.
-<ComponentCardGrid
- items={[
- {
- name: "Bauhaus Build",
- description: "Flat Bauhaus shapes tumble corner over corner into a frieze, then rebuild around an open title band",
- status: "stable",
- href: "/docs/motion-graphics/bauhaus-build",
- },
- {
- name: "Mondrian Split",
- description: "A De Stijl grid builds itself, reflows like rubber, and one cell takes over the frame",
- status: "stable",
- href: "/docs/motion-graphics/mondrian-split",
- },
- {
- name: "Truchet Flip",
- description: "A pattern bed — quarter-circle tiles snap a quarter turn as a wave passes and the lines reconnect into rings",
- status: "stable",
- href: "/docs/motion-graphics/truchet-flip",
- },
- {
- name: "Trim Burst",
- description: "A punctuation accent — short strokes shoot out from a point, and each start chases its end until the stroke zips shut in flight",
- status: "stable",
- href: "/docs/motion-graphics/trim-burst",
- },
- {
- name: "Speed Lines",
- description: "Streaks trail a flying element at its real speed, it lands with a squash and a small bounce, or radial lines snap onto an impact point",
- status: "stable",
- href: "/docs/motion-graphics/speed-lines",
- },
- {
- name: "Squiggle",
- description: "A line accent — a wave draws itself along a course, swims forward as it goes, calms, and erases toward the end",
- status: "stable",
- href: "/docs/motion-graphics/squiggle",
- },
- ]}
-/>
+<CategoryIndex section="/docs/motion-graphics" />
diff --git a/content/docs/shaders/getting-started/introduction.mdx b/content/docs/shaders/getting-started/introduction.mdx
index e07c9662..fc282430 100644
--- a/content/docs/shaders/getting-started/introduction.mdx
+++ b/content/docs/shaders/getting-started/introduction.mdx
@@ -3,21 +3,44 @@ title: Introduction
description: WebGL shader backdrops wrapped for Remotion and driven per-frame for deterministic renders
---
-Shaders are GPU-rendered animated backgrounds for your Remotion scenes. Each one wraps a shader from [paper-design/shaders](https://github.com/paper-design/shaders) and adapts it to the way Remotion renders video — headless, frame by frame, the same output on every pass.
+import { HowItWorks } from "@/components/docs/index/libraries/how-it-works";
+import { LibraryGallery } from "@/components/docs/index/libraries/library-gallery";
+import { ShaderHero } from "@/components/docs/index/libraries/shader-hero";
-Drop one behind your content as a full-bleed backdrop, tune a few controls, and reach for the raw shader parameters when you want full control.
+<ShaderHero
+ name="shader-warp"
+ props={{ colors: ["#0e0418", "#4a0d5e", "#a800b7", "#f0abfc"] }}
+ title="Your scene sits on top"
+ subtitle="The shader is the backdrop. Nothing else changes."
+ tags={["WebGL, driven per frame", "Built on paper-design/shaders"]}
+/>
-## Why a dedicated wrapper
+<HowItWorks
+ steps={[
+ {
+ title: "Install a shader",
+ body: "Every shader is its own registry item. Add one and the file lands in your project.",
+ },
+ {
+ title: "Drop it behind content",
+ body: "Render it first in an AbsoluteFill. Whatever follows sits on top as a full-bleed backdrop.",
+ },
+ {
+ title: "Tune, then go raw",
+ body: "A speed control plus a few of its own. Any other paper-design prop passes straight through.",
+ },
+ ]}
+>
-A shader animates against a wall-clock timer. Remotion does not — it renders frame N in isolation, often out of order and across parallel workers, and expects the exact same pixels every time it asks for that frame.
+## How it works
-Each component bridges the two: instead of letting the shader run on its own clock, it freezes the shader (`speed={0}`) and drives its `frame` uniform from `useCurrentFrame()`. The motion becomes a pure function of the timeline, so scrubbing, looping, and multi-pass renders all stay deterministic.
+Each component wraps a shader from [paper-design/shaders](https://github.com/paper-design/shaders) and adapts it to the way Remotion renders video: headless, frame by frame, the same output on every pass.
-The wrapper also gates the first paint with `delayRender()`/`continueRender()` so WebGL is initialised before Remotion captures a frame, and forces the canvas to fill the whole composition (`fit="cover"` with the exact `width`/`height`) so there are no black margins.
+</HowItWorks>
-## Using a shader
+<InstallBlock name="shader-mesh-gradient" />
-```tsx
+```tsx title="scene.tsx"
import { AbsoluteFill } from "remotion";
import { ShaderMeshGradient } from "@/components/remocn/shader-mesh-gradient";
@@ -29,6 +52,14 @@ export const Scene = () => (
);
```
-Every component exposes a `speed` control plus a handful of shader-specific ones, and forwards any remaining paper-design prop through, so nothing is locked away. Defaults are deliberately muted — pick your own palette when you want the shader to lead.
+<Note title="Why a dedicated wrapper">
+A shader runs on a wall-clock timer, while Remotion renders frame N in isolation, often out of order and across parallel workers. Each component freezes the shader with `speed={0}` and drives its `frame` uniform from `useCurrentFrame()`, so scrubbing, looping and multi-pass renders all stay deterministic. It also holds the first paint with `delayRender()` until WebGL is ready, and fills the whole composition so there are no black margins.
+</Note>
-Browse the individual shaders in the sidebar to preview each one and grab its install command.
+<LibraryGallery kind="shader">
+
+## All shaders
+
+Defaults are deliberately muted. Pick your own palette when the shader should lead.
+
+</LibraryGallery>
diff --git a/content/docs/social/index.mdx b/content/docs/social/index.mdx
index 6f3b2e87..e39e7a0a 100644
--- a/content/docs/social/index.mdx
+++ b/content/docs/social/index.mdx
@@ -3,33 +3,8 @@ title: Social
description: Remotion compositions for sharing milestones and social proof
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+
Ready-to-install compositions that turn GitHub stats, product launches, and community milestones into shareable video moments.
-<ComponentCardGrid
- items={[
- {
- name: "GitHubStars",
- description: "Stargazer fly-through with an odometer counter — paste a repo, preview the animation, download MP4",
- status: "stable",
- href: "/docs/social/github-stars",
- },
- {
- name: "XFollowCard",
- description: "Animated X profile follow card with cursor-driven Follow transition",
- status: "stable",
- href: "/docs/social/x-follow-card",
- },
- {
- name: "XFollowersOverview",
- description: "X follow notifications flip through in 3D, then the total follower count blurs in",
- status: "stable",
- href: "/docs/social/x-followers-overview",
- },
- {
- name: "LogoEnter",
- description: "A stacked group of round brand chips that spring in one-by-one, then hold — swap in any logos",
- status: "stable",
- href: "/docs/social/logo-enter",
- },
- ]}
-/>
+<CategoryIndex section="/docs/social" />
diff --git a/content/docs/templates/index.mdx b/content/docs/templates/index.mdx
new file mode 100644
index 00000000..3cea6ba4
--- /dev/null
+++ b/content/docs/templates/index.mdx
@@ -0,0 +1,43 @@
+---
+title: Templates
+description: Complete videos you install as-is. Swap the name, the copy and the accent color, then render. Every frame stays editable React and SVG.
+---
+
+import { TemplateCard } from "@/components/docs/index/templates/template-card";
+import { TemplateStep, TemplateSteps } from "@/components/docs/index/templates/template-steps";
+
+<TemplateSteps>
+ <TemplateStep n={1} title="Install">One command copies every scene, motion helper and bundled asset into your project</TemplateStep>
+ <TemplateStep n={2} title="Register">Add one Composition with the exported frames, fps, width and height constants</TemplateStep>
+ <TemplateStep n={3} title="Make it yours">Pass brandName, accentColor and content props, or edit the scene files directly</TemplateStep>
+</TemplateSteps>
+
+<TemplateCard name="release-teaser" inside={["Five statements", "Release lockup", "Open-ring geometry", "Edge light"]}>
+
+## Release Teaser
+
+</TemplateCard>
+
+<TemplateCard name="brand-guidelines" inside={["Mark and palette", "Type specimen", "Object collage, 3 photos"]}>
+
+## Brand Guidelines
+
+</TemplateCard>
+
+<TemplateCard name="workflow-console" inside={["18 scenes", "Terminal and charts"]}>
+
+## Workflow Console
+
+</TemplateCard>
+
+<TemplateCard name="launch-anything" inside={["7 product demos", "4 photo plates", "Laptop camera move"]}>
+
+## Product Showcase
+
+</TemplateCard>
+
+<TemplateCard name="fomo-limit-orders" inside={["Phone interface", "Exit price slider", "Confirmation", "Stopped mark"]}>
+
+## Order Flow
+
+</TemplateCard>
diff --git a/content/docs/templates/meta.json b/content/docs/templates/meta.json
index 6443c087..73c1c2d5 100644
--- a/content/docs/templates/meta.json
+++ b/content/docs/templates/meta.json
@@ -1,5 +1,6 @@
{
"title": "Templates",
+ "icon": "PlaySquareIcon",
"collapsible": false,
"pages": [
"release-teaser",
diff --git a/content/docs/transitions/index.mdx b/content/docs/transitions/index.mdx
index 0d2af7d1..356a5503 100644
--- a/content/docs/transitions/index.mdx
+++ b/content/docs/transitions/index.mdx
@@ -3,193 +3,90 @@ title: Transitions
description: Scene transitions built as presentations for TransitionSeries
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+import { ComponentGroup } from "@/components/docs/index/category/component-group";
+
Most transitions here are presentations for `@remotion/transitions` — pass one to a `TransitionSeries.Transition` between two sequences and control the pace with `linearTiming` or `springTiming`. The sequencers at the bottom work differently: they own the whole run of scenes themselves.
+<CategoryIndex section="/docs/transitions">
+
+<ComponentGroup
+ items={[
+ "whip-pan",
+ "push-through",
+ "focus-pull",
+ "zoom-blur",
+ ]}
+>
+
## Camera Motion
Pure CSS-transform physics, no dependencies beyond Remotion.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "WhipPan",
- description: "Whip the camera sideways with motion blur so both scenes fly through in one move",
- status: "stable",
- href: "/docs/transitions/whip-pan",
- },
- {
- name: "PushThrough",
- description: "Dolly through the outgoing scene while the next one approaches from the depth",
- status: "stable",
- href: "/docs/transitions/push-through",
- },
- {
- name: "FocusPull",
- description: "Rack focus from one scene to the next through a soft defocus breath",
- status: "stable",
- href: "/docs/transitions/focus-pull",
- },
- {
- name: "ZoomBlur",
- description: "Push the outgoing scene through the viewer while the incoming one resolves out of blur",
- status: "stable",
- href: "/docs/transitions/zoom-blur",
- },
+ "shader-spiral-pass",
+ "shader-seam",
+ "grain-dissolve",
+ "wave-wipe",
+ "ripple-zoom",
+ "swirl-dissolve",
+ "dither-dissolve",
+ "perlin-dissolve",
+ "smoke-dissolve",
+ "warp-dissolve",
]}
-/>
+>
## Shader
Textured, organic transitions driven by frame-synced shaders. Most use `@paper-design/shaders-react`; Shader Seam and Shader Spiral Pass use a local OpenShaders export.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "ShaderSpiralPass",
- description: "Fly into a luminous spiral and emerge through its center into the next scene",
- status: "stable",
- href: "/docs/transitions/shader-spiral-pass",
- },
- {
- name: "ShaderSeam",
- description: "Dissolve an OpenShaders material in place to uncover the next scene",
- status: "stable",
- href: "/docs/transitions/shader-seam",
- },
- {
- name: "GrainDissolve",
- description: "Disintegrate the outgoing scene into soft grainy shapes and condense the next out of the noise",
- status: "stable",
- href: "/docs/transitions/grain-dissolve",
- },
- {
- name: "WaveWipe",
- description: "Sweep a grainy wave up across the frame and reveal the next scene from below",
- status: "stable",
- href: "/docs/transitions/wave-wipe",
- },
- {
- name: "RippleZoom",
- description: "Fly the camera through the center of grainy ripple rings while the next scene approaches",
- status: "stable",
- href: "/docs/transitions/ripple-zoom",
- },
- {
- name: "SwirlDissolve",
- description: "Twist the frame into swirling bands that unwind into the next scene",
- status: "stable",
- href: "/docs/transitions/swirl-dissolve",
- },
- {
- name: "DitherDissolve",
- description: "Dissolve through an animated dither pattern for a retro print texture",
- status: "stable",
- href: "/docs/transitions/dither-dissolve",
- },
- {
- name: "PerlinDissolve",
- description: "Sweep a perlin-noise threshold across the frame to dissolve into the next scene",
- status: "stable",
- href: "/docs/transitions/perlin-dissolve",
- },
- {
- name: "SmokeDissolve",
- description: "Expand a smoke ring outward across the frame to reveal the next scene",
- status: "stable",
- href: "/docs/transitions/smoke-dissolve",
- },
- {
- name: "WarpDissolve",
- description: "Melt the outgoing scene into a folding domain-warp field that straightens into the next",
- status: "stable",
- href: "/docs/transitions/warp-dissolve",
- },
+ "ascii-dissolve",
+ "caret-wipe",
+ "icon-scatter",
]}
-/>
+>
## Stylized
Kinetic, interface-flavored transitions — typed wipes, scattering icons, and messaging motion.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "AsciiDissolve",
- description: "Dissolve one scene into the next through a drifting field of ASCII glyphs",
- status: "stable",
- href: "/docs/transitions/ascii-dissolve",
- },
- {
- name: "CaretWipe",
- description: "Sweep a typing caret across the frame, wiping the outgoing scene into the next",
- status: "stable",
- href: "/docs/transitions/caret-wipe",
- },
- {
- name: "IconScatter",
- description: "Scatter a field of icons over the cut, hiding the scene swap at the field's peak",
- status: "stable",
- href: "/docs/transitions/icon-scatter",
- },
+ "glitch-cut",
+ "ember-burn",
+ "particle-dissolve",
+ "grid-wave",
+ "displacement",
]}
-/>
+>
## Canvas
Pixel-level transitions. These read the actual pixels of both scenes through the experimental html-in-canvas browser API and post-process them per frame, which is what makes tearing, burning, and shattering possible at all. Chrome 149+ behind `chrome://flags/#canvas-draw-element` shows the real effect; every other browser degrades to a CSS approximation of the same edit, so previews and renders never break.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "GlitchCut",
- description: "Tear a hard cut into displaced slices with channel split and corrupted blocks",
- status: "stable",
- href: "/docs/transitions/glitch-cut",
- },
- {
- name: "EmberBurn",
- description: "Set the outgoing frame on fire so it boils, chars, and blows away as sparks that carry its own colour",
- status: "stable",
- href: "/docs/transitions/ember-burn",
- },
- {
- name: "ParticleDissolve",
- description: "Grind the frame into drifting grey dust and let the next scene coalesce back out of it",
- status: "stable",
- href: "/docs/transitions/particle-dissolve",
- },
- {
- name: "GridWave",
- description: "Send a wave across the frame that raises the picture into solid blocks and sets them down carrying the next scene",
- status: "stable",
- href: "/docs/transitions/grid-wave",
- },
- {
- name: "Displacement",
- description: "Shear the frame into a grid of offset colour-fringed tiles and settle them back on the next scene",
- status: "stable",
- href: "/docs/transitions/displacement",
- },
+ "slide-swap",
+ "spring-settle",
]}
-/>
+>
## Scene Sequencers
Not presentations. Each of these takes the whole list of scenes and runs the timeline itself, so the boundary is a property of the film rather than something dropped between two sequences. Scenes never overlap and the stage is continuous, which is what makes a run of them read as one cut instead of a slideshow.
-<ComponentCardGrid
- items={[
- {
- name: "SlideSwapScenes",
- description: "Shove one scene off the canvas and spring the next in from the opposite edge",
- status: "stable",
- href: "/docs/transitions/slide-swap",
- },
- {
- name: "SpringSettleScenes",
- description: "Shrink a scene away as one group, hold the stage empty for a beat, then land the next from above",
- status: "stable",
- href: "/docs/transitions/spring-settle",
- },
- ]}
-/>
+</ComponentGroup>
+
+</CategoryIndex>
diff --git a/content/docs/typography/index.mdx b/content/docs/typography/index.mdx
index 66f6bfd6..ff0d7e28 100644
--- a/content/docs/typography/index.mdx
+++ b/content/docs/typography/index.mdx
@@ -3,308 +3,131 @@ title: Typography
description: Text effects, reveals, and kinetic type for Remotion
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+import { ComponentGroup } from "@/components/docs/index/category/component-group";
+
Every way text can move, fade, glitch, or stretch across the screen. From quiet word-by-word reveals to full-bleed marquees and RGB glitches.
+<CategoryIndex section="/docs/typography">
+
+<ComponentGroup
+ items={[
+ "inline-word-roll",
+ "shader-text-reveal",
+ "type-fossil",
+ "soft-blur-in",
+ "per-character-rise",
+ "bottom-up-letters",
+ "top-down-letters",
+ "spring-scale-in",
+ "micro-scale-fade",
+ "scale-down-fade",
+ "blur-out-up",
+ "focus-blur-resolve",
+ "line-by-line-slide",
+ "staggered-fade-up",
+ "mask-reveal-up",
+ "tracking-in",
+ ]}
+>
+
## Reveals
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "Inline Word Roll",
- description: "Roll words upward beside a fixed prefix, smoothly recentering as their widths change",
- status: "stable",
- href: "/docs/typography/inline-word-roll",
- },
- {
- name: "Shader Text Reveal",
- description: "The original OpenShaders hero material reveals words, then settles into white type",
- status: "stable",
- href: "/docs/typography/shader-text-reveal",
- },
- {
- name: "Type Fossil",
- description: "Readable revisions with fine contour layers that compress into one clean typographic imprint",
- status: "stable",
- href: "/docs/typography/type-fossil",
- },
- {
- name: "SoftBlurIn",
- description: "Per-character fade-in with a gentle blur and upward motion",
- status: "stable",
- href: "/docs/typography/soft-blur-in",
- },
- {
- name: "PerCharacterRise",
- description: "Letters slide up from below with no blur — crisp and kinetic",
- status: "stable",
- href: "/docs/typography/per-character-rise",
- },
- {
- name: "BottomUpLetters",
- description: "Letters rise from below in a pronounced staircase, one symbol at a time",
- status: "stable",
- href: "/docs/typography/bottom-up-letters",
- },
- {
- name: "TopDownLetters",
- description: "Letters descend from above in a pronounced staircase, one symbol at a time",
- status: "stable",
- href: "/docs/typography/top-down-letters",
- },
- {
- name: "SpringScaleIn",
- description: "Words pop in with a soft overshoot scale, like a spring settling",
- status: "stable",
- href: "/docs/typography/spring-scale-in",
- },
- {
- name: "MicroScaleFade",
- description: "A calm, tiny scale pop for subtle premium polish",
- status: "stable",
- href: "/docs/typography/micro-scale-fade",
- },
- {
- name: "ScaleDownFade",
- description: "Subtle premium settle-in with a restrained scale-down fade on exit",
- status: "stable",
- href: "/docs/typography/scale-down-fade",
- },
- {
- name: "BlurOutUp",
- description: "Words arrive clean and depart upward with increasing blur",
- status: "stable",
- href: "/docs/typography/blur-out-up",
- },
- {
- name: "FocusBlurResolve",
- description: "A premium focus pull from heavy blur to crisp text, then a soft blur-out exit",
- status: "stable",
- href: "/docs/typography/focus-blur-resolve",
- },
- {
- name: "LineByLineSlide",
- description: "Each line slides in from the left with a staggered flow",
- status: "stable",
- href: "/docs/typography/line-by-line-slide",
- },
- {
- name: "StaggeredFadeUp",
- description: "Words rise from below with a soft cascading delay",
- status: "stable",
- href: "/docs/typography/staggered-fade-up",
- },
- {
- name: "MaskRevealUp",
- description: "Lines reveal upward with a soft masked feel and compact stagger",
- status: "stable",
- href: "/docs/typography/mask-reveal-up",
- },
- {
- name: "TrackingIn",
- description: "Letter-spacing collapses from wide to normal with a spring snap",
- status: "stable",
- href: "/docs/typography/tracking-in",
- },
+ "inline-highlight",
+ "marker-highlight",
+ "shimmer-sweep",
]}
-/>
+>
## Highlights
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "InlineHighlight",
- description: "Animates one word inside a sentence from a base color to a brand color",
- status: "stable",
- href: "/docs/typography/inline-highlight",
- },
- {
- name: "MarkerHighlight",
- description: "Marker bar sweeps in behind a phrase, optionally inverting the text color",
- status: "stable",
- href: "/docs/typography/marker-highlight",
- },
- {
- name: "ShimmerSweep",
- description: "Bright gradient sweeps across dim text, lighting it up",
- status: "stable",
- href: "/docs/typography/shimmer-sweep",
- },
+ "typewriter",
+ "slot-machine-roll",
]}
-/>
+>
## Dynamic Text
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "Typewriter",
- description: "Character-by-character text reveal with a deterministic blinking cursor",
- status: "stable",
- href: "/docs/typography/typewriter",
- },
- {
- name: "SlotMachineRoll",
- description: "Numbers and characters roll into place like a casino reel",
- status: "stable",
- href: "/docs/typography/slot-machine-roll",
- },
+ "matrix-decode",
+ "rgb-glitch-text",
]}
-/>
+>
## Tech & Glitch
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "MatrixDecode",
- description: "Random characters scramble and resolve into the target string",
- status: "stable",
- href: "/docs/typography/matrix-decode",
- },
- {
- name: "RGBGlitchText",
- description: "Three-channel RGB split with a brief horizontal jitter",
- status: "stable",
- href: "/docs/typography/rgb-glitch-text",
- },
+ "per-word-crossfade",
+ "fade-through",
+ "shared-axis-y",
+ "shared-axis-z",
]}
-/>
+>
## Text Transitions
Swap one phrase for another with motion.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "PerWordCrossfade",
- description: "One phrase fades out as the next fades in, word by word",
- status: "stable",
- href: "/docs/typography/per-word-crossfade",
- },
- {
- name: "FadeThrough",
- description: "Old text fades out as new fades in, Material-style",
- status: "stable",
- href: "/docs/typography/fade-through",
- },
- {
- name: "SharedAxisY",
- description: "Per-word hard-cut staircase for sharp editorial swaps",
- status: "stable",
- href: "/docs/typography/shared-axis-y",
- },
- {
- name: "SharedAxisZ",
- description: "Scale-based depth transition for focus shifts",
- status: "stable",
- href: "/docs/typography/shared-axis-z",
- },
+ "short-slide-right",
+ "kinetic-center-build",
+ "short-slide-down",
]}
-/>
+>
## Kinetic
Word-by-word builds with motion and momentum.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "ShortSlideRight",
- description: "The whole phrase glides in from the left while words reveal in sequence",
- status: "stable",
- href: "/docs/typography/short-slide-right",
- },
- {
- name: "KineticCenterBuild",
- description: "Words enter from the right and push the line until the phrase locks centered",
- status: "stable",
- href: "/docs/typography/kinetic-center-build",
- },
- {
- name: "ShortSlideDown",
- description: "Words drop in from above and stack into a centered composition",
- status: "stable",
- href: "/docs/typography/short-slide-down",
- },
+ "selection-snap",
+ "echo-stack",
+ "type-wall",
+ "ring-text",
+ "period-drop",
]}
-/>
+>
## Showreel
Heavy display type that snaps, echoes and spins on flat color fields.
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "Selection Snap",
- description: "A thin word snaps into a design-tool selection while it goes from Thin to Black",
- status: "stable",
- href: "/docs/typography/selection-snap",
- },
- {
- name: "Echo Stack",
- description: "A word focuses in while outline copies drift above and below it",
- status: "stable",
- href: "/docs/typography/echo-stack",
- },
- {
- name: "Type Wall",
- description: "Rows of one word fill the frame in alternating directions and faces",
- status: "stable",
- href: "/docs/typography/type-wall",
- },
- {
- name: "Ring Text",
- description: "Text runs around a tilted 3D band that spins",
- status: "stable",
- href: "/docs/typography/ring-text",
- },
- {
- name: "Period Drop",
- description: "A dot falls, bounces with squash and stretch, and settles as the period",
- status: "stable",
- href: "/docs/typography/period-drop",
- },
+ "outline-trace",
+ "glyph-anatomy",
+ "stripe-type",
+ "path-ride",
+ "type-repeater",
]}
-/>
+>
## Vector type
Type built the way a motion designer builds it: trim paths on real glyph outlines, a font editor's points and handles, striped type, text on a path and a repeater.
-<ComponentCardGrid
- items={[
- {
- name: "Outline Trace",
- description: "Every glyph contour draws itself as a stroke, then the fill wipes up inside each letter",
- status: "stable",
- href: "/docs/typography/outline-trace",
- },
- {
- name: "Glyph Anatomy",
- description: "Anchors and Bézier handles pull straight segments into curves before the word fills",
- status: "stable",
- href: "/docs/typography/glyph-anatomy",
- },
- {
- name: "Stripe Type",
- description: "Horizontal bands slide in from alternating sides and lock into a striped word",
- status: "stable",
- href: "/docs/typography/stripe-type",
- },
- {
- name: "Path Ride",
- description: "Text rides a self-drawing curve, then the curve pulls taut into a straight line",
- status: "stable",
- href: "/docs/typography/path-ride",
- },
- {
- name: "Type Repeater",
- description: "Copies of a word unfold into a tunnel, a spiral or a fan, then fold back",
- status: "stable",
- href: "/docs/typography/type-repeater",
- },
- ]}
-/>
+</ComponentGroup>
+
+</CategoryIndex>
diff --git a/content/docs/ui-blocks/index.mdx b/content/docs/ui-blocks/index.mdx
index 16d7f668..1832abd0 100644
--- a/content/docs/ui-blocks/index.mdx
+++ b/content/docs/ui-blocks/index.mdx
@@ -3,67 +3,45 @@ title: UI Blocks
description: Pre-assembled interface elements like code editors, layouts, charts, and workflow visualizations
---
+import { CategoryIndex } from "@/components/docs/index/category/category-index";
+import { ComponentGroup } from "@/components/docs/index/category/component-group";
+
Larger blocks built from primitives, the actual surfaces your viewers will recognize: code windows, terminals, charts, dashboards, and workflow diagrams.
+<CategoryIndex section="/docs/ui-blocks">
+
+<ComponentGroup
+ items={[
+ "glass-code-block",
+ "code-morph",
+ "terminal-simulator",
+ "terminal-cursor-zoom",
+ ]}
+>
+
## Code & CLI
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "GlassCodeBlock",
- description: "Premium frosted-glass code window with rim light and traffic-light controls",
- status: "stable",
- href: "/docs/ui-blocks/glass-code-block",
- },
- {
- name: "CodeMorph",
- description: "Keynote-style Magic Move for code, with surviving tokens gliding to their new line and column",
- status: "stable",
- href: "/docs/ui-blocks/code-morph",
- },
- {
- name: "TerminalSimulator",
- description: "CLI build simulation with chunked log output and step-function scrolling",
- status: "stable",
- href: "/docs/ui-blocks/terminal-simulator",
- },
- {
- name: "TerminalCursorZoom",
- description: "Camera rides the typing cursor, dollying across a terminal as a command types at high zoom",
- status: "stable",
- href: "/docs/ui-blocks/terminal-cursor-zoom",
- },
+ "animated-line-chart",
+ "animated-bar-chart",
]}
-/>
+>
## Data & System
-<ComponentCardGrid
+</ComponentGroup>
+
+<ComponentGroup
items={[
- {
- name: "AnimatedLineChart",
- description: "SVG line chart drawn left-to-right via stroke-dashoffset",
- status: "stable",
- href: "/docs/ui-blocks/animated-line-chart",
- },
- {
- name: "AnimatedBarChart",
- description: "Bars spring up from the baseline with deterministic stagger",
- status: "stable",
- href: "/docs/ui-blocks/animated-bar-chart",
- },
+ "search-reveal",
]}
-/>
+>
## Product intros
-<ComponentCardGrid
- items={[
- {
- name: "SearchReveal",
- description: "Construction circles become a search field that types your product name over an abstract graphic reveal",
- status: "stable",
- href: "/docs/ui-blocks/search-reveal",
- },
- ]}
-/>
+</ComponentGroup>
+
+</CategoryIndex>
diff --git a/content/docs/ui/index.mdx b/content/docs/ui/index.mdx
index 300d91f7..73deb3cf 100644
--- a/content/docs/ui/index.mdx
+++ b/content/docs/ui/index.mdx
@@ -1,19 +1,75 @@
---
title: Introduction
-description: shadcn-style primitives scripted on the Remotion timeline
+description: Familiar shadcn components rebuilt for Remotion. You declare what state a component is in and when, and it renders that state as a pure function of the frame.
---
-The `ui` tier brings familiar shadcn components — Button, Input, Checkbox, Switch, Spinner — into Remotion video. Instead of responding to mouse events, their interactions are **scripted on the timeline**: you declare what state a component is in and when, and it renders that state as a deterministic pure function of `useCurrentFrame()`.
+import { AtomCard, AtomCards, AtomsSection } from "@/components/docs/index/primitives/atom-cards";
+import { InstallWrites } from "@/components/docs/index/primitives/install-writes";
+import { RuntimeRules } from "@/components/docs/index/primitives/runtime-rules";
+import { TimelineDemo } from "@/components/docs/index/primitives/timeline-demo";
+import { UiBlocks } from "@/components/docs/index/primitives/ui-blocks";
+import { UiComponents } from "@/components/docs/index/primitives/ui-components";
-No `useState`. No event handlers. No CSS transitions. Every pixel is a function of the current frame — which is exactly what Remotion's headless per-frame renderer requires.
+<TimelineDemo />
## What makes this different from regular shadcn
In a browser, a button enters its loading state because the user clicked. In a video, it enters that state because you authored `{ at: 35, state: "loading" }`. The component looks identical; the wiring is completely different.
-This also means you get things that are impossible in a real UI: scrub backward through a form fill, play a button click at half speed, or loop a checkbox toggle indefinitely — all without any special setup.
+This also means you get things that are impossible in a real UI: scrub backward through a form fill, play a button click at half speed, or loop a checkbox toggle indefinitely, all without any special setup.
-## Where to go next
+<RuntimeRules not={["useState", "onClick", "transition:"]} only="useCurrentFrame()" />
-- [Concepts](/docs/ui/concepts) — the mental model: two kinds of atom, timeline hooks, states, theming, and core exports.
-- [Installation](/docs/ui/installation) — add your first component to a Remotion project.
+<AtomsSection concepts="/docs/ui/concepts">
+
+## Two kinds of atom
+
+Every primitive is one of two shapes. Knowing which tells you where the frame is read and how timing reaches the component.
+
+</AtomsSection>
+
+<AtomCards>
+
+<AtomCard
+ title="State atoms"
+ meta="Snap or smooth"
+ code={`{ at: 12, state: "hover" }`}
+ items={["button", "input", "checkbox", "switch"]}
+>
+ Pure visual functions of state and theme. They never read the frame; the state comes from a prop, `useCurrentState`, or a transition hook like `useButtonTransition`.
+</AtomCard>
+
+<AtomCard
+ title="Motion atoms"
+ meta="Loop on the frame"
+ code="<Caret blink={!tw.typing} />"
+ items={["spinner", "caret", "typing-indicator"]}
+>
+ Loop on `useCurrentFrame()` with no discrete states. No `Date`, no `Math.random`, no `requestAnimationFrame`, so they stay safe in the headless renderer.
+</AtomCard>
+
+</AtomCards>
+
+## Install your first primitive
+
+Remotion must already be set up. The shared remocn-ui core installs automatically as a registry dependency, so you only name the component you want.
+
+<InstallBlock name="button" />
+
+<InstallWrites name="button" />
+
+<UiComponents featured={["cursor", "command-menu", "toast", "dialog", "switch", "slider", "tooltip", "typing-indicator"]}>
+
+## Components
+
+The pieces a product demo is made of: a cursor that clicks, a menu that opens, a toast that lands. Each one copies into `components/remocn/` with its transition hook.
+
+</UiComponents>
+
+<UiBlocks>
+
+## Blocks
+
+Complete, shippable scenes built from these primitives. Each block orchestrates the cursor, fields and feedback into one coherent story you can drop into a Sequence.
+
+</UiBlocks>
diff --git a/lib/analytics.ts b/lib/analytics.ts
index ef6f3939..066f0d47 100644
--- a/lib/analytics.ts
+++ b/lib/analytics.ts
@@ -27,6 +27,11 @@ type AnalyticsEvents = {
package_manager: "pnpm" | "npm" | "yarn" | "bun" | "prompt";
surface: "docs" | "landing" | "bento";
};
+ install_prompt_opened: {
+ component: string;
+ agent: "claude" | "chatgpt" | "cursor";
+ surface: "docs";
+ };
preview_played: {
component: string;
surface: PreviewSurface;
diff --git a/lib/blog.ts b/lib/blog.ts
index 24666798..9e3a18ac 100644
--- a/lib/blog.ts
+++ b/lib/blog.ts
@@ -1,10 +1,3 @@
-export const blogDateFormatter = new Intl.DateTimeFormat("en-US", {
- timeZone: "UTC",
- year: "numeric",
- month: "long",
- day: "numeric",
-});
-
export function blogSlug(post: { info: { path: string } }): string {
return post.info.path.replace(/\.mdx$/, "");
}
diff --git a/lib/customizer-config.ts b/lib/customizer-config.ts
index 994db7af..7c84cab9 100644
--- a/lib/customizer-config.ts
+++ b/lib/customizer-config.ts
@@ -71,6 +71,16 @@ export interface ComponentConfig {
*/
snippet?: (values: Record<string, unknown>) => string;
previewBackdrop?: BackdropFill;
+ /**
+ * How the component looks in the docs index cards (small light tiles, no
+ * backdrop). `props` override the defaults there, e.g. a scene background
+ * set to "transparent". Light colors meant for a dark `previewBackdrop`
+ * already turn to ink automatically (see `build-preview-manifest`); list a
+ * color here to keep it. `fit: false` keeps the full frame instead of
+ * zooming to the content. `backdrop: true` paints `previewBackdrop` behind
+ * it, for the few that can't read on a light tile (shader-drawn text).
+ */
+ card?: { props?: Record<string, unknown>; fit?: boolean; backdrop?: boolean };
}
/** `ComponentConfig` after `resolveConfig`: schema converted for the site UI. */
diff --git a/lib/docs-layout.ts b/lib/docs-layout.ts
new file mode 100644
index 00000000..24a08a99
--- /dev/null
+++ b/lib/docs-layout.ts
@@ -0,0 +1,35 @@
+import type { CSSProperties } from "react";
+import saved from "@/config/docs-layout.json";
+
+/**
+ * Sizes of the docs frame, in px. Tuned by eye in `/lab/docs-layout`, which
+ * saves them to `config/docs-layout.json`; the docs layout reads that file.
+ */
+export type DocsLayout = {
+ /** Max width of the whole docs frame (header, columns, footer). */
+ frame: number;
+ /** Side padding of the frame from `lg` up. */
+ gutter: number;
+ /** Left sidebar width. */
+ sidebar: number;
+ /** Right rail width (TOC, Studio card, sponsors), from `xl` up. */
+ rail: number;
+ /** Article side padding from `xl` up. */
+ articlePadding: number;
+ /** Max width of the article column; 0 lets it fill the space. */
+ articleMax: number;
+};
+
+export const DOCS_LAYOUT: DocsLayout = saved;
+
+/** The layout as the CSS variables the docs frame reads. */
+export function docsLayoutVars(layout: DocsLayout): CSSProperties {
+ return {
+ "--docs-frame": `${layout.frame}px`,
+ "--docs-gutter": `${layout.gutter}px`,
+ "--docs-sidebar": `${layout.sidebar}px`,
+ "--docs-rail": `${layout.rail}px`,
+ "--docs-article-pad": `${layout.articlePadding}px`,
+ "--docs-article-max": layout.articleMax ? `${layout.articleMax}px` : "none",
+ } as CSSProperties;
+}
diff --git a/lib/docs-tabs.ts b/lib/docs-tabs.ts
index 21106b80..5db38357 100644
--- a/lib/docs-tabs.ts
+++ b/lib/docs-tabs.ts
@@ -1,7 +1,8 @@
import type { Node, Root } from "fumadocs-core/page-tree";
/**
- * The docs are split into top-level category tabs surfaced in `DocsHeader`.
+ * The docs are split into top-level libraries, switched from the sidebar's
+ * library switcher.
* Each tab owns its own sidebar tree (see {@link splitDocsTree}); the split is
* purely a view over the existing Fumadocs page tree.
*/
@@ -46,7 +47,7 @@ export const DOCS_TABS: DocsTab[] = [
{
id: "templates",
label: "Templates",
- href: "/docs/templates/launch-anything",
+ href: "/docs/templates",
},
{
id: "icons",
@@ -171,15 +172,11 @@ function hoistPrimitives(nodes: Node[]): Node[] {
* Splits the Fumadocs page tree into category tab trees. Immutable — the source
* `Root` (shared across requests) is never mutated; each branch is a shallow
* copy with a filtered `children` list, so order is preserved within each tab.
- * Compose after {@link withNewBadges} so the badge decoration survives the split.
+ * The docs layout turns each branch into a sidebar model, and the docs page
+ * uses the branch for its breadcrumb and prev/next.
*
- * Each branch gets a DISTINCT, stable `$id`. This is load-bearing: fumadocs'
- * `TreeContextProvider` memoizes the active tree with
- * `useMemo(() => rawTree, [rawTree.$id ?? rawTree])`. The source root's `$id` is
- * the literal "root", so two plain shallow copies would share it — the memo dep
- * would never change when `DocsShell` swaps trees on a tab switch, freezing the
- * sidebar on the first tab until a full page reload. Distinct ids make the dep
- * differ per tab so the sidebar updates client-side.
+ * Each branch gets a distinct, stable `$id` (`docs-tab-<id>`), so anything
+ * keyed on the tree id treats the libraries as different trees.
*
* The Primitives branch is additionally hoisted (see {@link hoistPrimitives}) so
* the remocn-ui pages render at the sidebar root without a wrapping "UI" label.
diff --git a/lib/header-layout.ts b/lib/header-layout.ts
new file mode 100644
index 00000000..037dc044
--- /dev/null
+++ b/lib/header-layout.ts
@@ -0,0 +1,43 @@
+import type { CSSProperties } from "react";
+import saved from "@/config/header-layout.json";
+
+/**
+ * Desktop (`lg`+) header sizes, in px. Tuned by eye in `/lab/header-layout`,
+ * which saves them to `config/header-layout.json`; `SiteHeader` reads that file.
+ */
+export type HeaderLayout = {
+ /** Height of both capsules. */
+ height: number;
+ /** Height of the items inside (nav links, GitHub, health, Get started). */
+ itemHeight: number;
+ /** Capsule corner radius. */
+ radius: number;
+ /** Item and hover-pill corner radius. */
+ itemRadius: number;
+ /** Space above the capsules. */
+ top: number;
+ /** Side padding of a nav link; the right capsule's items add 1px / 5px. */
+ itemPadding: number;
+ /** Item font size. */
+ text: number;
+ /** Wordmark font size (the mark scales with it). */
+ wordmark: number;
+};
+
+export const HEADER_LAYOUT: HeaderLayout = saved;
+
+/** The layout as the CSS variables the header reads. */
+export function headerLayoutVars(layout: HeaderLayout): CSSProperties {
+ const item = Math.min(layout.itemHeight, layout.height - 4);
+ return {
+ "--hdr-h": `${layout.height}px`,
+ "--hdr-item-h": `${item}px`,
+ "--hdr-inset": `${(layout.height - item) / 2}px`,
+ "--hdr-r": `${layout.radius}px`,
+ "--hdr-item-r": `${layout.itemRadius}px`,
+ "--hdr-top": `${layout.top}px`,
+ "--hdr-pad": `${layout.itemPadding}px`,
+ "--hdr-text": `${layout.text}px`,
+ "--hdr-wordmark": `${layout.wordmark}px`,
+ } as CSSProperties;
+}
diff --git a/lib/layout.shared.tsx b/lib/layout.shared.tsx
deleted file mode 100644
index b4cf7388..00000000
--- a/lib/layout.shared.tsx
+++ /dev/null
@@ -1,14 +0,0 @@
-import type { BaseLayoutProps } from "fumadocs-ui/layouts/shared";
-
-// The custom `SiteHeader` (mounted in `app/docs/layout.tsx`) owns the only top
-// bar, and `DocsLayout` is passed `nav={{ enabled: false }}`. So this no longer
-// supplies a Fumadocs `nav.title` / `links` / `githubUrl` — doing so would only
-// feed a second, suppressed header. Theme + i18n remain Fumadocs' job via
-// `RootProvider`, untouched here.
-export function baseOptions(): BaseLayoutProps {
- return {
- nav: {
- enabled: false,
- },
- };
-}
diff --git a/lib/mdx-to-markdown.test.ts b/lib/mdx-to-markdown.test.ts
new file mode 100644
index 00000000..59a47a14
--- /dev/null
+++ b/lib/mdx-to-markdown.test.ts
@@ -0,0 +1,51 @@
+import { describe, expect, test } from "bun:test";
+import { mdxToMarkdown } from "./mdx-to-markdown";
+
+const SITE = "https://remocn.dev";
+
+describe("mdxToMarkdown", () => {
+ test("drops the page's own component imports", () => {
+ const src = [
+ 'import { GuidePrompt } from "@/components/docs/guides/prompt-block";',
+ "import {",
+ " GuideNotes,",
+ " GuideMoreLink,",
+ '} from "@/components/docs/guides/director-notes";',
+ "",
+ "Text.",
+ ].join("\n");
+ expect(mdxToMarkdown(src, SITE).trim()).toBe("Text.");
+ });
+
+ test("keeps imports inside code fences", () => {
+ const src = [
+ "```tsx",
+ 'import { AbsoluteFill } from "remotion";',
+ "```",
+ ].join("\n");
+ expect(mdxToMarkdown(src, SITE)).toBe(src);
+ });
+
+ test("unwraps unknown components and keeps their markdown", () => {
+ const src = [
+ '<GuideNote title="Keep it short">',
+ "",
+ "One idea per **beat**.",
+ "",
+ "</GuideNote>",
+ ].join("\n");
+ expect(mdxToMarkdown(src, SITE)).toBe(
+ "**Keep it short**\n\nOne idea per **beat**.",
+ );
+ });
+
+ test("drops self-closing unknown components", () => {
+ const src = "Before\n\n<GuideCount value={3} />\n\nAfter";
+ expect(mdxToMarkdown(src, SITE)).toBe("Before\n\nAfter");
+ });
+
+ test("leaves placeholders that are not components alone", () => {
+ const src = "Swap <PRODUCT> for your name.";
+ expect(mdxToMarkdown(src, SITE)).toBe(src);
+ });
+});
diff --git a/lib/mdx-to-markdown.ts b/lib/mdx-to-markdown.ts
index e06a7a2e..1a338d27 100644
--- a/lib/mdx-to-markdown.ts
+++ b/lib/mdx-to-markdown.ts
@@ -225,6 +225,26 @@ function findClosingTag(src: string, tag: string, from: number): number {
return -1;
}
+/**
+ * Length of an MDX `import` statement starting at `start` (the page's own
+ * component imports; never inside code fences, which are copied verbatim).
+ */
+function importLength(src: string, start: number): number {
+ const statement = /^import\s[\s\S]*?\sfrom\s+["'][^"']+["'];?[ \t]*\n?/.exec(
+ src.slice(start),
+ );
+ return statement ? statement[0].length : 0;
+}
+
+/** After a dropped widget, don't leave a second blank line behind. */
+function skipBlankAfterDrop(src: string, i: number, out: string): number {
+ let next = i;
+ if (out.endsWith("\n\n") || out === "") {
+ while (src[next] === "\n") next += 1;
+ }
+ return next;
+}
+
export function stripFrontmatter(src: string): string {
if (!src.startsWith("---")) return src;
const end = src.indexOf("\n---", 3);
@@ -259,6 +279,12 @@ export function mdxToMarkdown(src: string, siteUrl: string): string {
i = blockEnd;
continue;
}
+
+ const imported = importLength(src, i);
+ if (imported) {
+ i += imported;
+ continue;
+ }
}
if (src[i] === "<") {
@@ -293,7 +319,7 @@ export function mdxToMarkdown(src: string, siteUrl: string): string {
if (DROPPED_WIDGETS.has(tag)) {
i = tagEnd.end;
- while (src[i] === "\n" && src[i + 1] === "\n") i += 1;
+ i = skipBlankAfterDrop(src, i, out);
continue;
}
@@ -324,6 +350,35 @@ export function mdxToMarkdown(src: string, siteUrl: string): string {
continue;
}
}
+
+ // Any other component (guide and index blocks): its markdown children
+ // are the content, so keep those and drop the tags. A string `title`
+ // is kept as a bold line; self-closing ones are visual only.
+ if (tag) {
+ const tagEnd = findTagEnd(src, i + 1 + tag.length);
+ if (tagEnd?.selfClosing) {
+ i = tagEnd.end;
+ i = skipBlankAfterDrop(src, i, out);
+ continue;
+ }
+ if (tagEnd) {
+ const closeIndex = findClosingTag(src, tag, tagEnd.end);
+ if (closeIndex !== -1) {
+ const attrs = parseAttrs(
+ src.slice(i + 1 + tag.length, tagEnd.end - 1),
+ );
+ const inner = mdxToMarkdown(
+ src.slice(tagEnd.end, closeIndex),
+ siteUrl,
+ ).trim();
+ const title =
+ typeof attrs.title === "string" ? `**${attrs.title}**\n\n` : "";
+ out += `${title}${inner}`;
+ i = closeIndex + `</${tag}>`.length;
+ continue;
+ }
+ }
+ }
}
out += src[i];
diff --git a/lib/registry-health.ts b/lib/registry-health.ts
new file mode 100644
index 00000000..834e8cd6
--- /dev/null
+++ b/lib/registry-health.ts
@@ -0,0 +1,139 @@
+import { z } from "zod";
+
+/**
+ * Registry health from the official shadcn directory. ui.shadcn.com checks
+ * every listed registry (index hourly, items daily, CLI dry-run weekly) and
+ * publishes the result in `registries.json`. Scoring:
+ * https://ui.shadcn.com/docs/registry/health
+ */
+const REGISTRIES_URL = "https://ui.shadcn.com/r/registries.json";
+const REGISTRY_NAME = "@remocn";
+
+export const REGISTRY_HEALTH_DOCS_URL =
+ "https://ui.shadcn.com/docs/registry/health";
+
+// Checks run hourly; anything older means the data stopped updating (on their
+// side, or our fetch keeps failing and serving a stale cache), so hide it.
+const MAX_AGE_MS = 3 * 24 * 60 * 60 * 1000;
+
+const healthSchema = z.object({
+ // The breakdown maximums below only hold for score version 1; any other
+ // version fails parsing and the badge is hidden rather than misreported.
+ scoreVersion: z.literal(1),
+ status: z.enum(["observing", "healthy", "degraded", "unavailable"]),
+ statusReason: z.object({ message: z.string() }),
+ score: z.number(),
+ breakdown: z.object({
+ reliability: z.number(),
+ correctness: z.number(),
+ installability: z.number(),
+ hygiene: z.number(),
+ }),
+ checkedAt: z.iso.datetime(),
+});
+
+const registriesSchema = z.array(
+ z.object({ name: z.string(), health: z.unknown().optional() }),
+);
+
+export type RegistryHealthStatus = z.infer<typeof healthSchema>["status"];
+
+export type RegistryHealthCheck = {
+ label: string;
+ score: number;
+ max: number;
+};
+
+export type RegistryHealth = {
+ status: RegistryHealthStatus;
+ /** Total out of 100. */
+ score: number;
+ /** Human sentence from the checker, e.g. "Recent checks are within…". */
+ summary: string;
+ /** ISO timestamp of the last check. */
+ checkedAt: string;
+ checks: RegistryHealthCheck[];
+};
+
+const BREAKDOWN: {
+ key: keyof z.infer<typeof healthSchema>["breakdown"];
+ label: string;
+ max: number;
+}[] = [
+ { key: "reliability", label: "Reliability", max: 45 },
+ { key: "correctness", label: "Correctness", max: 25 },
+ { key: "installability", label: "Installability", max: 20 },
+ { key: "hygiene", label: "Setup", max: 10 },
+];
+
+/** Latest health of the remocn registry, or null when unknown or stale. */
+export async function getRegistryHealth(): Promise<RegistryHealth | null> {
+ try {
+ const res = await fetch(REGISTRIES_URL, { next: { revalidate: 3600 } });
+ if (!res.ok) return null;
+
+ const registries = registriesSchema.parse(await res.json());
+ const entry = registries.find((item) => item.name === REGISTRY_NAME);
+ const health = healthSchema.safeParse(entry?.health).data;
+ if (!health) return null;
+
+ if (Date.now() - new Date(health.checkedAt).getTime() > MAX_AGE_MS) {
+ return null;
+ }
+
+ return {
+ status: health.status,
+ score: health.score,
+ summary: health.statusReason.message,
+ checkedAt: health.checkedAt,
+ checks: BREAKDOWN.map(({ key, label, max }) => ({
+ label,
+ score: health.breakdown[key],
+ max,
+ })),
+ };
+ } catch {
+ return null;
+ }
+}
+
+export const REGISTRY_HEALTH_STATUS_LABEL: Record<
+ RegistryHealthStatus,
+ string
+> = {
+ observing: "Observing",
+ healthy: "Healthy",
+ degraded: "Degraded",
+ unavailable: "Unavailable",
+};
+
+const POINTS = new Intl.NumberFormat("en-US", { maximumFractionDigits: 1 });
+
+/** 98.931 → "98.9", 10 → "10". */
+export function formatHealthPoints(value: number): string {
+ return POINTS.format(value);
+}
+
+const MONTHS = [
+ "Jan",
+ "Feb",
+ "Mar",
+ "Apr",
+ "May",
+ "Jun",
+ "Jul",
+ "Aug",
+ "Sep",
+ "Oct",
+ "Nov",
+ "Dec",
+];
+
+/** "23 Oct, 14:32 UTC" — formatted by hand so server and client agree. */
+export function formatHealthCheckedAt(iso: string): string {
+ const date = new Date(iso);
+ const pad = (value: number) => String(value).padStart(2, "0");
+ return `${date.getUTCDate()} ${MONTHS[date.getUTCMonth()]}, ${pad(
+ date.getUTCHours(),
+ )}:${pad(date.getUTCMinutes())} UTC`;
+}
diff --git a/lib/sponsor-traffic.ts b/lib/sponsor-traffic.ts
new file mode 100644
index 00000000..a499c2cf
--- /dev/null
+++ b/lib/sponsor-traffic.ts
@@ -0,0 +1,198 @@
+import { z } from "zod";
+
+/**
+ * Live traffic for the sponsors page, read from our self-hosted OpenPanel
+ * (Insights + Export API) with the same client as server-side tracking
+ * (`NEXT_PUBLIC_OPENPANEL_CLIENT_ID` + `OPENPANEL_CLIENT_SECRET`, see
+ * `lib/server/analytics.ts`). The client needs read access.
+ *
+ * Responses are cached for an hour. When the keys are missing or a request
+ * fails, `getSponsorTraffic()` returns null and the section isn't rendered.
+ */
+
+const API_URL = (
+ process.env.NEXT_PUBLIC_OPENPANEL_API_URL ?? "https://api.openpanel.dev"
+).replace(/\/$/, "");
+
+export const OPENPANEL_DASHBOARD_URL =
+ process.env.OPENPANEL_PUBLIC_DASHBOARD_URL;
+
+const PROJECT_ID = "remocn";
+const RANGE = "30d";
+const REVALIDATE_SECONDS = 3600;
+
+const zMetrics = z.object({
+ metrics: z.object({
+ unique_visitors: z.number(),
+ total_sessions: z.number(),
+ total_screen_views: z.number(),
+ avg_session_duration: z.number(),
+ views_per_session: z.number(),
+ }),
+ series: z.array(z.object({ date: z.string(), unique_visitors: z.number() })),
+});
+
+const zTop = z.array(
+ z.object({
+ // null = no referrer (direct visit)
+ name: z.string().nullable(),
+ prefix: z.string().nullish(),
+ sessions: z.number(),
+ }),
+);
+
+const zEventCount = z.object({
+ meta: z.object({ totalCount: z.number() }),
+});
+
+export type TrafficRow = { name: string; sessions: number };
+
+export type SponsorTraffic = {
+ /** True for the dev-only layout sample (no OpenPanel keys locally). */
+ sample?: boolean;
+ range: { start: string; end: string };
+ uniqueVisitors: number;
+ pageviews: number;
+ sessions: number;
+ /** Seconds. */
+ avgSessionDuration: number;
+ viewsPerSession: number;
+ /** Unique visitors per day. */
+ series: { date: string; visitors: number }[];
+ referrers: TrafficRow[];
+ countries: TrafficRow[];
+ devices: TrafficRow[];
+ /** All-time `registry_install` events (`npx shadcn add @remocn/…`). */
+ registryInstalls: number;
+};
+
+async function get<T>(path: string, schema: z.ZodType<T>): Promise<T> {
+ const res = await fetch(`${API_URL}${path}`, {
+ headers: {
+ "openpanel-client-id": process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID ?? "",
+ "openpanel-client-secret": process.env.OPENPANEL_CLIENT_SECRET ?? "",
+ },
+ next: { revalidate: REVALIDATE_SECONDS },
+ });
+ if (!res.ok) throw new Error(`OpenPanel ${path}: ${res.status}`);
+ return schema.parse(await res.json());
+}
+
+const toRows = (rows: z.infer<typeof zTop>, limit: number): TrafficRow[] =>
+ rows
+ .slice(0, limit)
+ .map(({ name, sessions }) => ({ name: name || "Direct", sessions }));
+
+// "https://l.chatplace.io" → "l.chatplace.io", "Twitter" → "X (Twitter)";
+// local dev sessions are dropped.
+function toReferrerRows(rows: z.infer<typeof zTop>, limit: number) {
+ return toRows(
+ rows
+ .map((row) => ({
+ ...row,
+ name:
+ row.name?.replace(/^https?:\/\//, "").replace(/^www\./, "") ?? null,
+ }))
+ .filter((row) => !row.name?.match(/^(localhost|127\.0\.0\.1)(:|$)/))
+ .map((row) =>
+ row.name === "Twitter" ? { ...row, name: "X (Twitter)" } : row,
+ ),
+ limit,
+ );
+}
+
+export async function getSponsorTraffic(): Promise<SponsorTraffic | null> {
+ if (
+ !process.env.NEXT_PUBLIC_OPENPANEL_CLIENT_ID ||
+ !process.env.OPENPANEL_CLIENT_SECRET
+ ) {
+ return null;
+ }
+
+ const insights = (column: string) =>
+ `/insights/${PROJECT_ID}/${column}?range=${RANGE}`;
+
+ try {
+ const [metrics, referrers, countries, devices, installs] =
+ await Promise.all([
+ get(insights("metrics"), zMetrics),
+ get(insights("referrer_name"), zTop),
+ get(insights("country"), zTop),
+ get(insights("device"), zTop),
+ get(
+ `/export/events?projectId=${PROJECT_ID}&event=registry_install&limit=1`,
+ zEventCount,
+ ),
+ ]);
+
+ const series = metrics.series.map((point) => ({
+ date: point.date,
+ visitors: point.unique_visitors,
+ }));
+
+ return {
+ range: {
+ start: series[0]?.date ?? "",
+ end: series.at(-1)?.date ?? "",
+ },
+ uniqueVisitors: metrics.metrics.unique_visitors,
+ pageviews: metrics.metrics.total_screen_views,
+ sessions: metrics.metrics.total_sessions,
+ avgSessionDuration: metrics.metrics.avg_session_duration,
+ viewsPerSession: metrics.metrics.views_per_session,
+ series,
+ referrers: toReferrerRows(referrers, 6),
+ countries: toRows(countries, 6),
+ devices: toRows(devices, 3),
+ registryInstalls: installs.meta.totalCount,
+ };
+ } catch {
+ return null;
+ }
+}
+
+// Numbers from the Paper design, so the section can be built and reviewed in
+// local dev without OpenPanel read keys. Never used in production.
+const DEV_SAMPLE: SponsorTraffic = {
+ sample: true,
+ range: { start: "2026-09-24", end: "2026-10-23" },
+ uniqueVisitors: 8762,
+ pageviews: 107927,
+ sessions: 9755,
+ avgSessionDuration: 475,
+ viewsPerSession: 11,
+ series: Array.from({ length: 30 }, (_, i) => {
+ const date = new Date(Date.UTC(2026, 8, 24 + i)).toISOString().slice(0, 10);
+ const wave = 230 + 70 * Math.sin(i * 0.9) + 40 * Math.sin(i * 2.3);
+ return { date, visitors: Math.round(i === 22 ? 614 : wave) };
+ }),
+ referrers: [
+ { name: "Direct", sessions: 5789 },
+ { name: "X (Twitter)", sessions: 1184 },
+ { name: "Google", sessions: 1153 },
+ { name: "ui.shadcn.com", sessions: 598 },
+ { name: "lchatplace.io", sessions: 177 },
+ { name: "toolfolio.com", sessions: 95 },
+ ],
+ countries: [
+ { name: "US", sessions: 1450 },
+ { name: "IN", sessions: 1037 },
+ { name: "SG", sessions: 734 },
+ { name: "BR", sessions: 563 },
+ { name: "JP", sessions: 441 },
+ { name: "FR", sessions: 414 },
+ ],
+ devices: [
+ { name: "desktop", sessions: 7942 },
+ { name: "mobile", sessions: 1789 },
+ { name: "tablet", sessions: 24 },
+ ],
+ registryInstalls: 162650,
+};
+
+/** Live data, or the design sample in local dev when keys are missing. */
+export async function getSponsorTrafficForPage(): Promise<SponsorTraffic | null> {
+ const live = await getSponsorTraffic();
+ if (live) return live;
+ return process.env.NODE_ENV === "development" ? DEV_SAMPLE : null;
+}
diff --git a/lib/studio-bar.ts b/lib/studio-bar.ts
deleted file mode 100644
index 1ed27396..00000000
--- a/lib/studio-bar.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-export const STUDIO_BAR_STORAGE_KEY = "remocn-studio-bar";
-
-export const STUDIO_BAR_SCRIPT = `try{if(localStorage.getItem("${STUDIO_BAR_STORAGE_KEY}")==="dismissed")document.documentElement.dataset.studioBar="dismissed"}catch(e){}`;
diff --git a/lib/ui-preview-internals.tsx b/lib/ui-preview-internals.tsx
index 76e77b90..16e94704 100644
--- a/lib/ui-preview-internals.tsx
+++ b/lib/ui-preview-internals.tsx
@@ -15,15 +15,6 @@ import { cn } from "@/lib/utils";
import type { BackdropFill } from "@/registry/remocn/backdrop";
import { Backdrop } from "@/registry/remocn/backdrop";
-/**
- * Shared internals for the docs preview widgets. Extracted verbatim from
- * `components/docs/component-preview.tsx` so both the original `ComponentPreview`
- * (animation tier) and the `UiComponentPreview` (ui tier) consume one
- * implementation — no copy-paste drift on the shared path.
- *
- * `getDefaults` already lives in `lib/customizer-config.ts`; reuse it from there.
- */
-
/**
* Build nuqs parsers + URL keys from a control config. Each control becomes a
* URL-synced query param prefixed with the component name (dashes → underscores)
@@ -55,15 +46,10 @@ export function buildParsers(name: string, controls: ControlConfig) {
}
/**
- * D2 — lazy-mount the Remotion player. Until the stage enters the viewport
- * (IntersectionObserver) or the user clicks the poster, render a labeled
- * poster button that exactly matches the Suspense fallback dimensions, so the
- * live Player swaps in with zero layout shift.
- *
- * Timing fields are passed flat (durationInFrames/fps/compositionWidth/
- * compositionHeight) so the caller can source them from either the registry
- * config (animation tier) or the example entry (ui tier — D2: example owns
- * timing).
+ * Lazy-mounted Remotion player with its own controls, for the changelog and
+ * the embed route (the docs pages use `components/docs/blocks/player`). Until
+ * the stage nears the viewport or the poster is clicked, a labeled poster
+ * button holds the same 16:9 box, so the Player swaps in without a shift.
*/
export function PreviewStage({
name,
@@ -117,7 +103,7 @@ export function PreviewStage({
// it shows the "playing" UI but the frame loop never starts — the preview
// looks frozen until a manual pause/play. Instead the Player mounts paused and
// we drive play() via the ref on the next animation frame, retrying once if
- // the first call didn't take. Mirrors stars/hooks/use-player-controls.ts.
+ // the first call didn't take.
useEffect(() => {
if (!mounted || reducedMotion) return;
let raf1 = 0;
@@ -136,9 +122,11 @@ export function PreviewStage({
};
}, [mounted, reducedMotion]);
+ // Pause while off screen (a reduced-motion reader may still press play),
+ // resume only what this observer paused.
const pausedByStage = useRef(false);
useEffect(() => {
- if (!mounted || reducedMotion) return;
+ if (!mounted) return;
const el = frameRef.current;
if (!el || typeof IntersectionObserver === "undefined") return;
const observer = new IntersectionObserver(
@@ -160,7 +148,7 @@ export function PreviewStage({
);
observer.observe(el);
return () => observer.disconnect();
- }, [mounted, reducedMotion]);
+ }, [mounted]);
const compProps = useMemo<
// biome-ignore lint/suspicious/noExplicitAny: dynamically-loaded Remotion composition, props shape varies per component
@@ -201,12 +189,7 @@ export function PreviewStage({
)}
>
{mounted ? (
- <div
- className={cn(
- "size-full",
- !reducedMotion && "animate-in fade-in duration-300 ease-out",
- )}
- >
+ <div className="size-full animate-in fade-in duration-200 ease-[ease]">
<Player
ref={playerRef}
{...compProps}
@@ -218,6 +201,9 @@ export function PreviewStage({
style={{ width: "100%", height: "100%" }}
controls
loop
+ // Browsers block autoplay with sound; the controls' volume
+ // button turns it back on.
+ initiallyMuted
acknowledgeRemotionLicense
/>
</div>
diff --git a/lib/utils.ts b/lib/utils.ts
index 365058ce..2092c141 100644
--- a/lib/utils.ts
+++ b/lib/utils.ts
@@ -1,5 +1,40 @@
import { type ClassValue, clsx } from "clsx";
-import { twMerge } from "tailwind-merge";
+import { extendTailwindMerge } from "tailwind-merge";
+
+// Teach tailwind-merge the design-system scales from app/globals.css. Without
+// this, `text-ui` / `text-h2` look like text colours and get merged away
+// against `text-white`, and custom radii/tracking aren't deduped.
+const twMerge = extendTailwindMerge({
+ extend: {
+ theme: {
+ text: [
+ "micro",
+ "mono",
+ "caption",
+ "small",
+ "ui",
+ "button-lg",
+ "lead",
+ "quote",
+ "h3",
+ "h2",
+ "display",
+ ],
+ radius: [
+ "tag",
+ "tile",
+ "control-sm",
+ "control",
+ "cta",
+ "capsule",
+ "card",
+ "panel",
+ "shell",
+ ],
+ tracking: ["display", "heading", "title"],
+ },
+ },
+});
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs));
diff --git a/lib/video-duration.ts b/lib/video-duration.ts
new file mode 100644
index 00000000..9bbfad12
--- /dev/null
+++ b/lib/video-duration.ts
@@ -0,0 +1,101 @@
+const HEAD_BYTES = 64 * 1024;
+const REVALIDATE_SECONDS = 60 * 60 * 24;
+
+/**
+ * Duration in seconds of a remote MP4, read from its `mvhd` box with Range
+ * requests (cached): the head of the file, then, when `moov` sits after the
+ * media data, the byte range where the next top-level box starts. `null` when
+ * a request fails or the box can't be found.
+ */
+export function getVideoDuration(url: string): Promise<number | null> {
+ const hit = memo.get(url);
+ if (hit && Date.now() - hit.at < REVALIDATE_SECONDS * 1000) return hit.value;
+ const value = readDuration(url);
+ memo.set(url, { value, at: Date.now() });
+ // A failed read is retried on the next render rather than kept.
+ void value.then((seconds) => {
+ if (seconds === null) memo.delete(url);
+ });
+ return value;
+}
+
+/**
+ * Durations per URL for the life of the server process (Range responses
+ * aren't reliably kept by the fetch cache), refreshed daily.
+ */
+const memo = new Map<string, { value: Promise<number | null>; at: number }>();
+
+async function readDuration(url: string): Promise<number | null> {
+ try {
+ let start = 0;
+ for (let hop = 0; hop < MAX_HOPS; hop++) {
+ const view = await fetchRange(url, start);
+ if (!view) return null;
+ const result = scanBoxes(view);
+ if (typeof result === "number") return result;
+ if (result === null) return null;
+ start += result.next;
+ }
+ } catch {
+ return null;
+ }
+ return null;
+}
+
+const MAX_HOPS = 4;
+
+async function fetchRange(url: string, start: number) {
+ const res = await fetch(url, {
+ headers: { Range: `bytes=${start}-${start + HEAD_BYTES - 1}` },
+ next: { revalidate: REVALIDATE_SECONDS },
+ });
+ if (!res.ok) return null;
+ return new DataView(await res.arrayBuffer());
+}
+
+function boxType(view: DataView, offset: number) {
+ return String.fromCharCode(
+ view.getUint8(offset),
+ view.getUint8(offset + 1),
+ view.getUint8(offset + 2),
+ view.getUint8(offset + 3),
+ );
+}
+
+/**
+ * Walks top-level boxes from the start of `view`: the duration when `moov` is
+ * inside, `{ next }` (offset of the first box past the buffer) to fetch more,
+ * or `null` when the data isn't a box stream.
+ */
+function scanBoxes(view: DataView): number | { next: number } | null {
+ let offset = 0;
+ while (offset + 8 <= view.byteLength) {
+ const size = view.getUint32(offset);
+ const type = boxType(view, offset + 4);
+ if (type === "moov") return readMvhd(view, offset + 8);
+ if (size < 8) return null;
+ offset += size;
+ }
+ return offset > 0 ? { next: offset } : null;
+}
+
+function readMvhd(view: DataView, mvhd: number): number | null {
+ if (mvhd + 40 > view.byteLength || boxType(view, mvhd + 4) !== "mvhd") {
+ return null;
+ }
+ const version = view.getUint8(mvhd + 8);
+ const timescale =
+ version === 1 ? view.getUint32(mvhd + 28) : view.getUint32(mvhd + 20);
+ const duration =
+ version === 1
+ ? Number(view.getBigUint64(mvhd + 32))
+ : view.getUint32(mvhd + 24);
+ return timescale > 0 ? duration / timescale : null;
+}
+
+/** 34.2 → "0:34", 458 → "7:38". */
+export function formatDuration(seconds: number): string {
+ const total = Math.max(0, Math.round(seconds));
+ const minutes = Math.floor(total / 60);
+ return `${minutes}:${String(total % 60).padStart(2, "0")}`;
+}
diff --git a/lib/with-new-badges.tsx b/lib/with-new-badges.tsx
deleted file mode 100644
index 2ec3cac4..00000000
--- a/lib/with-new-badges.tsx
+++ /dev/null
@@ -1,47 +0,0 @@
-import type { Item, Node, Root } from "fumadocs-core/page-tree";
-import { NewBadge } from "@/components/docs/new-badge";
-import { NEW_BADGE_PATHS } from "@/config/site";
-
-/**
- * Returns a copy of the Fumadocs page tree with an animated {@link NewBadge}
- * appended to the label of every sidebar item whose `url` is listed in
- * {@link NEW_BADGE_PATHS}. The Fumadocs sidebar renders an item's `name`
- * (a `ReactNode`) verbatim, so wrapping it as `<>{name} <NewBadge/></>` is all
- * that's needed to surface the badge in the rail.
- *
- * The walk is immutable — `source.pageTree` is built once and shared across
- * requests, so mutating it in place would let badges accumulate on the same
- * node across renders. Every touched node is shallow-cloned instead.
- */
-export function withNewBadges(tree: Root): Root {
- return { ...tree, children: tree.children.map(decorate) };
-}
-
-function decorate(node: Node): Node {
- if (node.type === "page") return decorateItem(node);
- if (node.type === "folder") {
- return {
- ...node,
- // `folder.index` is the folder's own landing page — decorate it too so a
- // badged folder index doesn't lose its tag, then recurse the children.
- index: node.index ? decorateItem(node.index) : node.index,
- children: node.children.map(decorate),
- };
- }
- return node;
-}
-
-/** Append the badge to a page item's label when its url is opted in. */
-function decorateItem(item: Item): Item {
- return NEW_BADGE_PATHS.has(item.url)
- ? {
- ...item,
- name: (
- <>
- {item.name}
- <NewBadge />
- </>
- ),
- }
- : item;
-}
diff --git a/mdx-components.tsx b/mdx-components.tsx
index c4b51dc6..86453bb9 100644
--- a/mdx-components.tsx
+++ b/mdx-components.tsx
@@ -1,15 +1,15 @@
import defaultMdxComponents from "fumadocs-ui/mdx";
import type { MDXComponents } from "mdx/types";
-import type { ComponentProps } from "react";
+import { type ComponentProps, isValidElement } from "react";
import { BlockPreview } from "@/components/docs/block-preview";
+import { CODE_PRE, CodeFrame } from "@/components/docs/blocks/code-frame";
+import { BLOCK_SPACING } from "@/components/docs/blocks/spacing";
import { Note, Warning } from "@/components/docs/callout";
import { CanvasFilterNote } from "@/components/docs/canvas-filter-note";
import { CanvasTransitionNote } from "@/components/docs/canvas-transition-note";
-import { getIconForLanguage } from "@/components/docs/code-icons";
import { ComponentCardGrid } from "@/components/docs/component-card-grid";
import { ComponentExample } from "@/components/docs/component-example";
import { ComponentPreviewMdx } from "@/components/docs/component-preview-mdx";
-import { CopyButton } from "@/components/docs/copy-button";
import { Dependencies } from "@/components/docs/dependencies";
import { GuideVideo } from "@/components/docs/guide-video";
import { IconsGallery } from "@/components/docs/icons-gallery";
@@ -17,97 +17,67 @@ import { InstallAll } from "@/components/docs/install-all";
import { InstallBlock } from "@/components/docs/install-block";
import { PropsTable } from "@/components/docs/props-table";
import { UiComponentPreview } from "@/components/docs/ui-component-preview";
-import { Frame, FramePanel } from "@/components/ui/frame";
import { cn } from "@/lib/utils";
/**
* MDX prose mapping for remocn docs.
*
- * Fumadocs' `defaultMdxComponents` is spread as the base — heading anchors +
- * scroll IDs, the internal-aware `Link`, and the overflow-wrapped `Table` stay
- * intact. Code blocks are the exception: `source.config.ts` swaps fumadocs'
- * shiki plugin for rehype-pretty-code (vesper / github-light-default), and the
- * `pre` / `figcaption` / `code` overrides below render the shadcn-style block
- * (line numbers, filename title with language icon, copy button).
- *
- * Docs typography is owned by shadcn typeset (`app/typeset.css`, applied via
- * the `typeset typeset-docs` container on the docs page): headings, links,
- * code, tables and all vertical rhythm derive from its three rhythm variables
- * on our oklch tokens. `app/globals.css` keeps only functional exceptions —
- * the Shiki surface fix (outranks Shiki's inline styles) and the readable
- * text-measure cap.
- *
- * Custom doc widgets are registered as-is (other lanes own their internals).
+ * Fumadocs' `defaultMdxComponents` is the base (heading anchors, the
+ * internal-aware `Link`, the overflow-wrapped `Table`). Code fences come from
+ * rehype-pretty-code (see `source.config.ts`) and are re-wrapped here in the
+ * shared dark `CodeFrame`: language label, Copy, Vesper tokens, no line
+ * numbers. Prose typography lives in `app/typeset.css` (`.typeset-docs`).
*/
-function Pre({ className, ...props }: ComponentProps<"pre">) {
+function Pre({ children, ...props }: ComponentProps<"pre">) {
+ const lang =
+ typeof props["data-language" as keyof typeof props] === "string"
+ ? (props["data-language" as keyof typeof props] as string)
+ : undefined;
+ const raw =
+ isValidElement<{ __raw__?: string }>(children) &&
+ typeof children.props.__raw__ === "string"
+ ? children.props.__raw__
+ : "";
return (
- <pre
- data-not-typeset
- // biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable code must be keyboard-focusable
- tabIndex={0}
- className={cn(
- "min-w-0 overflow-x-auto px-4 py-3.5 has-data-line-numbers:px-0",
- className,
- )}
- {...props}
- />
+ <CodeFrame lang={lang} code={raw}>
+ {/* biome-ignore lint/a11y/noNoninteractiveTabindex: horizontally scrollable code must be keyboard-focusable */}
+ <pre data-not-typeset tabIndex={0} {...props} className={CODE_PRE}>
+ {children}
+ </pre>
+ </CodeFrame>
);
}
-function Figure(props: ComponentProps<"figure">) {
+/** Drops rehype-pretty-code's figure marker so the frame owns the surface. */
+function Figure({
+ className,
+ ...props
+}: ComponentProps<"figure"> & { "data-rehype-pretty-code-figure"?: string }) {
if (!("data-rehype-pretty-code-figure" in props)) {
- return <figure {...props} />;
+ return <figure className={className} {...props} />;
}
- return (
- <Frame className="not-prose my-6">
- <FramePanel className="overflow-hidden p-0 [&>figure]:my-0">
- <figure {...props} />
- </FramePanel>
- </Frame>
- );
+ const { "data-rehype-pretty-code-figure": _marker, ...rest } = props;
+ return <figure {...rest} className={cn("not-prose", BLOCK_SPACING)} />;
}
-function Figcaption({
- className,
- children,
- ...props
-}: ComponentProps<"figcaption">) {
- const icon =
- "data-language" in props && typeof props["data-language"] === "string"
- ? getIconForLanguage(props["data-language"])
- : null;
-
+/** Markdown tables scroll inside a card (styled in `app/typeset.css`). */
+function Table(props: ComponentProps<"table">) {
return (
- <figcaption
- className={cn(
- "flex items-center gap-2 text-code-foreground [&_svg]:size-4 [&_svg]:opacity-70",
- className,
- )}
- {...props}
- >
- {icon}
- {children}
- </figcaption>
+ <div className="docs-table">
+ <table {...props} />
+ </div>
);
}
function Code({
- className,
- __raw__,
+ __raw__: _raw,
+ "data-line-numbers": _lineNumbers,
...props
-}: ComponentProps<"code"> & { __raw__?: string }) {
- if (typeof props.children === "string") {
- return <code className={className} {...props} />;
- }
-
- return (
- <>
- {__raw__ ? (
- <CopyButton value={__raw__} className="absolute top-3 right-2 z-10" />
- ) : null}
- <code className={className} {...props} />
- </>
- );
+}: ComponentProps<"code"> & {
+ __raw__?: string;
+ "data-line-numbers"?: string;
+}) {
+ return <code {...props} />;
}
export function getMDXComponents(components?: MDXComponents): MDXComponents {
@@ -115,8 +85,8 @@ export function getMDXComponents(components?: MDXComponents): MDXComponents {
...(defaultMdxComponents as MDXComponents),
pre: Pre,
figure: Figure,
- figcaption: Figcaption,
code: Code,
+ table: Table,
// Custom doc widgets — registrations only, not reimplemented here.
ComponentPreview: ComponentPreviewMdx,
diff --git a/package.json b/package.json
index 000104b7..ccde8e6a 100644
--- a/package.json
+++ b/package.json
@@ -73,6 +73,7 @@
"fumadocs-core": "^16.7.10",
"fumadocs-mdx": "^14.2.11",
"fumadocs-ui": "^16.7.10",
+ "geist": "1.8.2",
"jotai": "^2.19.1",
"json5": "^2.2.3",
"lucide-react": "^1.7.0",
diff --git a/public/landing/shader-cta.png b/public/landing/shader-cta.png
new file mode 100644
index 00000000..85c045dc
Binary files /dev/null and b/public/landing/shader-cta.png differ
diff --git a/public/landing/shader-magenta.png b/public/landing/shader-magenta.png
new file mode 100644
index 00000000..b97febdd
Binary files /dev/null and b/public/landing/shader-magenta.png differ
diff --git a/public/landing/shader-violet.png b/public/landing/shader-violet.png
new file mode 100644
index 00000000..3bab21f5
Binary files /dev/null and b/public/landing/shader-violet.png differ
diff --git a/public/landing/shader-why.png b/public/landing/shader-why.png
new file mode 100644
index 00000000..85a9cb2d
Binary files /dev/null and b/public/landing/shader-why.png differ
diff --git a/public/landing/sponsor-aceternity.svg b/public/landing/sponsor-aceternity.svg
new file mode 100644
index 00000000..b89b33b9
--- /dev/null
+++ b/public/landing/sponsor-aceternity.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="48 48 160 160" fill="currentColor"><path d="M146 48H106.136L48 208H87.8644L116.932 128C116.932 128 122 114.5 124.4 108L131.466 88L146 48Z"/><path d="M110 48H149.864L168.032 98H127.84L110 48Z"/><path d="M139.587 113.833L171.458 208H208L172.807 113.833H139.587Z"/><path d="M173 114L140.8 208H104L139.545 114H173Z"/></svg>
diff --git a/public/landing/sponsor-launchfast.png b/public/landing/sponsor-launchfast.png
new file mode 100644
index 00000000..be4b77d6
Binary files /dev/null and b/public/landing/sponsor-launchfast.png differ
diff --git a/public/landing/sponsor-neon.svg b/public/landing/sponsor-neon.svg
new file mode 100644
index 00000000..427875ae
--- /dev/null
+++ b/public/landing/sponsor-neon.svg
@@ -0,0 +1,4 @@
+<svg width="157" height="45" viewBox="0 0 157 45" fill="none" xmlns="http://www.w3.org/2000/svg">
+<path d="M43.9855 0.0123174V44L26.9857 29.2514V44H0.417969V0L43.9855 0.0123174ZM5.75846 38.6595H21.6452V17.5326L38.6453 32.5729V5.35124L5.75846 5.34181V38.6595Z" fill="black"/>
+<path d="M79.0696 35.7042L62.1559 20.7349V35.4106H56.8359V9.06775L73.7497 24.037V9.36126H79.0696V35.7042ZM84.9261 35.4106V9.36126H100.849V14.6078H90.2461V19.7443H98.6479V24.8808H90.2461V30.1641H100.849V35.4106H84.9261ZM117.319 35.7042C109.944 35.7042 104 29.7605 104 22.386C104 15.0114 109.944 9.06775 117.319 9.06775C124.693 9.06775 130.637 15.0114 130.637 22.386C130.637 29.7605 124.693 35.7042 117.319 35.7042ZM117.319 30.5677C121.868 30.5677 125.28 26.8987 125.28 22.386C125.28 17.8732 121.868 14.2042 117.319 14.2042C112.769 14.2042 109.357 17.8732 109.357 22.386C109.357 26.8987 112.769 30.5677 117.319 30.5677ZM156.492 35.7042L139.578 20.7349V35.4106H134.258V9.06775L151.172 24.037V9.36126H156.492V35.7042Z" fill="black"/>
+</svg>
diff --git a/public/landing/sponsor-vidrush.png b/public/landing/sponsor-vidrush.png
new file mode 100644
index 00000000..cff6cf99
Binary files /dev/null and b/public/landing/sponsor-vidrush.png differ
diff --git a/public/legal/satin-chip.webp b/public/legal/satin-chip.webp
new file mode 100644
index 00000000..5aa57481
Binary files /dev/null and b/public/legal/satin-chip.webp differ
diff --git a/public/testimonials/JNYBGR.jpg b/public/testimonials/JNYBGR.jpg
new file mode 100644
index 00000000..ad0bf31d
Binary files /dev/null and b/public/testimonials/JNYBGR.jpg differ
diff --git a/public/testimonials/bhoomikacodes.jpg b/public/testimonials/bhoomikacodes.jpg
new file mode 100644
index 00000000..44405c37
Binary files /dev/null and b/public/testimonials/bhoomikacodes.jpg differ
diff --git a/public/testimonials/bzagrodzki.jpg b/public/testimonials/bzagrodzki.jpg
new file mode 100644
index 00000000..28d7e9b6
Binary files /dev/null and b/public/testimonials/bzagrodzki.jpg differ
diff --git a/public/testimonials/davidhaz.jpg b/public/testimonials/davidhaz.jpg
new file mode 100644
index 00000000..f4cb6a92
Binary files /dev/null and b/public/testimonials/davidhaz.jpg differ
diff --git a/public/testimonials/denicmarko.jpg b/public/testimonials/denicmarko.jpg
new file mode 100644
index 00000000..2512bba0
Binary files /dev/null and b/public/testimonials/denicmarko.jpg differ
diff --git a/public/testimonials/dingyi.jpg b/public/testimonials/dingyi.jpg
new file mode 100644
index 00000000..e475cc8a
Binary files /dev/null and b/public/testimonials/dingyi.jpg differ
diff --git a/public/testimonials/guillaume_rygn.jpg b/public/testimonials/guillaume_rygn.jpg
new file mode 100644
index 00000000..f961f2a9
Binary files /dev/null and b/public/testimonials/guillaume_rygn.jpg differ
diff --git a/public/testimonials/haydenbleasel.jpg b/public/testimonials/haydenbleasel.jpg
new file mode 100644
index 00000000..b621824d
Binary files /dev/null and b/public/testimonials/haydenbleasel.jpg differ
diff --git a/public/testimonials/milessy_bc.jpg b/public/testimonials/milessy_bc.jpg
new file mode 100644
index 00000000..ee9404d6
Binary files /dev/null and b/public/testimonials/milessy_bc.jpg differ
diff --git a/public/testimonials/orcdev.jpg b/public/testimonials/orcdev.jpg
new file mode 100644
index 00000000..26a1d298
Binary files /dev/null and b/public/testimonials/orcdev.jpg differ
diff --git a/public/testimonials/shadcn.jpg b/public/testimonials/shadcn.jpg
new file mode 100644
index 00000000..dbc0e80e
Binary files /dev/null and b/public/testimonials/shadcn.jpg differ
diff --git a/public/testimonials/yesadok.jpg b/public/testimonials/yesadok.jpg
new file mode 100644
index 00000000..4363e204
Binary files /dev/null and b/public/testimonials/yesadok.jpg differ
diff --git a/registry/__manifest__.ts b/registry/__manifest__.ts
index e5211184..3c4562f1 100644
--- a/registry/__manifest__.ts
+++ b/registry/__manifest__.ts
@@ -15,6 +15,8 @@ export interface PreviewManifestEntry {
compositionHeight: number;
previewBackdrop?: BackdropFill;
defaults: Record<string, unknown>;
+ /** Index-card overrides on top of `defaults` (see ComponentConfig.card). */
+ card?: { props?: Record<string, unknown>; fit?: boolean; backdrop?: boolean };
}
export const previewManifest: Record<string, PreviewManifestEntry> = {
@@ -119,6 +121,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
cellSize: 22,
speed: 1,
},
+ card: {
+ props: {
+ colorFront: "#0E1012",
+ },
+ },
},
"ascii-render": {
durationInFrames: 90,
@@ -137,6 +144,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
intensity: 1,
speed: 1,
},
+ card: {
+ props: {
+ ink: "#0E1012",
+ },
+ },
},
backdrop: {
durationInFrames: 150,
@@ -292,6 +304,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ activeColor: "#0E1012",
+ },
+ },
},
"caption-blur-in": {
durationInFrames: 279,
@@ -313,6 +331,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-bounce-in": {
durationInFrames: 279,
@@ -334,6 +357,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-cube": {
durationInFrames: 279,
@@ -356,6 +384,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ activeColor: "#0E1012",
+ },
+ },
},
"caption-dim-progress": {
durationInFrames: 279,
@@ -377,6 +411,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-drop": {
durationInFrames: 279,
@@ -398,6 +437,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-emoji": {
durationInFrames: 279,
@@ -419,6 +463,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-handwrite": {
durationInFrames: 279,
@@ -440,6 +489,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-highlight-box": {
durationInFrames: 279,
@@ -464,6 +518,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ boxColor: "#0E1012",
+ },
+ },
},
"caption-karaoke": {
durationInFrames: 279,
@@ -485,6 +545,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ activeColor: "#0E1012",
+ },
+ },
},
"caption-knockout": {
durationInFrames: 279,
@@ -505,6 +571,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
combineTokensWithinMilliseconds: 1200,
holdMs: 600,
},
+ card: {
+ props: {
+ plateColor: "#0E1012",
+ },
+ },
},
"caption-label-maker": {
durationInFrames: 279,
@@ -525,6 +596,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
combineTokensWithinMilliseconds: 1000,
holdMs: 600,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-marker": {
durationInFrames: 279,
@@ -547,6 +623,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ markerColor: "#0E1012",
+ },
+ },
},
"caption-outline": {
durationInFrames: 279,
@@ -569,6 +651,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
combineTokensWithinMilliseconds: 1200,
holdMs: 600,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ activeColor: "#0E1012",
+ },
+ },
},
"caption-prosody": {
durationInFrames: 279,
@@ -592,6 +680,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ activeColor: "#0E1012",
+ },
+ },
},
"caption-redact": {
durationInFrames: 279,
@@ -613,6 +707,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-rise": {
durationInFrames: 279,
@@ -633,6 +732,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-scramble": {
durationInFrames: 279,
@@ -654,6 +758,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-slice": {
durationInFrames: 279,
@@ -675,6 +784,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-slot": {
durationInFrames: 279,
@@ -695,6 +809,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-speaker": {
durationInFrames: 282,
@@ -735,6 +854,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
combineTokensWithinMilliseconds: 1000,
holdMs: 600,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-stack": {
durationInFrames: 279,
@@ -757,6 +881,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ emphasisColor: "#0E1012",
+ },
+ },
},
"caption-stamp": {
durationInFrames: 279,
@@ -779,6 +909,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-subtitle": {
durationInFrames: 279,
@@ -801,6 +936,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
boxColor: "#000000",
boxOpacity: 0.72,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-teleprompter": {
durationInFrames: 279,
@@ -825,6 +965,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-timeline": {
durationInFrames: 279,
@@ -848,6 +993,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
upcomingOpacity: 0.4,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ playheadColor: "#0E1012",
+ },
+ },
},
"caption-typewriter": {
durationInFrames: 279,
@@ -869,6 +1020,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
caret: true,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-underline": {
durationInFrames: 279,
@@ -892,6 +1048,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ underlineColor: "#0E1012",
+ },
+ },
},
"caption-weight": {
durationInFrames: 279,
@@ -913,6 +1075,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"caption-word-pop": {
durationInFrames: 279,
@@ -934,6 +1101,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
holdMs: 600,
shadow: true,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
caret: {
durationInFrames: 120,
@@ -987,6 +1159,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
caretWidth: 3,
speed: 1,
},
+ card: {
+ props: {
+ caretColor: "#0E1012",
+ },
+ },
},
"centered-word-build": {
durationInFrames: 75,
@@ -1012,6 +1189,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "400",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"chat-gpt": {
durationInFrames: 150,
@@ -1097,6 +1279,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
turbulentAmount: 130,
speed: 1,
},
+ card: {
+ props: {
+ fill: "#0E1012",
+ background: "transparent",
+ },
+ },
},
"claude-chat": {
durationInFrames: 150,
@@ -1313,6 +1501,13 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
backgroundColor: "#a800b7",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ backgroundColor: "transparent",
+ cursorColor: "#0E1012",
+ },
+ },
},
dialog: {
durationInFrames: 120,
@@ -1452,6 +1647,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
cycle: 60,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ echoColor: "#0E1012",
+ },
+ },
},
"ecosystem-constellation": {
durationInFrames: 240,
@@ -1506,6 +1707,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
extrudeEndFrame: 48,
speed: 1,
},
+ card: {
+ props: {
+ faceColor: "#0E1012",
+ },
+ },
},
"fade-through": {
durationInFrames: 90,
@@ -1699,6 +1905,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
keepPoints: false,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"gooey-morph": {
durationInFrames: 120,
@@ -1718,6 +1929,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
barTravelFrames: 30,
speed: 1,
},
+ card: {
+ props: {
+ fill: "#0E1012",
+ },
+ },
},
"gradient-scale-cut-text": {
durationInFrames: 36,
@@ -1745,6 +1961,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "700",
speed: 1,
},
+ card: {
+ props: {
+ gradientEnd: "#0E1012",
+ backgroundColor: "transparent",
+ },
+ },
},
"grain-dissolve": {
durationInFrames: 116,
@@ -1798,6 +2020,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
paperTint: "#f4efe4",
speed: 1,
},
+ card: {
+ props: {
+ paperTint: "#0E1012",
+ },
+ },
},
"hand-count": {
durationInFrames: 90,
@@ -1860,6 +2087,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
intensity: 1,
speed: 1,
},
+ card: {
+ props: {
+ tint: "#0E1012",
+ },
+ },
},
"icon-activity": {
durationInFrames: 90,
@@ -2843,6 +3075,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
flyDistance: 260,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"icon-search": {
durationInFrames: 75,
@@ -3407,6 +3644,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "400",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ pillColor: "#0E1012",
+ },
+ },
},
"inline-word-roll": {
durationInFrames: 105,
@@ -3428,6 +3671,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
color: "#f5f5f5",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
input: {
durationInFrames: 120,
@@ -3505,6 +3753,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
backgroundColor: "#a800b7",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ backgroundColor: "transparent",
+ },
+ },
},
"kinetic-warp": {
durationInFrames: 120,
@@ -3523,6 +3777,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
keyframeStride: 20,
speed: 1,
},
+ card: {
+ props: {
+ textColor: "#0E1012",
+ },
+ },
},
"launch-anything": {
durationInFrames: 1600,
@@ -3770,6 +4029,13 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "700",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ outlineColor: "#0E1012",
+ backgroundColor: "transparent",
+ },
+ },
},
"outline-trace": {
durationInFrames: 75,
@@ -3881,6 +4147,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
lineWidth: 3,
speed: 1,
},
+ card: {
+ props: {
+ lineColor: "#0E1012",
+ },
+ },
},
"per-character-rise": {
durationInFrames: 60,
@@ -3936,6 +4207,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
dotSize: 0.2,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"perlin-dissolve": {
durationInFrames: 116,
@@ -3952,6 +4228,9 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
softness: 0.1,
speed: 1,
},
+ card: {
+ backdrop: true,
+ },
},
"perspective-marquee": {
durationInFrames: 240,
@@ -3973,6 +4252,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fadeColor: "#050505",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"perspective-squeeze": {
durationInFrames: 225,
@@ -3992,6 +4276,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
lineGap: 50,
speed: 1,
},
+ card: {
+ props: {
+ fill: "#0E1012",
+ },
+ },
},
"pixelate-region": {
durationInFrames: 90,
@@ -4093,6 +4382,13 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
loop: false,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ backgroundColor: "transparent",
+ accentColor: "#a800b7",
+ },
+ },
},
radio: {
durationInFrames: 120,
@@ -4246,6 +4542,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
flipDuration: 10,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"rush-type": {
durationInFrames: 104,
@@ -4268,6 +4569,9 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
peakHoldDuration: 3,
speed: 1,
},
+ card: {
+ backdrop: true,
+ },
},
"scale-down-fade": {
durationInFrames: 90,
@@ -4328,6 +4632,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
reducedMotion: false,
speed: 1,
},
+ card: {
+ props: {
+ backgroundColor: "transparent",
+ fieldColor: "#ffffff",
+ },
+ },
},
"security-cam": {
durationInFrames: 90,
@@ -4413,6 +4723,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
badge: true,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"shader-caustics": {
durationInFrames: 150,
@@ -4709,6 +5024,9 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
intensity: 1,
speed: 1,
},
+ card: {
+ backdrop: true,
+ },
},
"shader-voronoi": {
durationInFrames: 150,
@@ -4783,6 +5101,9 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "700",
speed: 1,
},
+ card: {
+ backdrop: true,
+ },
},
"shared-axis-y": {
durationInFrames: 90,
@@ -4923,6 +5244,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
size: 32,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
skeleton: {
durationInFrames: 120,
@@ -4967,6 +5293,9 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
slideFrames: 30,
speed: 1,
},
+ card: {
+ backdrop: true,
+ },
},
slider: {
durationInFrames: 120,
@@ -5056,6 +5385,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
seed: 1,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
spinner: {
durationInFrames: 120,
@@ -5148,6 +5482,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
delay: 0,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
stage: {
durationInFrames: 300,
@@ -5216,6 +5555,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
vertexLagFrames: 3.5,
speed: 1,
},
+ card: {
+ props: {
+ fill: "#0E1012",
+ },
+ },
},
"strikethrough-replace": {
durationInFrames: 120,
@@ -5253,6 +5597,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
exit: true,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"sustained-glitch": {
durationInFrames: 120,
@@ -5466,6 +5815,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
y: 0.5,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"truchet-flip": {
durationInFrames: 120,
@@ -5489,6 +5843,12 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
loop: false,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ secondaryColor: "#0E1012",
+ },
+ },
},
"tv-power-off": {
durationInFrames: 62,
@@ -5506,6 +5866,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
phosphor: "#d8ecff",
speed: 1,
},
+ card: {
+ props: {
+ phosphor: "#0E1012",
+ },
+ },
},
"type-fossil": {
durationInFrames: 208,
@@ -5524,6 +5889,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
backgroundColor: "#eeeae2",
speed: 1,
},
+ card: {
+ props: {
+ backgroundColor: "transparent",
+ },
+ },
},
"type-repeater": {
durationInFrames: 100,
@@ -5545,6 +5915,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
outline: true,
speed: 1,
},
+ card: {
+ props: {
+ accent: "#0E1012",
+ },
+ },
},
"type-wall": {
durationInFrames: 150,
@@ -5565,6 +5940,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
seed: 7,
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"typed-split-wipe": {
durationInFrames: 75,
@@ -5589,6 +5969,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "400",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
typewriter: {
durationInFrames: 120,
@@ -5671,6 +6056,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
direction: "up",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
"vhs-filter": {
durationInFrames: 90,
@@ -5721,6 +6111,9 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
colorBack: "#141318",
speed: 1,
},
+ card: {
+ backdrop: true,
+ },
},
"whip-pan": {
durationInFrames: 114,
@@ -5866,6 +6259,11 @@ export const previewManifest: Record<string, PreviewManifestEntry> = {
fontWeight: "400",
speed: 1,
},
+ card: {
+ props: {
+ color: "#0E1012",
+ },
+ },
},
};
diff --git a/registry/remocn/chromatic-wave/config.ts b/registry/remocn/chromatic-wave/config.ts
index ddc8ff8a..4be75016 100644
--- a/registry/remocn/chromatic-wave/config.ts
+++ b/registry/remocn/chromatic-wave/config.ts
@@ -51,4 +51,5 @@ export const chromaticWaveConfig: ComponentConfig = {
fps: FPS,
compositionWidth: W,
compositionHeight: H,
+ card: { props: { background: "transparent" } },
};
diff --git a/registry/remocn/cursor-gravity/config.ts b/registry/remocn/cursor-gravity/config.ts
index 937a52f0..f2e11464 100644
--- a/registry/remocn/cursor-gravity/config.ts
+++ b/registry/remocn/cursor-gravity/config.ts
@@ -37,4 +37,5 @@ export const cursorGravityConfig: ComponentConfig = {
fps: FPS,
compositionWidth: W,
compositionHeight: H,
+ card: { props: { backgroundColor: "transparent", cursorColor: "#0E1012" } },
};
diff --git a/registry/remocn/gradient-scale-cut-text/config.ts b/registry/remocn/gradient-scale-cut-text/config.ts
index dd2812df..9b6e50bf 100644
--- a/registry/remocn/gradient-scale-cut-text/config.ts
+++ b/registry/remocn/gradient-scale-cut-text/config.ts
@@ -120,4 +120,5 @@ export const gradientScaleCutTextConfig: ComponentConfig = {
compositionWidth: W,
compositionHeight: H,
previewBackdrop: { type: "color", value: "#000000" },
+ card: { props: { backgroundColor: "transparent" } },
};
diff --git a/registry/remocn/kinetic-morph-text/config.ts b/registry/remocn/kinetic-morph-text/config.ts
index 142c1ead..0f01bbbf 100644
--- a/registry/remocn/kinetic-morph-text/config.ts
+++ b/registry/remocn/kinetic-morph-text/config.ts
@@ -114,4 +114,5 @@ export const kineticMorphTextConfig: ComponentConfig = {
fps: FPS,
compositionWidth: W,
compositionHeight: H,
+ card: { props: { backgroundColor: "transparent" } },
};
diff --git a/registry/remocn/outline-fill-track-text/config.ts b/registry/remocn/outline-fill-track-text/config.ts
index 041e419c..3265d02e 100644
--- a/registry/remocn/outline-fill-track-text/config.ts
+++ b/registry/remocn/outline-fill-track-text/config.ts
@@ -125,4 +125,5 @@ export const outlineFillTrackTextConfig: ComponentConfig = {
compositionWidth: W,
compositionHeight: H,
previewBackdrop: { type: "color", value: "#030012" },
+ card: { props: { backgroundColor: "transparent" } },
};
diff --git a/registry/remocn/perlin-dissolve/config.ts b/registry/remocn/perlin-dissolve/config.ts
index 5fe502b6..86155686 100644
--- a/registry/remocn/perlin-dissolve/config.ts
+++ b/registry/remocn/perlin-dissolve/config.ts
@@ -31,4 +31,5 @@ export const perlinDissolveConfig: ComponentConfig = {
compositionHeight: H,
previewBackdrop: { type: "color", value: "#141318" },
snippet: perlinDissolveExampleCode,
+ card: { backdrop: true },
};
diff --git a/registry/remocn/radial-burst/config.ts b/registry/remocn/radial-burst/config.ts
index 6a62147e..d51cbc7f 100644
--- a/registry/remocn/radial-burst/config.ts
+++ b/registry/remocn/radial-burst/config.ts
@@ -86,4 +86,5 @@ export const radialBurstConfig: ComponentConfig = {
fps: FPS,
compositionWidth: W,
compositionHeight: H,
+ card: { props: { backgroundColor: "transparent", accentColor: "#a800b7" } },
};
diff --git a/registry/remocn/rolodex-flip/config.ts b/registry/remocn/rolodex-flip/config.ts
index 60a05d35..16f370fb 100644
--- a/registry/remocn/rolodex-flip/config.ts
+++ b/registry/remocn/rolodex-flip/config.ts
@@ -31,4 +31,5 @@ export const rolodexFlipConfig: ComponentConfig = {
compositionHeight: H,
previewBackdrop: { type: "color", value: "#141318" },
snippet: rolodexFlipExampleCode,
+ card: { props: { color: "#0E1012" } },
};
diff --git a/registry/remocn/rush-type/config.ts b/registry/remocn/rush-type/config.ts
index f67c9344..edf8d77c 100644
--- a/registry/remocn/rush-type/config.ts
+++ b/registry/remocn/rush-type/config.ts
@@ -84,4 +84,5 @@ export const rushTypeConfig: ComponentConfig = {
compositionWidth: W,
compositionHeight: H,
previewBackdrop: { type: "color", value: "#000000" },
+ card: { backdrop: true },
};
diff --git a/registry/remocn/search-reveal/config.ts b/registry/remocn/search-reveal/config.ts
index 9f01c12b..fbade08c 100644
--- a/registry/remocn/search-reveal/config.ts
+++ b/registry/remocn/search-reveal/config.ts
@@ -90,4 +90,5 @@ export const searchRevealConfig: ComponentConfig = {
fps: FPS,
compositionWidth: W,
compositionHeight: H,
+ card: { props: { backgroundColor: "transparent", fieldColor: "#ffffff" } },
};
diff --git a/registry/remocn/shader-text-reveal/config.ts b/registry/remocn/shader-text-reveal/config.ts
index f837321b..4142c66e 100644
--- a/registry/remocn/shader-text-reveal/config.ts
+++ b/registry/remocn/shader-text-reveal/config.ts
@@ -42,4 +42,5 @@ export const shaderTextRevealConfig: ComponentConfig = {
compositionWidth: W,
compositionHeight: H,
previewBackdrop: { type: "color", value: "#000000" },
+ card: { backdrop: true },
};
diff --git a/registry/remocn/shadow-sweep-text/config.ts b/registry/remocn/shadow-sweep-text/config.ts
index 8be9abd9..c445a5bb 100644
--- a/registry/remocn/shadow-sweep-text/config.ts
+++ b/registry/remocn/shadow-sweep-text/config.ts
@@ -79,4 +79,5 @@ export const shadowSweepTextConfig: ComponentConfig = {
compositionWidth: W,
compositionHeight: H,
previewBackdrop: { type: "color", value: "#030012" },
+ card: { backdrop: true },
};
diff --git a/registry/remocn/slide-swap/config.ts b/registry/remocn/slide-swap/config.ts
index ba2c98f9..571b6237 100644
--- a/registry/remocn/slide-swap/config.ts
+++ b/registry/remocn/slide-swap/config.ts
@@ -48,4 +48,5 @@ export const slideSwapConfig: ComponentConfig = {
compositionHeight: H,
previewBackdrop: { type: "color", value: "#141318" },
snippet: slideSwapExampleCode,
+ card: { backdrop: true },
};
diff --git a/registry/remocn/type-fossil/config.ts b/registry/remocn/type-fossil/config.ts
index 257d7e92..58b8c757 100644
--- a/registry/remocn/type-fossil/config.ts
+++ b/registry/remocn/type-fossil/config.ts
@@ -67,4 +67,5 @@ export const typeFossilConfig: ComponentConfig = {
fps: FPS,
compositionWidth: W,
compositionHeight: H,
+ card: { props: { backgroundColor: "transparent" } },
};
diff --git a/registry/remocn/value-swap/config.ts b/registry/remocn/value-swap/config.ts
index 728ea443..5c157b5f 100644
--- a/registry/remocn/value-swap/config.ts
+++ b/registry/remocn/value-swap/config.ts
@@ -40,4 +40,5 @@ export const valueSwapConfig: ComponentConfig = {
compositionHeight: H,
previewBackdrop: { type: "color", value: "#141318" },
snippet: valueSwapExampleCode,
+ card: { props: { color: "#0E1012" } },
};
diff --git a/registry/remocn/wave-wipe/config.ts b/registry/remocn/wave-wipe/config.ts
index ea27aadd..d0f2562e 100644
--- a/registry/remocn/wave-wipe/config.ts
+++ b/registry/remocn/wave-wipe/config.ts
@@ -44,4 +44,5 @@ export const waveWipeConfig: ComponentConfig = {
compositionHeight: H,
previewBackdrop: { type: "color", value: "#141318" },
snippet: waveWipeExampleCode,
+ card: { backdrop: true },
};
diff --git a/scripts/build-preview-manifest.mts b/scripts/build-preview-manifest.mts
index 341b35ed..899dfb68 100644
--- a/scripts/build-preview-manifest.mts
+++ b/scripts/build-preview-manifest.mts
@@ -25,10 +25,74 @@ export interface PreviewManifestEntry {
compositionHeight: number;
previewBackdrop?: BackdropFill;
defaults: Record<string, unknown>;
+ /** Index-card overrides on top of \`defaults\` (see ComponentConfig.card). */
+ card?: { props?: Record<string, unknown>; fit?: boolean; backdrop?: boolean };
}
export const previewManifest: Record<string, PreviewManifestEntry> = `;
+/** Ink the light index cards use instead of a light color. */
+const CARD_INK = "#0E1012";
+/** Control names that hold a component's main text/shape color. */
+const MAIN_INK = new Set(["color", "textColor", "fill"]);
+
+/** Relative lightness 0..1 of a CSS color, or null when it can't tell. */
+function lightness(value: unknown): number | null {
+ if (typeof value !== "string") return null;
+ const color = value.trim().toLowerCase();
+ if (color === "white") return 1;
+ if (color === "black") return 0;
+ const oklch = /^oklch\(\s*([\d.]+)(%?)/.exec(color);
+ if (oklch) return Number(oklch[1]) / (oklch[2] ? 100 : 1);
+ let rgb: number[] | null = null;
+ const hex = /^#([\da-f]{3,8})$/.exec(color)?.[1];
+ if (hex) {
+ const full =
+ hex.length <= 4 ? [...hex.slice(0, 3)].map((c) => c + c).join("") : hex;
+ rgb = [0, 2, 4].map((i) => Number.parseInt(full.slice(i, i + 2), 16));
+ }
+ const fn = /^rgba?\(([^)]+)\)/.exec(color)?.[1];
+ if (fn)
+ rgb = fn
+ .split(/[\s,/]+/)
+ .slice(0, 3)
+ .map(Number);
+ if (!rgb || rgb.some(Number.isNaN)) return null;
+ const [r, g, b] = rgb.map((c) => {
+ const v = c / 255;
+ return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
+ });
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
+}
+
+/**
+ * Props for the docs index cards: light tiles with no backdrop. Colors that
+ * were light only because the component sits on a dark backdrop turn to ink,
+ * then the config's own \`card.props\` win.
+ */
+function cardProps(config: Awaited<ReturnType<typeof loadComponentConfig>>) {
+ const props: Record<string, unknown> = {};
+ // Cards that keep their backdrop keep their colors too.
+ if (config.card?.backdrop) return { ...config.card.props };
+ const backdrop = config.previewBackdrop;
+ // Anything but a light flat color (dark colors, gradients, images) is a
+ // backdrop the light colors were chosen for.
+ const darkBackdrop =
+ !!backdrop &&
+ !(backdrop.type === "color" && (lightness(backdrop.value) ?? 0) > 0.5);
+ for (const [key, control] of Object.entries(config.controls)) {
+ if (control.type !== "color") continue;
+ if ((lightness(control.default) ?? 0) <= 0.5) continue;
+ // On a dark backdrop every light color was chosen for it. With no
+ // backdrop the component sits on the docs player's dark stage, but light
+ // fills there can be UI surfaces, so only the main ink flips.
+ if (darkBackdrop || (!backdrop && MAIN_INK.has(key))) {
+ props[key] = CARD_INK;
+ }
+ }
+ return { ...props, ...config.card?.props };
+}
+
async function main() {
const slugs = Object.keys(registry).sort();
const manifest: Record<string, unknown> = {};
@@ -43,6 +107,12 @@ async function main() {
};
if (config.previewBackdrop) entry.previewBackdrop = config.previewBackdrop;
entry.defaults = getDefaults(config.controls);
+ const props = cardProps(config);
+ const card: Record<string, unknown> = {};
+ if (Object.keys(props).length > 0) card.props = props;
+ if (config.card?.fit === false) card.fit = false;
+ if (config.card?.backdrop) card.backdrop = true;
+ if (Object.keys(card).length > 0) entry.card = card;
manifest[slug] = entry;
}
diff --git a/source.tsx b/source.tsx
index 97f1d5bd..4b66a42f 100644
--- a/source.tsx
+++ b/source.tsx
@@ -9,6 +9,7 @@ import {
Layers01Icon,
Layout01Icon,
MagicWand01Icon,
+ PlaySquareIcon,
Rocket01Icon,
Share01Icon,
SparklesIcon,
@@ -32,6 +33,7 @@ const DOCS_ICONS: Record<string, IconSvgElement> = {
Layers01Icon,
Layout01Icon,
MagicWand01Icon,
+ PlaySquareIcon,
Rocket01Icon,
Share01Icon,
SparklesIcon,