Skip to content

Play a finished motion-graphics ad in sync with the rough drafts it grew from, and export the breakdown as MP4.

Create standalone Null public UI starter

waselyabdadcea4693
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f02301e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,9 @@
+node_modules/
+.env
+.env.*
+!.env.example
+*.log
+coverage/
+.artifacts/
+.DS_Store
+Thumbs.db
diff --git a/AGENTS.md b/AGENTS.md
new file mode 100644
index 0000000..00dcf45
--- /dev/null
+++ b/AGENTS.md
@@ -0,0 +1,9 @@
+# Null
+
+This is an independent public UI starter. Keep its history, configuration, and data separate from the original Null Motion project.
+
+- Use Node.js 22+; `npm start`, `npm run check`, and `npm test` are the project commands.
+- Browser requests must use this project's origin. Never hardcode another local companion or copy personal databases, credentials, renders, or provider settings.
+- Preserve the inherited interface. Verify UI changes in a real browser at narrow and wide widths.
+- Generation, rendering, and Premiere are unconnected. Keep UI status honest until those services exist.
+- Preserve bundled third-party notices. Do not introduce a project license without the owner's decision.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..af02dd9
--- /dev/null
+++ b/README.md
@@ -0,0 +1,42 @@
+# Null
+
+A fresh public project using Null Motion's existing interface: a dark motion workspace, template gallery, prompt composer, reference and script pages, and render library layout.
+
+This first version is a **UI starter**. Template previews, navigation, local draft controls, and template selection work. AI generation, video rendering, template management, themes, and Premiere integration are not connected. Those actions return an explicit “not connected” message; no fake jobs or generated results are shown.
+
+## Run locally
+
+Install Node.js 22 or newer, then:
+
+```sh
+npm start
+```
+
+Open <http://127.0.0.1:4343>. There are no runtime packages to install and no credentials to configure.
+
+The optional `PORT` environment variable changes the port. `HOST` defaults to `127.0.0.1`; set it to your hosting environment's required bind address when deploying. This repository does not provision a hosted service.
+
+## Develop
+
+```sh
+npm run dev
+npm run check
+npm test
+```
+
+- `public/`: the inherited UI, styles, template previews, and artwork.
+- `data/template-catalog.json`: the bundled template definitions.
+- `server.js`: a standalone static server with read-only UI data routes.
+- `test/`: checks for previews, empty state data, disabled backend actions, and file isolation.
+
+The browser calls this project's own origin. It does not connect to the original Null Motion companion. Build new authenticated backend routes before enabling generation or shared data storage.
+
+## Project boundary
+
+This project starts with fresh Git history. It contains no personal render history, database, provider configuration, local credentials, or Premiere extension. Drafts and UI preferences use this project's browser origin.
+
+The original UI is retained to provide a starting point; inherited provider names, timing labels, and pipeline diagrams describe the future integration surface, not implemented service guarantees. External AI tools require their own accounts and may need to open in a separate tab.
+
+## Third-party notices
+
+The bundled GSAP file retains its copyright and license header; see [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md). Brand artwork belongs to its respective owners. No project-wide open-source license has been selected.
diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md
new file mode 100644
index 0000000..595a839
--- /dev/null
+++ b/THIRD_PARTY_NOTICES.md
@@ -0,0 +1,5 @@
+# Third-party notices
+
+`public/_vendor/gsap.min.js` is GSAP 3.14.2. Its original copyright and license header is preserved. License terms: <https://gsap.com/standard-license>.
+
+Template previews include third-party application marks for illustrative purposes. Those marks remain the property of their respective owners; their inclusion does not imply endorsement or grant trademark rights.
diff --git a/data/template-catalog.json b/data/template-catalog.json
new file mode 100644
index 0000000..7272448
--- /dev/null
+++ b/data/template-catalog.json
@@ -0,0 +1,600 @@
+{
+ "schemaVersion": 1,
+ "templates": [
+ {
+ "id": "05-app-icons",
+ "version": 3,
+ "name": "App Icon Float",
+ "description": "Approved logos rise and settle as a clean vertical lineup",
+ "category": "short",
+ "prompt": "A vertical transparent logo lineup. Three approved app marks rise from below on shallow arcs, settle as equal visual weights, and hold with restrained depth and clean silhouettes. Keep the marks undistorted and locally frozen. No generic tiles, looping bob, or decorative glow spam.",
+ "output": {
+ "width": 1080,
+ "height": 1920,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "05-app-icons/index.html",
+ "thumbnail": null
+ },
+ "customizer": {
+ "id": "app-icon-motion",
+ "defaults": {
+ "visibleCount": 3,
+ "entrance": "up",
+ "viewAngle": "front",
+ "splitFromHero": "off"
+ },
+ "fields": [
+ {
+ "key": "visibleCount",
+ "type": "integer",
+ "label": "Visible icons",
+ "minimum": 1,
+ "maximum": 4
+ },
+ {
+ "key": "entrance",
+ "type": "select",
+ "label": "Entrance",
+ "options": [
+ "up",
+ "down",
+ "left",
+ "right"
+ ]
+ },
+ {
+ "key": "viewAngle",
+ "type": "select",
+ "label": "View angle",
+ "options": [
+ "front",
+ "three-quarter-left",
+ "three-quarter-right",
+ "half-turn",
+ "full-turn"
+ ]
+ },
+ {
+ "key": "splitFromHero",
+ "type": "select",
+ "label": "Split from hero",
+ "options": [
+ "off",
+ "on"
+ ]
+ }
+ ]
+ },
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 4,
+ "purpose": "Replace the four authored app-icon slots with approved brand logos; four are required for the optional hero split."
+ }
+ ],
+ "qualityStatus": "approved"
+ },
+ {
+ "id": "27-icon-stack-rise",
+ "version": 2,
+ "name": "Icon Stack Rise",
+ "description": "A master mark unfolds into a balanced product family",
+ "category": "short",
+ "prompt": "A vertical transparent brand-family reveal. One approved master mark rises with three approved product marks stacked behind it; the master flips into the lead product as the rear marks fan into an optically balanced row. Hold the resolved lineup, then exit upward. Preserve every mark exactly and keep depth restrained.",
+ "output": {
+ "width": 1080,
+ "height": 1920,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "27-icon-stack-rise/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 4,
+ "required": true,
+ "purpose": "Use one approved master-brand logo and three approved product icons for the flip-and-fan reveal."
+ }
+ ],
+ "qualityStatus": "approved"
+ },
+ {
+ "id": "07-chat-sim",
+ "version": 1,
+ "name": "AI Chat Sim",
+ "description": "Typing conversation",
+ "category": "short",
+ "prompt": "A vertical 1080x1920 transparent overlay simulating an AI chat: a grey user bubble pops in, a typing indicator pulses, then the AI answer types out character-by-character with a blinking cursor, then action icons fade in. Clean, ChatGPT-style.",
+ "output": {
+ "width": 1080,
+ "height": 1920,
+ "duration": 7,
+ "fps": 30
+ },
+ "preview": {
+ "html": "07-chat-sim/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "08-prompt-bar",
+ "version": 1,
+ "name": "Prompt Bar",
+ "description": "Text typed into input",
+ "category": "short",
+ "prompt": "A vertical 1080x1920 transparent overlay: a sleek pill-shaped chat input bar slides up, a phrase types itself in with a blinking cursor, then the white circular send button presses. Glassy dark bar, premium easing.",
+ "output": {
+ "width": 1080,
+ "height": 1920,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "08-prompt-bar/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "02-three-step",
+ "version": 1,
+ "name": "Triple Sequence",
+ "description": "3-step explainer",
+ "category": "long",
+ "prompt": "A 1920x1080 transparent overlay: three metallic glass cards (01/02/03) stagger in bottom-up with scale+fade, each with an icon, title, description and a metallic progress bar that wipes in. Mannequin grey aesthetic, power4.out.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 7,
+ "fps": 30
+ },
+ "preview": {
+ "html": "02-three-step/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "03-slide-showcase",
+ "version": 1,
+ "name": "Slide-In Showcase",
+ "description": "Headline reveal",
+ "category": "long",
+ "prompt": "A 1920x1080 transparent overlay: a 1px metallic divider draws down, then an eyebrow, large silver gradient headline, and subtitle slide in horizontally from a mask, staggered. Left-aligned, expo/power4 easing.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "03-slide-showcase/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "04-morph-panel",
+ "version": 1,
+ "name": "Morph Panel",
+ "description": "Button to modal",
+ "category": "long",
+ "prompt": "A 1920x1080 transparent overlay: a small glossy obsidian button rises in, then morphs (width/height/radius) into a large panel, its label fading out as a header and content rows fade in. power4.inOut, premium.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 6,
+ "fps": 30
+ },
+ "preview": {
+ "html": "04-morph-panel/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "13-compare-bars",
+ "version": 1,
+ "name": "Compare Bars",
+ "description": "Before / after metric",
+ "category": "data",
+ "prompt": "A 1920x1080 transparent overlay on an obsidian glass card with faint gridlines: two bars grow up from a baseline — a short dim grey '1x' bar, then a tall silver-gradient '10x' bar with a soft bloom — then a glossy obsidian caption pill reading '10x faster' rises in. power4.out, premium metallic.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "13-compare-bars/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "14-leaderboard",
+ "version": 1,
+ "name": "Model Leaderboard",
+ "description": "Ranked tool list",
+ "category": "data",
+ "prompt": "A 1920x1080 transparent overlay: a vertical ranked list of four rows slides in from the left, staggered — each row has a rank number, a rounded obsidian app-icon tile with a soft glow, a name (Veo 3.1, Kling, Grok Imagine, Sora), and a silver score that fades in. Dark glass rows, power4.out. Swap in my brands.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "14-leaderboard/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 4,
+ "purpose": "Use approved logos for the ranked products or brands."
+ }
+ ],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "15-bar-3d",
+ "version": 1,
+ "name": "3D Bar Hero",
+ "description": "Hero stat with icon",
+ "category": "data",
+ "prompt": "A 1920x1080 transparent overlay: three pseudo-3D bars with floor reflections grow up from a baseline, the tall center silver bar blooms, and a rounded obsidian icon tile plus a large silver-gradient headline ('Worth your time and money') ride in on top. back.out tile pop, power4.out bars, premium.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "15-bar-3d/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 1,
+ "purpose": "Replace the hero icon tile when a real product or brand is featured."
+ }
+ ],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "16-line-growth",
+ "version": 1,
+ "name": "Line Growth",
+ "description": "Rising trend curve",
+ "category": "data",
+ "prompt": "A 1920x1080 transparent overlay: silver chart axes draw in, faint gridlines fade, then a glowing silver-gradient curve draws itself left-to-right rising toward the top-right with a soft fill underneath, and three obsidian marker tiles pop onto the line in sequence. power2.inOut draw, back.out markers.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "16-line-growth/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "17-integrations-grid",
+ "version": 1,
+ "name": "Integrations Grid",
+ "description": "Connect-apps cards",
+ "category": "ui",
+ "prompt": "A 1920x1080 transparent overlay: a 3x2 grid of obsidian glass integration cards pop in one after another with scale+fade — each card has a rounded glowing icon tile, an app name (Atlassian, Linear, Miro, Shopify, Notion, Canva), a one-line description and a '+' add button. Metallic dark, power4.out. Swap in my apps.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "17-integrations-grid/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 6,
+ "purpose": "Use approved app logos for the integration cards."
+ }
+ ],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "19-phone-showcase",
+ "version": 1,
+ "name": "Phone Showcase",
+ "description": "3D app mockup",
+ "category": "ui",
+ "prompt": "A 1920x1080 transparent overlay: a metallic silver phone with a dynamic island tilts in from a 3D angle and settles upright, a light glint sweeps across the bezel, and the dark app UI (a 'My Store' screen with a search bar and list rows) rises in. Then a gentle idle rotation. power4.out, premium.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "19-phone-showcase/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "screenshot",
+ "count": 1,
+ "purpose": "Replace the placeholder phone UI with an approved product screen when available."
+ }
+ ],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "20-search-typing",
+ "version": 1,
+ "name": "Search Typing",
+ "description": "Query types itself",
+ "category": "ui",
+ "prompt": "A 1920x1080 transparent overlay: a large silver-gradient wordmark, then a glossy obsidian search pill with a magnifier slides up and a phrase types itself in with a blinking caret, then two dark action buttons fade in below. Clean, premium, power3.out. Swap in my brand + query.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "20-search-typing/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 1,
+ "purpose": "Use an approved brand wordmark when the search experience represents a real product."
+ }
+ ],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "21-connector-list",
+ "version": 1,
+ "name": "Connector List",
+ "description": "Pick a tool row",
+ "category": "ui",
+ "prompt": "A 1920x1080 transparent overlay: a vertical list of obsidian rows slides in from the left, staggered — each with a glowing icon tile, a name (Notion, Perplexity, Lovable AI, Stripe, Supabase), a description and a chevron. Then a cursor glides in and a glassy highlight snaps onto one row with a soft glow pulse. power4.out.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "21-connector-list/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 5,
+ "purpose": "Use approved product logos for connector rows."
+ }
+ ],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "23-prompt-composer",
+ "version": 1,
+ "name": "Prompt Composer",
+ "description": "Prompt + attach + send",
+ "category": "ui",
+ "prompt": "A 1920x1080 transparent overlay: a glassy obsidian chat composer card rises in, a prompt types itself out with some words bolded and a couple silver-highlighted, an attachment chip pops in at the bottom, then a cursor glides to the white circular send button and presses it. Blinking caret, premium easing.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "23-prompt-composer/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "18-cta-click",
+ "version": 1,
+ "name": "Button Click",
+ "description": "CTA gets pressed",
+ "category": "overlay",
+ "prompt": "A 1920x1080 transparent overlay: a glossy obsidian CTA pill with a silver 'Publish' label and a faint focus ring settles in, then a cursor glides over and presses it — the button dips and springs back, a ripple expands and the ring pulses with a soft glow. expo.out in, back.out press, premium.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 4,
+ "fps": 30
+ },
+ "preview": {
+ "html": "18-cta-click/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "22-kinetic-headline",
+ "version": 3,
+ "name": "Kinetic Headline",
+ "description": "One-word emphasis with authored editorial motion",
+ "category": "overlay",
+ "prompt": "A transparent editorial headline emphasizing one word in a dimensional pill. Establish a fine guide and bounded atmosphere, bring the side words in on opposing shallow arcs, compress the emphasized word in anticipation, then settle it with one restrained overshoot and a single sheen. Hold the resolved line clearly. No fake UI or decorative clutter.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 4,
+ "fps": 30
+ },
+ "preview": {
+ "html": "22-kinetic-headline/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "approved"
+ },
+ {
+ "id": "26-null-manifesto",
+ "version": 2,
+ "name": "Null Manifesto",
+ "description": "Null Motion brand statement with a clear focal hierarchy",
+ "category": "overlay",
+ "prompt": "A five-second transparent Null Motion brand statement. Reveal the supplied Null mark and the exact headline 'THE KING OF MOTION GRAPHICS' as one balanced composition with a masked type entrance, a restrained orbit response, one chrome glint, and a readable hold before a clean alpha-safe exit. Keep the authentic mark undistorted; remove decorative telemetry that competes with the message.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "26-null-manifesto/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 1,
+ "required": true,
+ "purpose": "Use the supplied Null Motion logo asset."
+ }
+ ],
+ "qualityStatus": "approved"
+ },
+ {
+ "id": "24-showreel-notify",
+ "version": 1,
+ "name": "Showreel Notify",
+ "description": "Title + phone alert",
+ "category": "short",
+ "prompt": "A vertical 1080x1920 transparent overlay: a big glowing silver headline drops in up top, a dark obsidian phone rises into the center, a glassy notification toast ('+49 123 456 7890 — I need a creator!') drops onto the screen with a back.out bounce and a red badge pops, a huge silver '2025' rises from the bottom, and the phone idles with a gentle float.",
+ "output": {
+ "width": 1080,
+ "height": 1920,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "24-showreel-notify/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "01-cta-pill",
+ "version": 1,
+ "name": "Chrome CTA",
+ "description": "Subscribe / CTA",
+ "category": "overlay",
+ "prompt": "A 1920x1080 lower-third transparent overlay: a glossy obsidian pill rises in with a silver-gradient label and subcopy, a metallic glint sweeps across the pill face near the end. Premium, expo.out.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 4,
+ "fps": 30
+ },
+ "preview": {
+ "html": "01-cta-pill/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "06-notification",
+ "version": 1,
+ "name": "Notification Stack",
+ "description": "Toasts dropping in",
+ "category": "overlay",
+ "prompt": "A 1920x1080 transparent overlay: glassy notification toasts (icon + title + subtitle + timestamp) drop in one after another and stack, each with a back.out bounce. iOS/Gmail style on dark glass.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "06-notification/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [],
+ "qualityStatus": "legacy"
+ },
+ {
+ "id": "12-blur-reveal",
+ "version": 1,
+ "name": "Blur Reveal",
+ "description": "Logo unblurs",
+ "category": "overlay",
+ "prompt": "A 1920x1080 transparent overlay: a dark glass plate with a logo + wordmark drops in heavily blurred, then a light sweep wipes across and the mark + wordmark sharpen from blur to crisp with a soft glow bloom.",
+ "output": {
+ "width": 1920,
+ "height": 1080,
+ "duration": 5,
+ "fps": 30
+ },
+ "preview": {
+ "html": "12-blur-reveal/index.html",
+ "thumbnail": null
+ },
+ "customizer": null,
+ "assetIntent": [
+ {
+ "type": "logo",
+ "count": 1,
+ "required": true,
+ "purpose": "Use an approved logo and wordmark as the reveal subject."
+ }
+ ],
+ "qualityStatus": "legacy"
+ }
+ ]
+}
diff --git a/package-lock.json b/package-lock.json
new file mode 100644
index 0000000..75d59e7
--- /dev/null
+++ b/package-lock.json
@@ -0,0 +1,15 @@
+{
+ "name": "null",
+ "version": "0.1.0",
+ "lockfileVersion": 3,
+ "requires": true,
+ "packages": {
+ "": {
+ "name": "null",
+ "version": "0.1.0",
+ "engines": {
+ "node": ">=22"
+ }
+ }
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..d204bd3
--- /dev/null
+++ b/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "null",
+ "version": "0.1.0",
+ "private": true,
+ "description": "A fresh public motion UI based on Null Motion.",
+ "type": "module",
+ "scripts": {
+ "start": "node server.js",
+ "dev": "node --watch server.js",
+ "test": "node --test",
+ "check": "node scripts/check.js"
+ },
+ "engines": { "node": ">=22" }
+}
diff --git a/public/01-cta-pill/index.html b/public/01-cta-pill/index.html
new file mode 100644
index 0000000..95c50bb
--- /dev/null
+++ b/public/01-cta-pill/index.html
@@ -0,0 +1,130 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Chrome CTA Pill</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+
+ #root {
+ position: relative;
+ width: 1920px;
+ height: 1080px;
+ background: transparent;
+ overflow: hidden;
+ font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+
+ /* Lower-third anchor: centered, lower 20% of frame */
+ #cta-wrap {
+ position: absolute;
+ left: 50%;
+ bottom: 140px;
+ transform: translateX(-50%);
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ gap: 22px;
+ }
+
+ /* Glossy obsidian pill — matches the reference render */
+ #pill {
+ position: relative;
+ padding: 30px 78px;
+ border-radius: 999px;
+ background:
+ linear-gradient(180deg, #2b2b2e 0%, #161618 46%, #0a0a0b 100%);
+ box-shadow:
+ inset 0 2px 1px rgba(255,255,255,0.22),
+ inset 0 -3px 6px rgba(0,0,0,0.85),
+ inset 0 22px 26px rgba(255,255,255,0.05),
+ 0 30px 55px rgba(0,0,0,0.55),
+ 0 2px 0 rgba(255,255,255,0.04);
+ border: 1px solid rgba(255,255,255,0.10);
+ overflow: hidden;
+ will-change: transform, opacity;
+ }
+ /* top specular highlight cap */
+ #pill::before {
+ content: "";
+ position: absolute;
+ inset: 2px 2px 52% 2px;
+ border-radius: 999px 999px 60% 60% / 999px 999px 80% 80%;
+ background: linear-gradient(180deg, rgba(255,255,255,0.30), rgba(255,255,255,0.0));
+ pointer-events: none;
+ }
+ /* moving glint */
+ #pill::after {
+ content: "";
+ position: absolute;
+ top: 0; left: -60%;
+ width: 45%; height: 100%;
+ background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.0) 35%, rgba(255,255,255,0.55) 50%, rgba(255,255,255,0.0) 65%, transparent 100%);
+ transform: skewX(-18deg);
+ pointer-events: none;
+ }
+ #label {
+ position: relative;
+ font-size: 40px;
+ font-weight: 600;
+ letter-spacing: 0.18em;
+ background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 45%, #9a9a9a 100%);
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+ text-transform: uppercase;
+ }
+ #subcopy {
+ font-size: 21px;
+ font-weight: 400;
+ letter-spacing: 0.04em;
+ color: rgba(214,214,218,0.72);
+ will-change: transform, opacity;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="4" data-track-index="0" data-width="1920" data-height="1080">
+
+ <div id="cta-wrap">
+ <div id="pill" class="clip" data-start="0" data-duration="4" data-track-index="0">
+ <span id="label">Subscribe</span>
+ </div>
+ <div id="subcopy" class="clip" data-start="0" data-duration="4" data-track-index="1">New videos every week</div>
+ </div>
+
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "expo.out" } });
+
+ const pill = document.querySelector("#pill");
+ gsap.set(pill, { "--x": "-60%" });
+
+ // pill mask-rise
+ tl.from("#pill", { y: 90, opacity: 0, scale: 0.96, duration: 0.85 }, 0.1);
+ // label settle
+ tl.from("#label", { y: 14, opacity: 0, duration: 0.6 }, 0.45);
+ // subcopy
+ tl.from("#subcopy", { y: 18, opacity: 0, duration: 0.6 }, 0.65);
+
+ // metallic glint sweeps across the pill face near the tail
+ tl.to({ p: 0 }, {
+ p: 1, duration: 0.9, ease: "power2.inOut",
+ onUpdate() { pill.style.setProperty("--x", (-60 + this.targets()[0].p * 220) + "%"); }
+ }, 2.3);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+
+ // --- Live preview only (ignored by the headless renderer, which seeks the paused timeline) ---
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.6).play(); }
+ </script>
+ <style>
+ /* drive the glint pseudo via the --x var set in JS */
+ #pill::after { left: var(--x, -60%); }
+ </style>
+</body>
+</html>
diff --git a/public/02-three-step/index.html b/public/02-three-step/index.html
new file mode 100644
index 0000000..2b33cd0
--- /dev/null
+++ b/public/02-three-step/index.html
@@ -0,0 +1,141 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Three-Step Sequence</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+
+ #root {
+ position: relative;
+ width: 1920px;
+ height: 1080px;
+ background: transparent;
+ overflow: hidden;
+ font-family: "Inter", -apple-system, system-ui, Arial, sans-serif;
+ }
+
+ #grid {
+ position: absolute;
+ inset: 0;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 56px;
+ }
+
+ .card {
+ position: relative;
+ width: 420px;
+ height: 540px;
+ border-radius: 28px;
+ background:
+ linear-gradient(160deg, rgba(64,64,68,0.55) 0%, rgba(28,28,30,0.55) 100%);
+ border: 1px solid rgba(180,180,190,0.16);
+ box-shadow:
+ inset 0 1px 0 rgba(255,255,255,0.10),
+ 0 40px 80px rgba(0,0,0,0.45);
+ -webkit-backdrop-filter: blur(8px);
+ backdrop-filter: blur(8px);
+ padding: 44px 40px;
+ box-sizing: border-box;
+ display: flex;
+ flex-direction: column;
+ will-change: transform, opacity;
+ }
+
+ .num {
+ font-size: 22px;
+ font-weight: 600;
+ letter-spacing: 0.22em;
+ color: rgba(180,180,188,0.65);
+ }
+ .icon {
+ margin-top: 30px;
+ width: 84px; height: 84px;
+ border-radius: 22px;
+ background: linear-gradient(135deg, #E5E5E5 0%, #A3A3A3 100%);
+ box-shadow: inset 0 1px 2px rgba(255,255,255,0.7), 0 10px 24px rgba(0,0,0,0.35);
+ }
+ .title {
+ margin-top: 40px;
+ font-size: 38px;
+ font-weight: 600;
+ letter-spacing: -0.02em;
+ color: #ECECEE;
+ }
+ .desc {
+ margin-top: 18px;
+ font-size: 21px;
+ line-height: 1.5;
+ font-weight: 300;
+ letter-spacing: 0.01em;
+ color: rgba(200,200,206,0.72);
+ }
+ .bar {
+ margin-top: auto;
+ height: 8px; width: 70%;
+ border-radius: 99px;
+ background: linear-gradient(90deg, #D4D4D8 0%, #6b6b70 100%);
+ opacity: 0.85;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="7" data-track-index="0" data-width="1920" data-height="1080">
+
+ <div id="grid">
+ <div class="card clip" data-start="0" data-duration="7" data-track-index="0">
+ <div class="num">01</div>
+ <div class="icon"></div>
+ <div class="title">Record</div>
+ <div class="desc">Capture your take in one clean pass.</div>
+ <div class="bar"></div>
+ </div>
+ <div class="card clip" data-start="0" data-duration="7" data-track-index="1">
+ <div class="num">02</div>
+ <div class="icon"></div>
+ <div class="title">Refine</div>
+ <div class="desc">Cut the dead air and bad takes.</div>
+ <div class="bar"></div>
+ </div>
+ <div class="card clip" data-start="0" data-duration="7" data-track-index="2">
+ <div class="num">03</div>
+ <div class="icon"></div>
+ <div class="title">Release</div>
+ <div class="desc">Export and ship it everywhere.</div>
+ <div class="bar"></div>
+ </div>
+ </div>
+
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ const cards = gsap.utils.toArray(".card");
+
+ cards.forEach((card, i) => {
+ const start = 0.4 + i * 0.45;
+ tl.from(card, {
+ scaleY: 0.9, opacity: 0, y: 36,
+ transformOrigin: "bottom center",
+ duration: 1.0, ease: "power4.out"
+ }, start);
+ tl.from(card.querySelector(".bar"), {
+ scaleX: 0, transformOrigin: "left center",
+ duration: 0.9, ease: "expo.out"
+ }, start + 0.35);
+ });
+
+ // slow parallax drift on the whole grid during the hold
+ tl.to("#grid", { y: -14, duration: 4, ease: "sine.inOut" }, 2);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.7).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/03-slide-showcase/index.html b/public/03-slide-showcase/index.html
new file mode 100644
index 0000000..01e669f
--- /dev/null
+++ b/public/03-slide-showcase/index.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Slide-In Showcase</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent; overflow: hidden;
+ font-family: "Inter", -apple-system, system-ui, Arial, sans-serif;
+ }
+ #wrap { position: absolute; left: 200px; top: 50%; transform: translateY(-50%); width: 1300px; }
+
+ .eyebrow-mask, .line-mask, .sub-mask { overflow: hidden; }
+ #eyebrow {
+ display: inline-flex; align-items: center; gap: 18px;
+ font-size: 24px; font-weight: 600; letter-spacing: 0.28em; text-transform: uppercase;
+ color: rgba(190,190,198,0.85); will-change: transform;
+ }
+ #eyebrow .dot { width: 12px; height: 12px; border-radius: 50%; background: linear-gradient(135deg,#fff,#9a9a9e); box-shadow: 0 0 14px rgba(255,255,255,0.6); }
+
+ .line-mask { margin-top: 8px; }
+ .headline {
+ font-size: 150px; line-height: 1.0; font-weight: 700; letter-spacing: -0.05em;
+ background: linear-gradient(120deg, #FFFFFF 0%, #C9C9CD 48%, #828288 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ will-change: transform;
+ }
+
+ #underline { height: 4px; width: 0; margin-top: 38px; border-radius: 4px;
+ background: linear-gradient(90deg, #f4f4f6, rgba(244,244,246,0)); }
+
+ .sub-mask { margin-top: 34px; }
+ #sub { font-size: 30px; font-weight: 300; line-height: 1.5; color: rgba(206,206,212,0.8); max-width: 900px; will-change: transform; }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="wrap">
+ <div class="eyebrow-mask clip" data-start="0" data-duration="5" data-track-index="0"><span id="eyebrow"><span class="dot"></span> Introducing Null Motion</span></div>
+ <div class="line-mask clip" data-start="0" data-duration="5" data-track-index="1"><div class="headline" id="h1">Motion that</div></div>
+ <div class="line-mask clip" data-start="0" data-duration="5" data-track-index="2"><div class="headline" id="h2">sells.</div></div>
+ <div id="underline" class="clip" data-start="0" data-duration="5" data-track-index="3"></div>
+ <div class="sub-mask clip" data-start="0" data-duration="5" data-track-index="4"><div id="sub">After Effects–level graphics, generated from a single line of text.</div></div>
+ </div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "expo.out" } });
+ tl.from("#eyebrow", { yPercent: 130, opacity: 0, duration: 0.9 }, 0.1);
+ tl.from("#h1", { yPercent: 115, duration: 1.1 }, 0.35);
+ tl.from("#h2", { yPercent: 115, duration: 1.1 }, 0.5);
+ tl.to("#underline", { width: 560, duration: 1.0, ease: "power4.inOut" }, 0.95);
+ tl.from("#sub", { yPercent: 120, opacity: 0, duration: 0.9 }, 1.05);
+ // slow settle drift
+ tl.to("#wrap", { x: 18, duration: 3.2, ease: "sine.inOut" }, 1.8);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.8).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/04-morph-panel/index.html b/public/04-morph-panel/index.html
new file mode 100644
index 0000000..fa1a646
--- /dev/null
+++ b/public/04-morph-panel/index.html
@@ -0,0 +1,108 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Morphing Button to Panel</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+
+ #root {
+ position: relative;
+ width: 1920px;
+ height: 1080px;
+ background: transparent;
+ overflow: hidden;
+ font-family: "Inter", -apple-system, system-ui, Arial, sans-serif;
+ }
+
+ #stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
+
+ /* the morphing surface: starts as a compact button, expands to a panel */
+ #morph {
+ position: relative;
+ width: 220px;
+ height: 84px;
+ border-radius: 999px;
+ background: linear-gradient(180deg, #2c2c30 0%, #161618 55%, #0c0c0d 100%);
+ border: 1px solid rgba(255,255,255,0.10);
+ box-shadow:
+ inset 0 2px 1px rgba(255,255,255,0.20),
+ inset 0 -3px 6px rgba(0,0,0,0.8),
+ 0 30px 60px rgba(0,0,0,0.5);
+ overflow: hidden;
+ will-change: width, height, border-radius;
+ }
+
+ #btnLabel {
+ position: absolute;
+ inset: 0;
+ display: flex; align-items: center; justify-content: center;
+ font-size: 26px; font-weight: 600; letter-spacing: 0.06em;
+ color: #E5E5E5;
+ will-change: opacity, transform;
+ }
+
+ #panelContent {
+ position: absolute;
+ inset: 0;
+ padding: 56px 64px;
+ box-sizing: border-box;
+ opacity: 0;
+ display: flex; flex-direction: column;
+ will-change: opacity;
+ }
+ #panelContent h2 {
+ margin: 0;
+ font-size: 46px; font-weight: 600; letter-spacing: -0.03em;
+ color: #ECECEE;
+ }
+ #panelContent .row {
+ margin-top: 28px; height: 18px; border-radius: 99px;
+ background: linear-gradient(90deg, rgba(212,212,216,0.85), rgba(90,90,96,0.25));
+ }
+ #panelContent .row.short { width: 55%; }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="6" data-track-index="0" data-width="1920" data-height="1080">
+
+ <div id="stage">
+ <div id="morph" class="clip" data-start="0" data-duration="6" data-track-index="0">
+ <div id="btnLabel">Open</div>
+ <div id="panelContent">
+ <h2>Everything, expanded.</h2>
+ <div class="row"></div>
+ <div class="row"></div>
+ <div class="row short"></div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true });
+
+ // entrance: button rises in
+ tl.from("#morph", { y: 60, opacity: 0, scale: 0.9, duration: 0.8, ease: "expo.out" }, 0.2);
+
+ // morph: button -> panel at 1.5s
+ tl.to("#btnLabel", { opacity: 0, scale: 0.85, duration: 0.4, ease: "power2.in" }, 1.5);
+ tl.to("#morph", {
+ width: 1200, height: 600, borderRadius: 24,
+ duration: 1.4, ease: "power4.inOut"
+ }, 1.5);
+ // content fades in as the structure settles
+ tl.to("#panelContent", { opacity: 1, duration: 0.6, ease: "power2.out" }, 2.6);
+ tl.from("#panelContent h2", { y: 24, opacity: 0, duration: 0.7, ease: "power3.out" }, 2.7);
+ tl.from("#panelContent .row", { x: -40, opacity: 0, stagger: 0.12, duration: 0.6, ease: "power3.out" }, 2.9);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.8).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/05-app-icons/assets/adobe.svg b/public/05-app-icons/assets/adobe.svg
new file mode 100644
index 0000000..5d7b24d
--- /dev/null
+++ b/public/05-app-icons/assets/adobe.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64.57 35"><path fill="#eb1000" d="M6.27 10.22h4.39l6.2 14.94h-4.64L8.3 15.24l-2.59 6.51h3.08l1.23 3.41H0l6.27-14.94Zm15.76 3.1c.45 0 .94.04 1.43.16v-3.7h3.88V24.5c-.89.4-2.81.89-4.73.89-3.48 0-6.47-1.98-6.47-5.93s2.88-6.13 5.89-6.13Zm.49 8.87c.36 0 .65-.07.94-.16v-5.42c-.29-.11-.58-.16-.96-.16-1.27 0-2.45.94-2.45 2.92s1.2 2.81 2.47 2.81Zm11.73-8.87c3.23 0 5.98 2.18 5.98 6.02s-2.74 6.02-5.98 6.02-6-2.18-6-6.02 2.72-6.02 6-6.02Zm0 8.81c1.11 0 2.14-.89 2.14-2.79s-1.03-2.79-2.14-2.79-2.12.89-2.12 2.79.96 2.79 2.12 2.79Zm6.91-12.35h3.9v3.7c.47-.09.96-.16 1.45-.16 3.03 0 5.84 1.98 5.84 5.86 0 4.1-2.99 6.18-6.53 6.18-1.52 0-3.46-.31-4.66-.87V9.78Zm4.75 12.39c1.34 0 2.56-.96 2.56-2.94 0-1.85-1.2-2.72-2.5-2.72-.36 0-.65.04-.91.16v5.35c.22.09.51.16.85.16Zm13.06-8.85c2.92 0 5.6 1.87 5.6 5.64 0 .51-.02 1-.09 1.49h-7.27c.4 1.32 1.56 1.94 3.01 1.94 1.18 0 2.27-.29 3.5-.82v2.97c-1.14.58-2.5.82-3.9.82-3.7 0-6.58-2.23-6.58-6.02s2.61-6.02 5.73-6.02Zm1.96 4.7c-.2-1.27-1.05-1.78-1.92-1.78s-1.58.54-1.87 1.78h3.79Z"/></svg>
diff --git a/public/05-app-icons/assets/after-effects.svg b/public/05-app-icons/assets/after-effects.svg
new file mode 100644
index 0000000..95945c2
--- /dev/null
+++ b/public/05-app-icons/assets/after-effects.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><path d="M34.468 0H7.532A7.532 7.532 0 0 0 0 7.532v26.936A7.532 7.532 0 0 0 7.532 42h26.936A7.532 7.532 0 0 0 42 34.468V7.532A7.532 7.532 0 0 0 34.468 0Z" fill="#00005B"/><path d="M10.734 11.149h6.184l6.935 19.36H18.19l-.954-2.947H9.983l-.954 2.947H3.597l7.137-19.36Zm5 11.818-2.11-6.501-2.11 6.501h4.22Zm22.669-.433c0 .693-.058 1.445-.144 2.023H28.81c.578 1.444 1.965 2.138 4.132 2.138 1.56 0 2.918-.289 4.277-.925l.057 4.017c-1.473.751-3.063 1.011-5.114 1.011-5.057 0-8.438-2.803-8.438-7.889 0-4.652 3.236-7.744 7.513-7.744 4.392 0 7.166 2.832 7.166 7.369Zm-9.767-1.272h5.057c-.115-1.358-.953-2.311-2.427-2.311-1.416 0-2.312.751-2.63 2.311Z" fill="#9999FF"/></svg>
diff --git a/public/05-app-icons/assets/claude.svg b/public/05-app-icons/assets/claude.svg
new file mode 100644
index 0000000..a0505ec
--- /dev/null
+++ b/public/05-app-icons/assets/claude.svg
@@ -0,0 +1,4 @@
+<svg fill="#D97757" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <title>Claude</title>
+ <path d="m4.7144 15.9555 4.7174-2.6471.079-.2307-.079-.1275h-.2307l-.7893-.0486-2.6956-.0729-2.3375-.0971-2.2646-.1214-.5707-.1215-.5343-.7042.0546-.3522.4797-.3218.686.0608 1.5179.1032 2.2767.1578 1.6514.0972 2.4468.255h.3886l.0546-.1579-.1336-.0971-.1032-.0972L6.973 9.8356l-2.55-1.6879-1.3356-.9714-.7225-.4918-.3643-.4614-.1578-1.0078.6557-.7225.8803.0607.2246.0607.8925.686 1.9064 1.4754 2.4893 1.8336.3643.3035.1457-.1032.0182-.0728-.164-.2733-1.3539-2.4467-1.445-2.4893-.6435-1.032-.17-.6194c-.0607-.255-.1032-.4674-.1032-.7285L6.287.1335 6.6997 0l.9957.1336.419.3642.6192 1.4147 1.0018 2.2282 1.5543 3.0296.4553.8985.2429.8318.091.255h.1579v-.1457l.1275-1.706.2368-2.0947.2307-2.6957.0789-.7589.3764-.9107.7468-.4918.5828.2793.4797.686-.0668.4433-.2853 1.8517-.5586 2.9021-.3643 1.9429h.2125l.2429-.2429.9835-1.3053 1.6514-2.0643.7286-.8196.85-.9046.5464-.4311h1.0321l.759 1.1293-.34 1.1657-1.0625 1.3478-.8804 1.1414-1.2628 1.7-.7893 1.36.0729.1093.1882-.0183 2.8535-.607 1.5421-.2794 1.8396-.3157.8318.3886.091.3946-.3278.8075-1.967.4857-2.3072.4614-3.4364.8136-.0425.0304.0486.0607 1.5482.1457.6618.0364h1.621l3.0175.2247.7892.522.4736.6376-.079.4857-1.2142.6193-1.6393-.3886-3.825-.9107-1.3113-.3279h-.1822v.1093l1.0929 1.0686 2.0035 1.8092 2.5075 2.3314.1275.5768-.3218.4554-.34-.0486-2.2039-1.6575-.85-.7468-1.9246-1.621h-.1275v.17l.4432.6496 2.3436 3.5214.1214 1.0807-.17.3521-.6071.2125-.6679-.1214-1.3721-1.9246L14.38 17.959l-1.1414-1.9428-.1397.079-.674 7.2552-.3156.3703-.7286.2793-.6071-.4614-.3218-.7468.3218-1.4753.3886-1.9246.3157-1.53.2853-1.9004.17-.6314-.0121-.0425-.1397.0182-1.4328 1.9672-2.1796 2.9446-1.7243 1.8456-.4128.164-.7164-.3704.0667-.6618.4008-.5889 2.386-3.0357 1.4389-1.882.929-1.0868-.0062-.1579h-.0546l-6.3385 4.1164-1.1293.1457-.4857-.4554.0608-.7467.2307-.2429 1.9064-1.3114Z"/>
+</svg>
diff --git a/public/05-app-icons/assets/google-gemini.svg b/public/05-app-icons/assets/google-gemini.svg
new file mode 100644
index 0000000..b3a86a7
--- /dev/null
+++ b/public/05-app-icons/assets/google-gemini.svg
@@ -0,0 +1,4 @@
+<svg fill="#8E75B2" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <title>Google Gemini</title>
+ <path d="M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81"/>
+</svg>
diff --git a/public/05-app-icons/assets/perplexity.svg b/public/05-app-icons/assets/perplexity.svg
new file mode 100644
index 0000000..08c8e6c
--- /dev/null
+++ b/public/05-app-icons/assets/perplexity.svg
@@ -0,0 +1,4 @@
+<svg fill="#1FB8CD" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <title>Perplexity</title>
+ <path d="M22.3977 7.0896h-2.3106V.0676l-7.5094 6.3542V.1577h-1.1554v6.1966L4.4904 0v7.0896H1.6023v10.3976h2.8882V24l6.932-6.3591v6.2005h1.1554v-6.0469l6.9318 6.1807v-6.4879h2.8882V7.0896zm-3.4657-4.531v4.531h-5.355l5.355-4.531zm-13.2862.0676 4.8691 4.4634H5.6458V2.6262zM2.7576 16.332V8.245h7.8476l-6.1149 6.1147v1.9723H2.7576zm2.8882 5.0404v-3.8852h.0001v-2.6488l5.7763-5.7764v7.0111l-5.7764 5.2993zm12.7086.0248-5.7766-5.1509V9.0618l5.7766 5.7766v6.5588zm2.8882-5.0652h-1.733v-1.9723L13.3948 8.245h7.8478v8.087z"/>
+</svg>
diff --git a/public/05-app-icons/assets/photoshop.svg b/public/05-app-icons/assets/photoshop.svg
new file mode 100644
index 0000000..61bf9fc
--- /dev/null
+++ b/public/05-app-icons/assets/photoshop.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><path d="M34.468 0H7.532A7.532 7.532 0 0 0 0 7.532v26.936A7.532 7.532 0 0 0 7.532 42h26.936A7.532 7.532 0 0 0 42 34.468V7.532A7.532 7.532 0 0 0 34.468 0Z" fill="#001E36"/><path d="M14.666 11.149c5.491 0 8.582 2.571 8.582 6.877 0 5.028-4.19 7.05-8.12 7.05H12.47v5.433H7.095v-19.36h7.571Zm-2.196 4.594v4.739h2.37c1.646 0 2.802-.665 2.802-2.34 0-1.532-.982-2.399-2.687-2.399H12.47Zm11.871 13.813.029-4.479c1.531 1.011 3.67 1.647 5.143 1.647 1.012 0 1.474-.289 1.474-.809 0-.578-.636-.809-1.849-1.185-2.341-.693-4.913-1.647-4.913-4.71 0-3.121 2.572-4.855 6.3-4.855 1.762 0 3.207.26 4.479.809l-.029 4.277c-1.012-.607-3.005-1.156-4.306-1.156-.953 0-1.329.289-1.329.722 0 .521.462.665 1.849 1.099 2.688.809 4.942 1.676 4.942 4.825 0 3.005-2.457 5.028-6.3 5.028-2.023 0-3.93-.347-5.49-1.213Z" fill="#31A8FF"/></svg>
diff --git a/public/05-app-icons/assets/premiere-pro.svg b/public/05-app-icons/assets/premiere-pro.svg
new file mode 100644
index 0000000..57a5684
--- /dev/null
+++ b/public/05-app-icons/assets/premiere-pro.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"><path d="M196.959 0H43.041C19.27 0 0 19.27 0 43.041V196.96C0 220.73 19.27 240 43.041 240H196.96C220.73 240 240 220.73 240 196.959V43.04C240 19.27 220.73 0 196.959 0Z" fill="#00005B"/><path d="M92.552 63.706c31.373 0 49.042 14.696 49.042 39.3 0 28.731-23.944 40.29-46.401 40.29H80.002v31.043H49.289V63.706h43.263ZM80.002 89.96v27.081h13.541c9.412 0 16.016-3.798 16.016-13.375 0-8.752-5.614-13.706-15.356-13.706H80.002Zm104.409-3.302c6.77 0 12.219.826 14.696 1.651v22.457c-1.982-.495-5.78-.826-8.917-.826-6.109 0-9.577.496-12.715 1.652v62.747h-28.896V93.924c10.402-4.624 20.806-7.266 35.832-7.266Z" fill="#9999FF"/></svg>
diff --git a/public/05-app-icons/index.html b/public/05-app-icons/index.html
new file mode 100644
index 0000000..c59df76
--- /dev/null
+++ b/public/05-app-icons/index.html
@@ -0,0 +1,324 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<meta name="hyperframes" content="duration:5,fps:30,width:1080,height:1920,transparent:true" />
+<title>App Icon Float</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1080px; height: 1920px; background: transparent;
+ overflow: hidden; font-family: "Inter", system-ui, Arial, sans-serif;
+ }
+ #row {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
+ display: flex; gap: 48px; align-items: center; justify-content: center;
+ perspective: 1120px; transform-style: preserve-3d;
+ }
+ .tile {
+ width: 200px; height: 200px; border-radius: 46px;
+ display: flex; align-items: center; justify-content: center;
+ background: linear-gradient(145deg, #fafafd 0%, #ececf2 58%, #d8d8e1 100%);
+ border: 1px solid rgba(255,255,255,0.82);
+ box-shadow: inset 0 2px 2px rgba(255,255,255,.9), inset 0 -3px 8px rgba(45,45,58,.12), 0 24px 60px rgba(0,0,0,0.42);
+ position: relative; overflow: hidden; transform-style: preserve-3d;
+ will-change: transform, opacity;
+ }
+ .tile::before { content: ""; position: absolute; inset: 10px; z-index: 0; border: 1px solid rgba(35,35,48,.1); border-radius: 36px; pointer-events: none; }
+ .tile::after { content: ""; position: absolute; left: -38%; top: -20%; z-index: 2; width: 26%; height: 140%; transform: rotate(14deg); background: linear-gradient(90deg, transparent, rgba(255,255,255,.68), transparent); opacity: .52; pointer-events: none; }
+ #row.single .tile {
+ width: 380px; height: 380px; border-radius: 86px;
+ background: linear-gradient(145deg, #fbfbfd 0%, #ececf2 56%, #d6d6e0 100%);
+ border: 1px solid rgba(255,255,255,.9);
+ box-shadow: inset 0 2px 3px rgba(255,255,255,.95), inset 0 -4px 12px rgba(35,35,50,.13), 0 36px 90px rgba(0,0,0,.46);
+ overflow: hidden;
+ }
+ #row.single .tile::before { inset: 12px; border-radius: 74px; }
+ .mark-shell {
+ position: relative; z-index: 1; width: 104px; height: 104px;
+ transform-style: preserve-3d; pointer-events: none;
+ }
+ .mark-shell img {
+ position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: contain;
+ border-radius: inherit; backface-visibility: hidden; -webkit-backface-visibility: hidden;
+ pointer-events: none; user-select: none;
+ }
+ .mark-shell img.mark-back { transform: rotateY(180deg); }
+ #row.single .mark-shell { width: 228px; height: 228px; }
+ #row.single.direct-artwork .tile {
+ width: 540px; height: 540px; border: 0; border-radius: 0; overflow: visible;
+ background: transparent; box-shadow: none;
+ }
+ #row.single.direct-artwork .tile::before,
+ #row.single.direct-artwork .tile::after { display: none; }
+ #row.single.direct-artwork .mark-shell { width: 460px; height: 460px; border-radius: 0; }
+ #row.single.direct-artwork .mark-shell img {
+ border-radius: 0;
+ filter: drop-shadow(0 28px 30px rgba(0,0,0,.38));
+ }
+ #row.split {
+ width: 1080px; height: 520px; display: block;
+ perspective: 1600px; transform-style: preserve-3d;
+ }
+ #row.split .tile {
+ position: absolute; left: 50%; top: 50%; width: 220px; height: 220px;
+ margin: -110px 0 0 -110px; border-radius: 52px; overflow: visible;
+ }
+ #row.split .tile.split-hero {
+ width: 360px; height: 260px; margin: -130px 0 0 -180px; border-radius: 64px;
+ background: linear-gradient(145deg, #fff 0%, #f1f1f4 62%, #dcdce3 100%);
+ border: 1px solid rgba(255,255,255,.95); box-shadow: none;
+ }
+ #row.split .split-hero::before,
+ #row.split .split-hero::after { display: none; }
+ #row.split .split-hero .mark-shell { width: 250px; height: 140px; }
+ #row.split .tile.product-artwork {
+ background: transparent; border: 0; box-shadow: 0 30px 72px rgba(0,0,0,.48);
+ }
+ #row.split .tile.product-artwork::before,
+ #row.split .tile.product-artwork::after { display: none; }
+ #row.split .product-artwork .mark-shell { width: 220px; height: 220px; border-radius: 50px; }
+ #row.split .product-artwork .mark-shell img { border-radius: 50px; }
+ .depth-layer {
+ position: absolute; inset: 2px; border-radius: 102px;
+ background: linear-gradient(90deg, #090909, #343434 48%, #090909);
+ border: 1px solid rgba(255,255,255,.16); pointer-events: none;
+ backface-visibility: visible; -webkit-backface-visibility: visible;
+ }
+ .depth-side {
+ position: absolute; z-index: 3; display: block; pointer-events: none;
+ background: linear-gradient(90deg, #090909 0%, #4a4a4a 48%, #111 100%);
+ border: 1px solid rgba(255,255,255,.2); backface-visibility: visible;
+ -webkit-backface-visibility: visible;
+ }
+ .depth-side.left, .depth-side.right { top: 11%; width: 24px; height: 78%; }
+ .depth-side.left { left: -12px; transform: rotateY(90deg); }
+ .depth-side.right { right: -12px; transform: rotateY(90deg); }
+ .depth-side.top, .depth-side.bottom { left: 11%; width: 78%; height: 24px; }
+ .depth-side.top { top: -12px; transform: rotateX(90deg); }
+ .depth-side.bottom { bottom: -12px; transform: rotateX(90deg); }
+ #contact-shadow { position: absolute; left: 50%; top: calc(50% + 248px); width: 340px; height: 58px; margin-left: -170px; border-radius: 50%; background: rgba(0,0,0,.42); filter: blur(24px); transform-origin: 50% 50%; opacity: 0; will-change: transform, opacity; }
+ #root.split-mode #contact-shadow { top: calc(50% + 154px); width: 760px; height: 52px; margin-left: -380px; filter: blur(28px); }
+ #split-energy {
+ position: absolute; left: 50%; top: 50%; width: 720px; height: 4px; margin: -2px 0 0 -360px;
+ border-radius: 999px; opacity: 0;
+ background: linear-gradient(90deg, transparent 0%, rgba(153,153,255,.32) 18%, rgba(255,255,255,.9) 50%, rgba(49,168,255,.32) 82%, transparent 100%);
+ transform-origin: 50% 50%; will-change: transform, opacity;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1080" data-height="1920">
+ <div id="contact-shadow" aria-hidden="true"></div>
+ <div id="split-energy" aria-hidden="true"></div>
+ <div id="row">
+ <div class="tile t1">
+ <img data-null-asset-slot="brand" src="./assets/adobe.svg" alt="Adobe" />
+ </div>
+ <div class="tile t2">
+ <img data-null-asset-slot="brand" src="./assets/premiere-pro.svg" alt="Adobe Premiere Pro" />
+ </div>
+ <div class="tile t3">
+ <img data-null-asset-slot="brand" src="./assets/after-effects.svg" alt="Adobe After Effects" />
+ </div>
+ <div class="tile t4">
+ <img data-null-asset-slot="brand" src="./assets/photoshop.svg" alt="Adobe Photoshop" />
+ </div>
+ </div>
+ </div>
+ <script>
+ const viewAngleControls = {
+ front: { rotationAxis: "none", rotationDegrees: 0, settledYAngle: 0 },
+ "three-quarter-left": { rotationAxis: "none", rotationDegrees: 0, settledYAngle: -32 },
+ "three-quarter-right": { rotationAxis: "none", rotationDegrees: 0, settledYAngle: 32 },
+ "half-turn": { rotationAxis: "y", rotationDegrees: 180, settledYAngle: 180 },
+ "full-turn": { rotationAxis: "y", rotationDegrees: 360, settledYAngle: 360 }
+ };
+ const defaultControls = { visibleCount: 3, entrance: "up", viewAngle: "front", rotationAxis: "none", rotationDegrees: 0, settledYAngle: 0, splitFromHero: false };
+ const injectedControls = window.__nullMotionTemplateControls;
+ let controls = injectedControls && typeof injectedControls === "object" ? injectedControls : defaultControls;
+ if (!injectedControls) {
+ const preview = new URLSearchParams(location.search);
+ const visibleCount = Number(preview.get("visibleCount"));
+ const entrance = preview.get("entrance");
+ const viewAngle = preview.get("viewAngle");
+ const splitFromHero = preview.get("splitFromHero");
+ controls = { ...defaultControls };
+ if (Number.isInteger(visibleCount) && visibleCount >= 1 && visibleCount <= 4) controls.visibleCount = visibleCount;
+ if (["up", "down", "left", "right"].includes(entrance)) controls.entrance = entrance;
+ if (viewAngleControls[viewAngle]) Object.assign(controls, { viewAngle, ...viewAngleControls[viewAngle] });
+ if (["1", "on", "true"].includes(String(splitFromHero || "").toLowerCase())) controls.splitFromHero = true;
+ }
+ const settledYAngle = Number.isFinite(Number(controls.settledYAngle))
+ ? Number(controls.settledYAngle)
+ : Number(viewAngleControls[controls.viewAngle]?.settledYAngle) || 0;
+ const tl = gsap.timeline({ paused: true });
+ const tiles = gsap.utils.toArray(".tile");
+ const visibleTiles = tiles.slice(0, Math.max(1, Math.min(tiles.length, Number(controls.visibleCount) || tiles.length)));
+ // Remove unused authored slots from the render tree. HyperFrames controls
+ // clip visibility while sampling, so display:none alone is not a safe way
+ // to guarantee a singular-brand composition.
+ tiles.slice(visibleTiles.length).forEach(tile => { tile.remove(); });
+ const row = document.getElementById("row");
+ row.classList.toggle("single", visibleTiles.length === 1);
+ const splitMode = Boolean(controls.splitFromHero && visibleTiles.length >= 4);
+ row.classList.toggle("split", splitMode);
+ document.getElementById("root").classList.toggle("split-mode", splitMode);
+ row.classList.toggle("direct-artwork", visibleTiles.length === 1);
+ visibleTiles.forEach(tile => {
+ const front = tile.querySelector("img");
+ if (!front || front.closest(".mark-shell")) return;
+ const identity = `${front.getAttribute("alt") || ""} ${front.getAttribute("src") || ""}`.toLowerCase();
+ tile.classList.toggle("product-artwork", /premiere|after[ -]?effects|photoshop/.test(identity));
+ const shell = document.createElement("div");
+ shell.className = "mark-shell";
+ front.before(shell);
+ shell.appendChild(front);
+ if (row.classList.contains("raster-artwork")) {
+ for (let depth = -10; depth <= 10; depth += 2) {
+ const layer = document.createElement("span");
+ layer.className = "depth-layer";
+ layer.style.transform = `translateZ(${depth}px)`;
+ shell.insertBefore(layer, front);
+ }
+ for (const sideName of ["left", "right", "top", "bottom"]) {
+ const side = document.createElement("span");
+ side.className = `depth-side ${sideName}`;
+ shell.insertBefore(side, front);
+ }
+ }
+ const back = front.cloneNode(true);
+ back.classList.add("mark-back");
+ back.removeAttribute("data-null-asset-slot");
+ back.alt = "";
+ back.setAttribute("aria-hidden", "true");
+ shell.appendChild(back);
+ });
+ const entrances = {
+ up: { x: 0, y: 1120 }, down: { x: 0, y: -1120 },
+ left: { x: -720, y: 0 }, right: { x: 720, y: 0 }
+ };
+ const entrance = entrances[controls.entrance] || entrances.up;
+ const contactShadow = document.getElementById("contact-shadow");
+ const splitEnergy = document.getElementById("split-energy");
+ const firstBeat = 0.16;
+ tl.set(contactShadow, { opacity: 0, scaleX: 0.45, scaleY: 0.7 }, 0);
+ if (splitMode) {
+ const hero = visibleTiles[0];
+ const finals = visibleTiles.slice(1, 4);
+ hero.classList.add("split-hero");
+ gsap.set(hero, {
+ ...entrance, opacity: 0, scaleX: .86, scaleY: .7,
+ rotationX: 11, rotationY: 0, rotationZ: -4,
+ transformOrigin: "50% 80%", transformPerspective: 1600
+ });
+ gsap.set(finals, { x: 0, y: 0, opacity: 0, scale: .38, rotationY: -74, transformPerspective: 1600 });
+ gsap.set(splitEnergy, { opacity: 0, scaleX: .05 });
+ tl.to(hero, { opacity: 1, duration: .08, ease: "power2.out" }, .16)
+ .to(hero, { x: 0, y: -22, scaleX: .98, scaleY: 1.035, rotationX: -2, rotationZ: 1, duration: .86, ease: "power4.out" }, .16)
+ .to(hero, { y: 0, scaleX: 1, scaleY: 1, rotationX: 0, rotationZ: 0, duration: .28, ease: "power2.out" }, 1.02)
+ .to(contactShadow, { opacity: .3, scaleX: .48, scaleY: 1, duration: .88, ease: "power4.out" }, .16)
+ .to(hero, { rotationY: 84, y: -12, duration: .28, ease: "power3.inOut" }, 1.3)
+ .to(hero, { rotationY: 180, y: -16, duration: .28, ease: "sine.inOut" }, 1.58)
+ .to(hero, { rotationY: 276, y: -12, duration: .28, ease: "sine.inOut" }, 1.86)
+ .to(hero, { rotationY: 360, y: -4, duration: .28, ease: "power3.inOut" }, 2.14)
+ .to(splitEnergy, { opacity: .8, scaleX: 1, duration: .24, ease: "power4.out" }, 2.26)
+ .to(hero, { opacity: 0, scale: .5, rotationY: 378, duration: .22, ease: "power3.in", overwrite: "auto" }, 2.32)
+ .to(contactShadow, { opacity: .2, scaleX: 1, duration: .48, ease: "power3.out" }, 2.28);
+ const destinations = [-255, 0, 255];
+ finals.forEach((tile, index) => {
+ const at = 2.52 + index * .08;
+ tl.to(tile, {
+ x: destinations[index], y: index === 1 ? -14 : 8,
+ opacity: 1, scale: 1.06, rotationY: settledYAngle,
+ duration: .64, ease: "back.out(1.3)"
+ }, at)
+ .to(tile, { scale: 1, y: 0, duration: .25, ease: "power2.out" }, at + .62)
+ .to(tile, { y: -7, duration: .38, ease: "sine.inOut" }, 3.56 + index * .05)
+ .to(tile, { y: 0, duration: .38, ease: "sine.inOut" }, 3.94 + index * .05)
+ .to(tile, { y: -300, opacity: 0, scale: .88, rotationX: -10, duration: .62, ease: "power3.in" }, 4.3 + index * .04);
+ });
+ tl.to(splitEnergy, { opacity: .14, scaleX: .88, duration: .3, ease: "power2.out" }, 2.5)
+ .to(splitEnergy, { opacity: 0, scaleX: .65, duration: .4, ease: "power2.in" }, 3.12)
+ .to(contactShadow, { opacity: 0, scaleX: .55, duration: .58, ease: "power3.in", overwrite: "auto" }, 4.28);
+ } else visibleTiles.forEach((tile, index) => {
+ const at = firstBeat + index * 0.13;
+ const mark = tile.querySelector(".mark-shell");
+ tl.set(tile, {
+ ...entrance, opacity: 0, scaleX: 0.9, scaleY: 0.72,
+ rotationX: 12, rotationY: controls.rotationAxis === "y" ? 0 : settledYAngle * .35, rotationZ: controls.rotationAxis === "z" ? -9 : -4,
+ transformOrigin: "50% 82%", transformPerspective: 1500
+ }, 0)
+ .set(mark, { scale: 0.94, transformOrigin: "50% 50%" }, 0)
+ .to(tile, { opacity: 1, duration: 0.08, ease: "power2.out" }, at)
+ .to(tile, {
+ x: 0, y: -24, scaleX: 0.98, scaleY: 1.045, rotationX: -2.5,
+ rotationY: controls.rotationAxis === "y" ? 0 : settledYAngle, rotationZ: 1.2,
+ duration: 0.9, ease: "power4.out"
+ }, at)
+ .to(mark, { scale: 1.015, duration: 0.9, ease: "power3.out" }, at)
+ .to(tile, {
+ y: 0, scaleX: 1, scaleY: 1, rotationX: 0,
+ rotationY: controls.rotationAxis === "y" ? 0 : settledYAngle, rotationZ: 0,
+ duration: 0.34, ease: "power2.out"
+ }, at + 0.88)
+ .to(mark, { scale: 1, duration: 0.28, ease: "power2.out" }, at + 0.92);
+ if (index === 0) {
+ tl.to(contactShadow, { opacity: 0.3, scaleX: 1, scaleY: 1, duration: 0.9, ease: "power4.out" }, at)
+ .to(contactShadow, { opacity: 0.36, scaleX: 0.92, duration: 0.34, ease: "power2.out" }, at + 0.88);
+ }
+ if (Number(controls.rotationDegrees) && ["x", "y", "z"].includes(controls.rotationAxis)) {
+ const property = `rotation${controls.rotationAxis.toUpperCase()}`;
+ const degrees = Number(controls.rotationDegrees);
+ const rotationTarget = controls.rotationAxis === "y" ? (settledYAngle || degrees) : degrees;
+ const spinAt = 1.52 + index * 0.1;
+ // Explicit near-quarter stops make the revolution readable in sampled
+ // review frames. A thin app icon held at exactly 90/270 degrees becomes
+ // an unhelpful one-pixel line, so Y turns stop six degrees shy of edge-on
+ // while still completing the authored 360-degree revolution. A brief
+ // dwell tween at each near-edge stop keeps the foreshortened silhouette
+ // on screen for multiple frames instead of a single-frame flicker.
+ const turnStops = controls.rotationAxis === "y" ? [0.233333, 0.5, 0.766667, 1] : [0.25, 0.5, 0.75, 1];
+ tl.to(tile, { y: -12, z: 44, scale: visibleTiles.length === 1 ? 1.045 : 1.025, rotationX: -4, duration: 0.18, ease: "power2.out", force3D: true }, spinAt)
+ .to(tile, { [property]: rotationTarget * turnStops[0], y: -18, z: 72, rotationX: -6, duration: 0.42, ease: "sine.in", transformPerspective: 1120, force3D: true }, spinAt + 0.18)
+ .to(tile, { y: -20, z: 80, duration: 0.1, ease: "none", force3D: true }, spinAt + 0.6)
+ .to(tile, { [property]: rotationTarget * turnStops[1], y: -22, z: 88, rotationX: -3, duration: 0.42, ease: "sine.out", force3D: true }, spinAt + 0.7)
+ .to(tile, { [property]: rotationTarget * turnStops[2], y: -18, z: 72, rotationX: -6, duration: 0.42, ease: "sine.in", force3D: true }, spinAt + 1.12)
+ .to(tile, { y: -20, z: 80, duration: 0.1, ease: "none", force3D: true }, spinAt + 1.54)
+ .to(tile, { [property]: rotationTarget * turnStops[3], y: -10, z: 36, rotationX: -1, duration: 0.42, ease: "sine.out", force3D: true }, spinAt + 1.64)
+ .to(tile, { y: 0, z: 0, rotationX: 0, scale: 1, duration: 0.32, ease: "back.out(1.25)", force3D: true }, spinAt + 2.06);
+ if (index === 0) {
+ tl.to(contactShadow, { opacity: 0.18, scaleX: 0.5, duration: 0.42, ease: "sine.inOut" }, spinAt + 0.18)
+ .to(contactShadow, { opacity: 0.28, scaleX: 0.78, duration: 0.84, ease: "sine.inOut" }, spinAt + 0.6)
+ .to(contactShadow, { opacity: 0.36, scaleX: 0.92, duration: 0.32, ease: "power2.out" }, spinAt + 2.06);
+ }
+ } else {
+ tl.to(tile, { y: -13, rotationZ: -0.8, duration: 0.62, ease: "sine.inOut" }, 1.34 + index * 0.12)
+ .to(tile, { y: 0, rotationZ: 0, duration: 0.62, ease: "sine.inOut" }, 1.96 + index * 0.12);
+ }
+ // The exit must clear the top of a 1920px-tall canvas from a centered
+ // rest position before it disappears; opacity is deliberately decoupled
+ // from the travel and lags behind it so the icon reads as flying off
+ // frame rather than dissolving in place mid-canvas.
+ const exitDistance = 1550;
+ const exitY = controls.entrance === "down" ? exitDistance : -exitDistance;
+ const exitAt = 4.06 + index * 0.04;
+ tl.to(tile, { y: 10, scaleX: 1.03, scaleY: 0.97, duration: 0.12, ease: "power2.out" }, exitAt)
+ .to(tile, { y: exitY, scaleX: 0.92, scaleY: 1.06, rotationX: -6, duration: 0.6, ease: "power2.in" }, exitAt + 0.12)
+ .to(tile, { opacity: 0, duration: 0.16, ease: "power1.in" }, exitAt + 0.5);
+ if (index === 0) tl.to(contactShadow, { opacity: 0, scaleX: 0.3, scaleY: 0.4, duration: 0.34, ease: "power2.in" }, exitAt + 0.06);
+ });
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ window.startRender = function() { return window.__timelines["root"]; };
+ window.reactToAudio = function(amplitude, frequency) {
+ const amp = Math.max(0, Math.min(1, Number(amplitude) || 0));
+ const freq = Math.max(0, Math.min(1, Number(frequency) || 0));
+ document.getElementById("root").style.setProperty("--audio-response", String((amp + freq) * 0.5));
+ };
+ if (location.hash === "#play") { tl.play(); }
+ </script>
+</body>
+</html>
diff --git a/public/06-notification/index.html b/public/06-notification/index.html
new file mode 100644
index 0000000..cc997df
--- /dev/null
+++ b/public/06-notification/index.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Notification Stack</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, system-ui, Arial, sans-serif;
+ }
+ #stack {
+ position: absolute; left: 50%; top: 200px; transform: translateX(-50%);
+ display: flex; flex-direction: column; gap: 22px; width: 920px;
+ }
+ .toast {
+ display: flex; align-items: center; gap: 22px;
+ padding: 26px 30px; border-radius: 26px;
+ background: linear-gradient(180deg, rgba(38,38,42,0.92), rgba(20,20,23,0.92));
+ border: 1px solid rgba(255,255,255,0.08);
+ box-shadow: 0 30px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
+ -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
+ will-change: transform, opacity;
+ }
+ .ico { width: 64px; height: 64px; border-radius: 16px; background: #fff; display: flex; align-items: center; justify-content: center; flex: 0 0 auto; }
+ .ico svg { width: 38px; height: 38px; }
+ .body { flex: 1; }
+ .title { font-size: 28px; font-weight: 600; color: #f2f2f4; letter-spacing: -0.01em; }
+ .sub { margin-top: 6px; font-size: 22px; font-weight: 300; color: rgba(200,200,206,0.72); }
+ .time { font-size: 19px; color: rgba(170,170,178,0.6); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="stack">
+ <div class="toast clip" data-start="0" data-duration="5" data-track-index="0">
+ <div class="ico"><svg viewBox="0 0 24 24"><path d="M3 6h18v12H3z" fill="none" stroke="#d33" stroke-width="1.6"/><path d="M3 7l9 6 9-6" fill="none" stroke="#d33" stroke-width="1.6"/></svg></div>
+ <div class="body"><div class="title">New appointment</div><div class="sub">Monday · 1:00 PM — Jack Robinson</div></div>
+ <div class="time">now</div>
+ </div>
+ <div class="toast clip" data-start="0" data-duration="5" data-track-index="1">
+ <div class="ico"><svg viewBox="0 0 24 24"><path d="M3 6h18v12H3z" fill="none" stroke="#d33" stroke-width="1.6"/><path d="M3 7l9 6 9-6" fill="none" stroke="#d33" stroke-width="1.6"/></svg></div>
+ <div class="body"><div class="title">New appointment</div><div class="sub">Friday · 3:00 PM — Conor Turner</div></div>
+ <div class="time">1m ago</div>
+ </div>
+ <div class="toast clip" data-start="0" data-duration="5" data-track-index="2">
+ <div class="ico"><svg viewBox="0 0 24 24"><path d="M3 6h18v12H3z" fill="none" stroke="#d33" stroke-width="1.6"/><path d="M3 7l9 6 9-6" fill="none" stroke="#d33" stroke-width="1.6"/></svg></div>
+ <div class="body"><div class="title">New appointment</div><div class="sub">Thursday · 2:00 PM — John Smith</div></div>
+ <div class="time">2m ago</div>
+ </div>
+ </div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ const toasts = gsap.utils.toArray(".toast");
+ toasts.forEach((t, i) => {
+ tl.from(t, { y: -90, opacity: 0, scale: 0.95, duration: 0.7, ease: "back.out(1.4)" }, 0.3 + i * 0.7);
+ });
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.8).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/07-chat-sim/index.html b/public/07-chat-sim/index.html
new file mode 100644
index 0000000..0d81588
--- /dev/null
+++ b/public/07-chat-sim/index.html
@@ -0,0 +1,98 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>AI Chat Simulation</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1080px; height: 1920px; background: transparent; overflow: hidden;
+ font-family: "Inter", -apple-system, "SF Pro Text", system-ui, Arial, sans-serif;
+ }
+ #chat { position: absolute; left: 64px; right: 64px; top: 560px; display: flex; flex-direction: column; }
+
+ /* user message — grey rounded bubble, right aligned (ChatGPT style) */
+ .user {
+ align-self: flex-end; max-width: 80%;
+ background: #303030; color: #ECECEC;
+ font-size: 40px; font-weight: 400; line-height: 1.35;
+ padding: 30px 40px; border-radius: 30px;
+ box-shadow: 0 16px 40px rgba(0,0,0,0.4);
+ will-change: transform, opacity;
+ }
+
+ /* assistant — no bubble, avatar + flowing text (ChatGPT style) */
+ .ai { display: flex; gap: 26px; margin-top: 64px; }
+ .avatar {
+ flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%;
+ background: #0d0d0d; border: 1px solid rgba(255,255,255,0.18);
+ display: flex; align-items: center; justify-content: center;
+ }
+ .avatar svg { width: 38px; height: 38px; }
+ .ai-col { flex: 1; padding-top: 4px; }
+ .ai .text { color: #F4F4F4; font-size: 44px; font-weight: 400; line-height: 1.4; letter-spacing: -0.005em; }
+ .cursor { display: inline-block; width: 4px; height: 0.92em; margin-left: 5px; background: #F4F4F4; vertical-align: text-bottom; transform: translateY(5px); }
+
+ .actions { margin-top: 34px; display: flex; gap: 40px; opacity: 0; }
+ .actions svg { width: 40px; height: 40px; stroke: rgba(190,190,196,0.6); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
+
+ /* typing bubble shown before the answer */
+ #typing { display: inline-flex; gap: 16px; padding: 28px 36px; border-radius: 30px; background: #262626; align-items: center; }
+ #typing span { width: 17px; height: 17px; border-radius: 50%; background: rgba(225,225,228,0.85); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="7" data-track-index="0" data-width="1080" data-height="1920">
+ <div id="chat">
+ <div class="user clip" data-start="0" data-duration="7" data-track-index="0">What do you think of this decision?</div>
+ <div class="ai clip" data-start="0" data-duration="7" data-track-index="1">
+ <div class="avatar">
+ <svg viewBox="0 0 24 24" fill="none"><path d="M12 3l2 5.5L19.5 10 14 12l-2 5.5L10 12 4.5 10 10 8.5 12 3z" fill="#fff"/></svg>
+ </div>
+ <div class="ai-col">
+ <div id="typing"><span></span><span></span><span></span></div>
+ <div class="text" id="answer"><span id="aiText"></span><span class="cursor" id="cursor"></span></div>
+ <div class="actions" id="actions">
+ <svg viewBox="0 0 24 24"><rect x="9" y="9" width="12" height="12" rx="2.5"/><path d="M5 15V5a2 2 0 0 1 2-2h10"/></svg>
+ <svg viewBox="0 0 24 24"><path d="M7 11v9H4v-9zM7 11l4.5-8c1.5 0 2.4 1 2.1 2.4L13 9h5.6c1.3 0 2.2 1.2 1.8 2.5l-2 6.5c-.3 1.2-1.4 2-2.6 2H7"/></svg>
+ <svg viewBox="0 0 24 24"><path d="M17 13V4h3v9zM17 13l-4.5 8c-1.5 0-2.4-1-2.1-2.4L11 15H5.4c-1.3 0-2.2-1.2-1.8-2.5l2-6.5c.3-1.2 1.4-2 2.6-2H17"/></svg>
+ <svg viewBox="0 0 24 24"><path d="M3 12a9 9 0 0 1 15-6.7L21 8M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-15 6.7L3 16M3 21v-5h5"/></svg>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <script>
+ const ANSWER = "Yes — that's a great idea. Do it.";
+ const tl = gsap.timeline({ paused: true });
+ const aiText = document.getElementById("aiText");
+ const cursor = document.getElementById("cursor");
+
+ gsap.set("#answer", { display: "none" });
+ gsap.set(".ai", { opacity: 0 });
+ gsap.set("#actions", { opacity: 0 });
+ tl.to(cursor, { opacity: 0, duration: 0.5, repeat: 5, yoyo: true, ease: "steps(1)" }, 1.05);
+
+ // 1. user message pops in
+ tl.from(".user", { y: 46, opacity: 0, scale: 0.96, duration: 0.55, ease: "back.out(1.4)" }, 0.3);
+ // 2. assistant row + typing dots
+ tl.to(".ai", { opacity: 1, duration: 0.25 }, 1.0);
+ tl.from("#typing", { scale: 0.7, opacity: 0, duration: 0.3, ease: "back.out(2)", transformOrigin: "left center" }, 1.1);
+ tl.to("#typing span", { y: -13, duration: 0.4, stagger: 0.13, repeat: 3, yoyo: true, ease: "sine.inOut" }, 1.25);
+ // 3. swap typing -> answer, typewriter reveal
+ tl.set("#typing", { display: "none" }, 2.7);
+ tl.set("#answer", { display: "block" }, 2.7);
+ tl.to({ n: 0 }, { n: ANSWER.length, duration: 1.7, ease: "none",
+ onUpdate() { aiText.textContent = ANSWER.slice(0, Math.round(this.targets()[0].n)); } }, 2.75);
+ // 4. cursor out, actions in
+ tl.to("#cursor", { opacity: 0, duration: 0.2 }, 4.6);
+ tl.to("#actions", { opacity: 1, duration: 0.4 }, 4.7);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(1).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/08-prompt-bar/index.html b/public/08-prompt-bar/index.html
new file mode 100644
index 0000000..1670b30
--- /dev/null
+++ b/public/08-prompt-bar/index.html
@@ -0,0 +1,64 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Prompt Bar Typing</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1080px; height: 1920px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, system-ui, Arial, sans-serif;
+ }
+ #bar {
+ position: absolute; left: 60px; right: 60px; top: 50%; transform: translateY(-50%);
+ display: flex; align-items: center; gap: 26px;
+ padding: 30px 30px 30px 38px; border-radius: 999px;
+ background: linear-gradient(180deg, rgba(48,48,52,0.95), rgba(30,30,34,0.95));
+ border: 1px solid rgba(255,255,255,0.08);
+ box-shadow: 0 34px 70px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.10);
+ -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
+ will-change: transform, opacity;
+ }
+ .plus { width: 56px; height: 56px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; }
+ .plus svg { width: 40px; height: 40px; stroke: #d8d8de; stroke-width: 2; }
+ #txt { flex: 1; font-size: 42px; font-weight: 400; color: #f0f0f3; letter-spacing: -0.01em; white-space: nowrap; overflow: hidden; }
+ .cursor { display: inline-block; width: 3px; height: 0.95em; margin-left: 2px; background: #f0f0f3; vertical-align: middle; }
+ .send { width: 84px; height: 84px; flex: 0 0 auto; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; will-change: transform; }
+ .send svg { width: 44px; height: 44px; stroke: #111; stroke-width: 2.4; }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1080" data-height="1920">
+ <div id="bar" class="clip" data-start="0" data-duration="5" data-track-index="0">
+ <div class="plus"><svg viewBox="0 0 24 24" fill="none"><path d="M12 5v14M5 12h14"/></svg></div>
+ <div id="txt"><span id="typed"></span><span class="cursor" id="cursor"></span></div>
+ <div class="send" id="send"><svg viewBox="0 0 24 24" fill="none"><path d="M12 19V5M5 12l7-7 7 7"/></svg></div>
+ </div>
+ </div>
+ <script>
+ const PHRASE = "Tell me about your business";
+ const tl = gsap.timeline({ paused: true });
+ const typed = document.getElementById("typed");
+ const cursor = document.getElementById("cursor");
+
+ tl.to(cursor, { opacity: 0, duration: 0.5, repeat: 4, yoyo: true, ease: "steps(1)" }, 0.9);
+
+ tl.from("#bar", { y: 60, opacity: 0, scale: 0.97, duration: 0.7, ease: "expo.out" }, 0.2);
+ // typewriter
+ tl.to({ n: 0 }, {
+ n: PHRASE.length, duration: 1.9, ease: "none",
+ onUpdate() { typed.textContent = PHRASE.slice(0, Math.round(this.targets()[0].n)); }
+ }, 1.0);
+ // send button press at the end
+ tl.to("#cursor", { opacity: 0, duration: 0.2 }, 3.1);
+ tl.to("#send", { scale: 0.86, duration: 0.12, ease: "power2.in" }, 3.3);
+ tl.to("#send", { scale: 1, duration: 0.5, ease: "back.out(2.2)" }, 3.42);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.9).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/09-grid-network/index.html b/public/09-grid-network/index.html
new file mode 100644
index 0000000..11a2469
--- /dev/null
+++ b/public/09-grid-network/index.html
@@ -0,0 +1,95 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Node Network</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; overflow: hidden;
+ font-family: "Inter", system-ui, Arial, sans-serif;
+ background:
+ radial-gradient(900px 700px at 50% 50%, #0b1722 0%, #060a10 70%);
+ }
+ /* grid */
+ #grid {
+ position: absolute; inset: -2px;
+ background-image:
+ linear-gradient(rgba(90,150,210,0.10) 1px, transparent 1px),
+ linear-gradient(90deg, rgba(90,150,210,0.10) 1px, transparent 1px);
+ background-size: 64px 64px;
+ mask-image: radial-gradient(closest-side at 50% 50%, #000 60%, transparent 100%);
+ -webkit-mask-image: radial-gradient(closest-side at 50% 50%, #000 60%, transparent 100%);
+ }
+ #scene { position: absolute; inset: 0; }
+ svg.links { position: absolute; inset: 0; width: 100%; height: 100%; }
+ .link { stroke: #3aa0ff; stroke-width: 3; opacity: 0.5; filter: drop-shadow(0 0 6px rgba(58,160,255,0.8)); }
+ .hub {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
+ width: 190px; height: 190px; border-radius: 50%;
+ background: radial-gradient(circle at 40% 35%, #6fc0ff, #1c7fe0 70%);
+ box-shadow: 0 0 70px rgba(40,150,255,0.9), inset 0 2px 8px rgba(255,255,255,0.5);
+ display: flex; align-items: center; justify-content: center;
+ color: #fff; font-weight: 700; letter-spacing: 0.14em; font-size: 30px;
+ will-change: transform;
+ }
+ .node {
+ position: absolute; width: 92px; height: 92px; border-radius: 50%;
+ background: linear-gradient(180deg, #20262e, #11151b);
+ border: 1px solid rgba(120,180,240,0.4);
+ box-shadow: 0 0 26px rgba(40,130,220,0.5);
+ display: flex; align-items: center; justify-content: center;
+ transform: translate(-50%,-50%); will-change: transform, opacity;
+ }
+ .node svg { width: 48px; height: 48px; stroke: #bfe2ff; fill: none; stroke-width: 1.6; }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="6" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="grid" class="clip" data-start="0" data-duration="6" data-track-index="0"></div>
+ <div id="scene" class="clip" data-start="0" data-duration="6" data-track-index="1">
+ <svg class="links" id="links" viewBox="0 0 1920 1080" preserveAspectRatio="none"></svg>
+ <div class="hub" id="hub">COUNCIL</div>
+ </div>
+ </div>
+ <script>
+ const cx = 960, cy = 540, R = 320, N = 6;
+ const scene = document.getElementById("scene");
+ const links = document.getElementById("links");
+ const nodes = [];
+ for (let i = 0; i < N; i++) {
+ const a = (-90 + i * (360 / N)) * Math.PI / 180;
+ const x = cx + R * Math.cos(a), y = cy + R * Math.sin(a);
+ const line = document.createElementNS("http://www.w3.org/2000/svg", "line");
+ line.setAttribute("x1", cx); line.setAttribute("y1", cy);
+ line.setAttribute("x2", x); line.setAttribute("y2", y);
+ line.setAttribute("class", "link");
+ links.appendChild(line);
+ const node = document.createElement("div");
+ node.className = "node";
+ node.style.left = x + "px"; node.style.top = y + "px";
+ node.innerHTML = '<svg viewBox="0 0 24 24"><rect x="5" y="8" width="14" height="10" rx="3"/><circle cx="9" cy="13" r="1.3" fill="#bfe2ff"/><circle cx="15" cy="13" r="1.3" fill="#bfe2ff"/><path d="M12 4v4"/></svg>';
+ scene.appendChild(node);
+ nodes.push({ node, line });
+ }
+
+ const tl = gsap.timeline({ paused: true });
+ tl.from("#grid", { opacity: 0, scale: 1.1, duration: 1.0, ease: "power2.out" }, 0);
+ tl.from("#hub", { scale: 0, opacity: 0, duration: 0.8, ease: "back.out(1.7)" }, 0.3);
+ nodes.forEach((o, i) => {
+ gsap.set(o.line, { drawSVG: undefined });
+ tl.from(o.node, { scale: 0, opacity: 0, duration: 0.6, ease: "back.out(1.8)" }, 0.7 + i * 0.12);
+ tl.from(o.line, { opacity: 0, duration: 0.5 }, 0.7 + i * 0.12);
+ });
+ // pulse the hub + slow orbit drift
+ tl.to("#hub", { scale: 1.06, duration: 0.9, ease: "sine.inOut", yoyo: true, repeat: 2 }, 1.6);
+ tl.to(".link", { opacity: 0.85, duration: 0.52, stagger: 0.05, yoyo: true, repeat: 2, ease: "sine.inOut" }, 1.8);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.play(); }
+ </script>
+</body>
+</html>
diff --git a/public/10-candlestick/index.html b/public/10-candlestick/index.html
new file mode 100644
index 0000000..cd99246
--- /dev/null
+++ b/public/10-candlestick/index.html
@@ -0,0 +1,111 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Stock Candlesticks</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; overflow: hidden;
+ font-family: "Inter", system-ui, Arial, sans-serif;
+ background: radial-gradient(1300px 800px at 50% 35%, #14171c 0%, #0a0c10 70%, #070809 100%);
+ }
+ #title {
+ position: absolute; top: 88px; left: 0; right: 0; text-align: center;
+ font-size: 58px; font-weight: 700; letter-spacing: 0.06em; color: #EDEDEF;
+ }
+ #sub { position: absolute; top: 168px; left: 0; right: 0; text-align: center; font-size: 26px; font-weight: 600; letter-spacing: 0.02em; color: #34e07a; }
+ #plot { position: absolute; left: 160px; right: 160px; top: 260px; bottom: 130px; }
+ .gridline { position: absolute; left: 0; right: 0; height: 1px; background: rgba(255,255,255,0.06); transform-origin: left center; }
+ .gridline span { position: absolute; right: 100%; margin-right: 18px; top: -13px; font-size: 18px; color: rgba(160,160,170,0.5); }
+ .trend { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
+ .trend path { fill: none; stroke: rgba(80,220,140,0.55); stroke-width: 3; filter: drop-shadow(0 0 8px rgba(60,220,130,0.5)); }
+ .candle { position: absolute; transform-origin: bottom center; will-change: transform, opacity; }
+ .wick { position: absolute; left: 50%; transform: translateX(-50%); width: 4px; border-radius: 2px; top: 0; bottom: 0; }
+ .body { position: absolute; left: 0; width: 100%; border-radius: 4px; }
+ .up .wick, .up .body { background: linear-gradient(180deg,#3ff08a,#16a352); box-shadow: 0 0 16px rgba(40,220,120,0.45); }
+ .down .wick, .down .body { background: linear-gradient(180deg,#ff6a6a,#cc2c2c); box-shadow: 0 0 16px rgba(255,80,80,0.4); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="title" class="clip" data-start="0" data-duration="5" data-track-index="0">STOCK MARKET</div>
+ <div id="sub" class="clip" data-start="0" data-duration="5" data-track-index="1">▲ +24.6%</div>
+ <div id="plot" class="clip" data-start="0" data-duration="5" data-track-index="2">
+ <svg class="trend" id="trend" preserveAspectRatio="none"></svg>
+ </div>
+ </div>
+ <script>
+ // plot dimensions (px, within #plot which is 1600 x 690)
+ const PW = 1600, PH = 690, N = 22;
+ const plot = document.getElementById("plot");
+
+ // ---- generate a deterministic upward-biased OHLC walk ----
+ let seed = 0x10cafe;
+ const random = () => {
+ seed = (Math.imul(seed, 1664525) + 1013904223) >>> 0;
+ return seed / 4294967296;
+ };
+ let price = 30; const data = [];
+ for (let i = 0; i < N; i++) {
+ const open = price;
+ price = Math.max(8, Math.min(96, price + (random() - 0.40) * 12));
+ const close = price;
+ const hi = Math.max(open, close) + random() * 5 + 1;
+ const lo = Math.min(open, close) - random() * 5 - 1;
+ data.push({ open, close, hi, lo });
+ }
+ const lows = Math.min(...data.map(d => d.lo)) - 4;
+ const highs = Math.max(...data.map(d => d.hi)) + 4;
+ const Y = v => PH - ((v - lows) / (highs - lows)) * PH; // price -> pixel y
+
+ // gridlines
+ for (let g = 0; g <= 4; g++) {
+ const v = lows + (highs - lows) * g / 4;
+ const line = document.createElement("div");
+ line.className = "gridline"; line.style.top = Y(v) + "px";
+ line.innerHTML = `<span>${Math.round(v)}</span>`;
+ plot.appendChild(line);
+ }
+
+ const step = PW / N, cw = step * 0.58;
+ const candles = [];
+ data.forEach((d, i) => {
+ const x = i * step + (step - cw) / 2;
+ const yHi = Y(d.hi), yLo = Y(d.lo);
+ const up = d.close >= d.open;
+ const c = document.createElement("div");
+ c.className = "candle " + (up ? "up" : "down");
+ c.style.left = x + "px"; c.style.width = cw + "px";
+ c.style.top = yHi + "px"; c.style.height = (yLo - yHi) + "px";
+ const bodyTop = Y(Math.max(d.open, d.close)) - yHi;
+ const bodyH = Math.max(4, Math.abs(Y(d.open) - Y(d.close)));
+ c.innerHTML = `<div class="wick"></div><div class="body" style="top:${bodyTop}px;height:${bodyH}px"></div>`;
+ plot.appendChild(c); candles.push(c);
+ });
+
+ // trend line through closes
+ const trend = document.getElementById("trend");
+ trend.setAttribute("viewBox", `0 0 ${PW} ${PH}`);
+ const pts = data.map((d, i) => `${i * step + step / 2},${Y(d.close)}`).join(" L ");
+ const path = document.createElementNS("http://www.w3.org/2000/svg", "path");
+ path.setAttribute("d", "M " + pts);
+ trend.appendChild(path);
+ const len = path.getTotalLength();
+ path.style.strokeDasharray = len; path.style.strokeDashoffset = len;
+
+ const tl = gsap.timeline({ paused: true });
+ tl.from("#title", { y: -40, opacity: 0, duration: 0.7, ease: "expo.out" }, 0.1);
+ tl.from("#sub", { y: -20, opacity: 0, duration: 0.6, ease: "expo.out" }, 0.3);
+ tl.from(".gridline", { scaleX: 0, opacity: 0, duration: 0.7, stagger: 0.06, ease: "power2.out" }, 0.4);
+ tl.from(candles, { scaleY: 0, opacity: 0, duration: 0.45, stagger: 0.06, ease: "back.out(1.5)" }, 0.7);
+ tl.to(path, { strokeDashoffset: 0, duration: 1.6, ease: "power1.inOut" }, 1.0);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(1.2).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/12-blur-reveal/index.html b/public/12-blur-reveal/index.html
new file mode 100644
index 0000000..25c1036
--- /dev/null
+++ b/public/12-blur-reveal/index.html
@@ -0,0 +1,66 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Blur Logo Reveal</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent; overflow: hidden;
+ font-family: "Inter", -apple-system, system-ui, Arial, sans-serif;
+ }
+ #plate {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
+ display: flex; align-items: center; gap: 36px;
+ padding: 54px 84px; border-radius: 34px;
+ background: linear-gradient(180deg, rgba(30,30,34,0.92), rgba(16,16,19,0.94));
+ border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 50px 100px rgba(0,0,0,0.55);
+ overflow: hidden; will-change: transform, opacity;
+ }
+ /* the light sweep that wipes across as it sharpens */
+ #sweep {
+ position: absolute; top: 0; bottom: 0; left: -40%; width: 35%;
+ background: linear-gradient(105deg, transparent, rgba(255,255,255,0.18) 50%, transparent);
+ transform: skewX(-16deg); pointer-events: none;
+ }
+ #mark { width: 116px; height: 116px; flex: 0 0 auto; will-change: filter, opacity; }
+ #mark img { width: 100%; height: 100%; display: block; border-radius: 22px; box-shadow: inset 0 0 0 1px rgba(255,255,255,0.10), 0 6px 18px rgba(0,0,0,0.5); }
+ #word {
+ font-size: 104px; font-weight: 700; letter-spacing: -0.03em;
+ background: linear-gradient(135deg, #FFFFFF 0%, #C9C9CD 50%, #8C8C90 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ will-change: filter, opacity;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="plate" class="clip" data-start="0" data-duration="5" data-track-index="0">
+ <div id="mark"><img data-null-asset-slot="brand" src="../assets/null-logo.png" alt="Null" /></div>
+ <div id="word">Null</div>
+ <div id="sweep"></div>
+ </div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ // plate drops in
+ tl.from("#plate", { y: 70, opacity: 0, scale: 0.9, duration: 0.8, ease: "back.out(1.3)" }, 0.2);
+ // hold blurred...
+ gsap.set(["#word","#mark"], { filter: "blur(20px)", opacity: 0.35 });
+ // ...then sharpen as the light sweep passes
+ tl.fromTo("#sweep", { x: 0 }, { x: "560%", duration: 1.1, ease: "power2.inOut" }, 1.8);
+ tl.to(["#word","#mark"], { filter: "blur(0px)", opacity: 1, duration: 0.9, ease: "power2.out" }, 2.0);
+ // glow bloom + settle
+ tl.fromTo("#plate",
+ { boxShadow: "inset 0 1px 0 rgba(255,255,255,0.12), 0 50px 100px rgba(0,0,0,0.55)" },
+ { boxShadow: "inset 0 1px 0 rgba(255,255,255,0.18), 0 50px 110px rgba(0,0,0,0.55), 0 0 90px rgba(120,170,255,0.35)", duration: 0.8, ease: "sine.out" }, 2.3);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(1).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/13-compare-bars/index.html b/public/13-compare-bars/index.html
new file mode 100644
index 0000000..8b49409
--- /dev/null
+++ b/public/13-compare-bars/index.html
@@ -0,0 +1,100 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Compare Bars</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+
+ /* obsidian glass stage card the bars stand on */
+ #card {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
+ width: 1180px; height: 660px; border-radius: 34px;
+ background: linear-gradient(180deg, #1b1b1f 0%, #121214 50%, #0a0a0b 100%);
+ border: 1px solid rgba(255,255,255,0.08);
+ box-shadow: inset 0 2px 1px rgba(255,255,255,0.16), inset 0 -3px 8px rgba(0,0,0,0.8),
+ 0 40px 90px rgba(0,0,0,0.55);
+ overflow: hidden; will-change: transform, opacity;
+ }
+ /* faint baseline gridlines */
+ #card::before {
+ content: ""; position: absolute; inset: 0;
+ background: linear-gradient(180deg, rgba(255,255,255,.035), transparent 44%, rgba(255,255,255,.025));
+ pointer-events: none;
+ }
+
+ #bars { position: absolute; left: 0; right: 0; bottom: 96px; display: flex; align-items: flex-end; justify-content: center; gap: 150px; }
+ .bar-wrap { display: flex; flex-direction: column; align-items: center; gap: 18px; }
+ .bar {
+ width: 130px; border-radius: 14px 14px 4px 4px; transform-origin: bottom;
+ will-change: transform; box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 18px 40px rgba(0,0,0,0.5);
+ }
+ /* short, dim "before" bar */
+ #barA { height: 200px; background: linear-gradient(180deg, #3a3a40 0%, #232327 100%); }
+ /* tall silver "after" bar with a soft bloom */
+ #barB { height: 470px; background: linear-gradient(180deg, #F2F2F2 0%, #C2C2C6 48%, #8C8C90 100%);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.5), 0 0 70px rgba(220,220,228,0.30), 0 18px 40px rgba(0,0,0,0.5); }
+ .bval {
+ font-size: 46px; font-weight: 700; letter-spacing: -0.02em;
+ background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 50%, #9a9a9a 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent; will-change: transform, opacity;
+ }
+ #valA { color: #6c6c74; -webkit-text-fill-color: #6c6c74; }
+
+ /* glossy obsidian caption pill */
+ #cap {
+ position: absolute; left: 50%; bottom: 70px; transform: translateX(-50%);
+ padding: 20px 48px; border-radius: 999px;
+ background: linear-gradient(180deg, #2b2b2e 0%, #161618 46%, #0a0a0b 100%);
+ border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 2px 1px rgba(255,255,255,0.22), inset 0 -3px 6px rgba(0,0,0,0.85), 0 24px 50px rgba(0,0,0,0.55);
+ will-change: transform, opacity;
+ }
+ #cap span {
+ font-size: 40px; font-weight: 700; letter-spacing: -0.01em;
+ background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 45%, #9a9a9a 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="card" class="clip" data-start="0" data-duration="5" data-track-index="0">
+ <div id="bars">
+ <div class="bar-wrap">
+ <div class="bval" id="valA">1x</div>
+ <div class="bar" id="barA"></div>
+ </div>
+ <div class="bar-wrap">
+ <div class="bval" id="valB">10x</div>
+ <div class="bar" id="barB"></div>
+ </div>
+ </div>
+ </div>
+ <div id="cap" class="clip" data-start="0" data-duration="5" data-track-index="1"><span>10x faster</span></div>
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+
+ tl.from("#card", { y: 60, opacity: 0, scale: 0.97, duration: 0.8 }, 0);
+ // bars grow up from the baseline, staggered
+ tl.from("#barA", { scaleY: 0, duration: 0.7 }, 0.45);
+ tl.from("#valA", { y: 14, opacity: 0, duration: 0.5 }, 0.7);
+ tl.from("#barB", { scaleY: 0, duration: 0.95, ease: "power4.out" }, 0.62);
+ tl.from("#valB", { y: 14, opacity: 0, duration: 0.5 }, 1.1);
+ // caption pill rises in
+ tl.from("#cap", { y: 30, opacity: 0, scale: 0.96, duration: 0.7, ease: "expo.out" }, 1.25);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.8).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/14-leaderboard/index.html b/public/14-leaderboard/index.html
new file mode 100644
index 0000000..2407335
--- /dev/null
+++ b/public/14-leaderboard/index.html
@@ -0,0 +1,89 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Model Leaderboard</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+
+ #list {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
+ display: flex; flex-direction: column; gap: 26px; width: 860px;
+ }
+ .row {
+ display: flex; align-items: center; gap: 30px;
+ padding: 22px 32px; border-radius: 22px;
+ background: linear-gradient(180deg, #1b1b1f 0%, #131316 100%);
+ border: 1px solid rgba(255,255,255,0.07);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 22px 50px rgba(0,0,0,0.5);
+ will-change: transform, opacity;
+ }
+ .rank {
+ width: 40px; flex: none; text-align: center; font-size: 30px; font-weight: 700; letter-spacing: -0.02em;
+ background: linear-gradient(180deg, #ffffff 0%, #b9b9bd 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ }
+ /* rounded app-icon tile — swap the glyph/glow per brand */
+ .icon {
+ width: 84px; height: 84px; flex: none; border-radius: 22px;
+ display: flex; align-items: center; justify-content: center;
+ background: linear-gradient(160deg, #232327 0%, #0d0d0f 100%);
+ border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 0 50px rgba(190,190,200,0.22), 0 14px 30px rgba(0,0,0,0.55);
+ }
+ .icon svg { width: 44px; height: 44px; }
+ .name {
+ flex: 1; font-size: 34px; font-weight: 600; letter-spacing: -0.02em; color: #ECECEE;
+ }
+ .score {
+ font-size: 26px; font-weight: 600; letter-spacing: -0.01em;
+ background: linear-gradient(180deg, #F2F2F2 0%, #9a9a9e 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="list">
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="0">
+ <div class="rank">1</div>
+ <div class="icon"><svg viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="6.5" stroke="#cfe0ff" stroke-width="1.8"/><circle cx="12" cy="12" r="2.4" fill="#cfe0ff"/></svg></div>
+ <div class="name">Veo 3.1</div><div class="score">98</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="1">
+ <div class="rank">2</div>
+ <div class="icon"><svg viewBox="0 0 24 24" fill="none"><path d="M5 12c3-5 11-5 14 0-3 5-11 5-14 0z" stroke="#e6e6ea" stroke-width="1.6"/><circle cx="12" cy="12" r="2.2" fill="#e6e6ea"/></svg></div>
+ <div class="name">Kling</div><div class="score">94</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="2">
+ <div class="rank">3</div>
+ <div class="icon"><svg viewBox="0 0 24 24" fill="none"><path d="M12 3v18M3 12h18" stroke="#dcdce2" stroke-width="1.8"/><circle cx="12" cy="12" r="4.4" stroke="#dcdce2" stroke-width="1.4"/></svg></div>
+ <div class="name">Grok Imagine</div><div class="score">90</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="3">
+ <div class="rank">4</div>
+ <div class="icon"><svg viewBox="0 0 24 24" fill="none"><path d="M7 14c0-3 2-5 5-5s5 2 5 5-2 4-5 4-5-1-5-4z" stroke="#cfd6ff" stroke-width="1.5"/><circle cx="10.5" cy="13" r="0.9" fill="#cfd6ff"/><circle cx="13.5" cy="13" r="0.9" fill="#cfd6ff"/></svg></div>
+ <div class="name">Sora</div><div class="score">88</div>
+ </div>
+ </div>
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+ const rows = gsap.utils.toArray(".row");
+ rows.forEach((r, i) => {
+ tl.from(r, { x: -70, opacity: 0, duration: 0.7 }, 0.15 + i * 0.16);
+ tl.from(r.querySelector(".score"), { opacity: 0, x: 16, duration: 0.5 }, 0.45 + i * 0.16);
+ });
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.9).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/15-bar-3d/index.html b/public/15-bar-3d/index.html
new file mode 100644
index 0000000..9e2f9d0
--- /dev/null
+++ b/public/15-bar-3d/index.html
@@ -0,0 +1,107 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<meta name="hyperframes" content="duration:5,fps:30,width:1920,height:1080,transparent:true" />
+<title>3D Bar Hero</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+
+ /* perspective stage so the bars read as 3D */
+ #stage {
+ position: absolute; left: 250px; bottom: 158px;
+ display: flex; align-items: flex-end; gap: 44px;
+ perspective: 1400px;
+ }
+ #floor {
+ position: absolute; left: 210px; bottom: 118px; width: 720px; height: 72px;
+ border-radius: 50%; background: rgba(0,0,0,.32); filter: blur(24px);
+ opacity: 0; transform: scaleX(.45); transform-origin: 50% 50%; will-change: transform, opacity;
+ }
+ .col { display: flex; flex-direction: column; align-items: center; gap: 26px; }
+ .bar3d {
+ position: relative; width: 138px; border-radius: 12px 12px 2px 2px; transform-origin: bottom;
+ transform: rotateX(8deg); transform-style: preserve-3d; will-change: transform;
+ border: 1px solid rgba(255,255,255,.48);
+ box-shadow: inset 0 2px 1px rgba(255,255,255,.5), 0 20px 40px rgba(0,0,0,.24);
+ }
+ /* extruded right side face */
+ .bar3d::after {
+ content: ""; position: absolute; top: 8px; right: -18px; width: 18px; height: calc(100% - 8px);
+ background: linear-gradient(180deg, rgba(75,75,83,.72), rgba(28,28,33,.88));
+ transform: skewY(-34deg); transform-origin: top; border-radius: 0 6px 0 0;
+ }
+ .side { height: 300px; background: linear-gradient(180deg, #d8d8dc 0%, #9a9a9e 100%);
+ }
+ /* tall silver hero bar with a luminous bloom */
+ #hero { height: 560px; background: linear-gradient(180deg, #F6F6F8 0%, #C8C8CE 45%, #8E8E94 100%);
+ box-shadow: inset 0 2px 1px rgba(255,255,255,.72), 0 24px 48px rgba(0,0,0,.3), 0 0 54px rgba(225,225,235,.18); }
+
+ /* floating icon tile (on the bar top) + headline (in open space to the right) */
+ #cap { position: absolute; left: 1080px; top: 360px; width: 650px; display: flex; align-items: center; gap: 30px; z-index: 5; }
+ #tile {
+ width: 100px; height: 100px; border-radius: 26px; flex: none;
+ display: flex; align-items: center; justify-content: center;
+ background: linear-gradient(160deg, #2a2a2f 0%, #0c0c0e 100%);
+ border: 1px solid rgba(255,255,255,0.12);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 18px 40px rgba(0,0,0,.42);
+ will-change: transform, opacity;
+ }
+ #tile svg { width: 52px; height: 52px; }
+ #headline { will-change: transform, opacity; }
+ #headline .l1 {
+ font-size: 64px; font-weight: 720; letter-spacing: -0.04em; line-height: .98;
+ color: #f1f1f3; white-space: nowrap;
+ }
+ #headline .l2 { font-size: 30px; font-weight: 520; letter-spacing: -0.01em; color: #9898a1; margin-top: 14px; white-space: nowrap; }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="floor" aria-hidden="true"></div>
+ <div id="stage">
+ <div class="col"><div class="bar3d side" data-i="0"></div></div>
+ <div class="col">
+ <div class="bar3d" id="hero" data-i="1"></div>
+ </div>
+ <div class="col"><div class="bar3d side" data-i="2"></div></div>
+ </div>
+
+ <!-- Caption occupies a dedicated right-hand column and never crosses the chart silhouette. -->
+ <div id="cap">
+ <div id="tile"><svg viewBox="0 0 24 24" fill="none"><path d="M13 2 4 14h6l-1 8 9-12h-6l1-8z" fill="#eaeaef"/></svg></div>
+ <div id="headline"><div class="l1">Worth your</div><div class="l2">time and money</div></div>
+ </div>
+ </div>
+
+ <script>
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+ tl.from(".side", { scaleY: 0, opacity: 0, duration: .76, stagger: .12 }, .12);
+ tl.to("#floor", { opacity: .7, scaleX: 1, duration: .72 }, .18);
+ tl.from("#hero", { scaleY: 0, opacity: 0, duration: .94 }, .42);
+ tl.from("#tile", { y: 46, opacity: 0, scale: .74, duration: .66, ease: "back.out(1.45)" }, 1.02);
+ tl.from("#headline .l1", { x: 38, opacity: 0, duration: .62 }, 1.2);
+ tl.from("#headline .l2", { x: 26, opacity: 0, duration: .56 }, 1.36);
+ tl.to("#tile", { y: -8, duration: .5, ease: "sine.inOut" }, 2.35)
+ .to("#tile", { y: 0, duration: .5, ease: "sine.inOut" }, 2.85);
+ tl.to("#cap", { y: -22, opacity: 0, duration: .58, ease: "power3.in" }, 4.15);
+ tl.to("#stage", { y: 46, opacity: 0, duration: .62, ease: "power3.in" }, 4.24);
+ tl.to("#floor", { opacity: 0, scaleX: .62, duration: .5, ease: "power2.in" }, 4.32);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ window.startRender = function() { return window.__timelines["root"]; };
+ window.reactToAudio = function(amplitude, frequency) {
+ const amp = Math.max(0, Math.min(1, Number(amplitude) || 0));
+ document.getElementById("root").style.setProperty("--audio-response", String(amp));
+ };
+ if (location.hash === "#play") { tl.play(); }
+ </script>
+</body>
+</html>
diff --git a/public/16-line-growth/index.html b/public/16-line-growth/index.html
new file mode 100644
index 0000000..6077fa6
--- /dev/null
+++ b/public/16-line-growth/index.html
@@ -0,0 +1,92 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Line Growth</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ #chart { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 1400px; height: 760px; }
+ svg { width: 100%; height: 100%; overflow: visible; }
+ .axis { stroke: rgba(255,255,255,0.28); stroke-width: 3; stroke-linecap: round; }
+ .grid { stroke: rgba(255,255,255,0.06); stroke-width: 2; }
+ .curve {
+ fill: none; stroke: url(#silver); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round;
+ filter: drop-shadow(0 0 18px rgba(220,220,230,0.45));
+ }
+ .area { fill: url(#fade); opacity: 0; }
+
+ /* obsidian marker tiles that sit on the curve — swap glyph per use */
+ .marker {
+ position: absolute; width: 70px; height: 70px; border-radius: 18px; transform: translate(-50%, -50%);
+ display: flex; align-items: center; justify-content: center;
+ background: linear-gradient(160deg, #26262b 0%, #0c0c0e 100%);
+ border: 1px solid rgba(255,255,255,0.12);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.16), 0 0 44px rgba(200,200,210,0.30), 0 14px 28px rgba(0,0,0,0.6);
+ will-change: transform, opacity;
+ }
+ .marker span {
+ font-size: 30px; font-weight: 700;
+ background: linear-gradient(180deg, #ffffff 0%, #b9b9bd 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="chart" class="clip" data-start="0" data-duration="5" data-track-index="0">
+ <svg viewBox="0 0 1400 760" preserveAspectRatio="none">
+ <defs>
+ <linearGradient id="silver" x1="0" y1="1" x2="1" y2="0">
+ <stop offset="0" stop-color="#8C8C90"/><stop offset="0.5" stop-color="#D8D8DC"/><stop offset="1" stop-color="#F2F2F2"/>
+ </linearGradient>
+ <linearGradient id="fade" x1="0" y1="0" x2="0" y2="1">
+ <stop offset="0" stop-color="rgba(220,220,230,0.22)"/><stop offset="1" stop-color="rgba(220,220,230,0)"/>
+ </linearGradient>
+ </defs>
+ <!-- gridlines -->
+ <line class="grid" x1="80" y1="180" x2="1360" y2="180"/>
+ <line class="grid" x1="80" y1="380" x2="1360" y2="380"/>
+ <line class="grid" x1="80" y1="580" x2="1360" y2="580"/>
+ <!-- axes -->
+ <line id="axisY" class="axis" x1="80" y1="40" x2="80" y2="700"/>
+ <line id="axisX" class="axis" x1="80" y1="700" x2="1360" y2="700"/>
+ <!-- fill under curve -->
+ <path id="area" class="area" d="M80,640 C420,610 720,470 1000,300 C1180,190 1280,150 1360,120 L1360,700 L80,700 Z"/>
+ <!-- rising curve -->
+ <path id="curve" class="curve" d="M80,640 C420,610 720,470 1000,300 C1180,190 1280,150 1360,120"/>
+ </svg>
+ <!-- markers (left % / top % positioned over the chart box) -->
+ <div class="marker" data-i="0" style="left:21%; top:78%;"><span>?</span></div>
+ <div class="marker" data-i="1" style="left:50%; top:50%;"><span>?</span></div>
+ <div class="marker" data-i="2" style="left:79%; top:23%;"><span>?</span></div>
+ </div>
+ </div>
+
+ <script>
+ const curve = document.querySelector("#curve");
+ const len = curve.getTotalLength();
+ gsap.set(curve, { strokeDasharray: len, strokeDashoffset: len });
+
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power3.out" } });
+ // axes draw in
+ tl.from("#axisY", { scaleY: 0, transformOrigin: "bottom", duration: 0.5 }, 0);
+ tl.from("#axisX", { scaleX: 0, transformOrigin: "left", duration: 0.6 }, 0.2);
+ tl.from(".grid", { opacity: 0, duration: 0.4, stagger: 0.08 }, 0.3);
+ // curve draws along its length
+ tl.to(curve, { strokeDashoffset: 0, duration: 1.6, ease: "power2.inOut" }, 0.6);
+ tl.to("#area", { opacity: 1, duration: 0.8 }, 1.4);
+ // markers pop on in sync with the line passing them
+ tl.from(".marker", { scale: 0, opacity: 0, duration: 0.5, ease: "back.out(1.8)", stagger: 0.5 }, 0.9);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.9).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/17-integrations-grid/index.html b/public/17-integrations-grid/index.html
new file mode 100644
index 0000000..4714f1e
--- /dev/null
+++ b/public/17-integrations-grid/index.html
@@ -0,0 +1,75 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Integrations Grid</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ #grid {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
+ display: grid; grid-template-columns: repeat(3, 480px); gap: 28px;
+ }
+ .cell {
+ display: flex; align-items: center; gap: 22px; padding: 26px 28px; border-radius: 22px;
+ background: linear-gradient(180deg, #1b1b1f 0%, #131316 100%);
+ border: 1px solid rgba(255,255,255,0.07);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 22px 50px rgba(0,0,0,0.5);
+ will-change: transform, opacity;
+ }
+ .ic {
+ width: 72px; height: 72px; flex: none; border-radius: 18px;
+ display: flex; align-items: center; justify-content: center;
+ background: linear-gradient(160deg, #232327 0%, #0d0d0f 100%);
+ border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 0 44px rgba(190,190,200,0.20), 0 12px 26px rgba(0,0,0,0.55);
+ }
+ .ic svg { width: 38px; height: 38px; }
+ .body { flex: 1; min-width: 0; }
+ .nm { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: #ECECEE; }
+ .ds { font-size: 16px; color: var(--muted, #8a8a92); margin-top: 4px; line-height: 1.3; }
+ .add {
+ width: 44px; height: 44px; flex: none; border-radius: 12px;
+ display: flex; align-items: center; justify-content: center; font-size: 26px; color: #cfcfd4;
+ background: linear-gradient(180deg, #26262b, #161618); border: 1px solid rgba(255,255,255,0.10);
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="grid"></div>
+ </div>
+ <script>
+ // swap these for your own integrations (name / desc / glyph)
+ const APPS = [
+ ["Atlassian", "Jira issues & Confluence", '<path d="M7 20 12 8l5 12H7z" stroke="#cfe0ff" stroke-width="1.6" fill="none"/>'],
+ ["Linear", "Track issues & projects", '<path d="M5 19 19 5M9 19 19 9M5 15 15 5" stroke="#dcdce2" stroke-width="1.6"/>'],
+ ["Miro", "Boards & diagrams", '<path d="M7 4v16M12 4v16M17 4v16" stroke="#e8e8ee" stroke-width="2.2"/>'],
+ ["Shopify", "Manage your store", '<path d="M8 7l4-2 4 2v10l-4 2-4-2V7z" stroke="#cfe0d6" stroke-width="1.6" fill="none"/>'],
+ ["Notion", "Pages & databases", '<rect x="6" y="5" width="12" height="14" rx="2" stroke="#e6e6ea" stroke-width="1.6"/><path d="M9 9h6M9 12h6" stroke="#e6e6ea" stroke-width="1.4"/>'],
+ ["Canva", "Designs & graphics", '<circle cx="12" cy="12" r="6.5" stroke="#cfd6ff" stroke-width="1.8"/>'],
+ ];
+ const grid = document.getElementById("grid");
+ APPS.forEach((a, i) => {
+ const c = document.createElement("div");
+ c.className = "cell clip";
+ c.setAttribute("data-start","0"); c.setAttribute("data-duration","5"); c.setAttribute("data-track-index", i);
+ c.innerHTML = `<div class="ic"><svg viewBox="0 0 24 24" fill="none">${a[2]}</svg></div>
+ <div class="body"><div class="nm">${a[0]}</div><div class="ds">${a[1]}</div></div>
+ <div class="add">+</div>`;
+ grid.appendChild(c);
+ });
+
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+ tl.from(".cell", { y: 40, opacity: 0, scale: 0.94, duration: 0.7, stagger: 0.1 }, 0.1);
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(1.0).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/18-cta-click/index.html b/public/18-cta-click/index.html
new file mode 100644
index 0000000..0bfe955
--- /dev/null
+++ b/public/18-cta-click/index.html
@@ -0,0 +1,73 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>CTA Button Click</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ #wrap { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); }
+ /* focus ring that pulses on click */
+ #ring {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
+ width: 560px; height: 300px; border-radius: 40px;
+ border: 1.5px solid rgba(255,255,255,0.14); box-shadow: 0 0 60px rgba(190,190,210,0.10) inset;
+ }
+ /* glossy obsidian CTA pill */
+ #btn {
+ position: relative; padding: 34px 86px; border-radius: 999px; cursor: pointer;
+ background: linear-gradient(180deg, #2b2b2e 0%, #161618 46%, #0a0a0b 100%);
+ border: 1px solid rgba(255,255,255,0.12);
+ box-shadow: inset 0 2px 1px rgba(255,255,255,0.24), inset 0 -3px 6px rgba(0,0,0,0.85),
+ 0 0 70px rgba(200,200,220,0.18), 0 28px 55px rgba(0,0,0,0.55);
+ will-change: transform; overflow: hidden;
+ }
+ #btn span {
+ font-size: 52px; font-weight: 700; letter-spacing: -0.01em;
+ background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 45%, #9a9a9a 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ }
+ /* click ripple */
+ #ripple {
+ position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; border-radius: 50%;
+ transform: translate(-50%, -50%) scale(0); background: rgba(255,255,255,0.18); pointer-events: none;
+ }
+ /* cursor */
+ #cur { position: absolute; left: 0; top: 0; width: 44px; height: 44px; transform: translate(1180px, 760px); will-change: transform; z-index: 5; }
+ #cur svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="4" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="wrap" class="clip" data-start="0" data-duration="4" data-track-index="0">
+ <div id="ring"></div>
+ <div id="btn"><span>Publish</span><div id="ripple"></div></div>
+ </div>
+ <div id="cur" class="clip" data-start="0" data-duration="4" data-track-index="1">
+ <svg viewBox="0 0 24 24"><path d="M4 2 4 20 9 15 12.5 22 15 21 11.5 14 18 14 Z" fill="#fff" stroke="#0a0a0a" stroke-width="0.7" stroke-linejoin="round"/></svg>
+ </div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ // button + ring settle in
+ tl.from("#btn", { y: 40, opacity: 0, scale: 0.95, duration: 0.7, ease: "expo.out" }, 0.1);
+ tl.from("#ring", { opacity: 0, scale: 0.9, duration: 0.7, ease: "expo.out" }, 0.2);
+ // cursor glides to the button
+ tl.to("#cur", { x: 980, y: 545, duration: 0.9, ease: "power3.inOut" }, 0.9);
+ // press: button dips, ring pulses, ripple expands
+ tl.to("#btn", { scale: 0.94, duration: 0.12, ease: "power2.in" }, 1.85);
+ tl.to("#btn", { scale: 1, duration: 0.35, ease: "back.out(2.2)" }, 1.97);
+ tl.fromTo("#ripple", { scale: 0, opacity: 0.5 }, { scale: 14, opacity: 0, duration: 0.7, ease: "power2.out" }, 1.9);
+ tl.fromTo("#ring", { boxShadow: "0 0 60px rgba(190,190,210,0.10) inset" },
+ { boxShadow: "0 0 90px rgba(220,220,240,0.35) inset, 0 0 40px rgba(220,220,240,0.25)", duration: 0.3, yoyo: true, repeat: 1 }, 1.9);
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.9).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/19-phone-showcase/index.html b/public/19-phone-showcase/index.html
new file mode 100644
index 0000000..8dce816
--- /dev/null
+++ b/public/19-phone-showcase/index.html
@@ -0,0 +1,76 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Phone Showcase</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ #stage { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); perspective: 1800px; }
+ /* metallic phone body */
+ #phone {
+ position: relative; width: 420px; height: 860px; border-radius: 62px;
+ background: linear-gradient(150deg, #d6d6da 0%, #9a9a9e 45%, #c8c8cc 100%);
+ padding: 12px; transform-style: preserve-3d; will-change: transform; overflow: hidden;
+ box-shadow: 0 60px 110px rgba(0,0,0,0.6), inset 0 2px 2px rgba(255,255,255,0.7);
+ }
+ #screen {
+ position: relative; width: 100%; height: 100%; border-radius: 50px; overflow: hidden;
+ background: linear-gradient(180deg, #121214 0%, #0a0a0b 100%); color: #ECECEE;
+ }
+ #product-shot { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 2; display: block; }
+ /* dynamic island */
+ #island { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); width: 116px; height: 34px; border-radius: 18px; background: #000; z-index: 4; }
+ .ui { padding: 70px 30px 0; }
+ .ui h4 { margin: 0; text-align: center; font-size: 26px; font-weight: 600; letter-spacing: -0.02em; color: #cfcfd4; }
+ .search { margin: 26px 0 22px; height: 46px; border-radius: 14px; background: #1b1b1f; border: 1px solid rgba(255,255,255,0.07); }
+ .rowi { height: 70px; border-radius: 16px; background: linear-gradient(180deg,#1b1b1f,#141417); border: 1px solid rgba(255,255,255,0.05); margin-bottom: 16px; display:flex; align-items:center; gap:14px; padding:0 16px; }
+ .rowi .d { width: 44px; height:44px; border-radius: 12px; background: linear-gradient(160deg,#2a2a2f,#0d0d0f); flex:none; }
+ .rowi .l { flex:1; } .rowi .l b{ display:block; height:11px; width:55%; background:#34343a; border-radius:6px;} .rowi .l i{ display:block; height:9px; width:35%; background:#26262b; border-radius:6px; margin-top:8px;}
+ /* glint that sweeps across the metal bezel */
+ #glint { position: absolute; top: 0; left: -40%; width: 40%; height: 100%; border-radius: 62px; pointer-events: none;
+ background: linear-gradient(105deg, transparent 0%, rgba(255,255,255,0.55) 50%, transparent 100%); transform: skewX(-16deg); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="stage">
+ <div id="phone" class="clip" data-start="0" data-duration="5" data-track-index="0">
+ <div id="screen">
+ <img id="product-shot" data-null-asset-slot="screenshot" src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=" alt="Product interface" />
+ <div id="island"></div>
+ <div class="ui">
+ <h4>My Store</h4>
+ <div class="search"></div>
+ <div class="rowi"><div class="d"></div><div class="l"><b></b><i></i></div></div>
+ <div class="rowi"><div class="d"></div><div class="l"><b></b><i></i></div></div>
+ <div class="rowi"><div class="d"></div><div class="l"><b></b><i></i></div></div>
+ <div class="rowi"><div class="d"></div><div class="l"><b></b><i></i></div></div>
+ </div>
+ </div>
+ <div id="glint"></div>
+ </div>
+ </div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ // phone tilts in from a 3D angle and settles upright
+ tl.from("#phone", { rotateY: -42, rotateX: 10, y: 70, opacity: 0, duration: 1.1, ease: "power4.out" }, 0.1);
+ // Keep the authored timeline finite. An infinitely repeating child tween
+ // makes deterministic frame seeking grow without bound in Chromium.
+ tl.to("#phone", { rotateY: -6, duration: 1.8, ease: "sine.inOut", yoyo: true, repeat: 1 }, 1.2);
+ // UI rows rise in
+ tl.from(".ui > *", { y: 24, opacity: 0, duration: 0.6, stagger: 0.08, ease: "power3.out" }, 0.9);
+ // bezel glint sweep
+ tl.fromTo("#glint", { x: 0 }, { x: 1050, duration: 1.0, ease: "power2.inOut" }, 1.1);
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.play(); }
+ </script>
+</body>
+</html>
diff --git a/public/20-search-typing/index.html b/public/20-search-typing/index.html
new file mode 100644
index 0000000..1094e11
--- /dev/null
+++ b/public/20-search-typing/index.html
@@ -0,0 +1,70 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Search Typing</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ #col { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }
+ #mark {
+ font-size: 96px; font-weight: 700; letter-spacing: -0.05em; margin-bottom: 50px;
+ background: linear-gradient(135deg, #F2F2F2 0%, #B8B8BC 50%, #8C8C90 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent; will-change: transform, opacity;
+ }
+ /* glossy obsidian search pill */
+ #bar {
+ display: flex; align-items: center; gap: 18px; width: 860px; padding: 22px 30px; border-radius: 999px;
+ background: linear-gradient(180deg, #1b1b1f 0%, #131316 100%);
+ border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 26px 55px rgba(0,0,0,0.5); will-change: transform, opacity;
+ }
+ #bar svg { width: 34px; height: 34px; flex: none; }
+ #q { flex: 1; font-size: 34px; color: #ECECEE; white-space: nowrap; }
+ #q .cursor { display: inline-block; width: 3px; height: 36px; background: #cfcfd4; margin-left: 2px; vertical-align: -6px; }
+ #btns { display: flex; gap: 18px; margin-top: 44px; }
+ .sbtn {
+ padding: 16px 30px; border-radius: 12px; font-size: 19px; color: #d7d7dc;
+ background: linear-gradient(180deg, #1f1f23, #161618); border: 1px solid rgba(255,255,255,0.08); will-change: transform, opacity;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="col">
+ <div id="mark" class="clip" data-start="0" data-duration="5" data-track-index="0">Search</div>
+ <div id="bar" class="clip" data-start="0" data-duration="5" data-track-index="1">
+ <svg viewBox="0 0 24 24" fill="none"><circle cx="11" cy="11" r="6.5" stroke="#9a9a9e" stroke-width="2"/><path d="M16 16l4.5 4.5" stroke="#9a9a9e" stroke-width="2" stroke-linecap="round"/></svg>
+ <div id="q"><span id="typed"></span><span class="cursor" id="cur"></span></div>
+ </div>
+ <div id="btns" class="clip" data-start="0" data-duration="5" data-track-index="2">
+ <div class="sbtn">Search</div>
+ <div class="sbtn">I’m Feeling Lucky</div>
+ </div>
+ </div>
+ </div>
+ <script>
+ const PHRASE = "rank #1 on launch day";
+ const typed = document.getElementById("typed");
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power3.out" } });
+
+ tl.from("#mark", { y: 30, opacity: 0, duration: 0.7 }, 0.1);
+ tl.from("#bar", { y: 26, opacity: 0, duration: 0.7 }, 0.35);
+ // type the phrase character by character
+ tl.to({ n: 0 }, { n: PHRASE.length, duration: 1.7, ease: "none",
+ onUpdate() { typed.textContent = PHRASE.slice(0, Math.round(this.targets()[0].n)); } }, 0.9);
+ tl.from("#btns", { y: 20, opacity: 0, duration: 0.6 }, 2.5);
+ // blinking caret
+ tl.to("#cur", { opacity: 0, duration: 0.5, repeat: 4, yoyo: true, ease: "steps(1)" }, 0.85);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(1.0).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/21-connector-list/index.html b/public/21-connector-list/index.html
new file mode 100644
index 0000000..0844f1e
--- /dev/null
+++ b/public/21-connector-list/index.html
@@ -0,0 +1,85 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Connector List</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ #list { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 880px; display: flex; flex-direction: column; gap: 18px; }
+ .row {
+ position: relative; display: flex; align-items: center; gap: 24px; padding: 22px 26px; border-radius: 20px;
+ background: linear-gradient(180deg, #1a1a1e 0%, #131316 100%); border: 1px solid rgba(255,255,255,0.06);
+ box-shadow: 0 16px 36px rgba(0,0,0,0.4); will-change: transform, opacity;
+ }
+ .ic { width: 64px; height: 64px; flex: none; border-radius: 16px; display: flex; align-items: center; justify-content: center;
+ background: linear-gradient(160deg, #232327 0%, #0d0d0f 100%); border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.12), 0 10px 22px rgba(0,0,0,0.5); }
+ .ic svg { width: 34px; height: 34px; }
+ .body { flex: 1; min-width: 0; }
+ .nm { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; color: #ECECEE; }
+ .ds { font-size: 16px; color: #8a8a92; margin-top: 3px; }
+ .chev { color: #56565c; font-size: 24px; }
+ /* selection highlight that slides to the hovered row */
+ #hl { position: absolute; left: 0; width: 100%; height: 108px; border-radius: 20px; pointer-events: none;
+ background: linear-gradient(180deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
+ border: 1px solid rgba(255,255,255,0.18); box-shadow: 0 0 50px rgba(210,210,225,0.18); opacity: 0; will-change: transform, opacity; }
+ /* cursor */
+ #cur { position: absolute; width: 42px; height: 42px; left: 0; top: 0; transform: translate(980px, 620px); z-index: 6; will-change: transform; }
+ #cur svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="list">
+ <div id="hl"></div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="0">
+ <div class="ic"><svg viewBox="0 0 24 24" fill="none"><rect x="6" y="5" width="12" height="14" rx="2" stroke="#e6e6ea" stroke-width="1.6"/><path d="M9 9h6M9 12h6" stroke="#e6e6ea" stroke-width="1.4"/></svg></div>
+ <div class="body"><div class="nm">Notion</div><div class="ds">Access your pages and databases</div></div><div class="chev">›</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="1">
+ <div class="ic"><svg viewBox="0 0 24 24" fill="none"><circle cx="12" cy="12" r="6.5" stroke="#cfd6ff" stroke-width="1.6"/><path d="M12 5v14M5 12h14" stroke="#cfd6ff" stroke-width="1.2"/></svg></div>
+ <div class="body"><div class="nm">Perplexity</div><div class="ds">AI-powered search and answers</div></div><div class="chev">›</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="2">
+ <div class="ic"><svg viewBox="0 0 24 24" fill="none"><path d="M12 4l2.2 5.6L20 12l-5.8 2.4L12 20l-2.2-5.6L4 12l5.8-2.4L12 4z" stroke="#dcdce2" stroke-width="1.4"/></svg></div>
+ <div class="body"><div class="nm">Lovable AI</div><div class="ds">Unlock powerful AI features</div></div><div class="chev">›</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="3">
+ <div class="ic"><svg viewBox="0 0 24 24" fill="none"><rect x="6" y="7" width="12" height="10" rx="2" stroke="#cfe0ff" stroke-width="1.6"/><path d="M6 11h12" stroke="#cfe0ff" stroke-width="1.4"/></svg></div>
+ <div class="body"><div class="nm">Stripe</div><div class="ds">Payments, billing and subscriptions</div></div><div class="chev">›</div>
+ </div>
+ <div class="row clip" data-start="0" data-duration="5" data-track-index="4">
+ <div class="ic"><svg viewBox="0 0 24 24" fill="none"><path d="M13 4 6 14h5l-1 6 7-10h-5l1-6z" fill="#bfffd9"/></svg></div>
+ <div class="body"><div class="nm">Supabase</div><div class="ds">Connect your own project</div></div><div class="chev">›</div>
+ </div>
+ </div>
+ <div id="cur" class="clip" data-start="0" data-duration="5" data-track-index="5" aria-hidden="true">
+ <svg viewBox="0 0 24 24"><path d="M4 2 4 20 9 15 12.5 22 15 21 11.5 14 18 14 Z" fill="#fff" stroke="#0a0a0a" stroke-width="0.7" stroke-linejoin="round"/></svg>
+ </div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+ const rows = gsap.utils.toArray(".row");
+ rows.forEach((r, i) => tl.from(r, { x: -50, opacity: 0, duration: 0.6 }, 0.1 + i * 0.12));
+
+ // cursor moves to the Stripe row (index 3) and the highlight snaps onto it
+ const target = rows[3];
+ const place = () => target.offsetTop; // y within #list
+ tl.to("#cur", { x: 1080, y: 560, duration: 0.8, ease: "power3.inOut" }, 1.0);
+ tl.set("#hl", { y: () => target.offsetTop }, 0);
+ tl.to("#hl", { opacity: 1, duration: 0.35 }, 1.55);
+ tl.fromTo("#hl", { boxShadow: "0 0 50px rgba(210,210,225,0.18)" },
+ { boxShadow: "0 0 70px rgba(225,225,240,0.4)", duration: 0.4, yoyo: true, repeat: 1 }, 1.6);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(1.0).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/22-kinetic-headline/index.html b/public/22-kinetic-headline/index.html
new file mode 100644
index 0000000..8429d32
--- /dev/null
+++ b/public/22-kinetic-headline/index.html
@@ -0,0 +1,95 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+ <meta name="hyperframes" content="duration:4,fps:30,width:1920,height:1080,transparent:true">
+ <meta name="duration" content="4000">
+ <meta name="fps" content="30">
+ <meta name="width" content="1920">
+ <meta name="height" content="1080">
+ <title>Kinetic Headline</title>
+ <script src="../_vendor/gsap.min.js"></script>
+ <style>
+ * { box-sizing: border-box; margin: 0; padding: 0; }
+ :root { --audio-energy: 0; --audio-tone: 0; --silver: #f4f4f6; --amber: #e8b768; }
+ html, body { width: 1920px; height: 1080px; overflow: hidden; background: transparent; }
+ body { color: var(--silver); font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Arial, sans-serif; }
+ #root { position: absolute; inset: 0; overflow: hidden; background: transparent; perspective: 1400px; }
+ .plane { position: absolute; pointer-events: none; }
+ .atmosphere { left: 395px; top: 238px; width: 1130px; height: 610px; opacity: .82; background: radial-gradient(ellipse at 51% 52%, rgba(232,183,104,.13) 0%, rgba(92,123,128,.07) 32%, rgba(4,8,10,0) 72%); filter: blur(10px); transform: translateZ(-160px) scale(.84); }
+ .orbit { left: 529px; top: 302px; width: 862px; height: 462px; border: 1px solid rgba(244,244,246,.09); border-radius: 50%; transform: rotate(-6deg) translateZ(-90px); }
+ .orbit::after { content: ""; position: absolute; inset: 39px 75px; border: 1px solid rgba(232,183,104,.12); border-radius: 50%; }
+ .guide { left: 224px; top: 539px; width: 1472px; height: 1px; background: linear-gradient(90deg, transparent, rgba(244,244,246,.14) 16%, rgba(232,183,104,.32) 50%, rgba(244,244,246,.14) 84%, transparent); transform-origin: center; }
+ .headline { position: absolute; inset: 0; display: grid; place-items: center; transform-style: preserve-3d; }
+ .line { display: flex; align-items: center; justify-content: center; gap: 34px; white-space: nowrap; }
+ .word-mask { overflow: hidden; padding: 18px 2px 24px; }
+ .word { display: block; font-size: 132px; font-weight: 780; line-height: .88; letter-spacing: -.055em; background: linear-gradient(180deg, #fff 0%, #dedee2 44%, #999aa2 100%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 12px 25px rgba(0,0,0,.2)); will-change: transform, opacity, filter; }
+ .pill-wrap { position: relative; padding: 36px 0; transform-style: preserve-3d; }
+ .contact-shadow { position: absolute; left: 10%; right: 10%; bottom: 12px; height: 28px; border-radius: 50%; background: rgba(0,0,0,.48); filter: blur(18px); transform: translateZ(-25px); }
+ .pill { position: relative; min-width: 490px; padding: 34px 62px 38px; overflow: hidden; border-radius: 999px; background: linear-gradient(180deg, rgba(42,42,47,.98) 0%, rgba(17,17,20,.99) 58%, rgba(7,7,9,.99) 100%); border: 1px solid rgba(255,255,255,.18); box-shadow: inset 0 2px rgba(255,255,255,.2), inset 0 -1px rgba(232,183,104,.16), 0 0 48px rgba(232,183,104,.12), 0 24px 48px rgba(0,0,0,.34); transform-style: preserve-3d; will-change: transform, opacity, filter; }
+ .pill::before { content: ""; position: absolute; inset: 1px 28px auto; height: 45%; border-radius: 999px; background: linear-gradient(180deg, rgba(255,255,255,.09), transparent); }
+ .pill .word { position: relative; z-index: 2; text-align: center; font-size: 102px; letter-spacing: -.045em; }
+ .sheen { position: absolute; z-index: 3; top: -20%; left: -38%; width: 26%; height: 140%; opacity: 0; background: linear-gradient(105deg, transparent, rgba(255,255,255,.72), rgba(232,183,104,.28), transparent); filter: blur(1px); transform: skewX(-16deg); }
+ .index { position: absolute; left: 50%; top: calc(50% - 154px); display: flex; align-items: center; gap: 12px; transform: translateX(-50%); color: rgba(244,244,246,.52); font: 560 13px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .19em; }
+ .index i { width: 18px; height: 1px; background: var(--amber); box-shadow: 0 0 16px rgba(232,183,104,.48); }
+ .microcopy { position: absolute; left: 50%; top: calc(50% + 145px); transform: translateX(-50%); color: rgba(244,244,246,.42); font: 500 13px/1 "SFMono-Regular", Consolas, monospace; letter-spacing: .2em; }
+ .spark { position: absolute; z-index: 5; left: 50%; top: 50%; width: calc(8px + var(--audio-energy) * 4px); height: calc(8px + var(--audio-energy) * 4px); margin: -4px; border-radius: 50%; opacity: 0; background: #fff6df; box-shadow: 0 0 12px rgba(255,246,223,.9), 0 0 calc(32px + var(--audio-energy) * 18px) rgba(232,183,104,.65), 0 0 78px rgba(232,183,104,.24); }
+ </style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="4" data-track-index="0" data-width="1920" data-height="1080">
+ <div class="plane atmosphere clip" id="atmosphere" data-start="0" data-duration="4" data-track-index="0"></div>
+ <div class="plane orbit clip" id="orbit" data-start="0" data-duration="4" data-track-index="1"></div>
+ <div class="plane guide clip" id="guide" data-start="0" data-duration="4" data-track-index="2"></div>
+ <section class="headline clip" id="headline" data-start="0" data-duration="4" data-track-index="3" aria-label="You Launch Want">
+ <div class="index"><i></i><span>01 / EMPHASIS</span></div>
+ <div class="line">
+ <div class="word-mask"><span class="word" id="word-left">YOU</span></div>
+ <div class="pill-wrap">
+ <div class="contact-shadow" id="contact-shadow"></div>
+ <div class="pill" id="pill"><span class="word">LAUNCH</span><span class="sheen" id="sheen"></span></div>
+ <span class="spark" id="spark"></span>
+ </div>
+ <div class="word-mask"><span class="word" id="word-right">WANT</span></div>
+ </div>
+ <p class="microcopy">CLARITY / STRUCTURE / IMPACT</p>
+ </section>
+ </div>
+ <script>
+ window.__timelines = window.__timelines || {};
+ window.startRender = function startRender() {
+ if (window.__timelines.root) return window.__timelines.root;
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+ tl.from("#atmosphere", { opacity: 0, scale: .72, filter: "blur(22px)", duration: .72, ease: "power3.out" }, 0)
+ .from("#orbit", { opacity: 0, scale: .9, rotation: -9, duration: .82, ease: "power3.inOut" }, .04)
+ .from("#guide", { scaleX: 0, duration: .68, ease: "power3.inOut" }, .08)
+ .from(".index", { opacity: 0, y: 10, duration: .4, ease: "power2.out" }, .16)
+ .from("#word-left", { x: -112, y: 18, rotation: -1.2, opacity: 0, filter: "blur(8px)", duration: .72, ease: "power4.out" }, .2)
+ .from("#word-right", { x: 112, y: -18, rotation: 1.2, opacity: 0, filter: "blur(8px)", duration: .72, ease: "power4.out" }, .29)
+ .fromTo("#pill", { scaleX: .93, scaleY: 1.06, y: 12, opacity: 0, filter: "blur(6px)" }, { scaleX: 1.08, scaleY: .95, y: -4, opacity: 1, filter: "blur(0px)", duration: .43, ease: "power3.out" }, .45)
+ .to("#pill", { scaleX: 1, scaleY: 1, y: 0, duration: .34, ease: "back.out(1.55)" }, .82)
+ .from("#contact-shadow", { opacity: 0, scaleX: .55, y: -8, duration: .62, ease: "power3.out" }, .48)
+ .from(".microcopy", { opacity: 0, y: 9, duration: .42, ease: "power2.out" }, .76)
+ .to("#spark", { opacity: 1, x: -205, duration: .01 }, 1.22)
+ .to("#spark", { x: 210, y: -6, duration: .68, ease: "power3.inOut" }, 1.23)
+ .to("#spark", { opacity: 0, duration: .2, ease: "sine.out" }, 1.72)
+ .to("#sheen", { opacity: .82, left: "118%", duration: .76, ease: "power3.inOut" }, 1.22)
+ .to("#sheen", { opacity: 0, duration: .18, ease: "sine.out" }, 1.8)
+ .to("#orbit", { rotation: -4.7, x: -9, duration: 1.8, ease: "sine.inOut" }, 1.35)
+ .to("#atmosphere", { x: 11, scale: .86, duration: 1.8, ease: "sine.inOut" }, 1.35)
+ .to({}, { duration: .85 });
+ window.__timelines.root = tl;
+ return tl;
+ };
+ window.reactToAudio = function reactToAudio(amplitude = 0, frequency = 0) {
+ const a = Math.max(0, Math.min(1, Number(amplitude) || 0));
+ const f = Math.max(0, Math.min(1, Number(frequency) || 0));
+ document.documentElement.style.setProperty("--audio-energy", a.toFixed(4));
+ document.documentElement.style.setProperty("--audio-tone", f.toFixed(4));
+ };
+ const timeline = window.startRender();
+ if (location.hash === "#play") timeline.play(0);
+ </script>
+</body>
+</html>
diff --git a/public/23-prompt-composer/index.html b/public/23-prompt-composer/index.html
new file mode 100644
index 0000000..26b5f75
--- /dev/null
+++ b/public/23-prompt-composer/index.html
@@ -0,0 +1,93 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Prompt Composer</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1920px; height: 1080px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ /* glassy obsidian composer card */
+ #card {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 1080px;
+ padding: 40px 40px 26px; border-radius: 30px;
+ background: linear-gradient(180deg, #1b1b1f 0%, #131316 100%); border: 1px solid rgba(255,255,255,0.09);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.10), 0 40px 90px rgba(0,0,0,0.55); will-change: transform, opacity;
+ }
+ #text { font-size: 40px; line-height: 1.45; color: #d7d7dc; min-height: 116px; }
+ #text b { color: #fff; font-weight: 600; }
+ #text .hl { background: linear-gradient(180deg,#F2F2F2,#A9A9AE); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 600; }
+ .caret { display: inline-block; width: 3px; height: 40px; background: #cfcfd4; margin-left: 3px; vertical-align: -7px; }
+ #bottom { display: flex; align-items: center; gap: 16px; margin-top: 30px; }
+ .chip {
+ display: inline-flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; font-size: 22px; color: #ECECEE;
+ background: linear-gradient(180deg, #26262b, #16161a); border: 1px solid rgba(255,255,255,0.10); will-change: transform, opacity;
+ }
+ .chip .dot { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(160deg,#3a3a40,#0d0d0f); border: 1px solid rgba(255,255,255,0.12); }
+ .spacer { flex: 1; }
+ .pillbtn { padding: 12px 20px; border-radius: 999px; font-size: 21px; color: #b9b9bd; background: #161618; border: 1px solid rgba(255,255,255,0.08); }
+ #send {
+ width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none;
+ background: linear-gradient(180deg, #F2F2F2 0%, #B8B8BC 100%); box-shadow: inset 0 1px 1px rgba(255,255,255,0.8), 0 12px 26px rgba(0,0,0,0.5);
+ will-change: transform;
+ }
+ #send svg { width: 26px; height: 26px; }
+ /* cursor */
+ #cur { position: absolute; left: 0; top: 0; width: 44px; height: 44px; transform: translate(1180px, 760px); z-index: 6; will-change: transform; }
+ #cur svg { width: 100%; height: 100%; filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <div id="card" class="clip" data-start="0" data-duration="5" data-track-index="0">
+ <div id="text"><span id="typed"></span><span class="caret" id="caret"></span></div>
+ <div id="bottom">
+ <div class="chip" id="chip"><span class="dot"></span> board.fig</div>
+ <div class="spacer"></div>
+ <div class="pillbtn">Chat</div>
+ <div id="send"><svg viewBox="0 0 24 24" fill="none"><path d="M12 19V5M12 5l-6 6M12 5l6 6" stroke="#0c0c0d" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"/></svg></div>
+ </div>
+ </div>
+ <div id="cur" class="clip" data-start="0" data-duration="5" data-track-index="1">
+ <svg viewBox="0 0 24 24"><path d="M4 2 4 20 9 15 12.5 22 15 21 11.5 14 18 14 Z" fill="#fff" stroke="#0a0a0a" stroke-width="0.7" stroke-linejoin="round"/></svg>
+ </div>
+ </div>
+ <script>
+ // segments: [text, className] — className "" plain, "b" bold, "hl" silver highlight
+ const SEG = [
+ ["Build an app that can help me ", ""], ["find companies", "b"], [" to sell to. Here is a board with wireframes ", ""], ["how it should look", "hl"], [".", ""]
+ ];
+ const FULL = SEG.map(s => s[0]).join("");
+ const typed = document.getElementById("typed");
+ function render(n) {
+ let used = 0, html = "";
+ for (const [t, c] of SEG) {
+ if (used >= n) break;
+ const take = Math.min(t.length, n - used);
+ const part = t.slice(0, take).replace(/</g,"&lt;");
+ html += c ? `<span class="${c}">${part}</span>` : part;
+ used += t.length;
+ }
+ typed.innerHTML = html;
+ }
+
+ const tl = gsap.timeline({ paused: true });
+ tl.from("#card", { y: 50, opacity: 0, scale: 0.97, duration: 0.7, ease: "expo.out" }, 0.1);
+ tl.to({ n: 0 }, { n: FULL.length, duration: 2.2, ease: "none", onUpdate() { render(Math.round(this.targets()[0].n)); } }, 0.7);
+ tl.from("#chip", { y: 16, opacity: 0, scale: 0.9, duration: 0.5, ease: "back.out(1.7)" }, 1.4);
+ // cursor to send button, then press
+ tl.to("#cur", { x: 1300, y: 690, duration: 0.8, ease: "power3.inOut" }, 3.0);
+ tl.to("#send", { scale: 0.88, duration: 0.12 }, 3.7);
+ tl.to("#send", { scale: 1, duration: 0.3, ease: "back.out(2.4)" }, 3.82);
+ tl.to("#caret", { opacity: 0, duration: 0.5, repeat: 4, yoyo: true, ease: "steps(1)" }, 0.65);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.repeat(-1).repeatDelay(0.9).play(); }
+ </script>
+</body>
+</html>
diff --git a/public/24-showreel-notify/index.html b/public/24-showreel-notify/index.html
new file mode 100644
index 0000000..833f9f9
--- /dev/null
+++ b/public/24-showreel-notify/index.html
@@ -0,0 +1,81 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Showreel Notify</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; padding: 0; width: 100%; height: 100%; background: transparent; }
+ #root {
+ position: relative; width: 1080px; height: 1920px; background: transparent;
+ overflow: hidden; font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ }
+ /* glowing top + bottom kinetic words */
+ .big {
+ position: absolute; left: 50%; transform: translateX(-50%); text-align: center;
+ font-size: 150px; font-weight: 800; letter-spacing: -0.04em; line-height: 0.95;
+ background: linear-gradient(180deg, #ffffff 0%, #cfcfcf 45%, #8f8f93 100%);
+ -webkit-background-clip: text; background-clip: text; color: transparent;
+ text-shadow: 0 0 60px rgba(220,220,235,0.25); will-change: transform, opacity;
+ }
+ #top { top: 250px; }
+ #top small { display: block; font-size: 64px; font-weight: 500; letter-spacing: 0.02em; -webkit-text-fill-color: #8a8a92; margin-top: 10px; }
+ #year { bottom: 250px; font-size: 200px; }
+
+ /* phone in the center showing a notification */
+ #phone {
+ position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
+ width: 470px; height: 940px; border-radius: 64px; padding: 12px;
+ background: linear-gradient(150deg, #2a2a2f 0%, #0c0c0e 60%); border: 1px solid rgba(255,255,255,0.10);
+ box-shadow: inset 0 1px 0 rgba(255,255,255,0.14), 0 50px 100px rgba(0,0,0,0.6); will-change: transform, opacity;
+ }
+ #pscreen { width: 100%; height: 100%; border-radius: 52px; background: linear-gradient(180deg, #15151a, #0a0a0c); overflow: hidden; position: relative; }
+ /* glassy notification toast */
+ #toast {
+ position: absolute; left: 24px; right: 24px; top: 300px;
+ display: flex; align-items: center; gap: 16px; padding: 20px 22px; border-radius: 24px;
+ background: linear-gradient(180deg, rgba(40,40,46,0.92), rgba(22,22,26,0.92));
+ border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 24px 50px rgba(0,0,0,0.5); will-change: transform, opacity;
+ }
+ #toast .av { width: 64px; height: 64px; border-radius: 16px; flex: none; background: linear-gradient(160deg,#3a3a40,#0d0d0f); border: 1px solid rgba(255,255,255,0.12); display:flex; align-items:center; justify-content:center; }
+ #toast .av svg { width: 34px; height: 34px; }
+ #toast .tx { flex: 1; min-width: 0; }
+ #toast .tx b { display: block; font-size: 24px; color: #fff; font-weight: 600; }
+ #toast .tx p { margin: 4px 0 0; font-size: 22px; color: #b9b9bd; }
+ #toast .badge { position: absolute; top: -10px; right: -8px; width: 34px; height: 34px; border-radius: 50%; background: #ff4b4b; color: #fff; font-size: 20px; font-weight: 700; display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 18px rgba(0,0,0,0.5); }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1080" data-height="1920">
+ <div id="top" class="big clip" data-start="0" data-duration="5" data-track-index="0">VIRAL<small>content</small></div>
+
+ <div id="phone" class="clip" data-start="0" data-duration="5" data-track-index="1">
+ <div id="pscreen">
+ <div id="toast">
+ <div class="av"><svg viewBox="0 0 24 24" fill="none"><circle cx="12" cy="9" r="3.4" stroke="#cfe0d6" stroke-width="1.6"/><path d="M5 19c1.5-3 4-4 7-4s5.5 1 7 4" stroke="#cfe0d6" stroke-width="1.6"/></svg></div>
+ <div class="tx"><b>+49 123 456 7890</b><p>I need a creator!</p></div>
+ <div class="badge">1</div>
+ </div>
+ </div>
+ </div>
+
+ <div id="year" class="big clip" data-start="0" data-duration="5" data-track-index="2">2025</div>
+ </div>
+ <script>
+ const tl = gsap.timeline({ paused: true });
+ tl.from("#phone", { y: 80, opacity: 0, scale: 0.94, duration: 0.9, ease: "power4.out" }, 0.1);
+ tl.from("#top", { y: -50, opacity: 0, duration: 0.8, ease: "power4.out" }, 0.35);
+ tl.from("#year", { y: 50, opacity: 0, duration: 0.8, ease: "power4.out" }, 0.5);
+ // notification drops in with a bounce
+ tl.from("#toast", { y: -120, opacity: 0, duration: 0.7, ease: "back.out(1.7)" }, 1.1);
+ tl.from("#toast .badge", { scale: 0, duration: 0.4, ease: "back.out(2.4)" }, 1.5);
+ // gentle idle float on the phone
+ tl.to("#phone", { y: "-=20", duration: 1.1, ease: "sine.inOut", yoyo: true, repeat: 2 }, 1.6);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") { tl.play(); }
+ </script>
+</body>
+</html>
diff --git a/public/26-null-manifesto/assets/null-logo.png b/public/26-null-manifesto/assets/null-logo.png
new file mode 100644
index 0000000..996e666
Binary files /dev/null and b/public/26-null-manifesto/assets/null-logo.png differ
diff --git a/public/26-null-manifesto/index.html b/public/26-null-manifesto/index.html
new file mode 100644
index 0000000..22ee7a9
--- /dev/null
+++ b/public/26-null-manifesto/index.html
@@ -0,0 +1,1273 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <meta name="hyperframes" content="duration:5,fps:30,width:1920,height:1080,transparent:true" />
+ <meta name="description" content="Null Motion brand manifesto composition" />
+ <title>Null Manifesto</title>
+ <script src="../_vendor/gsap.min.js"></script>
+ <style>
+ :root {
+ --ink: #ececee;
+ --muted: #8a8a92;
+ --panel: rgba(20, 20, 23, 0.94);
+ --panel-2: rgba(27, 27, 31, 0.88);
+ --line: rgba(255, 255, 255, 0.12);
+ --silver: linear-gradient(135deg, #f2f2f2 0%, #b8b8bc 50%, #8c8c90 100%);
+ --blue: #6dcfff;
+ --amber: #ffb24b;
+ }
+
+ * { box-sizing: border-box; }
+
+ html,
+ body {
+ width: 100%;
+ height: 100%;
+ margin: 0;
+ overflow: hidden;
+ background: transparent !important;
+ }
+
+ body {
+ color: var(--ink);
+ font-family: "Inter", -apple-system, "SF Pro Display", "Segoe UI", system-ui, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ text-rendering: geometricPrecision;
+ }
+
+ #root {
+ position: relative;
+ width: 1920px;
+ height: 1080px;
+ overflow: hidden;
+ isolation: isolate;
+ perspective: 1500px;
+ background: transparent !important;
+ }
+
+ .shell {
+ position: absolute;
+ inset: 54px;
+ overflow: hidden;
+ border: 1px solid rgba(255, 255, 255, 0.13);
+ border-radius: 52px;
+ background:
+ radial-gradient(circle at 76% 36%, rgba(76, 161, 224, 0.12), transparent 32%),
+ radial-gradient(circle at 87% 82%, rgba(255, 158, 57, 0.07), transparent 24%),
+ linear-gradient(135deg, rgba(19, 19, 22, 0.97), rgba(7, 7, 9, 0.93));
+ box-shadow:
+ 0 48px 130px rgba(0, 0, 0, 0.48),
+ inset 0 1px 0 rgba(255, 255, 255, 0.1),
+ inset 0 -1px 0 rgba(0, 0, 0, 0.6);
+ backdrop-filter: blur(26px) saturate(120%);
+ -webkit-backdrop-filter: blur(26px) saturate(120%);
+ will-change: transform, opacity, clip-path, filter;
+ }
+
+ .shell::after {
+ position: absolute;
+ inset: 0;
+ z-index: 30;
+ pointer-events: none;
+ content: "";
+ opacity: 0.1;
+ mix-blend-mode: soft-light;
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
+ }
+
+ .ambient {
+ position: absolute;
+ z-index: 0;
+ border-radius: 50%;
+ opacity: 0;
+ pointer-events: none;
+ filter: blur(58px);
+ will-change: transform, opacity, filter;
+ }
+
+ .ambient-blue {
+ top: -280px;
+ right: 100px;
+ width: 780px;
+ height: 780px;
+ background: radial-gradient(circle, rgba(72, 183, 255, 0.2), rgba(33, 85, 138, 0.02) 68%);
+ }
+
+ .ambient-amber {
+ right: -170px;
+ bottom: -350px;
+ width: 720px;
+ height: 720px;
+ background: radial-gradient(circle, rgba(255, 151, 45, 0.14), rgba(124, 65, 14, 0.01) 70%);
+ }
+
+ .ambient-silver {
+ bottom: -470px;
+ left: -300px;
+ width: 900px;
+ height: 900px;
+ background: radial-gradient(circle, rgba(210, 210, 220, 0.1), transparent 70%);
+ }
+
+ .grid {
+ position: absolute;
+ inset: 0;
+ z-index: 1;
+ opacity: 0;
+ clip-path: inset(0 100% 0 0);
+ background-image:
+ linear-gradient(rgba(255, 255, 255, 0.027) 1px, transparent 1px),
+ linear-gradient(90deg, rgba(255, 255, 255, 0.027) 1px, transparent 1px);
+ background-size: 92px 92px;
+ -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 94%);
+ mask-image: linear-gradient(90deg, #000 0%, rgba(0, 0, 0, 0.6) 55%, transparent 94%);
+ will-change: transform, opacity, clip-path;
+ }
+
+ .topbar {
+ position: absolute;
+ top: 54px;
+ right: 72px;
+ left: 72px;
+ z-index: 8;
+ display: flex;
+ align-items: center;
+ min-height: 42px;
+ }
+
+ .brand-lockup,
+ .top-meta {
+ display: flex;
+ align-items: center;
+ flex: 0 0 auto;
+ overflow: hidden;
+ color: rgba(236, 236, 238, 0.65);
+ font-size: 13px;
+ font-weight: 670;
+ letter-spacing: 0.18em;
+ text-transform: uppercase;
+ }
+
+ .brand-mark {
+ position: relative;
+ width: 28px;
+ height: 28px;
+ margin-right: 13px;
+ overflow: hidden;
+ border: 1px solid rgba(255, 255, 255, 0.16);
+ border-radius: 8px;
+ background: #050506 url("assets/null-logo.png") center / cover no-repeat;
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 8px 20px rgba(0, 0, 0, 0.4);
+ }
+
+ .brand-lockup span,
+ .top-meta span {
+ display: inline-block;
+ opacity: 0;
+ transform: translateY(125%);
+ filter: blur(6px);
+ will-change: transform, opacity, filter;
+ }
+
+ .top-rule {
+ height: 1px;
+ margin: 0 26px;
+ flex: 1;
+ transform-origin: left center;
+ background: linear-gradient(90deg, rgba(238, 238, 242, 0.62), rgba(255, 255, 255, 0.05));
+ box-shadow: 0 0 18px rgba(215, 215, 225, 0.12);
+ will-change: transform;
+ }
+
+ .layout {
+ position: absolute;
+ inset: 0;
+ z-index: 5;
+ display: grid;
+ grid-template-columns: 1.04fr 0.96fr;
+ align-items: center;
+ padding: 134px 94px 112px 108px;
+ }
+
+ .copy {
+ position: relative;
+ z-index: 7;
+ width: 840px;
+ }
+
+ .eyebrow {
+ display: flex;
+ align-items: center;
+ margin-bottom: 30px;
+ overflow: hidden;
+ color: #bfc0c5;
+ font-size: 14px;
+ font-weight: 680;
+ letter-spacing: 0.24em;
+ text-transform: uppercase;
+ }
+
+ .eyebrow-dot {
+ width: 8px;
+ height: 8px;
+ margin-right: 13px;
+ flex: 0 0 auto;
+ border-radius: 50%;
+ background: #dfdfe2;
+ box-shadow: 0 0 14px 3px rgba(224, 224, 230, 0.22);
+ }
+
+ .eyebrow span {
+ display: inline-block;
+ opacity: 0;
+ transform: translateY(120%);
+ filter: blur(6px);
+ will-change: transform, opacity, filter;
+ }
+
+ .headline {
+ margin: 0;
+ width: 830px;
+ color: var(--ink);
+ font-size: 113px;
+ font-weight: 790;
+ line-height: 0.84;
+ letter-spacing: -0.073em;
+ text-transform: uppercase;
+ }
+
+ .title-mask {
+ display: block;
+ overflow: hidden;
+ padding: 0.04em 0.07em 0.1em 0;
+ }
+
+ .title-mask:nth-child(2) { margin-left: 0.76em; }
+ .title-mask:nth-child(3) { margin-left: 0.17em; }
+
+ .title-mask:first-child .title-word { word-spacing: 0.09em; }
+
+ .title-word {
+ display: inline-block;
+ opacity: 0;
+ transform-origin: left bottom;
+ filter: blur(15px);
+ will-change: transform, opacity, filter;
+ }
+
+ .title-mask:nth-child(2) .title-word {
+ background: var(--silver);
+ -webkit-background-clip: text;
+ background-clip: text;
+ color: transparent;
+ text-shadow: 0 16px 48px rgba(220, 220, 228, 0.07);
+ }
+
+ .title-mask:nth-child(3) .title-word {
+ font-weight: 430;
+ letter-spacing: -0.065em;
+ color: #9a9aa1;
+ }
+
+ .subcopy {
+ display: flex;
+ align-items: flex-start;
+ width: 650px;
+ margin-top: 44px;
+ }
+
+ .sub-rule {
+ width: 96px;
+ height: 2px;
+ margin-top: 13px;
+ margin-right: 27px;
+ flex: 0 0 auto;
+ transform-origin: left center;
+ background: linear-gradient(90deg, #e1e1e5, rgba(225, 225, 229, 0.08));
+ box-shadow: 0 0 15px rgba(220, 220, 226, 0.14);
+ will-change: transform;
+ }
+
+ .subcopy p {
+ width: 485px;
+ margin: 0;
+ color: var(--muted);
+ font-size: 18px;
+ font-weight: 390;
+ line-height: 1.65;
+ letter-spacing: 0.01em;
+ }
+
+ .word-mask {
+ display: inline-block;
+ overflow: hidden;
+ margin-right: 0.28em;
+ vertical-align: top;
+ }
+
+ .word {
+ display: inline-block;
+ opacity: 0;
+ filter: blur(5px);
+ will-change: transform, opacity, filter;
+ }
+
+ .visual {
+ position: relative;
+ width: 720px;
+ height: 720px;
+ justify-self: end;
+ transform-style: preserve-3d;
+ }
+
+ .orbit-field {
+ position: absolute;
+ inset: 0;
+ opacity: 0;
+ clip-path: circle(0% at 50% 50%);
+ transform-style: preserve-3d;
+ filter: blur(15px);
+ will-change: transform, opacity, clip-path, filter;
+ }
+
+ .halo {
+ position: absolute;
+ inset: 78px;
+ border-radius: 50%;
+ opacity: 0.76;
+ filter: blur(32px);
+ background: conic-gradient(from 205deg, rgba(109, 207, 255, 0.05), rgba(109, 207, 255, 0.36), rgba(255, 178, 75, 0.25), rgba(215, 215, 222, 0.06));
+ }
+
+ .orbit {
+ position: absolute;
+ inset: 83px;
+ border: 1px solid rgba(220, 220, 228, 0.33);
+ border-radius: 50%;
+ transform-style: preserve-3d;
+ box-shadow: 0 0 24px rgba(172, 190, 214, 0.08), inset 0 0 18px rgba(255, 255, 255, 0.03);
+ will-change: transform, opacity;
+ }
+
+ .orbit::before {
+ position: absolute;
+ top: 49%;
+ left: -5px;
+ width: 10px;
+ height: 10px;
+ border-radius: 50%;
+ content: "";
+ background: var(--blue);
+ box-shadow: 0 0 17px 5px rgba(109, 207, 255, 0.35);
+ }
+
+ .orbit-a { transform: rotateX(68deg) rotateZ(7deg); }
+ .orbit-b {
+ inset: 43px;
+ border-color: rgba(255, 178, 75, 0.25);
+ transform: rotateY(65deg) rotateZ(-24deg);
+ }
+
+ .orbit-b::before {
+ top: 18%;
+ right: 7%;
+ left: auto;
+ background: var(--amber);
+ box-shadow: 0 0 17px 5px rgba(255, 178, 75, 0.3);
+ }
+
+ .orbit-c {
+ inset: 17px;
+ border-color: rgba(232, 232, 236, 0.16);
+ transform: rotateX(52deg) rotateY(37deg) rotateZ(44deg);
+ }
+
+ .orbit-c::before {
+ top: auto;
+ bottom: 12%;
+ left: 24%;
+ background: #e4e4e8;
+ box-shadow: 0 0 17px 5px rgba(224, 224, 230, 0.2);
+ }
+
+ .logo-card {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ width: 394px;
+ height: 394px;
+ margin: -197px 0 0 -197px;
+ overflow: hidden;
+ border: 1px solid rgba(255, 255, 255, 0.16);
+ border-radius: 94px;
+ transform: translateZ(94px);
+ transform-style: preserve-3d;
+ background: #050506;
+ box-shadow:
+ inset 0 2px 1px rgba(255, 255, 255, 0.16),
+ inset 0 -30px 70px rgba(0, 0, 0, 0.42),
+ 0 48px 95px rgba(0, 0, 0, 0.58),
+ 0 0 70px rgba(84, 155, 211, 0.12);
+ will-change: transform, filter;
+ }
+
+ .logo-card::before {
+ position: absolute;
+ inset: 0;
+ z-index: 3;
+ border-radius: inherit;
+ pointer-events: none;
+ content: "";
+ background: linear-gradient(145deg, rgba(255, 255, 255, 0.13), transparent 27%, transparent 70%, rgba(255, 255, 255, 0.035));
+ }
+
+ .logo-card::after {
+ position: absolute;
+ top: -25%;
+ bottom: -25%;
+ left: var(--glint-x, -70%);
+ z-index: 4;
+ width: 37%;
+ pointer-events: none;
+ content: "";
+ transform: skewX(-18deg);
+ opacity: 0.82;
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.48), transparent);
+ filter: blur(7px);
+ }
+
+ .logo-card img {
+ width: 100%;
+ height: 100%;
+ display: block;
+ object-fit: cover;
+ transform: scale(1.32);
+ filter: blur(16px) saturate(0.65);
+ will-change: transform, filter, opacity;
+ }
+
+ .axis {
+ position: absolute;
+ top: 50%;
+ left: 5%;
+ width: 90%;
+ height: 1px;
+ background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
+ opacity: 0.44;
+ will-change: transform;
+ }
+
+ .status-chip,
+ .metric-card {
+ position: absolute;
+ z-index: 10;
+ overflow: hidden;
+ border: 1px solid rgba(255, 255, 255, 0.14);
+ opacity: 0;
+ background: linear-gradient(150deg, rgba(47, 47, 53, 0.75), rgba(12, 12, 15, 0.82));
+ box-shadow: 0 24px 55px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.12);
+ backdrop-filter: blur(19px) saturate(130%);
+ -webkit-backdrop-filter: blur(19px) saturate(130%);
+ will-change: transform, opacity, filter, clip-path;
+ }
+
+ .status-chip {
+ top: 56px;
+ right: -8px;
+ display: flex;
+ align-items: center;
+ padding: 14px 18px;
+ border-radius: 999px;
+ clip-path: inset(0 100% 0 0 round 999px);
+ color: rgba(236, 236, 238, 0.78);
+ font-size: 11px;
+ font-weight: 720;
+ letter-spacing: 0.16em;
+ text-transform: uppercase;
+ }
+
+ .status-dot {
+ width: 7px;
+ height: 7px;
+ margin-right: 10px;
+ border-radius: 50%;
+ background: #d9d9de;
+ box-shadow: 0 0 11px 3px rgba(220, 220, 226, 0.28);
+ }
+
+ .metric-card {
+ bottom: 48px;
+ left: -16px;
+ width: 252px;
+ padding: 23px 24px;
+ border-radius: 22px;
+ clip-path: inset(100% 0 0 0 round 22px);
+ }
+
+ .metric-head {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ margin-bottom: 16px;
+ color: rgba(236, 236, 238, 0.48);
+ font-size: 10px;
+ font-weight: 700;
+ letter-spacing: 0.17em;
+ text-transform: uppercase;
+ }
+
+ .metric-head svg {
+ width: 21px;
+ height: 21px;
+ color: #cfcfd4;
+ filter: drop-shadow(0 0 8px rgba(220, 220, 226, 0.24));
+ }
+
+ .metric-value {
+ color: var(--ink);
+ font-size: 45px;
+ font-weight: 740;
+ line-height: 1;
+ letter-spacing: -0.064em;
+ }
+
+ .metric-value small {
+ margin-left: 5px;
+ color: #9c9ca3;
+ font-size: 12px;
+ font-weight: 720;
+ letter-spacing: 0.13em;
+ }
+
+ .meter {
+ height: 3px;
+ margin-top: 18px;
+ overflow: hidden;
+ border-radius: 10px;
+ background: rgba(255, 255, 255, 0.08);
+ }
+
+ .meter span {
+ display: block;
+ width: 79%;
+ height: 100%;
+ transform-origin: left center;
+ border-radius: inherit;
+ background: var(--silver);
+ box-shadow: 0 0 13px rgba(220, 220, 226, 0.24);
+ will-change: transform;
+ }
+
+ .vertical-index {
+ position: absolute;
+ top: 50%;
+ right: 30px;
+ z-index: 8;
+ display: flex;
+ align-items: center;
+ opacity: 0;
+ writing-mode: vertical-rl;
+ color: rgba(236, 236, 238, 0.34);
+ font-size: 10px;
+ font-weight: 670;
+ letter-spacing: 0.27em;
+ text-transform: uppercase;
+ will-change: transform, opacity, filter;
+ }
+
+ .vertical-index::before {
+ width: 1px;
+ height: 54px;
+ margin-bottom: 16px;
+ content: "";
+ background: linear-gradient(transparent, rgba(255, 255, 255, 0.45));
+ }
+
+ .trail {
+ position: absolute;
+ inset: 0;
+ z-index: 3;
+ pointer-events: none;
+ }
+
+ .trail svg {
+ width: 100%;
+ height: 100%;
+ overflow: visible;
+ }
+
+ .trail-path {
+ fill: none;
+ stroke: url(#trail-gradient);
+ stroke-width: 2;
+ stroke-linecap: round;
+ stroke-dasharray: 1700;
+ stroke-dashoffset: 1700;
+ opacity: 0;
+ filter: url(#trail-glow);
+ will-change: stroke-dashoffset, opacity;
+ }
+
+ .particle-layer {
+ position: absolute;
+ inset: 0;
+ z-index: 2;
+ pointer-events: none;
+ }
+
+ .particle {
+ position: absolute;
+ width: var(--size);
+ height: var(--size);
+ border-radius: 50%;
+ opacity: 0;
+ background: var(--particle-color);
+ box-shadow: 0 0 calc(var(--size) * 4) var(--particle-color);
+ will-change: transform, opacity, filter;
+ }
+
+ .footer {
+ position: absolute;
+ right: 73px;
+ bottom: 43px;
+ left: 73px;
+ z-index: 9;
+ display: flex;
+ align-items: flex-end;
+ justify-content: space-between;
+ pointer-events: none;
+ }
+
+ .footer-label,
+ .footer-time {
+ overflow: hidden;
+ color: rgba(236, 236, 238, 0.42);
+ font-size: 10px;
+ font-weight: 670;
+ letter-spacing: 0.21em;
+ text-transform: uppercase;
+ }
+
+ .footer-time { color: rgba(216, 216, 222, 0.68); }
+
+ .footer-label span,
+ .footer-time span {
+ display: inline-block;
+ opacity: 0;
+ transform: translateY(125%);
+ filter: blur(5px);
+ will-change: transform, opacity, filter;
+ }
+ </style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1920" data-height="1080">
+ <section id="shell" class="shell clip" data-start="0" data-duration="5" data-track-index="1">
+ <div class="ambient ambient-blue"></div>
+ <div class="ambient ambient-amber"></div>
+ <div class="ambient ambient-silver"></div>
+ <div class="grid"></div>
+
+ <header id="topbar" class="topbar clip" data-start="0" data-duration="5" data-track-index="2">
+ <div class="brand-lockup">
+ <span class="brand-mark" aria-hidden="true"></span>
+ <span>Null / Motion</span>
+ </div>
+ <div class="top-rule"></div>
+ <div class="top-meta"><span>Manifesto / 005</span></div>
+ </header>
+
+ <div class="layout">
+ <article id="copy" class="copy clip" data-start="0" data-duration="5" data-track-index="3">
+ <div class="eyebrow">
+ <span class="eyebrow-dot"></span>
+ <span>After Effects-level craft</span>
+ </div>
+
+ <div class="headline-wrap">
+ <h1 class="headline">
+ <span class="title-mask"><span class="title-word">The King Of</span></span>
+ <span class="title-mask"><span class="title-word">Motion</span></span>
+ <span class="title-mask"><span class="title-word">Graphics.</span></span>
+ </h1>
+ </div>
+
+ <div class="subcopy">
+ <span class="sub-rule"></span>
+ <p data-split-words>Studio-grade motion, built frame by frame from one line of text.</p>
+ </div>
+ </article>
+
+ <aside id="visual" class="visual clip" data-start="0" data-duration="5" data-track-index="4" aria-hidden="true">
+ <div class="orbit-field">
+ <div class="halo"></div>
+ <div class="axis"></div>
+ <div class="orbit orbit-a"></div>
+ <div class="orbit orbit-b"></div>
+ <div class="orbit orbit-c"></div>
+ <figure class="logo-card">
+ <img src="assets/null-logo.png" alt="Null metallic n logo" />
+ </figure>
+ </div>
+
+ <div class="status-chip">
+ <span class="status-dot"></span>
+ <span>Alpha ready / 30 FPS</span>
+ </div>
+
+ <div class="metric-card">
+ <div class="metric-head">
+ <span>Frame control</span>
+ <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
+ <path d="M3 15.5c3.1 0 3.1-7 6.2-7s3.1 7 6.2 7 3.1-7 5.6-7" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" />
+ <circle cx="3" cy="15.5" r="1.4" fill="currentColor" />
+ <circle cx="21" cy="8.5" r="1.4" fill="currentColor" />
+ </svg>
+ </div>
+ <div class="metric-value">05.00<small>SEC</small></div>
+ <div class="meter"><span></span></div>
+ </div>
+ </aside>
+ </div>
+
+ <div id="trail" class="trail clip" data-start="0" data-duration="5" data-track-index="5" aria-hidden="true">
+ <svg viewBox="0 0 1812 972" preserveAspectRatio="none">
+ <defs>
+ <linearGradient id="trail-gradient" x1="0" y1="0" x2="1" y2="0">
+ <stop offset="0" stop-color="#d8d8de" stop-opacity="0" />
+ <stop offset="0.42" stop-color="#d8d8de" stop-opacity="0.42" />
+ <stop offset="0.72" stop-color="#6dcfff" stop-opacity="0.78" />
+ <stop offset="1" stop-color="#ffb24b" stop-opacity="0" />
+ </linearGradient>
+ <filter id="trail-glow" x="-100%" y="-100%" width="300%" height="300%">
+ <feGaussianBlur stdDeviation="5" result="blur" />
+ <feMerge><feMergeNode in="blur" /><feMergeNode in="SourceGraphic" /></feMerge>
+ </filter>
+ </defs>
+ <path class="trail-path" d="M-90 802 C 240 670, 464 908, 745 760 S 1270 570, 1900 710" />
+ </svg>
+ </div>
+
+ <div id="particles" class="particle-layer clip" data-start="0" data-duration="5" data-track-index="6" aria-hidden="true"></div>
+ <div class="vertical-index">Design / Animate / Render</div>
+
+ <footer id="footer" class="footer clip" data-start="0" data-duration="5" data-track-index="7">
+ <div class="footer-label"><span>Null Motion / Creative system</span></div>
+ <div class="footer-time"><span>00:00:05:00</span></div>
+ </footer>
+ </section>
+ </div>
+
+ <script>
+ window.__timelines = window.__timelines || {};
+ window.startRender = function startRender() {
+ if (window.__timelines.root) return window.__timelines.root;
+ const splitWords = (element) => {
+ const words = element.textContent.trim().split(/\s+/);
+ element.textContent = "";
+ words.forEach((word) => {
+ const mask = document.createElement("span");
+ const inner = document.createElement("span");
+ mask.className = "word-mask";
+ inner.className = "word";
+ inner.textContent = word;
+ mask.appendChild(inner);
+ element.appendChild(mask);
+ });
+ };
+
+ document.querySelectorAll("[data-split-words]").forEach(splitWords);
+
+ const particleLayer = document.getElementById("particles");
+ const particleColors = ["#d8d8de", "#6dcfff", "#ffb24b", "#a5a5ac"];
+
+ for (let index = 0; index < 22; index += 1) {
+ const particle = document.createElement("i");
+ particle.className = "particle";
+ particle.style.left = `${6 + ((index * 37) % 89)}%`;
+ particle.style.top = `${8 + ((index * 53) % 84)}%`;
+ particle.style.setProperty("--size", `${2 + ((index * 7) % 5)}px`);
+ particle.style.setProperty("--particle-color", particleColors[index % particleColors.length]);
+ particleLayer.appendChild(particle);
+ }
+
+ const logoCard = document.querySelector(".logo-card");
+ const tl = gsap.timeline({ paused: true });
+
+ tl.fromTo(".shell", {
+ opacity: 0,
+ scale: 0.97,
+ clipPath: "inset(49% 49% 49% 49% round 52px)"
+ }, {
+ opacity: 1,
+ scale: 1,
+ clipPath: "inset(0% 0% 0% 0% round 52px)",
+ duration: 0.9,
+ ease: "expo.out"
+ }, 0);
+
+ tl.to(".ambient-blue", {
+ opacity: 1,
+ x: -40,
+ y: 30,
+ scale: 1.08,
+ rotation: 8,
+ duration: 1.65,
+ ease: "power3.inOut"
+ }, 0.02);
+
+ tl.to(".ambient-amber", {
+ opacity: 1,
+ x: -22,
+ y: -28,
+ scale: 1.05,
+ rotation: -6,
+ duration: 1.8,
+ ease: "power3.inOut"
+ }, 0.08);
+
+ tl.to(".ambient-silver", {
+ opacity: 1,
+ x: 45,
+ y: -30,
+ scale: 1.08,
+ duration: 1.72,
+ ease: "power2.inOut"
+ }, 0.12);
+
+ tl.to(".grid", {
+ opacity: 0.7,
+ clipPath: "inset(0% 0% 0% 0%)",
+ x: -13,
+ duration: 1.32,
+ ease: "power4.out"
+ }, 0.12);
+
+ tl.fromTo(".top-rule", {
+ scaleX: 0
+ }, {
+ scaleX: 1,
+ duration: 1.05,
+ ease: "expo.out"
+ }, 0.2);
+
+ tl.to(".brand-lockup span, .top-meta span", {
+ opacity: 1,
+ y: "0%",
+ filter: "blur(0px)",
+ duration: 0.62,
+ stagger: 0.08,
+ ease: "power4.out"
+ }, 0.28);
+
+ tl.to(".eyebrow span", {
+ opacity: 1,
+ y: "0%",
+ filter: "blur(0px)",
+ duration: 0.65,
+ stagger: 0.08,
+ ease: "power4.out"
+ }, 0.38);
+
+ tl.fromTo(".title-word", {
+ opacity: 0,
+ yPercent: 118,
+ skewY: 7,
+ scale: 1.075,
+ filter: "blur(15px)"
+ }, {
+ opacity: 1,
+ yPercent: 0,
+ skewY: 0,
+ scale: 1,
+ filter: "blur(0px)",
+ duration: 0.9,
+ stagger: 0.105,
+ ease: "power4.out"
+ }, 0.48);
+
+ tl.to(".headline-wrap", {
+ x: 6,
+ scale: 1.022,
+ transformOrigin: "18% 50%",
+ duration: 0.2,
+ ease: "power3.out"
+ }, 1.1);
+
+ tl.to(".headline-wrap", {
+ x: 0,
+ scale: 1,
+ duration: 0.4,
+ ease: "back.out(1.45)"
+ }, 1.3);
+
+ tl.fromTo(".sub-rule", {
+ scaleX: 0
+ }, {
+ scaleX: 1.1,
+ duration: 0.6,
+ ease: "expo.out"
+ }, 0.96);
+
+ tl.to(".sub-rule", {
+ scaleX: 1,
+ duration: 0.3,
+ ease: "power3.inOut"
+ }, 1.56);
+
+ tl.fromTo(".subcopy .word", {
+ opacity: 0,
+ yPercent: 124,
+ filter: "blur(5px)"
+ }, {
+ opacity: 1,
+ yPercent: 0,
+ filter: "blur(0px)",
+ duration: 0.53,
+ stagger: 0.045,
+ ease: "power4.out"
+ }, 1.0);
+
+ tl.fromTo(".orbit-field", {
+ opacity: 0,
+ clipPath: "circle(0% at 50% 50%)",
+ scale: 0.68,
+ rotationY: -24,
+ rotationX: 9,
+ filter: "blur(15px)"
+ }, {
+ opacity: 1,
+ clipPath: "circle(75% at 50% 50%)",
+ scale: 1,
+ rotationY: 0,
+ rotationX: 0,
+ filter: "blur(0px)",
+ duration: 1.12,
+ ease: "back.out(1.25)"
+ }, 0.62);
+
+ tl.to(".logo-card img", {
+ scale: 1,
+ filter: "blur(0px) saturate(1)",
+ duration: 0.9,
+ ease: "power4.out"
+ }, 0.98);
+
+ tl.fromTo(".axis", {
+ rotation: -38,
+ scaleX: 0
+ }, {
+ rotation: -38,
+ scaleX: 1,
+ duration: 0.82,
+ ease: "expo.out"
+ }, 0.94);
+
+ tl.to(".logo-card", {
+ scale: 1.075,
+ rotation: 5,
+ duration: 0.32,
+ ease: "power3.out"
+ }, 1.34);
+
+ tl.to(".logo-card", {
+ scale: 1,
+ rotation: 0,
+ duration: 0.52,
+ ease: "back.out(1.7)"
+ }, 1.67);
+
+ tl.to(".orbit-a", {
+ rotationZ: 68,
+ rotationX: 75,
+ duration: 3.16,
+ ease: "power2.inOut"
+ }, 0.88);
+
+ tl.to(".orbit-b", {
+ rotationZ: -102,
+ rotationY: 72,
+ duration: 3.28,
+ ease: "power3.inOut"
+ }, 0.82);
+
+ tl.to(".orbit-c", {
+ rotationZ: 112,
+ rotationX: 61,
+ rotationY: 21,
+ duration: 3.06,
+ ease: "power2.inOut"
+ }, 0.98);
+
+ tl.fromTo(".status-chip", {
+ opacity: 0,
+ x: 42,
+ y: -20,
+ z: 110,
+ rotation: 4,
+ clipPath: "inset(0 100% 0 0 round 999px)"
+ }, {
+ opacity: 1,
+ x: 0,
+ y: 0,
+ rotation: 0,
+ clipPath: "inset(0% 0% 0% 0% round 999px)",
+ duration: 0.72,
+ ease: "back.out(1.55)"
+ }, 1.12);
+
+ tl.fromTo(".metric-card", {
+ opacity: 0,
+ x: -42,
+ y: 54,
+ z: 110,
+ rotation: -5,
+ clipPath: "inset(100% 0 0 0 round 22px)"
+ }, {
+ opacity: 1,
+ x: 0,
+ y: 0,
+ rotation: 0,
+ clipPath: "inset(0% 0% 0% 0% round 22px)",
+ duration: 0.86,
+ ease: "power4.out"
+ }, 1.24);
+
+ tl.fromTo(".meter span", {
+ scaleX: 0
+ }, {
+ scaleX: 1.08,
+ duration: 0.7,
+ ease: "expo.out"
+ }, 1.82);
+
+ tl.to(".meter span", {
+ scaleX: 1,
+ duration: 0.32,
+ ease: "power3.inOut"
+ }, 2.53);
+
+ tl.fromTo(".vertical-index", {
+ opacity: 0,
+ x: 25,
+ yPercent: -50,
+ filter: "blur(5px)"
+ }, {
+ opacity: 1,
+ x: 0,
+ yPercent: -50,
+ filter: "blur(0px)",
+ duration: 0.72,
+ ease: "power4.out"
+ }, 1.34);
+
+ tl.to(".trail-path", {
+ opacity: 0.86,
+ strokeDashoffset: 0,
+ duration: 1.44,
+ ease: "power3.inOut"
+ }, 1.56);
+
+ tl.to(".trail-path", {
+ opacity: 0.16,
+ strokeDashoffset: -130,
+ duration: 1.02,
+ ease: "power2.inOut"
+ }, 3.0);
+
+ tl.to(".footer-label span, .footer-time span", {
+ opacity: 1,
+ y: "0%",
+ filter: "blur(0px)",
+ duration: 0.58,
+ stagger: 0.1,
+ ease: "power4.out"
+ }, 1.62);
+
+ document.querySelectorAll(".particle").forEach((particle, index) => {
+ const start = 0.58 + (index % 8) * 0.09;
+ const driftX = ((index * 29) % 72) - 36;
+ const driftY = -28 - ((index * 17) % 74);
+ const duration = 2.35 + (index % 5) * 0.22;
+
+ tl.fromTo(particle, {
+ opacity: 0,
+ x: 0,
+ y: 14,
+ scale: 0.3,
+ filter: "blur(0px)"
+ }, {
+ opacity: 0.18 + (index % 4) * 0.09,
+ x: driftX,
+ y: driftY,
+ scale: 1,
+ filter: "blur(0px)",
+ duration,
+ ease: "power2.inOut"
+ }, start);
+
+ tl.to(particle, {
+ opacity: 0,
+ x: driftX * 1.22,
+ y: driftY - 22,
+ scale: 0.4,
+ filter: "blur(3px)",
+ duration: 0.46,
+ ease: "power3.in"
+ }, Math.min(4.0, start + duration));
+ });
+
+ tl.to(".orbit-field", {
+ x: -14,
+ y: 10,
+ rotationZ: -3,
+ duration: 2.3,
+ ease: "power2.inOut"
+ }, 1.78);
+
+ tl.to(".metric-card", {
+ y: -12,
+ rotation: -1.5,
+ duration: 1.62,
+ ease: "power2.inOut"
+ }, 2.3);
+
+ tl.to(".status-chip", {
+ y: 8,
+ rotation: 1.2,
+ duration: 1.5,
+ ease: "power2.inOut"
+ }, 2.24);
+
+ tl.to(".ambient-blue", {
+ x: 24,
+ y: 48,
+ scale: 1.14,
+ rotation: 16,
+ duration: 2.08,
+ ease: "power2.inOut"
+ }, 1.92);
+
+ tl.to(".ambient-amber", {
+ x: -52,
+ y: -54,
+ scale: 1.1,
+ rotation: -13,
+ duration: 2.02,
+ ease: "power3.inOut"
+ }, 2.02);
+
+ tl.to(".grid", {
+ x: 18,
+ y: -9,
+ opacity: 0.42,
+ duration: 2.22,
+ ease: "power2.inOut"
+ }, 1.84);
+
+ tl.to({ progress: 0 }, {
+ progress: 1,
+ duration: 0.84,
+ ease: "power3.inOut",
+ onUpdate() {
+ const progress = this.targets()[0].progress;
+ logoCard.style.setProperty("--glint-x", `${-70 + progress * 235}%`);
+ }
+ }, 2.78);
+
+ tl.to(".title-mask:nth-child(2) .title-word", {
+ scale: 1.018,
+ filter: "drop-shadow(0 0 18px rgba(225,225,230,0.18))",
+ duration: 0.3,
+ ease: "power3.out"
+ }, 2.86);
+
+ tl.to(".title-mask:nth-child(2) .title-word", {
+ scale: 1,
+ filter: "drop-shadow(0 0 0 rgba(225,225,230,0))",
+ duration: 0.45,
+ ease: "back.out(1.3)"
+ }, 3.16);
+
+ tl.to(".metric-card, .status-chip", {
+ opacity: 0,
+ y: -38,
+ scale: 0.92,
+ filter: "blur(10px)",
+ duration: 0.5,
+ stagger: 0.06,
+ ease: "power3.in"
+ }, 4.16);
+
+ tl.to(".subcopy, .eyebrow, .footer, .vertical-index", {
+ opacity: 0,
+ y: -20,
+ filter: "blur(9px)",
+ duration: 0.46,
+ stagger: 0.035,
+ ease: "power3.in"
+ }, 4.22);
+
+ tl.to(".orbit-field", {
+ opacity: 0,
+ scale: 0.72,
+ rotationZ: 14,
+ rotationY: 28,
+ filter: "blur(18px)",
+ clipPath: "circle(0% at 50% 50%)",
+ duration: 0.62,
+ ease: "power3.inOut"
+ }, 4.28);
+
+ tl.to(".headline-wrap", {
+ opacity: 0,
+ y: -48,
+ scale: 1.045,
+ skewY: -3,
+ filter: "blur(14px)",
+ duration: 0.55,
+ ease: "power3.in"
+ }, 4.38);
+
+ tl.to(".topbar", {
+ opacity: 0,
+ y: -16,
+ filter: "blur(7px)",
+ duration: 0.42,
+ ease: "power3.in"
+ }, 4.4);
+
+ tl.to(".ambient, .grid, .trail-path", {
+ opacity: 0,
+ scale: 0.88,
+ filter: "blur(74px)",
+ duration: 0.56,
+ stagger: 0.02,
+ ease: "power3.inOut"
+ }, 4.36);
+
+ tl.to(".shell", {
+ opacity: 0,
+ scale: 0.985,
+ clipPath: "inset(49% 49% 49% 49% round 52px)",
+ duration: 0.65,
+ ease: "power3.inOut"
+ }, 4.35);
+
+ window.__timelines["root"] = tl;
+ window.tl = tl;
+ return tl;
+ };
+ window.reactToAudio = function reactToAudio(amplitude = 0, frequency = 0) {
+ const a = Math.max(0, Math.min(1, Number(amplitude) || 0));
+ const f = Math.max(0, Math.min(1, Number(frequency) || 0));
+ document.documentElement.style.setProperty("--audio-energy", a.toFixed(4));
+ document.documentElement.style.setProperty("--audio-tone", f.toFixed(4));
+ };
+ const timeline = window.startRender();
+ if (location.hash === "#play") timeline.play(0);
+ </script>
+</body>
+</html>
diff --git a/public/27-cinematic-hud-overlay/index.html b/public/27-cinematic-hud-overlay/index.html
new file mode 100644
index 0000000..9d31616
--- /dev/null
+++ b/public/27-cinematic-hud-overlay/index.html
@@ -0,0 +1,506 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Cinematic Neural HUD</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ @font-face { font-family: "Arial"; src: local("Arial"); font-display: swap; }
+ @font-face { font-family: "Consolas"; src: local("Consolas"); font-display: swap; }
+
+ :root {
+ --core: #00e5ff;
+ --core-hot: #c6faff;
+ --core-deep: #087c9c;
+ --secondary: #ff2bd6;
+ --secondary-hot: #ffc4f3;
+ --core-glow: rgba(0, 229, 255, .68);
+ --secondary-glow: rgba(255, 43, 214, .48);
+ --void: #03050d;
+ --void-soft: #09111f;
+ --paper: #eafcff;
+ --muted: rgba(210, 241, 247, .48);
+ }
+
+ * { box-sizing: border-box; }
+ html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: transparent; }
+ body { font-family: "Arial", sans-serif; }
+
+ #root {
+ position: relative;
+ width: 1080px;
+ height: 1920px;
+ overflow: hidden;
+ isolation: isolate;
+ color: var(--paper);
+ background: transparent;
+ }
+
+ /* Bounded atmosphere: nearly full frame for drama, softly feathered to real alpha. */
+ #voidField {
+ position: absolute;
+ inset: 34px 28px 30px;
+ overflow: hidden;
+ border-radius: 54px;
+ background:
+ radial-gradient(circle at 39% 40%, rgba(0,229,255,.11) 0, rgba(0,229,255,.04) 22%, transparent 48%),
+ radial-gradient(circle at 69% 61%, rgba(255,43,214,.075) 0, transparent 42%),
+ linear-gradient(154deg, rgba(10,20,35,.98), rgba(2,4,11,.975) 58%, rgba(8,5,18,.96));
+ box-shadow: inset 0 0 0 1px rgba(193,243,255,.09), inset 0 0 160px rgba(0,0,0,.82), 0 24px 80px rgba(0,0,0,.38);
+ -webkit-mask-image: radial-gradient(ellipse 78% 76% at 50% 49%, #000 58%, rgba(0,0,0,.94) 79%, transparent 100%);
+ mask-image: radial-gradient(ellipse 78% 76% at 50% 49%, #000 58%, rgba(0,0,0,.94) 79%, transparent 100%);
+ }
+ #voidField::before {
+ content: "";
+ position: absolute;
+ inset: 0;
+ opacity: .18;
+ background-image:
+ linear-gradient(rgba(180,235,255,.055) 1px, transparent 1px),
+ linear-gradient(90deg, rgba(180,235,255,.045) 1px, transparent 1px);
+ background-size: 74px 74px;
+ -webkit-mask-image: radial-gradient(circle at 47% 46%, #000, transparent 72%);
+ mask-image: radial-gradient(circle at 47% 46%, #000, transparent 72%);
+ }
+ #voidField::after {
+ content: "";
+ position: absolute;
+ inset: 0;
+ opacity: .14;
+ mix-blend-mode: screen;
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 240 240' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' seed='17' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.24'/%3E%3C/svg%3E");
+ }
+
+ .depth-orb {
+ position: absolute;
+ border-radius: 50%;
+ pointer-events: none;
+ will-change: transform, opacity;
+ }
+ #orbCyan { width: 650px; height: 650px; left: -240px; top: 188px; background: var(--core); opacity: .075; filter: blur(132px); }
+ #orbMagenta { width: 720px; height: 720px; right: -310px; bottom: 160px; background: var(--secondary); opacity: .06; filter: blur(158px); }
+ #orbViolet { width: 440px; height: 440px; left: 350px; top: 810px; background: #6c43ff; opacity: .045; filter: blur(145px); }
+
+ #dustField { position: absolute; inset: 64px 42px; pointer-events: none; overflow: hidden; border-radius: 42px; }
+ .dust {
+ position: absolute;
+ border-radius: 50%;
+ background: var(--core-hot);
+ box-shadow: 0 0 8px var(--core-glow);
+ will-change: transform, opacity;
+ }
+
+ #backgroundSatellites, #midgroundSatellites { position: absolute; inset: 0; pointer-events: none; }
+ .satellite {
+ position: absolute;
+ display: grid;
+ place-items: center;
+ color: var(--core);
+ border: 1px solid color-mix(in srgb, var(--core) 28%, transparent);
+ background: rgba(5,12,22,.48);
+ clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
+ }
+ .satellite svg { width: 55%; height: 55%; overflow: visible; }
+ .satellite path, .satellite circle, .satellite polyline, .satellite line {
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 2.8;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ }
+ .satellite.back {
+ width: 82px;
+ height: 82px;
+ opacity: .23;
+ filter: blur(3.6px) drop-shadow(0 0 18px var(--core-glow));
+ }
+ .satellite.mid {
+ width: 116px;
+ height: 116px;
+ opacity: .52;
+ filter: drop-shadow(0 0 2px rgba(255,255,255,.68)) drop-shadow(0 0 17px var(--core-glow));
+ }
+ .s1 { left: 94px; top: 312px; } .s2 { right: 112px; top: 416px; }
+ .s3 { left: 124px; top: 1136px; } .s4 { right: 92px; top: 1252px; }
+ .s5 { left: 252px; top: 230px; } .s6 { right: 254px; top: 1112px; }
+ .s7 { left: 75px; top: 788px; } .s8 { right: 64px; top: 812px; }
+
+ #networkSvg { position: absolute; inset: 0; width: 1080px; height: 1920px; overflow: visible; pointer-events: none; }
+ .network-path {
+ fill: none;
+ stroke: url(#networkGradient);
+ stroke-width: 1.7;
+ stroke-dasharray: 8 12;
+ opacity: .42;
+ filter: url(#lineGlow);
+ }
+ .network-node { fill: var(--core-hot); stroke: var(--core); stroke-width: 3; filter: url(#nodeGlow); }
+ .network-node.secondary { fill: var(--secondary-hot); stroke: var(--secondary); }
+
+ #hub {
+ position: absolute;
+ left: 132px;
+ top: 424px;
+ width: 620px;
+ height: 620px;
+ perspective: 900px;
+ }
+ .hub-motion { position: absolute; inset: 0; transform-origin: 50% 50%; will-change: transform, filter, opacity; }
+ .volumetric-spill {
+ position: absolute;
+ inset: -210px;
+ opacity: .14;
+ border-radius: 50%;
+ background: radial-gradient(circle, var(--core-glow) 0, rgba(0,229,255,.22) 16%, rgba(0,229,255,.075) 37%, transparent 69%);
+ filter: blur(18px);
+ mix-blend-mode: screen;
+ }
+ .hub-optics {
+ position: absolute;
+ inset: 0;
+ border-radius: 50%;
+ filter:
+ drop-shadow(0 0 2px rgba(255,255,255,.95))
+ drop-shadow(0 0 10px var(--core-glow))
+ drop-shadow(0 0 35px color-mix(in srgb, var(--core) 42%, transparent))
+ drop-shadow(0 0 90px color-mix(in srgb, var(--core) 16%, transparent));
+ }
+ .hub-svg { width: 100%; height: 100%; overflow: visible; }
+ .ring-faint { fill: none; stroke: rgba(206,247,255,.12); stroke-width: 2; }
+ .ring-dashed { fill: none; stroke: var(--core); stroke-width: 2.5; stroke-dasharray: 4 15; opacity: .66; }
+ .ring-solid { fill: none; stroke: url(#coreGradient); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 510 1170; }
+ .ring-secondary { fill: none; stroke: var(--secondary); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 114 38 24 72; opacity: .72; }
+ .scope-tick { stroke: rgba(224,250,255,.38); stroke-width: 2; }
+ .core-disc { fill: rgba(3,11,20,.84); stroke: rgba(202,248,255,.16); stroke-width: 2; }
+ .core-hex { fill: rgba(0,229,255,.045); stroke: var(--core); stroke-width: 3; }
+ .core-mark { fill: none; stroke: var(--core-hot); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
+ .core-hotspot { fill: #fff; stroke: var(--core); stroke-width: 7; }
+ .core-label {
+ position: absolute;
+ left: 194px;
+ top: 270px;
+ width: 232px;
+ text-align: center;
+ pointer-events: none;
+ }
+ .core-label strong { display: block; font-size: 44px; line-height: .9; letter-spacing: -.055em; }
+ .core-label span { display: block; margin-top: 12px; font-family: "Consolas", monospace; font-size: 13px; letter-spacing: .28em; color: var(--core); text-transform: uppercase; }
+
+ #hudHeader {
+ position: absolute;
+ left: 86px;
+ top: 102px;
+ width: 908px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ }
+ .brand-lockup { display: flex; align-items: center; gap: 22px; }
+ .brand-mark {
+ width: 92px;
+ height: 92px;
+ display: grid;
+ place-items: center;
+ clip-path: polygon(18% 0, 82% 0, 100% 18%, 100% 82%, 82% 100%, 18% 100%, 0 82%, 0 18%);
+ background: linear-gradient(145deg, rgba(255,255,255,.14), rgba(0,229,255,.035));
+ border: 1px solid rgba(198,250,255,.26);
+ box-shadow: inset 0 1px rgba(255,255,255,.22), 0 18px 46px rgba(0,0,0,.42);
+ }
+ .brand-mark svg { width: 48px; height: 48px; }
+ .brand-mark path { fill: none; stroke: url(#brandGradient); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
+ .brand-copy small { display: block; margin-bottom: 7px; font-family: "Consolas", monospace; color: var(--core); font-size: 12px; letter-spacing: .29em; text-transform: uppercase; }
+ .brand-copy h1 { margin: 0; font-size: 35px; line-height: 1; letter-spacing: -.045em; text-transform: uppercase; }
+ .system-state { text-align: right; }
+ .system-state span { display: block; font-family: "Consolas", monospace; font-size: 11px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
+ .system-state strong { display: block; margin-top: 8px; color: var(--core); font-size: 18px; letter-spacing: .08em; }
+ .state-dot { display: inline-block; width: 8px; height: 8px; margin-right: 9px; border-radius: 50%; background: var(--core-hot); box-shadow: 0 0 15px var(--core); }
+
+ #terminal {
+ position: absolute;
+ right: 66px;
+ top: 296px;
+ width: 258px;
+ height: 844px;
+ overflow: hidden;
+ padding: 22px 16px 22px 26px;
+ border-left: 1px solid rgba(198,250,255,.12);
+ background: linear-gradient(90deg, rgba(2,7,13,.36), transparent 82%);
+ -webkit-mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 90%, transparent);
+ mask-image: linear-gradient(to bottom, transparent, #000 8%, #000 90%, transparent);
+ }
+ .terminal-heading { position: absolute; left: 26px; top: 32px; z-index: 2; font-family: "Consolas", monospace; font-size: 11px; letter-spacing: .24em; color: var(--core); text-transform: uppercase; }
+ .terminal-scroll { position: absolute; left: 26px; right: 10px; top: 86px; will-change: transform; }
+ .log-line { height: 29px; font-family: "Consolas", monospace; font-size: 12px; letter-spacing: .035em; color: rgba(205,236,243,.28); white-space: nowrap; }
+ .log-line b { color: var(--core); font-weight: 400; }
+ .log-line em { color: var(--secondary); font-style: normal; }
+
+ #statusGlass {
+ position: absolute;
+ left: 122px;
+ bottom: 190px;
+ width: 836px;
+ min-height: 316px;
+ padding: 38px 42px 34px;
+ overflow: hidden;
+ border: 1px solid rgba(210,248,255,.13);
+ border-top-color: rgba(235,253,255,.27);
+ border-radius: 34px;
+ background: linear-gradient(145deg, rgba(18,31,46,.7), rgba(4,8,17,.52));
+ box-shadow: inset 0 1px rgba(255,255,255,.08), inset 0 -60px 100px rgba(0,0,0,.24), 0 32px 90px rgba(0,0,0,.48);
+ backdrop-filter: blur(22px);
+ }
+ #statusGlass::before {
+ content: "";
+ position: absolute;
+ left: -15%; top: -110px;
+ width: 70%; height: 210px;
+ background: radial-gradient(ellipse, color-mix(in srgb, var(--core) 22%, transparent), transparent 68%);
+ filter: blur(22px);
+ }
+ .status-top { position: relative; display: flex; justify-content: space-between; align-items: flex-start; }
+ .status-title small { display: block; font-family: "Consolas", monospace; font-size: 11px; letter-spacing: .25em; color: var(--muted); text-transform: uppercase; }
+ .status-title strong { display: block; margin-top: 9px; font-size: 30px; letter-spacing: -.04em; }
+ .metric { text-align: right; }
+ .metric strong { display: block; font-size: 48px; line-height: .9; letter-spacing: -.06em; color: var(--core-hot); text-shadow: 0 0 24px var(--core-glow); }
+ .metric span { display: block; margin-top: 9px; font-family: "Consolas", monospace; font-size: 10px; letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
+ .meter { position: relative; height: 8px; margin-top: 36px; overflow: hidden; border-radius: 8px; background: rgba(255,255,255,.045); box-shadow: inset 0 1px 3px rgba(0,0,0,.8); }
+ .meter-fill { width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--core-deep), var(--core), var(--secondary)); box-shadow: 0 0 20px var(--core-glow); }
+ .status-cells { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; margin-top: 27px; }
+ .status-cell { padding: 15px 16px; border: 1px solid rgba(218,250,255,.07); border-radius: 13px; background: rgba(255,255,255,.025); }
+ .status-cell span { display: block; font-family: "Consolas", monospace; font-size: 9px; letter-spacing: .17em; color: var(--muted); text-transform: uppercase; }
+ .status-cell strong { display: block; margin-top: 7px; font-family: "Consolas", monospace; font-size: 15px; color: var(--paper); }
+
+ #foregroundReticle { position: absolute; inset: 0; pointer-events: none; }
+ .corner { position: absolute; width: 72px; height: 72px; opacity: .35; border-top: 2px solid var(--core); border-left: 2px solid var(--core); filter: drop-shadow(0 0 10px var(--core-glow)); }
+ .corner.c1 { left: 72px; top: 72px; }
+ .corner.c2 { right: 72px; top: 72px; rotate: 90deg; }
+ .corner.c3 { right: 72px; bottom: 72px; rotate: 180deg; }
+ .corner.c4 { left: 72px; bottom: 72px; rotate: -90deg; }
+ #scanBeam { position: absolute; left: 80px; top: 190px; width: 920px; height: 150px; opacity: 0; background: linear-gradient(to bottom, transparent, rgba(0,229,255,.07), rgba(198,250,255,.16), transparent); mix-blend-mode: screen; }
+
+ #opticalOverlays { position: absolute; inset: 34px 28px 30px; overflow: hidden; border-radius: 54px; pointer-events: none; }
+ .scanlines {
+ position: absolute;
+ inset: 0;
+ opacity: .19;
+ background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 1080 1920' xmlns='http://www.w3.org/2000/svg'%3E%3Cg stroke='%23dffaff' stroke-opacity='.075' stroke-width='1'%3E%3Cpath d='M0 162h1080M0 347h1080M0 593h1080M0 824h1080M0 1072h1080M0 1328h1080M0 1576h1080M0 1784h1080'/%3E%3C/g%3E%3C/svg%3E");
+ background-size: 100% 100%;
+ }
+ .chroma { position: absolute; inset: 0; opacity: .085; mix-blend-mode: screen; background: radial-gradient(circle at 27% 34%, rgba(255,0,64,.18), transparent 35%), radial-gradient(circle at 74% 63%, rgba(0,229,255,.2), transparent 40%); }
+ .vignette { position: absolute; inset: 0; background: radial-gradient(ellipse at 47% 48%, transparent 38%, rgba(0,0,0,.2) 65%, rgba(0,0,0,.87) 100%); }
+
+ #systemClock { position: absolute; left: 80px; bottom: 92px; font-family: "Consolas", monospace; color: rgba(210,241,247,.36); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="8" data-track-index="0" data-width="1080" data-height="1920">
+ <div id="voidField" class="clip" data-start="0" data-duration="8" data-track-index="1">
+ <div id="orbCyan" class="depth-orb"></div>
+ <div id="orbMagenta" class="depth-orb"></div>
+ <div id="orbViolet" class="depth-orb"></div>
+ </div>
+
+ <div id="dustField" class="clip" data-start="0" data-duration="8" data-track-index="2"></div>
+
+ <div id="backgroundSatellites" class="clip" data-start="0" data-duration="8" data-track-index="3">
+ <div class="satellite back s1"><svg viewBox="0 0 48 48"><path d="M10 29c6-11 9-16 14-16s8 5 14 16"/><circle cx="24" cy="25" r="4"/></svg></div>
+ <div class="satellite back s2"><svg viewBox="0 0 48 48"><polyline points="8,29 16,18 23,27 31,12 40,25"/><line x1="9" y1="35" x2="39" y2="35"/></svg></div>
+ <div class="satellite back s3"><svg viewBox="0 0 48 48"><circle cx="24" cy="24" r="13"/><path d="M24 11v26M11 24h26"/></svg></div>
+ <div class="satellite back s4"><svg viewBox="0 0 48 48"><path d="M12 16h24v17H12zM18 10v6M30 10v6M18 33v5M30 33v5"/></svg></div>
+ </div>
+
+ <div id="midgroundSatellites" class="clip" data-start="0" data-duration="8" data-track-index="4">
+ <div class="satellite mid s5"><svg viewBox="0 0 48 48"><path d="M10 24h7l4-11 7 22 4-11h7"/></svg></div>
+ <div class="satellite mid s6"><svg viewBox="0 0 48 48"><path d="M12 13h24v22H12zM17 19h14M17 25h9M17 30h12"/></svg></div>
+ <div class="satellite mid s7"><svg viewBox="0 0 48 48"><circle cx="15" cy="24" r="5"/><circle cx="33" cy="14" r="5"/><circle cx="33" cy="34" r="5"/><path d="M19 21l10-5M19 27l10 5"/></svg></div>
+ <div class="satellite mid s8"><svg viewBox="0 0 48 48"><path d="M11 30l8-14 7 10 5-7 7 11M11 35h27"/></svg></div>
+ </div>
+
+ <svg id="networkSvg" class="clip" data-start="0" data-duration="8" data-track-index="5" viewBox="0 0 1080 1920" aria-hidden="true">
+ <defs>
+ <linearGradient id="networkGradient" x1="0" y1="0" x2="1" y2="1"><stop stop-color="var(--core)"/><stop offset="1" stop-color="var(--secondary)"/></linearGradient>
+ <filter id="lineGlow"><feGaussianBlur stdDeviation="2" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>
+ <filter id="nodeGlow"><feGaussianBlur stdDeviation="5" result="b"/><feMerge><feMergeNode in="b"/><feMergeNode in="SourceGraphic"/></feMerge></filter>
+ </defs>
+ <path class="network-path" d="M145 353 C260 430 252 572 390 638"/>
+ <path class="network-path" d="M881 456 C790 492 765 618 691 666"/>
+ <path class="network-path" d="M138 846 C232 838 278 792 356 786"/>
+ <path class="network-path" d="M920 870 C816 864 748 826 694 804"/>
+ <path class="network-path" d="M305 286 C370 371 417 402 466 452"/>
+ <path class="network-path" d="M781 1172 C702 1068 645 1028 609 987"/>
+ <path class="network-path" d="M175 1190 C250 1100 315 1054 385 1008"/>
+ <path class="network-path" d="M918 1302 C823 1208 736 1130 660 1035"/>
+ <circle class="network-node" cx="145" cy="353" r="6"/><circle class="network-node secondary" cx="881" cy="456" r="6"/>
+ <circle class="network-node" cx="138" cy="846" r="6"/><circle class="network-node secondary" cx="920" cy="870" r="6"/>
+ <circle class="network-node" cx="305" cy="286" r="6"/><circle class="network-node secondary" cx="781" cy="1172" r="6"/>
+ <circle class="network-node" cx="175" cy="1190" r="6"/><circle class="network-node secondary" cx="918" cy="1302" r="6"/>
+ </svg>
+
+ <section id="hub" class="clip" data-start="0" data-duration="8" data-track-index="6">
+ <div class="hub-motion">
+ <div class="volumetric-spill"></div>
+ <div class="hub-optics">
+ <svg class="hub-svg" viewBox="0 0 620 620" aria-hidden="true">
+ <defs><linearGradient id="coreGradient" x1="0" y1="0" x2="1" y2="1"><stop stop-color="var(--core-hot)"/><stop offset=".48" stop-color="var(--core)"/><stop offset="1" stop-color="var(--secondary)"/></linearGradient></defs>
+ <g class="orbit-rings">
+ <circle class="ring-faint" cx="310" cy="310" r="270"/><circle class="ring-dashed" cx="310" cy="310" r="244"/>
+ <circle class="ring-solid" cx="310" cy="310" r="215"/><circle class="ring-secondary" cx="310" cy="310" r="190"/>
+ <g class="ticks">
+ <path class="scope-tick" d="M310 24v22M310 574v22M24 310h22M574 310h22"/>
+ <path class="scope-tick" d="M107 107l16 16M497 497l16 16M107 513l16-16M497 123l16-16"/>
+ </g>
+ </g>
+ <circle class="core-disc" cx="310" cy="310" r="145"/>
+ <path class="core-hex" d="M310 190l104 60v120l-104 60-104-60V250z"/>
+ <path class="core-mark" d="M256 326l31-31 30 30 48-55M258 360h106"/>
+ <circle class="core-hotspot" cx="365" cy="270" r="8"/>
+ </svg>
+ </div>
+ <div class="core-label"><strong id="coreMetric">78.4%</strong><span>Neural sync</span></div>
+ </div>
+ </section>
+
+ <header id="hudHeader" class="clip" data-start="0" data-duration="8" data-track-index="7">
+ <div class="brand-lockup">
+ <div class="brand-mark"><svg viewBox="0 0 48 48"><defs><linearGradient id="brandGradient"><stop stop-color="var(--core)"/><stop offset="1" stop-color="var(--secondary)"/></linearGradient></defs><path d="M8 11l16 28 16-28M15 11l9 16 9-16"/></svg></div>
+ <div class="brand-copy"><small>Null Motion / 027</small><h1 id="systemLabel">Neural Core</h1></div>
+ </div>
+ <div class="system-state"><span>Signal integrity</span><strong><i class="state-dot"></i>ONLINE</strong></div>
+ </header>
+
+ <aside id="terminal" class="clip" data-start="0" data-duration="8" data-track-index="8">
+ <div class="terminal-heading">Live process stream</div>
+ <div class="terminal-scroll" id="terminalScroll"></div>
+ </aside>
+
+ <section id="statusGlass" class="clip" data-start="0" data-duration="8" data-track-index="9">
+ <div class="status-top">
+ <div class="status-title"><small>Distributed inference</small><strong>Spatial synthesis</strong></div>
+ <div class="metric"><strong>04.82</strong><span>ms response</span></div>
+ </div>
+ <div class="meter"><div class="meter-fill"></div></div>
+ <div class="status-cells">
+ <div class="status-cell"><span>Nodes linked</span><strong>08 / 08</strong></div>
+ <div class="status-cell"><span>Phase state</span><strong>LOCKED</strong></div>
+ <div class="status-cell"><span>Vector field</span><strong>STABLE</strong></div>
+ </div>
+ </section>
+
+ <div id="foregroundReticle" class="clip" data-start="0" data-duration="8" data-track-index="10">
+ <i class="corner c1"></i><i class="corner c2"></i><i class="corner c3"></i><i class="corner c4"></i><div id="scanBeam"></div>
+ </div>
+ <div id="opticalOverlays" class="clip" data-start="0" data-duration="8" data-track-index="11"><div class="chroma"></div><div class="scanlines"></div><div class="vignette"></div></div>
+ <div id="systemClock" class="clip" data-start="0" data-duration="8" data-track-index="12">T+ 00:08:00 // deterministic capture</div>
+ </div>
+
+ <script>
+ const params = new URLSearchParams(location.search);
+ const palettes = {
+ cyber: { core: "#00e5ff", hot: "#c6faff", deep: "#087c9c", secondary: "#ff2bd6", secondaryHot: "#ffc4f3", glow: "rgba(0,229,255,.68)", secondaryGlow: "rgba(255,43,214,.48)" },
+ emerald: { core: "#38ff87", hot: "#e2ffeb", deep: "#0b9448", secondary: "#66e8ff", secondaryHot: "#ddfbff", glow: "rgba(56,255,135,.68)", secondaryGlow: "rgba(102,232,255,.46)" },
+ ultraviolet: { core: "#a978ff", hot: "#eee4ff", deep: "#6032ba", secondary: "#ff4ecd", secondaryHot: "#ffd6f3", glow: "rgba(169,120,255,.68)", secondaryGlow: "rgba(255,78,205,.46)" },
+ solar: { core: "#ffbd38", hot: "#fff1c9", deep: "#bd6d0b", secondary: "#ff4d6d", secondaryHot: "#ffd6de", glow: "rgba(255,189,56,.66)", secondaryGlow: "rgba(255,77,109,.46)" },
+ ice: { core: "#b8f7ff", hot: "#ffffff", deep: "#4e9aac", secondary: "#6c7cff", secondaryHot: "#d8dcff", glow: "rgba(184,247,255,.64)", secondaryGlow: "rgba(108,124,255,.46)" }
+ };
+ const palette = palettes[params.get("palette")] || palettes.cyber;
+ const rootStyle = document.documentElement.style;
+ rootStyle.setProperty("--core", palette.core);
+ rootStyle.setProperty("--core-hot", palette.hot);
+ rootStyle.setProperty("--core-deep", palette.deep);
+ rootStyle.setProperty("--secondary", palette.secondary);
+ rootStyle.setProperty("--secondary-hot", palette.secondaryHot);
+ rootStyle.setProperty("--core-glow", palette.glow);
+ rootStyle.setProperty("--secondary-glow", palette.secondaryGlow);
+ const cleanCopy = (value, fallback, max) => String(value || fallback).replace(/[<>]/g, "").trim().slice(0, max) || fallback;
+ document.getElementById("systemLabel").textContent = cleanCopy(params.get("label"), "Neural Core", 22);
+
+ const dustData = [
+ [7,16,3,.24],[13,42,2,.16],[18,72,4,.27],[22,28,2,.32],[27,88,3,.17],[31,54,2,.23],[35,12,4,.2],[39,67,3,.31],
+ [44,34,2,.18],[48,82,4,.22],[52,20,2,.3],[55,59,3,.2],[59,92,2,.26],[63,43,4,.19],[67,14,2,.28],[71,76,3,.25],
+ [75,31,2,.16],[79,62,4,.23],[83,9,3,.2],[87,84,2,.3],[91,48,3,.18],[9,91,2,.24],[16,58,3,.19],[25,6,2,.29],
+ [33,78,2,.16],[42,49,3,.24],[57,5,2,.2],[69,95,3,.19],[77,52,2,.28],[94,24,4,.18]
+ ];
+ const dustField = document.getElementById("dustField");
+ dustData.forEach(([x,y,size,opacity], index) => {
+ const mote = document.createElement("i");
+ mote.className = "dust";
+ mote.style.left = `${x}%`;
+ mote.style.top = `${y}%`;
+ mote.style.width = `${size}px`;
+ mote.style.height = `${size}px`;
+ mote.style.opacity = opacity;
+ mote.dataset.index = index;
+ dustField.appendChild(mote);
+ });
+
+ const logStates = ["SYNC", "TRACE", "VECTOR", "PHASE", "CACHE", "SIGNAL", "ROUTE", "KERNEL", "OPTIC", "NODE"];
+ const terminal = document.getElementById("terminalScroll");
+ for (let index = 0; index < 54; index += 1) {
+ const line = document.createElement("div");
+ line.className = "log-line";
+ const code = String(1007 + index * 17).padStart(4, "0");
+ const state = logStates[index % logStates.length];
+ line.innerHTML = `<b>${code}</b> / ${state} <em>${String((index * 13 + 41) % 97).padStart(2, "0")}</em> :: OK`;
+ terminal.appendChild(line);
+ }
+
+ const dust = Array.from(document.querySelectorAll(".dust"));
+ const paths = Array.from(document.querySelectorAll(".network-path"));
+ const nodes = Array.from(document.querySelectorAll(".network-node"));
+ const tl = gsap.timeline({ paused: true });
+
+ tl.from("#voidField", { opacity: 0, scale: 1.025, duration: 1.05, ease: "power3.out" }, 0);
+ tl.from("#hudHeader", { opacity: 0, y: -32, duration: .72, ease: "expo.out" }, .16);
+ tl.from(".brand-mark", { opacity: 0, scale: .35, rotation: -12, duration: .68, ease: "back.out(1.65)" }, .25);
+ tl.from(".brand-copy > *", { opacity: 0, y: 18, duration: .5, stagger: .09, ease: "power4.out" }, .38);
+ tl.from(".system-state", { opacity: 0, x: 24, duration: .56, ease: "power3.out" }, .52);
+
+ tl.to("#orbCyan", { x: 42, y: -28, scale: 1.09, duration: 7.4, ease: "sine.inOut" }, .18);
+ tl.to("#orbMagenta", { x: -34, y: 38, scale: 1.08, duration: 7.35, ease: "sine.inOut" }, .2);
+ tl.to("#orbViolet", { x: 18, y: -25, duration: 7.2, ease: "power2.inOut" }, .25);
+ tl.from("#backgroundSatellites", { opacity: 0, scale: .9, duration: 1.1, ease: "power3.out" }, .12);
+ tl.to("#backgroundSatellites", { x: 10, y: -13, duration: 7.15, ease: "sine.inOut" }, .42);
+ tl.from("#midgroundSatellites", { opacity: 0, scale: .82, duration: .95, ease: "power3.out" }, .38);
+ tl.to("#midgroundSatellites", { x: -18, y: 20, duration: 6.75, ease: "sine.inOut" }, .82);
+
+ tl.from(dust, { opacity: 0, duration: .7, stagger: .022, ease: "power2.out" }, .24);
+ tl.to(dust, { y: index => -74 - (index % 6) * 18, x: index => ((index % 5) - 2) * 7, duration: 7.05, ease: "sine.inOut" }, .32);
+ tl.to(dust, { opacity: 0, duration: .48, stagger: .006, ease: "power2.in" }, 7.24);
+
+ tl.fromTo(paths, { strokeDashoffset: 170, opacity: 0 }, { strokeDashoffset: 0, opacity: .42, duration: 1.25, stagger: .08, ease: "power3.inOut" }, .52);
+ tl.from(nodes, { opacity: 0, scale: 0, transformOrigin: "50% 50%", duration: .42, stagger: .11, ease: "back.out(2)" }, 1.08);
+
+ /* Mechanical lens pull. Atmospheric exposure catches up exactly 0.12s later. */
+ tl.fromTo(".hub-motion", { opacity: .24, scale: .6, filter: "blur(6px)" }, { opacity: 1, scale: 1.15, filter: "blur(0px)", duration: .78, ease: "expo.out" }, .88);
+ tl.to(".hub-motion", { scale: 1, duration: .34, ease: "power3.inOut" }, 1.67);
+ tl.fromTo(".volumetric-spill", { opacity: 0, scale: .52 }, { opacity: .18, scale: 1.12, duration: .62, ease: "power3.out" }, 1.0);
+ tl.to(".volumetric-spill", { opacity: .11, scale: 1, duration: .52, ease: "sine.inOut" }, 1.62);
+ tl.from(".core-label", { opacity: 0, scale: .7, duration: .54, ease: "back.out(1.5)" }, 1.52);
+ tl.to(".orbit-rings", { rotation: 356, transformOrigin: "50% 50%", duration: 6.12, ease: "power1.inOut" }, 1.26);
+ tl.to(".hub-motion", { x: 8, y: -12, rotationY: 1.5, duration: 5.35, ease: "sine.inOut" }, 2.05);
+
+ tl.from("#terminal", { opacity: 0, x: 38, duration: .72, ease: "power4.out" }, 1.34);
+ tl.from(".terminal-heading", { opacity: 0, x: 18, duration: .58, ease: "power3.out" }, 1.62);
+ tl.fromTo("#terminalScroll", { y: 0 }, { y: -612, duration: 5.92, ease: "power1.inOut" }, 1.76);
+ tl.from(".log-line", { opacity: 0, x: 10, duration: .22, stagger: .018, ease: "power2.out" }, 1.7);
+
+ tl.from("#statusGlass", { opacity: 0, y: 58, scale: .96, duration: .82, ease: "expo.out" }, 2.0);
+ tl.from(".status-title > *, .metric > *", { opacity: 0, y: 16, duration: .46, stagger: .07, ease: "power3.out" }, 2.32);
+ tl.to(".meter-fill", { width: "78.4%", duration: 1.18, ease: "power4.out" }, 2.56);
+ tl.from(".status-cell", { opacity: 0, y: 18, scale: .95, duration: .48, stagger: .08, ease: "back.out(1.4)" }, 2.72);
+
+ tl.from(".corner", { opacity: 0, scale: .65, duration: .64, stagger: .06, ease: "power3.out" }, .32);
+ tl.fromTo("#scanBeam", { opacity: 0, y: -180 }, { opacity: .72, y: 1470, duration: 5.52, ease: "power2.inOut" }, 1.74);
+ tl.to("#scanBeam", { opacity: 0, duration: .42, ease: "power2.in" }, 7.26);
+ tl.from("#opticalOverlays", { opacity: 0, duration: 1.1, ease: "power2.out" }, .16);
+ tl.from("#systemClock", { opacity: 0, x: -18, duration: .55, ease: "power3.out" }, 2.24);
+ tl.to(".state-dot", { scale: 1.42, opacity: .68, duration: .28, repeat: 1, yoyo: true, ease: "sine.inOut" }, 6.82);
+ tl.to("#coreMetric", { textShadow: `0 0 42px ${palette.glow}`, scale: 1.035, duration: .3, repeat: 1, yoyo: true, ease: "sine.inOut" }, 6.96);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines["root"] = tl;
+ if (location.hash === "#play") tl.play();
+ </script>
+</body>
+</html>
diff --git a/public/27-icon-stack-rise/assets/adobe.svg b/public/27-icon-stack-rise/assets/adobe.svg
new file mode 100644
index 0000000..5d7b24d
--- /dev/null
+++ b/public/27-icon-stack-rise/assets/adobe.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64.57 35"><path fill="#eb1000" d="M6.27 10.22h4.39l6.2 14.94h-4.64L8.3 15.24l-2.59 6.51h3.08l1.23 3.41H0l6.27-14.94Zm15.76 3.1c.45 0 .94.04 1.43.16v-3.7h3.88V24.5c-.89.4-2.81.89-4.73.89-3.48 0-6.47-1.98-6.47-5.93s2.88-6.13 5.89-6.13Zm.49 8.87c.36 0 .65-.07.94-.16v-5.42c-.29-.11-.58-.16-.96-.16-1.27 0-2.45.94-2.45 2.92s1.2 2.81 2.47 2.81Zm11.73-8.87c3.23 0 5.98 2.18 5.98 6.02s-2.74 6.02-5.98 6.02-6-2.18-6-6.02 2.72-6.02 6-6.02Zm0 8.81c1.11 0 2.14-.89 2.14-2.79s-1.03-2.79-2.14-2.79-2.12.89-2.12 2.79.96 2.79 2.12 2.79Zm6.91-12.35h3.9v3.7c.47-.09.96-.16 1.45-.16 3.03 0 5.84 1.98 5.84 5.86 0 4.1-2.99 6.18-6.53 6.18-1.52 0-3.46-.31-4.66-.87V9.78Zm4.75 12.39c1.34 0 2.56-.96 2.56-2.94 0-1.85-1.2-2.72-2.5-2.72-.36 0-.65.04-.91.16v5.35c.22.09.51.16.85.16Zm13.06-8.85c2.92 0 5.6 1.87 5.6 5.64 0 .51-.02 1-.09 1.49h-7.27c.4 1.32 1.56 1.94 3.01 1.94 1.18 0 2.27-.29 3.5-.82v2.97c-1.14.58-2.5.82-3.9.82-3.7 0-6.58-2.23-6.58-6.02s2.61-6.02 5.73-6.02Zm1.96 4.7c-.2-1.27-1.05-1.78-1.92-1.78s-1.58.54-1.87 1.78h3.79Z"/></svg>
diff --git a/public/27-icon-stack-rise/assets/after-effects.svg b/public/27-icon-stack-rise/assets/after-effects.svg
new file mode 100644
index 0000000..95945c2
--- /dev/null
+++ b/public/27-icon-stack-rise/assets/after-effects.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><path d="M34.468 0H7.532A7.532 7.532 0 0 0 0 7.532v26.936A7.532 7.532 0 0 0 7.532 42h26.936A7.532 7.532 0 0 0 42 34.468V7.532A7.532 7.532 0 0 0 34.468 0Z" fill="#00005B"/><path d="M10.734 11.149h6.184l6.935 19.36H18.19l-.954-2.947H9.983l-.954 2.947H3.597l7.137-19.36Zm5 11.818-2.11-6.501-2.11 6.501h4.22Zm22.669-.433c0 .693-.058 1.445-.144 2.023H28.81c.578 1.444 1.965 2.138 4.132 2.138 1.56 0 2.918-.289 4.277-.925l.057 4.017c-1.473.751-3.063 1.011-5.114 1.011-5.057 0-8.438-2.803-8.438-7.889 0-4.652 3.236-7.744 7.513-7.744 4.392 0 7.166 2.832 7.166 7.369Zm-9.767-1.272h5.057c-.115-1.358-.953-2.311-2.427-2.311-1.416 0-2.312.751-2.63 2.311Z" fill="#9999FF"/></svg>
diff --git a/public/27-icon-stack-rise/assets/photoshop.svg b/public/27-icon-stack-rise/assets/photoshop.svg
new file mode 100644
index 0000000..61bf9fc
--- /dev/null
+++ b/public/27-icon-stack-rise/assets/photoshop.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42"><path d="M34.468 0H7.532A7.532 7.532 0 0 0 0 7.532v26.936A7.532 7.532 0 0 0 7.532 42h26.936A7.532 7.532 0 0 0 42 34.468V7.532A7.532 7.532 0 0 0 34.468 0Z" fill="#001E36"/><path d="M14.666 11.149c5.491 0 8.582 2.571 8.582 6.877 0 5.028-4.19 7.05-8.12 7.05H12.47v5.433H7.095v-19.36h7.571Zm-2.196 4.594v4.739h2.37c1.646 0 2.802-.665 2.802-2.34 0-1.532-.982-2.399-2.687-2.399H12.47Zm11.871 13.813.029-4.479c1.531 1.011 3.67 1.647 5.143 1.647 1.012 0 1.474-.289 1.474-.809 0-.578-.636-.809-1.849-1.185-2.341-.693-4.913-1.647-4.913-4.71 0-3.121 2.572-4.855 6.3-4.855 1.762 0 3.207.26 4.479.809l-.029 4.277c-1.012-.607-3.005-1.156-4.306-1.156-.953 0-1.329.289-1.329.722 0 .521.462.665 1.849 1.099 2.688.809 4.942 1.676 4.942 4.825 0 3.005-2.457 5.028-6.3 5.028-2.023 0-3.93-.347-5.49-1.213Z" fill="#31A8FF"/></svg>
diff --git a/public/27-icon-stack-rise/assets/premiere-pro.svg b/public/27-icon-stack-rise/assets/premiere-pro.svg
new file mode 100644
index 0000000..57a5684
--- /dev/null
+++ b/public/27-icon-stack-rise/assets/premiere-pro.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240"><path d="M196.959 0H43.041C19.27 0 0 19.27 0 43.041V196.96C0 220.73 19.27 240 43.041 240H196.96C220.73 240 240 220.73 240 196.959V43.04C240 19.27 220.73 0 196.959 0Z" fill="#00005B"/><path d="M92.552 63.706c31.373 0 49.042 14.696 49.042 39.3 0 28.731-23.944 40.29-46.401 40.29H80.002v31.043H49.289V63.706h43.263ZM80.002 89.96v27.081h13.541c9.412 0 16.016-3.798 16.016-13.375 0-8.752-5.614-13.706-15.356-13.706H80.002Zm104.409-3.302c6.77 0 12.219.826 14.696 1.651v22.457c-1.982-.495-5.78-.826-8.917-.826-6.109 0-9.577.496-12.715 1.652v62.747h-28.896V93.924c10.402-4.624 20.806-7.266 35.832-7.266Z" fill="#9999FF"/></svg>
diff --git a/public/27-icon-stack-rise/index.html b/public/27-icon-stack-rise/index.html
new file mode 100644
index 0000000..62461af
--- /dev/null
+++ b/public/27-icon-stack-rise/index.html
@@ -0,0 +1,138 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<meta name="hyperframes" content="duration:5,fps:30,width:1080,height:1920,transparent:true" />
+<title>Icon Stack Rise</title>
+<script src="../_vendor/gsap.min.js"></script>
+<style>
+ html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; background: transparent; }
+ #root {
+ --audio-energy: 0; position: relative; width: 1080px; height: 1920px; overflow: hidden;
+ background: transparent; perspective: 1800px; font-family: Inter, system-ui, sans-serif;
+ }
+ #stack {
+ position: absolute; left: 50%; top: 50%; width: 760px; height: 560px;
+ margin: -280px 0 0 -380px; transform-style: preserve-3d; will-change: transform;
+ }
+ .icon-card {
+ position: absolute; left: 50%; top: 50%; width: 240px; height: 240px;
+ margin: -120px 0 0 -120px; border-radius: 54px; transform-style: preserve-3d;
+ will-change: transform, opacity;
+ }
+ .icon-card img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 54px; }
+ .master { z-index: 4; }
+ .master-face {
+ position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden;
+ border-radius: 54px; backface-visibility: hidden; -webkit-backface-visibility: hidden;
+ }
+ .master-front {
+ background: linear-gradient(145deg, #fff 0%, #f2f2f5 62%, #dcdce3 100%);
+ border: 1px solid rgba(255,255,255,.92);
+ }
+ .master-front::after {
+ content: ""; position: absolute; inset: 1px; border-radius: 53px;
+ background: linear-gradient(132deg, rgba(255,255,255,.72), transparent 38%); pointer-events: none;
+ }
+ .master-front img { width: 166px; height: 94px; border-radius: 0; }
+ .master-back { transform: none; }
+ .rear { z-index: 2; }
+ #after-card { z-index: 1; }
+ #photoshop-card { z-index: 2; }
+ #contact-shadow {
+ position: absolute; left: 50%; top: calc(50% + 166px); width: 590px; height: 64px;
+ margin-left: -295px; border-radius: 50%; opacity: 0;
+ background: rgba(0,0,0,.44); filter: blur(27px); transform-origin: 50% 50%;
+ }
+ #guide-line {
+ position: absolute; left: 50%; top: calc(50% + 2px); width: 760px; height: 3px;
+ margin-left: -380px; opacity: 0; border-radius: 999px; transform-origin: 50% 50%;
+ background: linear-gradient(90deg, transparent, rgba(49,168,255,.24) 18%, rgba(255,255,255,.82) 50%, rgba(153,153,255,.24) 82%, transparent);
+ }
+ #depth-glint {
+ position: absolute; left: 50%; top: 50%; width: 310px; height: 310px;
+ margin: -155px 0 0 -155px; border-radius: 50%; opacity: 0; pointer-events: none;
+ background: radial-gradient(circle, rgba(255,255,255,.12), rgba(78,112,255,.055) 38%, transparent 72%);
+ filter: blur(7px); transform-origin: 50% 50%;
+ }
+</style>
+</head>
+<body>
+ <div id="root" data-composition-id="root" data-start="0" data-duration="5" data-track-index="0" data-width="1080" data-height="1920">
+ <div id="guide-line" aria-hidden="true"></div>
+ <div id="depth-glint" aria-hidden="true"></div>
+ <div id="contact-shadow" aria-hidden="true"></div>
+ <div id="stack" data-layout-allow-overflow="true">
+ <div class="icon-card master" id="master-card" data-layout-allow-overflow="true">
+ <div class="master-face master-front" id="master-front"><img data-null-asset-slot="brand" src="./assets/adobe.svg" alt="Adobe" /></div>
+ <div class="master-face master-back" id="master-back"><img data-null-asset-slot="brand" src="./assets/premiere-pro.svg" alt="Adobe Premiere Pro" /></div>
+ </div>
+ <div class="icon-card rear" id="after-card" data-layout-allow-overflow="true"><img data-null-asset-slot="brand" src="./assets/after-effects.svg" alt="Adobe After Effects" /></div>
+ <div class="icon-card rear" id="photoshop-card" data-layout-allow-overflow="true"><img data-null-asset-slot="brand" src="./assets/photoshop.svg" alt="Adobe Photoshop" /></div>
+ </div>
+ </div>
+ <script>
+ const controls = window.__nullMotionTemplateControls || { finalLayout: "fan" };
+ const tl = gsap.timeline({ paused: true, defaults: { ease: "power4.out" } });
+ const stack = document.getElementById("stack");
+ const master = document.getElementById("master-card");
+ const masterFront = document.getElementById("master-front");
+ const masterBack = document.getElementById("master-back");
+ const after = document.getElementById("after-card");
+ const photoshop = document.getElementById("photoshop-card");
+ const shadow = document.getElementById("contact-shadow");
+ const line = document.getElementById("guide-line");
+ const glint = document.getElementById("depth-glint");
+ const cascade = controls.finalLayout === "cascade";
+ const finalPhotoshop = cascade ? { x: -220, y: 96, rotationZ: -3 } : { x: -274, y: 12, rotationZ: -2 };
+ const finalAfter = cascade ? { x: 220, y: -96, rotationZ: 3 } : { x: 274, y: 12, rotationZ: 2 };
+
+ gsap.set(stack, { y: 1120, rotationX: 7, transformPerspective: 1800 });
+ gsap.set(master, { x: 0, y: 0, z: 30, scale: 1, rotationY: 0, rotationZ: -2 });
+ gsap.set(masterFront, { opacity: 1 });
+ gsap.set(masterBack, { opacity: 0 });
+ gsap.set(photoshop, { x: 0, y: 38, z: -30, scale: .94, rotationY: -5, rotationZ: -4 });
+ gsap.set(after, { x: 0, y: 76, z: -70, scale: .88, rotationY: 6, rotationZ: 4 });
+ gsap.set([master, photoshop, after], { opacity: 0 });
+ gsap.set(line, { opacity: 0, scaleX: .06 });
+ gsap.set(shadow, { opacity: 0, scaleX: .36, scaleY: .66 });
+ gsap.set(glint, { opacity: 0, scale: .72 });
+ tl.to([master, photoshop, after], { opacity: 1, duration: .08, stagger: .035, ease: "power2.out" }, .14)
+ .to(stack, { y: -28, rotationX: -1.5, duration: 1.02, ease: "power4.out" }, .14)
+ .to(stack, { y: 0, rotationX: 0, duration: .239, ease: "back.out(1.28)" }, 1.161)
+ .to(shadow, { opacity: .34, scaleX: .58, scaleY: 1, duration: .96 }, .2)
+ .to(master, { y: 18, scaleX: 1.035, scaleY: .975, duration: .13, ease: "power2.out" }, 1.4)
+ .to(line, { opacity: .78, scaleX: 1, duration: .34 }, 1.48)
+ .to(glint, { opacity: .58, scale: 1.08, duration: .42 }, 1.48)
+ .to(master, { y: -12, scaleX: 1, scaleY: 1, rotationY: 88, rotationZ: 0, duration: .339, ease: "power3.in" }, 1.55)
+ .set(masterFront, { opacity: 0 }, 1.89)
+ .set(masterBack, { opacity: 1 }, 1.89)
+ .set(master, { rotationY: -88 }, 1.89)
+ .to(master, { rotationY: 0, duration: .359, ease: "power3.out" }, 1.891)
+ .to(photoshop, { ...finalPhotoshop, z: 0, scale: 1.075, rotationY: 0, duration: .72, ease: "back.out(1.38)" }, 1.74)
+ .to(after, { ...finalAfter, z: 0, scale: 1.075, rotationY: 0, duration: .72, ease: "back.out(1.38)" }, 1.84)
+ .to(master, { y: 0, scale: 1.075, duration: .309, ease: "back.out(1.24)" }, 2.251)
+ .to([master, photoshop, after], { scale: 1, duration: .26, stagger: .035, ease: "power2.out" }, 2.53)
+ .to(line, { opacity: .16, scaleX: .9, duration: .32, ease: "power2.out" }, 2.48)
+ .to(glint, { opacity: .12, scale: 1.18, duration: .42, ease: "power2.out" }, 2.43)
+ .to(shadow, { opacity: .28, scaleX: 1, duration: .5, ease: "power3.out" }, 2.18)
+ .to([photoshop, master, after], { y: index => [finalPhotoshop.y - 7, -7, finalAfter.y - 7][index], duration: .38, stagger: .045, ease: "sine.inOut" }, 3.35)
+ .to([photoshop, master, after], { y: index => [finalPhotoshop.y, 0, finalAfter.y][index], duration: .38, stagger: .045, ease: "sine.inOut" }, 3.73)
+ .to(line, { opacity: 0, scaleX: .68, duration: .3, ease: "power2.in" }, 4.02)
+ .to(glint, { opacity: 0, scale: .88, duration: .28, ease: "power2.in" }, 4.02)
+ .to([after, master, photoshop], { y: -980, opacity: 0, rotationX: -9, scale: .9, duration: .62, stagger: .05, ease: "power3.in" }, 4.08)
+ .to(shadow, { opacity: 0, scaleX: .46, duration: .52, ease: "power3.in" }, 4.1);
+
+ window.__timelines = window.__timelines || {};
+ window.__timelines.root = tl;
+ window.startRender = function startRender() { return window.__timelines.root; };
+ window.reactToAudio = function reactToAudio(amplitude, frequency) {
+ const a = Math.max(0, Math.min(1, Number(amplitude) || 0));
+ const f = Math.max(0, Math.min(1, Number(frequency) || 0));
+ document.documentElement.style.setProperty("--audio-energy", ((a + f) * .5).toFixed(4));
+ };
+ if (location.hash === "#play") tl.play();
+ </script>
+</body>
+</html>
diff --git a/public/_vendor/gsap.min.js b/public/_vendor/gsap.min.js
new file mode 100644
index 0000000..fde57af
--- /dev/null
+++ b/public/_vendor/gsap.min.js
@@ -0,0 +1,11 @@
+/*!
+ * GSAP 3.14.2
+ * https://gsap.com
+ *
+ * @license Copyright 2025, GreenSock. All rights reserved.
+ * Subject to the terms at https://gsap.com/standard-license.
+ * @author: Jack Doyle, [email protected]
+ */
+
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).window=t.window||{})}(this,function(e){"use strict";function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),(t.prototype.constructor=t).__proto__=e}function _assertThisInitialized(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function r(t){return"string"==typeof t}function s(t){return"function"==typeof t}function t(t){return"number"==typeof t}function u(t){return void 0===t}function v(t){return"object"==typeof t}function w(t){return!1!==t}function x(){return"undefined"!=typeof window}function y(t){return s(t)||r(t)}function R(t){return(i=bt(t,ht))&&Fe}function S(t,e){return console.warn("Invalid property",t,"set to",e,"Missing plugin? gsap.registerPlugin()")}function T(t,e){return!e&&console.warn(t)}function U(t,e){return t&&(ht[t]=e)&&i&&(i[t]=e)||ht}function V(){return 0}function ga(t){var e,r,i=t[0];if(v(i)||s(i)||(t=[t]),!(e=(i._gsap||{}).harness)){for(r=yt.length;r--&&!yt[r].targetTest(i););e=yt[r]}for(r=t.length;r--;)t[r]&&(t[r]._gsap||(t[r]._gsap=new Xt(t[r],e)))||t.splice(r,1);return t}function ha(t){return t._gsap||ga(Pt(t))[0]._gsap}function ia(t,e,r){return(r=t[e])&&s(r)?t[e]():u(r)&&t.getAttribute&&t.getAttribute(e)||r}function ja(t,e){return(t=t.split(",")).forEach(e)||t}function ka(t){return Math.round(1e5*t)/1e5||0}function la(t){return Math.round(1e7*t)/1e7||0}function ma(t,e){var r=e.charAt(0),i=parseFloat(e.substr(2));return t=parseFloat(t),"+"===r?t+i:"-"===r?t-i:"*"===r?t*i:t/i}function na(t,e){for(var r=e.length,i=0;t.indexOf(e[i])<0&&++i<r;);return i<r}function oa(){var t,e,r=pt.length,i=pt.slice(0);for(_t={},t=pt.length=0;t<r;t++)(e=i[t])&&e._lazy&&(e.render(e._lazy[0],e._lazy[1],!0)._lazy=0)}function pa(t){return!!(t._initted||t._startAt||t.add)}function qa(t,e,r,i){pt.length&&!I&&oa(),t.render(e,r,i||!!(I&&e<0&&pa(t))),pt.length&&!I&&oa()}function ra(t){var e=parseFloat(t);return(e||0===e)&&(t+"").match(ot).length<2?e:r(t)?t.trim():t}function sa(t){return t}function ta(t,e){for(var r in e)r in t||(t[r]=e[r]);return t}function wa(t,e){for(var r in e)"__proto__"!==r&&"constructor"!==r&&"prototype"!==r&&(t[r]=v(e[r])?wa(t[r]||(t[r]={}),e[r]):e[r]);return t}function xa(t,e){var r,i={};for(r in t)r in e||(i[r]=t[r]);return i}function ya(t){var e=t.parent||L,r=t.keyframes?function _setKeyframeDefaults(i){return function(t,e){for(var r in e)r in t||"duration"===r&&i||"ease"===r||(t[r]=e[r])}}($(t.keyframes)):ta;if(w(t.inherit))for(;e;)r(t,e.vars.defaults),e=e.parent||e._dp;return t}function Aa(t,e,r,i,n){void 0===r&&(r="_first"),void 0===i&&(i="_last");var a,s=t[i];if(n)for(a=e[n];s&&s[n]>a;)s=s._prev;return s?(e._next=s._next,s._next=e):(e._next=t[r],t[r]=e),e._next?e._next._prev=e:t[i]=e,e._prev=s,e.parent=e._dp=t,e}function Ba(t,e,r,i){void 0===r&&(r="_first"),void 0===i&&(i="_last");var n=e._prev,a=e._next;n?n._next=a:t[r]===e&&(t[r]=a),a?a._prev=n:t[i]===e&&(t[i]=n),e._next=e._prev=e.parent=null}function Ca(t,e){t.parent&&(!e||t.parent.autoRemoveChildren)&&t.parent.remove&&t.parent.remove(t),t._act=0}function Da(t,e){if(t&&(!e||e._end>t._dur||e._start<0))for(var r=t;r;)r._dirty=1,r=r.parent;return t}function Fa(t,e,r,i){return t._startAt&&(I?t._startAt.revert(ft):t.vars.immediateRender&&!t.vars.autoRevert||t._startAt.render(e,!0,i))}function Ha(t){return t._repeat?wt(t._tTime,t=t.duration()+t._rDelay)*t:0}function Ja(t,e){return(t-e._start)*e._ts+(0<=e._ts?0:e._dirty?e.totalDuration():e._tDur)}function Ka(t){return t._end=la(t._start+(t._tDur/Math.abs(t._ts||t._rts||q)||0))}function La(t,e){var r=t._dp;return r&&r.smoothChildTiming&&t._ts&&(t._start=la(r._time-(0<t._ts?e/t._ts:((t._dirty?t.totalDuration():t._tDur)-e)/-t._ts)),Ka(t),r._dirty||Da(r,t)),t}function Ma(t,e){var r;if((e._time||!e._dur&&e._initted||e._start<t._time&&(e._dur||!e.add))&&(r=Ja(t.rawTime(),e),(!e._dur||Mt(0,e.totalDuration(),r)-e._tTime>q)&&e.render(r,!0)),Da(t,e)._dp&&t._initted&&t._time>=t._dur&&t._ts){if(t._dur<t.duration())for(r=t;r._dp;)0<=r.rawTime()&&r.totalTime(r._tTime),r=r._dp;t._zTime=-q}}function Na(e,r,i,n){return r.parent&&Ca(r),r._start=la((t(i)?i:i||e!==L?Ot(e,i,r):e._time)+r._delay),r._end=la(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),Aa(e,r,"_first","_last",e._sort?"_start":0),xt(r)||(e._recent=r),n||Ma(e,r),e._ts<0&&La(e,e._tTime),e}function Oa(t,e){return(ht.ScrollTrigger||S("scrollTrigger",e))&&ht.ScrollTrigger.create(e,t)}function Pa(t,e,r,i,n){return Qt(t,e,n),t._initted?!r&&t._pt&&!I&&(t._dur&&!1!==t.vars.lazy||!t._dur&&t.vars.lazy)&&f!==It.frame?(pt.push(t),t._lazy=[n,i],1):void 0:1}function Ua(t,e,r,i){var n=t._repeat,a=la(e)||0,s=t._tTime/t._tDur;return s&&!i&&(t._time*=a/t._dur),t._dur=a,t._tDur=n?n<0?1e10:la(a*(n+1)+t._rDelay*n):a,0<s&&!i&&La(t,t._tTime=t._tDur*s),t.parent&&Ka(t),r||Da(t.parent,t),t}function Va(t){return t instanceof Zt?Da(t):Ua(t,t._dur)}function Ya(e,r,i){var n,a,s=t(r[1]),o=(s?2:1)+(e<2?0:1),u=r[o];if(s&&(u.duration=r[1]),u.parent=i,e){for(n=u,a=i;a&&!("immediateRender"in n);)n=a.vars.defaults||{},a=w(a.vars.inherit)&&a.parent;u.immediateRender=w(n.immediateRender),e<2?u.runBackwards=1:u.startAt=r[o-1]}return new te(r[0],u,r[1+o])}function Za(t,e){return t||0===t?e(t):e}function _a(t,e){return r(t)&&(e=ut.exec(t))?e[1]:""}function cb(t,e){return t&&v(t)&&"length"in t&&(!e&&!t.length||t.length-1 in t&&v(t[0]))&&!t.nodeType&&t!==h}function fb(r){return r=Pt(r)[0]||T("Invalid scope")||{},function(t){var e=r.current||r.nativeElement||r;return Pt(t,e.querySelectorAll?e:e===r?T("Invalid scope")||a.createElement("div"):r)}}function gb(t){return t.sort(function(){return.5-Math.random()})}function hb(t){if(s(t))return t;var p=v(t)?t:{each:t},_=Vt(p.ease),m=p.from||0,g=parseFloat(p.base)||0,y={},e=0<m&&m<1,T=isNaN(m)||e,b=p.axis,w=m,x=m;return r(m)?w=x={center:.5,edges:.5,end:1}[m]||0:!e&&T&&(w=m[0],x=m[1]),function(t,e,r){var i,n,a,s,o,u,h,l,f,d=(r||p).length,c=y[d];if(!c){if(!(f="auto"===p.grid?0:(p.grid||[1,X])[1])){for(h=-X;h<(h=r[f++].getBoundingClientRect().left)&&f<d;);f<d&&f--}for(c=y[d]=[],i=T?Math.min(f,d)*w-.5:m%f,n=f===X?0:T?d*x/f-.5:m/f|0,l=X,u=h=0;u<d;u++)a=u%f-i,s=n-(u/f|0),c[u]=o=b?Math.abs("y"===b?s:a):J(a*a+s*s),h<o&&(h=o),o<l&&(l=o);"random"===m&&gb(c),c.max=h-l,c.min=l,c.v=d=(parseFloat(p.amount)||parseFloat(p.each)*(d<f?d-1:b?"y"===b?d/f:f:Math.max(f,d/f))||0)*("edges"===m?-1:1),c.b=d<0?g-d:g,c.u=_a(p.amount||p.each)||0,_=_&&d<0?jt(_):_}return d=(c[t]-c.min)/c.max||0,la(c.b+(_?_(d):d)*c.v)+c.u}}function ib(i){var n=Math.pow(10,((i+"").split(".")[1]||"").length);return function(e){var r=la(Math.round(parseFloat(e)/i)*i*n);return(r-r%1)/n+(t(e)?0:_a(e))}}function jb(h,e){var l,f,r=$(h);return!r&&v(h)&&(l=r=h.radius||X,h.values?(h=Pt(h.values),(f=!t(h[0]))&&(l*=l)):h=ib(h.increment)),Za(e,r?s(h)?function(t){return f=h(t),Math.abs(f-t)<=l?f:t}:function(e){for(var r,i,n=parseFloat(f?e.x:e),a=parseFloat(f?e.y:0),s=X,o=0,u=h.length;u--;)(r=f?(r=h[u].x-n)*r+(i=h[u].y-a)*i:Math.abs(h[u]-n))<s&&(s=r,o=u);return o=!l||s<=l?h[o]:e,f||o===e||t(e)?o:o+_a(e)}:ib(h))}function kb(t,e,r,i){return Za($(t)?!e:!0===r?!!(r=0):!i,function(){return $(t)?t[~~(Math.random()*t.length)]:(r=r||1e-5)&&(i=r<1?Math.pow(10,(r+"").length-2):1)&&Math.floor(Math.round((t-r/2+Math.random()*(e-t+.99*r))/r)*r*i)/i})}function ob(e,r,t){return Za(t,function(t){return e[~~r(t)]})}function rb(t){return t.replace(tt,function(t){var e=t.indexOf("[")+1,r=t.substring(e||7,e?t.indexOf("]"):t.length-1).split(et);return kb(e?r:+r[0],e?0:+r[1],+r[2]||1e-5)})}function ub(t,e,r){var i,n,a,s=t.labels,o=X;for(i in s)(n=s[i]-e)<0==!!r&&n&&o>(n=Math.abs(n))&&(a=i,o=n);return a}function wb(t){return Ca(t),t.scrollTrigger&&t.scrollTrigger.kill(!!I),t.progress()<1&&Dt(t,"onInterrupt"),t}function zb(t){if(t)if(t=!t.name&&t.default||t,x()||t.headless){var e=t.name,r=s(t),i=e&&!r&&t.init?function(){this._props=[]}:t,n={init:V,render:ve,add:Jt,kill:Te,modifier:ye,rawVars:0},a={targetTest:0,get:0,getSetter:le,aliases:{},register:0};if(Lt(),t!==i){if(mt[e])return;ta(i,ta(xa(t,n),a)),bt(i.prototype,bt(n,xa(t,a))),mt[i.prop=e]=i,t.targetTest&&(yt.push(i),ct[e]=1),e=("css"===e?"CSS":e.charAt(0).toUpperCase()+e.substr(1))+"Plugin"}U(e,i),t.register&&t.register(Fe,i,we)}else St.push(t)}function Cb(t,e,r){return(6*(t+=t<0?1:1<t?-1:0)<1?e+(r-e)*t*6:t<.5?r:3*t<2?e+(r-e)*(2/3-t)*6:e)*zt+.5|0}function Db(e,r,i){var n,a,s,o,u,h,l,f,d,c,p=e?t(e)?[e>>16,e>>8&zt,e&zt]:0:Et.black;if(!p){if(","===e.substr(-1)&&(e=e.substr(0,e.length-1)),Et[e])p=Et[e];else if("#"===e.charAt(0)){if(e.length<6&&(e="#"+(n=e.charAt(1))+n+(a=e.charAt(2))+a+(s=e.charAt(3))+s+(5===e.length?e.charAt(4)+e.charAt(4):"")),9===e.length)return[(p=parseInt(e.substr(1,6),16))>>16,p>>8&zt,p&zt,parseInt(e.substr(7),16)/255];p=[(e=parseInt(e.substr(1),16))>>16,e>>8&zt,e&zt]}else if("hsl"===e.substr(0,3))if(p=c=e.match(rt),r){if(~e.indexOf("="))return p=e.match(it),i&&p.length<4&&(p[3]=1),p}else o=+p[0]%360/360,u=p[1]/100,n=2*(h=p[2]/100)-(a=h<=.5?h*(u+1):h+u-h*u),3<p.length&&(p[3]*=1),p[0]=Cb(o+1/3,n,a),p[1]=Cb(o,n,a),p[2]=Cb(o-1/3,n,a);else p=e.match(rt)||Et.transparent;p=p.map(Number)}return r&&!c&&(n=p[0]/zt,a=p[1]/zt,s=p[2]/zt,h=((l=Math.max(n,a,s))+(f=Math.min(n,a,s)))/2,l===f?o=u=0:(d=l-f,u=.5<h?d/(2-l-f):d/(l+f),o=l===n?(a-s)/d+(a<s?6:0):l===a?(s-n)/d+2:(n-a)/d+4,o*=60),p[0]=~~(o+.5),p[1]=~~(100*u+.5),p[2]=~~(100*h+.5)),i&&p.length<4&&(p[3]=1),p}function Eb(t){var r=[],i=[],n=-1;return t.split(Rt).forEach(function(t){var e=t.match(nt)||[];r.push.apply(r,e),i.push(n+=e.length+1)}),r.c=i,r}function Fb(t,e,r){var i,n,a,s,o="",u=(t+o).match(Rt),h=e?"hsla(":"rgba(",l=0;if(!u)return t;if(u=u.map(function(t){return(t=Db(t,e,1))&&h+(e?t[0]+","+t[1]+"%,"+t[2]+"%,"+t[3]:t.join(","))+")"}),r&&(a=Eb(t),(i=r.c).join(o)!==a.c.join(o)))for(s=(n=t.replace(Rt,"1").split(nt)).length-1;l<s;l++)o+=n[l]+(~i.indexOf(l)?u.shift()||h+"0,0,0,0)":(a.length?a:u.length?u:r).shift());if(!n)for(s=(n=t.split(Rt)).length-1;l<s;l++)o+=n[l]+u[l];return o+n[s]}function Ib(t){var e,r=t.join(" ");if(Rt.lastIndex=0,Rt.test(r))return e=Ft.test(r),t[1]=Fb(t[1],e),t[0]=Fb(t[0],e,Eb(t[1])),!0}function Rb(t){var e=(t+"").split("("),r=Bt[e[0]];return r&&1<e.length&&r.config?r.config.apply(null,~t.indexOf("{")?[function _parseObjectInString(t){for(var e,r,i,n={},a=t.substr(1,t.length-3).split(":"),s=a[0],o=1,u=a.length;o<u;o++)r=a[o],e=o!==u-1?r.lastIndexOf(","):r.length,i=r.substr(0,e),n[s]=isNaN(i)?i.replace(Nt,"").trim():+i,s=r.substr(e+1).trim();return n}(e[1])]:function _valueInParentheses(t){var e=t.indexOf("(")+1,r=t.indexOf(")"),i=t.indexOf("(",e);return t.substring(e,~i&&i<r?t.indexOf(")",r+1):r)}(t).split(",").map(ra)):Bt._CE&&Yt.test(t)?Bt._CE("",t):r}function Tb(t,e){for(var r,i=t._first;i;)i instanceof Zt?Tb(i,e):!i.vars.yoyoEase||i._yoyo&&i._repeat||i._yoyo===e||(i.timeline?Tb(i.timeline,e):(r=i._ease,i._ease=i._yEase,i._yEase=r,i._yoyo=e)),i=i._next}function Vb(t,e,r,i){void 0===r&&(r=function easeOut(t){return 1-e(1-t)}),void 0===i&&(i=function easeInOut(t){return t<.5?e(2*t)/2:1-e(2*(1-t))/2});var n,a={easeIn:e,easeOut:r,easeInOut:i};return ja(t,function(t){for(var e in Bt[t]=ht[t]=a,Bt[n=t.toLowerCase()]=r,a)Bt[n+("easeIn"===e?".in":"easeOut"===e?".out":".inOut")]=Bt[t+"."+e]=a[e]}),a}function Wb(e){return function(t){return t<.5?(1-e(1-2*t))/2:.5+e(2*(t-.5))/2}}function Xb(r,t,e){function Lm(t){return 1===t?1:i*Math.pow(2,-10*t)*G((t-a)*n)+1}var i=1<=t?t:1,n=(e||(r?.3:.45))/(t<1?t:1),a=n/Z*(Math.asin(1/i)||0),s="out"===r?Lm:"in"===r?function(t){return 1-Lm(1-t)}:Wb(Lm);return n=Z/n,s.config=function(t,e){return Xb(r,t,e)},s}function Yb(e,r){function Tm(t){return t?--t*t*((r+1)*t+r)+1:0}void 0===r&&(r=1.70158);var t="out"===e?Tm:"in"===e?function(t){return 1-Tm(1-t)}:Wb(Tm);return t.config=function(t){return Yb(e,t)},t}var F,I,l,L,h,n,a,i,o,f,d,c,p,_,m,g,b,k,O,M,C,P,A,D,z,E,B,Y,N={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},j={duration:.5,overwrite:!1,delay:0},X=1e8,q=1/X,Z=2*Math.PI,W=Z/4,H=0,J=Math.sqrt,Q=Math.cos,G=Math.sin,K="function"==typeof ArrayBuffer&&ArrayBuffer.isView||function(){},$=Array.isArray,tt=/random\([^)]+\)/g,et=/,\s*/g,rt=/(?:-?\.?\d|\.)+/gi,it=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,nt=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,at=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,st=/[+-]=-?[.\d]+/,ot=/[^,'"\[\]\s]+/gi,ut=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,ht={},lt={suppressEvents:!0,isStart:!0,kill:!1},ft={suppressEvents:!0,kill:!1},dt={suppressEvents:!0},ct={},pt=[],_t={},mt={},gt={},vt=30,yt=[],Tt="",bt=function _merge(t,e){for(var r in e)t[r]=e[r];return t},wt=function _animationCycle(t,e){var r=Math.floor(t=la(t/e));return t&&r===t?r-1:r},xt=function _isFromOrFromStart(t){var e=t.data;return"isFromStart"===e||"isStart"===e},kt={_start:0,endTime:V,totalDuration:V},Ot=function _parsePosition(t,e,i){var n,a,s,o=t.labels,u=t._recent||kt,h=t.duration()>=X?u.endTime(!1):t._dur;return r(e)&&(isNaN(e)||e in o)?(a=e.charAt(0),s="%"===e.substr(-1),n=e.indexOf("="),"<"===a||">"===a?(0<=n&&(e=e.replace(/=/,"")),("<"===a?u._start:u.endTime(0<=u._repeat))+(parseFloat(e.substr(1))||0)*(s?(n<0?u:i).totalDuration()/100:1)):n<0?(e in o||(o[e]=h),o[e]):(a=parseFloat(e.charAt(n-1)+e.substr(n+1)),s&&i&&(a=a/100*($(i)?i[0]:i).totalDuration()),1<n?_parsePosition(t,e.substr(0,n-1),i)+a:h+a)):null==e?h:+e},Mt=function _clamp(t,e,r){return r<t?t:e<r?e:r},Ct=[].slice,Pt=function toArray(t,e,i){return l&&!e&&l.selector?l.selector(t):!r(t)||i||!n&&Lt()?$(t)?function _flatten(t,e,i){return void 0===i&&(i=[]),t.forEach(function(t){return r(t)&&!e||cb(t,1)?i.push.apply(i,Pt(t)):i.push(t)})||i}(t,i):cb(t)?Ct.call(t,0):t?[t]:[]:Ct.call((e||a).querySelectorAll(t),0)},At=function mapRange(e,t,r,i,n){var a=t-e,s=i-r;return Za(n,function(t){return r+((t-e)/a*s||0)})},Dt=function _callback(t,e,r){var i,n,a,s=t.vars,o=s[e],u=l,h=t._ctx;if(o)return i=s[e+"Params"],n=s.callbackScope||t,r&&pt.length&&oa(),h&&(l=h),a=i?o.apply(n,i):o.call(n),l=u,a},St=[],zt=255,Et={aqua:[0,zt,zt],lime:[0,zt,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,zt],navy:[0,0,128],white:[zt,zt,zt],olive:[128,128,0],yellow:[zt,zt,0],orange:[zt,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[zt,0,0],pink:[zt,192,203],cyan:[0,zt,zt],transparent:[zt,zt,zt,0]},Rt=function(){var t,e="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b";for(t in Et)e+="|"+t+"\\b";return new RegExp(e+")","gi")}(),Ft=/hsl[a]?\(/,It=(O=Date.now,M=500,C=33,P=O(),A=P,z=D=1e3/240,g={time:0,frame:0,tick:function tick(){Al(!0)},deltaRatio:function deltaRatio(t){return b/(1e3/(t||60))},wake:function wake(){o&&(!n&&x()&&(h=n=window,a=h.document||{},ht.gsap=Fe,(h.gsapVersions||(h.gsapVersions=[])).push(Fe.version),R(i||h.GreenSockGlobals||!h.gsap&&h||{}),St.forEach(zb)),m="undefined"!=typeof requestAnimationFrame&&requestAnimationFrame,p&&g.sleep(),_=m||function(t){return setTimeout(t,z-1e3*g.time+1|0)},c=1,Al(2))},sleep:function sleep(){(m?cancelAnimationFrame:clearTimeout)(p),c=0,_=V},lagSmoothing:function lagSmoothing(t,e){M=t||1/0,C=Math.min(e||33,M)},fps:function fps(t){D=1e3/(t||240),z=1e3*g.time+D},add:function add(n,t,e){var a=t?function(t,e,r,i){n(t,e,r,i),g.remove(a)}:n;return g.remove(n),E[e?"unshift":"push"](a),Lt(),a},remove:function remove(t,e){~(e=E.indexOf(t))&&E.splice(e,1)&&e<=k&&k--},_listeners:E=[]}),Lt=function _wake(){return!c&&It.wake()},Bt={},Yt=/^[\d.\-M][\d.\-,\s]/,Nt=/["']/g,jt=function _invertEase(e){return function(t){return 1-e(1-t)}},Vt=function _parseEase(t,e){return t&&(s(t)?t:Bt[t]||Rb(t))||e};function Al(t){var e,r,i,n,a=O()-A,s=!0===t;if((M<a||a<0)&&(P+=a-C),(0<(e=(i=(A+=a)-P)-z)||s)&&(n=++g.frame,b=i-1e3*g.time,g.time=i/=1e3,z+=e+(D<=e?4:D-e),r=1),s||(p=_(Al)),r)for(k=0;k<E.length;k++)E[k](i,b,n,t)}function jn(t){return t<Y?B*t*t:t<.7272727272727273?B*Math.pow(t-1.5/2.75,2)+.75:t<.9090909090909092?B*(t-=2.25/2.75)*t+.9375:B*Math.pow(t-2.625/2.75,2)+.984375}ja("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;Vb(t+",Power"+(r-1),e?function(t){return Math.pow(t,r)}:function(t){return t},function(t){return 1-Math.pow(1-t,r)},function(t){return t<.5?Math.pow(2*t,r)/2:1-Math.pow(2*(1-t),r)/2})}),Bt.Linear.easeNone=Bt.none=Bt.Linear.easeIn,Vb("Elastic",Xb("in"),Xb("out"),Xb()),B=7.5625,Y=1/2.75,Vb("Bounce",function(t){return 1-jn(1-t)},jn),Vb("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)}),Vb("Circ",function(t){return-(J(1-t*t)-1)}),Vb("Sine",function(t){return 1===t?1:1-Q(t*W)}),Vb("Back",Yb("in"),Yb("out"),Yb()),Bt.SteppedEase=Bt.steps=ht.SteppedEase={config:function config(t,e){void 0===t&&(t=1);var r=1/t,i=t+(e?0:1),n=e?1:0;return function(t){return((i*Mt(0,.99999999,t)|0)+n)*r}}},j.ease=Bt["quad.out"],ja("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return Tt+=t+","+t+"Params,"});var Ut,Xt=function GSCache(t,e){this.id=H++,(t._gsap=this).target=t,this.harness=e,this.get=e?e.get:ia,this.set=e?e.getSetter:le},qt=((Ut=Animation.prototype).delay=function delay(t){return t||0===t?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+t-this._delay),this._delay=t,this):this._delay},Ut.duration=function duration(t){return arguments.length?this.totalDuration(0<this._repeat?t+(t+this._rDelay)*this._repeat:t):this.totalDuration()&&this._dur},Ut.totalDuration=function totalDuration(t){return arguments.length?(this._dirty=0,Ua(this,this._repeat<0?t:(t-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},Ut.totalTime=function totalTime(t,e){if(Lt(),!arguments.length)return this._tTime;var r=this._dp;if(r&&r.smoothChildTiming&&this._ts){for(La(this,t),!r._dp||r.parent||Ma(r,this);r&&r.parent;)r.parent._time!==r._start+(0<=r._ts?r._tTime/r._ts:(r.totalDuration()-r._tTime)/-r._ts)&&r.totalTime(r._tTime,!0),r=r.parent;!this.parent&&this._dp.autoRemoveChildren&&(0<this._ts&&t<this._tDur||this._ts<0&&0<t||!this._tDur&&!t)&&Na(this._dp,this,this._start-this._delay)}return(this._tTime!==t||!this._dur&&!e||this._initted&&Math.abs(this._zTime)===q||!this._initted&&this._dur&&t||!t&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=t),qa(this,t,e)),this},Ut.time=function time(t,e){return arguments.length?this.totalTime(Math.min(this.totalDuration(),t+Ha(this))%(this._dur+this._rDelay)||(t?this._dur:0),e):this._time},Ut.totalProgress=function totalProgress(t,e){return arguments.length?this.totalTime(this.totalDuration()*t,e):this.totalDuration()?Math.min(1,this._tTime/this._tDur):0<=this.rawTime()&&this._initted?1:0},Ut.progress=function progress(t,e){return arguments.length?this.totalTime(this.duration()*(!this._yoyo||1&this.iteration()?t:1-t)+Ha(this),e):this.duration()?Math.min(1,this._time/this._dur):0<this.rawTime()?1:0},Ut.iteration=function iteration(t,e){var r=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(t-1)*r,e):this._repeat?wt(this._tTime,r)+1:1},Ut.timeScale=function timeScale(t,e){if(!arguments.length)return this._rts===-q?0:this._rts;if(this._rts===t)return this;var r=this.parent&&this._ts?Ja(this.parent._time,this):this._tTime;return this._rts=+t||0,this._ts=this._ps||t===-q?0:this._rts,this.totalTime(Mt(-Math.abs(this._delay),this.totalDuration(),r),!1!==e),Ka(this),function _recacheAncestors(t){for(var e=t.parent;e&&e.parent;)e._dirty=1,e.totalDuration(),e=e.parent;return t}(this)},Ut.paused=function paused(t){return arguments.length?(this._ps!==t&&((this._ps=t)?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Lt(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,1===this.progress()&&Math.abs(this._zTime)!==q&&(this._tTime-=q)))),this):this._ps},Ut.startTime=function startTime(t){if(arguments.length){this._start=la(t);var e=this.parent||this._dp;return!e||!e._sort&&this.parent||Na(e,this,this._start-this._delay),this}return this._start},Ut.endTime=function endTime(t){return this._start+(w(t)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},Ut.rawTime=function rawTime(t){var e=this.parent||this._dp;return e?t&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?Ja(e.rawTime(t),this):this._tTime:this._tTime},Ut.revert=function revert(t){void 0===t&&(t=dt);var e=I;return I=t,pa(this)&&(this.timeline&&this.timeline.revert(t),this.totalTime(-.01,t.suppressEvents)),"nested"!==this.data&&!1!==t.kill&&this.kill(),I=e,this},Ut.globalTime=function globalTime(t){for(var e=this,r=arguments.length?t:e.rawTime();e;)r=e._start+r/(Math.abs(e._ts)||1),e=e._dp;return!this.parent&&this._sat?this._sat.globalTime(t):r},Ut.repeat=function repeat(t){return arguments.length?(this._repeat=t===1/0?-2:t,Va(this)):-2===this._repeat?1/0:this._repeat},Ut.repeatDelay=function repeatDelay(t){if(arguments.length){var e=this._time;return this._rDelay=t,Va(this),e?this.time(e):this}return this._rDelay},Ut.yoyo=function yoyo(t){return arguments.length?(this._yoyo=t,this):this._yoyo},Ut.seek=function seek(t,e){return this.totalTime(Ot(this,t),w(e))},Ut.restart=function restart(t,e){return this.play().totalTime(t?-this._delay:0,w(e)),this._dur||(this._zTime=-q),this},Ut.play=function play(t,e){return null!=t&&this.seek(t,e),this.reversed(!1).paused(!1)},Ut.reverse=function reverse(t,e){return null!=t&&this.seek(t||this.totalDuration(),e),this.reversed(!0).paused(!1)},Ut.pause=function pause(t,e){return null!=t&&this.seek(t,e),this.paused(!0)},Ut.resume=function resume(){return this.paused(!1)},Ut.reversed=function reversed(t){return arguments.length?(!!t!==this.reversed()&&this.timeScale(-this._rts||(t?-q:0)),this):this._rts<0},Ut.invalidate=function invalidate(){return this._initted=this._act=0,this._zTime=-q,this},Ut.isActive=function isActive(){var t,e=this.parent||this._dp,r=this._start;return!(e&&!(this._ts&&this._initted&&e.isActive()&&(t=e.rawTime(!0))>=r&&t<this.endTime(!0)-q))},Ut.eventCallback=function eventCallback(t,e,r){var i=this.vars;return 1<arguments.length?(e?(i[t]=e,r&&(i[t+"Params"]=r),"onUpdate"===t&&(this._onUpdate=e)):delete i[t],this):i[t]},Ut.then=function then(t){var i=this,n=i._prom;return new Promise(function(e){function Fo(){var t=i.then;i.then=null,n&&n(),s(r)&&(r=r(i))&&(r.then||r===i)&&(i.then=t),e(r),i.then=t}var r=s(t)?t:sa;i._initted&&1===i.totalProgress()&&0<=i._ts||!i._tTime&&i._ts<0?Fo():i._prom=Fo})},Ut.kill=function kill(){wb(this)},Animation);function Animation(t){this.vars=t,this._delay=+t.delay||0,(this._repeat=t.repeat===1/0?-2:t.repeat||0)&&(this._rDelay=t.repeatDelay||0,this._yoyo=!!t.yoyo||!!t.yoyoEase),this._ts=1,Ua(this,+t.duration,1,1),this.data=t.data,l&&(this._ctx=l).data.push(this),c||It.wake()}ta(qt.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-q,_prom:0,_ps:!1,_rts:1});var Zt=function(i){function Timeline(t,e){var r;return void 0===t&&(t={}),(r=i.call(this,t)||this).labels={},r.smoothChildTiming=!!t.smoothChildTiming,r.autoRemoveChildren=!!t.autoRemoveChildren,r._sort=w(t.sortChildren),L&&Na(t.parent||L,_assertThisInitialized(r),e),t.reversed&&r.reverse(),t.paused&&r.paused(!0),t.scrollTrigger&&Oa(_assertThisInitialized(r),t.scrollTrigger),r}_inheritsLoose(Timeline,i);var e=Timeline.prototype;return e.to=function to(t,e,r){return Ya(0,arguments,this),this},e.from=function from(t,e,r){return Ya(1,arguments,this),this},e.fromTo=function fromTo(t,e,r,i){return Ya(2,arguments,this),this},e.set=function set(t,e,r){return e.duration=0,e.parent=this,ya(e).repeatDelay||(e.repeat=0),e.immediateRender=!!e.immediateRender,new te(t,e,Ot(this,r),1),this},e.call=function call(t,e,r){return Na(this,te.delayedCall(0,t,e),r)},e.staggerTo=function staggerTo(t,e,r,i,n,a,s){return r.duration=e,r.stagger=r.stagger||i,r.onComplete=a,r.onCompleteParams=s,r.parent=this,new te(t,r,Ot(this,n)),this},e.staggerFrom=function staggerFrom(t,e,r,i,n,a,s){return r.runBackwards=1,ya(r).immediateRender=w(r.immediateRender),this.staggerTo(t,e,r,i,n,a,s)},e.staggerFromTo=function staggerFromTo(t,e,r,i,n,a,s,o){return i.startAt=r,ya(i).immediateRender=w(i.immediateRender),this.staggerTo(t,e,i,n,a,s,o)},e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_=this._time,m=this._dirty?this.totalDuration():this._tDur,g=this._dur,v=t<=0?0:la(t),y=this._zTime<0!=t<0&&(this._initted||!g);if(this!==L&&m<v&&0<=t&&(v=m),v!==this._tTime||r||y){if(_!==this._time&&g&&(v+=this._time-_,t+=this._time-_),i=v,f=this._start,u=!(l=this._ts),y&&(g||(_=this._zTime),!t&&e||(this._zTime=t)),this._repeat){if(c=this._yoyo,o=g+this._rDelay,this._repeat<-1&&t<0)return this.totalTime(100*o+t,e,r);if(i=la(v%o),v===m?(s=this._repeat,i=g):((s=~~(d=la(v/o)))&&s===d&&(i=g,s--),g<i&&(i=g)),d=wt(this._tTime,o),!_&&this._tTime&&d!==s&&this._tTime-d*o-this._dur<=0&&(d=s),c&&1&s&&(i=g-i,p=1),s!==d&&!this._lock){var T=c&&1&d,b=T===(c&&1&s);if(s<d&&(T=!T),_=T?0:v%g?g:v,this._lock=1,this.render(_||(p?0:la(s*o)),e,!g)._lock=0,this._tTime=v,!e&&this.parent&&Dt(this,"onRepeat"),this.vars.repeatRefresh&&!p&&(this.invalidate()._lock=1,d=s),_&&_!==this._time||u!=!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(g=this._dur,m=this._tDur,b&&(this._lock=2,_=T?g:-1e-4,this.render(_,!0),this.vars.repeatRefresh&&!p&&this.invalidate()),this._lock=0,!this._ts&&!u)return this;Tb(this,p)}}if(this._hasPause&&!this._forcing&&this._lock<2&&(h=function _findNextPauseTween(t,e,r){var i;if(e<r)for(i=t._first;i&&i._start<=r;){if("isPause"===i.data&&i._start>e)return i;i=i._next}else for(i=t._last;i&&i._start>=r;){if("isPause"===i.data&&i._start<e)return i;i=i._prev}}(this,la(_),la(i)))&&(v-=i-(i=h._start)),this._tTime=v,this._time=i,this._act=!l,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=t,_=0),!_&&v&&g&&!e&&!d&&(Dt(this,"onStart"),this._tTime!==v))return this;if(_<=i&&0<=t)for(n=this._first;n;){if(a=n._next,(n._act||i>=n._start)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(i-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(i-n._start)*n._ts,e,r),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=-q);break}}n=a}else{n=this._last;for(var w=t<0?t:i;n;){if(a=n._prev,(n._act||w<=n._end)&&n._ts&&h!==n){if(n.parent!==this)return this.render(t,e,r);if(n.render(0<n._ts?(w-n._start)*n._ts:(n._dirty?n.totalDuration():n._tDur)+(w-n._start)*n._ts,e,r||I&&pa(n)),i!==this._time||!this._ts&&!u){h=0,a&&(v+=this._zTime=w?-q:q);break}}n=a}}if(h&&!e&&(this.pause(),h.render(_<=i?0:-q)._zTime=_<=i?1:-1,this._ts))return this._start=f,Ka(this),this.render(t,e,r);this._onUpdate&&!e&&Dt(this,"onUpdate",!0),(v===m&&this._tTime>=this.totalDuration()||!v&&_)&&(f!==this._start&&Math.abs(l)===Math.abs(this._ts)||this._lock||(!t&&g||!(v===m&&0<this._ts||!v&&this._ts<0)||Ca(this,1),e||t<0&&!_||!v&&!_&&m||(Dt(this,v===m&&0<=t?"onComplete":"onReverseComplete",!0),!this._prom||v<m&&0<this.timeScale()||this._prom())))}return this},e.add=function add(e,i){var n=this;if(t(i)||(i=Ot(this,i,e)),!(e instanceof qt)){if($(e))return e.forEach(function(t){return n.add(t,i)}),this;if(r(e))return this.addLabel(e,i);if(!s(e))return this;e=te.delayedCall(0,e)}return this!==e?Na(this,e,i):this},e.getChildren=function getChildren(t,e,r,i){void 0===t&&(t=!0),void 0===e&&(e=!0),void 0===r&&(r=!0),void 0===i&&(i=-X);for(var n=[],a=this._first;a;)a._start>=i&&(a instanceof te?e&&n.push(a):(r&&n.push(a),t&&n.push.apply(n,a.getChildren(!0,e,r)))),a=a._next;return n},e.getById=function getById(t){for(var e=this.getChildren(1,1,1),r=e.length;r--;)if(e[r].vars.id===t)return e[r]},e.remove=function remove(t){return r(t)?this.removeLabel(t):s(t)?this.killTweensOf(t):(t.parent===this&&Ba(this,t),t===this._recent&&(this._recent=this._last),Da(this))},e.totalTime=function totalTime(t,e){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=la(It.time-(0<this._ts?t/this._ts:(this.totalDuration()-t)/-this._ts))),i.prototype.totalTime.call(this,t,e),this._forcing=0,this):this._tTime},e.addLabel=function addLabel(t,e){return this.labels[t]=Ot(this,e),this},e.removeLabel=function removeLabel(t){return delete this.labels[t],this},e.addPause=function addPause(t,e,r){var i=te.delayedCall(0,e||V,r);return i.data="isPause",this._hasPause=1,Na(this,i,Ot(this,t))},e.removePause=function removePause(t){var e=this._first;for(t=Ot(this,t);e;)e._start===t&&"isPause"===e.data&&Ca(e),e=e._next},e.killTweensOf=function killTweensOf(t,e,r){for(var i=this.getTweensOf(t,r),n=i.length;n--;)Wt!==i[n]&&i[n].kill(t,e);return this},e.getTweensOf=function getTweensOf(e,r){for(var i,n=[],a=Pt(e),s=this._first,o=t(r);s;)s instanceof te?na(s._targets,a)&&(o?(!Wt||s._initted&&s._ts)&&s.globalTime(0)<=r&&s.globalTime(s.totalDuration())>r:!r||s.isActive())&&n.push(s):(i=s.getTweensOf(a,r)).length&&n.push.apply(n,i),s=s._next;return n},e.tweenTo=function tweenTo(t,e){e=e||{};var r,i=this,n=Ot(i,t),a=e.startAt,s=e.onStart,o=e.onStartParams,u=e.immediateRender,h=te.to(i,ta({ease:e.ease||"none",lazy:!1,immediateRender:!1,time:n,overwrite:"auto",duration:e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale())||q,onStart:function onStart(){if(i.pause(),!r){var t=e.duration||Math.abs((n-(a&&"time"in a?a.time:i._time))/i.timeScale());h._dur!==t&&Ua(h,t,0,1).render(h._time,!0,!0),r=1}s&&s.apply(h,o||[])}},e));return u?h.render(0):h},e.tweenFromTo=function tweenFromTo(t,e,r){return this.tweenTo(e,ta({startAt:{time:Ot(this,t)}},r))},e.recent=function recent(){return this._recent},e.nextLabel=function nextLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t))},e.previousLabel=function previousLabel(t){return void 0===t&&(t=this._time),ub(this,Ot(this,t),1)},e.currentLabel=function currentLabel(t){return arguments.length?this.seek(t,!0):this.previousLabel(this._time+q)},e.shiftChildren=function shiftChildren(t,e,r){void 0===r&&(r=0);var i,n=this._first,a=this.labels;for(t=la(t);n;)n._start>=r&&(n._start+=t,n._end+=t),n=n._next;if(e)for(i in a)a[i]>=r&&(a[i]+=t);return Da(this)},e.invalidate=function invalidate(t){var e=this._first;for(this._lock=0;e;)e.invalidate(t),e=e._next;return i.prototype.invalidate.call(this,t)},e.clear=function clear(t){void 0===t&&(t=!0);for(var e,r=this._first;r;)e=r._next,this.remove(r),r=e;return this._dp&&(this._time=this._tTime=this._pTime=0),t&&(this.labels={}),Da(this)},e.totalDuration=function totalDuration(t){var e,r,i,n=0,a=this,s=a._last,o=X;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-t:t));if(a._dirty){for(i=a.parent;s;)e=s._prev,s._dirty&&s.totalDuration(),o<(r=s._start)&&a._sort&&s._ts&&!a._lock?(a._lock=1,Na(a,s,r-s._delay,1)._lock=0):o=r,r<0&&s._ts&&(n-=r,(!i&&!a._dp||i&&i.smoothChildTiming)&&(a._start+=la(r/a._ts),a._time-=r,a._tTime-=r),a.shiftChildren(-r,!1,-Infinity),o=0),s._end>n&&s._ts&&(n=s._end),s=e;Ua(a,a===L&&a._time>n?a._time:n,1,1),a._dirty=0}return a._tDur},Timeline.updateRoot=function updateRoot(t){if(L._ts&&(qa(L,Ja(t,L)),f=It.frame),It.frame>=vt){vt+=N.autoSleep||120;var e=L._first;if((!e||!e._ts)&&N.autoSleep&&It._listeners.length<2){for(;e&&!e._ts;)e=e._next;e||It.sleep()}}},Timeline}(qt);ta(Zt.prototype,{_lock:0,_hasPause:0,_forcing:0});function dc(t,e,i,n,a,o){var u,h,l,f;if(mt[t]&&!1!==(u=new mt[t]).init(a,u.rawVars?e[t]:function _processVars(t,e,i,n,a){if(s(t)&&(t=Gt(t,a,e,i,n)),!v(t)||t.style&&t.nodeType||$(t)||K(t))return r(t)?Gt(t,a,e,i,n):t;var o,u={};for(o in t)u[o]=Gt(t[o],a,e,i,n);return u}(e[t],n,a,o,i),i,n,o)&&(i._pt=h=new we(i._pt,a,t,0,1,u.render,u,0,u.priority),i!==d))for(l=i._ptLookup[i._targets.indexOf(a)],f=u._props.length;f--;)l[u._props[f]]=h;return u}function jc(t,r,e,i){var n,a,s=r.ease||i||"power1.inOut";if($(r))a=e[t]||(e[t]=[]),r.forEach(function(t,e){return a.push({t:e/(r.length-1)*100,v:t,e:s})});else for(n in r)a=e[n]||(e[n]=[]),"ease"===n||a.push({t:parseFloat(t),v:r[n],e:s})}var Wt,Ht,Jt=function _addPropTween(t,e,i,n,a,o,u,h,l,f){s(n)&&(n=n(a||0,t,o));var d,c=t[e],p="get"!==i?i:s(c)?l?t[e.indexOf("set")||!s(t["get"+e.substr(3)])?e:"get"+e.substr(3)](l):t[e]():c,_=s(c)?l?ue:re:ee;if(r(n)&&(~n.indexOf("random(")&&(n=rb(n)),"="===n.charAt(1)&&(!(d=ma(p,n)+(_a(p)||0))&&0!==d||(n=d))),!f||p!==n||Ht)return isNaN(p*n)||""===n?(c||e in t||S(e,n),function _addComplexStringPropTween(t,e,r,i,n,a,s){var o,u,h,l,f,d,c,p,_=new we(this._pt,t,e,0,1,ge,null,n),m=0,g=0;for(_.b=r,_.e=i,r+="",(c=~(i+="").indexOf("random("))&&(i=rb(i)),a&&(a(p=[r,i],t,e),r=p[0],i=p[1]),u=r.match(at)||[];o=at.exec(i);)l=o[0],f=i.substring(m,o.index),h?h=(h+1)%5:"rgba("===f.substr(-5)&&(h=1),l!==u[g++]&&(d=parseFloat(u[g-1])||0,_._pt={_next:_._pt,p:f||1===g?f:",",s:d,c:"="===l.charAt(1)?ma(d,l)-d:parseFloat(l)-d,m:h&&h<4?Math.round:0},m=at.lastIndex);return _.c=m<i.length?i.substring(m,i.length):"",_.fp=s,(st.test(i)||c)&&(_.e=0),this._pt=_}.call(this,t,e,p,n,_,h||N.stringFilter,l)):(d=new we(this._pt,t,e,+p||0,n-(p||0),"boolean"==typeof c?_e:ce,0,_),l&&(d.fp=l),u&&d.modifier(u,this,t),this._pt=d)},Qt=function _initTween(t,e,r){var i,n,a,s,o,u,h,l,f,d,c,p,_,m=t.vars,g=m.ease,v=m.startAt,y=m.immediateRender,T=m.lazy,b=m.onUpdate,x=m.runBackwards,k=m.yoyoEase,O=m.keyframes,M=m.autoRevert,C=t._dur,P=t._startAt,A=t._targets,D=t.parent,S=D&&"nested"===D.data?D.vars.targets:A,z="auto"===t._overwrite&&!F,E=t.timeline;if(!E||O&&g||(g="none"),t._ease=Vt(g,j.ease),t._yEase=k?jt(Vt(!0===k?g:k,j.ease)):0,k&&t._yoyo&&!t._repeat&&(k=t._yEase,t._yEase=t._ease,t._ease=k),t._from=!E&&!!m.runBackwards,!E||O&&!m.stagger){if(p=(l=A[0]?ha(A[0]).harness:0)&&m[l.prop],i=xa(m,ct),P&&(P._zTime<0&&P.progress(1),e<0&&x&&y&&!M?P.render(-1,!0):P.revert(x&&C?ft:lt),P._lazy=0),v){if(Ca(t._startAt=te.set(A,ta({data:"isStart",overwrite:!1,parent:D,immediateRender:!0,lazy:!P&&w(T),startAt:null,delay:0,onUpdate:b&&function(){return Dt(t,"onUpdate")},stagger:0},v))),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I||!y&&!M)&&t._startAt.revert(ft),y&&C&&e<=0&&r<=0)return void(e&&(t._zTime=e))}else if(x&&C&&!P)if(e&&(y=!1),a=ta({overwrite:!1,data:"isFromStart",lazy:y&&!P&&w(T),immediateRender:y,stagger:0,parent:D},i),p&&(a[l.prop]=p),Ca(t._startAt=te.set(A,a)),t._startAt._dp=0,t._startAt._sat=t,e<0&&(I?t._startAt.revert(ft):t._startAt.render(-1,!0)),t._zTime=e,y){if(!e)return}else _initTween(t._startAt,q,q);for(t._pt=t._ptCache=0,T=C&&w(T)||T&&!C,n=0;n<A.length;n++){if(h=(o=A[n])._gsap||ga(A)[n]._gsap,t._ptLookup[n]=d={},_t[h.id]&&pt.length&&oa(),c=S===A?n:S.indexOf(o),l&&!1!==(f=new l).init(o,p||i,t,c,S)&&(t._pt=s=new we(t._pt,o,f.name,0,1,f.render,f,0,f.priority),f._props.forEach(function(t){d[t]=s}),f.priority&&(u=1)),!l||p)for(a in i)mt[a]&&(f=dc(a,i,t,c,o,S))?f.priority&&(u=1):d[a]=s=Jt.call(t,o,a,"get",i[a],c,S,0,m.stringFilter);t._op&&t._op[n]&&t.kill(o,t._op[n]),z&&t._pt&&(Wt=t,L.killTweensOf(o,d,t.globalTime(e)),_=!t.parent,Wt=0),t._pt&&T&&(_t[h.id]=1)}u&&be(t),t._onInit&&t._onInit(t)}t._onUpdate=b,t._initted=(!t._op||t._pt)&&!_,O&&e<=0&&E.render(X,!0,!0)},Gt=function _parseFuncOrString(t,e,i,n,a){return s(t)?t.call(e,i,n,a):r(t)&&~t.indexOf("random(")?rb(t):t},Kt=Tt+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,autoRevert",$t={};ja(Kt+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return $t[t]=1});var te=function(R){function Tween(e,r,i,n){var a;"number"==typeof r&&(i.duration=r,r=i,i=null);var s,o,u,h,l,f,d,c,p=(a=R.call(this,n?r:ya(r))||this).vars,_=p.duration,m=p.delay,g=p.immediateRender,b=p.stagger,x=p.overwrite,k=p.keyframes,O=p.defaults,M=p.scrollTrigger,C=p.yoyoEase,P=r.parent||L,A=($(e)||K(e)?t(e[0]):"length"in r)?[e]:Pt(e);if(a._targets=A.length?ga(A):T("GSAP target "+e+" not found. https://gsap.com",!N.nullTargetWarn)||[],a._ptLookup=[],a._overwrite=x,k||b||y(_)||y(m)){if(r=a.vars,(s=a.timeline=new Zt({data:"nested",defaults:O||{},targets:P&&"nested"===P.data?P.vars.targets:A})).kill(),s.parent=s._dp=_assertThisInitialized(a),s._start=0,b||y(_)||y(m)){if(h=A.length,d=b&&hb(b),v(b))for(l in b)~Kt.indexOf(l)&&((c=c||{})[l]=b[l]);for(o=0;o<h;o++)(u=xa(r,$t)).stagger=0,C&&(u.yoyoEase=C),c&&bt(u,c),f=A[o],u.duration=+Gt(_,_assertThisInitialized(a),o,f,A),u.delay=(+Gt(m,_assertThisInitialized(a),o,f,A)||0)-a._delay,!b&&1===h&&u.delay&&(a._delay=m=u.delay,a._start+=m,u.delay=0),s.to(f,u,d?d(o,f,A):0),s._ease=Bt.none;s.duration()?_=m=0:a.timeline=0}else if(k){ya(ta(s.vars.defaults,{ease:"none"})),s._ease=Vt(k.ease||r.ease||"none");var D,S,z,E=0;if($(k))k.forEach(function(t){return s.to(A,t,">")}),s.duration();else{for(l in u={},k)"ease"===l||"easeEach"===l||jc(l,k[l],u,k.easeEach);for(l in u)for(D=u[l].sort(function(t,e){return t.t-e.t}),o=E=0;o<D.length;o++)(z={ease:(S=D[o]).e,duration:(S.t-(o?D[o-1].t:0))/100*_})[l]=S.v,s.to(A,z,E),E+=z.duration;s.duration()<_&&s.to({},{duration:_-s.duration()})}}_||a.duration(_=s.duration())}else a.timeline=0;return!0!==x||F||(Wt=_assertThisInitialized(a),L.killTweensOf(A),Wt=0),Na(P,_assertThisInitialized(a),i),r.reversed&&a.reverse(),r.paused&&a.paused(!0),(g||!_&&!k&&a._start===la(P._time)&&w(g)&&function _hasNoPausedAncestors(t){return!t||t._ts&&_hasNoPausedAncestors(t.parent)}(_assertThisInitialized(a))&&"nested"!==P.data)&&(a._tTime=-q,a.render(Math.max(0,-m)||0)),M&&Oa(_assertThisInitialized(a),M),a}_inheritsLoose(Tween,R);var e=Tween.prototype;return e.render=function render(t,e,r){var i,n,a,s,o,u,h,l,f,d=this._time,c=this._tDur,p=this._dur,_=t<0,m=c-q<t&&!_?c:t<q?0:t;if(p){if(m!==this._tTime||!t||r||!this._initted&&this._tTime||this._startAt&&this._zTime<0!=_||this._lazy){if(i=m,l=this.timeline,this._repeat){if(s=p+this._rDelay,this._repeat<-1&&_)return this.totalTime(100*s+t,e,r);if(i=la(m%s),m===c?(a=this._repeat,i=p):(a=~~(o=la(m/s)))&&a===o?(i=p,a--):p<i&&(i=p),(u=this._yoyo&&1&a)&&(f=this._yEase,i=p-i),o=wt(this._tTime,s),i===d&&!r&&this._initted&&a===o)return this._tTime=m,this;a!==o&&(l&&this._yEase&&Tb(l,u),this.vars.repeatRefresh&&!u&&!this._lock&&i!==s&&this._initted&&(this._lock=r=1,this.render(la(s*a),!0).invalidate()._lock=0))}if(!this._initted){if(Pa(this,_?t:i,r,e,m))return this._tTime=0,this;if(!(d===this._time||r&&this.vars.repeatRefresh&&a!==o))return this;if(p!==this._dur)return this.render(t,e,r)}if(this._tTime=m,this._time=i,!this._act&&this._ts&&(this._act=1,this._lazy=0),this.ratio=h=(f||this._ease)(i/p),this._from&&(this.ratio=h=1-h),!d&&m&&!e&&!o&&(Dt(this,"onStart"),this._tTime!==m))return this;for(n=this._pt;n;)n.r(h,n.d),n=n._next;l&&l.render(t<0?t:l._dur*l._ease(i/this._dur),e,r)||this._startAt&&(this._zTime=t),this._onUpdate&&!e&&(_&&Fa(this,t,0,r),Dt(this,"onUpdate")),this._repeat&&a!==o&&this.vars.onRepeat&&!e&&this.parent&&Dt(this,"onRepeat"),m!==this._tDur&&m||this._tTime!==m||(_&&!this._onUpdate&&Fa(this,t,0,!0),!t&&p||!(m===this._tDur&&0<this._ts||!m&&this._ts<0)||Ca(this,1),e||_&&!d||!(m||d||u)||(Dt(this,m===c?"onComplete":"onReverseComplete",!0),!this._prom||m<c&&0<this.timeScale()||this._prom()))}}else!function _renderZeroDurationTween(t,e,r,i){var n,a,s,o=t.ratio,u=e<0||!e&&(!t._start&&function _parentPlayheadIsBeforeStart(t){var e=t.parent;return e&&e._ts&&e._initted&&!e._lock&&(e.rawTime()<0||_parentPlayheadIsBeforeStart(e))}(t)&&(t._initted||!xt(t))||(t._ts<0||t._dp._ts<0)&&!xt(t))?0:1,h=t._rDelay,l=0;if(h&&t._repeat&&(l=Mt(0,t._tDur,e),a=wt(l,h),t._yoyo&&1&a&&(u=1-u),a!==wt(t._tTime,h)&&(o=1-u,t.vars.repeatRefresh&&t._initted&&t.invalidate())),u!==o||I||i||t._zTime===q||!e&&t._zTime){if(!t._initted&&Pa(t,e,i,r,l))return;for(s=t._zTime,t._zTime=e||(r?q:0),r=r||e&&!s,t.ratio=u,t._from&&(u=1-u),t._time=0,t._tTime=l,n=t._pt;n;)n.r(u,n.d),n=n._next;e<0&&Fa(t,e,0,!0),t._onUpdate&&!r&&Dt(t,"onUpdate"),l&&t._repeat&&!r&&t.parent&&Dt(t,"onRepeat"),(e>=t._tDur||e<0)&&t.ratio===u&&(u&&Ca(t,1),r||I||(Dt(t,u?"onComplete":"onReverseComplete",!0),t._prom&&t._prom()))}else t._zTime||(t._zTime=e)}(this,t,e,r);return this},e.targets=function targets(){return this._targets},e.invalidate=function invalidate(t){return t&&this.vars.runBackwards||(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(t),R.prototype.invalidate.call(this,t)},e.resetTo=function resetTo(t,e,r,i,n){c||It.wake(),this._ts||this.play();var a,s=Math.min(this._dur,(this._dp._time-this._start)*this._ts);return this._initted||Qt(this,s),a=this._ease(s/this._dur),function _updatePropTweens(t,e,r,i,n,a,s,o){var u,h,l,f,d=(t._pt&&t._ptCache||(t._ptCache={}))[e];if(!d)for(d=t._ptCache[e]=[],l=t._ptLookup,f=t._targets.length;f--;){if((u=l[f][e])&&u.d&&u.d._pt)for(u=u.d._pt;u&&u.p!==e&&u.fp!==e;)u=u._next;if(!u)return Ht=1,t.vars[e]="+=0",Qt(t,s),Ht=0,o?T(e+" not eligible for reset"):1;d.push(u)}for(f=d.length;f--;)(u=(h=d[f])._pt||h).s=!i&&0!==i||n?u.s+(i||0)+a*u.c:i,u.c=r-u.s,h.e&&(h.e=ka(r)+_a(h.e)),h.b&&(h.b=u.s+_a(h.b))}(this,t,e,r,i,a,s,n)?this.resetTo(t,e,r,i,1):(La(this,0),this.parent||Aa(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},e.kill=function kill(t,e){if(void 0===e&&(e="all"),!(t||e&&"all"!==e))return this._lazy=this._pt=0,this.parent?wb(this):this.scrollTrigger&&this.scrollTrigger.kill(!!I),this;if(this.timeline){var i=this.timeline.totalDuration();return this.timeline.killTweensOf(t,e,Wt&&!0!==Wt.vars.overwrite)._first||wb(this),this.parent&&i!==this.timeline.totalDuration()&&Ua(this,this._dur*this.timeline._tDur/i,0,1),this}var n,a,s,o,u,h,l,f=this._targets,d=t?Pt(t):f,c=this._ptLookup,p=this._pt;if((!e||"all"===e)&&function _arraysMatch(t,e){for(var r=t.length,i=r===e.length;i&&r--&&t[r]===e[r];);return r<0}(f,d))return"all"===e&&(this._pt=0),wb(this);for(n=this._op=this._op||[],"all"!==e&&(r(e)&&(u={},ja(e,function(t){return u[t]=1}),e=u),e=function _addAliasesToVars(t,e){var r,i,n,a,s=t[0]?ha(t[0]).harness:0,o=s&&s.aliases;if(!o)return e;for(i in r=bt({},e),o)if(i in r)for(n=(a=o[i].split(",")).length;n--;)r[a[n]]=r[i];return r}(f,e)),l=f.length;l--;)if(~d.indexOf(f[l]))for(u in a=c[l],"all"===e?(n[l]=e,o=a,s={}):(s=n[l]=n[l]||{},o=e),o)(h=a&&a[u])&&("kill"in h.d&&!0!==h.d.kill(u)||Ba(this,h,"_pt"),delete a[u]),"all"!==s&&(s[u]=1);return this._initted&&!this._pt&&p&&wb(this),this},Tween.to=function to(t,e,r){return new Tween(t,e,r)},Tween.from=function from(t,e){return Ya(1,arguments)},Tween.delayedCall=function delayedCall(t,e,r,i){return new Tween(e,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:t,onComplete:e,onReverseComplete:e,onCompleteParams:r,onReverseCompleteParams:r,callbackScope:i})},Tween.fromTo=function fromTo(t,e,r){return Ya(2,arguments)},Tween.set=function set(t,e){return e.duration=0,e.repeatDelay||(e.repeat=0),new Tween(t,e)},Tween.killTweensOf=function killTweensOf(t,e,r){return L.killTweensOf(t,e,r)},Tween}(qt);ta(te.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0}),ja("staggerTo,staggerFrom,staggerFromTo",function(r){te[r]=function(){var t=new Zt,e=Ct.call(arguments,0);return e.splice("staggerFromTo"===r?5:4,0,0),t[r].apply(t,e)}});function rc(t,e,r){return t.setAttribute(e,r)}function zc(t,e,r,i){i.mSet(t,e,i.m.call(i.tween,r,i.mt),i)}var ee=function _setterPlain(t,e,r){return t[e]=r},re=function _setterFunc(t,e,r){return t[e](r)},ue=function _setterFuncWithParam(t,e,r,i){return t[e](i.fp,r)},le=function _getSetter(t,e){return s(t[e])?re:u(t[e])&&t.setAttribute?rc:ee},ce=function _renderPlain(t,e){return e.set(e.t,e.p,Math.round(1e6*(e.s+e.c*t))/1e6,e)},_e=function _renderBoolean(t,e){return e.set(e.t,e.p,!!(e.s+e.c*t),e)},ge=function _renderComplexString(t,e){var r=e._pt,i="";if(!t&&e.b)i=e.b;else if(1===t&&e.e)i=e.e;else{for(;r;)i=r.p+(r.m?r.m(r.s+r.c*t):Math.round(1e4*(r.s+r.c*t))/1e4)+i,r=r._next;i+=e.c}e.set(e.t,e.p,i,e)},ve=function _renderPropTweens(t,e){for(var r=e._pt;r;)r.r(t,r.d),r=r._next},ye=function _addPluginModifier(t,e,r,i){for(var n,a=this._pt;a;)n=a._next,a.p===i&&a.modifier(t,e,r),a=n},Te=function _killPropTweensOf(t){for(var e,r,i=this._pt;i;)r=i._next,i.p===t&&!i.op||i.op===t?Ba(this,i,"_pt"):i.dep||(e=1),i=r;return!e},be=function _sortPropTweensByPriority(t){for(var e,r,i,n,a=t._pt;a;){for(e=a._next,r=i;r&&r.pr>a.pr;)r=r._next;(a._prev=r?r._prev:n)?a._prev._next=a:i=a,(a._next=r)?r._prev=a:n=a,a=e}t._pt=i},we=(PropTween.prototype.modifier=function modifier(t,e,r){this.mSet=this.mSet||this.set,this.set=zc,this.m=t,this.mt=r,this.tween=e},PropTween);function PropTween(t,e,r,i,n,a,s,o,u){this.t=e,this.s=i,this.c=n,this.p=r,this.r=a||ce,this.d=s||this,this.set=o||ee,this.pr=u||0,(this._next=t)&&(t._prev=this)}ja(Tt+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger",function(t){return ct[t]=1}),ht.TweenMax=ht.TweenLite=te,ht.TimelineLite=ht.TimelineMax=Zt,L=new Zt({sortChildren:!1,defaults:j,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0}),N.stringFilter=Ib;function Hc(t){return(Oe[t]||Me).map(function(t){return t()})}function Ic(){var t=Date.now(),o=[];2<t-Ce&&(Hc("matchMediaInit"),ke.forEach(function(t){var e,r,i,n,a=t.queries,s=t.conditions;for(r in a)(e=h.matchMedia(a[r]).matches)&&(i=1),e!==s[r]&&(s[r]=e,n=1);n&&(t.revert(),i&&o.push(t))}),Hc("matchMediaRevert"),o.forEach(function(e){return e.onMatch(e,function(t){return e.add(null,t)})}),Ce=t,Hc("matchMedia"))}var xe,ke=[],Oe={},Me=[],Ce=0,Pe=0,De=((xe=Context.prototype).add=function add(t,i,n){function Jw(){var t,e=l,r=a.selector;return e&&e!==a&&e.data.push(a),n&&(a.selector=fb(n)),l=a,t=i.apply(a,arguments),s(t)&&a._r.push(t),l=e,a.selector=r,a.isReverted=!1,t}s(t)&&(n=i,i=t,t=s);var a=this;return a.last=Jw,t===s?Jw(a,function(t){return a.add(null,t)}):t?a[t]=Jw:Jw},xe.ignore=function ignore(t){var e=l;l=null,t(this),l=e},xe.getTweens=function getTweens(){var e=[];return this.data.forEach(function(t){return t instanceof Context?e.push.apply(e,t.getTweens()):t instanceof te&&!(t.parent&&"nested"===t.parent.data)&&e.push(t)}),e},xe.clear=function clear(){this._r.length=this.data.length=0},xe.kill=function kill(i,t){var n=this;if(i?function(){for(var t,e=n.getTweens(),r=n.data.length;r--;)"isFlip"===(t=n.data[r]).data&&(t.revert(),t.getChildren(!0,!0,!1).forEach(function(t){return e.splice(e.indexOf(t),1)}));for(e.map(function(t){return{g:t._dur||t._delay||t._sat&&!t._sat.vars.immediateRender?t.globalTime(0):-1/0,t:t}}).sort(function(t,e){return e.g-t.g||-1/0}).forEach(function(t){return t.t.revert(i)}),r=n.data.length;r--;)(t=n.data[r])instanceof Zt?"nested"!==t.data&&(t.scrollTrigger&&t.scrollTrigger.revert(),t.kill()):t instanceof te||!t.revert||t.revert(i);n._r.forEach(function(t){return t(i,n)}),n.isReverted=!0}():this.data.forEach(function(t){return t.kill&&t.kill()}),this.clear(),t)for(var e=ke.length;e--;)ke[e].id===this.id&&ke.splice(e,1)},xe.revert=function revert(t){this.kill(t||{})},Context);function Context(t,e){this.selector=e&&fb(e),this.data=[],this._r=[],this.isReverted=!1,this.id=Pe++,t&&this.add(t)}var Se,Ee=((Se=MatchMedia.prototype).add=function add(t,e,r){v(t)||(t={matches:t});var i,n,a,s=new De(0,r||this.scope),o=s.conditions={};for(n in l&&!s.selector&&(s.selector=l.selector),this.contexts.push(s),e=s.add("onMatch",e),s.queries=t)"all"===n?a=1:(i=h.matchMedia(t[n]))&&(ke.indexOf(s)<0&&ke.push(s),(o[n]=i.matches)&&(a=1),i.addListener?i.addListener(Ic):i.addEventListener("change",Ic));return a&&e(s,function(t){return s.add(null,t)}),this},Se.revert=function revert(t){this.kill(t||{})},Se.kill=function kill(e){this.contexts.forEach(function(t){return t.kill(e,!0)})},MatchMedia);function MatchMedia(t){this.contexts=[],this.scope=t,l&&l.data.push(this)}var Re={registerPlugin:function registerPlugin(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];e.forEach(function(t){return zb(t)})},timeline:function timeline(t){return new Zt(t)},getTweensOf:function getTweensOf(t,e){return L.getTweensOf(t,e)},getProperty:function getProperty(i,t,e,n){r(i)&&(i=Pt(i)[0]);var a=ha(i||{}).get,s=e?sa:ra;return"native"===e&&(e=""),i?t?s((mt[t]&&mt[t].get||a)(i,t,e,n)):function(t,e,r){return s((mt[t]&&mt[t].get||a)(i,t,e,r))}:i},quickSetter:function quickSetter(r,e,i){if(1<(r=Pt(r)).length){var n=r.map(function(t){return Fe.quickSetter(t,e,i)}),a=n.length;return function(t){for(var e=a;e--;)n[e](t)}}r=r[0]||{};var s=mt[e],o=ha(r),u=o.harness&&(o.harness.aliases||{})[e]||e,h=s?function(t){var e=new s;d._pt=0,e.init(r,i?t+i:t,d,0,[r]),e.render(1,e),d._pt&&ve(1,d)}:o.set(r,u);return s?h:function(t){return h(r,u,i?t+i:t,o,1)}},quickTo:function quickTo(t,i,e){function by(t,e,r){return n.resetTo(i,t,e,r)}var r,n=Fe.to(t,ta(((r={})[i]="+=0.1",r.paused=!0,r.stagger=0,r),e||{}));return by.tween=n,by},isTweening:function isTweening(t){return 0<L.getTweensOf(t,!0).length},defaults:function defaults(t){return t&&t.ease&&(t.ease=Vt(t.ease,j.ease)),wa(j,t||{})},config:function config(t){return wa(N,t||{})},registerEffect:function registerEffect(t){var i=t.name,n=t.effect,e=t.plugins,a=t.defaults,r=t.extendTimeline;(e||"").split(",").forEach(function(t){return t&&!mt[t]&&!ht[t]&&T(i+" effect requires "+t+" plugin.")}),gt[i]=function(t,e,r){return n(Pt(t),ta(e||{},a),r)},r&&(Zt.prototype[i]=function(t,e,r){return this.add(gt[i](t,v(e)?e:(r=e)&&{},this),r)})},registerEase:function registerEase(t,e){Bt[t]=Vt(e)},parseEase:function parseEase(t,e){return arguments.length?Vt(t,e):Bt},getById:function getById(t){return L.getById(t)},exportRoot:function exportRoot(t,e){void 0===t&&(t={});var r,i,n=new Zt(t);for(n.smoothChildTiming=w(t.smoothChildTiming),L.remove(n),n._dp=0,n._time=n._tTime=L._time,r=L._first;r;)i=r._next,!e&&!r._dur&&r instanceof te&&r.vars.onComplete===r._targets[0]||Na(n,r,r._start-r._delay),r=i;return Na(L,n,0),n},context:function context(t,e){return t?new De(t,e):l},matchMedia:function matchMedia(t){return new Ee(t)},matchMediaRefresh:function matchMediaRefresh(){return ke.forEach(function(t){var e,r,i=t.conditions;for(r in i)i[r]&&(i[r]=!1,e=1);e&&t.revert()})||Ic()},addEventListener:function addEventListener(t,e){var r=Oe[t]||(Oe[t]=[]);~r.indexOf(e)||r.push(e)},removeEventListener:function removeEventListener(t,e){var r=Oe[t],i=r&&r.indexOf(e);0<=i&&r.splice(i,1)},utils:{wrap:function wrap(e,t,r){var i=t-e;return $(e)?ob(e,wrap(0,e.length),t):Za(r,function(t){return(i+(t-e)%i)%i+e})},wrapYoyo:function wrapYoyo(e,t,r){var i=t-e,n=2*i;return $(e)?ob(e,wrapYoyo(0,e.length-1),t):Za(r,function(t){return e+(i<(t=(n+(t-e)%n)%n||0)?n-t:t)})},distribute:hb,random:kb,snap:jb,normalize:function normalize(t,e,r){return At(t,e,0,1,r)},getUnit:_a,clamp:function clamp(e,r,t){return Za(t,function(t){return Mt(e,r,t)})},splitColor:Db,toArray:Pt,selector:fb,mapRange:At,pipe:function pipe(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];return function(t){return e.reduce(function(t,e){return e(t)},t)}},unitize:function unitize(e,r){return function(t){return e(parseFloat(t))+(r||_a(t))}},interpolate:function interpolate(e,i,t,n){var a=isNaN(e+i)?0:function(t){return(1-t)*e+t*i};if(!a){var s,o,u,h,l,f=r(e),d={};if(!0===t&&(n=1)&&(t=null),f)e={p:e},i={p:i};else if($(e)&&!$(i)){for(u=[],h=e.length,l=h-2,o=1;o<h;o++)u.push(interpolate(e[o-1],e[o]));h--,a=function func(t){t*=h;var e=Math.min(l,~~t);return u[e](t-e)},t=i}else n||(e=bt($(e)?[]:{},e));if(!u){for(s in i)Jt.call(d,e,s,"get",i[s]);a=function func(t){return ve(t,d)||(f?e.p:e)}}}return Za(t,a)},shuffle:gb},install:R,effects:gt,ticker:It,updateRoot:Zt.updateRoot,plugins:mt,globalTimeline:L,core:{PropTween:we,globals:U,Tween:te,Timeline:Zt,Animation:qt,getCache:ha,_removeLinkedListItem:Ba,reverting:function reverting(){return I},context:function context(t){return t&&l&&(l.data.push(t),t._ctx=l),l},suppressOverwrites:function suppressOverwrites(t){return F=t}}};ja("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return Re[t]=te[t]}),It.add(Zt.updateRoot),d=Re.to({},{duration:0});function Mc(t,e){for(var r=t._pt;r&&r.p!==e&&r.op!==e&&r.fp!==e;)r=r._next;return r}function Oc(t,a){return{name:t,headless:1,rawVars:1,init:function init(t,n,e){e._onInit=function(t){var e,i;if(r(n)&&(e={},ja(n,function(t){return e[t]=1}),n=e),a){for(i in e={},n)e[i]=a(n[i]);n=e}!function _addModifiers(t,e){var r,i,n,a=t._targets;for(r in e)for(i=a.length;i--;)(n=(n=t._ptLookup[i][r])&&n.d)&&(n._pt&&(n=Mc(n,r)),n&&n.modifier&&n.modifier(e[r],t,a[i],r))}(t,n)}}}}var Fe=Re.registerPlugin({name:"attr",init:function init(t,e,r,i,n){var a,s,o;for(a in this.tween=r,e)o=t.getAttribute(a)||"",(s=this.add(t,"setAttribute",(o||0)+"",e[a],i,n,0,0,a)).op=a,s.b=o,this._props.push(a)},render:function render(t,e){for(var r=e._pt;r;)I?r.set(r.t,r.p,r.b,r):r.r(t,r.d),r=r._next}},{name:"endArray",headless:1,init:function init(t,e){for(var r=e.length;r--;)this.add(t,r,t[r]||0,e[r],0,0,0,0,0,1)}},Oc("roundProps",ib),Oc("modifiers"),Oc("snap",jb))||Re;te.version=Zt.version=Fe.version="3.14.2",o=1,x()&&Lt();function yd(t,e){return e.set(e.t,e.p,Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function zd(t,e){return e.set(e.t,e.p,1===t?e.e:Math.round(1e4*(e.s+e.c*t))/1e4+e.u,e)}function Ad(t,e){return e.set(e.t,e.p,t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Bd(t,e){return e.set(e.t,e.p,1===t?e.e:t?Math.round(1e4*(e.s+e.c*t))/1e4+e.u:e.b,e)}function Cd(t,e){var r=e.s+e.c*t;e.set(e.t,e.p,~~(r+(r<0?-.5:.5))+e.u,e)}function Dd(t,e){return e.set(e.t,e.p,t?e.e:e.b,e)}function Ed(t,e){return e.set(e.t,e.p,1!==t?e.b:e.e,e)}function Fd(t,e,r){return t.style[e]=r}function Gd(t,e,r){return t.style.setProperty(e,r)}function Hd(t,e,r){return t._gsap[e]=r}function Id(t,e,r){return t._gsap.scaleX=t._gsap.scaleY=r}function Jd(t,e,r,i,n){var a=t._gsap;a.scaleX=a.scaleY=r,a.renderTransform(n,a)}function Kd(t,e,r,i,n){var a=t._gsap;a[e]=r,a.renderTransform(n,a)}function Nd(t,e){var r=this,i=this.target,n=i.style,a=i._gsap;if(t in hr&&n){if(this.tfm=this.tfm||{},"transform"===t)return mr.transform.split(",").forEach(function(t){return Nd.call(r,t,e)});if(~(t=mr[t]||t).indexOf(",")?t.split(",").forEach(function(t){return r.tfm[t]=xr(i,t)}):this.tfm[t]=a.x?a[t]:xr(i,t),t===vr&&(this.tfm.zOrigin=a.zOrigin),0<=this.props.indexOf(gr))return;a.svg&&(this.svgo=i.getAttribute("data-svg-origin"),this.props.push(vr,e,"")),t=gr}(n||e)&&this.props.push(t,e,n[t])}function Od(t){t.translate&&(t.removeProperty("translate"),t.removeProperty("scale"),t.removeProperty("rotate"))}function Pd(){var t,e,r=this.props,i=this.target,n=i.style,a=i._gsap;for(t=0;t<r.length;t+=3)r[t+1]?2===r[t+1]?i[r[t]](r[t+2]):i[r[t]]=r[t+2]:r[t+2]?n[r[t]]=r[t+2]:n.removeProperty("--"===r[t].substr(0,2)?r[t]:r[t].replace(cr,"-$1").toLowerCase());if(this.tfm){for(e in this.tfm)a[e]=this.tfm[e];a.svg&&(a.renderTransform(),i.setAttribute("data-svg-origin",this.svgo||"")),(t=Ue())&&t.isStart||n[gr]||(Od(n),a.zOrigin&&n[vr]&&(n[vr]+=" "+a.zOrigin+"px",a.zOrigin=0,a.renderTransform()),a.uncache=1)}}function Qd(t,e){var r={target:t,props:[],revert:Pd,save:Nd};return t._gsap||Fe.core.getCache(t),e&&t.style&&t.nodeType&&e.split(",").forEach(function(t){return r.save(t)}),r}function Sd(t,e){var r=Le.createElementNS?Le.createElementNS((e||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):Le.createElement(t);return r&&r.style?r:Le.createElement(t)}function Td(t,e,r){var i=getComputedStyle(t);return i[e]||i.getPropertyValue(e.replace(cr,"-$1").toLowerCase())||i.getPropertyValue(e)||!r&&Td(t,Tr(e)||e,1)||""}function Wd(){(function _windowExists(){return"undefined"!=typeof window})()&&window.document&&(Ie=window,Le=Ie.document,Ye=Le.documentElement,je=Sd("div")||{style:{}},Sd("div"),gr=Tr(gr),vr=gr+"Origin",je.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",Xe=!!Tr("perspective"),Ue=Fe.core.reverting,Ne=1)}function Xd(t){var e,r=t.ownerSVGElement,i=Sd("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),n=t.cloneNode(!0);n.style.display="block",i.appendChild(n),Ye.appendChild(i);try{e=n.getBBox()}catch(t){}return i.removeChild(n),Ye.removeChild(i),e}function Yd(t,e){for(var r=e.length;r--;)if(t.hasAttribute(e[r]))return t.getAttribute(e[r])}function Zd(e){var r,i;try{r=e.getBBox()}catch(t){r=Xd(e),i=1}return r&&(r.width||r.height)||i||(r=Xd(e)),!r||r.width||r.x||r.y?r:{x:+Yd(e,["x","cx","x1"])||0,y:+Yd(e,["y","cy","y1"])||0,width:0,height:0}}function $d(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Zd(t))}function _d(t,e){if(e){var r,i=t.style;e in hr&&e!==vr&&(e=gr),i.removeProperty?("ms"!==(r=e.substr(0,2))&&"webkit"!==e.substr(0,6)||(e="-"+e),i.removeProperty("--"===r?e:e.replace(cr,"-$1").toLowerCase())):i.removeAttribute(e)}}function ae(t,e,r,i,n,a){var s=new we(t._pt,e,r,0,1,a?Ed:Dd);return(t._pt=s).b=i,s.e=n,t._props.push(r),s}function de(t,e,r,i){var n,a,s,o,u=parseFloat(r)||0,h=(r+"").trim().substr((u+"").length)||"px",l=je.style,f=pr.test(e),d="svg"===t.tagName.toLowerCase(),c=(d?"client":"offset")+(f?"Width":"Height"),p="px"===i,_="%"===i;if(i===h||!u||br[i]||br[h])return u;if("px"===h||p||(u=de(t,e,r,"px")),o=t.getCTM&&$d(t),(_||"%"===h)&&(hr[e]||~e.indexOf("adius")))return n=o?t.getBBox()[f?"width":"height"]:t[c],ka(_?u/n*100:u/100*n);if(l[f?"width":"height"]=100+(p?h:i),a="rem"!==i&&~e.indexOf("adius")||"em"===i&&t.appendChild&&!d?t:t.parentNode,o&&(a=(t.ownerSVGElement||{}).parentNode),a&&a!==Le&&a.appendChild||(a=Le.body),(s=a._gsap)&&_&&s.width&&f&&s.time===It.time&&!s.uncache)return ka(u/s.width*100);if(!_||"height"!==e&&"width"!==e)!_&&"%"!==h||wr[Td(a,"display")]||(l.position=Td(t,"position")),a===t&&(l.position="static"),a.appendChild(je),n=je[c],a.removeChild(je),l.position="absolute";else{var m=t.style[e];t.style[e]=100+i,n=t[c],m?t.style[e]=m:_d(t,e)}return f&&_&&((s=ha(a)).time=It.time,s.width=a[c]),ka(p?n*u/100:n&&u?100/n*u:0)}function fe(t,e,r,i){if(!r||"none"===r){var n=Tr(e,t,1),a=n&&Td(t,n,1);a&&a!==r?(e=n,r=a):"borderColor"===e&&(r=Td(t,"borderTopColor"))}var s,o,u,h,l,f,d,c,p,_,m,g=new we(this._pt,t.style,e,0,1,ge),v=0,y=0;if(g.b=r,g.e=i,r+="","var(--"===(i+="").substring(0,6)&&(i=Td(t,i.substring(4,i.indexOf(")")))),"auto"===i&&(f=t.style[e],t.style[e]=i,i=Td(t,e)||i,f?t.style[e]=f:_d(t,e)),Ib(s=[r,i]),i=s[1],u=(r=s[0]).match(nt)||[],(i.match(nt)||[]).length){for(;o=nt.exec(i);)d=o[0],p=i.substring(v,o.index),l?l=(l+1)%5:"rgba("!==p.substr(-5)&&"hsla("!==p.substr(-5)||(l=1),d!==(f=u[y++]||"")&&(h=parseFloat(f)||0,m=f.substr((h+"").length),"="===d.charAt(1)&&(d=ma(h,d)+m),c=parseFloat(d),_=d.substr((c+"").length),v=nt.lastIndex-_.length,_||(_=_||N.units[e]||m,v===i.length&&(i+=_,g.e+=_)),m!==_&&(h=de(t,e,f,_)||0),g._pt={_next:g._pt,p:p||1===y?p:",",s:h,c:c-h,m:l&&l<4||"zIndex"===e?Math.round:0});g.c=v<i.length?i.substring(v,i.length):""}else g.r="display"===e&&"none"===i?Ed:Dd;return st.test(i)&&(g.e=0),this._pt=g}function he(t){var e=t.split(" "),r=e[0],i=e[1]||"50%";return"top"!==r&&"bottom"!==r&&"left"!==i&&"right"!==i||(t=r,r=i,i=t),e[0]=kr[r]||r,e[1]=kr[i]||i,e.join(" ")}function ie(t,e){if(e.tween&&e.tween._time===e.tween._dur){var r,i,n,a=e.t,s=a.style,o=e.u,u=a._gsap;if("all"===o||!0===o)s.cssText="",i=1;else for(n=(o=o.split(",")).length;-1<--n;)r=o[n],hr[r]&&(i=1,r="transformOrigin"===r?vr:gr),_d(a,r);i&&(_d(a,gr),u&&(u.svg&&a.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",Pr(a,1),u.uncache=1,Od(s)))}}function me(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t}function ne(t){var e=Td(t,gr);return me(e)?Mr:e.substr(7).match(it).map(ka)}function oe(t,e){var r,i,n,a,s=t._gsap||ha(t),o=t.style,u=ne(t);return s.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(u=[(n=t.transform.baseVal.consolidate().matrix).a,n.b,n.c,n.d,n.e,n.f]).join(",")?Mr:u:(u!==Mr||t.offsetParent||t===Ye||s.svg||(n=o.display,o.display="block",(r=t.parentNode)&&(t.offsetParent||t.getBoundingClientRect().width)||(a=1,i=t.nextElementSibling,Ye.appendChild(t)),u=ne(t),n?o.display=n:_d(t,"display"),a&&(i?r.insertBefore(t,i):r?r.appendChild(t):Ye.removeChild(t))),e&&6<u.length?[u[0],u[1],u[4],u[5],u[12],u[13]]:u)}function pe(t,e,r,i,n,a){var s,o,u,h=t._gsap,l=n||oe(t,!0),f=h.xOrigin||0,d=h.yOrigin||0,c=h.xOffset||0,p=h.yOffset||0,_=l[0],m=l[1],g=l[2],v=l[3],y=l[4],T=l[5],b=e.split(" "),w=parseFloat(b[0])||0,x=parseFloat(b[1])||0;r?l!==Mr&&(o=_*v-m*g)&&(u=w*(-m/o)+x*(_/o)-(_*T-m*y)/o,w=w*(v/o)+x*(-g/o)+(g*T-v*y)/o,x=u):(w=(s=Zd(t)).x+(~b[0].indexOf("%")?w/100*s.width:w),x=s.y+(~(b[1]||b[0]).indexOf("%")?x/100*s.height:x)),i||!1!==i&&h.smooth?(y=w-f,T=x-d,h.xOffset=c+(y*_+T*g)-y,h.yOffset=p+(y*m+T*v)-T):h.xOffset=h.yOffset=0,h.xOrigin=w,h.yOrigin=x,h.smooth=!!i,h.origin=e,h.originIsAbsolute=!!r,t.style[vr]="0px 0px",a&&(ae(a,h,"xOrigin",f,w),ae(a,h,"yOrigin",d,x),ae(a,h,"xOffset",c,h.xOffset),ae(a,h,"yOffset",p,h.yOffset)),t.setAttribute("data-svg-origin",w+" "+x)}function se(t,e,r){var i=_a(e);return ka(parseFloat(e)+parseFloat(de(t,"x",r+"px",i)))+i}function ze(t,e,i,n,a){var s,o,u=360,h=r(a),l=parseFloat(a)*(h&&~a.indexOf("rad")?lr:1)-n,f=n+l+"deg";return h&&("short"===(s=a.split("_")[1])&&(l%=u)!==l%180&&(l+=l<0?u:-u),"cw"===s&&l<0?l=(l+36e9)%u-~~(l/u)*u:"ccw"===s&&0<l&&(l=(l-36e9)%u-~~(l/u)*u)),t._pt=o=new we(t._pt,e,i,n,l,zd),o.e=f,o.u="deg",t._props.push(i),o}function Ae(t,e){for(var r in e)t[r]=e[r];return t}function Be(t,e,r){var i,n,a,s,o,u,h,l=Ae({},r._gsap),f=r.style;for(n in l.svg?(a=r.getAttribute("transform"),r.setAttribute("transform",""),f[gr]=e,i=Pr(r,1),_d(r,gr),r.setAttribute("transform",a)):(a=getComputedStyle(r)[gr],f[gr]=e,i=Pr(r,1),f[gr]=a),hr)(a=l[n])!==(s=i[n])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(n)<0&&(o=_a(a)!==(h=_a(s))?de(r,n,a,h):parseFloat(a),u=parseFloat(s),t._pt=new we(t._pt,i,n,o,u-o,yd),t._pt.u=h||0,t._props.push(n));Ae(i,l)}var Ie,Le,Ye,Ne,je,Ve,Ue,Xe,qe=Bt.Power0,Ze=Bt.Power1,We=Bt.Power2,He=Bt.Power3,Je=Bt.Power4,Qe=Bt.Linear,Ge=Bt.Quad,Ke=Bt.Cubic,$e=Bt.Quart,tr=Bt.Quint,er=Bt.Strong,rr=Bt.Elastic,ir=Bt.Back,nr=Bt.SteppedEase,ar=Bt.Bounce,sr=Bt.Sine,or=Bt.Expo,ur=Bt.Circ,hr={},lr=180/Math.PI,fr=Math.PI/180,dr=Math.atan2,cr=/([A-Z])/g,pr=/(left|right|width|margin|padding|x)/i,_r=/[\s,\(]\S/,mr={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},gr="transform",vr=gr+"Origin",yr="O,Moz,ms,Ms,Webkit".split(","),Tr=function _checkPropPrefix(t,e,r){var i=(e||je).style,n=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);n--&&!(yr[n]+t in i););return n<0?null:(3===n?"ms":0<=n?yr[n]:"")+t},br={deg:1,rad:1,turn:1},wr={grid:1,flex:1},xr=function _get(t,e,r,i){var n;return Ne||Wd(),e in mr&&"transform"!==e&&~(e=mr[e]).indexOf(",")&&(e=e.split(",")[0]),hr[e]&&"transform"!==e?(n=Pr(t,i),n="transformOrigin"!==e?n[e]:n.svg?n.origin:Ar(Td(t,vr))+" "+n.zOrigin+"px"):(n=t.style[e])&&"auto"!==n&&!i&&!~(n+"").indexOf("calc(")||(n=Or[e]&&Or[e](t,e,r)||Td(t,e)||ia(t,e)||("opacity"===e?1:0)),r&&!~(n+"").trim().indexOf(" ")?de(t,e,n,r)+r:n},kr={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},Or={clearProps:function clearProps(t,e,r,i,n){if("isFromStart"!==n.data){var a=t._pt=new we(t._pt,e,r,0,0,ie);return a.u=i,a.pr=-10,a.tween=n,t._props.push(r),1}}},Mr=[1,0,0,1,0,0],Cr={},Pr=function _parseTransform(t,e){var r=t._gsap||new Xt(t);if("x"in r&&!e&&!r.uncache)return r;var i,n,a,s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x,k,O,M,C,P,A,D,S,z,E,R,F=t.style,I=r.scaleX<0,L="deg",B=getComputedStyle(t),Y=Td(t,vr)||"0";return i=n=a=u=h=l=f=d=c=0,s=o=1,r.svg=!(!t.getCTM||!$d(t)),B.translate&&("none"===B.translate&&"none"===B.scale&&"none"===B.rotate||(F[gr]=("none"!==B.translate?"translate3d("+(B.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+("none"!==B.rotate?"rotate("+B.rotate+") ":"")+("none"!==B.scale?"scale("+B.scale.split(" ").join(",")+") ":"")+("none"!==B[gr]?B[gr]:"")),F.scale=F.rotate=F.translate="none"),m=oe(t,r.svg),r.svg&&(M=r.uncache?(C=t.getBBox(),Y=r.xOrigin-C.x+"px "+(r.yOrigin-C.y)+"px",""):!e&&t.getAttribute("data-svg-origin"),pe(t,M||Y,!!M||r.originIsAbsolute,!1!==r.smooth,m)),p=r.xOrigin||0,_=r.yOrigin||0,m!==Mr&&(T=m[0],b=m[1],w=m[2],x=m[3],i=k=m[4],n=O=m[5],6===m.length?(s=Math.sqrt(T*T+b*b),o=Math.sqrt(x*x+w*w),u=T||b?dr(b,T)*lr:0,(f=w||x?dr(w,x)*lr+u:0)&&(o*=Math.abs(Math.cos(f*fr))),r.svg&&(i-=p-(p*T+_*w),n-=_-(p*b+_*x))):(R=m[6],z=m[7],A=m[8],D=m[9],S=m[10],E=m[11],i=m[12],n=m[13],a=m[14],h=(g=dr(R,S))*lr,g&&(M=k*(v=Math.cos(-g))+A*(y=Math.sin(-g)),C=O*v+D*y,P=R*v+S*y,A=k*-y+A*v,D=O*-y+D*v,S=R*-y+S*v,E=z*-y+E*v,k=M,O=C,R=P),l=(g=dr(-w,S))*lr,g&&(v=Math.cos(-g),E=x*(y=Math.sin(-g))+E*v,T=M=T*v-A*y,b=C=b*v-D*y,w=P=w*v-S*y),u=(g=dr(b,T))*lr,g&&(M=T*(v=Math.cos(g))+b*(y=Math.sin(g)),C=k*v+O*y,b=b*v-T*y,O=O*v-k*y,T=M,k=C),h&&359.9<Math.abs(h)+Math.abs(u)&&(h=u=0,l=180-l),s=ka(Math.sqrt(T*T+b*b+w*w)),o=ka(Math.sqrt(O*O+R*R)),g=dr(k,O),f=2e-4<Math.abs(g)?g*lr:0,c=E?1/(E<0?-E:E):0),r.svg&&(M=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!me(Td(t,gr)),M&&t.setAttribute("transform",M))),90<Math.abs(f)&&Math.abs(f)<270&&(I?(s*=-1,f+=u<=0?180:-180,u+=u<=0?180:-180):(o*=-1,f+=f<=0?180:-180)),e=e||r.uncache,r.x=i-((r.xPercent=i&&(!e&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+"px",r.y=n-((r.yPercent=n&&(!e&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-n)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+"px",r.z=a+"px",r.scaleX=ka(s),r.scaleY=ka(o),r.rotation=ka(u)+L,r.rotationX=ka(h)+L,r.rotationY=ka(l)+L,r.skewX=f+L,r.skewY=d+L,r.transformPerspective=c+"px",(r.zOrigin=parseFloat(Y.split(" ")[2])||!e&&r.zOrigin||0)&&(F[vr]=Ar(Y)),r.xOffset=r.yOffset=0,r.force3D=N.force3D,r.renderTransform=r.svg?Fr:Xe?Rr:Dr,r.uncache=0,r},Ar=function _firstTwoOnly(t){return(t=t.split(" "))[0]+" "+t[1]},Dr=function _renderNon3DTransforms(t,e){e.z="0px",e.rotationY=e.rotationX="0deg",e.force3D=0,Rr(t,e)},Sr="0deg",zr="0px",Er=") ",Rr=function _renderCSSTransforms(t,e){var r=e||this,i=r.xPercent,n=r.yPercent,a=r.x,s=r.y,o=r.z,u=r.rotation,h=r.rotationY,l=r.rotationX,f=r.skewX,d=r.skewY,c=r.scaleX,p=r.scaleY,_=r.transformPerspective,m=r.force3D,g=r.target,v=r.zOrigin,y="",T="auto"===m&&t&&1!==t||!0===m;if(v&&(l!==Sr||h!==Sr)){var b,w=parseFloat(h)*fr,x=Math.sin(w),k=Math.cos(w);w=parseFloat(l)*fr,b=Math.cos(w),a=se(g,a,x*b*-v),s=se(g,s,-Math.sin(w)*-v),o=se(g,o,k*b*-v+v)}_!==zr&&(y+="perspective("+_+Er),(i||n)&&(y+="translate("+i+"%, "+n+"%) "),!T&&a===zr&&s===zr&&o===zr||(y+=o!==zr||T?"translate3d("+a+", "+s+", "+o+") ":"translate("+a+", "+s+Er),u!==Sr&&(y+="rotate("+u+Er),h!==Sr&&(y+="rotateY("+h+Er),l!==Sr&&(y+="rotateX("+l+Er),f===Sr&&d===Sr||(y+="skew("+f+", "+d+Er),1===c&&1===p||(y+="scale("+c+", "+p+Er),g.style[gr]=y||"translate(0, 0)"},Fr=function _renderSVGTransforms(t,e){var r,i,n,a,s,o=e||this,u=o.xPercent,h=o.yPercent,l=o.x,f=o.y,d=o.rotation,c=o.skewX,p=o.skewY,_=o.scaleX,m=o.scaleY,g=o.target,v=o.xOrigin,y=o.yOrigin,T=o.xOffset,b=o.yOffset,w=o.forceCSS,x=parseFloat(l),k=parseFloat(f);d=parseFloat(d),c=parseFloat(c),(p=parseFloat(p))&&(c+=p=parseFloat(p),d+=p),d||c?(d*=fr,c*=fr,r=Math.cos(d)*_,i=Math.sin(d)*_,n=Math.sin(d-c)*-m,a=Math.cos(d-c)*m,c&&(p*=fr,s=Math.tan(c-p),n*=s=Math.sqrt(1+s*s),a*=s,p&&(s=Math.tan(p),r*=s=Math.sqrt(1+s*s),i*=s)),r=ka(r),i=ka(i),n=ka(n),a=ka(a)):(r=_,a=m,i=n=0),(x&&!~(l+"").indexOf("px")||k&&!~(f+"").indexOf("px"))&&(x=de(g,"x",l,"px"),k=de(g,"y",f,"px")),(v||y||T||b)&&(x=ka(x+v-(v*r+y*n)+T),k=ka(k+y-(v*i+y*a)+b)),(u||h)&&(s=g.getBBox(),x=ka(x+u/100*s.width),k=ka(k+h/100*s.height)),s="matrix("+r+","+i+","+n+","+a+","+x+","+k+")",g.setAttribute("transform",s),w&&(g.style[gr]=s)};ja("padding,margin,Width,Radius",function(e,r){var t="Right",i="Bottom",n="Left",o=(r<3?["Top",t,i,n]:["Top"+n,"Top"+t,i+t,i+n]).map(function(t){return r<2?e+t:"border"+t+e});Or[1<r?"border"+e:e]=function(e,t,r,i,n){var a,s;if(arguments.length<4)return a=o.map(function(t){return xr(e,t,r)}),5===(s=a.join(" ")).split(a[0]).length?a[0]:s;a=(i+"").split(" "),s={},o.forEach(function(t,e){return s[t]=a[e]=a[e]||a[(e-1)/2|0]}),e.init(t,s,n)}});var Ir,Lr,Br,Yr={name:"css",register:Wd,targetTest:function targetTest(t){return t.style&&t.nodeType},init:function init(t,e,i,n,a){var s,o,u,h,l,f,d,c,p,_,m,g,v,y,T,b,w,x=this._props,k=t.style,O=i.vars.startAt;for(d in Ne||Wd(),this.styles=this.styles||Qd(t),b=this.styles.props,this.tween=i,e)if("autoRound"!==d&&(o=e[d],!mt[d]||!dc(d,e,i,n,t,a)))if(l=typeof o,f=Or[d],"function"===l&&(l=typeof(o=o.call(i,n,t,a))),"string"===l&&~o.indexOf("random(")&&(o=rb(o)),f)f(this,t,d,o,i)&&(T=1);else if("--"===d.substr(0,2))s=(getComputedStyle(t).getPropertyValue(d)+"").trim(),o+="",Rt.lastIndex=0,Rt.test(s)||(c=_a(s),(p=_a(o))?c!==p&&(s=de(t,d,s,p)+p):c&&(o+=c)),this.add(k,"setProperty",s,o,n,a,0,0,d),x.push(d),b.push(d,0,k[d]);else if("undefined"!==l){if(O&&d in O?(s="function"==typeof O[d]?O[d].call(i,n,t,a):O[d],r(s)&&~s.indexOf("random(")&&(s=rb(s)),_a(s+"")||"auto"===s||(s+=N.units[d]||_a(xr(t,d))||""),"="===(s+"").charAt(1)&&(s=xr(t,d))):s=xr(t,d),h=parseFloat(s),(_="string"===l&&"="===o.charAt(1)&&o.substr(0,2))&&(o=o.substr(2)),u=parseFloat(o),d in mr&&("autoAlpha"===d&&(1===h&&"hidden"===xr(t,"visibility")&&u&&(h=0),b.push("visibility",0,k.visibility),ae(this,k,"visibility",h?"inherit":"hidden",u?"inherit":"hidden",!u)),"scale"!==d&&"transform"!==d&&~(d=mr[d]).indexOf(",")&&(d=d.split(",")[0])),m=d in hr){if(this.styles.save(d),w=o,"string"===l&&"var(--"===o.substring(0,6)){if("calc("===(o=Td(t,o.substring(4,o.indexOf(")")))).substring(0,5)){var M=t.style.perspective;t.style.perspective=o,o=Td(t,"perspective"),M?t.style.perspective=M:_d(t,"perspective")}u=parseFloat(o)}if(g||((v=t._gsap).renderTransform&&!e.parseTransform||Pr(t,e.parseTransform),y=!1!==e.smoothOrigin&&v.smooth,(g=this._pt=new we(this._pt,k,gr,0,1,v.renderTransform,v,0,-1)).dep=1),"scale"===d)this._pt=new we(this._pt,v,"scaleY",v.scaleY,(_?ma(v.scaleY,_+u):u)-v.scaleY||0,yd),this._pt.u=0,x.push("scaleY",d),d+="X";else{if("transformOrigin"===d){b.push(vr,0,k[vr]),o=he(o),v.svg?pe(t,o,0,y,0,this):((p=parseFloat(o.split(" ")[2])||0)!==v.zOrigin&&ae(this,v,"zOrigin",v.zOrigin,p),ae(this,k,d,Ar(s),Ar(o)));continue}if("svgOrigin"===d){pe(t,o,1,y,0,this);continue}if(d in Cr){ze(this,v,d,h,_?ma(h,_+o):o);continue}if("smoothOrigin"===d){ae(this,v,"smooth",v.smooth,o);continue}if("force3D"===d){v[d]=o;continue}if("transform"===d){Be(this,o,t);continue}}}else d in k||(d=Tr(d)||d);if(m||(u||0===u)&&(h||0===h)&&!_r.test(o)&&d in k)u=u||0,(c=(s+"").substr((h+"").length))!==(p=_a(o)||(d in N.units?N.units[d]:c))&&(h=de(t,d,s,p)),this._pt=new we(this._pt,m?v:k,d,h,(_?ma(h,_+u):u)-h,m||"px"!==p&&"zIndex"!==d||!1===e.autoRound?yd:Cd),this._pt.u=p||0,m&&w!==o?(this._pt.b=s,this._pt.e=w,this._pt.r=Bd):c!==p&&"%"!==p&&(this._pt.b=s,this._pt.r=Ad);else if(d in k)fe.call(this,t,d,s,_?_+o:o);else if(d in t)this.add(t,d,s||t[d],_?_+o:o,n,a);else if("parseTransform"!==d){S(d,o);continue}m||(d in k?b.push(d,0,k[d]):"function"==typeof t[d]?b.push(d,2,t[d]()):b.push(d,1,s||t[d])),x.push(d)}T&&be(this)},render:function render(t,e){if(e.tween._time||!Ue())for(var r=e._pt;r;)r.r(t,r.d),r=r._next;else e.styles.revert()},get:xr,aliases:mr,getSetter:function getSetter(t,e,r){var i=mr[e];return i&&i.indexOf(",")<0&&(e=i),e in hr&&e!==vr&&(t._gsap.x||xr(t,"x"))?r&&Ve===r?"scale"===e?Id:Hd:(Ve=r||{})&&("scale"===e?Jd:Kd):t.style&&!u(t.style[e])?Fd:~e.indexOf("-")?Gd:le(t,e)},core:{_removeProperty:_d,_getMatrix:oe}};Fe.utils.checkPrefix=Tr,Fe.core.getStyleSaver=Qd,Br=ja((Ir="x,y,z,scale,scaleX,scaleY,xPercent,yPercent")+","+(Lr="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",function(t){hr[t]=1}),ja(Lr,function(t){N.units[t]="deg",Cr[t]=1}),mr[Br[13]]=Ir+","+Lr,ja("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",function(t){var e=t.split(":");mr[e[1]]=Br[e[0]]}),ja("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){N.units[t]="px"}),Fe.registerPlugin(Yr);var Nr=Fe.registerPlugin(Yr)||Fe,jr=Nr.core.Tween;e.Back=ir,e.Bounce=ar,e.CSSPlugin=Yr,e.Circ=ur,e.Cubic=Ke,e.Elastic=rr,e.Expo=or,e.Linear=Qe,e.Power0=qe,e.Power1=Ze,e.Power2=We,e.Power3=He,e.Power4=Je,e.Quad=Ge,e.Quart=$e,e.Quint=tr,e.Sine=sr,e.SteppedEase=nr,e.Strong=er,e.TimelineLite=Zt,e.TimelineMax=Zt,e.TweenLite=te,e.TweenMax=jr,e.default=Nr,e.gsap=Nr;if (typeof(window)==="undefined"||window!==e){Object.defineProperty(e,"__esModule",{value:!0})} else {delete e.default}});
+
diff --git a/public/assets/null-logo.png b/public/assets/null-logo.png
new file mode 100644
index 0000000..996e666
Binary files /dev/null and b/public/assets/null-logo.png differ
diff --git a/public/control-center.css b/public/control-center.css
new file mode 100644
index 0000000..4537f87
--- /dev/null
+++ b/public/control-center.css
@@ -0,0 +1,462 @@
+:root {
+ color-scheme: dark;
+ --cc-bg: #0d0d0f;
+ --cc-panel: #141417;
+ --cc-panel-2: #1b1b1f;
+ --cc-raised: #222228;
+ --cc-line: rgba(255, 255, 255, .09);
+ --cc-line-strong: rgba(255, 255, 255, .17);
+ --cc-text: #ececee;
+ --cc-muted: #8a8a92;
+ --cc-dim: #62626b;
+ --cc-silver: linear-gradient(135deg, #f2f2f2 0%, #b8b8bc 50%, #8c8c90 100%);
+ --cc-success: #63d58a;
+ --cc-warning: #f2c66d;
+ --cc-danger: #ef7a87;
+ --cc-info: #76d7ea;
+ --cc-ease: cubic-bezier(.16, 1, .3, 1);
+}
+
+* { box-sizing: border-box; }
+html { min-width: 320px; background: var(--cc-bg); }
+body {
+ min-height: 100vh;
+ margin: 0;
+ overflow-x: hidden;
+ background:
+ radial-gradient(920px 540px at 82% 0%, rgba(52, 111, 128, .10), transparent 64%),
+ radial-gradient(760px 520px at 13% 8%, rgba(89, 70, 117, .09), transparent 68%),
+ linear-gradient(180deg, #0d0d10 0%, #09090b 100%);
+ color: var(--cc-text);
+ font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+}
+body::before {
+ position: fixed;
+ z-index: -1;
+ inset: 0;
+ background-image: linear-gradient(rgba(255, 255, 255, .016) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, .016) 1px, transparent 1px);
+ background-size: 72px 72px;
+ opacity: .25;
+ mask-image: linear-gradient(to bottom, #000, transparent 76%);
+ pointer-events: none;
+ content: "";
+}
+button, input, textarea, select { font: inherit; }
+button, select { min-height: 44px; }
+button { -webkit-tap-highlight-color: transparent; }
+button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, [tabindex]:focus-visible {
+ outline: 2px solid rgba(118, 215, 234, .82);
+ outline-offset: 2px;
+}
+[hidden] { display: none !important; }
+
+.fallback-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+ min-height: 68px;
+ padding: 10px clamp(18px, 3vw, 44px);
+ border-bottom: 1px solid var(--cc-line);
+ background: rgba(9, 9, 12, .9);
+}
+.fallback-brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; }
+.fallback-brand img { width: 32px; height: 32px; border-radius: 10px; }
+.fallback-brand span { color: var(--cc-muted); }
+.fallback-header nav { display: flex; align-items: center; gap: 5px; overflow-x: auto; }
+.fallback-header nav a { min-height: 44px; padding: 13px 10px; color: var(--cc-muted); font-size: 12px; text-decoration: none; white-space: nowrap; }
+.fallback-header nav a[aria-current="page"] { color: var(--cc-text); }
+
+.control-page {
+ width: min(1640px, 100%);
+ margin: 0 auto;
+ padding: clamp(32px, 4.5vw, 72px) clamp(18px, 3.6vw, 58px) 90px;
+ transition: padding 240ms var(--cc-ease);
+}
+.control-hero {
+ display: grid;
+ grid-template-columns: minmax(0, 1fr) minmax(440px, .72fr);
+ align-items: end;
+ gap: clamp(36px, 5vw, 90px);
+ padding: 0 4px clamp(30px, 3.2vw, 48px);
+}
+.hero-copy { min-width: 0; }
+.eyebrow, .section-kicker {
+ color: #777b84;
+ font-size: 9px;
+ font-weight: 760;
+ letter-spacing: .17em;
+ text-transform: uppercase;
+}
+.eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
+.eyebrow::before { width: 28px; height: 1px; background: linear-gradient(90deg, #d5d5d8, transparent); box-shadow: 0 0 12px rgba(255, 255, 255, .22); content: ""; }
+.control-hero h1 {
+ max-width: 760px;
+ margin: 0;
+ background: var(--cc-silver);
+ color: transparent;
+ font-size: clamp(48px, 5.4vw, 84px);
+ font-weight: 590;
+ letter-spacing: -.065em;
+ line-height: .96;
+ background-clip: text;
+ -webkit-background-clip: text;
+}
+.control-hero p { max-width: 720px; margin: 20px 0 0; color: #94949d; font-size: clamp(14px, 1.2vw, 17px); line-height: 1.65; }
+.presence-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
+.presence-card {
+ display: grid;
+ grid-template-columns: 12px minmax(0, 1fr);
+ gap: 12px;
+ min-height: 112px;
+ padding: 18px;
+ border: 1px solid var(--cc-line);
+ border-radius: 16px;
+ background: linear-gradient(145deg, rgba(29, 29, 34, .86), rgba(14, 14, 18, .92));
+ box-shadow: inset 0 1px rgba(255, 255, 255, .045), 0 18px 44px rgba(0, 0, 0, .24);
+}
+.presence-icon { width: 8px; height: 8px; margin-top: 4px; border: 1px solid #777982; border-radius: 50%; background: #575a62; }
+.presence-card.is-checking .presence-icon { animation: pulse 1.35s ease-in-out infinite; }
+.presence-card.is-online .presence-icon { border-color: var(--cc-success); background: var(--cc-success); box-shadow: 0 0 12px rgba(99, 213, 138, .48); }
+.presence-card.is-offline .presence-icon { border-color: var(--cc-danger); background: var(--cc-danger); }
+.presence-card.is-idle .presence-icon { border-color: var(--cc-warning); background: var(--cc-warning); }
+.presence-card small, .presence-card strong, .presence-card div > span { display: block; }
+.presence-card small { color: var(--cc-dim); font-size: 9px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
+.presence-card strong { margin-top: 7px; color: #e4e4e8; font-size: 13px; font-weight: 660; }
+.presence-card div > span { margin-top: 5px; color: var(--cc-muted); font-size: 10px; line-height: 1.45; }
+
+.surface {
+ min-width: 0;
+ border: 1px solid var(--cc-line);
+ border-radius: 20px;
+ background: linear-gradient(145deg, rgba(23, 23, 27, .93), rgba(11, 11, 14, .96));
+ box-shadow: inset 0 1px rgba(255, 255, 255, .042), 0 24px 64px rgba(0, 0, 0, .24);
+}
+.surface-head { display: flex; min-width: 0; align-items: flex-end; justify-content: space-between; gap: 24px; }
+.surface-head.compact { align-items: center; }
+.surface-head h2, .surface-head h3 { margin: 5px 0 0; color: #e7e7e9; font-weight: 630; letter-spacing: -.025em; }
+.surface-head h2 { font-size: 18px; }
+.surface-head h3 { font-size: 15px; }
+.surface-head p { margin: 6px 0 0; color: var(--cc-muted); font-size: 11px; line-height: 1.45; }
+.sequence-console { padding: clamp(18px, 2.3vw, 30px); }
+.sequence-tools { display: flex; flex: 0 0 auto; align-items: end; gap: 9px; }
+.compact-field, .field { display: grid; min-width: 0; gap: 7px; }
+.compact-field > span, .field > span { color: #777780; font-size: 9px; font-weight: 720; letter-spacing: .11em; text-transform: uppercase; }
+.compact-field select { min-width: min(360px, 38vw); }
+select, input, textarea {
+ width: 100%;
+ min-width: 0;
+ border: 1px solid var(--cc-line);
+ border-radius: 10px;
+ outline: 0;
+ background: rgba(10, 10, 13, .76);
+ color: var(--cc-text);
+ transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
+}
+select, input { min-height: 44px; padding: 9px 11px; }
+textarea { min-height: 128px; padding: 12px 13px; resize: vertical; line-height: 1.58; }
+select:focus, input:focus, textarea:focus { border-color: rgba(118, 215, 234, .43); background: #111116; box-shadow: 0 0 0 3px rgba(118, 215, 234, .055); }
+input:disabled, select:disabled, textarea:disabled { opacity: .52; cursor: not-allowed; }
+.button, .text-button, .playback-controls button {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ min-height: 44px;
+ padding: 9px 14px;
+ border: 1px solid var(--cc-line);
+ border-radius: 10px;
+ background: #1b1b20;
+ color: #d7d7dc;
+ font-size: 11px;
+ font-weight: 680;
+ line-height: 1.2;
+ cursor: pointer;
+ transition: transform 150ms ease, border-color 150ms ease, background 150ms ease, color 150ms ease;
+}
+.button:hover:not(:disabled), .playback-controls button:hover:not(:disabled) { border-color: var(--cc-line-strong); background: #242429; color: #fff; transform: translateY(-1px); }
+.button:disabled, .playback-controls button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
+.button.primary { border-color: rgba(255, 255, 255, .44); background: var(--cc-silver); color: #101114; box-shadow: inset 0 1px rgba(255, 255, 255, .72), 0 8px 22px rgba(0, 0, 0, .26); }
+.button.primary:hover:not(:disabled) { background: linear-gradient(135deg, #fff, #c8c8cc 52%, #9b9ba0); color: #090a0c; }
+.button.warning { border-color: rgba(242, 198, 109, .28); color: #f4d391; background: rgba(117, 82, 24, .13); }
+.button.danger { border-color: rgba(239, 122, 135, .25); color: #f5a6af; background: rgba(103, 34, 43, .12); }
+.button.is-busy::before { width: 12px; height: 12px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .75s linear infinite; content: ""; }
+.icon-button span { font-size: 16px; font-weight: 400; }
+
+.inline-state {
+ display: grid;
+ grid-template-columns: 30px minmax(0, 1fr);
+ align-items: center;
+ gap: 12px;
+ margin-top: 20px;
+ padding: 13px 14px;
+ border: 1px solid var(--cc-line);
+ border-radius: 12px;
+ background: rgba(10, 10, 13, .55);
+}
+.inline-state[hidden] { display: none; }
+.state-mark { display: grid; width: 28px; height: 28px; place-items: center; border: 1px solid #393941; border-radius: 9px; background: #1a1a1f; }
+.inline-state.loading .state-mark::before { width: 12px; height: 12px; border: 1.5px solid #797982; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; content: ""; }
+.inline-state.error { border-color: rgba(239, 122, 135, .24); background: rgba(93, 28, 37, .12); }
+.inline-state.error .state-mark::before { color: var(--cc-danger); content: "!"; }
+.inline-state.empty .state-mark::before { color: var(--cc-muted); content: "—"; }
+.inline-state strong, .inline-state span { display: block; }
+.inline-state strong { color: #dcdce0; font-size: 11px; }
+.inline-state div span { margin-top: 3px; color: var(--cc-muted); font-size: 10px; line-height: 1.4; }
+
+.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; margin: 20px 0 0; }
+.summary-grid > div { min-width: 0; padding: 14px; border: 1px solid var(--cc-line); border-radius: 12px; background: rgba(9, 9, 12, .48); }
+.summary-grid dt { color: var(--cc-dim); font-size: 8px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
+.summary-grid dd { overflow: hidden; margin: 7px 0 0; color: #dedee2; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
+.timeline-figure { margin: 20px 0 0; padding: 16px; border: 1px solid var(--cc-line); border-radius: 14px; background: rgba(8, 8, 11, .5); }
+.timeline-figure figcaption { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
+.timeline-figure h3 { margin: 4px 0 0; font-size: 13px; }
+.timeline-figure figcaption > span { color: var(--cc-dim); font-size: 9px; }
+.timeline-ruler { display: grid; grid-template-columns: repeat(6, 1fr); padding: 0 4px 8px; color: #5e5e67; font: 8px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; }
+.timeline-ruler span:last-child { text-align: right; }
+.timeline-ruler span:not(:first-child):not(:last-child) { text-align: center; }
+.timeline-track { position: relative; min-height: 66px; overflow: hidden; border: 1px solid #292930; border-radius: 11px; background-image: linear-gradient(90deg, transparent calc(100% - 1px), rgba(255, 255, 255, .045) 100%); background-size: 20% 100%; transition: min-height 180ms var(--cc-ease); }
+.timeline-beat {
+ position: absolute;
+ top: calc(9px + var(--lane, 0) * 49px);
+ left: var(--left, 0%);
+ width: var(--width, 4%);
+ min-width: 34px;
+ min-height: 40px;
+ padding: 6px 8px;
+ overflow: hidden;
+ border: 1px solid #3a3a42;
+ border-radius: 8px;
+ background: linear-gradient(180deg, #2a2a30, #1c1c21);
+ color: #cfcfd4;
+ text-align: left;
+ cursor: pointer;
+}
+.timeline-beat:hover { border-color: #5a5a64; }
+.timeline-beat[aria-selected="true"] { border-color: #d3d3d7; background: linear-gradient(180deg, #3b3b42, #28282e); box-shadow: 0 0 0 1px rgba(255, 255, 255, .12), 0 8px 18px rgba(0, 0, 0, .3); }
+.timeline-beat.is-off { opacity: .44; border-style: dashed; }
+.timeline-beat.is-error { border-color: rgba(239, 122, 135, .55); }
+.timeline-beat.is-done { border-color: rgba(99, 213, 138, .38); }
+.timeline-beat b, .timeline-beat span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.timeline-beat b { font-size: 8.5px; font-weight: 720; }
+.timeline-beat span { margin-top: 3px; color: #82828b; font: 7.5px/1 ui-monospace, Consolas, monospace; }
+.timeline-empty { padding: 24px; border: 1px dashed #303037; border-radius: 11px; color: var(--cc-muted); font-size: 10px; text-align: center; }
+
+.studio-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
+.storyboard-panel { grid-column: span 3; padding: 19px; }
+.inspector-panel { grid-column: span 5; padding: 19px; }
+.output-stack { display: grid; grid-column: span 4; gap: 16px; min-width: 0; }
+.count-badge, .preview-badge, .dirty-state, .subpanel-head > span {
+ flex: 0 0 auto;
+ padding: 6px 8px;
+ border: 1px solid var(--cc-line);
+ border-radius: 999px;
+ color: #74747d;
+ background: rgba(8, 8, 11, .46);
+ font-size: 8px;
+ font-weight: 680;
+ letter-spacing: .04em;
+}
+.dirty-state.is-dirty { border-color: rgba(242, 198, 109, .26); color: #e2bd75; }
+.storyboard-list { display: grid; gap: 8px; margin-top: 16px; }
+.storyboard-card {
+ display: grid;
+ grid-template-columns: 38px minmax(0, 1fr) auto;
+ gap: 10px;
+ width: 100%;
+ min-height: 74px;
+ padding: 11px;
+ border: 1px solid var(--cc-line);
+ border-radius: 12px;
+ background: rgba(10, 10, 13, .6);
+ color: var(--cc-text);
+ text-align: left;
+ cursor: pointer;
+ transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
+}
+.storyboard-card:hover { border-color: var(--cc-line-strong); background: rgba(27, 27, 32, .78); transform: translateY(-1px); }
+.storyboard-card[aria-selected="true"] { border-color: rgba(225, 225, 229, .54); background: linear-gradient(145deg, #25252b, #17171c); box-shadow: inset 0 1px rgba(255, 255, 255, .065), 0 10px 24px rgba(0, 0, 0, .24); }
+.storyboard-card.is-off { opacity: .56; }
+.storyboard-number { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid #37373f; border-radius: 10px; background: #1b1b20; color: #b0b0b7; font: 730 9px/1 ui-monospace, Consolas, monospace; }
+.storyboard-copy { min-width: 0; }
+.storyboard-copy strong, .storyboard-copy span, .storyboard-copy small { display: block; }
+.storyboard-copy strong { overflow: hidden; color: #dbdbdf; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
+.storyboard-copy span { display: -webkit-box; margin-top: 5px; overflow: hidden; -webkit-box-orient: vertical; color: #777780; font-size: 9px; line-height: 1.4; -webkit-line-clamp: 2; }
+.storyboard-copy small { margin-top: 6px; color: #66666f; font: 7.5px/1.3 ui-monospace, Consolas, monospace; }
+.card-state { display: inline-flex; align-items: center; gap: 5px; color: #83838c; font-size: 7.5px; font-weight: 700; text-transform: uppercase; }
+.card-state::before { width: 6px; height: 6px; border-radius: 50%; background: #6b6b73; content: ""; }
+.card-state.done::before { background: var(--cc-success); }
+.card-state.error::before, .card-state.cancelled::before, .card-state.interrupted::before { background: var(--cc-danger); }
+.card-state.running::before, .card-state.rendering::before { background: var(--cc-info); box-shadow: 0 0 8px rgba(118, 215, 234, .45); }
+.card-state.partial::before { background: var(--cc-warning); }
+.panel-empty { display: grid; min-height: 210px; margin-top: 16px; padding: 28px 18px; place-content: center; place-items: center; border: 1px dashed #303037; border-radius: 13px; color: var(--cc-muted); text-align: center; }
+.empty-mark { display: grid; width: 46px; height: 46px; margin-bottom: 14px; place-items: center; border: 1px solid #37373e; border-radius: 13px; background: radial-gradient(circle at 42% 32%, #29292f, #17171b); color: #a2a2aa; font-size: 11px; font-weight: 740; box-shadow: inset 0 1px rgba(255, 255, 255, .05), 0 12px 26px rgba(0, 0, 0, .28); }
+.panel-empty strong { color: #d5d5d9; font-size: 13px; }
+.panel-empty p { max-width: 300px; margin: 7px 0 0; color: #72727b; font-size: 10px; line-height: 1.55; }
+
+#inspectorForm { margin-top: 17px; }
+.inspector-title-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; padding: 13px; border: 1px solid var(--cc-line); border-radius: 12px; background: rgba(9, 9, 12, .5); }
+.selected-identity { display: flex; min-width: 0; max-width: 100%; align-items: center; gap: 11px; }
+.selected-identity > div { min-width: 0; }
+.selected-identity > span { display: grid; width: 38px; height: 38px; flex: 0 0 38px; place-items: center; border: 1px solid #393941; border-radius: 10px; background: linear-gradient(145deg, #29292f, #18181d); color: #c9c9ce; font: 720 9px/1 ui-monospace, Consolas, monospace; }
+.selected-identity strong, .selected-identity small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.selected-identity strong { color: #e1e1e4; font-size: 12px; }
+.selected-identity small { margin-top: 4px; color: #74747d; font-size: 8.5px; }
+.switch-field { display: inline-grid; grid-template-columns: 36px auto; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; }
+.switch-field input { position: absolute; width: 1px; height: 1px; opacity: 0; }
+.switch-field > span { position: relative; width: 36px; height: 20px; border: 1px solid #45454e; border-radius: 999px; background: #1a1a1f; transition: 150ms ease; }
+.switch-field > span::after { position: absolute; top: 3px; left: 3px; width: 12px; height: 12px; border-radius: 50%; background: #777780; transition: transform 150ms var(--cc-ease), background 150ms; content: ""; }
+.switch-field input:checked + span { border-color: rgba(99, 213, 138, .38); background: rgba(45, 113, 68, .23); }
+.switch-field input:checked + span::after { background: var(--cc-success); transform: translateX(16px); }
+.switch-field input:focus-visible + span { outline: 2px solid var(--cc-info); outline-offset: 2px; }
+.switch-field b { color: #92929a; font-size: 9px; white-space: nowrap; }
+.full-field > small { color: #65656e; font-size: 8.5px; line-height: 1.4; }
+.form-grid { display: grid; gap: 10px; margin-top: 13px; }
+.timing-grid { grid-template-columns: minmax(94px, .7fr) minmax(94px, .7fr) minmax(160px, 1.6fr); }
+.input-unit { position: relative; }
+.input-unit input { padding-right: 40px; }
+.input-unit i { position: absolute; top: 50%; right: 11px; color: #65656e; font-size: 8px; font-style: normal; transform: translateY(-50%); pointer-events: none; }
+.subpanel { margin-top: 14px; padding: 14px; border: 1px solid var(--cc-line); border-radius: 13px; background: rgba(9, 9, 12, .42); }
+.subpanel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
+.subpanel-head h3 { margin: 4px 0 0; font-size: 12px; }
+.customizer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
+.customizer-control.wide { grid-column: 1 / -1; }
+.customizer-control input[type="color"] { padding: 5px; }
+.subpanel-empty { margin: 12px 0 0; color: #676770; font-size: 9px; line-height: 1.5; }
+.checklist { display: grid; gap: 7px; margin-top: 12px; }
+.check-item { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 9px; min-height: 44px; padding: 10px; border: 1px solid #2d2d34; border-radius: 10px; background: rgba(18, 18, 22, .72); cursor: pointer; }
+.check-item input { width: 18px; min-height: 18px; margin: 1px 0 0; accent-color: #d8d8dc; }
+.check-item span { color: #b1b1b8; font-size: 9px; line-height: 1.45; }
+.analysis-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 14px; }
+.proposal-panel { margin-top: 14px; padding: 15px; border: 1px solid rgba(118, 215, 234, .24); border-radius: 14px; background: linear-gradient(145deg, rgba(34, 71, 82, .14), rgba(8, 9, 12, .72)); }
+.proposal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
+.proposal-head h3 { margin: 4px 0 0; font-size: 13px; }
+.text-button { min-height: 44px; border-color: transparent; background: transparent; color: #8b8b94; }
+.text-button:hover { color: #fff; }
+.proposal-diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 13px; }
+.proposal-diff > div { min-width: 0; overflow: hidden; border: 1px solid var(--cc-line); border-radius: 10px; background: #0c0c0f; }
+.proposal-diff small { display: block; padding: 8px 10px; border-bottom: 1px solid var(--cc-line); color: #696972; font-size: 8px; font-weight: 730; letter-spacing: .11em; text-transform: uppercase; }
+.proposal-diff pre { min-height: 100px; margin: 0; padding: 10px; overflow: auto; color: #bdbdc4; font: 9px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
+.diff-list { display: grid; gap: 5px; margin: 11px 0; padding: 0; list-style: none; }
+.diff-list li { display: flex; gap: 7px; color: #90909a; font-size: 8.5px; line-height: 1.45; }
+.diff-list li::before { color: var(--cc-info); content: "+"; }
+.policy-details { margin-top: 14px; border: 1px solid var(--cc-line); border-radius: 11px; background: rgba(9, 9, 12, .48); }
+.policy-details summary { min-height: 44px; padding: 14px; color: #9a9aa3; font-size: 9px; font-weight: 670; cursor: pointer; }
+.policy-details[open] summary { border-bottom: 1px solid var(--cc-line); }
+.policy-details pre { max-width: 100%; margin: 0; padding: 13px; overflow: auto; color: #74747d; font: 8.5px/1.55 ui-monospace, Consolas, monospace; white-space: pre-wrap; }
+.revision-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 14px; padding: 14px; border: 1px solid var(--cc-line); border-radius: 13px; background: linear-gradient(145deg, rgba(34, 34, 40, .74), rgba(13, 13, 16, .75)); }
+.revision-bar strong, .revision-bar span { display: block; }
+.revision-bar strong { color: #d5d5da; font-size: 10px; }
+.revision-bar span { margin-top: 4px; color: #6f6f78; font-size: 8.5px; }
+.revision-actions { display: flex; flex: 0 0 auto; gap: 8px; }
+
+.preview-panel, .review-panel, .premiere-panel { padding: 17px; }
+.preview-stage { position: relative; display: grid; min-height: 220px; margin-top: 14px; overflow: hidden; place-items: center; border: 1px solid #292930; border-radius: 12px; aspect-ratio: 16 / 9; background-color: #09090b; }
+.checkerboard { background-image: linear-gradient(45deg, #151519 25%, transparent 25%), linear-gradient(-45deg, #151519 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #151519 75%), linear-gradient(-45deg, transparent 75%, #151519 75%); background-position: 0 0, 0 9px, 9px -9px, -9px 0; background-size: 18px 18px; }
+.preview-stage iframe, .preview-stage img { display: block; width: 100%; height: 100%; min-height: 220px; border: 0; object-fit: contain; background: transparent; }
+.preview-empty { display: grid; max-width: 270px; padding: 22px; place-items: center; color: #66666f; text-align: center; }
+.preview-empty strong { color: #a1a1a9; font-size: 10px; }
+.preview-empty span { margin-top: 6px; font-size: 8.5px; line-height: 1.5; }
+.playback-controls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 9px; }
+.playback-controls button { padding-inline: 8px; font-size: 9px; }
+.preview-caption { margin: 10px 2px 0; color: #707079; font-size: 8.5px; line-height: 1.5; }
+.preview-badge.is-ready { border-color: rgba(99, 213, 138, .25); color: #9cddb1; }
+.preview-badge.is-error { border-color: rgba(239, 122, 135, .25); color: #e99aa4; }
+.status-pill { display: inline-flex; min-height: 27px; align-items: center; gap: 6px; padding: 5px 8px; border: 1px solid var(--cc-line); border-radius: 999px; font-size: 8px; font-weight: 700; white-space: nowrap; }
+.status-pill > span { width: 6px; height: 6px; border-radius: 50%; background: #696972; }
+.status-pill.neutral { color: #85858e; }
+.status-pill.success { border-color: rgba(99, 213, 138, .23); color: #9bdfb1; }
+.status-pill.success > span { background: var(--cc-success); }
+.status-pill.warning { border-color: rgba(242, 198, 109, .25); color: #e9c77e; }
+.status-pill.warning > span { background: var(--cc-warning); }
+.status-pill.error { border-color: rgba(239, 122, 135, .25); color: #ee9ba5; }
+.status-pill.error > span { background: var(--cc-danger); }
+.review-body { margin-top: 13px; padding: 12px; border: 1px solid var(--cc-line); border-radius: 11px; background: rgba(9, 9, 12, .5); }
+.review-body p { margin: 0; color: #787881; font-size: 9px; line-height: 1.55; }
+.review-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
+.review-list li { display: grid; grid-template-columns: 9px minmax(0, 1fr); gap: 8px; color: #9999a2; font-size: 8.5px; line-height: 1.45; }
+.review-list li::before { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: #777780; content: ""; }
+.review-list li.pass::before { background: var(--cc-success); }
+.review-list li.fail::before { background: var(--cc-danger); }
+.review-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
+.action-note { margin: 9px 2px 0; color: #62626b; font-size: 8px; line-height: 1.45; }
+.placement-grid { display: grid; grid-template-columns: 1.25fr .75fr; gap: 9px; margin-top: 14px; }
+.premiere-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 11px; }
+.premiere-actions .button:first-child { grid-column: 1 / -1; }
+.action-history { margin-top: 11px; padding: 11px; border: 1px solid var(--cc-line); border-radius: 11px; background: rgba(9, 9, 12, .48); }
+.action-history p { margin: 0; color: #6f6f78; font-size: 8.5px; line-height: 1.5; }
+.action-history p.history-error { margin-top: 9px; color: #b98a91; }
+.history-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
+.history-list li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 8px; align-items: start; color: #8b8b94; font-size: 8px; line-height: 1.4; }
+.history-list i { width: 6px; height: 6px; margin-top: 3px; border-radius: 50%; background: #777780; }
+.history-list .done i, .history-list .inserted i, .history-list .saved i { background: var(--cc-success); }
+.history-list .error i, .history-list .failed i { background: var(--cc-danger); }
+.history-list time { color: #5f5f68; white-space: nowrap; }
+
+.toast { position: fixed; z-index: 1200; bottom: 24px; left: 50%; max-width: min(580px, calc(100vw - 32px)); padding: 12px 16px; border: 1px solid var(--cc-line-strong); border-radius: 11px; background: #1a1a1f; color: #e2e2e5; box-shadow: 0 18px 50px rgba(0, 0, 0, .55); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity 180ms ease, transform 180ms var(--cc-ease); }
+.toast.show { opacity: 1; transform: translate(-50%, 0); }
+.toast.error { border-color: rgba(239, 122, 135, .3); color: #f1adb5; }
+
+body.null-ai-dock-open .control-page { padding-right: clamp(16px, 2vw, 32px); padding-left: clamp(16px, 2vw, 32px); }
+body.null-ai-dock-open .control-hero { grid-template-columns: 1fr; }
+body.null-ai-dock-open .studio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+body.null-ai-dock-open .storyboard-panel, body.null-ai-dock-open .inspector-panel { grid-column: auto; }
+body.null-ai-dock-open .output-stack { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
+
+@keyframes spin { to { transform: rotate(360deg); } }
+@keyframes pulse { 50% { opacity: .38; transform: scale(.72); } }
+
+@media (max-width: 1260px) {
+ .control-hero { grid-template-columns: 1fr; align-items: start; }
+ .presence-grid { max-width: 760px; }
+ .studio-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .storyboard-panel, .inspector-panel { grid-column: auto; }
+ .output-stack { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
+}
+
+@media (max-width: 860px) {
+ .control-page { padding-inline: 14px; }
+ .control-hero { padding-inline: 3px; }
+ .sequence-head { align-items: stretch; flex-direction: column; }
+ .sequence-tools { align-items: stretch; }
+ .compact-field { flex: 1; }
+ .compact-field select { min-width: 0; }
+ .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .studio-grid, body.null-ai-dock-open .studio-grid { grid-template-columns: 1fr; }
+ .storyboard-panel, .inspector-panel, .output-stack, body.null-ai-dock-open .storyboard-panel, body.null-ai-dock-open .inspector-panel, body.null-ai-dock-open .output-stack { grid-column: auto; }
+ .output-stack, body.null-ai-dock-open .output-stack { grid-template-columns: 1fr; }
+}
+
+@media (max-width: 620px) {
+ .control-page { padding-top: 30px; padding-bottom: 58px; }
+ .control-hero h1 { font-size: 44px; }
+ .control-hero p { font-size: 14px; }
+ .presence-grid { grid-template-columns: 1fr; }
+ .presence-card { min-height: 94px; }
+ .surface { border-radius: 16px; }
+ .sequence-console, .storyboard-panel, .inspector-panel, .preview-panel, .review-panel, .premiere-panel { padding: 14px; }
+ .sequence-tools { display: grid; grid-template-columns: 1fr; }
+ .summary-grid { grid-template-columns: 1fr 1fr; }
+ .timeline-figure { padding: 11px; }
+ .timeline-figure figcaption > span { display: none; }
+ .inspector-title-row { align-items: flex-start; flex-direction: column; }
+ .selected-identity { width: 100%; }
+ .timing-grid, .customizer-grid, .proposal-diff, .placement-grid { grid-template-columns: 1fr; }
+ .customizer-control.wide { grid-column: auto; }
+ .revision-bar { align-items: stretch; flex-direction: column; }
+ .revision-actions { display: grid; grid-template-columns: 1fr; }
+ .analysis-actions, .review-actions { grid-template-columns: 1fr; }
+ .premiere-actions { grid-template-columns: 1fr; }
+ .premiere-actions .button:first-child { grid-column: auto; }
+ .preview-stage, .preview-stage iframe, .preview-stage img { min-height: 180px; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
+}
+
+@media (forced-colors: active) {
+ .surface, .presence-card, .storyboard-card, .timeline-beat { border: 1px solid CanvasText; }
+ .presence-icon, .card-state::before, .status-pill > span { forced-color-adjust: none; }
+}
diff --git a/public/control-center.html b/public/control-center.html
new file mode 100644
index 0000000..21ef4fd
--- /dev/null
+++ b/public/control-center.html
@@ -0,0 +1,221 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>Control Center · Null Motion</title>
+ <link rel="icon" href="assets/null-logo.png" />
+ <link rel="stylesheet" href="site-shell.css" />
+ <link rel="stylesheet" href="control-center.css" />
+ <script src="site-shell.js" defer></script>
+ <script src="control-center.js" defer></script>
+</head>
+<body>
+ <header class="fallback-header">
+ <a class="fallback-brand" href="./"><img src="assets/null-logo.png" alt="Null" /><b>Null</b><span>Motion</span></a>
+ <nav aria-label="Null Motion pages">
+ <a href="./">Templates</a>
+ <a href="create.html">Reference studio</a>
+ <a href="script.html">Script to motion</a>
+ <a href="system-map.html">Director pipeline</a>
+ <a href="control-center.html" aria-current="page">Control Center</a>
+ <a href="renders.html">Renders</a>
+ </nav>
+ </header>
+
+ <main class="control-page" id="controlCenter">
+ <section class="control-hero" aria-labelledby="pageTitle">
+ <div class="hero-copy">
+ <div class="eyebrow">Sequence operations</div>
+ <h1 id="pageTitle">Control every frame.</h1>
+ <p>Review authored intent beside rendered output, revise without losing the original, and hand approved motion back to Premiere with an auditable action trail.</p>
+ </div>
+ <div class="presence-grid" aria-label="Connection status">
+ <article class="presence-card is-checking" id="bridgePresence">
+ <span class="presence-icon" aria-hidden="true"></span>
+ <div><small>Local bridge</small><strong id="bridgePresenceText">Checking connection</strong><span id="bridgePresenceDetail">Waiting for health response</span></div>
+ </article>
+ <article class="presence-card is-checking" id="cepPresence">
+ <span class="presence-icon" aria-hidden="true"></span>
+ <div><small>Premiere panel</small><strong id="cepPresenceText">Checking presence</strong><span id="cepPresenceDetail">Waiting for CEP heartbeat</span></div>
+ </article>
+ </div>
+ </section>
+
+ <section class="surface sequence-console" aria-labelledby="sequenceHeading">
+ <div class="surface-head sequence-head">
+ <div>
+ <span class="section-kicker">Active production</span>
+ <h2 id="sequenceHeading">Sequence control</h2>
+ <p id="sequenceSubtitle">Loading sequence history from the local companion.</p>
+ </div>
+ <div class="sequence-tools">
+ <label class="compact-field" for="sequencePicker"><span>Sequence</span><select id="sequencePicker" disabled><option>Loading sequences…</option></select></label>
+ <button class="button secondary icon-button" id="refreshButton" type="button"><span aria-hidden="true">↻</span>Refresh</button>
+ </div>
+ </div>
+
+ <div class="inline-state loading" id="pageState" role="status" aria-live="polite">
+ <span class="state-mark" aria-hidden="true"></span>
+ <div><strong>Connecting to Null Motion</strong><span>Sequence controls appear when the local bridge responds.</span></div>
+ </div>
+
+ <dl class="summary-grid" id="sequenceSummary" aria-label="Sequence summary">
+ <div><dt>Status</dt><dd id="summaryStatus">Waiting</dd></div>
+ <div><dt>Graphics</dt><dd id="summaryGraphics">—</dd></div>
+ <div><dt>Timeline</dt><dd id="summaryDuration">—</dd></div>
+ <div><dt>Last change</dt><dd id="summaryUpdated">—</dd></div>
+ </dl>
+
+ <figure class="timeline-figure" aria-labelledby="timelineHeading">
+ <figcaption>
+ <div><span class="section-kicker">Editorial map</span><h3 id="timelineHeading">Motion timeline</h3></div>
+ <span id="timelineHint">Select a beat to inspect it</span>
+ </figcaption>
+ <div class="timeline-ruler" id="timelineRuler" aria-hidden="true"></div>
+ <div class="timeline-track" id="timelineTrack" role="listbox" aria-label="Storyboard timeline"></div>
+ <div class="timeline-empty" id="timelineEmpty">No timeline has been loaded.</div>
+ </figure>
+ </section>
+
+ <div class="studio-grid">
+ <section class="surface storyboard-panel" aria-labelledby="storyboardHeading">
+ <div class="surface-head compact">
+ <div><span class="section-kicker">Storyboard</span><h2 id="storyboardHeading">Directed beats</h2></div>
+ <span class="count-badge" id="storyboardCount">0 beats</span>
+ </div>
+ <div class="storyboard-list" id="storyboardList" role="listbox" aria-label="Storyboard beats"></div>
+ <div class="panel-empty" id="storyboardEmpty">
+ <span class="empty-mark" aria-hidden="true">N→</span>
+ <strong>No storyboard loaded</strong>
+ <p>Choose a sequence with an authored storyboard to review its graphics.</p>
+ </div>
+ </section>
+
+ <section class="surface inspector-panel" aria-labelledby="inspectorHeading">
+ <div class="surface-head compact">
+ <div><span class="section-kicker">Selected beat</span><h2 id="inspectorHeading">Inspector</h2></div>
+ <span class="dirty-state" id="dirtyState">No unsaved edits</span>
+ </div>
+
+ <div class="panel-empty" id="inspectorEmpty">
+ <span class="empty-mark" aria-hidden="true">01</span>
+ <strong>Select a storyboard beat</strong>
+ <p>Prompt, timing, template, customizer, and review controls will appear here.</p>
+ </div>
+
+ <form id="inspectorForm" hidden>
+ <div class="inspector-title-row">
+ <div class="selected-identity"><span id="selectedNumber">01</span><div><strong id="selectedTitle">Motion beat</strong><small id="selectedMeta">Awaiting sequence data</small></div></div>
+ <label class="switch-field"><input id="segmentEnabled" type="checkbox" /><span aria-hidden="true"></span><b>Include graphic</b></label>
+ </div>
+
+ <label class="field full-field" for="promptEditor">
+ <span>Production prompt</span>
+ <textarea id="promptEditor" rows="8" spellcheck="true" placeholder="No prompt was authored for this beat."></textarea>
+ <small id="promptMeta">Edits are kept locally until you create a revision.</small>
+ </label>
+
+ <div class="form-grid timing-grid">
+ <label class="field" for="startTimeInput"><span>Starts at</span><div class="input-unit"><input id="startTimeInput" type="number" min="0" step="0.001" inputmode="decimal" /><i>sec</i></div></label>
+ <label class="field" for="durationInput"><span>Duration</span><div class="input-unit"><input id="durationInput" type="number" min="0.1" step="0.001" inputmode="decimal" /><i>sec</i></div></label>
+ <label class="field template-field" for="templateSelect"><span>Authored template</span><select id="templateSelect"></select></label>
+ </div>
+
+ <section class="subpanel" aria-labelledby="customizerHeading">
+ <div class="subpanel-head"><div><span class="section-kicker">Bounded variation</span><h3 id="customizerHeading">Template customizer</h3></div><span id="customizerCount">0 controls</span></div>
+ <div class="customizer-grid" id="customizerControls"></div>
+ <p class="subpanel-empty" id="customizerEmpty">This template exposes no editable customizer controls for this beat.</p>
+ </section>
+
+ <section class="subpanel" aria-labelledby="checklistHeading">
+ <div class="subpanel-head"><div><span class="section-kicker">Acceptance criteria</span><h3 id="checklistHeading">Quality checklist</h3></div><span id="checklistProgress">No checklist</span></div>
+ <div class="checklist" id="qualityChecklist"></div>
+ <p class="subpanel-empty" id="checklistEmpty">No authored quality checklist was returned for this beat.</p>
+ </section>
+
+ <div class="analysis-actions" aria-label="AI revision proposals">
+ <button class="button secondary" id="repromptButton" type="button">Re-prompt</button>
+ <button class="button secondary" id="reanalyzeButton" type="button">Re-analyze beat</button>
+ </div>
+
+ <section class="proposal-panel" id="proposalPanel" aria-labelledby="proposalHeading" hidden>
+ <div class="proposal-head"><div><span class="section-kicker">Review before apply</span><h3 id="proposalHeading">Revision proposal</h3></div><button class="text-button" id="discardProposal" type="button">Discard</button></div>
+ <div class="proposal-diff">
+ <div><small>Current</small><pre id="proposalBefore"></pre></div>
+ <div><small>Proposed</small><pre id="proposalAfter"></pre></div>
+ </div>
+ <ul class="diff-list" id="proposalChanges"></ul>
+ <button class="button primary" id="applyProposal" type="button">Apply proposal</button>
+ </section>
+
+ <details class="policy-details">
+ <summary>Original generation policy</summary>
+ <pre id="generationPolicy">No generation policy was recorded.</pre>
+ </details>
+
+ <div class="revision-bar">
+ <div><strong>Create a non-destructive revision</strong><span id="revisionNote">The original sequence stays available.</span></div>
+ <div class="revision-actions">
+ <button class="button secondary" id="saveDraftButton" type="button">Save draft</button>
+ <button class="button primary" id="renderRevisionButton" type="button">Render revision</button>
+ </div>
+ </div>
+ </form>
+ </section>
+
+ <aside class="output-stack" aria-label="Preview, review, and Premiere actions">
+ <section class="surface preview-panel" aria-labelledby="authoredHeading">
+ <div class="surface-head compact"><div><span class="section-kicker">Source motion</span><h2 id="authoredHeading">Authored preview</h2></div><span class="preview-badge" id="authoredBadge">Unavailable</span></div>
+ <div class="preview-stage checkerboard" id="authoredStage">
+ <iframe id="authoredFrame" title="Authored template preview" referrerpolicy="no-referrer" hidden></iframe>
+ <div class="preview-empty" id="authoredEmpty"><strong>No authored player</strong><span>This beat did not return a template player path.</span></div>
+ </div>
+ <div class="playback-controls" aria-label="Authored preview playback">
+ <button id="playPreview" type="button" disabled>Play</button>
+ <button id="pausePreview" type="button" disabled>Pause</button>
+ <button id="restartPreview" type="button" disabled>Restart</button>
+ </div>
+ </section>
+
+ <section class="surface preview-panel" aria-labelledby="renderedHeading">
+ <div class="surface-head compact"><div><span class="section-kicker">Rendered truth</span><h2 id="renderedHeading">Rendered preview</h2></div><span class="preview-badge" id="renderedBadge">Unavailable</span></div>
+ <div class="preview-stage checkerboard" id="renderedStage">
+ <iframe id="renderedFrame" title="Rendered motion player" referrerpolicy="no-referrer" hidden></iframe>
+ <img id="renderedImage" alt="Rendered motion frame" hidden />
+ <div class="preview-empty" id="renderedEmpty"><strong>No rendered output</strong><span>A real player, instant preview, or sampled frame will appear when available.</span></div>
+ </div>
+ <p class="preview-caption" id="renderedCaption">Select a beat to inspect its render status.</p>
+ </section>
+
+ <section class="surface review-panel" aria-labelledby="reviewHeading">
+ <div class="surface-head compact"><div><span class="section-kicker">Rendered QA</span><h2 id="reviewHeading">Review & repair</h2></div><span class="status-pill neutral" id="reviewBadge"><span aria-hidden="true"></span>Not reviewed</span></div>
+ <div class="review-body" id="reviewBody"><p>No rendered review has been run for this beat.</p></div>
+ <div class="review-actions">
+ <button class="button secondary" id="reviewButton" type="button" disabled>Run quality review</button>
+ <button class="button warning" id="repairButton" type="button" disabled>Repair as new revision</button>
+ </div>
+ <p class="action-note">Repair always uses strict review with a refreshed cache. It never replaces the original.</p>
+ </section>
+
+ <section class="surface premiere-panel" aria-labelledby="premiereHeading">
+ <div class="surface-head compact"><div><span class="section-kicker">Premiere handoff</span><h2 id="premiereHeading">Return to the edit</h2></div><span class="status-pill neutral" id="handoffBadge"><span aria-hidden="true"></span>Not sent</span></div>
+ <div class="placement-grid">
+ <label class="field" for="placementMode"><span>Placement</span><select id="placementMode"><option value="absoluteTime">Storyboard time</option><option value="currentPlayhead">Current playhead</option></select></label>
+ <label class="field" id="absoluteTimeField" for="absoluteTime"><span>Sequence time</span><div class="input-unit"><input id="absoluteTime" type="number" min="0" step="0.001" inputmode="decimal" /><i>sec</i></div></label>
+ </div>
+ <div class="premiere-actions">
+ <button class="button primary" id="sendCepButton" type="button" disabled>Send to CEP</button>
+ <button class="button secondary" id="saveBinButton" type="button" disabled>Save to Premiere bin</button>
+ <button class="button secondary" id="insertButton" type="button" disabled>Insert</button>
+ <button class="button danger" id="rollbackButton" type="button" disabled>Rollback</button>
+ </div>
+ <div class="action-history" id="actionHistory" aria-live="polite"><p>No Premiere actions for this beat.</p></div>
+ </section>
+ </aside>
+ </div>
+ </main>
+
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
+</body>
+</html>
diff --git a/public/control-center.js b/public/control-center.js
new file mode 100644
index 0000000..b082433
--- /dev/null
+++ b/public/control-center.js
@@ -0,0 +1,1808 @@
+(() => {
+ "use strict";
+
+ const API = window.location.origin;
+ const TOKEN_KEY = "null-motion-bridge-token";
+ const LEGACY_TOKEN_KEYS = ["nullMotionBridgeToken", "null-motion-browser-token", "nullBridgeToken"];
+ const SAVED_SEQUENCE_KEY = "null-motion-control-sequence-id";
+ const TERMINAL_STATUSES = new Set(["done", "partial", "error", "cancelled", "interrupted"]);
+ const SUCCESS_STATUSES = new Set(["done", "ok", "completed", "saved", "inserted", "rolledback", "rolled-back", "success", "succeeded"]);
+ const FAILURE_STATUSES = new Set(["error", "failed", "cancelled", "interrupted", "rejected"]);
+ const POLL_ONLINE_MS = 3500;
+ const POLL_OFFLINE_MS = 7000;
+
+ const state = {
+ bridgeOnline: false,
+ bridgeChecked: false,
+ bridgeError: null,
+ health: null,
+ presence: null,
+ presenceChecked: false,
+ presenceError: null,
+ templates: [],
+ templatesError: null,
+ theme: null,
+ themeError: null,
+ batches: [],
+ batchesError: null,
+ jobs: [],
+ jobsError: null,
+ inbox: [],
+ inboxError: null,
+ actions: [],
+ actionsError: null,
+ selectedSequenceId: null,
+ sequence: null,
+ storyboard: null,
+ storyboardError: null,
+ originalStoryboard: null,
+ draftStoryboard: null,
+ originalGenerationPolicy: null,
+ baseUpdatedAt: null,
+ hydratedUpdatedAt: null,
+ selectedIndex: -1,
+ dirty: false,
+ remoteChangedWhileDirty: false,
+ proposal: null,
+ reviewByKey: new Map(),
+ actionBusy: false,
+ initializedSelection: false
+ };
+
+ let pollGeneration = 0;
+ let pollTimer = null;
+ let pollController = null;
+ let toastTimer = null;
+
+ const byId = id => document.getElementById(id);
+
+ function storageGet(key) {
+ try { return localStorage.getItem(key); } catch (_) { return null; }
+ }
+
+ function storageSet(key, value) {
+ try { localStorage.setItem(key, value); } catch (_) {}
+ }
+
+ function bridgeToken() {
+ try {
+ let token = localStorage.getItem(TOKEN_KEY) || "";
+ if (token) return token;
+ for (const key of LEGACY_TOKEN_KEYS) {
+ token = localStorage.getItem(key) || "";
+ if (!token) continue;
+ localStorage.setItem(TOKEN_KEY, token);
+ LEGACY_TOKEN_KEYS.forEach(legacyKey => localStorage.removeItem(legacyKey));
+ return token;
+ }
+ } catch (_) {}
+ return "";
+ }
+
+ function clone(value) {
+ if (value == null) return value;
+ if (typeof structuredClone === "function") {
+ try { return structuredClone(value); } catch (_) {}
+ }
+ return JSON.parse(JSON.stringify(value));
+ }
+
+ function text(value) { return value == null ? "" : String(value); }
+ function number(value, fallback = 0) { const parsed = Number(value); return Number.isFinite(parsed) ? parsed : fallback; }
+ function object(value) { return value && typeof value === "object" && !Array.isArray(value) ? value : {}; }
+ function firstValue(...values) { return values.find(value => value !== undefined && value !== null && value !== ""); }
+ function unique(values) { return Array.from(new Set(values.filter(value => value !== undefined && value !== null && value !== "").map(String))); }
+
+ function arrayFrom(payload, keys) {
+ if (Array.isArray(payload)) return payload;
+ for (const key of keys) if (Array.isArray(payload?.[key])) return payload[key];
+ return [];
+ }
+
+ function unwrapSequence(payload) {
+ return object(payload?.sequence || payload?.batch || payload?.data || payload);
+ }
+
+ function unwrapStoryboard(payload) {
+ return object(payload?.storyboard || payload?.data || payload);
+ }
+
+ function segmentsOf(storyboard) {
+ return Array.isArray(storyboard?.segments) ? storyboard.segments : Array.isArray(storyboard?.items) ? storyboard.items : [];
+ }
+
+ function normalizeStatus(value) {
+ const status = text(value || "pending").trim().toLowerCase().replace(/\s+/g, "-");
+ if (status === "completed" || status === "complete" || status === "succeeded" || status === "success") return "done";
+ if (status === "failed" || status === "failure") return "error";
+ if (status === "canceled") return "cancelled";
+ if (["working", "processing", "generating", "queued-for-render"].includes(status)) return "running";
+ return status || "pending";
+ }
+
+ function statusLabel(value) {
+ const status = normalizeStatus(value);
+ return ({
+ done: "Ready",
+ partial: "Partially complete",
+ error: "Error",
+ cancelled: "Cancelled",
+ interrupted: "Interrupted",
+ running: "In progress",
+ rendering: "Rendering",
+ pending: "Pending",
+ queued: "Queued",
+ draft: "Draft",
+ claimed: "Claimed by CEP",
+ inserted: "Inserted",
+ dismissed: "Dismissed"
+ })[status] || status.replace(/-/g, " ").replace(/^./, letter => letter.toUpperCase());
+ }
+
+ function statusTone(value) {
+ const status = normalizeStatus(value);
+ if (SUCCESS_STATUSES.has(status)) return "success";
+ if (FAILURE_STATUSES.has(status)) return "error";
+ if (["partial", "warning", "claimed", "queued"].includes(status)) return "warning";
+ return "neutral";
+ }
+
+ function isTerminal(value) { return TERMINAL_STATUSES.has(normalizeStatus(value)); }
+
+ function parseDate(value) {
+ const date = new Date(typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value);
+ return Number.isNaN(date.getTime()) ? null : date;
+ }
+
+ function formatDate(value) {
+ const date = parseDate(value);
+ if (!date) return "Not recorded";
+ return date.toLocaleString([], { dateStyle: "medium", timeStyle: "short" });
+ }
+
+ function formatRelativeDate(value) {
+ const date = parseDate(value);
+ if (!date) return "Not recorded";
+ const seconds = Math.round((Date.now() - date.getTime()) / 1000);
+ if (Math.abs(seconds) < 60) return "Just now";
+ const minutes = Math.round(seconds / 60);
+ if (Math.abs(minutes) < 60) return `${Math.abs(minutes)}m ${minutes >= 0 ? "ago" : "from now"}`;
+ const hours = Math.round(minutes / 60);
+ if (Math.abs(hours) < 24) return `${Math.abs(hours)}h ${hours >= 0 ? "ago" : "from now"}`;
+ return formatDate(value);
+ }
+
+ function formatTime(value, millis = true) {
+ const total = Math.max(0, number(value));
+ const hours = Math.floor(total / 3600);
+ const minutes = Math.floor((total % 3600) / 60);
+ const seconds = Math.floor(total % 60);
+ const fraction = Math.round((total - Math.floor(total)) * 1000);
+ const base = `${hours ? `${String(hours).padStart(2, "0")}:` : ""}${String(minutes).padStart(2, "0")}:${String(seconds).padStart(2, "0")}`;
+ return millis && fraction ? `${base}.${String(fraction).padStart(3, "0")}` : base;
+ }
+
+ function safeHttpUrl(value) {
+ if (!value) return "";
+ try {
+ const url = new URL(String(value), API);
+ return ["http:", "https:"].includes(url.protocol) ? url.href : "";
+ } catch (_) { return ""; }
+ }
+
+ function canonicalAuthoredPlayerUrl(value) {
+ if (!value) return "";
+ let raw = String(value).trim();
+ try {
+ if (/^https?:/i.test(raw)) raw = new URL(raw).pathname;
+ } catch (_) { return ""; }
+ raw = raw.split(/[?#]/)[0].replace(/^\/+/, "").replace(/^null\//i, "");
+ const parts = raw.split("/").filter(Boolean);
+ if (!parts.length || parts.some(part => part === "." || part === "..")) return "";
+ try {
+ return `${API}/null/${parts.map(part => encodeURIComponent(decodeURIComponent(part))).join("/")}`;
+ } catch (_) { return ""; }
+ }
+
+ class ApiError extends Error {
+ constructor(message, status, path) {
+ super(message);
+ this.name = "ApiError";
+ this.status = status;
+ this.path = path;
+ }
+ }
+
+ async function api(path, options = {}) {
+ const headers = Object.assign({}, options.headers || {});
+ const token = bridgeToken();
+ if (token) headers["X-Null-Bridge-Token"] = token;
+ const request = Object.assign({ cache: "no-store" }, options, { headers });
+ let response;
+ try {
+ response = await fetch(`${API}${path}`, request);
+ } catch (error) {
+ if (error?.name === "AbortError") throw error;
+ throw new ApiError("Null Motion bridge is offline.", 0, path);
+ }
+ const data = response.status === 204 ? {} : await response.json().catch(() => ({}));
+ if (!response.ok) throw new ApiError(data.error || data.message || `Null Motion request failed (${response.status}).`, response.status, path);
+ return data;
+ }
+
+ async function settled(promise) {
+ try { return { ok: true, value: await promise }; }
+ catch (error) { return { ok: false, error }; }
+ }
+
+ function showToast(message, error = false) {
+ const toast = byId("toast");
+ toast.textContent = message;
+ toast.classList.toggle("error", Boolean(error));
+ toast.classList.add("show");
+ clearTimeout(toastTimer);
+ toastTimer = setTimeout(() => toast.classList.remove("show"), 3000);
+ }
+
+ function setBusy(button, busy, label) {
+ if (!button) return;
+ if (!button.dataset.label) button.dataset.label = button.textContent;
+ button.disabled = Boolean(busy);
+ button.classList.toggle("is-busy", Boolean(busy));
+ button.textContent = busy && label ? label : button.dataset.label;
+ }
+
+ function batchId(batch) {
+ return text(firstValue(batch?.sequenceId, batch?.batchId, batch?.id, batch?._id));
+ }
+
+ function sequenceTitle(sequence, fallbackId = "") {
+ return text(firstValue(sequence?.title, sequence?.name, sequence?.sequenceName, sequence?.label, sequence?.storyboard?.title, fallbackId ? `Sequence ${fallbackId.slice(0, 8)}` : "Untitled sequence"));
+ }
+
+ function sequenceUpdatedAt(sequence, storyboard) {
+ return firstValue(sequence?.updatedAt, sequence?.finishedAt, sequence?.createdAt, storyboard?.updatedAt, storyboard?.createdAt, null);
+ }
+
+ function sequenceDuration(sequence = state.sequence, storyboard = state.draftStoryboard) {
+ const explicit = firstValue(sequence?.sequenceInfo?.duration, sequence?.duration, sequence?.timelineDuration, storyboard?.sequenceInfo?.duration, storyboard?.overallDuration, storyboard?.duration);
+ if (Number.isFinite(Number(explicit)) && Number(explicit) > 0) return Number(explicit);
+ return segmentsOf(storyboard).reduce((maximum, segment) => Math.max(maximum, segmentStart(segment) + segmentDuration(segment)), 0);
+ }
+
+ function sequenceInfo(sequence = state.sequence, storyboard = state.draftStoryboard) {
+ const source = object(sequence?.sequenceInfo || storyboard?.sequenceInfo);
+ return {
+ width: Math.max(0, number(firstValue(source.width, sequence?.width), 0)),
+ height: Math.max(0, number(firstValue(source.height, sequence?.height), 0)),
+ fps: Math.max(0, number(firstValue(source.fps, sequence?.fps), 0)),
+ duration: sequenceDuration(sequence, storyboard)
+ };
+ }
+
+ function segmentStart(segment) { return Math.max(0, number(firstValue(segment?.graphicStartTime, segment?.relativeStartTime, segment?.startTime, segment?.start), 0)); }
+ function segmentDuration(segment) { return Math.max(0, number(firstValue(segment?.graphicDuration, segment?.durationOverride, segment?.duration, segment?.endTime != null ? number(segment.endTime) - segmentStart(segment) : null), 0)); }
+ function segmentIdentifier(segment) { return text(firstValue(segment?.segmentId, segment?.itemId, segment?.id, segment?._id)); }
+ function segmentPrompt(segment) { return text(firstValue(segment?.customPrompt, segment?.optimizedPrompt, segment?.motionPrompt, segment?.prompt, segment?.suggestedPromptEnhancements)); }
+ function segmentTemplateId(segment) { return text(firstValue(segment?.templateId, segment?.template?.id, segment?.selectedTemplateId)); }
+ function segmentCopy(segment, index) { return text(firstValue(segment?.title, segment?.text, segment?.spokenText, segment?.transcript, segment?.intent, `Beat ${index + 1}`)); }
+
+ function entityJoinKeys(entity) {
+ return unique([entity?.segmentId, entity?.itemId, entity?.storyboardSegmentId, entity?.storyboardItemId, entity?.segment?.id, entity?.item?.id]);
+ }
+
+ function sameJoinKey(left, right) {
+ const leftKeys = entityJoinKeys(left);
+ const rightKeys = entityJoinKeys(right);
+ return leftKeys.some(key => rightKeys.includes(key));
+ }
+
+ function sequenceScoped(items) {
+ const selected = text(state.selectedSequenceId);
+ const scoped = items.filter(item => text(firstValue(item?.sequenceId, item?.batchId, item?.parentSequenceId)) === selected);
+ return scoped.length ? scoped : items;
+ }
+
+ function joinBySegmentIdOrItemId(segment, items, index) {
+ const exact = items.find(item => sameJoinKey(segment, item));
+ if (exact) return exact;
+ return sequenceScoped(items)[index] || null;
+ }
+
+ function combinedJobs() {
+ const embedded = arrayFrom(state.sequence, ["jobs", "items", "renders"]);
+ const all = embedded.concat(state.jobs);
+ const seen = new Set();
+ return all.filter(job => {
+ const id = text(firstValue(job?.jobId, job?.id, job?._id));
+ const key = id || `${entityJoinKeys(job).join(":")}:${firstValue(job?.index, job?.segmentIndex, "")}`;
+ if (!key || seen.has(key)) return false;
+ seen.add(key);
+ return true;
+ });
+ }
+
+ function sequencePlacements() {
+ const placements = arrayFrom(state.sequence, ["placements", "placementResults", "timelineItems"]);
+ if (placements.length) return placements;
+ return arrayFrom(state.sequence?.result, ["placements", "items"]);
+ }
+
+ function jobId(job) { return text(firstValue(job?.jobId, job?.id, job?._id)); }
+ function inboxId(item) { return text(firstValue(item?.inboxId, item?.id, item?._id)); }
+ function actionId(item) { return text(firstValue(item?.operationId, item?.id, item?._id)); }
+
+ function inboxForRecord(segment, job, index) {
+ const jobIdentifier = jobId(job);
+ const scoped = sequenceScoped(state.inbox);
+ const exact = scoped.filter(item => {
+ if (jobIdentifier && text(item?.jobId) === jobIdentifier) return true;
+ return sameJoinKey(segment, item);
+ });
+ const candidates = exact.length ? exact : scoped.length === segmentsOf(state.draftStoryboard).length ? [scoped[index]] : [];
+ return candidates.filter(Boolean).sort((a, b) => (parseDate(firstValue(b.updatedAt, b.createdAt))?.getTime() || 0) - (parseDate(firstValue(a.updatedAt, a.createdAt))?.getTime() || 0))[0] || null;
+ }
+
+ function actionsForInbox(item) {
+ const id = inboxId(item);
+ if (!id) return [];
+ return state.actions.filter(action => text(firstValue(action?.inboxId, action?.premiereInboxId)) === id).sort((a, b) => (parseDate(firstValue(a.createdAt, a.updatedAt))?.getTime() || 0) - (parseDate(firstValue(b.createdAt, b.updatedAt))?.getTime() || 0));
+ }
+
+ function records() {
+ const segments = segmentsOf(state.draftStoryboard);
+ const jobs = combinedJobs();
+ const placements = sequencePlacements();
+ return segments.map((segment, index) => {
+ const job = joinBySegmentIdOrItemId(segment, jobs, index);
+ const placement = joinBySegmentIdOrItemId(segment, placements, index) || object(job?.placement);
+ const inbox = inboxForRecord(segment, job, index);
+ return { segment, index, job, placement, inbox, actions: actionsForInbox(inbox) };
+ });
+ }
+
+ function recordKey(record) {
+ return `${state.selectedSequenceId || "sequence"}:${segmentIdentifier(record?.segment) || `index-${record?.index}`}`;
+ }
+
+ function selectedRecord() {
+ return records()[state.selectedIndex] || null;
+ }
+
+ function templateFor(id) {
+ return state.templates.find(template => text(firstValue(template?.id, template?.templateId, template?.slug)) === text(id)) || null;
+ }
+
+ function templateName(id) {
+ const template = templateFor(id);
+ return text(firstValue(template?.name, template?.title, id, "No template"));
+ }
+
+ function extractGenerationPolicy(sequence, storyboard) {
+ const policy = firstValue(sequence?.originalGenerationPolicy, sequence?.generationPolicy, sequence?.policy, sequence?.generationOptions, sequence?.request?.generationPolicy, storyboard?.generationPolicy);
+ if (policy && typeof policy === "object") return clone(policy);
+ const legacyPolicy = {};
+ ["generator", "quality", "themeId", "renderMode", "qualityReview", "cacheMode", "priority", "maxRepairPasses", "maxSegmentDuration", "planningDensity", "assetResolutionMode", "origin"].forEach(key => {
+ if (sequence?.[key] !== undefined && sequence[key] !== null) legacyPolicy[key] = clone(sequence[key]);
+ });
+ return Object.keys(legacyPolicy).length ? legacyPolicy : null;
+ }
+
+ function setPresenceCard(id, mode, title, detail) {
+ const card = byId(id);
+ card.className = `presence-card is-${mode}`;
+ byId(`${id}Text`).textContent = title;
+ byId(`${id}Detail`).textContent = detail;
+ }
+
+ function presenceActive(presence) {
+ if (!presence || typeof presence !== "object") return false;
+ const explicit = firstValue(presence.connected, presence.online, presence.active, presence.present, presence.cepConnected);
+ if (explicit !== undefined) return Boolean(explicit);
+ const seen = parseDate(firstValue(presence.lastSeenAt, presence.updatedAt, presence.heartbeatAt));
+ return Boolean(seen && Date.now() - seen.getTime() < 20000);
+ }
+
+ function activeBatchFromPresence() {
+ return text(firstValue(state.presence?.activeBatchId, state.presence?.activeSequenceId, state.presence?.sequenceId, state.presence?.batchId));
+ }
+
+ function renderPresence() {
+ if (!state.bridgeChecked) {
+ setPresenceCard("bridgePresence", "checking", "Checking connection", "Waiting for the local health endpoint.");
+ } else if (state.bridgeOnline) {
+ const version = text(firstValue(state.health?.bridgeVersion, state.health?.version));
+ const activeJobs = number(firstValue(state.health?.activeJobs, state.health?.queue?.active), 0);
+ setPresenceCard("bridgePresence", "online", "UI server ready", "Generation and rendering are not connected.");
+ } else {
+ const pairing = /401|403|pair|token|unauthorized/i.test(text(state.bridgeError?.message));
+ setPresenceCard("bridgePresence", "offline", pairing ? "Pairing required" : "Bridge offline", pairing ? "Pair the companion from Templates or Renders." : "Start the Null Motion companion on port 4242.");
+ }
+
+ if (!state.presenceChecked) {
+ setPresenceCard("cepPresence", "checking", "Checking presence", "Waiting for the CEP heartbeat endpoint.");
+ return;
+ }
+ if (state.presenceError) {
+ setPresenceCard("cepPresence", "offline", "CEP presence unavailable", state.bridgeOnline ? "The presence endpoint did not respond." : "Bridge connection is required for a heartbeat.");
+ return;
+ }
+ if (presenceActive(state.presence)) {
+ const batch = activeBatchFromPresence();
+ const sequence = text(firstValue(state.presence?.sequenceName, state.presence?.activeSequenceName, state.presence?.expectedSequenceId));
+ setPresenceCard("cepPresence", "online", "Premiere panel present", sequence || (batch ? `Active batch ${batch.slice(0, 10)}` : "Heartbeat is current"));
+ } else {
+ const seen = firstValue(state.presence?.lastSeenAt, state.presence?.updatedAt, state.presence?.heartbeatAt);
+ setPresenceCard("cepPresence", state.presence ? "idle" : "offline", state.presence ? "No active CEP heartbeat" : "Premiere panel not detected", seen ? `Last seen ${formatRelativeDate(seen)}` : "Open the Null Motion CEP panel to connect.");
+ }
+ }
+
+ function renderSequencePicker() {
+ const picker = byId("sequencePicker");
+ const batches = state.batches.slice().sort((a, b) => (parseDate(firstValue(b.updatedAt, b.createdAt))?.getTime() || 0) - (parseDate(firstValue(a.updatedAt, a.createdAt))?.getTime() || 0));
+ picker.replaceChildren();
+ if (!batches.length && !state.selectedSequenceId) {
+ const option = document.createElement("option");
+ option.textContent = !state.bridgeChecked ? "Loading sequences…" : state.bridgeOnline ? "No sequences available" : "Bridge unavailable";
+ picker.appendChild(option);
+ picker.disabled = true;
+ return;
+ }
+ const knownIds = new Set();
+ for (const batch of batches) {
+ const id = batchId(batch);
+ if (!id || knownIds.has(id)) continue;
+ knownIds.add(id);
+ const option = document.createElement("option");
+ option.value = id;
+ option.textContent = `${sequenceTitle(batch, id)} · ${statusLabel(batch.status)}`;
+ picker.appendChild(option);
+ }
+ if (state.selectedSequenceId && !knownIds.has(state.selectedSequenceId)) {
+ const option = document.createElement("option");
+ option.value = state.selectedSequenceId;
+ option.textContent = sequenceTitle(state.sequence, state.selectedSequenceId);
+ picker.prepend(option);
+ }
+ picker.disabled = false;
+ picker.value = state.selectedSequenceId || picker.options[0]?.value || "";
+ }
+
+ function setPageState(mode, title, detail, hidden = false) {
+ const node = byId("pageState");
+ node.hidden = hidden;
+ node.className = `inline-state ${mode}`;
+ node.querySelector("strong").textContent = title;
+ node.querySelector(":scope > div > span").textContent = detail;
+ }
+
+ function renderPageState() {
+ if (!state.bridgeChecked) {
+ setPageState("loading", "Connecting to Null Motion", "Sequence controls appear when the local bridge responds.");
+ return;
+ }
+ if (!state.bridgeOnline && !state.sequence) {
+ setPageState("error", "Control Center is offline", state.bridgeError?.message || "Start the local companion and refresh this page.");
+ return;
+ }
+ if (state.selectedSequenceId && !state.sequence) {
+ setPageState("error", "Sequence could not be loaded", state.storyboardError?.message || `The bridge did not return sequence ${state.selectedSequenceId}.`);
+ return;
+ }
+ if (!state.selectedSequenceId) {
+ if (state.batchesError) {
+ setPageState("error", "Sequence history unavailable", state.batchesError.message || "The bridge could not load recent sequence batches.");
+ return;
+ }
+ setPageState("empty", "No sequence runs yet", "Sequence history will appear after a generation backend is connected.");
+ return;
+ }
+ if (state.storyboardError && !state.draftStoryboard) {
+ setPageState("error", "Storyboard unavailable", state.storyboardError.message || "This sequence did not return an editable storyboard.");
+ return;
+ }
+ setPageState("empty", "", "", true);
+ }
+
+ function renderSummary() {
+ const sequence = state.sequence;
+ const segments = segmentsOf(state.draftStoryboard);
+ const enabled = segments.filter(segment => segment.shouldRenderGraphic !== false).length;
+ const status = normalizeStatus(sequence?.status);
+ byId("sequenceSubtitle").textContent = sequence ? `${sequenceTitle(sequence, state.selectedSequenceId)} · ${statusLabel(status)}` : "Choose a sequence run to inspect its storyboard and output.";
+ byId("summaryStatus").textContent = sequence ? statusLabel(status) : "Waiting";
+ byId("summaryGraphics").textContent = segments.length ? `${enabled} of ${segments.length}` : "No storyboard";
+ const duration = sequenceDuration();
+ byId("summaryDuration").textContent = duration > 0 ? formatTime(duration) : "Not recorded";
+ byId("summaryUpdated").textContent = sequence ? formatRelativeDate(sequenceUpdatedAt(sequence, state.draftStoryboard)) : "—";
+ }
+
+ function jobStatusFor(record) {
+ return normalizeStatus(firstValue(record?.job?.status, record?.segment?.renderStatus, record?.segment?.status, "pending"));
+ }
+
+ function renderStoryboard() {
+ const list = byId("storyboardList");
+ const empty = byId("storyboardEmpty");
+ const items = records();
+ list.replaceChildren();
+ byId("storyboardCount").textContent = `${items.length} beat${items.length === 1 ? "" : "s"}`;
+ empty.hidden = items.length > 0;
+ list.hidden = items.length === 0;
+ for (const record of items) {
+ const segment = record.segment;
+ const button = document.createElement("button");
+ button.type = "button";
+ button.className = `storyboard-card${segment.shouldRenderGraphic === false ? " is-off" : ""}`;
+ button.dataset.index = String(record.index);
+ button.setAttribute("role", "option");
+ button.setAttribute("aria-selected", record.index === state.selectedIndex ? "true" : "false");
+ const ordinal = document.createElement("span");
+ ordinal.className = "storyboard-number";
+ ordinal.textContent = String(record.index + 1).padStart(2, "0");
+ const copy = document.createElement("span");
+ copy.className = "storyboard-copy";
+ const title = document.createElement("strong");
+ title.textContent = segmentCopy(segment, record.index);
+ title.title = title.textContent;
+ const rationale = document.createElement("span");
+ rationale.textContent = text(firstValue(segment.whyGraphic, segment.visualRationale, segment.intent, segment.semanticCategory, "No rationale recorded"));
+ const meta = document.createElement("small");
+ meta.textContent = `${formatTime(segmentStart(segment))} · ${segmentDuration(segment).toFixed(2)}s · ${templateName(segmentTemplateId(segment))}`;
+ copy.append(title, rationale, meta);
+ const status = document.createElement("span");
+ status.className = `card-state ${jobStatusFor(record)}`;
+ status.textContent = statusLabel(jobStatusFor(record));
+ button.append(ordinal, copy, status);
+ list.appendChild(button);
+ }
+ }
+
+ function timelineLanes(items) {
+ const laneEnds = [];
+ const lanes = new Map();
+ items.slice().sort((a, b) => segmentStart(a.segment) - segmentStart(b.segment)).forEach(record => {
+ const start = segmentStart(record.segment);
+ const end = start + Math.max(.05, segmentDuration(record.segment));
+ let lane = laneEnds.findIndex(laneEnd => laneEnd <= start);
+ if (lane < 0) lane = laneEnds.length;
+ laneEnds[lane] = end;
+ lanes.set(record.index, lane);
+ });
+ return { lanes, count: Math.max(1, laneEnds.length) };
+ }
+
+ function renderTimeline() {
+ const track = byId("timelineTrack");
+ const empty = byId("timelineEmpty");
+ const ruler = byId("timelineRuler");
+ const items = records();
+ const duration = Math.max(.001, sequenceDuration());
+ track.replaceChildren();
+ ruler.replaceChildren();
+ if (!items.length) {
+ track.hidden = true;
+ ruler.hidden = true;
+ empty.hidden = false;
+ byId("timelineHint").textContent = "No authored beats";
+ return;
+ }
+ track.hidden = false;
+ ruler.hidden = false;
+ empty.hidden = true;
+ for (let index = 0; index < 6; index += 1) {
+ const label = document.createElement("span");
+ label.textContent = formatTime(duration * index / 5, false);
+ ruler.appendChild(label);
+ }
+ const laneData = timelineLanes(items);
+ track.style.minHeight = `${18 + laneData.count * 49}px`;
+ for (const record of items) {
+ const start = segmentStart(record.segment);
+ const length = Math.max(.05, segmentDuration(record.segment));
+ const left = Math.min(99.5, start / duration * 100);
+ const width = Math.max(.7, Math.min(100 - left, length / duration * 100));
+ const button = document.createElement("button");
+ const status = jobStatusFor(record);
+ button.type = "button";
+ button.className = `timeline-beat ${status === "done" ? "is-done" : FAILURE_STATUSES.has(status) ? "is-error" : ""}${record.segment.shouldRenderGraphic === false ? " is-off" : ""}`;
+ button.dataset.index = String(record.index);
+ button.setAttribute("role", "option");
+ button.setAttribute("aria-selected", record.index === state.selectedIndex ? "true" : "false");
+ button.setAttribute("aria-label", `Beat ${record.index + 1}, ${segmentCopy(record.segment, record.index)}, starts ${formatTime(start)}, duration ${length.toFixed(2)} seconds, ${statusLabel(status)}`);
+ button.style.setProperty("--left", `${left}%`);
+ button.style.setProperty("--width", `${width}%`);
+ button.style.setProperty("--lane", String(laneData.lanes.get(record.index) || 0));
+ const label = document.createElement("b");
+ label.textContent = templateName(segmentTemplateId(record.segment));
+ const timing = document.createElement("span");
+ timing.textContent = formatTime(start);
+ button.append(label, timing);
+ track.appendChild(button);
+ }
+ byId("timelineHint").textContent = `${items.length} authored beat${items.length === 1 ? "" : "s"} across ${formatTime(duration, false)}`;
+ }
+
+ function qualityItems(segment) {
+ const raw = firstValue(segment?.qualityChecklist, segment?.acceptanceCriteria, segment?.reviewChecklist, segment?.qualityChecks);
+ if (!Array.isArray(raw)) return [];
+ const saved = object(segment?.qualityChecklistState);
+ return raw.map((entry, index) => {
+ const value = typeof entry === "string" ? { label: entry } : object(entry);
+ const label = text(firstValue(value.label, value.text, value.name, value.criterion, value.check, value.description));
+ const status = normalizeStatus(firstValue(value.status, value.result, ""));
+ const checked = saved[index] !== undefined ? Boolean(saved[index]) : Boolean(firstValue(value.checked, value.complete, value.passed, status === "done" || status === "pass"));
+ return { source: entry, index, label, checked };
+ }).filter(item => item.label);
+ }
+
+ function renderChecklist(record) {
+ const root = byId("qualityChecklist");
+ const empty = byId("checklistEmpty");
+ const items = qualityItems(record.segment);
+ root.replaceChildren();
+ empty.hidden = items.length > 0;
+ root.hidden = items.length === 0;
+ const checked = items.filter(item => item.checked).length;
+ byId("checklistProgress").textContent = items.length ? `${checked} of ${items.length} checked` : "No checklist";
+ for (const item of items) {
+ const label = document.createElement("label");
+ label.className = "check-item";
+ const input = document.createElement("input");
+ input.type = "checkbox";
+ input.checked = item.checked;
+ input.dataset.checkIndex = String(item.index);
+ const copy = document.createElement("span");
+ copy.textContent = item.label;
+ label.append(input, copy);
+ root.appendChild(label);
+ }
+ }
+
+ function customizerValueObject(segment, create = false) {
+ const keys = ["customizerValues", "customizations", "templateValues", "slotValues", "controls"];
+ for (const key of keys) {
+ if (segment?.[key] && typeof segment[key] === "object" && !Array.isArray(segment[key])) return { key, values: segment[key] };
+ }
+ if (!create) return { key: "customizerValues", values: {} };
+ segment.customizerValues = {};
+ return { key: "customizerValues", values: segment.customizerValues };
+ }
+
+ function customizerDefinitions(segment, template) {
+ const candidates = [template?.preview?.controls, template?.customizer?.fields, template?.customizer?.controls, template?.customizerControls, template?.editableControls, template?.controls, segment?.customizer?.controls, segment?.controlDefinitions];
+ const defaults = object(template?.customizer?.defaults);
+ for (const candidate of candidates) {
+ if (Array.isArray(candidate) && candidate.length) return candidate.map((definition, index) => {
+ const normalized = typeof definition === "string" ? { id: definition, label: definition } : Object.assign({ id: firstValue(definition?.id, definition?.key, definition?.name, `control-${index}`) }, object(definition));
+ const id = text(firstValue(normalized.id, normalized.key, normalized.name));
+ if (normalized.default === undefined && defaults[id] !== undefined) normalized.default = defaults[id];
+ return normalized;
+ });
+ if (candidate && typeof candidate === "object" && !Array.isArray(candidate) && Object.keys(candidate).length) return Object.entries(candidate).map(([id, definition]) => {
+ const normalized = typeof definition === "object" ? Object.assign({ id }, definition) : { id, label: id, default: definition };
+ if (normalized.default === undefined && defaults[id] !== undefined) normalized.default = defaults[id];
+ return normalized;
+ });
+ }
+ const current = customizerValueObject(segment).values;
+ return Object.keys(current).map(id => ({ id, label: id, type: typeof current[id] === "boolean" ? "boolean" : typeof current[id] === "number" ? "number" : "text" }));
+ }
+
+ function controlType(definition, value) {
+ const type = text(firstValue(definition?.type, definition?.control, definition?.kind)).toLowerCase();
+ if (Array.isArray(definition?.options) || ["select", "enum", "dropdown"].includes(type)) return "select";
+ if (["boolean", "toggle", "checkbox"].includes(type) || typeof value === "boolean") return "checkbox";
+ if (["color", "colour"].includes(type) || /^#[0-9a-f]{3,8}$/i.test(text(value))) return "color";
+ if (["number", "range", "slider"].includes(type) || typeof value === "number") return type === "range" || type === "slider" ? "range" : "number";
+ if (["textarea", "multiline", "long-text"].includes(type)) return "textarea";
+ return "text";
+ }
+
+ function renderCustomizer(record) {
+ const root = byId("customizerControls");
+ const empty = byId("customizerEmpty");
+ const template = templateFor(segmentTemplateId(record.segment));
+ const definitions = customizerDefinitions(record.segment, template);
+ const values = customizerValueObject(record.segment).values;
+ root.replaceChildren();
+ empty.hidden = definitions.length > 0;
+ root.hidden = definitions.length === 0;
+ byId("customizerCount").textContent = `${definitions.length} control${definitions.length === 1 ? "" : "s"}`;
+ for (const definition of definitions) {
+ const id = text(firstValue(definition.id, definition.key, definition.name));
+ if (!id) continue;
+ const current = values[id] !== undefined ? values[id] : firstValue(definition.value, definition.default, "");
+ const type = controlType(definition, current);
+ const label = document.createElement("label");
+ label.className = `field customizer-control${type === "textarea" ? " wide" : ""}`;
+ const caption = document.createElement("span");
+ caption.textContent = text(firstValue(definition.label, definition.title, definition.name, id)).replace(/[-_]/g, " ");
+ let input;
+ if (type === "select") {
+ input = document.createElement("select");
+ for (const optionValue of definition.options || []) {
+ const normalized = typeof optionValue === "object" ? optionValue : { value: optionValue, label: optionValue };
+ const option = document.createElement("option");
+ option.value = text(firstValue(normalized.value, normalized.id, normalized.label));
+ option.textContent = text(firstValue(normalized.label, normalized.name, normalized.value));
+ input.appendChild(option);
+ }
+ input.value = text(current);
+ } else if (type === "textarea") {
+ input = document.createElement("textarea");
+ input.rows = 3;
+ input.value = text(current);
+ } else {
+ input = document.createElement("input");
+ input.type = type;
+ if (type === "checkbox") input.checked = Boolean(current);
+ else input.value = text(current);
+ if (["number", "range"].includes(type)) {
+ if (definition.min !== undefined) input.min = definition.min;
+ if (definition.max !== undefined) input.max = definition.max;
+ input.step = firstValue(definition.step, "any");
+ }
+ }
+ input.dataset.controlId = id;
+ input.dataset.controlType = type;
+ label.append(caption, input);
+ root.appendChild(label);
+ }
+ }
+
+ function authoredPlayerPath(record) {
+ const template = templateFor(segmentTemplateId(record?.segment));
+ return firstValue(record?.segment?.preview?.playerPath, record?.segment?.authoredPreview?.playerPath, record?.segment?.playerPath, template?.preview?.playerPath, template?.playerPath);
+ }
+
+ function renderAuthoredPreview(record) {
+ const frame = byId("authoredFrame");
+ const empty = byId("authoredEmpty");
+ const badge = byId("authoredBadge");
+ const url = canonicalAuthoredPlayerUrl(authoredPlayerPath(record));
+ if (!url) {
+ frame.hidden = true;
+ frame.removeAttribute("src");
+ frame.dataset.source = "";
+ empty.hidden = false;
+ badge.textContent = "Unavailable";
+ badge.className = "preview-badge";
+ ["playPreview", "pausePreview", "restartPreview"].forEach(id => { byId(id).disabled = true; });
+ return;
+ }
+ empty.hidden = true;
+ frame.hidden = false;
+ if (frame.dataset.source !== url) {
+ frame.dataset.source = url;
+ frame.src = `${url}#play`;
+ }
+ badge.textContent = "Authored source";
+ badge.className = "preview-badge is-ready";
+ ["playPreview", "pausePreview", "restartPreview"].forEach(id => { byId(id).disabled = false; });
+ }
+
+ function renderedSources(record) {
+ if (FAILURE_STATUSES.has(jobStatusFor(record))) return { player: "", frame: "" };
+ const job = record?.job || {};
+ const preview = object(job.preview);
+ const instant = object(job.instantPreview);
+ const player = safeHttpUrl(firstValue(job.renderedPlayerUrl, job.playerUrl, preview.renderedPlayerUrl, preview.playerUrl, instant.playerUrl, job.instantPlayerUrl));
+ const instantUrl = safeHttpUrl(firstValue(job.instantPreviewUrl, instant.url, preview.instantUrl));
+ const frame = safeHttpUrl(firstValue(job.frameUrl, job.reviewFrameUrl, preview.frameUrl, instant.frameUrl, job.thumbUrl, job.thumbnailUrl));
+ const inferredInstantFrame = /\.(?:png|jpe?g|webp)(?:[?#]|$)/i.test(instantUrl) ? instantUrl : "";
+ const inferredInstantPlayer = instantUrl && !inferredInstantFrame ? instantUrl : "";
+ return { player: player || inferredInstantPlayer, frame: frame || inferredInstantFrame };
+ }
+
+ function renderRenderedPreview(record) {
+ const frame = byId("renderedFrame");
+ const image = byId("renderedImage");
+ const empty = byId("renderedEmpty");
+ const badge = byId("renderedBadge");
+ const caption = byId("renderedCaption");
+ const status = jobStatusFor(record);
+ const sources = renderedSources(record);
+ frame.hidden = true;
+ image.hidden = true;
+ empty.hidden = true;
+ if (sources.player) {
+ frame.hidden = false;
+ if (frame.dataset.source !== sources.player) { frame.dataset.source = sources.player; frame.src = sources.player; }
+ } else if (sources.frame) {
+ image.hidden = false;
+ if (image.dataset.source !== sources.frame) { image.dataset.source = sources.frame; image.src = sources.frame; }
+ image.alt = `${segmentCopy(record.segment, record.index)} rendered frame`;
+ } else {
+ empty.hidden = false;
+ empty.querySelector("strong").textContent = status === "done" ? "Preview URL not returned" : isTerminal(status) ? `Render ${statusLabel(status).toLowerCase()}` : "Rendered output pending";
+ empty.querySelector("span").textContent = status === "done" ? "The render completed without a player, instant preview, or sampled frame URL." : text(firstValue(record?.job?.error, record?.job?.step, `Current status: ${statusLabel(status)}.`));
+ }
+ badge.textContent = statusLabel(status);
+ badge.className = `preview-badge${status === "done" ? " is-ready" : FAILURE_STATUSES.has(status) ? " is-error" : ""}`;
+ const jobIdentifier = jobId(record?.job);
+ caption.textContent = jobIdentifier ? `Job ${jobIdentifier} · ${statusLabel(status)}${record?.job?.step ? ` · ${record.job.step}` : ""}` : state.jobsError ? `Render job library unavailable: ${state.jobsError.message}` : "No render job is joined to this storyboard beat.";
+ }
+
+ function existingReview(record) {
+ const saved = state.reviewByKey.get(recordKey(record));
+ if (saved) return saved;
+ const direct = firstValue(record?.job?.qualityReview, record?.job?.review, record?.segment?.qualityReview, record?.segment?.review);
+ if (direct) return direct;
+ if (record?.job?.qualityAudit || record?.job?.visualReview) return { qualityAudit: record.job.qualityAudit, visualReview: record.job.visualReview, pass: record.job.visualReview?.pass };
+ return null;
+ }
+
+ function reviewPassed(review) {
+ if (!review) return null;
+ const explicit = firstValue(review.pass, review.passed, review.accepted, review.ok, review.success);
+ if (explicit !== undefined) return Boolean(explicit);
+ const verdict = normalizeStatus(firstValue(review.status, review.verdict, review.result));
+ if (["pass", "passed", "accepted", "approved", "done"].includes(verdict)) return true;
+ if (["fail", "failed", "rejected", "error", "needs-repair"].includes(verdict)) return false;
+ return null;
+ }
+
+ function reviewChecks(review) {
+ const checks = arrayFrom(review, ["checks", "issues", "findings", "criteria", "results"])
+ .concat(arrayFrom(review?.qualityAudit, ["issues", "criticalIssues"]))
+ .concat(arrayFrom(review?.visualReview, ["criticalArtifacts", "frameNotes"]));
+ return checks.map(item => typeof item === "string" ? { text: item, passed: null } : {
+ text: text(firstValue(item?.label, item?.name, item?.message, item?.issue, item?.criterion, item?.description)),
+ passed: firstValue(item?.passed, item?.ok, normalizeStatus(item?.status) === "pass" ? true : normalizeStatus(item?.status) === "fail" ? false : null)
+ }).filter(item => item.text);
+ }
+
+ function setStatusPill(node, tone, label) {
+ node.className = `status-pill ${tone}`;
+ node.replaceChildren();
+ const mark = document.createElement("span");
+ mark.setAttribute("aria-hidden", "true");
+ node.append(mark, document.createTextNode(label));
+ }
+
+ function renderReview(record) {
+ const review = existingReview(record);
+ const body = byId("reviewBody");
+ const badge = byId("reviewBadge");
+ body.replaceChildren();
+ if (!review) {
+ const paragraph = document.createElement("p");
+ paragraph.textContent = "No rendered review has been run for this beat.";
+ body.appendChild(paragraph);
+ setStatusPill(badge, "neutral", "Not reviewed");
+ } else {
+ const passed = reviewPassed(review);
+ setStatusPill(badge, passed === true ? "success" : passed === false ? "error" : "warning", passed === true ? "Review passed" : passed === false ? "Repair advised" : "Review returned");
+ const summary = text(firstValue(review.summary, review.message, review.rationale, review.verdict, review.visualReview?.repairInstructions, Array.isArray(review.visualReview?.strengths) ? review.visualReview.strengths.join(" · ") : review.visualReview?.strengths));
+ if (summary) {
+ const paragraph = document.createElement("p");
+ paragraph.textContent = summary;
+ body.appendChild(paragraph);
+ }
+ const checks = reviewChecks(review);
+ if (checks.length) {
+ const list = document.createElement("ul");
+ list.className = "review-list";
+ for (const check of checks) {
+ const item = document.createElement("li");
+ item.className = check.passed === true ? "pass" : check.passed === false ? "fail" : "";
+ item.textContent = check.text;
+ list.appendChild(item);
+ }
+ body.appendChild(list);
+ }
+ if (!summary && !checks.length) {
+ const paragraph = document.createElement("p");
+ paragraph.textContent = "The review endpoint returned a result without a textual summary or checklist.";
+ body.appendChild(paragraph);
+ }
+ }
+ const done = jobStatusFor(record) === "done" && Boolean(jobId(record.job));
+ byId("reviewButton").disabled = !done || state.actionBusy;
+ byId("repairButton").disabled = !done || !review || reviewPassed(review) === true || state.actionBusy;
+ }
+
+ function actionStatus(action) { return normalizeStatus(firstValue(action?.status, action?.result?.status, action?.result, action?.error ? "error" : "pending")); }
+
+ function renderPremiere(record) {
+ const badge = byId("handoffBadge");
+ const history = byId("actionHistory");
+ const inbox = record.inbox;
+ const actions = record.actions;
+ const status = normalizeStatus(actions.length ? actionStatus(actions[actions.length - 1]) : inbox?.status || "pending");
+ setStatusPill(badge, inbox ? statusTone(status) : "neutral", inbox ? statusLabel(status) : "Not sent");
+ history.replaceChildren();
+ if (!inbox) {
+ const paragraph = document.createElement("p");
+ paragraph.textContent = state.inboxError ? `Premiere inbox unavailable: ${state.inboxError.message}` : "No Premiere actions for this beat.";
+ history.appendChild(paragraph);
+ } else {
+ const list = document.createElement("ul");
+ list.className = "history-list";
+ const inboxRow = { action: "send", status: inbox.status || "pending", createdAt: inbox.createdAt, updatedAt: inbox.updatedAt, error: inbox.error };
+ for (const entry of [inboxRow].concat(actions)) {
+ const item = document.createElement("li");
+ const entryStatus = normalizeStatus(firstValue(entry?.status, entry?.result?.status, entry?.error ? "error" : "pending"));
+ item.className = entryStatus;
+ const mark = document.createElement("i");
+ mark.setAttribute("aria-hidden", "true");
+ const copy = document.createElement("span");
+ const action = text(firstValue(entry?.action, "send")).replace(/-/g, " ");
+ copy.textContent = `${action.replace(/^./, letter => letter.toUpperCase())} · ${entry?.error || statusLabel(entryStatus)}`;
+ const time = document.createElement("time");
+ time.textContent = formatRelativeDate(firstValue(entry?.updatedAt, entry?.createdAt));
+ item.append(mark, copy, time);
+ list.appendChild(item);
+ }
+ history.appendChild(list);
+ if (state.actionsError) {
+ const paragraph = document.createElement("p");
+ paragraph.textContent = `Action history unavailable: ${state.actionsError.message}`;
+ paragraph.className = "history-error";
+ history.appendChild(paragraph);
+ }
+ }
+
+ const done = jobStatusFor(record) === "done" && Boolean(jobId(record.job));
+ const latestSuccessfulInsert = actions.some(action => text(action?.action) === "insert" && SUCCESS_STATUSES.has(actionStatus(action))) || status === "inserted";
+ const rolledBack = actions.some(action => text(action?.action) === "rollback" && SUCCESS_STATUSES.has(actionStatus(action)));
+ byId("sendCepButton").disabled = !done || state.actionBusy;
+ byId("saveBinButton").disabled = !inbox || state.actionBusy;
+ byId("insertButton").disabled = !inbox || state.actionBusy;
+ byId("rollbackButton").disabled = !inbox || !latestSuccessfulInsert || rolledBack || state.actionBusy;
+ }
+
+ function renderProposal() {
+ const panel = byId("proposalPanel");
+ const proposal = state.proposal;
+ panel.hidden = !proposal;
+ if (!proposal) return;
+ byId("proposalHeading").textContent = proposal.type === "analysis" ? "Beat analysis proposal" : "Prompt proposal";
+ byId("proposalBefore").textContent = proposal.before;
+ byId("proposalAfter").textContent = proposal.after;
+ const list = byId("proposalChanges");
+ list.replaceChildren();
+ const changes = proposal.changes.length ? proposal.changes : ["The endpoint returned no material field changes."];
+ for (const change of changes) {
+ const item = document.createElement("li");
+ item.textContent = change;
+ list.appendChild(item);
+ }
+ byId("applyProposal").disabled = proposal.changes.length === 0;
+ }
+
+ function renderInspector(forceEditor = false) {
+ const record = selectedRecord();
+ const preserveDirtyEditor = state.dirty && !forceEditor;
+ const empty = byId("inspectorEmpty");
+ const form = byId("inspectorForm");
+ empty.hidden = Boolean(record);
+ form.hidden = !record;
+ byId("dirtyState").textContent = state.dirty ? "Unsaved edits" : "No unsaved edits";
+ byId("dirtyState").classList.toggle("is-dirty", state.dirty);
+ if (!record) {
+ renderProposal();
+ return;
+ }
+ const segment = record.segment;
+ byId("selectedNumber").textContent = String(record.index + 1).padStart(2, "0");
+ byId("selectedTitle").textContent = segmentCopy(segment, record.index);
+ byId("selectedMeta").textContent = `${formatTime(segmentStart(segment))} · ${segmentDuration(segment).toFixed(2)} seconds · ${statusLabel(jobStatusFor(record))}`;
+ if (!preserveDirtyEditor) {
+ byId("segmentEnabled").checked = segment.shouldRenderGraphic !== false;
+ byId("promptEditor").value = segmentPrompt(segment);
+ byId("promptMeta").textContent = `${segmentPrompt(segment).length.toLocaleString()} characters · edits remain local until a revision is created.`;
+ byId("startTimeInput").value = String(segmentStart(segment));
+ byId("durationInput").value = String(segmentDuration(segment));
+ byId("absoluteTime").value = String(Math.max(0, number(firstValue(record.placement?.absoluteStartTime, record.job?.absoluteStartTime, record.placement?.startTime, segmentStart(segment)))));
+
+ const select = byId("templateSelect");
+ const currentTemplate = segmentTemplateId(segment);
+ select.replaceChildren();
+ const none = document.createElement("option");
+ none.value = "";
+ none.textContent = "No template selected";
+ select.appendChild(none);
+ const known = new Set();
+ for (const template of state.templates) {
+ const id = text(firstValue(template?.id, template?.templateId, template?.slug));
+ if (!id || known.has(id)) continue;
+ known.add(id);
+ const option = document.createElement("option");
+ option.value = id;
+ option.textContent = text(firstValue(template?.name, template?.title, id));
+ select.appendChild(option);
+ }
+ if (currentTemplate && !known.has(currentTemplate)) {
+ const option = document.createElement("option");
+ option.value = currentTemplate;
+ option.textContent = `${currentTemplate} · unavailable in current catalog`;
+ select.appendChild(option);
+ }
+ select.value = currentTemplate;
+ renderCustomizer(record);
+ renderChecklist(record);
+ }
+ const policy = state.originalGenerationPolicy;
+ byId("generationPolicy").textContent = policy ? JSON.stringify(policy, null, 2) : "No generation policy was recorded for this sequence.";
+ const revisionConflict = state.remoteChangedWhileDirty ? "The remote sequence changed after editing began. Saving may return a conflict; your local edits have not been overwritten." : "The original sequence stays available.";
+ byId("revisionNote").textContent = revisionConflict;
+ byId("saveDraftButton").disabled = !state.dirty || state.actionBusy;
+ byId("renderRevisionButton").disabled = state.actionBusy;
+ renderAuthoredPreview(record);
+ renderRenderedPreview(record);
+ renderReview(record);
+ renderPremiere(record);
+ renderProposal();
+ }
+
+ function renderAll(forceEditor = false) {
+ renderPresence();
+ renderSequencePicker();
+ renderPageState();
+ renderSummary();
+ renderStoryboard();
+ renderTimeline();
+ renderInspector(forceEditor);
+ }
+
+ function updatedSignature(sequence, storyboard) {
+ return text(sequenceUpdatedAt(sequence, storyboard) || `${segmentsOf(storyboard).length}:${sequence?.status || ""}`);
+ }
+
+ function hydrateDraft(sequence, storyboard) {
+ state.originalStoryboard = storyboard ? clone(storyboard) : null;
+ state.draftStoryboard = storyboard ? clone(storyboard) : null;
+ state.storyboard = storyboard || null;
+ state.originalGenerationPolicy = extractGenerationPolicy(sequence, storyboard);
+ state.baseUpdatedAt = sequenceUpdatedAt(sequence, storyboard);
+ state.hydratedUpdatedAt = updatedSignature(sequence, storyboard);
+ state.dirty = false;
+ state.remoteChangedWhileDirty = false;
+ state.proposal = null;
+ const count = segmentsOf(state.draftStoryboard).length;
+ state.selectedIndex = count ? Math.min(Math.max(state.selectedIndex, 0), count - 1) : -1;
+ }
+
+ function applySequenceBundle(id, bundle) {
+ const previousId = state.selectedSequenceId;
+ const changedSelection = previousId !== id;
+ state.selectedSequenceId = id;
+ state.sequence = bundle.sequence;
+ state.storyboardError = bundle.storyboardError || null;
+ const signature = updatedSignature(bundle.sequence, bundle.storyboard);
+ if (changedSelection || !state.draftStoryboard) {
+ state.selectedIndex = segmentsOf(bundle.storyboard).length ? 0 : -1;
+ hydrateDraft(bundle.sequence, bundle.storyboard);
+ return;
+ }
+ if (state.dirty) {
+ if (state.hydratedUpdatedAt && signature && signature !== state.hydratedUpdatedAt) state.remoteChangedWhileDirty = true;
+ return;
+ }
+ if (signature !== state.hydratedUpdatedAt || bundle.storyboard !== state.storyboard) hydrateDraft(bundle.sequence, bundle.storyboard);
+ }
+
+ async function fetchSequenceBundle(id, signal) {
+ const sequencePayload = await api(`/api/v1/sequences/${encodeURIComponent(id)}`, { signal });
+ const sequence = unwrapSequence(sequencePayload);
+ if (!Object.keys(sequence).length) throw new ApiError("The sequence endpoint returned an empty response.", 502, `/api/v1/sequences/${id}`);
+ let storyboard = sequence.storyboard && typeof sequence.storyboard === "object" ? unwrapStoryboard(sequence.storyboard) : null;
+ let storyboardError = null;
+ const storyboardId = text(firstValue(sequence.storyboardId, sequence.storyboard?.id, sequence.storyboard?.storyboardId, sequencePayload?.storyboardId, id));
+ if (!storyboard || !segmentsOf(storyboard).length) {
+ try {
+ const payload = await api(`/api/v1/storyboards/${encodeURIComponent(storyboardId)}`, { signal });
+ const fetched = unwrapStoryboard(payload);
+ if (Object.keys(fetched).length) storyboard = fetched;
+ } catch (error) {
+ if (error?.name === "AbortError") throw error;
+ storyboardError = error;
+ }
+ }
+ return { sequence, storyboard, storyboardError };
+ }
+
+ function selectionCandidates() {
+ const query = new URLSearchParams(location.search);
+ const urlSequenceId = text(firstValue(query.get("sequence"), query.get("sequenceId"), query.get("batchId")));
+ const cepActiveBatchId = activeBatchFromPresence();
+ const savedSequenceId = text(storageGet(SAVED_SEQUENCE_KEY));
+ const newestSequenceId = batchId(state.batches.slice().sort((a, b) => (parseDate(firstValue(b.updatedAt, b.createdAt))?.getTime() || 0) - (parseDate(firstValue(a.updatedAt, a.createdAt))?.getTime() || 0))[0]);
+ return unique([urlSequenceId, cepActiveBatchId, savedSequenceId, newestSequenceId]);
+ }
+
+ function persistSelection(id) {
+ storageSet(SAVED_SEQUENCE_KEY, id);
+ try {
+ const url = new URL(location.href);
+ url.searchParams.set("sequence", id);
+ url.searchParams.delete("sequenceId");
+ url.searchParams.delete("batchId");
+ history.replaceState(null, "", url);
+ } catch (_) {}
+ }
+
+ async function resolveInitialSelection(signal) {
+ const candidates = selectionCandidates();
+ let lastError = null;
+ for (const id of candidates) {
+ try {
+ const bundle = await fetchSequenceBundle(id, signal);
+ applySequenceBundle(id, bundle);
+ persistSelection(id);
+ state.initializedSelection = true;
+ return;
+ } catch (error) {
+ if (error?.name === "AbortError") throw error;
+ lastError = error;
+ }
+ }
+ state.initializedSelection = true;
+ if (lastError && candidates.length) state.storyboardError = lastError;
+ }
+
+ async function refreshSelectedSequence(signal) {
+ if (!state.selectedSequenceId) return;
+ try {
+ const bundle = await fetchSequenceBundle(state.selectedSequenceId, signal);
+ applySequenceBundle(state.selectedSequenceId, bundle);
+ } catch (error) {
+ if (error?.name === "AbortError") throw error;
+ state.storyboardError = error;
+ if (!state.sequence) state.sequence = null;
+ }
+ }
+
+ async function refreshCycle(signal, generation) {
+ const [health, presence, catalog, theme, batches, jobs, inbox, actions] = await Promise.all([
+ settled(api("/api/v1/health", { signal })),
+ settled(api("/api/v1/premiere-presence", { signal })),
+ settled(api("/api/v1/templates", { signal })),
+ settled(api("/api/user/active-theme", { signal })),
+ settled(api("/api/v1/sequence-batches?limit=60", { signal })),
+ settled(api("/api/v1/jobs", { signal })),
+ settled(api("/api/v1/premiere-inbox?status=pending,claimed,inserted,dismissed&limit=200", { signal })),
+ settled(api("/api/v1/premiere-actions?limit=200", { signal }))
+ ]);
+ if (generation !== pollGeneration || signal.aborted) return;
+
+ state.bridgeChecked = true;
+ state.bridgeOnline = health.ok;
+ state.bridgeError = health.ok ? null : health.error;
+ if (health.ok) state.health = health.value;
+ state.presenceChecked = true;
+ state.presenceError = presence.ok ? null : presence.error;
+ if (presence.ok) state.presence = object(presence.value?.presence || presence.value);
+ state.templatesError = catalog.ok ? null : catalog.error;
+ if (catalog.ok) state.templates = arrayFrom(catalog.value, ["templates", "items"]);
+ state.themeError = theme.ok ? null : theme.error;
+ if (theme.ok) state.theme = theme.value?.theme || theme.value?.activeTheme || null;
+ state.batchesError = batches.ok ? null : batches.error;
+ if (batches.ok) state.batches = arrayFrom(batches.value, ["batches", "sequences", "items"]);
+ state.jobsError = jobs.ok ? null : jobs.error;
+ if (jobs.ok) state.jobs = arrayFrom(jobs.value, ["jobs", "items"]);
+ state.inboxError = inbox.ok ? null : inbox.error;
+ if (inbox.ok) state.inbox = arrayFrom(inbox.value, ["items", "inbox", "entries"]);
+ state.actionsError = actions.ok ? null : actions.error;
+ if (actions.ok) state.actions = arrayFrom(actions.value, ["actions", "items", "entries"]);
+
+ if (!state.selectedSequenceId) await resolveInitialSelection(signal);
+ else await refreshSelectedSequence(signal);
+ if (generation !== pollGeneration || signal.aborted) return;
+ renderAll();
+ }
+
+ function startPolling(delay = 0) {
+ pollGeneration += 1;
+ const generation = pollGeneration;
+ clearTimeout(pollTimer);
+ pollController?.abort();
+
+ const run = async () => {
+ if (generation !== pollGeneration) return;
+ if (document.hidden) {
+ pollTimer = setTimeout(run, POLL_OFFLINE_MS);
+ return;
+ }
+ const controller = new AbortController();
+ pollController = controller;
+ byId("refreshButton").classList.add("is-busy");
+ try {
+ await refreshCycle(controller.signal, generation);
+ } catch (error) {
+ if (error?.name !== "AbortError") {
+ state.bridgeChecked = true;
+ state.bridgeOnline = false;
+ state.bridgeError = error;
+ renderAll();
+ }
+ } finally {
+ if (pollController === controller) pollController = null;
+ byId("refreshButton").classList.remove("is-busy");
+ if (generation === pollGeneration) pollTimer = setTimeout(run, state.bridgeOnline ? POLL_ONLINE_MS : POLL_OFFLINE_MS);
+ }
+ };
+
+ pollTimer = setTimeout(run, delay);
+ }
+
+ function markDirty() {
+ state.dirty = true;
+ byId("dirtyState").textContent = "Unsaved edits";
+ byId("dirtyState").classList.add("is-dirty");
+ byId("saveDraftButton").disabled = state.actionBusy;
+ }
+
+ function selectRecord(index, focus = false) {
+ const count = segmentsOf(state.draftStoryboard).length;
+ if (!count) return;
+ state.selectedIndex = Math.max(0, Math.min(count - 1, Number(index) || 0));
+ state.proposal = null;
+ renderStoryboard();
+ renderTimeline();
+ renderInspector(true);
+ if (focus) byId("inspectorHeading").scrollIntoView({ behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth", block: "start" });
+ }
+
+ function updateSegmentPrompt(value) {
+ const record = selectedRecord();
+ if (!record) return;
+ record.segment.customPrompt = value;
+ markDirty();
+ byId("promptMeta").textContent = `${value.length.toLocaleString()} characters · unsaved local edit.`;
+ }
+
+ function updateTiming() {
+ const record = selectedRecord();
+ if (!record) return;
+ const durationLimit = sequenceDuration();
+ const start = Math.max(0, number(byId("startTimeInput").value));
+ const duration = Math.max(.1, number(byId("durationInput").value, .1));
+ record.segment.graphicStartTime = durationLimit ? Math.min(start, durationLimit) : start;
+ record.segment.graphicDuration = duration;
+ record.segment.durationOverride = duration;
+ byId("startTimeInput").value = String(record.segment.graphicStartTime);
+ byId("durationInput").value = String(duration);
+ if (firstValue(record.placement?.absoluteStartTime, record.job?.absoluteStartTime, record.placement?.startTime) === undefined) byId("absoluteTime").value = String(record.segment.graphicStartTime);
+ markDirty();
+ renderTimeline();
+ renderStoryboard();
+ byId("selectedMeta").textContent = `${formatTime(record.segment.graphicStartTime)} · ${duration.toFixed(2)} seconds · ${statusLabel(jobStatusFor(record))}`;
+ }
+
+ function proposalSummary(patch) {
+ const summary = {};
+ if (patch.customPrompt !== undefined) summary.prompt = patch.customPrompt;
+ if (patch.graphicStartTime !== undefined) summary.startTime = patch.graphicStartTime;
+ if (patch.graphicDuration !== undefined) summary.duration = patch.graphicDuration;
+ if (patch.templateId !== undefined) summary.template = patch.templateId;
+ if (patch.customizerValues !== undefined) summary.customizer = patch.customizerValues;
+ return JSON.stringify(summary, null, 2);
+ }
+
+ function currentProposalSummary(segment, patch) {
+ const current = {};
+ if (patch.customPrompt !== undefined) current.prompt = segmentPrompt(segment);
+ if (patch.graphicStartTime !== undefined) current.startTime = segmentStart(segment);
+ if (patch.graphicDuration !== undefined) current.duration = segmentDuration(segment);
+ if (patch.templateId !== undefined) current.template = segmentTemplateId(segment);
+ if (patch.customizerValues !== undefined) current.customizer = clone(customizerValueObject(segment).values);
+ return JSON.stringify(current, null, 2);
+ }
+
+ function changesForPatch(segment, patch) {
+ const changes = [];
+ if (patch.customPrompt !== undefined && text(patch.customPrompt) !== segmentPrompt(segment)) changes.push("Production prompt changed");
+ if (patch.graphicStartTime !== undefined && number(patch.graphicStartTime) !== segmentStart(segment)) changes.push(`Start moves from ${formatTime(segmentStart(segment))} to ${formatTime(patch.graphicStartTime)}`);
+ if (patch.graphicDuration !== undefined && number(patch.graphicDuration) !== segmentDuration(segment)) changes.push(`Duration changes from ${segmentDuration(segment).toFixed(2)}s to ${number(patch.graphicDuration).toFixed(2)}s`);
+ if (patch.templateId !== undefined && text(patch.templateId) !== segmentTemplateId(segment)) changes.push(`Template changes from ${templateName(segmentTemplateId(segment))} to ${templateName(patch.templateId)}`);
+ if (patch.customizerValues !== undefined && JSON.stringify(patch.customizerValues) !== JSON.stringify(customizerValueObject(segment).values)) changes.push("Template customizer values changed");
+ return changes;
+ }
+
+ function setProposal(type, patch) {
+ const record = selectedRecord();
+ if (!record) return;
+ state.proposal = {
+ type,
+ patch,
+ before: currentProposalSummary(record.segment, patch),
+ after: proposalSummary(patch),
+ changes: changesForPatch(record.segment, patch)
+ };
+ renderProposal();
+ byId("proposalPanel").scrollIntoView({ behavior: matchMedia("(prefers-reduced-motion: reduce)").matches ? "auto" : "smooth", block: "nearest" });
+ }
+
+ function policyValue(...keys) {
+ for (const key of keys) {
+ const value = state.originalGenerationPolicy?.[key];
+ if (value !== undefined && value !== null && value !== "") return value;
+ const sequenceValue = state.sequence?.[key];
+ if (sequenceValue !== undefined && sequenceValue !== null && sequenceValue !== "") return sequenceValue;
+ }
+ return undefined;
+ }
+
+ async function reprompt() {
+ const record = selectedRecord();
+ if (!record) return;
+ const prompt = segmentPrompt(record.segment).trim();
+ if (!prompt) { showToast("This beat has no prompt to optimize.", true); return; }
+ const button = byId("repromptButton");
+ setBusy(button, true, "Building proposal…");
+ try {
+ const info = sequenceInfo();
+ const response = await api("/api/prompts/optimize", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ prompt,
+ generator: policyValue("generator", "provider"),
+ engine: policyValue("engine", "backend") || "hyperframes",
+ duration: segmentDuration(record.segment),
+ width: info.width || undefined,
+ height: info.height || undefined,
+ fps: info.fps || undefined,
+ outputSpec: {
+ duration: segmentDuration(record.segment),
+ width: info.width || undefined,
+ height: info.height || undefined,
+ fps: info.fps || undefined
+ },
+ themeId: firstValue(state.theme?.id, policyValue("themeId")),
+ templateId: segmentTemplateId(record.segment),
+ origin: "website-control-center"
+ })
+ });
+ const proposed = text(firstValue(response?.optimizedPrompt, response?.prompt, response?.result?.optimizedPrompt)).trim();
+ if (!proposed) throw new Error("The optimizer returned no reviewable prompt.");
+ setProposal("prompt", { customPrompt: proposed });
+ } catch (error) {
+ showToast(error.message || "Could not create a prompt proposal.", true);
+ } finally { setBusy(button, false); }
+ }
+
+ function findProposedSegment(storyboard, current, index) {
+ const candidates = segmentsOf(storyboard);
+ const id = segmentIdentifier(current);
+ return candidates.find(candidate => id && segmentIdentifier(candidate) === id) || candidates[index] || null;
+ }
+
+ async function reanalyze() {
+ const record = selectedRecord();
+ if (!record) return;
+ const transcript = text(firstValue(state.sequence?.transcript, state.sequence?.sourceTranscript, state.draftStoryboard?.transcript, state.draftStoryboard?.source, record.segment?.text, record.segment?.spokenText)).trim();
+ if (!transcript) { showToast("No transcript text is available for re-analysis.", true); return; }
+ const button = byId("reanalyzeButton");
+ setBusy(button, true, "Analyzing beat…");
+ try {
+ const response = await api("/api/v1/psychology-analyze", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ transcript,
+ sequenceInfo: sequenceInfo(),
+ userPrompt: `Re-analyze storyboard beat ${record.index + 1} without applying changes. Current production prompt:\n${segmentPrompt(record.segment)}`,
+ generator: policyValue("generator", "provider"),
+ mode: "control-center-reanalysis",
+ origin: "website-control-center",
+ deepAnalysis: true,
+ directorMode: "review",
+ themeId: firstValue(state.theme?.id, policyValue("themeId")),
+ focusSegmentId: segmentIdentifier(record.segment) || undefined
+ })
+ });
+ const proposedSegment = response?.segment || findProposedSegment(response?.storyboard || response, record.segment, record.index);
+ if (!proposedSegment) throw new Error("The analysis returned no matching storyboard beat.");
+ const patch = {};
+ const proposedPrompt = segmentPrompt(proposedSegment);
+ if (proposedPrompt) patch.customPrompt = proposedPrompt;
+ const proposedStart = firstValue(proposedSegment.graphicStartTime, proposedSegment.relativeStartTime, proposedSegment.startTime);
+ const proposedDuration = firstValue(proposedSegment.graphicDuration, proposedSegment.durationOverride, proposedSegment.duration);
+ const proposedTemplate = segmentTemplateId(proposedSegment);
+ if (proposedStart !== undefined) patch.graphicStartTime = number(proposedStart);
+ if (proposedDuration !== undefined) patch.graphicDuration = Math.max(.1, number(proposedDuration, segmentDuration(record.segment)));
+ if (proposedTemplate) patch.templateId = proposedTemplate;
+ const proposedCustomizer = customizerValueObject(proposedSegment).values;
+ if (Object.keys(proposedCustomizer).length) patch.customizerValues = clone(proposedCustomizer);
+ if (!Object.keys(patch).length) throw new Error("The analysis returned no reviewable field proposal.");
+ setProposal("analysis", patch);
+ } catch (error) {
+ showToast(error.message || "Could not create an analysis proposal.", true);
+ } finally { setBusy(button, false); }
+ }
+
+ function applyProposal() {
+ const record = selectedRecord();
+ const proposal = state.proposal;
+ if (!record || !proposal) return;
+ const patch = proposal.patch;
+ if (patch.customPrompt !== undefined) record.segment.customPrompt = text(patch.customPrompt);
+ if (patch.graphicStartTime !== undefined) record.segment.graphicStartTime = Math.max(0, number(patch.graphicStartTime));
+ if (patch.graphicDuration !== undefined) {
+ record.segment.graphicDuration = Math.max(.1, number(patch.graphicDuration));
+ record.segment.durationOverride = record.segment.graphicDuration;
+ }
+ if (patch.templateId !== undefined) record.segment.templateId = text(patch.templateId);
+ if (patch.customizerValues !== undefined) record.segment.customizerValues = clone(patch.customizerValues);
+ state.proposal = null;
+ markDirty();
+ renderAll(true);
+ showToast("Proposal applied locally. Create a revision to save it.");
+ }
+
+ function revisionPayload({ render, repair = false }) {
+ const originalPolicy = clone(state.originalGenerationPolicy || {});
+ const generationPolicy = clone(originalPolicy);
+ if (repair) {
+ generationPolicy.cacheMode = "refresh";
+ generationPolicy.qualityReview = "strict";
+ generationPolicy.reviewMode = "strict";
+ generationPolicy.maxRepairPasses = Math.max(1, number(generationPolicy.maxRepairPasses, 1));
+ }
+ return {
+ baseUpdatedAt: state.baseUpdatedAt || null,
+ storyboard: clone(state.draftStoryboard),
+ editedStoryboard: clone(state.draftStoryboard),
+ generationPolicy,
+ originalGenerationPolicy: originalPolicy,
+ render: Boolean(render),
+ cacheMode: repair ? "refresh" : firstValue(generationPolicy.cacheMode, "use"),
+ qualityReview: repair ? "strict" : generationPolicy.qualityReview,
+ revisionType: repair ? "repair" : render ? "render" : "draft",
+ preserveOriginal: true,
+ origin: "website-control-center"
+ };
+ }
+
+ function responseSequenceId(response) {
+ return text(firstValue(response?.sequenceId, response?.batchId, response?.revisionId, response?.sequence?.id, response?.revision?.id, response?.id));
+ }
+
+ async function createRevision(render) {
+ if (!state.selectedSequenceId || !state.draftStoryboard) return;
+ const button = render ? byId("renderRevisionButton") : byId("saveDraftButton");
+ state.actionBusy = true;
+ renderInspector();
+ setBusy(button, true, render ? "Starting revision…" : "Saving draft…");
+ try {
+ const response = await api(`/api/v1/sequences/${encodeURIComponent(state.selectedSequenceId)}/revisions`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(revisionPayload({ render }))
+ });
+ const id = responseSequenceId(response);
+ state.dirty = false;
+ state.remoteChangedWhileDirty = false;
+ if (id && id !== state.selectedSequenceId) {
+ state.selectedSequenceId = id;
+ state.sequence = null;
+ state.draftStoryboard = null;
+ state.initializedSelection = true;
+ persistSelection(id);
+ } else if (response?.sequence || response?.storyboard) {
+ const sequence = unwrapSequence(response.sequence || response);
+ const storyboard = response.storyboard ? unwrapStoryboard(response.storyboard) : state.draftStoryboard;
+ applySequenceBundle(state.selectedSequenceId, { sequence, storyboard, storyboardError: null });
+ }
+ showToast(render ? "Render revision created." : "Draft revision saved.");
+ startPolling(0);
+ } catch (error) {
+ if (error?.status === 409) state.remoteChangedWhileDirty = true;
+ showToast(error.message || "Could not create the revision.", true);
+ } finally {
+ state.actionBusy = false;
+ setBusy(button, false);
+ renderInspector();
+ }
+ }
+
+ async function runQualityReview() {
+ const record = selectedRecord();
+ if (!record || !jobId(record.job)) return;
+ const button = byId("reviewButton");
+ state.actionBusy = true;
+ setBusy(button, true, "Reviewing frames…");
+ renderInspector();
+ try {
+ const sources = renderedSources(record);
+ const info = sequenceInfo();
+ const response = await api("/api/quality/review", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ jobId: jobId(record.job),
+ sequenceId: state.selectedSequenceId,
+ segmentId: segmentIdentifier(record.segment) || undefined,
+ duration: segmentDuration(record.segment),
+ fps: info.fps || undefined,
+ width: info.width || undefined,
+ height: info.height || undefined,
+ prompt: segmentPrompt(record.segment),
+ themeId: firstValue(state.theme?.id, policyValue("themeId")),
+ generator: policyValue("generator", "provider"),
+ qualityChecklist: qualityItems(record.segment).map(item => item.label),
+ playerUrl: sources.player || undefined,
+ frameUrl: sources.frame || undefined,
+ persist: true,
+ mode: "strict",
+ origin: "website-control-center"
+ })
+ });
+ const review = response?.review || response?.qualityReview || response?.result || response;
+ state.reviewByKey.set(recordKey(record), review);
+ showToast(reviewPassed(review) === true ? "Quality review passed." : "Quality review is ready.");
+ } catch (error) {
+ showToast(error.message || "Quality review failed.", true);
+ } finally {
+ state.actionBusy = false;
+ setBusy(button, false);
+ renderInspector();
+ }
+ }
+
+ async function repairRevision() {
+ const record = selectedRecord();
+ if (!record || !state.selectedSequenceId || !state.draftStoryboard) return;
+ const button = byId("repairButton");
+ state.actionBusy = true;
+ setBusy(button, true, "Creating repair…");
+ renderInspector();
+ try {
+ const payload = revisionPayload({ render: true, repair: true });
+ payload.repairSegmentId = segmentIdentifier(record.segment) || undefined;
+ payload.repairFromJobId = jobId(record.job) || undefined;
+ payload.qualityReviewResult = clone(existingReview(record));
+ const response = await api(`/api/v1/sequences/${encodeURIComponent(state.selectedSequenceId)}/revisions`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload)
+ });
+ const id = responseSequenceId(response);
+ showToast(id ? `Repair revision ${id.slice(0, 10)} created; original preserved.` : "Repair revision created; original preserved.");
+ startPolling(0);
+ } catch (error) {
+ showToast(error.message || "Could not create the repair revision.", true);
+ } finally {
+ state.actionBusy = false;
+ setBusy(button, false);
+ renderInspector();
+ }
+ }
+
+ function currentPlacement(record) {
+ const mode = byId("placementMode").value;
+ const absoluteTime = Math.max(0, number(byId("absoluteTime").value, segmentStart(record.segment)));
+ const expectedSequenceId = text(firstValue(state.presence?.activeSequenceId, state.presence?.expectedSequenceId, state.sequence?.expectedSequenceId));
+ return {
+ mode,
+ placementMode: mode,
+ currentPlayhead: mode === "currentPlayhead",
+ absoluteTime: mode === "absoluteTime" ? absoluteTime : undefined,
+ expectedSequenceId: expectedSequenceId || undefined
+ };
+ }
+
+ async function sendToCep() {
+ const record = selectedRecord();
+ if (!record || !jobId(record.job)) return;
+ const button = byId("sendCepButton");
+ const placement = currentPlacement(record);
+ state.actionBusy = true;
+ setBusy(button, true, "Sending…");
+ renderInspector();
+ try {
+ const payload = {
+ jobId: jobId(record.job),
+ title: segmentCopy(record.segment, record.index),
+ placementMode: placement.placementMode,
+ currentPlayhead: placement.currentPlayhead,
+ absoluteTime: placement.absoluteTime,
+ expectedSequenceId: placement.expectedSequenceId
+ };
+ Object.keys(payload).forEach(key => payload[key] === undefined && delete payload[key]);
+ const response = await api("/api/v1/premiere-inbox", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload)
+ });
+ const item = response?.inbox || response?.item || response?.entry || response;
+ if (item && typeof item === "object") state.inbox.push(item);
+ showToast(presenceActive(state.presence) ? "Sent to the Premiere panel." : "Queued for CEP; the panel is not currently present.");
+ startPolling(500);
+ } catch (error) {
+ showToast(error.message || "Could not send this render to CEP.", true);
+ } finally {
+ state.actionBusy = false;
+ setBusy(button, false);
+ renderInspector();
+ }
+ }
+
+ function operationId() {
+ if (globalThis.crypto?.randomUUID) return globalThis.crypto.randomUUID();
+ return `control-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
+ }
+
+ async function premiereAction(action) {
+ const record = selectedRecord();
+ if (!record?.inbox || !inboxId(record.inbox)) return;
+ const button = ({ save: byId("saveBinButton"), insert: byId("insertButton"), rollback: byId("rollbackButton") })[action];
+ const placement = currentPlacement(record);
+ state.actionBusy = true;
+ setBusy(button, true, action === "save" ? "Saving…" : action === "insert" ? "Inserting…" : "Rolling back…");
+ renderInspector();
+ try {
+ const payload = { operationId: operationId(), action };
+ if (action === "insert") payload.placement = placement;
+ const response = await api(`/api/v1/premiere-inbox/${encodeURIComponent(inboxId(record.inbox))}/actions`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(payload)
+ });
+ const result = response?.action || response?.item || response?.result || response;
+ if (result && typeof result === "object") state.actions.push(Object.assign({ inboxId: inboxId(record.inbox), action }, result));
+ showToast(action === "save" ? "Save-to-bin action queued." : action === "insert" ? "Insert action queued." : "Rollback action queued.");
+ startPolling(500);
+ } catch (error) {
+ showToast(error.message || `Premiere ${action} failed.`, true);
+ } finally {
+ state.actionBusy = false;
+ setBusy(button, false);
+ renderInspector();
+ }
+ }
+
+ function controlAuthored(action) {
+ const frame = byId("authoredFrame");
+ const source = frame.dataset.source;
+ if (!source) return;
+ try {
+ const timelines = Object.values(frame.contentWindow.__timelines || {});
+ if (timelines.length) {
+ timelines.forEach(timeline => {
+ if (action === "play") timeline.play?.();
+ if (action === "pause") timeline.pause?.();
+ if (action === "restart") timeline.restart?.();
+ });
+ return;
+ }
+ } catch (_) {}
+ if (action === "pause") frame.src = source;
+ else if (action === "play") frame.src = `${source}#play`;
+ else {
+ frame.src = "about:blank";
+ setTimeout(() => { frame.src = `${source}#play`; }, 0);
+ }
+ }
+
+ function confirmSequenceChange() {
+ return !state.dirty || window.confirm("Discard the unsaved edits for this sequence and open another one?");
+ }
+
+ function bindEvents() {
+ byId("refreshButton").addEventListener("click", () => startPolling(0));
+ byId("sequencePicker").addEventListener("change", event => {
+ const next = event.target.value;
+ if (!next || next === state.selectedSequenceId) return;
+ if (!confirmSequenceChange()) { event.target.value = state.selectedSequenceId; return; }
+ state.selectedSequenceId = next;
+ state.sequence = null;
+ state.storyboard = null;
+ state.draftStoryboard = null;
+ state.originalStoryboard = null;
+ state.selectedIndex = -1;
+ state.dirty = false;
+ state.proposal = null;
+ state.initializedSelection = true;
+ persistSelection(next);
+ renderAll();
+ startPolling(0);
+ });
+
+ function activateListItem(event, selector) {
+ const button = event.target.closest(selector);
+ if (!button) return;
+ selectRecord(Number(button.dataset.index), selector === ".timeline-beat");
+ }
+ byId("storyboardList").addEventListener("click", event => activateListItem(event, ".storyboard-card"));
+ byId("timelineTrack").addEventListener("click", event => activateListItem(event, ".timeline-beat"));
+
+ function listKeyboard(event, selector, horizontal) {
+ const button = event.target.closest(selector);
+ if (!button) return;
+ const previousKey = horizontal ? "ArrowLeft" : "ArrowUp";
+ const nextKey = horizontal ? "ArrowRight" : "ArrowDown";
+ if (![previousKey, nextKey, "Home", "End"].includes(event.key)) return;
+ event.preventDefault();
+ const buttons = Array.from(event.currentTarget.querySelectorAll(selector));
+ const current = buttons.indexOf(button);
+ const next = event.key === "Home" ? 0 : event.key === "End" ? buttons.length - 1 : Math.max(0, Math.min(buttons.length - 1, current + (event.key === previousKey ? -1 : 1)));
+ buttons[next]?.focus();
+ if (buttons[next]) selectRecord(Number(buttons[next].dataset.index));
+ }
+ byId("storyboardList").addEventListener("keydown", event => listKeyboard(event, ".storyboard-card", false));
+ byId("timelineTrack").addEventListener("keydown", event => listKeyboard(event, ".timeline-beat", true));
+
+ byId("segmentEnabled").addEventListener("change", event => {
+ const record = selectedRecord();
+ if (!record) return;
+ record.segment.shouldRenderGraphic = event.target.checked;
+ markDirty();
+ renderStoryboard();
+ renderTimeline();
+ });
+ byId("promptEditor").addEventListener("input", event => updateSegmentPrompt(event.target.value));
+ byId("startTimeInput").addEventListener("change", updateTiming);
+ byId("durationInput").addEventListener("change", updateTiming);
+ byId("templateSelect").addEventListener("change", event => {
+ const record = selectedRecord();
+ if (!record) return;
+ record.segment.templateId = event.target.value || null;
+ markDirty();
+ renderStoryboard();
+ renderTimeline();
+ renderCustomizer(record);
+ renderAuthoredPreview(record);
+ });
+ byId("customizerControls").addEventListener("input", event => {
+ const input = event.target.closest("[data-control-id]");
+ const record = selectedRecord();
+ if (!input || !record) return;
+ const holder = customizerValueObject(record.segment, true);
+ let value = input.type === "checkbox" ? input.checked : input.value;
+ if (["number", "range"].includes(input.dataset.controlType)) value = number(value);
+ holder.values[input.dataset.controlId] = value;
+ markDirty();
+ });
+ byId("qualityChecklist").addEventListener("change", event => {
+ const input = event.target.closest("[data-check-index]");
+ const record = selectedRecord();
+ if (!input || !record) return;
+ record.segment.qualityChecklistState = object(record.segment.qualityChecklistState);
+ record.segment.qualityChecklistState[input.dataset.checkIndex] = input.checked;
+ markDirty();
+ renderChecklist(record);
+ });
+
+ byId("repromptButton").addEventListener("click", reprompt);
+ byId("reanalyzeButton").addEventListener("click", reanalyze);
+ byId("discardProposal").addEventListener("click", () => { state.proposal = null; renderProposal(); });
+ byId("applyProposal").addEventListener("click", applyProposal);
+ byId("saveDraftButton").addEventListener("click", () => createRevision(false));
+ byId("renderRevisionButton").addEventListener("click", () => createRevision(true));
+ byId("reviewButton").addEventListener("click", runQualityReview);
+ byId("repairButton").addEventListener("click", repairRevision);
+
+ byId("placementMode").addEventListener("change", event => { byId("absoluteTimeField").hidden = event.target.value === "currentPlayhead"; });
+ byId("sendCepButton").addEventListener("click", sendToCep);
+ byId("saveBinButton").addEventListener("click", () => premiereAction("save"));
+ byId("insertButton").addEventListener("click", () => premiereAction("insert"));
+ byId("rollbackButton").addEventListener("click", () => premiereAction("rollback"));
+
+ byId("playPreview").addEventListener("click", () => controlAuthored("play"));
+ byId("pausePreview").addEventListener("click", () => controlAuthored("pause"));
+ byId("restartPreview").addEventListener("click", () => controlAuthored("restart"));
+
+ document.addEventListener("visibilitychange", () => { if (!document.hidden) startPolling(0); });
+ window.addEventListener("beforeunload", event => {
+ clearTimeout(pollTimer);
+ pollController?.abort();
+ if (!state.dirty) return;
+ event.preventDefault();
+ event.returnValue = "";
+ });
+ }
+
+ function initialize() {
+ bridgeToken();
+ bindEvents();
+ renderAll();
+ startPolling(0);
+ }
+
+ initialize();
+})();
diff --git a/public/create.html b/public/create.html
new file mode 100644
index 0000000..b81fc70
--- /dev/null
+++ b/public/create.html
@@ -0,0 +1,637 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Create from reference — Null Motion</title>
+<link rel="icon" href="assets/null-logo.png" />
+<style>
+ :root {
+ --bg: #0d0d0f; --panel: #141417; --panel-2: #1b1b1f; --line: #2a2a30;
+ --text: #ececee; --muted: #8a8a92; --quiet: #5e5e66;
+ --cyan: #00e5ff; --violet: #8b5cf6; --success: #4ade80; --danger: #fb7185;
+ --silver: linear-gradient(135deg, #f2f2f2 0%, #b8b8bc 50%, #8c8c90 100%);
+ }
+ * { box-sizing: border-box; }
+ html { color-scheme: dark; }
+ body {
+ margin: 0; min-height: 100vh; color: var(--text); background:
+ radial-gradient(900px 520px at 18% -10%, rgba(139,92,246,.09), transparent 62%),
+ radial-gradient(760px 480px at 94% 12%, rgba(0,229,255,.07), transparent 62%), var(--bg);
+ font-family: Inter, -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased;
+ }
+ button, input, textarea, select { font: inherit; }
+ button, a { -webkit-tap-highlight-color: transparent; }
+ header {
+ position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
+ min-height: 66px; padding: 13px clamp(18px,3vw,44px); border-bottom: 1px solid var(--line);
+ background: rgba(10,10,12,.84); backdrop-filter: blur(20px) saturate(130%);
+ }
+ .brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; font-size: 18px; text-decoration: none; }
+ .brand img { width: 31px; height: 31px; border-radius: 9px; box-shadow: 0 5px 15px rgba(0,0,0,.5); }
+ .brand b { font-weight: 650; } .brand span { color: var(--muted); }
+ .head-actions { display: flex; align-items: center; gap: 9px; }
+ .nav-link, .pair-btn, .status {
+ min-height: 36px; padding: 8px 13px; border: 1px solid var(--line); border-radius: 99px;
+ background: var(--panel); color: var(--muted); font-size: 12px; text-decoration: none;
+ }
+ .nav-link:hover, .pair-btn:hover { color: var(--text); border-color: #42424a; }
+ .nav-link.active { color: var(--text); border-color: #4b4b54; background: #242429; }
+ .pair-btn { cursor: pointer; }
+ .status { display: inline-flex; align-items: center; gap: 8px; }
+ .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #5a5a62; }
+ .status.online { color: #c8fbd9; border-color: rgba(74,222,128,.24); }
+ .status.online .status-dot { background: var(--success); box-shadow: 0 0 13px rgba(74,222,128,.5); }
+ .status.offline { color: #fda4af; border-color: rgba(251,113,133,.24); }
+ .status.offline .status-dot { background: var(--danger); }
+
+ main { width: min(1420px,100%); margin: 0 auto; padding: clamp(26px,3.5vw,48px) clamp(16px,4vw,54px) 74px; }
+ .intro { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: end; margin-bottom: 24px; }
+ .eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; color: #8befff; font-size: 10px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
+ .eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 15px rgba(0,229,255,.72); }
+ h1 { max-width: 820px; margin: 0; font-size: clamp(38px,4.5vw,62px); font-weight: 610; letter-spacing: -.055em; line-height: 1; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
+ .intro p { max-width: 700px; margin: 18px 0 0; color: #9a9aa3; font-size: clamp(15px,1.4vw,18px); line-height: 1.62; }
+ .step-map { display: flex; align-items: center; gap: 8px; padding-bottom: 4px; }
+ .step-pill { display: flex; align-items: center; gap: 8px; color: var(--quiet); font-size: 11px; white-space: nowrap; }
+ .step-pill b { display: grid; width: 24px; height: 24px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--panel); color: var(--muted); font-size: 10px; }
+ .step-pill.active { color: var(--text); } .step-pill.active b { border-color: rgba(0,229,255,.42); color: #baf7ff; background: rgba(0,229,255,.08); }
+ .step-line { width: 28px; height: 1px; background: var(--line); }
+
+ .workspace { display: grid; grid-template-columns: minmax(0,1.02fr) minmax(430px,.98fr); gap: 18px; align-items: start; }
+ .panel { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(24,24,28,.96), rgba(12,12,15,.97)); box-shadow: 0 28px 80px rgba(0,0,0,.25); }
+ .panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 22px 23px 18px; border-bottom: 1px solid var(--line); }
+ .panel-title small { display: block; margin-bottom: 6px; color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
+ .panel-title h2 { margin: 0; font-size: 20px; font-weight: 620; letter-spacing: -.025em; }
+ .panel-number { display: grid; width: 31px; height: 31px; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); font: 650 11px/1 ui-monospace, Consolas, monospace; }
+ .panel-body { padding: 22px 23px 24px; }
+
+ .dropzone {
+ position: relative; min-height: 230px; display: grid; place-items: center; padding: 22px; overflow: hidden;
+ border: 1px dashed #393941; border-radius: 17px; background:
+ linear-gradient(145deg, rgba(255,255,255,.018), transparent),
+ repeating-linear-gradient(45deg, rgba(255,255,255,.012) 0 1px, transparent 1px 11px);
+ cursor: pointer; transition: .2s ease;
+ }
+ .dropzone:hover, .dropzone.dragging { border-color: rgba(0,229,255,.58); background-color: rgba(0,229,255,.025); box-shadow: inset 0 0 50px rgba(0,229,255,.035); }
+ .drop-empty { max-width: 350px; text-align: center; }
+ .drop-icon { position: relative; width: 58px; height: 58px; margin: 0 auto 16px; border: 1px solid #3b3b44; border-radius: 17px; background: linear-gradient(145deg,#26262d,#151518); box-shadow: 0 14px 28px rgba(0,0,0,.35), inset 0 1px rgba(255,255,255,.07); }
+ .drop-icon::before, .drop-icon::after { content: ""; position: absolute; background: #bfc0c5; border-radius: 2px; }
+ .drop-icon::before { width: 20px; height: 2px; left: 18px; top: 27px; }
+ .drop-icon::after { width: 2px; height: 20px; left: 27px; top: 18px; }
+ .drop-empty strong { display: block; font-size: 15px; font-weight: 620; }
+ .drop-empty span { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
+ .drop-empty em { color: #b9f6ff; font-style: normal; }
+ .image-grid { display: none; width: 100%; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; align-self: stretch; }
+ .dropzone.has-images { display: block; padding: 13px; }
+ .dropzone.has-images .drop-empty { display: none; }
+ .dropzone.has-images .image-grid { display: grid; }
+ .reference { position: relative; min-height: 122px; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid #34343c; border-radius: 12px; background: #0b0b0d; }
+ .reference img { width: 100%; height: 100%; display: block; object-fit: cover; }
+ .reference-order { position: absolute; left: 7px; top: 7px; display: grid; width: 22px; height: 22px; place-items: center; border: 1px solid rgba(255,255,255,.18); border-radius: 7px; background: rgba(8,8,10,.78); backdrop-filter: blur(8px); font-size: 9px; font-weight: 750; }
+ .reference-remove { position: absolute; right: 7px; top: 7px; width: 24px; height: 24px; padding: 0; border: 1px solid rgba(255,255,255,.16); border-radius: 7px; background: rgba(8,8,10,.78); color: #d7d7dc; cursor: pointer; }
+ .reference-add { min-height: 122px; aspect-ratio: 1 / 1; border: 1px dashed #3b3b44; border-radius: 12px; background: rgba(255,255,255,.018); color: var(--muted); cursor: pointer; }
+ .reference-add:hover { border-color: rgba(0,229,255,.45); color: var(--text); }
+ .drop-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; color: var(--quiet); font-size: 10px; }
+ .drop-foot span:last-child { text-align: right; }
+
+ .field { margin-top: 18px; }
+ .field:first-child { margin-top: 0; }
+ .field label, .control label { display: block; margin-bottom: 8px; color: #adadb5; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
+ .field textarea, .field input, .control select, .control input {
+ width: 100%; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: var(--panel-2); color: var(--text); padding: 12px 13px; font-size: 13px; transition: border-color .2s, box-shadow .2s;
+ }
+ .field textarea { min-height: 95px; resize: vertical; line-height: 1.55; }
+ .field textarea:focus, .field input:focus, .control select:focus, .control input:focus { border-color: rgba(0,229,255,.48); box-shadow: 0 0 0 3px rgba(0,229,255,.055); }
+ .field-note { margin-top: 7px; color: var(--quiet); font-size: 10px; line-height: 1.5; }
+ .controls { display: grid; grid-template-columns: 1.25fr .75fr 1fr; gap: 10px; margin-top: 18px; }
+ .control { min-width: 0; }
+ .control select, .control input { height: 43px; padding: 9px 11px; }
+ .action-row { display: flex; align-items: center; gap: 11px; margin-top: 20px; }
+ .primary, .secondary, .result-actions a, .result-actions button {
+ display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 12px; padding: 11px 16px; font-weight: 650; font-size: 13px; text-decoration: none; cursor: pointer;
+ }
+ .primary { flex: 1; border: 0; color: #0b0b0d; background: var(--silver); box-shadow: inset 0 1px rgba(255,255,255,.78), 0 12px 28px rgba(0,0,0,.3); }
+ .secondary { border: 1px solid var(--line); color: var(--muted); background: var(--panel-2); }
+ .primary:disabled, .secondary:disabled { opacity: .48; cursor: default; }
+ .busy::before { content: ""; width: 12px; height: 12px; margin-right: 8px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
+
+ .blueprint-empty { min-height: 430px; display: grid; place-items: center; padding: 34px; text-align: center; }
+ .blueprint-empty-mark { width: 66px; height: 66px; display: grid; place-items: center; margin: 0 auto 18px; border: 1px solid var(--line); border-radius: 20px; background: radial-gradient(circle at 50% 25%, #292933, #151518 66%); color: #787883; font: 600 18px/1 ui-monospace,Consolas,monospace; box-shadow: inset 0 1px rgba(255,255,255,.06); }
+ .blueprint-empty h3 { margin: 0; font-size: 17px; font-weight: 600; }
+ .blueprint-empty p { max-width: 360px; margin: 9px auto 0; color: var(--muted); font-size: 12px; line-height: 1.65; }
+ .blueprint { display: none; }
+ .blueprint.show { display: block; }
+ .blueprint.show + .blueprint-empty { display: none; }
+ .analysis-strip { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; margin-bottom: 17px; }
+ .analysis-card { min-width: 0; padding: 11px; border: 1px solid var(--line); border-radius: 11px; background: rgba(8,8,10,.34); }
+ .analysis-card small { display: block; color: var(--quiet); font-size: 8px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
+ .analysis-card span { display: -webkit-box; overflow: hidden; margin-top: 6px; color: #b5b5bc; font-size: 10.5px; line-height: 1.45; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
+ .prompt-editor { width: 100%; min-height: 248px; resize: vertical; border: 1px solid var(--line); border-radius: 13px; outline: 0; background: #101013; color: #d8d8dd; padding: 15px; font: 11.5px/1.65 ui-monospace, "SFMono-Regular", Consolas, monospace; }
+ .prompt-editor:focus { border-color: rgba(139,92,246,.5); box-shadow: 0 0 0 3px rgba(139,92,246,.055); }
+ .prompt-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 9px 0 0; color: var(--quiet); font-size: 9.5px; }
+ .prompt-meta .fallback { color: #f7d58a; }
+ .checklist { margin-top: 17px; padding-top: 16px; border-top: 1px solid var(--line); }
+ .checklist-title { color: var(--muted); font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
+ .checklist-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
+ .check { padding: 6px 8px; border: 1px solid #303038; border-radius: 8px; color: #9999a2; background: rgba(255,255,255,.018); font-size: 9.5px; }
+ .generate-row { margin-top: 19px; }
+ .generate-row .primary { width: 100%; }
+ .generate-note { margin: 9px 2px 0; color: var(--quiet); font-size: 9.5px; line-height: 1.5; text-align: center; }
+
+ .job-panel { display: none; grid-column: 1 / -1; }
+ .job-panel.show { display: block; }
+ .job-layout { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(360px,.75fr); min-height: 470px; }
+ .preview-shell { position: relative; display: grid; place-items: center; min-height: 470px; overflow: hidden; border-right: 1px solid var(--line); background: radial-gradient(100% 100% at 50% 35%,#303037 0,#1b1b20 47%,#0d0d10 100%); }
+ .preview-shell::before { content: ""; position: absolute; inset: 0; opacity: .15; background-image: linear-gradient(45deg,#aaa 25%,transparent 25%),linear-gradient(-45deg,#aaa 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#aaa 75%),linear-gradient(-45deg,transparent 75%,#aaa 75%); background-size: 24px 24px; background-position: 0 0,0 12px,12px -12px,-12px 0; }
+ .preview-placeholder { position: relative; z-index: 1; text-align: center; color: var(--muted); }
+ .preview-placeholder .loader { width: 37px; height: 37px; margin: 0 auto 15px; border: 2px solid rgba(255,255,255,.12); border-top-color: var(--cyan); border-radius: 50%; animation: spin 1s linear infinite; }
+ .preview-placeholder strong { display: block; color: #d4d4d9; font-size: 13px; }
+ .preview-placeholder span { display: block; margin-top: 6px; font-size: 11px; }
+ .preview-frame { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; border: 0; background: transparent; }
+ .job-detail { padding: 25px; }
+ .job-badge { display: inline-flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid rgba(0,229,255,.23); border-radius: 99px; color: #9ff5ff; background: rgba(0,229,255,.06); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
+ .job-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 11px rgba(0,229,255,.7); }
+ .job-badge.done { color: #bdf7d0; border-color: rgba(74,222,128,.25); background: rgba(74,222,128,.06); }
+ .job-badge.done::before { background: var(--success); box-shadow: 0 0 11px rgba(74,222,128,.62); }
+ .job-detail h2 { margin: 19px 0 0; font-size: 27px; font-weight: 610; letter-spacing: -.04em; }
+ .job-status-copy { min-height: 42px; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.55; }
+ .progress { height: 5px; margin-top: 15px; overflow: hidden; border-radius: 5px; background: #28282e; }
+ .progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; border-radius: inherit; background: linear-gradient(90deg,var(--violet),var(--cyan)); transition: transform .35s ease; }
+ .job-spec { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-top: 20px; }
+ .spec { padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(8,8,10,.32); }
+ .spec small { display: block; color: var(--quiet); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }
+ .spec b { display: block; margin-top: 5px; color: #c9c9cf; font-size: 11px; font-weight: 600; }
+ .result-actions { display: none; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
+ .result-actions.show { display: flex; }
+ .result-actions a, .result-actions button { flex: 1 1 135px; min-height: 39px; padding: 9px 11px; border: 1px solid var(--line); color: var(--text); background: var(--panel-2); font-size: 11px; }
+ .result-actions .featured { border: 0; color: #0b0b0d; background: var(--silver); }
+ .job-error { display: none; margin-top: 16px; padding: 11px; border: 1px solid rgba(251,113,133,.22); border-radius: 10px; background: rgba(251,113,133,.05); color: #fda4af; font-size: 11px; line-height: 1.5; }
+ .job-error.show { display: block; }
+
+ .toast { position: fixed; z-index: 100; left: 50%; bottom: 25px; transform: translate(-50%,20px); padding: 11px 15px; border: 1px solid #3a3a42; border-radius: 11px; background: rgba(25,25,29,.96); color: var(--text); box-shadow: 0 18px 50px rgba(0,0,0,.45); font-size: 12px; opacity: 0; pointer-events: none; transition: .2s; }
+ .toast.show { opacity: 1; transform: translate(-50%,0); }
+ @keyframes spin { to { transform: rotate(360deg); } }
+ @media (max-width: 900px) {
+ .intro { grid-template-columns: 1fr; } .step-map { display: none; }
+ .workspace { grid-template-columns: 1fr; } .job-panel { grid-column: auto; }
+ .job-layout { grid-template-columns: 1fr; } .preview-shell { min-height: 430px; border-right: 0; border-bottom: 1px solid var(--line); }
+ }
+ @media (max-width: 680px) {
+ header { align-items: flex-start; flex-wrap: wrap; padding: 11px 14px; }
+ .head-actions { width: 100%; overflow-x: auto; padding-bottom: 2px; }
+ .head-actions > * { flex: 0 0 auto; }
+ .status { display: none; }
+ main { padding-top: 34px; } .intro { margin-bottom: 24px; } h1 { font-size: 43px; }
+ .panel-head, .panel-body { padding-left: 16px; padding-right: 16px; }
+ .dropzone { min-height: 210px; } .image-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
+ .controls { grid-template-columns: 1fr 1fr; } .controls .control:first-child { grid-column: 1 / -1; }
+ .analysis-strip { grid-template-columns: 1fr; } .analysis-card span { -webkit-line-clamp: 2; }
+ .job-layout { min-height: 0; } .preview-shell { min-height: 360px; } .job-detail { padding: 19px 17px 22px; }
+ }
+ @media (pointer: coarse) { button, select, input, .file-label { min-height: 44px; } }
+</style>
+<link rel="stylesheet" href="site-shell.css" />
+<script src="site-shell.js" defer></script>
+</head>
+<body>
+ <header>
+ <a class="brand" href="./"><img src="assets/null-logo.png" alt="Null" /><b>Null</b><span>Motion</span></a>
+ <nav class="head-actions" aria-label="Null Motion pages">
+ <a class="nav-link" href="./">Templates</a>
+ <a class="nav-link active" href="create.html" aria-current="page">Reference studio</a>
+ <a class="nav-link" href="script.html">Script to motion</a>
+ <a class="nav-link" href="system-map.html">Director pipeline</a>
+ <a class="nav-link" href="control-center.html">Control Center</a>
+ <a class="nav-link" href="renders.html">Renders</a>
+ <div class="status" id="bridgeStatus"><span class="status-dot"></span><span id="bridgeStatusText">Checking companion</span></div>
+ <button class="pair-btn" id="pairButton" type="button">Pair companion</button>
+ </nav>
+ </header>
+
+ <main>
+ <section class="intro">
+ <div>
+ <div class="eyebrow">Reference studio</div>
+ <h1>Turn what inspires you into motion.</h1>
+ <p>Paste screenshots from a motion graphic you like. Null reads the composition, materials, type, and implied timing, writes a production blueprint, then builds a working transparent template you can preview and reuse.</p>
+ </div>
+ <div class="step-map" aria-label="Creation steps">
+ <span class="step-pill active"><b>01</b> References</span><i class="step-line"></i>
+ <span class="step-pill" id="mapAnalyze"><b>02</b> Blueprint</span><i class="step-line"></i>
+ <span class="step-pill" id="mapBuild"><b>03</b> Build</span>
+ </div>
+ </section>
+
+ <section class="workspace">
+ <article class="panel">
+ <div class="panel-head">
+ <div class="panel-title"><small>Give Null something to study</small><h2>Reference frames</h2></div>
+ <span class="panel-number">01</span>
+ </div>
+ <div class="panel-body">
+ <div class="dropzone" id="dropzone" tabindex="0" role="button" aria-label="Paste or upload reference images">
+ <div class="drop-empty">
+ <div class="drop-icon" aria-hidden="true"></div>
+ <strong>Paste a screenshot anywhere</strong>
+ <span>or <em>choose images</em> / drag them here. Add multiple frames in playback order when you have them.</span>
+ </div>
+ <div class="image-grid" id="imageGrid"></div>
+ </div>
+ <input type="file" id="fileInput" accept="image/png,image/jpeg,image/webp" multiple hidden />
+ <div class="drop-foot"><span id="imageCount">No references attached</span><span>PNG, JPG, WEBP · up to 6</span></div>
+
+ <div class="field">
+ <label for="briefInput">What should this become?</label>
+ <textarea id="briefInput" placeholder="Optional — e.g. Keep the same pacing and card choreography, but use my product photos and make the final beat say “Ship faster.”"></textarea>
+ <div class="field-note">The screenshots define the visual language. Your note tells Null what to preserve, replace, or reinterpret.</div>
+ </div>
+
+ <div class="field">
+ <label for="sourceInput">Official asset source</label>
+ <input id="sourceInput" type="url" placeholder="https://your-brand.com (optional)" />
+ </div>
+
+ <div class="controls">
+ <div class="control"><label for="formatSelect">Format</label><select id="formatSelect">
+ <option value="vertical">Vertical · 1080 × 1920</option>
+ <option value="landscape">Landscape · 1920 × 1080</option>
+ <option value="square">Square · 1080 × 1080</option>
+ </select></div>
+ <div class="control"><label for="durationInput">Seconds</label><input id="durationInput" type="number" min="2" max="12" step="0.5" value="6" /></div>
+ <div class="control"><label for="providerSelect">AI provider</label><select id="providerSelect">
+ <option value="codex">Codex</option><option value="claude">Claude</option><option value="anthropic">Anthropic API</option>
+ </select></div>
+ </div>
+
+ <div class="action-row">
+ <button class="primary" id="analyzeButton" type="button">Analyze references</button>
+ </div>
+ </div>
+ </article>
+
+ <article class="panel">
+ <div class="panel-head">
+ <div class="panel-title"><small>Review before spending render time</small><h2>Motion blueprint</h2></div>
+ <span class="panel-number">02</span>
+ </div>
+ <div class="panel-body">
+ <div class="blueprint" id="blueprint">
+ <div class="analysis-strip" id="analysisStrip"></div>
+ <label for="promptEditor" class="checklist-title">Production prompt</label>
+ <textarea class="prompt-editor" id="promptEditor" spellcheck="false"></textarea>
+ <div class="prompt-meta"><span id="promptLength">0 characters</span><span id="analysisMode">AI reverse-engineered</span></div>
+ <div class="checklist">
+ <div class="checklist-title">Build checks</div>
+ <div class="checklist-items" id="checklistItems"></div>
+ </div>
+ <div class="generate-row"><button class="primary" id="generateButton" type="button">Generate example template</button></div>
+ <div class="generate-note">Builds editable HyperFrames source plus a transparent ProRes 4444 preview. It does not publish to the shared gallery automatically.</div>
+ </div>
+ <div class="blueprint-empty">
+ <div><div class="blueprint-empty-mark">N→</div><h3>Your blueprint will appear here</h3><p>Null will turn the reference frames into an editable prompt with exact layout, palette, materials, asset rules, and ordered animation beats.</p></div>
+ </div>
+ </div>
+ </article>
+
+ <article class="panel job-panel" id="jobPanel">
+ <div class="job-layout">
+ <div class="preview-shell" id="previewShell">
+ <div class="preview-placeholder" id="previewPlaceholder"><div class="loader"></div><strong>Building your example</strong><span id="previewStatus">Preparing the composition</span></div>
+ </div>
+ <div class="job-detail">
+ <span class="job-badge" id="jobBadge">In production</span>
+ <h2 id="jobTitle">Creating Null Motion</h2>
+ <div class="job-status-copy" id="jobStatus">Turning the approved blueprint into deterministic motion.</div>
+ <div class="progress"><span id="jobProgress"></span></div>
+ <div class="job-spec">
+ <div class="spec"><small>Canvas</small><b id="specCanvas">1080 × 1920</b></div>
+ <div class="spec"><small>Duration</small><b id="specDuration">6 seconds</b></div>
+ <div class="spec"><small>Provider</small><b id="specProvider">Codex</b></div>
+ </div>
+ <div class="job-error" id="jobError"></div>
+ <div class="result-actions" id="resultActions">
+ <a class="featured" id="previewLink" target="_blank" rel="noopener">Open preview</a>
+ <a id="movieLink">Download MOV</a>
+ <a id="sourceLink">Download HTML</a>
+ <button id="copyPromptButton" type="button">Copy blueprint</button>
+ <button id="startOverButton" type="button">Create another</button>
+ </div>
+ </div>
+ </div>
+ </article>
+ </section>
+ </main>
+
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
+
+<script>
+ const API = window.location.origin;
+ const TOKEN_KEY = "null-motion-bridge-token";
+ const MAX_IMAGES = 6;
+ const MAX_IMAGE_BYTES = 8 * 1024 * 1024;
+ const formats = {
+ vertical: { width: 1080, height: 1920, label: "Vertical" },
+ landscape: { width: 1920, height: 1080, label: "Landscape" },
+ square: { width: 1080, height: 1080, label: "Square" }
+ };
+ const stepLabels = {
+ researching: "Reading official references", sourcing: "Resolving authentic assets", optimizing: "Refining the direction",
+ expanding: "Writing the composition", building: "Building HyperFrames source", linting: "Checking the template contract",
+ queued: "Waiting for the render queue", rendering: "Rendering transparent frames", finalizing: "Preparing the preview",
+ reviewing: "Reviewing key frames", repairing: "Repairing visual issues", rerendering: "Rendering the repaired motion",
+ cancelling: "Cancelling"
+ };
+
+ let attachedImages = [];
+ let latestAnalysis = null;
+ let currentJobId = null;
+ let toastTimer = null;
+ let watchGeneration = 0;
+
+ const $ = id => document.getElementById(id);
+ const dropzone = $("dropzone");
+ const fileInput = $("fileInput");
+ const analyzeButton = $("analyzeButton");
+ const generateButton = $("generateButton");
+
+ function showToast(message) {
+ const toast = $("toast");
+ toast.textContent = message;
+ toast.classList.add("show");
+ clearTimeout(toastTimer);
+ toastTimer = setTimeout(() => toast.classList.remove("show"), 2800);
+ }
+
+ async function api(path, options = {}) {
+ const token = localStorage.getItem(TOKEN_KEY) || "";
+ const requestOptions = { ...options, headers: { ...(options.headers || {}) } };
+ if (token) requestOptions.headers["X-Null-Bridge-Token"] = token;
+ let response;
+ try { response = await fetch(`${API}${path}`, requestOptions); }
+ catch (_) { throw new Error("Null companion is offline. Start it, then try again."); }
+ const data = await response.json().catch(() => ({}));
+ if (!response.ok) throw new Error(data.error || `Null companion failed (${response.status})`);
+ return data;
+ }
+
+ function isPairingError(error) { return /401|403|pair|token|unauthorized/i.test(String(error?.message || error)); }
+
+ async function refreshBridgeStatus() {
+ const status = $("bridgeStatus");
+ try {
+ const health = await api("/health");
+ status.className = "status online";
+ $("bridgeStatusText").textContent = "UI ready · generation not connected";
+ } catch (error) {
+ status.className = "status offline";
+ $("bridgeStatusText").textContent = isPairingError(error) ? "Pair companion" : "Companion offline";
+ }
+ }
+
+ async function pairCompanion() {
+ const code = window.prompt("Enter the pairing code shown by the local Null companion:");
+ if (!code) return;
+ try {
+ const response = await fetch(`${API}/api/v1/pair`, { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ code: code.trim() }) });
+ const data = await response.json().catch(() => ({}));
+ if (!response.ok || !data.token) throw new Error(data.error || "Pairing failed");
+ localStorage.setItem(TOKEN_KEY, data.token);
+ showToast("Null companion paired");
+ refreshBridgeStatus();
+ } catch (error) { showToast(error.message || "Could not pair the companion"); }
+ }
+
+ function getSpec() {
+ const format = formats[$("formatSelect").value] || formats.vertical;
+ const duration = Math.min(12, Math.max(2, Number($("durationInput").value) || 6));
+ $("durationInput").value = duration;
+ return { ...format, duration, fps: 30 };
+ }
+
+ function referenceBrief() {
+ const note = $("briefInput").value.trim();
+ const frameLanguage = attachedImages.length > 1
+ ? `The ${attachedImages.length} attached images are ordered reference frames from one motion idea. Infer the transitions and causal motion between frame 1 and frame ${attachedImages.length}.`
+ : "The attached image is a visual reference for one motion-graphics idea. Infer a tasteful establish, reveal, readable hold, and resolve.";
+ return `${frameLanguage}\n\n${note || "Recreate the visual system as an original Null Motion example while preserving the reference's hierarchy, material language, and pacing. Do not copy trademarks or copyrighted copy; use supplied imagery only as an authorized reference asset."}`;
+ }
+
+ function readImage(file) {
+ return new Promise((resolve, reject) => {
+ if (!file || !/^image\/(png|jpeg|webp)$/i.test(file.type)) return reject(new Error("Use a PNG, JPG, or WEBP image."));
+ if (file.size > MAX_IMAGE_BYTES) return reject(new Error(`${file.name || "That image"} is larger than 8 MB.`));
+ const reader = new FileReader();
+ reader.onload = () => resolve({ dataUrl: String(reader.result || ""), name: file.name || "Pasted reference" });
+ reader.onerror = () => reject(new Error(`Could not read ${file.name || "that image"}.`));
+ reader.readAsDataURL(file);
+ });
+ }
+
+ async function addFiles(files) {
+ const available = MAX_IMAGES - attachedImages.length;
+ if (available <= 0) return showToast(`Up to ${MAX_IMAGES} reference frames are supported`);
+ const selected = [...files].slice(0, available);
+ for (const file of selected) {
+ try { attachedImages.push(await readImage(file)); }
+ catch (error) { showToast(error.message); }
+ }
+ renderImages();
+ if (files.length > selected.length) showToast(`Only the first ${MAX_IMAGES} reference frames were added`);
+ }
+
+ function renderImages() {
+ const grid = $("imageGrid");
+ grid.innerHTML = "";
+ attachedImages.forEach((item, index) => {
+ const card = document.createElement("div");
+ card.className = "reference";
+ const image = document.createElement("img"); image.src = item.dataUrl; image.alt = `Reference frame ${index + 1}`;
+ const order = document.createElement("span"); order.className = "reference-order"; order.textContent = String(index + 1).padStart(2,"0");
+ const remove = document.createElement("button"); remove.className = "reference-remove"; remove.type = "button"; remove.textContent = "×"; remove.setAttribute("aria-label", `Remove reference ${index + 1}`);
+ remove.onclick = event => { event.stopPropagation(); attachedImages.splice(index,1); renderImages(); };
+ card.append(image,order,remove); grid.appendChild(card);
+ });
+ if (attachedImages.length < MAX_IMAGES && attachedImages.length) {
+ const add = document.createElement("button"); add.className = "reference-add"; add.type = "button"; add.textContent = "+ Add frame";
+ add.onclick = event => { event.stopPropagation(); fileInput.click(); }; grid.appendChild(add);
+ }
+ dropzone.classList.toggle("has-images", attachedImages.length > 0);
+ $("imageCount").textContent = attachedImages.length ? `${attachedImages.length} reference${attachedImages.length === 1 ? "" : "s"} · playback order` : "No references attached";
+ }
+
+ function analysisCards(analysis = {}) {
+ const cards = [
+ ["Composition", analysis.layout || "Hierarchy and spatial rhythm extracted"],
+ ["Material", analysis.materialsLighting || "Surface, depth, and lighting extracted"],
+ ["Motion", analysis.motion || "Ordered animation beats inferred"]
+ ];
+ const strip = $("analysisStrip"); strip.innerHTML = "";
+ cards.forEach(([label,value]) => {
+ const card = document.createElement("div"); card.className = "analysis-card";
+ const small = document.createElement("small"); small.textContent = label;
+ const span = document.createElement("span"); span.textContent = String(value);
+ card.append(small,span); strip.appendChild(card);
+ });
+ }
+
+ function renderChecklist(items) {
+ const wrap = $("checklistItems"); wrap.innerHTML = "";
+ (items.length ? items : ["Transparent full-frame background","Deterministic timeline","Supplied imagery preserved"]).slice(0,8).forEach(item => {
+ const chip = document.createElement("span"); chip.className = "check"; chip.textContent = `✓ ${item}`; wrap.appendChild(chip);
+ });
+ }
+
+ async function analyzeReferences() {
+ if (!attachedImages.length) { dropzone.focus(); showToast("Paste or upload at least one reference image"); return; }
+ const spec = getSpec();
+ const source = $("sourceInput").value.trim();
+ if (source && !/^https?:\/\//i.test(source)) { $("sourceInput").focus(); showToast("Use a complete http or https URL"); return; }
+ analyzeButton.disabled = true; analyzeButton.classList.add("busy"); analyzeButton.textContent = "Reverse-engineering";
+ try {
+ const data = await api("/api/prompts/optimize", {
+ method: "POST", headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ prompt: referenceBrief(), images: attachedImages.map(item => item.dataUrl), sourceUrls: source ? [source] : [],
+ engine: "hyperframes", generator: $("providerSelect").value,
+ outputSpec: { width: spec.width, height: spec.height, duration: spec.duration, fps: spec.fps, transparent: true }
+ })
+ });
+ latestAnalysis = data;
+ $("promptEditor").value = data.optimizedPrompt || "";
+ $("promptLength").textContent = `${$("promptEditor").value.length.toLocaleString()} characters`;
+ $("analysisMode").textContent = data.fallback ? "Deterministic fallback blueprint" : "AI reverse-engineered";
+ $("analysisMode").className = data.fallback ? "fallback" : "";
+ analysisCards(data.analysis || {}); renderChecklist(data.qualityChecklist || []);
+ $("blueprint").classList.add("show"); $("mapAnalyze").classList.add("active");
+ if (data.warning) showToast("Blueprint created with the local fallback");
+ if (window.innerWidth < 1040) $("blueprint").scrollIntoView({ behavior: "smooth", block: "start" });
+ } catch (error) {
+ if (isPairingError(error)) showToast("Pair the companion before analyzing references"); else showToast(error.message);
+ } finally {
+ analyzeButton.disabled = false; analyzeButton.classList.remove("busy"); analyzeButton.textContent = "Analyze references";
+ }
+ }
+
+ function safeUrl(value) {
+ if (!value) return "";
+ try { const url = new URL(String(value),API); return /^https?:$/.test(url.protocol) ? url.href : ""; } catch (_) { return ""; }
+ }
+
+ function jobDownloadUrl(job) {
+ const explicit = safeUrl(job && job.downloadUrl);
+ if (explicit) return explicit;
+ const jobId = String((job && (job.jobId || job.id)) || "");
+ if (/^\d+$/.test(jobId) || /^[0-9a-f-]{36}$/i.test(jobId)) return `${API}/api/v1/jobs/${encodeURIComponent(jobId)}/download`;
+ return safeUrl(job && job.renderUrl);
+ }
+
+ function setJobProgress(job) {
+ const pct = Math.max(0,Math.min(100,Number(job.pct) || 0));
+ const label = stepLabels[job.step] || (job.status === "pending" ? "Queued" : "Working on the composition");
+ $("jobProgress").style.transform = `scaleX(${pct / 100})`;
+ $("jobStatus").textContent = `${label} · ${Math.round(pct)}%`;
+ $("previewStatus").textContent = label;
+ }
+
+ function finishJob(job) {
+ $("jobProgress").style.transform = "scaleX(1)";
+ $("jobBadge").classList.add("done"); $("jobBadge").textContent = "Template ready";
+ $("jobTitle").textContent = "Your motion is ready";
+ $("jobStatus").textContent = job.reviewSkipped ? "Rendered successfully · visual review skipped" : "Rendered and quality reviewed · source is ready to reuse";
+ const previewUrl = safeUrl(job.playerUrl || job.previewUrl);
+ if (previewUrl) {
+ const iframe = document.createElement("iframe"); iframe.className = "preview-frame"; iframe.src = previewUrl; iframe.title = "Generated Null Motion preview"; iframe.allow = "autoplay";
+ $("previewShell").appendChild(iframe); $("previewPlaceholder").style.display = "none";
+ $("previewLink").href = previewUrl;
+ }
+ const movieUrl = jobDownloadUrl(job); const sourceUrl = safeUrl(job.codeUrl);
+ $("movieLink").href = movieUrl; $("movieLink").download = job.mp4Name || "null-motion.mov"; $("movieLink").hidden = !movieUrl;
+ $("sourceLink").href = sourceUrl ? `${sourceUrl}${sourceUrl.includes("?") ? "&" : "?"}download=1` : "";
+ $("resultActions").classList.add("show");
+ showToast("Null Motion example ready");
+ refreshBridgeStatus();
+ }
+
+ async function watchJob(jobId, generation) {
+ for (;;) {
+ if (generation !== watchGeneration) return;
+ const job = await api(`/jobs/${jobId}`);
+ if (job.status === "done" || job.status === "completed") { finishJob(job); return; }
+ if (job.status === "error" || job.status === "failed" || job.status === "cancelled") throw new Error(job.error || `Generation ${job.status}.`);
+ setJobProgress(job);
+ await new Promise(resolve => setTimeout(resolve,1400));
+ }
+ }
+
+ async function generateTemplate() {
+ const prompt = $("promptEditor").value.trim();
+ if (!prompt) { $("promptEditor").focus(); showToast("The production prompt is empty"); return; }
+ if (!attachedImages.length) { showToast("Keep at least one reference attached"); return; }
+ const spec = getSpec(); const provider = $("providerSelect").value; const source = $("sourceInput").value.trim();
+ generateButton.disabled = true; generateButton.classList.add("busy"); generateButton.textContent = "Starting build";
+ $("jobPanel").classList.add("show"); $("mapBuild").classList.add("active");
+ $("jobBadge").className = "job-badge"; $("jobBadge").textContent = "In production";
+ $("jobTitle").textContent = "Creating Null Motion"; $("jobStatus").textContent = "Submitting the approved blueprint to the local render pipeline.";
+ $("jobProgress").style.transform = "scaleX(.02)"; $("jobError").classList.remove("show"); $("resultActions").classList.remove("show");
+ $("specCanvas").textContent = `${spec.width} × ${spec.height}`; $("specDuration").textContent = `${spec.duration} seconds`; $("specProvider").textContent = provider === "codex" ? "Codex" : provider === "claude" ? "Claude" : "Anthropic";
+ $("previewPlaceholder").style.display = "block"; $("previewStatus").textContent = "Preparing the composition";
+ $("previewShell").querySelectorAll("iframe").forEach(frame => frame.remove());
+ if (window.innerWidth < 1040) $("jobPanel").scrollIntoView({ behavior: "smooth", block: "start" });
+ try {
+ const started = await api("/generate", {
+ method: "POST", headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ prompt, promptOptimized: true, promptAnalysis: latestAnalysis?.analysis || null, qualityChecklist: latestAnalysis?.qualityChecklist || [],
+ generator: provider, preset: "Reference Studio Example", origin: "reference-studio", templateId: null,
+ duration: spec.duration, fps: spec.fps, width: spec.width, height: spec.height,
+ images: attachedImages.map(item => item.dataUrl), sourceUrls: source ? [source] : [], assetQueries: latestAnalysis?.assetQueries || [],
+ assetResolutionMode: "strict", renderMode: "production", qualityReview: "auto", maxRepairPasses: 1, cacheMode: "use", autoResearch: true
+ })
+ });
+ currentJobId = started.jobId; const generation = ++watchGeneration;
+ await watchJob(currentJobId,generation);
+ } catch (error) {
+ $("jobBadge").textContent = "Build stopped";
+ $("jobTitle").textContent = "Could not finish the example";
+ $("jobStatus").textContent = isPairingError(error) ? "Pair the local companion, then try the build again." : "The blueprint is still here. Fix the issue and retry without re-analyzing.";
+ $("jobError").textContent = error.message; $("jobError").classList.add("show"); showToast(error.message);
+ } finally {
+ generateButton.disabled = false; generateButton.classList.remove("busy"); generateButton.textContent = "Generate example template";
+ }
+ }
+
+ async function copyText(value) {
+ try { if (navigator.clipboard && window.isSecureContext) { await navigator.clipboard.writeText(value); return true; } } catch (_) {}
+ const area = document.createElement("textarea"); area.value = value; area.style.cssText = "position:fixed;left:-9999px;top:0"; document.body.appendChild(area); area.select();
+ const ok = document.execCommand("copy"); area.remove(); return ok;
+ }
+
+ function startOver() {
+ watchGeneration++; currentJobId = null; latestAnalysis = null; attachedImages = [];
+ $("briefInput").value = ""; $("sourceInput").value = ""; $("promptEditor").value = "";
+ $("blueprint").classList.remove("show"); $("jobPanel").classList.remove("show"); $("mapAnalyze").classList.remove("active"); $("mapBuild").classList.remove("active");
+ renderImages(); window.scrollTo({ top: 0, behavior: "smooth" });
+ }
+
+ dropzone.onclick = event => { if (!event.target.closest(".reference-remove,.reference-add")) fileInput.click(); };
+ dropzone.onkeydown = event => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); fileInput.click(); } };
+ fileInput.onchange = () => { addFiles(fileInput.files || []); fileInput.value = ""; };
+ ["dragenter","dragover"].forEach(type => dropzone.addEventListener(type,event => { event.preventDefault(); dropzone.classList.add("dragging"); }));
+ ["dragleave","drop"].forEach(type => dropzone.addEventListener(type,event => { event.preventDefault(); dropzone.classList.remove("dragging"); }));
+ dropzone.addEventListener("drop",event => addFiles([...(event.dataTransfer?.files || [])].filter(file => file.type.startsWith("image/"))));
+ window.addEventListener("paste",event => {
+ const files = [...(event.clipboardData?.items || [])].filter(item => item.type.startsWith("image/")).map(item => item.getAsFile()).filter(Boolean);
+ if (!files.length && ["TEXTAREA","INPUT"].includes(document.activeElement?.tagName)) return;
+ if (files.length) { event.preventDefault(); addFiles(files); showToast("Reference pasted"); }
+ });
+ $("promptEditor").addEventListener("input",() => $("promptLength").textContent = `${$("promptEditor").value.length.toLocaleString()} characters`);
+ analyzeButton.onclick = analyzeReferences; generateButton.onclick = generateTemplate; $("pairButton").onclick = pairCompanion;
+ $("copyPromptButton").onclick = () => copyText($("promptEditor").value).then(ok => showToast(ok ? "Blueprint copied" : "Could not copy the blueprint"));
+ $("startOverButton").onclick = startOver;
+
+ renderImages(); refreshBridgeStatus();
+ window.setInterval(() => { if (document.visibilityState === "visible") refreshBridgeStatus(); },10000);
+</script>
+</body>
+</html>
diff --git a/public/director-workspace.js b/public/director-workspace.js
new file mode 100644
index 0000000..343c6d9
--- /dev/null
+++ b/public/director-workspace.js
@@ -0,0 +1,598 @@
+(() => {
+ "use strict";
+
+ const API = window.location.origin;
+ const TOKEN_KEY = "null-motion-bridge-token";
+ const LEGACY_TOKEN_KEYS = ["null-motion-browser-token", "nullMotionBridgeToken", "nullBridgeToken"];
+ const PIPELINE_KEY = "null-director-pipeline-v1";
+ const SCRIPT_DRAFT_KEY = "null-script-workspace-draft";
+ const PROMPT_HANDOFF_KEY = "null-motion-prompt-handoff";
+ const PIPELINE_VERSION = 1;
+ const defaultStages = [
+ {
+ code: "01", icon: "GO", title: "Trigger", short: "Choose the source and define the request.",
+ heading: "Start from an explicit editorial intention",
+ body: "The editor chooses a complete Premiere sequence, a marked range, a timestamped script, or a single motion brief. Null records the active sequence, dimensions, frame rate, source range, provider, asset policy, render quality, and review mode before analysis begins.",
+ contracts: [["Input", "Transcript, caption track, timed script, or prompt"], ["Context", "Sequence size, FPS, range, origin, and editor guidance"], ["Guard", "Never infer a different sequence, range, provider, or asset policy"]],
+ status: "ready", notes: ""
+ },
+ {
+ code: "02", icon: "TC", title: "Read timing", short: "Extract words and preserve where they live.",
+ heading: "Build one trustworthy timeline map",
+ body: "Null reads corrected Premiere captions first, then a corrected source transcript or pasted timed text. Every cue is normalized into both sequence time and overlay-local time so graphics land on the intended words without passing absolute Premiere offsets into animation code.",
+ contracts: [["Source", "Prefer corrected caption timing; preserve the declared timestamp origin"], ["Mapping", "Keep sequence time and composition-local time as separate fields"], ["Guard", "Do not invent, double-apply, or silently shift timestamps"]],
+ status: "ready", notes: ""
+ },
+ {
+ code: "03", icon: "WHY", title: "Understand", short: "Read the whole video before choosing graphics.",
+ heading: "Understand meaning before decorating moments",
+ body: "The director examines the complete source for audience, argument, subtext, emotional arc, pacing, named entities, quantitative claims, footage competition, and moments where a graphic materially improves comprehension or impact. Leaving footage clean is a valid decision.",
+ contracts: [["Analyze", "Narrative, audience, emotion, entities, data, pacing, and footage pressure"], ["Select", "Prefer sparse high-value moments over wall-to-wall motion"], ["Guard", "Expose concise evidence and decisions without hidden chain-of-thought"]],
+ status: "ready", notes: ""
+ },
+ {
+ code: "04", icon: "IMG", title: "Plan assets", short: "Resolve authentic logos, products, and photos.",
+ heading: "Treat authenticity as a production input",
+ body: "Every named brand, app, person, place, interface, or product creates an explicit asset-needs decision. Required assets are researched, validated, approved, downloaded, and frozen locally before composition. Null never redraws a recognizable entity from memory.",
+ contracts: [["Classify", "Required, helpful, or not-needed for every planned graphic"], ["Research", "Prefer supplied files and official sources; preserve provenance"], ["Guard", "Strict mode stops before rendering when a required asset is unresolved"]],
+ status: "ready", notes: ""
+ },
+ {
+ code: "05", icon: "THM", title: "Set theme", short: "Create one campaign system for the video.",
+ heading: "Create continuity without making every shot identical",
+ body: "A theme is generated from brand evidence, subject, footage, audience, and emotional tone when the editor has not supplied one. It defines semantic color roles, typography, material, spacing, asset treatment, transition family, and motion character.",
+ contracts: [["Stable", "Palette roles, typography, material, spacing, and transition family"], ["Variable", "Template, crop, density, scale, emphasis, and asset arrangement"], ["Guard", "Never introduce a competing dominant palette inside one campaign"]],
+ status: "ready", notes: ""
+ },
+ {
+ code: "06", icon: "TPL", title: "Plan shots", short: "Choose useful 5–10 second motion windows.",
+ heading: "Turn the storyboard into independent authored shots",
+ body: "The director proposes a start time, duration, on-screen copy, authentic asset assignments, compatible template ID, slot values, transition notes, and a quality checklist. Most overlays live between five and ten seconds, while meaning and readability determine the final duration.",
+ contracts: [["Timing", "Prefer independent 5–10 second overlays with exact cue anchors"], ["Selection", "Rank only compatible templates from the live website catalog"], ["Guard", "Do not use a data graphic when the narration contains no real data"]],
+ status: "ready", notes: ""
+ },
+ {
+ code: "07", icon: "MOV", title: "Adapt & return", short: "Render, review, and place the finished overlays.",
+ heading: "Apply identity without replacing authored motion craft",
+ body: "Null fills approved copy and asset slots, applies campaign tokens and bounded controls, renders transparent media, and reviews sampled frames. Only accepted results return to Null Motion and insert above the footage at their verified sequence times.",
+ contracts: [["Allowed", "Copy, authentic assets, campaign tokens, duration, and authored controls"], ["Locked", "Structure, hierarchy, geometry, masks, and recognizable choreography"], ["Output", "Reviewed transparent MOV, sidecar metadata, provenance, and safe placement"]],
+ status: "ready", notes: ""
+ }
+ ];
+
+ const flowIcons = {
+ workspace: '<rect x="3" y="4" width="18" height="16" rx="2"></rect><path d="M3 9h18M9 9v11"></path>',
+ link: '<path d="M10 13a5 5 0 0 0 7.1.1l2-2a5 5 0 0 0-7.1-7.1l-1.1 1.1M14 11a5 5 0 0 0-7.1-.1l-2 2A5 5 0 0 0 12 20l1.1-1.1"></path>',
+ plan: '<path d="M9.5 4.5A3.5 3.5 0 0 0 6 8v1a3 3 0 0 0-2 2.8A3.2 3.2 0 0 0 7.2 15H9v4M14.5 4.5A3.5 3.5 0 0 1 18 8v1a3 3 0 0 1 2 2.8 3.2 3.2 0 0 1-3.2 3.2H15v4M9 8h6M9 12h6M9 16h6"></path>',
+ render: '<path d="M5 3h14v18H5zM9 3v4M15 3v4M9 17v4M15 17v4M5 9h14M5 15h14"></path>',
+ review: '<path d="M3 12s3.5-6 9-6 9 6 9 6-3.5 6-9 6-9-6-9-6z"></path><circle cx="12" cy="12" r="2.5"></circle>',
+ deliver: '<path d="M12 3v12M7 10l5 5 5-5M5 21h14"></path>',
+ sequence: '<rect x="3" y="5" width="18" height="14" rx="2"></rect><path d="M7 9h10M7 13h6M7 17h3"></path>',
+ transcript: '<path d="M6 3h9l4 4v14H6zM14 3v5h5M9 12h6M9 16h4"></path>',
+ storyboard: '<rect x="3" y="4" width="18" height="16" rx="2"></rect><path d="M8 4v16M16 4v16M3 10h18M3 15h18"></path>',
+ layers: '<path d="m12 3 9 5-9 5-9-5 9-5zM3 12l9 5 9-5M3 16l9 5 9-5"></path>',
+ timeline: '<path d="M4 5v14M20 5v14M4 12h16M8 9v6M13 8v8M17 10v4"></path>',
+ history: '<path d="M4 4v5h5M4.7 9A8 8 0 1 1 5 16M12 8v5l3 2"></path>'
+ };
+
+ const flowDefinitions = {
+ website: [
+ {
+ icon: "workspace", title: "Choose a workspace", short: "Start with a prompt, reference, or complete script.",
+ detail: "Templates and Manual handle one graphic. Reference Studio starts from captured visual evidence. Script to Motion plans a complete edit before it renders anything.",
+ where: "Browser page under templates/", output: "A prompt, reference package, or timestamped script", boundary: "The website cannot read or change a Premiere timeline.",
+ evidence: "templates/index.html · create.html · script.html", link: "./", linkLabel: "Open website workspaces"
+ },
+ {
+ icon: "link", title: "Connect locally", short: "The browser talks to the loopback companion.",
+ detail: "This public starter serves UI data from its own origin. Generation and provider access require a new backend integration.",
+ where: "Browser to local HTTP API", output: "An authenticated, versioned request", boundary: "The per-install secret is never returned to the browser.",
+ evidence: "POST /api/v1/pair · GET /api/v1/client-contract", link: "control-center.html", linkLabel: "Open connection diagnostics"
+ },
+ {
+ icon: "plan", title: "Build the plan", short: "Meaning, timing, theme, and useful graphic moments come first.",
+ detail: "Scripts use the psychology/storyboard route. Single prompts use the optimization route. The result is reviewable planning data, not hidden reasoning and not a render.",
+ where: "Local companion planning modules", output: "Storyboard segments or an optimized production brief", boundary: "Sparse planning may leave weak moments as footage-only.",
+ evidence: "POST /api/v1/psychology-analyze · POST /api/prompts/optimize"
+ },
+ {
+ icon: "render", title: "Resolve and render", short: "Authentic assets are frozen before the composition is built.",
+ detail: "The companion validates required assets, builds authored-template or provider HTML, renders it through HyperFrames and Chrome, then produces transparent media with FFmpeg.",
+ where: "server/runPipeline() and focused companion modules", output: "Transparent MOV, preview frames, provenance, and sidecar metadata", boundary: "Strict asset mode stops before composition when a required real asset is unresolved.",
+ evidence: "POST /generate · asset-resolver.js · builder.js"
+ },
+ {
+ icon: "review", title: "Review the job", short: "Progress and accepted outputs survive a page reload.",
+ detail: "Jobs are durable in SQLite. The website follows progress, displays review results and warnings, and can reopen completed or failed work from Renders.",
+ where: "Companion job store plus website status UI", output: "Accepted result, retryable failure, or explicit warning", boundary: "A skipped vision review is labeled unreviewed; it is not presented as reviewed.",
+ evidence: "GET /api/v1/jobs · SSE progress · server/db.js", link: "renders.html", linkLabel: "Open render history"
+ },
+ {
+ icon: "deliver", title: "Download or hand off", short: "Use the MOV directly or send a deliberate request to Premiere.",
+ detail: "The browser can download the transparent MOV. A paired website can also create a durable Premiere inbox or native action request, which the CEP panel must claim before anything happens in Premiere.",
+ where: "Download service or durable Premiere inbox", output: "Downloaded MOV or pending CEP action", boundary: "The browser never receives a general-purpose Premiere or filesystem bridge.",
+ evidence: "Premiere integration is not connected in this project."
+ }
+ ],
+ cep: [
+ {
+ icon: "sequence", title: "Read the sequence", short: "Auto starts from the active Premiere edit.",
+ detail: "The CEP panel asks host.jsx for sequence size, frame rate, playhead, In/Out range, and safe project context. It saves the project before caption extraction when required.",
+ where: "CEP panel to ExtendScript through evalScript", output: "Bounded sequence context with an explicit timestamp origin", boundary: "Premiere reads and writes stay in jsx/host.jsx.",
+ evidence: "HF_getSequenceInfo() · HF_getCaptionProjectContext()"
+ },
+ {
+ icon: "transcript", title: "Get corrected words", short: "Captions come first; corrected source transcripts are fallback.",
+ detail: "Null reads bounded caption records from the saved Premiere project. If captions are absent, the invisible read-only helper can return corrected source transcript data. SRT, CSV, and markers remain recovery inputs.",
+ where: "Companion caption reader or read-only transcript helper", output: "Timestamped cues tied to the selected sequence range", boundary: "The helper has no visible panel, generation logic, or timeline-write capability.",
+ evidence: "/api/v1/premiere-captions/extract · uxp-transcript-helper/"
+ },
+ {
+ icon: "storyboard", title: "Plan and review", short: "The complete edit becomes a sparse storyboard.",
+ detail: "Auto posts the transcript and sequence context for psychology analysis. Automatic mode continues after planning; Review first pauses so the editor can adjust segments, templates, assets, and timing.",
+ where: "CEP Auto UI plus companion storyboard module", output: "Selected 4–12 second overlay windows with relative and absolute timing", boundary: "Source-video duration never becomes one monolithic composition.",
+ evidence: "POST /api/v1/psychology-analyze"
+ },
+ {
+ icon: "layers", title: "Render overlays", short: "Each selected moment becomes an independent job.",
+ detail: "The panel submits a durable sequence batch. The companion runs bounded parallel jobs, emits incremental results, and keeps successful siblings when one segment fails.",
+ where: "Companion sequence scheduler and render pipeline", output: "Independent transparent MOVs plus absolute insertion times", boundary: "Provider identity, asset mode, render mode, and review policy remain explicit.",
+ evidence: "POST /api/v1/generate-sequence · script_batches · batch_items"
+ },
+ {
+ icon: "timeline", title: "Place at exact times", short: "Accepted overlays go above the footage, not under it.",
+ detail: "host.jsx validates the target sequence and chooses a dedicated or first safe track above every overlapping footage track. It places clips with Premiere time objects at returned absolute sequence times.",
+ where: "Premiere host transaction in jsx/host.jsx", output: "Placed timeline clips and a durable insertion receipt", boundary: "Overlay-local cues stay relative; absolute sequence offsets are applied only at placement.",
+ evidence: "HF_importAutoSequence() · TickTime/host time objects"
+ },
+ {
+ icon: "history", title: "Recover safely", short: "History survives panel and companion restarts.",
+ detail: "History reopens Auto batches and manual renders, shows partial success, retries failed items, and processes durable website inbox actions. Claimed actions use stored receipts so an acknowledgment retry cannot repeat a timeline mutation.",
+ where: "CEP History plus durable companion records", output: "Retry, insert, save, dismiss, or receipt-guarded rollback", boundary: "Uncertain claimed actions are not replayed automatically.",
+ evidence: "/api/v1/premiere-actions · premiere_inbox · premiere_actions"
+ }
+ ]
+ };
+
+ let stages = loadStages();
+ let selectedStage = 0;
+ let mode = "script";
+ let templates = [];
+ let activeTheme = null;
+ let clientContract = null;
+ let latestPlan = null;
+ const activeFlowSteps = { website: 0, cep: 0 };
+ let saveTimer = null;
+ let toastTimer = null;
+ let resetTimer = null;
+
+ function byId(id) { return document.getElementById(id); }
+ function bridgeToken() {
+ try {
+ let token = localStorage.getItem(TOKEN_KEY) || "";
+ if (token) return token;
+ for (const key of LEGACY_TOKEN_KEYS) {
+ token = localStorage.getItem(key) || "";
+ if (!token) continue;
+ localStorage.setItem(TOKEN_KEY, token);
+ LEGACY_TOKEN_KEYS.forEach(legacyKey => localStorage.removeItem(legacyKey));
+ return token;
+ }
+ } catch (_) {}
+ return "";
+ }
+ function escapeHtml(value) { return String(value == null ? "" : value).replace(/[&<>"']/g, character => ({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[character]); }
+ function clone(value) { return JSON.parse(JSON.stringify(value)); }
+ function clamp(value, min, max) { return Math.max(min, Math.min(max, Number(value) || 0)); }
+ function unique(values) { return Array.from(new Set(values.filter(Boolean))); }
+ function cleanText(value, fallback, max = 5000) { const text = String(value == null ? "" : value).trim(); return (text || fallback || "").slice(0, max); }
+
+ function flowIcon(name) {
+ return `<svg viewBox="0 0 24 24" aria-hidden="true">${flowIcons[name] || flowIcons.workspace}</svg>`;
+ }
+
+ function renderFlowDetail(name) {
+ const detail = byId(`${name}FlowDetail`);
+ const step = flowDefinitions[name]?.[activeFlowSteps[name]];
+ if (!detail || !step) return;
+ detail.innerHTML = `
+ <div class="flow-detail-copy">
+ <span class="flow-detail-icon">${flowIcon(step.icon)}</span>
+ <div><small>Step ${String(activeFlowSteps[name] + 1).padStart(2, "0")}</small><h4>${escapeHtml(step.title)}</h4><p>${escapeHtml(step.detail)}</p></div>
+ </div>
+ <dl class="flow-facts">
+ <div><dt>Runs in</dt><dd>${escapeHtml(step.where)}</dd></div>
+ <div><dt>Produces</dt><dd>${escapeHtml(step.output)}</dd></div>
+ <div><dt>Safety boundary</dt><dd>${escapeHtml(step.boundary)}</dd></div>
+ </dl>
+ <div class="flow-evidence"><span>Code path</span><code>${escapeHtml(step.evidence)}</code>${step.link ? `<a href="${escapeHtml(step.link)}">${escapeHtml(step.linkLabel)}</a>` : ""}</div>`;
+ }
+
+ function selectFlowStep(name, index, focus = false) {
+ const steps = flowDefinitions[name] || [];
+ activeFlowSteps[name] = clamp(index, 0, steps.length - 1);
+ const track = byId(`${name}Flow`);
+ track?.querySelectorAll("[data-flow-step]").forEach((button, buttonIndex) => {
+ const selected = buttonIndex === activeFlowSteps[name];
+ button.classList.toggle("active", selected);
+ button.setAttribute("aria-pressed", selected ? "true" : "false");
+ button.tabIndex = selected ? 0 : -1;
+ });
+ renderFlowDetail(name);
+ if (focus) track?.querySelector(`[data-flow-step="${activeFlowSteps[name]}"]`)?.focus({ preventScroll: true });
+ }
+
+ function renderFlow(name) {
+ const track = byId(`${name}Flow`);
+ const steps = flowDefinitions[name] || [];
+ if (!track) return;
+ track.innerHTML = steps.map((step, index) => `
+ <button class="flow-node${index === activeFlowSteps[name] ? " active" : ""}" type="button" data-flow-step="${index}" aria-pressed="${index === activeFlowSteps[name] ? "true" : "false"}" aria-controls="${name}FlowDetail" tabindex="${index === activeFlowSteps[name] ? "0" : "-1"}">
+ <span class="flow-node-count">${String(index + 1).padStart(2, "0")}</span>
+ <span class="flow-node-icon">${flowIcon(step.icon)}</span>
+ <span class="flow-node-copy"><b>${escapeHtml(step.title)}</b><span>${escapeHtml(step.short)}</span></span>
+ </button>`).join("");
+ track.addEventListener("click", event => {
+ const button = event.target.closest("[data-flow-step]");
+ if (button) selectFlowStep(name, Number(button.dataset.flowStep), true);
+ });
+ track.addEventListener("keydown", event => {
+ if (!["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(event.key)) return;
+ event.preventDefault();
+ const last = steps.length - 1;
+ let next = activeFlowSteps[name];
+ if (["ArrowRight", "ArrowDown"].includes(event.key)) next = next === last ? 0 : next + 1;
+ if (["ArrowLeft", "ArrowUp"].includes(event.key)) next = next === 0 ? last : next - 1;
+ if (event.key === "Home") next = 0;
+ if (event.key === "End") next = last;
+ selectFlowStep(name, next, true);
+ });
+ renderFlowDetail(name);
+ }
+
+ function initializeFlowExplainers() {
+ renderFlow("website");
+ renderFlow("cep");
+ }
+
+ function normalizeStages(input) {
+ const source = Array.isArray(input) ? input : [];
+ return defaultStages.map((fallback, index) => {
+ const value = source[index] && typeof source[index] === "object" ? source[index] : {};
+ const contracts = Array.isArray(value.contracts) ? value.contracts : fallback.contracts;
+ return {
+ code: fallback.code,
+ icon: cleanText(value.icon, fallback.icon, 4).toUpperCase(),
+ title: cleanText(value.title, fallback.title, 80),
+ short: cleanText(value.short, fallback.short, 180),
+ heading: cleanText(value.heading, fallback.heading, 180),
+ body: cleanText(value.body, fallback.body, 2500),
+ contracts: fallback.contracts.map((contract, contractIndex) => {
+ const incoming = Array.isArray(contracts[contractIndex]) ? contracts[contractIndex] : contract;
+ return [cleanText(incoming[0], contract[0], 48), cleanText(incoming[1], contract[1], 320)];
+ }),
+ status: ["ready", "review", "optional"].includes(value.status) ? value.status : "ready",
+ notes: cleanText(value.notes, "", 1800)
+ };
+ });
+ }
+
+ function loadStages() {
+ try { return normalizeStages(JSON.parse(localStorage.getItem(PIPELINE_KEY) || "null")?.stages); }
+ catch (_) { return clone(defaultStages); }
+ }
+
+ function saveStages() {
+ clearTimeout(saveTimer);
+ byId("saveState")?.classList.add("saving");
+ if (byId("saveState")) byId("saveState").textContent = "Saving…";
+ saveTimer = setTimeout(() => {
+ localStorage.setItem(PIPELINE_KEY, JSON.stringify({ version: PIPELINE_VERSION, updatedAt: new Date().toISOString(), stages }));
+ byId("saveState")?.classList.remove("saving");
+ if (byId("saveState")) byId("saveState").textContent = "Saved locally";
+ }, 220);
+ }
+
+ function showToast(message) {
+ clearTimeout(toastTimer);
+ byId("toast").textContent = message;
+ byId("toast").classList.add("show");
+ toastTimer = setTimeout(() => byId("toast").classList.remove("show"), 2400);
+ }
+
+ function renderPipeline() {
+ byId("pipeline").innerHTML = stages.map((stage, index) => `
+ <button class="stage${index === selectedStage ? " active" : ""}" type="button" data-stage="${index}">
+ <span class="stage-icon">${escapeHtml(stage.icon)}</span>
+ <span class="stage-copy"><b>${escapeHtml(stage.title)}</b><span>${escapeHtml(stage.short)}</span></span>
+ <span class="stage-num">${stage.code}</span><i class="stage-status ${stage.status}" aria-label="${escapeHtml(stage.status)}"></i>
+ </button>`).join("");
+ }
+
+ function renderEditor() {
+ const stage = stages[selectedStage];
+ byId("stageEditor").innerHTML = `
+ <div class="editor-head">
+ <div class="editor-identity"><span class="editor-badge">${escapeHtml(stage.icon)}</span><div><small>Stage ${stage.code} · editable</small><h3>${escapeHtml(stage.title)}</h3></div></div>
+ <div class="editor-nav"><button id="previousStage" type="button" aria-label="Previous stage"${selectedStage === 0 ? " disabled" : ""}>←</button><button id="nextStage" type="button" aria-label="Next stage"${selectedStage === stages.length - 1 ? " disabled" : ""}>→</button></div>
+ </div>
+ <div class="editor-form">
+ <div class="form-row">
+ <label class="field"><span>Stage name</span><input data-field="title" value="${escapeHtml(stage.title)}" /></label>
+ <label class="field"><span>Status</span><select data-field="status"><option value="ready"${stage.status === "ready" ? " selected" : ""}>Ready · required</option><option value="review"${stage.status === "review" ? " selected" : ""}>Needs review</option><option value="optional"${stage.status === "optional" ? " selected" : ""}>Optional</option></select></label>
+ </div>
+ <label class="field"><span>One-line purpose</span><input data-field="short" value="${escapeHtml(stage.short)}" /></label>
+ <label class="field"><span>Editorial objective</span><input data-field="heading" value="${escapeHtml(stage.heading)}" /></label>
+ <label class="field"><span>Operating instruction</span><textarea data-field="body">${escapeHtml(stage.body)}</textarea></label>
+ <div class="contract-editor"><div class="contract-editor-head"><span>Production contract</span><small>Label + enforceable rule</small></div>${stage.contracts.map((contract, index) => `<div class="contract-edit-row"><input data-contract="${index}" data-part="0" value="${escapeHtml(contract[0])}" aria-label="Contract ${index + 1} label" /><input data-contract="${index}" data-part="1" value="${escapeHtml(contract[1])}" aria-label="Contract ${index + 1} rule" /></div>`).join("")}</div>
+ <label class="field notes"><span>Your notes</span><textarea data-field="notes" placeholder="Add references, exceptions, acceptance criteria, or reminders for this stage…">${escapeHtml(stage.notes)}</textarea></label>
+ </div>`;
+ byId("previousStage").onclick = () => selectStage(selectedStage - 1);
+ byId("nextStage").onclick = () => selectStage(selectedStage + 1);
+ byId("stageEditor").querySelectorAll("[data-field]").forEach(input => {
+ const eventName = input.tagName === "SELECT" ? "change" : "input";
+ input.addEventListener(eventName, () => {
+ stage[input.dataset.field] = input.value;
+ saveStages(); renderPreview(); renderPipeline();
+ if (["title", "icon"].includes(input.dataset.field)) renderEditorHeading();
+ });
+ });
+ byId("stageEditor").querySelectorAll("[data-contract]").forEach(input => input.addEventListener("input", () => {
+ stage.contracts[Number(input.dataset.contract)][Number(input.dataset.part)] = input.value;
+ saveStages(); renderPreview();
+ }));
+ }
+
+ function renderEditorHeading() {
+ const stage = stages[selectedStage];
+ const heading = byId("stageEditor").querySelector(".editor-identity h3");
+ if (heading) heading.textContent = stage.title;
+ }
+
+ function renderPreview() {
+ const stage = stages[selectedStage];
+ byId("stagePreview").innerHTML = `<div class="readable-stage"><span class="stage-kicker">${stage.code} · ${escapeHtml(stage.icon)} · ${escapeHtml(stage.status)}</span><h3>${escapeHtml(stage.heading)}</h3><p>${escapeHtml(stage.body)}</p><div class="readable-contracts">${stage.contracts.map(contract => `<div class="readable-contract"><b>${escapeHtml(contract[0])}</b><span>${escapeHtml(contract[1])}</span></div>`).join("")}</div>${stage.notes ? `<div class="readable-notes"><small>Your notes</small><p>${escapeHtml(stage.notes)}</p></div>` : ""}</div>`;
+ }
+
+ function selectStage(index) {
+ selectedStage = clamp(index, 0, stages.length - 1);
+ renderPipeline(); renderEditor(); renderPreview();
+ }
+
+ function stageMarkdown(stage) {
+ return `## ${stage.code}. ${stage.title}\n\n**Purpose:** ${stage.short}\n\n### ${stage.heading}\n\n${stage.body}\n\n${stage.contracts.map(contract => `- **${contract[0]}:** ${contract[1]}`).join("\n")}${stage.notes ? `\n\n**Notes:** ${stage.notes}` : ""}`;
+ }
+ function pipelineMarkdown() { return `# Null Motion Director Pipeline\n\n${stages.map(stageMarkdown).join("\n\n---\n\n")}`; }
+ function pipelineJson() { return JSON.stringify({ version: PIPELINE_VERSION, exportedAt: new Date().toISOString(), stages }, null, 2); }
+ function planningGuidance() {
+ return stages.map(stage => `${stage.code} ${stage.title}: ${stage.short}\n${stage.body}\n${stage.contracts.map(contract => `${contract[0]}=${contract[1]}`).join("; ")}${stage.notes ? `\nEditor notes: ${stage.notes}` : ""}`).join("\n\n").slice(0, 7000);
+ }
+
+ async function copyText(text, success) {
+ try {
+ if (navigator.clipboard?.writeText) await navigator.clipboard.writeText(text);
+ else {
+ const textarea = document.createElement("textarea"); textarea.value = text; textarea.style.position = "fixed"; textarea.style.opacity = "0";
+ document.body.appendChild(textarea); textarea.select(); document.execCommand("copy"); textarea.remove();
+ }
+ showToast(success);
+ } catch (_) { showToast("Clipboard access was unavailable"); }
+ }
+
+ function exportPipeline() {
+ const blob = new Blob([pipelineJson()], { type: "application/json" });
+ const url = URL.createObjectURL(blob); const anchor = document.createElement("a");
+ anchor.href = url; anchor.download = "null-motion-director-pipeline.json"; anchor.click();
+ setTimeout(() => URL.revokeObjectURL(url), 1000); showToast("Pipeline exported");
+ }
+
+ function importPipeline() {
+ try {
+ const parsed = JSON.parse(byId("importInput").value);
+ stages = normalizeStages(Array.isArray(parsed) ? parsed : parsed.stages);
+ selectedStage = 0; saveStages(); selectStage(0); byId("importDialog").close(); byId("importInput").value = ""; showToast("Pipeline imported");
+ } catch (_) { showToast("Paste valid pipeline JSON"); }
+ }
+
+ async function api(path, options = {}) {
+ const headers = Object.assign({}, options.headers || {});
+ const token = bridgeToken();
+ if (token) headers["X-Null-Bridge-Token"] = token;
+ const response = await fetch(API + path, Object.assign({}, options, { headers }));
+ const data = await response.json().catch(() => ({}));
+ if (!response.ok) throw new Error(data.error || `Null bridge failed (${response.status})`);
+ return data;
+ }
+
+ function emptyOutput(title, copy) {
+ byId("labOutput").innerHTML = `<div class="output-empty"><div class="output-orbit">7</div><strong>${escapeHtml(title)}</strong><span>${escapeHtml(copy)}</span></div>`;
+ }
+
+ function setMode(nextMode) {
+ mode = nextMode;
+ byId("scriptMode").classList.toggle("active", mode === "script"); byId("promptMode").classList.toggle("active", mode === "prompt");
+ byId("scriptMode").setAttribute("aria-selected", mode === "script" ? "true" : "false"); byId("promptMode").setAttribute("aria-selected", mode === "prompt" ? "true" : "false");
+ byId("sourceLabel").textContent = mode === "script" ? "Timestamped transcript" : "Motion brief";
+ byId("sourceInput").placeholder = mode === "script" ? "Paste a transcript, SRT, VTT, or finished script…" : "Describe one graphic, its meaning, assets, timing, and desired tone…";
+ byId("duration").placeholder = mode === "script" ? "Auto, 01:30, or 90" : "5–10 seconds";
+ latestPlan = null;
+ emptyOutput(mode === "script" ? "Build a complete edit plan" : "Build a single-graphic plan", mode === "script" ? "The director will examine the complete transcript and propose only useful motion windows." : "The director will strengthen the brief, identify authentic assets, establish a theme, and prepare a template-ready handoff.");
+ }
+
+ function updateSourceCount() {
+ const text = byId("sourceInput").value.trim();
+ const words = text ? text.split(/\s+/).length : 0;
+ byId("sourceCount").textContent = `${words} word${words === 1 ? "" : "s"} · ${text.length} characters`;
+ }
+ function parseDuration(value) {
+ const clean = String(value || "").trim().toLowerCase().replace(/seconds?|secs?/g, "").trim();
+ if (!clean) return null;
+ if (/^\d+(?:\.\d+)?$/.test(clean)) return Number(clean);
+ const parts = clean.split(":").map(Number); if (parts.some(part => !Number.isFinite(part))) return null;
+ if (parts.length === 3) return parts[0] * 3600 + parts[1] * 60 + parts[2];
+ if (parts.length === 2) return parts[0] * 60 + parts[1];
+ return null;
+ }
+ function detectedTimelineEnd(text) {
+ let end = 0, match;
+ const pattern = /(?:^|\n)\s*(?:\d+\s*\n\s*)?\[?(\d{1,2}:\d{2}(?::\d{2})?(?:[,.]\d{1,3})?)\]?/g;
+ while ((match = pattern.exec(String(text || "")))) end = Math.max(end, parseDuration(match[1].replace(",", ".")) || 0);
+ const srt = /-->\s*(\d{1,2}:\d{2}(?::\d{2})?(?:[,.]\d{1,3})?)/g;
+ while ((match = srt.exec(String(text || "")))) end = Math.max(end, parseDuration(match[1].replace(",", ".")) || 0);
+ return end;
+ }
+ function sourceDuration(text) {
+ const explicit = parseDuration(byId("duration").value); if (explicit) return explicit;
+ if (mode === "prompt") return 7;
+ const timed = detectedTimelineEnd(text); if (timed) return timed + 3;
+ return Math.max(8, Math.ceil(text.split(/\s+/).filter(Boolean).length / 2.55));
+ }
+
+ function inferTheme(source) {
+ const text = String(source || "").toLowerCase();
+ if (/\b(ai|software|app|code|robot|grok|claude|notion|twitter|technology)\b/.test(text)) return { name:"Signal Graphite", style:"Precise technological editorial", colors:["#0A0D12","#EAF7FA","#63D9EB","#6D7BFF"], type:"Inter / compact mono labels", motion:"Productive with one expressive reveal" };
+ if (/\b(finance|money|market|stock|revenue|growth|business)\b/.test(text)) return { name:"Ledger", style:"Confident analytical editorial", colors:["#0D120F","#F1F7F3","#60D394","#F4C95D"], type:"Inter / tabular numerals", motion:"Measured, directional, and data-led" };
+ if (/\b(health|wellness|nature|calm|mind|fitness)\b/.test(text)) return { name:"Quiet Field", style:"Warm, calm, and human", colors:["#101310","#F5F1E8","#9BCF9F","#E7B879"], type:"Humanist sans / generous leading", motion:"Soft continuity and low-amplitude emphasis" };
+ return { name:"Editorial Signal", style:"Neutral premium documentary", colors:["#0E0F12","#F1F2F4","#F4C95D","#A78BFA"], type:"Inter / restrained display scale", motion:"Fast comprehension with selective expression" };
+ }
+ function normalizeTheme(theme) {
+ const colors = theme?.colors || {};
+ return { name:theme?.name || "Saved campaign theme", style:theme?.aestheticStyle || theme?.description || "Saved brand direction", colors:[colors.background || "#0E0F12", colors.text || "#F1F2F4", colors.primary || "#63D9EB", colors.accent || "#A78BFA"], type:theme?.fontFamily || "Inter", motion:theme?.motionCurve || theme?.transitionFamily || "Purposeful non-linear motion" };
+ }
+
+ async function runPlan() {
+ const source = byId("sourceInput").value.trim();
+ if (!source) { byId("sourceInput").focus(); showToast("Paste a source first"); return; }
+ if (mode === "script" && source.length < 32) { showToast("Add enough script for a complete-video read"); return; }
+ const button = byId("runButton"); button.disabled = true; button.firstElementChild.textContent = mode === "script" ? "Reading complete edit…" : "Strengthening brief…";
+ emptyOutput("Director is building the plan", "Reading meaning, timing, entities, theme evidence, your edited pipeline, and the approved template catalog.");
+ try {
+ const duration = sourceDuration(source); const generator = byId("provider").value; const customPipeline = planningGuidance(); let response;
+ if (mode === "script") {
+ response = await api("/api/v1/psychology-analyze", { method:"POST", headers:{"Content-Type":"application/json"}, body:JSON.stringify({
+ transcript:source, sequenceInfo:{width:1920,height:1080,fps:30,duration},
+ userPrompt:`Apply this editor-approved pipeline specification:\n\n${customPipeline}\n\nPrefer independent five-to-ten-second overlays, authentic assets, exact timestamp cues, and one coherent campaign theme.`,
+ generator, mode:"auto-sequence", origin:"website-director-lab", deepAnalysis:true, directorMode:"auto", planningDensity:byId("pacing").value,
+ minimumClipDuration:5, maxSegmentDuration:10, assetResolutionMode:"strict", themeMode:byId("themeMode").value === "active" ? "saved" : "auto", themeId:byId("themeMode").value === "active" && activeTheme ? activeTheme.id : null
+ }) });
+ const storyboard = response.storyboard || {};
+ const theme = storyboard.campaignTheme ? normalizeTheme(storyboard.campaignTheme) : byId("themeMode").value === "active" && activeTheme ? normalizeTheme(activeTheme) : inferTheme(source);
+ latestPlan = { mode, source, duration, storyboard, storyboardId:response.storyboardId, theme };
+ } else {
+ response = await api("/api/prompts/optimize", { method:"POST", headers:{"Content-Type":"application/json"}, body:JSON.stringify({
+ prompt:`${source}\n\nEDITOR PIPELINE:\n${customPipeline}\n\nUse an authored Null Motion template as the structural motion system. Target a readable five-to-ten-second graphic, use authentic supplied or researched assets, and preserve a transparent full-frame background.`,
+ generator, engine:"hyperframes", duration:clamp(duration,5,10), width:1920,height:1080,fps:30, themeId:byId("themeMode").value === "active" && activeTheme ? activeTheme.id : null
+ }) });
+ latestPlan = { mode, source, duration:clamp(duration,5,10), optimized:response, theme:response.theme ? normalizeTheme(response.theme) : inferTheme(source) };
+ }
+ renderResult(latestPlan);
+ } catch (error) {
+ byId("labOutput").innerHTML = `<div class="error-box"><b>Could not build the director plan.</b><br>${escapeHtml(error.message || error)}</div>`;
+ } finally { button.disabled = false; button.firstElementChild.textContent = "Build director plan"; }
+ }
+
+ function candidateId(candidate) { return typeof candidate === "string" ? candidate : candidate && (candidate.id || candidate.templateId); }
+ function templateName(id) { const template = templates.find(item => item.id === id); return template ? template.name : id || "Unselected"; }
+ function formatTime(seconds) { const value = Math.max(0, Number(seconds) || 0); const minutes = Math.floor(value / 60); const rest = value - minutes * 60; return `${String(minutes).padStart(2,"0")}:${rest.toFixed(rest % 1 ? 1 : 0).padStart(2,"0")}`; }
+ function resultStat(label, value) { return `<div class="result-stat"><small>${escapeHtml(label)}</small><b title="${escapeHtml(value)}">${escapeHtml(value)}</b></div>`; }
+
+ function renderResult(plan) {
+ const storyboard = plan.storyboard || null;
+ const segments = storyboard && Array.isArray(storyboard.segments) ? storyboard.segments : [];
+ const selected = segments.filter(segment => segment.shouldRenderGraphic !== false);
+ const assets = plan.mode === "script" ? unique(segments.flatMap(segment => (segment.assetQueries || segment.assetRecommendations || []).map(asset => typeof asset === "string" ? asset : asset.query || asset.entity || asset.name))) : (plan.optimized.assetQueries || []).map(asset => typeof asset === "string" ? asset : asset.query || asset.entity || asset.name);
+ const meaning = plan.mode === "script" ? storyboard.decisionSummary || storyboard.designRationale || "Complete-video narrative analysis returned a reviewable storyboard." : plan.optimized.analysis?.intent || plan.optimized.analysis?.summary || "The brief was expanded into a production-ready motion direction.";
+ const theme = plan.theme; const beats = selected.slice(0, 8); const optimizedPrompt = plan.mode === "prompt" ? plan.optimized.optimizedPrompt : "";
+ const assetHtml = assets.length ? `<div class="chip-row">${assets.slice(0,8).map(asset => `<span class="chip" title="${escapeHtml(asset)}">${escapeHtml(asset)}</span>`).join("")}</div>` : "<p>No recognizable entity requires an external asset, or none was found in this planning pass.</p>";
+ const detailHtml = plan.mode === "script" ? `<article class="result-card wide"><div class="result-card-head"><b>Proposed overlay windows</b><span>06 · TPL</span></div><div class="beats">${beats.length ? beats.map(segment => { const id = segment.templateId || candidateId((segment.bestTemplateCandidates || [])[0]); return `<div class="beat"><time>${formatTime(segment.graphicStartTime ?? segment.startTime)}</time><span title="${escapeHtml(segment.text || segment.spokenText || "")}">${escapeHtml(segment.text || segment.spokenText || "Motion beat")}</span><b>${escapeHtml(templateName(id))}</b></div>`; }).join("") : "<p>No overlay was justified. Leaving footage clean is a valid plan.</p>"}</div></article>` : `<article class="result-card wide"><div class="result-card-head"><b>Template-ready production prompt</b><span>06 · TPL</span></div><p>${escapeHtml(String(optimizedPrompt || plan.source).slice(0,1200))}</p></article>`;
+ byId("labOutput").innerHTML = `<div class="result-summary">${resultStat("Source",plan.mode === "script" ? "Complete edit" : "Single prompt")}${resultStat("Duration",formatTime(plan.duration))}${resultStat("Graphics",plan.mode === "script" ? `${selected.length} selected` : "1 planned")}${resultStat("Theme",theme.name)}</div><div class="result-grid"><article class="result-card wide"><div class="result-card-head"><b>Whole-source understanding</b><span>03 · WHY</span></div><p>${escapeHtml(meaning)}</p></article><article class="result-card"><div class="result-card-head"><b>Authentic asset plan</b><span>04 · IMG</span></div>${assetHtml}</article><article class="result-card"><div class="result-card-head"><b>Campaign theme</b><span>05 · THM</span></div><div class="theme-preview"><div class="swatches">${theme.colors.map(color => `<i style="background:${escapeHtml(color)}"></i>`).join("")}</div><div class="theme-copy"><b>${escapeHtml(theme.name)}</b><span>${escapeHtml(`${theme.style} · ${theme.type} · ${theme.motion}`)}</span></div></div></article>${detailHtml}</div><div class="result-actions"><button type="button" id="copyPlan">Copy plan</button><button class="primary" type="button" id="continuePlan">${plan.mode === "script" ? "Continue in Script to Motion" : "Continue in prompt generator"}</button></div>`;
+ byId("copyPlan").onclick = copyPlan; byId("continuePlan").onclick = continuePlan;
+ }
+
+ async function copyPlan() {
+ if (!latestPlan) return;
+ const text = latestPlan.mode === "script" ? JSON.stringify(latestPlan.storyboard, null, 2) : latestPlan.optimized.optimizedPrompt || latestPlan.source;
+ copyText(text, "Director plan copied");
+ }
+ function continuePlan() {
+ if (!latestPlan) return;
+ if (latestPlan.mode === "script") {
+ localStorage.setItem(SCRIPT_DRAFT_KEY, JSON.stringify({ script:latestPlan.source, duration:String(latestPlan.duration), format:"1920x1080", fps:"30", provider:byId("provider").value, density:byId("pacing").value, assetMode:"strict", renderMode:"high-end", guidance:`Use the edited director pipeline. ${planningGuidance().slice(0,3500)}` }));
+ location.href = "script.html";
+ } else { localStorage.setItem(PROMPT_HANDOFF_KEY, latestPlan.optimized.optimizedPrompt || latestPlan.source); location.href = "./"; }
+ }
+ function contractDeliveryLabel(value) {
+ return ({
+ "live-api": "Live API",
+ "live-and-generated-fallback": "Live + bundled",
+ "live-api-and-generated-fallback": "Live + bundled",
+ "cep-host": "CEP native",
+ "browser-workspace": "Website native"
+ })[value] || String(value || "Contract").replaceAll("-", " ");
+ }
+
+ function renderClientContract(contract, online) {
+ clientContract = contract && Number(contract.schemaVersion) === 1 ? contract : null;
+ const status = byId("clientContractStatus");
+ const version = byId("clientContractVersion");
+ const grid = byId("clientContractGrid");
+ if (!status || !version || !grid) return;
+ if (!clientContract) {
+ status.textContent = online ? "Contract unavailable" : "Bridge offline · architecture remains editable";
+ version.textContent = "Offline fallback";
+ grid.innerHTML = '<div class="contract-loading">Start or update the local companion to inspect live website and CEP parity.</div>';
+ return;
+ }
+ const shared = (clientContract.capabilities || []).filter(capability => capability.scope === "shared");
+ status.textContent = `${shared.length} shared capabilities verified by one contract`;
+ version.textContent = `Contract ${clientContract.contractVersion}`;
+ grid.innerHTML = shared.map(capability => {
+ const route = (capability.serverRoutes || [])[0] || capability.sourceOfTruth || "Shared contract";
+ return `<article class="contract-capability"><div class="contract-capability-head"><b title="${escapeHtml(capability.label)}">${escapeHtml(capability.label)}</b><span aria-label="Shared by both clients"></span></div><p>${escapeHtml(contractDeliveryLabel(capability.delivery))}<br><code>${escapeHtml(route)}</code></p></article>`;
+ }).join("") || '<div class="contract-loading">No shared capabilities are declared.</div>';
+ }
+
+ function useExample() {
+ byId("sourceInput").value = mode === "script" ? "00:00:00.000 --> 00:00:06.000\nMost AI tools make you jump between apps.\n\n00:00:06.000 --> 00:00:13.000\nGrok finds live conversations while Claude helps shape the idea.\n\n00:00:13.000 --> 00:00:20.000\nThen Notion becomes the place where the finished plan stays organized.\n\n00:00:20.000 --> 00:00:27.000\nThe point is not more software. It is one clear workflow with less friction." : "Show how Grok, Claude, and Notion work together in one AI research workflow. Use their real app logos, a clean technological campaign theme, and a concise 7-second authored motion template with a readable hold.";
+ byId("duration").value = mode === "script" ? "30" : "7"; updateSourceCount(); byId("sourceInput").focus();
+ }
+
+ function bindWorkspace() {
+ byId("pipeline").addEventListener("click", event => { const button = event.target.closest("[data-stage]"); if (button) selectStage(Number(button.dataset.stage)); });
+ byId("copyStage").onclick = () => copyText(stageMarkdown(stages[selectedStage]), "Stage copied as Markdown");
+ byId("copyPipeline").onclick = () => copyText(pipelineMarkdown(), "Full pipeline copied as Markdown");
+ byId("copyJson").onclick = () => copyText(pipelineJson(), "Pipeline JSON copied");
+ byId("exportPipeline").onclick = exportPipeline;
+ byId("openImport").onclick = () => { byId("importInput").value = pipelineJson(); byId("importDialog").showModal(); byId("importInput").select(); };
+ byId("importPipeline").onclick = importPipeline;
+ byId("resetPipeline").onclick = () => {
+ if (byId("resetPipeline").dataset.confirm !== "1") {
+ byId("resetPipeline").dataset.confirm = "1"; byId("resetPipeline").textContent = "Click again to restore";
+ clearTimeout(resetTimer); resetTimer = setTimeout(() => { byId("resetPipeline").dataset.confirm = ""; byId("resetPipeline").textContent = "Restore defaults"; }, 3000); return;
+ }
+ clearTimeout(resetTimer); stages = clone(defaultStages); selectedStage = 0; saveStages(); selectStage(0); byId("resetPipeline").dataset.confirm = ""; byId("resetPipeline").textContent = "Restore defaults"; showToast("Default pipeline restored");
+ };
+ }
+
+ function bindLab() {
+ byId("scriptMode").onclick = () => setMode("script"); byId("promptMode").onclick = () => setMode("prompt");
+ byId("exampleButton").onclick = useExample; byId("runButton").onclick = runPlan;
+ byId("clearSource").onclick = () => { byId("sourceInput").value = ""; byId("duration").value = ""; updateSourceCount(); byId("sourceInput").focus(); };
+ byId("pasteSource").onclick = async () => { try { byId("sourceInput").value = await navigator.clipboard.readText(); updateSourceCount(); } catch (_) { showToast("Clipboard read permission was unavailable"); } };
+ byId("sourceInput").addEventListener("input", updateSourceCount);
+ byId("sourceInput").addEventListener("keydown", event => { if ((event.ctrlKey || event.metaKey) && event.key === "Enter") { event.preventDefault(); runPlan(); } });
+ }
+
+ async function initialize() {
+ initializeFlowExplainers(); renderPipeline(); renderEditor(); renderPreview(); renderClientContract(null, false); bindWorkspace(); bindLab(); updateSourceCount();
+ try {
+ const results = await Promise.all([api("/api/v1/health"), api("/api/v1/templates"), api("/api/user/active-theme"), api("/api/v1/client-contract").catch(() => null)]);
+ templates = Array.isArray(results[1].templates) ? results[1].templates : []; activeTheme = results[2].theme || null;
+ renderClientContract(results[3], true);
+ byId("bridgeDot").classList.add("online"); byId("bridgeText").textContent = `UI ready · ${templates.length} templates · generation not connected`;
+ if (!activeTheme) byId("themeMode").value = "auto";
+ } catch (_) { renderClientContract(null, false); byId("bridgeText").textContent = "Bridge offline · editing still works"; }
+ }
+
+ initialize();
+})();
diff --git a/public/index.html b/public/index.html
new file mode 100644
index 0000000..8dad6a9
--- /dev/null
+++ b/public/index.html
@@ -0,0 +1,4067 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Null Motion — Template Gallery</title>
+<link rel="icon" href="assets/null-logo.png" />
+<style>
+ /* Hallmark · pre-emit critique: P5 H5 E5 S5 R5 V4 · component: imagination toggle · genre: atmospheric · tone: austere creative workbench · anchor: violet · structure: existing composer tool grid */
+ :root {
+ --bg: #0d0d0f; --panel: #141417; --panel-2: #1b1b1f; --line: #2a2a30;
+ --text: #ECECEE; --muted: #8a8a92;
+ --accent: #00e5ff; --accent-2: #7b2fbe; --success: #4ade80; --warning: #fbbf24; --danger: #fb7185;
+ --silver: linear-gradient(135deg, #F2F2F2 0%, #B8B8BC 50%, #8C8C90 100%);
+ }
+ * { box-sizing: border-box; }
+ html, body { margin: 0; padding: 0; overflow-x: clip; }
+ body {
+ background: radial-gradient(1200px 600px at 50% -10%, #1a1a1e 0%, var(--bg) 60%), var(--bg);
+ color: var(--text);
+ font-family: "Inter", -apple-system, "SF Pro Display", system-ui, Arial, sans-serif;
+ -webkit-font-smoothing: antialiased; min-height: 100vh;
+ }
+
+ header {
+ position: sticky; top: 0; z-index: 80;
+ display: flex; align-items: center; justify-content: space-between;
+ min-height: 62px; padding: 10px clamp(20px, 3vw, 44px); border-bottom: 1px solid rgba(255,255,255,.075);
+ background: rgba(10,10,12,.84); backdrop-filter: blur(18px) saturate(130%);
+ }
+ .brand { display: flex; align-items: center; gap: 12px; font-weight: 600; letter-spacing: -0.02em; font-size: 19px; }
+ .logo { width: 30px; height: 30px; border-radius: 9px; object-fit: cover; box-shadow: 0 4px 14px rgba(0,0,0,0.55), inset 0 0 0 1px rgba(255,255,255,0.08); }
+ .brand b { font-weight: 600; } .brand span { color: var(--muted); font-weight: 400; }
+ .login { display: flex; align-items: center; gap: 7px; }
+ .header-action, .chip { display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 7px 11px; border: 1px solid transparent; border-radius: 9px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 520; line-height: 1; text-decoration: none; cursor: pointer; transition: color .18s, border-color .18s, background .18s, transform .18s; }
+ .header-action:hover { color: var(--text); background: rgba(255,255,255,.045); }
+ .header-action.active { color: var(--text); background: rgba(255,255,255,.055); }
+ .header-action.primary { padding: 8px 13px; border-color: rgba(255,255,255,.12); color: #dedee2; background: linear-gradient(180deg, rgba(42,42,47,.9), rgba(24,24,28,.9)); box-shadow: inset 0 1px rgba(255,255,255,.06), 0 5px 16px rgba(0,0,0,.18); }
+ .header-action.primary::before { content: "+"; margin-right: 7px; color: #aef7ff; font-size: 15px; font-weight: 400; }
+ .header-action.primary:hover { border-color: rgba(0,229,255,.3); color: #fff; transform: translateY(-1px); }
+ .header-action.gemini-action {
+ gap: 7px; padding-inline: 10px; border-color: rgba(255,255,255,.1);
+ color: #d8d8dd; background: linear-gradient(180deg, rgba(38,38,44,.86), rgba(22,22,26,.86));
+ box-shadow: inset 0 1px rgba(255,255,255,.045);
+ }
+ .header-action.gemini-action:hover { border-color: rgba(126,166,255,.4); color: #fff; background: linear-gradient(180deg, rgba(48,48,56,.94), rgba(26,26,31,.94)); }
+ .gemini-action img { width: 17px; height: 17px; object-fit: contain; }
+ .gemini-action.is-open { border-color: rgba(126,166,255,.45); background: rgba(77,99,155,.18); }
+ .header-divider { width: 1px; height: 19px; margin: 0 3px; background: rgba(255,255,255,.09); }
+ .chip { border-color: var(--line); background: var(--panel); }
+ .chip:hover { color: var(--text); border-color: #3a3a42; }
+ .chip[hidden] { display: none; }
+ .bridge-status { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 7px 8px; color: var(--muted); font-size: 11px; font-weight: 560; white-space: nowrap; }
+ .bridge-dot { width: 7px; height: 7px; border-radius: 50%; background: #5a5a62; box-shadow: 0 0 0 3px rgba(90,90,98,.09); transition: background .2s, box-shadow .2s; }
+ .bridge-status.is-online { color: #a9dfbb; }
+ .bridge-status.is-online .bridge-dot { background: var(--success); box-shadow: 0 0 0 3px rgba(74,222,128,.09), 0 0 10px rgba(74,222,128,.36); }
+ .bridge-status.is-offline { color: #d9939e; }
+ .bridge-status.is-offline .bridge-dot { background: var(--danger); box-shadow: 0 0 0 3px rgba(251,113,133,.12); }
+ .bridge-status.is-checking .bridge-dot { animation: statusPulse 1.15s ease-in-out infinite; }
+
+ .hero {
+ display: grid; grid-template-columns: minmax(340px,.78fr) minmax(620px,1.22fr);
+ align-items: center; gap: clamp(42px,5vw,82px);
+ width: min(1480px,100%); margin: 0 auto; padding: 42px clamp(24px,4vw,54px) 26px;
+ text-align: left;
+ }
+ .hero-copy { min-width: 0; }
+ .hero h1 { margin: 0; max-width: 620px; font-size: clamp(42px,3.6vw,56px); font-weight: 600; letter-spacing: -0.05em; line-height: 1.02; background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
+ .hero p { margin: 15px 0 0; max-width: 530px; color: var(--muted); font-size: 16px; line-height: 1.5; font-weight: 300; }
+
+ .composer { width: 100%; max-width: 780px; margin: 0; justify-self: end; }
+ .prompt {
+ display: flex; align-items: flex-end; gap: 10px;
+ padding: 10px 10px 10px 18px; background: var(--panel); border: 1px solid var(--line);
+ border-radius: 18px; box-shadow: 0 30px 60px rgba(0,0,0,0.45); transition: border-color .2s, box-shadow .25s, background .25s;
+ }
+ .prompt.drag { border-color: #4a4a55; }
+ .prompt:focus-within { border-color: rgba(0,229,255,.58); background: #17171b; box-shadow: 0 0 0 3px rgba(0,229,255,.07), 0 28px 76px rgba(0,0,0,.56), 0 0 42px rgba(123,47,190,.1); }
+ .prompt textarea { flex: 1; min-width: 0; min-height: 68px; max-height: 170px; padding: 5px 0; resize: vertical; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 15px; line-height: 1.6; font-family: inherit; letter-spacing: .005em; }
+ .prompt textarea::placeholder { color: #56565c; }
+ /* compact backend toggle */
+ .seg { display: flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: 9px; overflow: hidden; }
+ .seg button { background: transparent; border: 0; color: var(--muted); font: inherit; font-size: 11.5px; padding: 6px 10px; cursor: pointer; }
+ .seg button.active { background: #26262c; color: var(--text); }
+ .go { border: 0; cursor: pointer; padding: 11px 20px; border-radius: 11px; font: inherit; font-weight: 600; font-size: 14px; color: #0c0c0d; background: var(--silver); box-shadow: inset 0 1px 1px rgba(255,255,255,0.7); }
+ .go:disabled { opacity: .58; cursor: default; }
+ .go.is-busy::before, .tool-btn.is-busy::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -1px; animation: spin .7s linear infinite; }
+ .composer-tools { display: flex; align-items: center; gap: 10px; margin-top: 12px; }
+ .composer-tools-left { display: flex; align-items: center; gap: 8px; min-width: 0; }
+ .tool-btn { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: 12px; cursor: pointer; }
+ .tool-btn:hover { color: var(--text); border-color: #3a3a42; }
+ .theme-dot { width: 9px; height: 9px; border-radius: 50%; background: #4f7cff; box-shadow: 0 0 12px currentColor; }
+
+ .result-panel { display: none; margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); text-align: left; }
+ .result-panel.show { display: flex; align-items: center; gap: 14px; }
+ .result-visual { flex: 0 0 58px; position: relative; display: grid; width: 58px; height: 76px; place-items: center; overflow: hidden; border: 1px solid var(--line); border-radius: 9px; background: radial-gradient(circle at 50% 35%, #2a2a31, var(--panel-2)); }
+ .result-thumb { display: none; width: 100%; height: 100%; object-fit: cover; }
+ .result-spinner { display: none; width: 22px; height: 22px; border: 2px solid rgba(255,255,255,.15); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
+ .result-panel.is-loading .result-spinner { display: block; }
+ .result-copy { flex: 1; min-width: 0; }
+ .result-title { font-size: 13px; font-weight: 600; color: var(--text); }
+ .result-status { max-height: 5.2em; margin-top: 3px; overflow: auto; overflow-wrap: anywhere; font-size: 12px; line-height: 1.4; color: var(--muted); }
+ .result-progress { height: 3px; margin-top: 8px; overflow: hidden; border-radius: 3px; background: #24242a; }
+ .result-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: #bfc3cc; transition: transform .25s; }
+ .result-actions { display: flex; gap: 8px; }
+ .result-actions a, .result-actions button { border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 9px; padding: 8px 10px; font: inherit; font-size: 11px; text-decoration: none; cursor: pointer; }
+
+ .dashboard { width: min(1540px,100%); margin: 8px auto 4px; padding: 0 clamp(18px,3vw,42px); }
+ .dashboard-shell { padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(145deg, rgba(24,24,28,.94), rgba(12,12,15,.96)); box-shadow: 0 18px 48px rgba(0,0,0,.22); }
+ .dashboard-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 11px; }
+ .dashboard-title { min-width: 0; }
+ .dashboard-title h2 { margin: 0; font-size: 13px; font-weight: 680; letter-spacing: .13em; text-transform: uppercase; }
+ .dashboard-title p { max-width: 620px; margin: 3px 0 0; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
+ .dashboard-actions { display: flex; flex: 0 0 auto; gap: 7px; }
+ .dashboard-refresh { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--muted); font: inherit; font-size: 10px; cursor: pointer; }
+ .dashboard-refresh:hover { color: var(--text); border-color: #44444c; }
+ .dashboard-refresh:disabled { opacity: .48; cursor: default; }
+ .dashboard-clear:hover { color: #fda4af; border-color: rgba(251,113,133,.32); }
+ .dashboard-refresh.is-loading::before { content: ""; width: 10px; height: 10px; border: 1.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
+ .dashboard-queue { color: #d9d9de; }
+ .dashboard-queue b { display: grid; min-width: 18px; height: 18px; padding: 0 5px; place-items: center; border-radius: 999px; background: #e4e4e8; color: #111114; font-size: 8px; }
+ .dashboard-queue[aria-expanded="true"] { border-color: #51515a; background: #242429; }
+ .generation-queue { margin-bottom: 14px; overflow: hidden; border: 1px solid #303037; border-radius: 13px; background: #111115; }
+ .generation-queue[hidden] { display: none; }
+ .queue-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; border-bottom: 1px solid #292930; }
+ .queue-head h3 { margin: 0; color: #e4e4e8; font-size: 11px; font-weight: 680; }
+ .queue-head p { margin: 3px 0 0; color: #74747d; font-size: 9px; }
+ .queue-close { display: grid; width: 26px; height: 26px; padding: 0; place-items: center; border: 1px solid #33333a; border-radius: 50%; background: #1b1b20; color: #aaaab2; font: inherit; font-size: 15px; cursor: pointer; }
+ .queue-list { display: grid; max-height: 330px; overflow: auto; }
+ .queue-empty { padding: 22px; color: #777780; font-size: 10.5px; text-align: center; }
+ .queue-item { display: grid; grid-template-columns: 8px minmax(0,1fr) minmax(120px,.5fr) auto; gap: 11px; align-items: center; padding: 11px 13px; border-bottom: 1px solid #25252b; }
+ .queue-item:last-child { border-bottom: 0; }
+ .queue-dot { width: 7px; height: 7px; border-radius: 50%; background: #8f8f99; box-shadow: 0 0 10px rgba(255,255,255,.2); }
+ .queue-item.is-rendering .queue-dot { background: #75d9f0; box-shadow: 0 0 12px rgba(87,211,255,.52); animation: statusPulse 1.5s ease-in-out infinite; }
+ .queue-item.is-waiting .queue-dot { background: #f5c96f; box-shadow: 0 0 12px rgba(245,201,111,.42); }
+ .queue-main { min-width: 0; }
+ .queue-title { overflow: hidden; color: #dedee2; font-size: 10.5px; font-weight: 640; text-overflow: ellipsis; white-space: nowrap; }
+ .queue-prompt { display: -webkit-box; overflow: hidden; margin-top: 4px; color: #85858f; font-size: 9px; line-height: 1.4; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
+ .queue-state { min-width: 0; }
+ .queue-state-label { display: flex; justify-content: space-between; gap: 8px; color: #9b9ba4; font-size: 8.5px; }
+ .queue-progress { height: 3px; margin-top: 6px; overflow: hidden; border-radius: 3px; background: #292930; }
+ .queue-progress span { display: block; width: 100%; height: 100%; transform-origin: left; background: #bfc3cc; }
+ .queue-actions { display: flex; align-items: center; gap: 6px; }
+ .queue-actions button { min-height: 28px; padding: 5px 8px; border: 1px solid #33333a; border-radius: 7px; background: #1c1c21; color: #c9c9cf; font: inherit; font-size: 8.5px; cursor: pointer; }
+ .queue-actions button:hover { border-color: #4b4b54; color: #fff; }
+ .queue-protected { color: #7fa18a; font-size: 10px; white-space: nowrap; }
+ .jobs-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
+ .jobs-empty { grid-column: 1 / -1; min-height: 108px; display: grid; place-items: center; padding: 22px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); font-size: 13px; text-align: center; }
+ .job-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; border: 1px solid var(--line); border-radius: 11px; background: rgba(14,14,17,.82); transition: border-color .18s, transform .18s, box-shadow .18s; }
+ .job-card:hover { border-color: #414149; transform: translateY(-1px); box-shadow: 0 10px 24px rgba(0,0,0,.22); }
+ .job-media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-bottom: 1px solid var(--line); background-color: #08080a; background-image: linear-gradient(45deg, #121216 25%, transparent 25%), linear-gradient(-45deg, #121216 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #121216 75%), linear-gradient(-45deg, transparent 75%, #121216 75%); background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-size: 16px 16px; }
+ .job-preview-trigger { position: relative; display: block; width: 100%; height: 100%; padding: 0; overflow: hidden; border: 0; background: transparent; color: var(--text); cursor: pointer; }
+ .job-preview-trigger img { display: block; width: 100%; height: 100%; object-fit: contain; transition: opacity .18s, transform .28s; }
+ .job-live-preview { position: absolute; z-index: 1; border: 0; transform-origin: top left; pointer-events: none; }
+ .job-preview-trigger:hover img, .job-preview-trigger:focus-visible img { opacity: .78; transform: scale(1.012); }
+ .job-preview-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
+ .job-preview-placeholder { display: grid; width: 100%; height: 100%; place-items: center; color: #64646d; font-size: 10px; letter-spacing: .03em; }
+ .job-play { position: absolute; z-index: 2; left: 50%; top: 50%; display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; background: rgba(10,10,13,.72); box-shadow: 0 8px 18px rgba(0,0,0,.32); opacity: 0; transform: translate(-50%,-44%) scale(.92); transition: opacity .18s, transform .18s, background .18s; backdrop-filter: blur(10px); }
+ .job-play::before { content: ""; width: 0; height: 0; margin-left: 3px; border-top: 6px solid transparent; border-bottom: 6px solid transparent; border-left: 9px solid #fff; }
+ .job-preview-trigger:hover .job-play, .job-preview-trigger:focus-visible .job-play { opacity: 1; transform: translate(-50%,-50%) scale(1); }
+ .job-media-badge { position: absolute; z-index: 2; right: 6px; bottom: 6px; padding: 3px 5px; border: 1px solid rgba(255,255,255,.12); border-radius: 5px; background: rgba(8,8,10,.74); color: #c7c7cd; font-size: 8px; font-weight: 650; letter-spacing: .03em; pointer-events: none; backdrop-filter: blur(8px); }
+ .job-body { display: flex; min-width: 0; flex: 1; flex-direction: column; padding: 12px; }
+ .job-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
+ .job-name { overflow: hidden; color: var(--text); font-size: 11.5px; font-weight: 650; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
+ .job-time { flex: 0 0 auto; color: #66666f; font-size: 8.5px; }
+ .job-specs { overflow: hidden; margin-top: 3px; color: #74747d; font-size: 8.5px; text-overflow: ellipsis; white-space: nowrap; }
+ .job-description { display: -webkit-box; min-height: 30px; margin: 8px 0 0; overflow: hidden; color: #8a8a94; font-size: 9px; line-height: 1.55; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
+ .job-actions { display: grid; grid-template-columns: minmax(0,1fr) auto auto auto; gap: 5px; margin-top: 9px; }
+ .job-actions a, .job-actions button { display: inline-flex; align-items: center; justify-content: center; min-height: 28px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-2); color: var(--text); font: inherit; font-size: 9px; font-weight: 600; text-decoration: none; cursor: pointer; }
+ .job-actions a:hover, .job-actions button:hover { border-color: #4a4a53; background: #222227; }
+ .job-actions .job-action-preview { border-color: rgba(255,255,255,.18); background: linear-gradient(180deg, #e8e8eb, #b8b8be); color: #111114; }
+ .job-actions .job-action-preview:hover { border-color: #fff; background: #ededf0; }
+ .job-actions button.job-delete { color: #8d8d96; }
+ .job-actions button.job-delete:hover { color: #fda4af; border-color: rgba(251,113,133,.32); }
+ .job-actions button:disabled { opacity: .48; cursor: default; }
+
+ @media (max-width: 1360px) { .jobs-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
+ @media (max-width: 880px) { .jobs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
+ @media (max-width: 720px) {
+ .queue-item { grid-template-columns: 8px minmax(0,1fr) auto; }
+ .queue-state { grid-column: 2 / -1; }
+ .jobs-grid { grid-template-columns: 1fr; }
+ }
+
+ /* Auto Director explainer: documents the real code path and the template-locked target. */
+ .director { width: min(1440px,100%); margin: 28px auto 6px; padding: 0 clamp(24px,4vw,54px); }
+ .director-shell { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: linear-gradient(145deg, rgba(23,23,27,.96), rgba(10,10,13,.98)); box-shadow: 0 28px 80px rgba(0,0,0,.28); }
+ .director-head { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 28px; align-items: end; padding: clamp(22px,3vw,34px); border-bottom: 1px solid var(--line); }
+ .director-eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 11px; color: #8befff; font-size: 10px; font-weight: 750; letter-spacing: .16em; text-transform: uppercase; }
+ .director-eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 15px rgba(0,229,255,.72); }
+ .director-head h2 { max-width: 800px; margin: 0; font-size: clamp(25px,2.5vw,38px); font-weight: 620; letter-spacing: -.035em; line-height: 1.08; }
+ .director-head p { max-width: 780px; margin: 13px 0 0; color: #9b9ba4; font-size: 14px; line-height: 1.65; }
+ .director-status { display: grid; grid-template-columns: repeat(2,minmax(120px,1fr)); gap: 8px; min-width: 286px; }
+ .director-stat { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: rgba(10,10,13,.55); }
+ .director-stat span { display: block; color: #65656d; font-size: 9px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
+ .director-stat b { display: block; margin-top: 5px; color: #d9d9dd; font-size: 12px; font-weight: 600; }
+ .director-stat.warning { border-color: rgba(251,191,36,.24); background: rgba(251,191,36,.045); }
+ .director-stat.warning b { color: #f8d67a; }
+ .director-body { padding: clamp(20px,3vw,34px); }
+ .director-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
+ .director-path { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(12,12,15,.68); }
+ .director-path.target { border-color: rgba(74,222,128,.24); background: linear-gradient(145deg, rgba(74,222,128,.045), rgba(12,12,15,.76)); }
+ .director-path-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
+ .director-path-title h3 { margin: 0; color: #e2e2e5; font-size: 15px; font-weight: 650; }
+ .director-pill { padding: 5px 8px; border: 1px solid rgba(251,191,36,.24); border-radius: 99px; color: #f8d67a; background: rgba(251,191,36,.05); font-size: 9px; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
+ .director-path.target .director-pill { color: #a7f3c1; border-color: rgba(74,222,128,.25); background: rgba(74,222,128,.06); }
+ .director-flow { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 18px; margin-top: 18px; }
+ .director-node { position: relative; min-width: 0; padding: 12px 10px; border: 1px solid #2d2d34; border-radius: 11px; background: #151519; }
+ .director-node:not(:last-child)::after { content: "\2192"; position: absolute; top: 50%; right: -15px; transform: translateY(-50%); color: #4d4d55; font-size: 13px; }
+ .director-node em { display: block; margin-bottom: 7px; color: #64646c; font: 700 9px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; }
+ .director-node b { display: block; color: #d8d8dd; font-size: 11px; line-height: 1.35; }
+ .director-node span { display: block; margin-top: 5px; color: #777780; font-size: 9.5px; line-height: 1.4; }
+ .director-node.escape { border-color: rgba(251,113,133,.28); background: rgba(251,113,133,.055); }
+ .director-node.escape b { color: #fda4af; }
+ .director-node.locked { border-color: rgba(74,222,128,.26); background: rgba(74,222,128,.05); }
+ .director-node.locked b { color: #a7f3c1; }
+ .director-callout { margin-top: 16px; padding: 14px 15px; border-left: 2px solid var(--warning); border-radius: 0 10px 10px 0; background: rgba(251,191,36,.05); color: #adadb5; font-size: 12px; line-height: 1.58; }
+ .director-callout strong { color: #f4f4f5; }
+ .director-path.target .director-callout { border-left-color: var(--success); background: rgba(74,222,128,.045); }
+ .director-rules { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; margin-top: 16px; }
+ .director-rule { padding: 17px; border: 1px solid var(--line); border-radius: 14px; background: rgba(17,17,20,.76); }
+ .director-rule small { display: block; margin-bottom: 8px; color: #71717a; font-size: 9px; font-weight: 750; letter-spacing: .12em; text-transform: uppercase; }
+ .director-rule h3 { margin: 0 0 8px; font-size: 13px; }
+ .director-rule p { margin: 0; color: #8d8d96; font-size: 11.5px; line-height: 1.58; }
+ .director-rule.ai h3 { color: #8befff; }
+ .director-rule.template h3 { color: #a7f3c1; }
+ .director-rule.fallback h3 { color: #f8d67a; }
+ .director-details { margin-top: 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(12,12,15,.62); }
+ .director-details summary { padding: 15px 17px; color: #cfcfd4; font-size: 12px; font-weight: 620; cursor: pointer; }
+ .director-details[open] summary { border-bottom: 1px solid var(--line); }
+ .director-detail-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 22px; padding: 19px; }
+ .director-steps { display: grid; gap: 12px; counter-reset: director-step; }
+ .director-step { position: relative; padding-left: 38px; counter-increment: director-step; }
+ .director-step::before { content: counter(director-step); position: absolute; left: 0; top: 0; display: grid; width: 25px; height: 25px; place-items: center; border: 1px solid #34343b; border-radius: 8px; color: #a9a9b1; background: #19191d; font: 700 10px/1 ui-monospace, Consolas, monospace; }
+ .director-step b { display: block; color: #d7d7dc; font-size: 11.5px; }
+ .director-step span { display: block; margin-top: 3px; color: #7e7e87; font-size: 10.5px; line-height: 1.5; }
+ .director-code { padding: 15px; border: 1px solid #292930; border-radius: 12px; background: #0d0d10; }
+ .director-code h4 { margin: 0 0 10px; color: #d0d0d5; font-size: 11px; }
+ .director-code code { display: block; margin: 7px 0; overflow-wrap: anywhere; color: #8d8d97; font: 10px/1.45 ui-monospace, "SFMono-Regular", Consolas, monospace; }
+ .director-defaults { margin: 12px 0 0; color: #f8d67a; font-size: 10.5px; line-height: 1.55; }
+
+ @keyframes spin { to { transform: rotate(360deg); } }
+ @keyframes statusPulse { 50% { opacity: .35; transform: scale(.78); } }
+
+ /* photo tray — hidden until an image is pasted/dropped */
+ #tray {
+ overflow: hidden; max-height: 0; opacity: 0;
+ transition: max-height .35s cubic-bezier(.16,1,.3,1), opacity .3s, margin-top .35s;
+ margin-top: 0;
+ }
+ #tray.show { max-height: 160px; opacity: 1; margin-top: 12px; }
+ .tray-inner { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--panel); border: 1px dashed var(--line); border-radius: 14px; }
+ .tray-label { font-size: 12px; color: var(--muted); margin-right: 4px; }
+ .thumb { position: relative; width: 84px; height: 84px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
+ .thumb img { width: 100%; height: 100%; object-fit: cover; }
+ .thumb .x { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; border-radius: 50%; background: rgba(0,0,0,0.7); color: #fff; font-size: 13px; line-height: 20px; text-align: center; cursor: pointer; }
+
+ #sections { overflow: hidden; padding-bottom: 70px; }
+ .section { width: min(1440px,100%); margin: 34px auto 0; padding: 0 clamp(24px,4vw,54px); }
+ .section:last-of-type { margin-bottom: 28px; }
+ .sec-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 0 0 12px; }
+ .sec-title { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
+ .sec-head h2 { font-size: 15px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted); font-weight: 600; margin: 0; }
+ .sec-head .count { font-size: 12px; color: #4d4d54; }
+
+ .carousel-controls { display: flex; align-items: center; gap: 7px; }
+ .carousel-status { min-width: 70px; margin-right: 4px; color: #5d5d65; font-size: 10px; letter-spacing: .12em; text-align: right; text-transform: uppercase; }
+ .carousel-btn {
+ display: inline-flex; align-items: center; justify-content: center;
+ width: 34px; height: 34px; padding: 0; border: 1px solid var(--line); border-radius: 50%;
+ background: linear-gradient(180deg,#1c1c20,#121215); color: #b8b8be; cursor: pointer;
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.05); transition: border-color .18s,color .18s,transform .18s,opacity .18s;
+ }
+ .carousel-btn:hover:not(:disabled) { color: var(--text); border-color: #484850; transform: translateY(-1px); }
+ .carousel-btn:disabled { opacity: .24; cursor: default; }
+ .carousel-btn svg { width: 14px; height: 14px; }
+
+ .grid {
+ display: flex; gap: 16px; width: 100%; overflow-x: auto; overflow-y: hidden;
+ padding: 10px 4px 22px; scroll-padding-inline: 4px; scroll-snap-type: x mandatory;
+ overscroll-behavior-inline: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;
+ }
+ .grid::-webkit-scrollbar { display: none; }
+ .card {
+ flex: 0 0 clamp(260px,22vw,300px); scroll-snap-align: start;
+ border: 1px solid var(--line); border-radius: 15px; overflow: hidden; background: var(--panel);
+ transition: transform .22s,border-color .22s,box-shadow .22s; display: flex; flex-direction: column; position: relative;
+ }
+ .grid-short .card { flex-basis: clamp(154px,12.2vw,174px); }
+ .card:hover { border-color: #3c3c46; transform: translateY(-2px); box-shadow: 0 28px 58px rgba(0,0,0,0.42); }
+ .template-quality { position: absolute; top: 9px; left: 9px; z-index: 5; padding: 5px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(12,12,15,.82); color: #b8b8c0; font-size: 8px; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; backdrop-filter: blur(10px); }
+ .template-quality.approved { border-color: rgba(74,222,128,.3); color: #a7f3c1; background: rgba(21,72,41,.72); }
+ .template-quality.needs-review { border-color: rgba(251,191,36,.3); color: #f8d67a; background: rgba(74,52,16,.72); }
+
+ .preview { position: relative; width: 100%; overflow: hidden; background: radial-gradient(120% 120% at 30% 20%, #3a3a40 0%, #1a1a1e 55%, #0c0c0e 100%); }
+ .preview iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: top left; pointer-events: none; }
+ /* hover overlay: use + download */
+ .overlay { position: absolute; left: 50%; bottom: 11px; transform: translate(-50%, 10px); opacity: 0; transition: .22s; z-index: 2;
+ display: flex; gap: 7px; }
+ .card:hover .overlay { opacity: 1; transform: translate(-50%, 0); }
+ .ovBtn { display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; padding: 9px 13px; border-radius: 9px; color: inherit; font: inherit; font-weight: 600; font-size: 12px; text-decoration: none; white-space: nowrap; box-shadow: 0 12px 30px rgba(0,0,0,0.5); }
+ .useBtn { color: #0c0c0d; background: var(--silver); box-shadow: inset 0 1px 1px rgba(255,255,255,0.7), 0 12px 30px rgba(0,0,0,0.5); }
+ .downloadBtn { color: var(--text); background: linear-gradient(180deg, #2b2b2e, #161618); border: 1px solid var(--line); }
+ .downloadBtn:hover { border-color: #4a4a55; }
+ @media (hover: none) { .overlay { opacity: 1; transform: translate(-50%, 0); } }
+ .meta { display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 70px; padding: 11px 13px 12px; }
+ .meta > div { min-width: 0; }
+ .meta .name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; font-size: 14px; }
+ .meta .use { overflow: hidden; margin-top: 3px; color: var(--muted); font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
+ .meta .tag { flex: 0 0 auto; font-size: 10px; color: var(--muted); border: 1px solid var(--line); padding: 5px 8px; border-radius: 99px; white-space: nowrap; cursor: pointer; background: transparent; font-family: inherit; transition: .2s; }
+ .meta .tag:hover { color: var(--text); border-color: #3a3a42; }
+ .template-delete { position: absolute; top: 9px; right: 9px; z-index: 5; display: grid; width: 30px; height: 30px; place-items: center; border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: rgba(12,12,15,.8); color: #9a9aa2; opacity: 0; cursor: pointer; backdrop-filter: blur(10px); transition: opacity .18s,color .18s,border-color .18s,background .18s; }
+ .card:hover .template-delete,.template-delete:focus-visible { opacity: 1; }
+ .template-delete:hover { color: #ffd2d8; border-color: rgba(251,113,133,.45); background: rgba(84,24,35,.88); }
+ .template-delete svg { width: 14px; height: 14px; }
+ .template-empty { width: min(620px,calc(100% - 32px)); margin: 42px auto; padding: 28px; border: 1px dashed #3a3a42; border-radius: 18px; color: var(--muted); text-align: center; }
+ .template-empty h2 { margin: 0 0 7px; color: var(--text); font-size: 18px; }
+ .template-empty p { margin: 0 0 16px; font-size: 13px; line-height: 1.5; }
+
+ @media (max-width: 1120px) {
+ .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 36px; }
+ .hero-copy { text-align: center; }
+ .hero h1, .hero p { margin-right: auto; margin-left: auto; }
+ .composer { justify-self: center; }
+ }
+
+ @media (max-width: 700px) {
+ header { padding: 13px 16px; }
+ .header-action.utility, .header-divider { display: none; }
+ #addTemplateBtn { display: inline-flex; width: 34px; padding: 0; font-size: 0; }
+ #addTemplateBtn::before { content: "\2699"; font-size: 15px; }
+ .header-action.primary { width: 34px; padding: 0; font-size: 0; }
+ .header-action.primary::before { margin: 0; font-size: 18px; }
+ .header-action.gemini-action { width: 34px; padding: 0; }
+ .gemini-action span { display: none; }
+ .bridge-status { padding: 8px 5px; }
+ .bridge-copy { display: none; }
+ .chip { padding: 8px 11px; font-size: 11px; }
+ .hero { gap: 22px; padding: 28px 16px 14px; }
+ .hero h1 { font-size: 38px; }
+ .hero p { font-size: 14px; }
+ .prompt { flex-wrap: wrap; padding: 10px; }
+ .prompt textarea { flex-basis: 100%; min-height: 84px; padding: 5px 4px 9px; }
+ .seg { margin-right: auto; }
+ .section { margin-top: 28px; padding: 0 16px; }
+ .sec-head h2 { font-size: 13px; }
+ .carousel-status { display: none; }
+ .carousel-btn { width: 32px; height: 32px; }
+ .grid { gap: 13px; margin: 0 -16px; width: calc(100% + 32px); padding: 8px 16px 20px; scroll-padding-inline: 16px; }
+ .card { flex-basis: min(78vw,280px); }
+ .grid-short .card { flex-basis: min(43vw,162px); }
+ .grid-short .ovBtn { padding: 8px 9px; font-size: 10.5px; }
+ .dashboard { padding: 0 16px; }
+ .dashboard-shell { padding: 14px; }
+ .dashboard-head { flex-direction: column; }
+ .dashboard-actions { width: 100%; }
+ .dashboard-actions button { flex: 1; }
+ .jobs-grid { grid-template-columns: 1fr; }
+ .director { margin-top: 22px; padding: 0 16px; }
+ .director-head { grid-template-columns: 1fr; }
+ .director-status { min-width: 0; }
+ .director-compare, .director-rules, .director-detail-grid { grid-template-columns: 1fr; }
+ .director-flow { grid-template-columns: 1fr; gap: 9px; }
+ .director-node:not(:last-child)::after { content: "\2193"; top: auto; right: 50%; bottom: -14px; transform: translateX(50%); }
+ }
+
+ /* ---- Prompt modal (the "copy the prompt" view, ref: side-by-side preview + prompt) ---- */
+ .modal { position: fixed; inset: 0; z-index: 100; display: none; align-items: center; justify-content: center; padding: 32px;
+ background: rgba(6,6,8,0.66); }
+ .modal.show { display: flex; }
+ .modal-card { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 0; width: min(1040px, 94vw); max-height: 88vh; overflow: hidden;
+ border: 1px solid var(--line); border-radius: 22px; background: var(--panel); box-shadow: 0 60px 120px rgba(0,0,0,0.7); }
+ .modal-preview { position: relative; overflow: hidden; background: radial-gradient(120% 120% at 30% 20%, #3a3a40 0%, #1a1a1e 55%, #0c0c0e 100%); border-right: 1px solid var(--line); }
+ .modal-preview iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: top left; pointer-events: none; }
+ .modal-right { display: flex; flex-direction: column; padding: 24px 24px 22px; min-width: 0; }
+ .modal-right h3 { margin: 0; font-size: 22px; font-weight: 600; letter-spacing: -0.02em;
+ background: var(--silver); -webkit-background-clip: text; background-clip: text; color: transparent; }
+ .modal-sub { font-size: 12px; color: var(--muted); margin: 6px 0 14px; }
+ .prompt-box { flex: 1; overflow: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px;
+ padding: 16px 18px; font-size: 14.5px; line-height: 1.55; color: #d7d7dc; white-space: pre-wrap; }
+ .modal-actions { display: flex; gap: 10px; margin-top: 16px; }
+ .modal-actions button, .modal-actions a { display: inline-flex; align-items: center; justify-content: center; border: 0; cursor: pointer; padding: 13px 20px; border-radius: 12px; font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; }
+ .btn-copy { flex: 1; color: #0c0c0d; background: var(--silver); box-shadow: inset 0 1px 1px rgba(255,255,255,0.7); }
+ .btn-use { color: var(--text); background: var(--panel-2); border: 1px solid var(--line); }
+ .btn-download { color: #baf7ff; background: rgba(0,229,255,.08); border: 1px solid rgba(0,229,255,.24) !important; }
+ .modal-x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
+ background: rgba(0,0,0,0.5); color: var(--text); font-size: 17px; cursor: pointer; }
+ @media (max-width: 720px) { .modal-card { grid-template-columns: 1fr; } .modal-preview { display: none; } }
+
+ /* Fast render preview: rendered frames first, live composition fallback. */
+ body.render-preview-open { overflow: hidden; }
+ .render-preview-modal { position: fixed; inset: 0; z-index: 120; display: none; place-items: center; padding: 20px; background: rgba(4,4,6,.76); backdrop-filter: blur(12px) saturate(110%); }
+ .render-preview-modal.show { display: grid; }
+ .render-preview-dialog { display: flex; width: min(840px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: hidden; flex-direction: column; border: 1px solid rgba(255,255,255,.13); border-radius: 15px; background: #111114; box-shadow: 0 34px 100px rgba(0,0,0,.72); }
+ .render-preview-modal.is-portrait .render-preview-dialog { width: min(520px, calc(100vw - 32px)); }
+ .render-preview-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 13px; border-bottom: 1px solid var(--line); }
+ .render-preview-heading { min-width: 0; }
+ .render-preview-eyebrow { display: block; margin-bottom: 3px; color: #76767f; font-size: 8px; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
+ .render-preview-head h3 { overflow: hidden; margin: 0; color: #eeeeef; font-size: 14px; font-weight: 640; letter-spacing: -.01em; text-overflow: ellipsis; white-space: nowrap; }
+ .render-preview-meta { margin-top: 2px; color: #808089; font-size: 9px; }
+ .render-preview-close { display: grid; flex: 0 0 auto; width: 30px; height: 30px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #1b1b1f; color: #cfcfd4; font: inherit; font-size: 17px; line-height: 1; cursor: pointer; }
+ .render-preview-close:hover { border-color: #4a4a52; background: #242429; color: #fff; }
+ .render-preview-viewport { display: grid; min-height: 220px; height: min(52vh, 470px); padding: 10px; place-items: center; overflow: hidden; background: #08080a; }
+ .render-preview-modal.is-portrait .render-preview-viewport { height: min(62vh, 560px); }
+ .render-preview-stage { position: relative; width: 100%; height: 100%; overflow: hidden; border: 1px solid #27272d; border-radius: 9px; background-color: #0b0b0e; background-image: linear-gradient(45deg, #15151a 25%, transparent 25%), linear-gradient(-45deg, #15151a 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #15151a 75%), linear-gradient(-45deg, transparent 75%, #15151a 75%); background-position: 0 0, 0 10px, 10px -10px, -10px 0; background-size: 20px 20px; }
+ .render-preview-image { display: none; width: 100%; height: 100%; object-fit: contain; }
+ .render-preview-frame { position: absolute; left: 50%; top: 50%; display: none; border: 0; transform-origin: center; pointer-events: none; }
+ .render-preview-image.show, .render-preview-frame.show { display: block; }
+ .render-preview-loading, .render-preview-unavailable { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 9px; color: #85858e; font-size: 12px; letter-spacing: .02em; }
+ .render-preview-loading::before { content: ""; width: 24px; height: 24px; margin-right: 9px; border: 2px solid rgba(255,255,255,.14); border-top-color: #d5d5da; border-radius: 50%; animation: spin .75s linear infinite; }
+ .render-preview-loading[hidden], .render-preview-unavailable[hidden] { display: none; }
+ .render-preview-controls { display: grid; grid-template-columns: auto minmax(120px,1fr) auto auto auto; align-items: center; gap: 9px; padding: 9px 12px; border-top: 1px solid var(--line); background: #141417; }
+ .render-preview-toggle { min-width: 58px; min-height: 29px; padding: 5px 9px; border: 1px solid #3a3a42; border-radius: 7px; background: #202025; color: #ededf0; font: inherit; font-size: 9.5px; font-weight: 620; cursor: pointer; }
+ .render-preview-toggle:hover { border-color: #55555f; }
+ .render-preview-scrubber { width: 100%; accent-color: #d3d3d7; cursor: pointer; }
+ .render-preview-time { min-width: 72px; color: #8d8d96; font: 9px/1 ui-monospace, "SFMono-Regular", Consolas, monospace; text-align: center; }
+ .render-preview-download { display: inline-flex; min-height: 29px; align-items: center; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: #1b1b1f; color: #dddddf; font-size: 9.5px; font-weight: 580; text-decoration: none; }
+ .render-preview-download:hover { border-color: #494952; background: #222227; }
+ .render-preview-download[aria-disabled="true"] { cursor: wait; border-color: #27272d; background: #151519; color: #73737d; pointer-events: auto; }
+ .render-preview-download[hidden] { display: none; }
+ .render-preview-prompt { min-height: 29px; padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: #1b1b1f; color: #dddddf; font: inherit; font-size: 9.5px; font-weight: 580; cursor: pointer; }
+ .render-preview-prompt:hover { border-color: #494952; background: #222227; }
+ .render-preview-prompt[hidden] { display: none; }
+ .render-preview-controls.is-live { grid-template-columns: auto minmax(0,1fr) auto auto; }
+ .render-preview-controls.is-live .render-preview-scrubber { display: none; }
+ .render-preview-controls.is-live .render-preview-time { min-width: 0; text-align: left; }
+
+ body.variation-picker-open { overflow: hidden; }
+ .variation-picker { position: fixed; inset: 0; z-index: 110; display: none; place-items: center; padding: 20px; background: rgba(4,4,6,.8); backdrop-filter: blur(14px) saturate(110%); }
+ .variation-picker.show { display: grid; }
+ .variation-picker-dialog { display: flex; width: min(1120px,calc(100vw - 32px)); max-height: calc(100vh - 40px); flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: #111114; box-shadow: 0 38px 120px rgba(0,0,0,.76); }
+ .variation-picker-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
+ .variation-picker-head span { display: block; margin-bottom: 4px; color: #777780; font-size: 8px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
+ .variation-picker-head h3 { margin: 0; font-size: 18px; letter-spacing: -.02em; }
+ .variation-picker-head p { margin: 5px 0 0; color: #85858e; font-size: 11px; }
+ .variation-picker-close { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #1b1b1f; color: #dddde1; font: inherit; font-size: 19px; cursor: pointer; }
+ .variation-picker-progress { height: 3px; overflow: hidden; background: #202025; }
+ .variation-picker-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg,#8d8d98,#f1f1f4); transition: transform .25s; }
+ .variation-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; padding: 18px; overflow: auto; }
+ .variation-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; border: 1px solid #2d2d34; border-radius: 14px; background: #151519; cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
+ .variation-card:hover { border-color: #4a4a53; transform: translateY(-2px); }
+ .variation-card.selected { border-color: rgba(226,226,232,.72); box-shadow: 0 0 0 1px rgba(255,255,255,.14), 0 18px 44px rgba(0,0,0,.34); }
+ .variation-card-media { position: relative; display: grid; aspect-ratio: 16/10; place-items: center; overflow: hidden; border-bottom: 1px solid #292930; background-color: #09090b; background-image: linear-gradient(45deg,#141418 25%,transparent 25%),linear-gradient(-45deg,#141418 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#141418 75%),linear-gradient(-45deg,transparent 75%,#141418 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; }
+ .variation-card-media img { width: 100%; height: 100%; object-fit: contain; }
+ .variation-card-placeholder { color: #6f6f78; font-size: 10px; }
+ .variation-card-status { position: absolute; right: 8px; top: 8px; padding: 4px 7px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(10,10,13,.78); color: #a9a9b2; font-size: 8px; font-weight: 700; text-transform: uppercase; backdrop-filter: blur(8px); }
+ .variation-card-body { display: flex; flex: 1; flex-direction: column; padding: 13px; }
+ .variation-card-title { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
+ .variation-card-title h4 { margin: 0; color: #ededf0; font-size: 13px; }
+ .variation-check { display: grid; flex: 0 0 auto; width: 18px; height: 18px; place-items: center; border: 1px solid #414149; border-radius: 50%; color: transparent; font-size: 10px; }
+ .variation-card.selected .variation-check { border-color: #e4e4e8; background: #e4e4e8; color: #111114; }
+ .variation-card-description { margin: 7px 0 12px; color: #85858e; font-size: 10.5px; line-height: 1.5; }
+ .variation-card-actions { display: flex; gap: 7px; margin-top: auto; }
+ .variation-card-actions button, .variation-card-actions a { display: inline-flex; min-height: 30px; align-items: center; justify-content: center; padding: 6px 9px; border: 1px solid #34343b; border-radius: 8px; background: #1d1d22; color: #dcdce1; font: inherit; font-size: 9px; text-decoration: none; cursor: pointer; }
+ .variation-card-actions button:disabled { opacity: .45; cursor: wait; }
+ .variation-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 18px; border-top: 1px solid var(--line); background: #141417; }
+ .variation-picker-status { color: #8b8b94; font-size: 10.5px; }
+ .variation-picker-download { display: inline-flex; min-height: 34px; align-items: center; padding: 7px 13px; border: 1px solid #ececef; border-radius: 9px; background: #e5e5e8; color: #111114; font-size: 10px; font-weight: 700; text-decoration: none; }
+ .variation-picker-download[aria-disabled="true"] { pointer-events: none; border-color: #303037; background: #1c1c21; color: #666670; }
+
+ .tool-btn.batch-action { border-color: rgba(255,255,255,.15); color: #d5d5da; background: linear-gradient(180deg,rgba(36,36,42,.92),rgba(19,19,23,.92)); }
+ .tool-btn.batch-action:hover { border-color: rgba(255,255,255,.28); color: #fff; }
+ .tool-btn.sweep-action { border-color: rgba(132,164,255,.24); color: #dce4ff; background: linear-gradient(180deg,rgba(33,39,58,.92),rgba(18,20,28,.94)); }
+
+ body.batch-screen-open { overflow: hidden; }
+ .variant-mode-modal { position: fixed; inset: 0; z-index: 142; display: none; place-items: center; padding: 18px; background: rgba(4,4,6,.82); backdrop-filter: blur(16px) saturate(110%); }
+ .variant-mode-modal.show { display: grid; }
+ .variant-mode-dialog { width: min(760px,calc(100vw - 28px)); overflow: hidden; border: 1px solid rgba(255,255,255,.15); border-radius: 18px; background: #111114; box-shadow: 0 40px 120px rgba(0,0,0,.76); }
+ .variant-mode-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 20px; border-bottom: 1px solid var(--line); }
+ .variant-mode-head span, .quality-sweep-kicker { display: block; margin-bottom: 5px; color: #7b7b85; font-size: 8px; font-weight: 760; letter-spacing: .15em; text-transform: uppercase; }
+ .variant-mode-head h3, .quality-sweep-head h3 { margin: 0; color: #f0f0f3; font-size: 20px; letter-spacing: -.025em; }
+ .variant-mode-head p { margin: 7px 0 0; color: #888892; font-size: 11px; line-height: 1.5; }
+ .variant-mode-close, .quality-sweep-close { display: grid; flex: 0 0 auto; width: 34px; height: 34px; padding: 0; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: #1b1b20; color: #d8d8de; font: inherit; font-size: 20px; cursor: pointer; }
+ .variant-mode-prompt { margin: 16px 18px 0; padding: 12px 13px; overflow: hidden; border: 1px solid #292930; border-radius: 10px; background: #0b0b0e; color: #a8a8b1; font-size: 10.5px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
+ .variant-profile-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; padding: 14px 18px 18px; }
+ .variant-profile { display: flex; min-width: 0; min-height: 116px; padding: 12px; flex-direction: column; border: 1px solid #2d2d34; border-radius: 12px; background: #17171b; color: #d5d5da; text-align: left; cursor: pointer; }
+ .variant-profile:hover { border-color: #484851; background: #1c1c21; }
+ .variant-profile.selected { border-color: #d8d8dd; box-shadow: 0 0 0 1px rgba(255,255,255,.12); background: #202025; }
+ .variant-profile strong { color: #f0f0f3; font-size: 11px; }
+ .variant-profile span { margin-top: 6px; color: #7f7f89; font-size: 9px; line-height: 1.4; }
+ .variant-profile em { margin-top: auto; padding-top: 9px; color: #aaaab3; font-size: 8.5px; font-style: normal; }
+ .variant-mode-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line); background: #141417; }
+ .variant-mode-summary { color: #888892; font-size: 10.5px; }
+ .variant-mode-create, .quality-sweep-create { min-height: 38px; padding: 8px 15px; border: 1px solid #f0f0f2; border-radius: 9px; background: #e8e8eb; color: #111114; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
+
+ .quality-sweep-screen { position: fixed; inset: 64px 0 0; z-index: 110; display: none; overflow: auto; background: radial-gradient(circle at 85% 0%,rgba(74,93,148,.13),transparent 30%),#09090c; }
+ .quality-sweep-screen.show { display: block; }
+ .quality-sweep-shell { width: min(1480px,100%); min-height: calc(100vh - 64px); margin: 0 auto; padding: 22px clamp(18px,3vw,46px) 34px; }
+ .quality-sweep-head { display: flex; align-items: center; justify-content: space-between; gap: 22px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
+ .quality-sweep-head-copy { min-width: 0; }
+ .quality-sweep-head p { max-width: 760px; margin: 7px 0 0; overflow: hidden; color: #858590; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
+ .quality-sweep-intro { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 22px 0 16px; }
+ .quality-sweep-intro h4 { margin: 0; color: #e7e7eb; font-size: 14px; }
+ .quality-sweep-intro p { max-width: 720px; margin: 6px 0 0; color: #7f7f89; font-size: 10.5px; line-height: 1.5; }
+ .quality-sweep-progress { width: min(320px,35vw); height: 4px; overflow: hidden; border-radius: 99px; background: #202027; }
+ .quality-sweep-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: linear-gradient(90deg,#7d8dbe,#eef1ff); transition: transform .25s; }
+ .quality-sweep-grid { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 12px; }
+ .quality-run-card { display: flex; min-width: 0; min-height: 430px; overflow: hidden; flex-direction: column; border: 1px solid #2a2a32; border-radius: 15px; background: #131317; box-shadow: 0 16px 36px rgba(0,0,0,.18); }
+ .quality-run-media { position: relative; display: grid; aspect-ratio: 9/12; min-height: 220px; place-items: center; overflow: hidden; border-bottom: 1px solid #292930; background-color: #09090b; background-image: linear-gradient(45deg,#15151a 25%,transparent 25%),linear-gradient(-45deg,#15151a 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#15151a 75%),linear-gradient(-45deg,transparent 75%,#15151a 75%); background-position: 0 0,0 8px,8px -8px,-8px 0; background-size: 16px 16px; }
+ .quality-run-media img { width: 100%; height: 100%; object-fit: contain; }
+ .quality-run-placeholder { color: #777782; font-size: 11px; }
+ .quality-run-status { position: absolute; right: 9px; top: 9px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 999px; background: rgba(10,10,13,.8); color: #b0b0ba; font-size: 8px; font-weight: 750; text-transform: uppercase; backdrop-filter: blur(8px); }
+ .quality-run-body { display: flex; flex: 1; padding: 14px; flex-direction: column; }
+ .quality-run-index { color: #6f6f79; font: 8px/1 ui-monospace,Consolas,monospace; letter-spacing: .12em; }
+ .quality-run-body h4 { margin: 8px 0 0; color: #eeeeF1; font-size: 14px; }
+ .quality-run-body p { margin: 7px 0 12px; color: #85858f; font-size: 10px; line-height: 1.5; }
+ .quality-run-estimate { margin-top: auto; color: #a1a1aa; font-size: 9px; }
+ .quality-run-live { margin-top: 10px; padding: 9px; border: 1px solid #292930; border-radius: 9px; background: #0e0e12; }
+ .quality-run-live-head { display: flex; justify-content: space-between; gap: 8px; color: #b4b4bd; font-size: 8.5px; }
+ .quality-run-live-head strong { color: #ededf1; font-size: 10px; }
+ .quality-run-progress { height: 3px; margin-top: 7px; overflow: hidden; border-radius: 3px; background: #292930; }
+ .quality-run-progress span { display: block; width: 100%; height: 100%; transform-origin: left; background: #c8ccd8; transition: transform .25s; }
+ .quality-run-actions { display: flex; gap: 7px; margin-top: 12px; }
+ .quality-run-actions button, .quality-run-actions a { display: inline-flex; flex: 1; min-height: 31px; align-items: center; justify-content: center; padding: 6px 9px; border: 1px solid #34343d; border-radius: 8px; background: #1d1d22; color: #dedee3; font: inherit; font-size: 9px; text-decoration: none; cursor: pointer; }
+ .quality-run-actions button:disabled { opacity: .42; cursor: wait; }
+ .quality-sweep-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 18px; }
+ .quality-sweep-status { color: #8c8c96; font-size: 10.5px; }
+
+ .job-prompt-modal { position: fixed; inset: 0; z-index: 145; display: none; place-items: center; padding: 20px; background: rgba(4,4,6,.78); backdrop-filter: blur(12px); }
+ .job-prompt-modal.show { display: grid; }
+ .job-prompt-dialog { display: flex; width: min(760px,calc(100vw - 32px)); max-height: min(760px,calc(100vh - 40px)); flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 16px; background: #121216; box-shadow: 0 34px 100px rgba(0,0,0,.72); }
+ .job-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 17px; border-bottom: 1px solid var(--line); }
+ .job-prompt-head span { display: block; margin-bottom: 4px; color: #777780; font-size: 8px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase; }
+ .job-prompt-head h3 { margin: 0; font-size: 15px; }
+ .job-prompt-close { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: #1b1b1f; color: #dddde1; font: inherit; font-size: 18px; cursor: pointer; }
+ .job-prompt-text { min-height: 220px; margin: 0; padding: 20px; overflow: auto; color: #dedee2; background: #0b0b0e; font: 13px/1.7 ui-monospace,"SFMono-Regular",Consolas,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
+ .job-prompt-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 15px; border-top: 1px solid var(--line); }
+ .job-prompt-actions button { min-height: 34px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 8px; background: #1d1d22; color: #e8e8eb; font: inherit; font-size: 10px; font-weight: 620; cursor: pointer; }
+ .job-prompt-actions .primary { color: #111114; border-color: #eeeef0; background: #e8e8eb; }
+
+ /* Integrated layout sketcher. Drawings are sent as Sketchflow guidance,
+ never embedded as visible production artwork. */
+ .draw-tool.has-sketch { border-color: rgba(87,211,255,.5); background: rgba(54,170,215,.12); color: #d7f7ff; }
+ .draw-modal { position: fixed; inset: 0; z-index: 130; display: none; place-items: center; padding: 18px; background: rgba(3,4,7,.82); backdrop-filter: blur(14px); }
+ .draw-modal.show { display: grid; }
+ .draw-dialog { display: grid; width: min(980px,calc(100vw - 30px)); max-height: calc(100vh - 30px); grid-template-columns: minmax(300px,1fr) 260px; overflow: hidden; border: 1px solid rgba(255,255,255,.14); border-radius: 18px; background: #111116; box-shadow: 0 36px 120px rgba(0,0,0,.72); }
+ .draw-stage-wrap { display: grid; min-height: 620px; padding: 22px; place-items: center; overflow: hidden; background: #08080b; }
+ .draw-stage { display: block; max-width: 100%; max-height: calc(100vh - 76px); border: 1px solid #34343d; border-radius: 9px; background: #f7f7f5; box-shadow: 0 24px 70px rgba(0,0,0,.5); cursor: crosshair; touch-action: none; }
+ .draw-panel { display: flex; min-width: 0; flex-direction: column; gap: 15px; padding: 20px; border-left: 1px solid var(--line); }
+ .draw-panel h3 { margin: 0; font-size: 17px; }
+ .draw-panel p { margin: -8px 0 2px; color: var(--muted); font-size: 11px; line-height: 1.5; }
+ .draw-tools { display: grid; grid-template-columns: repeat(3,1fr); gap: 7px; }
+ .draw-tools button, .draw-action { min-height: 36px; border: 1px solid #363640; border-radius: 9px; background: #1b1b20; color: #d8d8dc; font: inherit; font-size: 11px; cursor: pointer; }
+ .draw-tools button.active { border-color: rgba(87,211,255,.55); background: rgba(54,170,215,.13); color: #e4faff; }
+ .draw-field { display: grid; gap: 7px; color: #8d8d96; font-size: 10px; }
+ .draw-field input[type="color"] { width: 100%; height: 36px; padding: 3px; border: 1px solid #363640; border-radius: 9px; background: #17171b; }
+ .draw-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: auto; }
+ .draw-actions .primary { grid-column: 1 / -1; color: #0a0b0d; background: #eef1f5; border-color: #fff; font-weight: 700; }
+ @media (max-width: 760px) { .draw-dialog { grid-template-columns: 1fr; overflow: auto; } .draw-stage-wrap { min-height: 440px; } .draw-panel { border-top: 1px solid var(--line); border-left: 0; } }
+
+ @media (max-width: 680px) {
+ .render-preview-modal { padding: 8px; }
+ .render-preview-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); border-radius: 16px; }
+ .render-preview-viewport { min-height: 240px; height: 58vh; padding: 10px; }
+ .render-preview-controls { grid-template-columns: auto minmax(80px,1fr) auto; gap: 8px; padding: 12px; }
+ .render-preview-download { grid-column: 1 / -1; justify-content: center; }
+ .render-preview-controls.is-live { grid-template-columns: 1fr; }
+ .variation-picker { padding: 8px; }
+ .variation-picker-dialog { width: calc(100vw - 16px); max-height: calc(100vh - 16px); }
+ .variation-grid { grid-template-columns: 1fr; }
+ .variation-picker-foot { align-items: stretch; flex-direction: column; }
+ .variation-picker-download { justify-content: center; }
+ .variant-profile-grid { grid-template-columns: 1fr 1fr; }
+ .variant-mode-foot, .quality-sweep-intro, .quality-sweep-foot { align-items: stretch; flex-direction: column; }
+ .quality-sweep-progress { width: 100%; }
+ .quality-sweep-grid { grid-template-columns: 1fr; }
+ .quality-run-card { min-height: 0; }
+ .quality-run-media { aspect-ratio: 16/10; }
+ }
+
+ .toast { position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 30px); opacity: 0; transition: .3s;
+ background: var(--panel); border: 1px solid var(--line); color: var(--text); padding: 13px 20px; border-radius: 12px; font-size: 14px; box-shadow: 0 20px 50px rgba(0,0,0,0.6); z-index: 50; }
+ .toast.show { opacity: 1; transform: translate(-50%, 0); }
+
+ .theme-card { width: min(680px, 94vw); max-height: 88vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 60px 120px rgba(0,0,0,.7); }
+ .theme-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
+ .theme-head h3 { margin: 0; font-size: 21px; font-weight: 600; }
+ .theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
+ .theme-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
+ .theme-field.full { grid-column: 1 / -1; }
+ .theme-field label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .08em; }
+ .theme-field input, .theme-field textarea, .theme-field select { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); color: var(--text); padding: 10px 11px; outline: 0; font: inherit; font-size: 13px; }
+ .theme-field textarea { min-height: 74px; resize: vertical; }
+ .color-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
+ .color-row .theme-field input { padding: 8px 6px; text-transform: uppercase; }
+ .theme-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 18px; }
+ .template-manager { width: min(760px,94vw); max-height: 90vh; overflow: auto; padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); box-shadow: 0 60px 120px rgba(0,0,0,.72); }
+ .template-manager-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
+ .template-manager-head h3 { margin: 0; font-size: 21px; }
+ .template-manager-head p { margin: 6px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
+ .template-manager-close { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--panel-2); color: var(--text); cursor: pointer; }
+ .archived-block { margin-bottom: 20px; padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #101013; }
+ .archived-block h4,.template-import h4 { margin: 0; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
+ .archived-list { display: grid; gap: 7px; margin-top: 10px; }
+ .archived-empty { color: var(--muted); font-size: 12px; }
+ .archived-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 10px; border: 1px solid #292930; border-radius: 9px; background:#17171a; }
+ .archived-item span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
+ .archived-item button { flex: 0 0 auto; padding: 6px 9px; border: 1px solid #3a3a42; border-radius: 8px; background:#222227; color:var(--text); font:inherit; font-size:10.5px; cursor:pointer; }
+ .template-import { padding-top: 2px; }
+ .template-form-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:11px; margin-top:12px; }
+ .template-form-grid .wide { grid-column:1 / -1; }
+ .template-form-grid label { display:flex; flex-direction:column; gap:6px; min-width:0; color:var(--muted); font-size:10px; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
+ .template-form-grid input,.template-form-grid select,.template-form-grid textarea { width:100%; min-width:0; padding:10px 11px; border:1px solid var(--line); border-radius:9px; outline:0; background:var(--panel-2); color:var(--text); font:inherit; font-size:12px; }
+ .template-form-grid textarea { min-height:82px; resize:vertical; line-height:1.45; }
+ .template-dimensions { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; }
+ .template-import-note { margin:10px 0 0; color:#777780; font-size:10.5px; line-height:1.5; }
+ .template-import-actions { display:flex; align-items:center; justify-content:flex-end; gap:10px; margin-top:15px; }
+ .template-import-actions button { padding:10px 15px; border:0; border-radius:10px; background:var(--silver); color:#0c0c0d; font:inherit; font-size:12px; font-weight:700; cursor:pointer; }
+ .template-import-actions button:disabled { opacity:.55; cursor:default; }
+ @media (max-width: 720px) { .composer-tools { align-items: stretch; flex-direction: column; } .composer-tools-left { width:100%; } .theme-grid { grid-template-columns:1fr; } .color-row { grid-template-columns:1fr 1fr; } }
+ @media (max-width: 620px) { .template-delete { opacity:1; } .template-form-grid { grid-template-columns:1fr; } .template-form-grid .wide { grid-column:auto; } .template-dimensions { grid-template-columns:1fr 1fr; } }
+
+ /* 2026 control-room refresh */
+ :root {
+ --panel-glass: rgba(18,18,22,.86);
+ --line-soft: rgba(255,255,255,.085);
+ --line-bright: rgba(255,255,255,.16);
+ }
+ body {
+ overflow-x: clip;
+ background:
+ radial-gradient(900px 540px at 77% 4%, rgba(42,93,120,.14), transparent 62%),
+ radial-gradient(700px 460px at 18% 12%, rgba(78,54,113,.12), transparent 68%),
+ linear-gradient(180deg, #0c0c0f 0%, #0a0a0c 100%);
+ }
+ body::before {
+ content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
+ opacity: .22;
+ background-image: linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
+ background-size: 72px 72px;
+ mask-image: linear-gradient(to bottom, #000, transparent 72%);
+ }
+ button, select, input, textarea { -webkit-tap-highlight-color: transparent; }
+ button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible {
+ outline: 2px solid rgba(128,224,242,.72); outline-offset: 2px;
+ }
+ header {
+ min-height: 70px; padding-inline: clamp(22px,3vw,54px);
+ border-color: rgba(255,255,255,.065);
+ background: rgba(9,9,12,.76); box-shadow: 0 12px 36px rgba(0,0,0,.18);
+ }
+ .brand { gap: 11px; font-size: 18px; }
+ .logo { width: 32px; height: 32px; border-radius: 10px; }
+ .header-action { min-height: 36px; padding-inline: 12px; border-radius: 10px; }
+ .header-action.active { background: rgba(255,255,255,.07); box-shadow: inset 0 1px rgba(255,255,255,.035); }
+ .header-action.primary { border-color: rgba(255,255,255,.14); background: linear-gradient(180deg, rgba(45,45,51,.94), rgba(24,24,29,.94)); }
+
+ .hero {
+ position: relative; isolation: isolate;
+ grid-template-columns: minmax(320px,.7fr) minmax(700px,1.3fr);
+ gap: clamp(52px,5vw,96px); width: min(1580px,100%);
+ padding: clamp(58px,6vw,88px) clamp(28px,4vw,64px) 38px;
+ }
+ .hero::after {
+ content: ""; position: absolute; z-index: -1; top: 30px; right: 8%; width: 520px; height: 300px;
+ border-radius: 50%; background: rgba(72,142,160,.08); filter: blur(90px); pointer-events: none;
+ }
+ .hero-copy { align-self: center; }
+ .hero-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 19px; color: #8d929a; font-size: 10px; font-weight: 720; letter-spacing: .18em; text-transform: uppercase; }
+ .hero-eyebrow::before { content: ""; width: 28px; height: 1px; background: linear-gradient(90deg, #8befff, rgba(139,239,255,.15)); box-shadow: 0 0 12px rgba(139,239,255,.3); }
+ .hero h1 { min-width: 0; max-width: 610px; overflow-wrap: anywhere; font-size: clamp(54px,4.45vw,76px); font-weight: 590; line-height: .98; letter-spacing: -.06em; }
+ .hero p { max-width: 530px; margin-top: 21px; color: #94949d; font-size: 16px; line-height: 1.62; }
+ .composer {
+ position: relative; width: 100%; max-width: 820px; padding: 12px;
+ border: 1px solid var(--line-soft); border-radius: 20px;
+ background: linear-gradient(145deg, rgba(27,27,32,.92), rgba(13,13,17,.94));
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.055), 0 34px 100px rgba(0,0,0,.42), 0 0 0 1px rgba(0,0,0,.32);
+ }
+ .composer::before { content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit; background: linear-gradient(115deg, rgba(255,255,255,.035), transparent 32%); }
+ .composer-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 2px 3px 10px; }
+ .composer-kicker { display: block; margin-bottom: 5px; color: #6f727a; font-size: 9px; font-weight: 740; letter-spacing: .16em; text-transform: uppercase; }
+ .composer-head h2 { margin: 0; color: #e6e6e9; font-size: 16px; font-weight: 610; letter-spacing: -.02em; }
+ .composer-shortcut { color: #606069; font: 9px/1.2 ui-monospace, "SFMono-Regular", Consolas, monospace; white-space: nowrap; }
+ .prompt {
+ position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto auto; align-items: end;
+ min-height: 100px; padding: 12px; gap: 8px; border-color: rgba(255,255,255,.1); border-radius: 14px;
+ background: linear-gradient(180deg, rgba(11,11,14,.95), rgba(14,14,18,.94));
+ box-shadow: inset 0 1px 0 rgba(255,255,255,.035), 0 16px 38px rgba(0,0,0,.2);
+ }
+ .prompt:focus-within { border-color: rgba(110,208,228,.46); background: #101014; box-shadow: 0 0 0 3px rgba(84,185,207,.07), inset 0 1px rgba(255,255,255,.035), 0 20px 48px rgba(0,0,0,.28); }
+ .prompt textarea {
+ grid-column: 1 / -1; align-self: stretch; width: 100%; min-height: 60px; max-height: 140px;
+ padding: 1px 3px; overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none;
+ color: #e8e8eb; font-size: 14px; line-height: 1.5; resize: vertical;
+ }
+ .prompt textarea::-webkit-scrollbar { display: none; width: 0; height: 0; }
+ .prompt textarea::placeholder { color: #55555e; }
+ .prompt .seg { grid-column: 2; }
+ .prompt .go { grid-column: 3; }
+ .seg { height: 34px; border-color: rgba(255,255,255,.09); border-radius: 9px; background: #18181d; }
+ .seg button { min-width: 82px; padding-inline: 10px; font-size: 10px; }
+ .seg button.active { color: #ededf0; background: linear-gradient(180deg,#303037,#24242a); box-shadow: inset 0 1px rgba(255,255,255,.07); }
+ .go { min-width: 100px; height: 36px; padding: 0 17px; border-radius: 9px; font-size: 12px; box-shadow: inset 0 1px 1px rgba(255,255,255,.72), 0 8px 18px rgba(0,0,0,.26); transition: transform .18s, filter .18s, box-shadow .18s; }
+ .go:hover:not(:disabled) { transform: translateY(-1px); filter: brightness(1.08); box-shadow: inset 0 1px 1px rgba(255,255,255,.8), 0 12px 24px rgba(0,0,0,.32); }
+ .composer-tools { position: relative; display: grid; grid-template-columns: 1fr; gap: 9px; margin-top: 11px; }
+ .composer-tools-left { display: grid; grid-template-columns: minmax(105px,.7fr) minmax(130px,1fr) minmax(210px,1.7fr) minmax(130px,1fr) minmax(105px,.8fr); gap: 7px; width: 100%; }
+ .composer-tools-left .tool-btn { min-width: 0; }
+ .composer-tools-left #variationsBtn { grid-column: 1; }
+ .composer-tools-left #qualitySweepBtn { grid-column: 2; }
+ .composer-tools-left #imaginationToggle { grid-column: 3 / span 2; }
+ .tool-btn { min-height: 34px; padding: 7px 9px; border-color: rgba(255,255,255,.08); border-radius: 9px; background: rgba(10,10,13,.64); color: #96969f; font-size: 11px; white-space: nowrap; }
+ select.tool-btn { color-scheme: dark; }
+ select.tool-btn option { background: #202025; color: #f1f1f4; }
+ .tool-btn:hover { color: #dedee3; border-color: rgba(255,255,255,.16); background: rgba(28,28,33,.82); }
+ .imagination-toggle { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
+ .imagination-toggle::before { content: ""; width: 7px; height: 7px; flex: 0 0 auto; border: 1px solid var(--muted); border-radius: 50%; background: var(--panel-2); }
+ .imagination-toggle[aria-pressed="true"] { border-color: color-mix(in srgb, var(--accent-2) 58%, var(--line)); background: color-mix(in srgb, var(--accent-2) 22%, var(--panel)); color: var(--text); }
+ .imagination-toggle[aria-pressed="true"]::before { border-color: var(--text); background: var(--accent-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-2) 18%, transparent); }
+ .imagination-toggle:active { background: color-mix(in srgb, var(--accent-2) 28%, var(--panel)); }
+ .imagination-toggle:disabled, #assetModeSelect:disabled, #variationsBtn:disabled, #qualitySweepBtn:disabled { opacity: .5; color: var(--muted); cursor: not-allowed; }
+ @media (hover: hover) and (pointer: fine) {
+ .imagination-toggle:hover { border-color: color-mix(in srgb, var(--accent-2) 50%, var(--line)); color: var(--text); }
+ .tool-btn:disabled:hover { border-color: var(--line); background: var(--panel); color: var(--muted); }
+ }
+ .composer-hint { position: relative; display: flex; justify-content: space-between; gap: 18px; padding: 10px 4px 0; color: #5f5f68; font-size: 9.5px; line-height: 1.4; }
+ .composer-hint strong { color: #8a8a93; font-weight: 580; }
+ .generation-estimate { color: #8d94a5; text-align: center; }
+ .generation-estimate strong { color: #b6bccb; }
+
+ .result-panel { position: relative; margin-top: 11px; padding: 12px; border-color: rgba(255,255,255,.09); border-radius: 14px; background: rgba(9,9,12,.68); }
+ .result-panel.is-error { border-color: rgba(251,113,133,.24); background: linear-gradient(135deg,rgba(62,20,29,.38),rgba(13,13,16,.78)); }
+ .result-panel.is-error .result-title { color: #ffc1ca; }
+ .result-panel.is-error .result-status { color: #b98a91; }
+ .result-panel.is-error .result-progress span { background: #fb7185; }
+ .result-panel.is-complete { border-color: rgba(74,222,128,.18); }
+ .result-panel.is-complete .result-progress span { background: #62d58a; }
+ .result-actions { flex-wrap: wrap; justify-content: flex-end; }
+ .result-actions a, .result-actions button { min-height: 34px; padding-inline: 12px; }
+
+ .dashboard { width: min(1580px,100%); margin: 24px auto 8px; padding-inline: clamp(28px,4vw,64px); }
+ .dashboard-shell { padding: clamp(18px,2vw,24px); border-color: rgba(255,255,255,.075); border-radius: 22px; background: linear-gradient(145deg,rgba(20,20,24,.86),rgba(10,10,13,.9)); box-shadow: inset 0 1px rgba(255,255,255,.035), 0 28px 72px rgba(0,0,0,.24); }
+ .dashboard-head { margin-bottom: 17px; }
+ .dashboard-eyebrow { display: block; margin-bottom: 6px; color: #64646d; font-size: 9px; font-weight: 720; letter-spacing: .17em; text-transform: uppercase; }
+ .dashboard-title h2 { color: #dedee2; font-size: 15px; letter-spacing: -.01em; text-transform: none; }
+ .dashboard-title p { margin-top: 5px; color: #74747d; font-size: 11px; }
+ .dashboard-actions { align-items: center; }
+ .dashboard-all { display: inline-flex; min-height: 30px; align-items: center; padding: 6px 10px; color: #a7a7af; font-size: 10px; text-decoration: none; }
+ .dashboard-all:hover { color: #fff; }
+ .dashboard-refresh { min-height: 30px; padding-inline: 10px; border-color: rgba(255,255,255,.075); background: rgba(12,12,15,.65); }
+ .jobs-grid { grid-template-columns: repeat(4,minmax(0,1fr)); gap: 13px; }
+ .job-card { border-color: rgba(255,255,255,.075); border-radius: 14px; background: rgba(11,11,14,.72); }
+ .job-card:hover { border-color: rgba(255,255,255,.17); transform: translateY(-2px); box-shadow: 0 18px 42px rgba(0,0,0,.27); }
+ .job-media { aspect-ratio: 16 / 9; border-color: rgba(255,255,255,.065); }
+ .job-preview-placeholder { position: relative; grid-template-rows: auto auto; gap: 9px; color: #767680; font-size: 9.5px; }
+ .job-preview-placeholder::before { content: ""; width: 27px; height: 27px; justify-self: center; border: 1px solid rgba(255,255,255,.16); border-radius: 9px; background: radial-gradient(circle at 45% 35%,rgba(255,255,255,.11),rgba(255,255,255,.025)); box-shadow: 0 8px 18px rgba(0,0,0,.28); }
+ .job-body { padding: 11px; }
+ .job-name { font-size: 12px; }
+ .job-specs { margin-top: 4px; font-size: 9px; }
+ .job-actions { margin-top: 11px; }
+ .job-actions a, .job-actions button { min-height: 31px; font-size: 9.5px; }
+ .section { width: min(1580px,100%); padding-inline: clamp(28px,4vw,64px); }
+
+ @media (max-width: 1480px) {
+ .hero { grid-template-columns: minmax(290px,.62fr) minmax(660px,1.38fr); gap: 48px; }
+ .hero h1 { font-size: clamp(50px,4.1vw,66px); }
+ .jobs-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
+ }
+ @media (max-width: 1160px) {
+ .hero { grid-template-columns: 1fr; gap: 34px; max-width: 940px; padding-top: 48px; }
+ .hero-copy { text-align: left; }
+ .hero h1, .hero p { margin-left: 0; margin-right: 0; }
+ .composer { justify-self: center; max-width: 820px; }
+ .jobs-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
+ }
+ @media (max-width: 820px) {
+ .login { gap: 3px; }
+ .header-action.utility, .header-divider { display: none; }
+ .prompt { grid-template-columns: minmax(0,1fr) auto auto; }
+ .prompt textarea { grid-column: 1 / -1; }
+ .seg button { min-width: 82px; }
+ .composer-shortcut { display: none; }
+ .composer-tools-left { grid-template-columns: repeat(2,minmax(0,1fr)); }
+ .composer-tools-left #pipelineModeSelect { grid-column: 1 / -1; }
+ .composer-tools-left #variationsBtn, .composer-tools-left #qualitySweepBtn, .composer-tools-left #imaginationToggle { grid-column: auto; }
+ }
+ @media (max-width: 620px) {
+ header { min-height: 62px; padding: 11px 14px; }
+ .brand span, .header-action.active { display: none; }
+ .hero { gap: 25px; padding: 34px 16px 18px; }
+ .hero h1 { font-size: 43px; }
+ .hero p { margin-top: 17px; font-size: 14px; }
+ .composer { padding: 10px; border-radius: 20px; }
+ .composer-head { padding: 3px 3px 11px; }
+ .prompt { min-height: 0; padding: 12px; grid-template-columns: 1fr; }
+ .prompt textarea { min-height: 84px; grid-column: auto; }
+ .prompt .seg, .prompt .go { grid-column: auto; }
+ .seg { width: 100%; }
+ .seg button { flex: 1; min-width: 0; }
+ .go { width: 100%; }
+ .composer-tools-left { grid-template-columns: 1fr; }
+ .composer-tools-left #pipelineModeSelect, .composer-tools-left #imaginationToggle { grid-column: auto; }
+ .composer-hint span:last-child { display: none; }
+ .dashboard { margin-top: 18px; padding-inline: 16px; }
+ .dashboard-shell { padding: 14px; border-radius: 18px; }
+ .dashboard-head { align-items: flex-start; }
+ .dashboard-actions { display: grid; grid-template-columns: 1fr 1fr; }
+ .dashboard-all { grid-column: 1 / -1; justify-content: center; }
+ .jobs-grid { grid-template-columns: 1fr; }
+ .section { padding-inline: 16px; }
+ }
+ @media (pointer: coarse) {
+ .seg button, .go, .tool-btn, .queue-actions button { min-height: 44px; }
+ .dashboard-all,
+ .dashboard-refresh,
+ .dashboard-menu > summary,
+ .job-actions a,
+ .job-actions button,
+ .carousel-btn,
+ .catalog-jump,
+ .meta .tag,
+ .ovBtn,
+ .queue-close,
+ .modal-x,
+ .render-preview-close,
+ .template-manager-close { min-height: 44px; }
+ .ovBtn { min-width: 44px; }
+ .job-delete,
+ .carousel-btn,
+ .queue-close,
+ .modal-x,
+ .render-preview-close,
+ .template-manager-close { min-width: 44px; }
+ .template-delete { width: 44px; height: 44px; opacity: 1; }
+ }
+
+ /* UI organization pass: progressive disclosure and clearer workspace hierarchy. */
+ .hero {
+ grid-template-columns: minmax(330px,.72fr) minmax(650px,1.28fr);
+ gap: clamp(42px,4vw,76px);
+ padding-top: clamp(44px,4.5vw,68px);
+ }
+ .hero h1 { max-width: 590px; font-size: clamp(48px,4vw,68px); line-height: 1; }
+ .hero p { max-width: 500px; }
+ .composer-tools-left { grid-template-columns: repeat(5,minmax(0,1fr)); }
+ .composer-tools-left #themeBtn,
+ .composer-tools-left #variationsBtn,
+ .composer-tools-left #qualitySweepBtn,
+ .composer-tools-left #imaginationToggle { grid-column: auto; }
+ .composer-tools-left #themeBtn { order: 1; }
+ .composer-tools-left #imaginationToggle { order: 2; }
+ .composer-tools-left #variationsBtn { order: 3; }
+ .composer-tools-left #qualitySweepBtn { order: 4; }
+ .composer-settings { min-width: 0; order: 5; }
+ .composer-settings > summary {
+ display: flex;
+ width: 100%;
+ align-items: center;
+ justify-content: space-between;
+ list-style: none;
+ }
+ .composer-settings > summary::-webkit-details-marker { display: none; }
+ .composer-settings > summary span { color: #747780; font-size: 15px; font-weight: 400; transition: transform 180ms ease; }
+ .composer-settings[open] { grid-column: 1 / -1; }
+ .composer-settings[open] > summary { width: min(160px,100%); border-color: rgba(139,239,255,.26); color: #dfe1e6; }
+ .composer-settings[open] > summary span { transform: rotate(45deg); }
+ .composer-settings-panel {
+ display: grid;
+ grid-template-columns: .85fr minmax(230px,1.6fr) .9fr .7fr;
+ gap: 9px;
+ margin-top: 9px;
+ padding: 12px;
+ border: 1px solid rgba(255,255,255,.075);
+ border-radius: 12px;
+ background: rgba(8,8,11,.58);
+ }
+ .composer-field { display: grid; min-width: 0; gap: 6px; }
+ .composer-field > span { color: #686b74; font-size: 8px; font-weight: 760; letter-spacing: .11em; text-transform: uppercase; }
+ .composer-field .tool-btn { width: 100%; }
+ .composer-hint { grid-template-columns: minmax(0,1fr) auto; align-items: start; }
+ .composer-hint > span:last-child { display: none; }
+
+ .dashboard { margin-top: 34px; }
+ .dashboard-head { align-items: flex-end; }
+ .dashboard-actions { flex-wrap: wrap; justify-content: flex-end; }
+ .dashboard-all { border: 1px solid rgba(255,255,255,.1); border-radius: 9px; background: rgba(255,255,255,.035); }
+ .dashboard-menu { position: relative; }
+ .dashboard-menu > summary { list-style: none; cursor: pointer; }
+ .dashboard-menu > summary::-webkit-details-marker { display: none; }
+ .dashboard-menu-popover {
+ position: absolute;
+ z-index: 12;
+ top: calc(100% + 7px);
+ right: 0;
+ width: 170px;
+ padding: 7px;
+ border: 1px solid rgba(255,255,255,.11);
+ border-radius: 10px;
+ background: #17181d;
+ box-shadow: 0 18px 44px rgba(0,0,0,.42);
+ }
+ .dashboard-menu-popover .dashboard-clear { width: 100%; justify-content: flex-start; }
+ .jobs-grid { grid-template-columns: repeat(4,minmax(0,1fr)); }
+
+ .catalog-intro {
+ display: flex;
+ width: min(1580px,100%);
+ align-items: flex-end;
+ justify-content: space-between;
+ gap: 32px;
+ margin: 52px auto 4px;
+ padding-inline: clamp(28px,4vw,64px);
+ }
+ .catalog-eyebrow { display: block; margin-bottom: 7px; color: #6f737d; font-size: 9px; font-weight: 760; letter-spacing: .17em; text-transform: uppercase; }
+ .catalog-intro h2 { margin: 0; color: #e4e4e8; font-size: clamp(24px,2.2vw,34px); font-weight: 610; letter-spacing: -.035em; }
+ .catalog-intro p { max-width: 580px; margin: 8px 0 0; color: #7d808a; font-size: 12px; line-height: 1.55; }
+ .catalog-jumps { display: flex; max-width: 650px; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
+ .catalog-jump { min-height: 34px; padding: 8px 11px; border: 1px solid rgba(255,255,255,.075); border-radius: 9px; background: rgba(18,18,22,.62); color: #8a8e98; font-size: 10px; font-weight: 650; text-decoration: none; transition: color 160ms ease,border-color 160ms ease,background 160ms ease; }
+ .catalog-jump:hover { border-color: rgba(255,255,255,.16); background: #1a1b20; color: #ececf0; }
+ .section { margin-top: 24px; scroll-margin-top: 92px; }
+ .section + .section { margin-top: 34px; }
+
+ @media (max-width: 1160px) {
+ .hero { grid-template-columns: 1fr; max-width: 940px; }
+ .composer-settings-panel { grid-template-columns: repeat(2,minmax(0,1fr)); }
+ .jobs-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
+ .catalog-intro { align-items: flex-start; flex-direction: column; }
+ .catalog-jumps { justify-content: flex-start; }
+ }
+ @media (max-width: 820px) {
+ .composer-tools-left { grid-template-columns: repeat(2,minmax(0,1fr)); }
+ .composer-settings { grid-column: 1 / -1; }
+ .composer-settings[open] { grid-column: 1 / -1; }
+ }
+ @media (max-width: 620px) {
+ .hero-copy { text-align: left; }
+ .hero h1,.hero p { margin-right: 0; margin-left: 0; }
+ .hero h1 { font-size: 39px; }
+ .composer-settings-panel { grid-template-columns: 1fr; }
+ .composer-hint { grid-template-columns: 1fr; }
+ .composer-hint .generation-estimate { text-align: left; }
+ .dashboard-head { align-items: stretch; }
+ .jobs-grid { grid-template-columns: 1fr; }
+ .dashboard-actions { grid-template-columns: 1fr auto auto; }
+ .dashboard-all { grid-column: 1 / -1; }
+ .catalog-intro { gap: 19px; margin-top: 38px; padding-inline: 16px; }
+ .catalog-jumps { width: 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
+ .catalog-jumps::-webkit-scrollbar { display: none; }
+ .catalog-jump { flex: 0 0 auto; min-height: 44px; padding: 12px; }
+ }
+ @media (prefers-reduced-motion: reduce) {
+ .card,
+ .overlay,
+ .template-delete,
+ .job-card,
+ .job-preview-trigger img,
+ .job-play,
+ .carousel-btn,
+ .catalog-jump,
+ .composer-settings > summary span,
+ .result-progress span { transition: none !important; }
+ .card:hover,
+ .job-card:hover,
+ .carousel-btn:hover:not(:disabled),
+ .go:hover:not(:disabled) { transform: none; }
+ .result-spinner,
+ .go.is-busy::before,
+ .tool-btn.is-busy::before,
+ .dashboard-refresh.is-loading::before,
+ .queue-item.is-rendering .queue-dot { animation: none; }
+ }
+</style>
+<link rel="stylesheet" href="site-shell.css" />
+<script src="site-shell.js" defer></script>
+</head>
+<body>
+ <header>
+ <a class="brand" href="./" style="color:inherit;text-decoration:none"><img class="logo" src="assets/null-logo.png" alt="Null" /> <b>Null</b>&nbsp;<span>Motion</span></a>
+ <nav class="login" aria-label="Null Motion pages">
+ <a class="header-action active" href="./" aria-current="page">Templates</a>
+ <a class="header-action utility" href="create.html">Reference studio</a>
+ <a class="header-action primary" href="script.html">Script to motion</a>
+ <a class="header-action utility" href="system-map.html">Director pipeline</a>
+ <a class="header-action utility" href="control-center.html">Control Center</a>
+ <a class="header-action utility" href="renders.html">Renders</a>
+ <button class="header-action gemini-action" id="openGemini" type="button" aria-pressed="false" title="Open Google Gemini beside Null Motion">
+ <img src="https://www.gstatic.com/lamda/images/gemini_sparkle_4g_512_lt_f94943af3be039176192d.png" alt="" referrerpolicy="no-referrer" />
+ <span>Gemini</span>
+ </button>
+ <span class="header-divider" aria-hidden="true"></span>
+ <button class="header-action utility" id="addTemplateBtn" type="button">Manage templates</button>
+ <div class="bridge-status is-checking" id="bridgeStatus" role="status" aria-live="polite">
+ <span class="bridge-dot" aria-hidden="true"></span>
+ <span class="bridge-copy" id="bridgeStatusText">Checking bridge</span>
+ </div>
+ <button class="chip" id="pairBridge" hidden>Pair</button>
+ </nav>
+ </header>
+
+ <section class="hero">
+ <div class="hero-copy">
+ <div class="hero-eyebrow">AI motion director</div>
+ <h1>Motion graphics, directed for the edit.</h1>
+ <p>Explore motion templates and shape your next idea. Generation and rendering are not connected yet.</p>
+ </div>
+
+ <div class="composer">
+ <div class="composer-head">
+ <div><span class="composer-kicker">Create motion</span><h2>What should move?</h2></div>
+ <span class="composer-shortcut">ENTER to generate</span>
+ </div>
+ <div class="prompt" id="prompt">
+ <textarea id="promptInput" rows="3" aria-label="Motion brief" placeholder="Describe a motion graphic, paste a transcript, or attach an image..."></textarea>
+ <div class="seg" id="seg">
+ <button class="active" data-be="hyperframes">HyperFrames</button>
+ <button data-be="remotion">Remotion</button>
+ </div>
+ <button class="go">Generate</button>
+ </div>
+ <!-- reveals only on paste/drop of an image -->
+ <div id="tray"><div class="tray-inner"><span class="tray-label">Attached</span><div id="thumbs" style="display:flex;gap:12px;"></div></div></div>
+ <div class="composer-tools">
+ <div class="composer-tools-left">
+ <button class="tool-btn" id="themeBtn"><span class="theme-dot" id="themeDot" style="display:inline-block;margin-right:7px;vertical-align:-1px;"></span><span id="themeLabel">No theme</span></button>
+ <details class="composer-settings">
+ <summary class="tool-btn">Settings <span aria-hidden="true">+</span></summary>
+ <div class="composer-settings-panel">
+ <label class="composer-field"><span>Director</span><select class="tool-btn" id="providerSelect" aria-label="AI provider" title="AI provider used for every generation stage">
+ <option value="codex" selected>ChatGPT / Codex</option>
+ <option value="claude">Claude Code</option>
+ <option value="anthropic">Anthropic API</option>
+ </select></label>
+ <label class="composer-field"><span>Quality profile</span><select class="tool-btn" id="pipelineModeSelect" aria-label="Generation speed and quality profile" title="Choose how much direction, rendered review, and repair time to spend">
+ <option value="mega">Mega Fast · 3.6 sec measured · 8 sec target</option>
+ <option value="instant" selected>Instant HQ · ~45 sec · 55 sec hard stop</option>
+ <option value="rapid">Rapid · reviewed · ~2–4 min</option>
+ <option value="fast">Fast HQ · reviewed · ~4–6 min</option>
+ <option value="balanced">Refined HQ · reviewed · ~6–8 min</option>
+ <option value="after-effects">After Effects Quality · reviewed · ~10 min</option>
+ </select></label>
+ <label class="composer-field"><span>Real assets</span><select class="tool-btn" id="assetModeSelect" aria-label="Real asset resolution mode" title="Real asset resolution mode">
+ <option value="strict" selected>Real assets · Strict</option>
+ <option value="relaxed">Real assets · Relaxed</option>
+ <option value="none">Real assets · Off</option>
+ </select></label>
+ <div class="composer-field"><span>Composition</span><button class="tool-btn draw-tool" id="drawLayoutBtn" type="button">Draw layout</button></div>
+ </div>
+ </details>
+ <button class="tool-btn imagination-toggle" id="imaginationToggle" type="button" aria-pressed="false" aria-describedby="qualityContract generationEstimate" title="Build directly from the brief with authentic assets and rendered review">Use Imagination</button>
+ <button class="tool-btn batch-action" id="variationsBtn" type="button">3 variants</button>
+ <button class="tool-btn batch-action sweep-action" id="qualitySweepBtn" type="button">Quality sweep · 5</button>
+ </div>
+ </div>
+ <div class="composer-hint"><span id="qualityContract"><strong>Quality:</strong> authored contract checks; no invented pixel score.</span><span class="generation-estimate" id="generationEstimate"><strong>Time contract:</strong> ~45 sec typical, hard stop at 55 sec; certified templates only</span><span>Shift + Enter for a new line</span></div>
+ <div class="result-panel" id="resultPanel" role="status" aria-live="polite">
+ <div class="result-visual">
+ <img class="result-thumb" id="resultThumb" alt="Latest render thumbnail" />
+ <span class="result-spinner" aria-hidden="true"></span>
+ </div>
+ <div class="result-copy">
+ <div class="result-title" id="resultTitle">Preparing motion</div>
+ <div class="result-status" id="resultStatus">Waiting</div>
+ <div class="result-progress" id="resultProgressTrack" role="progressbar" aria-label="Generation progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span id="resultProgress"></span></div>
+ </div>
+ <div class="result-actions" id="resultActions"></div>
+ </div>
+ </div>
+ </section>
+
+ <section class="dashboard" aria-labelledby="recentJobsTitle">
+ <div class="dashboard-shell">
+ <div class="dashboard-head">
+ <div class="dashboard-title">
+ <span class="dashboard-eyebrow">Latest exports</span>
+ <h2 id="recentJobsTitle">Final renders</h2>
+ <p>Only approved Final Cut MOVs appear here. Failed attempts stay out of this library.</p>
+ </div>
+ <div class="dashboard-actions">
+ <a class="dashboard-all" href="renders.html">View all renders &rarr;</a>
+ <button class="dashboard-refresh dashboard-queue" id="queueToggle" type="button" aria-expanded="false"><span>Queue</span><b id="queueCount">0</b></button>
+ <button class="dashboard-refresh" id="refreshJobs" type="button">Refresh</button>
+ <details class="dashboard-menu">
+ <summary class="dashboard-refresh" aria-label="More render actions">More</summary>
+ <div class="dashboard-menu-popover"><button class="dashboard-refresh dashboard-clear" id="clearJobs" type="button">Clear render history</button></div>
+ </details>
+ </div>
+ </div>
+ <section class="generation-queue" id="generationQueue" hidden aria-labelledby="queueTitle">
+ <header class="queue-head">
+ <div>
+ <h3 id="queueTitle">Durable generation</h3>
+ <p id="queueSummary">Queued jobs continue on the companion if this page closes.</p>
+ </div>
+ <button class="queue-close" id="queueClose" type="button" aria-label="Close generation queue">&times;</button>
+ </header>
+ <div class="queue-list" id="queueList" aria-live="polite">
+ <div class="queue-empty">Generate something and it will keep running here while you start the next one.</div>
+ </div>
+ </section>
+ <div class="jobs-grid" id="jobsGrid" aria-live="polite">
+ <div class="jobs-empty">Checking for finished renders...</div>
+ </div>
+ </div>
+ </section>
+
+ <main id="sections"></main>
+
+ <!-- Prompt modal: live preview + the exact prompt, one click to copy -->
+ <div class="modal" id="modal">
+ <div class="modal-card">
+ <div class="modal-preview" id="modalPreview" data-w="1920" data-h="1080">
+ <button class="modal-x" id="modalX">×</button>
+ <iframe id="modalFrame" scrolling="no"></iframe>
+ </div>
+ <div class="modal-right">
+ <h3 id="modalTitle">Prompt</h3>
+ <div class="modal-sub" id="modalSub"></div>
+ <div class="prompt-box" id="modalPrompt"></div>
+ <div class="modal-actions">
+ <button class="btn-copy" id="modalCopy">⧉ Copy prompt</button>
+ <button class="btn-use" id="modalUse">Work with template →</button>
+ <a class="btn-download" id="modalDownload" href="#" download>Download source</a>
+ </div>
+ </div>
+ </div>
+ </div>
+
+ <div class="variation-picker" id="variationPicker" aria-hidden="true">
+ <section class="variation-picker-dialog" role="dialog" aria-modal="true" aria-labelledby="variationPickerTitle">
+ <header class="variation-picker-head">
+ <div>
+ <span>Multi-generation</span>
+ <h3 id="variationPickerTitle">Choose your strongest direction</h3>
+ <p id="variationPickerSubtitle">Generating three independently rendered options.</p>
+ </div>
+ <button class="variation-picker-close" id="variationPickerClose" type="button" aria-label="Close variation picker">&times;</button>
+ </header>
+ <div class="variation-picker-progress" id="variationPickerProgressTrack" role="progressbar" aria-label="Variation batch progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span id="variationPickerProgress"></span></div>
+ <div class="variation-grid" id="variationGrid" aria-live="polite"></div>
+ <footer class="variation-picker-foot">
+ <div class="variation-picker-status" id="variationPickerStatus">Preparing directions</div>
+ <a class="variation-picker-download" id="variationPickerDownload" href="#" aria-disabled="true">Download selected MOV</a>
+ </footer>
+ </section>
+ </div>
+
+ <div class="variant-mode-modal" id="variantModeModal" aria-hidden="true">
+ <section class="variant-mode-dialog" role="dialog" aria-modal="true" aria-labelledby="variantModeTitle">
+ <header class="variant-mode-head">
+ <div>
+ <span>Three independent directions</span>
+ <h3 id="variantModeTitle">Choose generation quality</h3>
+ <p>All three variants use the same brief and mode, with different authored motion directions.</p>
+ </div>
+ <button class="variant-mode-close" id="variantModeClose" type="button" aria-label="Close three-variant setup">&times;</button>
+ </header>
+ <div class="variant-mode-prompt" id="variantModePrompt"></div>
+ <div class="variant-profile-grid" id="variantProfileGrid" role="radiogroup" aria-label="Three-variant generation mode">
+ <button class="variant-profile selected" type="button" role="radio" aria-checked="true" data-profile="instant"><strong>Instant HQ</strong><span>Certified authored motion with deterministic quality checks.</span><em>~45 sec matched · &lt;1 sec repeat</em></button>
+ <button class="variant-profile" type="button" role="radio" data-profile="rapid"><strong>Rapid</strong><span>Fast authored staging, strict review, and repair.</span><em>~2–4 min each</em></button>
+ <button class="variant-profile" type="button" role="radio" data-profile="fast"><strong>Fast HQ</strong><span>Polished composition with strict review.</span><em>~4–6 min each</em></button>
+ <button class="variant-profile" type="button" role="radio" data-profile="balanced"><strong>Refined HQ</strong><span>Refined craft with strict review and repair.</span><em>~6–8 min each</em></button>
+ <button class="variant-profile" type="button" role="radio" data-profile="after-effects"><strong>After Effects</strong><span>Maximum craft and two repair opportunities.</span><em>~10 min each</em></button>
+ </div>
+ <footer class="variant-mode-foot">
+ <div class="variant-mode-summary" id="variantModeSummary">3 × Instant HQ · certified matches generated in parallel</div>
+ <button class="variant-mode-create" id="variantModeCreate" type="button">Create 3 variants</button>
+ </footer>
+ </section>
+ </div>
+
+ <div class="quality-sweep-screen" id="qualitySweepScreen" aria-hidden="true">
+ <main class="quality-sweep-shell" aria-labelledby="qualitySweepTitle">
+ <header class="quality-sweep-head">
+ <div class="quality-sweep-head-copy">
+ <span class="quality-sweep-kicker">Five-profile comparison</span>
+ <h3 id="qualitySweepTitle">Quality sweep</h3>
+ <p id="qualitySweepPrompt">The same brief will be rendered once at every production quality.</p>
+ </div>
+ <button class="quality-sweep-close" id="qualitySweepClose" type="button" aria-label="Return to composer">&times;</button>
+ </header>
+ <section class="quality-sweep-intro">
+ <div>
+ <h4>One brief. Five quality profiles.</h4>
+ <p>Compare real progress, turnaround, and approved results. Rejected drafts never unlock a download.</p>
+ </div>
+ <div class="quality-sweep-progress" id="qualitySweepProgressTrack" role="progressbar" aria-label="Quality sweep progress" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><span id="qualitySweepProgress"></span></div>
+ </section>
+ <section class="quality-sweep-grid" id="qualitySweepGrid" aria-live="polite"></section>
+ <footer class="quality-sweep-foot">
+ <div class="quality-sweep-status" id="qualitySweepStatus">Ready to create five renders</div>
+ <button class="quality-sweep-create" id="qualitySweepCreate" type="button">Create all 5 videos</button>
+ </footer>
+ </main>
+ </div>
+
+ <div class="render-preview-modal" id="renderPreviewModal" aria-hidden="true">
+ <section class="render-preview-dialog" role="dialog" aria-modal="true" aria-labelledby="renderPreviewTitle">
+ <header class="render-preview-head">
+ <div class="render-preview-heading">
+ <span class="render-preview-eyebrow" id="renderPreviewEyebrow">Final render</span>
+ <h3 id="renderPreviewTitle">Motion graphic</h3>
+ <div class="render-preview-meta" id="renderPreviewMeta"></div>
+ </div>
+ <button class="render-preview-close" id="renderPreviewClose" type="button" aria-label="Close preview">&times;</button>
+ </header>
+ <div class="render-preview-viewport" id="renderPreviewViewport">
+ <div class="render-preview-stage" id="renderPreviewStage">
+ <img class="render-preview-image" id="renderPreviewImage" alt="" />
+ <iframe class="render-preview-frame" id="renderPreviewFrame" title="Live motion graphic preview" scrolling="no"></iframe>
+ <div class="render-preview-loading" id="renderPreviewLoading">Loading preview</div>
+ <div class="render-preview-unavailable" id="renderPreviewUnavailable" hidden>Preview is unavailable for this render.</div>
+ </div>
+ </div>
+ <footer class="render-preview-controls" id="renderPreviewControls">
+ <button class="render-preview-toggle" id="renderPreviewToggle" type="button">Pause</button>
+ <input class="render-preview-scrubber" id="renderPreviewScrubber" type="range" min="0" max="0" value="0" step="1" aria-label="Preview timeline" />
+ <span class="render-preview-time" id="renderPreviewTime">0:00 / 0:00</span>
+ <button class="render-preview-prompt" id="renderPreviewPrompt" type="button">Prompt</button>
+ <a class="render-preview-download" id="renderPreviewDownload" href="#">Download render</a>
+ </footer>
+ </section>
+ </div>
+
+ <div class="job-prompt-modal" id="jobPromptModal" aria-hidden="true">
+ <section class="job-prompt-dialog" role="dialog" aria-modal="true" aria-labelledby="jobPromptTitle">
+ <header class="job-prompt-head">
+ <div><span>Final generation prompt</span><h3 id="jobPromptTitle">Motion prompt</h3></div>
+ <button class="job-prompt-close" id="jobPromptClose" type="button" aria-label="Close prompt">&times;</button>
+ </header>
+ <pre class="job-prompt-text" id="jobPromptText"></pre>
+ <footer class="job-prompt-actions">
+ <button id="jobPromptDone" type="button">Close</button>
+ <button class="primary" id="jobPromptCopy" type="button">Copy prompt</button>
+ </footer>
+ </section>
+ </div>
+
+ <div class="draw-modal" id="drawModal" aria-hidden="true">
+ <section class="draw-dialog" role="dialog" aria-modal="true" aria-labelledby="drawTitle">
+ <div class="draw-stage-wrap"><canvas class="draw-stage" id="drawCanvas" width="1080" height="1920" aria-label="Draw the intended motion layout"></canvas></div>
+ <aside class="draw-panel">
+ <h3 id="drawTitle">Draw the motion layout</h3>
+ <p>Sketch placement and direction. The drawing guides the generated design; it will not appear in the final video.</p>
+ <div class="draw-tools" id="drawTools">
+ <button class="active" type="button" data-draw-tool="pencil">Pen</button>
+ <button type="button" data-draw-tool="rect">Box</button>
+ <button type="button" data-draw-tool="arrow">Arrow</button>
+ </div>
+ <label class="draw-field">Stroke color<input id="drawColor" type="color" value="#24242c" /></label>
+ <label class="draw-field">Stroke width<input id="drawWidth" type="range" min="3" max="30" value="10" /></label>
+ <div class="draw-actions">
+ <button class="draw-action" id="drawUndo" type="button">Undo</button>
+ <button class="draw-action" id="drawClear" type="button">Clear</button>
+ <button class="draw-action" id="drawCancel" type="button">Cancel</button>
+ <button class="draw-action" id="drawRemove" type="button">Remove</button>
+ <button class="draw-action primary" id="drawUse" type="button">Use drawing</button>
+ </div>
+ </aside>
+ </section>
+ </div>
+
+ <div class="modal" id="themeModal">
+ <div class="theme-card">
+ <div class="theme-head"><h3>Brand theme</h3><button class="modal-x" id="themeX" style="position:static;">×</button></div>
+ <div class="theme-grid">
+ <div class="theme-field full"><label>Saved themes</label><select id="themeSelect"><option value="">New theme</option></select></div>
+ <div class="theme-field"><label>Name</label><input id="themeName" placeholder="My YouTube channel" /></div>
+ <div class="theme-field"><label>Style</label><input id="themeStyle" placeholder="Minimal editorial tech" /></div>
+ <div class="theme-field full"><label>Direction</label><textarea id="themeDescription" placeholder="Describe the visual identity, lighting, texture, logo usage, and anything every motion design must preserve."></textarea></div>
+ <div class="theme-field"><label>Font family</label><input id="themeFont" value="Inter, sans-serif" /></div>
+ <div class="theme-field"><label>Motion curve</label><input id="themeCurve" value="cubic-bezier(0.16, 1, 0.3, 1)" /></div>
+ <div class="theme-field full"><label>Palette</label><div class="color-row">
+ <div class="theme-field"><label>Primary</label><input id="colorPrimary" value="#4F7CFF" /></div>
+ <div class="theme-field"><label>Secondary</label><input id="colorSecondary" value="#151822" /></div>
+ <div class="theme-field"><label>Accent</label><input id="colorAccent" value="#8BA6FF" /></div>
+ <div class="theme-field"><label>Background</label><input id="colorBackground" value="#08090D" /></div>
+ <div class="theme-field"><label>Text</label><input id="colorText" value="#F4F5F7" /></div>
+ </div></div>
+ </div>
+ <div class="theme-actions"><button class="tool-btn" id="themeDelete">Delete</button><button class="go" id="themeSave">Save & activate</button></div>
+ </div>
+ </div>
+
+ <div class="modal" id="templateManagerModal" aria-hidden="true">
+ <div class="template-manager" role="dialog" aria-modal="true" aria-labelledby="templateManagerTitle">
+ <div class="template-manager-head"><div><h3 id="templateManagerTitle">Template library</h3><p>Restore something you removed, or import a real authored Null Motion composition.</p></div><button class="template-manager-close" id="templateManagerClose" type="button" aria-label="Close">&times;</button></div>
+ <section class="archived-block"><h4>Recently removed</h4><div class="archived-list" id="archivedTemplates"><div class="archived-empty">Loading archive...</div></div></section>
+ <form class="template-import" id="templateImportForm">
+ <h4>Add authored template</h4>
+ <div class="template-form-grid">
+ <label>Name<input id="templateName" maxlength="100" required placeholder="Editorial Counter" /></label>
+ <label>Category<select id="templateCategory" required><option value="short">Short form</option><option value="long">Long form</option><option value="ui">App &amp; UI</option><option value="data">Data &amp; charts</option><option value="overlay">Overlay</option></select></label>
+ <label class="wide">Description<input id="templateDescription" maxlength="180" required placeholder="Clean animated number reveal" /></label>
+ <label class="wide">Production prompt<textarea id="templatePrompt" maxlength="12000" required placeholder="Describe what this authored template communicates and which slots may change."></textarea></label>
+ <div class="template-dimensions wide"><label>Width<input id="templateWidth" type="number" min="1" max="7680" value="1920" required /></label><label>Height<input id="templateHeight" type="number" min="1" max="7680" value="1080" required /></label><label>Seconds<input id="templateDuration" type="number" min="0.25" max="120" step="0.25" value="5" required /></label><label>FPS<input id="templateFps" type="number" min="1" max="120" step="0.001" value="30" required /></label></div>
+ <label class="wide">Authored index.html<input id="templateHtml" type="file" accept=".html,text/html" required /></label>
+ </div>
+ <p class="template-import-note">HTML must contain matching root canvas metadata and a paused GSAP timeline registered in <code>window.__timelines</code>. Remote runtime dependencies and nondeterministic randomness are rejected.</p>
+ <div class="template-import-actions"><button id="templateImportSubmit" type="submit">Add to library</button></div>
+ </form>
+ </div>
+ </div>
+
+ <div class="toast" id="toast"></div>
+
+ <script>
+ const API = window.location.origin;
+ const GENERATION_PROFILES = Object.freeze({
+ mega: { key: "mega", label: "Mega Fast", pipelineMode: "fast-hq", quality: "high", qualityReview: "strict", maxRepairPasses: 0, minSeconds: 2, maxSeconds: 8 },
+ instant: { key: "instant", label: "Instant HQ", pipelineMode: "fast-hq", quality: "high", qualityReview: "strict", maxRepairPasses: 1, minSeconds: 40, maxSeconds: 55 },
+ rapid: { key: "rapid", label: "Rapid", pipelineMode: "fast-hq", quality: "high", qualityReview: "strict", maxRepairPasses: 1, minMinutes: 2, maxMinutes: 4 },
+ fast: { key: "fast", label: "Fast HQ", pipelineMode: "fast-hq", quality: "high", qualityReview: "strict", maxRepairPasses: 1, minMinutes: 4, maxMinutes: 6 },
+ balanced: { key: "balanced", label: "Refined HQ", pipelineMode: "full-quality", quality: "high", qualityReview: "strict", maxRepairPasses: 1, minMinutes: 6, maxMinutes: 8 },
+ "after-effects": { key: "after-effects", label: "After Effects Quality", pipelineMode: "full-quality", quality: "high", qualityReview: "strict", maxRepairPasses: 2, minMinutes: 10, maxMinutes: 10 }
+ });
+ const QUALITY_SWEEP_MODES = Object.freeze([
+ { key: "instant", label: "Instant HQ", description: "Certified authored motion with deterministic quality checks and verified render reuse." },
+ { key: "rapid", label: "Rapid", description: "Fast authored staging with strict review and one repair." },
+ { key: "fast", label: "Fast HQ", description: "Polished production hierarchy with strict review and repair." },
+ { key: "balanced", label: "Refined HQ", description: "Refined craft with strict review and one focused repair." },
+ { key: "after-effects", label: "After Effects Quality", description: "Maximum craft, strict inspection, and up to two repairs." }
+ ]);
+ const GEMINI_URL = "https://gemini.google.com/app";
+ let geminiWindow = null;
+
+ function openGeminiSidebar() {
+ const button = document.getElementById("openGemini");
+ const availableWidth = window.screen?.availWidth || 1440;
+ const availableHeight = window.screen?.availHeight || 900;
+ const availableLeft = Number(window.screen?.availLeft) || 0;
+ const sidebarWidth = Math.max(460, Math.min(620, Math.round(availableWidth * 0.34)));
+ const sidebarLeft = availableLeft + Math.max(0, availableWidth - sidebarWidth);
+
+ if (geminiWindow && !geminiWindow.closed) {
+ try {
+ geminiWindow.moveTo(sidebarLeft, 0);
+ geminiWindow.resizeTo(sidebarWidth, availableHeight);
+ geminiWindow.focus();
+ button?.classList.add("is-open");
+ button?.setAttribute("aria-pressed", "true");
+ return;
+ } catch (_) {}
+ }
+
+ geminiWindow = window.open(
+ GEMINI_URL,
+ "null-motion-gemini",
+ `popup=yes,width=${sidebarWidth},height=${availableHeight},left=${sidebarLeft},top=0`
+ );
+ if (!geminiWindow) {
+ showToast("Allow pop-ups for Null Motion, then open Gemini again");
+ return;
+ }
+ try { geminiWindow.focus(); } catch (_) {}
+ button?.classList.add("is-open");
+ button?.setAttribute("aria-pressed", "true");
+ }
+
+ document.getElementById("openGemini")?.addEventListener("click", openGeminiSidebar);
+
+ const BRIDGE_TOKEN_KEY = "null-motion-bridge-token";
+ const PROVIDER_KEY = "null-motion-provider";
+ const IMAGINATION_KEY = "null-motion-use-imagination";
+ let attachedImages = [];
+ let activeSketchImage = null;
+ let activeSketchJSON = null;
+ let activeTheme = null;
+ let savedThemes = [];
+ let lastOptimization = null;
+ let lastInstantProductionRequest = null;
+ let activeComposerJobId = null;
+ let selectedTemplate = null;
+ let useImagination = false;
+ try { useImagination = localStorage.getItem(IMAGINATION_KEY) === "true"; } catch (_) {}
+ let jobsLoadedOnce = false;
+ let jobsRefreshInFlight = false;
+ let activeBackgroundJobCount = 0;
+ let latestJobsPayload = { jobs: [], queue: {} };
+ let jobsPollTimer = 0;
+ const originalDocumentTitle = document.title;
+ let archivedTemplates = [];
+ let activeVariationBatch = null;
+ let selectedVariationJobId = null;
+ let selectedVariantProfileKey = "instant";
+ let activeQualitySweepBatch = null;
+ let qualitySweepDraft = null;
+ let qualitySweepRunning = false;
+ const knownJobStates = new Map();
+ const jobCardPreviewStops = [];
+ const PREVIEW_FRAME_RATE = 12;
+ // Canonical metadata comes from server/catalog.json through the local bridge.
+ // The adapter retains the gallery's legacy field names while downstream code migrates.
+ let T = [];
+
+ function selectedGenerationProfile() {
+ const key = document.getElementById("pipelineModeSelect")?.value || "instant";
+ return GENERATION_PROFILES[key] || GENERATION_PROFILES["after-effects"];
+ }
+
+ function setUseImagination(enabled, { persist = true } = {}) {
+ useImagination = enabled === true;
+ const toggle = document.getElementById("imaginationToggle");
+ const speed = document.getElementById("pipelineModeSelect");
+ const assets = document.getElementById("assetModeSelect");
+ const certifiedModes = new Set(["mega", "instant"]);
+ if (toggle) {
+ toggle.setAttribute("aria-pressed", useImagination ? "true" : "false");
+ toggle.title = useImagination
+ ? "Prompt-led generation is on. Authentic assets and rendered review stay required."
+ : "Build directly from the brief with authentic assets and rendered review";
+ }
+ if (speed) {
+ [...speed.options].forEach(option => { option.disabled = useImagination && certifiedModes.has(option.value); });
+ if (useImagination && certifiedModes.has(speed.value)) speed.value = "after-effects";
+ }
+ if (assets) {
+ if (useImagination) assets.value = "strict";
+ assets.disabled = useImagination;
+ assets.title = useImagination ? "Use Imagination requires authentic asset resolution" : "Real asset resolution mode";
+ }
+ for (const id of ["variationsBtn", "qualitySweepBtn"]) {
+ const action = document.getElementById(id);
+ if (!action) continue;
+ action.disabled = useImagination;
+ action.title = useImagination ? "Turn off Use Imagination to run template-directed batches" : "";
+ }
+ if (persist) {
+ try { localStorage.setItem(IMAGINATION_KEY, String(useImagination)); } catch (_) {}
+ }
+ updateGenerationEstimate();
+ }
+
+ function profileMinSeconds(profile) {
+ return Number(profile.minSeconds) || Number(profile.minMinutes) * 60;
+ }
+
+ function profileMaxSeconds(profile) {
+ return Number(profile.maxSeconds) || Number(profile.maxMinutes) * 60;
+ }
+
+ function generationEstimateRange(profile, durationSeconds = null) {
+ if (profile.maxSeconds) return profile.minSeconds === profile.maxSeconds ? `~${profile.maxSeconds} sec` : `${profile.minSeconds}–${profile.maxSeconds} sec`;
+ const typicalDuration = profile.key === "instant" ? 3 : 5;
+ const extraSeconds = Math.max(0, Number(durationSeconds) - typicalDuration);
+ const minMinutes = profile.minMinutes + Math.floor(extraSeconds / typicalDuration);
+ const maxMinutes = profile.maxMinutes + Math.ceil(extraSeconds * 2 / typicalDuration);
+ return minMinutes === maxMinutes ? `~${maxMinutes} min` : `${minMinutes}–${maxMinutes} min`;
+ }
+
+ function updateGenerationEstimate() {
+ const profile = selectedGenerationProfile();
+ const estimate = document.getElementById("generationEstimate");
+ const qualityContract = document.getElementById("qualityContract");
+ const requestedDuration = promptDurationOverride(document.getElementById("promptInput")?.value);
+ const typicalDuration = profile.key === "instant" ? 3 : 5;
+ if (!estimate) return;
+ if (qualityContract) qualityContract.innerHTML = useImagination
+ ? "<strong>Imagination:</strong> one prompt-led take · authentic assets · rendered-frame review."
+ : ["mega", "instant"].includes(profile.key)
+ ? "<strong>Quality:</strong> authored contract checks; no invented pixel score."
+ : "<strong>Quality:</strong> rendered-frame review is deliberately harsh.";
+ estimate.innerHTML = profile.key === "mega"
+ ? `<strong>Time target:</strong> 3.6 sec measured, ${profile.maxSeconds} sec target; an admitted render is allowed to finish`
+ : profile.key === "instant"
+ ? `<strong>Time contract:</strong> ~45 sec typical, hard stop at ${profile.maxSeconds} sec; certified templates only`
+ : `<strong>Estimate:</strong> ${generationEstimateRange(profile, requestedDuration)} for a ${requestedDuration || typicalDuration} sec vertical clip`;
+ }
+
+ function formatGenerationTime(seconds) {
+ const total = Math.max(0, Math.floor(Number(seconds) || 0));
+ if (total < 60) return `${total}s`;
+ const minutes = Math.floor(total / 60);
+ const remainder = total % 60;
+ return `${minutes}m ${String(remainder).padStart(2, "0")}s`;
+ }
+
+ function telemetryAgeSeconds(job) {
+ return Math.max(0, (Date.now() - (Number(job?._telemetryReceivedAt) || Date.now())) / 1000);
+ }
+
+ function currentJobElapsedSeconds(job) {
+ const serverElapsed = Number(job?.elapsedSeconds);
+ if (Number.isFinite(serverElapsed)) return Math.max(0, serverElapsed + (isTerminalJobStatus(job) || isQueuedJobStatus(job) ? 0 : telemetryAgeSeconds(job)));
+ const startedAt = Number(job?.startedAt);
+ const finishedAt = Number(job?.finishedAt);
+ return startedAt ? Math.max(0, ((isTerminalJobStatus(job) && finishedAt ? finishedAt : Date.now()) - startedAt) / 1000) : 0;
+ }
+
+ function isTerminalJobStatus(job) {
+ return ["done", "completed", "error", "failed", "cancelled", "canceled", "interrupted"].includes(String(job?.status || "").toLowerCase());
+ }
+
+ function isQueuedJobStatus(job) {
+ return ["pending", "queued"].includes(String(job?.status || "").toLowerCase());
+ }
+
+ function currentJobQueuedSeconds(job) {
+ const queued = Number(job?.queuedSeconds);
+ if (Number.isFinite(queued)) return Math.max(0, queued + (isQueuedJobStatus(job) ? telemetryAgeSeconds(job) : 0));
+ const createdAt = Number(job?.createdAt);
+ return createdAt ? Math.max(0, ((Number(job?.startedAt) || Date.now()) - createdAt) / 1000) : 0;
+ }
+
+ function currentJobEtaSeconds(job) {
+ const eta = Number(job?.etaSeconds);
+ if (!Number.isFinite(eta)) return null;
+ return Math.max(0, eta - (isTerminalJobStatus(job) ? 0 : telemetryAgeSeconds(job)));
+ }
+
+ function stageProgressLabel(job) {
+ const progress = job?.stageProgress;
+ const completed = Number(progress?.completed);
+ const total = Number(progress?.total);
+ if (!Number.isFinite(completed) || !Number.isFinite(total) || total <= 0) return "";
+ if (progress.unit === "seconds") return `${completed.toFixed(1)} / ${total.toFixed(1)} sec encoded`;
+ if (progress.unit === "assets") return `${Math.min(total, Math.round(completed))} / ${Math.round(total)} assets resolved`;
+ return `${Math.round(completed)} / ${Math.round(total)}`;
+ }
+
+ function generationRemainingLabel(job) {
+ if (isQueuedJobStatus(job)) {
+ const position = Number(job?.renderQueuePosition);
+ return `${position > 0 ? `queue #${position} · ` : ""}queued ${formatGenerationTime(currentJobQueuedSeconds(job))} · ETA starts when work begins`;
+ }
+ const elapsed = `elapsed ${formatGenerationTime(currentJobElapsedSeconds(job))}`;
+ if (job?.etaSource === "historical-estimate-exceeded") return `${elapsed} · historical estimate exceeded · finishing ${queueStepLabel(job).toLowerCase()}`;
+ const eta = currentJobEtaSeconds(job);
+ if (Number.isFinite(eta)) return `${elapsed} · ETA ~${formatGenerationTime(eta)}${Number(job?.etaSampleSize) > 0 ? ` (${job.etaSampleSize} similar)` : ""}`;
+ const profile = GENERATION_PROFILES[String(job?.speedProfile || "")];
+ return profile ? `${elapsed} · target ${generationEstimateRange(profile)}` : `${elapsed} · ETA collecting history`;
+ }
+
+ function escapeHtml(value) {
+ return String(value ?? "").replace(/[&<>"']/g, character => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" })[character]);
+ }
+
+ function toGalleryTemplate(template) {
+ return {
+ ...template,
+ w: template.width,
+ h: template.height,
+ section: template.category,
+ customizerSchema: template.customizer,
+ customizer: template.customizer?.id || null,
+ };
+ }
+
+ async function loadTemplateCatalog() {
+ try {
+ const payload = await api("/api/v1/templates");
+ const templates = Array.isArray(payload) ? payload : payload.templates;
+ if (!Array.isArray(templates)) throw new Error("The Null bridge returned an invalid template catalog.");
+ T = templates.map(toGalleryTemplate);
+ const directorTemplateCount = document.getElementById("directorTemplateCount");
+ if (directorTemplateCount) {
+ const approvedCount = T.filter(template => template.qualityStatus === "approved").length;
+ directorTemplateCount.textContent = `${T.length} templates · ${approvedCount} approved`;
+ }
+ renderTemplateCatalog();
+ } catch (error) {
+ root.innerHTML = `<section class="section"><div class="sec-head"><div class="sec-title"><h2>Template library unavailable</h2></div></div><p style="color:var(--muted);line-height:1.6">Start the local Null bridge, then reload this page. ${String(error.message || error)}</p></section>`;
+ showToast(error.message || "Could not load the template catalog");
+ }
+ }
+
+ const SECTIONS = [
+ { key:"short", title:"Short form", wide:false },
+ { key:"long", title:"Long form", wide:false },
+ { key:"ui", title:"App & UI", wide:false },
+ { key:"data", title:"Data & charts", wide:false },
+ { key:"overlay", title:"Overlays", wide:false },
+ ];
+
+ const root = document.getElementById("sections");
+ function renderTemplateCatalog() {
+ root.replaceChildren();
+ if (!T.length) {
+ root.innerHTML = '<div class="template-empty"><h2>Your library is empty</h2><p>Add an authored template or restore one you removed.</p><button class="header-action primary" id="emptyAddTemplate" type="button">Add template</button></div>';
+ document.getElementById("emptyAddTemplate").onclick = openTemplateManager;
+ return;
+ }
+ const catalogIntro = document.createElement("div");
+ catalogIntro.className = "catalog-intro";
+ catalogIntro.innerHTML = `<div><span class="catalog-eyebrow">Reusable motion system</span><h2 id="templateLibraryTitle">Template library</h2><p>Choose a proven composition, then adapt its copy, assets, and timing to the edit.</p></div><nav class="catalog-jumps" aria-label="Template categories">${SECTIONS.map(section => `<a class="catalog-jump" href="#section-${section.key}">${section.title}</a>`).join("")}</nav>`;
+ root.appendChild(catalogIntro);
+ SECTIONS.forEach(sec => {
+ const items = T.filter(t => t.section === sec.key);
+ if (!items.length) return;
+ const el = document.createElement("section");
+ el.className = "section";
+ el.id = `section-${sec.key}`;
+ el.innerHTML = `<div class="sec-head">
+ <div class="sec-title"><h2>${sec.title}</h2><span class="count">${items.length} edits</span></div>
+ <div class="carousel-controls">
+ <span class="carousel-status" aria-live="polite">All ${items.length}</span>
+ <button class="carousel-btn carousel-prev" type="button" aria-label="Previous ${sec.title} templates">
+ <svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="m12.5 4.5-5 5.5 5 5.5" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>
+ </button>
+ <button class="carousel-btn carousel-next" type="button" aria-label="Next ${sec.title} templates">
+ <svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="m7.5 4.5 5 5.5-5 5.5" stroke="currentColor" stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"/></svg>
+ </button>
+ </div>
+ </div>
+ <div class="grid grid-${sec.key}" role="region" aria-label="${sec.title} template carousel"></div>`;
+ const grid = el.querySelector(".grid");
+ items.forEach(t => {
+ const card = document.createElement("div");
+ card.className = "card";
+ card.dataset.templateDir = t.dir;
+ const qualityStatus = ["approved", "legacy", "needs-review"].includes(t.qualityStatus) ? t.qualityStatus : "needs-review";
+ const qualityLabel = qualityStatus === "approved" ? "Approved" : qualityStatus === "legacy" ? "Needs polish" : "Needs review";
+ card.innerHTML = `
+ <span class="template-quality ${qualityStatus}">${qualityLabel}</span>
+ <button class="template-delete" type="button" aria-label="Remove ${escapeHtml(t.name)}" title="Remove template"><svg viewBox="0 0 20 20" fill="none" aria-hidden="true"><path d="M4.5 6h11M8 3.5h4M6.5 6l.6 10h5.8l.6-10M8.5 8.5v5M11.5 8.5v5" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
+ <div class="preview" data-w="${t.w}" data-h="${t.h}">
+ <iframe src="${t.preview?.playerPath || `${t.dir}/index.html#play`}" scrolling="no" loading="lazy" title="${escapeHtml(t.name)} motion preview"></iframe>
+ <div class="overlay">
+ <button class="ovBtn useBtn" type="button" title="Load this template into the motion composer">Work</button>
+ <a class="ovBtn downloadBtn" href="${templateSourceUrl(t)}" download="${escapeHtml(t.id)}.html" title="Download portable authored HTML">Source</a>
+ </div>
+ </div>
+ <div class="meta">
+ <div><div class="name">${escapeHtml(t.name)}</div><div class="use">${escapeHtml(t.use)}</div></div>
+ <button class="tag">Prompt</button>
+ </div>`;
+ card.querySelector(".useBtn").onclick = (e) => { e.stopPropagation(); useTemplate(t); };
+ card.querySelector(".downloadBtn").onclick = (e) => e.stopPropagation();
+ card.querySelector(".tag").onclick = (e) => { e.stopPropagation(); openModal(t); };
+ card.querySelector(".template-delete").onclick = (e) => { e.stopPropagation(); deleteTemplate(t); };
+ card.querySelector(".preview").onclick = () => openModal(t);
+ grid.appendChild(card);
+ });
+ root.appendChild(el);
+ initCarousel(el, grid);
+ });
+ requestAnimationFrame(fit);
+ }
+
+ function applyCatalogPayload(payload) {
+ const templates = payload?.catalog?.templates || payload?.templates || [];
+ T = templates.map(toGalleryTemplate);
+ renderTemplateCatalog();
+ }
+
+ async function deleteTemplate(template) {
+ if (!confirm(`Remove "${template.name}" from Null Motion?\n\nIt will leave the website, planner, and Premiere library, but can be restored later.`)) return;
+ try {
+ const payload = await api(`/api/v1/templates/${encodeURIComponent(template.id)}`, { method: "DELETE" });
+ applyCatalogPayload(payload);
+ showToast(`${template.name} removed`);
+ } catch (error) {
+ showToast(error.message || "Could not remove template");
+ }
+ }
+
+ function renderArchivedTemplates() {
+ const list = document.getElementById("archivedTemplates");
+ list.replaceChildren();
+ if (!archivedTemplates.length) {
+ list.innerHTML = '<div class="archived-empty">Nothing has been removed.</div>';
+ return;
+ }
+ archivedTemplates.forEach(template => {
+ const row = document.createElement("div");
+ row.className = "archived-item";
+ const name = document.createElement("span");
+ name.textContent = `${template.name} · ${template.width}x${template.height}`;
+ const restore = document.createElement("button");
+ restore.type = "button";
+ restore.textContent = "Restore";
+ restore.onclick = async () => {
+ restore.disabled = true;
+ try {
+ const payload = await api(`/api/v1/templates/${encodeURIComponent(template.id)}/restore`, { method: "POST" });
+ applyCatalogPayload(payload);
+ await loadArchivedTemplates();
+ showToast(`${template.name} restored`);
+ } catch (error) {
+ restore.disabled = false;
+ showToast(error.message || "Could not restore template");
+ }
+ };
+ row.append(name, restore);
+ list.appendChild(row);
+ });
+ }
+
+ async function loadArchivedTemplates() {
+ const list = document.getElementById("archivedTemplates");
+ list.innerHTML = '<div class="archived-empty">Loading archive...</div>';
+ try {
+ const payload = await api("/api/v1/templates/archived");
+ archivedTemplates = Array.isArray(payload.templates) ? payload.templates : [];
+ renderArchivedTemplates();
+ } catch (error) {
+ list.innerHTML = `<div class="archived-empty">${escapeHtml(error.message || "Could not load archive")}</div>`;
+ }
+ }
+
+ function openTemplateManager() {
+ const manager = document.getElementById("templateManagerModal");
+ manager.classList.add("show");
+ manager.setAttribute("aria-hidden", "false");
+ loadArchivedTemplates();
+ }
+
+ function closeTemplateManager() {
+ const manager = document.getElementById("templateManagerModal");
+ manager.classList.remove("show");
+ manager.setAttribute("aria-hidden", "true");
+ }
+
+ document.getElementById("addTemplateBtn").onclick = openTemplateManager;
+ document.getElementById("templateManagerClose").onclick = closeTemplateManager;
+ document.getElementById("templateManagerModal").addEventListener("click", event => { if (event.target.id === "templateManagerModal") closeTemplateManager(); });
+ document.getElementById("templateImportForm").addEventListener("submit", async event => {
+ event.preventDefault();
+ const form = event.currentTarget;
+ const file = document.getElementById("templateHtml").files[0];
+ if (!file) return showToast("Choose an authored index.html file");
+ const submit = document.getElementById("templateImportSubmit");
+ submit.disabled = true;
+ submit.textContent = "Validating...";
+ try {
+ const payload = await api("/api/v1/templates", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ name: document.getElementById("templateName").value,
+ category: document.getElementById("templateCategory").value,
+ description: document.getElementById("templateDescription").value,
+ prompt: document.getElementById("templatePrompt").value,
+ width: Number(document.getElementById("templateWidth").value),
+ height: Number(document.getElementById("templateHeight").value),
+ duration: Number(document.getElementById("templateDuration").value),
+ fps: Number(document.getElementById("templateFps").value),
+ html: await file.text()
+ })
+ });
+ applyCatalogPayload(payload);
+ form.reset();
+ closeTemplateManager();
+ showToast(`${payload.template.name} added to the shared library`);
+ } catch (error) {
+ showToast(error.message || "Could not add template");
+ } finally {
+ submit.disabled = false;
+ submit.textContent = "Add to library";
+ }
+ });
+
+ function initCarousel(section, grid) {
+ const previous = section.querySelector(".carousel-prev");
+ const next = section.querySelector(".carousel-next");
+ const status = section.querySelector(".carousel-status");
+ let scrollFrame = 0;
+
+ function measurements() {
+ const card = grid.querySelector(".card");
+ const styles = getComputedStyle(grid);
+ const gap = parseFloat(styles.columnGap || styles.gap) || 16;
+ const cardWidth = card ? card.getBoundingClientRect().width : 0;
+ const step = cardWidth + gap;
+ const maximum = Math.max(0, grid.scrollWidth - grid.clientWidth);
+ const visible = step ? Math.max(1, Math.floor((grid.clientWidth + gap) / step)) : 1;
+ return { cardWidth, step, maximum, visible };
+ }
+
+ function updateCarousel() {
+ const cards = grid.querySelectorAll(".card");
+ const { step, maximum, visible } = measurements();
+ const canScroll = maximum > 3;
+ previous.disabled = !canScroll;
+ next.disabled = !canScroll;
+ if (!canScroll) {
+ status.textContent = `All ${cards.length}`;
+ return;
+ }
+ const first = Math.min(Math.max(0, Math.round(grid.scrollLeft / step)), Math.max(0, cards.length - visible));
+ const last = Math.min(cards.length, first + visible);
+ status.textContent = `${first + 1}-${last} / ${cards.length}`;
+ }
+
+ function moveCarousel(direction) {
+ const { cardWidth, maximum } = measurements();
+ if (maximum <= 3) return;
+ const pageDistance = Math.max(cardWidth + 16, grid.clientWidth - cardWidth - 16);
+ if (direction > 0 && grid.scrollLeft >= maximum - 4) {
+ grid.scrollTo({ left: 0, behavior: "smooth" });
+ } else if (direction < 0 && grid.scrollLeft <= 4) {
+ grid.scrollTo({ left: maximum, behavior: "smooth" });
+ } else {
+ grid.scrollBy({ left: direction * pageDistance, behavior: "smooth" });
+ }
+ }
+
+ previous.onclick = () => moveCarousel(-1);
+ next.onclick = () => moveCarousel(1);
+ grid.addEventListener("scroll", () => {
+ cancelAnimationFrame(scrollFrame);
+ scrollFrame = requestAnimationFrame(updateCarousel);
+ }, { passive: true });
+
+ if (window.ResizeObserver) {
+ const observer = new ResizeObserver(() => {
+ updateCarousel();
+ });
+ observer.observe(grid);
+ }
+
+ requestAnimationFrame(updateCarousel);
+ }
+
+ // size each preview box to the template's aspect, scale the iframe to fit width
+ function fit() {
+ document.querySelectorAll(".preview").forEach(p => {
+ const w = +p.dataset.w, h = +p.dataset.h;
+ const cw = p.clientWidth;
+ p.style.height = (cw * h / w) + "px";
+ const f = p.querySelector("iframe");
+ f.style.width = w + "px"; f.style.height = h + "px";
+ f.style.transform = `scale(${cw / w})`; // origin top-left; scaled width == card width, fills exactly
+ });
+ }
+ window.addEventListener("resize", fit);
+ window.addEventListener("load", fit);
+ requestAnimationFrame(fit); fit();
+
+ // backend toggle
+ let backend = "hyperframes";
+ document.querySelectorAll("#seg button").forEach(b => b.onclick = () => {
+ document.querySelectorAll("#seg button").forEach(x => x.classList.remove("active"));
+ b.classList.add("active"); backend = b.dataset.be;
+ });
+
+ const providerSelect = document.getElementById("providerSelect");
+ const savedProvider = localStorage.getItem(PROVIDER_KEY);
+ if (["codex", "claude", "anthropic"].includes(savedProvider)) providerSelect.value = savedProvider;
+ providerSelect.addEventListener("change", () => {
+ localStorage.setItem(PROVIDER_KEY, providerSelect.value);
+ showToast(`${providerSelect.options[providerSelect.selectedIndex].text} selected`);
+ });
+
+ function activeGenerator() {
+ return ["codex", "claude", "anthropic"].includes(providerSelect.value) ? providerSelect.value : "codex";
+ }
+
+ document.getElementById("promptInput").addEventListener("keydown", e => {
+ if (e.key !== "Enter" || e.shiftKey) return;
+ e.preventDefault();
+ realGenerate();
+ });
+
+ // Use template -> fill the prompt box + scroll up
+ const input = document.getElementById("promptInput");
+ function resizePromptInput() {
+ input.style.height = "auto";
+ const nextHeight = Math.min(180, Math.max(92, input.scrollHeight));
+ input.style.height = `${nextHeight}px`;
+ input.style.overflowY = input.scrollHeight > 180 ? "auto" : "hidden";
+ }
+ function setPromptValue(value) {
+ input.value = value;
+ resizePromptInput();
+ updateGenerationEstimate();
+ }
+ input.addEventListener("input", () => { resizePromptInput(); updateGenerationEstimate(); });
+ try {
+ const directorPrompt = localStorage.getItem("nullMotionDirectorPromptV1");
+ if (directorPrompt) {
+ setPromptValue(directorPrompt);
+ localStorage.removeItem("nullMotionDirectorPromptV1");
+ requestAnimationFrame(() => showToast("Director plan loaded into the prompt composer"));
+ }
+ } catch (_) {}
+
+ // ---- Integrated Sketchflow drawing pad ----
+ const drawModal = document.getElementById("drawModal");
+ const drawCanvas = document.getElementById("drawCanvas");
+ const drawContext = drawCanvas.getContext("2d");
+ const drawLayoutButton = document.getElementById("drawLayoutBtn");
+ let drawMode = "pencil";
+ let drawObjects = [];
+ let drawDraft = null;
+ let drawPointerActive = false;
+
+ function drawPoint(event) {
+ const rect = drawCanvas.getBoundingClientRect();
+ return {
+ x: Math.max(0, Math.min(drawCanvas.width, (event.clientX - rect.left) * drawCanvas.width / rect.width)),
+ y: Math.max(0, Math.min(drawCanvas.height, (event.clientY - rect.top) * drawCanvas.height / rect.height))
+ };
+ }
+
+ function paintSketchObject(object) {
+ if (!object) return;
+ const color = object.color || "#24242c";
+ const width = Number(object.strokeWidth) || 10;
+ drawContext.save();
+ drawContext.strokeStyle = color;
+ drawContext.fillStyle = color;
+ drawContext.lineWidth = width;
+ drawContext.lineCap = "round";
+ drawContext.lineJoin = "round";
+ if (object.type === "pencil") {
+ const points = object.points || [];
+ if (points.length > 1) {
+ drawContext.beginPath();
+ drawContext.moveTo(points[0][0], points[0][1]);
+ points.slice(1).forEach(point => drawContext.lineTo(point[0], point[1]));
+ drawContext.stroke();
+ }
+ } else if (object.type === "rect") {
+ drawContext.strokeRect(object.x, object.y, object.w, object.h);
+ } else if (object.type === "arrow") {
+ const [start, end] = object.points;
+ const angle = Math.atan2(end[1] - start[1], end[0] - start[0]);
+ const head = Math.max(22, width * 3.2);
+ drawContext.beginPath();
+ drawContext.moveTo(start[0], start[1]);
+ drawContext.lineTo(end[0], end[1]);
+ drawContext.moveTo(end[0], end[1]);
+ drawContext.lineTo(end[0] - head * Math.cos(angle - Math.PI / 6), end[1] - head * Math.sin(angle - Math.PI / 6));
+ drawContext.moveTo(end[0], end[1]);
+ drawContext.lineTo(end[0] - head * Math.cos(angle + Math.PI / 6), end[1] - head * Math.sin(angle + Math.PI / 6));
+ drawContext.stroke();
+ }
+ drawContext.restore();
+ }
+
+ function repaintSketch() {
+ drawContext.clearRect(0, 0, drawCanvas.width, drawCanvas.height);
+ drawContext.fillStyle = "#f7f7f5";
+ drawContext.fillRect(0, 0, drawCanvas.width, drawCanvas.height);
+ drawObjects.forEach(paintSketchObject);
+ paintSketchObject(drawDraft);
+ }
+
+ function openDrawingPad() {
+ const width = Number(selectedTemplate?.w) || 1080;
+ const height = Number(selectedTemplate?.h) || 1920;
+ if (drawCanvas.width !== width || drawCanvas.height !== height) {
+ drawCanvas.width = width;
+ drawCanvas.height = height;
+ drawObjects = [];
+ }
+ drawCanvas.style.aspectRatio = `${width} / ${height}`;
+ repaintSketch();
+ drawModal.classList.add("show");
+ drawModal.setAttribute("aria-hidden", "false");
+ document.getElementById("drawUndo").focus();
+ }
+
+ function closeDrawingPad() {
+ drawModal.classList.remove("show");
+ drawModal.setAttribute("aria-hidden", "true");
+ drawDraft = null;
+ drawPointerActive = false;
+ drawLayoutButton.focus();
+ }
+
+ document.querySelectorAll("[data-draw-tool]").forEach(button => {
+ button.onclick = () => {
+ drawMode = button.dataset.drawTool;
+ document.querySelectorAll("[data-draw-tool]").forEach(item => item.classList.toggle("active", item === button));
+ };
+ });
+
+ drawCanvas.addEventListener("pointerdown", event => {
+ event.preventDefault();
+ drawPointerActive = true;
+ drawCanvas.setPointerCapture(event.pointerId);
+ const point = drawPoint(event);
+ const color = document.getElementById("drawColor").value;
+ const strokeWidth = Number(document.getElementById("drawWidth").value) || 10;
+ drawDraft = drawMode === "pencil"
+ ? { type: "pencil", semantic: "note", color, strokeWidth, points: [[point.x, point.y, 0.65]] }
+ : drawMode === "rect"
+ ? { type: "rect", semantic: "element", color, strokeWidth, x: point.x, y: point.y, w: 0, h: 0, originX: point.x, originY: point.y }
+ : { type: "arrow", semantic: "accent", color, strokeWidth, points: [[point.x, point.y, 0.65], [point.x, point.y, 0.65]] };
+ repaintSketch();
+ });
+
+ drawCanvas.addEventListener("pointermove", event => {
+ if (!drawPointerActive || !drawDraft) return;
+ const point = drawPoint(event);
+ if (drawDraft.type === "pencil") drawDraft.points.push([point.x, point.y, 0.65]);
+ else if (drawDraft.type === "rect") {
+ drawDraft.x = Math.min(drawDraft.originX, point.x);
+ drawDraft.y = Math.min(drawDraft.originY, point.y);
+ drawDraft.w = Math.abs(point.x - drawDraft.originX);
+ drawDraft.h = Math.abs(point.y - drawDraft.originY);
+ } else drawDraft.points[1] = [point.x, point.y, 0.65];
+ repaintSketch();
+ });
+
+ function finishSketchStroke(event) {
+ if (!drawPointerActive || !drawDraft) return;
+ drawPointerActive = false;
+ try { drawCanvas.releasePointerCapture(event.pointerId); } catch (_) {}
+ const usable = drawDraft.type === "pencil" ? drawDraft.points.length > 1
+ : drawDraft.type === "rect" ? drawDraft.w > 4 && drawDraft.h > 4
+ : Math.hypot(drawDraft.points[1][0] - drawDraft.points[0][0], drawDraft.points[1][1] - drawDraft.points[0][1]) > 4;
+ if (usable) {
+ delete drawDraft.originX;
+ delete drawDraft.originY;
+ drawObjects.push(drawDraft);
+ }
+ drawDraft = null;
+ repaintSketch();
+ }
+ drawCanvas.addEventListener("pointerup", finishSketchStroke);
+ drawCanvas.addEventListener("pointercancel", finishSketchStroke);
+
+ drawLayoutButton.onclick = openDrawingPad;
+ document.getElementById("drawCancel").onclick = closeDrawingPad;
+ document.getElementById("drawUndo").onclick = () => { drawObjects.pop(); repaintSketch(); };
+ document.getElementById("drawClear").onclick = () => { drawObjects = []; repaintSketch(); };
+ document.getElementById("drawRemove").onclick = () => {
+ drawObjects = [];
+ activeSketchImage = null;
+ activeSketchJSON = null;
+ drawLayoutButton.classList.remove("has-sketch");
+ drawLayoutButton.textContent = "Draw layout";
+ closeDrawingPad();
+ showToast("Drawing removed");
+ };
+ document.getElementById("drawUse").onclick = () => {
+ if (!drawObjects.length) { showToast("Draw at least one shape or motion arrow"); return; }
+ const duration = Number(selectedTemplate?.duration) || 5;
+ activeSketchImage = drawCanvas.toDataURL("image/png");
+ activeSketchJSON = {
+ schemaVersion: 1,
+ mode: "sketchflow",
+ canvas: { width: drawCanvas.width, height: drawCanvas.height },
+ duration,
+ camera: "static",
+ frames: [{
+ id: "frame-1", label: "A",
+ objects: drawObjects.map((object, index) => ({
+ ...object,
+ id: `drawn-${index + 1}`,
+ startTime: 0,
+ endTime: duration,
+ motionHint: object.type === "arrow" ? "node-connect" : object.type === "rect" ? "pop" : "fade-in"
+ }))
+ }]
+ };
+ drawLayoutButton.classList.add("has-sketch");
+ drawLayoutButton.textContent = "Drawing attached";
+ closeDrawingPad();
+ showToast("Drawing attached as motion guidance");
+ };
+ drawModal.addEventListener("click", event => { if (event.target === drawModal) closeDrawingPad(); });
+
+ async function api(path, options = {}) {
+ const token = localStorage.getItem(BRIDGE_TOKEN_KEY) || "";
+ const requestOptions = { ...options, headers: { ...(options.headers || {}) } };
+ if (token) requestOptions.headers["X-Null-Bridge-Token"] = token;
+ const method = String(requestOptions.method || "GET").toUpperCase();
+ // The production companion is supervised and normally comes back within
+ // a few seconds. Keep read-only polling alive through that brief restart
+ // instead of converting a recoverable disconnect into a failed render.
+ const attempts = method === "GET" ? 15 : 1;
+ for (let attempt = 0; attempt < attempts; attempt += 1) {
+ try {
+ const response = await fetch(`${API}${path}`, requestOptions);
+ const data = await response.json().catch(() => ({}));
+ if (!response.ok) throw new Error(data.error || `Null bridge failed (${response.status})`);
+ return data;
+ } catch (error) {
+ const isNetworkFailure = error instanceof TypeError || /failed to fetch|networkerror|load failed/i.test(String(error.message || ""));
+ if (!isNetworkFailure) throw error;
+ if (attempt + 1 < attempts) {
+ await new Promise(resolve => setTimeout(resolve, 500));
+ continue;
+ }
+ const unavailable = new Error("The local bridge stopped responding. Check that it is running, then try again.");
+ unavailable.code = "BRIDGE_UNREACHABLE";
+ throw unavailable;
+ }
+ }
+ }
+
+ function setBridgeState(state, label, { showPair = false } = {}) {
+ const status = document.getElementById("bridgeStatus");
+ status.classList.remove("is-checking", "is-online", "is-offline");
+ status.classList.add(`is-${state}`);
+ document.getElementById("bridgeStatusText").textContent = label;
+ status.setAttribute("aria-label", label);
+ document.getElementById("pairBridge").hidden = !showPair;
+ }
+
+ async function refreshBridgeStatus() {
+ try {
+ const health = await api("/health");
+ const active = Number(health.activeJobs) || 0;
+ const version = health.bridgeVersion ? ` v${health.bridgeVersion}` : "";
+ setBridgeState("online", "UI server ready · generation not connected");
+ } catch (error) {
+ const needsPairing = /401|403|pair|token|unauthorized/i.test(String(error.message || ""));
+ setBridgeState("offline", needsPairing ? "Pair required" : "Bridge offline", { showPair: needsPairing });
+ }
+ }
+
+ function safeJobUrl(value) {
+ if (!value) return null;
+ try {
+ const url = new URL(String(value), API);
+ return /^https?:$/.test(url.protocol) ? url.href : null;
+ } catch (_) {
+ return null;
+ }
+ }
+
+ let jobPromptRestoreFocus = null;
+ function exactJobPrompt(job) {
+ return String(job?.optimizedPrompt || job?.prompt || job?.originalPrompt || "").trim();
+ }
+
+ function openJobPrompt(job, trigger = null) {
+ const prompt = exactJobPrompt(job);
+ if (!prompt) { showToast("No generation prompt was saved for this render"); return; }
+ jobPromptRestoreFocus = trigger || document.activeElement;
+ document.getElementById("jobPromptTitle").textContent = displayJobName(job);
+ document.getElementById("jobPromptText").textContent = prompt;
+ const modal = document.getElementById("jobPromptModal");
+ modal.classList.add("show");
+ modal.setAttribute("aria-hidden", "false");
+ document.getElementById("jobPromptClose").focus();
+ }
+
+ function closeJobPrompt() {
+ const modal = document.getElementById("jobPromptModal");
+ if (!modal.classList.contains("show")) return;
+ modal.classList.remove("show");
+ modal.setAttribute("aria-hidden", "true");
+ document.getElementById("jobPromptText").textContent = "";
+ if (jobPromptRestoreFocus && document.contains(jobPromptRestoreFocus)) jobPromptRestoreFocus.focus();
+ jobPromptRestoreFocus = null;
+ }
+
+ document.getElementById("jobPromptClose").onclick = closeJobPrompt;
+ document.getElementById("jobPromptDone").onclick = closeJobPrompt;
+ document.getElementById("jobPromptCopy").onclick = () => copyText(document.getElementById("jobPromptText").textContent)
+ .then(() => showToast("Production prompt copied"));
+ document.getElementById("jobPromptModal").addEventListener("click", event => {
+ if (event.target.id === "jobPromptModal") closeJobPrompt();
+ });
+
+ function jobDownloadHref(job) {
+ const status = String(job?.status || "").toLowerCase();
+ if (job?.previewOnly === true || !["done", "completed"].includes(status)) return null;
+ const explicit = safeJobUrl(job?.downloadUrl);
+ if (explicit) {
+ try {
+ const direct = new URL(explicit);
+ if (direct.origin === API && /\/api\/v1\/jobs\/[^/]+\/download$/.test(direct.pathname)) {
+ return direct.href;
+ }
+ } catch (_) {}
+ return explicit;
+ }
+ const rendered = safeJobUrl(job?.renderUrl);
+ if (!rendered) return null;
+ const jobId = String(job?.id || job?.jobId || "");
+ if (/^\d+$/.test(jobId) || /^[0-9a-f-]{36}$/i.test(jobId)) {
+ return `${API}/api/v1/jobs/${encodeURIComponent(jobId)}/download`;
+ }
+ return rendered;
+ }
+
+ function formatJobTime(value) {
+ const timestamp = Number(value);
+ const date = new Date(Number.isFinite(timestamp) ? timestamp : value);
+ if (Number.isNaN(date.getTime())) return "Saved render";
+ const ageSeconds = Math.max(0, Math.floor((Date.now() - date.getTime()) / 1000));
+ if (ageSeconds < 60) return `${ageSeconds}s ago`;
+ if (ageSeconds < 60 * 60) return `${Math.floor(ageSeconds / 60)}m ago`;
+ if (ageSeconds < 24 * 60 * 60) return `${Math.floor(ageSeconds / 3600)}h ago`;
+ return date.toLocaleDateString(undefined, { month: "short", day: "numeric" });
+ }
+
+ function displayJobName(job) {
+ const value = String(job.preset || job.templateId || "Motion graphic")
+ .replace(/^\d+[\s_-]*/, "")
+ .replace(/[-_]+/g, " ")
+ .trim();
+ return value ? value.replace(/\b\w/g, letter => letter.toUpperCase()) : "Motion graphic";
+ }
+
+ function jobStatusMeta(job) {
+ const raw = String(job.status || "queued").toLowerCase();
+ if (raw === "done" || raw === "completed") return { key: "done", label: "Done" };
+ if (raw === "error" || raw === "failed" || raw === "interrupted") return { key: "error", label: raw === "interrupted" ? "Interrupted" : "Error" };
+ if (raw === "cancelled" || raw === "canceled") return { key: "cancelled", label: "Cancelled" };
+ if (raw === "pending" || raw === "queued") return { key: raw, label: "Queued" };
+ return { key: "working", label: "Running" };
+ }
+
+ function compactJobLabel(job) {
+ const prompt = String(job?.originalPrompt || job?.prompt || "").split(/\n\nVARIATION/i)[0].trim();
+ if (prompt) return prompt.length > 58 ? `${prompt.slice(0, 55)}...` : prompt;
+ return displayJobName(job);
+ }
+
+ function ensureCompletionNotifications() {
+ if (!("Notification" in window) || Notification.permission !== "default") return;
+ Notification.requestPermission().catch(() => {});
+ }
+
+ function announceJobTerminal(job, state) {
+ const label = compactJobLabel(job);
+ const succeeded = state === "done";
+ const title = succeeded ? "Null Motion render ready" : "Null Motion generation failed";
+ const body = succeeded ? `${label} is ready in Final renders.` : `${label} could not be generated.`;
+ showToast(succeeded ? `“${label}” is done generating` : `“${label}” could not be generated`);
+ if (!("Notification" in window) || Notification.permission !== "granted") return;
+ if (document.visibilityState === "visible" && document.hasFocus()) return;
+ try { new Notification(title, { body }); } catch (_) {}
+ }
+
+ const JOB_STEP_LABELS = Object.freeze({
+ pending: "Queued", queued: "Queued", researching: "Reading websites", sourcing: "Sourcing assets",
+ optimizing: "Directing", "directing-fast": "Fast direction", "asset-resolving": "Resolving authentic assets",
+ planning: "Planning motion", expanding: "Writing composition", building: "Building composition",
+ linting: "Checking composition", rendering: "Encoding video", upscaling: "Finishing 1080p delivery",
+ finalizing: "Verifying video", reviewing: "Inspecting rendered frames", repairing: "Repairing visual issues",
+ rerendering: "Encoding repaired video", "preview-ready": "Preview ready", cancelling: "Cancelling"
+ });
+
+ function queueStepLabel(job) {
+ if (job?.renderSlotActive) return "Rendering";
+ if (Number(job?.renderQueuePosition) > 0) return `Waiting for renderer · #${job.renderQueuePosition}`;
+ const raw = String(job?.step || "").toLowerCase();
+ if (raw.endsWith("-retrying")) return `Retrying ${JOB_STEP_LABELS[raw.slice(0, -9)] || raw.slice(0, -9)}`;
+ return JOB_STEP_LABELS[raw] || "Working";
+ }
+
+ function setQueuePanelOpen(open) {
+ const panel = document.getElementById("generationQueue");
+ const toggle = document.getElementById("queueToggle");
+ panel.hidden = !open;
+ toggle.setAttribute("aria-expanded", String(Boolean(open)));
+ if (open) panel.scrollIntoView({ behavior: "smooth", block: "nearest" });
+ }
+
+ function createQueueItem(job) {
+ const item = document.createElement("article");
+ item.className = `queue-item${job.renderSlotActive ? " is-rendering" : ""}${Number(job.renderQueuePosition) > 0 ? " is-waiting" : ""}`;
+ const dot = document.createElement("span");
+ dot.className = "queue-dot";
+ dot.setAttribute("aria-hidden", "true");
+
+ const main = document.createElement("div");
+ main.className = "queue-main";
+ const title = document.createElement("div");
+ title.className = "queue-title";
+ title.textContent = `${displayJobName(job)} · ${Number(job.width) || 1080}×${Number(job.height) || 1920}`;
+ const detail = document.createElement("div");
+ detail.className = "queue-prompt";
+ const submittedPrompt = String(job?.originalPrompt || job?.prompt || job?.optimizedPrompt || "").replace(/\s+/g, " ").trim();
+ detail.textContent = submittedPrompt ? `Prompt: ${submittedPrompt}` : "Prompt unavailable";
+ detail.title = detail.textContent;
+ main.append(title, detail);
+
+ const pct = Math.max(0, Math.min(100, Number(job.pct ?? job.progress) || 0));
+ const state = document.createElement("div");
+ state.className = "queue-state";
+ const stateLabel = document.createElement("div");
+ stateLabel.className = "queue-state-label";
+ const step = document.createElement("span");
+ step.textContent = queueStepLabel(job);
+ const progressText = document.createElement("span");
+ progressText.textContent = [stageProgressLabel(job), `${Math.round(pct)}%`, generationRemainingLabel(job)].filter(Boolean).join(" · ");
+ stateLabel.append(step, progressText);
+ const progress = document.createElement("div");
+ progress.className = "queue-progress";
+ progress.setAttribute("role", "progressbar");
+ progress.setAttribute("aria-label", `${queueStepLabel(job)} progress`);
+ progress.setAttribute("aria-valuemin", "0");
+ progress.setAttribute("aria-valuemax", "100");
+ progress.setAttribute("aria-valuenow", String(Math.round(pct)));
+ const progressBar = document.createElement("span");
+ progressBar.style.transform = `scaleX(${pct / 100})`;
+ progress.appendChild(progressBar);
+ state.append(stateLabel, progress);
+
+ const actions = document.createElement("div");
+ actions.className = "queue-actions";
+ if (exactJobPrompt(job)) {
+ const prompt = document.createElement("button");
+ prompt.type = "button";
+ prompt.textContent = "Prompt";
+ prompt.onclick = () => openJobPrompt(job, prompt);
+ actions.appendChild(prompt);
+ }
+ const protectedProcess = document.createElement("span");
+ protectedProcess.className = "queue-protected";
+ protectedProcess.textContent = "Server process";
+ actions.appendChild(protectedProcess);
+ item.append(dot, main, state, actions);
+ return item;
+ }
+
+ function renderGenerationQueue(jobs, queueSummary = {}) {
+ const active = (Array.isArray(jobs) ? jobs : []).filter(job => !["done", "error", "cancelled"].includes(jobStatusMeta(job).key));
+ active.sort((a, b) => Number(Boolean(b.renderSlotActive)) - Number(Boolean(a.renderSlotActive))
+ || (Number(a.renderQueuePosition) || Number.MAX_SAFE_INTEGER) - (Number(b.renderQueuePosition) || Number.MAX_SAFE_INTEGER)
+ || (Number(a.startedAt) || 0) - (Number(b.startedAt) || 0));
+ activeBackgroundJobCount = active.length;
+ document.getElementById("queueCount").textContent = String(active.length);
+ document.title = active.length ? `(${active.length}) ${originalDocumentTitle}` : originalDocumentTitle;
+ const rendering = Number(queueSummary.activeRenders) || active.filter(job => job.renderSlotActive).length;
+ const waiting = Number(queueSummary.waitingForRenderer) || active.filter(job => Number(job.renderQueuePosition) > 0).length;
+ document.getElementById("queueSummary").textContent = active.length
+ ? `${active.length} active · ${rendering} rendering · ${waiting} waiting. Final Cut + Download unlock together.`
+ : "Queue clear. Approved files are in Final renders.";
+ const list = document.getElementById("queueList");
+ list.replaceChildren();
+ if (!active.length) {
+ const empty = document.createElement("div");
+ empty.className = "queue-empty";
+ empty.textContent = "The queue is clear. Generate something and it will keep running here in the background.";
+ list.appendChild(empty);
+ } else {
+ active.forEach(job => list.appendChild(createQueueItem(job)));
+ }
+ }
+
+ function appendJobLink(container, label, value, options = {}) {
+ const href = safeJobUrl(value);
+ if (!href) return;
+ const link = document.createElement("a");
+ link.href = href;
+ link.textContent = label;
+ if (options.className) link.className = options.className;
+ if (options.download) link.download = options.download === true ? "" : options.download;
+ else { link.target = "_blank"; link.rel = "noopener"; }
+ container.appendChild(link);
+ }
+
+ function previewFrameCount(job) {
+ return Math.max(0, Math.min(1800, Math.floor(Number(job?.previewFrameCount) || 0)));
+ }
+
+ function previewFrameUrl(job, index) {
+ const baseUrl = safeJobUrl(job?.previewFrameBaseUrl);
+ const count = previewFrameCount(job);
+ const frame = Math.max(1, Math.min(count, Math.floor(Number(index) || 1)));
+ return baseUrl && count ? `${baseUrl}${String(frame).padStart(4, "0")}.jpg` : null;
+ }
+
+ function livePreviewUrl(job) {
+ const instant = safeJobUrl(job?.instantPreviewUrl);
+ if (instant) return instant;
+ const base = safeJobUrl(job?.previewUrl);
+ if (!base) return null;
+ const url = new URL(base);
+ if (!/\/index\.html$/i.test(url.pathname)) url.pathname = `${url.pathname.replace(/\/$/, "")}/index.html`;
+ url.hash = "play";
+ return url.href;
+ }
+
+ function formatPreviewClock(seconds) {
+ const safeSeconds = Math.max(0, Number(seconds) || 0);
+ const minutes = Math.floor(safeSeconds / 60);
+ const remainder = Math.floor(safeSeconds % 60);
+ return `${minutes}:${String(remainder).padStart(2, "0")}`;
+ }
+
+ function livePreviewDimensions(frame, job) {
+ let root = null;
+ try { root = frame?.contentDocument?.querySelector('[data-composition-id="root"], #root'); } catch (_) {}
+ const width = Number(root?.dataset?.width) || Number(root?.offsetWidth) || Number(job?.deliveryWidth) || Number(job?.width) || 1920;
+ const height = Number(root?.dataset?.height) || Number(root?.offsetHeight) || Number(job?.deliveryHeight) || Number(job?.height) || 1080;
+ return { width: Math.max(1, width), height: Math.max(1, height) };
+ }
+
+ function jobSpecification(job) {
+ const { width, height } = livePreviewDimensions(null, job);
+ const dimensions = `${width}×${height}`;
+ const duration = Number(job?.duration) > 0 ? `${Number(job.duration).toFixed(Number(job.duration) % 1 ? 1 : 0)}s` : null;
+ const fps = Number(job?.fps) > 0 ? `${Number(job.fps).toFixed(Number(job.fps) % 1 ? 2 : 0)} fps` : null;
+ const renderTime = isTerminalJobStatus(job) && currentJobElapsedSeconds(job) > 0 ? `rendered in ${formatGenerationTime(currentJobElapsedSeconds(job))}` : null;
+ return [dimensions, duration, fps, renderTime].filter(Boolean).join(" · ");
+ }
+
+ function positionCardLiveFrame(frame, trigger, job) {
+ const { width, height } = livePreviewDimensions(frame, job);
+ const scale = Math.min(trigger.clientWidth / width, trigger.clientHeight / height);
+ frame.style.width = `${width}px`;
+ frame.style.height = `${height}px`;
+ frame.style.left = `${(trigger.clientWidth - width * scale) / 2}px`;
+ frame.style.top = `${(trigger.clientHeight - height * scale) / 2}px`;
+ frame.style.transform = `scale(${scale})`;
+ }
+
+ function attachCardMotionPreview(trigger, image, job) {
+ const count = previewFrameCount(job);
+ const firstFrame = previewFrameUrl(job, 1);
+ const liveUrl = livePreviewUrl(job);
+ const instantLive = job?.instantPreviewReady === true && liveUrl;
+ const posterUrl = image?.src || "";
+ let timer = 0;
+ let frame = 1;
+ let liveFrame = null;
+
+ const stop = () => {
+ if (timer) window.clearInterval(timer);
+ timer = 0;
+ frame = 1;
+ if (image) {
+ image.dataset.previewing = "false";
+ image.style.opacity = "";
+ if (posterUrl) image.src = posterUrl;
+ }
+ if (liveFrame) {
+ if (liveFrame.dataset.previewTransferred !== "true") {
+ liveFrame.src = "about:blank";
+ liveFrame.remove();
+ }
+ liveFrame = null;
+ }
+ };
+ const start = () => {
+ if (timer || liveFrame || document.body.classList.contains("render-preview-open")) return;
+ if (!instantLive && image && count >= 2 && firstFrame) {
+ image.dataset.previewing = "true";
+ image.src = firstFrame;
+ timer = window.setInterval(() => {
+ frame = frame >= count ? 1 : frame + 1;
+ image.src = previewFrameUrl(job, frame);
+ }, 1000 / PREVIEW_FRAME_RATE);
+ return;
+ }
+ if (!liveUrl) return;
+ liveFrame = document.createElement("iframe");
+ liveFrame.className = "job-live-preview";
+ liveFrame.title = "";
+ liveFrame.tabIndex = -1;
+ liveFrame.setAttribute("aria-hidden", "true");
+ liveFrame.setAttribute("scrolling", "no");
+ liveFrame.dataset.instantPreview = instantLive ? "true" : "false";
+ liveFrame.dataset.loaded = "false";
+ const frameElement = liveFrame;
+ liveFrame.onload = () => {
+ frameElement.dataset.loaded = "true";
+ positionCardLiveFrame(frameElement, trigger, job);
+ };
+ positionCardLiveFrame(liveFrame, trigger, job);
+ liveFrame.src = liveUrl;
+ if (image) image.style.opacity = "0";
+ trigger.appendChild(liveFrame);
+ };
+
+ if ((!image || count < 2 || !firstFrame) && !liveUrl) return;
+
+ if (!image && instantLive) {
+ requestAnimationFrame(start);
+ jobCardPreviewStops.push(stop);
+ return;
+ }
+
+ trigger.addEventListener("pointerenter", start);
+ trigger.addEventListener("pointerleave", stop);
+ trigger.addEventListener("focus", start);
+ trigger.addEventListener("blur", stop);
+ jobCardPreviewStops.push(stop);
+ }
+
+ const renderPreviewModal = document.getElementById("renderPreviewModal");
+ const renderPreviewImage = document.getElementById("renderPreviewImage");
+ const renderPreviewFrame = document.getElementById("renderPreviewFrame");
+ const renderPreviewLoading = document.getElementById("renderPreviewLoading");
+ const renderPreviewUnavailable = document.getElementById("renderPreviewUnavailable");
+ const renderPreviewControls = document.getElementById("renderPreviewControls");
+ const renderPreviewScrubber = document.getElementById("renderPreviewScrubber");
+ const renderPreviewToggle = document.getElementById("renderPreviewToggle");
+ const renderPreviewTime = document.getElementById("renderPreviewTime");
+ const renderPreviewState = {
+ job: null,
+ frameIndex: 0,
+ count: 0,
+ playing: false,
+ lastTick: 0,
+ raf: 0,
+ preloads: [],
+ restoreFocus: null,
+ borrowedFrame: null,
+ borrowedHome: null,
+ liveReadyTimer: 0
+ };
+
+ function renderPreviewJobId(job) {
+ return String(job?.id || job?.jobId || "");
+ }
+
+ function isQualityRejected(job) {
+ return /visual quality gate rejected|quality gate rejected/i.test(String(job?.error || ""));
+ }
+
+ function renderPreviewProductionLabel(job) {
+ const status = String(job?.status || "").toLowerCase();
+ const pct = Math.max(0, Math.min(100, Math.round(Number(job?.pct ?? job?.progress) || 0)));
+ if (["done", "completed"].includes(status)) return "Production MOV ready";
+ if (["error", "failed", "cancelled", "canceled", "interrupted"].includes(status)) return isQualityRejected(job) ? "Rejected by quality gate" : "Production MOV failed";
+ const labels = {
+ queued: "waiting for render slot",
+ rendering: "rendering production MOV",
+ upscaling: "finishing 1080p delivery",
+ finalizing: "verifying production MOV",
+ reviewing: "reviewing rendered frames",
+ repairing: "repairing rendered frames",
+ rerendering: "rendering repaired MOV"
+ };
+ return [labels[String(job?.step || "").toLowerCase()] || queueStepLabel(job), stageProgressLabel(job), `${pct}%`, generationRemainingLabel(job)].filter(Boolean).join(" · ");
+ }
+
+ function updateRenderPreviewArtifactState(job) {
+ if (!job || !renderPreviewModal.classList.contains("show")) return;
+ const currentId = renderPreviewJobId(renderPreviewState.job);
+ if (currentId && renderPreviewJobId(job) !== currentId) return;
+ renderPreviewState.job = { ...(renderPreviewState.job || {}), ...job };
+
+ const current = renderPreviewState.job;
+ const download = document.getElementById("renderPreviewDownload");
+ const eyebrow = document.getElementById("renderPreviewEyebrow");
+ const downloadUrl = jobDownloadHref(current);
+ download.hidden = current.previewOnly === true;
+ download.onclick = null;
+ if (downloadUrl) {
+ eyebrow.textContent = "Final approved render";
+ download.removeAttribute("aria-disabled");
+ download.textContent = "Download MOV";
+ download.href = downloadUrl;
+ download.download = current.mp4Name || "null-motion.mov";
+ } else {
+ download.setAttribute("aria-disabled", "true");
+ download.removeAttribute("href");
+ download.removeAttribute("download");
+ eyebrow.textContent = current.previewOnly === true ? "Preview only" : "Final render unavailable";
+ download.textContent = "MOV unavailable";
+ download.onclick = event => {
+ event.preventDefault();
+ showToast(current.error || "The production MOV is unavailable.");
+ };
+ }
+
+ renderPreviewTime.textContent = downloadUrl ? "Final MOV ready · download available" : "Preview only · no MOV created";
+ }
+
+ function updateRenderPreviewTime() {
+ const duration = Number(renderPreviewState.job?.duration) > 0
+ ? Number(renderPreviewState.job.duration)
+ : renderPreviewState.count / PREVIEW_FRAME_RATE;
+ const current = Math.min(duration, renderPreviewState.frameIndex / PREVIEW_FRAME_RATE);
+ renderPreviewTime.textContent = `${formatPreviewClock(current)} / ${formatPreviewClock(duration)}`;
+ renderPreviewScrubber.value = String(renderPreviewState.frameIndex);
+ }
+
+ function showRenderPreviewFrame(index) {
+ if (!renderPreviewState.job || !renderPreviewState.count) return;
+ renderPreviewState.frameIndex = Math.max(0, Math.min(renderPreviewState.count - 1, Math.floor(Number(index) || 0)));
+ const url = previewFrameUrl(renderPreviewState.job, renderPreviewState.frameIndex + 1);
+ if (url) renderPreviewImage.src = url;
+ updateRenderPreviewTime();
+ }
+
+ function renderPreviewTick(timestamp) {
+ if (!renderPreviewState.playing || !renderPreviewModal.classList.contains("show")) return;
+ if (!renderPreviewState.lastTick) renderPreviewState.lastTick = timestamp;
+ const frameDuration = 1000 / PREVIEW_FRAME_RATE;
+ const elapsed = timestamp - renderPreviewState.lastTick;
+ if (elapsed >= frameDuration) {
+ const steps = Math.max(1, Math.floor(elapsed / frameDuration));
+ showRenderPreviewFrame((renderPreviewState.frameIndex + steps) % renderPreviewState.count);
+ renderPreviewState.lastTick += steps * frameDuration;
+ }
+ renderPreviewState.raf = requestAnimationFrame(renderPreviewTick);
+ }
+
+ function playRenderPreview() {
+ if (renderPreviewState.count < 2) return;
+ cancelAnimationFrame(renderPreviewState.raf);
+ renderPreviewState.playing = true;
+ renderPreviewState.lastTick = 0;
+ renderPreviewToggle.textContent = "Pause";
+ renderPreviewState.raf = requestAnimationFrame(renderPreviewTick);
+ }
+
+ function pauseRenderPreview() {
+ renderPreviewState.playing = false;
+ cancelAnimationFrame(renderPreviewState.raf);
+ renderPreviewState.raf = 0;
+ renderPreviewToggle.textContent = "Play";
+ }
+
+ function fitRenderPreviewFrame() {
+ const activeFrame = renderPreviewState.borrowedFrame || renderPreviewFrame;
+ if (!activeFrame.classList.contains("show") || !renderPreviewState.job) return;
+ const stage = document.getElementById("renderPreviewStage");
+ const { width, height } = livePreviewDimensions(activeFrame, renderPreviewState.job);
+ const scale = Math.min(stage.clientWidth / width, stage.clientHeight / height);
+ activeFrame.style.width = `${width}px`;
+ activeFrame.style.height = `${height}px`;
+ activeFrame.style.left = "50%";
+ activeFrame.style.top = "50%";
+ activeFrame.style.transform = `translate(-50%,-50%) scale(${scale})`;
+ }
+
+ function clearLivePreviewHandshake() {
+ window.clearTimeout(renderPreviewState.liveReadyTimer);
+ renderPreviewState.liveReadyTimer = 0;
+ }
+
+ function failLivePreview(message) {
+ clearLivePreviewHandshake();
+ renderPreviewLoading.hidden = true;
+ renderPreviewUnavailable.hidden = false;
+ renderPreviewUnavailable.textContent = message;
+ renderPreviewTime.textContent = "Preview unavailable";
+ }
+
+ window.addEventListener("message", event => {
+ if (!renderPreviewModal.classList.contains("show")) return;
+ const activeFrame = renderPreviewState.borrowedFrame || renderPreviewFrame;
+ if (event.source !== activeFrame.contentWindow) return;
+ const message = event.data;
+ if (!message || message.source !== "null-motion-preview") return;
+ try {
+ if (event.origin !== new URL(activeFrame.src).origin) return;
+ } catch (_) { return; }
+ if (message.state !== "playing") {
+ failLivePreview("Preview failed to start. The production render was not approved.");
+ return;
+ }
+ clearLivePreviewHandshake();
+ activeFrame.dataset.loaded = "true";
+ renderPreviewLoading.hidden = true;
+ renderPreviewUnavailable.hidden = true;
+ updateRenderPreviewArtifactState(renderPreviewState.job);
+ requestAnimationFrame(fitRenderPreviewFrame);
+ });
+
+ function showLiveRenderPreview(liveUrl, activeFrame = renderPreviewFrame) {
+ clearLivePreviewHandshake();
+ renderPreviewControls.classList.add("is-live");
+ renderPreviewToggle.textContent = "Replay";
+ renderPreviewTime.textContent = liveUrl ? "Starting live preview" : "No preview available";
+ if (!liveUrl) {
+ failLivePreview("Preview is unavailable for this render.");
+ return;
+ }
+ renderPreviewLoading.hidden = false;
+ renderPreviewUnavailable.hidden = true;
+ activeFrame.className = "render-preview-frame show";
+ activeFrame.dataset.loaded = "false";
+ activeFrame.onload = () => requestAnimationFrame(fitRenderPreviewFrame);
+ document.getElementById("renderPreviewStage").appendChild(activeFrame);
+ renderPreviewState.liveReadyTimer = window.setTimeout(() => {
+ failLivePreview("Preview failed to start. Production rendering and quality review continue in the background.");
+ }, 4500);
+ activeFrame.src = liveUrl;
+ }
+
+ function openRenderPreview(job, trigger = null) {
+ if (!["done", "completed"].includes(String(job?.status || "").toLowerCase())) {
+ showToast("Final Cut and Download unlock together after approval.");
+ return;
+ }
+ const borrowedFrame = trigger?.closest?.(".job-card")?.querySelector?.('.job-live-preview[data-instant-preview="true"]') || null;
+ const borrowedHome = borrowedFrame?.parentElement || null;
+ if (borrowedFrame) borrowedFrame.dataset.previewTransferred = "true";
+ jobCardPreviewStops.forEach(stop => stop());
+ pauseRenderPreview();
+ renderPreviewState.job = job;
+ renderPreviewState.frameIndex = 0;
+ renderPreviewState.count = previewFrameCount(job);
+ renderPreviewState.restoreFocus = trigger || document.activeElement;
+ renderPreviewState.preloads = [];
+ renderPreviewState.borrowedFrame = borrowedFrame;
+ renderPreviewState.borrowedHome = borrowedHome;
+
+ document.getElementById("renderPreviewTitle").textContent = displayJobName(job);
+ document.getElementById("renderPreviewMeta").textContent = jobSpecification(job);
+ renderPreviewLoading.hidden = false;
+ renderPreviewUnavailable.hidden = true;
+ renderPreviewImage.classList.remove("show");
+ renderPreviewImage.removeAttribute("src");
+ renderPreviewFrame.classList.remove("show");
+ renderPreviewFrame.src = "about:blank";
+ renderPreviewControls.classList.remove("is-live");
+
+ const download = document.getElementById("renderPreviewDownload");
+ download.hidden = job.previewOnly === true;
+ const promptButton = document.getElementById("renderPreviewPrompt");
+ promptButton.hidden = !exactJobPrompt(job);
+ promptButton.onclick = () => openJobPrompt(job, promptButton);
+
+ const { width, height } = livePreviewDimensions(null, job);
+ renderPreviewModal.classList.toggle("is-portrait", height > width);
+ renderPreviewModal.classList.add("show");
+ renderPreviewModal.setAttribute("aria-hidden", "false");
+ document.body.classList.add("render-preview-open");
+ updateRenderPreviewArtifactState(job);
+
+ const firstFrame = previewFrameUrl(job, 1);
+ const liveUrl = livePreviewUrl(job);
+ if (firstFrame && renderPreviewState.count > 0) {
+ renderPreviewImage.classList.add("show");
+ renderPreviewImage.alt = `${displayJobName(job)} animated preview`;
+ renderPreviewScrubber.max = String(Math.max(0, renderPreviewState.count - 1));
+ renderPreviewScrubber.value = "0";
+ renderPreviewImage.onload = () => {
+ renderPreviewImage.onload = null;
+ renderPreviewLoading.hidden = true;
+ if (!renderPreviewState.playing && renderPreviewState.frameIndex === 0) playRenderPreview();
+ };
+ showRenderPreviewFrame(0);
+ const preloadCount = Math.min(renderPreviewState.count, PREVIEW_FRAME_RATE * 10);
+ for (let index = 2; index <= preloadCount; index += 1) {
+ const preload = new Image();
+ preload.src = previewFrameUrl(job, index);
+ renderPreviewState.preloads.push(preload);
+ }
+ } else if (job.instantPreviewReady === true && liveUrl) {
+ showLiveRenderPreview(liveUrl, borrowedFrame || renderPreviewFrame);
+ } else showLiveRenderPreview(liveUrl);
+
+ document.getElementById("renderPreviewClose").focus();
+ }
+
+ function closeRenderPreview() {
+ if (!renderPreviewModal.classList.contains("show")) return;
+ pauseRenderPreview();
+ clearLivePreviewHandshake();
+ renderPreviewModal.classList.remove("show");
+ renderPreviewModal.classList.remove("is-portrait");
+ renderPreviewModal.setAttribute("aria-hidden", "true");
+ document.body.classList.remove("render-preview-open");
+ renderPreviewImage.onload = null;
+ renderPreviewImage.removeAttribute("src");
+ renderPreviewFrame.onload = null;
+ renderPreviewFrame.src = "about:blank";
+ renderPreviewState.preloads = [];
+ const borrowedFrame = renderPreviewState.borrowedFrame;
+ const borrowedHome = renderPreviewState.borrowedHome;
+ if (borrowedFrame) {
+ if (borrowedHome && document.contains(borrowedHome)) {
+ borrowedFrame.className = "job-live-preview";
+ borrowedFrame.dataset.previewTransferred = "false";
+ borrowedFrame.onload = () => { borrowedFrame.dataset.loaded = "true"; };
+ borrowedHome.appendChild(borrowedFrame);
+ positionCardLiveFrame(borrowedFrame, borrowedHome, renderPreviewState.job);
+ } else {
+ borrowedFrame.src = "about:blank";
+ borrowedFrame.remove();
+ }
+ }
+ const restoreFocus = renderPreviewState.restoreFocus;
+ renderPreviewState.job = null;
+ renderPreviewState.count = 0;
+ renderPreviewState.borrowedFrame = null;
+ renderPreviewState.borrowedHome = null;
+ if (restoreFocus && document.contains(restoreFocus)) restoreFocus.focus();
+ }
+
+ document.getElementById("renderPreviewClose").onclick = closeRenderPreview;
+ renderPreviewModal.addEventListener("click", event => { if (event.target === renderPreviewModal) closeRenderPreview(); });
+ function replayLiveRenderPreview() {
+ const url = livePreviewUrl(renderPreviewState.job);
+ if (!url) return;
+ renderPreviewLoading.hidden = false;
+ const activeFrame = renderPreviewState.borrowedFrame || renderPreviewFrame;
+ activeFrame.src = "about:blank";
+ requestAnimationFrame(() => { activeFrame.src = url; });
+ }
+ renderPreviewToggle.onclick = () => renderPreviewControls.classList.contains("is-live")
+ ? replayLiveRenderPreview()
+ : renderPreviewState.playing ? pauseRenderPreview() : playRenderPreview();
+ renderPreviewScrubber.addEventListener("input", event => {
+ showRenderPreviewFrame(event.target.value);
+ renderPreviewState.lastTick = performance.now();
+ });
+ window.addEventListener("resize", fitRenderPreviewFrame);
+ window.addEventListener("keydown", event => {
+ if (document.getElementById("jobPromptModal").classList.contains("show")) {
+ if (event.key === "Escape") closeJobPrompt();
+ return;
+ }
+ if (!renderPreviewModal.classList.contains("show")) return;
+ if (event.key === "Escape") { closeRenderPreview(); return; }
+ if (renderPreviewControls.classList.contains("is-live")) return;
+ if (event.key === " ") {
+ event.preventDefault();
+ renderPreviewState.playing ? pauseRenderPreview() : playRenderPreview();
+ } else if (event.key === "ArrowLeft" || event.key === "ArrowRight") {
+ event.preventDefault();
+ pauseRenderPreview();
+ showRenderPreviewFrame(renderPreviewState.frameIndex + (event.key === "ArrowLeft" ? -1 : 1));
+ }
+ });
+
+ async function deleteJob(job, button) {
+ const jobId = String(job && (job.id || job.jobId) || "");
+ if (!jobId || !button || button.disabled) return;
+ button.disabled = true;
+ button.textContent = "Deleting...";
+ try {
+ await api(`/api/v1/jobs/${encodeURIComponent(jobId)}`, { method: "DELETE" });
+ knownJobStates.delete(jobId);
+ button.closest(".job-card")?.remove();
+ await refreshRecentJobs({ announceCompletions: false });
+ showToast("Render deleted");
+ } catch (error) {
+ button.disabled = false;
+ button.textContent = "Delete";
+ showToast(error.message || "Could not delete this render");
+ }
+ }
+
+ async function clearJobs() {
+ const button = document.getElementById("clearJobs");
+ if (button.disabled || !window.confirm("Delete all saved render history and files?")) return;
+ button.disabled = true;
+ button.textContent = "Clearing...";
+ try {
+ await api("/api/v1/jobs", { method: "DELETE" });
+ knownJobStates.clear();
+ await refreshRecentJobs({ announceCompletions: false });
+ showToast("Render history cleared");
+ } catch (error) {
+ showToast(error.message || "Could not clear render history");
+ } finally {
+ button.textContent = "Clear all";
+ button.disabled = false;
+ }
+ }
+
+ function createJobCard(job) {
+ const card = document.createElement("article");
+ card.className = "job-card";
+
+ const media = document.createElement("div");
+ media.className = "job-media";
+ const mediaButton = document.createElement("button");
+ mediaButton.type = "button";
+ mediaButton.className = "job-preview-trigger";
+ mediaButton.setAttribute("aria-label", `Preview ${displayJobName(job)}`);
+ mediaButton.onclick = () => openRenderPreview(job, mediaButton);
+ const thumbUrl = safeJobUrl(job.thumbUrl) || previewFrameUrl(job, 1);
+ let image = null;
+ if (thumbUrl) {
+ image = document.createElement("img");
+ image.src = thumbUrl;
+ image.alt = `${displayJobName(job)} preview`;
+ image.loading = "lazy";
+ mediaButton.appendChild(image);
+ } else {
+ const placeholder = document.createElement("span");
+ placeholder.className = "job-preview-placeholder";
+ placeholder.textContent = livePreviewUrl(job) ? "Open live preview" : "Preview unavailable";
+ mediaButton.appendChild(placeholder);
+ }
+ const play = document.createElement("span");
+ play.className = "job-play";
+ play.setAttribute("aria-hidden", "true");
+ const badge = document.createElement("span");
+ badge.className = "job-media-badge";
+ badge.textContent = Number(job.duration) > 0 ? `${Number(job.duration).toFixed(Number(job.duration) % 1 ? 1 : 0)} sec` : "Preview";
+ mediaButton.append(play, badge);
+ attachCardMotionPreview(mediaButton, image, job);
+ media.appendChild(mediaButton);
+
+ const main = document.createElement("div");
+ main.className = "job-body";
+ const heading = document.createElement("div");
+ heading.className = "job-heading";
+ const name = document.createElement("div");
+ name.className = "job-name";
+ name.textContent = displayJobName(job);
+ const time = document.createElement("div");
+ time.className = "job-time";
+ time.dataset.timestamp = String(job.finishedAt || job.startedAt || "");
+ time.textContent = formatJobTime(time.dataset.timestamp);
+ heading.append(name, time);
+ const specs = document.createElement("div");
+ specs.className = "job-specs";
+ specs.textContent = jobSpecification(job);
+ const description = document.createElement("p");
+ description.className = "job-description";
+ description.textContent = job.optimizedPrompt || job.prompt || job.originalPrompt || "Finished motion graphic ready to use.";
+ main.append(heading, specs, description);
+ const actions = document.createElement("div");
+ actions.className = "job-actions";
+ const preview = document.createElement("button");
+ preview.type = "button";
+ preview.className = "job-action-preview";
+ preview.textContent = "Final Cut";
+ preview.onclick = () => openRenderPreview(job, preview);
+ actions.appendChild(preview);
+ if (jobDownloadHref(job)) {
+ const download = document.createElement("a");
+ download.className = "job-action-download";
+ download.textContent = "Download";
+ download.href = jobDownloadHref(job);
+ download.download = job.mp4Name || "null-motion.mov";
+ actions.appendChild(download);
+ }
+ if (exactJobPrompt(job)) {
+ const prompt = document.createElement("button");
+ prompt.type = "button";
+ prompt.className = "job-action-prompt";
+ prompt.textContent = "Prompt";
+ prompt.onclick = () => openJobPrompt(job, prompt);
+ actions.appendChild(prompt);
+ }
+ const remove = document.createElement("button");
+ remove.type = "button";
+ remove.className = "job-delete";
+ remove.textContent = "×";
+ remove.title = "Delete render";
+ remove.setAttribute("aria-label", `Delete ${displayJobName(job)}`);
+ remove.onclick = () => deleteJob(job, remove);
+ actions.appendChild(remove);
+ main.appendChild(actions);
+ card.append(media, main);
+ return card;
+ }
+
+ function renderRecentJobs(jobs) {
+ const grid = document.getElementById("jobsGrid");
+ const recent = Array.isArray(jobs)
+ ? jobs.filter(job => jobStatusMeta(job).key === "done" && job.previewOnly !== true && Boolean(jobDownloadHref(job))).slice(0, 4)
+ : [];
+ jobCardPreviewStops.splice(0).forEach(stop => stop());
+ grid.replaceChildren();
+ if (!recent.length) {
+ const empty = document.createElement("div");
+ empty.className = "jobs-empty";
+ empty.textContent = "No final renders yet. Approved motion graphics will appear here automatically.";
+ grid.appendChild(empty);
+ } else {
+ recent.forEach(job => grid.appendChild(createJobCard(job)));
+ }
+ const hasSavedJobs = Array.isArray(jobs) && jobs.some(job => ["done", "error"].includes(jobStatusMeta(job).key));
+ document.getElementById("clearJobs").disabled = !hasSavedJobs;
+ }
+
+ async function refreshRecentJobs({ announceCompletions = true } = {}) {
+ if (jobsRefreshInFlight) return latestJobsPayload;
+ jobsRefreshInFlight = true;
+ const button = document.getElementById("refreshJobs");
+ button.classList.add("is-loading");
+ button.disabled = true;
+ try {
+ const payload = await api("/jobs");
+ const receivedAt = Date.now();
+ const rawJobs = Array.isArray(payload) ? payload : (payload.jobs || []);
+ const jobs = rawJobs.map(job => ({ ...job, _telemetryReceivedAt: receivedAt }));
+ if (jobsLoadedOnce && announceCompletions) {
+ jobs.forEach(job => {
+ const id = String(job.id || job.jobId || "");
+ const previous = knownJobStates.get(id);
+ const next = jobStatusMeta(job).key;
+ if (id && previous && previous !== next && ["done", "error"].includes(next)) announceJobTerminal(job, next);
+ });
+ }
+ jobs.forEach(job => knownJobStates.set(String(job.id || job.jobId || ""), jobStatusMeta(job).key));
+ latestJobsPayload = { jobs, queue: Array.isArray(payload) ? {} : (payload.queue || {}) };
+ renderGenerationQueue(jobs, latestJobsPayload.queue);
+ renderRecentJobs(jobs);
+ if (activeComposerJobId) {
+ const activeComposerJob = jobs.find(job => String(job.id || job.jobId || "") === activeComposerJobId);
+ if (activeComposerJob) updateActiveComposerJob(activeComposerJob);
+ }
+ jobsLoadedOnce = true;
+ return latestJobsPayload;
+ } catch (error) {
+ if (!jobsLoadedOnce) {
+ const empty = document.createElement("div");
+ empty.className = "jobs-empty";
+ empty.textContent = /401|403|pair|token|unauthorized/i.test(String(error.message || ""))
+ ? "Pair the local companion to view render history."
+ : "Start the local Null bridge to view render history.";
+ document.getElementById("jobsGrid").replaceChildren(empty);
+ document.getElementById("clearJobs").disabled = true;
+ }
+ } finally {
+ jobsRefreshInFlight = false;
+ button.classList.remove("is-loading");
+ button.disabled = false;
+ }
+ }
+
+ async function pairBridge() {
+ const code = window.prompt("Enter the pairing code shown by the local Null companion:");
+ if (!code) return;
+ try {
+ const response = await fetch(`${API}/api/v1/pair`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({ code: code.trim() })
+ });
+ const data = await response.json().catch(() => ({}));
+ if (!response.ok || !data.token) throw new Error(data.error || "Pairing failed");
+ localStorage.setItem(BRIDGE_TOKEN_KEY, data.token);
+ showToast("Null companion paired");
+ refreshBridgeStatus();
+ refreshRecentJobs({ announceCompletions: false });
+ } catch (error) {
+ showToast(error.message || "Could not pair the companion");
+ }
+ }
+
+ document.getElementById("pairBridge").onclick = pairBridge;
+ document.getElementById("refreshJobs").onclick = () => {
+ refreshBridgeStatus();
+ refreshRecentJobs({ announceCompletions: false });
+ };
+ document.getElementById("queueToggle").onclick = () => setQueuePanelOpen(document.getElementById("generationQueue").hidden);
+ document.getElementById("queueClose").onclick = () => setQueuePanelOpen(false);
+ document.getElementById("clearJobs").onclick = clearJobs;
+
+ function sourceUrls() {
+ return [];
+ }
+
+ async function optimizePromptText(text, images = attachedImages) {
+ const data = await api("/api/prompts/optimize", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ prompt: text,
+ images,
+ engine: backend,
+ generator: activeGenerator(),
+ themeId: activeTheme?.id || null,
+ sourceUrls: sourceUrls(),
+ designOptions: currentDesignOptions(),
+ outputSpec: { duration: selectedTemplate?.duration || 5, fps: selectedTemplate?.fps || 30, width: selectedTemplate?.w || 1080, height: selectedTemplate?.h || 1920 }
+ })
+ });
+ lastOptimization = data;
+ return data;
+ }
+
+ function setResultState(title, status, pct = 0, state = "working") {
+ const panel = document.getElementById("resultPanel");
+ panel.classList.add("show");
+ panel.classList.toggle("is-loading", state === "working" && pct < 100);
+ panel.classList.toggle("is-error", state === "error");
+ panel.classList.toggle("is-complete", state !== "error" && pct >= 100);
+ if (panel.classList.contains("is-loading")) document.getElementById("resultThumb").style.display = "none";
+ document.getElementById("resultTitle").textContent = title;
+ document.getElementById("resultStatus").textContent = status;
+ const progress = Math.max(0, Math.min(100, Number(pct) || 0));
+ document.getElementById("resultProgress").style.transform = `scaleX(${progress / 100})`;
+ document.getElementById("resultProgressTrack").setAttribute("aria-valuenow", String(Math.round(progress)));
+ }
+
+ function updateActiveComposerJob(job) {
+ if (!job || String(job.id || job.jobId || "") !== activeComposerJobId) return;
+ const status = jobStatusMeta(job).key;
+ if (status === "done") {
+ activeComposerJobId = null;
+ renderCompletedJob(job);
+ return;
+ }
+ if (["error", "cancelled"].includes(status)) {
+ activeComposerJobId = null;
+ setResultState(status === "cancelled" ? "Generation cancelled" : "Production render failed", job.error || "The job did not complete.", Number(job.pct) || 0, "error");
+ return;
+ }
+ const pct = Math.max(0, Math.min(99, Number(job.pct ?? job.progress) || 0));
+ setResultState(`Generating · ${queueStepLabel(job)}`, [stageProgressLabel(job), `${Math.round(pct)}%`, generationRemainingLabel(job)].filter(Boolean).join(" · "), pct);
+ }
+
+ function friendlyRenderError(error) {
+ const message = String(error && error.message || "The render could not be completed.");
+ if (error?.code === "BRIDGE_UNREACHABLE" || /failed to fetch|bridge stopped|process restart|interrupted/i.test(message)) {
+ return {
+ title: "Render interrupted",
+ status: "The local bridge restarted or disconnected. Your preview is safe - try the production render again."
+ };
+ }
+ return { title: "Production render failed", status: message };
+ }
+
+ function renderCompletedJob(job) {
+ const elapsedSeconds = currentJobElapsedSeconds(job);
+ setResultState("Final Cut ready", elapsedSeconds > 0
+ ? `Quality checked - transparent ProRes 4444 - ready in ${formatGenerationTime(elapsedSeconds)}`
+ : "Quality checked - transparent ProRes 4444", 100);
+ const thumb = document.getElementById("resultThumb");
+ if (job.thumbUrl) { thumb.src = job.thumbUrl; thumb.style.display = "block"; }
+ else thumb.style.display = "none";
+ const actions = document.getElementById("resultActions");
+ actions.innerHTML = "";
+ const download = document.createElement("a");
+ download.textContent = "Download";
+ download.href = jobDownloadHref(job);
+ download.download = job.mp4Name || "null-motion.mov";
+ const preview = document.createElement("button");
+ preview.type = "button"; preview.textContent = "Final Cut";
+ preview.onclick = () => openRenderPreview(job, preview);
+ const prompt = document.createElement("button");
+ prompt.textContent = "Prompt";
+ prompt.onclick = () => openJobPrompt(job, prompt);
+ actions.append(preview, download, prompt);
+ const id = String(job.id || job.jobId || "");
+ if (id) knownJobStates.set(id, "done");
+ showToast(id ? `Render #${id} is ready` : "Render complete");
+ refreshRecentJobs({ announceCompletions: false });
+ refreshBridgeStatus();
+ }
+
+ function renderInstantPreview(job, { productionInProgress = false } = {}) {
+ const authored = job.templateLocked === true && Boolean(job.templateId);
+ const certified = job.instantTemplate === true;
+ setResultState(productionInProgress && certified ? "Instant HQ preview ready" : productionInProgress ? "Preview ready" : "Motion preview", productionInProgress
+ ? "Rendering the downloadable MOV automatically"
+ : authored ? "Instant authored preview - no MOV was created" : "Free-form preview - no MOV was created", productionInProgress ? 55 : 100);
+ const actions = document.getElementById("resultActions");
+ actions.innerHTML = "";
+ const preview = document.createElement("button");
+ preview.type = "button";
+ preview.textContent = "Preview here";
+ preview.onclick = () => openRenderPreview(job, preview);
+ actions.appendChild(preview);
+ if (!productionInProgress) {
+ const render = document.createElement("button");
+ render.textContent = "Create MOV";
+ render.onclick = () => startProductionFromInstant(job, render);
+ actions.appendChild(render);
+ }
+ showToast(productionInProgress ? "Preview ready - finishing the MOV" : (authored ? `Authored ${job.templateId} preview is ready` : "Free-form motion preview is ready"));
+ openRenderPreview(job, preview);
+ }
+
+ function productionRequestFromInstant(job) {
+ const remembered = lastInstantProductionRequest
+ && String(lastInstantProductionRequest.prompt || "") === String(job.optimizedPrompt || job.prompt || "")
+ && String(lastInstantProductionRequest.templateId || "") === String(job.templateId || "")
+ ? lastInstantProductionRequest
+ : null;
+ const speedProfile = job.speedProfile || remembered?.speedProfile || (job.pipelineMode === "fast-hq" ? "fast" : "after-effects");
+ const profile = GENERATION_PROFILES[speedProfile] || GENERATION_PROFILES["after-effects"];
+ const pipelineMode = profile.pipelineMode;
+ return {
+ ...(remembered || {}),
+ prompt: job.optimizedPrompt || job.prompt || job.originalPrompt,
+ promptOptimized: Boolean(job.optimizedPrompt) || remembered?.promptOptimized === true,
+ pipelineMode,
+ speedProfile: profile.key,
+ generator: job.generator || remembered?.generator || activeGenerator(),
+ origin: "website",
+ priority: "high",
+ preset: job.preset || remembered?.preset || "Null Motion",
+ duration: Number(job.duration) || remembered?.duration || 5,
+ fps: Number(job.fps) || remembered?.fps || 30,
+ width: Number(job.width) || remembered?.width || 1080,
+ height: Number(job.height) || remembered?.height || 1920,
+ templateId: job.templateId || remembered?.templateId || null,
+ images: remembered?.images || attachedImages,
+ sourceUrls: remembered?.sourceUrls || sourceUrls(),
+ assetQueries: remembered?.assetQueries || job.assetResolution?.queries || [],
+ themeId: remembered?.themeId || job.theme?.id || null,
+ designOptions: job.designOptions || remembered?.designOptions || null,
+ assetResolutionMode: job.assetResolutionMode || remembered?.assetResolutionMode || "strict",
+ autoResearch: remembered?.autoResearch !== false,
+ quality: profile.quality,
+ renderMode: "production",
+ qualityReview: profile.qualityReview,
+ maxRepairPasses: profile.maxRepairPasses,
+ previewOnly: false
+ };
+ }
+
+ async function startProductionFromInstant(job, button) {
+ if (!job || button.disabled) return;
+ button.disabled = true;
+ button.textContent = "Starting render...";
+ try {
+ setResultState("Rendering production MOV", "Using the approved instant composition", 5);
+ const started = await api("/generate", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(productionRequestFromInstant(job))
+ });
+ closeRenderPreview();
+ await watchJob(started.jobId, false);
+ } catch (error) {
+ const friendly = friendlyRenderError(error);
+ setResultState(friendly.title, friendly.status, 0, "error");
+ showToast(friendly.status);
+ button.disabled = false;
+ button.textContent = "Retry production MOV";
+ }
+ }
+
+ async function watchJob(jobId, releaseOnPreview = false, quiet = false, recoveryAttempts = 0) {
+ for (;;) {
+ const job = await api(`/jobs/${jobId}`);
+ job._telemetryReceivedAt = Date.now();
+ if (job.status === "done" && job.previewOnly) { renderInstantPreview(job); return job; }
+ if (job.status === "done") { renderCompletedJob(job); return job; }
+ if (job.status === "interrupted" && job.previewOnly !== true && recoveryAttempts < 2) {
+ setResultState("Finishing production MOV", "The bridge reconnected - resuming automatically", Math.max(60, Number(job.pct) || 0));
+ const restarted = await api("/generate", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(productionRequestFromInstant(job))
+ });
+ refreshRecentJobs({ announceCompletions: false });
+ return watchJob(restarted.jobId, false, quiet, recoveryAttempts + 1);
+ }
+ if (["error", "interrupted", "cancelled"].includes(job.status)) throw new Error(job.error || (job.status === "interrupted" ? "The render was interrupted by a process restart." : "Generation failed"));
+ const previewReady = job.instantPreviewReady === true && (job.instantPreviewUrl || job.previewUrl);
+ if (releaseOnPreview && previewReady) {
+ renderInstantPreview(job, { productionInProgress: job.previewOnly !== true });
+ watchJob(jobId, false, true, recoveryAttempts).catch(error => {
+ const friendly = friendlyRenderError(error);
+ setResultState(friendly.title, friendly.status, 70, "error");
+ showToast(friendly.status);
+ });
+ return;
+ }
+ if (!quiet) setResultState(`Generating · ${queueStepLabel(job)}`, [stageProgressLabel(job), `${Math.round(Number(job.pct) || 0)}%`, generationRemainingLabel(job)].filter(Boolean).join(" · "), Number(job.pct) || 0);
+ await new Promise(resolve => setTimeout(resolve, 1000));
+ }
+ }
+
+ function clearComposerAfterSubmission() {
+ setPromptValue("");
+ attachedImages = [];
+ thumbs.replaceChildren();
+ tray.classList.remove("show");
+ activeSketchImage = null;
+ activeSketchJSON = null;
+ drawObjects = [];
+ drawLayoutButton.classList.remove("has-sketch");
+ drawLayoutButton.textContent = "Draw layout";
+ input.focus();
+ }
+
+ function promptDurationOverride(value) {
+ const matches = [...String(value || "").matchAll(/\b(\d+(?:\.\d+)?)\s*(?:[-–—]\s*)?(?:seconds?|secs?|s)\b/gi)]
+ .map(match => Number(match[1]))
+ .filter(Number.isFinite);
+ if (!matches.length) return null;
+ return Math.max(3, Math.min(12, Math.max(...matches)));
+ }
+
+ async function realGenerate() {
+ const value = input.value.trim();
+ if (!value && !attachedImages.length && !activeSketchImage) { input.focus(); showToast("Pick a template, type a prompt, paste an image, or draw a layout"); return; }
+ const button = document.querySelector(".go");
+ button.disabled = true; button.classList.add("is-busy"); button.textContent = "Preparing...";
+ document.getElementById("resultActions").innerHTML = "";
+ try {
+ if (backend === "remotion") {
+ setResultState("Directing motion", "Preparing a production prompt", 4);
+ const optimized = await optimizePromptText(value);
+ setPromptValue(optimized.optimizedPrompt);
+ await copyText(optimized.optimizedPrompt);
+ setResultState("Remotion prompt ready", "Copied to clipboard", 100);
+ showToast("High-quality Remotion prompt copied");
+ return;
+ }
+ ensureCompletionNotifications();
+ const generationProfile = selectedGenerationProfile();
+ const pipelineMode = generationProfile.pipelineMode;
+ let productionPrompt = value;
+ let promptOptimized = false;
+ let assetQueries = [];
+ setResultState("Adding to background queue", "Submitting the job to Null Motion", 4);
+ const activeTemplate = useImagination ? null : selectedTemplate;
+ const width = activeTemplate?.w || 1080;
+ const height = activeTemplate?.h || 1920;
+ const durationOverride = promptDurationOverride(productionPrompt);
+ const requestPayload = {
+ prompt: productionPrompt, promptOptimized, pipelineMode, speedProfile: generationProfile.key, generator: activeGenerator(), origin: useImagination ? "imagination" : "website", priority: "high",
+ preset: activeTemplate?.name || (useImagination ? "Use Imagination" : "Null Motion"), duration: durationOverride || (generationProfile.key === "instant" ? Math.min(3, activeTemplate?.duration || 3) : activeTemplate?.duration || 5), durationOverride, fps: ["mega", "instant"].includes(generationProfile.key) ? 24 : activeTemplate?.fps || 30, width, height,
+ templateId: activeTemplate?.id || null,
+ templateMode: useImagination ? "freeform" : "adaptive",
+ images: attachedImages, sourceUrls: sourceUrls(), assetQueries,
+ sketchImages: activeSketchImage ? [activeSketchImage] : [], sketchJSON: activeSketchJSON,
+ themeId: activeTheme?.id || null, designOptions: currentDesignOptions(),
+ assetResolutionMode: document.getElementById("assetModeSelect").value,
+ autoResearch: document.getElementById("assetModeSelect").value !== "none",
+ // Every production profile includes strict rendered-frame review.
+ // The Quick path saves time through capture strategy, not by skipping QA.
+ quality: generationProfile.quality, renderMode: "production", qualityReview: generationProfile.qualityReview, maxRepairPasses: generationProfile.maxRepairPasses,
+ previewOnly: false
+ };
+ lastInstantProductionRequest = requestPayload;
+ const started = await api("/generate", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(requestPayload)
+ });
+ const jobId = String(started.jobId || "");
+ if (!jobId) throw new Error("The companion did not return a generation job.");
+ activeComposerJobId = jobId;
+ knownJobStates.set(jobId, "queued");
+ const submittedLabel = value
+ ? (value.length > 58 ? `${value.slice(0, 55)}...` : value)
+ : (selectedTemplate?.name || "Motion graphic");
+ setResultState("Generating · Queued", `“${submittedLabel}” · 0% · queued 0s · ETA starts when work begins`, 0);
+ const queueButton = document.createElement("button");
+ queueButton.type = "button";
+ queueButton.textContent = "View queue";
+ queueButton.onclick = () => setQueuePanelOpen(true);
+ document.getElementById("resultActions").replaceChildren(queueButton);
+ showToast(`“${submittedLabel}” is in the background queue`);
+ clearComposerAfterSubmission();
+ setQueuePanelOpen(true);
+ activeBackgroundJobCount = Math.max(activeBackgroundJobCount, Number(started.backgroundJobCount) || 1);
+ scheduleJobsPoll(700);
+ refreshRecentJobs();
+ refreshBridgeStatus();
+ } catch (error) {
+ activeComposerJobId = null;
+ setResultState("Could not generate", error.message, 0, "error");
+ showToast(error.message);
+ } finally {
+ button.disabled = false; button.classList.remove("is-busy"); button.textContent = "Generate";
+ }
+ }
+
+ function composerBatchPayload(value, profile = null) {
+ const activeTemplate = useImagination ? null : selectedTemplate;
+ const width = activeTemplate?.w || 1080;
+ const height = activeTemplate?.h || 1920;
+ const payload = {
+ prompt: value,
+ generator: activeGenerator(),
+ origin: useImagination ? "imagination" : "website",
+ priority: "high",
+ preset: activeTemplate?.name || (useImagination ? "Use Imagination" : "Null Motion"),
+ duration: activeTemplate?.duration || 5,
+ fps: activeTemplate?.fps || 30,
+ width,
+ height,
+ templateId: activeTemplate?.id || null,
+ templateMode: useImagination ? "freeform" : "adaptive",
+ images: [...attachedImages],
+ sourceUrls: sourceUrls(),
+ themeId: activeTheme?.id || null,
+ designOptions: currentDesignOptions(),
+ sketchImages: activeSketchImage ? [activeSketchImage] : [],
+ sketchJSON: activeSketchJSON,
+ assetResolutionMode: document.getElementById("assetModeSelect").value,
+ autoResearch: document.getElementById("assetModeSelect").value !== "none"
+ };
+ if (profile) Object.assign(payload, {
+ pipelineMode: profile.pipelineMode,
+ speedProfile: profile.key,
+ quality: profile.quality,
+ qualityReview: profile.qualityReview,
+ maxRepairPasses: profile.maxRepairPasses
+ });
+ return payload;
+ }
+
+ function composerHasBatchInput() {
+ return Boolean(input.value.trim() || attachedImages.length || activeSketchImage);
+ }
+
+ function setVariantProfile(profileKey) {
+ selectedVariantProfileKey = GENERATION_PROFILES[profileKey] ? profileKey : "instant";
+ document.querySelectorAll("#variantProfileGrid .variant-profile").forEach(button => {
+ const selected = button.dataset.profile === selectedVariantProfileKey;
+ button.classList.toggle("selected", selected);
+ button.setAttribute("aria-checked", selected ? "true" : "false");
+ });
+ const profile = GENERATION_PROFILES[selectedVariantProfileKey];
+ document.getElementById("variantModeSummary").textContent = `3 × ${profile.label} · ${generationEstimateRange(profile)} each · generated in parallel`;
+ }
+
+ function openVariantModePicker() {
+ if (!composerHasBatchInput()) { input.focus(); showToast("Type a brief, paste an image, or draw a layout first"); return; }
+ selectedVariantProfileKey = selectedGenerationProfile().key;
+ setVariantProfile(selectedVariantProfileKey);
+ const brief = input.value.trim() || selectedTemplate?.name || "Attached visual brief";
+ document.getElementById("variantModePrompt").textContent = brief;
+ const modal = document.getElementById("variantModeModal");
+ modal.classList.add("show");
+ modal.setAttribute("aria-hidden", "false");
+ document.body.classList.add("batch-screen-open");
+ document.getElementById("variantModeCreate").focus();
+ }
+
+ function closeVariantModePicker() {
+ const modal = document.getElementById("variantModeModal");
+ modal.classList.remove("show");
+ modal.setAttribute("aria-hidden", "true");
+ if (!document.getElementById("qualitySweepScreen").classList.contains("show")) document.body.classList.remove("batch-screen-open");
+ }
+
+ document.querySelectorAll("#variantProfileGrid .variant-profile").forEach(button => {
+ button.addEventListener("click", () => setVariantProfile(button.dataset.profile));
+ });
+ document.getElementById("variantModeClose").onclick = closeVariantModePicker;
+ document.getElementById("variantModeModal").addEventListener("click", event => {
+ if (event.target.id === "variantModeModal") closeVariantModePicker();
+ });
+
+ function openVariationPicker() {
+ const picker = document.getElementById("variationPicker");
+ picker.classList.add("show");
+ picker.setAttribute("aria-hidden", "false");
+ document.body.classList.add("variation-picker-open");
+ document.getElementById("variationPickerClose").focus();
+ }
+
+ function closeVariationPicker() {
+ const picker = document.getElementById("variationPicker");
+ picker.classList.remove("show");
+ picker.setAttribute("aria-hidden", "true");
+ document.body.classList.remove("variation-picker-open");
+ }
+
+ function variationStatusLabel(job) {
+ if (!job) return "Queued";
+ if (job.status === "done") return "Ready";
+ if (["error", "cancelled", "interrupted"].includes(job.status)) return "Failed";
+ return queueStepLabel(job);
+ }
+
+ function selectVariation(jobId) {
+ selectedVariationJobId = String(jobId || "") || null;
+ if (activeVariationBatch) renderVariationPicker(activeVariationBatch);
+ }
+
+ function renderVariationPicker(batch) {
+ activeVariationBatch = batch;
+ const items = Array.isArray(batch?.items) ? batch.items : [];
+ const bestId = String(batch?.best?.id || batch?.best?.jobId || "");
+ if (!selectedVariationJobId || !items.some(item => String(item.jobId) === selectedVariationJobId)) {
+ selectedVariationJobId = bestId || String(items.find(item => item.job?.status === "done")?.jobId || items[0]?.jobId || "") || null;
+ }
+ const grid = document.getElementById("variationGrid");
+ grid.innerHTML = "";
+ items.forEach((item, index) => {
+ const job = item.job || { id: item.jobId, jobId: item.jobId, status: "pending", pct: 0 };
+ const jobId = String(item.jobId || job.id || job.jobId || "");
+ const card = document.createElement("article");
+ card.className = `variation-card${jobId === selectedVariationJobId ? " selected" : ""}`;
+ card.tabIndex = 0;
+ card.setAttribute("role", "radio");
+ card.setAttribute("aria-checked", jobId === selectedVariationJobId ? "true" : "false");
+ card.onclick = event => { if (!event.target.closest("button,a")) selectVariation(jobId); };
+ card.onkeydown = event => { if (event.key === "Enter" || event.key === " ") { event.preventDefault(); selectVariation(jobId); } };
+
+ const media = document.createElement("div");
+ media.className = "variation-card-media";
+ if (job.thumbUrl) {
+ const image = document.createElement("img");
+ image.src = job.thumbUrl;
+ image.alt = `${item.name || `Direction ${index + 1}`} preview frame`;
+ media.appendChild(image);
+ } else {
+ const placeholder = document.createElement("span");
+ placeholder.className = "variation-card-placeholder";
+ placeholder.textContent = job.status === "error" ? (job.error || "Generation failed") : `${Math.round(Number(job.pct) || 0)}%`;
+ media.appendChild(placeholder);
+ }
+ const status = document.createElement("span");
+ status.className = "variation-card-status";
+ status.textContent = `${variationStatusLabel(job)}${jobId && jobId === bestId ? " · best" : ""}`;
+ media.appendChild(status);
+
+ const body = document.createElement("div");
+ body.className = "variation-card-body";
+ const title = document.createElement("div");
+ title.className = "variation-card-title";
+ const heading = document.createElement("h4");
+ heading.textContent = item.name || `Direction ${index + 1}`;
+ const check = document.createElement("span");
+ check.className = "variation-check";
+ check.textContent = "✓";
+ title.append(heading, check);
+ const description = document.createElement("p");
+ description.className = "variation-card-description";
+ description.textContent = item.description || "Independent motion direction";
+ const actions = document.createElement("div");
+ actions.className = "variation-card-actions";
+ const preview = document.createElement("button");
+ preview.type = "button";
+ preview.textContent = "Preview";
+ preview.disabled = !["done", "completed"].includes(String(job.status || "").toLowerCase());
+ preview.onclick = () => { selectVariation(jobId); openRenderPreview(job, preview); };
+ actions.appendChild(preview);
+ if (job.status === "done") {
+ const download = document.createElement("a");
+ download.textContent = "Download";
+ download.href = jobDownloadHref(job);
+ download.download = job.mp4Name || "null-motion.mov";
+ actions.appendChild(download);
+ }
+ body.append(title, description, actions);
+ card.append(media, body);
+ grid.appendChild(card);
+ });
+
+ const jobs = items.map(item => item.job).filter(Boolean);
+ const done = jobs.filter(job => job.status === "done").length;
+ const failed = jobs.filter(job => ["error", "cancelled"].includes(job.status)).length;
+ const average = jobs.reduce((sum, job) => sum + (Number(job.pct) || 0), 0) / Math.max(1, items.length);
+ document.getElementById("variationPickerProgress").style.transform = `scaleX(${Math.max(0, Math.min(100, average)) / 100})`;
+ document.getElementById("variationPickerProgressTrack").setAttribute("aria-valuenow", String(Math.round(Math.max(0, Math.min(100, average)))));
+ document.getElementById("variationPickerSubtitle").textContent = batch.complete
+ ? "Preview each finished animation, select the strongest direction, and download that exact MOV."
+ : "Three independent animations are generating in parallel. Finished options can be previewed immediately.";
+ document.getElementById("variationPickerStatus").textContent = batch.complete
+ ? `${done} ready${failed ? ` · ${failed} failed` : ""} · select one to download`
+ : `${done} of ${items.length || 3} ready${failed ? ` · ${failed} failed` : ""}`;
+ const selected = items.find(item => String(item.jobId) === selectedVariationJobId)?.job;
+ const selectedDownload = document.getElementById("variationPickerDownload");
+ if (selected?.status === "done") {
+ selectedDownload.href = jobDownloadHref(selected);
+ selectedDownload.download = selected.mp4Name || "null-motion.mov";
+ selectedDownload.setAttribute("aria-disabled", "false");
+ } else {
+ selectedDownload.href = "#";
+ selectedDownload.removeAttribute("download");
+ selectedDownload.setAttribute("aria-disabled", "true");
+ }
+ }
+
+ document.getElementById("variationPickerClose").onclick = closeVariationPicker;
+ document.getElementById("variationPicker").addEventListener("click", event => { if (event.target.id === "variationPicker") closeVariationPicker(); });
+
+ async function generateVariations(profileKey = selectedVariantProfileKey) {
+ const value = input.value.trim() || selectedTemplate?.prompt || "Create a motion graphic from the attached visual reference.";
+ if (!value && !attachedImages.length && !activeSketchImage) { input.focus(); showToast("Type a brief, paste an image, or draw a layout first"); return; }
+ const generationProfile = GENERATION_PROFILES[profileKey] || GENERATION_PROFILES.balanced;
+ const button = document.getElementById("variationsBtn");
+ closeVariantModePicker();
+ button.disabled = true; button.classList.add("is-busy"); button.textContent = "Starting 3...";
+ document.getElementById("resultActions").innerHTML = "";
+ selectedVariationJobId = null;
+ activeVariationBatch = { items: [], complete: false };
+ renderVariationPicker(activeVariationBatch);
+ openVariationPicker();
+ try {
+ const started = await api("/api/demo-factory", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ ...composerBatchPayload(value, generationProfile),
+ count: 3,
+ preset: selectedTemplate?.name || "Null Variant Factory"
+ })
+ });
+ refreshRecentJobs({ announceCompletions: false });
+ refreshBridgeStatus();
+ for (;;) {
+ const batch = await api(`/api/demo-factory/${started.batchId}`);
+ renderVariationPicker(batch);
+ const done = batch.variations.filter(job => job.status === "done").length;
+ const failed = batch.variations.filter(job => job.status === "error").length;
+ const average = batch.variations.reduce((sum, job) => sum + (Number(job.pct) || 0), 0) / Math.max(1, batch.variations.length);
+ setResultState(`Generating 3 · ${generationProfile.label}`, `${done} complete${failed ? `, ${failed} failed` : ""} · preview finished options now`, average);
+ if (batch.complete) {
+ const best = batch.best;
+ if (!best) throw new Error("All demo variations failed.");
+ setResultState("3 variations ready", "Choose and download your preferred motion direction", 100);
+ const actions = document.getElementById("resultActions");
+ actions.innerHTML = "";
+ const review = document.createElement("button");
+ review.type = "button";
+ review.textContent = "Review options";
+ review.onclick = openVariationPicker;
+ actions.appendChild(review);
+ showToast("Three motion directions are ready to compare");
+ break;
+ }
+ await new Promise(resolve => setTimeout(resolve, 1800));
+ }
+ } catch (error) {
+ setResultState("Variation factory failed", error.message, 0, "error");
+ showToast(error.message);
+ } finally {
+ button.disabled = false; button.classList.remove("is-busy"); button.textContent = "3 variants";
+ }
+ }
+
+ function qualitySweepItemForMode(batch, mode) {
+ return (Array.isArray(batch?.items) ? batch.items : []).find(item => item.id === mode.key || item.key === mode.key || item.job?.speedProfile === mode.key) || null;
+ }
+
+ function qualitySweepTimingLabel(job, profile) {
+ if (!job) return `${generationEstimateRange(profile)} estimate`;
+ const elapsed = formatGenerationTime(currentJobElapsedSeconds(job));
+ const status = String(job.status || "").toLowerCase();
+ if (["done", "completed"].includes(status)) return `rendered in ${elapsed}`;
+ if (isTerminalJobStatus(job)) return `stopped after ${elapsed}`;
+ return generationRemainingLabel(job);
+ }
+
+ function renderQualitySweep(batch = activeQualitySweepBatch) {
+ const grid = document.getElementById("qualitySweepGrid");
+ grid.replaceChildren();
+ const jobsForSweep = [];
+ QUALITY_SWEEP_MODES.forEach((mode, index) => {
+ const profile = GENERATION_PROFILES[mode.key];
+ const item = qualitySweepItemForMode(batch, mode);
+ const job = item?.job || null;
+ if (job) jobsForSweep.push(job);
+ const card = document.createElement("article");
+ card.className = "quality-run-card";
+
+ const media = document.createElement("div");
+ media.className = "quality-run-media";
+ if (job?.thumbUrl) {
+ const image = document.createElement("img");
+ image.src = job.thumbUrl;
+ image.alt = `${mode.label} preview frame`;
+ media.appendChild(image);
+ } else {
+ const placeholder = document.createElement("span");
+ placeholder.className = "quality-run-placeholder";
+ placeholder.textContent = job ? `${Math.round(Number(job.pct) || 0)}%` : "Ready";
+ media.appendChild(placeholder);
+ }
+ const status = document.createElement("span");
+ status.className = "quality-run-status";
+ status.textContent = job ? variationStatusLabel(job) : "Not started";
+ media.appendChild(status);
+
+ const body = document.createElement("div");
+ body.className = "quality-run-body";
+ const number = document.createElement("span");
+ number.className = "quality-run-index";
+ number.textContent = `0${index + 1} / 05`;
+ const heading = document.createElement("h4");
+ heading.textContent = mode.label;
+ const description = document.createElement("p");
+ description.textContent = mode.description;
+ const estimate = document.createElement("div");
+ estimate.className = "quality-run-estimate";
+ estimate.textContent = qualitySweepTimingLabel(job, profile);
+ const live = document.createElement("div");
+ live.className = "quality-run-live";
+ const liveHead = document.createElement("div");
+ liveHead.className = "quality-run-live-head";
+ const liveStage = document.createElement("span");
+ liveStage.textContent = job ? queueStepLabel(job) : "Not started";
+ const livePercent = document.createElement("strong");
+ const pct = Math.max(0, Math.min(100, Number(job?.pct ?? job?.progress) || 0));
+ livePercent.textContent = `${Math.round(pct)}%`;
+ liveHead.append(liveStage, livePercent);
+ const liveProgress = document.createElement("div");
+ liveProgress.className = "quality-run-progress";
+ liveProgress.setAttribute("role", "progressbar");
+ liveProgress.setAttribute("aria-label", `${mode.label} progress`);
+ liveProgress.setAttribute("aria-valuemin", "0");
+ liveProgress.setAttribute("aria-valuemax", "100");
+ liveProgress.setAttribute("aria-valuenow", String(Math.round(pct)));
+ const liveProgressBar = document.createElement("span");
+ liveProgressBar.style.transform = `scaleX(${pct / 100})`;
+ liveProgress.appendChild(liveProgressBar);
+ live.append(liveHead, liveProgress);
+ const actions = document.createElement("div");
+ actions.className = "quality-run-actions";
+ const preview = document.createElement("button");
+ preview.type = "button";
+ preview.textContent = "Preview";
+ preview.disabled = !(job && ["done", "completed"].includes(String(job.status || "").toLowerCase()));
+ preview.onclick = () => openRenderPreview(job, preview);
+ actions.appendChild(preview);
+ if (job?.status === "done") {
+ const download = document.createElement("a");
+ download.textContent = "Download";
+ download.href = jobDownloadHref(job);
+ download.download = job.mp4Name || `null-motion-${mode.key}.mov`;
+ actions.appendChild(download);
+ }
+ body.append(number, heading, description, estimate, live, actions);
+ card.append(media, body);
+ grid.appendChild(card);
+ });
+
+ const completeCount = jobsForSweep.filter(job => ["done", "completed"].includes(String(job.status).toLowerCase())).length;
+ const failedCount = jobsForSweep.filter(job => ["error", "failed", "cancelled", "interrupted"].includes(String(job.status).toLowerCase())).length;
+ const runningCount = jobsForSweep.filter(job => !isTerminalJobStatus(job) && !isQueuedJobStatus(job)).length;
+ const queuedCount = jobsForSweep.filter(job => isQueuedJobStatus(job)).length;
+ const average = jobsForSweep.reduce((sum, job) => sum + (Number(job.pct) || 0), 0) / Math.max(1, QUALITY_SWEEP_MODES.length);
+ document.getElementById("qualitySweepProgress").style.transform = `scaleX(${Math.max(0, Math.min(100, average)) / 100})`;
+ document.getElementById("qualitySweepProgressTrack").setAttribute("aria-valuenow", String(Math.round(Math.max(0, Math.min(100, average)))));
+ document.getElementById("qualitySweepStatus").textContent = batch?.complete
+ ? `${completeCount} ready${failedCount ? ` · ${failedCount} failed` : ""} · ${Math.round(average)}% complete`
+ : jobsForSweep.length
+ ? `${completeCount} ready · ${runningCount} running · ${queuedCount} queued${failedCount ? ` · ${failedCount} failed` : ""} · ${Math.round(average)}% overall`
+ : "Ready to create five renders";
+ }
+
+ function openQualitySweepScreen() {
+ if (!composerHasBatchInput()) { input.focus(); showToast("Type a brief, paste an image, or draw a layout first"); return; }
+ const value = input.value.trim() || selectedTemplate?.prompt || "Create a motion graphic from the attached visual reference.";
+ if (!qualitySweepRunning) {
+ const nextDraft = composerBatchPayload(value);
+ if (!qualitySweepDraft || qualitySweepDraft.prompt !== nextDraft.prompt) activeQualitySweepBatch = null;
+ qualitySweepDraft = nextDraft;
+ }
+ document.getElementById("qualitySweepPrompt").textContent = value;
+ renderQualitySweep(activeQualitySweepBatch);
+ const screen = document.getElementById("qualitySweepScreen");
+ screen.classList.add("show");
+ screen.setAttribute("aria-hidden", "false");
+ document.body.classList.add("batch-screen-open");
+ document.getElementById("qualitySweepCreate").focus();
+ }
+
+ function closeQualitySweepScreen() {
+ const screen = document.getElementById("qualitySweepScreen");
+ screen.classList.remove("show");
+ screen.setAttribute("aria-hidden", "true");
+ if (!document.getElementById("variantModeModal").classList.contains("show")) document.body.classList.remove("batch-screen-open");
+ document.getElementById("qualitySweepBtn").focus();
+ }
+
+ async function startQualitySweep() {
+ if (qualitySweepRunning) return;
+ if (!qualitySweepDraft) openQualitySweepScreen();
+ if (!qualitySweepDraft) return;
+ qualitySweepRunning = true;
+ const create = document.getElementById("qualitySweepCreate");
+ create.disabled = true;
+ create.textContent = "Starting 5 renders...";
+ try {
+ const started = await api("/api/quality-sweep", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify(qualitySweepDraft)
+ });
+ activeQualitySweepBatch = {
+ id: started.batchId,
+ complete: false,
+ items: (started.profiles || QUALITY_SWEEP_MODES).map((profile, index) => ({ ...profile, jobId: started.jobIds?.[index], job: { id: started.jobIds?.[index], status: "pending", pct: 0 } }))
+ };
+ renderQualitySweep(activeQualitySweepBatch);
+ refreshRecentJobs({ announceCompletions: false });
+ refreshBridgeStatus();
+ for (;;) {
+ const batch = await api(`/api/quality-sweep/${started.batchId}`);
+ activeQualitySweepBatch = batch;
+ renderQualitySweep(batch);
+ refreshRecentJobs({ announceCompletions: false });
+ if (batch.complete) {
+ const ready = batch.items.filter(item => item.job?.status === "done").length;
+ showToast(`${ready} quality-sweep render${ready === 1 ? " is" : "s are"} ready`);
+ break;
+ }
+ await new Promise(resolve => setTimeout(resolve, 1800));
+ }
+ } catch (error) {
+ document.getElementById("qualitySweepStatus").textContent = error.message;
+ showToast(error.message);
+ } finally {
+ qualitySweepRunning = false;
+ create.disabled = false;
+ create.textContent = activeQualitySweepBatch?.complete ? "Run all 5 again" : "Create all 5 videos";
+ }
+ }
+
+ document.querySelector(".go").onclick = realGenerate;
+ document.getElementById("variationsBtn").onclick = openVariantModePicker;
+ document.getElementById("variantModeCreate").onclick = () => generateVariations(selectedVariantProfileKey);
+ document.getElementById("qualitySweepBtn").onclick = openQualitySweepScreen;
+ document.getElementById("qualitySweepClose").onclick = closeQualitySweepScreen;
+ document.getElementById("qualitySweepCreate").onclick = startQualitySweep;
+ window.addEventListener("keydown", event => {
+ if (event.key !== "Escape") return;
+ if (document.getElementById("variantModeModal").classList.contains("show")) closeVariantModePicker();
+ else if (document.getElementById("qualitySweepScreen").classList.contains("show")) closeQualitySweepScreen();
+ });
+
+ function currentDesignOptions() {
+ return null;
+ }
+
+ function productionTemplatePrompt(t) {
+ const width = Number(t?.w || t?.width) || 1920;
+ const height = Number(t?.h || t?.height) || 1080;
+ const fps = Number(t?.fps) || 30;
+ const duration = Number(t?.duration) || 5;
+ return `${t.prompt}\n\nUse the authored ${t.name} template as a locked composition. Change only its exposed copy, approved assets, colors, and timing slots; do not redesign the structure or add decorative layers. Deliver ${width}x${height}, ${fps}fps, ${duration} seconds, with a transparent full-frame background.`;
+ }
+
+ function templatePreviewUrl(t) {
+ return t?.preview?.playerPath || `${t.dir}/index.html#play`;
+ }
+ function templateSourceUrl(t) {
+ return `${API}/api/v1/templates/${encodeURIComponent(t?.id || "")}/source`;
+ }
+ function useTemplate(t) {
+ setUseImagination(false);
+ selectedTemplate = t;
+ setPromptValue(productionTemplatePrompt(t));
+ input.focus();
+ window.scrollTo({ top: 0, behavior: "smooth" });
+ showToast(`“${t.name}” loaded into your ${backend === "remotion" ? "Remotion" : "HyperFrames"} prompt`);
+ }
+
+ // toast
+ const toastEl = document.getElementById("toast"); let toastTimer;
+ function showToast(msg) { toastEl.textContent = msg; toastEl.classList.add("show"); clearTimeout(toastTimer); toastTimer = setTimeout(() => toastEl.classList.remove("show"), 2600); }
+
+ // ---- Copy the prompt (robust: works on file:// where navigator.clipboard is blocked) ----
+ async function copyText(text) {
+ try {
+ if (navigator.clipboard && window.isSecureContext) { await navigator.clipboard.writeText(text); return true; }
+ } catch (e) { /* fall through */ }
+ try {
+ const ta = document.createElement("textarea");
+ ta.value = text; ta.style.position = "fixed"; ta.style.opacity = "0"; ta.style.top = "0";
+ document.body.appendChild(ta); ta.focus(); ta.select();
+ const ok = document.execCommand("copy"); ta.remove(); return ok;
+ } catch (e) { return false; }
+ }
+ function copyPrompt(t) {
+ copyText(t.prompt).then(ok => showToast(ok ? `“${t.name}” prompt copied — paste it anywhere` : "Couldn’t copy — select the text in the prompt view"));
+ }
+
+ async function copyProductionPrompt(t) {
+ showToast(`Enhancing ${t.name} prompt...`);
+ try {
+ const data = await optimizePromptText(productionTemplatePrompt(t), []);
+ const ok = await copyText(data.optimizedPrompt);
+ showToast(ok ? `${t.name} production prompt copied` : "Could not copy the enhanced prompt");
+ } catch (error) {
+ const ok = await copyText(productionTemplatePrompt(t));
+ showToast(ok ? `Bridge unavailable - original ${t.name} prompt copied` : error.message);
+ }
+ }
+
+ // ---- Prompt modal ----
+ const modal = document.getElementById("modal");
+ const modalFrame = document.getElementById("modalFrame");
+ const modalPreview = document.getElementById("modalPreview");
+ let modalT = null;
+ function fitModal() {
+ const p = modalPreview, w = +p.dataset.w, h = +p.dataset.h, cw = p.clientWidth;
+ if (!cw) return;
+ p.style.height = (cw * h / w) + "px";
+ modalFrame.style.width = w + "px"; modalFrame.style.height = h + "px";
+ modalFrame.style.transform = `scale(${cw / w})`;
+ }
+ function openModal(t) {
+ modalT = t;
+ document.getElementById("modalTitle").textContent = t.name;
+ document.getElementById("modalSub").textContent = `${t.use} · ${t.tag}`;
+ document.getElementById("modalPrompt").textContent = t.prompt;
+ const download = document.getElementById("modalDownload");
+ download.href = templateSourceUrl(t);
+ download.download = `${t.id}.html`;
+ modalPreview.dataset.w = t.w; modalPreview.dataset.h = t.h;
+ modalFrame.src = templatePreviewUrl(t);
+ modal.classList.add("show");
+ requestAnimationFrame(fitModal);
+ }
+ function closeModal() { modal.classList.remove("show"); modalFrame.src = ""; modalT = null; }
+ document.getElementById("modalX").onclick = closeModal;
+ document.getElementById("modalCopy").onclick = () => modalT && copyProductionPrompt(modalT);
+ document.getElementById("modalUse").onclick = () => { if (modalT) { useTemplate(modalT); closeModal(); } };
+ modal.addEventListener("click", e => { if (e.target === modal) closeModal(); });
+ window.addEventListener("keydown", e => { if (e.key === "Escape") { closeModal(); closeTemplateManager(); } });
+ window.addEventListener("resize", () => { if (modal.classList.contains("show")) fitModal(); });
+
+ function updateThemeIndicator() {
+ document.getElementById("themeLabel").textContent = activeTheme ? activeTheme.name : "No theme";
+ document.getElementById("themeDot").style.background = activeTheme?.colors?.primary || "#4F7CFF";
+ }
+
+ function fillThemeForm(theme) {
+ const colors = theme?.colors || {};
+ document.getElementById("themeName").value = theme?.name || "";
+ document.getElementById("themeStyle").value = theme?.aestheticStyle || "Premium editorial motion";
+ document.getElementById("themeDescription").value = theme?.description || "";
+ document.getElementById("themeFont").value = theme?.fontFamily || "Inter, sans-serif";
+ document.getElementById("themeCurve").value = theme?.motionCurve || "cubic-bezier(0.16, 1, 0.3, 1)";
+ document.getElementById("colorPrimary").value = colors.primary || "#4F7CFF";
+ document.getElementById("colorSecondary").value = colors.secondary || "#151822";
+ document.getElementById("colorAccent").value = colors.accent || "#8BA6FF";
+ document.getElementById("colorBackground").value = colors.background || "#08090D";
+ document.getElementById("colorText").value = colors.text || "#F4F5F7";
+ }
+
+ function renderThemeSelect() {
+ const select = document.getElementById("themeSelect");
+ select.innerHTML = '<option value="">New theme</option>';
+ savedThemes.forEach(theme => {
+ const option = document.createElement("option");
+ option.value = theme.id; option.textContent = theme.name;
+ select.appendChild(option);
+ });
+ select.value = activeTheme?.id || "";
+ }
+
+ async function loadThemes() {
+ try {
+ const data = await api("/api/themes");
+ savedThemes = data.themes || [];
+ activeTheme = data.activeTheme || null;
+ renderThemeSelect(); updateThemeIndicator();
+ } catch (_) { updateThemeIndicator(); }
+ }
+
+ function openThemeModal() {
+ renderThemeSelect(); fillThemeForm(activeTheme);
+ document.getElementById("themeModal").classList.add("show");
+ }
+
+ function closeThemeModal() { document.getElementById("themeModal").classList.remove("show"); }
+
+ document.getElementById("themeBtn").onclick = openThemeModal;
+ document.getElementById("imaginationToggle").onclick = () => {
+ if (!useImagination && selectedTemplate) {
+ const templatePrompt = productionTemplatePrompt(selectedTemplate);
+ if (input.value.trim() === templatePrompt.trim()) setPromptValue(selectedTemplate.prompt || "");
+ selectedTemplate = null;
+ }
+ setUseImagination(!useImagination);
+ };
+ document.getElementById("themeX").onclick = closeThemeModal;
+ document.getElementById("themeModal").addEventListener("click", event => { if (event.target.id === "themeModal") closeThemeModal(); });
+ document.getElementById("themeSelect").onchange = async event => {
+ const theme = savedThemes.find(item => item.id === event.target.value) || null;
+ if (!theme) { fillThemeForm(null); return; }
+ try {
+ const data = await api(`/api/themes/${theme.id}/activate`, { method: "PUT" });
+ activeTheme = data.theme; savedThemes = data.themes || savedThemes;
+ fillThemeForm(activeTheme); updateThemeIndicator();
+ } catch (error) { showToast(error.message); }
+ };
+ document.getElementById("themeSave").onclick = async () => {
+ const selectedId = document.getElementById("themeSelect").value;
+ const payload = {
+ id: selectedId || undefined, active: true,
+ name: document.getElementById("themeName").value,
+ aestheticStyle: document.getElementById("themeStyle").value,
+ description: document.getElementById("themeDescription").value,
+ fontFamily: document.getElementById("themeFont").value,
+ motionCurve: document.getElementById("themeCurve").value,
+ colors: {
+ primary: document.getElementById("colorPrimary").value,
+ secondary: document.getElementById("colorSecondary").value,
+ accent: document.getElementById("colorAccent").value,
+ background: document.getElementById("colorBackground").value,
+ text: document.getElementById("colorText").value
+ }
+ };
+ if (!payload.name.trim()) { showToast("Give the theme a name"); return; }
+ try {
+ const data = await api("/api/themes", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(payload) });
+ activeTheme = data.theme; savedThemes = data.themes || [];
+ updateThemeIndicator(); closeThemeModal(); showToast(`${activeTheme.name} is now active`);
+ } catch (error) { showToast(error.message); }
+ };
+ document.getElementById("themeDelete").onclick = async () => {
+ const id = document.getElementById("themeSelect").value;
+ if (!id) { fillThemeForm(null); return; }
+ try {
+ const data = await api(`/api/themes/${id}`, { method: "DELETE" });
+ savedThemes = data.themes || []; activeTheme = data.activeTheme || null;
+ renderThemeSelect(); fillThemeForm(activeTheme); updateThemeIndicator();
+ } catch (error) { showToast(error.message); }
+ };
+ loadThemes();
+
+ function addReferenceDataUrl(value) {
+ const dataUrl = String(value || "");
+ if (!/^data:image\/(?:png|jpe?g|webp);base64,/i.test(dataUrl)) return false;
+ if (attachedImages.length >= 6) { showToast("Up to 6 reference images are supported"); return false; }
+ if (dataUrl.length > 16 * 1024 * 1024) { showToast("That screenshot is too large for a reference image"); return false; }
+ attachedImages.push(dataUrl);
+ const t = document.createElement("div"); t.className = "thumb";
+ const image = document.createElement("img"); image.src = dataUrl; image.alt = "Reference image";
+ const remove = document.createElement("div"); remove.className = "x"; remove.textContent = "x";
+ remove.onclick = () => {
+ attachedImages = attachedImages.filter(item => item !== dataUrl);
+ t.remove(); if (!thumbs.children.length) tray.classList.remove("show");
+ };
+ t.append(image, remove); thumbs.appendChild(t); tray.classList.add("show");
+ return true;
+ }
+
+ function addReferenceImage(file) {
+ if (!file || !file.type.startsWith("image/")) return;
+ const reader = new FileReader();
+ reader.onload = () => addReferenceDataUrl(reader.result);
+ reader.readAsDataURL(file);
+ }
+
+ // ---- Photo tray: pasted/dropped files become real base64 vision inputs ----
+ const tray = document.getElementById("tray");
+ const thumbs = document.getElementById("thumbs");
+ const promptBox = document.getElementById("prompt");
+ window.addEventListener("paste", e => {
+ const items = [...(e.clipboardData?.items || [])].filter(i => i.type.startsWith("image/"));
+ if (!items.length) return;
+ items.forEach(i => addReferenceImage(i.getAsFile()));
+ });
+ // drag-drop also feeds the tray
+ ["dragover","dragenter"].forEach(ev => promptBox.addEventListener(ev, e => { e.preventDefault(); promptBox.classList.add("drag"); }));
+ ["dragleave","drop"].forEach(ev => promptBox.addEventListener(ev, e => { e.preventDefault(); promptBox.classList.remove("drag"); }));
+ promptBox.addEventListener("drop", e => { [...(e.dataTransfer?.files||[])].filter(f=>f.type.startsWith("image/")).forEach(addReferenceImage); });
+ const acceptedNullQuickCaptures = new Set();
+ function acknowledgeNullQuickCapture(id) {
+ window.postMessage({ source: "null-quick", type: "accepted", id }, location.origin);
+ const url = new URL(location.href);
+ if (url.searchParams.has("nullQuick")) {
+ url.searchParams.delete("nullQuick");
+ history.replaceState(null, "", url.pathname + url.search + url.hash);
+ }
+ }
+ window.addEventListener("message", event => {
+ if (event.source !== window || event.origin !== location.origin) return;
+ if (event.data?.source !== "null-quick" || event.data?.type !== "capture") return;
+ const capture = event.data.capture || {};
+ if (!capture.id) return;
+ if (acceptedNullQuickCaptures.has(capture.id)) {
+ acknowledgeNullQuickCapture(capture.id);
+ return;
+ }
+ if (!addReferenceDataUrl(capture.dataUrl)) return;
+ acceptedNullQuickCaptures.add(capture.id);
+ const isImage = capture.kind === "image";
+ if (!input.value.trim()) {
+ setPromptValue(isImage
+ ? "Turn this reference image into a premium transparent motion graphic. Preserve its visual hierarchy and recognizable details while adapting it for clear editorial motion."
+ : "Turn this page screenshot into a premium transparent motion graphic. Preserve its visual hierarchy and recognizable details while adapting it for clear editorial motion.");
+ }
+ input.focus();
+ showToast(`${isImage ? "Reference image" : "Page screenshot"} added from ${capture.sourceTitle || "the active tab"}`);
+ acknowledgeNullQuickCapture(capture.id);
+ });
+ document.getElementById("pipelineModeSelect")?.addEventListener("change", updateGenerationEstimate);
+ setUseImagination(useImagination, { persist: false });
+ updateGenerationEstimate();
+ function scheduleJobsPoll(delay) {
+ window.clearTimeout(jobsPollTimer);
+ jobsPollTimer = window.setTimeout(async () => {
+ refreshBridgeStatus();
+ await refreshRecentJobs();
+ const nextDelay = activeBackgroundJobCount
+ ? (document.visibilityState === "visible" ? 1000 : 2500)
+ : (document.visibilityState === "visible" ? 5000 : 15000);
+ scheduleJobsPoll(nextDelay);
+ }, delay);
+ }
+ window.setInterval(() => {
+ document.querySelectorAll(".job-time[data-timestamp]").forEach(element => {
+ element.textContent = formatJobTime(element.dataset.timestamp);
+ });
+ if (!activeBackgroundJobCount) return;
+ renderGenerationQueue(latestJobsPayload.jobs, latestJobsPayload.queue);
+ if (activeComposerJobId) {
+ const job = latestJobsPayload.jobs.find(item => String(item.id || item.jobId || "") === activeComposerJobId);
+ if (job) updateActiveComposerJob(job);
+ }
+ if (renderPreviewState.job && renderPreviewModal.classList.contains("show")) updateRenderPreviewArtifactState(renderPreviewState.job);
+ }, 1000);
+ refreshBridgeStatus();
+ refreshRecentJobs({ announceCompletions: false }).finally(() => scheduleJobsPoll(activeBackgroundJobCount ? 1000 : 5000));
+ document.addEventListener("visibilitychange", () => {
+ scheduleJobsPoll(250);
+ });
+ loadTemplateCatalog();
+ </script>
+</body>
+</html>
diff --git a/public/pipeline-workspace.css b/public/pipeline-workspace.css
new file mode 100644
index 0000000..1e42ca2
--- /dev/null
+++ b/public/pipeline-workspace.css
@@ -0,0 +1,518 @@
+/* Hallmark · macrostructure: Map / Diagram · genre: modern-minimal · theme: Null project system · enrichment: none · nav: shared site shell · contrast: pass (40–41) · slop: pass (42–45) · honest: pass (46) · chrome: pass (47) · tokens: pass (48) · responsive: pass (49) · icons: pass (30) · mobile: pass (34, 49, 50–57) */
+/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V5 */
+@import url("tokens.css");
+
+* { box-sizing: border-box; }
+html, body { overflow-x: clip; }
+html { scroll-behavior: smooth; }
+body {
+ min-height: 100vh;
+ margin: 0;
+ background: var(--color-paper);
+ color: var(--color-ink);
+ font-family: var(--font-body);
+ font-size: var(--text-base);
+ -webkit-font-smoothing: antialiased;
+}
+button, input, textarea, select { font: inherit; }
+button, a { -webkit-tap-highlight-color: var(--color-transparent); }
+button { color: inherit; }
+a, button { white-space: nowrap; }
+:focus-visible {
+ outline: 2px solid var(--color-focus);
+ outline-offset: 2px;
+}
+button:disabled, [aria-disabled="true"] { cursor: not-allowed; opacity: .5; color: var(--color-dim); }
+
+.fallback-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: var(--space-md);
+ padding: var(--space-md) var(--space-lg);
+ border-bottom: var(--rule-thin) solid var(--color-rule);
+}
+.fallback-header a { color: var(--color-muted); text-decoration: none; }
+.fallback-header > a { color: var(--color-ink); font-weight: 800; }
+.fallback-header nav { display: flex; flex-wrap: wrap; gap: var(--space-md); }
+
+.pipeline-page {
+ width: min(92rem, 100%);
+ margin-inline: auto;
+ padding: var(--space-lg) clamp(var(--space-md), 4vw, var(--space-2xl)) var(--space-3xl);
+}
+.pipeline-hero {
+ display: grid;
+ gap: var(--space-xl);
+ align-items: end;
+ padding-block: var(--space-xl) var(--space-2xl);
+}
+.hero-copy { min-width: 0; }
+.hero-kicker {
+ margin: 0;
+ color: var(--color-accent);
+ font-family: var(--font-mono);
+ font-size: var(--text-xs);
+ font-weight: 700;
+}
+.hero-copy h1 {
+ min-width: 0;
+ margin: var(--space-md) 0;
+ color: var(--color-ink);
+ font-family: var(--font-display);
+ font-size: var(--text-display);
+ font-style: normal;
+ font-weight: 700;
+ letter-spacing: -.045em;
+ line-height: 1;
+ overflow-wrap: anywhere;
+}
+.hero-copy > p:not(.hero-kicker) {
+ max-width: 62ch;
+ margin: 0;
+ color: var(--color-muted);
+ font-size: var(--text-base);
+ line-height: 1.65;
+}
+.hero-actions { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-lg); }
+.button, .text-button, .icon-button, .run-button, .result-actions button, .dialog-close {
+ min-height: 44px;
+ border: var(--rule-thin) solid var(--color-rule-strong);
+ border-radius: var(--radius-md);
+ background: var(--color-paper-3);
+ color: var(--color-ink-2);
+ cursor: pointer;
+ font-size: var(--text-xs);
+ font-weight: 700;
+ text-decoration: none;
+ transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
+}
+.button { display: inline-flex; align-items: center; justify-content: center; padding-inline: var(--space-md); }
+.button.primary, .run-button, .result-actions button.primary {
+ border-color: var(--color-accent);
+ background: var(--color-accent);
+ color: var(--color-accent-ink);
+}
+.button.primary:focus-visible, .run-button:focus-visible, .result-actions button.primary:focus-visible {
+ outline-color: var(--color-focus-dark);
+ box-shadow: 0 0 0 4px var(--color-focus);
+}
+.button.full { width: 100%; }
+.button:active, .text-button:active, .icon-button:active, .run-button:active, .result-actions button:active { transform: translateY(1px); }
+
+.hero-status {
+ padding: var(--space-lg);
+ border: var(--rule-thin) solid var(--color-rule);
+ border-radius: var(--radius-xl);
+ background: var(--color-paper-2);
+ color: var(--color-ink);
+}
+.status-head {
+ display: flex;
+ align-items: center;
+ gap: var(--space-sm);
+ padding-bottom: var(--space-md);
+ border-bottom: var(--rule-thin) solid var(--color-rule);
+ font-size: var(--text-sm);
+}
+.live-dot { width: .5rem; height: .5rem; flex: 0 0 .5rem; border-radius: 50%; background: var(--color-dim); }
+.live-dot.online { background: var(--color-success); }
+.boundary-list { display: grid; gap: 0; margin: 0; }
+.boundary-list div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: var(--space-md); padding-block: var(--space-sm); border-bottom: var(--rule-thin) solid var(--color-rule); }
+.boundary-list dt { color: var(--color-ink-2); font-size: var(--text-sm); font-weight: 700; }
+.boundary-list dd { margin: 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.5; }
+.hero-status > p { margin: var(--space-md) 0 0; color: var(--color-dim); font-size: var(--text-xs); line-height: 1.55; }
+
+.flow-section, .client-sync-section, .workspace-section, .lab-section, .guardrails { scroll-margin-top: var(--space-3xl); }
+.flow-section { padding-block: var(--space-lg) var(--space-xl); }
+.cep-flow-section { padding-top: var(--space-2xl); }
+.section-heading {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+ gap: var(--space-md);
+ margin: var(--space-2xl) 0 var(--space-lg);
+}
+.section-heading.compact { margin-top: 0; }
+.section-heading h2 {
+ min-width: 0;
+ margin: 0;
+ font-family: var(--font-display);
+ font-size: clamp(var(--text-xl), 3vw, var(--text-2xl));
+ font-style: normal;
+ font-weight: 700;
+ letter-spacing: -.035em;
+ line-height: 1.08;
+ overflow-wrap: anywhere;
+}
+.section-heading > p, .section-intro { max-width: 66ch; margin: var(--space-xs) 0 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.6; }
+.flow-hint {
+ display: inline-flex;
+ align-items: center;
+ min-height: 32px;
+ padding-inline: var(--space-sm);
+ border: var(--rule-thin) solid var(--color-rule);
+ border-radius: var(--radius-pill);
+ color: var(--color-dim);
+ font-family: var(--font-mono);
+ font-size: .6875rem;
+}
+
+.flow-explorer {
+ overflow: hidden;
+ border: var(--rule-thin) solid var(--color-rule);
+ border-radius: var(--radius-xl);
+ background: var(--color-paper-2);
+}
+.flow-explorer-head {
+ display: grid;
+ grid-template-columns: auto minmax(0, 1fr);
+ gap: var(--space-md);
+ align-items: center;
+ padding: var(--space-lg);
+ border-bottom: var(--rule-thin) solid var(--color-rule);
+}
+.flow-explorer-head h3 { margin: 0; font-family: var(--font-display); font-size: var(--text-md); font-weight: 700; letter-spacing: -.025em; }
+.flow-explorer-head p { margin: var(--space-2xs) 0 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.5; }
+.flow-mark, .flow-detail-icon, .flow-node-icon, .guardrail-icon {
+ display: grid;
+ place-items: center;
+ color: var(--color-accent);
+}
+.flow-mark { width: 3rem; height: 3rem; border: var(--rule-thin) solid var(--color-accent-rule); border-radius: var(--radius-md); background: var(--color-accent-soft); }
+.flow-mark.cep { color: var(--color-warning); border-color: var(--color-rule-strong); background: var(--color-warning-soft); }
+.flow-mark svg, .flow-detail-icon svg, .flow-node-icon svg, .guardrail-icon svg { width: 1.35rem; height: 1.35rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
+.flow-badge {
+ grid-column: 1 / -1;
+ justify-self: start;
+ padding: var(--space-xs) var(--space-sm);
+ border: var(--rule-thin) solid var(--color-accent-rule);
+ border-radius: var(--radius-pill);
+ color: var(--color-accent);
+ background: var(--color-accent-soft);
+ font-family: var(--font-mono);
+ font-size: .625rem;
+ font-weight: 700;
+}
+.flow-badge.native { border-color: var(--color-success-rule); color: var(--color-success); background: var(--color-success-soft); }
+
+.flow-track {
+ position: relative;
+ display: grid;
+ gap: var(--space-xs);
+ padding: var(--space-md);
+}
+.flow-track::before {
+ position: absolute;
+ top: var(--space-lg);
+ bottom: var(--space-lg);
+ left: 2.65rem;
+ width: var(--rule-thin);
+ background: var(--color-rule-strong);
+ content: "";
+}
+.flow-node {
+ position: relative;
+ z-index: var(--z-base);
+ display: grid;
+ grid-template-columns: 2.75rem minmax(0, 1fr);
+ gap: var(--space-sm);
+ align-items: center;
+ min-width: 0;
+ min-height: 76px;
+ padding: var(--space-sm);
+ border: var(--rule-thin) solid var(--color-rule);
+ border-radius: var(--radius-md);
+ background: var(--color-paper-2);
+ color: var(--color-muted);
+ text-align: start;
+ white-space: normal;
+ cursor: pointer;
+ transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out);
+}
+.flow-node.active { border-color: var(--color-accent); background: var(--color-paper-3); color: var(--color-ink); }
+.flow-node-count { position: absolute; top: var(--space-xs); right: var(--space-xs); color: var(--color-dim); font-family: var(--font-mono); font-size: .625rem; font-variant-numeric: tabular-nums; }
+.flow-node-icon { width: 2.75rem; height: 2.75rem; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper); }
+.flow-node.active .flow-node-icon { border-color: var(--color-accent-rule); color: var(--color-accent); background: var(--color-accent-soft); }
+.flow-node-copy { min-width: 0; padding-inline-end: var(--space-md); }
+.flow-node-copy b, .flow-node-copy span { display: block; }
+.flow-node-copy b { overflow: hidden; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
+.flow-node-copy span { margin-top: var(--space-2xs); color: var(--color-dim); font-size: var(--text-xs); line-height: 1.4; white-space: normal; }
+
+.flow-detail {
+ display: grid;
+ gap: var(--space-lg);
+ padding: var(--space-lg);
+ border-top: var(--rule-thin) solid var(--color-rule);
+ background: var(--color-paper);
+ color: var(--color-ink);
+}
+.flow-detail-copy { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--space-md); align-items: start; }
+.flow-detail-icon { width: 3rem; height: 3rem; border: var(--rule-thin) solid var(--color-accent-rule); border-radius: var(--radius-md); background: var(--color-accent-soft); }
+.flow-detail-copy small { color: var(--color-accent); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.flow-detail-copy h4 { margin: var(--space-xs) 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; letter-spacing: -.03em; }
+.flow-detail-copy p { max-width: 68ch; margin: 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.65; }
+.flow-facts { display: grid; gap: 0; margin: 0; }
+.flow-facts div { padding-block: var(--space-sm); border-bottom: var(--rule-thin) solid var(--color-rule); }
+.flow-facts div:first-child { padding-top: 0; }
+.flow-facts div:last-child { border-bottom: 0; }
+.flow-facts dt { color: var(--color-dim); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.flow-facts dd { margin: var(--space-2xs) 0 0; color: var(--color-ink-2); font-size: var(--text-sm); line-height: 1.5; }
+.flow-evidence { display: flex; min-width: 0; flex-wrap: wrap; align-items: center; gap: var(--space-sm); padding-top: var(--space-md); border-top: var(--rule-thin) solid var(--color-rule); }
+.flow-evidence span { color: var(--color-dim); font-size: var(--text-xs); }
+.flow-evidence code { min-width: 0; color: var(--color-accent); font-family: var(--font-mono); font-size: .6875rem; overflow-wrap: anywhere; }
+.flow-evidence a { margin-inline-start: auto; color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700; text-underline-offset: .2rem; }
+.panel-tabs-guide { display: flex; flex-wrap: wrap; gap: var(--space-xs) var(--space-md); align-items: center; padding: var(--space-md) var(--space-lg); border-top: var(--rule-thin) solid var(--color-rule); color: var(--color-muted); font-size: var(--text-xs); }
+.panel-tabs-guide > strong { color: var(--color-ink-2); }
+.panel-tabs-guide span { white-space: nowrap; }
+.panel-tabs-guide b { color: var(--color-warning); }
+
+.client-sync-section { padding-block: var(--space-xl); }
+.contract-panel { overflow: hidden; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-xl); background: var(--color-paper-2); }
+.contract-panel-head { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-md); padding: var(--space-lg); border-bottom: var(--rule-thin) solid var(--color-rule); }
+.contract-panel-head small, .contract-panel-head b { display: block; }
+.contract-panel-head small { color: var(--color-dim); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.contract-panel-head b { margin-top: var(--space-xs); font-size: var(--text-sm); }
+.contract-panel-head > span { padding: var(--space-xs) var(--space-sm); border: var(--rule-thin) solid var(--color-success-rule); border-radius: var(--radius-pill); color: var(--color-success); background: var(--color-success-soft); font-family: var(--font-mono); font-size: .6875rem; }
+.client-contract-grid { display: grid; grid-template-columns: 1fr; gap: var(--rule-thin); background: var(--color-rule); }
+.contract-capability { min-width: 0; padding: var(--space-md); background: var(--color-paper); }
+.contract-capability-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); }
+.contract-capability-head b { overflow: hidden; color: var(--color-ink-2); font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
+.contract-capability-head span { width: .45rem; height: .45rem; flex: 0 0 .45rem; border-radius: 50%; background: var(--color-success); }
+.contract-capability p { margin: var(--space-xs) 0 0; color: var(--color-dim); font-size: var(--text-xs); line-height: 1.45; }
+.contract-capability code { color: var(--color-accent); font-family: var(--font-mono); font-size: .6875rem; overflow-wrap: anywhere; }
+.contract-loading { grid-column: 1 / -1; padding: var(--space-xl); color: var(--color-dim); font-size: var(--text-sm); text-align: center; background: var(--color-paper); }
+.sync-policy { display: grid; gap: var(--space-xs); padding: var(--space-lg); border-top: var(--rule-thin) solid var(--color-rule); }
+.sync-policy b { color: var(--color-warning); font-size: var(--text-xs); }
+.sync-policy span { color: var(--color-muted); font-size: var(--text-sm); line-height: 1.6; }
+.sync-policy code { color: var(--color-ink-2); font-family: var(--font-mono); font-size: var(--text-xs); }
+
+.workspace-actions { display: flex; width: 100%; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
+.save-state { width: 100%; color: var(--color-dim); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.save-state.saving { color: var(--color-warning); }
+.text-button, .icon-button { padding-inline: var(--space-sm); }
+.pipeline-workspace { display: grid; overflow: hidden; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-xl); background: var(--color-paper-2); }
+.stage-sidebar { padding: var(--space-sm); border-bottom: var(--rule-thin) solid var(--color-rule); background: var(--color-paper); }
+.stage-sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding: var(--space-xs) var(--space-xs) var(--space-sm); }
+.stage-sidebar-head span { font-size: var(--text-sm); font-weight: 800; }
+.stage-sidebar-head small { color: var(--color-dim); font-size: .6875rem; }
+.stage-list { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xs); }
+.stage { position: relative; display: grid; grid-template-columns: 2.25rem minmax(0, 1fr); gap: var(--space-xs); align-items: center; width: 100%; min-width: 0; min-height: 68px; padding: var(--space-xs); border: var(--rule-thin) solid var(--color-transparent); border-radius: var(--radius-md); background: var(--color-transparent); color: var(--color-ink); text-align: start; cursor: pointer; transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); }
+.stage.active { border-color: var(--color-accent-rule); background: var(--color-accent-soft); }
+.stage-icon, .editor-badge { display: grid; place-items: center; border: var(--rule-thin) solid var(--color-rule-strong); border-radius: var(--radius-md); color: var(--color-accent); background: var(--color-paper-2); font-family: var(--font-mono); font-size: .6875rem; font-weight: 800; }
+.stage-icon { width: 2.25rem; height: 2.25rem; }
+.stage:nth-child(4) .stage-icon, .stage:nth-child(5) .stage-icon { color: var(--color-warning); }
+.stage:nth-child(6) .stage-icon, .stage:nth-child(7) .stage-icon { color: var(--color-success); }
+.stage-copy { min-width: 0; }
+.stage-copy b, .stage-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
+.stage-copy b { font-size: var(--text-xs); }
+.stage-copy span, .stage-num { display: none; }
+.stage-status { position: absolute; right: var(--space-xs); bottom: var(--space-xs); width: .4rem; height: .4rem; border-radius: 50%; background: var(--color-success); }
+.stage-status.review { background: var(--color-warning); }
+.stage-status.optional { background: var(--color-dim); }
+
+.stage-editor { min-width: 0; padding: var(--space-lg); }
+.editor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); padding-bottom: var(--space-md); border-bottom: var(--rule-thin) solid var(--color-rule); }
+.editor-identity { display: flex; align-items: center; gap: var(--space-sm); min-width: 0; }
+.editor-badge { width: 2.75rem; height: 2.75rem; flex: 0 0 2.75rem; border-color: var(--color-accent-rule); background: var(--color-accent-soft); }
+.editor-identity small, .readable-head small { display: block; color: var(--color-dim); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.editor-identity h3 { margin: var(--space-2xs) 0 0; font-family: var(--font-display); font-size: var(--text-md); font-weight: 700; letter-spacing: -.025em; }
+.editor-nav { display: flex; gap: var(--space-xs); }
+.editor-nav button { width: 44px; height: 44px; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper); color: var(--color-muted); cursor: pointer; }
+.editor-form { display: grid; gap: var(--space-md); padding-top: var(--space-lg); }
+.form-row { display: grid; gap: var(--space-md); }
+.field { display: block; min-width: 0; }
+.field > span, .contract-editor-head span, .settings label > span { display: block; margin-bottom: var(--space-xs); color: var(--color-dim); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.field input, .field textarea, .field select, .settings input, .settings select, .contract-edit-row input, #sourceInput, .import-dialog textarea {
+ width: 100%;
+ border: var(--rule-thin) solid var(--color-rule-strong);
+ border-radius: var(--radius-md);
+ outline: 2px solid var(--color-transparent);
+ outline-offset: 1px;
+ background: var(--color-paper);
+ color: var(--color-ink-2);
+}
+.field input, .field select, .settings input, .settings select, .contract-edit-row input { min-height: 44px; padding-inline: var(--space-sm); font-size: var(--text-sm); }
+.field textarea { min-height: 7rem; padding: var(--space-sm); resize: vertical; font-size: var(--text-sm); line-height: 1.6; }
+.field.notes textarea { min-height: 6rem; }
+.field input:focus-visible, .field textarea:focus-visible, .field select:focus-visible, .settings input:focus-visible, .settings select:focus-visible, .contract-edit-row input:focus-visible, #sourceInput:focus-visible, .import-dialog textarea:focus-visible { outline-color: var(--color-focus); }
+.contract-editor { padding: var(--space-md); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-lg); background: var(--color-paper); }
+.contract-editor-head { display: flex; justify-content: space-between; gap: var(--space-sm); }
+.contract-editor-head small { color: var(--color-dim); font-size: .6875rem; }
+.contract-edit-row { display: grid; gap: var(--space-xs); margin-top: var(--space-xs); }
+.contract-edit-row input:last-child { color: var(--color-muted); }
+
+.stage-readable { display: flex; min-width: 0; flex-direction: column; padding: var(--space-lg); border-top: var(--rule-thin) solid var(--color-rule); background: var(--color-paper); }
+.readable-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); padding-bottom: var(--space-md); border-bottom: var(--rule-thin) solid var(--color-rule); }
+.readable-head b { display: block; margin-top: var(--space-2xs); font-size: var(--text-sm); }
+.icon-button { min-width: 44px; }
+.readable-stage { padding-block: var(--space-lg); }
+.readable-stage .stage-kicker { color: var(--color-accent); font-family: var(--font-mono); font-size: .6875rem; font-weight: 800; }
+.readable-stage h3 { margin: var(--space-sm) 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; line-height: 1.15; letter-spacing: -.035em; }
+.readable-stage > p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.65; white-space: pre-wrap; }
+.readable-contracts { display: grid; gap: var(--space-xs); margin-top: var(--space-lg); }
+.readable-contract { padding: var(--space-sm); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
+.readable-contract b, .readable-contract span { display: block; }
+.readable-contract b { margin-bottom: var(--space-2xs); color: var(--color-ink-2); font-size: var(--text-xs); }
+.readable-contract span { color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5; }
+.readable-notes { margin-top: var(--space-md); padding: var(--space-sm); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-warning-soft); }
+.readable-notes small { color: var(--color-warning); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.readable-notes p { margin: var(--space-xs) 0 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5; white-space: pre-wrap; }
+.handoff-card { margin-top: auto; padding-top: var(--space-md); border-top: var(--rule-thin) solid var(--color-rule); }
+.handoff-card small { color: var(--color-success); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.handoff-card p { margin: var(--space-xs) 0 var(--space-sm); color: var(--color-dim); font-size: var(--text-xs); line-height: 1.55; }
+
+.lab { display: grid; overflow: hidden; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-xl); background: var(--color-paper-2); }
+.lab-input, .lab-output { min-width: 0; padding: var(--space-lg); }
+.lab-input { border-bottom: var(--rule-thin) solid var(--color-rule); }
+.lab-output { background: var(--color-paper); }
+.lab-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-md); }
+.lab-topline h3 { margin: 0; font-family: var(--font-display); font-size: var(--text-md); font-weight: 700; }
+.lab-topline p { margin: var(--space-2xs) 0 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.5; }
+.api-pill { padding: var(--space-xs) var(--space-sm); border: var(--rule-thin) solid var(--color-success-rule); border-radius: var(--radius-pill); color: var(--color-success); background: var(--color-success-soft); font-family: var(--font-mono); font-size: .625rem; font-weight: 800; }
+.mode-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2xs); padding: var(--space-2xs); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper); }
+.mode-tab { min-height: 44px; border: 0; border-radius: var(--radius-sm); background: var(--color-transparent); color: var(--color-muted); font-size: var(--text-xs); cursor: pointer; }
+.mode-tab.active { background: var(--color-paper-3); color: var(--color-ink); }
+.source-toolbar { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-sm); margin: var(--space-md) var(--space-3xs) var(--space-xs); }
+.source-toolbar label { color: var(--color-ink-2); font-size: var(--text-xs); font-weight: 700; }
+.source-toolbar div { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
+.source-toolbar button { min-height: 32px; padding: 0; border: 0; background: var(--color-transparent); color: var(--color-accent); font-size: var(--text-xs); cursor: pointer; }
+.source-toolbar button:last-child { color: var(--color-dim); }
+#sourceInput { min-height: 16rem; padding: var(--space-sm); resize: vertical; font-size: var(--text-sm); line-height: 1.65; }
+.source-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-xs); margin: var(--space-xs) var(--space-3xs) 0; color: var(--color-dim); font-family: var(--font-mono); font-size: .6875rem; }
+.settings { display: grid; gap: var(--space-sm); margin-top: var(--space-md); }
+.run-button { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-top: var(--space-sm); padding-inline: var(--space-md); }
+.lab-note { margin: var(--space-sm) var(--space-3xs) 0; color: var(--color-dim); font-size: var(--text-xs); line-height: 1.5; }
+.output-empty { display: grid; min-height: 24rem; place-items: center; align-content: center; padding: var(--space-xl); border: var(--rule-thin) dashed var(--color-rule-strong); border-radius: var(--radius-lg); text-align: center; }
+.output-orbit { display: grid; width: 3rem; height: 3rem; place-items: center; margin-bottom: var(--space-md); border: var(--rule-thin) solid var(--color-accent-rule); border-radius: 50%; color: var(--color-accent); background: var(--color-accent-soft); font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 800; }
+.output-empty strong { color: var(--color-ink-2); font-size: var(--text-sm); }
+.output-empty span { max-width: 48ch; margin-top: var(--space-xs); color: var(--color-dim); font-size: var(--text-xs); line-height: 1.55; }
+.result-summary, .result-grid { display: grid; gap: var(--space-xs); }
+.result-summary { margin-bottom: var(--space-xs); }
+.result-stat, .result-card { min-width: 0; padding: var(--space-sm); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-md); background: var(--color-paper-2); }
+.result-stat small { display: block; color: var(--color-dim); font-family: var(--font-mono); font-size: .625rem; font-weight: 700; }
+.result-stat b { display: block; margin-top: var(--space-xs); overflow: hidden; font-size: var(--text-xs); text-overflow: ellipsis; white-space: nowrap; }
+.result-card { min-height: 8rem; }
+.result-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-sm); margin-bottom: var(--space-sm); }
+.result-card-head b { font-size: var(--text-xs); }
+.result-card-head span { color: var(--color-dim); font-family: var(--font-mono); font-size: .625rem; }
+.result-card p { margin: 0; color: var(--color-muted); font-size: var(--text-xs); line-height: 1.6; white-space: pre-wrap; }
+.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-xs); }
+.chip { max-width: 100%; padding: var(--space-xs) var(--space-sm); overflow: hidden; border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-sm); background: var(--color-paper-3); color: var(--color-ink-2); font-size: .6875rem; text-overflow: ellipsis; white-space: nowrap; }
+.theme-preview { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: var(--space-sm); align-items: center; }
+.swatches { display: flex; height: 3rem; overflow: hidden; border: var(--rule-thin) solid var(--color-rule-strong); border-radius: var(--radius-sm); }
+.swatches i { flex: 1; }
+.theme-copy b, .theme-copy span { display: block; }
+.theme-copy b { font-size: var(--text-xs); }
+.theme-copy span { margin-top: var(--space-2xs); color: var(--color-muted); font-size: .6875rem; line-height: 1.45; }
+.beats { display: grid; max-height: 13rem; gap: var(--space-xs); overflow: auto; }
+.beat { display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); gap: var(--space-xs); align-items: center; padding: var(--space-xs); border: var(--rule-thin) solid var(--color-rule); border-radius: var(--radius-sm); background: var(--color-paper-3); }
+.beat time { color: var(--color-accent); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; font-variant-numeric: tabular-nums; }
+.beat span { overflow: hidden; color: var(--color-ink-2); font-size: .6875rem; text-overflow: ellipsis; white-space: nowrap; }
+.beat b { display: none; }
+.result-actions { display: flex; gap: var(--space-xs); margin-top: var(--space-xs); }
+.result-actions button { flex: 1; padding-inline: var(--space-sm); }
+.error-box { padding: var(--space-sm); border: var(--rule-thin) solid var(--color-error); border-radius: var(--radius-md); background: var(--color-error-soft); color: var(--color-error); font-size: var(--text-xs); line-height: 1.55; }
+
+.guardrail-grid { display: grid; gap: var(--space-sm); }
+.guardrail-grid article { min-height: 10rem; padding: var(--space-lg); border-top: var(--rule-thin) solid var(--color-rule); background: var(--color-paper); }
+.guardrail-icon { width: 2.5rem; height: 2.5rem; border: var(--rule-thin) solid currentColor; border-radius: var(--radius-md); }
+.guardrail-icon.green { color: var(--color-success); }
+.guardrail-icon.cyan { color: var(--color-accent); }
+.guardrail-icon.yellow { color: var(--color-warning); }
+.guardrail-grid h3 { margin: var(--space-lg) 0 var(--space-xs); font-family: var(--font-display); font-size: var(--text-md); font-weight: 700; }
+.guardrail-grid p { margin: 0; color: var(--color-muted); font-size: var(--text-sm); line-height: 1.6; }
+
+.import-dialog {
+ position: fixed;
+ inset: 0;
+ width: min(41rem, calc(100% - 2rem));
+ height: fit-content;
+ max-height: min(80dvh, 42rem);
+ margin: auto;
+ padding: 0;
+ border: var(--rule-thin) solid var(--color-rule-strong);
+ border-radius: var(--radius-xl);
+ background: var(--color-paper-2);
+ color: var(--color-ink);
+ box-shadow: 0 2rem 5rem var(--color-shadow);
+}
+.import-dialog::backdrop { background: var(--color-overlay); }
+.import-dialog form { padding: var(--space-lg); }
+.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-lg); }
+.dialog-head small { color: var(--color-accent); font-family: var(--font-mono); font-size: .6875rem; font-weight: 700; }
+.dialog-head h2 { margin: var(--space-xs) 0 0; font-family: var(--font-display); font-size: var(--text-lg); font-weight: 700; }
+.dialog-close { width: 44px; padding: 0; font-size: var(--text-md); }
+.import-dialog form > p { color: var(--color-muted); font-size: var(--text-sm); line-height: 1.55; }
+.import-dialog textarea { min-height: 16rem; padding: var(--space-sm); resize: vertical; font-family: var(--font-mono); font-size: .6875rem; line-height: 1.55; }
+.dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-xs); margin-top: var(--space-sm); }
+.toast { position: fixed; z-index: var(--z-toast); right: var(--space-md); bottom: var(--space-md); max-width: calc(100% - 2rem); padding: var(--space-sm) var(--space-md); transform: translateY(var(--space-md)); border: var(--rule-thin) solid var(--color-rule-strong); border-radius: var(--radius-md); opacity: 0; pointer-events: none; background: var(--color-paper-4); color: var(--color-ink); font-size: var(--text-xs); transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out); }
+.toast.show { opacity: 1; transform: none; }
+
+@media (hover: hover) and (pointer: fine) {
+ .button:hover, .text-button:hover, .icon-button:hover, .result-actions button:hover { border-color: var(--color-accent-rule); background: var(--color-paper-4); color: var(--color-ink); transform: translateY(-1px); }
+ .button.primary:hover, .run-button:hover, .result-actions button.primary:hover { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-accent-ink); }
+ .flow-node:hover, .stage:hover { border-color: var(--color-rule-strong); background: var(--color-paper-3); }
+ .flow-node.active:hover, .stage.active:hover { border-color: var(--color-accent); background: var(--color-accent-soft); }
+ .source-toolbar button:hover { color: var(--color-ink); }
+}
+
+@media (min-width: 40rem) {
+ .pipeline-page { padding-top: var(--space-xl); }
+ .flow-explorer-head { grid-template-columns: auto minmax(0, 1fr) auto; }
+ .flow-badge { grid-column: auto; justify-self: end; }
+ .contract-panel-head { flex-direction: row; align-items: center; justify-content: space-between; }
+ .client-contract-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .sync-policy { grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-lg); }
+ .stage-list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
+ .stage-copy span { display: block; font-size: .6875rem; color: var(--color-dim); }
+ .form-row, .settings, .contract-edit-row { grid-template-columns: 1fr 1fr; }
+ .contract-edit-row { grid-template-columns: 7rem minmax(0, 1fr); }
+ .source-toolbar { flex-direction: row; align-items: center; justify-content: space-between; }
+ .result-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .result-card.wide { grid-column: 1 / -1; }
+ .guardrail-grid { grid-template-columns: 1.2fr 1fr; }
+ .guardrail-grid article:last-child { grid-column: 1 / -1; }
+}
+
+@media (min-width: 60rem) {
+ .pipeline-hero { grid-template-columns: minmax(0, 1.25fr) minmax(19rem, .55fr); gap: clamp(var(--space-xl), 5vw, var(--space-3xl)); padding-block: var(--space-2xl) var(--space-3xl); }
+ .section-heading { flex-direction: row; align-items: end; justify-content: space-between; }
+ .section-heading > p { margin: 0; }
+ .flow-track { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-xs); padding: var(--space-lg); }
+ .flow-track::before { top: 3.4rem; right: calc(8.333% + var(--space-lg)); bottom: auto; left: calc(8.333% + var(--space-lg)); width: auto; height: var(--rule-thin); }
+ .flow-node { display: flex; min-height: 10rem; flex-direction: column; align-items: flex-start; padding: var(--space-md); }
+ .flow-node-copy { padding-inline-end: 0; }
+ .flow-node-copy b { min-height: 2.5em; }
+ .flow-detail { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); padding: var(--space-xl); }
+ .flow-evidence { grid-column: 1 / -1; }
+ .pipeline-workspace { grid-template-columns: 13rem minmax(0, 1fr); }
+ .stage-sidebar { border-right: var(--rule-thin) solid var(--color-rule); border-bottom: 0; }
+ .stage-list { grid-template-columns: 1fr; }
+ .stage-copy span { display: block; }
+ .stage-readable { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 18rem; gap: var(--space-lg); border-left: 0; }
+ .readable-head { grid-column: 1 / -1; }
+ .handoff-card { margin-top: 0; }
+ .lab { grid-template-columns: minmax(22rem, .82fr) minmax(0, 1.18fr); }
+ .lab-input { border-right: var(--rule-thin) solid var(--color-rule); border-bottom: 0; }
+ .result-summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
+ .beat { grid-template-columns: 3.25rem minmax(0, 1fr) auto; }
+ .beat b { display: block; color: var(--color-success); font-family: var(--font-mono); font-size: .625rem; }
+ .guardrail-grid { grid-template-columns: 1.2fr 1fr .9fr; }
+ .guardrail-grid article:last-child { grid-column: auto; }
+}
+
+@media (min-width: 76rem) {
+ .pipeline-workspace { grid-template-columns: 14rem minmax(28rem, 1fr) 20rem; }
+ .stage-readable { grid-column: auto; display: flex; border-top: 0; border-left: var(--rule-thin) solid var(--color-rule); }
+ .readable-head { grid-column: auto; }
+ .handoff-card { margin-top: auto; }
+ .workspace-actions { width: auto; justify-content: flex-end; }
+ .save-state { width: auto; margin-inline-end: var(--space-xs); }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ html { scroll-behavior: auto; }
+ *, *::before, *::after { animation-duration: 150ms !important; animation-iteration-count: 1 !important; transition-duration: 150ms !important; }
+}
diff --git a/public/renders.html b/public/renders.html
new file mode 100644
index 0000000..77f2f44
--- /dev/null
+++ b/public/renders.html
@@ -0,0 +1,348 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
+ <title>Renders · Null Motion</title>
+ <link rel="icon" href="assets/null-logo.png" />
+ <style>
+ :root { --bg:#09090b; --panel:#131316; --panel-2:#19191d; --line:#2b2b31; --line-strong:#46464f; --text:#f4f4f5; --muted:#98989f; --success:#63d58a; --danger:#ef7070; }
+ * { box-sizing:border-box; }
+ html { color-scheme:dark; }
+ body { min-height:100vh; margin:0; color:var(--text); background:radial-gradient(950px 520px at 50% -12%,#202027 0%,var(--bg) 66%); font-family:Inter,-apple-system,"SF Pro Display",system-ui,Arial,sans-serif; -webkit-font-smoothing:antialiased; }
+ button { font:inherit; }
+ header { position:sticky; top:0; z-index:20; display:flex; align-items:center; justify-content:space-between; min-height:62px; padding:10px clamp(18px,3vw,42px); border-bottom:1px solid rgba(255,255,255,.075); background:rgba(9,9,11,.9); backdrop-filter:blur(18px) saturate(130%); }
+ .brand { display:flex; align-items:center; gap:11px; color:inherit; font-size:18px; font-weight:640; letter-spacing:-.025em; text-decoration:none; }
+ .brand img { width:30px; height:30px; border-radius:9px; box-shadow:0 4px 14px rgba(0,0,0,.55); }
+ .brand span { color:var(--muted); font-weight:420; }
+ .nav { display:flex; align-items:center; gap:7px; }
+ .nav-link,.pair-button { min-height:34px; padding:8px 11px; border:1px solid transparent; border-radius:9px; color:var(--muted); background:transparent; font-size:12px; font-weight:570; text-decoration:none; white-space:nowrap; }
+ .nav-link:hover,.pair-button:hover { color:var(--text); background:rgba(255,255,255,.045); }
+ .nav-link.active { color:var(--text); border-color:var(--line-strong); background:rgba(255,255,255,.055); }
+ .pair-button { cursor:pointer; border-color:var(--line); }
+ .bridge { display:flex; align-items:center; gap:7px; padding:8px 8px 8px 12px; color:var(--muted); font-size:11px; font-weight:600; white-space:nowrap; }
+ .bridge-dot { width:7px; height:7px; border-radius:50%; background:#5b5b63; }
+ .bridge.online { color:#a9dfbb; } .bridge.online .bridge-dot { background:var(--success); box-shadow:0 0 10px rgba(99,213,138,.4); }
+ main { width:min(1180px,calc(100% - 36px)); margin:0 auto; padding:64px 0 90px; }
+ .hero { display:flex; align-items:end; justify-content:space-between; gap:24px; margin-bottom:28px; }
+ .eyebrow { margin-bottom:12px; color:#b4b4bb; font-size:11px; font-weight:760; letter-spacing:.15em; text-transform:uppercase; }
+ h1 { margin:0; font-size:clamp(42px,7vw,78px); line-height:.94; letter-spacing:-.07em; }
+ .intro { max-width:620px; margin:18px 0 0; color:var(--muted); font-size:15px; line-height:1.65; }
+ .refresh { min-height:42px; padding:10px 16px; border:1px solid var(--line-strong); border-radius:10px; color:var(--text); background:linear-gradient(180deg,#25252a,#17171a); cursor:pointer; font-weight:650; }
+ .refresh:disabled { cursor:wait; opacity:.6; }
+ .summary { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:14px; color:var(--muted); font-size:12px; }
+ .summary-tools { display:flex; align-items:center; gap:10px; }
+ .history-toggle { padding:6px 9px; border:1px solid var(--line); border-radius:8px; color:var(--muted); background:#151519; cursor:pointer; font:inherit; font-size:11px; }
+ .history-toggle:hover { color:var(--text); border-color:var(--line-strong); }
+ .grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:15px; }
+ .card { overflow:hidden; border:1px solid var(--line); border-radius:16px; background:linear-gradient(160deg,var(--panel-2),var(--panel)); box-shadow:0 18px 45px rgba(0,0,0,.2); }
+ .thumb { position:relative; display:grid; place-items:center; aspect-ratio:16/9; overflow:hidden; color:#707078; background:radial-gradient(circle at 50% 28%,#303038,#111114 68%); font-size:12px; }
+ .thumb img { width:100%; height:100%; object-fit:cover; }
+ .status { position:absolute; top:10px; left:10px; padding:6px 9px; border:1px solid rgba(255,255,255,.12); border-radius:99px; color:#dddde2; background:rgba(10,10,12,.78); backdrop-filter:blur(10px); font-size:10px; font-weight:740; letter-spacing:.06em; text-transform:uppercase; }
+ .status.done { color:#b7edc7; border-color:rgba(99,213,138,.28); background:rgba(22,61,36,.74); }
+ .status.error { color:#ffc1c1; border-color:rgba(239,112,112,.3); background:rgba(72,27,27,.72); }
+ .card-body { padding:15px; }
+ .card h2 { overflow:hidden; margin:0; font-size:15px; letter-spacing:-.02em; text-overflow:ellipsis; white-space:nowrap; }
+ .meta { margin:7px 0 14px; color:var(--muted); font-size:11px; }
+ .actions { display:grid; grid-template-columns:repeat(auto-fit,minmax(90px,1fr)); gap:8px; }
+ .actions a,.actions button { display:flex; align-items:center; justify-content:center; min-height:38px; padding:9px 10px; border:1px solid var(--line); border-radius:9px; color:var(--text); background:#1b1b1f; font:inherit; font-size:12px; font-weight:650; text-decoration:none; cursor:pointer; }
+ .actions a:hover,.actions button:hover { border-color:var(--line-strong); background:#222227; }
+ .actions .download { color:#0b0b0c; border-color:#e7e7e9; background:#f1f1f2; }
+ .actions .download:hover { border-color:white; background:white; }
+ .actions.single { grid-template-columns:1fr; }
+ .empty { grid-column:1/-1; padding:68px 24px; border:1px dashed var(--line-strong); border-radius:16px; color:var(--muted); text-align:center; background:rgba(19,19,22,.65); }
+ .empty strong { display:block; margin-bottom:8px; color:var(--text); font-size:18px; }
+ .empty-links { display:flex; justify-content:center; flex-wrap:wrap; gap:8px; margin-top:20px; }
+ .empty-links a { padding:9px 12px; border:1px solid var(--line); border-radius:9px; color:var(--text); text-decoration:none; }
+ .toast { position:fixed; left:50%; bottom:24px; z-index:50; transform:translate(-50%,15px); padding:11px 15px; border:1px solid var(--line-strong); border-radius:10px; color:var(--text); background:#1c1c20; opacity:0; pointer-events:none; transition:.2s; box-shadow:0 16px 40px rgba(0,0,0,.45); font-size:12px; }
+ .toast.show { opacity:1; transform:translate(-50%,0); }
+ .prompt-modal { position:fixed; inset:0; z-index:60; display:none; place-items:center; padding:20px; background:rgba(4,4,6,.8); backdrop-filter:blur(12px); }
+ .prompt-modal.show { display:grid; }
+ .prompt-dialog { display:flex; width:min(760px,calc(100vw - 32px)); max-height:calc(100vh - 40px); flex-direction:column; overflow:hidden; border:1px solid var(--line-strong); border-radius:16px; background:#121216; box-shadow:0 34px 100px rgba(0,0,0,.72); }
+ .prompt-head { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:15px 17px; border-bottom:1px solid var(--line); }
+ .prompt-head small { display:block; margin-bottom:4px; color:var(--muted); font-size:9px; font-weight:750; letter-spacing:.12em; text-transform:uppercase; }
+ .prompt-head h2 { margin:0; font-size:16px; }
+ .prompt-close { width:30px; height:30px; border:1px solid var(--line); border-radius:50%; background:#1b1b1f; color:var(--text); cursor:pointer; }
+ .prompt-text { min-height:220px; margin:0; padding:20px; overflow:auto; color:#dedee2; background:#0b0b0e; font:13px/1.7 ui-monospace,"SFMono-Regular",Consolas,monospace; white-space:pre-wrap; overflow-wrap:anywhere; }
+ .prompt-actions { display:flex; justify-content:flex-end; padding:12px 15px; border-top:1px solid var(--line); }
+ .prompt-actions button { min-height:34px; padding:7px 12px; border:1px solid #eeeef0; border-radius:8px; color:#111114; background:#e8e8eb; font:inherit; font-size:11px; font-weight:650; cursor:pointer; }
+ @media (max-width:900px) { .grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }
+ @media (max-width:680px) { header { align-items:flex-start; flex-wrap:wrap; padding:10px 14px; } .nav { width:100%; overflow-x:auto; padding-bottom:2px; } .nav > * { flex:0 0 auto; } .bridge { display:none; } main { width:min(100% - 28px,1180px); padding-top:40px; } .hero { align-items:flex-start; flex-direction:column; } h1 { font-size:52px; } .grid { grid-template-columns:1fr; } .refresh { width:100%; } }
+ </style>
+ <link rel="stylesheet" href="site-shell.css" />
+ <script src="site-shell.js" defer></script>
+</head>
+<body>
+ <header>
+ <a class="brand" href="./"><img src="assets/null-logo.png" alt="Null" /><b>Null</b> <span>Motion</span></a>
+ <nav class="nav" aria-label="Null Motion pages">
+ <a class="nav-link" href="./">Templates</a>
+ <a class="nav-link" href="create.html">Reference studio</a>
+ <a class="nav-link" href="script.html">Script to motion</a>
+ <a class="nav-link" href="system-map.html">Director pipeline</a>
+ <a class="nav-link" href="control-center.html">Control Center</a>
+ <a class="nav-link active" href="renders.html" aria-current="page">Renders</a>
+ <div class="bridge" id="bridge"><span class="bridge-dot"></span><span id="bridgeText">Checking companion</span></div>
+ <button class="pair-button" id="pairButton" type="button" hidden>Pair</button>
+ </nav>
+ </header>
+ <main>
+ <section class="hero">
+ <div>
+ <div class="eyebrow">Output library</div>
+ <h1>Your renders.</h1>
+ <p class="intro">Every finished Null Motion video lives here. Preview it in the browser or use Download MOV to save the actual file to your browser's Downloads folder.</p>
+ </div>
+ <button class="refresh" id="refreshButton" type="button">Refresh renders</button>
+ </section>
+ <div class="summary"><span id="summaryText">Loading renders…</span><span class="summary-tools"><button class="history-toggle" id="historyToggle" type="button" hidden>Show failed attempts</button><span id="updatedText"></span></span></div>
+ <section class="grid" id="renderGrid" aria-live="polite"></section>
+ </main>
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
+ <div class="prompt-modal" id="promptModal" aria-hidden="true">
+ <section class="prompt-dialog" role="dialog" aria-modal="true" aria-labelledby="promptTitle">
+ <header class="prompt-head"><div><small>Final generation prompt</small><h2 id="promptTitle">Motion prompt</h2></div><button class="prompt-close" id="promptClose" type="button" aria-label="Close prompt">&times;</button></header>
+ <pre class="prompt-text" id="promptText"></pre>
+ <footer class="prompt-actions"><button id="promptCopy" type="button">Copy prompt</button></footer>
+ </section>
+ </div>
+ <script>
+ const API = window.location.origin;
+ const TOKEN_KEY = "null-motion-bridge-token";
+ const LEGACY_TOKEN_KEYS = ["nullBridgeToken", "nullMotionBridgeToken", "null-motion-browser-token"];
+ const grid = document.getElementById("renderGrid");
+ const refreshButton = document.getElementById("refreshButton");
+ const historyToggle = document.getElementById("historyToggle");
+ let showFailedAttempts = false;
+ let latestJobs = [];
+
+ function safeUrl(value) {
+ if (!value) return "";
+ try { const url = new URL(String(value), API); return /^https?:$/.test(url.protocol) ? url.href : ""; } catch (_) { return ""; }
+ }
+
+ function jobId(job) { return String(job && (job.id || job.jobId) || ""); }
+
+ function jobPrompt(job) { return String(job && (job.optimizedPrompt || job.prompt || job.originalPrompt) || "").trim(); }
+
+ function bridgeToken() {
+ try {
+ let token = localStorage.getItem(TOKEN_KEY) || "";
+ if (token) return token;
+ for (const key of LEGACY_TOKEN_KEYS) {
+ token = localStorage.getItem(key) || "";
+ if (!token) continue;
+ localStorage.setItem(TOKEN_KEY, token);
+ LEGACY_TOKEN_KEYS.forEach(legacyKey => localStorage.removeItem(legacyKey));
+ return token;
+ }
+ } catch (_) {}
+ return "";
+ }
+
+ function showToast(message) {
+ const toast = document.getElementById("toast");
+ toast.textContent = message; toast.classList.add("show");
+ window.clearTimeout(showToast.timer);
+ showToast.timer = window.setTimeout(function () { toast.classList.remove("show"); }, 2200);
+ }
+
+ function openPrompt(job) {
+ const prompt = jobPrompt(job);
+ if (!prompt) { showToast("No prompt was saved for this render"); return; }
+ document.getElementById("promptTitle").textContent = displayName(job);
+ document.getElementById("promptText").textContent = prompt;
+ document.getElementById("promptModal").classList.add("show");
+ document.getElementById("promptModal").setAttribute("aria-hidden", "false");
+ document.getElementById("promptClose").focus();
+ }
+
+ function closePrompt() {
+ document.getElementById("promptModal").classList.remove("show");
+ document.getElementById("promptModal").setAttribute("aria-hidden", "true");
+ }
+
+ function downloadUrl(job) {
+ const explicit = safeUrl(job && job.downloadUrl);
+ if (explicit) return explicit;
+ const id = jobId(job);
+ if (/^\d+$/.test(id) || /^[0-9a-f-]{36}$/i.test(id)) return API + "/api/v1/jobs/" + encodeURIComponent(id) + "/download";
+ return safeUrl(job && job.renderUrl);
+ }
+
+ function statusOf(job) {
+ const status = String(job && job.status || "pending").toLowerCase();
+ if (status === "completed") return "done";
+ if (status === "failed" || status === "cancelled" || status === "canceled" || status === "interrupted") return "error";
+ return status;
+ }
+
+ function displayName(job) {
+ return job.templateName || job.preset || job.mp4Name || (job.prompt ? String(job.prompt).slice(0, 70) : "Null Motion render");
+ }
+
+ function formatDate(value) {
+ const date = new Date(Number(value) || value);
+ return Number.isNaN(date.getTime()) ? "" : date.toLocaleString([], { dateStyle:"medium", timeStyle:"short" });
+ }
+
+ async function api(path, options) {
+ const headers = Object.assign({}, options && options.headers || {});
+ const token = bridgeToken();
+ if (token) headers["X-Null-Bridge-Token"] = token;
+ const response = await fetch(API + path, Object.assign({}, options || {}, { headers }));
+ const data = await response.json().catch(function () { return {}; });
+ if (!response.ok) throw new Error(data.error || "Null companion failed (" + response.status + ")");
+ return data;
+ }
+
+ async function retryJob(job, button) {
+ button.disabled = true;
+ button.textContent = "Retrying…";
+ try {
+ const prompt = String(job.originalPrompt || job.prompt || "").trim();
+ if (!prompt) throw new Error("This attempt has no reusable prompt.");
+ await api("/generate", {
+ method:"POST",
+ headers:{ "Content-Type":"application/json" },
+ body:JSON.stringify({
+ prompt:prompt,
+ preset:job.preset || "Custom",
+ generator:job.generator || "codex",
+ duration:job.duration || 5,
+ fps:job.fps || 30,
+ width:job.deliveryWidth || job.width || 1920,
+ height:job.deliveryHeight || job.height || 1080,
+ speedProfile:job.speedProfile || "instant",
+ pipelineMode:job.pipelineMode || "fast-hq",
+ renderMode:"production",
+ qualityReview:"strict",
+ cacheMode:"refresh",
+ priority:"high",
+ assetResolutionMode:job.assetResolutionMode || "relaxed",
+ assetQueries:Array.isArray(job.assetQueries) ? job.assetQueries : [],
+ sourceUrls:Array.isArray(job.sourceUrls) ? job.sourceUrls : [],
+ templateId:job.templateLocked ? job.templateId : null,
+ designOptions:job.designOptions || null,
+ autoResearch:true,
+ origin:"website-retry"
+ })
+ });
+ showToast("Recovery render queued");
+ showFailedAttempts = false;
+ window.setTimeout(refresh, 300);
+ } catch (error) {
+ showToast(error.message);
+ button.disabled = false;
+ button.textContent = "Retry";
+ }
+ }
+
+ function link(label, href, className) {
+ const anchor = document.createElement("a");
+ anchor.textContent = label;
+ anchor.href = href;
+ if (className) anchor.className = className;
+ return anchor;
+ }
+
+ function renderCard(job) {
+ const status = statusOf(job);
+ const card = document.createElement("article"); card.className = "card";
+ const thumb = document.createElement("div"); thumb.className = "thumb";
+ const imageUrl = safeUrl(job.thumbUrl);
+ if (imageUrl) { const image = document.createElement("img"); image.src = imageUrl; image.alt = displayName(job) + " preview"; image.loading = "lazy"; thumb.appendChild(image); }
+ else thumb.appendChild(document.createTextNode(status === "done" ? "Render ready" : (job.step || status)));
+ const badge = document.createElement("span"); badge.className = "status " + status; badge.textContent = status === "done" ? "Ready" : status === "error" ? "Previous attempt" : status; thumb.appendChild(badge);
+ const body = document.createElement("div"); body.className = "card-body";
+ const title = document.createElement("h2"); title.textContent = displayName(job); title.title = displayName(job);
+ const meta = document.createElement("div"); meta.className = "meta"; meta.textContent = [job.width && job.height ? job.width + "×" + job.height : "", job.duration ? Number(job.duration).toFixed(1) + "s" : "", formatDate(job.finishedAt || job.startedAt)].filter(Boolean).join(" · ");
+ const actions = document.createElement("div"); actions.className = "actions";
+ if (status === "done") {
+ const preview = safeUrl(job.playerUrl || job.previewUrl);
+ if (preview) { const previewLink = link("Preview", preview); previewLink.target = "_blank"; previewLink.rel = "noopener"; actions.appendChild(previewLink); }
+ const file = downloadUrl(job);
+ if (file) { const download = link("Download MOV", file, "download"); download.download = job.mp4Name || "null-motion.mov"; actions.appendChild(download); }
+ if (jobPrompt(job)) { const prompt = document.createElement("button"); prompt.type = "button"; prompt.textContent = "Prompt"; prompt.onclick = function () { openPrompt(job); }; actions.appendChild(prompt); }
+ if (actions.children.length === 1) actions.classList.add("single");
+ } else if (status === "error") {
+ const detail = document.createElement("span"); detail.style.cssText = "grid-column:1/-1;color:var(--muted);font-size:12px"; detail.textContent = job.error || "This attempt did not finish."; actions.appendChild(detail);
+ const retry = document.createElement("button"); retry.type = "button"; retry.textContent = "Retry"; retry.onclick = function () { retryJob(job, retry); }; actions.appendChild(retry);
+ if (jobPrompt(job)) { const prompt = document.createElement("button"); prompt.type = "button"; prompt.textContent = "Prompt"; prompt.onclick = function () { openPrompt(job); }; actions.appendChild(prompt); }
+ } else {
+ actions.classList.add("single");
+ const detail = document.createElement("span"); detail.style.cssText = "color:var(--muted);font-size:12px"; detail.textContent = "Automatic recovery is running: " + (job.step || status) + "."; actions.appendChild(detail);
+ }
+ body.append(title, meta, actions); card.append(thumb, body); return card;
+ }
+
+ function emptyState(message) {
+ const empty = document.createElement("div"); empty.className = "empty";
+ const title = document.createElement("strong"); title.textContent = "No finished videos yet";
+ const copy = document.createElement("span"); copy.textContent = message || "Choose a starting point and your completed renders will appear here.";
+ const links = document.createElement("div"); links.className = "empty-links";
+ links.append(link("Browse templates", "./"), link("Create from reference", "create.html"), link("Direct a script", "script.html"));
+ empty.append(title, copy, links); return empty;
+ }
+
+ function paintJobs() {
+ const failed = latestJobs.filter(function (job) { return statusOf(job) === "error"; });
+ const visible = showFailedAttempts ? latestJobs : latestJobs.filter(function (job) { return statusOf(job) !== "error"; });
+ grid.replaceChildren();
+ if (!visible.length) grid.appendChild(emptyState());
+ else visible.forEach(function (job) { grid.appendChild(renderCard(job)); });
+ const ready = latestJobs.filter(function (job) { return statusOf(job) === "done"; }).length;
+ const active = latestJobs.length - ready - failed.length;
+ document.getElementById("summaryText").textContent = ready + " downloadable " + (ready === 1 ? "render" : "renders") + (active ? " · " + active + " recovering" : "") + (failed.length ? " · " + failed.length + " previous attempts " + (showFailedAttempts ? "shown" : "hidden") : "");
+ historyToggle.hidden = failed.length === 0;
+ historyToggle.textContent = showFailedAttempts ? "Hide failed attempts" : "Show failed attempts";
+ }
+
+ async function refresh() {
+ refreshButton.disabled = true; refreshButton.textContent = "Refreshing…";
+ try {
+ const payload = await api("/api/v1/jobs");
+ const jobs = Array.isArray(payload) ? payload : (payload.jobs || []);
+ latestJobs = jobs;
+ paintJobs();
+ document.getElementById("updatedText").textContent = "Updated " + new Date().toLocaleTimeString([], { hour:"numeric", minute:"2-digit" });
+ setBridge(true);
+ } catch (error) {
+ grid.replaceChildren(emptyState(/401|403|pair|token|unauthorized/i.test(error.message) ? "Pair the local companion to see your renders." : "Start the local Null companion to load your render library."));
+ document.getElementById("summaryText").textContent = error.message;
+ setBridge(false, /401|403|pair|token|unauthorized/i.test(error.message));
+ } finally { refreshButton.disabled = false; refreshButton.textContent = "Refresh renders"; }
+ }
+
+ historyToggle.addEventListener("click", function () { showFailedAttempts = !showFailedAttempts; paintJobs(); });
+
+ function setBridge(online, pairRequired) {
+ document.getElementById("bridge").classList.toggle("online", online);
+ document.getElementById("bridgeText").textContent = online ? "Companion online" : (pairRequired ? "Pair required" : "Companion offline");
+ document.getElementById("pairButton").hidden = !pairRequired;
+ }
+
+ async function pair() {
+ const code = window.prompt("Enter the pairing code shown by the local Null companion:");
+ if (!code) return;
+ try {
+ const response = await fetch(API + "/api/v1/pair", { method:"POST", headers:{ "Content-Type":"application/json" }, body:JSON.stringify({ code:code.trim() }) });
+ const data = await response.json().catch(function () { return {}; });
+ if (!response.ok || !data.token) throw new Error(data.error || "Pairing failed");
+ localStorage.setItem(TOKEN_KEY, data.token); refresh();
+ } catch (error) { document.getElementById("summaryText").textContent = error.message; }
+ }
+
+ refreshButton.onclick = refresh;
+ document.getElementById("pairButton").onclick = pair;
+ document.getElementById("promptClose").onclick = closePrompt;
+ document.getElementById("promptModal").onclick = function (event) { if (event.target.id === "promptModal") closePrompt(); };
+ document.getElementById("promptCopy").onclick = function () {
+ navigator.clipboard.writeText(document.getElementById("promptText").textContent).then(function () { showToast("Production prompt copied"); });
+ };
+ window.addEventListener("keydown", function (event) { if (event.key === "Escape") closePrompt(); });
+ refresh();
+ window.setInterval(refresh, 12000);
+ </script>
+</body>
+</html>
diff --git a/public/script-workspace.js b/public/script-workspace.js
new file mode 100644
index 0000000..bc99d43
--- /dev/null
+++ b/public/script-workspace.js
@@ -0,0 +1,573 @@
+(function () {
+ "use strict";
+
+ var API = window.location.origin;
+ var TOKEN_KEY = "null-motion-bridge-token";
+ var LEGACY_TOKEN_KEYS = ["nullMotionBridgeToken", "null-motion-browser-token", "nullBridgeToken"];
+ var DRAFT_KEY = "nullMotionScriptDraftV1";
+ var TERMINAL = new Set(["done", "partial", "error", "cancelled", "interrupted"]);
+ var templates = [];
+ var storyboard = null;
+ var storyboardId = null;
+ var sequenceInfo = null;
+ var activeBatchId = null;
+ var activeThemeId = null;
+ var eventSource = null;
+ var pollTimer = null;
+ var toastTimer = null;
+
+ function byId(id) { return document.getElementById(id); }
+
+ function bridgeToken() {
+ try {
+ var token = localStorage.getItem(TOKEN_KEY) || "";
+ if (token) return token;
+ for (var index = 0; index < LEGACY_TOKEN_KEYS.length; index += 1) {
+ token = localStorage.getItem(LEGACY_TOKEN_KEYS[index]) || "";
+ if (!token) continue;
+ localStorage.setItem(TOKEN_KEY, token);
+ LEGACY_TOKEN_KEYS.forEach(function (key) { localStorage.removeItem(key); });
+ return token;
+ }
+ } catch (error) {}
+ return "";
+ }
+
+ function escapeHtml(value) {
+ return String(value == null ? "" : value).replace(/[&<>"']/g, function (character) {
+ return { "&": "&amp;", "<": "&lt;", ">": "&gt;", '"': "&quot;", "'": "&#39;" }[character];
+ });
+ }
+
+ async function api(path, options) {
+ options = options || {};
+ var headers = Object.assign({}, options.headers || {});
+ var token = bridgeToken();
+ if (token) headers["X-Null-Bridge-Token"] = token;
+ var response = await fetch(API + path, Object.assign({}, options, { headers: headers }));
+ var data = await response.json().catch(function () { return {}; });
+ if (!response.ok) throw new Error(data.error || "Null bridge failed (" + response.status + ")");
+ return data;
+ }
+
+ function showToast(message) {
+ clearTimeout(toastTimer);
+ byId("toast").textContent = message;
+ byId("toast").classList.add("show");
+ toastTimer = setTimeout(function () { byId("toast").classList.remove("show"); }, 2600);
+ }
+
+ function setStatus(id, message, error) {
+ var node = byId(id);
+ node.textContent = message || "";
+ node.classList.toggle("show", Boolean(message));
+ node.classList.toggle("error", Boolean(error));
+ }
+
+ function setStep(number) {
+ [1, 2, 3].forEach(function (index) {
+ byId("step" + index).classList.toggle("active", index === number);
+ byId("step" + index).classList.toggle("done", index < number);
+ });
+ }
+
+ async function initialize() {
+ restoreDraft();
+ updateScriptStats();
+ try {
+ var responses = await Promise.all([api("/api/v1/health"), api("/api/v1/templates"), api("/api/user/active-theme")]);
+ var health = responses[0];
+ var catalog = responses[1];
+ var themeResponse = responses[2];
+ byId("bridge").className = "bridge online";
+ byId("bridgeText").textContent = "UI ready · generation not connected";
+ templates = Array.isArray(catalog.templates) ? catalog.templates : [];
+ activeThemeId = themeResponse.theme && themeResponse.theme.id || null;
+ } catch (error) {
+ byId("bridge").className = "bridge offline";
+ byId("bridgeText").textContent = "Bridge offline";
+ setStatus("inputStatus", "Start the Null Motion companion, then reload this page.", true);
+ }
+ }
+
+ function parseDuration(value) {
+ var clean = String(value || "").trim().toLowerCase().replace(/seconds?|secs?/g, "").trim();
+ if (!clean) return null;
+ if (/^\d+(?:\.\d+)?$/.test(clean)) return Number(clean);
+ var parts = clean.split(":").map(Number);
+ if (parts.some(function (part) { return !Number.isFinite(part); })) return null;
+ if (parts.length === 3) return parts[0] * 3600 + parts[1] * 60 + parts[2];
+ if (parts.length === 2) return parts[0] * 60 + parts[1];
+ return null;
+ }
+
+ function detectedTimelineEnd(text) {
+ var end = 0;
+ var pattern = /(?:^|\n)\s*(?:\d+\s*\n\s*)?\[?(\d{1,2}:\d{2}(?::\d{2})?(?:[,.]\d{1,3})?)\]?/g;
+ var match;
+ while ((match = pattern.exec(String(text || "")))) end = Math.max(end, parseDuration(match[1].replace(",", ".")) || 0);
+ var srtPattern = /-->\s*(\d{1,2}:\d{2}(?::\d{2})?(?:[,.]\d{1,3})?)/g;
+ while ((match = srtPattern.exec(String(text || "")))) end = Math.max(end, parseDuration(match[1].replace(",", ".")) || 0);
+ return end;
+ }
+
+ function estimatedDuration(text) {
+ var words = String(text || "").trim().split(/\s+/).filter(Boolean).length;
+ return Math.max(8, Math.ceil(words / 2.55));
+ }
+
+ function currentSequenceInfo() {
+ var dimensions = byId("videoFormat").value.split("x").map(Number);
+ var transcript = byId("scriptInput").value;
+ var explicit = parseDuration(byId("videoDuration").value);
+ var timed = detectedTimelineEnd(transcript);
+ var duration = Math.max(4, explicit || (timed ? timed + 4 : estimatedDuration(transcript)));
+ return {
+ width: dimensions[0],
+ height: dimensions[1],
+ fps: Number(byId("videoFps").value) || 30,
+ duration: Math.round(duration * 1000) / 1000
+ };
+ }
+
+ function formatTime(seconds, includeMillis) {
+ var value = Math.max(0, Number(seconds) || 0);
+ var hours = Math.floor(value / 3600);
+ var minutes = Math.floor((value % 3600) / 60);
+ var whole = Math.floor(value % 60);
+ var millis = Math.round((value - Math.floor(value)) * 1000);
+ var base = (hours ? String(hours).padStart(2, "0") + ":" : "") +
+ String(minutes).padStart(2, "0") + ":" + String(whole).padStart(2, "0");
+ return includeMillis && millis ? base + "." + String(millis).padStart(3, "0") : base;
+ }
+
+ function saveDraft() {
+ var draft = {
+ script: byId("scriptInput").value,
+ duration: byId("videoDuration").value,
+ format: byId("videoFormat").value,
+ fps: byId("videoFps").value,
+ provider: byId("provider").value,
+ density: byId("density").value,
+ assetMode: byId("assetMode").value,
+ renderMode: byId("renderMode").value,
+ guidance: byId("guidance").value
+ };
+ localStorage.setItem(DRAFT_KEY, JSON.stringify(draft));
+ }
+
+ function restoreDraft() {
+ try {
+ var draft = JSON.parse(localStorage.getItem(DRAFT_KEY) || "null");
+ if (!draft) return;
+ byId("scriptInput").value = draft.script || "";
+ byId("videoDuration").value = draft.duration || "";
+ [["videoFormat", "format"], ["videoFps", "fps"], ["provider", "provider"], ["density", "density"], ["assetMode", "assetMode"], ["renderMode", "renderMode"]].forEach(function (pair) {
+ var node = byId(pair[0]);
+ var value = draft[pair[1]];
+ if (value && Array.from(node.options).some(function (option) { return option.value === String(value); })) node.value = String(value);
+ });
+ byId("guidance").value = draft.guidance || "";
+ } catch (error) {}
+ }
+
+ function updateScriptStats() {
+ var value = byId("scriptInput").value;
+ var words = value.trim().split(/\s+/).filter(Boolean).length;
+ byId("scriptStats").textContent = words.toLocaleString() + " words · about " + formatTime(currentSequenceInfo().duration);
+ saveDraft();
+ }
+
+ async function analyzeScript() {
+ var transcript = byId("scriptInput").value.trim();
+ if (!transcript) {
+ byId("scriptInput").focus();
+ setStatus("inputStatus", "Paste or import a script first.", true);
+ return;
+ }
+ if (transcript.length < 32) {
+ setStatus("inputStatus", "Add a little more script so the director has enough context.", true);
+ return;
+ }
+ var button = byId("analyzeButton");
+ button.disabled = true;
+ button.classList.add("busy");
+ button.textContent = "Directing the story…";
+ setStatus("inputStatus", "Analyzing narrative beats, timing, real entities, and the approved template catalog.");
+ sequenceInfo = currentSequenceInfo();
+ try {
+ var response = await api("/api/v1/psychology-analyze", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ transcript: transcript,
+ sequenceInfo: sequenceInfo,
+ userPrompt: byId("guidance").value.trim(),
+ generator: byId("provider").value,
+ mode: "auto-sequence",
+ origin: "website-script",
+ deepAnalysis: true,
+ directorMode: "auto",
+ planningDensity: byId("density").value,
+ minimumClipDuration: 4,
+ assetResolutionMode: byId("assetMode").value,
+ themeId: activeThemeId
+ })
+ });
+ storyboard = response.storyboard;
+ storyboardId = response.storyboardId || (storyboard && storyboard.id) || null;
+ if (!storyboard || !Array.isArray(storyboard.segments) || !storyboard.segments.length) {
+ throw new Error("The director returned no timeline segments.");
+ }
+ byId("planPanel").hidden = false;
+ renderPlan();
+ setStatus("inputStatus", "");
+ setStep(2);
+ byId("planPanel").scrollIntoView({ behavior: "smooth", block: "start" });
+ } catch (error) {
+ setStatus("inputStatus", error.message || "Could not build the timeline.", true);
+ } finally {
+ button.disabled = false;
+ button.classList.remove("busy");
+ button.textContent = "Build motion timeline";
+ }
+ }
+
+ function selectedSegments() {
+ return storyboard && Array.isArray(storyboard.segments)
+ ? storyboard.segments.filter(function (segment) { return segment.shouldRenderGraphic !== false; })
+ : [];
+ }
+
+ function candidateId(candidate) {
+ return typeof candidate === "string" ? candidate : candidate && candidate.id;
+ }
+
+ function templateName(id) {
+ var template = templates.find(function (item) { return item.id === id; });
+ return (template && template.name) || id || "No template";
+ }
+
+ function renderSummary() {
+ var selected = selectedSegments();
+ var insights = storyboard.overallCampaignInsights || {};
+ var warning = insights.longVideoWarning;
+ var coverage = selected.reduce(function (sum, segment) { return sum + (Number(segment.graphicDuration) || 0); }, 0);
+ var cards = [
+ ["Video length", formatTime(sequenceInfo.duration)],
+ ["Motion graphics", selected.length + " selected"],
+ ["Graphic coverage", Math.round(coverage) + " seconds"],
+ [warning ? "Long-video plan" : "Complexity", warning ? "Sparse highlights" : (insights.complexityBudget || "Balanced")]
+ ];
+ byId("summaryGrid").innerHTML = cards.map(function (card, index) {
+ var title = warning && index === 3 ? warning : card[1];
+ var className = "summary-card" + (warning && index === 3 ? " warning" : "");
+ return '<div class="' + className + '"><small>' + escapeHtml(card[0]) + '</small><b title="' +
+ escapeHtml(title) + '">' + escapeHtml(card[1]) + "</b></div>";
+ }).join("");
+ byId("rationale").textContent = storyboard.decisionSummary || storyboard.designRationale ||
+ "Null selected the beats where motion most improves comprehension or emphasis.";
+ byId("generateButton").disabled = selected.length === 0;
+ }
+
+ function renderTimeline() {
+ var duration = Math.max(1, sequenceInfo.duration || storyboard.overallDuration || 60);
+ byId("timelineRuler").innerHTML = Array.from({ length: 6 }, function (_, index) {
+ return "<span>" + formatTime(duration * index / 6) + "</span>";
+ }).join("");
+ byId("timelineTrack").innerHTML = storyboard.segments.map(function (segment, index) {
+ var start = Math.max(0, Number(segment.graphicStartTime) || 0);
+ var length = Math.max(0.2, Number(segment.graphicDuration) || 0.2);
+ var left = Math.min(99.5, start / duration * 100);
+ var width = Math.max(0.5, Math.min(100 - left, length / duration * 100));
+ var classes = ["timeline-block"];
+ if (segment.criticality === "low") classes.push("low");
+ if (segment.shouldRenderGraphic === false) classes.push("off");
+ var label = segment.templateId ? templateName(segment.templateId) : "Beat " + (index + 1);
+ return '<button class="' + classes.join(" ") + '" type="button" data-index="' + index +
+ '" style="left:' + left + "%;width:" + width + '%" title="' +
+ escapeHtml(formatTime(start, true) + " · " + (segment.text || "")) + '"><b>' +
+ escapeHtml(label) + "</b><span>" + formatTime(start, true) + "</span></button>";
+ }).join("");
+ byId("timelineTrack").querySelectorAll("button").forEach(function (button) {
+ button.onclick = function () {
+ var card = byId("segmentList").children[Number(button.dataset.index)];
+ if (card) card.scrollIntoView({ behavior: "smooth", block: "center" });
+ };
+ });
+ }
+
+ function renderSegments() {
+ var root = byId("segmentList");
+ root.innerHTML = storyboard.segments.map(function (segment, index) {
+ var candidateIds = (segment.bestTemplateCandidates || []).map(candidateId);
+ var allIds = [segment.templateId].concat(candidateIds, templates.map(function (template) { return template.id; })).filter(Boolean);
+ var ids = Array.from(new Set(allIds));
+ var templateOptions = ids.map(function (id) {
+ return '<option value="' + escapeHtml(id) + '"' + (id === segment.templateId ? " selected" : "") + ">" +
+ escapeHtml(templateName(id)) + "</option>";
+ }).join("");
+ var enabled = segment.shouldRenderGraphic !== false;
+ return '<article class="segment' + (enabled ? "" : " is-off") + '" data-index="' + index + '">' +
+ '<div class="segment-toggle"><input class="segment-enabled" type="checkbox" aria-label="Generate graphic for beat ' + (index + 1) + '"' + (enabled ? " checked" : "") + " /></div>" +
+ '<div class="segment-copy"><div class="segment-kicker">Beat ' + String(index + 1).padStart(2, "0") +
+ ' <span class="criticality ' + escapeHtml(segment.criticality || "medium") + '">' +
+ escapeHtml(segment.criticality || "medium") + "</span> " + escapeHtml(segment.semanticCategory || "") +
+ '</div><div class="spoken">' + escapeHtml(segment.text || "") + '</div><div class="why">' +
+ escapeHtml(segment.whyGraphic || segment.visualRationale || segment.intent || "") + "</div></div>" +
+ '<div class="segment-controls">' +
+ '<div class="field"><label>Starts at</label><input class="segment-start" type="number" min="0" max="' +
+ sequenceInfo.duration + '" step="0.1" value="' + (Number(segment.graphicStartTime) || 0) + '" /></div>' +
+ '<div class="field"><label>Duration</label><input class="segment-duration" type="number" min="3" max="7" step="0.1" value="' +
+ (Number(segment.graphicDuration) || 4) + '" /></div>' +
+ '<div class="field template-field"><label>Template</label><select class="segment-template">' + templateOptions + "</select></div>" +
+ '<div class="field prompt-field"><label>Motion direction</label><textarea class="segment-prompt" placeholder="Optional segment-specific direction">' +
+ escapeHtml(segment.customPrompt || segment.suggestedPromptEnhancements || "") + "</textarea></div></div></article>";
+ }).join("");
+
+ Array.from(root.children).forEach(function (card, index) {
+ var segment = storyboard.segments[index];
+ card.querySelector(".segment-enabled").onchange = function (event) {
+ segment.shouldRenderGraphic = event.target.checked;
+ card.classList.toggle("is-off", !event.target.checked);
+ renderSummary();
+ renderTimeline();
+ };
+ card.querySelector(".segment-start").onchange = function (event) {
+ segment.graphicStartTime = Math.max(0, Math.min(sequenceInfo.duration, Number(event.target.value) || 0));
+ event.target.value = segment.graphicStartTime;
+ renderTimeline();
+ };
+ card.querySelector(".segment-duration").onchange = function (event) {
+ segment.graphicDuration = Math.max(3, Math.min(7, Number(event.target.value) || 4));
+ segment.durationOverride = segment.graphicDuration;
+ event.target.value = segment.graphicDuration;
+ renderSummary();
+ renderTimeline();
+ };
+ card.querySelector(".segment-template").onchange = function (event) {
+ segment.templateId = event.target.value;
+ renderTimeline();
+ };
+ card.querySelector(".segment-prompt").onchange = function (event) {
+ segment.customPrompt = event.target.value.trim();
+ };
+ });
+ }
+
+ function renderPlan() {
+ renderSummary();
+ renderTimeline();
+ renderSegments();
+ }
+
+ function timelineText() {
+ var header = "NULL MOTION TIMELINE\nVideo: " + formatTime(sequenceInfo.duration) + " · " +
+ sequenceInfo.width + "x" + sequenceInfo.height + " · " + sequenceInfo.fps + " fps\nGraphics: " +
+ selectedSegments().length + "\n";
+ return header + storyboard.segments.map(function (segment, index) {
+ var status = segment.shouldRenderGraphic === false ? "FOOTAGE ONLY" :
+ "NULL MOTION · " + templateName(segment.templateId) + " · " + Number(segment.graphicDuration).toFixed(1) + "s";
+ return "\n" + String(index + 1).padStart(2, "0") + " " + formatTime(segment.graphicStartTime, true) + " " +
+ status + "\n" + segment.text + "\n" + (segment.customPrompt || segment.whyGraphic || "");
+ }).join("\n");
+ }
+
+ async function copyTimeline() {
+ try {
+ await navigator.clipboard.writeText(timelineText());
+ showToast("Timeline script copied");
+ } catch (error) {
+ showToast("Clipboard access was blocked");
+ }
+ }
+
+ function downloadTimeline() {
+ var payload = {
+ apiVersion: 1,
+ storyboardId: storyboardId,
+ sequenceInfo: sequenceInfo,
+ transcript: byId("scriptInput").value,
+ storyboard: storyboard
+ };
+ var url = URL.createObjectURL(new Blob([JSON.stringify(payload, null, 2)], { type: "application/json" }));
+ var anchor = document.createElement("a");
+ anchor.href = url;
+ anchor.download = "null-motion-timeline-" + Date.now() + ".json";
+ anchor.click();
+ setTimeout(function () { URL.revokeObjectURL(url); }, 1000);
+ }
+
+ async function generateSequence() {
+ if (!storyboard || !selectedSegments().length) {
+ setStatus("planStatus", "Select at least one graphic.", true);
+ return;
+ }
+ var button = byId("generateButton");
+ button.disabled = true;
+ button.classList.add("busy");
+ button.textContent = "Starting sequence…";
+ setStatus("planStatus", "");
+ try {
+ var renderMode = byId("renderMode").value;
+ var response = await api("/api/v1/generate-sequence", {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ storyboard: storyboard,
+ storyboardId: storyboardId,
+ transcript: byId("scriptInput").value,
+ sequenceInfo: sequenceInfo,
+ generator: byId("provider").value,
+ quality: renderMode === "high-end" ? "high" : "standard",
+ origin: "website-script",
+ renderMode: renderMode,
+ qualityReview: renderMode === "preview" ? "skip" : renderMode === "high-end" ? "strict" : "auto",
+ cacheMode: "use",
+ priority: "high",
+ assetResolutionMode: byId("assetMode").value,
+ themeId: activeThemeId,
+ maxRepairPasses: renderMode === "high-end" ? 2 : renderMode === "preview" ? 0 : 1,
+ minimumClipDuration: 4,
+ maxSegmentDuration: 7,
+ planningDensity: byId("density").value
+ })
+ });
+ activeBatchId = response.sequenceId || response.batchId;
+ if (!activeBatchId) throw new Error("The companion did not return a sequence ID.");
+ byId("runPanel").hidden = false;
+ setStep(3);
+ applyBatch(response);
+ watchBatch(activeBatchId);
+ byId("runPanel").scrollIntoView({ behavior: "smooth", block: "start" });
+ } catch (error) {
+ setStatus("planStatus", error.message || "Could not start the sequence.", true);
+ button.disabled = false;
+ } finally {
+ button.classList.remove("busy");
+ button.textContent = "Generate selected graphics";
+ }
+ }
+
+ function stopWatch() {
+ if (eventSource) {
+ eventSource.close();
+ eventSource = null;
+ }
+ if (pollTimer) {
+ clearInterval(pollTimer);
+ pollTimer = null;
+ }
+ }
+
+ function watchBatch(batchId) {
+ stopWatch();
+ function poll() {
+ api("/api/v1/sequences/" + encodeURIComponent(batchId)).then(applyBatch).catch(function (error) {
+ byId("runStatus").textContent = error.message;
+ });
+ }
+ pollTimer = setInterval(poll, 1800);
+ poll();
+ try {
+ eventSource = new EventSource(API + "/api/v1/sequences/" + encodeURIComponent(batchId) + "/events");
+ eventSource.onmessage = function (event) {
+ try { applyBatch(JSON.parse(event.data)); } catch (error) {}
+ };
+ eventSource.onerror = function () {
+ if (eventSource) eventSource.close();
+ eventSource = null;
+ };
+ } catch (error) {}
+ }
+
+ function jobLabel(job, index) {
+ return job.templateName || templateName(job.templateId) || "Graphic " + (index + 1);
+ }
+
+ function applyBatch(batch) {
+ if (!batch) return;
+ var status = String(batch.status || "pending").toLowerCase();
+ var jobs = Array.isArray(batch.jobs) ? batch.jobs : [];
+ var complete = jobs.filter(function (job) { return job.status === "done"; }).length;
+ var failed = jobs.filter(function (job) { return ["error", "cancelled", "interrupted"].includes(job.status); }).length;
+ byId("runTitle").textContent = TERMINAL.has(status)
+ ? status === "done" ? "Motion sequence ready" : status === "partial" ? "Sequence partially complete" : "Sequence " + status
+ : "Generating motion sequence";
+ byId("runStatus").textContent = complete + " of " + (jobs.length || selectedSegments().length) + " ready" +
+ (failed ? " · " + failed + " failed" : "") + (batch.etaSeconds ? " · about " + batch.etaSeconds + "s remaining" : "");
+ byId("runProgress").style.transform = "scaleX(" + Math.max(0, Math.min(100, Number(batch.progress) || 0)) / 100 + ")";
+ byId("cancelButton").disabled = TERMINAL.has(status);
+ byId("retryButton").hidden = !["partial", "error", "cancelled", "interrupted"].includes(status) || failed === 0;
+ byId("runList").innerHTML = jobs.length ? jobs.map(function (job, index) {
+ var jobStatus = String(job.status || "pending").toLowerCase();
+ var renderHref = safeHttpUrl(job.downloadUrl) || (job.jobId
+ ? API + "/api/v1/jobs/" + encodeURIComponent(job.jobId) + "/download"
+ : job.mp4Name ? API + "/renders/" + encodeURIComponent(job.mp4Name) : "");
+ var thumb = job.thumbUrl
+ ? '<img src="' + escapeHtml(job.thumbUrl) + '" alt="' + escapeHtml(jobLabel(job, index)) + ' preview" />'
+ : escapeHtml(jobStatus === "done" ? "Preview ready" : job.step || jobStatus);
+ var actions = jobStatus === "done"
+ ? (job.playerUrl ? '<a href="' + escapeHtml(job.playerUrl) + '" target="_blank" rel="noopener">Preview</a>' : "") +
+ (renderHref ? '<a href="' + escapeHtml(renderHref) + '" download>Download</a>' : "")
+ : "";
+ return '<article class="run-item ' + escapeHtml(jobStatus) + '"><div class="run-thumb">' + thumb +
+ '</div><div class="run-item-body"><div class="run-item-title"><span>' + escapeHtml(jobLabel(job, index)) +
+ "</span><span>" + formatTime(job.relativeStartTime, true) + '</span></div><div class="run-item-status">' +
+ escapeHtml(jobStatus === "done" ? "Transparent MOV ready" : job.error || job.step || jobStatus) +
+ '</div><div class="run-item-actions">' + actions + "</div></div></article>";
+ }).join("") : '<div class="empty">The sequence is queued. Segment jobs will appear shortly.</div>';
+ if (TERMINAL.has(status)) {
+ stopWatch();
+ byId("generateButton").disabled = false;
+ if (status === "done") showToast("Your Null Motion sequence is ready");
+ }
+ }
+
+ async function cancelBatch() {
+ if (!activeBatchId) return;
+ try {
+ applyBatch(await api("/api/v1/sequences/" + encodeURIComponent(activeBatchId) + "/cancel", { method: "POST" }));
+ } catch (error) {
+ showToast(error.message);
+ }
+ }
+
+ async function retryBatch() {
+ if (!activeBatchId) return;
+ byId("retryButton").disabled = true;
+ try {
+ var batch = await api("/api/v1/sequences/" + encodeURIComponent(activeBatchId) + "/retry-failed", { method: "POST" });
+ applyBatch(batch);
+ watchBatch(activeBatchId);
+ } catch (error) {
+ showToast(error.message);
+ } finally {
+ byId("retryButton").disabled = false;
+ }
+ }
+
+ byId("scriptInput").addEventListener("input", updateScriptStats);
+ ["videoDuration", "videoFormat", "videoFps", "provider", "density", "assetMode", "renderMode", "guidance"].forEach(function (id) {
+ byId(id).addEventListener("change", updateScriptStats);
+ });
+ byId("scriptFile").onchange = function (event) {
+ var file = event.target.files && event.target.files[0];
+ if (!file) return;
+ var reader = new FileReader();
+ reader.onload = function () {
+ byId("scriptInput").value = String(reader.result || "");
+ updateScriptStats();
+ showToast(file.name + " imported");
+ };
+ reader.readAsText(file);
+ };
+ byId("analyzeButton").onclick = analyzeScript;
+ byId("copyTimeline").onclick = copyTimeline;
+ byId("downloadTimeline").onclick = downloadTimeline;
+ byId("generateButton").onclick = generateSequence;
+ byId("cancelButton").onclick = cancelBatch;
+ byId("retryButton").onclick = retryBatch;
+ window.addEventListener("beforeunload", stopWatch);
+ initialize();
+}());
diff --git a/public/script.html b/public/script.html
new file mode 100644
index 0000000..7942d12
--- /dev/null
+++ b/public/script.html
@@ -0,0 +1,187 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta charset="utf-8" />
+<meta name="viewport" content="width=device-width, initial-scale=1" />
+<title>Script to Motion — Null Motion</title>
+<link rel="icon" href="assets/null-logo.png" />
+<style>
+ :root {
+ --bg:#0d0d0f; --panel:#141417; --panel-2:#1b1b1f; --line:#2a2a30; --line-strong:#3b3b43;
+ --text:#ececee; --muted:#8a8a92; --accent:#00e5ff; --success:#4ade80; --warning:#fbbf24;
+ --danger:#fb7185; --silver:linear-gradient(135deg,#f2f2f2 0%,#b8b8bc 52%,#8c8c90 100%);
+ }
+ * { box-sizing:border-box; }
+ html { scroll-behavior:smooth; }
+ body { min-height:100vh; margin:0; color:var(--text); background:radial-gradient(1000px 620px at 50% -10%,#1b1b20 0%,var(--bg) 64%); font-family:Inter,-apple-system,"SF Pro Display",system-ui,Arial,sans-serif; -webkit-font-smoothing:antialiased; }
+ button,input,textarea,select { font:inherit; }
+ header { position:sticky; top:0; z-index:30; display:flex; align-items:center; justify-content:space-between; min-height:62px; padding:10px clamp(18px,3vw,42px); border-bottom:1px solid rgba(255,255,255,.075); background:rgba(10,10,12,.9); backdrop-filter:blur(18px) saturate(130%); }
+ .brand { display:flex; align-items:center; gap:11px; color:inherit; font-size:18px; font-weight:620; letter-spacing:-.025em; text-decoration:none; }
+ .brand img { width:30px; height:30px; border-radius:9px; box-shadow:0 4px 14px rgba(0,0,0,.55); }
+ .brand span { color:var(--muted); font-weight:420; }
+ .header-actions { display:flex; align-items:center; gap:8px; }
+ .header-link { min-height:34px; padding:8px 11px; border:1px solid transparent; border-radius:9px; color:var(--muted); background:transparent; font-size:12px; font-weight:560; text-decoration:none; }
+ .header-link:hover { color:var(--text); background:rgba(255,255,255,.045); }
+ .header-link.active { color:var(--text); border-color:var(--line-strong); background:rgba(255,255,255,.055); }
+ .bridge { display:flex; align-items:center; gap:8px; padding:8px 10px; color:var(--muted); font-size:11px; font-weight:600; }
+ .bridge-dot { width:7px; height:7px; border-radius:50%; background:#5a5a62; }
+ .bridge.online { color:#a9dfbb; } .bridge.online .bridge-dot { background:var(--success); box-shadow:0 0 10px rgba(74,222,128,.38); }
+ .bridge.offline { color:#e89aa6; } .bridge.offline .bridge-dot { background:var(--danger); }
+ main { width:min(1460px,100%); margin:0 auto; padding:30px clamp(18px,3vw,44px) 90px; }
+ .intro { display:grid; grid-template-columns:minmax(0,1fr) minmax(360px,.72fr); gap:36px; align-items:end; margin-bottom:22px; }
+ .eyebrow { display:flex; align-items:center; gap:9px; margin-bottom:12px; color:#8befff; font-size:10px; font-weight:780; letter-spacing:.16em; text-transform:uppercase; }
+ .eyebrow::before { content:""; width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 15px rgba(0,229,255,.7); }
+ h1 { max-width:820px; margin:0; font-size:clamp(38px,4.2vw,58px); font-weight:610; letter-spacing:-.05em; line-height:1; background:var(--silver); background-clip:text; -webkit-background-clip:text; color:transparent; }
+ .intro p { max-width:720px; margin:18px 0 0; color:#9797a0; font-size:15px; line-height:1.7; }
+ .steps { display:grid; grid-template-columns:repeat(3,1fr); overflow:hidden; border:1px solid var(--line); border-radius:15px; background:rgba(20,20,23,.75); }
+ .step { min-width:0; padding:14px; border-left:1px solid var(--line); } .step:first-child { border-left:0; }
+ .step small { display:block; color:#62626b; font-size:8.5px; font-weight:760; letter-spacing:.13em; text-transform:uppercase; }
+ .step b { display:block; margin-top:5px; color:#a0a0a8; font-size:11px; font-weight:620; }
+ .step.active { background:rgba(0,229,255,.035); } .step.active small { color:#8befff; } .step.active b { color:#e5e5e8; } .step.done small { color:#8fe4ab; }
+ .panel { overflow:hidden; border:1px solid var(--line); border-radius:20px; background:linear-gradient(145deg,rgba(24,24,28,.96),rgba(11,11,14,.98)); box-shadow:0 28px 80px rgba(0,0,0,.28); }
+ .panel + .panel { margin-top:22px; }
+ .panel-head { display:flex; align-items:flex-start; justify-content:space-between; gap:24px; padding:22px 24px; border-bottom:1px solid var(--line); }
+ .panel-title h2 { margin:0; font-size:18px; font-weight:650; letter-spacing:-.02em; } .panel-title p { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
+ .panel-body { padding:24px; }
+ .ingest-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(310px,.55fr); gap:20px; }
+ .script-box { position:relative; }
+ .script-box textarea { width:100%; min-height:340px; padding:18px 18px 52px; resize:vertical; border:1px solid var(--line); border-radius:15px; outline:0; color:var(--text); background:#101013; font:13px/1.68 ui-monospace,"SFMono-Regular",Consolas,monospace; transition:border-color .18s,box-shadow .18s; }
+ .script-box textarea:focus { border-color:rgba(0,229,255,.55); box-shadow:0 0 0 3px rgba(0,229,255,.06); } .script-box textarea::placeholder { color:#55555e; }
+ .script-tools { position:absolute; left:13px; right:13px; bottom:13px; display:flex; align-items:center; justify-content:space-between; gap:12px; color:#696972; font-size:10px; pointer-events:none; }
+ .file-label { display:inline-flex; align-items:center; min-height:28px; padding:6px 9px; border:1px solid var(--line); border-radius:8px; color:#a9a9b0; background:#1b1b1f; font-size:10px; font-weight:650; cursor:pointer; pointer-events:auto; }
+ .file-label:hover { color:#fff; border-color:#474750; } .file-label input { display:none; }
+ .settings { display:flex; min-width:0; flex-direction:column; gap:14px; } .setting-group { display:grid; grid-template-columns:1fr 1fr; gap:11px; }
+ .field { display:flex; min-width:0; flex-direction:column; gap:6px; } .field.full { grid-column:1 / -1; }
+ .field label { color:#777780; font-size:9px; font-weight:760; letter-spacing:.1em; text-transform:uppercase; }
+ .field input,.field select,.field textarea { width:100%; min-width:0; padding:10px 11px; border:1px solid var(--line); border-radius:9px; outline:0; color:var(--text); background:var(--panel-2); font-size:12px; }
+ .field textarea { min-height:92px; resize:vertical; line-height:1.5; } .field input:focus,.field select:focus,.field textarea:focus { border-color:rgba(0,229,255,.45); }
+ .setting-note { margin:0; color:#707079; font-size:10.5px; line-height:1.55; }
+ .primary { display:inline-flex; min-height:42px; align-items:center; justify-content:center; padding:11px 17px; border:0; border-radius:11px; color:#0b0b0c; background:var(--silver); box-shadow:inset 0 1px rgba(255,255,255,.75); font-size:12px; font-weight:760; cursor:pointer; }
+ .primary:hover { filter:brightness(1.08); } .primary:disabled { opacity:.52; cursor:default; filter:none; }
+ .primary.busy::before { content:""; width:12px; height:12px; margin-right:8px; border:1.5px solid currentColor; border-right-color:transparent; border-radius:50%; animation:spin .7s linear infinite; }
+ .secondary { display:inline-flex; min-height:36px; align-items:center; justify-content:center; padding:8px 12px; border:1px solid var(--line-strong); border-radius:9px; color:#d5d5da; background:var(--panel-2); font-size:11px; font-weight:650; cursor:pointer; text-decoration:none; }
+ .secondary:hover { border-color:#55555f; background:#232328; } .secondary:disabled { opacity:.48; cursor:default; }
+ .status { display:none; margin-top:12px; padding:11px 12px; border:1px solid var(--line); border-radius:9px; color:#aaaab2; background:#111114; font-size:11px; line-height:1.5; }
+ .status.show { display:block; } .status.error { border-color:rgba(251,113,133,.3); color:#f3a5b0; background:rgba(251,113,133,.045); }
+ #planPanel[hidden],#runPanel[hidden] { display:none; }
+ .plan-actions { display:flex; flex-wrap:wrap; justify-content:flex-end; gap:8px; }
+ .summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin-bottom:18px; }
+ .summary-card { min-width:0; padding:14px; border:1px solid var(--line); border-radius:12px; background:rgba(16,16,19,.82); }
+ .summary-card small { display:block; color:#66666f; font-size:8.5px; font-weight:760; letter-spacing:.1em; text-transform:uppercase; }
+ .summary-card b { display:block; overflow:hidden; margin-top:6px; color:#dedee2; font-size:14px; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
+ .summary-card.warning { border-color:rgba(251,191,36,.24); background:rgba(251,191,36,.035); } .summary-card.warning b { color:#f5cf70; }
+ .rationale { margin:0 0 18px; padding:14px 15px; border-left:2px solid var(--accent); border-radius:0 10px 10px 0; color:#96969f; background:rgba(0,229,255,.035); font-size:11.5px; line-height:1.6; }
+ .timeline { position:relative; min-height:112px; overflow:hidden; margin-bottom:20px; border:1px solid var(--line); border-radius:13px; background:#0f0f12; }
+ .timeline-ruler { display:grid; grid-template-columns:repeat(6,1fr); height:30px; border-bottom:1px solid var(--line); color:#65656e; font:8.5px/30px ui-monospace,Consolas,monospace; }
+ .timeline-ruler span { padding-left:8px; border-left:1px solid rgba(255,255,255,.035); } .timeline-ruler span:first-child { border-left:0; }
+ .timeline-track { position:relative; height:80px; background-image:linear-gradient(90deg,transparent calc(100% - 1px),rgba(255,255,255,.035) calc(100% - 1px)); background-size:16.666% 100%; }
+ .timeline-block { position:absolute; top:17px; min-width:5px; height:46px; overflow:hidden; padding:6px 7px; border:1px solid rgba(0,229,255,.34); border-radius:8px; color:#c9faff; background:linear-gradient(180deg,rgba(0,229,255,.18),rgba(0,229,255,.07)); font-size:8.5px; line-height:1.25; box-shadow:0 8px 18px rgba(0,0,0,.22); cursor:pointer; }
+ .timeline-block.low { border-color:rgba(255,255,255,.2); color:#c5c5cb; background:rgba(255,255,255,.07); }
+ .timeline-block.off { top:28px; height:24px; border-color:#303038; color:#5d5d65; background:#17171b; opacity:.72; }
+ .timeline-block b { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .timeline-block span { display:block; margin-top:3px; opacity:.7; }
+ .segment-list { display:grid; gap:10px; }
+ .segment { display:grid; grid-template-columns:44px minmax(180px,.8fr) minmax(360px,1.5fr); overflow:hidden; border:1px solid var(--line); border-radius:13px; background:rgba(15,15,18,.84); }
+ .segment-toggle { display:flex; align-items:flex-start; justify-content:center; padding-top:17px; border-right:1px solid var(--line); } .segment-toggle input { width:16px; height:16px; accent-color:var(--accent); }
+ .segment-copy { min-width:0; padding:14px; border-right:1px solid var(--line); }
+ .segment-kicker { display:flex; align-items:center; gap:7px; margin-bottom:8px; color:#6f6f78; font-size:8.5px; font-weight:760; letter-spacing:.1em; text-transform:uppercase; }
+ .criticality { padding:3px 5px; border:1px solid #34343b; border-radius:5px; color:#9999a2; } .criticality.high { border-color:rgba(251,191,36,.25); color:#eac65f; }
+ .spoken { color:#d1d1d6; font-size:11px; line-height:1.55; } .why { margin-top:9px; color:#75757e; font-size:9.5px; line-height:1.48; }
+ .segment-controls { display:grid; grid-template-columns:105px 90px minmax(160px,1fr); gap:10px; align-items:start; padding:13px; }
+ .segment-controls .field label { font-size:8px; } .segment-controls .prompt-field { grid-column:1 / -1; } .segment-controls textarea { min-height:62px; }
+ .segment.is-off { opacity:.55; } .segment.is-off .segment-controls { pointer-events:none; }
+ .run-overview { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:18px; align-items:center; margin-bottom:16px; }
+ .run-copy h3 { margin:0; font-size:15px; } .run-copy p { margin:5px 0 0; color:var(--muted); font-size:11px; }
+ .progress { height:5px; overflow:hidden; margin-top:11px; border-radius:99px; background:#27272d; } .progress span { display:block; width:100%; height:100%; transform:scaleX(0); transform-origin:left; background:linear-gradient(90deg,var(--accent),#a5f3fc); transition:transform .3s; }
+ .run-list { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:10px; }
+ .run-item { overflow:hidden; border:1px solid var(--line); border-radius:12px; background:#111114; } .run-item.done { border-color:rgba(74,222,128,.2); } .run-item.error { border-color:rgba(251,113,133,.3); }
+ .run-thumb { display:grid; aspect-ratio:16/9; place-items:center; overflow:hidden; border-bottom:1px solid var(--line); color:#5f5f68; background:#0a0a0c; font-size:10px; } .run-thumb img { width:100%; height:100%; object-fit:contain; }
+ .run-item-body { padding:11px; } .run-item-title { display:flex; justify-content:space-between; gap:8px; color:#d4d4d9; font-size:10.5px; font-weight:650; } .run-item-status { margin-top:5px; color:#777780; font-size:9px; }
+ .run-item-actions { display:flex; gap:6px; margin-top:9px; } .run-item-actions a { padding:6px 8px; border:1px solid var(--line); border-radius:7px; color:#cfcfd4; background:#1c1c20; font-size:9px; text-decoration:none; }
+ .empty { grid-column:1 / -1; padding:32px; border:1px dashed var(--line); border-radius:12px; color:#6d6d76; font-size:11px; text-align:center; }
+ .toast { position:fixed; z-index:80; left:50%; bottom:24px; max-width:min(560px,calc(100vw - 32px)); padding:10px 14px; border:1px solid #3a3a42; border-radius:10px; color:#ececef; background:#1b1b20; box-shadow:0 16px 44px rgba(0,0,0,.48); font-size:11px; opacity:0; transform:translate(-50%,10px); pointer-events:none; transition:.2s; }
+ .toast.show { opacity:1; transform:translate(-50%,0); }
+ @keyframes spin { to { transform:rotate(360deg); } }
+ @media (max-width:980px) { .intro,.ingest-grid { grid-template-columns:1fr; } .intro { gap:24px; } .summary-grid { grid-template-columns:1fr 1fr; } .segment { grid-template-columns:40px 1fr; } .segment-copy { border-right:0; } .segment-controls { grid-column:2; border-top:1px solid var(--line); } .run-list { grid-template-columns:1fr 1fr; } }
+ @media (max-width:660px) { header { align-items:flex-start; flex-wrap:wrap; } .header-actions { width:100%; flex-wrap:nowrap; overflow-x:auto; justify-content:flex-start; padding-bottom:2px; } .header-actions > * { flex:0 0 auto; } .bridge { display:none; } main { padding-top:28px; } .steps { grid-template-columns:1fr; } .step { border-top:1px solid var(--line); border-left:0; } .step:first-child { border-top:0; } .panel-head { flex-direction:column; } .plan-actions { justify-content:flex-start; } .panel-body { padding:15px; } .script-box textarea { min-height:260px; } .summary-grid,.run-list { grid-template-columns:1fr; } .segment { grid-template-columns:36px 1fr; } .segment-copy { padding:12px; } .segment-controls { grid-template-columns:1fr 1fr; padding:11px; } .segment-controls .template-field,.segment-controls .prompt-field { grid-column:1 / -1; } .run-overview { grid-template-columns:1fr; } }
+ @media (pointer:coarse) { button, select, input, .file-label, .primary { min-height:44px; } }
+</style>
+<link rel="stylesheet" href="site-shell.css" />
+<script src="site-shell.js" defer></script>
+</head>
+<body>
+ <header>
+ <a class="brand" href="./"><img src="assets/null-logo.png" alt="Null" /><b>Null</b> <span>Motion</span></a>
+ <nav class="header-actions" aria-label="Null Motion pages">
+ <a class="header-link" href="./">Templates</a>
+ <a class="header-link" href="create.html">Reference studio</a>
+ <a class="header-link active" href="script.html" aria-current="page">Script to motion</a>
+ <a class="header-link" href="system-map.html">Director pipeline</a>
+ <a class="header-link" href="control-center.html">Control Center</a>
+ <a class="header-link" href="renders.html">Renders</a>
+ <div class="bridge" id="bridge"><span class="bridge-dot"></span><span id="bridgeText">Checking bridge</span></div>
+ </nav>
+ </header>
+ <main>
+ <section class="intro">
+ <div><div class="eyebrow">Script director</div><h1>Turn a script into a motion timeline.</h1><p>Paste a finished script or timecoded transcript. Null finds the moments where graphics improve the edit, builds an editable timeline, then renders each approved overlay independently for your video.</p></div>
+ <div class="steps" aria-label="Workflow">
+ <div class="step active" id="step1"><small>01 · Input</small><b>Paste the script</b></div>
+ <div class="step" id="step2"><small>02 · Review</small><b>Edit the timeline</b></div>
+ <div class="step" id="step3"><small>03 · Render</small><b>Generate overlays</b></div>
+ </div>
+ </section>
+ <section class="panel" id="inputPanel">
+ <div class="panel-head"><div class="panel-title"><h2>Video script</h2><p>Plain scripts, timestamped lines, SRT, and VTT are supported.</p></div></div>
+ <div class="panel-body"><div class="ingest-grid">
+ <div class="script-box">
+ <textarea id="scriptInput" spellcheck="true" placeholder="Paste your script here…
+
+Optional timecode format:
+[00:00] Your opening line
+[00:08] The next idea
+[00:17] A key statistic or product moment"></textarea>
+ <div class="script-tools"><label class="file-label">Import .txt / .srt / .vtt<input id="scriptFile" type="file" accept=".txt,.md,.srt,.vtt,text/plain,text/vtt,application/x-subrip" /></label><span id="scriptStats">0 words</span></div>
+ </div>
+ <div class="settings">
+ <div class="setting-group">
+ <div class="field full"><label for="videoDuration">Video duration</label><input id="videoDuration" placeholder="Auto, 01:30, or 90 seconds" /></div>
+ <div class="field"><label for="videoFormat">Video format</label><select id="videoFormat"><option value="1920x1080">16:9 · 1920×1080</option><option value="1080x1920">9:16 · 1080×1920</option><option value="1080x1080">1:1 · 1080×1080</option><option value="3840x2160">4K · 3840×2160</option></select></div>
+ <div class="field"><label for="videoFps">Frame rate</label><select id="videoFps"><option>23.976</option><option>25</option><option>29.97</option><option selected>30</option><option>50</option><option>59.94</option></select></div>
+ <div class="field"><label for="provider">Director</label><select id="provider"><option value="codex" selected>ChatGPT / Codex</option><option value="claude">Claude Code</option><option value="anthropic">Anthropic API</option></select></div>
+ <div class="field"><label for="density">Coverage</label><select id="density"><option value="strategic" selected>Strategic highlights</option><option value="continuous">Continuous coverage</option></select></div>
+ <div class="field"><label for="assetMode">Real assets</label><select id="assetMode"><option value="strict" selected>Strict</option><option value="relaxed">Relaxed</option><option value="none">Off</option></select></div>
+ <div class="field"><label for="renderMode">Render quality</label><select id="renderMode"><option value="preview">Preview · Fast</option><option value="production" selected>Production</option><option value="high-end">High-end</option></select></div>
+ <div class="field full"><label for="guidance">Direction (optional)</label><textarea id="guidance" placeholder="Audience, tone, brand rules, moments to emphasize, or anything the director should know."></textarea></div>
+ </div>
+ <p class="setting-note">Untimed scripts are paced from their word count. Add a video duration when the final cut has pauses, interviews, or large sections without narration.</p>
+ <button class="primary" id="analyzeButton" type="button">Build motion timeline</button>
+ <div class="status" id="inputStatus" role="status" aria-live="polite"></div>
+ </div>
+ </div></div>
+ </section>
+ <section class="panel" id="planPanel" hidden>
+ <div class="panel-head">
+ <div class="panel-title"><h2>Motion timeline</h2><p>Only checked beats will become Null Motion graphics. Timing is relative to the start of the video.</p></div>
+ <div class="plan-actions"><button class="secondary" id="copyTimeline" type="button">Copy timeline script</button><button class="secondary" id="downloadTimeline" type="button">Download JSON</button><button class="primary" id="generateButton" type="button">Generate selected graphics</button></div>
+ </div>
+ <div class="panel-body">
+ <div class="summary-grid" id="summaryGrid"></div><p class="rationale" id="rationale"></p>
+ <div class="timeline" id="timeline"><div class="timeline-ruler" id="timelineRuler"></div><div class="timeline-track" id="timelineTrack"></div></div>
+ <div class="segment-list" id="segmentList"></div><div class="status" id="planStatus" role="status" aria-live="polite"></div>
+ </div>
+ </section>
+ <section class="panel" id="runPanel" hidden>
+ <div class="panel-head">
+ <div class="panel-title"><h2>Sequence render</h2><p>Each overlay is rendered independently, so completed graphics survive partial failures.</p></div>
+ <div class="plan-actions"><button class="secondary" id="cancelButton" type="button">Cancel remaining</button><button class="secondary" id="retryButton" type="button" hidden>Retry failures</button></div>
+ </div>
+ <div class="panel-body">
+ <div class="run-overview"><div class="run-copy"><h3 id="runTitle">Preparing sequence</h3><p id="runStatus">Waiting for the companion</p><div class="progress"><span id="runProgress"></span></div></div></div>
+ <div class="run-list" id="runList"><div class="empty">Sequence jobs will appear here.</div></div>
+ </div>
+ </section>
+ </main>
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
+ <script src="script-workspace.js"></script>
+</body>
+</html>
diff --git a/public/site-shell.css b/public/site-shell.css
new file mode 100644
index 0000000..2be2e2b
--- /dev/null
+++ b/public/site-shell.css
@@ -0,0 +1,325 @@
+:root {
+ --null-shell-top: 76px;
+ --null-shell-dock: 620px;
+ --null-shell-bg: #0b0c10;
+ --null-shell-panel: #14161c;
+ --null-shell-raised: #1c1f26;
+ --null-shell-line: rgba(255, 255, 255, .09);
+ --null-shell-line-strong: rgba(255, 255, 255, .17);
+ --null-shell-text: #ececef;
+ --null-shell-muted: #858994;
+ --null-shell-ease: cubic-bezier(.16, 1, .3, 1);
+}
+
+* { box-sizing: border-box; }
+
+body {
+ padding-top: var(--null-shell-top) !important;
+ background:
+ radial-gradient(920px 520px at 9% -8%, rgba(212, 206, 190, .055), transparent 64%),
+ radial-gradient(760px 480px at 96% 24%, rgba(255, 255, 255, .022), transparent 66%),
+ var(--null-shell-bg) !important;
+ transition: padding-right 240ms var(--null-shell-ease);
+}
+
+body > header:not(.null-site-topbar) { display: none !important; }
+
+.null-skip-link {
+ position: fixed;
+ z-index: 1200;
+ top: 8px;
+ left: 16px;
+ padding: 10px 14px;
+ border: 1px solid var(--null-shell-line-strong);
+ border-radius: 10px;
+ background: #f1f0ec;
+ color: #101114;
+ font: 750 12px/1 Inter, system-ui, sans-serif;
+ text-decoration: none;
+ transform: translateY(-150%);
+ transition: transform 150ms ease;
+}
+
+.null-skip-link:focus { transform: translateY(0); }
+
+.null-site-topbar {
+ position: fixed;
+ z-index: 1000;
+ top: 0;
+ right: 18px;
+ left: 18px;
+ display: flex;
+ align-items: center;
+ gap: 4px;
+ min-height: 56px;
+ margin-top: 10px;
+ padding: 6px;
+ overflow: hidden;
+ border: 1px solid var(--null-shell-line);
+ border-radius: 15px;
+ background: rgba(13, 14, 18, .91);
+ box-shadow: 0 16px 40px rgba(0, 0, 0, .25), inset 0 1px rgba(255, 255, 255, .045);
+ backdrop-filter: blur(22px) saturate(125%);
+ transition: right 240ms var(--null-shell-ease);
+}
+
+.null-shell-brand {
+ display: inline-flex;
+ min-width: 142px;
+ min-height: 42px;
+ align-items: center;
+ gap: 9px;
+ padding: 5px 10px 5px 6px;
+ border-radius: 10px;
+ color: var(--null-shell-text);
+ text-decoration: none;
+}
+
+.null-shell-brand:hover { background: rgba(255, 255, 255, .04); }
+.null-shell-brand-mark {
+ display: grid;
+ width: 30px;
+ height: 30px;
+ place-items: center;
+ border: 1px solid rgba(255, 255, 255, .15);
+ border-radius: 9px;
+ background: linear-gradient(145deg, #31333a, #1b1d22);
+ color: #f6f4ef;
+ font: 800 12px/1 Inter, system-ui, sans-serif;
+ box-shadow: inset 0 1px rgba(255, 255, 255, .08);
+}
+
+.null-shell-brand-copy { display: grid; gap: 1px; }
+.null-shell-brand-copy b { font: 760 12px/1 Inter, system-ui, sans-serif; letter-spacing: -.01em; }
+.null-shell-brand-copy small { color: var(--null-shell-muted); font: 600 9px/1 Inter, system-ui, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
+.null-shell-nav { display: flex; min-width: 0; flex: 1; gap: 3px; }
+
+.null-shell-link,
+.null-shell-action {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 9px;
+ min-width: 0;
+ min-height: 42px;
+ padding: 7px 13px;
+ border: 1px solid transparent;
+ border-radius: 10px;
+ background: transparent;
+ color: var(--null-shell-muted);
+ font: 700 12px/1 Inter, -apple-system, "SF Pro Display", system-ui, sans-serif;
+ text-decoration: none;
+ white-space: nowrap;
+ cursor: pointer;
+ transition: color 150ms ease, background 150ms ease, border-color 150ms ease, transform 150ms ease;
+}
+
+.null-shell-link { flex: 1 1 108px; }
+.null-shell-link:hover,
+.null-shell-action:hover { color: var(--null-shell-text); background: rgba(255, 255, 255, .045); }
+
+.null-shell-link[aria-current="page"] {
+ border-color: rgba(235, 232, 222, .18);
+ background: linear-gradient(145deg, #303136, #202126);
+ color: #f5f3ee;
+ box-shadow: 0 8px 18px rgba(0, 0, 0, .26), inset 0 1px rgba(255, 255, 255, .09);
+}
+
+.null-shell-link[aria-current="page"]::after {
+ position: absolute;
+ right: 14px;
+ bottom: 2px;
+ left: 14px;
+ height: 2px;
+ border-radius: 2px;
+ background: linear-gradient(90deg, transparent, #f0eee8 18%, #f0eee8 82%, transparent);
+ content: "";
+}
+
+.null-shell-link { position: relative; }
+.null-shell-glyph {
+ display: grid;
+ width: 24px;
+ height: 24px;
+ flex: 0 0 24px;
+ place-items: center;
+ border: 1px solid rgba(255, 255, 255, .10);
+ border-radius: 7px;
+ background: rgba(255, 255, 255, .025);
+}
+
+.null-shell-glyph svg,
+.null-shell-action > svg {
+ width: 16px;
+ height: 16px;
+ fill: none;
+ stroke: currentColor;
+ stroke-width: 1.8;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+}
+
+.null-shell-spacer { flex: 0 0 1px; align-self: stretch; margin: 5px 2px; background: var(--null-shell-line); }
+.null-shell-manage { flex: 0 0 auto; }
+
+.null-shell-ai-toggle {
+ flex: 0 0 auto;
+ border-color: rgba(255, 255, 255, .13);
+ background: #202226;
+ color: #e9e7e2;
+ box-shadow: inset 0 1px rgba(255, 255, 255, .055);
+}
+
+.null-shell-ai-state {
+ display: inline-grid;
+ min-width: 38px;
+ min-height: 25px;
+ padding: 3px 7px;
+ place-items: center;
+ border-radius: 7px;
+ background: #e8e4da;
+ color: #161718;
+ font-size: 10px;
+ font-weight: 800;
+}
+
+.null-shell-ai-toggle[aria-expanded="true"] .null-shell-ai-state { background: #34363b; color: #dad8d2; }
+.null-shell-health { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: #62656d; }
+.null-shell-health.online { background: #4ade80; box-shadow: 0 0 10px rgba(74, 222, 128, .48); }
+.null-shell-health.offline { background: #fb7185; }
+
+.null-ai-dock {
+ position: fixed;
+ z-index: 990;
+ top: 76px;
+ right: 14px;
+ bottom: 14px;
+ display: flex;
+ width: calc(var(--null-shell-dock) - 28px);
+ min-width: 0;
+ overflow: hidden;
+ flex-direction: column;
+ border: 1px solid var(--null-shell-line);
+ border-radius: 17px;
+ background: #0b0d11;
+ box-shadow: 0 28px 80px rgba(0, 0, 0, .48), 0 0 26px rgba(255, 255, 255, .025);
+ opacity: 0;
+ visibility: hidden;
+ pointer-events: none;
+ transform: translateX(18px);
+ transition: opacity 200ms ease, transform 240ms var(--null-shell-ease), visibility 200ms;
+}
+
+.null-ai-dock.open { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(0); }
+.null-ai-dock-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; min-height: 66px; padding: 10px 11px; border-bottom: 1px solid var(--null-shell-line); background: #15171d; }
+.null-ai-tabs { display: grid; min-width: 0; flex: 1 0 320px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; padding: 3px; border: 1px solid rgba(255, 255, 255, .06); border-radius: 10px; background: rgba(0, 0, 0, .28); }
+.null-ai-tab { display: inline-flex; min-width: 0; align-items: center; justify-content: center; gap: 6px; min-height: 35px; padding: 7px 8px; overflow: hidden; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #858995; font: 750 11px/1 Inter, system-ui, sans-serif; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
+.null-ai-tab:hover { color: #e5e5e8; }
+.null-ai-tab.active { border-color: rgba(235, 232, 222, .17); background: linear-gradient(145deg, #34353b, #23242a); color: #f2f1ed; box-shadow: inset 0 1px rgba(255, 255, 255, .08); }
+.null-ai-actions { display: flex; flex: 0 0 auto; gap: 6px; margin-left: auto; }
+.null-ai-action { min-height: 38px; padding: 8px 11px; border: 1px solid var(--null-shell-line); border-radius: 10px; background: #202228; color: #d7d7dc; font: 700 11px/1 Inter, system-ui, sans-serif; cursor: pointer; }
+.null-ai-action:hover { border-color: var(--null-shell-line-strong); color: #fff; }
+.null-ai-dock-body { position: relative; display: grid; min-height: 0; flex: 1; place-items: center; overflow: hidden; background: radial-gradient(560px 360px at 50% 0%, rgba(255, 255, 255, .035), transparent 66%), #090a0d; }
+.null-ai-loading { position: absolute; z-index: 3; inset: 0; display: none; place-content: center; place-items: center; padding: 30px; background: #090a0d; color: #e8e8eb; text-align: center; pointer-events: none; }
+.null-ai-loading.show { display: grid; }
+.null-ai-loading span { width: 30px; height: 30px; margin-bottom: 15px; border: 2px solid rgba(255,255,255,.14); border-top-color: #e8e6df; border-radius: 50%; animation: nullShellSpin .75s linear infinite; }
+.null-ai-loading b { font: 700 14px/1.3 Inter, system-ui, sans-serif; }
+.null-ai-loading small { margin-top: 6px; color: #777b86; font: 500 11px/1.4 Inter, system-ui, sans-serif; }
+.null-ai-fallback { max-width: 390px; padding: 30px; text-align: center; }
+.null-ai-mark { display: grid; width: 52px; height: 52px; margin: 0 auto 18px; place-items: center; border: 1px solid var(--null-shell-line-strong); border-radius: 14px; background: linear-gradient(145deg, #272930, #16181e); color: #f0f0f2; font-size: 17px; font-weight: 800; box-shadow: inset 0 1px rgba(255, 255, 255, .07), 0 12px 30px rgba(0, 0, 0, .35); }
+.null-ai-fallback h2 { margin: 0; color: #f0f0f3; font: 650 18px/1.25 Inter, system-ui, sans-serif; letter-spacing: -.02em; }
+.null-ai-fallback p { margin: 10px auto 20px; color: #818590; font: 400 12px/1.6 Inter, system-ui, sans-serif; }
+.null-ai-primary { min-height: 42px; padding: 10px 18px; border: 1px solid rgba(255, 255, 255, .28); border-radius: 10px; background: linear-gradient(180deg, #f0efec, #c7c5c1); color: #101114; font: 800 12px/1 Inter, system-ui, sans-serif; cursor: pointer; box-shadow: 0 10px 28px rgba(0, 0, 0, .35); }
+.null-ai-embed-link { display: block; margin: 15px auto 0; border: 0; background: transparent; color: #8f939e; font: 500 11px/1.2 Inter, system-ui, sans-serif; text-decoration: underline; cursor: pointer; }
+.null-ai-frame { position: absolute; inset: 0; display: none; width: 100%; height: 100%; border: 0; background: #090a0d; }
+.null-ai-frame.active { display: block; }
+.null-ai-frame-back { position: absolute; z-index: 2; right: 12px; bottom: 12px; display: none; }
+.null-ai-frame-back.active { display: block; }
+@keyframes nullShellSpin { to { transform: rotate(360deg); } }
+
+.null-ai-splitter {
+ position: fixed;
+ z-index: 995;
+ top: 80px;
+ bottom: 18px;
+ right: calc(var(--null-shell-dock) - 3px);
+ display: none;
+ width: 8px;
+ cursor: col-resize;
+}
+
+.null-ai-splitter::before { position: absolute; inset: 0 3px; border-radius: 99px; background: rgba(255, 255, 255, .16); content: ""; transition: background 150ms, box-shadow 150ms; }
+.null-ai-splitter:hover::before,
+.null-ai-splitter.dragging::before { background: #d8d5cd; box-shadow: 0 0 14px rgba(255, 255, 255, .34); }
+
+body.null-ai-dock-open { padding-right: var(--null-shell-dock) !important; }
+body.null-ai-dock-open .null-site-topbar { right: calc(var(--null-shell-dock) + 10px); }
+body.null-ai-dock-open .null-ai-splitter { display: block; }
+
+@media (max-width: 1180px) {
+ .null-shell-brand { min-width: 42px; width: 42px; padding: 6px; }
+ .null-shell-brand-copy { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
+ .null-shell-link { flex-basis: 52px; padding-inline: 8px; }
+ .null-shell-link .null-shell-label,
+ .null-shell-manage .null-shell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
+ .null-shell-manage { width: 40px; padding: 6px; }
+}
+
+@media (max-width: 860px) {
+ :root { --null-shell-top: 72px; }
+ body.null-ai-dock-open { padding-right: 0 !important; overflow: hidden; }
+ body.null-ai-dock-open::before { position: fixed; z-index: 980; inset: 0; background: rgba(4, 5, 8, .72); backdrop-filter: blur(6px); content: ""; }
+ body.null-ai-dock-open .null-site-topbar { right: 10px; }
+ .null-site-topbar { right: 10px; left: 10px; margin-top: 8px; }
+ .null-shell-spacer, .null-shell-manage { display: none; }
+ .null-shell-ai-toggle { width: 42px; padding: 6px; }
+ .null-shell-ai-toggle > .null-shell-label,
+ .null-shell-ai-state,
+ .null-shell-health { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
+ .null-ai-dock { z-index: 1005; top: 72px; right: 10px; bottom: 10px; left: 10px; width: auto; }
+ .null-ai-splitter { display: none !important; }
+}
+
+@media (max-width: 560px) {
+ .null-site-topbar { gap: 2px; overflow: hidden; }
+ .null-shell-nav { overflow-x: auto; scrollbar-width: none; }
+ .null-shell-nav::-webkit-scrollbar { display: none; }
+ .null-shell-link { min-width: 42px; flex: 0 0 42px; }
+ .null-shell-link .null-shell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
+ .null-shell-ai-toggle { margin-left: auto; }
+ .null-ai-dock-head { align-items: stretch; flex-direction: column; }
+ .null-ai-tabs { width: 100%; }
+ .null-ai-tab { flex: 1; justify-content: center; }
+ .null-ai-actions { justify-content: flex-end; }
+}
+
+@media (pointer: coarse) {
+ .null-skip-link { min-height: 44px; }
+ .null-shell-brand,
+ .null-shell-link,
+ .null-shell-action,
+ .null-ai-tab,
+ .null-ai-action { min-height: 44px; }
+ .null-shell-brand,
+ .null-shell-link,
+ .null-shell-action { min-width: 44px; }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ body,
+ .null-site-topbar,
+ .null-ai-dock,
+ .null-shell-link,
+ .null-shell-action,
+ .null-ai-tab,
+ .null-ai-action,
+ .null-skip-link { transition: none !important; }
+ .null-ai-loading span { animation: none; border-color: rgba(255,255,255,.5); }
+}
+/* Public starter status stays visible on every inherited workspace page. */
+.null-public-notice {
+ margin: 10px 24px 0;
+ color: #aaaab3;
+ font: 12px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ text-align: center;
+}
diff --git a/public/site-shell.js b/public/site-shell.js
new file mode 100644
index 0000000..35c6aac
--- /dev/null
+++ b/public/site-shell.js
@@ -0,0 +1,214 @@
+(() => {
+ "use strict";
+
+ const pages = [
+ { key: "templates", href: "./", label: "Templates", icon: '<rect x="4" y="4" width="16" height="16" rx="2"></rect><path d="M4 9h16M9 9v11"></path>' },
+ { key: "reference", href: "create.html", label: "Reference", icon: '<rect x="3" y="4" width="18" height="16" rx="2"></rect><circle cx="8.5" cy="9" r="1.5"></circle><path d="m21 15-4.2-4.2L8 19"></path>' },
+ { key: "script", href: "script.html", label: "Script", icon: '<path d="M6 3h8l4 4v14H6z"></path><path d="M14 3v5h5M9 12h6M9 16h4"></path>' },
+ { key: "pipeline", href: "system-map.html", label: "Pipeline", icon: '<circle cx="5" cy="12" r="2"></circle><circle cx="12" cy="5" r="2"></circle><circle cx="19" cy="12" r="2"></circle><circle cx="12" cy="19" r="2"></circle><path d="m6.5 10.5 4-4m3 0 4 4m0 3-4 4m-3 0-4-4"></path>' },
+ { key: "control", href: "control-center.html", label: "Control", icon: '<path d="M4 6h10M18 6h2M4 12h2M10 12h10M4 18h7M15 18h5"></path><circle cx="16" cy="6" r="2"></circle><circle cx="8" cy="12" r="2"></circle><circle cx="13" cy="18" r="2"></circle>' },
+ { key: "renders", href: "renders.html", label: "Renders", icon: '<rect x="3" y="5" width="18" height="14" rx="2"></rect><path d="m10 9 5 3-5 3z"></path>' }
+ ];
+ const tools = {
+ grok: { name: "Grok", url: "https://x.com/i/grok" },
+ perplexity: { name: "Perplexity", url: "https://www.perplexity.ai/" },
+ chatgpt: { name: "ChatGPT", url: "https://chatgpt.com/" },
+ gemini: { name: "Gemini", url: "https://gemini.google.com/app" }
+ };
+ const OPEN_KEY = "nullMotionAiDockOpen";
+ const WIDTH_KEY = "nullMotionAiDockWidth";
+ const TOOL_KEY = "nullMotionAiDockTool";
+ let activeTool = read(TOOL_KEY) || "grok";
+ if (!tools[activeTool]) activeTool = "grok";
+ let dockOpen = read(OPEN_KEY) === "1";
+ let popup = null;
+ let dragging = false;
+
+ function read(key) { try { return localStorage.getItem(key); } catch (_) { return null; } }
+ function write(key, value) { try { localStorage.setItem(key, value); } catch (_) {} }
+ function activePage() {
+ const file = location.pathname.split("/").pop().toLowerCase();
+ if (file === "create.html") return "reference";
+ if (file === "script.html") return "script";
+ if (file === "system-map.html") return "pipeline";
+ if (file === "control-center.html") return "control";
+ if (file === "renders.html") return "renders";
+ return "templates";
+ }
+ function pageLink(page) {
+ const current = activePage() === page.key ? ' aria-current="page"' : "";
+ return `<a class="null-shell-link" href="${page.href}" title="${page.label}"${current}><span class="null-shell-glyph" aria-hidden="true"><svg viewBox="0 0 24 24">${page.icon}</svg></span><span class="null-shell-label">${page.label}</span></a>`;
+ }
+
+ function mount() {
+ const main = document.querySelector("main, body > section");
+ if (main && !main.id) main.id = "nullMainContent";
+
+ const skipLink = document.createElement("a");
+ skipLink.className = "null-skip-link";
+ skipLink.href = `#${main?.id || "nullMainContent"}`;
+ skipLink.textContent = "Skip to content";
+
+ const topbar = document.createElement("header");
+ topbar.className = "null-site-topbar";
+ topbar.setAttribute("aria-label", "Null Motion navigation");
+ topbar.innerHTML = `<a class="null-shell-brand" href="./" aria-label="Null Motion home"><span class="null-shell-brand-mark" aria-hidden="true">N</span><span class="null-shell-brand-copy"><b>Null</b><small>Motion</small></span></a><nav class="null-shell-nav" aria-label="Workspace">${pages.map(pageLink).join("")}</nav><span class="null-shell-spacer" aria-hidden="true"></span><button class="null-shell-action null-shell-manage" id="nullShellManage" type="button" title="Manage templates"><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M12 3v18M3 12h18"></path></svg><span class="null-shell-label">Manage</span></button><button class="null-shell-action null-shell-ai-toggle" id="nullAiToggle" type="button" aria-controls="nullAiDock" aria-expanded="false"><span class="null-shell-health" id="nullShellHealth" aria-hidden="true"></span><svg viewBox="0 0 24 24" aria-hidden="true"><path d="M4 5.5A2.5 2.5 0 0 1 6.5 3h11A2.5 2.5 0 0 1 20 5.5v9a2.5 2.5 0 0 1-2.5 2.5H11l-4.5 4v-4A2.5 2.5 0 0 1 4 14.5z"></path><path d="M8 8h8M8 12h5"></path></svg><span class="null-shell-label">AI tools</span><span class="null-shell-ai-state">Open</span></button>`;
+
+ const dock = document.createElement("aside");
+ dock.className = "null-ai-dock";
+ dock.id = "nullAiDock";
+ dock.setAttribute("aria-label", "AI tools");
+ dock.innerHTML = `<div class="null-ai-dock-head"><div class="null-ai-tabs" role="tablist" aria-label="AI workspace">${Object.entries(tools).map(([key, tool]) => `<button class="null-ai-tab" type="button" role="tab" data-tool="${key}" aria-selected="false">${tool.name}</button>`).join("")}</div><div class="null-ai-actions"><button class="null-ai-action" id="nullAiReload" type="button" title="Reload this AI tab" aria-label="Reload this AI tab">↻</button><button class="null-ai-action" id="nullAiOpen" type="button">Open ↗</button><button class="null-ai-action" id="nullAiClose" type="button">Hide</button></div></div><div class="null-ai-dock-body"><div class="null-ai-loading" id="nullAiLoading" role="status"><span></span><b>Loading ${tools[activeTool].name}</b><small>Preparing your signed-in session…</small></div>${Object.entries(tools).map(([key, tool]) => `<iframe class="null-ai-frame" data-tool-frame="${key}" title="${tool.name}" allow="clipboard-read; clipboard-write; microphone; camera; fullscreen" referrerpolicy="no-referrer"></iframe>`).join("")}</div>`;
+
+ const splitter = document.createElement("div");
+ splitter.className = "null-ai-splitter";
+ splitter.id = "nullAiSplitter";
+ splitter.setAttribute("role", "separator");
+ splitter.setAttribute("aria-label", "Resize workspace and AI dock");
+ splitter.setAttribute("aria-orientation", "vertical");
+ splitter.tabIndex = -1;
+ document.body.prepend(skipLink, topbar);
+ const notice = document.createElement("p");
+ notice.className = "null-public-notice";
+ notice.setAttribute("role", "note");
+ notice.textContent = "UI preview · Browse templates and explore the workspace. Generation, rendering, and Premiere are not connected yet.";
+ topbar.after(notice);
+ document.body.append(splitter, dock);
+ bind(topbar, dock, splitter);
+ applySavedWidth();
+ selectTool(activeTool);
+ setDockOpen(dockOpen, false);
+ checkHealth();
+ if (activePage() === "templates" && new URLSearchParams(location.search).get("manage") === "1") {
+ document.getElementById("addTemplateBtn")?.click();
+ history.replaceState(null, "", location.pathname + location.hash);
+ }
+ }
+
+ function bind(topbar, dock, splitter) {
+ const toggle = topbar.querySelector("#nullAiToggle");
+ toggle.addEventListener("click", () => setDockOpen(!dockOpen));
+ dock.querySelector("#nullAiClose").addEventListener("click", () => setDockOpen(false));
+ dock.querySelector("#nullAiOpen").addEventListener("click", openTool);
+ dock.querySelector("#nullAiReload").addEventListener("click", reloadActiveTool);
+ dock.querySelectorAll(".null-ai-tab").forEach(tab => tab.addEventListener("click", () => selectTool(tab.dataset.tool)));
+ dock.querySelectorAll(".null-ai-frame").forEach(frame => frame.addEventListener("load", () => {
+ if (frame.dataset.toolFrame === activeTool) setLoading(false);
+ }));
+ topbar.querySelector("#nullShellManage").addEventListener("click", () => {
+ const manager = document.getElementById("addTemplateBtn");
+ if (manager) manager.click();
+ else location.href = "./?manage=1";
+ });
+ splitter.addEventListener("pointerdown", event => {
+ if (!dockOpen || innerWidth <= 860) return;
+ dragging = true;
+ splitter.classList.add("dragging");
+ document.body.style.userSelect = "none";
+ splitter.setPointerCapture?.(event.pointerId);
+ });
+ splitter.addEventListener("keydown", event => {
+ if (!dockOpen || !["ArrowLeft", "ArrowRight"].includes(event.key)) return;
+ event.preventDefault();
+ const current = parseInt(getComputedStyle(document.documentElement).getPropertyValue("--null-shell-dock"), 10) || 620;
+ setDockWidth(current + (event.key === "ArrowLeft" ? 24 : -24));
+ });
+ addEventListener("pointermove", event => {
+ if (!dragging) return;
+ setDockWidth(innerWidth - event.clientX, false);
+ });
+ addEventListener("pointerup", () => {
+ if (!dragging) return;
+ dragging = false;
+ splitter.classList.remove("dragging");
+ document.body.style.userSelect = "";
+ write(WIDTH_KEY, getComputedStyle(document.documentElement).getPropertyValue("--null-shell-dock").trim());
+ });
+ addEventListener("keydown", event => { if (event.key === "Escape" && dockOpen) setDockOpen(false); });
+ addEventListener("message", event => {
+ if (event.source !== window || event.data?.source !== "null-quick") return;
+ if (event.data?.type === "embedReady" && dockOpen) loadActiveTool(true);
+ });
+ }
+
+ function setDockOpen(open, persist = true) {
+ dockOpen = Boolean(open);
+ document.body.classList.toggle("null-ai-dock-open", dockOpen);
+ const dock = document.getElementById("nullAiDock");
+ const toggle = document.getElementById("nullAiToggle");
+ const state = toggle.querySelector(".null-shell-ai-state");
+ dock.classList.toggle("open", dockOpen);
+ dock.setAttribute("aria-hidden", dockOpen ? "false" : "true");
+ dock.inert = !dockOpen;
+ toggle.setAttribute("aria-expanded", dockOpen ? "true" : "false");
+ state.textContent = dockOpen ? "Hide" : "Open";
+ document.getElementById("nullAiSplitter").tabIndex = dockOpen ? 0 : -1;
+ if (dockOpen) loadActiveTool();
+ if (persist) write(OPEN_KEY, dockOpen ? "1" : "0");
+ }
+
+ function setDockWidth(value, persist = true) {
+ const min = Math.min(420, innerWidth * .44);
+ const max = Math.max(min, innerWidth - 560);
+ const width = Math.round(Math.min(Math.max(Number(value) || 620, min), max));
+ document.documentElement.style.setProperty("--null-shell-dock", `${width}px`);
+ if (persist) write(WIDTH_KEY, `${width}px`);
+ }
+ function applySavedWidth() { setDockWidth(parseInt(read(WIDTH_KEY), 10) || Math.max(520, innerWidth * .36), false); }
+
+ function selectTool(key) {
+ if (!tools[key]) return;
+ activeTool = key;
+ write(TOOL_KEY, key);
+ document.querySelectorAll(".null-ai-tab").forEach(tab => {
+ const selected = tab.dataset.tool === key;
+ tab.classList.toggle("active", selected);
+ tab.setAttribute("aria-selected", selected ? "true" : "false");
+ });
+ document.querySelectorAll(".null-ai-frame").forEach(frame => frame.classList.toggle("active", frame.dataset.toolFrame === key));
+ if (dockOpen) loadActiveTool();
+ }
+
+ function activeFrame() { return document.querySelector(`.null-ai-frame[data-tool-frame="${activeTool}"]`); }
+ function setLoading(loading) {
+ const panel = document.getElementById("nullAiLoading");
+ if (!panel) return;
+ panel.classList.toggle("show", loading);
+ panel.querySelector("b").textContent = `Loading ${tools[activeTool].name}`;
+ }
+ function loadActiveTool(force = false) {
+ const frame = activeFrame();
+ if (!frame || (frame.src && !force)) return;
+ setLoading(true);
+ frame.src = tools[activeTool].url;
+ }
+ function reloadActiveTool() {
+ const frame = activeFrame();
+ if (!frame) return;
+ setLoading(true);
+ frame.src = tools[activeTool].url;
+ }
+
+ function openTool() {
+ const tool = tools[activeTool];
+ const width = Math.max(460, Math.min(650, Math.round((screen.availWidth || 1440) * .36)));
+ const left = (Number(screen.availLeft) || 0) + Math.max(0, (screen.availWidth || 1440) - width);
+ popup = window.open(tool.url, `null-motion-${activeTool}`, `popup=yes,width=${width},height=${screen.availHeight || 900},left=${left},top=0`);
+ popup?.focus();
+ }
+
+ async function checkHealth() {
+ const indicator = document.getElementById("nullShellHealth");
+ try {
+ const response = await fetch("/health", { cache: "no-store" });
+ indicator.className = `null-shell-health ${response.ok ? "online" : "offline"}`;
+ indicator.title = response.ok ? "UI server ready" : "UI server unavailable";
+ } catch (_) {
+ indicator.className = "null-shell-health offline";
+ indicator.title = "Companion offline";
+ }
+ }
+
+ if (document.readyState === "loading") document.addEventListener("DOMContentLoaded", mount, { once: true });
+ else mount();
+})();
diff --git a/public/system-map.html b/public/system-map.html
new file mode 100644
index 0000000..09a8eba
--- /dev/null
+++ b/public/system-map.html
@@ -0,0 +1,160 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <meta charset="utf-8" />
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
+ <title>Null Motion — Director Pipeline</title>
+ <link rel="icon" href="assets/null-logo.png" />
+ <link rel="stylesheet" href="pipeline-workspace.css" />
+ <link rel="stylesheet" href="site-shell.css" />
+ <script src="site-shell.js" defer></script>
+</head>
+<body>
+ <header class="fallback-header">
+ <a href="./">Null Motion</a>
+ <nav><a href="./">Templates</a><a href="create.html">Reference studio</a><a href="script.html">Script to motion</a><a href="system-map.html" aria-current="page">Director pipeline</a><a href="control-center.html">Control Center</a><a href="renders.html">Renders</a></nav>
+ </header>
+
+ <main class="pipeline-page">
+ <section class="pipeline-hero" aria-labelledby="pageTitle">
+ <div class="hero-copy">
+ <p class="hero-kicker">Website first. Premiere second.</p>
+ <h1 id="pageTitle">From idea to timeline.</h1>
+ <p>Follow two real paths through Null Motion. Select any step to see what it does, where it runs, and what it is allowed to change.</p>
+ <nav class="hero-actions" aria-label="Pipeline page sections">
+ <a class="button primary" href="#websiteFlowSection">Website flow</a>
+ <a class="button" href="#cepFlowSection">CEP flow</a>
+ <a class="button" href="#workspaceTitle">Edit director rules</a>
+ </nav>
+ </div>
+ <aside class="hero-status" aria-label="System boundary">
+ <div class="status-head"><span class="live-dot" id="bridgeDot"></span><b id="bridgeText">Checking local companion</b></div>
+ <dl class="boundary-list">
+ <div><dt>Website</dt><dd>Choose, plan, monitor, and download.</dd></div>
+ <div><dt>Companion</dt><dd>Research, generate, render, review, and persist.</dd></div>
+ <div><dt>CEP</dt><dd>Read Premiere and place approved media.</dd></div>
+ </dl>
+ <p>Select a step below. The highlighted detail explains the handoff and its safety boundary.</p>
+ </aside>
+ </section>
+
+ <section class="flow-section" id="websiteFlowSection" aria-labelledby="websiteFlowTitle">
+ <div class="section-heading compact">
+ <div><h2 id="websiteFlowTitle">How the website works</h2><p class="section-intro">The browser is the workspace. It sends controlled requests to the local companion, then shows durable results.</p></div>
+ <span class="flow-hint">Select a step for details</span>
+ </div>
+ <article class="flow-explorer" data-flow="website">
+ <header class="flow-explorer-head">
+ <span class="flow-mark" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="3" y="4" width="18" height="14" rx="2"></rect><path d="M8 21h8M12 18v3M3 8h18"></path></svg></span>
+ <div><h3>Browser path</h3><p>Prompt, reference, or script to a reviewed transparent render.</p></div>
+ <span class="flow-badge">No timeline access</span>
+ </header>
+ <div class="flow-track" id="websiteFlow" aria-label="Website pipeline steps"></div>
+ <div class="flow-detail" id="websiteFlowDetail" aria-live="polite"></div>
+ </article>
+ </section>
+
+ <section class="flow-section cep-flow-section" id="cepFlowSection" aria-labelledby="cepFlowTitle">
+ <div class="section-heading compact">
+ <div><h2 id="cepFlowTitle">How the CEP extension works</h2><p class="section-intro">The panel coordinates the job. ExtendScript is the narrow seam that reads and writes the Premiere project.</p></div>
+ <span class="flow-hint">Auto path shown</span>
+ </div>
+ <article class="flow-explorer cep-explorer" data-flow="cep">
+ <header class="flow-explorer-head">
+ <span class="flow-mark cep" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M4 4h16v16H4z"></path><path d="M8 16V8h3.2a2.6 2.6 0 0 1 0 5.2H8M15 16V9.5h2.2a2.3 2.3 0 0 1 0 4.6H15"></path></svg></span>
+ <div><h3>Premiere Auto path</h3><p>Corrected transcript to independent overlays at exact sequence times.</p></div>
+ <span class="flow-badge native">Only host.jsx writes</span>
+ </header>
+ <div class="flow-track" id="cepFlow" aria-label="CEP extension pipeline steps"></div>
+ <div class="flow-detail" id="cepFlowDetail" aria-live="polite"></div>
+ <div class="panel-tabs-guide" aria-label="Other CEP panel tabs">
+ <strong>Other panel tools</strong>
+ <span><b>Manual</b> one directed graphic</span>
+ <span><b>Library</b> shared authored templates</span>
+ <span><b>Batch</b> several independent prompts</span>
+ <span><b>Presets</b> starting recipes for Manual</span>
+ <span><b>History</b> recovery, inbox, retry, and rollback</span>
+ </div>
+ </article>
+ </section>
+
+ <section class="client-sync-section" aria-labelledby="clientSyncTitle">
+ <div class="section-heading compact">
+ <div><h2 id="clientSyncTitle">One companion, two clients</h2><p class="section-intro">Website and CEP share versioned behavior without sharing the same layout or host permissions.</p></div>
+ </div>
+ <div class="contract-panel">
+ <div class="contract-panel-head"><div><small>Client parity contract</small><b id="clientContractStatus">Loading live contract…</b></div><span id="clientContractVersion">Bundled fallback</span></div>
+ <div class="client-contract-grid" id="clientContractGrid"><div class="contract-loading">Checking shared capabilities against the companion…</div></div>
+ <div class="sync-policy"><b>Live versus bundled</b><span>Catalogs, jobs, themes, storyboards, and render contracts come from the running companion. CEP fallback catalogs and previews are generated by <code>npm run sync:cep</code>. Website layout never gains Premiere permissions through synchronization.</span></div>
+ </div>
+ </section>
+
+ <section class="workspace-section" aria-labelledby="workspaceTitle">
+ <div class="section-heading compact">
+ <div><h2 id="workspaceTitle">Edit the director rules</h2><p class="section-intro">These seven stages control this page’s Planning Lab. Changes stay in this browser; they do not replace server defaults.</p></div>
+ <div class="workspace-actions"><span class="save-state" id="saveState">Saved locally</span><button class="text-button" id="copyPipeline" type="button">Copy rules</button><button class="text-button" id="exportPipeline" type="button">Export JSON</button><button class="text-button" id="openImport" type="button">Import</button><button class="text-button" id="resetPipeline" type="button">Restore defaults</button></div>
+ </div>
+
+ <div class="pipeline-workspace">
+ <aside class="stage-sidebar" aria-label="Pipeline stages">
+ <div class="stage-sidebar-head"><span>Pipeline</span><small>Choose a stage to edit</small></div>
+ <div class="stage-list" id="pipeline"></div>
+ </aside>
+
+ <article class="stage-editor" id="stageEditor" aria-live="polite"></article>
+
+ <aside class="stage-readable" aria-label="Readable stage summary">
+ <div class="readable-head"><div><small>Readable view</small><b>Current stage</b></div><button class="icon-button" id="copyStage" type="button" title="Copy this stage" aria-label="Copy this stage">Copy</button></div>
+ <div id="stagePreview"></div>
+ <div class="handoff-card"><small>Pipeline handoff</small><p>Your edits are saved in this browser and applied when you run this page’s Planning Lab. They do not replace global server defaults.</p><button class="button full" id="copyJson" type="button">Copy pipeline JSON</button></div>
+ </aside>
+ </div>
+ </section>
+
+ <section class="lab-section" aria-labelledby="labTitle">
+ <div class="section-heading">
+ <div><h2 id="labTitle">Test the plan without rendering</h2></div>
+ <p>Uses the real analysis or optimization endpoint. It builds a reviewable plan without starting a render or touching Premiere.</p>
+ </div>
+ <div class="lab">
+ <div class="lab-input">
+ <div class="lab-topline"><div><h3>Source material</h3><p>Paste a complete transcript or describe one motion graphic.</p></div><span class="api-pill">Real API</span></div>
+ <div class="mode-tabs" role="tablist"><button class="mode-tab active" id="scriptMode" type="button" role="tab" aria-selected="true">Script / transcript</button><button class="mode-tab" id="promptMode" type="button" role="tab" aria-selected="false">Single prompt</button></div>
+ <div class="source-toolbar"><label id="sourceLabel" for="sourceInput">Timestamped transcript</label><div><button id="pasteSource" type="button">Paste</button><button id="exampleButton" type="button">Example</button><button id="clearSource" type="button">Clear</button></div></div>
+ <textarea id="sourceInput" spellcheck="true" placeholder="Paste a transcript, SRT, VTT, or finished script…"></textarea>
+ <div class="source-meta"><span id="sourceCount">0 words</span><span>Ctrl/⌘ + Enter to build</span></div>
+ <div class="settings">
+ <label><span>Director</span><select id="provider"><option value="codex" selected>ChatGPT / Codex</option><option value="claude">Claude Code</option><option value="anthropic">Anthropic API</option></select></label>
+ <label><span>Video duration</span><input id="duration" placeholder="Auto, 01:30, or 90" /></label>
+ <label><span>Campaign theme</span><select id="themeMode"><option value="auto">Generate from source</option><option value="active">Use saved theme</option></select></label>
+ <label><span>Graphic cadence</span><select id="pacing"><option value="strategic" selected>Strategic · selected moments</option><option value="continuous">Continuous · every useful beat</option></select></label>
+ </div>
+ <button class="run-button" id="runButton" type="button"><span>Build director plan</span><span aria-hidden="true">→</span></button>
+ <p class="lab-note">Weak moments can remain footage-only. Strict asset mode stops before rendering when a required authentic asset cannot be resolved.</p>
+ </div>
+ <div class="lab-output" id="labOutput"><div class="output-empty"><div class="output-orbit">7</div><strong>Your reviewable plan appears here</strong><span>Narrative read, timing windows, authentic asset queries, campaign theme, template choices, and the production handoff.</span></div></div>
+ </div>
+ </section>
+
+ <section class="guardrails" aria-labelledby="guardrailTitle">
+ <div class="section-heading"><div><h2 id="guardrailTitle">What the system may change</h2></div><p>Templates supply the motion concept. The source video supplies identity, evidence, and editorial purpose.</p></div>
+ <div class="guardrail-grid">
+ <article><span class="guardrail-icon green" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M4 20h4l10.5-10.5a2.8 2.8 0 0 0-4-4L4 16v4zM13 7l4 4"></path></svg></span><h3>Adapt</h3><p>Approved copy, authentic assets, campaign tokens, timing, emphasis, and bounded authored controls.</p></article>
+ <article><span class="guardrail-icon cyan" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 3 4 7v5c0 5 3.4 8 8 9 4.6-1 8-4 8-9V7l-8-4zM8 12l2.5 2.5L16 9"></path></svg></span><h3>Preserve</h3><p>Hierarchy, geometry, masks, reveal order, easing relationships, transparency, and recognizable choreography.</p></article>
+ <article><span class="guardrail-icon yellow" aria-hidden="true"><svg viewBox="0 0 24 24"><path d="M12 3a9 9 0 1 0 9 9 9 9 0 0 0-9-9zM9 9l6 6M15 9l-6 6"></path></svg></span><h3>Stop cleanly</h3><p>When a template does not fit, choose another, leave the footage clean, or author a reusable template.</p></article>
+ </div>
+ </section>
+ </main>
+
+ <dialog class="import-dialog" id="importDialog">
+ <form method="dialog">
+ <div class="dialog-head"><div><small>Pipeline import</small><h2>Paste a pipeline JSON file</h2></div><button class="dialog-close" value="cancel" aria-label="Close">×</button></div>
+ <p>Import replaces the seven editable stage drafts in this browser. Invalid or incomplete stages are safely filled from the defaults.</p>
+ <textarea id="importInput" spellcheck="false" placeholder='{"version":1,"stages":[…]}'></textarea>
+ <div class="dialog-actions"><button class="button" value="cancel">Cancel</button><button class="button primary" id="importPipeline" value="default" type="button">Import pipeline</button></div>
+ </form>
+ </dialog>
+ <div class="toast" id="toast" role="status" aria-live="polite"></div>
+ <script src="director-workspace.js"></script>
+</body>
+</html>
diff --git a/public/tokens.css b/public/tokens.css
new file mode 100644
index 0000000..848f6a9
--- /dev/null
+++ b/public/tokens.css
@@ -0,0 +1,79 @@
+/* Hallmark · macrostructure: Map / Diagram · tone: technical · anchor hue: cyan · theme: Null project system */
+/* Hallmark · pre-emit critique: P5 H5 E4 S5 R5 V5 */
+:root {
+ color-scheme: dark;
+
+ --color-paper: oklch(14% 0.012 255);
+ --color-paper-2: oklch(17% 0.013 255);
+ --color-paper-3: oklch(20% 0.014 255);
+ --color-paper-4: oklch(24% 0.015 255);
+ --color-ink: oklch(95% 0.008 245);
+ --color-ink-2: oklch(85% 0.01 245);
+ --color-muted: oklch(76% 0.012 250);
+ --color-dim: oklch(66% 0.012 250);
+ --color-rule: oklch(31% 0.014 255);
+ --color-rule-strong: oklch(43% 0.018 252);
+ --color-accent: oklch(82% 0.115 205);
+ --color-accent-ink: oklch(17% 0.022 215);
+ --color-accent-soft: oklch(82% 0.115 205 / 0.09);
+ --color-accent-rule: oklch(82% 0.115 205 / 0.34);
+ --color-success: oklch(79% 0.13 155);
+ --color-success-ink: oklch(17% 0.025 155);
+ --color-success-soft: oklch(79% 0.13 155 / 0.08);
+ --color-success-rule: oklch(79% 0.13 155 / 0.3);
+ --color-warning: oklch(84% 0.13 85);
+ --color-warning-soft: oklch(84% 0.13 85 / 0.08);
+ --color-error: oklch(72% 0.17 20);
+ --color-error-soft: oklch(72% 0.17 20 / 0.08);
+ --color-focus: oklch(89% 0.13 195);
+ --color-focus-dark: oklch(23% 0.025 215);
+ --color-overlay: oklch(7% 0.012 255 / 0.76);
+ --color-shadow: oklch(7% 0.012 255 / 0.34);
+ --color-transparent: transparent;
+
+ --font-display: Bahnschrift, "Arial Narrow", sans-serif;
+ --font-body: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
+ --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, ui-monospace, monospace;
+
+ --space-3xs: 0.125rem;
+ --space-2xs: 0.25rem;
+ --space-xs: 0.5rem;
+ --space-sm: 0.75rem;
+ --space-md: 1rem;
+ --space-lg: 1.5rem;
+ --space-xl: 2.5rem;
+ --space-2xl: 4rem;
+ --space-3xl: 6rem;
+ --space-4xl: 9rem;
+
+ --text-xs: 0.75rem;
+ --text-sm: 0.875rem;
+ --text-base: 1rem;
+ --text-md: 1.25rem;
+ --text-lg: 1.5625rem;
+ --text-xl: 1.953rem;
+ --text-2xl: 2.441rem;
+ --text-3xl: 3.052rem;
+ --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem);
+
+ --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
+ --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
+ --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
+ --dur-micro: 120ms;
+ --dur-short: 220ms;
+ --dur-long: 420ms;
+
+ --radius-sm: 0.375rem;
+ --radius-md: 0.625rem;
+ --radius-lg: 0.875rem;
+ --radius-xl: 1.125rem;
+ --radius-pill: 999px;
+ --rule-thin: 1px;
+
+ --z-base: 1;
+ --z-raised: 10;
+ --z-dropdown: 100;
+ --z-sticky: 200;
+ --z-modal: 400;
+ --z-toast: 500;
+}
diff --git a/scripts/check.js b/scripts/check.js
new file mode 100644
index 0000000..f297ce3
--- /dev/null
+++ b/scripts/check.js
@@ -0,0 +1,26 @@
+import { readdir, readFile } from 'node:fs/promises';
+import { Script } from 'node:vm';
+import { spawnSync } from 'node:child_process';
+
+let count = 0;
+async function check(directory) {
+ for (const entry of await readdir(directory, { withFileTypes: true })) {
+ const url = new URL(entry.name + (entry.isDirectory() ? '/' : ''), directory);
+ if (entry.isDirectory()) { await check(url); continue; }
+ if (!/\.(?:html|js)$/.test(entry.name)) continue;
+ const source = await readFile(url, 'utf8');
+ if (/https?:\/\/(?:127\.0\.0\.1|localhost):424[23]/.test(source)) throw new Error(`Personal companion URL: ${url}`);
+ if (entry.name.endsWith('.js')) new Script(source, { filename: url.pathname });
+ else for (const match of source.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script>/gi)) {
+ if (/\bsrc\s*=|application\/json|application\/ld\+json/.test(match[1])) continue;
+ new Script(match[2], { filename: url.pathname });
+ }
+ count++;
+ }
+}
+await check(new URL('../public/', import.meta.url));
+for (const filename of ['server.js', 'scripts/check.js']) {
+ const result = spawnSync(process.execPath, ['--check', filename], { stdio: 'inherit' });
+ if (result.status) process.exit(result.status);
+}
+console.log(`Checked ${count} UI files; no personal companion URLs.`);
diff --git a/server.js b/server.js
new file mode 100644
index 0000000..9435295
--- /dev/null
+++ b/server.js
@@ -0,0 +1,85 @@
+import http from 'node:http';
+import { readFile, realpath, stat } from 'node:fs/promises';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+const root = fileURLToPath(new URL('./public/', import.meta.url));
+const catalog = JSON.parse(await readFile(new URL('./data/template-catalog.json', import.meta.url), 'utf8'));
+const templates = catalog.templates.map(template => ({
+ ...template,
+ ...template.output,
+ dir: template.id,
+ use: template.description,
+ tag: template.category,
+ qualityStatus: 'needs-review',
+ preview: { ...template.preview, path: template.preview.html, playerPath: `${template.preview.html}#play` },
+ customizer: template.customizer ? {
+ ...template.customizer,
+ fields: template.customizer.fields.map(field => ({ ...field, min: field.minimum, max: field.maximum }))
+ } : null
+}));
+const unsupported = { error: 'This feature is not connected in this new project yet.', code: 'NOT_CONNECTED' };
+const health = { ok: true, status: 'ok', mode: 'ui-starter', activeJobs: 0, capabilities: { generation: false, rendering: false, premiere: false }, providers: [] };
+const readOnly = new Map([
+ ['/health', health], ['/api/v1/health', health],
+ ['/api/v1/templates', { schemaVersion: 1, templates }],
+ ['/api/v1/templates/archived', { templates: [] }],
+ ['/jobs', { jobs: [], queue: {} }], ['/api/v1/jobs', { jobs: [], queue: {} }],
+ ['/api/themes', { themes: [] }], ['/api/user/active-theme', { theme: null }],
+ ['/api/v1/sequence-batches', { batches: [] }],
+ ['/api/v1/premiere-presence', { connected: false, sessions: [] }],
+ ['/api/v1/premiere-inbox', { items: [] }],
+ ['/api/v1/premiere-actions', { actions: [] }]
+]);
+const mime = { '.html': 'text/html; charset=utf-8', '.css': 'text/css; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.svg': 'image/svg+xml', '.png': 'image/png', '.json': 'application/json; charset=utf-8' };
+
+function json(response, status, body) {
+ response.writeHead(status, { 'Content-Type': mime['.json'], 'Cache-Control': 'no-store' });
+ response.end(JSON.stringify(body));
+}
+
+export function createApp() {
+ return http.createServer(async (request, response) => {
+ response.setHeader('X-Content-Type-Options', 'nosniff');
+ response.setHeader('Referrer-Policy', 'no-referrer');
+ let pathname;
+ try { pathname = decodeURIComponent(new URL(request.url, 'http://localhost').pathname); }
+ catch { return json(response, 400, { error: 'Invalid URL.' }); }
+ if (!['GET', 'HEAD'].includes(request.method)) return json(response, 501, unsupported);
+ if (pathname.includes('\\') || pathname.includes('\0') || pathname.split('/').some(part => part.startsWith('.'))) {
+ return json(response, 403, { error: 'Forbidden.' });
+ }
+ if (readOnly.has(pathname)) return json(response, 200, readOnly.get(pathname));
+ const sourceMatch = pathname.match(/^\/api\/v1\/templates\/([^/]+)\/source$/);
+ if (sourceMatch) {
+ const template = templates.find(item => item.id === sourceMatch[1]);
+ if (!template) return json(response, 404, { error: 'Template not found.' });
+ pathname = '/' + template.preview.html;
+ } else if (pathname.startsWith('/api/') || pathname === '/generate') {
+ return json(response, 501, unsupported);
+ }
+ // Keep the inherited /null/ links working without involving another server.
+ if (pathname === '/null') pathname = '/';
+ else if (pathname.startsWith('/null/')) pathname = pathname.slice(5);
+ let filename = path.resolve(root, '.' + pathname);
+ try {
+ if ((await stat(filename)).isDirectory()) filename = path.join(filename, 'index.html');
+ const [canonicalRoot, canonicalFile] = await Promise.all([realpath(root), realpath(filename)]);
+ const relative = path.relative(canonicalRoot, canonicalFile);
+ if (relative.startsWith('..') || path.isAbsolute(relative) || !mime[path.extname(filename)]) {
+ return json(response, 403, { error: 'Forbidden.' });
+ }
+ const data = await readFile(canonicalFile);
+ response.writeHead(200, { 'Content-Type': mime[path.extname(filename)], 'Content-Length': data.length });
+ response.end(request.method === 'HEAD' ? undefined : data);
+ } catch (error) {
+ json(response, error.code === 'ENOENT' || error.code === 'ENOTDIR' ? 404 : 500, { error: 'File unavailable.' });
+ }
+ });
+}
+
+if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
+ const port = Number(process.env.PORT || 4343);
+ const host = process.env.HOST || '127.0.0.1';
+ createApp().listen(port, host, () => console.log(`Null UI: http://${host}:${port}`));
+}
diff --git a/test/server.test.js b/test/server.test.js
new file mode 100644
index 0000000..9db7295
--- /dev/null
+++ b/test/server.test.js
@@ -0,0 +1,39 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { once } from 'node:events';
+import { createApp } from '../server.js';
+
+test('public workspace is standalone, read-only, and serves its own previews', async t => {
+ const server = createApp().listen(0, '127.0.0.1');
+ await once(server, 'listening');
+ t.after(() => { server.closeAllConnections(); server.close(); });
+ const base = `http://127.0.0.1:${server.address().port}`;
+ const get = path => fetch(base + path);
+
+ const home = await get('/');
+ assert.equal(home.status, 200);
+ assert.match(await home.text(), /Template Gallery/);
+ const catalog = await (await get('/api/v1/templates')).json();
+ assert.ok(catalog.templates.length > 0);
+ for (const template of catalog.templates) {
+ assert.ok(template.width > 0 && template.height > 0);
+ assert.equal((await get('/' + template.preview.path)).status, 200);
+ const source = await get(`/api/v1/templates/${template.id}/source`);
+ assert.equal(source.status, 200);
+ assert.match(source.headers.get('content-type'), /text\/html/);
+ }
+ assert.deepEqual((await (await get('/api/v1/jobs')).json()).jobs, []);
+ const health = await (await get('/health')).json();
+ assert.equal(health.mode, 'ui-starter');
+ assert.equal(health.capabilities.generation, false);
+ for (const path of ['/generate', '/api/v1/pair', '/api/v1/templates']) {
+ const response = await fetch(base + path, { method: 'POST', body: '{}' });
+ assert.equal(response.status, 501);
+ assert.match((await response.json()).error, /not connected/i);
+ }
+ for (const path of ['/.git/config', '/server.js', '/package.json', '/%2e%2e%5cserver.js', '/assets/%2e%2e%5c%2e%2e%5cserver.js']) {
+ assert.ok([400, 403, 404].includes((await get(path)).status), path);
+ }
+ assert.equal((await get('/%ZZ')).status, 400);
+ assert.equal((await get('/api/v1/unknown')).status, 501);
+});