# Light Beam Effect

Motionboard shot name: Screen Projection Beams

Small laptops on black each throw a trapezoid beam of light with an app screen inside it. The beams swing, hand off, merge into one wide beam that carries a stat along its right edge, and the last laptop closes.

- Position in a launch film: Features
- Slug: light-beam-effect
- Preview video: https://media.motionboard.app/projection-beams.mp4
- Recipe page: https://motionboard.app/recipes/light-beam-effect/
- License: MIT. Free to use in your own projects, including commercial launch films. https://github.com/krisyangdev/motionboard/blob/main/LICENSE

## How to use this recipe

You are a coding agent. The user wants this shot for their own product. Follow these steps.

1. **Know the product.** If the product is clear from the user's repo or conversation, ask nothing and start. Otherwise ask once for: product name, logo file, brand colors.
2. **Pick the output.** If the user's message says a video or their website, do that. Otherwise ask once which one they want.
   - **Video (HyperFrames).** Create a folder named `projection-beams`. Download every file under "Source files" below with the curl commands, keeping relative paths. Adapt `index.html` (see "What to adapt"). Run `npx --yes hyperframes@0.8.209 check` on the untouched copy first and note its result. Preview with `npx --yes hyperframes@0.8.209 preview`, render an MP4 with `npx --yes hyperframes@0.8.209 render` (into `renders/`, named with a timestamp). The same commands are in `package.json` as `dev`, `check`, `render`; pass flags after `--`, as in `npm run render -- --quality draft`. Rendering needs network access for web fonts and GSAP.
   - **Website motion.** Port the GSAP timeline in `index.html` into the user's site, using their stack (React, Vue, Svelte, plain HTML). Build the same DOM structure, keep the timeline's durations, delays and easings exactly, and start it when the element scrolls into view (IntersectionObserver or ScrollTrigger). Respect `prefers-reduced-motion: reduce`: show the final frame as a static state and skip the movement.
3. **What to adapt.**
   - **Brand layer** (product name, logo, colors, fonts, copy): replace directly with the user's.
   - **UI layer** (the product screens, cards, windows, controls shown in the shot): rebuild the user's real UI as clean DOM, from their codebase (components, design tokens) or from a screenshot used as reference only. Never paste a screenshot into the shot.
   - **Motion** (timing, easing, camera moves, layering, stagger, order of events): keep exactly as in the source. This is what the recipe is.
   - The timeline targets UI elements by id and class, and camera moves land on fixed coordinates. Keep the ids the timeline uses, keep row counts and text lengths close to the source, and when the layout moves, update the target coordinates without changing the times.
4. **Fonts.** HyperFrames fetches Google Fonts such as Inter on its own. Some sources use macOS local fonts (PingFang, Songti via `local()`). Use the user's brand font when it can be bundled; for a system font such as SF Pro, use Inter. Check that text still fits its boxes.
5. **Verify.** Compare the render with the preview video above at the beat times in the Timing row. The beats, timing and camera should match; only brand and UI content differ.

## Spec

| Item | Value |
| --- | --- |
| Timing | Film 11s. Laptop 1 rises 0–1.4s; beam 1 opens at 0.75s (1.0s); completion pill appears 1.15s and is accepted 1.9s; hand-off 3.0–3.45s (beam 1 leans left to -26° and narrows), then laptop 1 fades out 3.45–3.85s and back in at 4.45s (0.35s); beam 2 opens at 3.4s (1.0s); camera pulls back 4.4–5.5s; beam 1 reopens at 4.75s, beam 3 opens for the first time at 5.0s (laptop 3 fades in at 4.7s over 0.35s) and three beams run until 6.4s; beams 1 and 3 narrow 6.42–6.92s and their laptops fade out 6.5–6.9s (0.4s); wide beam 6.5–7.5s; stat slides in at 7.05s (0.9s) and fades at 8.3s (0.3s); beam narrows 8.25–8.85s; lid closes 8.4–9.4s; wordmark at 8.9s and held to the end (2.1s) |
| Easing | Opening and slide-in `cubic-bezier(0.16,1,0.3,1)` (expo.out); slow sweeps sine.inOut; narrowing power3.in (power2.inOut at the hand-off); camera pans, widening and lid closing power3.inOut |
| Camera | Flat framing on black, never still: slow push 0.86→0.9x over 0–3.0s; a 1.1s pan to laptop 2 at 3.0–4.1s at 0.9x with a -3° roll; drift to 0.94x at 4.1–4.4s; pull back to 0.72x and level at 4.4–5.5s; roll to -3° and drift to 0.74x at 5.5–6.4s with all three beams inside the frame; 1.1s move to 0.9x at 6.4–7.5s with the frame centre 60px right of and 175px above laptop 2, so the whole wide beam and the stat stay in frame; 0.93x at 7.5–8.3s; push to 1.2x at 8.3–11.0s |
| Subject | Lid 380x268px, corner radius 14px at the top and 9px at the bottom, 6px narrower per side at the top edge than at the bottom, a 4px bright line along the top, a two-line chamfer around the edge and a 44px darkening gradient along the bottom whose last 6px is a dark hinge band; open, the lid is 262px high (98% of 268px) with a slim 374x11px base edge (no key texture) showing about 4px under it and a 360x30px soft contact shadow; laptops 1 and 3 raise the base edge 2px while they yaw (4.6–5.6s) so the visible edge halves to about 2px and the lid reads as a thin slab; closed, the lid is a 380x268px rectangle, the hinge band fades out and the base edge drops 9px so about 7px of it shows. The beam's near edge stays on the lid top; leaning moves only the far edge (offset = length × tan of the angle) and the far-edge skew k lowers the right far corner by k px and raises the left one by k px (negative reverses). Beam 1 opens 800px long (820px by 3.1s), near half-width 170px, far half-width 520px; beam 2 is 860px long, near 170px, far 560px, k=30; in the three-beam stage beam 1 is 650px long, near 150px, far 330px, k=-40, beam 2 is 680px, near 150px, far 330px, k=0, and beam 3 is 650px, near 160px, far 350px, k=45; the wide beam is 560px long, near half-width 190px, far half-width 800px. Each screen is a full 1280x800 display scaled 1.25x (mail 1.1x with its layer 20px left of and 114px below the centred position so the toast and a whole paragraph sit inside the beam without text cut at the beam's left edge; the console in the wide beam 1.3x) |
| Sync | The completion accepted at 1.9s, the pill vanishing and 5 code lines turning solid share one frame, all inside the beam; the build row going from Building to Ready and 0.9 s to 1.8 s lands at 5.05s, both cells in the middle of beam 2; the mail toast appears at 5.5s on the axis of beam 3 with one whole paragraph and both attachments in the same beam; the lid edge lights 0.2s before each beam opens |
| Style | Pure black `#040405`, one accent teal `#2dd4bf`; UI in Inter 13px; stat in League Gothic, 40px small line, 224px number and 94px label, skewed -10° and rotated about -43° along the right edge, 18px off it; wordmark Inter 600; grain re-rolled every 3 frames and a vignette |

## Why it works

The beam is a trapezoid window and the screen sits fixed in screen space. When the beam leans, only its far edge moves and the near edge stays on the lid top, so a swinging beam changes which part of the screen shows while the text stays level and readable. On a black frame only the beam has content, so the eye follows the light. The three screens go dark, light, dark (code editor, build console, mail), so the same beam never repeats itself. Every sync beat lands inside a beam: the completion pill, the build status cell, the mail toast and a whole mail paragraph sit where the beam shows them. The stat comes last, outside the right slanted edge of the widest beam, reading upward, and the number 2.4× is the largest element in the only accent color, teal #2dd4bf. The laptop is a thin silver lid seen from behind with a slim base edge, and it ends as a thin chamfered slab.

## Prompt

