# Prompt: rebuild "Cullet" (a real-time material studio whose hero is a slab of cut glass)

Paste everything below the line into your AI coding agent.

---

Build a landing page in **Next.js 16 (App Router) + React 19 + TypeScript + Tailwind CSS v4** at `/cullet` for a fictional company called **Cullet** (Cullet Lab): a browser studio for authoring real-time glass materials (dispersion, transmission, refraction, roughness, a thin film) and exporting them as plain glTF with the KHR material extensions, USDZ, or a typed three.js module. Slogan: *"Designed in glass."* Plans: Sketch $0, Studio $24 a seat ($19 billed yearly), Foundry custom. Install `npm i next react react-dom three lenis`. Read the installed Next docs before using any API. Keep the whole copy unit inside `src/app/(cullet)/`, importing only npm packages and files from that folder.

**The central idea: glass is cut, not drawn, so the page is a slab of frosted quartz cleaved along its cut lines.** The hero is a slab of eleven extruded glass shards carrying the page's text; scrolling cleaves it apart to reveal the next chapter; "Read paper" shatters it into a technical note and "Back" reassembles it; further down, one piece of glass becomes a live sampler.

Mood: clinical, high-key, optical, quiet, precise. Number the chapters like a lab notebook (Chapter 01 … 07). Specific numbers only: 1.6 ms per material at 1080p, 60 fps with dispersion on a three-year-old phone, 0 baked maps, 41,200 materials cut.

## Brand

- **Palette (eight colours; tints only via `color-mix()`, registered in `scripts/templates.config.ts`):** ink `#0F1117` (text, the CTA pill, the Open slab), paper `#F4F5F8` (page), white `#FFFFFF` (the glass, cards), slate `#525866` (muted text), mist `#9AA1B2` (hairlines; muted text on ink only), haze `#DCE8FF` (cool fill light, tints), cobalt `#2563EB` (the one accent: links, focus, selection, chapter labels), emerald `#10B981` (rare: CTA hover, success, live dots). One palette-exempt file, `sampler/spectrum.ts`, holds six wavelength stops (650–420 nm) used only where a ray has split.
- **Type (`next/font/google`, distinct variables):** Inter 400/500/600 (`--font-fc-inter`) for body and the hero print; Inter Tight 500/600 (`--font-fc-tight`) for display, tracking −0.03 to −0.05em; Geist Mono 400/500 (`--font-fc-mono`, `preload: false`) for chapter labels, codes and readouts.
- **Logo:** an ink tile (rx 5.4 in a 24 viewBox) with one cut shard traced in paper, `M5.3 6.7 13.4 4.3 19.7 12.5 10.6 19.7Z`, beside "Cullet" in Inter Tight 600. Ship `brand/Logo.tsx`, `icon.svg` (with one cobalt edge) and a 1200×630 `opengraph-image.tsx` drawing the cut slab behind "Designed / in glass.".
- **Corners:** rounded. Shards 20·s, cards 20–24px, buttons 8–10px, the hero CTA 6px.
- **Signature details:** text printed on the glass and cut by the gaps (yet still selectable); a numbered chapter rail with a sliding glass pill; live readouts (frame time, Abbe number, the glTF line that flashes as you turn a dial); catalogue codes CU-152…; the slab's l1→J1 cut line recurring as the materials sheet's top edge and as a cobalt cut through the footer wordmark; `KHR_materials_dispersion` as a recurring caption.

## The hero: a cut slab of quartz (port this exactly)

Pure, tested geometry in `cut/`:

