Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat: add the interactive Cap homepage
Richie McIlroya1a5c1d21d7f
diff --git a/apps/web/components/pages/HomeTwo/Agents.tsx b/apps/web/components/pages/HomeTwo/Agents.tsxnew file mode 100644index 000000000..d8cdff150--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Agents.tsx@@ -0,0 +1,250 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { ArrowUpRight } from "lucide-react";+import Link from "next/link";+import { useRef, useState } from "react";+import { Eyebrow } from "./Eyebrow";+import { AGENT } from "./scenes";+import { LazyMount, useInView, useReducedMotion } from "./scenes/engine";+import {+ BAND,+ BODY_TEXT,+ BTN_SECONDARY,+ GRAIN,+ grainBg,+ H_SECTION,+ MODE_THEME,+ MONO,+} from "./theme";++const DARK = {+ backgroundColor: "#111111",+ backgroundImage: GRAIN,+ backgroundSize: "200px 200px",+} as const;++const SURFACES = ["CLI", "MCP server", "JSON on every command", "REST API"];++const FACTS = [+ {+ title: "One prompt to set up",+ body: "Paste one prompt from the docs and your agent installs the CLI, the Cap skill, and the MCP server for Claude Code, Cursor, or Codex.",+ snippet: "cap agents install --target claude --component all",+ mode: "instant" as const,+ },+ {+ title: "Every command speaks JSON",+ body: "Add one flag and the answer comes back as data. Recording and export stream NDJSON events as they happen.",+ snippet: "cap guide --json",+ mode: "studio" as const,+ },+ {+ title: "76 MCP tools, zero secrets",+ body: "Read and manage Caps, comments, sharing, and analytics over MCP. Capture and upload stay in the CLI, so no secret passes through the model.",+ snippet: "cap mcp serve",+ mode: "screenshot" as const,+ },+ {+ title: "Least privilege login",+ body: "Sign in with the creator profile by default, and the agent asks before anything records, uploads, or costs money.",+ snippet: "cap auth login",+ mode: "share" as const,+ },+];++type Tab = { key: "cli" | "mcp"; label: string; lines: string[]; note: string };++const CLI_TAB: Tab = {+ key: "cli",+ label: "CLI",+ lines: [+ "cap record start --screen 1 --mode instant --duration 20 --json",+ 'cap upload ./recording.cap --export --name "Checkout bug repro" --json',+ ],+ note: "Record in the background, stop it later, and upload a .cap or .mp4 for a link. Works from any shell, script, or agent tool call.",+};++const MCP_TAB: Tab = {+ key: "mcp",+ label: "MCP",+ lines: [+ "{",+ ' "mcpServers": {',+ ' "cap": { "command": "cap", "args": ["mcp", "serve"] }',+ " }",+ "}",+ ],+ note: "Point any MCP client at the Cap server and it gets 76 tools for listing, reading, commenting on, and sharing Caps. Capture and upload stay in the CLI.",+};++const TABS: Tab[] = [CLI_TAB, MCP_TAB];++export const Agents = () => {+ const [chapter, setChapter] = useState(0);+ const [tab, setTab] = useState(0);+ const cardRef = useRef<HTMLDivElement | null>(null);+ const inView = useInView(cardRef);+ const reducedMotion = useReducedMotion();+ const playing = inView && !reducedMotion;+ const active = TABS[tab] ?? CLI_TAB;++ return (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.studio.accent}>Cap for Agents</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Your agent can record, share, and read Caps+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[640px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ Cap ships a CLI and a local MCP server, so Claude Code, Cursor,+ Codex, OpenCode, or any shell capable agent can record your screen,+ upload the result, and read back the transcript and summary. One+ pasted prompt installs everything, and the agent asks before+ anything records, uploads, or costs money.+ </p>+ </div>++ <div+ ref={cardRef}+ className="mt-14 rounded-[24px] p-4 lg:p-6"+ style={DARK}+ >+ <LazyMount w={1200} h={520}>+ <AGENT.Scene+ chapter={chapter}+ playing={playing}+ onChapterEnd={() =>+ setChapter((current) => (current + 1) % AGENT.chapters.length)+ }+ />+ </LazyMount>+ <ul className="mt-5 flex flex-wrap items-center gap-2">+ {SURFACES.map((surface) => (+ <li+ key={surface}+ className={classNames(+ MONO,+ "rounded-full border border-white/15 px-3 py-1.5 text-[11px] uppercase leading-none tracking-[0.05em] text-[rgba(255,255,255,0.72)]",+ )}+ >+ {surface}+ </li>+ ))}+ <li className="ml-auto">+ <Link+ href="/docs/agents"+ className={classNames(+ MONO,+ "flex items-center gap-1.5 rounded-full bg-white px-3.5 py-2 text-[11px] uppercase leading-none tracking-[0.05em] text-[#111111] transition-colors duration-200 hover:bg-[#EDF1F6]",+ )}+ >+ Agent docs+ <ArrowUpRight className="size-3" />+ </Link>+ </li>+ </ul>+ </div>++ <div className="mt-4 grid gap-4 lg:grid-cols-[1.05fr_1fr]">+ <ul className="grid gap-4 sm:grid-cols-2">+ {FACTS.map((fact) => {+ const theme = MODE_THEME[fact.mode];+ return (+ <li+ key={fact.title}+ className="flex flex-col justify-between rounded-[20px] p-6"+ style={grainBg(BAND)}+ >+ <div>+ <span+ aria-hidden="true"+ className="block size-[7px]"+ style={{ background: theme.accent }}+ />+ <h3 className="mt-5 text-[19px] font-normal leading-[1.1] tracking-[-0.02em] text-[#111111]">+ {fact.title}+ </h3>+ <p+ className={`${BODY_TEXT} mt-2 text-[14.5px] leading-[1.45] text-[rgba(17,17,17,0.7)]`}+ >+ {fact.body}+ </p>+ </div>+ <code+ className={classNames(+ MONO,+ "mt-5 block whitespace-pre-wrap break-words rounded-[10px] bg-white px-3 py-2 text-[12px] leading-[1.6] text-[#111111] shadow-[0_0_0_1px_rgba(17,17,17,0.06)]",+ )}+ >+ <span className="text-[rgba(17,17,17,0.4)]">$ </span>+ {fact.snippet}+ </code>+ </li>+ );+ })}+ </ul>++ <div+ className="flex flex-col rounded-[20px] p-6"+ style={grainBg(BAND)}+ >+ <div className="flex items-center gap-1 self-start rounded-full bg-white p-1 shadow-[0_0_0_1px_rgba(17,17,17,0.06)]">+ {TABS.map((item, i) => (+ <button+ key={item.key}+ type="button"+ aria-pressed={i === tab}+ onClick={() => setTab(i)}+ className={classNames(+ "rounded-full px-4 py-1.5 text-[13px] font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]",+ i === tab+ ? "bg-[#111111] text-white"+ : "text-[rgba(17,17,17,0.6)] hover:text-[#111111]",+ )}+ >+ {item.label}+ </button>+ ))}+ </div>+ <pre+ className={classNames(+ MONO,+ "mt-4 rounded-[14px] p-5 text-[12.5px] leading-[1.75] text-[#F8FAFC]",+ )}+ style={DARK}+ >+ {active.lines.map((line) => (+ <span+ key={line}+ className="block whitespace-pre-wrap break-words"+ >+ {active.key === "cli" ? (+ <span className="text-[rgba(255,255,255,0.4)]">$ </span>+ ) : null}+ {line}+ </span>+ ))}+ </pre>+ <p+ className={`${BODY_TEXT} mb-5 mt-4 text-[14.5px] leading-[1.45] text-[rgba(17,17,17,0.7)]`}+ >+ {active.note}+ </p>+ <Link+ href="/docs/agents"+ className={classNames(BTN_SECONDARY, "self-start")}+ >+ Read the agent docs+ </Link>+ </div>+ </div>+ </div>+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/DeepDive.tsx b/apps/web/components/pages/HomeTwo/DeepDive.tsxnew file mode 100644index 000000000..d601483f2--- /dev/null+++ b/apps/web/components/pages/HomeTwo/DeepDive.tsx@@ -0,0 +1,198 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { ArrowUpRight } from "lucide-react";+import Link from "next/link";+import type { ComponentType } from "react";+import { useCallback, useId, useRef, useState } from "react";+import { Eyebrow } from "./Eyebrow";+import { Fit, SCENES, STAGE } from "./scenes";+import { LazyMount, useInView, useReducedMotion } from "./scenes/engine";+import {+ BODY_TEXT,+ H_SECTION,+ MODE_THEME,+ type ModeKey,+ meshStyle,+} from "./theme";++export type DiveItem = {+ title: string;+ body: string;+};++export type DiveChip = {+ title: string;+ description: string;+ Icon: ComponentType<{ className?: string }>;+};++export type DiveConfig = {+ mode: ModeKey;+ eyebrow: string;+ heading: string;+ intro?: string;+ items: DiveItem[];+ chips?: DiveChip[];+ href: string;+ flip?: boolean;+};++export const DeepDive = ({ config }: { config: DiveConfig }) => {+ const [active, setActive] = useState(0);+ const baseId = useId();+ const theme = MODE_THEME[config.mode];+ const scene = SCENES[config.mode];+ const visualRef = useRef<HTMLDivElement | null>(null);+ const progressRef = useRef<HTMLSpanElement | null>(null);+ const inView = useInView(visualRef);+ const reducedMotion = useReducedMotion();+ const playing = inView && !reducedMotion;+ const count = config.items.length;++ const advance = useCallback(() => {+ setActive((current) => (current + 1) % count);+ }, [count]);++ return (+ <section className="px-5 py-16 lg:py-24">+ <div className="mx-auto grid max-w-[1200px] items-start gap-12 lg:grid-cols-2 lg:gap-16">+ <div+ className={classNames(+ "order-first",+ config.flip ? "lg:order-first" : "lg:order-last",+ )}+ >+ <div ref={visualRef} className="lg:sticky lg:top-24">+ <div+ className="rounded-[24px] p-3 shadow-[0_30px_60px_-40px_rgba(17,17,17,0.35)]"+ style={meshStyle(theme)}+ >+ <LazyMount w={STAGE.w} h={STAGE.h} className="mx-auto">+ <Fit w={STAGE.w} h={STAGE.h}>+ <scene.Scene+ chapter={active}+ playing={playing}+ onChapterEnd={advance}+ progressRef={progressRef}+ />+ </Fit>+ </LazyMount>+ </div>+ </div>+ </div>++ <div className={config.flip ? "lg:order-last" : "lg:order-first"}>+ <Eyebrow accent={theme.accent}>{config.eyebrow}</Eyebrow>++ <h2+ className={`${H_SECTION} mt-6 max-w-[480px] text-balance text-[clamp(34px,3.9vw,50px)]`}+ >+ {config.heading}+ </h2>++ {config.intro ? (+ <p+ className={`${BODY_TEXT} mt-6 max-w-[460px] text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)]`}+ >+ {config.intro}+ </p>+ ) : null}++ <div className="mt-10">+ {config.items.map((item, i) => {+ const open = i === active;+ const panelId = `${baseId}-panel-${i}`;+ const headerId = `${baseId}-header-${i}`;+ return (+ <div+ key={item.title}+ className="relative border-t border-[#E1E7EE] last:border-b"+ >+ <span+ aria-hidden="true"+ className="absolute inset-x-0 top-[-1px] h-[2px] overflow-hidden"+ style={{ opacity: open ? 1 : 0 }}+ >+ <span+ ref={open ? progressRef : undefined}+ className="block h-full w-full origin-left"+ style={{+ background: theme.accent,+ transform: `scaleX(${open && !playing ? 1 : 0})`,+ }}+ />+ </span>+ <h3>+ <button+ type="button"+ id={headerId}+ aria-expanded={open}+ aria-controls={panelId}+ onClick={() => setActive(i)}+ className={classNames(+ "flex w-full items-center justify-between gap-6 py-[24px] text-left text-[19px] font-normal tracking-[-0.02em] transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111] focus-visible:ring-offset-4 focus-visible:ring-offset-[#F8FAFC] lg:text-[21px]",+ open+ ? "text-[#111111]"+ : "text-[rgba(17,17,17,0.4)] hover:text-[rgba(17,17,17,0.7)]",+ )}+ >+ {item.title}+ </button>+ </h3>+ <div+ id={panelId}+ aria-hidden={!open}+ className="grid transition-[grid-template-rows] duration-300 ease-out"+ style={{ gridTemplateRows: open ? "1fr" : "0fr" }}+ >+ <div className="overflow-hidden">+ <div className="flex items-start justify-between gap-6 pb-8">+ <p+ className={`${BODY_TEXT} max-w-[420px] text-[16px] leading-[1.5] text-[rgba(17,17,17,0.78)]`}+ >+ {item.body}+ </p>+ <Link+ href={config.href}+ tabIndex={open ? undefined : -1}+ aria-label={`Learn more about ${item.title}`}+ className="grid size-10 shrink-0 place-items-center rounded-[8px] bg-[#E7EDF3] text-[#111111] transition-colors duration-200 hover:bg-[#DCE4EC] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]"+ >+ <ArrowUpRight className="size-4" />+ </Link>+ </div>+ </div>+ </div>+ </div>+ );+ })}+ </div>++ {config.chips ? (+ <ul className="mt-10 grid gap-x-8 gap-y-6 sm:grid-cols-2">+ {config.chips.map((chip) => (+ <li key={chip.title} className="flex items-start gap-3">+ <span+ className="grid size-8 shrink-0 place-items-center rounded-[8px]"+ style={{ background: theme.chip, color: theme.glyph }}+ >+ <chip.Icon className="size-4" />+ </span>+ <span className="min-w-0">+ <span className="block text-[15px] font-medium text-[#111111]">+ {chip.title}+ </span>+ <span className="mt-0.5 block text-[13.5px] leading-snug text-[rgba(17,17,17,0.55)]">+ {chip.description}+ </span>+ </span>+ </li>+ ))}+ </ul>+ ) : null}+ </div>+ </div>+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/DeepDives.tsx b/apps/web/components/pages/HomeTwo/DeepDives.tsxnew file mode 100644index 000000000..b5fbdbdc5--- /dev/null+++ b/apps/web/components/pages/HomeTwo/DeepDives.tsx@@ -0,0 +1,218 @@+"use client";++import {+ BookOpen,+ Captions,+ Copy,+ EyeOff,+ FileText,+ Globe,+ Layers,+ LayoutGrid,+ Link2,+ Maximize2,+ MousePointerClick,+ MoveUpRight,+ Palette,+ Square,+ Type,+ Upload,+} from "lucide-react";+import { DeepDive, type DiveConfig } from "./DeepDive";+import { StudioFeatures } from "./studio/StudioFeatures";++const INSTANT: DiveConfig = {+ mode: "instant",+ eyebrow: "Instant Mode",+ heading: "Share your screen or webcam instantly",+ intro:+ "Hit record, stop, and share. Your video is live with a title, summary, chapters, and transcript, all written for you.",+ href: "/features",+ items: [+ {+ title: "Uploads while you record",+ body: "Instant Mode streams to the cloud as you go, so the video is ready the moment you press stop.",+ },+ {+ title: "The link is on your clipboard",+ body: "Press stop and it is already copied, ready to paste into Slack, a ticket, or an email.",+ },+ {+ title: "Share publicly or privately",+ body: "Password protect the sensitive ones, keep a link to your team, or leave it public. You decide who can watch.",+ },+ ],+ chips: [+ {+ title: "Instant links",+ description: "Shareable URL, immediately",+ Icon: Link2,+ },+ {+ title: "Background upload",+ description: "Uploads while you record",+ Icon: Upload,+ },+ {+ title: "Auto transcription",+ description: "Captions on every recording",+ Icon: Captions,+ },+ {+ title: "AI summaries",+ description: "Titles and descriptions",+ Icon: FileText,+ },+ {+ title: "Smart chapters",+ description: "Auto segmented timeline",+ Icon: BookOpen,+ },+ {+ title: "Browser viewing",+ description: "No downloads required",+ Icon: Globe,+ },+ ],+};++const STUDIO: DiveConfig = {+ mode: "studio",+ eyebrow: "Studio Mode",+ heading: "Record in full quality, edit before you share",+ intro:+ "Studio records at the highest quality straight to your device, with no compression and no upload. Then blur what is private, switch scenes between screen and camera, add text and captions, and set the look before anyone sees it.",+ href: "/features",+ flip: true,+ items: [+ {+ title: "Records locally in full quality",+ body: "4K at 60fps straight to your device, with no compression and no upload. Screen, camera, and mic each stay on their own track.",+ },+ {+ title: "An editor built in",+ body: "Custom backgrounds, adjustable padding, rounded corners, shadows and borders, all set before anyone sees it.",+ },+ {+ title: "Automatic zoom and cursor effects",+ body: "Cap smooths the cursor, adds click effects and natural motion blur, and zooms in where the action is.",+ },+ ],+ chips: [+ {+ title: "Custom backgrounds",+ description: "Gradients, wallpapers, colours",+ Icon: Palette,+ },+ {+ title: "Adjustable padding",+ description: "Scale from 0% to 40%",+ Icon: Maximize2,+ },+ {+ title: "Blur sensitive areas",+ description: "Mask, pixelate, or highlight",+ Icon: EyeOff,+ },+ {+ title: "Scenes and split screen",+ description: "Camera only, split, or floating",+ Icon: LayoutGrid,+ },+ {+ title: "Text and captions",+ description: "Animated titles, local captions",+ Icon: Type,+ },+ {+ title: "Cursor effects",+ description: "Sizing, smoothing, click effects",+ Icon: MousePointerClick,+ },+ ],+};++const SCREENSHOT: DiveConfig = {+ mode: "screenshot",+ eyebrow: "Screenshot Mode",+ heading: "Capture, beautify, share",+ intro:+ "One hotkey grabs the window, and the same editing tools that polish your videos turn the still into something worth pasting.",+ href: "/features",+ items: [+ {+ title: "Capture and beautify in one hotkey",+ body: "Grab any window or area and Cap drops it on a background with padding, rounded corners, and a shadow.",+ },+ {+ title: "Annotate, then copy",+ body: "Point out the bug or the button you mean, then send the result straight to your clipboard or save it as a file.",+ },+ ],+ chips: [+ {+ title: "Beautiful backgrounds",+ description: "Gradients, wallpapers, solid colours",+ Icon: Palette,+ },+ {+ title: "Adjustable padding",+ description: "Clean spacing around the capture",+ Icon: Maximize2,+ },+ {+ title: "Rounded corners",+ description: "Squircle or rounded styles",+ Icon: Square,+ },+ {+ title: "Shadow and borders",+ description: "Depth without the fuss",+ Icon: Layers,+ },+ {+ title: "Annotation tools",+ description: "Arrows, shapes, text, masks",+ Icon: MoveUpRight,+ },+ {+ title: "Instant copy and save",+ description: "One click to clipboard or file",+ Icon: Copy,+ },+ ],+};++const UNDERSTAND: DiveConfig = {+ mode: "share",+ eyebrow: "Cap AI · On every recording",+ heading: "Every recording, understood",+ intro:+ "Titles, summaries, chapters, and a searchable transcript arrive with the recording, so the work after the recording is already done.",+ href: "/features",+ flip: true,+ items: [+ {+ title: "Auto transcription",+ body: "Every word transcribed and timestamped, so viewers can search the recording instead of scrubbing it.",+ },+ {+ title: "Titles, summaries, and chapters",+ body: "Written the moment you finish recording, with clickable chapters viewers can skim.",+ },+ {+ title: "Comments and reactions",+ body: "Feedback lands at the exact timestamp it is about, so the conversation stays with the recording.",+ },+ ],+};++export const DeepDives = () => (+ <>+ <DeepDive config={INSTANT} />+ <DeepDive config={STUDIO} />+ <StudioFeatures />+ <DeepDive config={SCREENSHOT} />+ <DeepDive config={UNDERSTAND} />+ </>+);diff --git a/apps/web/components/pages/HomeTwo/Eyebrow.tsx b/apps/web/components/pages/HomeTwo/Eyebrow.tsxnew file mode 100644index 000000000..1db56a17e--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Eyebrow.tsx@@ -0,0 +1,36 @@+import { classNames } from "@cap/utils/helpers";+import type { ReactNode } from "react";+import { EYEBROW, INK } from "./theme";++/**+ * 12px uppercase mono eyebrow with a small accent square, the way Intercom+ * marks its sections. `color` covers the dark band; `accent` picks up the+ * section's mode hue.+ */+export const Eyebrow = ({+ children,+ accent = "#8DBCF0",+ color = INK,+ className,+}: {+ children: ReactNode;+ accent?: string;+ color?: string;+ className?: string;+}) => (+ <p+ className={classNames(+ EYEBROW,+ "inline-flex items-center gap-2.5",+ className,+ )}+ style={{ color }}+ >+ <span+ aria-hidden="true"+ className="inline-block size-[7px]"+ style={{ background: accent }}+ />+ {children}+ </p>+);diff --git a/apps/web/components/pages/HomeTwo/Faq.tsx b/apps/web/components/pages/HomeTwo/Faq.tsxnew file mode 100644index 000000000..0e802b8d8--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Faq.tsx@@ -0,0 +1,60 @@+import { homepageCopy } from "@/data/homepage-copy";+import { Eyebrow } from "./Eyebrow";+import { BODY_TEXT, H_SECTION, MODE_THEME } from "./theme";++/**+ * The homepage FAQ, same questions and answers, rebuilt as hairline rows with+ * a plus that turns into a minus. Plain `details` elements, so it opens with+ * no JavaScript and stays keyboard native.+ */+export const Faq = () => (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto grid max-w-[1100px] gap-12 lg:grid-cols-[minmax(0,340px)_minmax(0,1fr)] lg:gap-20">+ <div className="lg:sticky lg:top-28 lg:self-start">+ <Eyebrow accent={MODE_THEME.screenshot.accent}>FAQ</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(34px,3.9vw,48px)]`}+ >+ Questions? We've got answers.+ </h2>+ <p+ className={`${BODY_TEXT} mt-5 max-w-[320px] text-[16px] leading-[1.5] text-[rgba(17,17,17,0.72)]`}+ >+ Still stuck? Mail{" "}+ <a+ href="mailto:[email protected]"+ className="underline decoration-[rgba(17,17,17,0.3)] underline-offset-[5px] transition-colors duration-200 hover:decoration-[#111111]"+ >+ </a>{" "}+ and a human answers.+ </p>+ </div>++ <div>+ {homepageCopy.faq.items.map((item) => (+ <details+ key={item.question}+ className="group border-t border-[#E1E7EE] last:border-b"+ >+ <summary className="flex cursor-pointer list-none items-center justify-between gap-6 py-6 text-left text-[17px] font-normal tracking-[-0.02em] text-[rgba(17,17,17,0.75)] transition-colors duration-200 hover:text-[#111111] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111] group-open:text-[#111111] lg:text-[19px] [&::-webkit-details-marker]:hidden">+ {item.question}+ <span+ aria-hidden="true"+ className="relative grid size-8 shrink-0 place-items-center rounded-full bg-[#E7EDF3] transition-colors duration-200 group-hover:bg-[#DCE4EC]"+ >+ <span className="absolute h-[1.5px] w-3 rounded-full bg-[#111111]" />+ <span className="absolute h-3 w-[1.5px] rounded-full bg-[#111111] transition-transform duration-200 group-open:scale-y-0" />+ </span>+ </summary>+ <p+ className={`${BODY_TEXT} max-w-[640px] pb-7 pr-10 text-[15.5px] leading-[1.6] text-[rgba(17,17,17,0.72)]`}+ >+ {item.answer}+ </p>+ </details>+ ))}+ </div>+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/Features.tsx b/apps/web/components/pages/HomeTwo/Features.tsxnew file mode 100644index 000000000..f83da626f--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Features.tsx@@ -0,0 +1,142 @@+import { classNames } from "@cap/utils/helpers";+import {+ ArrowDownToLine,+ Captions,+ Gauge,+ Github,+ HardDrive,+ Lock,+ MessageSquare,+ MonitorSmartphone,+} from "lucide-react";+import Link from "next/link";+import type { ComponentType } from "react";+import { Eyebrow } from "./Eyebrow";+import {+ BAND,+ BODY_TEXT,+ BTN_SECONDARY,+ grainBg,+ H_SECTION,+ MODE_THEME,+ type ModeKey,+} from "./theme";++/**+ * The homepage's "built for how you actually work" grid, in the new type and+ * colour system. Same eight promises, one accent per card so the row reads in+ * the four mode hues rather than one flat block.+ */++type Feature = {+ title: string;+ body: string;+ accent: ModeKey;+ Icon: ComponentType<{ className?: string }>;+};++const FEATURES: Feature[] = [+ {+ title: "Your storage, your rules",+ body: "Connect your own Google Drive or S3 bucket, use Cap Cloud, or keep everything local. You are never locked into our infrastructure.",+ accent: "instant",+ Icon: HardDrive,+ },+ {+ title: "Privacy by default, sharing by choice",+ body: "Share publicly or privately, password protect the sensitive ones, or keep a recording on your machine and never upload it at all.",+ accent: "studio",+ Icon: Lock,+ },+ {+ title: "Async collaboration that works",+ body: "Comments, reactions, and transcripts keep the conversation moving. See who watched and turn a recording into the next step, not another meeting.",+ accent: "screenshot",+ Icon: MessageSquare,+ },+ {+ title: "Cross platform for your whole team",+ body: "Native apps for macOS and Windows that feel at home on each, plus a Chrome extension when recording in the browser is the right call.",+ accent: "share",+ Icon: MonitorSmartphone,+ },+ {+ title: "Quality that makes you look good",+ body: "4K recording, 60fps capture, and compression smart enough to keep the file sizes sane.",+ accent: "studio",+ Icon: Gauge,+ },+ {+ title: "Truly open source",+ body: "See exactly how Cap works, contribute the feature you need, or self host the whole thing. No black boxes.",+ accent: "instant",+ Icon: Github,+ },+ {+ title: "Cap AI does the busywork",+ body: "Titles, summaries, clickable chapters, and transcripts write themselves for every recording, with no usage limits on Pro.",+ accent: "share",+ Icon: Captions,+ },+ {+ title: "Import your Loom videos",+ body: "Switching from Loom? Bring your existing library across with the built in importer and keep everything in one place.",+ accent: "screenshot",+ Icon: ArrowDownToLine,+ },+];++export const Features = () => (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.studio.accent}>Why Cap</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Built for how you actually work+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[560px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ We obsessed over the details so you do not have to. Every feature here+ exists to save you time and make you look good.+ </p>+ </div>++ <ul className="mt-14 grid gap-3 sm:grid-cols-2 lg:grid-cols-4 lg:gap-4">+ {FEATURES.map((feature) => {+ const theme = MODE_THEME[feature.accent];+ return (+ <li+ key={feature.title}+ className="flex flex-col rounded-[14px] p-6"+ style={grainBg(BAND)}+ >+ <span+ className="grid size-9 shrink-0 place-items-center rounded-[9px]"+ style={{ background: theme.chip, color: theme.glyph }}+ >+ <feature.Icon className="size-[18px]" />+ </span>+ <h3 className="mt-5 text-balance text-[19px] font-normal leading-[1.15] tracking-[-0.02em] text-[#111111]">+ {feature.title}+ </h3>+ <p+ className={`${BODY_TEXT} mt-3 text-[15px] leading-[1.5] text-[rgba(17,17,17,0.72)]`}+ >+ {feature.body}+ </p>+ </li>+ );+ })}+ </ul>++ <div className="mt-10 flex justify-center">+ <Link href="/features" className={classNames(BTN_SECONDARY)}>+ View all features+ </Link>+ </div>+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/FinalCta.tsx b/apps/web/components/pages/HomeTwo/FinalCta.tsxnew file mode 100644index 000000000..e4780fc11--- /dev/null+++ b/apps/web/components/pages/HomeTwo/FinalCta.tsx@@ -0,0 +1,75 @@+"use client";++import Link from "next/link";+import { Eyebrow } from "./Eyebrow";+import { Fit, SCENES, STAGE } from "./scenes";+import { LazyMount } from "./scenes/engine";+import {+ BODY_TEXT,+ BTN_PRIMARY,+ BTN_SECONDARY,+ H_HERO,+ MODE_THEME,+ type ModeKey,+ meshStyle,+} from "./theme";++const REEL: ModeKey[] = ["instant", "studio", "screenshot"];++export const FinalCta = () => (+ <section className="overflow-hidden pb-24 pt-20 lg:pb-28 lg:pt-28">+ <div className="mx-auto flex max-w-[900px] flex-col items-center px-5 text-center">+ <Eyebrow accent={MODE_THEME.share.accent}>Get started</Eyebrow>+ <h2+ className={`${H_HERO} mt-6 text-balance text-[clamp(44px,6.4vw,78px)]`}+ >+ Ready to upgrade how you communicate?+ </h2>+ <p+ className={`${BODY_TEXT} mt-7 max-w-[560px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[18px]`}+ >+ All of the work around screen recordings, handled in one place. Capture,+ polish, and share without the busywork.+ </p>+ <div className="mt-9 flex flex-col items-stretch gap-3 sm:flex-row sm:items-center">+ <Link href="/pricing" className={BTN_PRIMARY}>+ Upgrade to Cap Pro+ </Link>+ <Link href="/download" className={BTN_SECONDARY}>+ Download for free+ </Link>+ </div>+ </div>++ <div+ aria-hidden="true"+ className="mt-20 flex items-start justify-center gap-5 lg:gap-6"+ >+ {REEL.map((mode, i) => {+ const scene = SCENES[mode];+ const centre = i === 1;+ return (+ <div+ key={mode}+ className={+ centre+ ? "w-[min(92vw,640px)] shrink-0 rounded-[22px] p-3"+ : "hidden w-[460px] shrink-0 rounded-[22px] p-3 sm:block"+ }+ style={meshStyle(MODE_THEME[mode])}+ >+ <LazyMount w={STAGE.w} h={STAGE.h}>+ <Fit w={STAGE.w} h={STAGE.h} still>+ <scene.Scene+ chapter={0}+ playing={false}+ staticT={scene.poster}+ />+ </Fit>+ </LazyMount>+ </div>+ );+ })}+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/Hero.tsx b/apps/web/components/pages/HomeTwo/Hero.tsxnew file mode 100644index 000000000..2bd1fa1e7--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Hero.tsx@@ -0,0 +1,223 @@+"use client";++import { useDetectPlatform } from "hooks/useDetectPlatform";+import { ArrowDown } from "lucide-react";+import Image from "next/image";+import Link from "next/link";+import { useRef } from "react";+import { trackEvent } from "@/app/utils/analytics";+import { getDownloadUrl } from "@/utils/platform";+import { CapRecorderWindow } from "./demo/CapRecorderWindow";+import { LinkNotification } from "./demo/CapSurfaces";+import { MenuBar } from "./demo/MacDesktop";+import { AppleGlyph } from "./glyphs";+import { HeroHeadline } from "./HeroHeadline";+import { Fit, noop, useInView } from "./scenes/engine";+import {+ BODY_TEXT,+ BTN_PRIMARY,+ BTN_SECONDARY,+ MODE_THEME,+ meshStyle,+} from "./theme";++const PHONE_STAGE = { w: 440, h: 508 };++const PhoneStage = () => {+ const boxRef = useRef<HTMLDivElement | null>(null);+ const inView = useInView(boxRef, "0px");+ return (+ <div ref={boxRef} className="mt-10 w-full md:hidden">+ <div+ className="rounded-[22px] p-2.5"+ style={meshStyle(MODE_THEME.instant)}+ >+ <Fit w={PHONE_STAGE.w} h={PHONE_STAGE.h} className="mx-auto">+ <div+ className="relative overflow-hidden rounded-[14px] bg-black"+ style={{ width: PHONE_STAGE.w, height: PHONE_STAGE.h }}+ >+ <Image+ src="/backgrounds/sf.webp"+ alt=""+ fill+ sizes="440px"+ draggable={false}+ className="object-cover"+ />+ <MenuBar recording={false} onSwitchOs={noop} />+ <div className="absolute z-20" style={{ left: 48, top: 30 }}>+ <LinkNotification visible={inView} onOpen={noop} />+ </div>+ <div className="absolute z-10" style={{ left: 55, top: 104 }}>+ <CapRecorderWindow+ ui={{+ visible: true,+ mode: "instant",+ displaySelected: true,+ cameraOn: true,+ }}+ onMode={noop}+ onSelectDisplay={noop}+ onToggleCamera={noop}+ onMiss={noop}+ />+ </div>+ </div>+ </Fit>+ </div>+ </div>+ );+};++const WindowsGlyph = ({ className }: { className?: string }) => (+ <svg+ aria-hidden="true"+ className={className}+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <path d="M0,0H11.377V11.372H0ZM12.623,0H24V11.372H12.623ZM0,12.623H11.377V24H0Zm12.623,0H24V24H12.623" />+ </svg>+);++/** Small muted link to /download for the platforms not shown on the button. */+const AltIcon = ({+ label,+ children,+}: {+ label: string;+ children: React.ReactNode;+}) => (+ <Link+ href="/download"+ aria-label={`Download Cap: ${label}`}+ title={label}+ className="grid size-7 place-items-center rounded-[7px] text-[rgba(17,17,17,0.45)] transition-colors duration-200 hover:bg-[#E7EDF3] hover:text-[#111111] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]"+ >+ {children}+ </Link>+);++export const Hero = () => {+ const { platform, isIntel } = useDetectPlatform();+ // Default the display to macOS while detection resolves (same pattern as+ // the live homepage Header): majority platform, identical button size.+ const displayPlatform = platform ?? "macos";+ const isWindows = displayPlatform === "windows";+ const isLinux = displayPlatform === "linux";+ const platformName = isWindows ? "Windows" : isLinux ? "Linux" : "macOS";+ const downloadHref = isWindows+ ? "/download"+ : getDownloadUrl(displayPlatform, isIntel);++ return (+ // On desktop the hero takes the fold minus the laptop's peek and centres+ // itself in it, so the space above and below the block stays even instead+ // of piling up under the buttons. Capped, because on a tall monitor a+ // viewport-tall hero just reads as a hole.+ <section className="relative px-5 pb-12 pt-12 sm:pt-14 md:pb-4 md:pt-[56px]">+ <span+ data-header-sentinel+ aria-hidden="true"+ className="pointer-events-none absolute bottom-0 left-0 size-px"+ />+ <div className="mx-auto flex max-w-[1020px] flex-col items-center text-center">+ <HeroHeadline />++ <p+ className={`${BODY_TEXT} mt-8 max-w-[660px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[19px] md:mt-10`}+ >+ One open source app for every way you capture your screen. Start free+ and move to Cap Pro when you need more, whether you work alone, with a+ small team, or across an entire organization.+ </p>++ <div className="mt-9 flex flex-col items-stretch gap-3 sm:flex-row sm:items-center">+ <Link+ href={downloadHref}+ onClick={() =>+ trackEvent("download_cta_clicked", {+ source_page: "home_header",+ cta_location: "primary",+ target_url: downloadHref,+ detected_platform: platform ?? "unknown",+ is_intel: Boolean(isIntel),+ })+ }+ className={BTN_PRIMARY}+ >+ {isWindows ? (+ <WindowsGlyph className="mr-2.5 size-[18px]" />+ ) : isLinux ? (+ <Image+ src="/logos/os/linux.svg"+ alt=""+ width={19}+ height={19}+ className="mr-2.5 size-[19px]"+ />+ ) : (+ <AppleGlyph className="mr-2.5 size-[19px]" />+ )}+ Download free for {platformName}+ </Link>+ {/* Scrolls to the demo AND starts the tour, so the click has an+ unmistakable payoff instead of landing on an idle laptop. */}+ <button+ type="button"+ onClick={() => {+ window.dispatchEvent(new Event("ht-demo-start"));+ document+ .getElementById("modes")+ ?.scrollIntoView({ behavior: "smooth" });+ }}+ className={`${BTN_SECONDARY} group cursor-pointer gap-2.5`}+ >+ See how Cap works+ <span className="grid size-6 place-items-center rounded-full bg-[#E7EDF3] text-[rgba(17,17,17,0.65)] transition-colors duration-200 group-hover:bg-[#DCE4EC] group-hover:text-[#111111]">+ <ArrowDown className="size-3.5 transition-transform duration-200 group-hover:translate-y-[2px]" />+ </span>+ </button>+ </div>++ <div className="mt-5 flex items-center gap-2 text-[14px] text-[rgba(17,17,17,0.5)]">+ <span>Also available on</span>+ <span className="flex items-center gap-1">+ {isWindows || isLinux ? (+ <AltIcon label="macOS">+ <AppleGlyph className="size-4" />+ </AltIcon>+ ) : null}+ {!isWindows ? (+ <AltIcon label="Windows">+ <WindowsGlyph className="size-[15px]" />+ </AltIcon>+ ) : null}+ {!isLinux ? (+ <AltIcon label="Linux">+ <Image+ src="/logos/os/linux.svg"+ alt=""+ width={16}+ height={16}+ className="size-4 opacity-60"+ />+ </AltIcon>+ ) : null}+ <AltIcon label="Chrome">+ <Image+ src="/logos/browsers/google-chrome.svg"+ alt=""+ width={16}+ height={16}+ className="size-4 opacity-70"+ />+ </AltIcon>+ </span>+ </div>+ <PhoneStage />+ </div>+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/HeroHeadline.tsx b/apps/web/components/pages/HomeTwo/HeroHeadline.tsxnew file mode 100644index 000000000..b9aa16177--- /dev/null+++ b/apps/web/components/pages/HomeTwo/HeroHeadline.tsx@@ -0,0 +1,524 @@+"use client";++import { useDetectPlatform } from "hooks/useDetectPlatform";+import { useCallback, useEffect, useRef, useState } from "react";+import {+ InstantIcon,+ ScreenshotIcon,+ StudioIcon,+} from "@/components/pages/HomePage/modeIcons";+import { MacCursor, WindowsCursor } from "./cursors";+import { H_HERO, INK, MODE_THEME, type ModeKey } from "./theme";++/**+ * The hero headline is a three-slot machine: capture verb, middle beat,+ * payoff. The slots keep their rhythm while the words are revised, so one+ * sentence re-reads as a different mode.+ *+ * Record. Edit. Share. (at rest)+ * Record. Stop. Instant Share. (Instant)+ * Record. Edit. Export. (Studio)+ * Screenshot. Beautify. Paste. (Screenshot)+ *+ * Nothing moves on its own: the mode bar sits above the line from the first+ * paint with a cursor leaning in beside it, and you click a mode to watch+ * the line get revised. The revision is staged like an edit on paper: a rule+ * strikes through the word in the incoming mode's colour, the struck word+ * lifts away, and the replacement rises into the gap while the slot width+ * glides so the line re-centres. Words that survive the change are never+ * struck, so you see exactly what the mode changes, which is why Studio only+ * crosses out the last word.+ */++type SlideKey = ModeKey | "all";++type Slide = {+ key: SlideKey;+ /** [capture, middle, payoff] */+ words: [string, string, string];+};++const SLIDES: Slide[] = [+ { key: "all", words: ["Record.", "Edit.", "Share."] },+ { key: "instant", words: ["Record.", "Stop.", "Instant Share."] },+ { key: "studio", words: ["Record.", "Edit.", "Export."] },+ { key: "screenshot", words: ["Screenshot.", "Beautify.", "Paste."] },+];++/** The cursor's one line: it invites the click, then retires once you take it. */+const NUDGE = "Click me \u{1F440}";+const NUDGE_TOUCH = "Tap me \u{1F440}";+const TOUCH_QUERY = "(max-width: 767px)";+const TYPE_MS = 26;+/** The cursor leans in first, then starts talking. */+const NUDGE_AT = 520;+const TYPE_AT = NUDGE_AT + 260;++type PillKey = Extract<ModeKey, "instant" | "studio" | "screenshot">;++const PILLS: { key: PillKey; label: string; short: string; slide: number }[] = [+ { key: "instant", label: "Instant Mode", short: "Instant", slide: 1 },+ { key: "studio", label: "Studio Mode", short: "Studio", slide: 2 },+ {+ key: "screenshot",+ label: "Screenshot Mode",+ short: "Screenshot",+ slide: 3,+ },+];++const PILL_ICON = {+ instant: InstantIcon,+ studio: StudioIcon,+ screenshot: ScreenshotIcon,+} as const;++/* --------------------------------------------------------------- timing -- */++/** Per-slot head start, so the revision runs left to right down the line. */+const SLOT_DELAY = [0, 120, 240];+/** Rule sweeps across the word. */+const STRIKE_MS = 260;+/** Beat where the struck word just sits there, crossed out. */+const HOLD_MS = 110;+/** Struck word (and its rule) lift away. */+const LIFT_MS = 260;+/** Replacement rises in, overlapping the lift so the two read as one move. */+const RISE_MS = 520;++const LIFT_AT = STRIKE_MS + HOLD_MS;+const RISE_AT = LIFT_AT + 150;+const WIDTH_AT = LIFT_AT + 60;++/* ------------------------------------------------------------------ slot -- */++type Departing = { text: string; color: string; id: number };++type Swap = { text: string; gen: number; from: Departing | null };++const Slot = ({+ text,+ color,+ strike,+ delay,+ animate,+}: {+ text: string;+ /** Ink for most slots, the mode's colour for the payoff. */+ color: string;+ /** Colour of the cross-out rule: the incoming mode's. */+ strike: string;+ delay: number;+ animate: boolean;+}) => {+ const ghostRef = useRef<HTMLSpanElement>(null);+ const [width, setWidth] = useState<number>();+ // The swap has to be derived during render, not in an effect: the exit+ // layer, the remount key and the enter animation all have to appear in+ // the same commit as the new word, or the replacement pops in unanimated.+ const [swap, setSwap] = useState<Swap>(() => ({+ text,+ gen: 0,+ from: null,+ }));+ // Holds the colour the slot was painted in for the word now leaving.+ const paintedColor = useRef(color);++ if (swap.text !== text) {+ setSwap({+ text,+ gen: swap.gen + 1,+ // A word that survives the mode change is never struck out: it just+ // stays put while its neighbours are revised around it.+ from: animate+ ? { text: swap.text, color: paintedColor.current, id: swap.gen + 1 }+ : null,+ });+ }++ useEffect(() => {+ paintedColor.current = color;+ }, [color]);++ const measure = useCallback(() => {+ const el = ghostRef.current;+ if (el) setWidth(el.getBoundingClientRect().width);+ }, []);++ // The ghost is in flow and invisible, so it always carries the natural+ // width of whatever the slot is currently showing. Remeasure when the+ // word, the loaded fonts, or the clamped font size changes.+ // biome-ignore lint/correctness/useExhaustiveDependencies: remeasure on word change+ useEffect(() => {+ measure();+ }, [measure, text]);++ useEffect(() => {+ window.addEventListener("resize", measure);+ document.fonts?.ready.then(measure).catch(() => {});+ return () => window.removeEventListener("resize", measure);+ }, [measure]);++ // Retire the struck word once it has finished lifting. The enter class is+ // left in place (it fills forwards) so the timer can't clip the rise.+ const departingId = swap.from?.id;+ useEffect(() => {+ if (departingId === undefined) return;+ const timer = window.setTimeout(+ () =>+ setSwap((s) => (s.from?.id === departingId ? { ...s, from: null } : s)),+ delay + LIFT_AT + LIFT_MS + 40,+ );+ return () => window.clearTimeout(timer);+ }, [departingId, delay]);++ const entering = animate && swap.gen > 0;++ return (+ <span+ className="ht-slot"+ style={{+ width,+ color,+ transitionDelay: `${delay + WIDTH_AT}ms`,+ }}+ >+ {/* Sets the slot's height and its natural (target) width. */}+ <span ref={ghostRef} className="ht-slot-ghost" aria-hidden="true">+ {text}+ </span>++ {swap.from ? (+ <span key={`out-${swap.from.id}`} className="ht-layer">+ <span+ className="ht-out"+ style={{+ color: swap.from.color,+ animationDelay: `${delay + LIFT_AT}ms`,+ }}+ >+ {swap.from.text}+ <span+ className="ht-strike"+ style={{ background: strike, animationDelay: `${delay}ms` }}+ />+ </span>+ </span>+ ) : null}++ <span key={`in-${swap.gen}`} className="ht-layer">+ <span+ className={entering ? "ht-in" : undefined}+ style={+ entering ? { animationDelay: `${delay + RISE_AT}ms` } : undefined+ }+ >+ {text}+ </span>+ </span>+ </span>+ );+};++/* -------------------------------------------------------------- headline -- */++export const HeroHeadline = () => {+ const { platform } = useDetectPlatform();+ const [index, setIndex] = useState(0);+ const [typed, setTyped] = useState(0);+ const [nudgeText, setNudgeText] = useState(NUDGE);+ const [nudge, setNudge] = useState(false);+ const [asked, setAsked] = useState(true);+ const [reduced, setReduced] = useState(false);++ // Match the download button: assume macOS while detection resolves, so the+ // arrow never swaps shape under the reader.+ const Arrow = platform === "windows" ? WindowsCursor : MacCursor;++ useEffect(() => {+ const query = window.matchMedia("(prefers-reduced-motion: reduce)");+ const sync = () => setReduced(query.matches);+ sync();+ query.addEventListener("change", sync);+ return () => query.removeEventListener("change", sync);+ }, []);++ // The cursor leans in, then types its line. Reduced motion gets both at+ // once, already finished.+ useEffect(() => {+ const text = window.matchMedia(TOUCH_QUERY).matches ? NUDGE_TOUCH : NUDGE;+ setNudgeText(text);+ if (reduced) {+ setNudge(true);+ setTyped(text.length);+ return;+ }+ const lean = window.setTimeout(() => setNudge(true), NUDGE_AT);+ let tick = 0;+ const start = window.setTimeout(() => {+ tick = window.setInterval(() => {+ setTyped((n) => {+ if (n + 1 >= text.length) window.clearInterval(tick);+ return n + 1;+ });+ }, TYPE_MS);+ }, TYPE_AT);+ return () => {+ window.clearTimeout(lean);+ window.clearTimeout(start);+ window.clearInterval(tick);+ };+ }, [reduced]);++ const slide = SLIDES[index] ?? SLIDES[0];+ if (!slide) return null;+ const theme = slide.key === "all" ? null : MODE_THEME[slide.key];+ const accent = theme ? theme.glyph : INK;++ // Clicking the mode you're already on puts the plain line back, so you can+ // always see what Cap changed.+ const pick = (target: number) => {+ setIndex((current) => (current === target ? 0 : target));+ // The cursor and its bubble have done their job the moment you click.+ setAsked(false);+ };++ return (+ <div className="flex w-full flex-col items-center">+ <style href="ht-hero-headline" precedence="default">+ {CSS}+ </style>++ <div className="relative pb-10 md:pb-14">+ <div className="mx-auto flex w-fit flex-nowrap items-center justify-center gap-0.5 rounded-full border border-[#DDE4EB] bg-white/70 p-1 shadow-[0_1px_2px_rgba(17,17,17,0.04)]">+ {PILLS.map((pill) => {+ const active = index === pill.slide;+ const pillTheme = MODE_THEME[pill.key];+ const Icon = PILL_ICON[pill.key];+ return (+ <button+ key={pill.key}+ type="button"+ onClick={() => pick(pill.slide)}+ aria-pressed={active}+ className={`flex h-8 items-center gap-1.5 whitespace-nowrap rounded-full px-2.5 transition-colors duration-300 sm:px-3 ${+ active+ ? "text-[#111111]"+ : "text-[rgba(17,17,17,0.5)] hover:bg-[#EDF1F6] hover:text-[#111111]"+ } focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111] focus-visible:ring-offset-1 focus-visible:ring-offset-white`}+ style={active ? { background: pillTheme.chip } : undefined}+ >+ <Icon className="size-3.5" />+ <span className="text-[13px] font-medium leading-none">+ <span className="sm:hidden">{pill.short}</span>+ <span className="hidden sm:inline">{pill.label}</span>+ </span>+ </button>+ );+ })}+ </div>++ {/* Nothing cycles on its own, so the cursor is what says the line is+ yours to change. It retires as soon as you take it up on the+ offer. */}+ <span+ aria-hidden="true"+ className={`ht-nudge ${nudge && asked ? "is-on" : ""}`}+ >+ <span className="ht-nudge-float">+ {/* Width reserved up front so each line types out from a fixed+ left edge instead of walking as it grows. */}+ <span className={`ht-nudge-chip ${typed > 0 ? "is-typed" : ""}`}>+ <span className="invisible">{nudgeText}</span>+ <span className="absolute inset-0 flex items-center px-[10px]">+ {nudgeText.slice(0, typed)}+ {typed < nudgeText.length ? (+ <span className="ht-caret" />+ ) : null}+ </span>+ </span>+ <Arrow className="ht-nudge-arrow" />+ </span>+ </span>+ </div>++ <h1 className={`${H_HERO} text-[clamp(36px,5.6vw,74px)]`}>+ <span className="sr-only">+ Record. Edit. Share. Cap has three recording modes: Instant, Studio,+ and Screenshot.+ </span>+ <span+ aria-hidden="true"+ className="ht-headline flex flex-col items-center sm:flex-row sm:justify-center sm:gap-[0.26em]"+ >+ {slide.words.map((word, i) => (+ <Slot+ key={`slot-${i === 0 ? "capture" : i === 1 ? "beat" : "payoff"}`}+ text={word}+ color={i === 2 ? accent : INK}+ strike={accent}+ delay={SLOT_DELAY[i] ?? 0}+ animate={!reduced}+ />+ ))}+ </span>+ </h1>+ </div>+ );+};++const CSS = `+/* The site's base sheet pins spans to line-height 1.5rem, which would+ collapse the slot line boxes. Restore the H_HERO leading. */+.ht-headline, .ht-headline span { line-height: 0.98; }++.ht-slot {+ position: relative;+ display: inline-block;+ white-space: nowrap;+ vertical-align: top;+ transition: width 560ms cubic-bezier(0.22, 0.9, 0.24, 1),+ color 1ms linear;+}+.ht-slot-ghost { visibility: hidden; }+.ht-layer {+ position: absolute;+ inset: 0;+ display: flex;+ align-items: flex-start;+ justify-content: center;+ white-space: nowrap;+ pointer-events: none;+}+.ht-layer > span { position: relative; display: inline-block; }++/* The cross-out rule, drawn through the x-height and running a hair past+ the word at both ends the way a pen would. */+.ht-strike {+ position: absolute;+ left: -0.04em;+ right: -0.04em;+ top: 0.54em;+ height: 0.055em;+ border-radius: 999px;+ transform-origin: left center;+ animation: ht-strike ${STRIKE_MS}ms cubic-bezier(0.5, 0, 0.2, 1) both;+}++@keyframes ht-strike { from { transform: scaleX(0); } to { transform: scaleX(1); } }+@keyframes ht-out {+ from { opacity: 1; transform: translate3d(0, 0, 0); }+ to { opacity: 0; transform: translate3d(0, -0.55em, 0); }+}+@keyframes ht-in {+ from { opacity: 0; transform: translate3d(0, 0.5em, 0); }+ to { opacity: 1; transform: translate3d(0, 0, 0); }+}+.ht-out { animation: ht-out ${LIFT_MS}ms cubic-bezier(0.4, 0, 0.75, 0.2) both; }+.ht-in { animation: ht-in ${RISE_MS}ms cubic-bezier(0.18, 0.9, 0.22, 1) both; }++/* Caret for the nudge as it types itself out. */+.ht-caret {+ display: inline-block;+ width: 1.5px;+ height: 1em;+ margin-left: 2px;+ vertical-align: -0.12em;+ background: rgba(255, 255, 255, 0.85);+ animation: ht-blink 1s steps(1, end) infinite;+}+@keyframes ht-blink { 0%, 50% { opacity: 1; } 50.01%, 100% { opacity: 0; } }++/* The cursor leaning in beside the mode bar. Hidden on phones, where there+ is no room beside a wrapped bar and no cursor to speak of on touch. */+.ht-nudge {+ display: block;+ position: absolute;+ left: 6%;+ right: auto;+ top: 46px;+ z-index: 20;+ pointer-events: none;+ opacity: 0;+ transform: translate3d(9px, 7px, 0) scale(0.94);+ transform-origin: right center;+ transition: opacity 260ms ease,+ transform 340ms cubic-bezier(0.18, 0.9, 0.22, 1);+}+.ht-nudge.is-on {+ opacity: 1;+ transform: translate3d(0, 0, 0) scale(1);+}+/* Bubble and cursor sit side by side, the tail on the bubble's right edge+ reaching across the gap to the arrow. */+.ht-nudge-float {+ display: flex;+ align-items: flex-start;+ gap: 7px;+}+.ht-nudge.is-on .ht-nudge-float {+ animation: ht-nudge-float 3.2s ease-in-out 360ms infinite;+}+@keyframes ht-nudge-float {+ 0%, 100% { transform: translate3d(0, 0, 0); }+ 50% { transform: translate3d(-3px, -3px, 0); }+}++.ht-nudge-arrow {+ display: none;+ flex: none;+ width: 17px;+ height: auto;+ filter: drop-shadow(0 2px 5px rgba(17, 17, 17, 0.28));+}+/* An iMessage bubble sitting to the left of the cursor with its tail aimed+ back at it. The mode bar and the page behind it are all white, so the chip+ needs its own colour to land, and it stays a size under the mode toggles+ (13px) so it reads as an aside rather than a fourth control. */+.ht-nudge-chip {+ position: relative;+ display: block;+ margin-top: 0;+ white-space: nowrap;+ border-radius: 13px;+ background: linear-gradient(180deg, #2f95ff 0%, #0a7cff 100%);+ padding: 5px 10px;+ font-size: 10.5px;+ font-weight: 500;+ letter-spacing: -0.005em;+ line-height: 1;+ color: #ffffff;+ box-shadow: 0 1px 1px rgba(10, 124, 255, 0.25),+ 0 8px 18px -9px rgba(10, 124, 255, 0.55);+ opacity: 0;+ transition: opacity 170ms ease;+}+.ht-nudge-chip::before {+ content: "";+ position: absolute;+ left: 16px;+ top: -3px;+ width: 8px;+ height: 8px;+ border-radius: 2px;+ background: linear-gradient(180deg, #2f95ff 0%, #0a7cff 100%);+ transform: rotate(45deg);+}+/* Only ever seen with type in it, so the swap between the two lines resizes+ the chip while it is invisible. */+.ht-nudge-chip.is-typed { opacity: 1; }+@media (min-width: 768px) {+ .ht-nudge { left: auto; right: 80%; top: 26px; }+ .ht-nudge-arrow { display: block; }+ .ht-nudge-chip { margin-top: 14px; }+ .ht-nudge-chip::before { left: auto; right: -3px; top: 9px; }+}+@media (min-width: 1024px) { .ht-nudge { right: 94%; } }++@media (prefers-reduced-motion: reduce) {+ .ht-slot { transition: none; }+ .ht-nudge, .ht-nudge-chip { transition: none; }+ .ht-strike, .ht-out, .ht-in, .ht-caret { animation: none; }+ .ht-nudge.is-on .ht-nudge-float { animation: none; }+}+`;diff --git a/apps/web/components/pages/HomeTwo/LoomBridge.tsx b/apps/web/components/pages/HomeTwo/LoomBridge.tsxnew file mode 100644index 000000000..a977c4a85--- /dev/null+++ b/apps/web/components/pages/HomeTwo/LoomBridge.tsx@@ -0,0 +1,56 @@+import { classNames } from "@cap/utils/helpers";+import { ArrowRight } from "lucide-react";+import Link from "next/link";+import { Eyebrow } from "./Eyebrow";+import {+ BAND,+ BODY_TEXT,+ BTN_PRIMARY,+ EYEBROW,+ grainBg,+ MODE_THEME,+} from "./theme";++/**+ * The Loom-switcher bridge. The comparison cluster is the best-converting+ * message on the site, so it earns a dedicated moment on the homepage:+ * one-click library import plus the standing MIGRATE20 offer.+ */+export const LoomBridge = () => (+ <section className="px-5 pb-4 pt-2">+ <div+ className="mx-auto flex max-w-[1200px] flex-col items-start justify-between gap-8 rounded-[20px] p-8 lg:flex-row lg:items-center lg:p-12"+ style={grainBg(BAND)}+ >+ <div className="max-w-[560px]">+ <Eyebrow accent={MODE_THEME.instant.accent}>+ Switching from Loom+ </Eyebrow>+ <h2 className="mt-5 text-balance text-[clamp(28px,3.2vw,40px)] font-normal leading-[1.05] tracking-[-0.03em] text-[#111111]">+ Bring your whole Loom library with you+ </h2>+ <p+ className={`${BODY_TEXT} mt-4 max-w-[500px] text-[16px] leading-[1.5] text-[rgba(17,17,17,0.78)]`}+ >+ Import every video in one click and pick up where you left off. Your+ recordings land in storage you own, on a plan that stays free.+ </p>+ </div>++ <div className="flex flex-col items-start gap-3 lg:items-end">+ <Link href="/tools/loom-downloader" className={BTN_PRIMARY}>+ Import from Loom+ <ArrowRight className="ml-2 size-4" />+ </Link>+ <p+ className={classNames(+ EYEBROW,+ "text-[11px] text-[rgba(17,17,17,0.5)]",+ )}+ >+ MIGRATE20 · 20% off Pro, forever+ </p>+ </div>+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/ModeWalkthrough.tsx b/apps/web/components/pages/HomeTwo/ModeWalkthrough.tsxnew file mode 100644index 000000000..98589a32e--- /dev/null+++ b/apps/web/components/pages/HomeTwo/ModeWalkthrough.tsx@@ -0,0 +1,227 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { Link2 } from "lucide-react";+import dynamic from "next/dynamic";+import { getImageProps } from "next/image";+import Link from "next/link";+import type { ComponentType } from "react";+import { useEffect, useState } from "react";+import {+ InstantIcon,+ ScreenshotIcon,+ StudioIcon,+} from "@/components/pages/HomePage/modeIcons";++import { htGeist } from "./fonts";+import { Fit, SCENES, STAGE } from "./scenes";+import { LazyMount } from "./scenes/engine";+import {+ BODY_TEXT,+ CARD_BG,+ grainBg,+ H_CARD,+ MODE_THEME,+ type ModeKey,+ meshStyle,+} from "./theme";++const DesktopDemo = dynamic(+ () => import("./demo/DesktopDemo").then((m) => m.DesktopDemo),+ {+ loading: () => <div className="h-[100svh] max-h-[860px] min-h-[660px]" />,+ },+);++const { props: wallpaper } = getImageProps({+ src: "/backgrounds/sf.webp",+ alt: "",+ fill: true,+ sizes: "1360px",+});++type Step = {+ key: ModeKey;+ label: string;+ heading: string;+ body: string;+ href: string;+ extraChip?: string;+ Icon: ComponentType<{ className?: string }>;+};++/**+ * Static cards for the stacked fallback (mobile, and anyone who prefers+ * reduced motion). The pinned experience is the DesktopDemo.+ */+const STEPS: Step[] = [+ {+ key: "instant",+ label: "Instant Mode",+ heading: "Share your screen in seconds",+ body: "Hit record and Cap uploads as you go. The moment you stop, a share link is on your clipboard, ready to paste anywhere.",+ href: "/features",+ Icon: InstantIcon,+ },+ {+ key: "studio",+ label: "Studio Mode",+ heading: "Full quality, edited before you share",+ body: "Record locally in 4K with separate screen, camera, and mic tracks. Polish with backgrounds, automatic zoom, and cursor effects in the built in editor.",+ href: "/features",+ Icon: StudioIcon,+ },+ {+ key: "screenshot",+ label: "Screenshot Mode",+ heading: "Screenshots that look designed",+ body: "Capture any window with a hotkey, beautify it with one click, and copy it straight to your clipboard.",+ href: "/features",+ Icon: ScreenshotIcon,+ },+ {+ key: "share",+ label: "Share",+ heading: "One link does the rest",+ body: "Every capture gets a Cap page with comments, reactions, transcript, and chapters. Viewers watch in the browser. No download, no account.",+ href: "/features",+ extraChip: "Every mode",+ Icon: Link2,+ },+];++const LEARN_MORE =+ "mt-7 inline-flex items-center gap-1.5 rounded-sm text-[15.5px] font-normal text-[#111111] underline decoration-[rgba(17,17,17,0.3)] underline-offset-[6px] transition-colors duration-200 hover:decoration-[#111111] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111] focus-visible:ring-offset-4 focus-visible:ring-offset-[#F8FAFC]";++const StackedSteps = ({ className }: { className?: string }) => (+ <div className={classNames("px-3 pb-12 pt-2 sm:px-4", className)}>+ <div className="mx-auto flex max-w-[720px] flex-col gap-5">+ {STEPS.map((step) => {+ const theme = MODE_THEME[step.key];+ const scene = SCENES[step.key];+ return (+ <div+ key={step.key}+ className="overflow-hidden rounded-[20px] p-2.5"+ style={meshStyle(theme)}+ >+ <div className="rounded-[14px] p-6 sm:p-8" style={grainBg(CARD_BG)}>+ <div className="flex flex-wrap items-center gap-2">+ <span className="inline-flex items-center gap-2.5">+ <span+ className="grid size-8 shrink-0 place-items-center rounded-[8px]"+ style={{ background: theme.chip, color: theme.glyph }}+ >+ <step.Icon className="h-4 w-4" />+ </span>+ <span className="text-[15px] font-medium text-[#111111]">+ {step.label}+ </span>+ </span>+ {step.extraChip ? (+ <span className="rounded-full bg-[#E7EDF3] px-2.5 py-1 text-[12px] font-normal text-[rgba(17,17,17,0.55)]">+ {step.extraChip}+ </span>+ ) : null}+ </div>++ <h3+ className={`${H_CARD} mt-6 max-w-[430px] text-balance text-[clamp(30px,3.1vw,42px)]`}+ >+ {step.heading}+ </h3>++ <p+ className={`${BODY_TEXT} mt-5 max-w-[420px] text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)]`}+ >+ {step.body}+ </p>++ <Link href={step.href} className={LEARN_MORE}>+ Learn more+ <span aria-hidden="true">→</span>+ </Link>++ <div className="mt-8">+ <LazyMount w={STAGE.w} h={STAGE.h} className="mx-auto">+ <Fit w={STAGE.w} h={STAGE.h} still>+ <scene.Scene+ chapter={0}+ playing={false}+ staticT={scene.poster}+ />+ </Fit>+ </LazyMount>+ </div>+ </div>+ </div>+ );+ })}+ </div>+ </div>+);++/* -------------------------------------------------------------------------- */++export const ModeWalkthrough = () => {+ // `false` on the server and on the first client render, so the markup the+ // server produced (CSS-driven responsive split) hydrates identically.+ const [forceStacked, setForceStacked] = useState(false);+ const [desktop, setDesktop] = useState(false);+ const [startRequested, setStartRequested] = useState(false);++ useEffect(() => {+ const reduced = window.matchMedia("(prefers-reduced-motion: reduce)");+ const wide = window.matchMedia("(min-width: 768px)");+ const sync = () => {+ setForceStacked(reduced.matches);+ if (wide.matches && !reduced.matches) setDesktop(true);+ };+ sync();+ reduced.addEventListener("change", sync);+ wide.addEventListener("change", sync);+ return () => {+ reduced.removeEventListener("change", sync);+ wide.removeEventListener("change", sync);+ };+ }, []);++ useEffect(() => {+ const start = () => setStartRequested(true);+ window.addEventListener("ht-demo-start", start);+ return () => window.removeEventListener("ht-demo-start", start);+ }, []);++ return (+ // biome-ignore lint/correctness/useUniqueElementIds: stable anchor target for the hero's "See how it works" link+ <section+ id="modes"+ aria-labelledby="modes-heading"+ className={`${htGeist.variable} scroll-mt-[68px] lg:scroll-mt-[76px]`}+ >+ <link+ rel="preload"+ as="image"+ href={wallpaper.srcSet ? undefined : wallpaper.src}+ fetchPriority="high"+ imageSrcSet={wallpaper.srcSet}+ imageSizes={wallpaper.sizes}+ media="(min-width: 768px) and (prefers-reduced-motion: no-preference)"+ />+ {/* biome-ignore lint/correctness/useUniqueElementIds: paired with the section's aria-labelledby above */}+ <h2 id="modes-heading" className="sr-only">+ How Cap works: Instant Mode, Studio Mode, and the editor+ </h2>++ <div className={forceStacked ? "hidden" : "hidden md:block"}>+ {desktop ? (+ <DesktopDemo startRequested={startRequested} />+ ) : (+ <div className="h-[100svh] max-h-[860px] min-h-[660px]" />+ )}+ </div>++ <StackedSteps className={forceStacked ? "block" : "md:hidden"} />+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/Ownership.tsx b/apps/web/components/pages/HomeTwo/Ownership.tsxnew file mode 100644index 000000000..8e207a02f--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Ownership.tsx@@ -0,0 +1,439 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { Server } from "lucide-react";+import Image from "next/image";+import { type ReactNode, useEffect, useRef, useState } from "react";+import { CapLogoMark } from "./demo/capIcons";+import { Eyebrow } from "./Eyebrow";+import { Scaled } from "./scenes/engine";+import {+ BAND,+ BODY_TEXT,+ EYEBROW,+ grainBg,+ H_SECTION,+ MODE_THEME,+ type ModeKey,+} from "./theme";+import { useInView, usePageVisible, useReducedMotion } from "./visibility";++const QUOTE = {+ name: "Steven Tey",+ handle: "Founder, Dub.co",+ image: "/testimonials/steven_tey.jpg",+ content:+ "Cap is one of my favorite pieces of software I've used in the recent years. Best part is you get to own your data since they're fully open-source + via their S3 integration.",+};++type Destination = {+ key: string;+ name: string;+ label: string;+ detail: string;+ mode: ModeKey;+ icon: ReactNode;+};++const DESTINATIONS: Destination[] = [+ {+ key: "cloud",+ name: "Cap Cloud",+ label: "Cap Cloud",+ detail: "Zero setup. Encrypted, and shareable the second you stop.",+ mode: "instant",+ icon: <CapLogoMark className="size-6" />,+ },+ {+ key: "s3",+ name: "Your own S3 bucket",+ label: "Your S3 bucket",+ detail: "Any S3 compatible bucket, in any region you choose.",+ mode: "studio",+ icon: (+ <span className="grid size-6 place-items-center rounded-[6px] bg-[#111111] text-[10px] font-semibold text-white">+ S3+ </span>+ ),+ },+ {+ key: "drive",+ name: "Google Drive",+ label: "Google Drive",+ detail: "Recordings land in a Drive folder you pick.",+ mode: "screenshot",+ icon: (+ <Image+ src="/logos/google-drive.svg"+ alt=""+ width={24}+ height={24}+ className="size-6"+ />+ ),+ },+ {+ key: "self",+ name: "Self hosted",+ label: "Self hosted",+ detail: "Run the whole platform on your own infrastructure.",+ mode: "share",+ icon: <Server className="size-5 text-[#111111]" />,+ },+];++const PROOF = [+ {+ label: "Open source",+ body: "Every line is on GitHub. Audit it, fork it, or contribute the feature you need.",+ },+ {+ label: "SOC 2 Type II · ISO 27001",+ body: "Independently audited controls behind Cap Cloud.",+ },+ {+ label: "HIPAA compliant",+ body: "Signed BAAs for organizations handling PHI.",+ },+ {+ label: "No lock in",+ body: "Recordings are plain video files. Take them anywhere, any time.",+ },+];++const DIAGRAM = { w: 560, h: 340 };+const SOURCE = { x: 168, y: DIAGRAM.h / 2 };+const NODE = { x: 372, w: 176, h: 56, gap: 22 };+const nodeY = (i: number) =>+ (DIAGRAM.h - (NODE.h * 4 + NODE.gap * 3)) / 2 + i * (NODE.h + NODE.gap);+const routePath = (i: number) => {+ const cy = nodeY(i) + NODE.h / 2;+ const mid = (SOURCE.x + NODE.x) / 2;+ return `M ${SOURCE.x} ${SOURCE.y} C ${mid} ${SOURCE.y}, ${mid} ${cy}, ${NODE.x} ${cy}`;+};++const ROUTE_CSS = `+ @keyframes ht-route-packet {+ from { offset-distance: 0%; opacity: 0; }+ 8% { opacity: 1; }+ 92% { opacity: 1; }+ to { offset-distance: 100%; opacity: 0; }+ }+ @keyframes ht-route-dash {+ to { stroke-dashoffset: -28; }+ }+ @keyframes ht-route-land {+ 0% { box-shadow: 0 0 0 0 var(--ht-glow); }+ 100% { box-shadow: 0 0 0 14px transparent; }+ }+`;++const StorageRoute = ({+ active,+ playing,+}: {+ active: number;+ playing: boolean;+}) => {+ const theme = MODE_THEME[DESTINATIONS[active]?.mode ?? "instant"];+ const animationPlayState = playing ? "running" : "paused";+ return (+ <Scaled w={DIAGRAM.w} h={DIAGRAM.h} className="mx-auto">+ <style>{ROUTE_CSS}</style>+ <svg+ aria-hidden="true"+ viewBox={`0 0 ${DIAGRAM.w} ${DIAGRAM.h}`}+ className="absolute inset-0 h-full w-full"+ >+ {DESTINATIONS.map((destination, i) => (+ <path+ key={destination.key}+ d={routePath(i)}+ fill="none"+ stroke={i === active ? theme.glyph : "rgba(17,17,17,0.14)"}+ strokeWidth={i === active ? 2 : 1.5}+ strokeDasharray={i === active ? "8 6" : undefined}+ strokeLinecap="round"+ className="transition-[stroke] duration-500"+ style={+ i === active+ ? {+ animationName: "ht-route-dash",+ animationDuration: "1.1s",+ animationTimingFunction: "linear",+ animationIterationCount: "infinite",+ animationPlayState,+ }+ : undefined+ }+ />+ ))}+ </svg>++ {[0, 1].map((packet) => (+ <span+ key={packet}+ className="pointer-events-none absolute left-0 top-0 size-3 rounded-full"+ style={{+ background: theme.glyph,+ boxShadow: `0 0 0 4px ${theme.chip}`,+ offsetPath: `path("${routePath(active)}")`,+ offsetRotate: "0deg",+ animationName: "ht-route-packet",+ animationDuration: "2.2s",+ animationTimingFunction: "linear",+ animationDelay: `${packet * 1.1}s`,+ animationIterationCount: "infinite",+ animationPlayState,+ }}+ />+ ))}++ <div+ className="absolute flex w-[150px] -translate-x-full -translate-y-1/2 flex-col gap-2 rounded-[14px] bg-white p-2.5"+ style={{+ left: SOURCE.x - 6,+ top: SOURCE.y,+ boxShadow:+ "0 0 0 1px rgba(17,17,17,0.06), 0 20px 40px -24px rgba(17,17,17,0.5)",+ }}+ >+ <div+ className="relative h-[68px] overflow-hidden rounded-[9px]"+ style={{+ background: "linear-gradient(135deg,#71a3f5 0%,#b7d4fa 100%)",+ }}+ >+ <span className="absolute inset-x-4 inset-y-3 rounded-[5px] bg-white/95 shadow-[0_8px_20px_-10px_rgba(16,24,40,0.5)]">+ <span className="absolute left-2 top-2 h-[3px] w-10 rounded-full bg-[rgba(17,17,17,0.35)]" />+ <span className="absolute left-2 top-[15px] h-[3px] w-16 rounded-full bg-[rgba(17,17,17,0.12)]" />+ </span>+ <span className="absolute bottom-2 left-2 size-4 rounded-full bg-[#111111] ring-2 ring-white/70" />+ </div>+ <div className="flex items-center gap-2 px-0.5">+ <CapLogoMark className="size-4 shrink-0" />+ <span className="min-w-0 flex-1 leading-tight">+ <span className="block truncate text-[12px] font-medium text-[#111111]">+ team-update.cap+ </span>+ <span className="block text-[10.5px] text-[rgba(17,17,17,0.5)]">+ 4K · 1.2 GB+ </span>+ </span>+ </div>+ </div>++ {DESTINATIONS.map((destination, i) => {+ const on = i === active;+ const tone = MODE_THEME[destination.mode];+ return (+ <div+ key={destination.key}+ className={classNames(+ "absolute flex items-center gap-3 rounded-[12px] px-3 transition-[background-color,box-shadow,transform] duration-500",+ on ? "bg-white" : "bg-white/60",+ )}+ style={+ {+ left: NODE.x,+ top: nodeY(i),+ width: NODE.w,+ height: NODE.h,+ "--ht-glow": tone.pill,+ boxShadow: on+ ? `0 0 0 1.5px ${tone.accent}, 0 18px 36px -22px rgba(17,17,17,0.5)`+ : "0 0 0 1px rgba(17,17,17,0.06)",+ animationName: on ? "ht-route-land" : "none",+ animationDuration: "2.2s",+ animationTimingFunction: "ease-out",+ animationIterationCount: "infinite",+ animationPlayState,+ } as React.CSSProperties+ }+ >+ <span+ className="grid size-9 shrink-0 place-items-center rounded-[9px]"+ style={{ background: on ? tone.chip : "#F1F4F8" }}+ >+ {destination.icon}+ </span>+ <span+ className={classNames(+ "truncate text-[13px] font-medium transition-colors duration-300",+ on ? "text-[#111111]" : "text-[rgba(17,17,17,0.6)]",+ )}+ >+ {destination.label}+ </span>+ </div>+ );+ })}+ </Scaled>+ );+};++export const Ownership = () => {+ const [active, setActive] = useState(0);+ const [pinned, setPinned] = useState(false);+ const cardRef = useRef<HTMLDivElement | null>(null);+ const inView = useInView(cardRef);+ const pageVisible = usePageVisible();+ const reducedMotion = useReducedMotion();+ const playing = inView && pageVisible && !reducedMotion;++ useEffect(() => {+ if (!playing || pinned) return;+ const timer = setInterval(+ () => setActive((current) => (current + 1) % DESTINATIONS.length),+ 3200,+ );+ return () => clearInterval(timer);+ }, [playing, pinned]);++ useEffect(() => {+ if (!pinned) return;+ const release = setTimeout(() => setPinned(false), 9000);+ return () => clearTimeout(release);+ }, [pinned]);++ const choose = (i: number) => {+ setActive(i);+ setPinned(true);+ };++ return (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.studio.accent}>Open source</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Your recordings. Actually yours.+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[600px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ Cap is open source, and every recording goes exactly where you say.+ Use Cap Cloud, point it at your own bucket or Drive, or self host+ the whole thing.+ </p>+ </div>++ <div+ ref={cardRef}+ className="mt-14 grid gap-4 rounded-[24px] p-3 lg:grid-cols-[1.3fr_1fr] lg:p-4"+ style={grainBg(BAND)}+ >+ <div className="flex items-center rounded-[16px] bg-[#F8FAFC] px-6 py-8 shadow-[0_0_0_1px_rgba(17,17,17,0.04)] lg:px-10">+ <StorageRoute active={active} playing={playing} />+ </div>++ <div className="flex flex-col gap-2">+ {DESTINATIONS.map((destination, i) => {+ const on = i === active;+ const tone = MODE_THEME[destination.mode];+ return (+ <button+ key={destination.key}+ type="button"+ aria-pressed={on}+ onClick={() => choose(i)}+ className={classNames(+ "flex flex-1 items-start gap-3.5 rounded-[14px] px-4 py-4 text-left transition-[background-color,box-shadow] duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]",+ on+ ? "bg-white shadow-[0_0_0_1px_rgba(17,17,17,0.06),0_18px_36px_-26px_rgba(17,17,17,0.45)]"+ : "hover:bg-white/50",+ )}+ >+ <span+ className="mt-[3px] inline-block size-[7px] shrink-0 transition-colors duration-300"+ style={{+ background: on ? tone.accent : "rgba(17,17,17,0.18)",+ }}+ />+ <span className="min-w-0">+ <span+ className={classNames(+ "block text-[16px] font-medium transition-colors duration-300",+ on ? "text-[#111111]" : "text-[rgba(17,17,17,0.55)]",+ )}+ >+ {destination.name}+ </span>+ <span+ className={classNames(+ BODY_TEXT,+ "mt-1 block text-[14.5px] leading-[1.45] transition-colors duration-300",+ on+ ? "text-[rgba(17,17,17,0.72)]"+ : "text-[rgba(17,17,17,0.4)]",+ )}+ >+ {destination.detail}+ </span>+ </span>+ </button>+ );+ })}+ </div>+ </div>++ <div className="mt-4 grid gap-4 lg:grid-cols-[1.3fr_1fr]">+ <figure className="flex flex-col justify-center rounded-[20px] bg-white p-8 shadow-[0_0_0_1px_rgba(17,17,17,0.05)] lg:p-10">+ <blockquote+ className={`${BODY_TEXT} text-balance text-[clamp(19px,1.9vw,24px)] leading-[1.4] text-[#111111]`}+ >+ “{QUOTE.content}”+ </blockquote>+ <figcaption className="mt-7 flex flex-wrap items-center gap-2">+ <span className="inline-flex items-center gap-2 rounded-full bg-[#EDF1F6] py-1.5 pl-1.5 pr-4">+ <Image+ src={QUOTE.image}+ alt=""+ width={28}+ height={28}+ className="size-7 rounded-full object-cover"+ />+ <span className="text-[13.5px] font-medium text-[#111111]">+ {QUOTE.name}+ </span>+ </span>+ <span className="rounded-full bg-[#EDF1F6] px-4 py-2 text-[13.5px] text-[rgba(17,17,17,0.55)]">+ {QUOTE.handle}+ </span>+ </figcaption>+ </figure>++ <ul+ className="grid grid-cols-1 gap-px overflow-hidden rounded-[20px] sm:grid-cols-2"+ style={grainBg(BAND)}+ >+ {PROOF.map((item) => (+ <li key={item.label} className="flex flex-col gap-2 p-6">+ <p+ className={classNames(+ EYEBROW,+ "flex items-center gap-2 text-[11px] text-[#111111]",+ )}+ >+ <span+ aria-hidden="true"+ className="inline-block size-[7px]"+ style={{ background: MODE_THEME.studio.accent }}+ />+ {item.label}+ </p>+ <p+ className={`${BODY_TEXT} text-[14.5px] leading-[1.45] text-[rgba(17,17,17,0.72)]`}+ >+ {item.body}+ </p>+ </li>+ ))}+ </ul>+ </div>+ </div>+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/Platforms.tsx b/apps/web/components/pages/HomeTwo/Platforms.tsxnew file mode 100644index 000000000..75c62d533--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Platforms.tsx@@ -0,0 +1,239 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { useDetectPlatform } from "hooks/useDetectPlatform";+import { ArrowUpRight } from "lucide-react";+import Image from "next/image";+import Link from "next/link";+import { getDownloadUrl } from "@/utils/platform";+import { Eyebrow } from "./Eyebrow";+import { AppleGlyph } from "./glyphs";+import {+ BAND,+ BODY_TEXT,+ BTN_PRIMARY,+ grainBg,+ H_CARD,+ H_SECTION,+ MODE_THEME,+ MONO,+ meshStyle,+} from "./theme";++const WindowsGlyph = ({ className }: { className?: string }) => (+ <svg+ aria-hidden="true"+ className={className}+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <path d="M0,0H11.377V11.372H0ZM12.623,0H24V11.372H12.623ZM0,12.623H11.377V24H0Zm12.623,0H24V24H12.623" />+ </svg>+);++const TERMINAL = [+ { prompt: true, text: "cap record start --mode studio --duration 30" },+ { prompt: true, text: "cap export ./recording.cap --quality 4k" },+ { prompt: true, text: "cap upload ./recording.mp4 --json" },+ { prompt: false, text: '{ "url": "https://cap.so/s/x7f2k9" }' },+];++const Tile = ({+ href,+ title,+ body,+ icon,+}: {+ href: string;+ title: string;+ body: string;+ icon: React.ReactNode;+}) => (+ <Link+ href={href}+ className="group flex flex-col justify-between rounded-[20px] p-7 transition-colors duration-200 hover:bg-[#E5EAF1] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]"+ style={grainBg(BAND)}+ >+ <span className="flex items-start justify-between">+ {icon}+ <ArrowUpRight className="size-4 text-[rgba(17,17,17,0.4)] transition-colors duration-200 group-hover:text-[#111111]" />+ </span>+ <span className="mt-10 block">+ <span className="block text-[19px] font-normal leading-[1.1] tracking-[-0.02em] text-[#111111]">+ {title}+ </span>+ <span+ className={`${BODY_TEXT} mt-2 block text-[14.5px] leading-[1.45] text-[rgba(17,17,17,0.7)]`}+ >+ {body}+ </span>+ </span>+ </Link>+);++export const Platforms = () => {+ const { platform, isIntel } = useDetectPlatform();+ const current = platform ?? "macos";++ const desktops = [+ {+ key: "macos",+ name: "macOS",+ note: "Apple silicon and Intel. macOS 13.1 or newer.",+ href: getDownloadUrl("macos", isIntel),+ glyph: <AppleGlyph className="size-7" />,+ mode: "instant" as const,+ },+ {+ key: "windows",+ name: "Windows",+ note: "Windows 10 or newer.",+ href: getDownloadUrl("windows", false),+ glyph: <WindowsGlyph className="size-6" />,+ mode: "studio" as const,+ },+ {+ key: "linux",+ name: "Linux",+ note: "Debian and Ubuntu, as a .deb package.",+ href: getDownloadUrl("linux", false),+ glyph: (+ <Image+ src="/logos/os/linux.svg"+ alt=""+ width={28}+ height={28}+ className="size-7"+ />+ ),+ mode: "screenshot" as const,+ },+ ];++ return (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.screenshot.accent}>+ Every platform+ </Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Native on Mac, Windows and Linux+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[540px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ A real desktop app on all three, with the same recorder, editor, and+ share link. Plus a Chrome extension for the browser and a CLI for+ everything else.+ </p>+ </div>++ <div className="mt-14 grid gap-4 md:grid-cols-3">+ {desktops.map((desktop) => {+ const yours = desktop.key === current;+ return (+ <div+ key={desktop.key}+ className="flex flex-col justify-between rounded-[24px] p-8 md:min-h-[300px]"+ style={meshStyle(MODE_THEME[desktop.mode])}+ >+ <div className="flex items-start justify-between gap-4">+ <span className="grid size-14 place-items-center rounded-[16px] bg-white text-[#111111] shadow-[0_0_0_1px_rgba(17,17,17,0.06),0_14px_30px_-18px_rgba(17,17,17,0.5)]">+ {desktop.glyph}+ </span>+ {yours ? (+ <span+ className={classNames(+ MONO,+ "rounded-full bg-white/70 px-3 py-1.5 text-[11px] uppercase leading-none tracking-[0.05em] text-[rgba(17,17,17,0.7)]",+ )}+ >+ Your device+ </span>+ ) : null}+ </div>+ <div className="mt-10">+ <h3 className={`${H_CARD} text-[clamp(28px,2.6vw,34px)]`}>+ {desktop.name}+ </h3>+ <p+ className={`${BODY_TEXT} mt-2 text-[15.5px] leading-[1.45] text-[rgba(17,17,17,0.7)]`}+ >+ {desktop.note}+ </p>+ <Link+ href={desktop.href}+ className={classNames(+ BTN_PRIMARY,+ "mt-6 h-[46px] px-5 text-[15px]",+ )}+ >+ Download for {desktop.name}+ </Link>+ </div>+ </div>+ );+ })}+ </div>++ <div className="mt-4 grid gap-4 md:grid-cols-2">+ <Tile+ href="/download"+ title="Chrome extension"+ body="Record a tab or your whole screen without leaving the browser."+ icon={+ <Image+ src="/logos/browsers/google-chrome.svg"+ alt=""+ width={36}+ height={36}+ className="size-9"+ />+ }+ />+ <Link+ href="/docs"+ className="group flex flex-col rounded-[20px] p-7 transition-colors duration-200 hover:bg-[#E5EAF1] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]"+ style={grainBg(BAND)}+ >+ <span className="flex items-start justify-between">+ <span className="block text-[19px] font-normal leading-[1.1] tracking-[-0.02em] text-[#111111]">+ Built for developers+ </span>+ <ArrowUpRight className="size-4 shrink-0 text-[rgba(17,17,17,0.4)] transition-colors duration-200 group-hover:text-[#111111]" />+ </span>+ <span+ className={`${BODY_TEXT} mt-2 block text-[14.5px] leading-[1.45] text-[rgba(17,17,17,0.7)]`}+ >+ Record, export, and publish from the terminal, the API, or the MCP+ server.+ </span>+ <span+ className={classNames(+ MONO,+ "mt-5 block rounded-[12px] bg-[#111111] p-4 text-[11.5px] leading-[1.7] text-[#F8FAFC]",+ )}+ >+ {TERMINAL.map((line) => (+ <span+ key={line.text}+ className="block whitespace-pre-wrap break-words"+ >+ {line.prompt ? (+ <span className="text-[rgba(255,255,255,0.4)]">$ </span>+ ) : null}+ <span className={line.prompt ? undefined : "text-[#8FDCBB]"}>+ {line.text}+ </span>+ </span>+ ))}+ </span>+ </Link>+ </div>+ </div>+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/Pricing.tsx b/apps/web/components/pages/HomeTwo/Pricing.tsxnew file mode 100644index 000000000..d07399931--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Pricing.tsx@@ -0,0 +1,227 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { Check } from "lucide-react";+import Link from "next/link";+import { useState } from "react";+import { trackEvent } from "@/app/utils/analytics";+import { homepageCopy } from "@/data/homepage-copy";+import { Eyebrow } from "./Eyebrow";+import {+ BAND,+ BODY_TEXT,+ BTN_PRIMARY,+ BTN_SECONDARY,+ CARD_BG,+ grainBg,+ H_SECTION,+ MODE_THEME,+ MONO,+ type ModeTheme,+} from "./theme";++/**+ * The homepage's two plans in the new system. Prices come from the shared+ * pricing copy so the page can never drift from /pricing; the checkout itself+ * still lives there, so both actions link out rather than mounting Stripe.+ */++const { commercial, pro, subtitle, lovedBy } = homepageCopy.pricing;++/** Sentence case and plain punctuation, the house voice on this page. */+const BLURB = {+ commercial:+ "A commercial licence for the Cap desktop app, with unlimited local recording and editing.",+ pro: "Everything in Desktop plus unlimited cloud features for sharing and collaboration.",+};++type Billing = "annual" | "monthly";++const money = (amount: number) =>+ Number.isInteger(amount) ? `$${amount}` : `$${amount.toFixed(2)}`;++const PlanCard = ({+ name,+ badge,+ blurb,+ price,+ cadence,+ note,+ features,+ cta,+ href,+ onClick,+ primary,+ theme,+}: {+ name: string;+ badge?: string;+ blurb: string;+ price: string;+ cadence: string;+ note: string;+ features: readonly string[];+ cta: string;+ href: string;+ onClick?: () => void;+ primary?: boolean;+ theme: ModeTheme;+}) => (+ <div+ className="flex flex-col rounded-[14px] p-7 lg:p-8"+ style={grainBg(CARD_BG)}+ >+ <div className="flex items-center gap-2.5">+ <span className="text-[15px] font-medium text-[#111111]">{name}</span>+ {badge ? (+ <span+ className={classNames(+ MONO,+ "rounded-full px-2.5 py-1 text-[10.5px] uppercase leading-none tracking-[0.05em]",+ )}+ style={{ background: theme.chip, color: theme.glyph }}+ >+ {badge}+ </span>+ ) : null}+ </div>++ <p+ className={`${BODY_TEXT} mt-3 min-h-[48px] max-w-[380px] text-[15px] leading-[1.5] text-[rgba(17,17,17,0.72)]`}+ >+ {blurb}+ </p>++ <div className="mt-7 flex items-baseline gap-2">+ <span className="text-[46px] font-normal leading-none tracking-[-0.03em] text-[#111111]">+ {price}+ </span>+ <span className="text-[14px] text-[rgba(17,17,17,0.5)]">{cadence}</span>+ </div>+ <p className="mt-2 text-[13.5px] text-[rgba(17,17,17,0.5)]">{note}</p>++ <Link+ href={href}+ onClick={onClick}+ className={classNames(primary ? BTN_PRIMARY : BTN_SECONDARY, "mt-7")}+ >+ {cta}+ </Link>++ <ul className="mt-8 space-y-3 border-t border-[#E1E7EE] pt-7">+ {features.map((feature) => (+ <li key={feature} className="flex items-start gap-3">+ <span+ className="mt-px grid size-5 shrink-0 place-items-center rounded-full"+ style={{ background: theme.chip, color: theme.glyph }}+ >+ <Check className="size-3" strokeWidth={2.5} />+ </span>+ <span className="text-[14px] leading-snug text-[rgba(17,17,17,0.72)]">+ {feature}+ </span>+ </li>+ ))}+ </ul>+ </div>+);++export const Pricing = () => {+ const [billing, setBilling] = useState<Billing>("monthly");+ const annual = billing === "annual";++ return (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1060px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.instant.accent}>Pricing</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Simple, honest pricing+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[560px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ {subtitle}+ </p>++ <div className="mt-8 flex items-center gap-1 rounded-full border border-[#DDE4EB] bg-white/70 p-1">+ {(["annual", "monthly"] as const).map((option) => {+ const active = billing === option;+ return (+ <button+ key={option}+ type="button"+ onClick={() => setBilling(option)}+ aria-pressed={active}+ className={classNames(+ "h-8 rounded-full px-4 text-[13px] font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111] focus-visible:ring-offset-1 focus-visible:ring-offset-white",+ active+ ? "text-[#111111]"+ : "text-[rgba(17,17,17,0.5)] hover:bg-[#EDF1F6] hover:text-[#111111]",+ )}+ style={+ active ? { background: MODE_THEME.instant.chip } : undefined+ }+ >+ {option === "annual" ? "Annual" : "Monthly"}+ </button>+ );+ })}+ </div>+ <p className="mt-4 text-[13.5px] text-[rgba(17,17,17,0.5)]">+ {lovedBy}+ </p>+ </div>++ <div+ className="mt-14 grid gap-3 rounded-[20px] p-3 lg:grid-cols-2 lg:gap-4 lg:p-4"+ style={grainBg(BAND)}+ >+ <PlanCard+ name={commercial.title}+ blurb={BLURB.commercial}+ price={money(+ annual ? commercial.pricing.yearly : commercial.pricing.lifetime,+ )}+ cadence={annual ? "per year" : "one time"}+ note={+ annual+ ? `Or ${money(commercial.pricing.lifetime)} once, for a licence that never renews.`+ : `Or ${money(commercial.pricing.yearly)} a year if you would rather pay as you go.`+ }+ features={commercial.features}+ cta={commercial.cta}+ href="/pricing"+ theme={MODE_THEME.screenshot}+ />+ <PlanCard+ name={pro.title}+ badge={pro.badge}+ blurb={BLURB.pro}+ price={money(annual ? pro.pricing.annual : pro.pricing.monthly)}+ cadence="per user, per month"+ note={+ annual+ ? "Billed annually. Save 32% against monthly."+ : `Billed monthly. Switch to annual for ${money(pro.pricing.annual)} a month.`+ }+ features={pro.features}+ cta={pro.cta}+ href="/pricing"+ onClick={() =>+ trackEvent("pricing_cta_clicked", {+ source_page: "home_pricing",+ cta_location: "primary",+ target_url: "/pricing",+ })+ }+ primary+ theme={MODE_THEME.instant}+ />+ </div>+ </div>+ </section>+ );+};diff --git a/apps/web/components/pages/HomeTwo/Testimonials.tsx b/apps/web/components/pages/HomeTwo/Testimonials.tsxnew file mode 100644index 000000000..96429f02f--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Testimonials.tsx@@ -0,0 +1,91 @@+import { classNames } from "@cap/utils/helpers";+import Image from "next/image";+import Link from "next/link";+import { testimonials } from "@/data/testimonials";+import { Eyebrow } from "./Eyebrow";+import { BODY_TEXT, BTN_SECONDARY, H_SECTION, MODE_THEME } from "./theme";++/**+ * The homepage's wall of quotes, straightened out: real cards in a masonry+ * column instead of a rotated scatter, so the type stays on the same grid as+ * the rest of the page. Steven Tey is deliberately absent, he leads the+ * ownership section above.+ */++const PICKS = [+ "Olivia",+ "CJ",+ "evening kid",+ "Roger Mattos",+ "Greg_Ld",+ "Rohith Gilla",+ "Hrushi",+ "Bilal Budhani",+ "diana",+];++const QUOTES = PICKS.map((name) =>+ testimonials.find((item) => item.name === name),+).filter((item): item is (typeof testimonials)[number] => Boolean(item));++export const Testimonials = () => (+ <section className="px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.share.accent}>Testimonials</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Loved by builders, trusted by teams+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[440px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ Join the thousands who made Cap their daily driver for showing work+ instead of writing about it.+ </p>+ </div>++ <div className="mt-14 gap-4 sm:columns-2 lg:columns-3">+ {QUOTES.map((quote) => (+ <a+ key={quote.name}+ href={quote.url}+ target="_blank"+ rel="noopener noreferrer"+ className="mb-4 block break-inside-avoid rounded-[14px] bg-white p-6 shadow-[0_0_0_1px_rgba(17,17,17,0.05)] transition-shadow duration-200 hover:shadow-[0_0_0_1px_rgba(17,17,17,0.12),0_14px_30px_-18px_rgba(17,17,17,0.35)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]"+ >+ <p+ className={`${BODY_TEXT} whitespace-pre-line text-[15.5px] leading-[1.55] text-[rgba(17,17,17,0.82)]`}+ >+ {quote.content}+ </p>+ <span className="mt-5 flex items-center gap-3">+ <Image+ src={quote.image}+ alt=""+ width={36}+ height={36}+ className="size-9 rounded-full object-cover"+ />+ <span className="min-w-0">+ <span className="block truncate text-[14px] font-medium text-[#111111]">+ {quote.name}+ </span>+ <span className="block truncate text-[13px] text-[rgba(17,17,17,0.5)]">+ {quote.handle}+ </span>+ </span>+ </span>+ </a>+ ))}+ </div>++ <div className="mt-6 flex justify-center">+ <Link href="/testimonials" className={classNames(BTN_SECONDARY)}>+ Read more testimonials+ </Link>+ </div>+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/Workflow.tsx b/apps/web/components/pages/HomeTwo/Workflow.tsxnew file mode 100644index 000000000..8549d228a--- /dev/null+++ b/apps/web/components/pages/HomeTwo/Workflow.tsx@@ -0,0 +1,179 @@+import { classNames } from "@cap/utils/helpers";+import Link from "next/link";+import type { ComponentType } from "react";+import {+ InstantIcon,+ ScreenshotIcon,+ StudioIcon,+} from "@/components/pages/HomePage/modeIcons";+import { Eyebrow } from "./Eyebrow";+import {+ BAND,+ BODY_TEXT,+ BTN_PRIMARY,+ CARD_BG,+ grainBg,+ H_SECTION,+ MODE_THEME,+ MONO,+ type ModeKey,+ type ModeTheme,+} from "./theme";++/**+ * The modes, explained side by side. What happens after you press record+ * depends entirely on which mode you picked, so each card walks its own+ * capture-to-shared path instead of pretending there is one workflow.+ */++type Mode = {+ key: ModeKey;+ name: string;+ promise: string;+ steps: string[];+ bestFor: string;+ Icon: ComponentType<{ className?: string }>;+};++const MODES: Mode[] = [+ {+ key: "instant",+ name: "Instant Mode",+ promise: "From recording to shared in one step",+ steps: [+ "Press record. Cap uploads while you talk, so there is nothing to wait for.",+ "Press stop. The share link is already on your clipboard.",+ "Paste it anywhere. Viewers watch in the browser, no account needed.",+ ],+ bestFor: "Bug reports, quick answers, async standups",+ Icon: InstantIcon,+ },+ {+ key: "studio",+ name: "Studio Mode",+ promise: "Full quality, polished before anyone sees it",+ steps: [+ "Record locally in 4K. Screen, camera, and mic each get their own track.",+ "The editor opens when you stop: backgrounds, auto zoom, cursor effects, captions.",+ "Export in 4K, or share it as a Cap link like everything else.",+ ],+ bestFor: "Product demos, tutorials, launch videos",+ Icon: StudioIcon,+ },+ {+ key: "screenshot",+ name: "Screenshot Mode",+ promise: "Stills that look designed",+ steps: [+ "Hit the hotkey and grab any window or area.",+ "Beautify with one click: background, padding, shadow.",+ "It's on your clipboard, ready to paste or share as a link.",+ ],+ bestFor: "Docs, pull requests, social posts",+ Icon: ScreenshotIcon,+ },+];++const StepRow = ({+ index,+ text,+ theme,+}: {+ index: number;+ text: string;+ theme: ModeTheme;+}) => (+ <li className="flex items-start gap-3">+ <span+ className="mt-px flex size-6 shrink-0 items-center justify-center rounded-full text-[12px] font-medium tabular-nums"+ style={{ background: theme.chip, color: theme.glyph }}+ >+ {index}+ </span>+ <span className="text-[13.5px] leading-snug text-[rgba(17,17,17,0.72)]">+ {text}+ </span>+ </li>+);++export const Workflow = () => (+ // biome-ignore lint/correctness/useUniqueElementIds: anchor target for the demo's "Learn more"+ <section id="workflow" className="scroll-mt-10 px-5 py-20 lg:py-28">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.instant.accent}>Cap has 3 modes</Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ One app for every workflow+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[600px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ Record and share with Instant, edit your videos with Studio, or+ capture and customize images with Screenshot.+ </p>+ <Link href="/download" className={classNames(BTN_PRIMARY, "mt-8")}>+ Download Cap free+ </Link>+ </div>++ <div className="mt-16 rounded-[20px] p-3 lg:p-4" style={grainBg(BAND)}>+ <div className="grid gap-3 md:grid-cols-3 lg:gap-4">+ {MODES.map((mode) => {+ const theme = MODE_THEME[mode.key];+ return (+ <div+ key={mode.key}+ className="flex flex-col rounded-[14px] p-6 text-left"+ style={grainBg(CARD_BG)}+ >+ <div className="flex items-center gap-2.5">+ <span+ className="grid size-8 shrink-0 place-items-center rounded-[8px]"+ style={{ background: theme.chip, color: theme.glyph }}+ >+ <mode.Icon className="size-4" />+ </span>+ <span className="text-[15px] font-medium text-[#111111]">+ {mode.name}+ </span>+ </div>++ <h3 className="mt-5 max-w-[300px] text-balance text-[22px] font-normal leading-[1.1] tracking-[-0.02em] text-[#111111]">+ {mode.promise}+ </h3>++ <div className="flex flex-1 flex-col justify-between">+ <div>+ <ol className="mt-5 space-y-3">+ {mode.steps.map((text, i) => (+ <StepRow+ key={text}+ index={i + 1}+ text={text}+ theme={theme}+ />+ ))}+ </ol>++ <div className="mt-6 border-t border-[#E1E7EE] pt-4">+ <p+ className={`${MONO} text-[11px] font-normal uppercase leading-none tracking-[0.05em] text-[rgba(17,17,17,0.45)]`}+ >+ Best for+ </p>+ <p className="mt-2 text-[13.5px] leading-snug text-[rgba(17,17,17,0.72)]">+ {mode.bestFor}+ </p>+ </div>+ </div>+ </div>+ </div>+ );+ })}+ </div>+ </div>+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/cursors.tsx b/apps/web/components/pages/HomeTwo/cursors.tsxnew file mode 100644index 000000000..d13b1c2e0--- /dev/null+++ b/apps/web/components/pages/HomeTwo/cursors.tsx@@ -0,0 +1,52 @@+/**+ * The two pointers Cap Desktop actually ships, traced 1:1 from+ * `packages/ui-solid/icons/cursor-macos.svg` and `cursor-windows.svg`.+ *+ * The only change is the shadow: the source files carry it as an SVG filter+ * with a hard-coded id, which would collide wherever two cursors render on+ * the same page, so it is applied in CSS at the use site instead+ * (`drop-shadow(...)`, matching the 1.5px blur at 60% black).+ */++type CursorProps = { className?: string };++export const MacCursor = ({ className }: CursorProps) => (+ <svg aria-hidden="true" className={className} viewBox="0 0 17 24" fill="none">+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M4.501 3.2601L12.884 11.6611C13.937 12.7171 13.19 14.5191 11.699 14.5191L10.475 14.519L11.6908 17.4067C11.9038 17.9127 11.9068 18.4727 11.6998 18.9817C11.4918 19.4917 11.0978 19.8897 10.5898 20.1027C10.3338 20.2097 10.0658 20.2637 9.7918 20.2637C8.9608 20.2637 8.2158 19.7687 7.8938 19.0027L6.616 15.965L5.784 16.7031C4.703 17.6591 3 16.8921 3 15.4481V3.8811C3 3.0971 3.947 2.7051 4.501 3.2601Z"+ fill="white"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M4 4.53033C4 4.39933 4.159 4.33333 4.251 4.42633L12.159 12.3513C12.59 12.7833 12.284 13.5203 11.674 13.5203L8.97 13.5188L10.7696 17.7947C10.9966 18.3347 10.7426 18.9557 10.2036 19.1817C9.6626 19.4087 9.0426 19.1557 8.8166 18.6167L6.999 14.2928L5.139 15.9403C4.723 16.3083 4.0811 16.0518 4.007 15.5285L4 15.4273V4.53033Z"+ fill="black"+ />+ </svg>+);++export const WindowsCursor = ({ className }: CursorProps) => (+ <svg aria-hidden="true" className={className} viewBox="0 0 18 25" fill="none">+ <path+ d="M3.3125 18.3749V3.75391L13.9027 14.3874H8.84609L11.4221 20.5586L8.84609 21.508L6.36552 15.4317L3.3125 18.3749Z"+ fill="white"+ stroke="black"+ strokeWidth="0.622951"+ />+ </svg>+);++/** Aspect ratio of each pointer, so a caller can size by width alone. */+export const CURSOR_RATIO = { macos: 17 / 24, windows: 18 / 25 } as const;++export const PlatformCursor = ({+ platform,+ className,+}: CursorProps & { platform: "macos" | "windows" }) =>+ platform === "windows" ? (+ <WindowsCursor className={className} />+ ) : (+ <MacCursor className={className} />+ );diff --git a/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsx b/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsxnew file mode 100644index 000000000..8047d0e05--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/CapEditorWindow.tsx@@ -0,0 +1,858 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import Image from "next/image";+import type { RefObject } from "react";+import {+ CapAudioOn,+ CapCamera,+ CapClapperboard,+ CapCrop,+ CapCursor,+ CapImage,+ CapLayoutIcon,+ CapMessageBubble,+ CapNext,+ CapPause,+ CapPlay,+ CapPresets,+ CapPrev,+ CapRedo,+ CapScissors,+ CapTrash,+ CapUndo,+ CapUpload,+ LucideAppWindowMac,+ LucideBuilding2,+ LucideChevronDown,+ LucideClock,+ LucideFolder,+ LucideKeyboard,+ LucidePlus,+ LucideSearch,+ LucideZoomIn,+ LucideZoomOut,+} from "./capIcons";+import { TrafficLights, WindowsCaptionControls } from "./chrome";+import { useVideoAttrs, VIDEO_POSTERS } from "./media";+import { useIsWindowsDemo } from "./platform";++/**+ * Shell replica of the Cap desktop editor (light theme, 1275×800 native+ * layout scaled to fit). Layout, colours and copy mirror+ * apps/desktop/src/routes/editor/*.+ */++const C = {+ gray1: "#fcfcfc",+ gray2: "#f9f9f9",+ gray3: "#f0f0f0",+ gray4: "#e8e8e8",+ gray5: "#e0e0e0",+ gray6: "#d9d9d9",+ gray9: "#8d8d8d",+ gray10: "#838383",+ gray11: "#646464",+ gray12: "#202020",+ blue9: "#0090ff",+ trackClip: "#3f8ae0",+ trackZoom: "#4a4f5c",+};++const WALLPAPERS = [+ "sf",+ "nyc",+ "miami",+ "monaco",+ "london",+ "rome",+ "santorini",+].map((city) => ({+ id: city,+ thumb: `/backgrounds/thumbs/${city}.webp`,+ full: `/backgrounds/${city}.webp`,+}));++const WALLPAPER_THEMES = [+ "macOS",+ "Dark",+ "Blue",+ "Cities",+ "Purple",+ "Orange",+];++const EditorButton = ({+ children,+ className,+}: {+ children: React.ReactNode;+ className?: string;+}) => (+ <span+ className={classNames(+ "flex h-8 items-center gap-1.5 rounded-lg px-1.5 text-[0.875rem]",+ className,+ )}+ style={{ color: C.gray12 }}+ >+ {children}+ </span>+);++const Field = ({+ icon,+ label,+ children,+}: {+ icon: React.ReactNode;+ label: string;+ children?: React.ReactNode;+}) => (+ <div className="flex flex-col gap-4">+ <div className="flex items-center gap-2">+ <span className="size-4" style={{ color: C.gray12 }}>+ {icon}+ </span>+ <span className="text-sm font-medium" style={{ color: C.gray12 }}>+ {label}+ </span>+ </div>+ {children}+ </div>+);++const SliderRow = ({ fill, anchor }: { fill: number; anchor?: string }) => (+ <div className="relative flex h-4 items-center">+ <div+ className="h-[0.3rem] w-full overflow-hidden rounded-full"+ style={{ background: C.gray4 }}+ >+ <div+ className="h-full rounded-full transition-[width] duration-200 ease-out"+ style={{ width: `${fill * 100}%`, background: C.blue9 }}+ />+ </div>+ <span+ data-scene-anchor={anchor}+ className="absolute size-4 rounded-full border shadow-md transition-[left] duration-200 ease-out"+ style={{+ left: `calc(${fill * 100}% - 8px)`,+ background: C.gray1,+ borderColor: C.gray6,+ }}+ />+ </div>+);++/** Little sidebar tab. */+const Tab = ({+ icon,+ selected,+ disabled,+}: {+ icon: React.ReactNode;+ selected?: boolean;+ disabled?: boolean;+}) => (+ <span+ className={classNames(+ "relative flex flex-1 items-center justify-center",+ disabled && "opacity-50",+ )}+ >+ {selected ? (+ <span+ className="absolute size-9 rounded-lg"+ style={{ background: C.gray3 }}+ />+ ) : null}+ <span+ className="relative size-5"+ style={{ color: selected ? C.gray12 : C.gray11 }}+ >+ {icon}+ </span>+ </span>+);++/** Deterministic mic waveform for the clip segment. */+const WAVE_HEIGHTS = Array.from({ length: 90 }, (_, i) => {+ const a = Math.sin(i * 0.55) * 0.5 + 0.5;+ const b = Math.sin(i * 1.7 + 2) * 0.5 + 0.5;+ return 0.15 + 0.75 * (0.4 * a + 0.6 * b);+});++export type EditorUi = {+ visible: boolean;+ /** Which wallpaper swatch is active (the visitor clicks them). */+ bgIndex: number;+ playing: boolean;+ padding?: number;+ radius?: number;+ zoomSegments?: boolean;+};++export const CapEditorWindow = ({+ ui,+ width,+ height,+ videoRef,+ camVideoRef,+ playheadRef,+ timeRef,+ canvasRef,+ canvasChildren,+ onSwatch,+ onExport,+ onTogglePlay,+}: {+ ui: EditorUi;+ width: number;+ height: number;+ videoRef: RefObject<HTMLVideoElement | null>;+ camVideoRef: RefObject<HTMLVideoElement | null>;+ playheadRef: RefObject<HTMLDivElement | null>;+ timeRef: RefObject<HTMLSpanElement | null>;+ canvasRef?: RefObject<HTMLDivElement | null>;+ canvasChildren?: React.ReactNode;+ onSwatch: (index: number) => void;+ onExport: () => void;+ onTogglePlay: () => void;+}) => {+ const isWindows = useIsWindowsDemo();+ const screenVideo = useVideoAttrs(VIDEO_POSTERS.screen, ui.visible);+ const cameraVideo = useVideoAttrs(VIDEO_POSTERS.webcam, ui.visible);+ const scale = width / 1275;+ const wallpaper = WALLPAPERS[ui.bgIndex] ?? WALLPAPERS[0];+ const padding = ui.padding ?? 0.35;+ const radius = ui.radius ?? 0.5;++ return (+ <div+ inert={!ui.visible}+ className={classNames(+ "absolute transition-[opacity,transform] duration-[400ms] ease-[cubic-bezier(0.16,1,0.3,1)]",+ ui.visible+ ? "opacity-100 [transform:scale(1)]"+ : "pointer-events-none opacity-0 [transform:scale(0.96)_translateY(14px)]",+ )}+ style={{ width, height, fontWeight: 500 }}+ >+ <div+ className="overflow-hidden rounded-[10px]"+ style={{+ width: 1275,+ height: 800,+ transform: `scale(${scale})`,+ transformOrigin: "top left",+ background: C.gray2,+ border: "1px solid rgba(0,0,0,0.1)",+ boxShadow: "0 28px 80px rgba(0,0,0,0.3), 0 4px 18px rgba(0,0,0,0.12)",+ }}+ >+ <div className="flex h-full w-full flex-col">+ {/* ------------------------------------------------- header (56px) */}+ <div className="flex h-14 shrink-0 items-center">+ <div className="flex items-center gap-2 px-4">+ {/* macOS overlay traffic lights; on Windows the caption+ controls sit at the far right of the header instead. */}+ {isWindows ? null : <TrafficLights className="mr-3" />}+ <EditorButton>+ <CapTrash className="size-5" />+ </EditorButton>+ <EditorButton>+ <LucideFolder className="size-5" />+ </EditorButton>+ <span className="text-sm" style={{ color: C.gray12 }}>+ Dashboard walkthrough+ <span style={{ color: C.gray11 }}>.cap</span>+ </span>+ </div>++ <div+ className="flex h-full items-center gap-2 border-x px-4"+ style={{ borderColor: "rgba(18,22,31,0.1)" }}+ >+ <EditorButton>+ <CapPresets className="size-5" />+ <span>Presets</span>+ <LucideChevronDown+ className="size-3.5"+ style={{ color: C.gray11 }}+ />+ </EditorButton>+ <EditorButton>+ <LucideBuilding2 className="size-4" />+ <span>Cap</span>+ <LucideChevronDown+ className="size-3.5"+ style={{ color: C.gray11 }}+ />+ </EditorButton>+ </div>++ <div className="flex flex-1 items-center gap-2 pl-2 pr-2">+ <EditorButton>+ <CapUndo className="size-5" />+ </EditorButton>+ <EditorButton className="opacity-50">+ <CapRedo className="size-5" />+ </EditorButton>+ <div className="flex-1" />+ <span+ className="flex h-[40px] items-center gap-2 rounded-xl border px-4 text-[0.875rem]"+ style={{+ background: C.gray5,+ borderColor: C.gray6,+ color: C.gray12,+ boxShadow: "0 1.5px 0 0 rgba(255,255,255,0.4) inset",+ }}+ >+ <CapClapperboard className="size-4" />+ <span>Clips</span>+ </span>+ <button+ type="button"+ data-demo-anchor="editor-export"+ aria-label="Export the recording"+ onClick={onExport}+ className="flex h-[40px] cursor-pointer items-center gap-2 rounded-xl px-4 text-[0.8125rem] font-medium text-white transition-[filter] duration-150 hover:brightness-[1.08]"+ style={{+ background: "linear-gradient(to bottom, #3b82f6, #2563eb)",+ boxShadow:+ "0 4px 14px -6px rgba(37,99,235,0.5), inset 0 1px 0 0 rgba(255,255,255,0.22)",+ }}+ >+ <CapUpload className="size-5" />+ <span>Export</span>+ </button>+ {isWindows ? (+ <WindowsCaptionControls className="-mr-2 h-14 self-stretch" />+ ) : null}+ </div>+ </div>++ {/* --------------------------------------------------- content row */}+ <div className="flex min-h-0 flex-1 px-2">+ {/* Player card */}+ <div+ className="flex min-w-0 flex-1 flex-col overflow-hidden rounded-xl border"+ style={{ borderColor: C.gray3, background: C.gray1 }}+ >+ {/* player toolbar */}+ <div className="flex items-center justify-between p-3">+ <div className="flex items-center gap-3">+ <EditorButton className="w-28">+ <CapLayoutIcon className="size-5" />+ <span className="flex-1 text-left">Auto</span>+ <LucideChevronDown+ className="size-3.5"+ style={{ color: C.gray11 }}+ />+ </EditorButton>+ <EditorButton>+ <CapCrop className="size-5" />+ <span>Crop</span>+ </EditorButton>+ <EditorButton>+ <LucideAppWindowMac className="size-5" />+ <span>Frame</span>+ <LucideChevronDown+ className="size-3.5"+ style={{ color: C.gray11 }}+ />+ </EditorButton>+ </div>+ <div className="flex items-center gap-2">+ <span+ className="text-xs font-medium"+ style={{ color: C.gray11 }}+ >+ Preview quality+ </span>+ <span+ className="flex h-9 items-center gap-2 rounded-lg border px-3 text-sm"+ style={{+ borderColor: C.gray3,+ background: C.gray2,+ color: C.gray12,+ }}+ >+ Full+ <LucideChevronDown+ className="size-4"+ style={{ color: C.gray11 }}+ />+ </span>+ </div>+ </div>++ {/* canvas */}+ <div className="relative min-h-0 flex-1 px-4 pb-2">+ <div+ className="relative mx-auto h-full overflow-hidden"+ style={{+ aspectRatio: "16 / 9",+ maxWidth: "100%",+ backgroundImage: `url(${wallpaper?.full})`,+ backgroundSize: "cover",+ backgroundPosition: "center",+ }}+ >+ <div+ ref={canvasRef}+ className="absolute inset-0 will-change-transform"+ >+ <div+ className="absolute inset-0 flex items-center justify-center transition-[padding] duration-200 ease-out"+ style={{ padding: `${1.5 + padding * 9}%` }}+ >+ <video+ ref={videoRef}+ className="h-full w-full object-cover transition-[border-radius] duration-200 ease-out"+ style={{+ borderRadius: 2 + radius * 16,+ boxShadow: "0 18px 45px rgba(0,0,0,0.35)",+ }}+ src="/illustrations/homepage-animation.mp4"+ muted+ loop+ playsInline+ {...screenVideo}+ />+ </div>+ <div+ className="absolute overflow-hidden rounded-full"+ style={{+ left: "3.5%",+ bottom: "6%",+ width: "13%",+ aspectRatio: "1",+ boxShadow: "0 10px 26px rgba(0,0,0,0.4)",+ }}+ >+ <video+ ref={camVideoRef}+ className="h-full w-full object-cover"+ src="/videos/home-two/webcam.mp4"+ muted+ loop+ playsInline+ {...cameraVideo}+ />+ </div>+ {canvasChildren}+ </div>+ </div>+ </div>++ {/* transport bar */}+ <div className="relative flex items-center p-5">+ <div className="flex flex-1 items-center">+ <span+ className="text-sm tabular-nums"+ style={{ color: C.gray12 }}+ >+ <span ref={timeRef}>0:00.00</span>+ <span style={{ color: C.gray11 }}> / 0:32.00</span>+ </span>+ </div>+ <div+ className="flex items-center gap-8"+ style={{ color: C.gray11 }}+ >+ <CapPrev className="h-3 w-auto" style={{ color: C.gray12 }} />+ <button+ type="button"+ aria-label={ui.playing ? "Pause preview" : "Play preview"}+ onClick={onTogglePlay}+ className="flex size-9 cursor-pointer items-center justify-center rounded-full border transition-colors duration-150 hover:bg-[#e8e8e8]"+ style={{+ borderColor: "#c7ccda",+ background: C.gray3,+ color: C.gray12,+ }}+ >+ {ui.playing ? (+ <CapPause className="h-3 w-auto" />+ ) : (+ <CapPlay className="ml-0.5 h-3 w-auto" />+ )}+ </button>+ <CapNext className="h-3 w-auto" style={{ color: C.gray12 }} />+ </div>+ <div className="flex flex-1 items-center justify-end gap-4">+ <CapScissors className="size-5" style={{ color: C.gray12 }} />+ <span+ className="h-8 w-px rounded-full"+ style={{ background: C.gray4 }}+ />+ <LucideZoomOut+ className="size-5"+ style={{ color: C.gray12 }}+ />+ <div className="relative flex w-24 items-center">+ <div+ className="h-[0.3rem] w-full overflow-hidden rounded-full"+ style={{ background: C.gray4 }}+ >+ <div+ className="h-full rounded-full"+ style={{ width: "38%", background: C.blue9 }}+ />+ </div>+ <span+ className="absolute size-4 rounded-full border shadow-md"+ style={{+ left: "calc(38% - 8px)",+ background: C.gray1,+ borderColor: C.gray6,+ }}+ />+ </div>+ <LucideZoomIn+ className="size-5"+ style={{ color: C.gray12 }}+ />+ </div>+ </div>++ {/* resize handle strip */}+ <div+ className="flex h-4 flex-col items-center justify-center gap-0.5 border-t"+ style={{+ borderColor: C.gray4,+ background: "rgba(249,249,249,0.95)",+ }}+ >+ <span+ className="h-0.5 w-20 rounded-full"+ style={{ background: C.gray6 }}+ />+ <span+ className="h-0.5 w-20 rounded-full"+ style={{ background: C.gray6 }}+ />+ </div>+ </div>++ {/* Config sidebar */}+ <div+ className="ml-2 flex w-[416px] shrink-0 flex-col overflow-hidden rounded-xl border"+ style={{ borderColor: C.gray3, background: C.gray1 }}+ >+ <div+ className="flex h-16 shrink-0 items-center border-b"+ style={{ borderColor: C.gray3 }}+ >+ <Tab icon={<CapImage className="size-5" />} selected />+ <Tab icon={<CapCamera className="size-5" />} />+ <Tab icon={<CapAudioOn className="size-5" />} />+ <Tab icon={<CapCursor className="size-5" />} />+ <Tab icon={<LucideKeyboard className="size-5" />} />+ <Tab icon={<CapMessageBubble className="size-5" />} />+ </div>++ <div className="flex min-h-0 flex-1 flex-col gap-6 overflow-hidden p-4 text-sm">+ <Field+ icon={<CapImage className="size-4" />}+ label="Background Image"+ >+ <div className="flex flex-col gap-2">+ <div className="flex flex-row items-center gap-2">+ {["Desktop", "Wallpaper", "Image"].map((label) => (+ <SourceTile+ key={label}+ label={label}+ selected={label === "Wallpaper"}+ />+ ))}+ </div>+ <div className="flex flex-row items-center gap-2">+ {["Color", "Gradient", "None"].map((label) => (+ <SourceTile key={label} label={label} />+ ))}+ </div>+ </div>+ <div+ className="w-full border-t border-dashed"+ style={{ borderColor: C.gray5 }}+ />+ <div>+ <div className="mb-3 flex flex-row items-center gap-2 overflow-hidden text-xs">+ {WALLPAPER_THEMES.map((label) => (+ <span+ key={label}+ className="flex flex-1 items-center justify-center whitespace-nowrap rounded-lg border px-4 py-2"+ style={+ label === "Cities"+ ? {+ background: C.gray3,+ borderColor: C.gray3,+ color: C.gray12,+ }+ : { borderColor: C.gray5, color: C.gray11 }+ }+ >+ {label}+ </span>+ ))}+ </div>+ <div+ data-demo-anchor="editor-swatches"+ className="grid grid-cols-7 gap-2"+ >+ {WALLPAPERS.map((item, i) => (+ <button+ key={item.id}+ type="button"+ aria-label={`Wallpaper ${item.id}`}+ data-demo-anchor={+ i === 1 ? "editor-swatch" : undefined+ }+ data-scene-anchor={`swatch-${i}`}+ onClick={() => onSwatch(i)}+ className="aspect-square cursor-pointer overflow-hidden rounded-lg transition-[box-shadow,transform] duration-150 hover:scale-[1.06]"+ style={{+ boxShadow:+ ui.bgIndex === i+ ? "0 0 0 2px #e5e7eb, 0 0 0 4px #6b7280"+ : undefined,+ }}+ >+ <Image+ src={item.thumb}+ alt=""+ width={48}+ height={48}+ draggable={false}+ className="h-full w-full object-cover"+ />+ </button>+ ))}+ </div>+ </div>+ </Field>+ <div+ className="w-full border-t border-dashed"+ style={{ borderColor: "#d1d5db" }}+ />++ <Field+ icon={<CapLayoutIcon className="size-4" />}+ label="Padding"+ >+ <SliderRow fill={padding} anchor="editor-padding" />+ </Field>+ <Field+ icon={<CapCrop className="size-4" />}+ label="Rounded Corners"+ >+ <SliderRow fill={radius} anchor="editor-radius" />+ </Field>+ </div>+ </div>+ </div>++ {/* ------------------------------------------------------ timeline */}+ <div+ data-demo-anchor="editor-timeline"+ className="relative shrink-0 px-4 pt-8"+ style={{ height: 236 }}+ >+ {/* minimap */}+ <div+ className="absolute left-32 right-4 top-3 h-3 rounded-full"+ style={{ background: "rgba(217,217,217,0.35)" }}+ >+ <span+ className="absolute inset-y-0 left-0 w-2/5 rounded-full border"+ style={{+ borderColor: "rgba(206,206,206,0.8)",+ background: "rgba(217,217,217,0.7)",+ }}+ />+ </div>++ <div className="flex gap-2">+ {/* gutter */}+ <div className="flex w-[104px] shrink-0 flex-col justify-end pb-1">+ <span+ className="flex h-8 w-full items-center justify-center gap-1.5 rounded-lg text-[0.6875rem] font-medium text-white"+ style={{+ background: "linear-gradient(to bottom, #3b82f6, #2563eb)",+ boxShadow:+ "0 2px 8px -4px rgba(37,99,235,0.55), inset 0 1px 0 0 rgba(255,255,255,0.2)",+ }}+ >+ <LucidePlus className="size-3.5" />+ <span>Add track</span>+ <LucideChevronDown className="size-2.5 text-white/70" />+ </span>+ </div>+ {/* ruler */}+ <div+ className="relative h-8 flex-1 text-xs"+ style={{ color: C.gray9 }}+ >+ {[0, 1, 2, 3, 4, 5, 6].map((s) => (+ <span+ key={s}+ className="absolute flex -translate-x-1/2 flex-col items-center gap-1"+ style={{ left: `${(s / 6.4) * 100}%`, top: 0 }}+ >+ <span>{`0:${String(s * 5).padStart(2, "0")}`}</span>+ <span className="h-1 w-1 rounded-full bg-current" />+ </span>+ ))}+ </div>+ </div>++ {/* video track */}+ <div className="mt-2 flex gap-2">+ <div+ className="flex h-[52px] w-[104px] shrink-0 flex-col items-center justify-center gap-1 rounded-xl text-white"+ style={{+ background: C.trackClip,+ border: "1px solid #2a5c96",+ }}+ >+ <CapClapperboard className="size-4" />+ <span className="text-[0.625rem] font-medium">Video</span>+ </div>+ <div className="relative h-[52px] flex-1">+ <div+ className="absolute inset-y-0 left-0 overflow-hidden rounded-xl"+ style={{+ width: "78%",+ background: C.trackClip,+ border: "1px solid #2a5c96",+ }}+ >+ <div className="flex h-full flex-col items-center justify-center">+ <span className="text-xs text-white/70">Clip</span>+ <span className="flex items-center gap-1 text-[0.625rem] text-white">+ <LucideClock className="size-3" />+ <span>0:32</span>+ <span className="ml-1 rounded bg-white/15 px-1">1x</span>+ </span>+ </div>+ {/* mic waveform */}+ <div className="absolute inset-x-0 bottom-0 flex h-3 items-end gap-px px-1">+ {WAVE_HEIGHTS.map((h, i) => (+ <span+ // biome-ignore lint/suspicious/noArrayIndexKey: static generated bars+ key={i}+ className="w-full flex-1 rounded-sm"+ style={{+ height: `${h * 100}%`,+ background: "rgba(255,255,255,0.4)",+ }}+ />+ ))}+ </div>+ </div>+ </div>+ </div>++ {/* zoom track */}+ <div className="mt-2 flex gap-2">+ <div+ className="flex h-[52px] w-[104px] shrink-0 flex-col items-center justify-center gap-1 rounded-xl text-white"+ style={{+ background: C.trackZoom,+ border: "1px solid #30343d",+ }}+ >+ <LucideSearch className="size-4" />+ <span className="text-[0.625rem] font-medium">Zoom</span>+ </div>+ <div+ className="relative flex h-[52px] flex-1 items-center justify-center overflow-hidden rounded-xl"+ style={{ background: "rgba(240,240,240,0.35)" }}+ >+ {ui.zoomSegments ? (+ [+ { left: "9%", width: "22%" },+ { left: "44%", width: "26%" },+ ].map((segment) => (+ <span+ key={segment.left}+ className="absolute inset-y-0 flex items-center justify-center gap-1.5 rounded-xl text-xs text-white"+ style={{+ ...segment,+ background: C.trackZoom,+ border: "1px solid #30343d",+ }}+ >+ <LucideSearch className="size-3.5" />+ Auto+ </span>+ ))+ ) : (+ <span+ data-scene-anchor="editor-zoom-generate"+ className="flex h-8 items-center rounded-lg border px-3 text-xs shadow-md"+ style={{+ background: C.gray5,+ borderColor: C.gray6,+ color: C.gray12,+ boxShadow: "0 1.5px 0 0 rgba(255,255,255,0.4) inset",+ }}+ >+ Click to generate zoom segments+ </span>+ )}+ </div>+ </div>++ {/* playhead */}+ <div+ ref={playheadRef}+ className="pointer-events-none absolute bottom-2 top-6 will-change-transform"+ style={{ left: 128 }}+ >+ <span+ className="absolute -left-[5.5px] top-0 size-3 rounded-full"+ style={{ background: "rgb(226,64,64)" }}+ />+ <span+ className="absolute left-0 top-1 h-full w-px"+ style={{+ background:+ "linear-gradient(to bottom, rgb(226,64,64), rgba(226,64,64,0))",+ }}+ />+ </div>+ </div>+ </div>+ </div>+ </div>+ );+};++const SourceTile = ({+ label,+ selected,+}: {+ label: string;+ selected?: boolean;+}) => (+ <span+ className="flex flex-1 items-center justify-center gap-1.5 rounded-[10px] border px-2 py-2.5 text-xs"+ style={+ selected+ ? { background: C.gray3, borderColor: C.gray3, color: C.gray12 }+ : { borderColor: "transparent", color: C.gray11 }+ }+ >+ <span+ className="size-3.5 rounded"+ style={{+ background: "linear-gradient(135deg,#8fc1f7,#dad0f8)",+ }}+ />+ {label}+ </span>+);diff --git a/apps/web/components/pages/HomeTwo/demo/CapRecorderWindow.tsx b/apps/web/components/pages/HomeTwo/demo/CapRecorderWindow.tsxnew file mode 100644index 000000000..6810acaad--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/CapRecorderWindow.tsx@@ -0,0 +1,506 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { useState } from "react";+import {+ CapCamera,+ CapChevronDown,+ CapFilmCut,+ CapInfo,+ CapInstant,+ CapLogoFull,+ CapMicrophone,+ CapScreenshot,+ LucideAppWindowMac,+ LucideBell,+ LucideCircleHelp,+ LucideImage,+ LucideMaximize2,+ LucideScanText,+ LucideSettings,+ LucideSquarePlay,+ LucideVideo,+ MdiMonitor,+ MsScreenshotFrame,+ PhMonitorBold,+} from "./capIcons";+import { TrafficLights, WindowsCaptionControls } from "./chrome";+import { useIsWindowsDemo } from "./platform";++/**+ * Pixel replica of the Cap desktop recorder window (compact 330×395 layout,+ * light theme) — markup and values mirror+ * apps/desktop/src/routes/(window-chrome)/new-main/index.tsx and friends.+ * In the interactive demo the controls are real buttons: the mode pills,+ * Display tile, and camera row report clicks up to the orchestrator, and+ * hover states (including the mode hovercards) come from the visitor's own+ * pointer.+ */++export type RecorderMode = "instant" | "studio";++export type RecorderUi = {+ visible: boolean;+ mode: RecorderMode;+ /** Display target selected (blue state on the Display tile). */+ displaySelected: boolean;+ /** Camera row populated + On pill. */+ cameraOn: boolean;+};++/* Desktop palette (Radix light values used by the app). */+const C = {+ gray1: "#fcfcfc",+ gray2: "#f9f9f9",+ gray3: "#f0f0f0",+ gray4: "#e8e8e8",+ gray5: "#e0e0e0",+ gray6: "#d9d9d9",+ gray7: "#cecece",+ gray8: "#bbbbbb",+ gray10: "#838383",+ gray11: "#646464",+ gray12: "#202020",+ blue3: "#e6f4fe",+ blue8: "#5eb1ef",+ blue9: "#0090ff",+ blue10: "#0588f0",+ blue11: "#0d74ce",+};++type HoverMode = RecorderMode | "screenshot";++const MODE_HOVERCARDS: Record<+ HoverMode,+ { label: string; description: string }+> = {+ instant: {+ label: "Instant mode",+ description:+ "Uploads while you record and gives you a link to share when you stop.",+ },+ studio: {+ label: "Studio mode",+ description:+ "Saves recordings on your computer and opens the editor when you stop.",+ },+ screenshot: {+ label: "Screenshot mode",+ description:+ "Capture a window or area, adjust the background, and copy the image to your clipboard.",+ },+};++const HeaderIconButton = ({ children }: { children: React.ReactNode }) => (+ <span className="flex size-5 items-center justify-center text-[#646464]">+ {children}+ </span>+);++const InfoPill = ({ on }: { on: boolean }) => (+ <span+ className="inline-flex h-[24px] min-w-[40px] items-center justify-center rounded-full px-2.5 text-[11px] font-medium leading-none"+ style={+ on+ ? { background: C.blue9, color: "#ffffff" }+ : { background: C.gray5, color: C.gray11 }+ }+ >+ {on ? "On" : "Off"}+ </span>+);++const DeviceRow = ({+ icon,+ label,+ on,+ showSettings,+ anchor,+ ariaLabel,+ onClick,+}: {+ icon: React.ReactNode;+ label: string;+ on: boolean;+ showSettings?: boolean;+ anchor?: string;+ ariaLabel: string;+ onClick: () => void;+}) => (+ <button+ type="button"+ data-demo-anchor={anchor}+ aria-label={ariaLabel}+ onClick={onClick}+ className="flex h-[42px] w-full cursor-pointer items-center gap-2.5 rounded-lg border border-[#d9d9d9] bg-[#f9f9f9] pl-3 pr-1.5 transition-colors duration-150 hover:border-[#bbbbbb] hover:bg-[#e8e8e8]"+ >+ <span className="size-4 shrink-0" style={{ color: C.gray11 }}>+ {icon}+ </span>+ <p+ className="min-w-0 flex-1 truncate text-left text-sm font-medium"+ style={{ color: C.gray12 }}+ >+ {label}+ </p>+ <span className="flex shrink-0 items-center gap-0.5">+ {showSettings ? (+ <span+ className="flex size-7 items-center justify-center rounded-md"+ style={{ color: C.gray10 }}+ >+ <LucideSettings className="size-3.5" />+ </span>+ ) : null}+ <InfoPill on={on} />+ </span>+ </button>+);++const TargetTile = ({+ icon,+ name,+ selected,+ withDropdown,+ anchor,+ onClick,+}: {+ icon: React.ReactNode;+ name: string;+ selected?: boolean;+ withDropdown?: boolean;+ anchor?: string;+ onClick: () => void;+}) => (+ <button+ type="button"+ data-demo-anchor={anchor}+ aria-label={`Record ${name}`}+ onClick={onClick}+ className={classNames(+ "flex flex-1 cursor-pointer overflow-hidden rounded-lg border transition-[background-color,border-color] duration-150",+ selected+ ? "border-[#5eb1ef] bg-[#e6f4fe] shadow-[0_0_0_1px_#fcfcfc,0_0_0_2px_#5eb1ef] hover:border-[#0090ff] hover:bg-[#d5efff]"+ : "border-[#d9d9d9] bg-[#f9f9f9] hover:border-[#bbbbbb] hover:bg-[#f0f0f0]",+ )}+ >+ <span+ className={classNames(+ "flex flex-1 flex-col items-center justify-end gap-1 py-2 text-center",+ withDropdown ? "pl-5" : "",+ )}+ >+ <span+ className="size-5 shrink-0"+ style={{ color: selected ? C.blue10 : C.gray10 }}+ >+ {icon}+ </span>+ <p className="text-xs" style={{ color: selected ? C.blue11 : C.gray12 }}>+ {name}+ </p>+ </span>+ {withDropdown ? (+ <span+ className="flex w-7 shrink-0 items-center justify-center border-l"+ style={{ background: C.gray4, borderColor: C.gray6 }}+ >+ <CapChevronDown className="size-4" style={{ color: C.gray11 }} />+ </span>+ ) : null}+ </button>+);++const ModeButton = ({+ selected,+ hovered,+ anchor,+ label,+ onClick,+ onHover,+ children,+}: {+ selected: boolean;+ hovered: boolean;+ anchor: string;+ label: string;+ onClick: () => void;+ onHover: (over: boolean) => void;+ children: React.ReactNode;+}) => (+ <button+ type="button"+ data-demo-anchor={anchor}+ aria-label={label}+ aria-pressed={selected}+ onClick={onClick}+ onMouseEnter={() => onHover(true)}+ onMouseLeave={() => onHover(false)}+ className="relative flex size-7 cursor-pointer items-center justify-center rounded-full transition-all duration-200"+ style={{+ background: selected || hovered ? C.gray7 : C.gray3,+ boxShadow: selected+ ? `0 0 0 1px ${C.gray1}, 0 0 0 3px #3b82f6`+ : undefined,+ }}+ >+ {children}+ </button>+);++export const CapRecorderWindow = ({+ ui,+ onMode,+ onSelectDisplay,+ onToggleCamera,+ onMiss,+}: {+ ui: RecorderUi;+ onMode: (mode: RecorderMode) => void;+ onSelectDisplay: () => void;+ onToggleCamera: () => void;+ onMiss: () => void;+}) => {+ const isWindows = useIsWindowsDemo();+ const [hoverMode, setHoverMode] = useState<HoverMode | null>(null);+ const hovercard = hoverMode ? MODE_HOVERCARDS[hoverMode] : null;++ const hover = (mode: HoverMode) => (over: boolean) =>+ setHoverMode((prev) => (over ? mode : prev === mode ? null : prev));++ return (+ <div+ inert={!ui.visible}+ className={classNames(+ "absolute select-none overflow-visible transition-[opacity,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",+ ui.visible+ ? "opacity-100 [transform:scale(1)]"+ : "pointer-events-none opacity-0 [transform:scale(0.97)_translateY(6px)]",+ )}+ style={{ width: 330, height: 395, fontWeight: 500 }}+ >+ <div+ className="flex h-full w-full flex-col overflow-hidden rounded-[16px] backdrop-blur-[28px] backdrop-saturate-[1.45]"+ style={{+ background: "rgba(244,244,243,0.84)",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 28px 80px rgba(0,0,0,0.26), 0 4px 18px rgba(0,0,0,0.1)",+ }}+ >+ {/* Titlebar */}+ <div+ className="flex h-9 w-full shrink-0 items-center border-b"+ style={{+ background: "rgba(250,250,249,0.72)",+ borderColor: "rgba(0,0,0,0.08)",+ }}+ >+ {/* macOS: close + zoom only, the way the recorder ships. Windows+ puts its caption controls at the far end instead. */}+ {isWindows ? null : (+ <TrafficLights+ size={14}+ minimize={false}+ className="ml-3 gap-2.5"+ />+ )}+ <div className="mx-2 flex min-w-0 flex-1 items-center gap-1">+ <HeaderIconButton>+ <LucideCircleHelp className="size-4" />+ </HeaderIconButton>+ <div className="min-h-9 min-w-0 flex-1" />+ <div className="flex shrink-0 items-center gap-1">+ <HeaderIconButton>+ <LucideMaximize2 className="size-3.5" />+ </HeaderIconButton>+ <HeaderIconButton>+ <LucideSettings className="size-4" />+ </HeaderIconButton>+ <HeaderIconButton>+ <LucideImage className="size-4" />+ </HeaderIconButton>+ <HeaderIconButton>+ <LucideSquarePlay className="size-4" />+ </HeaderIconButton>+ <HeaderIconButton>+ <LucideScanText className="size-4" />+ </HeaderIconButton>+ <HeaderIconButton>+ <LucideBell className="size-4" />+ </HeaderIconButton>+ </div>+ </div>+ {isWindows ? <WindowsCaptionControls className="h-9" /> : null}+ </div>++ {/* Body */}+ <div className="flex min-h-0 flex-1 flex-col gap-2 px-[13px] pb-[8px]">+ {/* Logo row + mode selector */}+ <div className="mb-[6px] mt-[16px] flex items-center justify-between">+ <div className="flex items-center space-x-1">+ <CapLogoFull className="h-auto w-[92px]" />+ <span+ className="ml-2 rounded-lg border px-1 py-0.5 text-[0.6rem] leading-normal"+ style={{+ borderColor: C.gray5,+ background: C.gray3,+ color: C.gray12,+ }}+ >+ Personal+ </span>+ </div>++ <div+ className="relative flex w-fit items-center gap-2 rounded-full border p-1.5"+ style={{ borderColor: C.gray5, background: C.gray3 }}+ >+ <span+ data-demo-anchor="mode-info"+ className="absolute -left-1.5 -top-2 flex rounded-full p-1"+ style={{ background: C.gray5 }}+ >+ <CapInfo className="size-2.5" style={{ color: "#000000" }} />+ </span>+ <ModeButton+ selected={ui.mode === "instant"}+ hovered={hoverMode === "instant"}+ anchor="mode-instant"+ label="Instant mode"+ onClick={() => onMode("instant")}+ onHover={hover("instant")}+ >+ <CapInstant className="h-4 w-auto" style={{ color: "#000" }} />+ </ModeButton>+ <ModeButton+ selected={ui.mode === "studio"}+ hovered={hoverMode === "studio"}+ anchor="mode-studio"+ label="Studio mode"+ onClick={() => onMode("studio")}+ onHover={hover("studio")}+ >+ <CapFilmCut+ className="h-[0.9rem] w-auto"+ style={{ color: "#000" }}+ />+ </ModeButton>+ <ModeButton+ selected={false}+ hovered={hoverMode === "screenshot"}+ anchor="mode-screenshot"+ label="Screenshot mode"+ onClick={onMiss}+ onHover={hover("screenshot")}+ >+ <CapScreenshot+ className="size-[0.9rem]"+ style={{ color: "#000" }}+ />+ </ModeButton>++ {/* Mode hovercard (bottom-end, gutter 12) */}+ <div+ className={classNames(+ "pointer-events-none absolute right-0 top-[calc(100%+12px)] z-20 transition-[opacity,transform] duration-150",+ hovercard+ ? "translate-y-0 opacity-100"+ : "-translate-y-1 opacity-0",+ )}+ >+ <div+ className="flex min-w-[12rem] max-w-[15rem] flex-col gap-2 rounded-lg border px-3 py-2.5 shadow-lg"+ style={{+ background: C.gray12,+ borderColor: C.gray3,+ color: C.gray1,+ }}+ >+ <div className="flex flex-col gap-0.5">+ <span className="text-xs font-medium">+ {hovercard?.label ?? ""}+ </span>+ <span+ className="text-[10px] leading-snug"+ style={{ color: C.gray4 }}+ >+ {hovercard?.description ?? ""}+ </span>+ </div>+ <span+ className="-mx-1 flex items-center gap-1.5 rounded-md px-2 py-1 text-[11px]"+ style={{ color: C.gray4 }}+ >+ <LucideSettings className="size-3" />+ <span>Quality settings</span>+ </span>+ </div>+ </div>+ </div>+ </div>++ {/* Capture targets */}+ <div className="flex w-full flex-col gap-2 text-xs">+ <div className="flex w-full flex-row items-stretch gap-2">+ <TargetTile+ icon={<MdiMonitor className="size-5" />}+ name="Display"+ selected={ui.displaySelected}+ withDropdown+ anchor="target-display"+ onClick={onSelectDisplay}+ />+ <TargetTile+ icon={<LucideAppWindowMac className="size-5" />}+ name="Window"+ withDropdown+ onClick={onMiss}+ />+ </div>+ <div className="flex w-full flex-row items-stretch gap-2">+ <TargetTile+ icon={<MsScreenshotFrame className="size-5" />}+ name="Area"+ onClick={onMiss}+ />+ <TargetTile+ icon={<LucideVideo className="size-5" />}+ name="Camera Only"+ onClick={onMiss}+ />+ </div>+ </div>++ {/* Device rows */}+ <div className="space-y-2">+ <DeviceRow+ icon={<CapCamera className="size-4" />}+ label={ui.cameraOn ? "MacBook Pro Camera" : "No Camera"}+ on={ui.cameraOn}+ showSettings={ui.cameraOn}+ anchor="row-camera"+ ariaLabel={ui.cameraOn ? "Turn camera off" : "Turn camera on"}+ onClick={onToggleCamera}+ />+ <DeviceRow+ icon={<CapMicrophone className="size-4" />}+ label={isWindows ? "Microphone Array" : "MacBook Pro Microphone"}+ on+ showSettings+ anchor="row-mic"+ ariaLabel="Microphone"+ onClick={onMiss}+ />+ <DeviceRow+ icon={<PhMonitorBold className="size-4" />}+ label="Record System Audio"+ on+ ariaLabel="System audio"+ onClick={onMiss}+ />+ </div>+ </div>+ </div>+ </div>+ );+};diff --git a/apps/web/components/pages/HomeTwo/demo/CapShareWindow.tsx b/apps/web/components/pages/HomeTwo/demo/CapShareWindow.tsxnew file mode 100644index 000000000..2d40ca7a5--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/CapShareWindow.tsx@@ -0,0 +1,249 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import type { RefObject } from "react";+import { useState } from "react";+import { CapLogoMark, CapPlay } from "./capIcons";+import { TrafficLights, WindowsCaptionControls } from "./chrome";+import { useVideoAttrs, VIDEO_POSTERS } from "./media";+import { useIsWindowsDemo } from "./platform";++/**+ * A browser window showing the Cap share page an instant recording produces —+ * the payoff shot for Instant Mode: paste the link, viewers watch and comment+ * in the browser. The reaction pills are live so the visitor can leave one.+ */+export const CapShareWindow = ({+ visible,+ width,+ height,+ commentVisible,+ videoRef,+ title = "Dashboard walkthrough",+ url = "cap.link/dashboard-walkthrough",+ duration = "0:32",+}: {+ visible: boolean;+ width: number;+ height: number;+ commentVisible: boolean;+ videoRef: RefObject<HTMLVideoElement | null>;+ title?: string;+ url?: string;+ duration?: string;+}) => {+ const isWindows = useIsWindowsDemo();+ const screenVideo = useVideoAttrs(VIDEO_POSTERS.screen, visible);+ const [reacted, setReacted] = useState<Record<string, boolean>>({});++ return (+ <div+ inert={!visible}+ data-demo-anchor="share-window"+ className={classNames(+ "absolute transition-[opacity,transform] duration-[400ms] ease-[cubic-bezier(0.16,1,0.3,1)]",+ visible+ ? "opacity-100 [transform:scale(1)_translateY(0)]"+ : "pointer-events-none opacity-0 [transform:scale(0.96)_translateY(18px)]",+ )}+ style={{ width, height }}+ >+ <div+ className="flex h-full w-full flex-col overflow-hidden"+ style={{+ borderRadius: isWindows ? 8 : 10,+ background: "#ffffff",+ border: "1px solid rgba(0,0,0,0.1)",+ boxShadow: "0 28px 80px rgba(0,0,0,0.28), 0 4px 18px rgba(0,0,0,0.1)",+ }}+ >+ {/* browser chrome */}+ <div+ className="flex h-11 shrink-0 items-center gap-3 border-b px-3.5"+ style={{ background: "#f6f7f9", borderColor: "rgba(0,0,0,0.07)" }}+ >+ {isWindows ? null : <TrafficLights />}+ <div className="flex items-center gap-2 text-[rgba(17,17,17,0.4)]">+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-4">+ <path+ d="m14 6-6 6 6 6"+ fill="none"+ stroke="currentColor"+ strokeWidth="2.4"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ <svg+ aria-hidden="true"+ viewBox="0 0 24 24"+ className="size-4 opacity-50"+ >+ <path+ d="m10 6 6 6-6 6"+ fill="none"+ stroke="currentColor"+ strokeWidth="2.4"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+ </div>+ <div className="flex min-w-0 flex-1 justify-center">+ <span+ className="flex h-7 w-[62%] min-w-0 items-center justify-center gap-1.5 rounded-lg text-[12px]"+ style={{+ background: "rgba(17,17,17,0.05)",+ color: "rgba(17,17,17,0.7)",+ }}+ >+ <svg+ aria-hidden="true"+ viewBox="0 0 24 24"+ className="size-3 opacity-60"+ >+ <rect+ x="5"+ y="10"+ width="14"+ height="10"+ rx="2"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ />+ <path+ d="M8 10V7a4 4 0 0 1 8 0v3"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ />+ </svg>+ <span className="truncate">{url}</span>+ </span>+ </div>+ {isWindows ? (+ <WindowsCaptionControls className="-mr-3.5 h-11" />+ ) : (+ <span className="w-10" />+ )}+ </div>++ {/* share page */}+ <div className="flex min-h-0 flex-1 flex-col">+ <div className="flex items-center gap-2.5 px-5 pb-3 pt-4">+ <CapLogoMark className="size-7" />+ <div className="min-w-0 flex-1 leading-tight">+ <p className="truncate text-[14px] font-semibold text-[#111111]">+ {title}+ </p>+ <p className="text-[11.5px] text-[rgba(17,17,17,0.5)]">+ Richie · just now · {duration}+ </p>+ </div>+ <span+ data-scene-anchor="share-button"+ className="flex h-8 items-center rounded-lg px-3.5 text-[12.5px] font-medium text-white"+ style={{ background: "linear-gradient(180deg,#3b82f6,#2563eb)" }}+ >+ Share+ </span>+ </div>++ {/* player */}+ <div className="relative mx-5 overflow-hidden rounded-xl bg-black">+ <video+ ref={videoRef}+ className="aspect-[16/9] w-full object-cover"+ src="/illustrations/homepage-animation.mp4"+ muted+ loop+ playsInline+ {...screenVideo}+ />+ {/* player controls */}+ <div+ className="absolute inset-x-0 bottom-0 flex items-center gap-3 px-4 pb-2.5 pt-8 text-white"+ style={{+ background:+ "linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0))",+ }}+ >+ <CapPlay className="h-3 w-auto" />+ <div className="relative h-1 flex-1 overflow-hidden rounded-full bg-white/25">+ <span className="absolute inset-y-0 left-0 w-1/3 rounded-full bg-white" />+ </div>+ <span className="text-[11px] tabular-nums text-white/90">+ 0:11 / {duration}+ </span>+ </div>+ </div>++ {/* reactions + comment */}+ <div className="flex min-h-0 flex-1 flex-col gap-3 px-5 py-4">+ <div+ data-demo-anchor="share-reactions"+ className="flex items-center gap-2"+ >+ {["👍", "🔥", "❤️"].map((emoji) => (+ <button+ key={emoji}+ type="button"+ aria-label={`React with ${emoji}`}+ onClick={() =>+ setReacted((prev) => ({ ...prev, [emoji]: !prev[emoji] }))+ }+ className={classNames(+ "flex h-7 cursor-pointer items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors duration-150",+ reacted[emoji]+ ? "border-[#5eb1ef] bg-[#e6f4fe]"+ : "border-[rgba(0,0,0,0.08)] hover:bg-[rgba(17,17,17,0.04)]",+ )}+ style={{ color: "rgba(17,17,17,0.7)" }}+ >+ {emoji}+ <span className="text-[11px] text-[rgba(17,17,17,0.45)]">+ {(emoji === "🔥" ? 2 : 1) + (reacted[emoji] ? 1 : 0)}+ </span>+ </button>+ ))}+ <span className="flex-1" />+ <span className="text-[11.5px] text-[rgba(17,17,17,0.45)]">+ 3 views+ </span>+ </div>++ <div+ className={classNames(+ "flex items-start gap-2.5 transition-[opacity,transform] duration-[400ms] ease-out",+ commentVisible+ ? "translate-y-0 opacity-100"+ : "translate-y-2 opacity-0",+ )}+ >+ <span+ className="mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white"+ style={{+ background: "linear-gradient(135deg,#7B5FD0,#B9A5F2)",+ }}+ >+ S+ </span>+ <div className="min-w-0 flex-1 rounded-xl bg-[#F4F6F9] px-3 py-2">+ <p className="text-[11.5px] font-medium text-[#111111]">+ Sofia+ <span className="ml-1.5 font-normal text-[rgba(17,17,17,0.4)]">+ at 0:12+ </span>+ </p>+ <p className="text-[12.5px] text-[rgba(17,17,17,0.75)]">+ Perfect — shipping this today 🔥+ </p>+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>+ );+};diff --git a/apps/web/components/pages/HomeTwo/demo/CapSurfaces.tsx b/apps/web/components/pages/HomeTwo/demo/CapSurfaces.tsxnew file mode 100644index 000000000..907fac617--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/CapSurfaces.tsx@@ -0,0 +1,469 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import type { RefObject } from "react";+import type { RecorderMode } from "./CapRecorderWindow";+import {+ CapCamera,+ CapCaretDown,+ CapFilmCut,+ CapGear,+ CapInfo,+ CapInstant,+ CapLogoMark,+ CapMicrophone,+ CapMoreVertical,+ CapPauseCircle,+ CapPlay,+ CapRestart,+ CapSettingsGear,+ CapStopCircle,+ CapTrash,+ CapX,+} from "./capIcons";+import { useVideoAttrs, VIDEO_POSTERS } from "./media";+import { OS_FONT, useIsWindowsDemo } from "./platform";++/**+ * The Cap surfaces that float on the desktop while recording: the in-progress+ * toolbar (320×150 host window, 296×40 visible bar), the circular camera+ * preview window, the target-select overlay panels, and the macOS+ * notification Cap fires when an instant link lands on the clipboard.+ * All values mirror in-progress-recording.tsx / camera.tsx /+ * target-select-overlay.tsx in apps/desktop. In the interactive demo the+ * controls are live: stop/pause/restart work, and the notification opens the+ * share page.+ */++/* ------------------------------------------------------ recording toolbar -- */++const ToolButton = ({+ label,+ onClick,+ children,+}: {+ label: string;+ onClick: () => void;+ children: React.ReactNode;+}) => (+ <button+ type="button"+ aria-label={label}+ onClick={onClick}+ className="flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg p-1 transition-colors duration-100 hover:bg-[#f0f0f0]"+ style={{ color: "#646464" }}+ >+ {children}+ </button>+);++export const RecordingToolbar = ({+ visible,+ paused,+ timerRef,+ onStop,+ onTogglePause,+ onRestart,+ onMiss,+}: {+ visible: boolean;+ paused: boolean;+ timerRef: RefObject<HTMLSpanElement | null>;+ onStop: () => void;+ onTogglePause: () => void;+ onRestart: () => void;+ onMiss: () => void;+}) => (+ <div+ inert={!visible}+ className={classNames(+ "absolute transition-[opacity,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",+ visible+ ? "translate-y-0 opacity-100"+ : "pointer-events-none translate-y-3 opacity-0",+ )}+ style={{ width: 296, fontWeight: 500 }}+ >+ <div+ className="flex h-10 w-full flex-row items-stretch overflow-hidden rounded-2xl border"+ style={{+ background: "#fcfcfc",+ borderColor: "#e0e0e0",+ boxShadow: "0 1px 3px rgba(0,0,0,0.1)",+ }}+ >+ <div className="flex flex-1 flex-row justify-between p-1">+ {/* Stop button with timer */}+ <button+ type="button"+ data-demo-anchor="toolbar-stop"+ aria-label="Stop recording"+ onClick={onStop}+ className="flex cursor-pointer flex-row items-center gap-1 rounded-lg px-2 py-1 transition-colors duration-100 hover:bg-[rgba(239,68,68,0.08)]"+ style={{ color: "#ff4766" }}+ >+ <CapStopCircle className="size-5" />+ <span+ ref={timerRef}+ className="text-[0.875rem] font-medium tabular-nums"+ >+ 0:00+ </span>+ </button>++ {/* Icon cluster */}+ <div+ data-demo-anchor="toolbar-tools"+ className="flex items-center gap-1"+ >+ <div className="relative flex h-8 w-8 items-center justify-center">+ <CapMicrophone className="size-5" style={{ color: "#202020" }} />+ <span+ className="absolute inset-x-1 bottom-1 h-0.5 overflow-hidden rounded-full"+ style={{ background: "#838383" }}+ >+ <span+ className={classNames(+ "absolute inset-0 rounded-full",+ paused ? "" : "ht-demo-mic-meter",+ )}+ style={{ background: "#0090ff" }}+ />+ </span>+ </div>+ <ToolButton+ label={paused ? "Resume recording" : "Pause recording"}+ onClick={onTogglePause}+ >+ {paused ? (+ <CapPlay className="ml-0.5 h-3.5 w-auto" />+ ) : (+ <CapPauseCircle className="size-5" />+ )}+ </ToolButton>+ <ToolButton label="Restart recording" onClick={onRestart}>+ <CapRestart className="size-5" />+ </ToolButton>+ <ToolButton label="Discard recording" onClick={onMiss}>+ <CapTrash className="size-5" />+ </ToolButton>+ <ToolButton label="Recording settings" onClick={onMiss}>+ <CapSettingsGear className="size-5" />+ </ToolButton>+ </div>+ </div>++ {/* Drag handle */}+ <div+ className="flex items-center border-l p-1"+ style={{ borderColor: "#e0e0e0" }}+ >+ <CapMoreVertical className="size-5" style={{ color: "#838383" }} />+ </div>+ </div>+ </div>+);++/* --------------------------------------------------- camera preview window -- */++export const CameraWindow = ({+ visible,+ videoRef,+}: {+ visible: boolean;+ videoRef: RefObject<HTMLVideoElement | null>;+}) => {+ const videoAttrs = useVideoAttrs(VIDEO_POSTERS.webcam, visible);+ return (+ <div+ data-demo-anchor="camera-window"+ className={classNames(+ "absolute transition-[opacity,transform] duration-[400ms] ease-[cubic-bezier(0.16,1,0.3,1)]",+ visible+ ? "opacity-100 [transform:scale(1)]"+ : "pointer-events-none opacity-0 [transform:scale(0.6)]",+ )}+ style={{ width: 230, height: 230 }}+ >+ <div+ className="h-full w-full overflow-hidden rounded-full"+ style={{+ background: "#111111",+ boxShadow:+ "0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1)",+ }}+ >+ <video+ ref={videoRef}+ className="h-full w-full object-cover"+ src="/videos/home-two/webcam.mp4"+ muted+ loop+ playsInline+ {...videoAttrs}+ />+ </div>+ </div>+ );+};++/* --------------------------------------------------- target select overlay -- */++const GLASS: React.CSSProperties = {+ background: "rgba(252,252,252,0.82)",+ border: "1px solid rgba(32,32,32,0.1)",+ boxShadow:+ "0 20px 25px -5px rgba(0,0,0,0.2), 0 8px 10px -6px rgba(0,0,0,0.2)",+};++const OverlayDeviceRow = ({+ icon,+ label,+ on,+}: {+ icon: React.ReactNode;+ label: string;+ on: boolean;+}) => (+ <div+ className="flex h-[42px] w-full flex-row items-center gap-2 rounded-lg border px-2"+ style={{ borderColor: "#e0e0e0", background: "#f0f0f0" }}+ >+ <span className="size-4 shrink-0" style={{ color: "#838383" }}>+ {icon}+ </span>+ <p+ className="min-w-0 flex-1 truncate text-left text-sm"+ style={{ color: "#202020" }}+ >+ {label}+ </p>+ <span+ className="inline-flex h-[24px] min-w-[40px] shrink-0 items-center justify-center rounded-full px-2.5 text-[11px] font-medium leading-none"+ style={+ on+ ? { background: "#0090ff", color: "#fff" }+ : { background: "#e0e0e0", color: "#646464" }+ }+ >+ {on ? "On" : "Off"}+ </span>+ </div>+);++export const TargetOverlayPanel = ({+ visible,+ mode,+ cameraOn,+ onStart,+ onClose,+}: {+ visible: boolean;+ mode: RecorderMode;+ cameraOn: boolean;+ onStart: () => void;+ onClose: () => void;+}) => {+ const isWindows = useIsWindowsDemo();+ const modeLabel = mode === "instant" ? "Instant" : "Studio";+ return (+ <div+ inert={!visible}+ className={classNames(+ "absolute flex flex-col items-center transition-[opacity,transform] duration-300 ease-[cubic-bezier(0.16,1,0.3,1)]",+ visible+ ? "translate-y-0 opacity-100"+ : "pointer-events-none translate-y-4 opacity-0",+ )}+ style={{ width: 416, fontWeight: 500 }}+ >+ <div className="my-2.5 flex w-full flex-col items-stretch gap-2.5">+ <div className="rounded-2xl p-3 backdrop-blur-xl" style={GLASS}>+ <div className="flex items-center gap-2.5">+ <button+ type="button"+ aria-label="Close target selection"+ onClick={onClose}+ className="flex size-9 shrink-0 cursor-pointer items-center justify-center rounded-full transition-transform duration-150 hover:scale-105"+ style={{ background: "#202020" }}+ >+ <CapX className="size-3" style={{ color: "#ffffff" }} />+ </button>++ <button+ type="button"+ data-demo-anchor="overlay-start"+ aria-label="Start recording"+ onClick={onStart}+ className="group flex h-11 min-w-0 max-w-[18rem] flex-1 cursor-pointer flex-row overflow-hidden rounded-full text-white"+ style={{+ background:+ "linear-gradient(to right, #0588f0 0%, #0588f0 55%, #0d74ce 100%)",+ }}+ >+ <span className="flex min-w-0 flex-1 items-center py-1 pl-4 transition-colors group-hover:bg-white/10">+ {mode === "instant" ? (+ <CapInstant className="h-4 w-auto shrink-0" />+ ) : (+ <CapFilmCut className="h-4 w-auto shrink-0" />+ )}+ <span className="ml-3 mr-2 flex min-w-0 flex-col">+ <span className="whitespace-nowrap text-left text-[0.95rem] font-medium text-white">+ Start Recording+ </span>+ <span className="-mt-0.5 flex items-center gap-1 whitespace-nowrap text-[11px] font-light text-white/90">+ {modeLabel} Mode+ </span>+ </span>+ </span>+ <span+ className="flex items-center border-l py-1.5 pl-2.5 pr-3"+ style={{+ borderColor: "rgba(255,255,255,0.2)",+ background: "rgba(255,255,255,0.05)",+ }}+ >+ <CapCaretDown className="h-1.5 w-2.5" />+ </span>+ </button>++ <span+ className="flex size-9 shrink-0 items-center justify-center rounded-full border"+ style={{+ background: "#d9d9d9",+ borderColor: "rgba(0,0,0,0.08)",+ color: "#202020",+ }}+ >+ <CapGear className="size-5" />+ </span>+ </div>+ </div>++ <div className="rounded-2xl p-3 backdrop-blur-xl" style={GLASS}>+ <div className="grid w-full grid-cols-2 gap-2">+ <OverlayDeviceRow+ icon={<CapCamera className="size-4" />}+ label={+ cameraOn+ ? isWindows+ ? "Integrated Webcam"+ : "MacBook Pro Camera"+ : "No Camera"+ }+ on={cameraOn}+ />+ <OverlayDeviceRow+ icon={<CapMicrophone className="size-4" />}+ label={isWindows ? "Microphone Array" : "MacBook Pro Microphone"}+ on+ />+ </div>+ </div>+ </div>++ <div className="mt-1 flex w-fit items-center justify-center gap-1">+ <CapInfo className="size-3 opacity-70" style={{ color: "#ffffff" }} />+ <p className="text-sm text-white [text-shadow:0_1px_3px_rgba(0,0,0,0.55)]">+ <span className="opacity-70">What is </span>+ <span className="font-medium">{modeLabel} Mode</span>?+ </p>+ </div>+ </div>+ );+};++/* -------------------------------------------------------- link notification -- */++export const LinkNotification = ({+ visible,+ onOpen,+}: {+ visible: boolean;+ onOpen: () => void;+}) => {+ const isWindows = useIsWindowsDemo();+ return (+ <div+ inert={!visible}+ data-demo-anchor="notification"+ className={classNames(+ "absolute transition-[opacity,transform] duration-[400ms] ease-[cubic-bezier(0.16,1,0.3,1)]",+ visible+ ? "translate-x-0 translate-y-0 opacity-100"+ : classNames(+ "pointer-events-none opacity-0",+ // The banner slides in from the right edge, the toast rises+ // off the taskbar, same as each OS does it.+ isWindows ? "translate-y-6" : "translate-x-6",+ ),+ )}+ style={{ width: 344 }}+ >+ {isWindows ? (+ <button+ type="button"+ aria-label="Open the shared Cap"+ onClick={onOpen}+ className="flex w-full cursor-pointer flex-col gap-1.5 p-4 text-left transition-colors duration-200 hover:bg-[#fbfbfb]"+ style={{+ borderRadius: 8,+ background: "#f3f3f3",+ border: "1px solid rgba(0,0,0,0.07)",+ boxShadow: "0 16px 40px rgba(0,0,0,0.28)",+ fontFamily: OS_FONT.windows,+ }}+ >+ <span className="flex items-center gap-2">+ <CapLogoMark className="size-4 shrink-0" />+ <span className="text-[12px]" style={{ color: "#5c5c5c" }}>+ Cap+ </span>+ <span className="flex-1" />+ <span className="text-[12px]" style={{ color: "#5c5c5c" }}>+ now+ </span>+ </span>+ <span+ className="text-[14px] font-semibold"+ style={{ color: "#1b1b1b" }}+ >+ Link copied+ </span>+ <span className="text-[13px]" style={{ color: "#404040" }}>+ The share link is on your clipboard. Click to open it.+ </span>+ </button>+ ) : (+ <button+ type="button"+ aria-label="Open the shared Cap"+ onClick={onOpen}+ className="flex w-full cursor-pointer items-center gap-3 rounded-2xl p-3 text-left backdrop-blur-xl transition-transform duration-200 hover:scale-[1.02]"+ style={{+ background: "rgba(245,245,245,0.78)",+ border: "1px solid rgba(0,0,0,0.06)",+ boxShadow:+ "0 12px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.1)",+ }}+ >+ <CapLogoMark className="size-9 shrink-0" />+ <span className="min-w-0 flex-1 leading-tight">+ <p+ className="truncate text-[13px] font-semibold"+ style={{ color: "#1d1d1f" }}+ >+ Link Copied+ </p>+ <p className="truncate text-[13px]" style={{ color: "#48484a" }}>+ Link copied to clipboard+ </p>+ </span>+ <span className="self-start text-[11px]" style={{ color: "#86868b" }}>+ now+ </span>+ </button>+ )}+ </div>+ );+};diff --git a/apps/web/components/pages/HomeTwo/demo/DesktopDemo.tsx b/apps/web/components/pages/HomeTwo/demo/DesktopDemo.tsxnew file mode 100644index 000000000..c0cf6771a--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/DesktopDemo.tsx@@ -0,0 +1,1480 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { useDetectPlatform } from "hooks/useDetectPlatform";+import { MousePointerClick, RotateCcw } from "lucide-react";+import Image from "next/image";+import Link from "next/link";+import {+ memo,+ useCallback,+ useEffect,+ useLayoutEffect,+ useMemo,+ useReducer,+ useRef,+ useState,+} from "react";+import { PlatformCursor } from "../cursors";+import {+ BTN_PRIMARY,+ BTN_SECONDARY,+ CARD_BG,+ grainBg,+ MODE_THEME,+ type ModeTheme,+} from "../theme";+import { useInView, usePageVisible } from "../visibility";+import { CapEditorWindow, type EditorUi } from "./CapEditorWindow";+import {+ CapRecorderWindow,+ type RecorderMode,+ type RecorderUi,+} from "./CapRecorderWindow";+import { CapShareWindow } from "./CapShareWindow";+import {+ CameraWindow,+ LinkNotification,+ RecordingToolbar,+ TargetOverlayPanel,+} from "./CapSurfaces";+import { CapClapperboard, CapFilmCut, CapInstant } from "./capIcons";+import { ContentWindow, DesktopFiles, Dock, MenuBar } from "./MacDesktop";+import { type DemoPlatform, DemoPlatformProvider } from "./platform";+import { WinDesktopFiles, WinTaskbar } from "./WindowsShell";++const MemoizedEditorWindow = memo(CapEditorWindow);+const MemoizedShareWindow = memo(CapShareWindow);+const MemoizedContentWindow = memo(ContentWindow);++/**+ * The interactive "see how it works" demo: a macOS desktop inside a laptop+ * mockup, with the real Cap windows recreated 1:1 — and this time the+ * visitor drives. Every control in the story is a live button: pick Instant+ * mode, choose the display, start and stop a real (fake) recording, open the+ * link notification, flip to Studio, turn the camera on, restyle the editor+ * background, hit Export. A guide bubble explains each step, a pulsing+ * beacon + spotlight mark the next click, and "i" hotspots open short+ * explainers on the parts worth poking at. Off-script clicks that would+ * break the story get a friendly nudge; harmless ones (camera toggle,+ * pausing the recording, any wallpaper, reactions) just work.+ */++/* ------------------------------------------------------------ stage layout -- */++const STAGE_W = 1360;++/**+ * The laptop is one fixed logical canvas, uniformly scaled to fit. The+ * screen is 1360×850; windows live in a 1360×794 layer under the 28px+ * menu bar so the POS coordinates below stay screen-relative.+ */+const LAPTOP = {+ w: 1470,+ h: 920,+ bodyX: 33,+ bodyW: 1404,+ bodyH: 894,+ screenX: 55,+ screenY: 22,+ screenW: 1360,+ screenH: 850,+ baseY: 894,+ baseH: 26,+};++const POS = {+ content: { left: 80, top: 58, width: 760, height: 560 },+ recorder: { left: 906, top: 96 },+ camera: { left: 1040, top: 474 },+ toolbar: { left: (STAGE_W - 296) / 2, top: 646 },+ overlay: { left: (STAGE_W - 416) / 2, top: 388 },+ notification: { left: STAGE_W - 344 - 18, top: 14 },+ share: { left: (STAGE_W - 720) / 2, top: 40, width: 720, height: 622 },+ editor: { left: (STAGE_W - 1080) / 2, top: 14, width: 1080, height: 678 },+};++/**+ * Windows toasts rise from the bottom right, above the taskbar, where macOS+ * banners drop in at the top right. Layer space, so the 28px the windows+ * layer is already offset by is taken out.+ */+const WIN_NOTIFICATION_TOP = LAPTOP.screenH - 28 - 48 - 16 - 112;++/** Idle "attract" state: the recorder sits centred, like the app just opened. */+const IDLE_RECORDER = { left: (STAGE_W - 330) / 2, top: 185 };++const clamp = (v: number, lo: number, hi: number) =>+ Math.min(hi, Math.max(lo, v));++const formatClock = (totalSeconds: number) => {+ const s = Math.max(0, Math.floor(totalSeconds));+ return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;+};++/* ------------------------------------------------------------------- state -- */++type Stage =+ | "recorder"+ | "overlay"+ | "recording"+ | "shared"+ | "editor"+ | "done";++type DemoState = {+ /** Current tour step; TOTAL_STEPS means the demo is finished. */+ step: number;+ stage: Stage;+ mode: RecorderMode;+ displaySelected: boolean;+ cameraOn: boolean;+ notification: boolean;+ shareVisible: boolean;+ comment: boolean;+ bgIndex: number;+ paused: boolean;+ editorPlaying: boolean;+ /** Story history, so free play can never strand the tour. */+ r1Started: boolean;+ r1Stopped: boolean;+ shareSeen: boolean;+ r2Started: boolean;+ r2Stopped: boolean;+ swatched: boolean;+ interacted: boolean;+ /** Bumped when a click lands somewhere the story can't go yet. */+ nudge: number;+};++type Action =+ | { type: "mode"; mode: RecorderMode }+ | { type: "display" }+ | { type: "closeOverlay" }+ | { type: "start" }+ | { type: "stop" }+ | { type: "togglePause" }+ | { type: "openShare" }+ | { type: "commentIn" }+ | { type: "continue" }+ | { type: "toggleCamera" }+ | { type: "swatch"; index: number }+ | { type: "export" }+ | { type: "toggleEditorPlay" }+ | { type: "jump"; phase: number }+ | { type: "skip" }+ | { type: "replay" }+ | { type: "miss" };++const TOTAL_STEPS = 13;++/** Per-step "you're done" checks; free play can satisfy several at once. */+const STEP_DONE: ((s: DemoState) => boolean)[] = [+ (s) => s.mode === "instant",+ (s) => s.displaySelected,+ (s) => s.r1Started,+ (s) => s.r1Stopped,+ (s) => s.shareVisible,+ (s) => s.shareSeen,+ (s) => s.mode === "studio",+ (s) => s.cameraOn,+ (s) => s.displaySelected,+ (s) => s.r2Started,+ (s) => s.r2Stopped,+ (s) => s.swatched,+ () => false, // export jumps straight to done+];++const advance = (s: DemoState): DemoState => {+ let step = s.step;+ while (step < TOTAL_STEPS && STEP_DONE[step]?.(s)) step++;+ return step === s.step ? s : { ...s, step };+};++const INITIAL: DemoState = {+ step: 0,+ stage: "recorder",+ mode: "studio",+ displaySelected: false,+ cameraOn: false,+ notification: false,+ shareVisible: false,+ comment: false,+ bgIndex: 0,+ paused: false,+ editorPlaying: false,+ r1Started: false,+ r1Stopped: false,+ shareSeen: false,+ r2Started: false,+ r2Stopped: false,+ swatched: false,+ interacted: false,+ nudge: 0,+};++/** Entry states for the phase pills. */+const PHASE_STATES: DemoState[] = [+ INITIAL,+ {+ ...INITIAL,+ step: 6,+ mode: "instant",+ r1Started: true,+ r1Stopped: true,+ shareSeen: true,+ interacted: true,+ },+ {+ ...INITIAL,+ step: 11,+ stage: "editor",+ mode: "studio",+ cameraOn: true,+ r1Started: true,+ r1Stopped: true,+ shareSeen: true,+ r2Started: true,+ r2Stopped: true,+ editorPlaying: true,+ interacted: true,+ },+];++const miss = (s: DemoState): DemoState => ({+ ...s,+ nudge: s.nudge + 1,+ interacted: true,+});++const reducer = (s: DemoState, a: Action): DemoState => {+ switch (a.type) {+ case "mode": {+ if (s.stage !== "recorder" && s.stage !== "overlay") return miss(s);+ if (a.mode === s.mode) return s;+ // Keep the story sound: Instant belongs to the first act, Studio to+ // the second. Early flips get a nudge instead of a broken narrative.+ const allowed = a.mode === "instant" ? s.step < 6 : s.step >= 6;+ if (!allowed) return miss(s);+ return advance({ ...s, mode: a.mode, interacted: true });+ }+ case "display": {+ if (s.stage === "overlay") return s;+ if (s.stage !== "recorder") return miss(s);+ return advance({+ ...s,+ displaySelected: true,+ stage: "overlay",+ interacted: true,+ });+ }+ case "closeOverlay": {+ if (s.stage !== "overlay") return s;+ return {+ ...s,+ stage: "recorder",+ displaySelected: false,+ step: Math.min(s.step, s.r1Stopped ? 8 : 1),+ interacted: true,+ };+ }+ case "start": {+ if (s.stage !== "overlay") return s;+ if (s.step !== 2 && s.step !== 9) return miss(s);+ const second = s.r1Stopped;+ return advance({+ ...s,+ stage: "recording",+ paused: false,+ r1Started: s.r1Started || !second,+ r2Started: s.r2Started || second,+ interacted: true,+ });+ }+ case "stop": {+ if (s.stage !== "recording") return s;+ if (s.mode === "instant") {+ return advance({+ ...s,+ stage: "shared",+ notification: true,+ r1Stopped: true,+ displaySelected: false,+ paused: false,+ interacted: true,+ });+ }+ return advance({+ ...s,+ stage: "editor",+ r2Stopped: true,+ displaySelected: false,+ paused: false,+ editorPlaying: true,+ interacted: true,+ });+ }+ case "togglePause":+ return s.stage === "recording"+ ? { ...s, paused: !s.paused, interacted: true }+ : s;+ case "openShare":+ if (!s.notification) return s;+ return advance({+ ...s,+ shareVisible: true,+ notification: false,+ interacted: true,+ });+ case "commentIn":+ return { ...s, comment: true };+ case "continue":+ return advance({+ ...s,+ shareSeen: true,+ shareVisible: false,+ comment: false,+ stage: "recorder",+ interacted: true,+ });+ case "toggleCamera": {+ if (s.stage !== "recorder" && s.stage !== "overlay") return miss(s);+ return advance({ ...s, cameraOn: !s.cameraOn, interacted: true });+ }+ case "swatch":+ if (s.stage !== "editor") return s;+ return advance({+ ...s,+ bgIndex: a.index,+ swatched: true,+ interacted: true,+ });+ case "export":+ if (s.stage !== "editor") return s;+ return {+ ...s,+ stage: "done",+ step: TOTAL_STEPS,+ swatched: true,+ interacted: true,+ };+ case "toggleEditorPlay":+ return s.stage === "editor" || s.stage === "done"+ ? { ...s, editorPlaying: !s.editorPlaying, interacted: true }+ : s;+ case "jump":+ return PHASE_STATES[a.phase] ?? INITIAL;+ case "skip":+ return {+ ...(PHASE_STATES[2] ?? INITIAL),+ stage: "done",+ step: TOTAL_STEPS,+ swatched: true,+ };+ case "replay":+ return INITIAL;+ case "miss":+ return miss(s);+ }+};++/* -------------------------------------------------------------------- tour -- */++type TourStep = {+ text: string;+ /** Objective target: the spotlight + beacon land on this anchor. */+ anchor?: string;+ /** Spotlight padding around the target, content px. */+ pad?: number;+ /** Skip the dim for free-play moments (recording). */+ dim?: boolean;+ /** Bubble centre, screen-space; parked beside the action, never on it. */+ bx: number;+ by: number;+ /** Steps with no natural click get an explicit continue button. */+ continueLabel?: string;+};++// biome-ignore format: keep one step per line+const TOUR: TourStep[] = [+ { text: "Select Instant Mode to record and share a video.", anchor: "mode-instant", bx: 640, by: 420 },+ { text: "Click Display to record the whole screen.", anchor: "target-display", bx: 620, by: 480 },+ { text: "Click Start Recording.", anchor: "overlay-start", bx: 360, by: 645 },+ { text: "Cap uploads while you record. Click Stop to finish.", anchor: "toolbar-stop", dim: false, bx: 400, by: 550 },+ { text: "Cap copies a share link when you stop. Click the notification to open the video.", anchor: "notification", bx: 800, by: 170 },+ { text: "Viewers can watch, comment, and react in their browser.", anchor: "share-window", pad: 6, bx: 1180, by: 400, continueLabel: "Try Studio Mode" },+ { text: "Select Studio Mode to edit a recording before sharing it.", anchor: "mode-studio", bx: 640, by: 420 },+ { text: "Turn on the camera to record yourself alongside your screen.", anchor: "row-camera", bx: 600, by: 645 },+ { text: "Click Display to select your screen.", anchor: "target-display", bx: 620, by: 480 },+ { text: "Studio saves the recording on your computer. Click Start Recording.", anchor: "overlay-start", bx: 360, by: 645 },+ { text: "Click Stop to open your recording in the editor.", anchor: "toolbar-stop", dim: false, bx: 400, by: 550 },+ { text: "Choose a wallpaper to change the video's background.", anchor: "editor-swatches", bx: 620, by: 620 },+ { text: "Click Export to finish the demo. In Cap, you can save a video file or share a link.", anchor: "editor-export", bx: 860, by: 230 },+];++/** "i" hotspots: extra info for the curious, separate from the tour. */+type InfoSpot = {+ key: string;+ anchor: string;+ title: string;+ text: string;+ /** Dot position as a fraction of the anchor rect. */+ fx: number;+ fy: number;+ side: "above" | "below" | "left" | "right";+ when: (s: DemoState) => boolean;+};++const onDesktop = (s: DemoState) =>+ s.stage === "recorder" || s.stage === "overlay";++// biome-ignore format: keep one spot per line+const INFO_SPOTS: InfoSpot[] = [+ { key: "modes", anchor: "mode-info", title: "Recording modes", text: "Use Instant for quick video sharing, Studio for editing recordings, or Screenshot for still images.", fx: 0.5, fy: 0.5, side: "below", when: onDesktop },+ { key: "mic", anchor: "row-mic", title: "Audio tracks", text: "Studio saves your microphone and system audio separately so you can adjust their volume in the editor.", fx: 1, fy: 0, side: "below", when: onDesktop },+ { key: "camera", anchor: "camera-window", title: "Camera preview", text: "See your camera while recording. Studio saves it separately so you can adjust its size and position later.", fx: 0.85, fy: 0.1, side: "left", when: (s) => s.cameraOn && (onDesktop(s) || s.stage === "recording") },+ { key: "tools", anchor: "toolbar-tools", title: "Recording controls", text: "Pause and resume from the toolbar. Try the pause button.", fx: 1, fy: 0, side: "above", when: (s) => s.stage === "recording" },+ { key: "reactions", anchor: "share-reactions", title: "Comments and reactions", text: "Viewers can leave feedback at a specific point in the video. Click an emoji to add a reaction.", fx: 1, fy: 0.2, side: "above", when: (s) => s.shareVisible },+ { key: "tracks", anchor: "editor-timeline", title: "Separate tracks", text: "Studio records your screen, camera, and audio separately, so you can edit them after recording.", fx: 0.5, fy: 0.06, side: "below", when: (s) => s.stage === "editor" },+];++/* ---------------------------------------------------------------- captions -- */++type Caption = {+ key: string;+ theme: ModeTheme;+ chip: string;+ Icon: React.ComponentType<{+ className?: string;+ style?: React.CSSProperties;+ }>;+};++const CAPTIONS: [Caption, Caption, Caption] = [+ {+ key: "instant",+ theme: MODE_THEME.instant,+ chip: "Instant Mode",+ Icon: CapInstant,+ },+ {+ key: "studio",+ theme: MODE_THEME.studio,+ chip: "Studio Mode",+ Icon: CapFilmCut,+ },+ {+ key: "editor",+ theme: MODE_THEME.share,+ chip: "The Editor",+ Icon: CapClapperboard,+ },+];++const phaseOf = (step: number) => (step >= 11 ? 2 : step >= 6 ? 1 : 0);++/** Where each phase starts, for the progress bar's chapter ticks. */+const PHASE_TICKS = [6 / TOTAL_STEPS, 11 / TOTAL_STEPS];++type Mark = { x: number; y: number; w: number; h: number };++/* --------------------------------------------------------------- component -- */++export const DesktopDemo = ({+ startRequested = false,+}: {+ startRequested?: boolean;+}) => {+ const frameBoxRef = useRef<HTMLDivElement | null>(null);+ const inView = useInView(frameBoxRef, "0px");+ const pageVisible = usePageVisible();+ const active = inView && pageVisible;+ const screenRef = useRef<HTMLDivElement | null>(null);+ const timerRef = useRef<HTMLSpanElement | null>(null);+ const contentScrollRef = useRef<HTMLDivElement | null>(null);+ const editorTimeRef = useRef<HTMLSpanElement | null>(null);+ const playheadRef = useRef<HTMLDivElement | null>(null);+ const cameraVideoRef = useRef<HTMLVideoElement | null>(null);+ const shareVideoRef = useRef<HTMLVideoElement | null>(null);+ const editorVideoRef = useRef<HTMLVideoElement | null>(null);+ const editorCamRef = useRef<HTMLVideoElement | null>(null);+ const typedRef = useRef<HTMLSpanElement | null>(null);+ const clockRef = useRef({ accum: 0, last: 0 });+ const playOffsetRef = useRef(0);+ const marksSigRef = useRef("");++ /** Null until the first fit: the laptop stays invisible so it can't paint+ at a guessed size and visibly re-scale once measured. */+ const [scale, setScale] = useState<number | null>(null);+ const [state, dispatch] = useReducer(reducer, INITIAL);+ const [marks, setMarks] = useState<Record<string, Mark>>({});+ const [openSpot, setOpenSpot] = useState<string | null>(null);+ /** Attract mode: the tour only begins once the visitor opts in. */+ const [idle, setIdle] = useState(true);++ /** The demo dresses as the visitor's own OS. Everything but Windows (and+ the first paint, before detection resolves) gets the macOS shell, the+ same default the download button uses. Clicking the Apple glyph in the+ menu bar (or Start on the taskbar) switches shells by hand, which is+ how anyone sees the other platform. */+ const { platform } = useDetectPlatform();+ const [osOverride, setOsOverride] = useState<DemoPlatform | null>(null);+ const demoPlatform: DemoPlatform =+ osOverride ?? (platform === "windows" ? "windows" : "macos");+ const isWindows = demoPlatform === "windows";+ const switchOs = useCallback(+ () => setOsOverride(isWindows ? "macos" : "windows"),+ [isWindows],+ );++ const startDemo = useCallback(() => setIdle(false), []);+ useEffect(() => {+ if (startRequested) setIdle(false);+ }, [startRequested]);++ /* The hero's "See how Cap works" hands the visitor straight into the tour. */+ useEffect(() => {+ const onStart = () => setIdle(false);+ window.addEventListener("ht-demo-start", onStart);+ return () => window.removeEventListener("ht-demo-start", onStart);+ }, []);++ const send = useCallback((action: Action) => {+ setOpenSpot(null);+ dispatch(action);+ }, []);+ const chooseWallpaper = useCallback(+ (index: number) => send({ type: "swatch", index }),+ [send],+ );+ const exportRecording = useCallback(() => send({ type: "export" }), [send]);+ const toggleEditorPlayback = useCallback(+ () => send({ type: "toggleEditorPlay" }),+ [send],+ );++ /* Fit the laptop into the space above the controls strip. Layout effect,+ so the very first paint already uses the measured scale. */+ useLayoutEffect(() => {+ const box = frameBoxRef.current;+ if (!box) return;+ const fitLaptop = () => {+ const r = box.getBoundingClientRect();+ // Slightly undersized (×0.95, capped): the laptop should read as an+ // object on the page, not a takeover, but without leaving a dead band+ // between it and the hero above.+ setScale(+ Math.min(+ 0.82,+ 0.95 * Math.min(r.width / LAPTOP.w, r.height / LAPTOP.h),+ ),+ );+ };+ fitLaptop();+ const ro = new ResizeObserver(fitLaptop);+ ro.observe(box);+ return () => ro.disconnect();+ }, []);++ /* Resolve the anchors the current state cares about (the objective + the+ visible info spots) into screen-space rects. Re-measured a few times+ after every state change so entrance transitions settle. */+ const stepDef = state.step < TOTAL_STEPS ? TOUR[state.step] : undefined;+ const visibleSpots = useMemo(+ () => INFO_SPOTS.filter((spot) => spot.when(state)),+ [state],+ );++ // biome-ignore lint/correctness/useExhaustiveDependencies: scale/idle/demoPlatform re-trigger measurement after the laptop refits, the recorder slides home, or the shell swaps+ useEffect(() => {+ const wanted = [+ ...(stepDef?.anchor ? [stepDef.anchor] : []),+ ...visibleSpots.map((spot) => spot.anchor),+ ];+ const measure = () => {+ const screen = screenRef.current;+ if (!screen) return;+ const rect = screen.getBoundingClientRect();+ if (rect.width < 10) return;+ const s = rect.width / LAPTOP.screenW;+ const next: Record<string, Mark> = {};+ for (const anchor of wanted) {+ const el = screen.querySelector<HTMLElement>(+ `[data-demo-anchor="${anchor}"]`,+ );+ if (!el) continue;+ const r = el.getBoundingClientRect();+ next[anchor] = {+ x: (r.left - rect.left) / s,+ y: (r.top - rect.top) / s,+ w: r.width / s,+ h: r.height / s,+ };+ }+ const sig = JSON.stringify(next);+ if (sig !== marksSigRef.current) {+ marksSigRef.current = sig;+ setMarks(next);+ }+ };+ measure();+ if (idle) return;+ const t1 = setTimeout(measure, 300);+ const t2 = setTimeout(measure, 700);+ return () => {+ clearTimeout(t1);+ clearTimeout(t2);+ };+ }, [stepDef, visibleSpots, scale, idle, demoPlatform]);++ /* Press record and it is recording: no 3-2-1. Every fresh take starts from+ a zeroed clock with the recorded window scrolled back to the top. Keyed+ on the stage alone, so pause and resume never reset it. */+ useEffect(() => {+ if (state.stage !== "recording") return;+ clockRef.current = { accum: 0, last: 0 };+ if (timerRef.current) timerRef.current.textContent = "0:00";+ if (contentScrollRef.current)+ contentScrollRef.current.style.transform = "translate3d(0, 0, 0)";+ }, [state.stage]);++ /* The recording clock: real elapsed time in the toolbar, and the recorded+ window slowly "does some work" underneath. */+ useEffect(() => {+ if (state.stage !== "recording" || state.paused) return;+ clockRef.current.last = performance.now();+ return () => {+ const c = clockRef.current;+ c.accum += performance.now() - c.last;+ c.last = 0;+ };+ }, [state.stage, state.paused]);++ useEffect(() => {+ if (state.stage !== "recording" || !active) return;+ const paint = () => {+ const c = clockRef.current;+ const elapsed = c.accum + (state.paused ? 0 : performance.now() - c.last);+ const secs = elapsed / 1000;+ const text = formatClock(secs);+ if (timerRef.current && timerRef.current.textContent !== text)+ timerRef.current.textContent = text;+ if (contentScrollRef.current)+ contentScrollRef.current.style.transform = `translate3d(0, ${-Math.min(+ 240,+ secs * 14,+ )}px, 0)`;+ };+ paint();+ if (state.paused) return;+ const id = setInterval(paint, 200);+ return () => clearInterval(id);+ }, [state.stage, state.paused, active]);++ const restartClock = useCallback(() => {+ clockRef.current = { accum: 0, last: performance.now() };+ if (timerRef.current) timerRef.current.textContent = "0:00";+ }, []);++ /* Sofia's comment lands a beat after the share page opens. */+ useEffect(() => {+ if (!state.shareVisible) return;+ const id = setTimeout(() => dispatch({ type: "commentIn" }), 1400);+ return () => clearTimeout(id);+ }, [state.shareVisible]);++ /* Editor playback: playhead + timecode loop while playing. */+ useEffect(() => {+ const playing =+ (state.stage === "editor" || state.stage === "done") &&+ state.editorPlaying &&+ active;+ if (!playing) return;+ let raf = 0;+ const t0 = performance.now();+ const offset = playOffsetRef.current;+ const loop = (ts: number) => {+ const frac = (((ts - t0) / 1000 + offset) % 20) / 20;+ if (playheadRef.current)+ playheadRef.current.style.transform = `translate3d(${frac * 720}px, 0, 0)`;+ if (editorTimeRef.current) {+ const secs = frac * 19;+ const frames = Math.floor((secs % 1) * 30);+ const text = `${formatClock(secs)}.${String(frames).padStart(2, "0")}`;+ if (editorTimeRef.current.textContent !== text)+ editorTimeRef.current.textContent = text;+ }+ raf = requestAnimationFrame(loop);+ };+ raf = requestAnimationFrame(loop);+ return () => {+ playOffsetRef.current = ((performance.now() - t0) / 1000 + offset) % 20;+ cancelAnimationFrame(raf);+ };+ }, [state.stage, state.editorPlaying, active]);++ /* Type the guide text in on every step change (and on nudges, which+ re-pop the card). */+ // biome-ignore lint/correctness/useExhaustiveDependencies: a nudge remounts the keyed card, so the typed node must refill+ useEffect(() => {+ if (idle) return;+ const text = TOUR[state.step]?.text;+ const typed = typedRef.current;+ if (!text || !typed) return;+ let i = 0;+ typed.textContent = "▍";+ const id = setInterval(() => {+ i += 2;+ if (i >= text.length) {+ typed.textContent = text;+ clearInterval(id);+ } else {+ typed.textContent = `${text.slice(0, i)}▍`;+ }+ }, 16);+ return () => clearInterval(id);+ }, [state.step, state.nudge, idle]);++ /* Videos follow the discrete state. */+ const cameraWindowVisible =+ state.cameraOn && (onDesktop(state) || state.stage === "recording");+ const editorVisible = state.stage === "editor" || state.stage === "done";+ const editorUi = useMemo<EditorUi>(+ () => ({+ visible: editorVisible,+ bgIndex: state.bgIndex,+ playing: state.editorPlaying,+ }),+ [editorVisible, state.bgIndex, state.editorPlaying],+ );+ useEffect(() => {+ const sync = (video: HTMLVideoElement | null, shouldPlay: boolean) => {+ if (!video) return;+ if (shouldPlay && active) {+ if (video.paused) video.play().catch(() => {});+ } else if (!video.paused) {+ video.pause();+ }+ };+ sync(cameraVideoRef.current, cameraWindowVisible);+ sync(shareVideoRef.current, state.shareVisible);+ sync(editorVideoRef.current, editorUi.visible && editorUi.playing);+ sync(editorCamRef.current, editorUi.visible && editorUi.playing);+ }, [+ cameraWindowVisible,+ state.shareVisible,+ editorUi.visible,+ editorUi.playing,+ active,+ ]);++ /* Derived scene. */+ const recorderUi: RecorderUi = {+ visible: onDesktop(state),+ mode: state.mode,+ displaySelected: state.displaySelected,+ cameraOn: state.cameraOn,+ };+ const overlayVisible = state.stage === "overlay";+ const toolbarVisible = state.stage === "recording";+ const phase = phaseOf(state.step);+ const caption = CAPTIONS[phase];++ /* Spotlight + beacon geometry for the current objective. */+ const objectiveMark = stepDef?.anchor ? marks[stepDef.anchor] : undefined;+ const pad = stepDef?.pad ?? 10;+ const dimmed = Boolean(+ !idle &&+ objectiveMark &&+ stepDef &&+ stepDef.dim !== false &&+ state.stage !== "done",+ );+ /* The notification step is the one place the two shells disagree on where+ the action happens, so its bubble follows the toast to the bottom. */+ const notificationStep = stepDef?.anchor === "notification";+ const bubbleX = isWindows && notificationStep ? 700 : (stepDef?.bx ?? 0);+ const bubbleY = isWindows && notificationStep ? 620 : (stepDef?.by ?? 0);++ const beaconVisible = Boolean(+ !idle &&+ objectiveMark &&+ stepDef &&+ !stepDef.continueLabel &&+ state.stage !== "done",+ );++ /* Until measured, lay out at a placeholder scale behind opacity 0. */+ const fitScale = scale ?? 0.6;+ const laptopStyle = useMemo<React.CSSProperties>(+ () => ({ width: LAPTOP.w * fitScale, height: LAPTOP.h * fitScale }),+ [fitScale],+ );+ const laptopInnerStyle = useMemo<React.CSSProperties>(+ () => ({+ width: LAPTOP.w,+ height: LAPTOP.h,+ transform: `scale(${fitScale})`,+ transformOrigin: "top left",+ fontFamily:+ "var(--font-ht-geist), 'Geist Sans', -apple-system, system-ui, sans-serif",+ }),+ [fitScale],+ );++ return (+ <DemoPlatformProvider value={demoPlatform}>+ <div+ data-demo-active={active}+ className="ht-interactive-demo relative flex h-[100svh] max-h-[860px] min-h-[660px] flex-col items-center px-5 pb-4 pt-6 lg:px-8"+ >+ <style>{`+ @keyframes ht-caption-in {+ from { opacity: 0; transform: translateY(8px); }+ to { opacity: 1; transform: translateY(0); }+ }+ @keyframes ht-demo-wiggle {+ 0%, 100% { translate: 0 0; }+ 25% { translate: -5px 0; }+ 55% { translate: 4px 0; }+ 80% { translate: -2px 0; }+ }+ @keyframes ht-demo-mic {+ 0% { transform: translateX(-70%); }+ 15% { transform: translateX(-42%); }+ 30% { transform: translateX(-60%); }+ 45% { transform: translateX(-30%); }+ 60% { transform: translateX(-55%); }+ 75% { transform: translateX(-38%); }+ 100% { transform: translateX(-70%); }+ }+ .ht-demo-mic-meter { animation: ht-demo-mic 1.6s ease-in-out infinite; }+ .ht-interactive-demo[data-demo-active="false"] .ht-demo-mic-meter,+ .ht-interactive-demo[data-demo-active="false"] .ht-demo-loop {+ animation-play-state: paused;+ }+ @keyframes ht-demo-pulse {+ 0% { box-shadow: 0 0 0 0 rgba(0,144,255,0.55); }+ 70%, 100% { box-shadow: 0 0 0 12px rgba(0,144,255,0); }+ }+ @keyframes ht-cursor-drift {+ 0%, 100% { transform: translate3d(0, 0, 0); }+ 50% { transform: translate3d(-14px, -10px, 0); }+ }+ `}</style>++ {/* Laptop */}+ <div+ ref={frameBoxRef}+ className="relative flex min-h-0 w-full flex-1 items-center justify-center"+ >+ {/* Phase-coloured glow grounding the laptop on the band. */}+ <div+ aria-hidden="true"+ className={classNames(+ "absolute left-1/2 top-1/2 h-[58%] w-[62%] -translate-x-1/2 -translate-y-1/2 rounded-full blur-3xl transition-[background-color,opacity] duration-700",+ scale === null ? "opacity-0" : "opacity-[0.55]",+ )}+ style={{ background: caption.theme.pill }}+ />++ <div+ className={classNames(+ "relative transition-opacity duration-500",+ scale === null ? "opacity-0" : "opacity-100",+ )}+ style={laptopStyle}+ >+ <div style={laptopInnerStyle}>+ {/* Lid / bezel */}+ <div+ aria-hidden="true"+ className="absolute"+ style={{+ left: LAPTOP.bodyX,+ top: 0,+ width: LAPTOP.bodyW,+ height: LAPTOP.bodyH,+ borderRadius: 30,+ background: "linear-gradient(180deg, #2b2d33 0%, #101114 8%)",+ boxShadow:+ "inset 0 0 0 1px rgba(255,255,255,0.09), 0 40px 90px -30px rgba(17,17,17,0.45), 0 12px 30px -12px rgba(17,17,17,0.3)",+ }}+ />++ {/* Screen */}+ <div+ ref={screenRef}+ className="absolute overflow-hidden"+ style={{+ left: LAPTOP.screenX,+ top: LAPTOP.screenY,+ width: LAPTOP.screenW,+ height: LAPTOP.screenH,+ borderRadius: 14,+ background: "#000",+ }}+ >+ {/* Wallpaper: one of the city paintings Cap Desktop ships. */}+ <Image+ src="/backgrounds/sf.webp"+ alt=""+ fill+ sizes="1360px"+ draggable={false}+ className="object-cover"+ />++ {/* Desktop chrome */}+ {isWindows ? (+ <>+ <WinDesktopFiles />+ <WinTaskbar+ recording={state.stage === "recording"}+ onSwitchOs={switchOs}+ />+ </>+ ) : (+ <>+ <MenuBar+ recording={state.stage === "recording"}+ onSwitchOs={switchOs}+ />+ <DesktopFiles />+ <Dock />+ </>+ )}++ {/* Target-select highlight around "the screen" */}+ <div+ className={classNames(+ "pointer-events-none absolute inset-0 z-20 rounded-[14px] transition-opacity duration-300",+ overlayVisible ? "opacity-100" : "opacity-0",+ )}+ style={{+ boxShadow:+ "inset 0 0 0 3px rgba(5,136,240,0.9), inset 0 0 80px rgba(5,136,240,0.18)",+ background: "rgba(17,24,39,0.10)",+ }}+ />++ {/* Windows layer, below the menu bar. */}+ <div+ inert={idle || state.stage === "done"}+ className="absolute left-0 top-7"+ style={{ width: STAGE_W, height: LAPTOP.screenH - 28 }}+ >+ <div+ className={classNames(+ "absolute transition-opacity duration-500",+ idle ? "opacity-0" : "opacity-100",+ )}+ style={{ left: POS.content.left, top: POS.content.top }}+ >+ <MemoizedContentWindow+ width={POS.content.width}+ height={POS.content.height}+ scrollRef={contentScrollRef}+ />+ </div>++ <div+ className="absolute"+ style={{ left: POS.share.left, top: POS.share.top }}+ >+ <MemoizedShareWindow+ visible={state.shareVisible}+ width={POS.share.width}+ height={POS.share.height}+ commentVisible={state.comment}+ videoRef={shareVideoRef}+ />+ </div>++ <div+ className="absolute transition-[left,top] duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"+ style={idle ? IDLE_RECORDER : POS.recorder}+ >+ <CapRecorderWindow+ ui={recorderUi}+ onMode={(mode) => send({ type: "mode", mode })}+ onSelectDisplay={() => send({ type: "display" })}+ onToggleCamera={() => send({ type: "toggleCamera" })}+ onMiss={() => send({ type: "miss" })}+ />+ </div>++ <div+ className="absolute"+ style={{ left: POS.camera.left, top: POS.camera.top }}+ >+ <CameraWindow+ visible={cameraWindowVisible}+ videoRef={cameraVideoRef}+ />+ </div>++ <div+ className="absolute z-10"+ style={{ left: POS.editor.left, top: POS.editor.top }}+ >+ <MemoizedEditorWindow+ ui={editorUi}+ width={POS.editor.width}+ height={POS.editor.height}+ videoRef={editorVideoRef}+ camVideoRef={editorCamRef}+ playheadRef={playheadRef}+ timeRef={editorTimeRef}+ onSwatch={chooseWallpaper}+ onExport={exportRecording}+ onTogglePlay={toggleEditorPlayback}+ />+ </div>++ <div+ className="absolute z-20"+ style={{ left: POS.overlay.left, top: POS.overlay.top }}+ >+ <TargetOverlayPanel+ visible={overlayVisible}+ mode={state.mode}+ cameraOn={state.cameraOn}+ onStart={() => send({ type: "start" })}+ onClose={() => send({ type: "closeOverlay" })}+ />+ </div>++ <div+ className="absolute z-20"+ style={{ left: POS.toolbar.left, top: POS.toolbar.top }}+ >+ <RecordingToolbar+ visible={toolbarVisible}+ paused={state.paused}+ timerRef={timerRef}+ onStop={() => send({ type: "stop" })}+ onTogglePause={() => send({ type: "togglePause" })}+ onRestart={restartClock}+ onMiss={() => send({ type: "miss" })}+ />+ </div>++ <div+ className="absolute z-30"+ style={{+ left: POS.notification.left,+ top: isWindows+ ? WIN_NOTIFICATION_TOP+ : POS.notification.top,+ }}+ >+ <LinkNotification+ visible={state.notification}+ onOpen={() => send({ type: "openShare" })}+ />+ </div>+ </div>++ {/* Spotlight: a soft dim with a bright cutout gliding to the+ next objective. Pointer-events-free, so it guides without+ locking anything. */}+ <div+ aria-hidden="true"+ className="pointer-events-none absolute left-0 top-0 z-30 rounded-[14px] transition-[transform,width,height,box-shadow] duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"+ style={{+ transform: `translate3d(${(objectiveMark?.x ?? 0) - pad}px, ${+ (objectiveMark?.y ?? 0) - pad+ }px, 0)`,+ width: (objectiveMark?.w ?? LAPTOP.screenW) + pad * 2,+ height: (objectiveMark?.h ?? LAPTOP.screenH) + pad * 2,+ boxShadow: dimmed+ ? "0 0 24px 9999px rgba(9,12,20,0.5)"+ : "0 0 24px 9999px rgba(9,12,20,0)",+ }}+ />++ {/* Beacon: a pulsing ring hugging the objective's edge, so the+ control itself stays fully visible. */}+ {beaconVisible && objectiveMark ? (+ <div+ aria-hidden="true"+ className="ht-demo-loop pointer-events-none absolute left-0 top-0 z-[35] border-2 border-[#0090ff] transition-[transform,width,height] duration-500 ease-[cubic-bezier(0.4,0,0.2,1)] [animation:ht-demo-pulse_1.8s_ease-out_infinite]"+ style={{+ transform: `translate3d(${objectiveMark.x - 5}px, ${+ objectiveMark.y - 5+ }px, 0)`,+ width: objectiveMark.w + 10,+ height: objectiveMark.h + 10,+ borderRadius: Math.min(+ 18,+ (Math.min(objectiveMark.w, objectiveMark.h) + 10) / 2,+ ),+ }}+ />+ ) : null}++ {/* "i" hotspots: more info, on demand. */}+ {idle+ ? null+ : visibleSpots.map((spot) => {+ const mark = marks[spot.anchor];+ if (!mark) return null;+ const x = mark.x + mark.w * spot.fx;+ const y = mark.y + mark.h * spot.fy;+ const open = openSpot === spot.key;+ return (+ <div+ key={spot.key}+ className="absolute z-[35]"+ style={{ left: x, top: y }}+ >+ <button+ type="button"+ aria-label={`About: ${spot.title}`}+ aria-expanded={open}+ onClick={() =>+ setOpenSpot((prev) =>+ prev === spot.key ? null : spot.key,+ )+ }+ className={classNames(+ "absolute -left-[11px] -top-[11px] flex size-[22px] cursor-pointer items-center justify-center rounded-full text-[12px] font-semibold italic shadow-[0_2px_10px_rgba(17,17,17,0.35)] transition-transform duration-150 hover:scale-110",+ open+ ? "bg-[#111111] text-white"+ : "bg-white text-[#111111]",+ )}+ style={{+ border: "1.5px solid rgba(17,17,17,0.35)",+ fontFamily: "Georgia, serif",+ }}+ >+ i+ </button>+ {open ? (+ <div+ className="absolute w-[240px] animate-[ht-caption-in_200ms_ease-out] rounded-xl px-3.5 py-3 shadow-[0_16px_40px_-8px_rgba(17,17,17,0.5)]"+ style={{+ background: "#202020",+ color: "#fcfcfc",+ ...(spot.side === "below" && {+ left: -120,+ top: 20,+ }),+ ...(spot.side === "above" && {+ left: -120,+ bottom: 20,+ }),+ ...(spot.side === "left" && {+ right: 20,+ top: -12,+ }),+ ...(spot.side === "right" && {+ left: 20,+ top: -12,+ }),+ }}+ >+ <p className="text-[13px] font-semibold">+ {spot.title}+ </p>+ <p className="mt-1 text-[12px] leading-snug text-[rgba(255,255,255,0.75)]">+ {spot.text}+ </p>+ </div>+ ) : null}+ </div>+ );+ })}++ {/* The guide bubble: numbered, typed-in, parked beside the+ action. Wrong-turn clicks re-pop it with a wiggle. */}+ {!idle && stepDef && state.stage !== "done" ? (+ <div+ className="absolute left-0 top-0 z-40 transition-transform duration-500 ease-[cubic-bezier(0.4,0,0.2,1)]"+ style={{+ transform: `translate3d(${clamp(bubbleX, 200, 1160)}px, ${clamp(+ bubbleY,+ 80,+ 780,+ )}px, 0)`,+ }}+ >+ <div className="-translate-x-1/2 -translate-y-1/2">+ <div+ key={`${state.step}:${state.nudge}`}+ className={classNames(+ "relative w-max max-w-[330px] rounded-[16px] px-4 pb-3.5 pt-5 shadow-[0_20px_50px_-12px_rgba(17,17,17,0.55)]",+ state.nudge > 0+ ? "animate-[ht-caption-in_300ms_ease-out,ht-demo-wiggle_400ms_ease-out]"+ : "animate-[ht-caption-in_300ms_ease-out]",+ )}+ style={{+ ...grainBg(CARD_BG),+ fontFamily:+ "var(--font-ht-sans), ui-sans-serif, system-ui, sans-serif",+ }}+ >+ {/* Mode attachment */}+ <span+ className="absolute -top-3.5 left-4 flex items-center gap-1.5 rounded-full px-2.5 py-1 text-[12px] font-semibold shadow-[0_2px_8px_rgba(17,17,17,0.18)]"+ style={{+ background: caption.theme.chip,+ color: caption.theme.glyph,+ }}+ >+ <caption.Icon className="h-3 w-auto" />+ {caption.chip}+ </span>+ <div className="flex items-start gap-3">+ <span+ className="flex size-8 shrink-0 items-center justify-center rounded-full text-[15px] font-semibold text-[#111111]"+ style={{ background: caption.theme.pill }}+ >+ {state.step + 1}+ </span>+ <div className="min-w-0">+ <p className="relative mt-1 text-[19px] font-medium leading-snug tracking-[-0.01em] text-[#111111]">+ <span className="invisible">{stepDef.text}</span>+ <span+ ref={typedRef}+ className="absolute inset-0"+ aria-hidden="true"+ />+ <span className="sr-only">{stepDef.text}</span>+ </p>+ {stepDef.continueLabel ? (+ <button+ type="button"+ onClick={() => send({ type: "continue" })}+ className="mt-3 flex h-9 cursor-pointer items-center gap-1.5 rounded-full bg-[#111111] px-4 text-[14px] font-medium text-white transition-colors duration-150 hover:bg-[#2b2b2b]"+ >+ {stepDef.continueLabel}+ <span aria-hidden="true">→</span>+ </button>+ ) : null}+ </div>+ </div>+ </div>+ </div>+ </div>+ ) : null}++ {/* Idle state: an oversized cursor resting on the app, so the+ screen reads as clickable before the tour chrome exists. */}+ <div+ aria-hidden="true"+ className={classNames(+ "pointer-events-none absolute z-[45] transition-opacity duration-500",+ idle ? "opacity-100" : "opacity-0",+ )}+ style={{ left: 792, top: 468 }}+ >+ <PlatformCursor+ platform={demoPlatform}+ className="ht-demo-loop w-[62px] drop-shadow-[0_10px_18px_rgba(17,17,17,0.35)] [animation:ht-cursor-drift_5s_ease-in-out_infinite]"+ />+ </div>++ {/* Restart, parked bottom-left of the screen once the tour runs. */}+ <button+ type="button"+ inert={idle}+ onClick={() => send({ type: "replay" })}+ className={classNames(+ "absolute bottom-4 left-4 z-[45] flex h-[44px] cursor-pointer items-center gap-2 rounded-full bg-black/55 px-5 text-[17px] font-medium text-white backdrop-blur-md transition-[opacity,background-color] duration-300 hover:bg-black/75 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/70",+ idle ? "pointer-events-none opacity-0" : "opacity-100",+ )}+ >+ <RotateCcw className="size-[16px]" />+ Restart demo+ </button>++ {/* Idle hover overlay: dim the screen and offer the two ways+ in. It stops short of the OS bar so the Apple glyph (or+ Start) can still switch shells before the tour begins. */}+ {idle ? (+ <div+ className={classNames(+ "group absolute inset-x-0 z-[65]",+ isWindows ? "bottom-12 top-0" : "bottom-0 top-7",+ )}+ >+ <button+ type="button"+ aria-label="Start the interactive demo"+ onClick={startDemo}+ className="absolute inset-0 h-full w-full cursor-pointer bg-[rgba(9,12,20,0)] transition-colors duration-300 group-focus-within:bg-[rgba(9,12,20,0.55)] group-hover:bg-[rgba(9,12,20,0.55)]"+ />+ <div className="pointer-events-none absolute inset-0 flex translate-y-3 flex-col items-center justify-center gap-5 opacity-0 transition-all duration-300 group-focus-within:translate-y-0 group-focus-within:opacity-100 group-hover:translate-y-0 group-hover:opacity-100">+ <button+ type="button"+ onClick={startDemo}+ className="pointer-events-auto flex h-[76px] cursor-pointer items-center gap-3.5 rounded-full bg-white px-12 text-[26px] font-medium text-[#111111] shadow-[0_28px_70px_-18px_rgba(9,12,20,0.65)] transition-transform duration-200 hover:scale-[1.04] focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-[#0090ff]"+ >+ <MousePointerClick className="size-[26px]" />+ Start interactive demo+ </button>+ <button+ type="button"+ onClick={(event) => {+ event.stopPropagation();+ document+ .getElementById("workflow")+ ?.scrollIntoView({ behavior: "smooth" });+ }}+ className="pointer-events-auto flex h-[56px] cursor-pointer items-center gap-2 rounded-full border border-white/40 bg-black/30 px-9 text-[20px] font-medium text-white backdrop-blur-md transition-colors duration-200 hover:bg-black/50 focus-visible:outline-none focus-visible:ring-4 focus-visible:ring-white/70"+ >+ Learn more+ <span aria-hidden="true">↓</span>+ </button>+ </div>+ </div>+ ) : null}++ {/* Finish card. */}+ {state.stage === "done" ? (+ <div className="absolute inset-0 z-50 flex items-center justify-center bg-[rgba(9,12,20,0.5)]">+ <div+ className="w-[520px] animate-[ht-caption-in_300ms_ease-out] rounded-[20px] px-10 pb-9 pt-10 text-center shadow-[0_30px_80px_-20px_rgba(17,17,17,0.6)]"+ style={{+ ...grainBg(CARD_BG),+ fontFamily:+ "var(--font-ht-sans), ui-sans-serif, system-ui, sans-serif",+ }}+ >+ <span+ className="mx-auto flex w-fit items-center gap-1.5 rounded-full px-3 py-1.5 text-[13px] font-semibold"+ style={{+ background: caption.theme.chip,+ color: caption.theme.glyph,+ }}+ >+ <CapClapperboard className="h-3.5 w-auto" />+ Demo complete+ </span>+ <h3 className="mt-5 text-[40px] font-normal leading-[1.04] tracking-[-0.03em] text-[#111111]">+ Try Cap for yourself+ </h3>+ <p className="mx-auto mt-3 max-w-[380px] text-[16px] leading-normal text-[rgba(17,17,17,0.7)]">+ Download Cap for macOS or Windows to record, edit, and+ share your screen.+ </p>+ <div className="mt-7 flex items-center justify-center gap-3">+ <Link href="/download" className={BTN_PRIMARY}>+ Download Cap free+ </Link>+ <button+ type="button"+ onClick={() => send({ type: "replay" })}+ className={classNames(+ BTN_SECONDARY,+ "cursor-pointer",+ )}+ >+ Replay the demo+ </button>+ </div>+ </div>+ </div>+ ) : null}++ {/* Camera notch: a MacBook tell, so the Windows shell gets a+ plain lid instead. */}+ {isWindows ? null : (+ <div className="pointer-events-none absolute left-1/2 top-0 z-[60] h-[24px] w-[196px] -translate-x-1/2 rounded-b-[10px] bg-black" />+ )}+ </div>++ {/* Base / deck */}+ <div+ aria-hidden="true"+ className="absolute"+ style={{+ left: 0,+ top: LAPTOP.baseY,+ width: LAPTOP.w,+ height: LAPTOP.baseH,+ borderRadius: "0 0 18px 18px",+ background:+ "linear-gradient(180deg, #eceef2 0%, #cdd1d8 45%, #9aa0aa 100%)",+ boxShadow:+ "inset 0 1px 0 rgba(255,255,255,0.85), 0 18px 40px -18px rgba(17,17,17,0.5)",+ }}+ >+ {/* Thumb groove */}+ <div+ className="absolute left-1/2 top-0 h-[10px] w-[220px] -translate-x-1/2 rounded-b-[12px]"+ style={{+ background:+ "linear-gradient(180deg, #aab0b9 0%, #d5d9df 100%)",+ }}+ />+ </div>+ </div>+ </div>+ </div>++ {/* Controls: phase pills, tour progress, skip. Hidden until the tour starts. */}+ <div+ className={classNames(+ "relative z-10 mt-3 flex flex-wrap items-center justify-center gap-x-4 gap-y-2 transition-opacity duration-500",+ idle ? "pointer-events-none opacity-0" : "opacity-100",+ )}+ >+ <div className="flex items-center gap-1">+ {CAPTIONS.map((c, i) => (+ <button+ key={c.key}+ type="button"+ onClick={() => send({ type: "jump", phase: i })}+ aria-label={`Jump to ${c.chip}`}+ aria-current={i === phase ? "true" : undefined}+ className={classNames(+ "flex h-9 cursor-pointer items-center gap-1.5 rounded-full px-3 text-[13px] font-medium transition-colors duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]",+ i === phase+ ? "text-[#111111]"+ : "text-[rgba(17,17,17,0.45)] hover:bg-[#EDF1F6] hover:text-[#111111]",+ )}+ style={i === phase ? { background: c.theme.pill } : undefined}+ >+ <c.Icon className="h-3 w-auto" />+ {c.chip}+ </button>+ ))}+ </div>+ <div+ className="relative h-1.5 w-48 overflow-hidden rounded-full"+ style={{ background: "rgba(17,17,17,0.12)" }}+ aria-hidden="true"+ >+ <div+ className="absolute inset-y-0 left-0 rounded-full transition-[width] duration-500"+ style={{+ background: "#111111",+ width: `${(Math.min(state.step, TOTAL_STEPS) / TOTAL_STEPS) * 100}%`,+ }}+ />+ {PHASE_TICKS.map((t) => (+ <span+ key={t}+ className="absolute inset-y-0 w-[3px] bg-[#F8FAFC]"+ style={{ left: `${t * 100}%` }}+ />+ ))}+ </div>+ <span className="text-[12px] font-medium tabular-nums text-[rgba(17,17,17,0.45)]">+ {Math.min(state.step + 1, TOTAL_STEPS)} / {TOTAL_STEPS}+ </span>+ <button+ type="button"+ onClick={() => send({ type: "skip" })}+ className="flex h-8 cursor-pointer items-center gap-1 rounded-full px-2.5 text-[13px] font-medium text-[rgba(17,17,17,0.45)] transition-colors duration-200 hover:bg-[#EDF1F6] hover:text-[#111111] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111]"+ >+ Skip demo+ </button>+ </div>+ </div>+ </DemoPlatformProvider>+ );+};diff --git a/apps/web/components/pages/HomeTwo/demo/MacDesktop.tsx b/apps/web/components/pages/HomeTwo/demo/MacDesktop.tsxnew file mode 100644index 000000000..d348f8a62--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/MacDesktop.tsx@@ -0,0 +1,602 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import type { RefObject } from "react";+import { AppleGlyph } from "../glyphs";+import { CapLogoMark } from "./capIcons";+import {+ OsSwitchButton,+ TrafficLights,+ WindowsCaptionControls,+} from "./chrome";+import { useIsWindowsDemo } from "./platform";++/**+ * The fake macOS environment the demo plays inside: menu bar, desktop files,+ * dock, and the little app window that gets recorded. All chrome is drawn in+ * CSS/SVG so it stays crisp at any scale.+ */++/* ------------------------------------------------------------- menu bar -- */++const MenuGlyph = ({ children }: { children: React.ReactNode }) => (+ <span className="flex h-full items-center opacity-80">{children}</span>+);++export const MenuBar = ({+ recording,+ onSwitchOs,+}: {+ recording: boolean;+ onSwitchOs: () => void;+}) => (+ <div+ className="relative z-30 flex h-7 w-full items-center gap-4 px-4 text-[12.5px] font-medium text-[#1d1d1f] backdrop-blur-md"+ style={{+ background: "rgba(255,255,255,0.55)",+ fontFamily:+ "-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif",+ }}+ >+ <OsSwitchButton+ label="Switch the demo to Windows"+ tooltip="See the Windows version"+ align="left"+ onClick={onSwitchOs}+ className="-mx-1.5 h-7 rounded-[5px] px-1.5 hover:bg-black/[0.07]"+ >+ <AppleGlyph className="size-[13px]" />+ </OsSwitchButton>+ <span className="-ml-2.5 font-semibold">Cap</span>+ {["File", "Edit", "View", "Window", "Help"].map((item) => (+ <span key={item} className="hidden opacity-90 lg:inline">+ {item}+ </span>+ ))}+ <span className="flex-1" />++ {/* macOS screen-recording indicator */}+ <span+ className={classNames(+ "flex items-center gap-1 rounded-full px-1.5 py-[1px] transition-opacity duration-300",+ recording ? "opacity-100" : "opacity-0",+ )}+ style={{ background: "rgba(88,86,214,0.16)" }}+ >+ <svg aria-hidden="true" viewBox="0 0 14 14" className="size-3">+ <rect+ x="1"+ y="1"+ width="12"+ height="12"+ rx="3.5"+ fill="none"+ stroke="#5856D6"+ strokeWidth="1.6"+ />+ <circle cx="7" cy="7" r="2.4" fill="#5856D6" />+ </svg>+ </span>++ {/* battery */}+ <MenuGlyph>+ <svg aria-hidden="true" viewBox="0 0 26 12" className="h-[11px] w-auto">+ <rect+ x="0.5"+ y="0.5"+ width="21"+ height="11"+ rx="3"+ fill="none"+ stroke="currentColor"+ strokeOpacity="0.5"+ />+ <rect x="2" y="2" width="15" height="8" rx="1.6" fill="currentColor" />+ <path+ d="M23 4v4c1.2-.3 2-1 2-2s-.8-1.7-2-2Z"+ fill="currentColor"+ fillOpacity="0.5"+ />+ </svg>+ </MenuGlyph>+ {/* wifi */}+ <MenuGlyph>+ <svg aria-hidden="true" viewBox="0 0 16 12" className="h-[11px] w-auto">+ <path d="M8 10.8 1.2 4a9.6 9.6 0 0 1 13.6 0Z" fill="none" />+ <path+ d="M8 11.2 0.8 4.1C2.7 2.2 5.2 1 8 1s5.3 1.2 7.2 3.1Z"+ fill="currentColor"+ />+ </svg>+ </MenuGlyph>+ {/* search */}+ <MenuGlyph>+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-[13px]">+ <circle+ cx="11"+ cy="11"+ r="7"+ fill="none"+ stroke="currentColor"+ strokeWidth="2.4"+ />+ <path+ d="m20.5 20.5-4-4"+ stroke="currentColor"+ strokeWidth="2.4"+ strokeLinecap="round"+ />+ </svg>+ </MenuGlyph>+ {/* control centre */}+ <MenuGlyph>+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-[13px]">+ <rect+ x="2"+ y="4"+ width="20"+ height="7"+ rx="3.5"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ />+ <circle cx="6" cy="7.5" r="2" fill="currentColor" />+ <rect+ x="2"+ y="13"+ width="20"+ height="7"+ rx="3.5"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ />+ <circle cx="18" cy="16.5" r="2" fill="currentColor" />+ </svg>+ </MenuGlyph>+ <span className="whitespace-nowrap tabular-nums opacity-90">+ Thu 20 Aug 9:41 AM+ </span>+ </div>+);++/* -------------------------------------------------------- desktop files -- */++const FolderIcon = () => (+ <svg+ aria-hidden="true"+ viewBox="0 0 64 52"+ className="h-11 w-auto drop-shadow-sm"+ >+ <path+ d="M4 8a5 5 0 0 1 5-5h14.2a5 5 0 0 1 3.8 1.7L30.4 9H55a5 5 0 0 1 5 5v2H4Z"+ fill="#4BA3F2"+ />+ <rect x="4" y="12" width="56" height="36" rx="5" fill="#6FB9F7" />+ <rect+ x="4"+ y="12"+ width="56"+ height="10"+ rx="5"+ fill="#83C4F9"+ opacity="0.8"+ />+ </svg>+);++export const CapFileIcon = () => (+ <span className="relative flex h-11 w-9 items-center justify-center rounded-[6px] bg-white shadow-[0_1px_3px_rgba(0,0,0,0.25)]">+ <span+ className="absolute right-0 top-0 h-3 w-3 rounded-bl-[6px]"+ style={{ background: "#e3e6ec" }}+ />+ <CapLogoMark className="size-5" />+ </span>+);++export const ImageFileIcon = () => (+ <span className="relative flex h-11 w-9 items-center justify-center overflow-hidden rounded-[6px] bg-white shadow-[0_1px_3px_rgba(0,0,0,0.25)]">+ <span+ className="absolute inset-1 rounded-[3px]"+ style={{+ background:+ "linear-gradient(160deg, #8fc1f7 0%, #dad0f8 55%, #f6d9ec 100%)",+ }}+ />+ <span className="absolute bottom-1.5 left-2 size-2 rounded-full bg-white/80" />+ </span>+);++const DesktopFile = ({+ icon,+ label,+}: {+ icon: React.ReactNode;+ label: string;+}) => (+ <div className="flex w-[86px] flex-col items-center gap-1">+ {icon}+ <span+ className="max-w-full truncate rounded px-1 text-center text-[11px] font-medium text-white"+ style={{+ fontFamily:+ "-apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif",+ textShadow: "0 1px 2px rgba(0,0,0,0.45)",+ }}+ >+ {label}+ </span>+ </div>+);++export const DesktopFiles = () => (+ <div className="absolute right-4 top-14 z-0 flex flex-col items-end gap-5">+ <DesktopFile icon={<FolderIcon />} label="Recordings" />+ <DesktopFile icon={<CapFileIcon />} label="team-update.cap" />+ <DesktopFile icon={<ImageFileIcon />} label="Q3 launch.png" />+ </div>+);++/* ----------------------------------------------------------------- dock -- */++const FinderIcon = () => (+ <svg aria-hidden="true" viewBox="0 0 48 48" className="size-full">+ <rect width="48" height="48" rx="11" fill="#3C9BF4" />+ <path+ d="M27 0h10a11 11 0 0 1 11 11v26a11 11 0 0 1-11 11H27Z"+ fill="#2478D4"+ />+ <path d="M27 0v48" stroke="#1d64b8" strokeWidth="1.4" />+ <path+ d="M14 14v8M36 14v8"+ stroke="#fff"+ strokeWidth="3"+ strokeLinecap="round"+ />+ <path+ d="M12 32c4 4.5 9 6.5 14 6.5S36 36.5 40 32"+ fill="none"+ stroke="#fff"+ strokeWidth="3"+ strokeLinecap="round"+ />+ </svg>+);++const SafariIcon = () => (+ <svg aria-hidden="true" viewBox="0 0 48 48" className="size-full">+ <rect width="48" height="48" rx="11" fill="#f2f4f8" />+ <circle cx="24" cy="24" r="18" fill="url(#ht-safari)" />+ <path d="m33 15-6.2 6.8-5.6 5.6L15 33l6.8-6.2 5.6-5.6Z" fill="#fff" />+ <path d="m33 15-11.2 6.8 5.6 5.6Z" fill="#FF3B30" />+ <defs>+ {/* biome-ignore lint/correctness/useUniqueElementIds: single-instance decorative svg defs */}+ <linearGradient id="ht-safari" x1="24" y1="6" x2="24" y2="42">+ <stop stopColor="#3FA9F5" />+ <stop offset="1" stopColor="#1B6FE0" />+ </linearGradient>+ </defs>+ </svg>+);++const MessagesIcon = () => (+ <svg aria-hidden="true" viewBox="0 0 48 48" className="size-full">+ <rect width="48" height="48" rx="11" fill="url(#ht-msg)" />+ <path+ d="M24 10c-8.8 0-16 5.6-16 12.6 0 4.4 2.9 8.3 7.3 10.5-.3 1.9-1.3 3.6-2.8 4.9 2.7-.3 5.2-1.4 7.1-3 1.4.3 2.9.4 4.4.4 8.8 0 16-5.6 16-12.8S32.8 10 24 10Z"+ fill="#fff"+ />+ <defs>+ {/* biome-ignore lint/correctness/useUniqueElementIds: single-instance decorative svg defs */}+ <linearGradient id="ht-msg" x1="24" y1="0" x2="24" y2="48">+ <stop stopColor="#5BF675" />+ <stop offset="1" stopColor="#0DBC2C" />+ </linearGradient>+ </defs>+ </svg>+);++const NotesIcon = () => (+ <svg aria-hidden="true" viewBox="0 0 48 48" className="size-full">+ <rect width="48" height="48" rx="11" fill="#fff" />+ <rect width="48" height="14" rx="11" fill="#FBBC49" />+ <rect y="10" width="48" height="4" fill="#FBBC49" />+ <path+ d="M10 22h28M10 29h28M10 36h18"+ stroke="#d9dbe1"+ strokeWidth="2.4"+ strokeLinecap="round"+ />+ </svg>+);++const TrashIcon = () => (+ <svg aria-hidden="true" viewBox="0 0 48 48" className="size-full">+ <path+ d="M12 14h24l-2.2 26.2a4 4 0 0 1-4 3.8H18.2a4 4 0 0 1-4-3.8Z"+ fill="url(#ht-trash)"+ />+ <rect x="9" y="9" width="30" height="5" rx="2.5" fill="#c8cdd6" />+ <path+ d="M19 19v19M24 19v19M29 19v19"+ stroke="#8f96a3"+ strokeWidth="1.6"+ strokeLinecap="round"+ />+ <defs>+ {/* biome-ignore lint/correctness/useUniqueElementIds: single-instance decorative svg defs */}+ <linearGradient id="ht-trash" x1="24" y1="14" x2="24" y2="44">+ <stop stopColor="#e6e9ee" />+ <stop offset="1" stopColor="#b9bfc9" />+ </linearGradient>+ </defs>+ </svg>+);++const DockApp = ({+ children,+ running,+}: {+ children: React.ReactNode;+ running?: boolean;+}) => (+ <div className="relative flex flex-col items-center">+ <span className="size-11 transition-transform duration-200">+ {children}+ </span>+ <span+ className={classNames(+ "absolute -bottom-[5px] size-[3px] rounded-full bg-black/40",+ running ? "opacity-100" : "opacity-0",+ )}+ />+ </div>+);++export const Dock = () => (+ <div className="absolute bottom-2 left-1/2 z-30 -translate-x-1/2">+ <div+ className="flex items-center gap-2.5 rounded-2xl border border-white/40 px-2.5 py-1.5 pb-2 backdrop-blur-xl"+ style={{+ background: "rgba(255,255,255,0.38)",+ boxShadow: "0 8px 24px rgba(0,0,0,0.18)",+ }}+ >+ <DockApp running>+ <FinderIcon />+ </DockApp>+ <DockApp>+ <SafariIcon />+ </DockApp>+ <DockApp>+ <MessagesIcon />+ </DockApp>+ <DockApp>+ <NotesIcon />+ </DockApp>+ <DockApp running>+ <CapLogoMark className="size-full drop-shadow-sm" />+ </DockApp>+ <span className="mx-0.5 h-9 w-px rounded-full bg-black/15" />+ <DockApp>+ <TrashIcon />+ </DockApp>+ </div>+ </div>+);++/* -------------------------------------------- the window being recorded -- */++const SkeletonBar = ({+ w,+ tone = "rgba(17,17,17,0.08)",+ h = 8,+}: {+ w: number | string;+ tone?: string;+ h?: number;+}) => (+ <span+ className="block rounded-full"+ style={{ width: w, height: h, background: tone }}+ />+);++/**+ * A generic macOS app window (a little analytics dashboard) that plays the+ * part of "the thing you're recording". The inner content scrolls via+ * `scrollRef` while the demo cursor "works".+ */+export const ContentWindow = ({+ width,+ height,+ scrollRef,+}: {+ width: number;+ height: number;+ scrollRef: RefObject<HTMLDivElement | null>;+}) => {+ const isWindows = useIsWindowsDemo();+ return (+ <div+ className="absolute overflow-hidden"+ style={{+ width,+ height,+ borderRadius: isWindows ? 8 : 10,+ background: "#ffffff",+ border: "1px solid rgba(0,0,0,0.1)",+ boxShadow: "0 22px 60px rgba(0,0,0,0.18), 0 3px 12px rgba(0,0,0,0.08)",+ }}+ >+ {/* titlebar */}+ <div+ className={classNames(+ "flex h-10 items-center gap-2 border-b",+ isWindows ? "pl-3.5" : "px-3.5",+ )}+ style={{+ background: isWindows ? "#f3f3f3" : "#f6f7f9",+ borderColor: "rgba(0,0,0,0.07)",+ }}+ >+ {isWindows ? null : <TrafficLights />}+ <div className="flex flex-1 justify-center">+ <span+ className="flex h-6 w-[46%] items-center justify-center gap-1.5 rounded-md text-[11px]"+ style={{+ background: "rgba(17,17,17,0.05)",+ color: "rgba(17,17,17,0.55)",+ }}+ >+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-2.5">+ <rect+ x="5"+ y="10"+ width="14"+ height="10"+ rx="2"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ />+ <path+ d="M8 10V7a4 4 0 0 1 8 0v3"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ />+ </svg>+ acme.com/dashboard+ </span>+ </div>+ {isWindows ? (+ <WindowsCaptionControls className="h-10" />+ ) : (+ <span className="w-12" />+ )}+ </div>++ {/* app body */}+ <div className="flex h-[calc(100%-40px)]">+ {/* sidebar */}+ <div+ className="flex w-[52px] shrink-0 flex-col items-center gap-4 border-r pt-4"+ style={{ borderColor: "rgba(0,0,0,0.06)", background: "#fafbfc" }}+ >+ <span+ className="size-6 rounded-[7px]"+ style={{ background: "linear-gradient(135deg,#8FC1F7,#3D77C2)" }}+ />+ {[0.14, 0.08, 0.08, 0.08].map((o, i) => (+ <span+ // biome-ignore lint/suspicious/noArrayIndexKey: static skeleton+ key={i}+ className="size-4 rounded-md"+ style={{ background: `rgba(17,17,17,${o})` }}+ />+ ))}+ </div>++ {/* scrollable main */}+ <div className="relative flex-1 overflow-hidden">+ <div+ ref={scrollRef}+ className="absolute inset-x-0 top-0 will-change-transform"+ >+ <div className="flex flex-col gap-5 p-5">+ <div className="flex items-center justify-between">+ <div className="flex flex-col gap-2">+ <SkeletonBar w={150} h={13} tone="rgba(17,17,17,0.75)" />+ <SkeletonBar w={96} h={7} tone="rgba(17,17,17,0.25)" />+ </div>+ <span+ className="h-7 w-20 rounded-lg"+ style={{+ background: "linear-gradient(180deg,#71a3f5,#3f7fd2)",+ }}+ />+ </div>++ <div className="grid grid-cols-3 gap-3">+ {["#E4F0FB", "#EFE9FB", "#E5F3EC"].map((bg) => (+ <div+ key={bg}+ className="flex flex-col gap-2.5 rounded-xl p-3"+ style={{ background: bg }}+ >+ <SkeletonBar w="55%" h={7} tone="rgba(17,17,17,0.3)" />+ <SkeletonBar w="38%" h={13} tone="rgba(17,17,17,0.7)" />+ </div>+ ))}+ </div>++ {/* chart card */}+ <div+ className="rounded-xl border p-4"+ style={{ borderColor: "rgba(0,0,0,0.08)" }}+ >+ <SkeletonBar w={110} h={8} tone="rgba(17,17,17,0.5)" />+ <div className="mt-4 flex h-24 items-end gap-2">+ {[+ 0.35, 0.5, 0.42, 0.62, 0.55, 0.74, 0.66, 0.88, 0.79, 0.95,+ 0.85, 1,+ ].map((h, i) => (+ <span+ // biome-ignore lint/suspicious/noArrayIndexKey: static chart+ key={i}+ className="flex-1 rounded-t-md"+ style={{+ height: `${h * 100}%`,+ background:+ i % 3 === 2+ ? "rgba(143,193,247,0.9)"+ : "rgba(143,193,247,0.45)",+ }}+ />+ ))}+ </div>+ </div>++ {/* table rows (revealed as the cursor scrolls) */}+ <div+ className="rounded-xl border"+ style={{ borderColor: "rgba(0,0,0,0.08)" }}+ >+ {[0, 1, 2, 3, 4].map((row) => (+ <div+ key={row}+ className="flex items-center gap-3 border-b px-4 py-3 last:border-b-0"+ style={{ borderColor: "rgba(0,0,0,0.05)" }}+ >+ <span+ className="size-6 rounded-full"+ style={{+ background: [+ "#BFDCFC",+ "#DACBF9",+ "#BFEDD8",+ "#FFD9AC",+ "#F6D9EC",+ ][row],+ }}+ />+ <SkeletonBar+ w={`${34 - row * 3}%`}+ h={7}+ tone="rgba(17,17,17,0.35)"+ />+ <span className="flex-1" />+ <SkeletonBar w={44} h={7} tone="rgba(17,17,17,0.15)" />+ </div>+ ))}+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>+ );+};diff --git a/apps/web/components/pages/HomeTwo/demo/WindowsShell.tsx b/apps/web/components/pages/HomeTwo/demo/WindowsShell.tsxnew file mode 100644index 000000000..b6120fa50--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/WindowsShell.tsx@@ -0,0 +1,285 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { CapLogoMark } from "./capIcons";+import { OsSwitchButton } from "./chrome";+import { CapFileIcon, ImageFileIcon } from "./MacDesktop";+import { OS_FONT } from "./platform";++/**+ * The Windows 11 dressing for the demo desktop: taskbar instead of a menu+ * bar and dock, Segoe UI everywhere, and a bottom-right toast where macOS+ * gets a banner. The Cap windows themselves are unchanged apart from their+ * caption controls, which is exactly how the app ships on both platforms.+ */++const WIN_FONT = OS_FONT.windows;++/* ------------------------------------------------------ taskbar glyphs -- */++const StartGlyph = () => (+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-[19px]">+ {[+ [2, 2],+ [13, 2],+ [2, 13],+ [13, 13],+ ].map(([x, y]) => (+ <rect+ key={`${x}-${y}`}+ x={x}+ y={y}+ width="9"+ height="9"+ rx="0.8"+ fill="#0078D4"+ />+ ))}+ </svg>+);++const SearchGlyph = () => (+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-[19px]">+ <circle+ cx="10.5"+ cy="10.5"+ r="6.5"+ fill="none"+ stroke="#1b1b1b"+ strokeWidth="1.7"+ />+ <path+ d="m15.5 15.5 4.5 4.5"+ stroke="#1b1b1b"+ strokeWidth="1.7"+ strokeLinecap="round"+ />+ </svg>+);++const ExplorerGlyph = () => (+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-[21px]">+ <path+ d="M2 6.4a1.6 1.6 0 0 1 1.6-1.6h5.1c.42 0 .82.17 1.13.46L11.4 6.6H20a1.6 1.6 0 0 1 1.6 1.6v.9H2Z"+ fill="#F2B33D"+ />+ <path+ d="M2 8.6h19.6a1.6 1.6 0 0 1 1.58 1.87l-1.4 8A1.6 1.6 0 0 1 20.2 19.8H4.5a1.6 1.6 0 0 1-1.58-1.33l-1.4-8A1.6 1.6 0 0 1 2 8.6Z"+ fill="#FFCC5F"+ />+ </svg>+);++const EdgeGlyph = () => (+ <svg aria-hidden="true" viewBox="0 0 24 24" className="size-[21px]">+ <circle cx="12" cy="12" r="10" fill="url(#ht-edge)" />+ <path+ d="M4.6 15.6c2.2 2.4 6 3.2 9.2 2 2-.8 3.3-2.2 3.3-3.6 0-1.3-1-2.2-2.8-2.2H9.4c-2.6 0-4.4-1.4-4.8-3.4a9.9 9.9 0 0 0 0 7.2Z"+ fill="#ffffff"+ fillOpacity="0.92"+ />+ <defs>+ {/* biome-ignore lint/correctness/useUniqueElementIds: single-instance decorative svg defs */}+ <linearGradient id="ht-edge" x1="3" y1="4" x2="21" y2="20">+ <stop stopColor="#37C7F3" />+ <stop offset="0.55" stopColor="#1B84D6" />+ <stop offset="1" stopColor="#0C5BA8" />+ </linearGradient>+ </defs>+ </svg>+);++const TrayChevron = () => (+ <svg aria-hidden="true" viewBox="0 0 16 16" className="size-3">+ <path+ d="m4 10 4-4 4 4"+ fill="none"+ stroke="#1b1b1b"+ strokeWidth="1.4"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++const TrayWifi = () => (+ <svg aria-hidden="true" viewBox="0 0 16 12" className="h-[13px] w-auto">+ <path+ d="M8 10.9 0.9 3.9A10.1 10.1 0 0 1 8 1c2.7 0 5.2 1.05 7.1 2.9Z"+ fill="#1b1b1b"+ />+ </svg>+);++const TraySpeaker = () => (+ <svg aria-hidden="true" viewBox="0 0 20 16" className="h-[13px] w-auto">+ <path d="M3 6h3l4-3.4v10.8L6 10H3Z" fill="#1b1b1b" />+ <path+ d="M12.6 5.2a3.8 3.8 0 0 1 0 5.6M14.9 3a7 7 0 0 1 0 10"+ fill="none"+ stroke="#1b1b1b"+ strokeWidth="1.3"+ strokeLinecap="round"+ />+ </svg>+);++const TrayBattery = () => (+ <svg aria-hidden="true" viewBox="0 0 26 12" className="h-[12px] w-auto">+ <rect+ x="0.6"+ y="0.6"+ width="21"+ height="10.8"+ rx="2.4"+ fill="none"+ stroke="#1b1b1b"+ strokeOpacity="0.75"+ strokeWidth="1.2"+ />+ <rect x="2.4" y="2.4" width="15" height="7.2" rx="1.4" fill="#1b1b1b" />+ <path d="M23.2 4v4c1-.25 1.7-.95 1.7-2s-.7-1.75-1.7-2Z" fill="#1b1b1b" />+ </svg>+);++/* ---------------------------------------------------------------- taskbar -- */++const TaskbarApp = ({+ children,+ running,+ label,+}: {+ children: React.ReactNode;+ running?: boolean;+ label: string;+}) => (+ <span className="relative flex size-10 items-center justify-center rounded-[6px] transition-colors duration-150 hover:bg-black/[0.06]">+ {children}+ <span className="sr-only">{label}</span>+ <span+ className={classNames(+ "absolute bottom-[3px] h-[3px] rounded-full transition-all duration-200",+ running ? "w-4 bg-[#0078D4]" : "w-0 bg-transparent",+ )}+ />+ </span>+);++export const WinTaskbar = ({+ recording,+ onSwitchOs,+}: {+ recording: boolean;+ onSwitchOs: () => void;+}) => (+ <div+ className="absolute inset-x-0 bottom-0 z-30 flex h-12 items-center px-3 text-[#1b1b1b]"+ style={{+ background: "rgba(243,243,243,0.86)",+ backdropFilter: "blur(28px)",+ WebkitBackdropFilter: "blur(28px)",+ borderTop: "1px solid rgba(255,255,255,0.6)",+ boxShadow: "0 -1px 12px rgba(0,0,0,0.10)",+ fontFamily: WIN_FONT,+ }}+ >+ {/* The centre cluster is centred on the bar, tray and spacer balance it. */}+ <div className="flex-1" />+ <div className="flex items-center gap-1">+ <OsSwitchButton+ label="Switch the demo to macOS"+ tooltip="See the macOS version"+ side="above"+ onClick={onSwitchOs}+ className="size-10 rounded-[6px] hover:bg-black/[0.06]"+ >+ <StartGlyph />+ </OsSwitchButton>+ <TaskbarApp label="Search">+ <SearchGlyph />+ </TaskbarApp>+ <TaskbarApp label="File Explorer" running>+ <ExplorerGlyph />+ </TaskbarApp>+ <TaskbarApp label="Microsoft Edge">+ <EdgeGlyph />+ </TaskbarApp>+ <TaskbarApp label="Cap" running>+ <CapLogoMark className="size-[21px]" />+ </TaskbarApp>+ </div>++ <div className="flex flex-1 items-center justify-end gap-2.5">+ {/* Windows shows recording apps in the tray, not in a menu bar. */}+ <span+ className={classNames(+ "flex items-center gap-1.5 rounded-[6px] px-2 py-1 text-[11px] font-semibold tracking-[0.02em] transition-opacity duration-300",+ recording ? "opacity-100" : "opacity-0",+ )}+ style={{ background: "rgba(196,43,28,0.12)", color: "#c42b1c" }}+ >+ <span className="size-[7px] rounded-full bg-[#c42b1c]" />+ REC+ </span>+ <TrayChevron />+ <TrayWifi />+ <TraySpeaker />+ <TrayBattery />+ <span className="ml-1 flex flex-col items-end text-[11px] leading-[1.25] tabular-nums">+ <span>9:41 AM</span>+ <span>20/08/2026</span>+ </span>+ </div>+ </div>+);++/* --------------------------------------------------------- desktop files -- */++const WinFolderIcon = () => (+ <svg aria-hidden="true" viewBox="0 0 64 52" className="h-11 w-auto">+ <path+ d="M2 10a5 5 0 0 1 5-5h13.6a5 5 0 0 1 3.6 1.5L27.4 10H57a5 5 0 0 1 5 5v3H2Z"+ fill="#E3A631"+ />+ <path+ d="M2 16h60a4 4 0 0 1 3.95 4.66l-3.6 22A4 4 0 0 1 58.4 46H7.6a4 4 0 0 1-3.95-3.34l-3.6-22A4 4 0 0 1 2 16Z"+ fill="#FFC85C"+ />+ <path+ d="M2 16h60a4 4 0 0 1 3.95 4.66l-.7 4.34H0.75L0.05 20.66A4 4 0 0 1 2 16Z"+ fill="#FFD684"+ opacity="0.75"+ />+ </svg>+);++const WinDesktopFile = ({+ icon,+ label,+}: {+ icon: React.ReactNode;+ label: string;+}) => (+ <div className="flex w-[88px] flex-col items-center gap-1.5">+ {icon}+ <span+ className="max-w-full truncate rounded-[3px] px-1 text-center text-[11.5px] font-normal text-white"+ style={{+ fontFamily: WIN_FONT,+ textShadow: "0 1px 3px rgba(0,0,0,0.6)",+ }}+ >+ {label}+ </span>+ </div>+);++export const WinDesktopFiles = () => (+ // Kept on the right so the recorded window still owns the left half; a+ // Windows desktop lets icons live anywhere.+ <div className="absolute right-4 top-6 z-0 flex flex-col items-end gap-5">+ <WinDesktopFile icon={<WinFolderIcon />} label="Recordings" />+ <WinDesktopFile icon={<CapFileIcon />} label="team-update.cap" />+ <WinDesktopFile icon={<ImageFileIcon />} label="Q3 launch.png" />+ </div>+);diff --git a/apps/web/components/pages/HomeTwo/demo/capIcons.tsx b/apps/web/components/pages/HomeTwo/demo/capIcons.tsxnew file mode 100644index 000000000..1c61e75b1--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/capIcons.tsx@@ -0,0 +1,953 @@+/**+ * Exact SVG copies of the icons the Cap desktop app renders, lifted from+ * packages/ui-solid/icons/*.svg and the icon sets the app imports+ * (lucide, mdi, ph, material-symbols). Fill colours that ship as white/black+ * in the source files are swapped to currentColor so CSS drives them, which+ * is also what the app itself does via its `invert` utility.+ */++type IconProps = { className?: string; style?: React.CSSProperties };++/* ------------------------------------------------------------------ brand -- */++/** cap:logo-full — rounded-square mark + "Cap" wordmark (light theme). */+export const CapLogoFull = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 103 40"+ fill="none"+ >+ <rect x="0.25" y="0.25" width="39.5" height="39.5" rx="7.75" fill="white" />+ <rect+ x="0.25"+ y="0.25"+ width="39.5"+ height="39.5"+ rx="7.75"+ stroke="#E7EAF0"+ strokeWidth="0.5"+ />+ <path+ d="M20 36C28.8365 36 36 28.8365 36 20C36 11.1635 28.8365 4 20 4C11.1635 4 4 11.1635 4 20C4 28.8365 11.1635 36 20 36Z"+ fill="#4785FF"+ />+ <path+ d="M20.0001 33C27.1797 33 33 27.1797 33 20.0001C33 12.8203 27.1797 7 20.0001 7C12.8203 7 7 12.8204 7 20.0001C7 27.1797 12.8204 33 20.0001 33Z"+ fill="#ADC9FF"+ />+ <path+ d="M20.0001 30.0002C25.5229 30.0002 30.0002 25.5229 30.0002 20.0001C30.0002 14.4773 25.5229 10.0002 20.0001 10.0002C14.4773 10.0002 10.0002 14.4773 10.0002 20.0001C10.0002 25.5229 14.4773 30.0002 20.0001 30.0002Z"+ fill="white"+ />+ <path+ d="M58.416 30.448C53.012 30.448 49.204 26.584 49.204 20.088C49.204 13.704 52.872 9.672 58.472 9.672C63.54 9.672 66.256 12.332 67.096 16.84L63.288 17.036C62.812 14.432 61.216 12.836 58.472 12.836C55.084 12.836 52.984 15.664 52.984 20.088C52.984 24.568 55.14 27.284 58.444 27.284C61.384 27.284 62.952 25.576 63.4 22.72L67.208 22.916C66.424 27.592 63.456 30.448 58.416 30.448ZM74.6451 30.336C71.5091 30.336 69.4371 28.852 69.4371 26.248C69.4371 23.672 71.0331 22.3 74.3091 21.656L79.2651 20.676C79.2651 18.576 78.2851 17.484 76.4091 17.484C74.6451 17.484 73.6931 18.296 73.3571 19.808L69.6891 19.64C70.2771 16.504 72.6851 14.712 76.4091 14.712C80.6651 14.712 82.8491 16.952 82.8491 20.928V26.36C82.8491 27.172 83.1291 27.396 83.6891 27.396H84.1651V30C83.9411 30.056 83.3531 30.112 82.8771 30.112C81.2531 30.112 80.0491 29.524 79.7411 27.676C79.0131 29.272 77.1091 30.336 74.6451 30.336ZM75.3731 27.732C77.7531 27.732 79.2651 26.22 79.2651 23.952V23.112L75.4011 23.896C73.8051 24.204 73.1611 24.876 73.1611 25.912C73.1611 27.088 73.9451 27.732 75.3731 27.732ZM86.8741 34.2V15.048H90.3181L90.3741 17.26C91.2421 15.608 92.8941 14.712 94.8541 14.712C99.1101 14.712 101.21 18.212 101.21 22.524C101.21 26.836 99.0821 30.336 94.8261 30.336C92.9221 30.336 91.2701 29.412 90.4581 27.956V34.2H86.8741ZM93.9861 27.424C96.1701 27.424 97.4861 25.604 97.4861 22.524C97.4861 19.444 96.1701 17.624 93.9861 17.624C91.8021 17.624 90.4581 19.276 90.4581 22.524C90.4581 25.772 91.7741 27.424 93.9861 27.424Z"+ fill="#12161F"+ />+ </svg>+);++/** cap:logo — just the rounded-square mark with concentric circles. */+export const CapLogoMark = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 80 80"+ fill="none"+ >+ <rect x="0.5" y="0.5" width="79" height="79" rx="15.5" fill="white" />+ <rect x="0.5" y="0.5" width="79" height="79" rx="15.5" stroke="#E7EAF0" />+ <path+ d="M40 72C57.6731 72 72 57.6731 72 40C72 22.3269 57.6731 8 40 8C22.3269 8 8 22.3269 8 40C8 57.6731 22.3269 72 40 72Z"+ fill="#4785FF"+ />+ <path+ d="M40.0001 66C54.3595 66 66 54.3595 66 40.0001C66 25.6405 54.3595 14 40.0001 14C25.6405 14 14 25.6408 14 40.0001C14 54.3595 25.6408 66 40.0001 66Z"+ fill="#ADC9FF"+ />+ <path+ d="M39.9999 60C51.0455 60 60 51.0455 60 39.9998C60 28.9542 51.0455 20 39.9999 20C28.9542 20 20 28.9542 20 39.9998C20 51.0455 28.9542 60 39.9999 60Z"+ fill="white"+ />+ </svg>+);++/* ------------------------------------------------------------- mode icons -- */++/** cap:instant — lightning bolt. */+export const CapInstant = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 152 223"+ fill="none"+ >+ <path+ d="M150.167 109.163L53.4283 220.65C52.4032 221.826 51.05 222.613 49.573 222.89C48.0959 223.167 46.5752 222.919 45.2403 222.185C43.9054 221.451 42.8287 220.27 42.1727 218.82C41.5167 217.369 41.317 215.729 41.6038 214.146L54.2661 146.019L4.48901 125.914C3.41998 125.484 2.46665 124.776 1.7142 123.853C0.961745 122.93 0.433602 121.82 0.176954 120.624C-0.0796948 119.428 -0.0568536 118.182 0.243435 116.997C0.543723 115.813 1.1121 114.727 1.8978 113.837L98.6363 2.35043C99.6614 1.17365 101.015 0.387451 102.492 0.110461C103.969 -0.166529 105.489 0.080724 106.824 0.814909C108.159 1.54909 109.236 2.73037 109.892 4.18049C110.548 5.63061 110.748 7.27088 110.461 8.85379L97.7639 77.0554L147.541 97.1322C148.602 97.5652 149.548 98.2727 150.294 99.1922C151.041 100.112 151.566 101.215 151.822 102.404C152.078 103.593 152.058 104.832 151.763 106.011C151.468 107.19 150.908 108.273 150.132 109.163H150.167Z"+ fill="currentColor"+ />+ </svg>+);++/** cap:film-cut — clapperboard. */+export const CapFilmCut = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 124 119"+ fill="none"+ >+ <path+ d="M119.04 49.5796H48.42L115.32 31.9207C115.954 31.7539 116.548 31.4634 117.068 31.0659C117.588 30.6684 118.025 30.1718 118.352 29.6047C118.68 29.0377 118.891 28.4115 118.975 27.7621C119.06 27.1128 119.014 26.4533 118.842 25.8217L113.783 7.22689C113.087 4.72519 111.433 2.59843 109.179 1.30722C106.926 0.0160012 104.254 -0.335719 101.743 0.328232L7.32875 25.2452C6.07164 25.5715 4.89225 26.1452 3.85965 26.9328C2.82705 27.7203 1.96198 28.706 1.31509 29.8319C0.664581 30.9441 0.244302 32.1756 0.0792245 33.4533C-0.0858532 34.7311 0.00763733 36.0289 0.354142 37.2698L4.96668 54.2654C4.96668 54.3522 4.96668 54.4452 4.96668 54.5382V109.083C4.96668 111.713 6.01176 114.235 7.87202 116.095C9.73228 117.955 12.2553 119 14.8861 119H114.081C116.711 119 119.234 117.955 121.095 116.095C122.955 114.235 124 111.713 124 109.083V54.5382C124 53.2231 123.477 51.9618 122.547 51.0319C121.617 50.102 120.356 49.5796 119.04 49.5796ZM104.26 9.91073L107.98 23.5903L87.1555 29.1253L69.7159 19.0346L104.26 9.91073ZM33.2061 28.6728L50.6395 38.7388L13.6896 48.4887L9.9698 34.8029L33.2061 28.6728Z"+ fill="currentColor"+ />+ </svg>+);++/** cap:screenshot. */+export const CapScreenshot = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <path d="M21,2H3A1,1,0,0,0,2,3V21a1,1,0,0,0,1,1H21a1,1,0,0,0,1-1V3A1,1,0,0,0,21,2ZM20,14l-3-3-5,5-2-2L4,20V4H20ZM6,8.5A2.5,2.5,0,1,1,8.5,11,2.5,2.5,0,0,1,6,8.5Z" />+ </svg>+);++/* -------------------------------------------------------------- cap 20×20 -- */++export const CapCamera = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M2.5 6.66666C2.5 5.28594 3.61929 4.16666 5 4.16666H10C11.3807 4.16666 12.5 5.28594 12.5 6.66666V13.3333C12.5 14.714 11.3807 15.8333 10 15.8333H5C3.61929 15.8333 2.5 14.714 2.5 13.3333V6.66666Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinejoin="round"+ />+ <path+ d="M12.9607 8.103L16.294 6.43633C16.8481 6.15929 17.5 6.5622 17.5 7.18169V12.8183C17.5 13.4378 16.8481 13.8407 16.294 13.5637L12.9607 11.897C12.6783 11.7558 12.5 11.4673 12.5 11.1516V8.84835C12.5 8.53271 12.6783 8.24416 12.9607 8.103Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapMicrophone = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M10 15.8333V17.5M10 15.8333C6.93483 15.8333 5.12236 13.9543 4.17862 12.5M10 15.8333C13.0652 15.8333 14.8777 13.9543 15.8214 12.5M13.3333 5.83333V9.16667C13.3333 11.0076 11.841 12.5 10 12.5C8.15906 12.5 6.66668 11.0076 6.66668 9.16667V5.83333C6.66668 3.99238 8.15906 2.5 10 2.5C11.841 2.5 13.3333 3.99238 13.3333 5.83333Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapChevronDown = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M6 8L8.93934 10.9393C9.52513 11.5251 10.4749 11.5251 11.0607 10.9393L14 8"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapCaretDown = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 10 6"+ fill="currentColor"+ >+ <path d="M9.80763 1.18378L5.46126 5.79649C5.40069 5.861 5.32872 5.91218 5.24947 5.9471C5.17023 5.98202 5.08526 6 4.99946 6C4.91365 6 4.82869 5.98202 4.74944 5.9471C4.67019 5.91218 4.59822 5.861 4.53765 5.79649L0.191285 1.18378C0.0688072 1.0538 0 0.877507 0 0.693683C0 0.50986 0.0688072 0.333566 0.191285 0.203583C0.313762 0.0736001 0.479877 0.000576714 0.653086 0.000576712C0.826296 0.00057671 0.992411 0.0736001 1.11489 0.203583L5 4.32677L8.88511 0.203007C9.00759 0.0730239 9.1737 0 9.34691 0C9.52012 0 9.68624 0.0730239 9.80871 0.203007C9.93119 0.332989 10 0.509284 10 0.693107C10 0.87693 9.93119 1.05322 9.80871 1.18321L9.80763 1.18378Z" />+ </svg>+);++export const CapX = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 9 9"+ fill="currentColor"+ >+ <path d="M8.49846 7.4817C8.60682 7.59004 8.66769 7.73699 8.66769 7.89022C8.66769 8.04345 8.60682 8.1904 8.49846 8.29875C8.39011 8.4071 8.24315 8.46797 8.08991 8.46797C7.93668 8.46797 7.78972 8.4071 7.68136 8.29875L4.62973 5.24634L1.57715 8.29779C1.46879 8.40613 1.32183 8.467 1.1686 8.467C1.01536 8.467 0.868401 8.40613 0.760047 8.29779C0.651693 8.18944 0.59082 8.04249 0.59082 7.88926C0.59082 7.73603 0.651693 7.58908 0.760047 7.48074L3.81264 4.42929L0.761008 1.37688C0.652654 1.26854 0.591782 1.12159 0.591782 0.96836C0.591782 0.815133 0.652654 0.668182 0.761008 0.559834C0.869363 0.451486 1.01632 0.390617 1.16956 0.390617C1.32279 0.390617 1.46975 0.451486 1.57811 0.559834L4.62973 3.61224L7.68232 0.559353C7.79068 0.451006 7.93764 0.390137 8.09087 0.390137C8.24411 0.390137 8.39107 0.451006 8.49942 0.559353C8.60778 0.667701 8.66865 0.814652 8.66865 0.967879C8.66865 1.12111 8.60778 1.26806 8.49942 1.3764L5.44683 4.42929L8.49846 7.4817Z" />+ </svg>+);++export const CapInfo = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="currentColor"+ >+ <path d="M9.75 0C7.82164 0 5.93657 0.571828 4.33319 1.64317C2.72982 2.71452 1.48013 4.23726 0.742179 6.01884C0.00422452 7.80042 -0.188858 9.76082 0.187348 11.6521C0.563554 13.5434 1.49215 15.2807 2.85571 16.6443C4.21928 18.0079 5.95656 18.9365 7.84787 19.3127C9.73919 19.6889 11.6996 19.4958 13.4812 18.7578C15.2627 18.0199 16.7855 16.7702 17.8568 15.1668C18.9282 13.5634 19.5 11.6784 19.5 9.75C19.4973 7.16498 18.4692 4.68661 16.6413 2.85872C14.8134 1.03084 12.335 0.00272983 9.75 0ZM9.375 4.5C9.59751 4.5 9.81502 4.56598 10 4.6896C10.185 4.81321 10.3292 4.98891 10.4144 5.19448C10.4995 5.40005 10.5218 5.62625 10.4784 5.84448C10.435 6.06271 10.3278 6.26316 10.1705 6.4205C10.0132 6.57783 9.81271 6.68498 9.59448 6.72838C9.37625 6.77179 9.15005 6.74951 8.94449 6.66436C8.73892 6.57922 8.56322 6.43502 8.4396 6.25002C8.31598 6.06501 8.25 5.8475 8.25 5.625C8.25 5.32663 8.36853 5.04048 8.57951 4.8295C8.79049 4.61853 9.07664 4.5 9.375 4.5ZM10.5 15C10.1022 15 9.72065 14.842 9.43934 14.5607C9.15804 14.2794 9 13.8978 9 13.5V9.75C8.80109 9.75 8.61033 9.67098 8.46967 9.53033C8.32902 9.38968 8.25 9.19891 8.25 9C8.25 8.80109 8.32902 8.61032 8.46967 8.46967C8.61033 8.32902 8.80109 8.25 9 8.25C9.39783 8.25 9.77936 8.40804 10.0607 8.68934C10.342 8.97064 10.5 9.35218 10.5 9.75V13.5C10.6989 13.5 10.8897 13.579 11.0303 13.7197C11.171 13.8603 11.25 14.0511 11.25 14.25C11.25 14.4489 11.171 14.6397 11.0303 14.7803C10.8897 14.921 10.6989 15 10.5 15Z" />+ </svg>+);++export const CapStopCircle = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M7.91666 8.75C7.91666 8.28976 8.28975 7.91667 8.74999 7.91667H11.25C11.7102 7.91667 12.0833 8.28976 12.0833 8.75V11.25C12.0833 11.7102 11.7102 12.0833 11.25 12.0833H8.74999C8.28975 12.0833 7.91666 11.7102 7.91666 11.25V8.75Z"+ fill="currentColor"+ />+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M9.99999 3.33333C6.31809 3.33333 3.33332 6.3181 3.33332 10C3.33332 13.6819 6.31809 16.6667 9.99999 16.6667C13.6819 16.6667 16.6667 13.6819 16.6667 10C16.6667 6.3181 13.6819 3.33333 9.99999 3.33333ZM1.66666 10C1.66666 5.39763 5.39762 1.66667 9.99999 1.66667C14.6024 1.66667 18.3333 5.39763 18.3333 10C18.3333 14.6024 14.6024 18.3333 9.99999 18.3333C5.39762 18.3333 1.66666 14.6024 1.66666 10Z"+ fill="currentColor"+ />+ </svg>+);++export const CapPauseCircle = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M10 3.33334C6.31811 3.33334 3.33334 6.31811 3.33334 10C3.33334 13.6819 6.31811 16.6667 10 16.6667C13.6819 16.6667 16.6667 13.6819 16.6667 10C16.6667 6.31811 13.6819 3.33334 10 3.33334ZM1.66667 10C1.66667 5.39763 5.39763 1.66667 10 1.66667C14.6024 1.66667 18.3333 5.39763 18.3333 10C18.3333 14.6024 14.6024 18.3333 10 18.3333C5.39763 18.3333 1.66667 14.6024 1.66667 10Z"+ fill="currentColor"+ />+ <path+ d="M8 8.50001C8 8.08579 8.33579 7.75001 8.75 7.75001C9.16422 7.75001 9.5 8.08579 9.5 8.50001V11.5C9.5 11.9142 9.16422 12.25 8.75 12.25C8.33579 12.25 8 11.9142 8 11.5V8.50001Z"+ fill="currentColor"+ />+ <path+ d="M10.5 8.50001C10.5 8.08579 10.8358 7.75001 11.25 7.75001C11.6642 7.75001 12 8.08579 12 8.50001V11.5C12 11.9142 11.6642 12.25 11.25 12.25C10.8358 12.25 10.5 11.9142 10.5 11.5V8.50001Z"+ fill="currentColor"+ />+ </svg>+);++export const CapRestart = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M3.73637 12.2222C4.65157 14.8115 7.12099 16.6667 10.0237 16.6667C13.7056 16.6667 16.6904 13.6819 16.6904 9.99999C16.6904 6.3181 13.7056 3.33333 10.0237 3.33333C7.62065 3.33333 6.05882 4.41778 4.50914 6.24999M4.16676 3.33333V5.83333C4.16676 6.29357 4.53986 6.66666 5.00009 6.66666H7.5001"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapTrash = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M5.00001 5V15C5.00001 16.3807 6.1193 17.5 7.50001 17.5H12.5C13.8807 17.5 15 16.3807 15 15V5M5.00001 5H15M5.00001 5H3.33334M15 5H16.6667M7.50001 5C7.50001 3.61929 8.6193 2.5 10 2.5C11.3807 2.5 12.5 3.61929 12.5 5M11.6667 9.16667V13.3333M8.33334 9.16667V13.3333"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++/** cap:settings — the 20×20 stroked gear used in the recording toolbar. */+export const CapSettingsGear = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M6.39723 4.43782L6.08762 4.36637C5.60543 4.2551 5.09992 4.40008 4.75 4.75C4.40008 5.09992 4.2551 5.60543 4.36637 6.08762L4.43782 6.39723C4.62569 7.21131 4.29 8.05667 3.59485 8.5201L3.12404 8.83397C2.73417 9.09388 2.5 9.53144 2.5 10C2.5 10.4686 2.73417 10.9061 3.12404 11.166L3.59485 11.4799C4.29 11.9433 4.62569 12.7887 4.43782 13.6028L4.36637 13.9124C4.2551 14.3946 4.40008 14.9001 4.75 15.25C5.09992 15.5999 5.60543 15.7449 6.08762 15.6336L6.39723 15.5622C7.21131 15.3743 8.05667 15.71 8.5201 16.4052L8.83397 16.876C9.09388 17.2658 9.53144 17.5 10 17.5C10.4686 17.5 10.9061 17.2658 11.166 16.876L11.4799 16.4052C11.9433 15.71 12.7887 15.3743 13.6028 15.5622L13.9124 15.6336C14.3946 15.7449 14.9001 15.5999 15.25 15.25C15.5999 14.9001 15.7449 14.3946 15.6336 13.9124L15.5622 13.6028C15.3743 12.7887 15.71 11.9433 16.4052 11.4799L16.876 11.166C17.2658 10.9061 17.5 10.4686 17.5 10C17.5 9.53144 17.2658 9.09388 16.876 8.83397L16.4052 8.5201C15.71 8.05667 15.3743 7.21131 15.5622 6.39723L15.6336 6.08762C15.7449 5.60543 15.5999 5.09992 15.25 4.75C14.9001 4.40008 14.3946 4.2551 13.9124 4.36637L13.6028 4.43782C12.7887 4.62569 11.9433 4.29 11.4799 3.59485L11.166 3.12404C10.9061 2.73417 10.4686 2.5 10 2.5C9.53144 2.5 9.09388 2.73417 8.83397 3.12404L8.5201 3.59485C8.05667 4.29 7.21131 4.62569 6.39723 4.43782Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinejoin="round"+ />+ <path+ d="M12.5 10C12.5 11.3807 11.3807 12.5 10 12.5C8.61929 12.5 7.5 11.3807 7.5 10C7.5 8.61929 8.61929 7.5 10 7.5C11.3807 7.5 12.5 8.61929 12.5 10Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinejoin="round"+ />+ </svg>+);++/** cap:gear — 16×16 filled gear (the round settings button on the target overlay). */+export const CapGear = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 16 16"+ fill="none"+ >+ <path+ d="M15.4286 7.42857H14.8329C14.766 6.6137 14.5526 5.81759 14.2029 5.07857L14.7193 4.78071C14.8506 4.70494 14.9464 4.58011 14.9856 4.4337C15.0249 4.28729 15.0043 4.13128 14.9286 4C14.8528 3.86872 14.728 3.77291 14.5816 3.73367C14.4351 3.69442 14.2791 3.71494 14.1479 3.79071L13.63 4.09C13.1626 3.41972 12.5803 2.83742 11.91 2.37L12.2093 1.85214C12.2851 1.72086 12.3056 1.56485 12.2663 1.41844C12.2271 1.27203 12.1313 1.1472 12 1.07143C11.8687 0.995652 11.7127 0.975132 11.5663 1.01438C11.4199 1.05363 11.2951 1.14943 11.2193 1.28071L10.9214 1.79714C10.1824 1.44738 9.3863 1.23396 8.57143 1.16714V0.571429C8.57143 0.419876 8.51123 0.274531 8.40406 0.167368C8.2969 0.0602039 8.15155 0 8 0C7.84845 0 7.7031 0.0602039 7.59594 0.167368C7.48878 0.274531 7.42857 0.419876 7.42857 0.571429V1.16714C6.6137 1.23396 5.81759 1.44738 5.07857 1.79714L4.78071 1.28071C4.70494 1.14943 4.58011 1.05363 4.4337 1.01438C4.28729 0.975132 4.13128 0.995652 4 1.07143C3.86872 1.1472 3.77291 1.27203 3.73367 1.41844C3.69442 1.56485 3.71494 1.72086 3.79071 1.85214L4.09 2.37C3.41972 2.83742 2.83742 3.41972 2.37 4.09L1.85214 3.79071C1.78714 3.75319 1.71538 3.72884 1.64097 3.71906C1.56655 3.70927 1.49094 3.71423 1.41844 3.73367C1.27203 3.77291 1.1472 3.86872 1.07143 4C0.995652 4.13128 0.975132 4.28729 1.01438 4.4337C1.05363 4.58011 1.14943 4.70494 1.28071 4.78071L1.79714 5.07857C1.44738 5.81759 1.23396 6.6137 1.16714 7.42857H0.571429C0.419876 7.42857 0.274531 7.48878 0.167368 7.59594C0.0602039 7.7031 0 7.84845 0 8C0 8.15155 0.0602039 8.2969 0.167368 8.40406C0.274531 8.51123 0.419876 8.57143 0.571429 8.57143H1.16714C1.23396 9.3863 1.44738 10.1824 1.79714 10.9214L1.28071 11.2193C1.17171 11.2822 1.08651 11.3792 1.03833 11.4955C0.990146 11.6117 0.98168 11.7406 1.01424 11.8622C1.04681 11.9837 1.11858 12.0911 1.21842 12.1677C1.31827 12.2443 1.4406 12.2858 1.56643 12.2857C1.66676 12.286 1.76537 12.2596 1.85214 12.2093L2.37 11.91C2.83742 12.5803 3.41972 13.1626 4.09 13.63L3.79071 14.1479C3.71494 14.2791 3.69442 14.4351 3.73367 14.5816C3.77291 14.728 3.86872 14.8528 4 14.9286C4.13128 15.0043 4.28729 15.0249 4.4337 14.9856C4.58011 14.9464 4.70494 14.8506 4.78071 14.7193L5.07857 14.2029C5.81759 14.5526 6.6137 14.766 7.42857 14.8329V15.4286C7.42857 15.5801 7.48878 15.7255 7.59594 15.8326C7.7031 15.9398 7.84845 16 8 16C8.15155 16 8.2969 15.9398 8.40406 15.8326C8.51123 15.7255 8.57143 15.5801 8.57143 15.4286V14.8329C9.3863 14.766 10.1824 14.5526 10.9214 14.2029L11.2193 14.7193C11.2951 14.8506 11.4199 14.9464 11.5663 14.9856C11.7127 15.0249 11.8687 15.0043 12 14.9286C12.1313 14.8528 12.2271 14.728 12.2663 14.5816C12.3056 14.4351 12.2851 14.2791 12.2093 14.1479L11.91 13.63C12.5803 13.1626 13.1626 12.5803 13.63 11.91L14.1479 12.2093C14.2129 12.2468 14.2846 12.2712 14.359 12.281C14.4335 12.2908 14.5091 12.2858 14.5816 12.2664C14.6541 12.2469 14.722 12.2134 14.7816 12.1677C14.8411 12.122 14.8911 12.065 14.9286 12C15.0044 11.8688 15.0251 11.7129 14.986 11.5664C14.9469 11.42 14.8512 11.2952 14.72 11.2193L14.2036 10.9214C14.5533 10.1824 14.7668 9.3863 14.8336 8.57143H15.4286C15.5801 8.57143 15.7255 8.51123 15.8326 8.40406C15.9398 8.2969 16 8.15155 16 8C16 7.84845 15.9398 7.7031 15.8326 7.59594C15.7255 7.48878 15.5801 7.42857 15.4286 7.42857ZM4 8C3.99971 7.39465 4.13703 6.79716 4.4016 6.25268C4.66616 5.70821 5.05104 5.23101 5.52714 4.85714L7.34 8L5.52714 11.1429C5.05104 10.769 4.66616 10.2918 4.4016 9.74732C4.13703 9.20284 3.99971 8.60535 4 8ZM8 12C7.49152 12.0005 6.98766 11.9035 6.51571 11.7143L8.33 8.57143H11.9586C11.8199 9.5228 11.3437 10.3926 10.617 11.022C9.89027 11.6515 8.96142 11.9986 8 12ZM8.33 7.42857L6.51571 4.28571C7.0776 4.06125 7.68308 3.96718 8.28658 4.01058C8.89007 4.05398 9.47586 4.23373 9.99984 4.53629C10.5238 4.83885 10.9723 5.25634 11.3116 5.75732C11.6509 6.2583 11.8721 6.82973 11.9586 7.42857H8.33Z"+ fill="currentColor"+ />+ </svg>+);++export const CapMoreVertical = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M9.99999 4.16667C10.4602 4.16667 10.8333 3.79357 10.8333 3.33333C10.8333 2.8731 10.4602 2.5 9.99999 2.5C9.53975 2.5 9.16666 2.8731 9.16666 3.33333C9.16666 3.79357 9.53975 4.16667 9.99999 4.16667Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path+ d="M9.99999 10.8333C10.4602 10.8333 10.8333 10.4602 10.8333 10C10.8333 9.53976 10.4602 9.16667 9.99999 9.16667C9.53975 9.16667 9.16666 9.53976 9.16666 10C9.16666 10.4602 9.53975 10.8333 9.99999 10.8333Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ <path+ d="M9.99999 17.5C10.4602 17.5 10.8333 17.1269 10.8333 16.6667C10.8333 16.2064 10.4602 15.8333 9.99999 15.8333C9.53975 15.8333 9.16666 16.2064 9.16666 16.6667C9.16666 17.1269 9.53975 17.5 9.99999 17.5Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++/* -------------------------------------------- editor icons (cap package) -- */++export const CapClapperboard = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M2.5 8.33332H17.5M2.5 8.33332V13.3333C2.5 14.714 3.61929 15.8333 5 15.8333H15C16.3807 15.8333 17.5 14.714 17.5 13.3333V8.33332M2.5 8.33332V6.66666C2.5 5.28594 3.61929 4.16666 5 4.16666H15C16.3807 4.16666 17.5 5.28594 17.5 6.66666V8.33332M6.58333 4.58332L5.91667 7.91666M10.3333 4.58332L9.66667 7.91666M14.0833 4.58332L13.4167 7.91666"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapCrop = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M2.5 5H13.3333C14.2538 5 15 5.74619 15 6.66667V17.5M5 2.5V13.3333C5 14.2538 5.74619 15 6.66667 15H17.5"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapImage = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M13.3333 16.6667L8.43444 11.7678C7.45813 10.7915 5.87522 10.7915 4.89891 11.7678L3.33334 13.3333M5.83334 16.6667H14.1667C15.5474 16.6667 16.6667 15.5474 16.6667 14.1667V5.83334C16.6667 4.45263 15.5474 3.33334 14.1667 3.33334H5.83334C4.45263 3.33334 3.33334 4.45263 3.33334 5.83334V14.1667C3.33334 15.5474 4.45263 16.6667 5.83334 16.6667ZM13.75 7.91668C13.75 8.83715 13.0038 9.58334 12.0833 9.58334C11.1629 9.58334 10.4167 8.83715 10.4167 7.91668C10.4167 6.9962 11.1629 6.25001 12.0833 6.25001C13.0038 6.25001 13.75 6.9962 13.75 7.91668Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ />+ </svg>+);++export const CapAudioOn = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M15.8959 4.10807C17.4039 5.61611 18.3366 7.69944 18.3366 10.0006C18.3366 12.3018 17.4039 14.3852 15.8959 15.8932M13.2442 6.75944C14.0737 7.58886 14.5867 8.73469 14.5867 10.0003C14.5867 11.266 14.0737 12.4118 13.2442 13.2413M3.33666 6.66667H4.39991C4.78981 6.66667 5.16736 6.52997 5.46689 6.28037L8.63651 3.63902C9.17928 3.18671 10.0033 3.57267 10.0033 4.2792V15.7208C10.0033 16.4273 9.17928 16.8133 8.63651 16.361L5.46689 13.7196C5.16736 13.47 4.78981 13.3333 4.39991 13.3333H3.33666C2.41619 13.3333 1.67 12.5871 1.67 11.6667V8.33333C1.67 7.41286 2.41619 6.66667 3.33666 6.66667Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapMessageBubble = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M5.00183 3.33334H15.0018C16.3825 3.33334 17.5018 4.45263 17.5018 5.83334V12.5C17.5018 13.8807 16.3825 15 15.0018 15H10.0018L5.83516 17.5V15H5.00183C3.62112 15 2.50183 13.8807 2.50183 12.5V5.83334C2.50183 4.45263 3.62112 3.33334 5.00183 3.33334Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="square"+ strokeLinejoin="round"+ />+ <path+ d="M5.52084 9.16667C5.52084 9.56937 5.84729 9.89583 6.25 9.89583C6.65271 9.89583 6.97917 9.56937 6.97917 9.16667C6.97917 8.76396 6.65271 8.4375 6.25 8.4375C5.84729 8.4375 5.52084 8.76396 5.52084 9.16667ZM9.27084 9.16667C9.27084 9.56937 9.59729 9.89583 10 9.89583C10.4027 9.89583 10.7292 9.56937 10.7292 9.16667C10.7292 8.76396 10.4027 8.4375 10 8.4375C9.59729 8.4375 9.27084 8.76396 9.27084 9.16667ZM13.0208 9.16667C13.0208 9.56937 13.3473 9.89583 13.75 9.89583C14.1527 9.89583 14.4792 9.56937 14.4792 9.16667C14.4792 8.76396 14.1527 8.4375 13.75 8.4375C13.3473 8.4375 13.0208 8.76396 13.0208 9.16667Z"+ fill="currentColor"+ stroke="currentColor"+ strokeWidth="0.625"+ strokeLinecap="square"+ />+ </svg>+);++export const CapCursor = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M3.1164 4.70352L7.21444 16.6885C7.58598 17.7751 9.10312 17.8278 9.54909 16.7695L11.4923 12.1586C11.6189 11.858 11.8581 11.6189 12.1587 11.4922L16.7696 9.54903C17.8278 9.10306 17.7752 7.58592 16.6886 7.21437L4.70359 3.11633C3.7205 2.78019 2.78025 3.72044 3.1164 4.70352Z"+ stroke="currentColor"+ strokeWidth="1.71296"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapUndo = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M5.83333 2.5L3.33333 5L5.83333 7.5M4.16666 5H11.25C14.2415 5 16.6667 7.42512 16.6667 10.4167C16.6667 13.4082 14.2415 15.8333 11.25 15.8333H4.99999"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapRedo = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M13.3333 2.5L15.8333 5L13.3333 7.5M15 5H7.91667C4.92512 5 2.5 7.42512 2.5 10.4167C2.5 13.4082 4.92512 15.8333 7.91667 15.8333H14.1667"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapPresets = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="currentColor"+ >+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M13.7857 2.95241C14.6865 2.05167 16.1468 2.05167 17.0476 2.95241C17.9483 3.85314 17.9483 5.31352 17.0476 6.21425L6.21425 17.0476C5.31352 17.9483 3.85314 17.9483 2.95241 17.0476C2.05167 16.1468 2.05167 14.6865 2.95241 13.7857L13.7857 2.95241ZM15.8691 4.13092C15.6192 3.88106 15.2141 3.88106 14.9642 4.13092L13.4702 5.62499L14.375 6.52982L15.8691 5.03574C16.1189 4.78588 16.1189 4.38078 15.8691 4.13092ZM13.1965 7.70833L12.2917 6.80351L4.13092 14.9643C3.88106 15.2141 3.88106 15.6192 4.13092 15.8691C4.38078 16.1189 4.78588 16.1189 5.03574 15.8691L13.1965 7.70833Z"+ />+ <path d="M8.2084 1.72878C8.28903 1.68846 8.35442 1.62308 8.39474 1.54244L8.79328 0.745358C8.94683 0.438254 9.38508 0.438254 9.53863 0.745358L9.93718 1.54244C9.97749 1.62308 10.0429 1.68846 10.1235 1.72878L10.9206 2.12732C11.2277 2.28088 11.2277 2.71913 10.9206 2.87268L10.1235 3.27122C10.0429 3.31154 9.97749 3.37692 9.93718 3.45756L9.53863 4.25465C9.38508 4.56175 8.94683 4.56175 8.79328 4.25465L8.39474 3.45756C8.35442 3.37692 8.28903 3.31154 8.2084 3.27122L7.41131 2.87268C7.10421 2.71913 7.10421 2.28088 7.41131 2.12732L8.2084 1.72878Z" />+ <path d="M15.7084 10.8954C15.789 10.8551 15.8544 10.7897 15.8947 10.7091L16.2933 9.91202C16.4468 9.60492 16.8851 9.60492 17.0386 9.91202L17.4372 10.7091C17.4775 10.7897 17.5429 10.8551 17.6235 10.8954L18.4206 11.294C18.7277 11.4475 18.7277 11.8858 18.4206 12.0393L17.6235 12.4379C17.5429 12.4782 17.4775 12.5436 17.4372 12.6242L17.0386 13.4213C16.8851 13.7284 16.4468 13.7284 16.2933 13.4213L15.8947 12.6242C15.8544 12.5436 15.789 12.4782 15.7084 12.4379L14.9113 12.0393C14.6042 11.8858 14.6042 11.4475 14.9113 11.294L15.7084 10.8954Z" />+ <path d="M4.04173 5.89545C4.12237 5.85513 4.18775 5.78975 4.22807 5.70911L4.62661 4.91202C4.78016 4.60492 5.21842 4.60492 5.37197 4.91202L5.77051 5.70911C5.81083 5.78975 5.87621 5.85513 5.95685 5.89545L6.75393 6.29399C7.06104 6.44754 7.06104 6.88579 6.75393 7.03935L5.95685 7.43789C5.87621 7.47821 5.81083 7.54359 5.77051 7.62423L5.37197 8.42131C5.21842 8.72842 4.78016 8.72842 4.62661 8.42131L4.22807 7.62423C4.18775 7.54359 4.12237 7.47821 4.04173 7.43789L3.24465 7.03935C2.93754 6.88579 2.93754 6.44754 3.24465 6.29399L4.04173 5.89545Z" />+ </svg>+);++export const CapScissors = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="currentColor"+ >+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M5 2.5C3.15905 2.5 1.66666 3.99238 1.66666 5.83333C1.66666 7.67428 3.15905 9.16667 5 9.16667C5.85421 9.16667 6.63337 8.84536 7.22322 8.317L9.74771 10L7.22322 11.683C6.63337 11.1546 5.85421 10.8333 5 10.8333C3.15905 10.8333 1.66666 12.3257 1.66666 14.1667C1.66666 16.0076 3.15905 17.5 5 17.5C6.84095 17.5 8.33333 16.0076 8.33333 14.1667C8.33333 13.7822 8.26824 13.4129 8.14846 13.0692L18.6556 6.06446C18.1451 5.29858 17.1103 5.09162 16.3444 5.60221L11.25 8.99846L8.14846 6.93075C8.26824 6.5871 8.33333 6.21782 8.33333 5.83333C8.33333 3.99238 6.84095 2.5 5 2.5ZM3.33333 5.83333C3.33333 4.91286 4.07952 4.16667 5 4.16667C5.92047 4.16667 6.66666 4.91286 6.66666 5.83333C6.66666 6.75381 5.92047 7.5 5 7.5C4.07952 7.5 3.33333 6.75381 3.33333 5.83333ZM3.33333 14.1667C3.33333 13.2462 4.07952 12.5 5 12.5C5.92047 12.5 6.66666 13.2462 6.66666 14.1667C6.66666 15.0871 5.92047 15.8333 5 15.8333C4.07952 15.8333 3.33333 15.0871 3.33333 14.1667Z"+ />+ <path d="M16.3444 14.3978L12.0012 11.5023L13.5035 10.5008L18.6556 13.9355C18.1451 14.7014 17.1103 14.9084 16.3444 14.3978Z" />+ </svg>+);++export const CapUpload = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M16.6667 10.625V14.1667C16.6667 15.5474 15.5474 16.6667 14.1667 16.6667H5.83333C4.45262 16.6667 3.33333 15.5474 3.33333 14.1667V10.625M9.99999 3.33333V12.7083M9.99999 3.33333L13.75 7.08333M9.99999 3.33333L6.24999 7.08333"+ stroke="currentColor"+ strokeWidth="1.66667"+ strokeLinecap="round"+ strokeLinejoin="round"+ />+ </svg>+);++export const CapLayoutIcon = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 20 20"+ fill="none"+ >+ <path+ d="M15.8333 6.00001V14C15.8333 14.4805 15.8327 14.7907 15.8134 15.0268C15.7949 15.2532 15.7635 15.3371 15.7425 15.3783C15.6626 15.5351 15.5351 15.6626 15.3783 15.7425C15.3371 15.7635 15.2532 15.7949 15.0268 15.8134C14.7907 15.8327 14.4805 15.8333 14 15.8333H5.99999C5.51953 15.8333 5.20931 15.8327 4.97319 15.8134C4.74681 15.7949 4.66287 15.7635 4.62167 15.7425C4.46487 15.6626 4.33738 15.5351 4.25749 15.3783C4.2365 15.3371 4.2051 15.2532 4.1866 15.0268C4.16731 14.7907 4.16666 14.4805 4.16666 14V6.00001C4.16666 5.51955 4.16731 5.20932 4.1866 4.97321C4.2051 4.74682 4.2365 4.66289 4.25749 4.62168C4.33738 4.46488 4.46487 4.3374 4.62167 4.2575C4.66287 4.23651 4.74681 4.20511 4.97319 4.18662C5.20931 4.16732 5.51953 4.16668 5.99999 4.16668H14C14.4805 4.16668 14.7907 4.16732 15.0268 4.18662C15.2532 4.20511 15.3371 4.23651 15.3783 4.2575C15.5351 4.3374 15.6626 4.46488 15.7425 4.62168C15.7635 4.66289 15.7949 4.74682 15.8134 4.97321C15.8327 5.20932 15.8333 5.51955 15.8333 6.00001Z"+ stroke="currentColor"+ strokeWidth="1.66667"+ />+ <path+ d="M10 3.33334V16.6667M3.33333 8.33334H10M10 11.6667H16.6667"+ stroke="currentColor"+ strokeWidth="1.66667"+ />+ </svg>+);++export const CapPrev = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 12 15"+ fill="currentColor"+ >+ <path d="M12 1.491V13.509C11.9978 13.7218 11.939 13.9301 11.8297 14.1127C11.7205 14.2952 11.5646 14.4454 11.3782 14.5479C11.1917 14.6504 10.9814 14.7015 10.7687 14.696C10.556 14.6904 10.3486 14.6284 10.1678 14.5163L1.2 8.90775V14.1C1.2 14.2591 1.13679 14.4117 1.02426 14.5243C0.911742 14.6368 0.75913 14.7 0.6 14.7C0.44087 14.7 0.288258 14.6368 0.175736 14.5243C0.0632142 14.4117 0 14.2591 0 14.1V0.900003C0 0.740873 0.0632142 0.588261 0.175736 0.475739C0.288258 0.363217 0.44087 0.300003 0.6 0.300003C0.75913 0.300003 0.911742 0.363217 1.02426 0.475739C1.13679 0.588261 1.2 0.740873 1.2 0.900003V6.09225L10.1678 0.483753C10.3484 0.370382 10.556 0.307344 10.7691 0.301168C10.9823 0.294992 11.1932 0.345901 11.38 0.448625C11.5669 0.551349 11.7229 0.702153 11.8319 0.885424C11.9409 1.06869 11.9989 1.27777 12 1.491Z" />+ </svg>+);++export const CapNext = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 12 15"+ fill="currentColor"+ >+ <path d="M12 0.900003V14.1C12 14.2591 11.9368 14.4117 11.8243 14.5243C11.7117 14.6368 11.5591 14.7 11.4 14.7C11.2409 14.7 11.0883 14.6368 10.9757 14.5243C10.8632 14.4117 10.8 14.2591 10.8 14.1V8.90775L1.83225 14.5163C1.65165 14.6296 1.44403 14.6927 1.23088 14.6988C1.01774 14.705 0.806815 14.6541 0.619954 14.5514C0.433093 14.4487 0.277086 14.2979 0.168086 14.1146C0.0590853 13.9313 0.00105403 13.7222 0 13.509V1.491C0.00105403 1.27777 0.0590853 1.06869 0.168086 0.885424C0.277086 0.702153 0.433093 0.551349 0.619954 0.448625C0.806815 0.345901 1.01774 0.294992 1.23088 0.301168C1.44403 0.307344 1.65165 0.370382 1.83225 0.483753L10.8 6.09225V0.900003C10.8 0.740873 10.8632 0.588261 10.9757 0.475739C11.0883 0.363217 11.2409 0.300003 11.4 0.300003C11.5591 0.300003 11.7117 0.363217 11.8243 0.475739C11.9368 0.588261 12 0.740873 12 0.900003Z" />+ </svg>+);++export const CapPlay = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 10 11"+ fill="currentColor"+ >+ <path d="M10 5.5C10.0004 5.63058 9.9608 5.75903 9.88513 5.87284C9.80946 5.98665 9.70027 6.08196 9.56818 6.14949L1.38182 10.3868C1.2438 10.4583 1.08572 10.4973 0.923908 10.4999C0.762096 10.5024 0.602417 10.4683 0.461364 10.4012C0.321653 10.3351 0.205271 10.2387 0.124184 10.122C0.0430974 10.0052 0.000233442 9.87225 0 9.73682V1.26318C0.000233442 1.12775 0.0430974 0.994814 0.124184 0.878045C0.205271 0.761275 0.321653 0.664887 0.461364 0.598793C0.602417 0.531656 0.762096 0.497596 0.923908 0.500132C1.08572 0.502667 1.2438 0.541706 1.38182 0.613215L9.56818 4.85051C9.70027 4.91804 9.80946 5.01335 9.88513 5.12716C9.9608 5.24097 10.0004 5.36942 10 5.5Z" />+ </svg>+);++export const CapPause = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 17 19"+ fill="currentColor"+ >+ <path d="M16.6587 2.14536V17.1454C16.6587 17.5432 16.5007 17.9247 16.2194 18.206C15.938 18.4873 15.5565 18.6454 15.1587 18.6454H11.4087C11.0109 18.6454 10.6293 18.4873 10.348 18.206C10.0667 17.9247 9.90869 17.5432 9.90869 17.1454V2.14536C9.90869 1.74753 10.0667 1.366 10.348 1.08469C10.6293 0.80339 11.0109 0.645355 11.4087 0.645355H15.1587C15.5565 0.645355 15.938 0.80339 16.2194 1.08469C16.5007 1.366 16.6587 1.74753 16.6587 2.14536ZM5.40869 0.645355H1.65869C1.26087 0.645355 0.879336 0.80339 0.598031 1.08469C0.316727 1.366 0.158691 1.74753 0.158691 2.14536V17.1454C0.158691 17.5432 0.316727 17.9247 0.598031 18.206C0.879336 18.4873 1.26087 18.6454 1.65869 18.6454H5.40869C5.80652 18.6454 6.18805 18.4873 6.46935 18.206C6.75066 17.9247 6.90869 17.5432 6.90869 17.1454V2.14536C6.90869 1.74753 6.75066 1.366 6.46935 1.08469C6.18805 0.80339 5.80652 0.645355 5.40869 0.645355Z" />+ </svg>+);++/* -------------------------------------------- target + third-party icons -- */++/** ph:monitor-bold — the system audio row icon. */+export const PhMonitorBold = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 256 256"+ fill="currentColor"+ >+ <path d="M208 36H48a28 28 0 0 0-28 28v112a28 28 0 0 0 28 28h160a28 28 0 0 0 28-28V64a28 28 0 0 0-28-28m4 140a4 4 0 0 1-4 4H48a4 4 0 0 1-4-4V64a4 4 0 0 1 4-4h160a4 4 0 0 1 4 4Zm-40 52a12 12 0 0 1-12 12H96a12 12 0 0 1 0-24h64a12 12 0 0 1 12 12" />+ </svg>+);++/** mdi:monitor — the Display target icon. */+export const MdiMonitor = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <path d="M21 16H3V4h18m0-2H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h7v2H8v2h8v-2h-2v-2h7a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2" />+ </svg>+);++/** lucide:app-window-mac — the Window target icon. */+export const LucideAppWindowMac = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 24 24"+ >+ <g+ fill="none"+ stroke="currentColor"+ strokeLinecap="round"+ strokeLinejoin="round"+ strokeWidth="2"+ >+ <rect width="20" height="16" x="2" y="4" rx="2" />+ <path d="M6 8h.01M10 8h.01M14 8h.01" />+ </g>+ </svg>+);++/** material-symbols:screenshot-frame-2-rounded — the Area target icon. */+export const MsScreenshotFrame = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <path d="M20.288 9.713Q20 9.425 20 9V7h-2q-.425 0-.712-.288T17 6t.288-.712T18 5h2q.825 0 1.413.588T22 7v2q0 .425-.288.713T21 10t-.712-.288M3 10q-.425 0-.712-.288T2 9V7q0-.825.588-1.412T4 5h2q.425 0 .713.288T7 6t-.288.713T6 7H4v2q0 .425-.288.713T3 10m15 9q-.425 0-.712-.288T17 18t.288-.712T18 17h2v-2q0-.425.288-.712T21 14t.713.288T22 15v2q0 .825-.587 1.413T20 19zM4 19q-.825 0-1.412-.587T2 17v-2q0-.425.288-.712T3 14t.713.288T4 15v2h2q.425 0 .713.288T7 18t-.288.713T6 19z" />+ </svg>+);++const Lucide = ({+ className,+ style,+ children,+}: IconProps & { children: React.ReactNode }) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 24 24"+ fill="none"+ stroke="currentColor"+ strokeWidth="2"+ strokeLinecap="round"+ strokeLinejoin="round"+ >+ {children}+ </svg>+);++export const LucideVideo = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" />+ <rect width="14" height="12" x="2" y="6" rx="2" />+ </Lucide>+);++export const LucideSettings = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M9.671 4.136a2.34 2.34 0 0 1 4.659 0a2.34 2.34 0 0 0 3.319 1.915a2.34 2.34 0 0 1 2.33 4.033a2.34 2.34 0 0 0 0 3.831a2.34 2.34 0 0 1-2.33 4.033a2.34 2.34 0 0 0-3.319 1.915a2.34 2.34 0 0 1-4.659 0a2.34 2.34 0 0 0-3.32-1.915a2.34 2.34 0 0 1-2.33-4.033a2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915" />+ <circle cx="12" cy="12" r="3" />+ </Lucide>+);++export const LucideImage = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <rect width="18" height="18" x="3" y="3" rx="2" ry="2" />+ <circle cx="9" cy="9" r="2" />+ <path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21" />+ </Lucide>+);++export const LucideSquarePlay = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <rect width="18" height="18" x="3" y="3" rx="2" />+ <path d="M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z" />+ </Lucide>+);++export const LucideScanText = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M3 7V5a2 2 0 0 1 2-2h2" />+ <path d="M17 3h2a2 2 0 0 1 2 2v2" />+ <path d="M21 17v2a2 2 0 0 1-2 2h-2" />+ <path d="M7 21H5a2 2 0 0 1-2-2v-2" />+ <path d="M7 8h8" />+ <path d="M7 12h10" />+ <path d="M7 16h6" />+ </Lucide>+);++export const LucideCircleHelp = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <circle cx="12" cy="12" r="10" />+ <path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" />+ <path d="M12 17h.01" />+ </Lucide>+);++export const LucideMaximize2 = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M15 3h6v6" />+ <path d="m21 3-7 7" />+ <path d="m3 21 7-7" />+ <path d="M9 21H3v-6" />+ </Lucide>+);++export const LucideBell = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M10.268 21a2 2 0 0 0 3.464 0" />+ <path d="M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326" />+ </Lucide>+);++export const LucideEyeOff = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M9.88 9.88a3 3 0 1 0 4.24 4.24" />+ <path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68" />+ <path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61" />+ <path d="m2 2 20 20" />+ </Lucide>+);++export const LucideFolder = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z" />+ </Lucide>+);++export const LucideBuilding2 = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z" />+ <path d="M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2" />+ <path d="M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2" />+ <path d="M10 6h4" />+ <path d="M10 10h4" />+ <path d="M10 14h4" />+ <path d="M10 18h4" />+ </Lucide>+);++export const LucideKeyboard = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <rect width="20" height="16" x="2" y="4" rx="2" />+ <path d="M6 8h.01" />+ <path d="M10 8h.01" />+ <path d="M14 8h.01" />+ <path d="M18 8h.01" />+ <path d="M8 12h.01" />+ <path d="M12 12h.01" />+ <path d="M16 12h.01" />+ <path d="M7 16h10" />+ </Lucide>+);++export const LucideChevronDown = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="m6 9 6 6 6-6" />+ </Lucide>+);++export const LucideSearch = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <circle cx="11" cy="11" r="8" />+ <path d="m21 21-4.3-4.3" />+ </Lucide>+);++export const LucideZoomIn = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <circle cx="11" cy="11" r="8" />+ <path d="m21 21-4.3-4.3" />+ <path d="M11 8v6" />+ <path d="M8 11h6" />+ </Lucide>+);++export const LucideZoomOut = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <circle cx="11" cy="11" r="8" />+ <path d="m21 21-4.3-4.3" />+ <path d="M8 11h6" />+ </Lucide>+);++export const LucideClock = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <circle cx="12" cy="12" r="10" />+ <path d="M12 6v6l4 2" />+ </Lucide>+);++export const LucidePlus = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M5 12h14" />+ <path d="M12 5v14" />+ </Lucide>+);++export const LucideLoader = ({ className, style }: IconProps) => (+ <Lucide className={className} style={style}>+ <path d="M21 12a9 9 0 1 1-6.219-8.56" />+ </Lucide>+);++/* ----------------------------------------------------------------- cursor -- */++/**+ * cap:cursor-macos — the real macOS arrow, white outline + black body with+ * a soft drop shadow, exactly as shipped in the desktop icon set.+ */+export const MacCursor = ({ className, style }: IconProps) => (+ <svg+ aria-hidden="true"+ className={className}+ style={style}+ viewBox="0 0 17 24"+ fill="none"+ >+ <g filter="url(#ht-cursor-shadow)">+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M4.501 3.2601L12.884 11.6611C13.937 12.7171 13.19 14.5191 11.699 14.5191L10.475 14.519L11.6908 17.4067C11.9038 17.9127 11.9068 18.4727 11.6998 18.9817C11.4918 19.4917 11.0978 19.8897 10.5898 20.1027C10.3338 20.2097 10.0658 20.2637 9.7918 20.2637C8.9608 20.2637 8.2158 19.7687 7.8938 19.0027L6.616 15.965L5.784 16.7031C4.703 17.6591 3 16.8921 3 15.4481V3.8811C3 3.0971 3.947 2.7051 4.501 3.2601Z"+ fill="white"+ />+ </g>+ <path+ fillRule="evenodd"+ clipRule="evenodd"+ d="M4 4.53033C4 4.39933 4.159 4.33333 4.251 4.42633L12.159 12.3513C12.59 12.7833 12.284 13.5203 11.674 13.5203L8.97 13.5188L10.7696 17.7947C10.9966 18.3347 10.7426 18.9557 10.2036 19.1817C9.6626 19.4087 9.0426 19.1557 8.8166 18.6167L6.999 14.2928L5.139 15.9403C4.723 16.3083 4.0811 16.0518 4.007 15.5285L4 15.4273V4.53033Z"+ fill="black"+ />+ <defs>+ {/* biome-ignore lint/correctness/useUniqueElementIds: single-instance svg filter */}+ <filter+ id="ht-cursor-shadow"+ x="0"+ y="0"+ width="16.375"+ height="23.2637"+ filterUnits="userSpaceOnUse"+ colorInterpolationFilters="sRGB"+ >+ <feFlood floodOpacity="0" result="BackgroundImageFix" />+ <feColorMatrix+ in="SourceAlpha"+ type="matrix"+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"+ result="hardAlpha"+ />+ <feOffset />+ <feGaussianBlur stdDeviation="1.5" />+ <feComposite in2="hardAlpha" operator="out" />+ <feColorMatrix+ type="matrix"+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.6 0"+ />+ <feBlend+ mode="normal"+ in2="BackgroundImageFix"+ result="effect1_dropShadow"+ />+ <feBlend+ mode="normal"+ in="SourceGraphic"+ in2="effect1_dropShadow"+ result="shape"+ />+ </filter>+ </defs>+ </svg>+);diff --git a/apps/web/components/pages/HomeTwo/demo/chrome.tsx b/apps/web/components/pages/HomeTwo/demo/chrome.tsxnew file mode 100644index 000000000..d0d594425--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/chrome.tsx@@ -0,0 +1,167 @@+"use client";++import { classNames } from "@cap/utils/helpers";++/**+ * Window decorations for the fake desktop. macOS gets traffic lights on the+ * left; Windows gets the caption controls Cap Desktop actually draws, traced+ * from `apps/desktop/src/components/titlebar/controls/CaptionControlsWindows11.tsx`+ * (46px cells, 10px glyphs, #c42b1c on the close hover).+ */++export const TrafficLights = ({+ size = 12,+ /** The recorder window only offers close + zoom. */+ minimize = true,+ className,+}: {+ size?: number;+ minimize?: boolean;+ className?: string;+}) => (+ <div className={classNames("flex items-center gap-2", className)}>+ {["#FF5F57", ...(minimize ? ["#FEBC2E"] : []), "#28C840"].map((color) => (+ <span+ key={color}+ className="rounded-full"+ style={{ width: size, height: size, background: color }}+ />+ ))}+ </div>+);++/* ------------------------------------------------------- windows glyphs -- */++const MinimizeGlyph = () => (+ <svg aria-hidden="true" width="10" height="1" viewBox="0 0 10 1" fill="none">+ <path+ d="M0.498047 1.00098C0.429688 1.00098 0.364583 0.987956 0.302734 0.961914C0.244141 0.935872 0.192057 0.900065 0.146484 0.854492C0.100911 0.808919 0.0651042 0.756836 0.0390625 0.698242C0.0130208 0.636393 0 0.571289 0 0.50293C0 0.43457 0.0130208 0.371094 0.0390625 0.3125C0.0651042 0.250651 0.100911 0.19694 0.146484 0.151367C0.192057 0.102539 0.244141 0.0651042 0.302734 0.0390625C0.364583 0.0130208 0.429688 0 0.498047 0H9.50195C9.57031 0 9.63379 0.0130208 9.69238 0.0390625C9.75423 0.0651042 9.80794 0.102539 9.85352 0.151367C9.89909 0.19694 9.9349 0.250651 9.96094 0.3125C9.98698 0.371094 10 0.43457 10 0.50293C10 0.571289 9.98698 0.636393 9.96094 0.698242C9.9349 0.756836 9.89909 0.808919 9.85352 0.854492C9.80794 0.900065 9.75423 0.935872 9.69238 0.961914C9.63379 0.987956 9.57031 1.00098 9.50195 1.00098H0.498047Z"+ fill="currentColor"+ />+ </svg>+);++const MaximizeGlyph = () => (+ <svg+ aria-hidden="true"+ width="10"+ height="10"+ viewBox="0 0 10 10"+ fill="none"+ >+ <path+ d="M1.47461 10.001C1.2793 10.001 1.09212 9.96191 0.913086 9.88379C0.734049 9.80241 0.576172 9.69499 0.439453 9.56152C0.30599 9.4248 0.198568 9.26693 0.117188 9.08789C0.0390625 8.90885 0 8.72168 0 8.52637V1.47559C0 1.28027 0.0390625 1.0931 0.117188 0.914062C0.198568 0.735026 0.30599 0.578776 0.439453 0.445312C0.576172 0.308594 0.734049 0.201172 0.913086 0.123047C1.09212 0.0416667 1.2793 0.000976562 1.47461 0.000976562H8.52539C8.7207 0.000976562 8.90788 0.0416667 9.08691 0.123047C9.26595 0.201172 9.4222 0.308594 9.55566 0.445312C9.69238 0.578776 9.7998 0.735026 9.87793 0.914062C9.95931 1.0931 10 1.28027 10 1.47559V8.52637C10 8.72168 9.95931 8.90885 9.87793 9.08789C9.7998 9.26693 9.69238 9.4248 9.55566 9.56152C9.4222 9.69499 9.26595 9.80241 9.08691 9.88379C8.90788 9.96191 8.7207 10.001 8.52539 10.001H1.47461ZM8.50098 9C8.56934 9 8.63281 8.98698 8.69141 8.96094C8.75326 8.9349 8.80697 8.89909 8.85254 8.85352C8.89811 8.80794 8.93392 8.75586 8.95996 8.69727C8.986 8.63542 8.99902 8.57031 8.99902 8.50195V1.5C8.99902 1.43164 8.986 1.36816 8.95996 1.30957C8.93392 1.24772 8.89811 1.19401 8.85254 1.14844C8.80697 1.10286 8.75326 1.06706 8.69141 1.04102C8.63281 1.01497 8.56934 1.00195 8.50098 1.00195H1.49902C1.43066 1.00195 1.36556 1.01497 1.30371 1.04102C1.24512 1.06706 1.19303 1.10286 1.14746 1.14844C1.10189 1.19401 1.06608 1.24772 1.04004 1.30957C1.014 1.36816 1.00098 1.43164 1.00098 1.5V8.50195C1.00098 8.57031 1.014 8.63542 1.04004 8.69727C1.06608 8.75586 1.10189 8.80794 1.14746 8.85352C1.19303 8.89909 1.24512 8.9349 1.30371 8.96094C1.36556 8.98698 1.43066 9 1.49902 9H8.50098Z"+ fill="currentColor"+ />+ </svg>+);++const CloseGlyph = () => (+ <svg+ aria-hidden="true"+ width="10"+ height="10"+ viewBox="0 0 10 10"+ fill="none"+ >+ <path+ d="M5 5.70898L0.854492 9.85449C0.756836 9.95215 0.639648 10.001 0.50293 10.001C0.359701 10.001 0.239258 9.95378 0.141602 9.85938C0.0472005 9.76172 0 9.64128 0 9.49805C0 9.36133 0.0488281 9.24414 0.146484 9.14648L4.29199 5.00098L0.146484 0.855469C0.0488281 0.757812 0 0.638997 0 0.499023C0 0.430664 0.0130208 0.36556 0.0390625 0.303711C0.0651042 0.241862 0.100911 0.189779 0.146484 0.147461C0.192057 0.101888 0.245768 0.0660807 0.307617 0.0400391C0.369466 0.0139974 0.43457 0.000976562 0.50293 0.000976562C0.639648 0.000976562 0.756836 0.0498047 0.854492 0.147461L5 4.29297L9.14551 0.147461C9.24316 0.0498047 9.36198 0.000976562 9.50195 0.000976562C9.57031 0.000976562 9.63379 0.0139974 9.69238 0.0400391C9.75423 0.0660807 9.80794 0.101888 9.85352 0.147461C9.89909 0.193034 9.9349 0.246745 9.96094 0.308594C9.98698 0.367188 10 0.430664 10 0.499023C10 0.638997 9.95117 0.757812 9.85352 0.855469L5.70801 5.00098L9.85352 9.14648C9.95117 9.24414 10 9.36133 10 9.49805C10 9.56641 9.98698 9.63151 9.96094 9.69336C9.9349 9.75521 9.89909 9.80892 9.85352 9.85449C9.8112 9.90007 9.75911 9.93587 9.69727 9.96191C9.63542 9.98796 9.57031 10.001 9.50195 10.001C9.36198 10.001 9.24316 9.95215 9.14551 9.85449L5 5.70898Z"+ fill="currentColor"+ />+ </svg>+);++/**+ * Minimise / maximise / close, stretched to the titlebar's height the way+ * Windows does. `light` flips the glyph colour for dark titlebars.+ */+export const WindowsCaptionControls = ({+ light,+ className,+}: {+ light?: boolean;+ className?: string;+}) => {+ const cell =+ "flex w-[46px] shrink-0 items-center justify-center self-stretch transition-colors duration-150";+ return (+ <div+ aria-hidden="true"+ className={classNames("flex items-stretch self-stretch", className)}+ style={{ color: light ? "rgba(255,255,255,0.9)" : "rgba(0,0,0,0.9)" }}+ >+ <span+ className={classNames(+ cell,+ light ? "hover:bg-white/10" : "hover:bg-black/[0.05]",+ )}+ >+ <MinimizeGlyph />+ </span>+ <span+ className={classNames(+ cell,+ light ? "hover:bg-white/10" : "hover:bg-black/[0.05]",+ )}+ >+ <MaximizeGlyph />+ </span>+ <span className={classNames(cell, "hover:bg-[#c42b1c] hover:text-white")}>+ <CloseGlyph />+ </span>+ </div>+ );+};++/* ---------------------------------------------------------- os switcher -- */++/**+ * The OS badge in the corner of the fake desktop doubles as the switch+ * between the two shells: the Apple glyph in the menu bar, the Start button+ * on the taskbar. A tooltip on hover says so, since nothing else on the+ * chrome is clickable.+ */+export const OsSwitchButton = ({+ children,+ label,+ tooltip,+ side = "below",+ align = "center",+ className,+ onClick,+}: {+ children: React.ReactNode;+ /** Screen-reader label, e.g. "Switch the demo to Windows". */+ label: string;+ tooltip: string;+ side?: "below" | "above";+ /** "left" keeps the bubble on screen when the button hugs the corner. */+ align?: "center" | "left";+ className?: string;+ onClick: () => void;+}) => (+ <button+ type="button"+ aria-label={label}+ onClick={(event) => {+ event.stopPropagation();+ onClick();+ }}+ className={classNames(+ "group relative flex cursor-pointer items-center justify-center transition-colors duration-150",+ className,+ )}+ >+ {children}+ <span+ className={classNames(+ "pointer-events-none absolute z-50 whitespace-nowrap rounded-[8px] px-2.5 py-1.5 text-[12px] font-medium text-white opacity-0 shadow-[0_10px_28px_-8px_rgba(9,12,20,0.6)] transition-opacity duration-150 group-hover:opacity-100 group-focus-visible:opacity-100",+ side === "below" ? "top-[calc(100%+8px)]" : "bottom-[calc(100%+10px)]",+ align === "left" ? "left-0" : "left-1/2 -translate-x-1/2",+ )}+ style={{ background: "#202020" }}+ >+ {tooltip}+ </span>+ </button>+);diff --git a/apps/web/components/pages/HomeTwo/demo/media.tsx b/apps/web/components/pages/HomeTwo/demo/media.tsxnew file mode 100644index 000000000..c488eb532--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/media.tsx@@ -0,0 +1,19 @@+"use client";++import { createContext, useContext } from "react";++const SceneMediaContext = createContext<{ still: boolean }>({ still: false });++export const SceneMediaProvider = SceneMediaContext.Provider;++export const useSceneMedia = () => useContext(SceneMediaContext);++export const VIDEO_POSTERS = {+ webcam: "/videos/home-two/webcam-poster.jpg",+ screen: "/illustrations/homepage-animation-poster.jpg",+} as const;++export const useVideoAttrs = (poster: string, visible = true) => {+ const { still } = useSceneMedia();+ return { poster, preload: still || !visible ? "none" : "metadata" } as const;+};diff --git a/apps/web/components/pages/HomeTwo/demo/platform.tsx b/apps/web/components/pages/HomeTwo/demo/platform.tsxnew file mode 100644index 000000000..4af16f93c--- /dev/null+++ b/apps/web/components/pages/HomeTwo/demo/platform.tsx@@ -0,0 +1,30 @@+"use client";++import { createContext, useContext } from "react";++/**+ * Which OS the demo is dressed as. Everything except the Cap windows'+ * chrome is shared, so a single context beats threading a prop through the+ * whole window tree.+ *+ * Windows visitors get the Windows shell; every other platform (macOS,+ * Linux, and the first paint before detection resolves) gets macOS, the same+ * default the download button uses.+ */+export type DemoPlatform = "macos" | "windows";++const DemoPlatformContext = createContext<DemoPlatform>("macos");++export const DemoPlatformProvider = DemoPlatformContext.Provider;++export const useDemoPlatform = () => useContext(DemoPlatformContext);++export const useIsWindowsDemo = () => useDemoPlatform() === "windows";++/** System UI stack per platform, for the OS chrome (not the Cap windows). */+export const OS_FONT = {+ macos:+ "-apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', sans-serif",+ windows:+ "'Segoe UI Variable Text', 'Segoe UI', 'Segoe UI Web (West European)', system-ui, sans-serif",+} as const;diff --git a/apps/web/components/pages/HomeTwo/fonts.ts b/apps/web/components/pages/HomeTwo/fonts.tsnew file mode 100644index 000000000..b3f95faeb--- /dev/null+++ b/apps/web/components/pages/HomeTwo/fonts.ts@@ -0,0 +1,50 @@+import {+ DM_Mono,+ Geist,+ Instrument_Sans,+ Source_Serif_4,+} from "next/font/google";++/**+ * The /home-two type system mirrors Intercom's three-role setup:+ * a regular-weight grotesk for display and UI, a light serif for body copy,+ * and an uppercase mono for eyebrows. All loaded only on this page via the+ * variable classes on the page's <main>.+ */++/** Display + UI grotesk (Saans analog). Applied as the page's base font. */+export const htSans = Instrument_Sans({+ subsets: ["latin"],+ weight: ["400", "500"],+ display: "swap",+ variable: "--font-ht-sans",+});++/** Light serif for body copy and quotes (Serrif analog). */+export const htSerif = Source_Serif_4({+ subsets: ["latin"],+ weight: ["300", "400"],+ style: ["normal"],+ display: "swap",+ variable: "--font-ht-serif",+});++/**+ * The Cap desktop app's actual UI font (Geist Sans at weight 500), used only+ * inside the "See how it works" desktop demo so the recreated app windows+ * render with the same type as the real app.+ */+export const htGeist = Geist({+ subsets: ["latin"],+ weight: ["400", "500", "600"],+ display: "swap",+ variable: "--font-ht-geist",+});++/** Uppercase mono for eyebrows and small labels (SaansMono analog). */+export const htMono = DM_Mono({+ subsets: ["latin"],+ weight: ["400"],+ display: "swap",+ variable: "--font-ht-mono",+});diff --git a/apps/web/components/pages/HomeTwo/glyphs.tsx b/apps/web/components/pages/HomeTwo/glyphs.tsxnew file mode 100644index 000000000..294ae509d--- /dev/null+++ b/apps/web/components/pages/HomeTwo/glyphs.tsx@@ -0,0 +1,22 @@+import Image from "next/image";++export const AppleGlyph = ({ className }: { className?: string }) => (+ <svg+ aria-hidden="true"+ className={className}+ viewBox="0 0 24 24"+ fill="currentColor"+ >+ <path d="M18.71,19.5C17.88,20.74 17,21.95 15.66,21.97C14.32,22 13.89,21.18 12.37,21.18C10.84,21.18 10.37,21.95 9.1,22C7.79,22.05 6.8,20.68 5.96,19.47C4.25,17 2.94,12.45 4.7,9.39C5.57,7.87 7.13,6.91 8.82,6.88C10.1,6.86 11.32,7.75 12.11,7.75C12.89,7.75 14.37,6.68 15.92,6.84C16.57,6.87 18.39,7.1 19.56,8.82C19.47,8.88 17.39,10.1 17.41,12.63C17.44,15.65 20.06,16.66 20.09,16.67C20.06,16.74 19.67,18.11 18.71,19.5M13,3.5C13.73,2.67 14.94,2.04 15.94,2C16.07,3.17 15.6,4.35 14.9,5.19C14.21,6.04 13.07,6.7 11.95,6.61C11.8,5.46 12.36,4.26 13,3.5Z" />+ </svg>+);++export const WindowsLogo = ({ size = 16 }: { size?: number }) => (+ <Image+ src="/logos/os/windows.svg"+ alt=""+ width={size}+ height={size}+ style={{ width: size, height: size }}+ />+);diff --git a/apps/web/components/pages/HomeTwo/index.tsx b/apps/web/components/pages/HomeTwo/index.tsxnew file mode 100644index 000000000..186e3acc4--- /dev/null+++ b/apps/web/components/pages/HomeTwo/index.tsx@@ -0,0 +1,60 @@+import { HomePageSchema } from "@/components/pages/HomePage/HomePageSchema";+import { Agents } from "@/components/pages/HomeTwo/Agents";+import { DeepDives } from "@/components/pages/HomeTwo/DeepDives";+import { Faq } from "@/components/pages/HomeTwo/Faq";+import { Features } from "@/components/pages/HomeTwo/Features";+import { FinalCta } from "@/components/pages/HomeTwo/FinalCta";+import { htMono, htSans, htSerif } from "@/components/pages/HomeTwo/fonts";+import { Hero } from "@/components/pages/HomeTwo/Hero";+import { LoomBridge } from "@/components/pages/HomeTwo/LoomBridge";+import { ModeWalkthrough } from "@/components/pages/HomeTwo/ModeWalkthrough";+import { Ownership } from "@/components/pages/HomeTwo/Ownership";+import { Platforms } from "@/components/pages/HomeTwo/Platforms";+import { Pricing } from "@/components/pages/HomeTwo/Pricing";+import { Testimonials } from "@/components/pages/HomeTwo/Testimonials";+import { BAND, CREAM, grainBg, SHELL } from "@/components/pages/HomeTwo/theme";+import { Workflow } from "@/components/pages/HomeTwo/Workflow";++const CARD_RADIUS = "rounded-[24px]";++export function HomeTwoPage() {+ // No overflow clipping anywhere on the card: it would trap the walkthrough's+ // sticky card. The corners are cut on the card and on the band that paints+ // over them instead.+ return (+ <div+ className={`${htSans.className} ${htSans.variable} ${htSerif.variable} ${htMono.variable} text-[#111111]`}+ style={grainBg(SHELL)}+ >+ <HomePageSchema />+ <div className="px-2.5 pb-2.5 pt-[68px] sm:px-4 sm:pb-4 lg:pt-[76px]">+ <div+ className={`${CARD_RADIUS} shadow-[0_0_0_1px_rgba(17,17,17,0.045)]`}+ style={grainBg(CREAM)}+ >+ {/* Band one: the hero flows straight into the pinned walkthrough so+ the gradient card already peeks into the first viewport. It+ carries the card's top corners because it paints over them. */}+ <div+ className={`${CARD_RADIUS} rounded-b-[28px]`}+ style={grainBg(BAND)}+ >+ <Hero />+ <ModeWalkthrough />+ </div>+ <Workflow />+ <DeepDives />+ <Features />+ <Ownership />+ <Platforms />+ <Agents />+ <Testimonials />+ <Pricing />+ <Faq />+ <LoomBridge />+ <FinalCta />+ </div>+ </div>+ </div>+ );+}diff --git a/apps/web/components/pages/HomeTwo/metadata.ts b/apps/web/components/pages/HomeTwo/metadata.tsnew file mode 100644index 000000000..f020ef864--- /dev/null+++ b/apps/web/components/pages/HomeTwo/metadata.ts@@ -0,0 +1,9 @@+import { buildMarketingMetadata } from "@/lib/og/url";++export const homePageMetadata = buildMarketingMetadata({+ title: "Cap | The open source screen recorder",+ description:+ "Record, edit, and share beautiful screen recordings. Instant links, studio-grade editing, and screenshots in one open source app.",+ path: "/",+ ogTitle: "One app for every way you capture your screen",+});diff --git a/apps/web/components/pages/HomeTwo/scenes/AgentScene.tsx b/apps/web/components/pages/HomeTwo/scenes/AgentScene.tsxnew file mode 100644index 000000000..230d4b414--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/AgentScene.tsx@@ -0,0 +1,460 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { Check } from "lucide-react";+import { useRef } from "react";+import { CapShareWindow } from "../demo/CapShareWindow";+import { RecordingToolbar } from "../demo/CapSurfaces";+import { CapLogoMark } from "../demo/capIcons";+import { ContentWindow } from "../demo/MacDesktop";+import { MONO } from "../theme";+import { SCENE_META } from "./catalog";+import {+ clockText,+ easeInOut,+ Fit,+ noop,+ type SceneModule,+ type SceneProps,+ STAGE,+ Stage,+ span,+ typed,+ useCursor,+ useSceneClock,+ useSceneState,+ useVideo,+ type Way,+} from "./engine";++const CHAPTERS = SCENE_META.agent.chapters;++const PROMPT =+ "Record a 20 second repro of the checkout bug and send me the link";+const PLAN =+ "I'll pick the screen, record it in Instant Mode, upload it, and read back the summary.";+const DONE = "Done. The repro is live with a transcript and summary.";+const SUMMARY = "Summary: the cart total resets after a promo code is applied.";++const PROMPT_START = 250;+const PROMPT_CPS = 36;+const PLAN_AT = 2300;+const TOOL1 = { start: 2700, done: 3400 };+const RECORD = { start: 3900, end: 8900 };+const TOOL2 = { start: 3600, done: 9000 };+const TOOL3 = { start: 9400, done: 10600 };+const TOOL4 = { start: 10900, done: 12000 };+const FINAL_AT = 12200;+const LINK_AT = 12500;+const SHARE_AT = 10650;+const COMMENT_AT = 13800;+const RECORD_SECONDS = 20;++type ToolStatus = "idle" | "running" | "done";++const toolStatus = (+ t: number,+ tool: { start: number; done: number },+): ToolStatus => (t < tool.start ? "idle" : t < tool.done ? "running" : "done");++const uiAt = (t: number) => ({+ plan: t >= PLAN_AT,+ tool1: toolStatus(t, TOOL1),+ tool2: toolStatus(t, TOOL2),+ tool3: toolStatus(t, TOOL3),+ tool4: toolStatus(t, TOOL4),+ recording: t >= RECORD.start && t < RECORD.end,+ final: t >= FINAL_AT,+ link: t >= LINK_AT,+ toolbar: t >= RECORD.start - 200 && t < RECORD.end + 100,+ share: t >= SHARE_AT,+ comment: t >= COMMENT_AT,+});++const recordSeconds = (t: number) =>+ Math.min(+ RECORD_SECONDS,+ Math.floor(span(t, RECORD.start, RECORD.end) * RECORD_SECONDS),+ );++const POS = {+ content: { left: 60, top: 40, width: 560, height: 380 },+ toolbar: { left: (680 - 296) / 2, top: 428 },+ share: { left: 80, top: 24, width: 520, height: 440 },+};++const PATH: Way[] = [+ { t: 0, x: 620, y: 440 },+ { t: 17000, x: 620, y: 440 },+];++const AGENT_CSS = `+ @keyframes ht-agent-spin {+ to { transform: rotate(360deg); }+ }+ @keyframes ht-agent-blink {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0; }+ }+ @keyframes ht-agent-pulse {+ 0%, 100% { opacity: 1; }+ 50% { opacity: 0.35; }+ }+`;++const Status = ({ status }: { status: ToolStatus }) => (+ <span className="relative mt-[3px] grid size-4 shrink-0 place-items-center">+ <span+ className={classNames(+ "absolute inset-0 rounded-full border-2 border-[rgba(255,255,255,0.18)] border-t-[#8FC1F7] transition-opacity duration-200",+ status === "running" ? "opacity-100" : "opacity-0",+ )}+ style={{ animation: "ht-agent-spin 0.9s linear infinite" }}+ />+ <span+ className={classNames(+ "absolute inset-0 grid place-items-center rounded-full bg-[#8FDCBB] text-[#0b2a1f] transition-[opacity,transform] duration-300",+ status === "done" ? "scale-100 opacity-100" : "scale-50 opacity-0",+ )}+ >+ <Check className="size-2.5" strokeWidth={3.5} />+ </span>+ <span+ className={classNames(+ "absolute inset-[5px] rounded-full bg-[rgba(255,255,255,0.18)] transition-opacity duration-200",+ status === "idle" ? "opacity-100" : "opacity-0",+ )}+ />+ </span>+);++const Tokens = ({ text }: { text: string }) => {+ const parts = text.split(" ");+ const seen = new Map<string, number>();+ return parts.map((token, i) => {+ const n = seen.get(token) ?? 0;+ seen.set(token, n + 1);+ return (+ <span key={`${token}#${n}`}>+ <span className="whitespace-nowrap">{token}</span>+ {i < parts.length - 1 ? " " : ""}+ </span>+ );+ });+};++const Tool = ({+ status,+ command,+ via = "$",+ children,+}: {+ status: ToolStatus;+ command: string;+ via?: string;+ children?: React.ReactNode;+}) => (+ <div+ className={classNames(+ "transition-[opacity,transform] duration-[420ms] ease-out",+ status === "idle"+ ? "translate-y-2 opacity-0"+ : "translate-y-0 opacity-100",+ )}+ >+ <div className="flex items-start gap-2.5">+ <Status status={status} />+ <p+ className={classNames(+ MONO,+ "min-w-0 flex-1 text-[12.5px] leading-[1.6] text-[#F8FAFC]",+ )}+ >+ <span className="text-[rgba(255,255,255,0.45)]">{via} </span>+ <Tokens text={command} />+ </p>+ </div>+ <div+ className={classNames(+ MONO,+ "flex items-start gap-2 pl-[26px] text-[12px] leading-[1.6] text-[rgba(255,255,255,0.55)] transition-opacity duration-300",+ )}+ style={{ opacity: status === "idle" ? 0 : 1 }}+ >+ <span className="shrink-0">⎿</span>+ <div className="min-w-0 flex-1">{children}</div>+ </div>+ </div>+);++const Json = ({ children }: { children: React.ReactNode }) => (+ <span className="text-[rgba(255,255,255,0.7)]">{children}</span>+);+const Key = ({ children }: { children: React.ReactNode }) => (+ <span className="text-[#8FC1F7]">{children}</span>+);+const Str = ({ children }: { children: React.ReactNode }) => (+ <span className="text-[#8FDCBB]">{children}</span>+);+const Num = ({ children }: { children: React.ReactNode }) => (+ <span className="text-[#F5BE85]">{children}</span>+);++const Message = ({+ show,+ children,+}: {+ show: boolean;+ children: React.ReactNode;+}) => (+ <div+ className={classNames(+ "flex items-start gap-2.5 transition-[opacity,transform] duration-[420ms] ease-out",+ show ? "translate-y-0 opacity-100" : "translate-y-2 opacity-0",+ )}+ >+ <span className="mt-[5px] size-2.5 shrink-0 rounded-[3px] bg-[#B9A5F2]" />+ <div className="min-w-0 flex-1">{children}</div>+ </div>+);++export const AgentScene = (props: SceneProps) => {+ const promptRef = useRef<HTMLSpanElement | null>(null);+ const clockRef = useRef<HTMLSpanElement | null>(null);+ const timerRef = useRef<HTMLSpanElement | null>(null);+ const layerRef = useRef<HTMLDivElement | null>(null);+ const scrollRef = useRef<HTMLDivElement | null>(null);+ const shareVideoRef = useRef<HTMLVideoElement | null>(null);+ const [ui, setUi] = useSceneState(uiAt(0));+ const cursor = useCursor(layerRef);+ useVideo(props.playing && ui.share, shareVideoRef);++ useSceneClock({+ ...props,+ chapters: CHAPTERS,+ tick: (t, seek) => {+ setUi(uiAt(t));+ if (promptRef.current) {+ promptRef.current.textContent = typed(+ PROMPT,+ t,+ PROMPT_START,+ PROMPT_CPS,+ );+ }+ const seconds = recordSeconds(t);+ if (clockRef.current) {+ clockRef.current.textContent =+ t < RECORD.start+ ? "Starting"+ : t < RECORD.end+ ? `Recording ${clockText(seconds * 1000)}`+ : `Recorded ${clockText(RECORD_SECONDS * 1000)}`;+ }+ if (timerRef.current) {+ timerRef.current.textContent = clockText(seconds * 1000);+ }+ if (scrollRef.current) {+ scrollRef.current.style.transform = `translateY(${+ -120 * easeInOut(span(t, RECORD.start + 800, RECORD.end - 600))+ }px)`;+ }+ cursor.tick(PATH, t, seek);+ },+ });++ return (+ <div className="grid gap-4 lg:grid-cols-[1.05fr_1fr] lg:gap-6">+ <style>{AGENT_CSS}</style>+ <div className="flex min-h-[420px] flex-col rounded-[18px] bg-[rgba(255,255,255,0.03)] p-5 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.08)] lg:p-6">+ <div className="flex items-center gap-2 border-b border-white/10 pb-4">+ <span className="size-2 rounded-full bg-[#FF5F57]" />+ <span className="size-2 rounded-full bg-[#FEBC2E]" />+ <span className="size-2 rounded-full bg-[#28C840]" />+ <span+ className={classNames(+ MONO,+ "ml-3 text-[11px] uppercase tracking-[0.05em] text-[rgba(255,255,255,0.45)]",+ )}+ >+ agent session · ~/checkout+ </span>+ </div>++ <div className="flex flex-1 flex-col gap-4 pt-5">+ <div className="flex items-start gap-2.5">+ <span+ className={classNames(MONO, "mt-px text-[13px] text-[#8FC1F7]")}+ >+ ›+ </span>+ <p className="text-[14.5px] leading-[1.55] text-[#F8FAFC]">+ <span ref={promptRef} />+ <span+ className="ml-0.5 inline-block h-[15px] w-[7px] translate-y-[2px] bg-[#F8FAFC]"+ style={{+ animation: "ht-agent-blink 1s steps(1) infinite",+ opacity: ui.plan ? 0 : 1,+ }}+ />+ </p>+ </div>++ <Message show={ui.plan}>+ <p className="text-[14px] leading-[1.55] text-[rgba(255,255,255,0.82)]">+ {PLAN}+ </p>+ </Message>++ <div className="flex flex-col gap-3">+ <Tool status={ui.tool1} command="cap targets --json">+ <Json>+ {"{"} <Key>"screens"</Key>: [{"{"} <Key>"id"</Key>: <Num>1</Num>+ , <Key>"name"</Key>: <Str>"Built-in Retina Display"</Str> {"}"}]{" "}+ {"}"}+ </Json>+ </Tool>+ <Tool+ status={ui.tool2}+ command="cap record start --screen 1 --mode instant --duration 20 --json"+ >+ <span className="block">+ <Json>+ {"{"}+ <Key>"type"</Key>:<Str>"started"</Str>+ {"}"}+ </Json>+ </span>+ <span className="flex items-center gap-2">+ <span+ className={classNames(+ "size-2 rounded-full transition-colors duration-300",+ ui.recording+ ? "bg-[#ff4766]"+ : "bg-[rgba(255,255,255,0.35)]",+ )}+ style={+ ui.recording+ ? {+ animation: "ht-agent-pulse 1.2s ease-in-out infinite",+ }+ : undefined+ }+ />+ <span ref={clockRef} className="tabular-nums text-[#F8FAFC]" />+ </span>+ <span+ className="block transition-opacity duration-300"+ style={{ opacity: ui.tool2 === "done" ? 1 : 0 }}+ >+ <Json>+ {"{"}+ <Key>"type"</Key>:<Str>"stopped"</Str>,+ <Key>"recordingMetaExists"</Key>:<Num>true</Num>+ {"}"}+ </Json>+ </span>+ </Tool>+ <Tool+ status={ui.tool3}+ command={+ 'cap upload ./recording.cap --export --name "Checkout bug repro" --json'+ }+ >+ <Json>+ {"{"} <Key>"url"</Key>: <Str>"https://cap.so/s/x7f2k9"</Str>{" "}+ {"}"}+ </Json>+ </Tool>+ <Tool+ status={ui.tool4}+ via="mcp"+ command="caps_wait, caps_context x7f2k9"+ >+ <span className="text-[rgba(255,255,255,0.7)]">{SUMMARY}</span>+ </Tool>+ </div>++ <Message show={ui.final}>+ <p className="text-[14px] leading-[1.55] text-[rgba(255,255,255,0.82)]">+ {DONE}+ </p>+ <a+ href="https://cap.so/s/x7f2k9"+ tabIndex={-1}+ className={classNames(+ "mt-3 flex items-center gap-3 rounded-[12px] bg-white p-2.5 pr-4 text-[#111111] transition-[opacity,transform] duration-[480ms] ease-[cubic-bezier(0.16,1,0.3,1)]",+ ui.link+ ? "translate-y-0 scale-100 opacity-100"+ : "translate-y-2 scale-[0.97] opacity-0",+ )}+ >+ <span className="grid size-9 shrink-0 place-items-center rounded-[9px] bg-[#E4F0FB]">+ <CapLogoMark className="size-5" />+ </span>+ <span className="min-w-0 flex-1 leading-tight">+ <span className="block truncate text-[13.5px] font-medium">+ Checkout bug repro+ </span>+ <span className="block text-[12px] text-[rgba(17,17,17,0.55)]">+ cap.so/s/x7f2k9 · 0:20 · AI summary ready+ </span>+ </span>+ </a>+ </Message>+ </div>+ </div>++ <div className="flex flex-col justify-center">+ <Fit w={STAGE.w} h={STAGE.h} className="mx-auto">+ <Stage+ wallpaper="/backgrounds/santorini.webp"+ recording={ui.recording}+ layerRef={layerRef}+ >+ <div+ className="absolute"+ style={{ left: POS.content.left, top: POS.content.top }}+ >+ <ContentWindow+ width={POS.content.width}+ height={POS.content.height}+ scrollRef={scrollRef}+ />+ </div>+ <div className="absolute z-10" style={POS.share}>+ <CapShareWindow+ visible={ui.share}+ width={POS.share.width}+ height={POS.share.height}+ commentVisible={ui.comment}+ videoRef={shareVideoRef}+ title="Checkout bug repro"+ url="cap.so/s/x7f2k9"+ duration="0:20"+ />+ </div>+ <div className="absolute z-20" style={POS.toolbar}>+ <RecordingToolbar+ visible={ui.toolbar}+ paused={false}+ timerRef={timerRef}+ onStop={noop}+ onTogglePause={noop}+ onRestart={noop}+ onMiss={noop}+ />+ </div>+ {cursor.Cursor}+ </Stage>+ </Fit>+ </div>+ </div>+ );+};++export const AGENT: SceneModule = {+ Scene: AgentScene,+ chapters: CHAPTERS,+ poster: SCENE_META.agent.poster,+};diff --git a/apps/web/components/pages/HomeTwo/scenes/AiScene.tsx b/apps/web/components/pages/HomeTwo/scenes/AiScene.tsxnew file mode 100644index 000000000..207ee4c5a--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/AiScene.tsx@@ -0,0 +1,594 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { Search, Sparkles } from "lucide-react";+import { type RefObject, useRef } from "react";+import { CapLogoMark, CapPlay } from "../demo/capIcons";+import { TrafficLights } from "../demo/chrome";+import { useVideoAttrs, VIDEO_POSTERS } from "../demo/media";+import { SCENE_META } from "./catalog";+import {+ restartAnimation,+ type SceneModule,+ type SceneProps,+ Stage,+ typed,+ useCursor,+ useSceneClock,+ useSceneState,+ useVideo,+ type Way,+} from "./engine";++const CHAPTERS = SCENE_META.share.chapters;++const WINDOW = { left: 30, top: 22, width: 620, height: 438 };+const VIDEO_SECONDS = 32;+const SPEED = 2.5;++const TITLE = "Dashboard walkthrough";+const QUERY = "live data";+const SUMMARY =+ "A tour of the new analytics dashboard: the live data cards, the revenue chart, and the team table, plus what ships next.";++const TRANSCRIPT = [+ { at: 0, t: "0:00", text: "So this is the new dashboard we're shipping." },+ { at: 4, t: "0:04", text: "Every card here pulls live data, watch this." },+ { at: 9, t: "0:09", text: "The chart updates as orders come in." },+ { at: 14, t: "0:14", text: "Down here is the team table, sortable now." },+ { at: 19, t: "0:19", text: "Next week we add filters and exports." },+ { at: 25, t: "0:25", text: "And that's really all there is to it." },+];++const CHAPTER_LIST = [+ { at: 0, t: "0:00", label: "What we shipped" },+ { at: 11, t: "0:11", label: "The new flow, end to end" },+ { at: 24, t: "0:24", label: "What's next" },+];++const PATH: Way[] = [+ { t: 0, x: 520, y: 330 },+ { t: 1200, at: "share-search" },+ { t: 1300, at: "share-search", click: true },+ { t: 2800, x: 610, y: 400 },+ { t: 7000, x: 610, y: 400 },+ { t: 12100, at: "chapter-1" },+ { t: 12200, at: "chapter-1", click: true },+ { t: 13000, at: "reaction-fire" },+ { t: 14000, at: "reaction-fire" },+ { t: 14150, at: "reaction-fire", click: true },+ { t: 15000, x: 560, y: 440 },+ { t: 20500, x: 560, y: 440 },+];++const SEEK_AT = 12200;+const SEEK_TO = CHAPTER_LIST[1]?.at ?? 11;+const QUERY_START = 1400;+const TITLE_START = 7200;+const SUMMARY_START = 8300;+const CHAPTER_REVEAL = [10500, 10850, 11200];+const FIRE_AT = 14150;+const SUMMARY_TAB = 7000;+const COMMENTS_TAB = 14000;++const videoSecondsAt = (t: number) => {+ const raw = (t / 1000) * SPEED;+ const offset = t >= SEEK_AT ? SEEK_TO - (SEEK_AT / 1000) * SPEED : 0;+ return (((raw + offset) % VIDEO_SECONDS) + VIDEO_SECONDS) % VIDEO_SECONDS;+};++const uiAt = (t: number) => {+ const seconds = videoSecondsAt(t);+ const queryDone = t >= QUERY_START + (QUERY.length / 12) * 1000 + 300;+ return {+ tab:+ t < SUMMARY_TAB+ ? "transcript"+ : t < COMMENTS_TAB+ ? "summary"+ : "comments",+ activeLine: TRANSCRIPT.reduce(+ (acc, line, i) => (seconds >= line.at ? i : acc),+ 0,+ ),+ matched: t < SUMMARY_TAB && queryDone,+ chaptersShown: CHAPTER_REVEAL.filter((at) => t >= at).length,+ activeChapter: CHAPTER_LIST.reduce(+ (acc, chapter, i) => (seconds >= chapter.at ? i : acc),+ 0,+ ),+ fire: t >= FIRE_AT,+ comment: t >= 14500,+ reply: t >= 16000,+ };+};++const Tab = ({ label, active }: { label: string; active: boolean }) => (+ <span+ className={classNames(+ "relative flex h-9 flex-1 items-center justify-center text-[12px] font-medium transition-colors duration-200",+ active ? "text-[#111111]" : "text-[rgba(17,17,17,0.45)]",+ )}+ >+ {label}+ <span+ className={classNames(+ "absolute inset-x-3 bottom-0 h-[2px] rounded-full bg-[#111111] transition-opacity duration-200",+ active ? "opacity-100" : "opacity-0",+ )}+ />+ </span>+);++const Avatar = ({+ initial,+ gradient,+}: {+ initial: string;+ gradient: string;+}) => (+ <span+ className="mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full text-[10px] font-semibold text-white"+ style={{ background: gradient }}+ >+ {initial}+ </span>+);++const Comment = ({+ show,+ name,+ stamp,+ text,+ initial,+ gradient,+ indent,+}: {+ show: boolean;+ name: string;+ stamp: string;+ text: string;+ initial: string;+ gradient: string;+ indent?: boolean;+}) => (+ <div+ className={classNames(+ "flex items-start gap-2.5 transition-[opacity,transform] duration-[420ms] ease-out",+ show ? "translate-y-0 opacity-100" : "translate-y-2 opacity-0",+ indent && "pl-8",+ )}+ >+ <Avatar initial={initial} gradient={gradient} />+ <div className="min-w-0 flex-1 rounded-xl bg-[#F4F6F9] px-3 py-2">+ <p className="text-[11.5px] font-medium text-[#111111]">+ {name}+ <span className="ml-1.5 font-normal text-[rgba(17,17,17,0.4)]">+ {stamp}+ </span>+ </p>+ <p className="text-[12.5px] leading-snug text-[rgba(17,17,17,0.75)]">+ {text}+ </p>+ </div>+ </div>+);++const SharePage = ({+ ui,+ videoRef,+ progressRef,+ timeRef,+ titleRef,+ queryRef,+ summaryRef,+ popRef,+}: {+ ui: ReturnType<typeof uiAt>;+ videoRef: RefObject<HTMLVideoElement | null>;+ progressRef: RefObject<HTMLSpanElement | null>;+ timeRef: RefObject<HTMLSpanElement | null>;+ titleRef: RefObject<HTMLSpanElement | null>;+ queryRef: RefObject<HTMLSpanElement | null>;+ summaryRef: RefObject<HTMLSpanElement | null>;+ popRef: RefObject<HTMLSpanElement | null>;+}) => {+ const screenVideo = useVideoAttrs(VIDEO_POSTERS.screen);+ return (+ <div+ className="flex h-full w-full flex-col overflow-hidden rounded-[10px]"+ style={{+ background: "#ffffff",+ border: "1px solid rgba(0,0,0,0.1)",+ boxShadow: "0 28px 80px rgba(0,0,0,0.28), 0 4px 18px rgba(0,0,0,0.1)",+ }}+ >+ <div+ className="flex h-10 shrink-0 items-center gap-3 border-b px-3.5"+ style={{ background: "#f6f7f9", borderColor: "rgba(0,0,0,0.07)" }}+ >+ <TrafficLights />+ <div className="flex min-w-0 flex-1 justify-center">+ <span+ className="flex h-6 w-[52%] items-center justify-center rounded-md text-[11px]"+ style={{+ background: "rgba(17,17,17,0.05)",+ color: "rgba(17,17,17,0.6)",+ }}+ >+ cap.link/dashboard-walkthrough+ </span>+ </div>+ <span className="w-12" />+ </div>++ <div className="flex min-h-0 flex-1 gap-3.5 p-4">+ <div className="flex min-w-0 flex-1 flex-col">+ <div className="flex items-center gap-2.5 pb-3">+ <CapLogoMark className="size-7" />+ <div className="min-w-0 flex-1 leading-tight">+ <p className="truncate text-[14px] font-semibold text-[#111111]">+ <span ref={titleRef}>{TITLE}</span>+ <span+ className={classNames(+ "ml-1 inline-block h-[13px] w-[1.5px] translate-y-[2px] bg-[#111111]",+ ui.tab === "summary" ? "opacity-70" : "opacity-0",+ )}+ />+ </p>+ <p className="text-[11.5px] text-[rgba(17,17,17,0.5)]">+ Richie · just now · 0:32+ </p>+ </div>+ <span+ className="flex h-8 items-center rounded-lg px-3.5 text-[12.5px] font-medium text-white"+ style={{ background: "linear-gradient(180deg,#3b82f6,#2563eb)" }}+ >+ Share+ </span>+ </div>++ <div className="relative overflow-hidden rounded-xl bg-black">+ <video+ ref={videoRef}+ className="aspect-[16/9] w-full object-cover"+ src="/illustrations/homepage-animation.mp4"+ muted+ loop+ playsInline+ {...screenVideo}+ />+ <div+ className="absolute inset-x-0 bottom-0 flex items-center gap-3 px-4 pb-2.5 pt-8 text-white"+ style={{+ background:+ "linear-gradient(to top, rgba(0,0,0,0.65), rgba(0,0,0,0))",+ }}+ >+ <CapPlay className="h-3 w-auto" />+ <div className="relative h-1 flex-1 rounded-full bg-white/25">+ {ui.chaptersShown > 0+ ? CHAPTER_LIST.map((chapter, i) => (+ <span+ key={chapter.t}+ className="absolute inset-y-0 w-[2px] bg-black/40"+ style={{+ left: `${(chapter.at / VIDEO_SECONDS) * 100}%`,+ opacity: i === 0 || i >= ui.chaptersShown ? 0 : 1,+ }}+ />+ ))+ : null}+ <span+ ref={progressRef}+ className="absolute inset-y-0 left-0 w-0 rounded-full bg-white"+ />+ <span+ className={classNames(+ "absolute -top-[3px] size-[10px] -translate-x-1/2 rounded-full border-2 border-white transition-opacity duration-300",+ ui.comment ? "opacity-100" : "opacity-0",+ )}+ style={{+ left: `${(12 / VIDEO_SECONDS) * 100}%`,+ background: "linear-gradient(135deg,#7B5FD0,#B9A5F2)",+ }}+ />+ </div>+ <span+ ref={timeRef}+ className="text-[11px] tabular-nums text-white/90"+ >+ 0:00 / 0:32+ </span>+ </div>+ </div>++ <div className="flex items-center gap-2 pt-3">+ {[+ { emoji: "👍", count: 1, anchor: "reaction-up", lit: false },+ {+ emoji: "🔥",+ count: ui.fire ? 3 : 2,+ anchor: "reaction-fire",+ lit: ui.fire,+ },+ { emoji: "❤️", count: 1, anchor: "reaction-heart", lit: false },+ ].map((reaction) => (+ <span+ key={reaction.emoji}+ data-scene-anchor={reaction.anchor}+ className={classNames(+ "relative flex h-7 items-center gap-1 rounded-full border px-2.5 text-[12px] transition-colors duration-150",+ reaction.lit+ ? "border-[#5eb1ef] bg-[#e6f4fe]"+ : "border-[rgba(0,0,0,0.08)]",+ )}+ style={{ color: "rgba(17,17,17,0.7)" }}+ >+ {reaction.emoji}+ <span className="text-[11px] tabular-nums text-[rgba(17,17,17,0.45)]">+ {reaction.count}+ </span>+ {reaction.anchor === "reaction-fire" ? (+ <span+ ref={popRef}+ className="pointer-events-none absolute left-1.5 top-0 text-[16px] opacity-0"+ >+ 🔥+ </span>+ ) : null}+ </span>+ ))}+ <span className="flex-1" />+ <span className="text-[11.5px] text-[rgba(17,17,17,0.45)]">+ 3 views+ </span>+ </div>+ </div>++ <div+ className="flex w-[240px] shrink-0 flex-col overflow-hidden rounded-xl border"+ style={{ borderColor: "rgba(0,0,0,0.08)" }}+ >+ <div+ className="flex shrink-0 border-b px-1"+ style={{ borderColor: "rgba(0,0,0,0.07)" }}+ >+ <Tab label="Comments" active={ui.tab === "comments"} />+ <Tab label="Summary" active={ui.tab === "summary"} />+ <Tab label="Transcript" active={ui.tab === "transcript"} />+ </div>++ <div className="relative min-h-0 flex-1">+ <div+ className={classNames(+ "absolute inset-0 flex flex-col gap-2 p-2.5 transition-opacity duration-300",+ ui.tab === "transcript" ? "opacity-100" : "opacity-0",+ )}+ >+ <div+ data-scene-anchor="share-search"+ className="flex h-8 items-center gap-2 rounded-lg border px-2.5"+ style={{ borderColor: "#e0e0e0", background: "#f9f9f9" }}+ >+ <Search className="size-3.5 shrink-0 text-[#838383]" />+ <span className="text-[11.5px] text-[#202020]">+ <span ref={queryRef} />+ <span className="text-[#838383]">+ {ui.tab === "transcript" && ui.matched+ ? ""+ : "Search this recording"}+ </span>+ </span>+ </div>+ <div className="flex flex-col gap-0.5">+ {TRANSCRIPT.map((line, i) => {+ const active = i === ui.activeLine;+ const hit = ui.matched && i === 1;+ const dim = ui.matched && !hit;+ return (+ <div+ key={line.t}+ className="flex items-start gap-2 rounded-lg px-2 py-1.5 transition-[background-color,opacity] duration-300"+ style={{+ background: hit+ ? "#FFF3C4"+ : active+ ? "#e6f4fe"+ : "transparent",+ opacity: dim ? 0.35 : 1,+ }}+ >+ <span+ className="w-7 shrink-0 pt-px text-[10.5px] tabular-nums"+ style={{ color: active || hit ? "#0d74ce" : "#838383" }}+ >+ {line.t}+ </span>+ <p+ className="text-[12px] leading-snug"+ style={{ color: active || hit ? "#202020" : "#646464" }}+ >+ {line.text}+ </p>+ </div>+ );+ })}+ </div>+ </div>++ <div+ className={classNames(+ "absolute inset-0 flex flex-col gap-3 p-3 transition-opacity duration-300",+ ui.tab === "summary" ? "opacity-100" : "opacity-0",+ )}+ >+ <div>+ <div className="flex items-center gap-1.5">+ <p className="text-[11px] font-semibold uppercase tracking-[0.04em] text-[rgba(17,17,17,0.5)]">+ Summary+ </p>+ <span className="flex items-center gap-1 rounded-full bg-[#EFE7FD] px-1.5 py-[2px] text-[9.5px] font-medium text-[#7B5FD0]">+ <Sparkles className="size-2.5" />+ Cap AI+ </span>+ </div>+ <p className="mt-1.5 min-h-[62px] text-[12px] leading-[1.45] text-[#202020]">+ <span ref={summaryRef} />+ </p>+ </div>+ <div>+ <p className="text-[11px] font-semibold uppercase tracking-[0.04em] text-[rgba(17,17,17,0.5)]">+ Chapters+ </p>+ <div className="mt-1.5 flex flex-col gap-0.5">+ {CHAPTER_LIST.map((chapter, i) => (+ <div+ key={chapter.t}+ data-scene-anchor={`chapter-${i}`}+ className="flex items-center gap-2 rounded-lg px-2 py-1.5 transition-[opacity,transform,background-color] duration-[380ms] ease-out"+ style={{+ opacity: i < ui.chaptersShown ? 1 : 0,+ transform:+ i < ui.chaptersShown ? "none" : "translateY(6px)",+ background:+ i === ui.activeChapter && ui.chaptersShown > 0+ ? "#f0f0f0"+ : "transparent",+ }}+ >+ <span+ className="text-[10.5px] tabular-nums"+ style={{+ color: i === ui.activeChapter ? "#0d74ce" : "#838383",+ }}+ >+ {chapter.t}+ </span>+ <span className="text-[12px] font-medium text-[#202020]">+ {chapter.label}+ </span>+ </div>+ ))}+ </div>+ </div>+ </div>++ <div+ className={classNames(+ "absolute inset-0 flex flex-col gap-2.5 p-3 transition-opacity duration-300",+ ui.tab === "comments" ? "opacity-100" : "opacity-0",+ )}+ >+ <Comment+ show={ui.comment}+ name="Sofia"+ stamp="at 0:12"+ text="Perfect, shipping this today 🔥"+ initial="S"+ gradient="linear-gradient(135deg,#7B5FD0,#B9A5F2)"+ />+ <Comment+ show={ui.reply}+ name="Richie"+ stamp="just now"+ text="Filters land next week, I'll record a follow up."+ initial="R"+ gradient="linear-gradient(135deg,#3D77C2,#8FC1F7)"+ indent+ />+ <div+ className={classNames(+ "mt-auto flex h-8 items-center rounded-lg border px-2.5 text-[11.5px] text-[#838383] transition-opacity duration-300",+ ui.comment ? "opacity-100" : "opacity-0",+ )}+ style={{ borderColor: "#e0e0e0" }}+ >+ Leave a comment+ </div>+ </div>+ </div>+ </div>+ </div>+ </div>+ );+};++export const AiScene = (props: SceneProps) => {+ const layerRef = useRef<HTMLDivElement | null>(null);+ const videoRef = useRef<HTMLVideoElement | null>(null);+ const progressRef = useRef<HTMLSpanElement | null>(null);+ const timeRef = useRef<HTMLSpanElement | null>(null);+ const titleRef = useRef<HTMLSpanElement | null>(null);+ const queryRef = useRef<HTMLSpanElement | null>(null);+ const summaryRef = useRef<HTMLSpanElement | null>(null);+ const popRef = useRef<HTMLSpanElement | null>(null);+ const popAtRef = useRef(-1);+ const [ui, setUi] = useSceneState(uiAt(0));+ const cursor = useCursor(layerRef);+ useVideo(props.playing, videoRef);++ useSceneClock({+ ...props,+ chapters: CHAPTERS,+ tick: (t, seek) => {+ setUi(uiAt(t));+ const seconds = videoSecondsAt(t);+ if (progressRef.current) {+ progressRef.current.style.width = `${(seconds / VIDEO_SECONDS) * 100}%`;+ }+ if (timeRef.current) {+ timeRef.current.textContent = `0:${String(Math.floor(seconds)).padStart(+ 2,+ "0",+ )} / 0:32`;+ }+ if (queryRef.current) {+ queryRef.current.textContent =+ t >= QUERY_START && t < SUMMARY_TAB+ ? typed(QUERY, t, QUERY_START, 12)+ : "";+ }+ if (titleRef.current) {+ titleRef.current.textContent =+ t >= SUMMARY_TAB && t < COMMENTS_TAB+ ? typed(TITLE, t, TITLE_START, 20)+ : TITLE;+ }+ if (summaryRef.current) {+ summaryRef.current.textContent =+ t >= COMMENTS_TAB ? SUMMARY : typed(SUMMARY, t, SUMMARY_START, 58);+ }+ if (seek) popAtRef.current = t - 1;+ if (popAtRef.current < FIRE_AT && t >= FIRE_AT) {+ restartAnimation(popRef.current, "ht-scene-pop 700ms ease-out");+ }+ popAtRef.current = t;+ cursor.tick(PATH, t, seek);+ },+ });++ return (+ <Stage wallpaper="/backgrounds/rome.webp" layerRef={layerRef}>+ <div className="absolute" style={WINDOW}>+ <SharePage+ ui={ui}+ videoRef={videoRef}+ progressRef={progressRef}+ timeRef={timeRef}+ titleRef={titleRef}+ queryRef={queryRef}+ summaryRef={summaryRef}+ popRef={popRef}+ />+ </div>+ {cursor.Cursor}+ </Stage>+ );+};++export const AI: SceneModule = {+ Scene: AiScene,+ chapters: CHAPTERS,+ poster: SCENE_META.share.poster,+};diff --git a/apps/web/components/pages/HomeTwo/scenes/InstantScene.tsx b/apps/web/components/pages/HomeTwo/scenes/InstantScene.tsxnew file mode 100644index 000000000..67a779195--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/InstantScene.tsx@@ -0,0 +1,250 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { useRef } from "react";+import { CapShareWindow } from "../demo/CapShareWindow";+import { LinkNotification, RecordingToolbar } from "../demo/CapSurfaces";+import { CapLogoMark } from "../demo/capIcons";+import { ContentWindow } from "../demo/MacDesktop";+import { SCENE_META } from "./catalog";+import {+ clockText,+ easeInOut,+ noop,+ Reveal,+ type SceneModule,+ type SceneProps,+ Stage,+ span,+ useCursor,+ useSceneClock,+ useSceneState,+ useVideo,+ type Way,+} from "./engine";++const CHAPTERS = SCENE_META.instant.chapters;++const POS = {+ content: { left: 24, top: 22, width: 430, height: 330 },+ toolbar: { left: 192, top: 424 },+ notification: { left: 322, top: 10 },+ share: { left: 100, top: 12, width: 480, height: 464 },+ popover: { left: 264, top: 108, width: 300 },+};++const PATH: Way[] = [+ { t: 0, x: 250, y: 200 },+ { t: 2200, x: 330, y: 250 },+ { t: 3900, x: 390, y: 180 },+ { t: 5800, at: "toolbar-stop" },+ { t: 5900, at: "toolbar-stop", click: true },+ { t: 6100, at: "toolbar-stop" },+ { t: 7300, at: "notification" },+ { t: 7400, at: "notification", click: true },+ { t: 8800, x: 620, y: 400 },+ { t: 10300, x: 620, y: 400 },+ { t: 11400, at: "share-button" },+ { t: 11600, at: "share-button" },+ { t: 11700, at: "share-button", click: true },+ { t: 12900, at: "share-password" },+ { t: 13000, at: "share-password", click: true },+ { t: 14200, at: "share-public" },+ { t: 14300, at: "share-public", click: true },+ { t: 15400, at: "share-copy" },+ { t: 15500, at: "share-copy", click: true },+ { t: 16400, at: "share-copy", dx: 40, dy: 30 },+ { t: 17600, at: "share-copy", dx: 40, dy: 30 },+];++const RECORD_START = 200;+const RECORD_STOP = 5950;++const uiAt = (t: number) => ({+ toolbar: t >= 100 && t < RECORD_STOP,+ recording: t >= RECORD_START && t < RECORD_STOP,+ notification: t >= 6150 && t < 8200,+ share: t >= 7450,+ comment: t >= 9500,+ popover: t >= 11750,+ password: t >= 13000,+ publicLink: t < 14300,+ copied: t >= 15500,+});++const Switch = ({ on }: { on: boolean }) => (+ <span+ className="relative inline-flex h-5 w-[34px] shrink-0 rounded-full transition-colors duration-200"+ style={{ background: on ? "#0090ff" : "#e0e0e0" }}+ >+ <span+ className="absolute top-[2px] size-4 rounded-full bg-white shadow-sm transition-[left] duration-200"+ style={{ left: on ? 16 : 2 }}+ />+ </span>+);++const SharePopover = ({+ show,+ password,+ publicLink,+ copied,+}: {+ show: boolean;+ password: boolean;+ publicLink: boolean;+ copied: boolean;+}) => (+ <Reveal+ show={show}+ from="translateY(-6px) scale(0.97)"+ className="z-40"+ style={{+ left: POS.popover.left,+ top: POS.popover.top,+ width: POS.popover.width,+ transformOrigin: "top right",+ }}+ >+ <div+ className="flex flex-col gap-2 rounded-[14px] p-3"+ style={{+ background: "#fcfcfc",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 24px 60px -18px rgba(16,24,40,0.45)",+ }}+ >+ <div+ className="flex h-[38px] items-center gap-2 rounded-lg px-2.5"+ style={{+ background: "#e6f4fe",+ border: "1px solid rgba(0,144,255,0.2)",+ }}+ >+ <CapLogoMark className="size-4 shrink-0" />+ <span+ className="min-w-0 flex-1 truncate text-[12px]"+ style={{ color: "#0d74ce" }}+ >+ cap.link/dashboard-walkthrough+ </span>+ <span+ data-scene-anchor="share-copy"+ className={classNames(+ "flex h-6 items-center rounded-md px-2 text-[11px] font-medium text-white transition-colors duration-200",+ copied ? "bg-[#0f7a58]" : "bg-[#0090ff]",+ )}+ >+ {copied ? "Copied" : "Copy"}+ </span>+ </div>+ <div+ className="flex h-[38px] items-center gap-2.5 rounded-lg px-2.5"+ style={{ background: "#f9f9f9", border: "1px solid #d9d9d9" }}+ >+ <span className="flex-1 text-[12px] font-medium text-[#202020]">+ Password protection+ </span>+ <span data-scene-anchor="share-password">+ <Switch on={password} />+ </span>+ </div>+ <div+ className="flex h-[38px] items-center gap-2.5 rounded-lg px-2.5"+ style={{ background: "#f9f9f9", border: "1px solid #d9d9d9" }}+ >+ <span className="min-w-0 flex-1">+ <span className="block text-[12px] font-medium text-[#202020]">+ {publicLink ? "Anyone with the link" : "Only your team"}+ </span>+ </span>+ <span data-scene-anchor="share-public">+ <Switch on={publicLink} />+ </span>+ </div>+ </div>+ </Reveal>+);++export const InstantScene = (props: SceneProps) => {+ const layerRef = useRef<HTMLDivElement | null>(null);+ const scrollRef = useRef<HTMLDivElement | null>(null);+ const timerRef = useRef<HTMLSpanElement | null>(null);+ const shareVideoRef = useRef<HTMLVideoElement | null>(null);+ const [ui, setUi] = useSceneState(uiAt(0));+ const cursor = useCursor(layerRef);+ useVideo(props.playing && ui.share, shareVideoRef);++ useSceneClock({+ ...props,+ chapters: CHAPTERS,+ tick: (t, seek) => {+ setUi(uiAt(t));+ if (timerRef.current) {+ timerRef.current.textContent =+ t >= RECORD_START ? clockText(t - RECORD_START) : "0:00";+ }+ if (scrollRef.current) {+ scrollRef.current.style.transform = `translateY(${+ -110 * easeInOut(span(t, 1300, 4200))+ }px)`;+ }+ cursor.tick(PATH, t, seek);+ },+ });++ return (+ <Stage+ wallpaper="/backgrounds/nyc.webp"+ recording={ui.recording}+ layerRef={layerRef}+ >+ <div+ className="absolute"+ style={{ left: POS.content.left, top: POS.content.top }}+ >+ <ContentWindow+ width={POS.content.width}+ height={POS.content.height}+ scrollRef={scrollRef}+ />+ </div>+ <div className="absolute z-10" style={POS.share}>+ <CapShareWindow+ visible={ui.share}+ width={POS.share.width}+ height={POS.share.height}+ commentVisible={ui.comment}+ videoRef={shareVideoRef}+ />+ </div>+ <SharePopover+ show={ui.popover}+ password={ui.password}+ publicLink={ui.publicLink}+ copied={ui.copied}+ />+ <div className="absolute z-20" style={POS.toolbar}>+ <RecordingToolbar+ visible={ui.toolbar}+ paused={false}+ timerRef={timerRef}+ onStop={noop}+ onTogglePause={noop}+ onRestart={noop}+ onMiss={noop}+ />+ </div>+ <div className="absolute z-30" style={POS.notification}>+ <LinkNotification visible={ui.notification} onOpen={noop} />+ </div>+ {cursor.Cursor}+ </Stage>+ );+};++export const INSTANT: SceneModule = {+ Scene: InstantScene,+ chapters: CHAPTERS,+ poster: SCENE_META.instant.poster,+};diff --git a/apps/web/components/pages/HomeTwo/scenes/ScreenshotScene.tsx b/apps/web/components/pages/HomeTwo/scenes/ScreenshotScene.tsxnew file mode 100644index 000000000..ee8784f27--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/ScreenshotScene.tsx@@ -0,0 +1,310 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { Check, MoveUpRight, Square, Type } from "lucide-react";+import { useRef } from "react";+import { CapLogoMark } from "../demo/capIcons";+import { ContentWindow } from "../demo/MacDesktop";+import { SCENE_META } from "./catalog";+import {+ easeOut,+ lerp,+ Reveal,+ type SceneModule,+ type SceneProps,+ Stage,+ span,+ useCursor,+ useSceneClock,+ useSceneState,+ type Way,+} from "./engine";++const CHAPTERS = SCENE_META.screenshot.chapters;++const WALLPAPER = "/backgrounds/london.webp";++const POS = {+ content: { left: 120, top: 44, width: 440, height: 330 },+ result: { left: 130, top: 60, width: 420, height: 300 },+ notification: { left: 322, top: 10 },+ toolbar: { left: 130 + (420 - 196) / 2, top: 374 },+};++const MARQUEE = {+ x0: 112,+ y0: 36,+ x1: 568,+ y1: 382,+};++const DRAG = { start: 300, end: 1600 };+const ARROW = { from: { x: 300, y: 150 }, to: { x: 410, y: 215 } };+const DRAW = { start: 7100, end: 8100 };++const PATH: Way[] = [+ { t: 0, x: MARQUEE.x0, y: MARQUEE.y0 },+ { t: DRAG.start, x: MARQUEE.x0, y: MARQUEE.y0 },+ { t: DRAG.end, x: MARQUEE.x1, y: MARQUEE.y1 },+ { t: 1700, x: MARQUEE.x1, y: MARQUEE.y1 },+ { t: 2800, x: 610, y: 430 },+ { t: 4600, x: 610, y: 430 },+ { t: 5700, at: "annotate-arrow" },+ { t: 6000, at: "annotate-arrow" },+ { t: 6200, at: "annotate-arrow", click: true },+ { t: 7000, x: ARROW.from.x, y: ARROW.from.y },+ { t: DRAW.start, x: ARROW.from.x, y: ARROW.from.y },+ { t: DRAW.end, x: ARROW.to.x, y: ARROW.to.y },+ { t: 8300, x: ARROW.to.x, y: ARROW.to.y },+ { t: 9200, at: "annotate-done" },+ { t: 9300, at: "annotate-done", click: true },+ { t: 10200, x: 600, y: 440 },+ { t: 12000, x: 600, y: 440 },+];++const uiAt = (t: number) => ({+ marquee: t >= DRAG.start && t < 1750,+ flash: t >= 1700 && t < 2050,+ result: t >= 2050,+ captured: t >= 2900 && t < 6000,+ toolbar: t >= 6050,+ arrowTool: t >= 6200,+ drawing: t >= DRAW.start,+ copied: t >= 9400,+});++const Notification = ({ show, title }: { show: boolean; title: string }) => (+ <Reveal+ show={show}+ from="translateX(24px)"+ className="z-40"+ style={POS.notification}+ >+ <div+ className="flex w-[344px] items-center gap-3 rounded-2xl p-3"+ style={{+ background: "rgba(245,245,245,0.92)",+ border: "1px solid rgba(0,0,0,0.06)",+ boxShadow: "0 12px 32px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.1)",+ }}+ >+ <CapLogoMark className="size-9 shrink-0" />+ <span className="min-w-0 flex-1 leading-tight">+ <p+ className="truncate text-[13px] font-semibold"+ style={{ color: "#1d1d1f" }}+ >+ {title}+ </p>+ <p className="truncate text-[13px]" style={{ color: "#48484a" }}>+ Copied to clipboard+ </p>+ </span>+ <span className="self-start text-[11px]" style={{ color: "#86868b" }}>+ now+ </span>+ </div>+ </Reveal>+);++export const ScreenshotScene = (props: SceneProps) => {+ const layerRef = useRef<HTMLDivElement | null>(null);+ const scrollRef = useRef<HTMLDivElement | null>(null);+ const resultScrollRef = useRef<HTMLDivElement | null>(null);+ const marqueeRef = useRef<HTMLDivElement | null>(null);+ const sizeRef = useRef<HTMLSpanElement | null>(null);+ const arrowRef = useRef<SVGSVGElement | null>(null);+ const [ui, setUi] = useSceneState(uiAt(0));+ const cursor = useCursor(layerRef);++ useSceneClock({+ ...props,+ chapters: CHAPTERS,+ tick: (t, seek) => {+ setUi(uiAt(t));+ const drag = easeOut(span(t, DRAG.start, DRAG.end));+ const width = lerp(0, MARQUEE.x1 - MARQUEE.x0, drag);+ const height = lerp(0, MARQUEE.y1 - MARQUEE.y0, drag);+ if (marqueeRef.current) {+ marqueeRef.current.style.width = `${width}px`;+ marqueeRef.current.style.height = `${height}px`;+ }+ if (sizeRef.current) {+ sizeRef.current.textContent = `${Math.round(width)} × ${Math.round(+ height,+ )}`;+ }+ if (arrowRef.current) {+ const draw = span(t, DRAW.start, DRAW.end);+ const x = lerp(ARROW.from.x, ARROW.to.x, draw);+ const y = lerp(ARROW.from.y, ARROW.to.y, draw);+ const line = arrowRef.current.querySelector("line");+ const head = arrowRef.current.querySelector("polygon");+ line?.setAttribute("x2", String(x));+ line?.setAttribute("y2", String(y));+ const angle =+ (Math.atan2(y - ARROW.from.y, x - ARROW.from.x) * 180) / Math.PI;+ head?.setAttribute(+ "transform",+ `translate(${x} ${y}) rotate(${angle})`,+ );+ arrowRef.current.style.opacity = t >= DRAW.start ? "1" : "0";+ }+ cursor.tick(PATH, t, seek);+ },+ });++ return (+ <Stage wallpaper={WALLPAPER} layerRef={layerRef}>+ <div+ className="absolute transition-opacity duration-500"+ style={{+ left: POS.content.left,+ top: POS.content.top,+ opacity: ui.result ? 0.35 : 1,+ }}+ >+ <ContentWindow+ width={POS.content.width}+ height={POS.content.height}+ scrollRef={scrollRef}+ />+ </div>++ <div+ ref={marqueeRef}+ className="pointer-events-none absolute z-20 rounded-[4px] transition-opacity duration-150"+ style={{+ left: MARQUEE.x0,+ top: MARQUEE.y0,+ width: 0,+ height: 0,+ opacity: ui.marquee ? 1 : 0,+ border: "1.5px dashed rgba(255,255,255,0.95)",+ boxShadow:+ "0 0 0 1px rgba(0,144,255,0.9), 0 0 0 9999px rgba(9,12,20,0.42)",+ }}+ >+ <span+ ref={sizeRef}+ className="absolute -bottom-7 right-0 rounded-md px-2 py-1 text-[11px] font-medium tabular-nums text-white"+ style={{ background: "rgba(32,32,32,0.9)" }}+ />+ </div>++ <div+ className="pointer-events-none absolute inset-0 z-30 bg-white transition-opacity duration-300"+ style={{ opacity: ui.flash ? 0.8 : 0 }}+ />++ <Reveal+ show={ui.result}+ from="translateY(10px) scale(0.92)"+ className="z-20"+ style={{+ left: POS.result.left,+ top: POS.result.top,+ width: POS.result.width,+ height: POS.result.height,+ }}+ >+ <div+ className="relative h-full w-full overflow-hidden rounded-[12px]"+ style={{+ backgroundImage: `url(${WALLPAPER})`,+ backgroundSize: "cover",+ backgroundPosition: "center",+ boxShadow:+ "0 30px 70px -20px rgba(16,24,40,0.55), 0 0 0 1px rgba(0,0,0,0.08)",+ }}+ >+ <div className="absolute" style={{ left: 50, top: 36 }}>+ <ContentWindow+ width={319}+ height={228}+ scrollRef={resultScrollRef}+ />+ </div>+ <svg+ ref={arrowRef}+ aria-hidden="true"+ className="absolute inset-0 opacity-0"+ viewBox={`${POS.result.left} ${POS.result.top} ${POS.result.width} ${POS.result.height}`}+ width={POS.result.width}+ height={POS.result.height}+ >+ <line+ x1={ARROW.from.x}+ y1={ARROW.from.y}+ x2={ARROW.from.x}+ y2={ARROW.from.y}+ stroke="#ff4766"+ strokeWidth="4"+ strokeLinecap="round"+ />+ <polygon+ points="0,0 -14,-7 -14,7"+ fill="#ff4766"+ transform={`translate(${ARROW.from.x} ${ARROW.from.y})`}+ />+ </svg>+ </div>+ </Reveal>++ <Reveal+ show={ui.toolbar}+ from="translateY(10px)"+ className="z-30"+ style={POS.toolbar}+ >+ <div+ className="flex items-center gap-1 rounded-full border p-1.5"+ style={{+ background: "#fcfcfc",+ borderColor: "#e0e0e0",+ boxShadow: "0 8px 24px -8px rgba(16,24,40,0.28)",+ }}+ >+ {[+ { Icon: MoveUpRight, anchor: "annotate-arrow" },+ { Icon: Square, anchor: "annotate-square" },+ { Icon: Type, anchor: "annotate-text" },+ ].map(({ Icon, anchor }, i) => (+ <span+ key={anchor}+ data-scene-anchor={anchor}+ className={classNames(+ "grid size-8 place-items-center rounded-full transition-colors duration-200",+ i === 0 && ui.arrowTool+ ? "bg-[#e6f4fe] text-[#0d74ce]"+ : "text-[#646464]",+ )}+ >+ <Icon className="size-3.5" />+ </span>+ ))}+ <span className="mx-1 h-4 w-px" style={{ background: "#e0e0e0" }} />+ <span+ data-scene-anchor="annotate-done"+ className={classNames(+ "grid size-8 place-items-center rounded-full transition-colors duration-200",+ ui.copied ? "bg-[#dff3e9] text-[#0f7a58]" : "text-[#0f7a58]",+ )}+ >+ <Check className="size-4" strokeWidth={3} />+ </span>+ </div>+ </Reveal>++ <Notification show={ui.captured} title="Screenshot captured" />+ <Notification show={ui.copied} title="Annotation saved" />+ {cursor.Cursor}+ </Stage>+ );+};++export const SCREENSHOT: SceneModule = {+ Scene: ScreenshotScene,+ chapters: CHAPTERS,+ poster: SCENE_META.screenshot.poster,+};diff --git a/apps/web/components/pages/HomeTwo/scenes/StudioScene.tsx b/apps/web/components/pages/HomeTwo/scenes/StudioScene.tsxnew file mode 100644index 000000000..c2aecb9c5--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/StudioScene.tsx@@ -0,0 +1,303 @@+"use client";++import { useRef } from "react";+import { CapEditorWindow } from "../demo/CapEditorWindow";+import { CapRecorderWindow } from "../demo/CapRecorderWindow";+import {+ CameraWindow,+ RecordingToolbar,+ TargetOverlayPanel,+} from "../demo/CapSurfaces";+import { CapCursor } from "../demo/capIcons";+import { ContentWindow } from "../demo/MacDesktop";+import { SCENE_META } from "./catalog";+import {+ clockText,+ easeInOut,+ lerp,+ noop,+ quantize,+ restartAnimation,+ type SceneModule,+ type SceneProps,+ Stage,+ span,+ useCursor,+ useSceneClock,+ useSceneState,+ useVideo,+ type Way,+} from "./engine";++const CHAPTERS = SCENE_META.studio.chapters;++const EDITOR = { left: 30, top: 44, width: 620, height: 389 };+const EDITOR_SCALE = EDITOR.width / 1275;+const SLIDER_PX = 384 * EDITOR_SCALE;++const POS = {+ content: { left: 250, top: 26, width: 400, height: 300 },+ recorder: { left: 36, top: 50 },+ camera: { left: 420, top: 236 },+ overlay: { left: 132, top: 130 },+ toolbar: { left: 192, top: 428 },+};++const PATH: Way[] = [+ { t: 0, x: 330, y: 300 },+ { t: 1200, at: "row-camera" },+ { t: 1300, at: "row-camera", click: true },+ { t: 2900, at: "target-display" },+ { t: 3000, at: "target-display", click: true },+ { t: 4600, at: "overlay-start" },+ { t: 4700, at: "overlay-start", click: true },+ { t: 5800, x: 590, y: 170 },+ { t: 6400, x: 590, y: 170 },+ { t: 7200, at: "swatch-2" },+ { t: 7300, at: "swatch-2", click: true },+ { t: 8300, at: "editor-padding" },+ { t: 8400, at: "editor-padding" },+ { t: 9400, at: "editor-padding", dx: SLIDER_PX * 0.4 },+ { t: 10100, at: "editor-radius" },+ { t: 10200, at: "editor-radius" },+ { t: 11000, at: "editor-radius", dx: SLIDER_PX * 0.45 },+ { t: 12300, at: "editor-zoom-generate" },+ { t: 13400, at: "editor-zoom-generate" },+ { t: 13500, at: "editor-zoom-generate", click: true },+ { t: 14300, x: 210, y: 452 },+ { t: 20000, x: 210, y: 452 },+];++const RECORD_START = 5000;+const STUDIO_END = 6400;+const EDITOR_OPEN = 6500;+const PLAYBACK_LOOP = 9000;+const ZOOM_GENERATE = 13500;+const ZOOM_IN = { start: 13800, end: 15200 };+const ZOOM_OUT = { start: 17800, end: 19000 };+const CANVAS_CLICK = 15500;++const uiAt = (t: number) => ({+ recorder: t < 4750,+ cameraOn: t >= 1300,+ camera: t >= 1400 && t < STUDIO_END,+ display: t >= 3000,+ overlay: t >= 3200 && t < 4700,+ toolbar: t >= RECORD_START && t < STUDIO_END,+ recording: t >= RECORD_START && t < STUDIO_END,+ content: t < STUDIO_END,+ editor: t >= EDITOR_OPEN,+ bgIndex: t >= 7300 ? 2 : 0,+ padding: quantize(0.35 + 0.4 * span(t, 8400, 9400)),+ radius: quantize(0.5 + 0.45 * span(t, 10200, 11000)),+ zoomSegments: t >= ZOOM_GENERATE,+});++const zoomAt = (t: number) =>+ 1 ++ 0.75 * easeInOut(span(t, ZOOM_IN.start, ZOOM_IN.end)) -+ 0.75 * easeInOut(span(t, ZOOM_OUT.start, ZOOM_OUT.end));++export const StudioScene = (props: SceneProps) => {+ const layerRef = useRef<HTMLDivElement | null>(null);+ const scrollRef = useRef<HTMLDivElement | null>(null);+ const timerRef = useRef<HTMLSpanElement | null>(null);+ const cameraRef = useRef<HTMLVideoElement | null>(null);+ const editorVideoRef = useRef<HTMLVideoElement | null>(null);+ const editorCamRef = useRef<HTMLVideoElement | null>(null);+ const playheadRef = useRef<HTMLDivElement | null>(null);+ const timeRef = useRef<HTMLSpanElement | null>(null);+ const canvasRef = useRef<HTMLDivElement | null>(null);+ const canvasCursorRef = useRef<HTMLDivElement | null>(null);+ const canvasRingRef = useRef<HTMLSpanElement | null>(null);+ const canvasClickRef = useRef(-1);+ const [ui, setUi] = useSceneState(uiAt(0));+ const cursor = useCursor(layerRef);++ useVideo(props.playing && ui.camera, cameraRef);+ useVideo(props.playing && ui.editor, editorVideoRef);+ useVideo(props.playing && ui.editor, editorCamRef);++ useSceneClock({+ ...props,+ chapters: CHAPTERS,+ tick: (t, seek) => {+ setUi(uiAt(t));+ if (timerRef.current) {+ timerRef.current.textContent =+ t >= RECORD_START ? clockText(t - RECORD_START) : "0:00";+ }+ if (scrollRef.current) {+ scrollRef.current.style.transform = `translateY(${+ -70 * easeInOut(span(t, 5300, 6300))+ }px)`;+ }+ if (t >= EDITOR_OPEN) {+ const f = ((t - EDITOR_OPEN) % PLAYBACK_LOOP) / PLAYBACK_LOOP;+ if (playheadRef.current) {+ playheadRef.current.style.left = `${128 + f * 0.78 * 1131}px`;+ }+ if (timeRef.current) {+ const seconds = f * 32;+ timeRef.current.textContent = `0:${String(+ Math.floor(seconds),+ ).padStart(2, "0")}.${String(+ Math.floor((seconds % 1) * 100),+ ).padStart(2, "0")}`;+ }+ }+ if (canvasRef.current) {+ canvasRef.current.style.transform = `scale(${zoomAt(t)})`;+ }+ if (canvasCursorRef.current) {+ const glide = easeInOut(span(t, ZOOM_IN.start, ZOOM_IN.end));+ const settle = easeInOut(span(t, 15800, 17000));+ canvasCursorRef.current.style.left = `${lerp(+ lerp(30, 61, glide),+ 52,+ settle,+ )}%`;+ canvasCursorRef.current.style.top = `${lerp(+ lerp(40, 45.5, glide),+ 58,+ settle,+ )}%`;+ }+ if (seek) canvasClickRef.current = t - 1;+ if (canvasClickRef.current < CANVAS_CLICK && t >= CANVAS_CLICK) {+ restartAnimation(+ canvasRingRef.current,+ "ht-scene-ripple 620ms ease-out",+ );+ }+ canvasClickRef.current = t;+ cursor.tick(PATH, t, seek);+ },+ });++ return (+ <Stage+ wallpaper="/backgrounds/monaco.webp"+ recording={ui.recording}+ layerRef={layerRef}+ >+ <div+ className="absolute transition-opacity duration-500"+ style={{+ left: POS.content.left,+ top: POS.content.top,+ opacity: ui.content ? 1 : 0,+ }}+ >+ <ContentWindow+ width={POS.content.width}+ height={POS.content.height}+ scrollRef={scrollRef}+ />+ </div>+ <div+ className="pointer-events-none absolute inset-0 z-20 rounded-[14px] transition-opacity duration-300"+ style={{+ opacity: ui.overlay ? 1 : 0,+ boxShadow:+ "inset 0 0 0 3px rgba(5,136,240,0.9), inset 0 0 80px rgba(5,136,240,0.18)",+ background: "rgba(17,24,39,0.10)",+ }}+ />+ <div className="absolute z-10" style={POS.recorder}>+ <CapRecorderWindow+ ui={{+ visible: ui.recorder,+ mode: "studio",+ displaySelected: ui.display,+ cameraOn: ui.cameraOn,+ }}+ onMode={noop}+ onSelectDisplay={noop}+ onToggleCamera={noop}+ onMiss={noop}+ />+ </div>+ <div className="absolute z-10" style={POS.camera}>+ <CameraWindow visible={ui.camera} videoRef={cameraRef} />+ </div>+ <div className="absolute z-30" style={POS.overlay}>+ <TargetOverlayPanel+ visible={ui.overlay}+ mode="studio"+ cameraOn={ui.cameraOn}+ onStart={noop}+ onClose={noop}+ />+ </div>+ <div className="absolute z-30" style={POS.toolbar}>+ <RecordingToolbar+ visible={ui.toolbar}+ paused={false}+ timerRef={timerRef}+ onStop={noop}+ onTogglePause={noop}+ onRestart={noop}+ onMiss={noop}+ />+ </div>+ <div+ className="absolute z-20"+ style={{ left: EDITOR.left, top: EDITOR.top }}+ >+ <CapEditorWindow+ ui={{+ visible: ui.editor,+ bgIndex: ui.bgIndex,+ playing: ui.editor,+ padding: ui.padding,+ radius: ui.radius,+ zoomSegments: ui.zoomSegments,+ }}+ width={EDITOR.width}+ height={EDITOR.height}+ videoRef={editorVideoRef}+ camVideoRef={editorCamRef}+ playheadRef={playheadRef}+ timeRef={timeRef}+ canvasRef={canvasRef}+ canvasChildren={+ <div+ ref={canvasCursorRef}+ className="absolute"+ style={{+ left: "30%",+ top: "40%",+ opacity: ui.zoomSegments ? 1 : 0,+ transition: "opacity 400ms ease",+ }}+ >+ <span+ ref={canvasRingRef}+ className="absolute -left-5 -top-5 size-10 rounded-full opacity-0"+ style={{ border: "3px solid rgba(0,144,255,0.9)" }}+ />+ <CapCursor+ className="h-9 w-auto"+ style={{+ color: "#202020",+ filter: "drop-shadow(0 2px 3px rgba(0,0,0,0.5))",+ }}+ />+ </div>+ }+ onSwatch={noop}+ onExport={noop}+ onTogglePlay={noop}+ />+ </div>+ {cursor.Cursor}+ </Stage>+ );+};++export const STUDIO: SceneModule = {+ Scene: StudioScene,+ chapters: CHAPTERS,+ poster: SCENE_META.studio.poster,+};diff --git a/apps/web/components/pages/HomeTwo/scenes/catalog.ts b/apps/web/components/pages/HomeTwo/scenes/catalog.tsnew file mode 100644index 000000000..057609a93--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/catalog.ts@@ -0,0 +1,35 @@+export type Chapter = { start: number; end: number; pose: number };++const chapterList = (+ ...spans: [duration: number, pose: number][]+): Chapter[] => {+ let cursor = 0;+ return spans.map(([duration, pose]) => {+ const start = cursor;+ cursor += duration;+ return { start, end: cursor, pose: start + pose };+ });+};++export const SCENE_META = {+ instant: {+ chapters: chapterList([6100, 4200], [5500, 4700], [6000, 5400]),+ poster: 10800,+ },+ studio: {+ chapters: chapterList([6400, 5800], [7000, 6300], [6600, 2200]),+ poster: 11800,+ },+ screenshot: {+ chapters: chapterList([6000, 4200], [6000, 4400]),+ poster: 4200,+ },+ share: {+ chapters: chapterList([7000, 6000], [7000, 6500], [6500, 5500]),+ poster: 13500,+ },+ agent: {+ chapters: chapterList([3600, 3000], [7000, 6800], [6400, 4200]),+ poster: 13800,+ },+};diff --git a/apps/web/components/pages/HomeTwo/scenes/engine.tsx b/apps/web/components/pages/HomeTwo/scenes/engine.tsxnew file mode 100644index 000000000..a24681688--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/engine.tsx@@ -0,0 +1,511 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import Image from "next/image";+import {+ type ComponentType,+ type ReactNode,+ type RefObject,+ useEffect,+ useLayoutEffect,+ useRef,+ useState,+} from "react";+import { MacCursor } from "../cursors";+import { MenuBar } from "../demo/MacDesktop";+import { SceneMediaProvider, useSceneMedia } from "../demo/media";+import { htGeist } from "../fonts";+import { usePageVisible } from "../visibility";+import type { Chapter } from "./catalog";++export const STAGE = { w: 680, h: 510, bar: 28 } as const;+export const LAYER = { w: STAGE.w, h: STAGE.h - STAGE.bar } as const;++export type { Chapter } from "./catalog";++export type SceneProps = {+ chapter: number;+ playing: boolean;+ onChapterEnd?: () => void;+ progressRef?: RefObject<HTMLSpanElement | null>;+ staticT?: number;+};++export type SceneModule = {+ Scene: ComponentType<SceneProps>;+ chapters: Chapter[];+ poster: number;+};++export const noop = () => {};++export const clamp01 = (v: number) => Math.min(1, Math.max(0, v));++export const easeInOut = (f: number) =>+ f < 0.5 ? 4 * f * f * f : 1 - (-2 * f + 2) ** 3 / 2;++export const easeOut = (f: number) => 1 - (1 - f) ** 3;++export const span = (t: number, from: number, to: number) =>+ clamp01((t - from) / (to - from));++export const lerp = (a: number, b: number, f: number) => a + (b - a) * f;++export const clockText = (ms: number) => {+ const s = Math.max(0, Math.floor(ms / 1000));+ return `${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;+};++export const typed = (text: string, t: number, from: number, cps = 28) =>+ text.slice(0, Math.max(0, Math.floor(((t - from) / 1000) * cps)));++export const useSceneState = <S,>(initial: S) => {+ const [state, setState] = useState(initial);+ const keyRef = useRef("");+ const set = useRef((next: S) => {+ const key = JSON.stringify(next);+ if (key === keyRef.current) return;+ keyRef.current = key;+ setState(next);+ }).current;+ return [state, set] as const;+};++export const useVideo = (+ playing: boolean,+ ref: RefObject<HTMLVideoElement | null>,+) => {+ const { still } = useSceneMedia();+ const pageVisible = usePageVisible();+ useEffect(() => {+ const video = ref.current;+ if (!video || still) return;+ if (playing && pageVisible) {+ video.play().catch(noop);+ return;+ }+ video.pause();+ const nudge = () => {+ if (video.currentTime === 0) video.currentTime = 0.1;+ };+ if (video.readyState >= 1) nudge();+ else video.addEventListener("loadedmetadata", nudge, { once: true });+ return () => video.removeEventListener("loadedmetadata", nudge);+ }, [playing, ref, still, pageVisible]);+};++export const LazyMount = ({+ w,+ h,+ rootMargin = "800px 0px",+ grow,+ className,+ children,+}: {+ w: number;+ h: number;+ rootMargin?: string;+ grow?: boolean;+ className?: string;+ children: ReactNode;+}) => {+ const boxRef = useRef<HTMLDivElement | null>(null);+ const [mounted, setMounted] = useState(false);++ useEffect(() => {+ const el = boxRef.current;+ if (!el || mounted) return;+ const io = new IntersectionObserver(+ ([entry]) => {+ if (entry?.isIntersecting) setMounted(true);+ },+ { rootMargin },+ );+ io.observe(el);+ return () => io.disconnect();+ }, [mounted, rootMargin]);++ return (+ <div+ ref={boxRef}+ className={classNames("w-full", className)}+ style={+ mounted+ ? undefined+ : { maxWidth: grow ? undefined : w, aspectRatio: `${w} / ${h}` }+ }+ >+ {mounted ? children : null}+ </div>+ );+};++export { useInView, useReducedMotion } from "../visibility";++type Tick = (t: number, seek: boolean) => void;++export const useSceneClock = ({+ chapters,+ chapter,+ playing,+ staticT,+ onChapterEnd,+ progressRef,+ tick,+}: SceneProps & { chapters: Chapter[]; tick: Tick }) => {+ const pageVisible = usePageVisible();+ const tRef = useRef(staticT ?? chapters[chapter]?.start ?? 0);+ const startedRef = useRef(false);+ const tickRef = useRef(tick);+ tickRef.current = tick;+ const endRef = useRef(onChapterEnd);+ endRef.current = onChapterEnd;++ useEffect(() => {+ if (staticT === undefined) return;+ tRef.current = staticT;+ tickRef.current(staticT, true);+ const settle = setTimeout(() => tickRef.current(staticT, true), 700);+ return () => clearTimeout(settle);+ }, [staticT]);++ useEffect(() => {+ if (staticT !== undefined) return;+ const current = chapters[chapter];+ if (!current) return;+ tRef.current = startedRef.current ? current.start : current.pose;+ tickRef.current(tRef.current, true);+ }, [chapter, chapters, staticT]);++ useEffect(() => {+ if (staticT !== undefined || !playing || !pageVisible) return;+ const current = chapters[chapter];+ if (!current) return;+ if (!startedRef.current) {+ startedRef.current = true;+ tRef.current = current.start;+ tickRef.current(current.start, true);+ }+ let raf = 0;+ let last = performance.now();+ const paint = (fraction: number) => {+ const bar = progressRef?.current;+ if (bar) bar.style.transform = `scaleX(${fraction})`;+ };+ const frame = (now: number) => {+ const dt = Math.min(48, now - last);+ last = now;+ const t = tRef.current + dt;+ if (t >= current.end) {+ tRef.current = current.end;+ tickRef.current(current.end, false);+ paint(1);+ endRef.current?.();+ return;+ }+ tRef.current = t;+ tickRef.current(t, false);+ paint((t - current.start) / (current.end - current.start));+ raf = requestAnimationFrame(frame);+ };+ raf = requestAnimationFrame(frame);+ return () => cancelAnimationFrame(raf);+ }, [playing, chapter, chapters, staticT, progressRef, pageVisible]);+};++export const restartAnimation = (el: HTMLElement | null, animation: string) => {+ if (!el) return;+ el.style.animation = "none";+ void el.offsetWidth;+ el.style.animation = animation;+};++export const quantize = (value: number, steps = 20) =>+ Math.round(value * steps) / steps;++export type Way = {+ t: number;+ x?: number;+ y?: number;+ at?: string;+ dx?: number;+ dy?: number;+ click?: boolean;+};++type Point = { x: number; y: number };++const anchorCenter = (root: HTMLElement, name: string): Point | null => {+ const el = root.querySelector<HTMLElement>(+ `[data-demo-anchor="${name}"], [data-scene-anchor="${name}"]`,+ );+ if (!el) return null;+ const rootRect = root.getBoundingClientRect();+ const scale = rootRect.width / LAYER.w || 1;+ const rect = el.getBoundingClientRect();+ return {+ x: (rect.left - rootRect.left + rect.width / 2) / scale,+ y: (rect.top - rootRect.top + rect.height / 2) / scale,+ };+};++export const useCursor = (root: RefObject<HTMLDivElement | null>) => {+ const elRef = useRef<HTMLDivElement | null>(null);+ const ringRef = useRef<HTMLSpanElement | null>(null);+ const prevRef = useRef(-1);+ const cache = useRef(new Map<string, { point: Point; settled: boolean }>());++ const resolve = (way: Way, settle = false): Point => {+ if (way.at) {+ let hit = cache.current.get(way.at);+ if ((!hit || (settle && !hit.settled)) && root.current) {+ const measured = anchorCenter(root.current, way.at);+ if (measured) {+ hit = { point: measured, settled: settle };+ cache.current.set(way.at, hit);+ }+ }+ if (hit) {+ return {+ x: hit.point.x + (way.dx ?? 0),+ y: hit.point.y + (way.dy ?? 0),+ };+ }+ }+ return { x: way.x ?? 0, y: way.y ?? 0 };+ };++ const positionAt = (path: Way[], t: number): Point => {+ const first = path[0];+ if (!first) return { x: 0, y: 0 };+ if (t <= first.t) return resolve(first);+ for (let i = 1; i < path.length; i++) {+ const a = path[i - 1];+ const b = path[i];+ if (!a || !b) break;+ if (t <= b.t) {+ const progress = span(t, a.t, b.t);+ const from = resolve(a);+ const to = resolve(b, progress > 0.5);+ const f = easeInOut(progress);+ return { x: lerp(from.x, to.x, f), y: lerp(from.y, to.y, f) };+ }+ }+ return resolve(path[path.length - 1] ?? first, true);+ };++ const tick = (path: Way[], t: number, seek: boolean) => {+ if (seek) {+ prevRef.current = t - 1;+ cache.current.clear();+ }+ const pos = positionAt(path, t);+ const el = elRef.current;+ if (el) el.style.transform = `translate3d(${pos.x}px, ${pos.y}px, 0)`;+ const clicked =+ !seek && path.some((w) => w.click && w.t > prevRef.current && w.t <= t);+ if (clicked)+ restartAnimation(ringRef.current, "ht-scene-ripple 520ms ease-out");+ prevRef.current = t;+ };++ const Cursor = (+ <div+ ref={elRef}+ className="pointer-events-none absolute left-0 top-0 z-[60] will-change-transform"+ >+ <span+ ref={ringRef}+ className="absolute -left-4 -top-4 size-8 rounded-full opacity-0"+ style={{ border: "2px solid rgba(0,144,255,0.9)" }}+ />+ <span+ className="absolute -left-[4px] -top-[3px] block"+ style={{ filter: "drop-shadow(0 1.5px 1.5px rgba(0,0,0,0.6))" }}+ >+ <MacCursor className="h-[27px] w-auto" />+ </span>+ </div>+ );++ return { tick, Cursor };+};++export const SCENE_CSS = `+ @keyframes ht-scene-ripple {+ 0% { transform: scale(0.35); opacity: 0.9; }+ 100% { transform: scale(1.6); opacity: 0; }+ }+ @keyframes ht-demo-mic {+ 0% { transform: translateX(-70%); }+ 15% { transform: translateX(-42%); }+ 30% { transform: translateX(-60%); }+ 45% { transform: translateX(-30%); }+ 60% { transform: translateX(-55%); }+ 75% { transform: translateX(-38%); }+ 100% { transform: translateX(-70%); }+ }+ .ht-demo-mic-meter { animation: ht-demo-mic 1.6s ease-in-out infinite; }+ @keyframes ht-scene-pop {+ 0% { transform: translateY(6px) scale(0.6); opacity: 0; }+ 60% { transform: translateY(-10px) scale(1.15); opacity: 1; }+ 100% { transform: translateY(-26px) scale(1); opacity: 0; }+ }+`;++export const Scaled = ({+ w,+ h,+ className,+ style,+ inert: isInert,+ grow,+ children,+}: {+ w: number;+ h: number;+ className?: string;+ style?: React.CSSProperties;+ inert?: boolean;+ grow?: boolean;+ children: ReactNode;+}) => {+ const boxRef = useRef<HTMLDivElement | null>(null);+ const [scale, setScale] = useState<number | null>(null);++ useLayoutEffect(() => {+ const box = boxRef.current;+ if (!box) return;+ const measure = () =>+ setScale(grow ? box.clientWidth / w : Math.min(1, box.clientWidth / w));+ measure();+ const ro = new ResizeObserver(measure);+ ro.observe(box);+ return () => ro.disconnect();+ }, [w, grow]);++ const s = scale ?? 1;+ return (+ <div+ ref={boxRef}+ aria-hidden="true"+ inert={isInert}+ className={classNames(+ "relative w-full select-none transition-opacity duration-500",+ scale === null ? "opacity-0" : "opacity-100",+ isInert && "pointer-events-none",+ className,+ )}+ style={{+ ...style,+ maxWidth: grow ? undefined : w,+ aspectRatio: `${w} / ${h}`,+ }}+ >+ <div+ className="absolute left-0 top-0"+ style={{+ width: w,+ height: h,+ transform: `scale(${s})`,+ transformOrigin: "top left",+ }}+ >+ {children}+ </div>+ </div>+ );+};++export const Fit = ({+ w,+ h,+ className,+ still,+ grow,+ children,+}: {+ w: number;+ h: number;+ className?: string;+ still?: boolean;+ grow?: boolean;+ children: ReactNode;+}) => (+ <SceneMediaProvider value={{ still: Boolean(still) }}>+ <Scaled+ w={w}+ h={h}+ inert+ grow={grow}+ className={classNames(htGeist.variable, className)}+ style={{+ fontFamily:+ "var(--font-ht-geist), 'Geist Sans', -apple-system, system-ui, sans-serif",+ fontWeight: 500,+ }}+ >+ {children}+ </Scaled>+ </SceneMediaProvider>+);++export const Stage = ({+ wallpaper,+ recording,+ layerRef,+ children,+}: {+ wallpaper: string;+ recording?: boolean;+ layerRef?: RefObject<HTMLDivElement | null>;+ children: ReactNode;+}) => (+ <div+ className="relative overflow-hidden rounded-[14px] bg-black"+ style={{ width: STAGE.w, height: STAGE.h }}+ >+ <style>{SCENE_CSS}</style>+ <Image+ src={wallpaper}+ alt=""+ fill+ sizes="680px"+ draggable={false}+ className="object-cover"+ />+ <MenuBar recording={Boolean(recording)} onSwitchOs={noop} />+ <div+ ref={layerRef}+ className="absolute left-0"+ style={{ top: STAGE.bar, width: LAYER.w, height: LAYER.h }}+ >+ {children}+ </div>+ </div>+);++export const Reveal = ({+ show,+ from = "translateY(8px) scale(0.98)",+ className,+ style,+ children,+}: {+ show: boolean;+ from?: string;+ className?: string;+ style?: React.CSSProperties;+ children: ReactNode;+}) => (+ <div+ className={classNames(+ "absolute transition-[opacity,transform] duration-[420ms] ease-[cubic-bezier(0.16,1,0.3,1)]",+ show ? "opacity-100" : "opacity-0",+ className,+ )}+ style={{ ...style, transform: show ? "none" : from }}+ >+ {children}+ </div>+);diff --git a/apps/web/components/pages/HomeTwo/scenes/index.ts b/apps/web/components/pages/HomeTwo/scenes/index.tsnew file mode 100644index 000000000..b319c2a1f--- /dev/null+++ b/apps/web/components/pages/HomeTwo/scenes/index.ts@@ -0,0 +1,39 @@+"use client";++import dynamic from "next/dynamic";+import { createElement } from "react";+import type { ModeKey } from "../theme";+import { SCENE_META } from "./catalog";+import type { SceneModule } from "./engine";++export const SCENES: Record<ModeKey, SceneModule> = {+ instant: {+ ...SCENE_META.instant,+ Scene: dynamic(() => import("./InstantScene").then((m) => m.InstantScene)),+ },+ studio: {+ ...SCENE_META.studio,+ Scene: dynamic(() => import("./StudioScene").then((m) => m.StudioScene)),+ },+ screenshot: {+ ...SCENE_META.screenshot,+ Scene: dynamic(() =>+ import("./ScreenshotScene").then((m) => m.ScreenshotScene),+ ),+ },+ share: {+ ...SCENE_META.share,+ Scene: dynamic(() => import("./AiScene").then((m) => m.AiScene)),+ },+};++export const AGENT: SceneModule = {+ ...SCENE_META.agent,+ Scene: dynamic(() => import("./AgentScene").then((m) => m.AgentScene), {+ loading: () =>+ createElement("div", { style: { aspectRatio: "1200 / 520" } }),+ }),+};++export type { SceneModule, SceneProps } from "./engine";+export { Fit, STAGE } from "./engine";diff --git a/apps/web/components/pages/HomeTwo/studio/StudioFeatures.tsx b/apps/web/components/pages/HomeTwo/studio/StudioFeatures.tsxnew file mode 100644index 000000000..b82431c15--- /dev/null+++ b/apps/web/components/pages/HomeTwo/studio/StudioFeatures.tsx@@ -0,0 +1,110 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { useRef } from "react";+import { Eyebrow } from "../Eyebrow";+import { Fit, LazyMount } from "../scenes/engine";+import {+ BAND,+ BODY_TEXT,+ grainBg,+ H_SECTION,+ MODE_THEME,+ meshStyle,+} from "../theme";+import { useInView, useReducedMotion } from "../visibility";+import { CARDS_A } from "./cardsA";+import { CARDS_B } from "./cardsB";+import { CANVAS, type StudioCard } from "./shared";++const ORDER = [+ "mask",+ "text",+ "scenes",+ "zoom",+ "captions",+ "three-d",+ "canvas",+ "grades",+ "clips",+];+const SPAN: Record<string, 1 | 2> = { mask: 2, scenes: 2, clips: 2 };+const ALL = [...CARDS_A, ...CARDS_B];+const CARDS = ORDER.flatMap((key) => {+ const card = ALL.find((item) => item.key === key);+ return card ? [{ ...card, span: SPAN[key] ?? 1 }] : [];+});++const Card = ({ card }: { card: StudioCard }) => {+ const ref = useRef<HTMLLIElement | null>(null);+ const inView = useInView(ref, "-5% 0px -5% 0px");+ const reduced = useReducedMotion();+ return (+ <li+ ref={ref}+ className={classNames(+ "flex flex-col rounded-[22px] p-3",+ card.span === 2 ? "lg:col-span-2" : undefined,+ )}+ style={grainBg(BAND)}+ >+ <div className="rounded-[16px] p-2" style={meshStyle(MODE_THEME.studio)}>+ <LazyMount+ w={CANVAS.w}+ h={CANVAS.h}+ grow={card.span === 2}+ className="mx-auto"+ >+ <Fit+ w={CANVAS.w}+ h={CANVAS.h}+ grow={card.span === 2}+ className="mx-auto"+ >+ <card.Visual playing={inView && !reduced} />+ </Fit>+ </LazyMount>+ </div>+ <div className="px-3 pb-3 pt-5">+ <h3 className="text-[19px] font-normal leading-[1.15] tracking-[-0.02em] text-[#111111]">+ {card.title}+ </h3>+ <p+ className={`${BODY_TEXT} mt-2 text-[14.5px] leading-[1.5] text-[rgba(17,17,17,0.72)]`}+ >+ {card.body}+ </p>+ </div>+ </li>+ );+};++export const StudioFeatures = () => (+ <section className="px-5 py-16 lg:py-24">+ <div className="mx-auto max-w-[1200px]">+ <div className="mx-auto flex max-w-[760px] flex-col items-center text-center">+ <Eyebrow accent={MODE_THEME.studio.accent}>+ Studio Mode · The editor+ </Eyebrow>+ <h2+ className={`${H_SECTION} mt-6 text-balance text-[clamp(38px,5vw,56px)]`}+ >+ Polish it before anyone sees it+ </h2>+ <p+ className={`${BODY_TEXT} mt-6 max-w-[620px] text-balance text-[16.5px] leading-[1.5] text-[rgba(17,17,17,0.78)] sm:text-[17.5px]`}+ >+ Studio Mode opens straight into an editor made for screen recordings.+ Blur what is private, switch scenes between screen and camera, add+ text and captions, grade the color, and export in 4K or as a link.+ </p>+ </div>++ <ul className="mt-14 grid gap-4 md:grid-cols-2 lg:grid-cols-3">+ {CARDS.map((card) => (+ <Card key={card.key} card={card} />+ ))}+ </ul>+ </div>+ </section>+);diff --git a/apps/web/components/pages/HomeTwo/studio/cardsA.tsx b/apps/web/components/pages/HomeTwo/studio/cardsA.tsxnew file mode 100644index 000000000..f0206bff8--- /dev/null+++ b/apps/web/components/pages/HomeTwo/studio/cardsA.tsx@@ -0,0 +1,831 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import { useRef } from "react";+import { ContentWindow } from "../demo/MacDesktop";+import { useVideoAttrs, VIDEO_POSTERS } from "../demo/media";+import {+ easeInOut,+ easeOut,+ lerp,+ restartAnimation,+ SCENE_CSS,+ span,+ typed,+ useCursor,+ useSceneState,+ useVideo,+ type Way,+} from "../scenes/engine";+import {+ CameraBubble,+ CanvasStage,+ Chip,+ RECORDED,+ RecordedWindow,+ type StudioCard,+ useLoop,+} from "./shared";++const MASK_DURATION = 8200;+const MASK = { x: RECORDED.left + 72, y: RECORDED.top + 112, w: 268, h: 52 };+const MASK_DRAG = { start: 600, end: 1700 };+const MASK_BLUR = 1900;+const MASK_PIXELATE = 3600;+const MASK_HIGHLIGHT = 5400;+const MASK_CONTROL = { x: MASK.x, y: MASK.y + MASK.h + 14 };+const MASK_MODES = ["Blur", "Pixelate", "Highlight"] as const;+const SEGMENT_W = 74;++const MASK_PATH: Way[] = [+ { t: 0, x: MASK.x - 36, y: MASK.y - 26 },+ { t: MASK_DRAG.start, x: MASK.x, y: MASK.y },+ { t: MASK_DRAG.end, x: MASK.x + MASK.w, y: MASK.y + MASK.h },+ { t: MASK_BLUR, x: MASK.x + MASK.w, y: MASK.y + MASK.h },+ { t: 3400, x: MASK_CONTROL.x + SEGMENT_W * 1.5, y: MASK_CONTROL.y + 14 },+ {+ t: MASK_PIXELATE,+ x: MASK_CONTROL.x + SEGMENT_W * 1.5,+ y: MASK_CONTROL.y + 14,+ click: true,+ },+ { t: 5200, x: MASK_CONTROL.x + SEGMENT_W * 2.5, y: MASK_CONTROL.y + 14 },+ {+ t: MASK_HIGHLIGHT,+ x: MASK_CONTROL.x + SEGMENT_W * 2.5,+ y: MASK_CONTROL.y + 14,+ click: true,+ },+ { t: 6600, x: MASK.x + MASK.w + 60, y: MASK.y + MASK.h + 90 },+ { t: MASK_DURATION, x: MASK.x + MASK.w + 60, y: MASK.y + MASK.h + 90 },+];++const PIXELS = Array.from({ length: 22 * 4 }, (_, i) => {+ const seed = Math.sin(i * 12.9898 + 4.1414) * 43758.5453;+ const v = seed - Math.floor(seed);+ const l = 62 + Math.floor(v * 30);+ return `hsl(216 22% ${l}%)`;+});++const maskUiAt = (t: number) => ({+ drawing: t >= MASK_DRAG.start && t < MASK_BLUR,+ mode:+ t >= MASK_HIGHLIGHT+ ? "Highlight"+ : t >= MASK_PIXELATE+ ? "Pixelate"+ : t >= MASK_BLUR+ ? "Blur"+ : null,+});++const BlurVisual = ({ playing }: { playing: boolean }) => {+ const rootRef = useRef<HTMLDivElement | null>(null);+ const boxRef = useRef<HTMLDivElement | null>(null);+ const [ui, setUi] = useSceneState(maskUiAt(0));+ const cursor = useCursor(rootRef);++ useLoop({+ duration: MASK_DURATION,+ playing,+ pose: 4400,+ tick: (t, seek) => {+ setUi(maskUiAt(t));+ const drag = easeOut(span(t, MASK_DRAG.start, MASK_DRAG.end));+ if (boxRef.current) {+ boxRef.current.style.width = `${lerp(0, MASK.w, drag)}px`;+ boxRef.current.style.height = `${lerp(0, MASK.h, drag)}px`;+ boxRef.current.style.opacity = t >= MASK_DRAG.start ? "1" : "0";+ }+ cursor.tick(MASK_PATH, t, seek);+ },+ });++ const applied = ui.mode !== null;+ const highlight = ui.mode === "Highlight";++ return (+ <div ref={rootRef} className="relative">+ <CanvasStage>+ <RecordedWindow />+ <CameraBubble playing={playing} />++ <div+ ref={boxRef}+ className="pointer-events-none absolute z-20 overflow-hidden rounded-[6px]"+ style={{+ left: MASK.x,+ top: MASK.y,+ width: 0,+ height: 0,+ opacity: 0,+ border: applied+ ? "2px solid #0090ff"+ : "2px dashed rgba(255,255,255,0.95)",+ boxShadow: highlight+ ? "0 0 0 9999px rgba(9,12,20,0.55)"+ : applied+ ? "0 0 0 1px rgba(255,255,255,0.7)"+ : "0 0 0 1px rgba(0,144,255,0.9), 0 0 0 9999px rgba(9,12,20,0.18)",+ transition: "box-shadow 420ms ease, border-color 200ms ease",+ }}+ >+ <div+ className="absolute inset-0 transition-opacity duration-300"+ style={{+ opacity: ui.mode === "Blur" ? 1 : 0,+ backdropFilter: "blur(9px) saturate(1.2)",+ WebkitBackdropFilter: "blur(9px) saturate(1.2)",+ background: "rgba(236,240,246,0.35)",+ }}+ />+ <div+ className="absolute inset-0 grid transition-opacity duration-300"+ style={{+ opacity: ui.mode === "Pixelate" ? 1 : 0,+ gridTemplateColumns: "repeat(22, 1fr)",+ gridTemplateRows: "repeat(4, 1fr)",+ }}+ >+ {PIXELS.map((color, i) => (+ <span key={`${i}-${color}`} style={{ background: color }} />+ ))}+ </div>+ </div>++ {[+ { left: MASK.x - 5, top: MASK.y - 5 },+ { left: MASK.x + MASK.w - 5, top: MASK.y - 5 },+ { left: MASK.x - 5, top: MASK.y + MASK.h - 5 },+ { left: MASK.x + MASK.w - 5, top: MASK.y + MASK.h - 5 },+ ].map((handle) => (+ <span+ key={`${handle.left}-${handle.top}`}+ className="pointer-events-none absolute z-30 size-[10px] rounded-full border-2 border-[#0090ff] bg-white transition-opacity duration-300"+ style={{ ...handle, opacity: applied ? 1 : 0 }}+ />+ ))}++ <div+ className="absolute z-30 flex rounded-lg p-1 transition-[opacity,transform] duration-300"+ style={{+ left: MASK_CONTROL.x,+ top: MASK_CONTROL.y,+ background: "#fcfcfc",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 10px 24px -12px rgba(16,24,40,0.5)",+ opacity: applied ? 1 : 0,+ transform: applied ? "translateY(0)" : "translateY(6px)",+ }}+ >+ {MASK_MODES.map((mode) => (+ <span+ key={mode}+ className={classNames(+ "flex h-7 items-center justify-center rounded-md text-[12px] font-medium transition-colors duration-200",+ ui.mode === mode+ ? "bg-[#111111] text-white"+ : "text-[rgba(17,17,17,0.6)]",+ )}+ style={{ width: SEGMENT_W }}+ >+ {mode}+ </span>+ ))}+ </div>+ {cursor.Cursor}+ </CanvasStage>+ </div>+ );+};++const TRACK = { top: 328, height: 36, left: 96, right: 584 } as const;++const TrackStrip = ({+ label,+ children,+ playhead,+}: {+ label: string;+ children: React.ReactNode;+ playhead: React.RefObject<HTMLDivElement | null>;+}) => (+ <div+ className="absolute inset-x-4 z-30 flex items-stretch gap-2"+ style={{ top: TRACK.top, height: TRACK.height }}+ >+ <span+ className="flex w-[72px] shrink-0 items-center justify-center rounded-lg text-[11px] font-medium text-white"+ style={{ background: "#4a4f5c", border: "1px solid #30343d" }}+ >+ {label}+ </span>+ <div+ className="relative flex-1 overflow-hidden rounded-lg"+ style={{ background: "rgba(252,252,252,0.55)" }}+ >+ {children}+ <div+ ref={playhead}+ className="pointer-events-none absolute inset-y-0 left-0 w-px"+ style={{ background: "rgb(226,64,64)" }}+ >+ <span+ className="absolute -left-[4.5px] -top-[1px] size-[10px] rounded-full"+ style={{ background: "rgb(226,64,64)" }}+ />+ </div>+ </div>+ </div>+);++const CameraPane = ({+ playing,+ style,+ className,+}: {+ playing: boolean;+ style?: React.CSSProperties;+ className?: string;+}) => {+ const ref = useRef<HTMLVideoElement | null>(null);+ const attrs = useVideoAttrs(VIDEO_POSTERS.webcam);+ useVideo(playing, ref);+ return (+ <div+ className={classNames("absolute overflow-hidden bg-[#111111]", className)}+ style={style}+ >+ <video+ ref={ref}+ className="h-full w-full object-cover"+ src="/videos/home-two/webcam.mp4"+ muted+ loop+ playsInline+ {...attrs}+ />+ </div>+ );+};++const SCENES_DURATION = 12000;+const SCENE_MODES = [+ { key: "default", label: "Default" },+ { key: "cameraOnly", label: "Camera only" },+ { key: "splitScreen", label: "Split screen" },+ { key: "floating", label: "Floating" },+] as const;+type SceneKey = (typeof SCENE_MODES)[number]["key"];+const SCENE_SLOT = SCENES_DURATION / SCENE_MODES.length;+const SCENE_SCREEN = { w: 360, h: 250 } as const;++const SCENE_LAYOUT: Record<+ SceneKey,+ {+ screen: {+ left: number;+ top: number;+ w: number;+ h: number;+ shift: number;+ scale: number;+ radius: number;+ opacity: number;+ };+ camera: {+ left: number;+ top: number;+ w: number;+ h: number;+ radius: number;+ opacity: number;+ };+ }+> = {+ default: {+ screen: {+ left: 120,+ top: 30,+ w: 360,+ h: 250,+ shift: 0,+ scale: 1,+ radius: 10,+ opacity: 1,+ },+ camera: { left: 28, top: 222, w: 88, h: 88, radius: 44, opacity: 1 },+ },+ cameraOnly: {+ screen: {+ left: 120,+ top: 30,+ w: 360,+ h: 250,+ shift: 0,+ scale: 1,+ radius: 10,+ opacity: 0,+ },+ camera: { left: 120, top: 30, w: 360, h: 250, radius: 12, opacity: 1 },+ },+ splitScreen: {+ screen: {+ left: 24,+ top: 30,+ w: 272,+ h: 250,+ shift: -6,+ scale: 1,+ radius: 12,+ opacity: 1,+ },+ camera: { left: 304, top: 30, w: 272, h: 250, radius: 12, opacity: 1 },+ },+ floating: {+ screen: {+ left: 52,+ top: 40,+ w: 320,+ h: 222,+ shift: 0,+ scale: 320 / 360,+ radius: 14,+ opacity: 1,+ },+ camera: { left: 396, top: 84, w: 160, h: 160, radius: 18, opacity: 1 },+ },+};++const SCENE_EASE = "cubic-bezier(0.22, 1, 0.36, 1)";+const sceneTransition = `left 480ms ${SCENE_EASE}, top 480ms ${SCENE_EASE}, width 480ms ${SCENE_EASE}, height 480ms ${SCENE_EASE}, border-radius 480ms ${SCENE_EASE}, opacity 320ms ease, transform 480ms ${SCENE_EASE}`;++const sceneAt = (t: number): SceneKey =>+ SCENE_MODES[Math.min(SCENE_MODES.length - 1, Math.floor(t / SCENE_SLOT))]+ ?.key ?? "default";++const ScenesVisual = ({ playing }: { playing: boolean }) => {+ const playheadRef = useRef<HTMLDivElement | null>(null);+ const [scene, setScene] = useSceneState<SceneKey>("default");+ const scrollRef = useRef<HTMLDivElement | null>(null);++ useLoop({+ duration: SCENES_DURATION,+ playing,+ pose: 7000,+ tick: (t) => {+ setScene(sceneAt(t));+ if (playheadRef.current) {+ playheadRef.current.style.left = `${(t / SCENES_DURATION) * 100}%`;+ }+ },+ });++ const layout = SCENE_LAYOUT[scene];++ return (+ <CanvasStage wallpaper="/backgrounds/sf.webp">+ <div+ className="absolute overflow-hidden"+ style={{+ left: layout.screen.left,+ top: layout.screen.top,+ width: layout.screen.w,+ height: layout.screen.h,+ borderRadius: layout.screen.radius,+ opacity: layout.screen.opacity,+ transform: layout.screen.opacity ? "scale(1)" : "scale(0.94)",+ boxShadow: "0 22px 60px rgba(0,0,0,0.28)",+ transition: sceneTransition,+ }}+ >+ <div+ className="absolute left-0 top-0"+ style={{+ width: SCENE_SCREEN.w,+ height: SCENE_SCREEN.h,+ transform: `translateX(${layout.screen.shift}px) scale(${layout.screen.scale})`,+ transformOrigin: "top left",+ transition: `transform 480ms ${SCENE_EASE}`,+ }}+ >+ <ContentWindow+ width={SCENE_SCREEN.w}+ height={SCENE_SCREEN.h}+ scrollRef={scrollRef}+ />+ </div>+ </div>+ <CameraPane+ playing={playing}+ style={{+ left: layout.camera.left,+ top: layout.camera.top,+ width: layout.camera.w,+ height: layout.camera.h,+ borderRadius: layout.camera.radius,+ opacity: layout.camera.opacity,+ boxShadow: "0 14px 34px rgba(0,0,0,0.32)",+ transition: sceneTransition,+ }}+ />+ <TrackStrip label="Scene" playhead={playheadRef}>+ {SCENE_MODES.map((mode, i) => (+ <span+ key={mode.key}+ className="absolute inset-y-1 flex items-center justify-center rounded-md text-[11px] font-medium text-white transition-[background-color,opacity] duration-300"+ style={{+ left: `calc(${(i / SCENE_MODES.length) * 100}% + 3px)`,+ width: `calc(${100 / SCENE_MODES.length}% - 6px)`,+ background: scene === mode.key ? "#7B5FD0" : "#B9A5F2",+ border: "1px solid rgba(123,95,208,0.5)",+ }}+ >+ {mode.label}+ </span>+ ))}+ </TrackStrip>+ </CanvasStage>+ );+};++const TEXT_DURATION = 10000;+const LOWER = { enter: 400, exit: 2900 };+const STAT = { enter: 3700, exit: 6100 };+const TYPE = { enter: 6600, exit: 9400 };+const TYPEWRITER_TEXT = "Try the new flow →";++const textPresetAt = (t: number) =>+ t >= TYPE.enter - 100 && t < TYPE.exit + 300+ ? "Typewriter · Typewriter"+ : t >= STAT.enter - 100 && t < STAT.exit + 300+ ? "Big Stat · Pop"+ : t >= LOWER.enter - 100 && t < LOWER.exit + 300+ ? "Lower Third · Slide up"+ : null;++const TextVisual = ({ playing }: { playing: boolean }) => {+ const lowerRef = useRef<HTMLDivElement | null>(null);+ const statRef = useRef<HTMLDivElement | null>(null);+ const typeRef = useRef<HTMLDivElement | null>(null);+ const typeTextRef = useRef<HTMLSpanElement | null>(null);+ const [preset, setPreset] = useSceneState<string | null>(null);+ const lastPreset = useRef("Lower Third · Slide up");+ if (preset) lastPreset.current = preset;++ useLoop({+ duration: TEXT_DURATION,+ playing,+ pose: 4800,+ tick: (t) => {+ setPreset(textPresetAt(t));+ if (lowerRef.current) {+ const inF = easeOut(span(t, LOWER.enter, LOWER.enter + 480));+ const outF = easeOut(span(t, LOWER.exit, LOWER.exit + 360));+ lowerRef.current.style.opacity = `${inF * (1 - outF)}`;+ lowerRef.current.style.transform = `translateY(${lerp(26, 0, inF) + outF * 18}px)`;+ }+ if (statRef.current) {+ const inF = span(t, STAT.enter, STAT.enter + 520);+ const overshoot = 1 + Math.sin(inF * Math.PI) * 0.12;+ const outF = easeOut(span(t, STAT.exit, STAT.exit + 320));+ statRef.current.style.opacity = `${easeOut(inF) * (1 - outF)}`;+ statRef.current.style.transform = `translateX(-50%) scale(${lerp(0.6, 1, easeOut(inF)) * overshoot})`;+ }+ if (typeRef.current && typeTextRef.current) {+ const outF = easeOut(span(t, TYPE.exit, TYPE.exit + 300));+ typeRef.current.style.opacity = `${t >= TYPE.enter ? 1 - outF : 0}`;+ typeTextRef.current.textContent =+ t >= TYPE.enter+ ? typed(TYPEWRITER_TEXT, t, TYPE.enter + 200, 22)+ : "";+ }+ },+ });++ return (+ <CanvasStage wallpaper="/backgrounds/nyc.webp">+ <RecordedWindow />+ <CameraBubble playing={playing} />++ <div+ ref={lowerRef}+ className="absolute z-20 flex items-stretch gap-3 opacity-0"+ style={{ left: 136, top: 318 }}+ >+ <span className="w-[3px] rounded-full bg-[#8FC1F7]" />+ <span className="leading-tight [text-shadow:0_2px_12px_rgba(0,0,0,0.45)]">+ <span className="block text-[18px] font-semibold text-white">+ Sofia Chen+ </span>+ <span className="block text-[12.5px] font-medium text-white/80">+ Head of Product+ </span>+ </span>+ </div>++ <div+ ref={statRef}+ className="absolute left-1/2 z-20 flex -translate-x-1/2 flex-col items-center rounded-2xl px-8 py-4 opacity-0"+ style={{+ top: 104,+ background: "rgba(17,17,17,0.72)",+ boxShadow: "0 18px 40px -16px rgba(0,0,0,0.6)",+ }}+ >+ <span className="text-[64px] font-semibold leading-none tracking-[-0.04em] text-white [text-shadow:0_6px_30px_rgba(0,0,0,0.45)]">+ 3.2×+ </span>+ <span className="mt-2 text-[13px] font-medium uppercase tracking-[0.08em] text-white/85 [text-shadow:0_2px_10px_rgba(0,0,0,0.45)]">+ faster onboarding+ </span>+ </div>++ <div+ ref={typeRef}+ className="absolute z-20 rounded-lg px-3 py-2 text-[14px] font-medium text-white opacity-0"+ style={{ right: 32, top: 40, background: "rgba(17,17,17,0.8)" }}+ >+ <span ref={typeTextRef} />+ <span className="ml-0.5 inline-block h-[14px] w-[1.5px] translate-y-[2px] animate-pulse bg-white/85" />+ </div>++ <div+ className="absolute left-4 top-4 z-30 transition-opacity duration-300"+ style={{ opacity: preset ? 1 : 0 }}+ >+ <Chip>{preset ?? lastPreset.current}</Chip>+ </div>+ </CanvasStage>+ );+};++const ZOOM_DURATION = 8000;+const ZOOM_FOCUS = { x: 420, y: 104 };+const ZOOM_CLICK = 1500;+const ZOOM_IN = { start: 1600, end: 2600 };+const ZOOM_OUT = { start: 5200, end: 6200 };+const ZOOM_PATH: Way[] = [+ { t: 0, x: 300, y: 230 },+ { t: 1400, x: ZOOM_FOCUS.x, y: ZOOM_FOCUS.y },+ { t: ZOOM_CLICK, x: ZOOM_FOCUS.x, y: ZOOM_FOCUS.y, click: true },+ { t: 3200, x: ZOOM_FOCUS.x, y: ZOOM_FOCUS.y },+ { t: 4600, x: ZOOM_FOCUS.x + 26, y: ZOOM_FOCUS.y + 34 },+ { t: ZOOM_DURATION, x: ZOOM_FOCUS.x + 26, y: ZOOM_FOCUS.y + 34 },+];++const zoomScaleAt = (t: number) =>+ 1 ++ easeInOut(span(t, ZOOM_IN.start, ZOOM_IN.end)) -+ easeInOut(span(t, ZOOM_OUT.start, ZOOM_OUT.end));++const ZoomVisual = ({ playing }: { playing: boolean }) => {+ const rootRef = useRef<HTMLDivElement | null>(null);+ const zoomRef = useRef<HTMLDivElement | null>(null);+ const ringRef = useRef<HTMLSpanElement | null>(null);+ const playheadRef = useRef<HTMLDivElement | null>(null);+ const clickRef = useRef(-1);+ const [ui, setUi] = useSceneState({ segment: false });+ const cursor = useCursor(rootRef);++ useLoop({+ duration: ZOOM_DURATION,+ playing,+ pose: 3600,+ tick: (t, seek) => {+ setUi({ segment: t >= ZOOM_CLICK });+ if (zoomRef.current) {+ zoomRef.current.style.transform = `scale(${zoomScaleAt(t)})`;+ }+ if (playheadRef.current) {+ playheadRef.current.style.left = `${(t / ZOOM_DURATION) * 100}%`;+ }+ if (seek) clickRef.current = t - 1;+ if (clickRef.current < ZOOM_CLICK && t >= ZOOM_CLICK) {+ restartAnimation(ringRef.current, "ht-scene-ripple 700ms ease-out");+ }+ clickRef.current = t;+ cursor.tick(ZOOM_PATH, t, seek);+ },+ });++ return (+ <div ref={rootRef} className="relative">+ <CanvasStage wallpaper="/backgrounds/london.webp">+ <style>{SCENE_CSS}</style>+ <div+ ref={zoomRef}+ className="absolute inset-0 will-change-transform"+ style={{ transformOrigin: `${ZOOM_FOCUS.x}px ${ZOOM_FOCUS.y}px` }}+ >+ <RecordedWindow top={30} />+ <CameraBubble playing={playing} size={88} left={28} top={222} />+ <span+ ref={ringRef}+ className="pointer-events-none absolute size-9 -translate-x-1/2 -translate-y-1/2 rounded-full opacity-0"+ style={{+ left: ZOOM_FOCUS.x,+ top: ZOOM_FOCUS.y,+ border: "2px solid rgba(0,144,255,0.9)",+ }}+ />+ <span+ className="pointer-events-none absolute size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-[#0090ff] transition-opacity duration-300"+ style={{+ left: ZOOM_FOCUS.x,+ top: ZOOM_FOCUS.y,+ opacity: ui.segment ? 1 : 0,+ boxShadow: "0 0 0 3px rgba(0,144,255,0.25)",+ }}+ />+ </div>+ <TrackStrip label="Zoom" playhead={playheadRef}>+ <span+ className="absolute inset-y-1 flex items-center justify-center rounded-md text-[11px] font-medium text-white transition-opacity duration-300"+ style={{+ left: `${(ZOOM_CLICK / ZOOM_DURATION) * 100}%`,+ width: `${((ZOOM_OUT.end - ZOOM_CLICK) / ZOOM_DURATION) * 100}%`,+ background: "#4a4f5c",+ border: "1px solid #30343d",+ opacity: ui.segment ? 1 : 0,+ }}+ >+ 2×+ </span>+ </TrackStrip>+ {cursor.Cursor}+ </CanvasStage>+ </div>+ );+};++const CAPTIONS_DURATION = 9000;+const CAPTION_LINES = [+ {+ start: 600,+ words: "So this is the new dashboard we’re shipping".split(" "),+ },+ { start: 4400, words: "Every card here pulls live data".split(" ") },+];+const WORD_MS = 380;+const CAPTION_CLOCK_BASE = 4;+const BURN_TOGGLE = { x: 548, y: 30 };+const BURN_AT = 7600;+const CAPTION_PATH: Way[] = [+ { t: 0, x: 470, y: 250 },+ { t: 6600, x: 470, y: 250 },+ { t: 7400, x: BURN_TOGGLE.x, y: BURN_TOGGLE.y },+ { t: BURN_AT, x: BURN_TOGGLE.x, y: BURN_TOGGLE.y, click: true },+ { t: 8400, x: BURN_TOGGLE.x - 60, y: BURN_TOGGLE.y + 70 },+ { t: CAPTIONS_DURATION, x: BURN_TOGGLE.x - 60, y: BURN_TOGGLE.y + 70 },+];++const captionAt = (t: number) => {+ let line = 0;+ for (let i = 0; i < CAPTION_LINES.length; i++) {+ if (t >= (CAPTION_LINES[i]?.start ?? 0)) line = i;+ }+ const current = CAPTION_LINES[line];+ const elapsed = t - (current?.start ?? 0);+ const active = Math.min(+ (current?.words.length ?? 1) - 1,+ Math.floor(Math.max(0, elapsed) / WORD_MS),+ );+ return {+ line,+ active,+ shown: t >= (CAPTION_LINES[0]?.start ?? 0),+ burn: t >= BURN_AT,+ };+};++const CaptionsVisual = ({ playing }: { playing: boolean }) => {+ const rootRef = useRef<HTMLDivElement | null>(null);+ const clockRef = useRef<HTMLSpanElement | null>(null);+ const [ui, setUi] = useSceneState(captionAt(0));+ const cursor = useCursor(rootRef);++ useLoop({+ duration: CAPTIONS_DURATION,+ playing,+ pose: 2200,+ tick: (t, seek) => {+ setUi(captionAt(t));+ if (clockRef.current) {+ const seconds =+ CAPTION_CLOCK_BASE + Math.floor(Math.max(0, t - 600) / 1000);+ clockRef.current.textContent = `0:${String(seconds).padStart(2, "0")}`;+ }+ cursor.tick(CAPTION_PATH, t, seek);+ },+ });++ const line = CAPTION_LINES[ui.line] ?? CAPTION_LINES[0];++ return (+ <div ref={rootRef} className="relative">+ <CanvasStage wallpaper="/backgrounds/rome.webp">+ <RecordedWindow top={22} />+ <CameraBubble playing={playing} size={88} left={28} top={222} />++ <div className="absolute left-4 top-4 z-30">+ <Chip>+ <span className="size-2 rounded-full bg-[#0f7a58]" />+ English · Whisper+ </Chip>+ </div>++ <div+ className="absolute z-30 flex h-8 items-center gap-2 rounded-lg pl-2.5 pr-1.5 text-[12px] font-medium"+ style={{+ right: 16,+ top: 16,+ background: "#fcfcfc",+ color: "#202020",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 8px 20px -10px rgba(16,24,40,0.45)",+ }}+ >+ Burn in+ <span+ className="relative inline-flex h-5 w-[34px] rounded-full transition-colors duration-200"+ style={{ background: ui.burn ? "#0090ff" : "#e0e0e0" }}+ >+ <span+ className="absolute top-[2px] size-4 rounded-full bg-white shadow-sm transition-[left] duration-200"+ style={{ left: ui.burn ? 16 : 2 }}+ />+ </span>+ </div>++ <div+ className="absolute bottom-[22px] left-1/2 z-20 flex max-w-[540px] -translate-x-1/2 items-center justify-center gap-x-1 whitespace-nowrap rounded-xl px-4 py-2 transition-opacity duration-300"+ style={{+ background: "rgba(17,17,17,0.74)",+ opacity: ui.shown ? 1 : 0,+ }}+ >+ {line?.words.map((word, i) => (+ <span+ key={`${ui.line}-${word}-${i}`}+ className={classNames(+ "rounded-md px-1.5 py-1 text-[16px] font-medium leading-none transition-colors duration-150",+ i === ui.active ? "bg-[#0090ff] text-white" : "text-white/92",+ )}+ >+ {word}+ </span>+ ))}+ </div>+ <span+ ref={clockRef}+ className="absolute z-20 rounded-md px-1.5 py-0.5 text-[11px] font-medium tabular-nums text-white/85 transition-opacity duration-300"+ style={{+ right: 16,+ bottom: 26,+ background: "rgba(17,17,17,0.6)",+ opacity: ui.shown ? 1 : 0,+ }}+ >+ 0:04+ </span>+ {cursor.Cursor}+ </CanvasStage>+ </div>+ );+};++export const CARDS_A: StudioCard[] = [+ {+ key: "mask",+ title: "Blur what is private",+ body: "Drop a mask over a password, an email, or a face and choose blur or pixelate. Or flip it to a highlight that dims everything else.",+ span: 2,+ Visual: BlurVisual,+ },+ {+ key: "scenes",+ title: "Scenes for screen and camera",+ body: "Switch any stretch of the timeline to camera only, hide camera, split screen, or floating cards, each with its own transition.",+ span: 2,+ Visual: ScenesVisual,+ },+ {+ key: "text",+ title: "Text that animates",+ body: "Titles, lower thirds, big stats, and typewriter callouts as stackable tracks, with fade, slide, pop, or typewriter in and out.",+ Visual: TextVisual,+ },+ {+ key: "zoom",+ title: "Automatic zoom",+ body: "Generate zooms from your recorded clicks, or draw your own from 1x to 4.5x with a fixed focal point.",+ Visual: ZoomVisual,+ },+ {+ key: "captions",+ title: "Captions, generated locally",+ body: "Transcribe on your machine in 19 languages, fix the words, style them, and burn them in with the active word highlighted.",+ Visual: CaptionsVisual,+ },+];diff --git a/apps/web/components/pages/HomeTwo/studio/cardsB.tsx b/apps/web/components/pages/HomeTwo/studio/cardsB.tsxnew file mode 100644index 000000000..b13bcad03--- /dev/null+++ b/apps/web/components/pages/HomeTwo/studio/cardsB.tsx@@ -0,0 +1,881 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import Image from "next/image";+import { useRef } from "react";+import {+ easeInOut,+ lerp,+ span,+ useCursor,+ useSceneState,+ type Way,+} from "../scenes/engine";+import {+ CANVAS,+ CameraBubble,+ CanvasStage,+ Chip,+ RECORDED,+ RecordedWindow,+ type StudioCard,+ useLoop,+} from "./shared";++/* ------------------------------------------------------------ 3D camera -- */++const THREE_D_DURATION = 9000;++const threeDPoseAt = (t: number) => {+ if (t < 3000) {+ const f = easeInOut(span(t, 0, 3000));+ return {+ ry: lerp(-14, 14, f),+ rx: 0,+ tx: lerp(-28, 28, f),+ s: 1,+ label: "Glide across",+ };+ }+ if (t < 6000) {+ const f = easeInOut(span(t, 3000, 6000));+ return {+ ry: lerp(14, 0, f),+ rx: lerp(0, 10, f),+ tx: lerp(28, 0, f),+ s: lerp(1, 0.86, f),+ label: "Pull back",+ };+ }+ if (t < 7500) {+ const f = easeInOut(span(t, 6000, 7500));+ return {+ ry: lerp(0, -24, f),+ rx: lerp(10, 6, f),+ tx: lerp(0, -10, f),+ s: lerp(0.86, 1, f),+ label: "Tilt away",+ };+ }+ const f = easeInOut(span(t, 7500, THREE_D_DURATION));+ return {+ ry: lerp(-24, -14, f),+ rx: lerp(6, 0, f),+ tx: lerp(-10, -28, f),+ s: 1,+ label: "Tilt away",+ };+};++const ThreeDVisual = ({ playing }: { playing: boolean }) => {+ const groupRef = useRef<HTMLDivElement | null>(null);+ const depthRef = useRef<HTMLDivElement | null>(null);+ const vignetteRef = useRef<HTMLDivElement | null>(null);+ const floorRef = useRef<HTMLDivElement | null>(null);+ const [ui, setUi] = useSceneState({ label: "Glide across" });++ useLoop({+ duration: THREE_D_DURATION,+ playing,+ pose: 6900,+ tick: (t) => {+ const pose = threeDPoseAt(t);+ setUi({ label: pose.label });+ const tilt = Math.min(1, Math.abs(pose.ry) / 24);+ if (groupRef.current) {+ groupRef.current.style.transform = `translateX(${pose.tx}px) scale(${pose.s}) rotateY(${pose.ry}deg) rotateX(${pose.rx}deg)`;+ }+ if (depthRef.current) {+ depthRef.current.style.opacity = `${tilt * 0.55}`;+ depthRef.current.style.background =+ pose.ry > 0+ ? "linear-gradient(to right, rgba(9,12,20,0) 35%, rgba(9,12,20,0.75))"+ : "linear-gradient(to left, rgba(9,12,20,0) 35%, rgba(9,12,20,0.75))";+ }+ if (vignetteRef.current) {+ vignetteRef.current.style.opacity = `${0.18 + tilt * 0.4}`;+ }+ if (floorRef.current) {+ floorRef.current.style.transform = `translateX(${pose.tx * 1.15}px) scaleX(${0.7 + pose.s * 0.4}) scaleY(${pose.s})`;+ floorRef.current.style.opacity = `${0.35 + tilt * 0.3}`;+ }+ },+ });++ return (+ <CanvasStage wallpaper="/backgrounds/rome.webp">+ <div+ ref={vignetteRef}+ className="pointer-events-none absolute inset-0 z-0"+ style={{+ background:+ "radial-gradient(80% 70% at 50% 50%, rgba(9,12,20,0) 45%, rgba(9,12,20,0.7) 100%)",+ opacity: 0.18,+ }}+ />+ <div+ ref={floorRef}+ className="pointer-events-none absolute z-0 rounded-full"+ style={{+ left: RECORDED.left + 30,+ top: RECORDED.top + RECORDED.height + 8,+ width: RECORDED.width - 60,+ height: 26,+ background:+ "radial-gradient(50% 50% at 50% 50%, rgba(9,12,20,0.55), rgba(9,12,20,0))",+ filter: "blur(6px)",+ opacity: 0.35,+ }}+ />+ <div+ className="absolute inset-0 z-10"+ style={{ perspective: 900, perspectiveOrigin: "50% 45%" }}+ >+ <div+ ref={groupRef}+ className="absolute inset-0 will-change-transform"+ style={{ transformStyle: "preserve-3d" }}+ >+ <RecordedWindow />+ <CameraBubble+ playing={playing}+ size={84}+ left={RECORDED.left - 36}+ top={RECORDED.top + RECORDED.height - 60}+ />+ <div+ ref={depthRef}+ className="pointer-events-none absolute rounded-[10px]"+ style={{+ left: RECORDED.left,+ top: RECORDED.top,+ width: RECORDED.width,+ height: RECORDED.height,+ opacity: 0,+ }}+ />+ </div>+ </div>+ <div className="absolute left-4 top-4 z-20 flex items-center gap-2">+ <Chip>+ <span+ className="size-2 rounded-full"+ style={{ background: "#7B5FD0" }}+ />+ 3D camera+ </Chip>+ <Chip style={{ color: "rgba(17,17,17,0.6)" }}>{ui.label}</Chip>+ </div>+ </CanvasStage>+ );+};++/* --------------------------------------------------------------- canvas -- */++const CANVAS_DURATION = 10000;+const WALLS = [+ "/backgrounds/monaco.webp",+ "/backgrounds/santorini.webp",+ "/backgrounds/nyc.webp",+];+type FrameKind = "none" | "browser" | "macbook";++const canvasUiAt = (t: number) => ({+ wall: t < 2500 ? 0 : t < 5000 ? 1 : 2,+ frame: (t < 5000+ ? "none"+ : t < 7600+ ? "browser"+ : t < 9500+ ? "macbook"+ : "none") as FrameKind,+});++const FRAME_LABEL: Record<FrameKind, string> = {+ none: "Frame · None",+ browser: "Frame · Browser",+ macbook: "Frame · MacBook",+};++const canvasScaleAt = (t: number) => {+ const grow = easeInOut(span(t, 2500, 3500));+ const back = easeInOut(span(t, 9500, CANVAS_DURATION));+ const s = lerp(lerp(1, 0.9, grow), 1, back);+ const r = lerp(lerp(10, 20, grow), 10, back);+ return { s, r };+};++const CanvasVisual = ({ playing }: { playing: boolean }) => {+ const groupRef = useRef<HTMLDivElement | null>(null);+ const clipRef = useRef<HTMLDivElement | null>(null);+ const [ui, setUi] = useSceneState(canvasUiAt(0));++ useLoop({+ duration: CANVAS_DURATION,+ playing,+ pose: 6400,+ tick: (t) => {+ setUi(canvasUiAt(t));+ const { s, r } = canvasScaleAt(t);+ if (groupRef.current) groupRef.current.style.transform = `scale(${s})`;+ if (clipRef.current) clipRef.current.style.borderRadius = `${r}px`;+ },+ });++ const browser = ui.frame === "browser";+ const macbook = ui.frame === "macbook";++ return (+ <CanvasStage wallpaper={WALLS[0]}>+ {WALLS.slice(1).map((wall, i) => (+ <Image+ key={wall}+ src={wall}+ alt=""+ fill+ sizes="600px"+ draggable={false}+ className="object-cover transition-opacity duration-700"+ style={{ opacity: ui.wall >= i + 1 ? 1 : 0 }}+ />+ ))}+ <div+ ref={groupRef}+ className="absolute will-change-transform"+ style={{+ left: RECORDED.left,+ top: RECORDED.top,+ width: RECORDED.width,+ height: RECORDED.height,+ transformOrigin: "50% 55%",+ }}+ >+ <div+ className="pointer-events-none absolute transition-[opacity,transform] duration-500"+ style={{+ left: -14,+ top: -14,+ right: -14,+ bottom: -14,+ borderRadius: 22,+ background: "linear-gradient(180deg, #2b2d33 0%, #101114 12%)",+ boxShadow:+ "inset 0 0 0 1px rgba(255,255,255,0.08), 0 30px 60px -30px rgba(9,12,20,0.7)",+ opacity: macbook ? 1 : 0,+ transform: macbook ? "scale(1)" : "scale(1.04)",+ }}+ />+ <div+ className="pointer-events-none absolute transition-opacity duration-500"+ style={{+ left: -48,+ right: -48,+ bottom: -26,+ height: 12,+ borderRadius: "0 0 14px 14px",+ background: "linear-gradient(180deg, #d7d9de, #9a9ea6)",+ boxShadow: "0 14px 30px -12px rgba(9,12,20,0.6)",+ opacity: macbook ? 1 : 0,+ }}+ />+ <div+ className="pointer-events-none absolute inset-x-0 flex items-center gap-2 px-3 transition-[opacity,transform] duration-500"+ style={{+ top: -34,+ height: 36,+ borderRadius: "10px 10px 0 0",+ background: "#f6f7f9",+ border: "1px solid rgba(0,0,0,0.08)",+ borderBottom: "none",+ opacity: browser ? 1 : 0,+ transform: browser ? "translateY(0)" : "translateY(10px)",+ }}+ >+ <span className="flex items-center gap-1.5">+ {["#FF5F57", "#FEBC2E", "#28C840"].map((color) => (+ <span+ key={color}+ className="size-[9px] rounded-full"+ style={{ background: color }}+ />+ ))}+ </span>+ <span+ className="ml-1 flex h-6 items-center rounded-t-md px-3 text-[10.5px] font-medium"+ style={{ background: "#ffffff", color: "#202020" }}+ >+ Dashboard+ </span>+ <span+ className="ml-auto flex h-5 w-[46%] items-center justify-center rounded-md text-[10px]"+ style={{+ background: "rgba(17,17,17,0.06)",+ color: "rgba(17,17,17,0.6)",+ }}+ >+ acme.com/dashboard+ </span>+ </div>+ <div+ ref={clipRef}+ className="absolute inset-0 overflow-hidden transition-[border-radius] duration-500"+ style={{+ borderRadius: 10,+ boxShadow: "0 24px 50px -20px rgba(9,12,20,0.6)",+ }}+ >+ <div+ className="absolute inset-x-0 transition-[top] duration-500"+ style={{ top: browser ? -40 : 0 }}+ >+ <RecordedWindow left={0} top={0} />+ </div>+ </div>+ </div>+ <CameraBubble playing={playing} />+ <div className="absolute left-4 top-4 z-20 flex gap-2">+ <Chip>{FRAME_LABEL[ui.frame]}</Chip>+ </div>+ </CanvasStage>+ );+};++/* --------------------------------------------------------------- grades -- */++type Grade = {+ name: string;+ filter: string;+ tint: string;+ sliders: [number, number, number];+};++const NONE_GRADE: Grade = {+ name: "None",+ filter: "none",+ tint: "transparent",+ sliders: [0.5, 0.5, 0.5],+};++const GRADES: Grade[] = [+ {+ name: "Cinematic",+ filter: "contrast(1.15) saturate(0.82) sepia(0.12)",+ tint: "rgba(24,52,92,0.18)",+ sliders: [0.45, 0.68, 0.42],+ },+ {+ name: "Noir",+ filter: "grayscale(1) contrast(1.25) brightness(0.96)",+ tint: "rgba(0,0,0,0.08)",+ sliders: [0.48, 0.78, 0.02],+ },+ {+ name: "Vintage",+ filter: "sepia(0.45) contrast(0.95) brightness(1.04) saturate(0.9)",+ tint: "rgba(255,196,120,0.16)",+ sliders: [0.56, 0.42, 0.44],+ },+ {+ name: "Frost",+ filter: "saturate(0.75) brightness(1.06) hue-rotate(-8deg)",+ tint: "rgba(168,208,255,0.24)",+ sliders: [0.6, 0.46, 0.36],+ },+ {+ name: "Golden",+ filter: "sepia(0.3) saturate(1.2) brightness(1.03)",+ tint: "rgba(255,186,74,0.2)",+ sliders: [0.55, 0.52, 0.66],+ },+ {+ name: "Midnight",+ filter: "brightness(0.82) contrast(1.15) saturate(0.9) hue-rotate(12deg)",+ tint: "rgba(22,30,86,0.3)",+ sliders: [0.3, 0.66, 0.45],+ },+ {+ name: "Vivid",+ filter: "saturate(1.55) contrast(1.08)",+ tint: "transparent",+ sliders: [0.52, 0.6, 0.88],+ },+ {+ name: "Dreamy",+ filter: "brightness(1.08) contrast(0.88) saturate(1.15)",+ tint: "rgba(255,190,230,0.18)",+ sliders: [0.66, 0.36, 0.62],+ },+];++const GRADES_DURATION = 9600;+const SWATCH = { w: 62, gap: 6, x: 16, y: CANVAS.h - 16 - 26 };+const GRADE_STOPS: { name: string; at: number }[] = [+ { name: "Cinematic", at: 1000 },+ { name: "Noir", at: 2400 },+ { name: "Golden", at: 3800 },+ { name: "Midnight", at: 5200 },+ { name: "Vivid", at: 6600 },+ { name: "Dreamy", at: 8000 },+];+const SLIDER_LABELS = ["Exposure", "Contrast", "Saturation"];++const swatchCenter = (name: string) => {+ const index = GRADES.findIndex((grade) => grade.name === name);+ return {+ x: SWATCH.x + index * (SWATCH.w + SWATCH.gap) + SWATCH.w / 2,+ y: SWATCH.y + 13,+ };+};++const GRADE_PATH: Way[] = [+ { t: 0, x: 320, y: 190 },+ ...GRADE_STOPS.flatMap((stop) => {+ const point = swatchCenter(stop.name);+ return [+ { t: stop.at - 160, ...point },+ { t: stop.at, ...point, click: true },+ ];+ }),+ { t: GRADES_DURATION - 600, x: 420, y: 210 },+ { t: GRADES_DURATION, x: 420, y: 210 },+];++const gradeAt = (t: number) => {+ let current = NONE_GRADE.name;+ for (const stop of GRADE_STOPS) if (t >= stop.at) current = stop.name;+ return current;+};++const GradesVisual = ({ playing }: { playing: boolean }) => {+ const rootRef = useRef<HTMLDivElement | null>(null);+ const [ui, setUi] = useSceneState({ grade: NONE_GRADE.name });+ const cursor = useCursor(rootRef);++ useLoop({+ duration: GRADES_DURATION,+ playing,+ pose: 4600,+ tick: (t, seek) => {+ setUi({ grade: gradeAt(t) });+ cursor.tick(GRADE_PATH, t, seek);+ },+ });++ const grade = GRADES.find((item) => item.name === ui.grade) ?? NONE_GRADE;++ return (+ <div ref={rootRef} className="relative">+ <CanvasStage wallpaper="/backgrounds/liverpool.webp">+ <div+ className="absolute inset-0 transition-[filter] duration-500"+ style={{ filter: grade.filter }}+ >+ <RecordedWindow left={56} top={RECORDED.top - 14} />+ <CameraBubble playing={playing} top={CANVAS.h - 24 - 96 - 40} />+ </div>+ <div+ className="pointer-events-none absolute inset-0 transition-[background-color] duration-500"+ style={{ background: grade.tint, mixBlendMode: "multiply" }}+ />+ <div+ className="pointer-events-none absolute inset-0 transition-opacity duration-500"+ style={{+ background:+ "radial-gradient(85% 75% at 50% 50%, rgba(9,12,20,0) 55%, rgba(9,12,20,0.55) 100%)",+ opacity: ui.grade === "None" ? 0 : 0.6,+ }}+ />++ <div+ className="absolute z-20 flex w-[164px] flex-col gap-2.5 rounded-[12px] p-3"+ style={{+ left: CANVAS.w - 164 - 16,+ top: 16,+ background: "#fcfcfc",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 12px 30px -16px rgba(16,24,40,0.5)",+ }}+ >+ {SLIDER_LABELS.map((label, i) => (+ <div key={label} className="flex flex-col gap-1.5">+ <span className="text-[10.5px] font-medium text-[#202020]">+ {label}+ </span>+ <span className="relative flex h-3 items-center">+ <span+ className="h-[3px] w-full overflow-hidden rounded-full"+ style={{ background: "#e8e8e8" }}+ >+ <span+ className="block h-full rounded-full transition-[width] duration-500"+ style={{+ width: `${(grade.sliders[i] ?? 0.5) * 100}%`,+ background: "#0090ff",+ }}+ />+ </span>+ <span+ className="absolute size-3 rounded-full border bg-white shadow-sm transition-[left] duration-500"+ style={{+ left: `calc(${(grade.sliders[i] ?? 0.5) * 100}% - 6px)`,+ borderColor: "#d9d9d9",+ }}+ />+ </span>+ </div>+ ))}+ </div>++ <div+ className="absolute z-20 flex"+ style={{ left: SWATCH.x, top: SWATCH.y, gap: SWATCH.gap }}+ >+ {GRADES.map((item) => (+ <span+ key={item.name}+ className={classNames(+ "flex h-[26px] items-center justify-center rounded-lg text-[11px] font-medium transition-colors duration-200",+ ui.grade === item.name+ ? "bg-[#111111] text-white"+ : "bg-[rgba(252,252,252,0.92)] text-[#202020]",+ )}+ style={{+ width: SWATCH.w,+ boxShadow: "0 8px 20px -12px rgba(16,24,40,0.6)",+ }}+ >+ {item.name}+ </span>+ ))}+ </div>+ {cursor.Cursor}+ </CanvasStage>+ </div>+ );+};++/* ---------------------------------------------------------------- clips -- */++const CLIPS_DURATION = 10000;+const PANEL = { x: 16, y: 206, w: 568, h: 153 };+const GUTTER = 68;+const LANE_X = PANEL.x + 16 + GUTTER + 8;+const LANE_W = PANEL.w - 32 - GUTTER - 8;+const TRACK_Y = PANEL.y + 16 + 22 + 8;+const TRACK_H = 40;+const CLIP_A = { start: 232, trimmed: 196 };+const CLIP_B = { start: 190, fast: 95 };+const TRIM = { start: 2200, end: 3400 };+const SPEED_AT = 3900;+const FADE_AT = 5200;+const AUDIO_AT = 6400;++const WAVES = Array.from({ length: 48 }, (_, i) => {+ const a = Math.sin(i * 0.7) * 0.5 + 0.5;+ const b = Math.sin(i * 1.9 + 1) * 0.5 + 0.5;+ return { key: `w${i}`, h: 0.25 + 0.7 * (0.5 * a + 0.5 * b) };+});++const clipsUiAt = (t: number) => ({+ speed: t >= SPEED_AT,+ fade: t >= FADE_AT,+ audio: t >= AUDIO_AT,+});++const clipWidthsAt = (t: number) => {+ const trim = easeInOut(span(t, TRIM.start, TRIM.end));+ const a = lerp(CLIP_A.start, CLIP_A.trimmed, trim);+ const b = t >= SPEED_AT ? CLIP_B.fast : CLIP_B.start;+ return { a, b };+};++const CLIPS_PATH: Way[] = [+ { t: 0, x: 420, y: 120 },+ { t: 1900, x: LANE_X + CLIP_A.start + 2, y: TRACK_Y + TRACK_H / 2 },+ { t: TRIM.start, x: LANE_X + CLIP_A.start + 2, y: TRACK_Y + TRACK_H / 2 },+ { t: TRIM.end, x: LANE_X + CLIP_A.trimmed + 2, y: TRACK_Y + TRACK_H / 2 },+ {+ t: SPEED_AT - 150,+ x: LANE_X + CLIP_A.trimmed + 6 + CLIP_B.start / 2,+ y: TRACK_Y + TRACK_H / 2,+ },+ {+ t: SPEED_AT,+ x: LANE_X + CLIP_A.trimmed + 6 + CLIP_B.start / 2,+ y: TRACK_Y + TRACK_H / 2,+ click: true,+ },+ { t: FADE_AT - 150, x: LANE_X + CLIP_A.trimmed + 3, y: TRACK_Y - 6 },+ { t: FADE_AT, x: LANE_X + CLIP_A.trimmed + 3, y: TRACK_Y - 6, click: true },+ { t: AUDIO_AT + 400, x: 470, y: 150 },+ { t: CLIPS_DURATION, x: 470, y: 150 },+];++const ClipsVisual = ({ playing }: { playing: boolean }) => {+ const rootRef = useRef<HTMLDivElement | null>(null);+ const clipARef = useRef<HTMLDivElement | null>(null);+ const clipBRef = useRef<HTMLDivElement | null>(null);+ const seamRef = useRef<HTMLDivElement | null>(null);+ const playheadRef = useRef<HTMLDivElement | null>(null);+ const [ui, setUi] = useSceneState(clipsUiAt(0));+ const cursor = useCursor(rootRef);++ useLoop({+ duration: CLIPS_DURATION,+ playing,+ pose: 7200,+ tick: (t, seek) => {+ setUi(clipsUiAt(t));+ const { a, b } = clipWidthsAt(t);+ if (clipARef.current) clipARef.current.style.width = `${a}px`;+ if (clipBRef.current) {+ clipBRef.current.style.left = `${a + 6}px`;+ clipBRef.current.style.width = `${b}px`;+ }+ if (seamRef.current) seamRef.current.style.left = `${a - 6}px`;+ const frac = (t % 3200) / 3200;+ const fast = t >= SPEED_AT;+ const split = fast ? 0.66 : a / (a + b);+ const head =+ frac < split+ ? lerp(0, a, frac / split)+ : lerp(a + 6, a + 6 + b, (frac - split) / (1 - split));+ if (playheadRef.current) {+ playheadRef.current.style.transform = `translateX(${head}px)`;+ }+ cursor.tick(CLIPS_PATH, t, seek);+ },+ });++ return (+ <div ref={rootRef} className="relative">+ <CanvasStage wallpaper="/backgrounds/sf.webp">+ <RecordedWindow left={170} top={22} width={280} height={162} />+ <CameraBubble playing={playing} size={56} left={130} top={130} />++ <div+ className="absolute z-10 rounded-[12px] p-4"+ style={{+ left: PANEL.x,+ top: PANEL.y,+ width: PANEL.w,+ height: PANEL.h,+ background: "#fcfcfc",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 18px 40px -18px rgba(16,24,40,0.5)",+ }}+ >+ <div className="flex gap-2">+ <div style={{ width: GUTTER }} />+ <div+ className="relative h-[22px] flex-1 text-[9.5px]"+ style={{ color: "#8d8d8d" }}+ >+ {["0:00", "0:05", "0:10", "0:15", "0:20"].map((label, i) => (+ <span+ key={label}+ className="absolute top-0 flex -translate-x-1/2 flex-col items-center gap-0.5"+ style={{ left: `${(i / 4.4) * 100}%` }}+ >+ {label}+ <span className="size-[3px] rounded-full bg-current" />+ </span>+ ))}+ </div>+ </div>++ <div className="mt-2 flex gap-2">+ <div+ className="flex shrink-0 items-center justify-center rounded-lg text-[10px] font-medium text-white"+ style={{+ width: GUTTER,+ height: TRACK_H,+ background: "#3f8ae0",+ border: "1px solid #2a5c96",+ }}+ >+ Video+ </div>+ <div className="relative flex-1" style={{ height: TRACK_H }}>+ <div+ ref={clipARef}+ className="absolute inset-y-0 left-0 overflow-hidden rounded-lg"+ style={{+ width: CLIP_A.start,+ background: "#3f8ae0",+ border: "1px solid #2a5c96",+ }}+ >+ <span className="absolute left-2 top-1.5 text-[9.5px] font-medium text-white/80">+ Clip 1+ </span>+ <span className="absolute inset-x-1 bottom-1 flex h-3 items-end gap-px">+ {WAVES.slice(0, 30).map((wave) => (+ <span+ key={wave.key}+ className="flex-1 rounded-[1px]"+ style={{+ height: `${wave.h * 100}%`,+ background: "rgba(255,255,255,0.45)",+ }}+ />+ ))}+ </span>+ </div>+ <div+ ref={clipBRef}+ className="absolute inset-y-0 overflow-hidden rounded-lg transition-[width] duration-500"+ style={{+ left: CLIP_A.start + 6,+ width: CLIP_B.start,+ background: "#3f8ae0",+ border: "1px solid #2a5c96",+ }}+ >+ <span className="absolute left-2 top-1.5 text-[9.5px] font-medium text-white/80">+ Clip 2+ </span>+ <span+ className={classNames(+ "absolute right-1.5 top-1 rounded-md px-1.5 py-0.5 text-[9.5px] font-semibold transition-opacity duration-300",+ ui.speed ? "opacity-100" : "opacity-0",+ )}+ style={{ background: "#ffffff", color: "#2563eb" }}+ >+ 2×+ </span>+ <span className="absolute inset-x-1 bottom-1 flex h-3 items-end gap-px">+ {WAVES.slice(18, 40).map((wave) => (+ <span+ key={wave.key}+ className="flex-1 rounded-[1px]"+ style={{+ height: `${wave.h * 100}%`,+ background: "rgba(255,255,255,0.45)",+ }}+ />+ ))}+ </span>+ </div>+ <div+ ref={seamRef}+ className={classNames(+ "pointer-events-none absolute -top-1 -bottom-1 w-[18px] rounded-md transition-opacity duration-300",+ ui.fade ? "opacity-100" : "opacity-0",+ )}+ style={{+ left: CLIP_A.start - 6,+ background:+ "linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0) 100%)",+ boxShadow: "0 0 18px 2px rgba(255,255,255,0.55)",+ }}+ >+ <span+ className="absolute -top-5 left-1/2 -translate-x-1/2 whitespace-nowrap rounded-md px-1.5 py-0.5 text-[9px] font-medium text-white"+ style={{ background: "#202020" }}+ >+ Crossfade+ </span>+ </div>+ <div+ ref={playheadRef}+ className="pointer-events-none absolute -top-2 bottom-0 left-0 will-change-transform"+ >+ <span+ className="absolute -left-[4px] top-0 size-[9px] rounded-full"+ style={{ background: "rgb(226,64,64)" }}+ />+ <span+ className="absolute left-0 top-1 h-full w-px"+ style={{+ background:+ "linear-gradient(rgb(226,64,64), rgba(226,64,64,0.2))",+ }}+ />+ </div>+ </div>+ </div>++ <div+ className={classNames(+ "mt-2 flex gap-2 transition-[opacity,transform] duration-500",+ ui.audio+ ? "translate-y-0 opacity-100"+ : "translate-y-2 opacity-0",+ )}+ >+ <div+ className="flex shrink-0 items-center justify-center rounded-lg text-[10px] font-medium text-white"+ style={{+ width: GUTTER,+ height: 30,+ background: "#2f7a5b",+ border: "1px solid #1f5a42",+ }}+ >+ Audio+ </div>+ <div+ className="relative overflow-hidden rounded-lg"+ style={{+ width: LANE_W * 0.9,+ height: 30,+ background: "#dff3e9",+ border: "1px solid #bfe3d1",+ }}+ >+ <span+ className="absolute left-2 top-1 text-[9.5px] font-medium"+ style={{ color: "#0f7a58" }}+ >+ Lofi 03+ </span>+ <span className="absolute inset-x-1 bottom-1 flex h-2.5 items-end gap-px">+ {WAVES.map((wave) => (+ <span+ key={wave.key}+ className="flex-1 rounded-[1px]"+ style={{+ height: `${wave.h * 100}%`,+ background: "rgba(15,122,88,0.45)",+ }}+ />+ ))}+ </span>+ </div>+ </div>+ </div>+ {cursor.Cursor}+ </CanvasStage>+ </div>+ );+};++/* --------------------------------------------------------------- export -- */++export const CARDS_B: StudioCard[] = [+ {+ key: "three-d",+ title: "3D camera moves",+ body: "Tilt the frame into perspective and glide, sweep, or pull back across it with focus blur.",+ Visual: ThreeDVisual,+ },+ {+ key: "canvas",+ title: "Any canvas, one recording",+ body: "Wallpapers, gradients, or your own image, then padding, corners, shadows, and a macOS, Windows, browser, or MacBook frame.",+ Visual: CanvasVisual,+ },+ {+ key: "grades",+ title: "Color grades",+ body: "Cinematic, Noir, Vintage, Frost, Golden, Midnight, Vivid, or Dreamy, then dial exposure, contrast, and vignette.",+ Visual: GradesVisual,+ },+ {+ key: "clips",+ title: "Clips, speed, and music",+ body: "Trim, split, reorder, speed up to 8x, crossfade between clips, and lay a track from the built in library underneath.",+ Visual: ClipsVisual,+ },+];diff --git a/apps/web/components/pages/HomeTwo/studio/shared.tsx b/apps/web/components/pages/HomeTwo/studio/shared.tsxnew file mode 100644index 000000000..ed0f0fa8c--- /dev/null+++ b/apps/web/components/pages/HomeTwo/studio/shared.tsx@@ -0,0 +1,200 @@+"use client";++import { classNames } from "@cap/utils/helpers";+import Image from "next/image";+import {+ type ComponentType,+ type CSSProperties,+ type ReactNode,+ useEffect,+ useRef,+} from "react";+import { ContentWindow } from "../demo/MacDesktop";+import { useVideoAttrs, VIDEO_POSTERS } from "../demo/media";+import { useVideo } from "../scenes/engine";+import { useReducedMotion } from "../visibility";++export type StudioCard = {+ key: string;+ title: string;+ body: string;+ span?: 1 | 2;+ Visual: ComponentType<{ playing: boolean }>;+};++export const CANVAS = { w: 600, h: 375 } as const;++export const useLoop = ({+ duration,+ playing,+ pose,+ tick,+}: {+ duration: number;+ playing: boolean;+ pose: number;+ tick: (t: number, seek: boolean) => void;+}) => {+ const tRef = useRef(0);+ const tickRef = useRef(tick);+ tickRef.current = tick;+ const reduced = useReducedMotion();++ useEffect(() => {+ if (reduced) {+ tickRef.current(pose, true);+ return;+ }+ if (!playing) return;+ let raf = 0;+ let last = performance.now();+ let seek = true;+ const frame = (now: number) => {+ const dt = Math.min(48, now - last);+ last = now;+ const next = tRef.current + dt;+ if (next >= duration) seek = true;+ tRef.current = next % duration;+ tickRef.current(tRef.current, seek);+ seek = false;+ raf = requestAnimationFrame(frame);+ };+ raf = requestAnimationFrame(frame);+ return () => cancelAnimationFrame(raf);+ }, [playing, reduced, duration, pose]);+};++export const CanvasStage = ({+ wallpaper = "/backgrounds/monaco.webp",+ className,+ style,+ children,+}: {+ wallpaper?: string;+ className?: string;+ style?: CSSProperties;+ children: ReactNode;+}) => (+ <div+ className={classNames(+ "relative overflow-hidden rounded-[12px] bg-black",+ className,+ )}+ style={{ width: CANVAS.w, height: CANVAS.h, ...style }}+ >+ <Image+ src={wallpaper}+ alt=""+ fill+ sizes="600px"+ draggable={false}+ className="object-cover"+ />+ {children}+ </div>+);++export const RECORDED = {+ left: 120,+ top: 62,+ width: 360,+ height: 250,+} as const;++export const RecordedWindow = ({+ left = RECORDED.left,+ top = RECORDED.top,+ width = RECORDED.width,+ height = RECORDED.height,+ className,+ style,+}: {+ left?: number;+ top?: number;+ width?: number;+ height?: number;+ className?: string;+ style?: CSSProperties;+}) => {+ const scrollRef = useRef<HTMLDivElement | null>(null);+ return (+ <div+ className={classNames("absolute", className)}+ style={{ left, top, width, height, ...style }}+ >+ <ContentWindow width={width} height={height} scrollRef={scrollRef} />+ </div>+ );+};++export const CameraBubble = ({+ playing,+ size = 96,+ left = 24,+ top = CANVAS.h - 24 - 96,+ className,+ style,+}: {+ playing: boolean;+ size?: number;+ left?: number;+ top?: number;+ className?: string;+ style?: CSSProperties;+}) => {+ const ref = useRef<HTMLVideoElement | null>(null);+ const attrs = useVideoAttrs(VIDEO_POSTERS.webcam);+ useVideo(playing, ref);+ return (+ <div+ className={classNames(+ "absolute overflow-hidden rounded-full bg-[#111111]",+ className,+ )}+ style={{+ left,+ top,+ width: size,+ height: size,+ boxShadow: "0 10px 26px rgba(0,0,0,0.35)",+ ...style,+ }}+ >+ <video+ ref={ref}+ className="h-full w-full object-cover"+ src="/videos/home-two/webcam.mp4"+ muted+ loop+ playsInline+ {...attrs}+ />+ </div>+ );+};++export const Chip = ({+ children,+ className,+ style,+}: {+ children: ReactNode;+ className?: string;+ style?: CSSProperties;+}) => (+ <span+ className={classNames(+ "inline-flex h-7 items-center gap-1.5 rounded-lg px-2.5 text-[12px] font-medium",+ className,+ )}+ style={{+ background: "#fcfcfc",+ color: "#202020",+ border: "1px solid rgba(0,0,0,0.08)",+ boxShadow: "0 8px 20px -10px rgba(16,24,40,0.45)",+ ...style,+ }}+ >+ {children}+ </span>+);diff --git a/apps/web/components/pages/HomeTwo/theme.ts b/apps/web/components/pages/HomeTwo/theme.tsnew file mode 100644index 000000000..924714626--- /dev/null+++ b/apps/web/components/pages/HomeTwo/theme.ts@@ -0,0 +1,177 @@+import type { CSSProperties } from "react";++/**+ * Shared visual tokens for the /home-two prototype.+ *+ * Typography follows Intercom's system: a regular-weight grotesk set very+ * tight (leading ~1.0, -0.03em) for display, a light serif for body copy,+ * and 12px uppercase mono eyebrows. Colours are pastel takes on Cap's four+ * mode hues on warm paper, and every coloured surface carries a film-grain+ * texture baked into its background-image stack.+ */++export type ModeKey = "instant" | "studio" | "screenshot" | "share";++/** Near-black ink. */+export const INK = "#111111";+/** Page canvas. */+export const CREAM = "#F8FAFC";+/**+ * The lighter shell the page sits on: navbar background plus the gutters+ * around the inset page card, so the rounded corners read as a seam.+ */+export const SHELL = "#FFFFFF";+/** Warm paper band and tile fill. */+export const BAND = "#EDF1F6";+/** Body copy on light surfaces. */+export const BODY_COLOR = "rgba(17,17,17,0.78)";+/** Muted labels and microcopy. */+export const MUTED = "rgba(17,17,17,0.5)";+/** Warm hairline rules. */+export const HAIRLINE = "#E1E7EE";+/** The cream the floating content cards sit on. */+export const CARD_BG = CREAM;++/* ----------------------------------------------------------------- grain -- */++/** Tiling monochrome noise, alpha baked in. Prepend to any background stack. */+export const GRAIN = `url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeComponentTransfer%3E%3CfeFuncA type='linear' slope='0.1'/%3E%3C/feComponentTransfer%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E")`;++/** A solid colour with grain. */+export const grainBg = (color: string): CSSProperties => ({+ backgroundColor: color,+ backgroundImage: GRAIN,+ backgroundSize: "200px 200px",+});++/* ------------------------------------------------------------ mode themes -- */++export type ModeTheme = {+ /** Radial layers of the mesh (exactly four, see meshStyle's size list). */+ image: string;+ /** Base colour under the mesh. */+ base: string;+ /** Solid fill for the active nav pill. */+ pill: string;+ /** Softer fill for inline chips. */+ chip: string;+ /** Glyph colour on `chip`. On the solid `pill` glyphs use INK. */+ glyph: string;+ /** Wash behind the coded mockups. */+ panel: string;+ /** Decorative vertical bars inside the mockup panel. */+ bars: string;+ /** Accent for underlines, ticks, and eyebrow squares. */+ accent: string;+};++/** Mesh + grain, ready for a style prop. */+export const meshStyle = (t: ModeTheme): CSSProperties => ({+ backgroundColor: t.base,+ backgroundImage: `${GRAIN}, ${t.image}`,+ backgroundSize: "200px 200px, auto, auto, auto, auto",+});++export const MODE_THEME: Record<ModeKey, ModeTheme> = {+ instant: {+ image: [+ "radial-gradient(92% 95% at 6% 6%, #8FC1F7 0%, rgba(143,193,247,0) 66%)",+ "radial-gradient(70% 78% at 96% 2%, #CDEBF4 0%, rgba(205,235,244,0) 60%)",+ "radial-gradient(82% 76% at 92% 96%, #DDD7F8 0%, rgba(221,215,248,0) 62%)",+ "radial-gradient(92% 88% at 24% 100%, #AFD6F8 0%, rgba(175,214,248,0) 70%)",+ ].join(","),+ base: "#E4F0FB",+ pill: "#BFDCFC",+ chip: "#E1EFFE",+ glyph: "#3D77C2",+ panel: "rgba(143,193,247,0.18)",+ bars: "rgba(111,168,232,0.32)",+ accent: "#8DBCF0",+ },+ studio: {+ image: [+ "radial-gradient(80% 88% at 92% 8%, #B9A5F2 0%, rgba(185,165,242,0) 60%)",+ "radial-gradient(72% 80% at 4% 4%, #C3DCF8 0%, rgba(195,220,248,0) 60%)",+ "radial-gradient(84% 80% at 6% 98%, #F6D9EC 0%, rgba(246,217,236,0) 62%)",+ "radial-gradient(88% 72% at 68% 100%, #D5EDE6 0%, rgba(213,237,230,0) 66%)",+ ].join(","),+ base: "#EFE9FB",+ pill: "#DACBF9",+ chip: "#EFE7FD",+ glyph: "#7B5FD0",+ panel: "rgba(185,165,242,0.18)",+ bars: "rgba(167,139,240,0.30)",+ accent: "#BCA7F4",+ },+ screenshot: {+ image: [+ "radial-gradient(80% 88% at 8% 92%, #8FDCBB 0%, rgba(143,220,187,0) 60%)",+ "radial-gradient(72% 78% at 88% 4%, #E0D8F7 0%, rgba(224,216,247,0) 60%)",+ "radial-gradient(80% 80% at 96% 92%, #F8E7C8 0%, rgba(248,231,200,0) 64%)",+ "radial-gradient(88% 80% at 28% 2%, #C8EEDD 0%, rgba(200,238,221,0) 66%)",+ ].join(","),+ base: "#E5F3EC",+ pill: "#BFEDD8",+ chip: "#E2F6EC",+ glyph: "#3F9974",+ panel: "rgba(143,220,187,0.20)",+ bars: "rgba(111,203,164,0.32)",+ accent: "#93D9BC",+ },+ share: {+ image: [+ "radial-gradient(80% 88% at 92% 88%, #F5BE85 0%, rgba(245,190,133,0) 60%)",+ "radial-gradient(70% 74% at 4% 8%, #D6EDE1 0%, rgba(214,237,225,0) 60%)",+ "radial-gradient(80% 80% at 2% 94%, #F9D4C6 0%, rgba(249,212,198,0) 64%)",+ "radial-gradient(84% 74% at 58% 0%, #FBEAD0 0%, rgba(251,234,208,0) 68%)",+ ].join(","),+ base: "#F9F0E2",+ pill: "#FFD9AC",+ chip: "#FCEEDB",+ glyph: "#B07430",+ panel: "rgba(245,190,133,0.20)",+ bars: "rgba(240,168,96,0.32)",+ accent: "#F5C08A",+ },+};++/* ------------------------------------------------------------- typography -- */++export const SANS =+ "[font-family:var(--font-ht-sans),ui-sans-serif,system-ui,sans-serif]";++export const SERIF_BODY =+ "[font-family:var(--font-ht-serif),Georgia,serif] font-light";++export const MONO = "[font-family:var(--font-ht-mono),ui-monospace,monospace]";++/** 12px uppercase mono eyebrow. No colour: set it at the use site (Eyebrow.tsx). */+export const EYEBROW = `${MONO} text-[12px] font-normal uppercase leading-none tracking-[0.05em]`;++export const H_HERO = `${SANS} font-normal leading-[0.98] tracking-[-0.03em] text-[#111111]`;++export const H_SECTION = `${SANS} font-normal leading-[1.0] tracking-[-0.03em] text-[#111111]`;++export const H_CARD = `${SANS} font-normal leading-[1.04] tracking-[-0.03em] text-[#111111]`;++export const BODY_TEXT = `${SERIF_BODY} tracking-[-0.01em]`;++/* ---------------------------------------------------------------- buttons -- */++/**+ * Cap-blue primary action, glass finish: vertical gradient body, a bright+ * inset top edge, a soft ambient blue glow, and a top-half sheen overlay.+ */+export const BTN_PRIMARY = [+ "group relative inline-flex h-[48px] items-center justify-center overflow-hidden rounded-[12px] px-6",+ "text-[16px] font-medium text-[#111111] [text-shadow:0_1px_0_rgba(255,255,255,0.45)]",+ "[background:linear-gradient(180deg,#F5FAFE_0%,#E3EFFB_52%,#CFE2F6_100%)]",+ "shadow-[inset_0_0_0_1px_rgba(63,127,205,0.65),inset_0_2px_3px_-1px_rgba(255,255,255,0.8),inset_0_-1px_1px_rgba(61,119,194,0.2),0_1px_2px_rgba(61,119,194,0.2),0_10px_24px_-10px_rgba(120,178,240,0.55)]",+ "after:pointer-events-none after:absolute after:inset-x-[3px] after:top-[3px] after:h-[44%] after:rounded-t-[9px] after:bg-gradient-to-b after:from-white/35 after:to-transparent",+ "transition-[filter,transform,box-shadow] duration-200 hover:brightness-[1.03] hover:shadow-[inset_0_0_0_1px_rgba(52,116,196,0.78),inset_0_2px_3px_-1px_rgba(255,255,255,0.85),inset_0_-1px_1px_rgba(61,119,194,0.2),0_2px_4px_rgba(61,119,194,0.22),0_14px_30px_-10px_rgba(120,178,240,0.65)]",+ "active:translate-y-px active:brightness-[0.98]",+ "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#55A0EA] focus-visible:ring-offset-2 focus-visible:ring-offset-[#F8FAFC]",+].join(" ");++export const BTN_SECONDARY =+ "inline-flex h-[48px] items-center justify-center rounded-[10px] border border-[#D3DCE6] bg-white px-6 text-[16px] font-normal text-[#111111] transition-colors duration-200 hover:bg-[#EDF1F6] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111111] focus-visible:ring-offset-2 focus-visible:ring-offset-[#F8FAFC]";diff --git a/apps/web/components/pages/HomeTwo/visibility.ts b/apps/web/components/pages/HomeTwo/visibility.tsnew file mode 100644index 000000000..38391d0d1--- /dev/null+++ b/apps/web/components/pages/HomeTwo/visibility.ts@@ -0,0 +1,49 @@+"use client";++import {+ type RefObject,+ useEffect,+ useState,+ useSyncExternalStore,+} from "react";++const subscribeToVisibility = (notify: () => void) => {+ document.addEventListener("visibilitychange", notify);+ return () => document.removeEventListener("visibilitychange", notify);+};++const pageVisible = () => document.visibilityState !== "hidden";+const initiallyVisible = () => true;++export const usePageVisible = () =>+ useSyncExternalStore(subscribeToVisibility, pageVisible, initiallyVisible);++export const useInView = (+ ref: RefObject<Element | null>,+ margin = "-10% 0px -10% 0px",+) => {+ const [inView, setInView] = useState(false);+ useEffect(() => {+ const el = ref.current;+ if (!el) return;+ const io = new IntersectionObserver(+ ([entry]) => setInView(Boolean(entry?.isIntersecting)),+ { rootMargin: margin },+ );+ io.observe(el);+ return () => io.disconnect();+ }, [ref, margin]);+ return inView;+};++export const useReducedMotion = () => {+ const [reduced, setReduced] = useState(false);+ useEffect(() => {+ const query = window.matchMedia("(prefers-reduced-motion: reduce)");+ const sync = () => setReduced(query.matches);+ sync();+ query.addEventListener("change", sync);+ return () => query.removeEventListener("change", sync);+ }, []);+ return reduced;+};diff --git a/apps/web/public/backgrounds/liverpool.webp b/apps/web/public/backgrounds/liverpool.webpnew file mode 100644index 000000000..f36b5392eBinary files /dev/null and b/apps/web/public/backgrounds/liverpool.webp differdiff --git a/apps/web/public/backgrounds/london.webp b/apps/web/public/backgrounds/london.webpnew file mode 100644index 000000000..2aaca4f77Binary files /dev/null and b/apps/web/public/backgrounds/london.webp differdiff --git a/apps/web/public/backgrounds/miami.webp b/apps/web/public/backgrounds/miami.webpnew file mode 100644index 000000000..4ddceace4Binary files /dev/null and b/apps/web/public/backgrounds/miami.webp differdiff --git a/apps/web/public/backgrounds/monaco.webp b/apps/web/public/backgrounds/monaco.webpnew file mode 100644index 000000000..a6b28cac4Binary files /dev/null and b/apps/web/public/backgrounds/monaco.webp differdiff --git a/apps/web/public/backgrounds/nyc.webp b/apps/web/public/backgrounds/nyc.webpnew file mode 100644index 000000000..bb47e3b19Binary files /dev/null and b/apps/web/public/backgrounds/nyc.webp differdiff --git a/apps/web/public/backgrounds/rome.webp b/apps/web/public/backgrounds/rome.webpnew file mode 100644index 000000000..e5c7f31a2Binary files /dev/null and b/apps/web/public/backgrounds/rome.webp differdiff --git a/apps/web/public/backgrounds/santorini.webp b/apps/web/public/backgrounds/santorini.webpnew file mode 100644index 000000000..f65af11e5Binary files /dev/null and b/apps/web/public/backgrounds/santorini.webp differdiff --git a/apps/web/public/backgrounds/sf.webp b/apps/web/public/backgrounds/sf.webpnew file mode 100644index 000000000..deb5d122aBinary files /dev/null and b/apps/web/public/backgrounds/sf.webp differdiff --git a/apps/web/public/backgrounds/thumbs/liverpool.webp b/apps/web/public/backgrounds/thumbs/liverpool.webpnew file mode 100644index 000000000..819d1f788Binary files /dev/null and b/apps/web/public/backgrounds/thumbs/liverpool.webp differdiff --git a/apps/web/public/backgrounds/thumbs/london.webp b/apps/web/public/backgrounds/thumbs/london.webpnew file mode 100644index 000000000..5d9d7ffc7Binary files /dev/null and b/apps/web/public/backgrounds/thumbs/london.webp differdiff --git a/apps/web/public/backgrounds/thumbs/miami.webp b/apps/web/public/backgrounds/thumbs/miami.webpnew file mode 100644index 000000000..0537348fdBinary files /dev/null and b/apps/web/public/backgrounds/thumbs/miami.webp differdiff --git a/apps/web/public/backgrounds/thumbs/monaco.webp b/apps/web/public/backgrounds/thumbs/monaco.webpnew file mode 100644index 000000000..fe02d6e04Binary files /dev/null and b/apps/web/public/backgrounds/thumbs/monaco.webp differdiff --git a/apps/web/public/backgrounds/thumbs/nyc.webp b/apps/web/public/backgrounds/thumbs/nyc.webpnew file mode 100644index 000000000..d0fc57e4dBinary files /dev/null and b/apps/web/public/backgrounds/thumbs/nyc.webp differdiff --git a/apps/web/public/backgrounds/thumbs/rome.webp b/apps/web/public/backgrounds/thumbs/rome.webpnew file mode 100644index 000000000..1c58ebdc8Binary files /dev/null and b/apps/web/public/backgrounds/thumbs/rome.webp differdiff --git a/apps/web/public/backgrounds/thumbs/santorini.webp b/apps/web/public/backgrounds/thumbs/santorini.webpnew file mode 100644index 000000000..8f18f5f8dBinary files /dev/null and b/apps/web/public/backgrounds/thumbs/santorini.webp differdiff --git a/apps/web/public/backgrounds/thumbs/sf.webp b/apps/web/public/backgrounds/thumbs/sf.webpnew file mode 100644index 000000000..1ecf5b0b2Binary files /dev/null and b/apps/web/public/backgrounds/thumbs/sf.webp differdiff --git a/apps/web/public/illustrations/homepage-animation-poster.jpg b/apps/web/public/illustrations/homepage-animation-poster.jpgnew file mode 100644index 000000000..1dfa45f8fBinary files /dev/null and b/apps/web/public/illustrations/homepage-animation-poster.jpg differdiff --git a/apps/web/public/videos/home-two/webcam-poster.jpg b/apps/web/public/videos/home-two/webcam-poster.jpgnew file mode 100644index 000000000..4b6aa3b79Binary files /dev/null and b/apps/web/public/videos/home-two/webcam-poster.jpg differdiff --git a/apps/web/public/videos/home-two/webcam.mp4 b/apps/web/public/videos/home-two/webcam.mp4new file mode 100644index 000000000..d56d9d384Binary files /dev/null and b/apps/web/public/videos/home-two/webcam.mp4 differ