> Build an 11-second, 1920x1080, 30 fps product film called Screen Projection Beams for a fictional product, Harbor (a laptop and its three app screens). The frame is pure black #040405 and the only accent color is teal #2dd4bf. The laptop is a thin silver lid seen from behind and slightly above: 380x268 px, corner radius 14 px at the top and 9 px at the bottom, 6 px narrower per side at the top edge than at the bottom, a 4 px bright line along the top edge, a two-line chamfer around the edge (1 px light line plus 3 px dark line), a 44 px gradient that darkens the bottom with a 6 px dark hinge band on its last pixels and a very faint vertical brushed texture. Open, the lid is 262 px high (98% of 268 px) with a slim 374x11 px base edge under it (a dark-to-light metal gradient, no key texture) showing about 4 px, and a 360x30 px soft contact shadow; laptops 1 and 3 raise the base edge 2 px while they yaw so the visible edge halves; when a beam is on, a faint teal pool of light shows on the floor. A dark engraved mark sits in the middle of the lid and the top edge of the lid is where light comes out. A beam is a clip-path trapezoid window whose near edge sits on the lid top and opens outward from it. To lean a beam, move only the far edge sideways (offset = length × tan of the angle); the near edge never moves, so it stays pinned to the lid. The far-edge skew k lowers the right far corner by k px and raises the left far corner by k px (negative k does the opposite). Behind the window sits a screen-space UI layer (a full 1280x800 screen scaled 1.25x) that does not move when the beam leans; the beam only changes which part of it is revealed. Add a 3 px bright line along the beam edges, a soft bloom at the lid edge (peak opacity 50% so the screens read first) and a lit edge on the lid top. Three screens, all real English product UI: A is a dark code editor (file tree, tabs, 33 lines of TypeScript, minimap, terminal, status bar); B is a light build console (sidebar, four KPI cards, a 14-day build-time line chart with a v2.14 · cache on annotation, a builds table with the columns Build, Commit, Status, Duration, Branch, Author, Started; median build 1.8 s, cache hit rate 94.2%); C is a dark mail app (sidebar, a list of 10 emails, an open thread titled Re: Q4 launch checklist with two body paragraphs and two attachments). Timeline: 0 to 1.4 s laptop 1 rises from 80 px below at 1.14x scale (expo.out) and fades from 0.35 to 1 over 0.7 s. The camera starts at 0.86x and pushes slowly to 0.9x over the first 3 s. At 0.55 s the lid top edge lights; at 0.75 s beam 1 opens (length 0 to 800, far half-width 170 to 520, near half-width 170, 1.0 s expo.out; lean -14 to -3 degrees over 1.3 s expo.out; k=0). At 1.15 s a floating Accept Tab pill appears in the middle of the beam above the cursor line; at 1.9 s the grayed-out completion in the editor is accepted, the pill disappears and 5 lines turn solid on the same frame, and the beam length eases to 820 by 3.1 s. From 2.05 to 3.0 s beam 1 sweeps slowly to +12 degrees (sine.inOut). From 2.35 to 3.0 s the terminal prints a line every 0.12 s, 6 lines, ending with Build complete in 1.8s. Hand-off from 3.0 s: beam 1 leans left to -26 degrees in 0.45 s and narrows to a line in the same 0.45 s (power2.in for the lean, power2.inOut for the narrowing) while the camera pans 1.1 s (power3.inOut) to laptop 2 on the right at 0.9x with a -3 degree roll. Beam 2 opens only after beam 1 has closed, at 3.4 s (lean -30 to -6 degrees over 1.3 s; length 860, near half-width 170, far half-width 560, k=30, over 1.0 s), so the two windows never overlap. Laptop 1 fades out from 3.45 to 3.85 s and fades back in over 0.35 s from 4.45 s; laptop 3 stays out of the frame until it fades in over 0.35 s at 4.7 s, so no unlit side laptop is cut off by the bottom of the frame. Beam 2 reveals the console and its line chart draws from 3.75 to 4.75 s; the camera drifts to 0.94x from 4.1 to 4.4 s. From 4.4 to 5.5 s the camera pulls back to 0.72x and levels out (1.1 s, power3.inOut). Beam 2 leans slowly to +4 degrees from 4.55 to 5.65 s and narrows from 4.65 to 5.55 s to length 680, near half-width 150, far half-width 330, k=0. Beam 1 reopens at 4.75 s (lean -30 to -17 degrees over 1.3 s; length 650, near half-width 150, far half-width 330, k=-40, over 1.0 s). Beam 3 opens for the first time at 5.0 s (lean +28 to +20 degrees over 1.3 s; length 650, near half-width 160, far half-width 350, k=45, over 1.0 s). Laptops 1 and 3 yaw -9 and +10 degrees from 4.6 to 5.6 s. Three beams run together; the mail screen is scaled 1.1x and its layer sits 20 px left of and 114 px below the centred position, so the middle of beam 3 shows one whole body paragraph and the two attachments with no letters cut at the beam's left edge. At 5.05 s the first row of the builds table turns from Building to Ready and its duration from 0.9 s to 1.8 s, both cells in the middle of beam 2 (the Ready cell flashes a green tint). At 5.5 s a mail toast (Priya Nair: Legal signed off on the terms. Sending the final PDF now.) appears above the paragraph in beam 3 and fades at 6.3 s. From 5.5 to 6.4 s beam 2 leans to -4 degrees, beam 3 leans to +18 degrees and the camera rolls to -3 degrees and drifts to 0.74x, with all three beams inside the frame. From 6.4 to 6.9 s beams 1 and 3 lean inward to +12 and -12 degrees and narrow (6.42 to 6.92 s, power3.in) and from 6.5 to 6.9 s their laptops fade out (0.4 s), so they are gone before the stat appears; the camera moves to laptop 2 at 0.9x over 1.1 s with the frame centre 60 px right of and 175 px above laptop 2. From 6.5 to 7.5 s beam 2 levels out and becomes one wide flat beam that sits entirely inside the frame (near half-width 190, far half-width 800, length 560, k=0, power3.inOut) and the console scales to 1.3x; the chart annotation v2.14 · cache on sits right next to the dashed line and the Nov 4 tooltip (Median 1.8 s, p95 4.1 s) sits in the free space further right, so they never overlap. At 7.05 s the stat slides in along the right slanted edge (200 px along the edge, 0.9 s expo.out). It sits outside the edge, 18 px away from it, starting 200 px along the edge from the lid corner, and the whole block is rotated about -43 degrees so it reads upward, parallel to the edge. It has three parts: a small UP TO (League Gothic 40 px), the number 2.4× in a teal gradient (224 px, the largest element) and FASTER BUILDS (94 px, white-to-gray gradient), all skewed -10 degrees and all inside the frame. The camera drifts to 0.93x from 7.5 to 8.3 s. At 8.3 s the stat fades over 0.3 s. From 8.25 to 8.85 s the beam narrows (power3.in); from 8.4 to 9.4 s the lid height goes from 0.98 to 1, its trapezoid outline becomes a rectangle, the hinge band fades out and the base edge drops 9 px so only about 7 px of it shows, and the laptop moves to the center of the frame (1.0 s, power3.inOut) while the camera pushes to 1.2x from 8.3 to 11.0 s; at 8.9 s the lid mark lights teal over 0.8 s and the word Harbor fades in under the lid (Inter 600, 52 px growing to 62 px with the camera, 0.6 s expo.out). The wordmark is placed in the same group as the lid so it moves with it and never overlaps it, and it holds to the end of the film (2.1 s); at 9.2 s a highlight sweeps across the lid. Add film grain re-rolled every 3 frames and a vignette.

## Often confused with