- **The cut** in region units (x right, y down). Edge points `t1 (.27,0) t2 (.68,0) r1 (1,.48) b1 (.44,1) l1 (0,.36) l2 (0,.78)` and junctions `J1 (.34,.28) J2 (.62,.24) J3 (.81,.41) J4 (.26,.57) J5 (.51,.61) J6 (.72,.69)`, each with periods `px, py` (11.9–18.2 s) and a phase. Each point drifts `sin(2πt/px + φ)·0.017` in x and `cos(2πt/py + 1.3φ)·0.017` in y (edge points move only along their edge), and moves away from the pointer within 0.48 by `(1 − d/0.48)²·0.028`. Eight shards: `[TL,t1,J1,l1] [t1,t2,J2,J1] [t2,TR,r1,J3,J2] [l1,J1,J4,l2] [J1,J2,J5,J4] [J2,J3,J6,J5] [l2,J4,J5,b1,BL] [b1,J5,J6,J3,r1,BR]`, which tile the panel at any time. The nav is three shards split by two slanted cuts (landscape 0.25→0.29 and 0.79→0.75 across its height; portrait 0.30→0.33 and 0.78→0.74), swaying ±0.007.
- **Glass metrics:** `s = slabW / 1730`; inset every polygon by half of a `14·s` gap (mitre offset); round corners with quadratic tangents of radius `20·s`, capped at 42% of an edge; extrude `14·s` with a `3·s` bevel.
- **Layout:** the slab is inset `8.5svh 5.5vw` (16px on phones) inside a sticky 100svh stage of a 230svh section. Nav band `max(48px, 10.8% of slab height)`, gap `max(8px, 14·s)`, the panel below. Panel text sized with container units: eyebrow "REAL-TIME MATERIAL STUDIO" (tracked 0.2em), headline "Designed / in glass." `clamp(38px, min(7.8cqw, 20cqh), 220px)` weight 600, −0.045em, line-height 0.97; sub copy "Author dispersion, transmission, and refraction in the browser. / Live previews, real materials."; an ink "Open studio" pill and "Read paper →"; a hairline registration ring; footer "© Cullet Lab" and "KHR_materials_dispersion". Nav: mark + "Cullet" | "Studio · Materials · Pricing" | "Sign in".
- **WebGL (three.js `WebGLRenderer`, `MeshPhysicalMaterial`):** white glass with emissive `0xf0f4fa` at 0.35, roughness 0.22, clearcoat 1 at 0.08, IOR 1.52, iridescence 0.65 (IOR 1.35, 280–680 nm), env 1.15, under a `RoomEnvironment` PMREM (0.85) and a high-key rig (ambient 1.35, hemisphere white/haze 1.15, key 2.2 from upper left, cool fill 1.35 from below right, rim 1.1). A haze-coloured shadow plane sits behind each shard. Camera FOV 30 placed so 1 world unit = 1 CSS px. The page group tilts toward the pointer (rotateY `x·3.5° − 1.2°`, rotateX `y·2.75° + 0.8°`, τ 0.3 s). The shard under the pointer lifts 50·s (nav 32·s) and tips up to ±0.24 rad on a spring (k 170, c 19), and its iridescence rises to 1 and env to 2. `onBeforeCompile` adds a cobalt and rose blush that follows the pointer (`exp(−1.6·(d/max(120, 300s))²)`). Rebuild the drifting geometry at ~45 fps.
- **Printed text, real DOM:** the DOM is the layout and a canvas is the ink. `print.ts` draws every `[data-print]` element (`text` / `box` / `mark` / `ring`) at its offset in its own computed font, letter-spacing and `--print` / `--print-bg` / `--print-line` variables (hover and focus restyle those, and the print redraws once per frame). Each shard's cap uses UVs mapped to the whole region. The DOM stays on top, transparent, mapped onto the tilted glass with a homography: solve the 8-DOF projective map from the plane's rectangle to its four projected corners and apply it as `matrix3d()` with `transform-origin: 0 0`. Text stays selectable and every link focusable.
- **Poster first:** draw the same cut as eleven HTML-positioned SVGs (frosted gradient, white rim, two drop-shadows), server-rendered for a laptop and a phone guess and then refit to the real box. WebGL takes over on idle with a fine pointer; on touch screens only after a "Light the glass" tap; never under reduced motion. The handover is a short lift-and-land, not a fly-in.
- **Cleave (scroll):** `cleave = range(pinProgress, 0.04, 0.82)`; per shard `easeInCubic(range(c, 0.035i, 0.035i + 0.62))`; each flies `520·s·f` along its outward direction (from the slab centre) and `(460–800)·s·f` toward the camera, tumbling; the poster does the same in CSS from `--cleave`. Behind the glass, "Chapter 01 / Real-time glass, in five terms." fades up. The slab ignores pointers while cleaving.
- **Shatter (Read paper):** ease-in-cubic over 0.72 s, 30 ms stagger, with gravity `640·s·f²`; at 280 ms a dialog opens: "Technical note 07 · Dispersion in a single forward pass." with three paragraphs, three figures and a link to the terms, beside a skewed quartz sliver behind "← Back" that wobbles and tips toward the pointer. Back or Escape reassembles (back-ease, 0.12 s wait) and returns focus to Read paper. The slab is `inert` and the scroll locked while it is open. Without JS, Read paper is a link to `#terms`.

## Page