- [3D Tilted UI with Depth of Field](https://motionboard.app/r/3d-tilted-ui-depth-of-field.md): Tilted UI with Depth of Field tilts one interface and uses blur to lead the eye; here the interface stays still behind a trapezoid beam window and the light hands off between several laptops.
- [Light Reveal](https://motionboard.app/r/light-reveal.md): Light Reveal uses a sweeping light to bring out the material of a product on black; the beams here reveal app screens and pass from one laptop to the next.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/projection-beams/hyperframes.json (318 B)
- https://motionboard.app/source/projection-beams/index.html (65.2 KB)
- https://motionboard.app/source/projection-beams/package.json (305 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "projection-beams/hyperframes.json" "https://motionboard.app/source/projection-beams/hyperframes.json"
curl -fsSL --create-dirs -o "projection-beams/index.html" "https://motionboard.app/source/projection-beams/index.html"
curl -fsSL --create-dirs -o "projection-beams/package.json" "https://motionboard.app/source/projection-beams/package.json"
```

## index.html

```html
<!doctype html>
<html lang="en" data-resolution="landscape">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=1920, height=1080" />
    <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
    <style>
      :root {
        --base: #040405;
        --ink: #f2f3f5;
        --muted: #8b8f98;
        --accent: #2dd4bf;
        --font-ui: "Inter", -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
        --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: var(--base); }
      #root {
        position: relative; width: 1920px; height: 1080px; overflow: hidden; background: var(--base);
        font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums;
      }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      svg { display: block; flex: none; }

      /* ---------- camera and world ---------- */
      #stage { z-index: 1; overflow: hidden; }
      #cam1 { position: absolute; left: 960px; top: 540px; width: 0; height: 0; }
      #cam2, #cam3 { position: absolute; left: 0; top: 0; width: 0; height: 0; }
      .lg { position: absolute; left: 0; top: 0; width: 0; height: 0; }

      /* ---------- laptop, seen from behind: lid back with the mark ---------- */
      .body { position: absolute; left: -190px; top: 0; width: 380px; height: 268px; }
      .pool {
        position: absolute; left: -130px; top: 235px; width: 640px; height: 210px; opacity: 0; pointer-events: none;
        background: radial-gradient(ellipse 50% 50% at 50% 30%, rgba(140,235,222,0.20) 0%, rgba(140,235,222,0.06) 55%, rgba(0,0,0,0) 100%);
      }
      .fsh {
        position: absolute; left: 10px; top: 255px; width: 360px; height: 30px; pointer-events: none; filter: blur(8px);
        background: radial-gradient(ellipse at 50% 20%, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.55) 50%, rgba(0,0,0,0) 74%);
      }
      .base {
        position: absolute; left: 3px; top: 255px; width: 374px; height: 11px; border-radius: 0 0 9px 9px / 0 0 6px 6px;
        background:
          linear-gradient(90deg, rgba(0,0,0,0.30) 0, rgba(0,0,0,0) 5%, rgba(0,0,0,0) 95%, rgba(0,0,0,0.30) 100%),
          linear-gradient(180deg, #17181b 0, #2b2d31 2px, #8d9097 4px, #c4c7cc 7px, #9a9da4 10px, #5d6067 100%);
        box-shadow: inset 0 -1px 0 rgba(255,255,255,0.55), 0 1px 0 rgba(0,0,0,0.7);
      }
      .lid {
        position: absolute; left: 0; top: 0; width: 380px; height: 268px; border-radius: 14px 14px 9px 9px / 14px 14px 12px 12px; overflow: hidden;
        clip-path: polygon(1.6% 0, 98.4% 0, 100% 100%, 0 100%);
        transform-origin: 50% 0;
        background:
          linear-gradient(180deg, rgba(255,255,255,0.18) 0%, rgba(255,255,255,0) 28%, rgba(0,0,0,0.14) 100%),
          linear-gradient(112deg, #85888f 0%, #bfc2c8 26%, #a4a7ae 48%, #d0d2d7 68%, #8a8d94 100%);
        box-shadow: inset 0 2px 0 rgba(255,255,255,0.95), inset 0 0 0 1px rgba(255,255,255,0.5), inset 0 0 0 3px rgba(0,0,0,0.10), inset 0 -3px 5px rgba(0,0,0,0.30), inset 3px 0 4px rgba(255,255,255,0.18), inset -3px 0 4px rgba(0,0,0,0.26);
      }
      .lid::after {
        content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 44px;
        background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.14) 50%, rgba(0,0,0,0.34) 78%, rgba(0,0,0,0.52) 100%);
      }
      .hg {
        position: absolute; left: 3px; top: 259px; width: 374px; height: 6px; pointer-events: none; filter: blur(0.7px);
        background: linear-gradient(180deg, rgba(0,0,0,0) 0, rgba(0,0,0,0.5) 38%, rgba(0,0,0,0.8) 62%, rgba(0,0,0,0) 100%);
      }
      .lip {
        position: absolute; left: 0; top: 0; width: 380px; height: 4px; z-index: 2;
        background: linear-gradient(180deg, #ffffff 0, rgba(255,255,255,0.55) 2px, rgba(255,255,255,0) 4px);
      }
      .lid::before {
        content: ""; position: absolute; inset: 0;
        background: repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0 1px, rgba(0,0,0,0.022) 1px 3px);
      }
      .spec {
        position: absolute; left: -200px; top: -40px; width: 240px; height: 360px;
        background: linear-gradient(100deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.30) 50%, rgba(255,255,255,0) 100%);
        transform: skewX(-12deg);
      }
      .mk { position: absolute; left: 154px; top: 100px; width: 72px; height: 72px; }
      .mkg { opacity: 0; filter: drop-shadow(0 0 10px #2dd4bf) drop-shadow(0 0 28px rgba(45,212,191,0.8)); }
      .edge {
        position: absolute; left: 10px; top: -2px; width: 360px; height: 3px; border-radius: 2px; opacity: 0;
        background: linear-gradient(90deg, rgba(190,255,248,0) 0%, #d8fffa 20%, #ffffff 50%, #d8fffa 80%, rgba(190,255,248,0) 100%);
        box-shadow: 0 0 22px 4px rgba(120, 240, 225, 0.65);
      }

      /* ---------- beam: window onto a screen-space UI layer ---------- */
      .bm {
        --a: 170; --b: 170; --L: 0; --k: 0; --t: 0;
        position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0;
      }
      .win, .rim, .glow {
        position: absolute; left: -1600px; top: -2400px; width: 3200px; height: 2400px;
      }
      .win {
        clip-path: polygon(
          calc(1600px - var(--a) * 1px) 2400px,
          calc(1600px + var(--a) * 1px) 2400px,
          calc(1600px + var(--b) * 1px + var(--L) * var(--t) * 1px) calc(2400px - var(--L) * 1px + var(--k) * 1px),
          calc(1600px - var(--b) * 1px + var(--L) * var(--t) * 1px) calc(2400px - var(--L) * 1px - var(--k) * 1px));
        background: #0a0b0d;
      }
      .rim {
        clip-path: polygon(
          calc(1600px - var(--a) * 1px - 3px) 2400px,
          calc(1600px + var(--a) * 1px + 3px) 2400px,
          calc(1600px + var(--b) * 1px + var(--L) * var(--t) * 1px + 3px) calc(2400px - var(--L) * 1px + var(--k) * 1px - 3px),
          calc(1600px - var(--b) * 1px + var(--L) * var(--t) * 1px - 3px) calc(2400px - var(--L) * 1px - var(--k) * 1px - 3px));
        background: linear-gradient(to top, rgba(220,255,250,0.95) 0, rgba(220,255,250,0.35) 1000px, rgba(220,255,250,0.3) 2400px);
      }
      .glow { filter: blur(40px); }
      .glow i {
        position: absolute; left: 0; top: 0; width: 3200px; height: 2400px; display: block;
        clip-path: polygon(
          calc(1600px - var(--a) * 1px - 60px) 2400px,
          calc(1600px + var(--a) * 1px + 60px) 2400px,
          calc(1600px + var(--b) * 1px + var(--L) * var(--t) * 1px + 60px) calc(2400px - var(--L) * 1px + var(--k) * 1px - 60px),
          calc(1600px - var(--b) * 1px + var(--L) * var(--t) * 1px - 60px) calc(2400px - var(--L) * 1px - var(--k) * 1px - 60px));
        background: linear-gradient(to top, rgba(110,235,220,0.08) 0, rgba(110,235,220,0.02) 900px, rgba(110,235,220,0) 1800px);
      }
      .pc { position: absolute; left: 1600px; top: 2400px; width: 0; height: 0; }
      .pc .pc { left: 0; top: 0; }
      .shade {
        position: absolute; left: 0; top: 0; width: 3200px; height: 2400px; pointer-events: none;
        background: linear-gradient(to top, rgba(0,0,0,0) 0, rgba(0,0,0,0.12) 300px, rgba(0,0,0,0.5) 1100px, rgba(0,0,0,0.5) 2400px);
      }
      .bloom {
        position: absolute; left: 1180px; top: 2060px; width: 840px; height: 340px; mix-blend-mode: screen; pointer-events: none;
        background: radial-gradient(ellipse at 50% 100%, rgba(200,255,248,0.5) 0%, rgba(200,255,248,0.133) 38%, rgba(200,255,248,0) 70%);
      }

      /* ---------- screens ---------- */
      .pn {
        position: absolute; left: -640px; top: -740px; width: 1280px; height: 800px; overflow: hidden;
        transform-origin: 640px 800px; font-size: 13px; color: #c5c8d0;
      }
      .ic { flex: none; display: block; }
      .row { display: flex; align-items: center; }
      .grow { flex: 1; min-width: 0; }
      .nw { white-space: nowrap; }
      .mbar {
        position: absolute; left: 0; top: 0; width: 1280px; height: 26px; display: flex; align-items: center; gap: 18px; padding: 0 14px;
        font-size: 12.5px; font-weight: 500; z-index: 3;
      }
      .mbar b { font-weight: 700; }
      .mbar .r { margin-left: auto; display: flex; align-items: center; gap: 12px; }
      .win2 { position: absolute; left: 0; top: 26px; width: 1280px; height: 774px; display: flex; flex-direction: column; }
      .tbar { height: 38px; flex: none; display: flex; align-items: center; padding: 0 14px; position: relative; }
      .tl3 { display: flex; gap: 8px; }
      .tl3 i { display: block; width: 12px; height: 12px; border-radius: 50%; }
      .tbar .ttl { position: absolute; left: 0; right: 0; text-align: center; font-size: 12.5px; font-weight: 500; }
      .kb {
        display: inline-flex; align-items: center; justify-content: center; height: 18px; min-width: 18px; padding: 0 5px;
        border-radius: 5px; font-size: 11px; font-weight: 500;
      }
      .av { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; }

      /* A: editor */
      .pa { background: #131417; }
      .pa .mbar { background: #0b0c0e; color: #d6d8de; }
      .pa .win2 { background: #17181c; }
      .pa .tbar { background: #1b1c20; border-bottom: 1px solid #0e0f11; color: #9a9ea8; }
      .pa .tl3 i { background: #3a3c42; }
      .abody { flex: 1; min-height: 0; display: flex; }
      .act { width: 48px; flex: none; background: #121316; border-right: 1px solid #0e0f11; display: flex; flex-direction: column; align-items: center; padding-top: 10px; gap: 4px; color: #6f737c; }
      .act > div { width: 48px; height: 44px; display: flex; align-items: center; justify-content: center; position: relative; }
      .act > div.on { color: #e6e8ee; }
      .act > div.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--accent); }
      .exp { width: 236px; flex: none; background: #15161a; border-right: 1px solid #0e0f11; overflow: hidden; }
      .exp .h { height: 34px; display: flex; align-items: center; padding: 0 14px; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; color: #8b8f98; }
      .exp .t { height: 24px; display: flex; align-items: center; gap: 6px; font-size: 13px; color: #b6bac3; white-space: nowrap; }
      .exp .t.on { background: #23252b; color: #f0f2f6; }
      .exp .t .ic { color: #7b7f89; }
      .exp .t.d { color: #d3d6dd; }
      .amain { flex: 1; min-width: 0; display: flex; flex-direction: column; }
      .atabs { height: 34px; flex: none; display: flex; background: #131417; border-bottom: 1px solid #0e0f11; }
      .atab { display: flex; align-items: center; gap: 8px; padding: 0 14px; font-size: 13px; color: #8b8f98; border-right: 1px solid #0e0f11; white-space: nowrap; }
      .atab.on { background: #1c1d22; color: #eef0f4; box-shadow: inset 0 1px 0 var(--accent); }
      .atab .ts { font-size: 9.5px; font-weight: 700; color: #4aa3f0; }
      .crumb { height: 24px; flex: none; display: flex; align-items: center; gap: 6px; padding: 0 16px; font-size: 12px; color: #7b7f89; background: #1c1d22; }
      .edit { flex: 1; min-height: 0; position: relative; overflow: hidden; background: #1c1d22; }
      .code { position: absolute; left: 0; top: -180px; width: 900px; font-family: var(--font-mono); font-size: 13px; line-height: 20px; }
      .ln { display: flex; height: 20px; white-space: pre; }
      .ln .n { width: 58px; flex: none; text-align: right; padding-right: 20px; color: #565a63; }
      .ln.cur { background: #23252b; }
      .ln.cur .n { color: #c9ccd3; }
      .ln .tx { color: #d4d7de; }
      .k { color: #c084fc; } .s { color: #86d9a0; } .f { color: #6cb6ff; } .nn { color: #f4a261; } .c { color: #5f6570; font-style: italic; } .ty { color: #f2cc6b; }
      .ghost { opacity: 0.38; }
      .caret { display: inline-block; width: 2px; height: 16px; margin-left: 1px; vertical-align: -3px; background: #e8eaee; }
      .gpill {
        position: absolute; left: 300px; top: 322px; height: 24px; opacity: 0; display: flex; align-items: center; gap: 8px; padding: 0 8px; border-radius: 6px;
        background: #2a2c33; border: 1px solid #3a3d46; font-size: 11.5px; color: #c5c8d0; font-family: var(--font-ui); box-shadow: 0 8px 20px rgba(0,0,0,0.4);
      }
      .gpill .kb { background: #3a3d46; color: #e8eaee; }
      .mini { position: absolute; right: 0; top: 0; width: 96px; bottom: 0; background: #1c1d22; border-left: 1px solid #17181c; }
      .mini i { position: absolute; height: 2px; border-radius: 1px; opacity: 0.55; }
      .term { height: 170px; flex: none; background: #17181c; border-top: 1px solid #0e0f11; }
      .term .tt { white-space: nowrap; height: 28px; display: flex; align-items: center; gap: 22px; padding: 0 16px; font-size: 11px; font-weight: 500; letter-spacing: 0.04em; color: #7b7f89; }
      .term .tt .on { color: #eef0f4; box-shadow: inset 0 -1px 0 var(--accent); height: 28px; display: flex; align-items: center; }
      .term .tb { padding: 6px 16px; font-family: var(--font-mono); font-size: 12.5px; line-height: 19px; color: #c5c8d0; white-space: pre; }
      .tg { color: #2dd4bf; } .tm { color: #7b7f89; } .tw { color: #f2f3f5; font-weight: 700; }
      .tln { opacity: 0; }
      .sbar { height: 24px; flex: none; display: flex; align-items: center; gap: 16px; padding: 0 12px; background: #0f766e; color: #e8fffb; font-size: 12px; }
      .sbar .r { margin-left: auto; display: flex; gap: 16px; }
      .sbar > span, .sbar .r > span { display: flex; align-items: center; gap: 5px; }

      /* B: dashboard */
      .pb { background: #ffffff; color: #3b3f47; }
      .pb .mbar { background: #f3f3f5; color: #1c1d21; border-bottom: 1px solid #e3e4e8; }
      .pb .win2 { background: #fff; }
      .pb .tbar { background: #f7f7f9; border-bottom: 1px solid #e6e7ea; color: #6b6f78; }
      .pb .tl3 i:nth-child(1) { background: #ff5f57; } .pb .tl3 i:nth-child(2) { background: #febc2e; } .pb .tl3 i:nth-child(3) { background: #28c840; }
      .bbody { flex: 1; min-height: 0; display: flex; }
      .bside { width: 232px; flex: none; background: #fafafb; border-right: 1px solid #e8e9ec; padding: 12px 10px; display: flex; flex-direction: column; }
      .bws { height: 38px; display: flex; align-items: center; gap: 9px; padding: 0 8px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: #17181c; margin-bottom: 10px; }
      .bws .sq { width: 22px; height: 22px; border-radius: 6px; background: linear-gradient(135deg, #2dd4bf, #0f766e); display: flex; align-items: center; justify-content: center; }
      .bnav { height: 32px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: #4b4f58; white-space: nowrap; }
      .bnav .ic { color: #7b808a; }
      .bnav b { margin-left: auto; font-weight: 500; font-size: 11.5px; color: #8b909a; }
      .bnav.on { background: #eceef1; color: #101114; }
      .bnav.on .ic { color: #0f766e; }
      .bsh { height: 26px; margin-top: 12px; padding: 0 10px; display: flex; align-items: center; font-size: 11.5px; font-weight: 600; color: #8b909a; }
      .bmain { flex: 1; min-width: 0; padding: 20px 28px 0; }
      .bh { height: 36px; display: flex; align-items: center; gap: 12px; }
      .bh h1 { font-size: 22px; font-weight: 650; letter-spacing: -0.015em; color: #101114; }
      .pill { height: 22px; display: inline-flex; align-items: center; gap: 5px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; }
      .btn { height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 12px; border-radius: 7px; font-size: 12.5px; font-weight: 550; white-space: nowrap; }
      .btn.sec { border: 1px solid #dcdee3; color: #2b2e35; background: #fff; }
      .btn.pri { background: #0f766e; color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,0.2); }
      .bf { height: 32px; margin-top: 14px; display: flex; align-items: center; gap: 8px; }
      .kpis { margin-top: 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
      .kpi { height: 92px; border: 1px solid #e6e7eb; border-radius: 10px; padding: 12px 16px; background: #fff; }
      .kpi .l { font-size: 12px; color: #6b707a; display: flex; align-items: center; gap: 6px; }
      .kpi .v { margin-top: 8px; font-size: 26px; font-weight: 650; letter-spacing: -0.02em; color: #101114; display: flex; align-items: baseline; gap: 10px; }
      .kpi .d { font-size: 12px; font-weight: 550; }
      .up { color: #0f9f6e; } .dn { color: #0f9f6e; }
      .card { margin-top: 16px; border: 1px solid #e6e7eb; border-radius: 10px; background: #fff; height: 250px; position: relative; }
      .card .ch { height: 42px; display: flex; align-items: center; padding: 0 16px; font-size: 13.5px; font-weight: 600; color: #17181c; gap: 14px; }
      .lgd { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: #6b707a; }
      .lgd i { width: 10px; height: 3px; border-radius: 2px; display: block; }
      .tbl { margin-top: 16px; border: 1px solid #e6e7eb; border-radius: 10px; overflow: hidden; height: 250px; }
      .tr { height: 36px; display: flex; align-items: center; padding: 0 16px; border-top: 1px solid #eef0f2; font-size: 12.5px; color: #3b3f47; white-space: nowrap; }
      .tr.h { height: 32px; border-top: 0; background: #f8f8fa; font-size: 11.5px; font-weight: 600; color: #7b808a; }
      .tr > div { flex: none; display: flex; align-items: center; gap: 8px; overflow: hidden; }
      .c1 { width: 80px; } .c2 { width: 270px; } .c3 { width: 170px; } .c4 { width: 110px; } .c5 { width: 120px; } .c6 { width: 110px; }
      .mono { font-family: var(--font-mono); font-size: 12px; }
      .st { display: inline-flex; align-items: center; gap: 6px; font-weight: 550; }
      .st i { width: 7px; height: 7px; border-radius: 50%; display: block; }
      .ok { color: #0f7a55; } .ok i { background: #1fb878; } .er { color: #c2362e; } .er i { background: #e5484d; } .bd { color: #a16207; } .bd i { background: #f5a524; }
      .dim { color: #8b909a; }

      /* C: mail */
      .pc3 { background: #141518; color: #c9ccd3; }
      .pc3 .mbar { background: #0b0c0e; color: #d6d8de; }
      .pc3 .win2 { background: #17181b; }
      .pc3 .tbar { background: #1a1b1f; border-bottom: 1px solid #0e0f11; color: #9a9ea8; }
      .pc3 .tl3 i { background: #3a3c42; }
      .cbody { flex: 1; min-height: 0; display: flex; }
      .cside { width: 224px; flex: none; background: #121316; border-right: 1px solid #0e0f11; padding: 12px 10px; }
      .cnav { height: 31px; display: flex; align-items: center; gap: 10px; padding: 0 10px; border-radius: 7px; font-size: 13px; font-weight: 500; color: #aeb2bb; white-space: nowrap; }
      .cnav .ic { color: #7b7f89; }
      .cnav b { margin-left: auto; font-weight: 500; font-size: 11.5px; color: #8b8f98; }
      .cnav.on { background: #23252b; color: #f2f3f6; }
      .cnav.on .ic { color: var(--accent); }
      .clist { width: 372px; flex: none; border-right: 1px solid #0e0f11; background: #16171a; overflow: hidden; }
      .clh { height: 50px; display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid #0e0f11; }
      .clh h2 { font-size: 16px; font-weight: 650; color: #f2f3f6; letter-spacing: -0.01em; }
      .mrow { height: 66px; display: flex; gap: 11px; padding: 10px 16px 0 14px; border-bottom: 1px solid #1d1e22; position: relative; }
      .mrow.sel { background: #212329; box-shadow: inset 2px 0 0 var(--accent); }
      .mrow .mt { flex: 1; min-width: 0; }
      .mrow .a { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #e9ebf0; }
      .mrow .a em { margin-left: auto; font-style: normal; font-weight: 450; font-size: 11.5px; color: #7b7f89; }
      .mrow .b { margin-top: 2px; font-size: 12.5px; color: #c4c7ce; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .mrow .p { margin-top: 2px; font-size: 12px; color: #7b7f89; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
      .udot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); display: block; flex: none; }
      .cread { flex: 1; min-width: 0; padding: 0 30px; }
      .crh { height: 50px; display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #0e0f11; margin: 0 -30px; padding: 0 22px; color: #8b8f98; }
      .crh .ib { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border-radius: 7px; }
      .cread h1 { margin-top: 20px; font-size: 22px; font-weight: 650; letter-spacing: -0.015em; color: #f4f5f8; line-height: 28px; }
      .cread p { font-size: 14px; line-height: 22px; color: #c9ccd3; margin-top: 12px; max-width: 430px; }
      .att { height: 44px; display: inline-flex; align-items: center; gap: 10px; padding: 0 14px 0 10px; border: 1px solid #2a2c33; border-radius: 9px; background: #1c1d21; font-size: 12.5px; color: #dfe1e6; font-weight: 500; }
      .att span { display: block; font-size: 11px; color: #7b7f89; font-weight: 450; }
      .compose { position: absolute; left: 30px; right: 30px; bottom: 22px; height: 84px; border: 1px solid #2c2e35; border-radius: 10px; background: #1a1b1f; padding: 12px 14px; font-size: 13.5px; color: #7b7f89; }
      .toast {
        position: absolute; left: 626px; top: 60px; width: 300px; padding: 12px 14px; border-radius: 12px; display: flex; gap: 11px; opacity: 0;
        background: #26282f; border: 1px solid #373a43; box-shadow: 0 18px 40px rgba(0,0,0,0.5); z-index: 5;
      }

      /* ---------- stat text along the right edge of the wide cone ---------- */
      .stat { position: absolute; left: 0; top: 0; width: 0; height: 0; }
      .sw { position: absolute; left: 0; top: 0; width: 900px; height: 0; transform-origin: 0 0; }
      .sin { position: absolute; left: 0; top: 18px; white-space: nowrap; opacity: 0; transform-origin: 0 0; display: flex; align-items: flex-end; gap: 30px; }
      .sin .sm {
        font-family: "League Gothic", "Oswald", sans-serif; font-size: 40px; line-height: 40px; letter-spacing: 0.06em; color: #cfd2d8;
        transform: skewX(-10deg); transform-origin: 0 100%; margin-bottom: 2px;
      }
      .sin .bg {
        font-family: "League Gothic", "Oswald", sans-serif; letter-spacing: 0.005em; color: #fff;
        transform: skewX(-10deg); transform-origin: 0 100%;
        background: linear-gradient(180deg, #ffffff 0%, #e7e9ee 55%, #aeb2ba 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
      }
      .sin .big { font-size: 224px; line-height: 192px; }
      .sin .mid { font-size: 94px; line-height: 84px; }
      .sin .bg.ac { background: linear-gradient(180deg, #d9fffa 0%, #5eead4 50%, #14b8a6 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }

      /* ---------- finish ---------- */
      #wm { position: absolute; left: -380px; top: 322px; width: 760px; text-align: center; opacity: 0; font-weight: 600; font-size: 52px; line-height: 60px; letter-spacing: -0.03em; color: #f2f3f5; }
      #grain {
        z-index: 3; pointer-events: none; opacity: 0.08; background-size: 256px 256px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='256' height='256'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='256' height='256' filter='url(%23n)'/%3E%3C/svg%3E");
      }
      #vig { z-index: 4; pointer-events: none; background: radial-gradient(ellipse at center, rgba(0,0,0,0) 52%, rgba(0,0,0,0.55) 100%); }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="11" data-width="1920" data-height="1080">
      <div id="stage" class="clip full" data-start="0" data-duration="11" data-track-index="0" data-layout-allow-overlap>
        <div id="cam1"><div id="cam2"><div id="cam3"></div></div></div>
      </div>
      <div id="grain" class="clip full" data-start="0" data-duration="11" data-track-index="2"></div>
      <div id="vig" class="clip full" data-start="0" data-duration="11" data-track-index="3"></div>
    </div>

    <script>
      const EXPO = "expo.out";
      const IO = "power3.inOut";

      /* ---------- icons (lucide-style, 24 grid) ---------- */
      const G = {
        search: '<circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/>',
        folder: '<path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/>',
        file: '<path d="M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z"/><path d="M14 2v4a2 2 0 0 0 2 2h4"/>',
        branch: '<line x1="6" x2="6" y1="3" y2="15"/><circle cx="18" cy="6" r="3"/><circle cx="6" cy="18" r="3"/><path d="M18 9a9 9 0 0 1-9 9"/>',
        play: '<polygon points="6 3 20 12 6 21 6 3"/>',
        grid: '<rect width="7" height="7" x="3" y="3" rx="1"/><rect width="7" height="7" x="14" y="3" rx="1"/><rect width="7" height="7" x="14" y="14" rx="1"/><rect width="7" height="7" x="3" y="14" rx="1"/>',
        cr: '<path d="m9 18 6-6-6-6"/>',
        cd: '<path d="m6 9 6 6 6-6"/>',
        x: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
        term: '<polyline points="4 17 10 11 4 5"/><line x1="12" x2="20" y1="19" y2="19"/>',
        sliders: '<line x1="21" x2="14" y1="4" y2="4"/><line x1="10" x2="3" y1="4" y2="4"/><line x1="21" x2="12" y1="12" y2="12"/><line x1="8" x2="3" y1="12" y2="12"/><line x1="21" x2="16" y1="20" y2="20"/><line x1="12" x2="3" y1="20" y2="20"/><line x1="14" x2="14" y1="2" y2="6"/><line x1="8" x2="8" y1="10" y2="14"/><line x1="16" x2="16" y1="18" y2="22"/>',
        bell: '<path d="M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"/><path d="M10.3 21a1.94 1.94 0 0 0 3.4 0"/>',
        home: '<path d="m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"/><polyline points="9 22 9 12 15 12 15 22"/>',
        bars: '<line x1="12" x2="12" y1="20" y2="10"/><line x1="18" x2="18" y1="20" y2="4"/><line x1="6" x2="6" y1="20" y2="16"/>',
        zap: '<path d="M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z"/>',
        db: '<ellipse cx="12" cy="5" rx="9" ry="3"/><path d="M3 5V19A9 3 0 0 0 21 19V5"/><path d="M3 12A9 3 0 0 0 21 12"/>',
        clock: '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
        check: '<path d="M20 6 9 17l-5-5"/>',
        inbox: '<polyline points="22 12 16 12 14 15 10 15 8 12 2 12"/><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"/>',
        star: '<polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"/>',
        send: '<path d="m22 2-7 20-4-9-9-4Z"/><path d="M22 2 11 13"/>',
        archive: '<rect width="20" height="5" x="2" y="3" rx="1"/><path d="M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"/><path d="M10 12h4"/>',
        trash: '<path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/>',
        edit: '<path d="M12 20h9"/><path d="M16.5 3.5a2.121 2.121 0 0 1 3 3L7 19l-4 1 1-4Z"/>',
        tag: '<path d="M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z"/><circle cx="7.5" cy="7.5" r=".5" fill="currentColor"/>',
        clip: '<path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/>',
        reply: '<polyline points="9 17 4 12 9 7"/><path d="M20 18v-2a4 4 0 0 0-4-4H4"/>',
        more: '<circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/>',
        wifi: '<path d="M12 20h.01"/><path d="M2 8.82a15 15 0 0 1 20 0"/><path d="M5 12.859a10 10 0 0 1 14 0"/><path d="M8.5 16.429a5 5 0 0 1 7 0"/>',
        users: '<path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87"/><path d="M16 3.13a4 4 0 0 1 0 7.75"/>',
        filter: '<polygon points="22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3"/>',
        arrowUp: '<path d="m5 12 7-7 7 7"/><path d="M12 19V5"/>',
        arrowDown: '<path d="M12 5v14"/><path d="m19 12-7 7-7-7"/>',
        layers: '<path d="m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z"/><path d="m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65"/><path d="m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65"/>',
        cal: '<rect width="18" height="18" x="3" y="4" rx="2"/><path d="M16 2v4"/><path d="M8 2v4"/><path d="M3 10h18"/>',
        dl: '<path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/>',
        plus: '<path d="M5 12h14"/><path d="M12 5v14"/>',
        git: '<circle cx="12" cy="12" r="3"/><line x1="3" x2="9" y1="12" y2="12"/><line x1="15" x2="21" y1="12" y2="12"/>',
        sync: '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
        info: '<circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/>',
        spark: '<path d="M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z"/>',
      };
      const ic = (g, s, c, sw) =>
        '<svg class="ic" width="' + s + '" height="' + s + '" viewBox="0 0 24 24" fill="none" stroke="' + (c || "currentColor") + '" stroke-width="' + (sw || 1.7) +
        '" stroke-linecap="round" stroke-linejoin="round">' + G[g] + "</svg>";
      const MARK = (c, s) =>
        '<svg width="' + s + '" height="' + s + '" viewBox="0 0 64 64" fill="none" stroke="' + c + '" stroke-width="6" stroke-linecap="round"><path d="M39.5 52.7A22 22 0 1 1 53.7 35.8"/><circle cx="32" cy="32" r="6" fill="' + c + '" stroke="none"/></svg>';
      const PEOPLE = {
        maya: ["MC", "#e0634a"], liam: ["LO", "#3b82c4"], priya: ["PN", "#2f9e77"], daniel: ["DK", "#8b5cf6"], sofia: ["SR", "#d6498b"],
        ethan: ["EW", "#b9812a"], hannah: ["HB", "#1f9d9a"], omar: ["OH", "#64748b"], aisha: ["AK", "#c2410c"],
      };
      const avt = (k, s, f) => '<span class="av" style="width:' + s + "px;height:" + s + "px;font-size:" + (f || Math.round(s * 0.38)) + "px;background:" + PEOPLE[k][1] + '">' + PEOPLE[k][0] + "</span>";

      function menubar(app, items, extra) {
        return '<div class="mbar"><span class="row" style="gap:9px">' + MARK("currentColor", 13) + "<b>" + app + "</b></span>" +
          items.map((t) => "<span>" + t + "</span>").join("") +
          '<span class="r">' + ic("search", 13) + ic("wifi", 14) + '<span class="row" style="gap:5px"><svg width="22" height="11" viewBox="0 0 22 11"><rect x="0.5" y="0.5" width="18" height="10" rx="3" fill="none" stroke="currentColor" opacity="0.6"/><rect x="2" y="2" width="12.5" height="7" rx="1.8" fill="currentColor"/><rect x="19.5" y="3.5" width="2" height="4" rx="1" fill="currentColor" opacity="0.6"/></svg>87%</span><span>Wed Nov 4&nbsp; 10:41 AM</span></span></div>';
      }
      const MENU = ["File", "Edit", "View", "Go", "Window", "Help"];

      /* ---------- screen A: code editor ---------- */
      const CODE = [
        'import { createHash } from "node:crypto";',
        'import { readFile, writeFile, mkdir } from "node:fs/promises";',
        'import type { BuildContext, ModuleGraph } from "./types";',
        "",
        'const CACHE_DIR = ".harbor/cache";',
        "const MAX_AGE_MS = 1000 * 60 * 60 * 24 * 7;",
        "",
        "export async function hashInputs(files: string[]): Promise<string> {",
        '  const hash = createHash("sha256");',
        "  for (const file of [...files].sort()) {",
        "    hash.update(file);",
        "    hash.update(await readFile(file));",
        "  }",
        '  return hash.digest("hex").slice(0, 16);',
        "}",
        "",
        "export async function restoreCache(ctx: BuildContext) {",
        "  const key = await hashInputs(ctx.inputs);",
        "  const path = `${CACHE_DIR}/${key}.json`;",
        '  const raw = await readFile(path, "utf8").catch(() => null);',
        "  if (!raw) return null;",
        "  const graph: ModuleGraph = JSON.parse(raw);",
        "  if (ctx.now - graph.createdAt > MAX_AGE_MS) return null;",
        "  ctx.log.info(`cache hit ${key} (${graph.modules.length} modules)`);",
        "  return graph;",
        "}",
        "",
        "export async function saveCache(ctx: BuildContext, graph: ModuleGraph) {",
        "  const key = await hashInputs(ctx.inputs);",
        "  await mkdir(CACHE_DIR, { recursive: true });",
        "  await writeFile(`${CACHE_DIR}/${key}.json`, JSON.stringify(graph));",
        "  ctx.log.info(`cache saved ${key}`);",
        "}",
      ];
      const KW = /^(import|export|from|const|let|async|await|function|return|if|type|new|null|for|of|catch)$/;
      const esc = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
      function hl(src) {
        const re = /(\/\/.*)|("(?:[^"\\]|\\.)*"|`(?:[^`\\]|\\.)*`)|(\b\d[\d_]*\b)|([A-Za-z_$][\w$]*)|(\s+|.)/g;
        let m, out = "";
        while ((m = re.exec(src))) {
          const t = esc(m[0]);
          if (m[1]) out += '<span class="c">' + t + "</span>";
          else if (m[2]) out += '<span class="s">' + t + "</span>";
          else if (m[3]) out += '<span class="nn">' + t + "</span>";
          else if (m[4]) {
            if (KW.test(m[4])) out += '<span class="k">' + t + "</span>";
            else if (src[re.lastIndex] === "(") out += '<span class="f">' + t + "</span>";
            else if (/^[A-Z]/.test(m[4]) || /^(string|Promise)$/.test(m[4])) out += '<span class="ty">' + t + "</span>";
            else out += t;
          } else out += t;
        }
        return out;
      }
      function panelA() {
        const FIRST = 10; // first visible line number
        let code = "";
        CODE.forEach((l, i) => {
          const no = i + 1;
          const cls = "ln" + (no === 28 ? " cur" : "") + (no >= 29 ? " ghost" : "");
          code += '<div class="' + cls + '"><span class="n">' + no + '</span><span class="tx">' + hl(l) + (no === 28 ? '<i class="caret"></i>' : "") + "</span></div>";
        });
        // minimap: one bar per line
        let mini = "";
        CODE.forEach((l, i) => {
          if (!l) return;
          const ind = (l.match(/^ */)[0].length) * 1.6;
          const w = Math.min(l.trim().length * 1.5, 80 - ind);
          const col = /^(import|export|const)/.test(l.trim()) ? "#c084fc" : /\(/.test(l) ? "#6cb6ff" : "#9aa0ab";
          mini += '<i style="left:' + (8 + ind) + "px;top:" + (8 + i * 4) + "px;width:" + w + "px;background:" + col + '"></i>';
        });
        const tree = [
          [0, "cd", "folder", "harbor-web", 1], [1, "cr", "folder", ".harbor"], [1, "cd", "folder", "src", 1], [2, "cd", "folder", "build", 1],
          [3, "", "file", "cache.ts", 2], [3, "", "file", "compile.ts"], [3, "", "file", "config.ts"], [3, "", "file", "graph.ts"], [3, "", "file", "index.ts"],
          [2, "cr", "folder", "components"], [2, "cr", "folder", "lib"], [2, "cr", "folder", "routes"], [2, "", "file", "types.ts"],
          [1, "cr", "folder", "public"], [1, "", "file", ".env.example"], [1, "", "file", "package.json"], [1, "", "file", "tsconfig.json"], [1, "", "file", "README.md"],
        ];
        const exp = tree.map((r) =>
          '<div class="t' + (r[4] === 2 ? " on" : "") + (r[4] === 1 ? " d" : "") + '" style="padding-left:' + (12 + r[0] * 14) + 'px">' + (r[1] ? ic(r[1], 13) : '<span style="width:13px;flex:none"></span>') +
          ic(r[2], 14, r[2] === "folder" ? "#7da7d9" : "#7b7f89") + "<span>" + r[3] + "</span>" +
          (r[3] === "cache.ts" ? '<span style="margin-left:auto;margin-right:12px;color:#e5c07b;font-size:11px">M</span>' : "") + "</div>").join("");
        const tabs = [["router.ts"], ["config.ts"], ["cache.ts", 1], ["types.ts"]]
          .map((t) => '<div class="atab' + (t[1] ? " on" : "") + '"><span class="ts">TS</span>' + t[0] + (t[1] ? '<span style="color:#e5c07b;font-size:16px;line-height:10px;margin-left:2px">●</span>' : ic("x", 12, "#6f737c")) + "</div>").join("");
        const act = ["file", "search", "branch", "play", "grid"].map((g, i) => '<div class="' + (i === 0 ? "on" : "") + '">' + ic(g, 22, "currentColor", 1.5) + "</div>").join("");
        return menubar("Code", ["File", "Edit", "Selection", "View", "Go", "Run", "Terminal", "Window", "Help"]) +
          '<div class="win2"><div class="tbar"><div class="tl3"><i></i><i></i><i></i></div><div class="ttl">cache.ts — harbor-web</div></div>' +
          '<div class="abody"><div class="act">' + act + '</div><div class="exp"><div class="h">EXPLORER</div>' + exp + "</div>" +
          '<div class="amain"><div class="atabs">' + tabs + '</div><div class="crumb">src' + ic("cr", 11) + "build" + ic("cr", 11) + "cache.ts" + ic("cr", 11) + '<span style="color:#c5c8d0">saveCache</span></div>' +
          '<div class="edit"><div class="code">' + code + '</div><div class="gpill" id="gpill">Accept<span class="kb">Tab</span><span style="color:#7b7f89">Word</span><span class="kb">⌘→</span></div><div class="mini">' + mini + "</div></div>" +
          '<div class="term"><div class="tt"><span>PROBLEMS</span><span>OUTPUT</span><span class="on">TERMINAL</span><span>DEBUG CONSOLE</span><span style="margin-left:auto;color:#7b7f89">zsh · harbor-web</span></div><div class="tb">' +
          '<div><span class="tg">harbor-web</span> <span class="tm">on</span> <span class="k">main</span> <span class="tm">›</span> <span class="tw">harbor build --cache</span></div>' +
          '<div class="tln t0"><span class="tm"> ◇ Resolving 1,284 modules</span></div>' +
          '<div class="tln t1"><span class="tg"> ✓</span> Cache restored  <span class="tm">key 7f3a9c21e0b4d815</span>  (94.2% hit)</div>' +
          '<div class="tln t2"><span class="tg"> ✓</span> Compiled in <span class="tw">1.8s</span>  <span class="tm">(was 4.4s)</span></div>' +
          '<div class="tln t3"><span class="tg"> ✓</span> Bundled 38 chunks  <span class="tm">2.41 MB → 612 kB gzip</span></div>' +
          '<div class="tln t4"><span class="tg"> ✓</span> Type check passed  <span class="tm">0 errors</span></div>' +
          '<div class="tln t5"><span class="tw"> Build complete in 1.8s</span></div></div></div></div></div>' +
          '<div class="sbar"><span>' + ic("branch", 12) + "main</span><span>" + ic("sync", 12) + '</span><span>' + ic("x", 12) + " 0  " + ic("info", 12) + ' 0</span><span class="r"><span>Ln 28, Col 74</span><span>Spaces: 2</span><span>UTF-8</span><span>TypeScript</span><span>' + ic("spark", 12) + " Harbor AI</span></span></div></div>";
      }

      /* ---------- screen B: build dashboard (light) ---------- */
      const MED = [4.4, 4.5, 4.3, 4.6, 4.4, 4.2, 4.5, 4.4, 2.7, 1.9, 1.8, 1.8, 1.7, 1.8];
      const P95 = [8.1, 8.4, 7.9, 8.8, 8.2, 7.7, 8.3, 8.1, 5.6, 4.4, 4.2, 4.3, 4.0, 4.1];
      function chartSVG() {
        const W = 976, H = 178, x0 = 44, x1 = W - 12, y0 = 8, y1 = H - 24, ymax = 10;
        const X = (i) => x0 + (i * (x1 - x0)) / 13;
        const Y = (v) => y1 - (v / ymax) * (y1 - y0);
        let g = "";
        [0, 2.5, 5, 7.5, 10].forEach((v) => {
          g += '<line x1="' + x0 + '" x2="' + x1 + '" y1="' + Y(v) + '" y2="' + Y(v) + '" stroke="#eceef1"/><text x="' + (x0 - 10) + '" y="' + (Y(v) + 4) + '" text-anchor="end" font-size="11" fill="#8b909a">' + (v ? v + " s" : "0") + "</text>";
        });
        const days = ["Oct 22", "Oct 24", "Oct 26", "Oct 28", "Oct 30", "Nov 1", "Nov 3"];
        days.forEach((d, i) => { g += '<text x="' + X(i * 2) + '" y="' + (H - 6) + '" text-anchor="middle" font-size="11" fill="#8b909a">' + d + "</text>"; });
        const path = (arr) => arr.map((v, i) => (i ? "L" : "M") + X(i).toFixed(1) + " " + Y(v).toFixed(1)).join(" ");
        const dots = P95.map((v, i) => "").join("");
        const mx = X(7.6);
        return '<svg width="' + W + '" height="' + H + '" viewBox="0 0 ' + W + " " + H + '"><defs><linearGradient id="ga" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#14b8a6" stop-opacity="0.22"/><stop offset="1" stop-color="#14b8a6" stop-opacity="0"/></linearGradient></defs>' + g +
          '<path id="chArea" d="' + path(MED) + " L" + X(13) + " " + y1 + " L" + x0 + " " + y1 + ' Z" fill="url(#ga)" opacity="0"/>' +
          '<path d="' + path(P95) + '" fill="none" stroke="#b6bcc6" stroke-width="2" stroke-linejoin="round" stroke-linecap="round"/>' +
          '<path id="chLine" d="' + path(MED) + '" pathLength="1" fill="none" stroke="#0f9488" stroke-width="2.6" stroke-linejoin="round" stroke-linecap="round" stroke-dasharray="1" stroke-dashoffset="1"/>' +
          '<line x1="' + mx + '" x2="' + mx + '" y1="' + y0 + '" y2="' + y1 + '" stroke="#9aa1ad" stroke-dasharray="3 4"/>' +
          '<rect x="' + (mx + 8) + '" y="' + (y0 + 2) + '" width="118" height="22" rx="6" fill="#f1f2f5" stroke="#e2e4e9"/><text x="' + (mx + 18) + '" y="' + (y0 + 17) + '" font-size="11.5" font-weight="600" fill="#3b3f47">v2.14 · cache on</text>' +
          '<g id="chDot" opacity="0"><circle cx="' + X(13) + '" cy="' + Y(1.8) + '" r="5" fill="#fff" stroke="#0f9488" stroke-width="2.5"/></g></svg>';
      }
      function panelB() {
        const nav = [["home", "Overview"], ["layers", "Builds", 1, "12.5k"], ["zap", "Deployments", 0, "48"], ["db", "Cache"], ["bars", "Insights"], ["term", "Logs"], ["users", "Team"]]
          .map((n) => '<div class="bnav' + (n[2] ? " on" : "") + '">' + ic(n[0], 16) + n[1] + (n[3] ? "<b>" + n[3] + "</b>" : "") + "</div>").join("");
        const kpi = [
          ["Median build time", "1.8 s", "▼ 58%", "clock"], ["p95 build time", "4.1 s", "▼ 49%", "clock"], ["Cache hit rate", "94.2%", "▲ 6.1 pts", "db"], ["Builds", "12,481", "▲ 8.3%", "layers"],
        ].map((k) => '<div class="kpi"><div class="l">' + ic(k[3], 14, "#8b909a") + k[0] + '</div><div class="v">' + k[1] + '<span class="d ' + (k[2][0] === "▼" ? "dn" : "up") + '">' + k[2] + "</span></div></div>").join("");
        const rows = [
          ["#8420", "Fix WebSocket reconnect on chat nav", "main", "liam", "Liam Ortiz", "bd", "ok", "1.8 s", "just now"],
          ["#8419", "Bump grpc to 1.64.0", "main", "maya", "Maya Chen", "ok", "ok", "1.7 s", "6m ago"],
          ["#8418", "Add retry backoff to webhook worker", "feat/webhooks", "priya", "Priya Nair", "ok", "ok", "1.9 s", "14m ago"],
          ["#8417", "Update onboarding copy", "design/onboarding", "sofia", "Sofia Reyes", "ok", "ok", "1.6 s", "31m ago"],
          ["#8416", "Migrate invoices table to v2 schema", "feat/billing-v2", "daniel", "Daniel Kim", "ok", "ok", "2.4 s", "48m ago"],
          ["#8415", "Upgrade eslint config", "chore/lint", "ethan", "Ethan Walker", "er", "er", "0.6 s", "1h ago"],
        ];
        const trs = rows.map((r, i) =>
          '<div class="tr"><div class="c1 mono dim">' + r[0] + '</div><div class="c2" style="font-weight:500;color:#17181c">' + r[1] + '</div>' +
          (i === 0
            ? '<div class="c5"><span class="st bd" id="stB" style="padding:2px 8px;border-radius:11px"><i></i>Building…</span><span class="st ok" id="stR" style="display:none;position:absolute;padding:2px 8px;border-radius:11px"><i></i>Ready</span></div><div class="c6 mono"><span id="duB">0.9 s</span><span id="duR" style="opacity:0;position:absolute">' + r[7] + "</span></div>"
            : '<div class="c5"><span class="st ' + r[6] + '"><i></i>' + (r[6] === "er" ? "Error" : "Ready") + '</span></div><div class="c6 mono">' + r[7] + "</div>") +
          '<div class="c3"><span class="mono" style="background:#f1f2f5;border-radius:5px;padding:2px 6px;font-size:11.5px">' + r[2] + '</span></div>' +
          '<div class="c4">' + avt(r[3], 20, 8.5) + '<span>' + r[4].split(" ")[0] + "</span></div>" +
          '<div class="dim" style="margin-left:auto;width:90px;justify-content:flex-end">' + r[8] + "</div></div>").join("");
        return menubar("Console", MENU) +
          '<div class="win2"><div class="tbar"><div class="tl3"><i></i><i></i><i></i></div><div class="ttl">Builds — harbor-web</div></div><div class="bbody">' +
          '<div class="bside"><div class="bws"><span class="sq">' + MARK("#fff", 12) + '</span>Northwind' + ic("cd", 14, "#8b909a") + "</div>" +
          '<div class="bnav" style="color:#8b909a">' + ic("search", 15) + 'Search<b><span class="kb" style="background:#eceef1">⌘K</span></b></div>' + nav +
          '<div class="bsh">Projects</div><div class="bnav"><span style="width:16px;height:16px;border-radius:5px;background:#6366f1;color:#fff;font-size:9px;font-weight:700;display:flex;align-items:center;justify-content:center">H</span>harbor-web</div>' +
          '<div class="bnav"><span style="width:16px;height:16px;border-radius:5px;background:#f59e0b;color:#fff;font-size:9px;font-weight:700;display:flex;align-items:center;justify-content:center">D</span>docs-site</div>' +
          '<div class="bnav"><span style="width:16px;height:16px;border-radius:5px;background:#ec4899;color:#fff;font-size:9px;font-weight:700;display:flex;align-items:center;justify-content:center">M</span>mobile-app</div>' +
          '<div class="grow"></div><div class="bnav">' + ic("sliders", 16) + 'Settings</div><div class="row" style="gap:10px;padding:10px 10px 4px;border-top:1px solid #e8e9ec;margin-top:8px">' + avt("maya", 28) + '<div style="font-size:12.5px;font-weight:600;color:#17181c;line-height:15px">Maya Chen<div style="font-weight:450;color:#8b909a;font-size:11.5px">maya@northwind.co</div></div></div></div>' +
          '<div class="bmain"><div class="bh"><h1>Builds</h1><span class="pill" style="background:#e6f7f4;color:#0f766e">' + ic("branch", 12) + 'main</span><span class="grow"></span><span class="btn sec">' + ic("dl", 14) + 'Export</span><span class="btn pri">' + ic("plus", 14) + "New build</span></div>" +
          '<div class="bf"><span class="btn sec">' + ic("cal", 14) + 'Last 14 days' + ic("cd", 13, "#8b909a") + '</span><span class="btn sec">' + ic("branch", 14) + 'All branches' + ic("cd", 13, "#8b909a") + '</span><span class="btn sec">' + ic("filter", 14) + 'Filter</span><span class="grow"></span><span class="dim" style="font-size:12px">Updated just now</span></div>' +
          '<div class="kpis">' + kpi + '</div><div class="card"><div class="ch">Build duration<span class="grow"></span><span class="lgd"><i style="background:#0f9488"></i>Median</span><span class="lgd"><i style="background:#b6bcc6"></i>p95</span></div>' + chartSVG() +
          '<div id="chTip" style="position:absolute;right:112px;top:58px;width:150px;padding:9px 11px;border-radius:9px;background:#17181c;color:#fff;font-size:11.5px;line-height:17px;box-shadow:0 10px 24px rgba(0,0,0,0.18);opacity:0"><span style="color:#9aa0ab">Nov 4</span><div class="row" style="gap:6px"><i style="width:8px;height:8px;border-radius:2px;background:#2dd4bf;display:block"></i>Median <b style="margin-left:auto">1.8 s</b></div><div class="row" style="gap:6px"><i style="width:8px;height:8px;border-radius:2px;background:#b6bcc6;display:block"></i>p95 <b style="margin-left:auto">4.1 s</b></div></div></div>' +
          '<div class="tbl"><div class="tr h"><div class="c1">Build</div><div class="c2">Commit</div><div class="c5">Status</div><div class="c6">Duration</div><div class="c3">Branch</div><div class="c4">Author</div><div style="margin-left:auto;width:90px;justify-content:flex-end">Started</div></div>' + trs + "</div></div></div></div>";
      }

      /* ---------- screen C: mail (dark) ---------- */
      function panelC() {
        const nav = [["inbox", "Inbox", 1, "12"], ["star", "Starred"], ["clock", "Snoozed"], ["send", "Sent"], ["edit", "Drafts", 0, "2"], ["archive", "Archive"], ["trash", "Trash"]]
          .map((n) => '<div class="cnav' + (n[2] ? " on" : "") + '">' + ic(n[0], 16) + n[1] + (n[3] ? '<b id="' + (n[1] === "Inbox" ? "ibx" : "") + '">' + n[3] + "</b>" : "") + "</div>").join("");
        const labels = [["#e0634a", "Launch"], ["#3b82c4", "Design"], ["#2f9e77", "Finance"], ["#8b5cf6", "Recruiting"]]
          .map((l) => '<div class="cnav"><i style="width:9px;height:9px;border-radius:3px;background:' + l[0] + ';display:block;margin:0 3px"></i>' + l[1] + "</div>").join("");
        const msgs = [
          ["maya", "Maya Chen", "10:38 AM", "Re: Q4 launch checklist", "Thanks Liam, pricing page copy is updated and the new build is live on staging…", 1, 1],
          ["liam", "Liam Ortiz", "10:12 AM", "ENG-2141 assigned to you", "Fix WebSocket reconnect on chat nav · High priority", 1],
          ["daniel", "Daniel Kim", "9:47 AM", "Standup notes, Wed Nov 4", "Checkout e2e is green again. Reconnect fix is in review, Priya is on the retry…", 1],
          ["sofia", "Sofia Reyes", "9:31 AM", "Onboarding copy v3 for review", "Updated the empty states and the three tooltips. Comments are open in Figma until…", 0],
          ["omar", "Omar Haddad", "9:05 AM", "Invoice #10442 paid", "Northwind Billing received $4,800.00 for the annual plan. A receipt is attached.", 0],
          ["hannah", "Hannah Brooks", "8:52 AM", "Interview loop: Staff Engineer", "Debrief is moved to Thursday 2:00 PM. Please submit your scorecard before then.", 1],
          ["ethan", "Ethan Walker", "Yesterday", "Webhook retries, design doc", "I added a section on backoff and jitter. Would like a second pair of eyes on the…", 0],
          ["aisha", "Aisha Khan", "Yesterday", "Customer call notes: Acme", "They want SSO by January and asked about audit logs. Full notes in the doc below.", 0],
          ["priya", "Priya Nair", "Tue", "Flaky checkout e2e on staging", "Traced it to the cart service warming up. Added a readiness check, PR #4152.", 0],
          ["maya", "Maya Chen", "Tue", "Board deck, final numbers", "Attaching the final deck. Revenue slide is updated with October actuals.", 0],
        ];
        const rows = msgs.map((m) =>
          '<div class="mrow' + (m[6] ? " sel" : "") + '">' + avt(m[0], 34, 12) + '<div class="mt"><div class="a">' + m[1] + (m[5] ? '<i class="udot"></i>' : "") + "<em>" + m[2] + '</em></div><div class="b">' + m[3] + '</div><div class="p">' + m[4] + "</div></div></div>").join("");
        return menubar("Mail", ["File", "Edit", "View", "Mailbox", "Message", "Window", "Help"]) +
          '<div class="win2"><div class="tbar"><div class="tl3"><i></i><i></i><i></i></div><div class="ttl">Inbox — maya@northwind.co</div></div><div class="cbody">' +
          '<div class="cside"><div class="btn" style="background:var(--accent);color:#06312d;height:34px;width:100%;justify-content:center;font-weight:650;margin-bottom:12px">' + ic("edit", 15, "#06312d", 2) + 'Compose</div>' + nav +
          '<div class="bsh" style="color:#7b7f89;margin-top:14px;padding:0 10px;height:26px;display:flex;align-items:center;font-size:11.5px;font-weight:600">Labels</div>' + labels + "</div>" +
          '<div class="clist"><div class="clh"><h2>Inbox</h2><span class="pill" style="background:#23252b;color:#aeb2bb">Primary</span><span class="pill" style="color:#7b7f89">Updates 3</span><span class="pill" style="color:#7b7f89">Team</span><span class="grow"></span>' + ic("filter", 15, "#7b7f89") + "</div>" + rows + "</div>" +
          '<div class="cread"><div class="crh"><span class="ib">' + ic("archive", 16) + '</span><span class="ib">' + ic("trash", 16) + '</span><span class="ib">' + ic("clock", 16) + '</span><span class="ib">' + ic("tag", 16) + '</span><span class="grow"></span><span style="font-size:12px;color:#7b7f89">1 of 128</span><span class="ib">' + ic("more", 16) + "</span></div>" +
          "<h1>Re: Q4 launch checklist</h1>" +
          '<div class="row" style="gap:12px;margin-top:16px">' + avt("maya", 40, 14) + '<div class="grow"><div style="font-size:14px;font-weight:600;color:#f2f3f6">Maya Chen <span style="font-weight:450;color:#7b7f89;font-size:12.5px">&lt;maya@northwind.co&gt;</span></div><div style="font-size:12.5px;color:#7b7f89;margin-top:2px">to me, Priya, Daniel · Nov 4, 10:38 AM</div></div>' + ic("reply", 17, "#8b8f98") + ic("star", 17, "#8b8f98") + "</div>" +
          "<p>Hi Liam,</p><p>Thanks for the quick turnaround. The pricing page copy is updated and the new build is live on staging (build #8420, 1.8s). Two things before Thursday:</p>" +
          "<p>1. Legal sign-off on the revised terms. Priya has the draft.<br>2. Final screenshots for the changelog, light and dark.</p>" +
          "<p>Ethan will cut the release branch once both are done. I also attached the latest plan so everyone is looking at the same numbers.</p>" +
          '<div class="row" style="gap:10px;margin-top:18px"><span class="att">' + ic("file", 20, "#e0634a") + '<div>launch-plan-q4.pdf<span>1.2 MB</span></div></span><span class="att">' + ic("file", 20, "#2f9e77") + '<div>pricing-v3.xlsx<span>86 KB</span></div></span></div>' +
          '<div class="compose"><div class="row" style="gap:8px;margin-bottom:8px">' + ic("reply", 14, "#7b7f89") + 'Reply to Maya Chen…</div><div class="row" style="gap:10px"><span class="btn" style="background:var(--accent);color:#06312d;height:26px">Send<span class="kb" style="background:rgba(0,0,0,0.15);color:#06312d">⌘↵</span></span>' + ic("clip", 16, "#7b7f89") + "</div></div></div></div></div>" +
          '<div class="toast" id="toast">' + avt("priya", 32, 11) + '<div style="font-size:12.5px;line-height:17px;color:#aeb2bb"><b style="color:#f2f3f6;font-weight:600">Priya Nair</b><br>Legal signed off on the terms. Sending the final PDF now.</div></div>';
      }

      /* ---------- laptops ---------- */
      function laptop(n, cls, html) {
        const beam = '<div class="bm" id="bm' + n + '"><div class="glow" data-layout-allow-occlusion><i></i></div><div class="rim" data-layout-allow-occlusion></div><div class="win" data-layout-allow-occlusion><div class="pc" id="pca' + n + '"><div class="pc" id="pcb' + n + '"><div class="pn ' + cls + '" data-layout-ignore id="pn' + n + '"' + (n === 3 ? ' style="left:-660px;top:-626px"' : "") + ">" + html + '</div></div></div><div class="shade"></div><div class="bloom" id="bl' + n + '"></div></div></div>';
        const body = '<div class="body" id="bd' + n + '"><div class="pool" id="pool' + n + '"></div><div class="fsh" id="fsh' + n + '"></div><div class="base" data-layout-allow-occlusion id="base' + n + '"></div>' +
          '<div class="lid" data-layout-allow-occlusion id="lid' + n + '"><div class="lip"></div><div class="spec" data-layout-allow-overflow id="spec' + n + '"></div><div class="mk">' +
          '<div style="position:absolute;left:0;top:1px;opacity:0.5">' + MARK("rgba(255,255,255,0.9)", 72) + '</div><div style="position:absolute;left:0;top:0">' + MARK("rgba(38,40,46,0.78)", 72) + '</div><div class="mkg" id="mkg' + n + '" style="position:absolute;left:0;top:0">' + MARK("#2dd4bf", 72) + "</div></div></div>" +
          '<div class="hg" id="hg' + n + '"></div><div class="edge" data-layout-allow-occlusion id="edge' + n + '"></div></div>';
        return '<div class="lg" id="lg' + n + '">' + beam + body + "</div>";
      }
      const statHTML =
        '<div class="stat" id="stat"><div class="sw" id="swr" data-layout-allow-occlusion data-layout-allow-overflow><div class="sin" id="sinr" data-layout-allow-occlusion data-layout-allow-overflow>' +
        '<div data-layout-allow-occlusion><div class="sm" data-layout-allow-occlusion>UP TO</div><div class="bg ac big" data-layout-allow-occlusion>2.4×</div></div><div class="bg mid" data-layout-allow-occlusion>FASTER BUILDS</div></div></div></div>' +
        '<div id="wm">Harbor</div>';
      document.getElementById("cam3").innerHTML = laptop(1, "pa", panelA()) + laptop(2, "pb", panelB()) + laptop(3, "pc3", panelC());
      document.getElementById("lg2").insertAdjacentHTML("beforeend", statHTML);

      /* ---------- timeline ---------- */
      const tl = gsap.timeline({ paused: true });
      const POS = { 1: [860, 760], 2: [1500, 760], 3: [2120, 810] };
      [1, 2, 3].forEach((n) => {
        gsap.set("#lg" + n, { x: POS[n][0], y: POS[n][1] });
        gsap.set("#pn" + n, { scale: n === 3 ? 1.1 : 1.25 });
        gsap.set("#lid" + n, { scaleY: 0.978, filter: "brightness(0.55)" });
        gsap.set("#base" + n, { y: 0 });
      });

      // state trackers so every fromTo starts where the previous one ended
      const S = {
        1: { L: 0, b: 170, a: 170, k: 0, th: 0, yaw: 0 },
        2: { L: 0, b: 170, a: 170, k: 0, th: 0, yaw: 0 },
        3: { L: 0, b: 170, a: 170, k: 0, th: 0, yaw: 0 },
      };
      function shape(n, o, at, dur, ease) {
        const s = S[n], from = {}, to = {};
        ["L", "b", "a", "k"].forEach((k) => { if (o[k] !== undefined) { from["--" + k] = s[k]; to["--" + k] = o[k]; s[k] = o[k]; } });
        to.duration = dur; to.ease = ease || EXPO; to.immediateRender = false;
        tl.fromTo("#bm" + n, from, to, at);
      }
      function swing(n, th, at, dur, ease) {
        const s = S[n];
        tl.fromTo("#bm" + n, { "--t": Math.tan((s.th * Math.PI) / 180) }, { "--t": Math.tan((th * Math.PI) / 180), duration: dur, ease: ease || EXPO, immediateRender: false }, at);
        s.th = th;
      }
      function yaw(n, v, at, dur, ease) {
        const s = S[n];
        tl.fromTo("#lg" + n, { rotation: s.yaw }, { rotation: v, duration: dur, ease: ease || IO, immediateRender: false }, at);
        tl.fromTo("#pca" + n, { rotation: -s.yaw }, { rotation: -v, duration: dur, ease: ease || IO, immediateRender: false }, at);
        s.yaw = v;
      }
      const LB = { 1: 0.55, 2: 0.55, 3: 0.55 }, LE = { 1: 0, 2: 0, 3: 0 };
      function lit(n, on, at, dur) {
        const b = on ? 1 : 0.55, e = on ? 1 : 0;
        tl.fromTo("#lid" + n, { filter: "brightness(" + LB[n] + ")" }, { filter: "brightness(" + b + ")", duration: dur, ease: "power2.out", immediateRender: false }, at);
        tl.fromTo("#edge" + n, { opacity: LE[n] }, { opacity: e, duration: dur, ease: "power2.out", immediateRender: false }, at);
        tl.fromTo("#pool" + n, { opacity: LE[n] }, { opacity: e, duration: dur * 1.6, ease: "power2.out", immediateRender: false }, at);
        LB[n] = b; LE[n] = e;
      }
      function openBeam(n, at, th0, th1, o, dur) {
        S[n].th = th0;
        gsap.set("#bm" + n, { "--t": Math.tan((th0 * Math.PI) / 180) });
        tl.set("#bm" + n, { opacity: 1 }, at);
        shape(n, o, at, dur || 1.0, EXPO);
        swing(n, th1, at, (dur || 1.0) + 0.3, EXPO);
        tl.fromTo("#bl" + n, { opacity: 1 }, { opacity: 0.45, duration: 1.2, ease: "power2.out", immediateRender: false }, at + 0.05);
        lit(n, true, at - 0.2, 0.5);
      }
      function closeBeam(n, at, dur, ease) {
        shape(n, { L: 2, b: S[n].a, k: 0 }, at, dur, ease || "power3.in");
        tl.set("#bm" + n, { opacity: 0 }, at + dur);
        lit(n, false, at + dur * 0.4, 0.5);
      }

      // camera: three nested layers. cam1 is the screen centre, cam2 scales/rolls, cam3 pans the world
      const C = { cx: 860, cy: 495, s: 0.86, rot: 0 };
      gsap.set("#cam3", { x: -C.cx, y: -C.cy });
      gsap.set("#cam2", { scale: C.s, rotation: C.rot });
      function cam(cx, cy, s, rot, at, dur, ease) {
        tl.fromTo("#cam3", { x: -C.cx, y: -C.cy }, { x: -cx, y: -cy, duration: dur, ease, immediateRender: false }, at);
        tl.fromTo("#cam2", { scale: C.s, rotation: C.rot }, { scale: s, rotation: rot, duration: dur, ease, immediateRender: false }, at);
        Object.assign(C, { cx, cy, s, rot });
      }

      // grain re-rolled every 3 frames
      for (let f = 0; f < 330; f += 3) {
        tl.set("#grain", { backgroundPosition: ((f * 97) % 256) + "px " + ((f * 61 + 37 * (f % 5)) % 256) + "px" }, f / 30);
      }
      gsap.set("#pn2", { x: -90 });
      gsap.set("#lg3", { opacity: 0 });

      /* ---- scene 1: laptop 1 wakes and throws the editor (0 to 3.0) ---- */
      tl.fromTo("#lg1", { opacity: 0.35 }, { opacity: 1, duration: 0.7, ease: "power2.out" }, 0);
      tl.fromTo("#bd1", { y: 80, scale: 1.14 }, { y: 0, scale: 1, duration: 1.4, ease: EXPO }, 0);
      tl.fromTo("#spec1", { x: -120 }, { x: 700, duration: 2.6, ease: "power2.inOut" }, 0.2);
      openBeam(1, 0.75, -14, -3, { L: 800, b: 520, a: 170 }, 1.0);
      cam(860, 495, 0.9, 0, 0, 3.0, "none");
      swing(1, 12, 2.05, 0.95, "sine.inOut");
      shape(1, { L: 820 }, 1.9, 1.2, "sine.inOut");
      tl.fromTo("#gpill", { opacity: 0, y: 6 }, { opacity: 1, y: 0, duration: 0.4, ease: "power2.out", immediateRender: false }, 1.15);
      tl.set("#gpill", { opacity: 0 }, 1.9);
      tl.set(".ghost", { opacity: 1 }, 1.9);
      for (let i = 0; i < 6; i++) tl.set(".t" + i, { opacity: 1 }, 2.35 + 0.12 * i);

      /* ---- scene 2: hand-off to laptop 2 (3.0 to 4.4) ---- */
      swing(1, -26, 3.0, 0.45, "power2.in");
      tl.fromTo("#lg1", { opacity: 1 }, { opacity: 0, duration: 0.4, ease: "power1.out", immediateRender: false }, 3.45);
      tl.fromTo("#lg1", { opacity: 0 }, { opacity: 1, duration: 0.35, ease: "power2.out", immediateRender: false }, 4.45);
      tl.fromTo("#lg3", { opacity: 0 }, { opacity: 1, duration: 0.35, ease: "power2.out", immediateRender: false }, 4.7);
      closeBeam(1, 3.0, 0.45, "power2.inOut");
      cam(1500, 490, 0.9, -3, 3.0, 1.1, IO);
      openBeam(2, 3.4, -30, -6, { L: 860, b: 560, a: 170, k: 30 }, 1.0);
      tl.fromTo("#spec2", { x: -120 }, { x: 700, duration: 2.6, ease: "power2.inOut" }, 3.4);
      tl.fromTo("#chLine", { strokeDashoffset: 1 }, { strokeDashoffset: 0, duration: 1.0, ease: "power2.inOut", immediateRender: false }, 3.75);
      tl.fromTo("#chArea", { opacity: 0 }, { opacity: 1, duration: 0.7, ease: "power1.out", immediateRender: false }, 4.2);
      tl.set("#chDot", { opacity: 1 }, 4.7);
      tl.set("#chTip", { opacity: 1 }, 4.7);
      swing(2, 4, 4.55, 1.1, "sine.inOut");
      cam(1500, 490, 0.94, -3, 4.1, 0.3, "none");

      /* ---- scene 3: three beams at once (4.4 to 6.4) ---- */
      cam(1500, 670, 0.72, 0, 4.4, 1.1, IO);
      yaw(1, -9, 4.6, 1.0);
      tl.fromTo("#base1, #base3", { y: 0 }, { y: -2, duration: 1.0, ease: IO, immediateRender: false }, 4.6);
      openBeam(1, 4.75, -30, -17, { L: 650, b: 330, a: 150, k: -40 }, 1.0);
      yaw(3, 10, 4.6, 1.0);
      tl.fromTo("#spec3", { x: -120 }, { x: 700, duration: 2.6, ease: "power2.inOut" }, 4.75);
      openBeam(3, 5.0, 28, 20, { L: 650, b: 350, a: 160, k: 45 }, 1.0);
      shape(2, { L: 680, b: 330, a: 150, k: 0 }, 4.65, 0.9, IO);
      tl.set("#stB", { display: "none" }, 5.05);
      tl.set("#stR", { display: "inline-flex", position: "static" }, 5.05);
      tl.fromTo("#stR", { backgroundColor: "rgba(31,184,120,0.45)" }, { backgroundColor: "rgba(31,184,120,0)", duration: 0.7, ease: "power1.out", immediateRender: false }, 5.05);
      tl.set("#duB", { opacity: 0, position: "absolute" }, 5.05);
      tl.set("#duR", { opacity: 1, position: "static" }, 5.05);
      tl.fromTo("#toast", { opacity: 0, y: -10 }, { opacity: 1, y: 0, duration: 0.45, ease: EXPO, immediateRender: false }, 5.5);
      tl.to("#toast", { opacity: 0, duration: 0.3, ease: "power1.out" }, 6.3);
      swing(2, -4, 5.5, 0.9, "sine.inOut");
      swing(1, -17, 5.7, 0.7, "sine.inOut");
      swing(3, 18, 5.7, 0.7, "sine.inOut");
      cam(1500, 670, 0.74, -3, 5.5, 0.9, "sine.inOut");

      /* ---- scene 4: one wide cone (6.4 to 8.3) ---- */
      swing(1, 12, 6.4, 0.5, "power2.in");
      closeBeam(1, 6.42, 0.5);
      swing(3, -12, 6.4, 0.5, "power2.in");
      closeBeam(3, 6.42, 0.5);
      tl.fromTo("#lg1, #lg3", { opacity: 1 }, { opacity: 0, duration: 0.4, ease: "power1.out", immediateRender: false }, 6.5);
      yaw(1, 0, 6.4, 0.5);
      cam(1560, 585, 0.9, 0, 6.4, 1.1, IO);
      shape(2, { L: 560, b: 800, a: 190, k: 0 }, 6.5, 1.0, IO);
      swing(2, 0, 6.5, 1.0, IO);
      tl.fromTo("#pn2", { scale: 1.25, x: -90 }, { scale: 1.3, x: 0, duration: 1.0, ease: IO, immediateRender: false }, 6.5);
      // stat sits outside the right edge of the wide cone (edge angle 42 degrees, from x 190 at the lid corner), starting 200px along the edge
      gsap.set("#swr", { x: 337, y: -135, rotation: -42.6 });
      tl.fromTo("#sinr", { opacity: 0, x: -200 }, { opacity: 1, x: 0, duration: 0.9, ease: EXPO, immediateRender: false }, 7.05);
      cam(1560, 585, 0.93, 0, 7.5, 0.8, "none");

      /* ---- scene 5: lid closes and the lockup holds (8.3 to 11.0) ---- */
      tl.to("#sinr", { opacity: 0, duration: 0.3, ease: "power1.out" }, 8.3);
      shape(2, { L: 2, b: 190 }, 8.25, 0.6, "power3.in");
      tl.set("#bm2", { opacity: 0 }, 8.85);
      tl.fromTo("#hg2", { opacity: 1 }, { opacity: 0, duration: 0.5, ease: "power2.out", immediateRender: false }, 8.4);
      tl.fromTo("#edge2", { opacity: 1 }, { opacity: 0, duration: 0.5, ease: "power2.out", immediateRender: false }, 8.4);
      tl.fromTo("#pool2", { opacity: 1 }, { opacity: 0, duration: 0.8, ease: "power2.out", immediateRender: false }, 8.4);
      tl.fromTo("#lid2", { scaleY: 0.978, filter: "brightness(1)" }, { scaleY: 1, filter: "brightness(1.05)", duration: 1.0, ease: IO, immediateRender: false }, 8.4);
      tl.fromTo("#lid2", { clipPath: "polygon(1.6% 0, 98.4% 0, 100% 100%, 0% 100%)" }, { clipPath: "polygon(0% 0, 100% 0, 100% 100%, 0% 100%)", duration: 1.0, ease: IO, immediateRender: false }, 8.4);
      tl.fromTo("#base2", { y: 0, x: 0 }, { y: 9, duration: 1.0, ease: IO, immediateRender: false }, 8.4);
      tl.fromTo("#fsh2", { y: 0, opacity: 1 }, { y: 9, opacity: 0.8, duration: 1.0, ease: IO, immediateRender: false }, 8.4);
      tl.fromTo("#lg2", { y: 760 }, { y: 386, duration: 1.0, ease: IO, immediateRender: false }, 8.4);
      cam(1500, 520, 1.2, 0, 8.3, 2.7, "power2.out");
      tl.fromTo("#spec2", { x: -140 }, { x: 600, duration: 1.3, ease: "power2.inOut", immediateRender: false }, 9.2);
      tl.to("#mkg2", { opacity: 1, duration: 0.8, ease: "power2.out" }, 8.9);
      tl.fromTo("#wm", { opacity: 0, y: 14 }, { opacity: 1, y: 0, duration: 0.6, ease: EXPO }, 8.9);

      tl.set({}, {}, 11);
      window.__timelines = window.__timelines || {};
      window.__timelines["main"] = tl;
    </script>
  </body>
</html>
```