1. **Header** (fixed glass bar): lockup, Terms · Studio · Materials · Pricing with a cobalt indicator that slides (transform only) to the current section, "Open studio". It arrives once the slab has cleaved, tucks away on scroll-down and returns on scroll-up, and has a page-progress hairline. On phones: a menu sheet that opens with a clip-path circle from the toggle, staggers its links, traps focus, closes on Escape and gives focus back.
2. **Terms** (`#terms`, Chapter 01, held for 5 × 78svh on ≥960px): a rail of five numbered terms (Iridescence, Index of refraction, Dispersion, Transmission, Roughness) with a sliding glass pill; one glass figure at a time with an SVG ray diagram (thin film, Snell, prism with a spectral fan, a frosted slab scattering, micro-shards with narrow and wide cones), a readout chip, `01 / 05`, the term and its definition. Each step wipes the figure in on a diagonal and draws its rays in order. The rail jumps to a step. Elsewhere it is five stacked cards.
3. **Studio** (`#sampler`, Chapter 02, "Turn the dials. Watch the light."): a white sheet that slides over the held terms. A 4:3 stage (WebGL near the viewport on desktop, on tap on touch) with a 10-face lathe gem in transmissive `MeshPhysicalMaterial` in front of a striped studio card, turning slowly and dragged with inertia, with a HUD ("Live · WebGL" and the measured frame time). Six preset chips; five range dials (IOR 1–2.4, dispersion 0–1, roughness 0–1, thickness 0.1–4 cm, iridescence 0–1); the Abbe number; and a glTF readout (`KHR_materials_ior/_dispersion/_transmission/_volume/_iridescence`) whose changed line flashes, with "Copy JSON". Before WebGL, an SVG poster answers every dial: the fan bends `34°·(ior−1)`, spreads `46°·d·(ior−1)`, blurs with roughness, and a film tint follows iridescence.
4. **Workflow** (`#workflow`, Chapter 03, "Cut. Preview. Ship."): three steps joined by a drawn cobalt line, each with a working surface: a layer stack, three renderer tiles with ms readouts, and a code snippet.
5. **Materials** (`#materials`, Chapter 04, "Six cuts to start from."): a white sheet whose top edge is a cut line that levels out as it enters. Six cards (Crown silica CU-152, Dense flint CU-172, Frosted quartz CU-154, Borosilicate CU-147, Sapphire CU-177, Opal film CU-145) with palette-only CSS glass swatches, IOR / Abbe / roughness, a use line, and "Open in studio", which loads the preset into the sampler and travels there.
6. **Proof** (`#proof`, Chapter 05, "Glass that fits in a frame."): four count-up stats with drawn rules, a marquee of renderers that read the export, three studio notes.
7. **Pricing** (`#pricing`, Chapter 06, "Pay for the seat, not the render."): a monthly/yearly radio switch with a sliding pill; three cuts; prices roll in on change.
8. **Open** (`#open`, Chapter 07, ink): "Your first glass is ten minutes away." with a seat form: work email, a role chip group, team size. Rules in `forms/request.ts` (tested). Invalid fields shake once, messages slide down, and focus goes to the first error. Submit shows "Cutting your seat…", then the form cleaves away and a glass shard settles with an emerald tick: "Your seat is cut." with a stable seat number and a starter material. No network request.
9. **Footer:** lockup, index, a giant wordmark with a cobalt cut through it, "© 2026 Cullet Lab · a fictional brand for a landing-page template", "Back to the slab ↑".

## Motion

- **Identity:** precise and physical. Verbs: **cleave** and **settle**. Signature moment: the scroll-scrubbed cleave of the hero slab.
- **Tokens in `@theme`:** out `cubic-bezier(0.22, 1, 0.36, 1)`, out-expo `cubic-bezier(0.16, 1, 0.3, 1)`, in-out `cubic-bezier(0.77, 0, 0.175, 1)`, in `cubic-bezier(0.55, 0, 0.9, 0.35)` (the shatter only), back `cubic-bezier(0.34, 1.45, 0.64, 1)`, spring `linear(0, 0.35 8%, 0.82 20%, 1.06 30%, 1.02 42%, 0.99 58%, 1)`; durations 90 / 180 / 300 (hover fills, label rolls, toggles) / 420 / 800 / 1200 ms; shift 28px; stagger 70ms.
- **Load (CSS keyframes, before hydration):** backdrop settles from 1.08, poster settles from an 8px blur, nav items drop at 150ms + 50ms, headline rises through masks, copy and CTAs follow.
- **Reveals (one IntersectionObserver flips `data-in`):** mask-rise titles, slide labels, rise copy, scale-rise card cascades, diagonal clip-path cleave wipes (clip the child, observe the parent), drawn lines and rays, count-ups.
- **States:** buttons fill-wipe and roll their label (`content: attr(data-text) / ""`), press to .97 with a spring release; cards lift with a pointer spotlight, a swatch sheen and dimmed siblings; links draw their underline; the header indicator, rail pill and pricing pill slide.
- **One scroll owner** (`motion/ScrollDirector.tsx`) writes `--cleave`, the terms' `--p` and active step, the materials' `--enter`, page progress and the header state from a single rAF. Lenis (lerp 0.1) runs on fine pointers with motion allowed and answers `fc:goto` and `fc:lock`.
- **Reduced motion and no JS:** hidden states live inside `(prefers-reduced-motion: no-preference) and (scripting: enabled)`; neither WebGL engine mounts; nothing is held; a `<noscript>` reveal override.

## Quality bar

- Animate only transforms, opacity and clip-path (plus the one-shot load blur). CLS 0. No horizontal overflow at 375px.
- One h1, landmarks, real buttons and links, AA contrast, visible focus rings (they survive on the transparent DOM over the glass), a labelled paper dialog with a focus trap.
- Structure: `brand/`, `cut/` (geometry, pattern, homography + tests), `hero/` (poster, engine, print, controller), `terms/`, `sampler/` (params + tests, engine, poster), `sections/`, `forms/` (rules + tests), `content/` (typed data + tests), `motion/` (math, progress + tests, primitives, the director).
- Playwright covers the WebGL takeover and the homography transform, the scroll cleave, the paper (focus, inert, Escape, Back), the held terms and rail, the dials and the glTF readout, presets and "Open in studio", pricing, the form (errors, focus, success, no request), reveals and hover, reduced motion (no WebGL, nothing hidden), and the phone (tap to light, menu, no overflow).
