# Rack Focus

A large insight card sits sharp in the foreground with a blurred laptop behind it. Focus pulls to the laptop, the card softens and drifts away, a second card slides in from the right and takes focus back, and a last pull lands on the headline Every dollar, in focus. before the Corsa lockup.

- Position in a launch film: Product reveal
- Slug: rack-focus
- Preview video: https://media.motionboard.app/rack-focus.mp4
- Recipe page: https://motionboard.app/recipes/rack-focus/
- 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 `rack-focus`. 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 10.6s. Insight card rises 0.1–0.9s; runway count 12.9→14.2 over 1.0–2.3s and sparkline draws 0.9–2.2s; rack 1 to the laptop 2.5–3.4s (0.9s); insight card drifts off left 3.0–4.4s; new transaction row 3.75–4.3s, cash 482,310→481,070 over 3.85–4.5s, tooltip $33.9k 4.2–4.55s; approval card slides in from the right 4.6–5.6s; rack 2 to the card 4.9–5.8s (0.9s); Approve pressed at 6.2s, budget bar fills 6.4–7.1s; card leaves 7.1–7.8s; rack 3 to the headline 7.1–8.1s (1.0s), headline fades in 7.5–8.3s, underline draws 8.15–8.85s; scene fades 9.1–9.6s; lockup rises 9.3–10.4s and holds to the end |
| Easing | All three racks use power2.inOut, interpolating the focus distance between keyframes; card rise and slide-in, number counts, underline and lockup rise use expo.out; sparkline, fades and blur recovery use power2.out; card exits use power2.inOut and power2.in; the background drift is linear (none) |
| Camera | Locked camera with one focus distance driving the film. Depths: foreground cards 0, laptop 0.8, headline 1.5, bokeh 2.0–2.5. Focus is 0 for 0–2.5s, 0.8 at 3.4–4.9s, back to 0 at 4.9–5.8s, then 1.5 at 7.1–8.1s. Blur radius: planes in front of the focus get 40px per unit of distance capped at 24px; planes behind it get 28px per unit capped at 22px. Focus breathing: a foreground card grows 5% when fully defocused, the laptop and headline at most 1.4%. Parallax drift is linear over the 10.6s: x offset headline 10px, laptop 22px, approval card 44px, insight card 60px, with y at 25% of x |
| Subject | Insight card 700x448px scaled 1.2x to about 840x538px, centred at (510, 700), left of centre; approval card 520x338px scaled 1.2x to about 624x406px, centred at (1500, 520), right of centre; laptop lid 1000x600px scaled 1.18x to about 1180x708px, centred near (1190, 640), screen 976x576px with 14–15px UI text (about 16.5–17.7px on screen) and a 1120x24px base; headline Every dollar, in focus. at 140px with 144px line height, centred; 7 bokeh discs of 65–180px with a thin brighter rim, a faint fill and a soft outer edge, clustered at the laptop's upper left and right at depth 2.0–2.5; diameter = size × (0.3 + 0.7 × min(1, \|depth − focus\| / 2.4)), opacity = (0.08 + 0.17 × (1 − that ratio)) × 0.75–1, with a 3px blur |
| Sync | In each rack one plane's blur rises while the other falls on the same frame and the same curve; the laptop is sharp at 3.4s and the new transaction row lands 0.35s later; focus settles on the approval card at 5.8s and Approve is pressed 0.4s after, with the figures and budget bar following; the headline starts to appear at 7.5s while focus is still moving and is sharp at 8.1s, when the underline begins; the laptop drops to 45% opacity at 7.2–8.1s so the headline owns the frame |
| Style | Background `#09090b`, one accent mint `#3fe0a5`, neutral dark grey cards and UI; Inter throughout, headline weight 700; cards with 26px corners, a 1px hairline border and a large soft shadow; grain at 7% opacity re-rolled every 3 frames and a vignette reaching 50% at the edges |

## Why it works

One shared focus distance drives the whole film and each plane computes its blur from its own distance to it, so one plane going soft and another going sharp happen on the same frame and the same easing curve, and the viewer reads a lens turning its focus ring. The foreground card grows slightly as it defocuses, which is real lens focus breathing, and a slow parallax drift keeps the order of the planes visible. Each rack shows only two planes: the insight card against the laptop, the approval card against the laptop, then the headline against the defocused laptop; one card drifts out before the next comes in, so the frame never holds three layers at once. Each pull is followed by a hold of about 1.5s with something happening on the interface (a counting number, a new transaction row, an Approve press), so there is content to read the moment focus lands. The headline appears last and sits on the farthest content plane, so it stays soft whenever focus is elsewhere. Bokeh lights sit at the back and swell and shrink with focus, giving the background a change on every pull. There is one accent color, mint #3fe0a5.

## Prompt

> Build a 10.6-second, 1920x1080, 30 fps dark product film called Rack Focus for a fictional product, Corsa (a team finance app). Background #09090b, one accent color mint #3fe0a5, font Inter. The frame has four planes, each with a depth: an insight card and an approval card in front (depth 0), a laptop in the middle (depth 0.8), the headline Every dollar, in focus. far back (depth 1.5), and 7 bokeh lights at the very back (depth 2.0–2.5). Drive the film with one focus distance f over time: 0 for 0–2.5s, to 0.8 over 2.5–3.4s, held at 0.8 until 4.9s, back to 0 over 4.9–5.8s, held at 0 until 7.1s, then to 1.5 over 7.1–8.1s, every segment eased with power2.inOut. On each frame compute each plane's blur radius from its distance to f: 40px per unit of distance when the plane is in front of the focus, capped at 24px; 28px per unit when it is behind, capped at 22px. Apply it as CSS filter: blur() on the plane. Scale a plane up as it defocuses (focus breathing): foreground cards up to 5%, laptop and headline up to 1.4%. Add a linear parallax drift: x offset = −u × factor, with u running from −1 to 1 over the film and factors of 10px for the headline, 22px for the laptop, 44px for the approval card and 60px for the insight card, y offset at 25% of x. Put all state in one render(t) function driven by one linear proxy tween from 0 to 10.6s, with no CSS animations. The insight card is 700x448px scaled 1.2x and centred at (510, 700): a Corsa Insight header, a number counting 12.9→14.2 months of runway, a +1.3 mo chip, a sparkline, one line of copy and two buttons. The laptop lid is 1000x600px scaled 1.18x and centred near (1190, 640), with a 976x576px Corsa dashboard: a 176px sidebar, three KPI cards (Cash balance $482,310, Monthly burn $33,920, Runway 14.2 mo), an 8-month spend bar chart with November in mint and a transactions table, UI text 14–15px. The approval card is 520x338px scaled 1.2x and centred at (1500, 520): Priya Nair requesting $2,400.00 for annual design seats, a Marketing budget $6,180 left bar, and Approve and Decline buttons. Timeline: the insight card rises 0.1–0.9s (expo.out, from 50px below, scale 0.94→1) and the other planes fade in 0–1.2s; the number counts to 14.2 over 1.0–2.3s and the sparkline draws 0.9–2.2s; rack 1 to the laptop 2.5–3.4s while the insight card drifts 380px left and fades over 3.0–4.4s; at 3.75–4.3s a row Planwise −$1,240.00 slides in at the top of the transactions table (the other rows move down 34px, the new row flashes mint), cash counts to $481,070 over 3.85–4.5s and a $33.9k tooltip appears on the chart at 4.2–4.55s; the approval card slides in from 340px right at 4.6–5.6s (expo.out); rack 2 back to the foreground at 4.9–5.8s; at 6.2s Approve is pressed (scale 0.95 and back), the label turns to Approved and the budget bar fills from 38.2% to 62.2% over 6.4–7.1s with the text changing to $3,780 left; the card leaves right 7.1–7.8s; rack 3 to the headline 7.1–8.1s, with the headline fading in 7.5–8.3s, the laptop dropping to 45% opacity and a mint underline under focus. drawing 8.15–8.85s; the scene fades out 9.1–9.6s; the lockup rises 9.3–10.4s (120px mint mark, Corsa at 136px, Team finance, made clear. at 34px), going from 14px blur to sharp as it rises. Bokeh sits only at the laptop's upper left and right: diameter = size × (0.3 + 0.7 × min(1, |depth − f| / 2.4)) and opacity = (0.08 + 0.17 × (1 − that ratio)) × 0.75–1, so the discs swell, shrink and dim with focus. Finish with 7% grain re-rolled every 3 frames and a vignette.

## Often confused with

- [Device Push-in Focus](https://motionboard.app/r/device-push-in-focus.md): Device Push-in Focus moves the camera toward parts of one device; in Rack Focus the camera stays still and focus moves between planes at different depths: foreground cards, the laptop and the headline.
- [3D Tilted UI with Depth of Field](https://motionboard.app/r/3d-tilted-ui-depth-of-field.md): Tilted UI with Depth of Field leads the eye with a sharp band and graded blur across one tilted interface; in Rack Focus a whole plane is sharp at a time and the sharp plane changes over time.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/rack-focus/hyperframes.json (318 B)
- https://motionboard.app/source/rack-focus/index.html (32.3 KB)
- https://motionboard.app/source/rack-focus/package.json (299 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "rack-focus/hyperframes.json" "https://motionboard.app/source/rack-focus/hyperframes.json"
curl -fsSL --create-dirs -o "rack-focus/index.html" "https://motionboard.app/source/rack-focus/index.html"
curl -fsSL --create-dirs -o "rack-focus/package.json" "https://motionboard.app/source/rack-focus/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: #09090b;
        --ink: #f4f4f5;
        --soft: #c4c4cc;
        --muted: #8e8e98;
        --line: rgba(255, 255, 255, 0.09);
        --accent: #3fe0a5;
        --accent-ink: #04140d;
        --font-ui: "Inter", -apple-system, "SF Pro Text", "Helvetica Neue", sans-serif;
      }
      * { 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; }
      .plane { position: absolute; opacity: 0; transform-origin: 50% 50%; }
      svg { display: block; flex: none; }
      .ac { color: var(--accent); }

      /* ---------- backdrop ---------- */
      #bg {
        z-index: 0;
        background:
          radial-gradient(ellipse 46% 44% at 68% 64%, rgba(63, 224, 165, 0.085) 0%, rgba(63, 224, 165, 0) 70%),
          radial-gradient(ellipse 58% 50% at 18% 14%, rgba(120, 132, 175, 0.10) 0%, rgba(120, 132, 175, 0) 70%),
          #09090b;
      }
      #bokeh { z-index: 1; overflow: hidden; }
      .bk {
        position: absolute; left: 0; top: 0; width: 200px; height: 200px; border-radius: 50%;
        filter: blur(3px); opacity: 0; transform-origin: 50% 50%;
      }

      /* z order of the focus planes: far to near */
      #hl { z-index: 2; }
      #lap { z-index: 3; }
      #cb { z-index: 4; }
      #ca { z-index: 5; }

      /* ---------- headline plane ---------- */
      #hl { left: 260px; top: 396px; width: 1400px; height: 288px; text-align: center; }
      #hl .h1 { font-size: 140px; line-height: 144px; font-weight: 700; letter-spacing: -0.045em; color: var(--ink); white-space: nowrap; }
      #hl .ac { position: relative; display: inline-block; }
      #hl .ul { position: absolute; left: 4px; right: 14px; bottom: 8px; height: 8px; border-radius: 4px; background: var(--accent); transform-origin: 0 50%; transform: scaleX(0); }

      /* ---------- cards ---------- */
      .card {
        border-radius: 26px;
        background: linear-gradient(160deg, #1c1c22 0%, #121216 100%);
        border: 1px solid var(--line);
        box-shadow: 0 50px 110px rgba(0, 0, 0, 0.65), 0 14px 36px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.06);
      }
      .ctile { position: absolute; width: 38px; height: 38px; border-radius: 11px; background: rgba(63, 224, 165, 0.14); color: var(--accent); display: flex; align-items: center; justify-content: center; }
      .chead { position: absolute; font-size: 17px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
      .cmeta { position: absolute; font-size: 15px; color: var(--muted); white-space: nowrap; }
      .btn { position: absolute; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 16px; font-weight: 600; white-space: nowrap; }
      .btn.pri { background: var(--accent); color: var(--accent-ink); }
      .btn.gho { background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.10); color: #d4d4d9; }

      /* card A: insight */
      #ca { left: 160px; top: 476px; width: 700px; height: 448px; }
      #ca .num { position: absolute; left: 32px; top: 78px; font-size: 100px; line-height: 110px; font-weight: 800; letter-spacing: -0.05em; }
      #ca .unit { position: absolute; left: 252px; top: 130px; font-size: 21px; font-weight: 500; color: var(--muted); }
      #ca .chip { position: absolute; right: 32px; top: 100px; height: 36px; padding: 0 14px 0 11px; border-radius: 18px; background: rgba(63, 224, 165, 0.14); color: var(--accent); display: flex; align-items: center; gap: 7px; font-size: 16px; font-weight: 600; white-space: nowrap; }
      #ca .spark { position: absolute; left: 32px; top: 204px; }
      #ca .body { position: absolute; left: 32px; top: 308px; width: 636px; font-size: 20px; line-height: 28px; color: var(--soft); letter-spacing: -0.005em; }
      #ca .body b { color: var(--ink); font-weight: 600; }

      /* card B: approval */
      #cb { left: 1240px; top: 351px; width: 520px; height: 338px; }
      #cb .av { position: absolute; left: 28px; top: 26px; width: 44px; height: 44px; border-radius: 50%; background: #2c2c33; border: 1px solid rgba(255, 255, 255, 0.10); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 600; color: #d4d4d9; }
      #cb .st { position: absolute; right: 28px; top: 32px; height: 32px; border-radius: 16px; padding: 0 14px; display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; white-space: nowrap; }
      #cb .st.pend { background: rgba(255, 255, 255, 0.08); color: #c4c4cc; }
      #cb .st.done { background: rgba(63, 224, 165, 0.16); color: var(--accent); opacity: 0; }
      #cb .amt { position: absolute; left: 28px; top: 92px; font-size: 56px; line-height: 64px; font-weight: 700; letter-spacing: -0.04em; }
      #cb .amt small { font-size: 32px; color: var(--muted); font-weight: 600; letter-spacing: -0.02em; }
      #cb .what { position: absolute; left: 28px; top: 162px; font-size: 17px; color: var(--muted); white-space: nowrap; }
      #cb .bl { position: absolute; left: 28px; top: 204px; font-size: 14px; color: var(--muted); white-space: nowrap; }
      #cb .br { position: absolute; right: 28px; top: 204px; font-size: 14px; font-weight: 600; color: var(--soft); white-space: nowrap; }
      #cb .track { position: absolute; left: 28px; right: 28px; top: 230px; height: 8px; border-radius: 4px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
      #cb .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 38%; border-radius: 4px; background: #6a6a74; }
      #cb .btn { top: 268px; }
      .lab2 { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }

      /* ---------- laptop plane ---------- */
      #lap { left: 690px; top: 344px; width: 1000px; height: 640px; }
      .lid { position: absolute; left: 0; top: 0; width: 1000px; height: 600px; border-radius: 22px 22px 6px 6px; background: #0b0b0e; border: 1px solid #2c2c33; box-shadow: 0 60px 120px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.10); }
      .scr { position: absolute; left: 12px; top: 12px; width: 976px; height: 576px; border-radius: 10px; overflow: hidden; background: #0e0e11; }
      .scr::after { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255, 255, 255, 0.045) 0%, rgba(255, 255, 255, 0) 38%); pointer-events: none; }
      .base { position: absolute; left: -60px; top: 600px; width: 1120px; height: 24px; border-radius: 0 0 26px 26px; background: linear-gradient(180deg, #34343b 0%, #1b1b20 100%); box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6); }
      .base::before { content: ""; position: absolute; left: 50%; top: 0; width: 170px; height: 8px; margin-left: -85px; border-radius: 0 0 10px 10px; background: #0f0f12; }
      .side { position: absolute; left: 0; top: 0; width: 176px; height: 576px; background: #0b0b0e; border-right: 1px solid var(--line); }
      .brand { position: absolute; left: 18px; top: 18px; display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
      .nav { position: absolute; left: 10px; width: 156px; height: 34px; border-radius: 8px; display: flex; align-items: center; gap: 10px; padding: 0 10px; font-size: 15px; font-weight: 500; color: var(--muted); }
      .nav.on { background: rgba(255, 255, 255, 0.07); color: var(--ink); }
      .ws { position: absolute; left: 10px; bottom: 14px; width: 156px; height: 46px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); display: flex; align-items: center; gap: 10px; padding: 0 10px; }
      .ws i { font-style: normal; width: 26px; height: 26px; border-radius: 7px; background: #2c2c33; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #d4d4d9; }
      .ws span { font-size: 13.5px; font-weight: 600; line-height: 16px; }
      .ws em { display: block; font-style: normal; font-size: 12.5px; font-weight: 400; color: var(--muted); }
      .main { position: absolute; left: 176px; top: 0; width: 800px; height: 576px; }
      .mt { position: absolute; left: 24px; top: 20px; font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
      .pill { position: absolute; right: 24px; top: 20px; height: 30px; padding: 0 12px; border-radius: 15px; background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 500; color: #c4c4cc; }
      .kpi { position: absolute; top: 70px; width: 241px; height: 92px; border-radius: 12px; background: #131317; border: 1px solid var(--line); }
      .kpi .kl { position: absolute; left: 16px; top: 13px; font-size: 14px; color: var(--muted); }
      .kpi .kv { position: absolute; left: 16px; top: 34px; font-size: 30px; line-height: 34px; font-weight: 700; letter-spacing: -0.03em; }
      .kpi .kd { position: absolute; left: 16px; top: 68px; font-size: 14px; font-weight: 500; color: var(--accent); }
      .kpi .kd.n { color: var(--muted); }
      .pn { position: absolute; left: 24px; width: 752px; border-radius: 12px; background: #131317; border: 1px solid var(--line); }
      .pn .pt { position: absolute; left: 16px; top: 12px; font-size: 15px; font-weight: 600; }
      .pn .pr { position: absolute; right: 16px; top: 13px; font-size: 14px; font-weight: 500; color: var(--accent); }
      #chart { top: 176px; height: 182px; }
      .bars { position: absolute; left: 20px; right: 20px; top: 48px; height: 100px; display: flex; align-items: flex-end; justify-content: space-between; }
      .bars i { display: block; width: 56px; border-radius: 6px 6px 2px 2px; background: #2b2b32; }
      .bars i.cur { background: var(--accent); }
      .bl2 { position: absolute; left: 20px; right: 20px; top: 156px; display: flex; justify-content: space-between; }
      .bl2 span { width: 56px; text-align: center; font-size: 13.5px; color: var(--muted); }
      #tip { position: absolute; left: 670px; top: 42px; width: 68px; height: 28px; border-radius: 8px; background: var(--ink); color: #09090b; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; opacity: 0; }
      #txn { top: 372px; height: 184px; }
      #rows { position: absolute; left: 0; top: 42px; width: 750px; height: 136px; overflow: hidden; }
      .tr { position: absolute; left: 8px; width: 734px; height: 34px; border-radius: 8px; display: flex; align-items: center; }
      .tr .lg { margin-left: 8px; width: 24px; height: 24px; border-radius: 7px; background: #2c2c33; display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 700; color: #d4d4d9; flex: none; }
      .tr .nm { position: absolute; left: 44px; font-size: 15px; font-weight: 600; }
      .tr .ct { position: absolute; left: 215px; font-size: 14px; color: var(--muted); }
      .tr .cd { position: absolute; left: 372px; font-size: 14px; color: var(--muted); }
      .tr .tm { position: absolute; left: 490px; font-size: 14px; color: var(--muted); }
      .tr .am { position: absolute; right: 14px; font-size: 15px; font-weight: 600; }
      #flash { background: rgba(63, 224, 165, 0.14); }

      /* ---------- finish ---------- */
      #grain {
        z-index: 8; pointer-events: none; opacity: 0.07;
        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: 9; pointer-events: none;
        background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0) 52%, rgba(0, 0, 0, 0.5) 100%);
      }
      #lock { z-index: 7; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; padding-bottom: 20px; }
      #lock .lrow { display: flex; align-items: center; gap: 30px; opacity: 0; }
      #lock .wm { font-size: 136px; line-height: 140px; font-weight: 700; letter-spacing: -0.05em; padding-bottom: 8px; }
      #lock .tag { font-size: 34px; line-height: 44px; font-weight: 400; color: #9a9aa4; letter-spacing: -0.01em; opacity: 0; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="10.6" data-width="1920" data-height="1080">
      <div id="bg" class="clip full" data-start="0" data-duration="10.6" data-track-index="0"></div>
      <div id="bokeh" class="clip full" data-start="0" data-duration="10.6" data-track-index="1" data-layout-ignore></div>

      <!-- plane 1.5: headline, far behind the product; only on screen for the last rack -->
      <div id="hl" class="clip plane" data-start="0" data-duration="10.6" data-track-index="2" data-layout-allow-overlap>
        <div class="h1">Every dollar,<br />in <span class="ac">focus.<i class="ul"></i></span></div>
      </div>

      <!-- plane 0.8: laptop with the product screen -->
      <div id="lap" class="clip plane" data-start="0" data-duration="10.6" data-track-index="3" data-layout-allow-overlap>
        <div class="lid">
          <div class="scr">
            <div class="side">
              <div class="brand" id="brandmark"></div>
              <div id="navs"></div>
              <div class="ws"><i>NL</i><span>Northwind Labs<em>14 members</em></span></div>
            </div>
            <div class="main">
              <div class="mt">Overview</div>
              <div class="pill" id="pill"></div>
              <div class="kpi" style="left:24px"><div class="kl">Cash balance</div><div class="kv" id="l-cash">$482,310</div><div class="kd">+2.1% vs Oct</div></div>
              <div class="kpi" style="left:279px"><div class="kl">Monthly burn</div><div class="kv">$33,920</div><div class="kd">-4.8% vs Oct</div></div>
              <div class="kpi" style="left:535px"><div class="kl">Runway</div><div class="kv">14.2 mo</div><div class="kd">+1.3 mo this month</div></div>
              <div class="pn" id="chart">
                <div class="pt">Spend by month</div>
                <div class="pr">Down 11.6% since Apr</div>
                <div class="bars" id="bars"></div>
                <div class="bl2" id="blab"></div>
                <div id="tip">$33.9k</div>
              </div>
              <div class="pn" id="txn">
                <div class="pt">Recent transactions</div>
                <div class="pr">View all</div>
                <div id="rows"></div>
              </div>
            </div>
          </div>
        </div>
        <div class="base"></div>
      </div>

      <!-- plane 0.35: approval card -->
      <div id="cb" class="clip plane card" data-start="0" data-duration="10.6" data-track-index="4" data-layout-allow-overlap>
        <div class="av">PN</div>
        <div class="chead" style="left:86px;top:26px">Priya Nair</div>
        <div class="cmeta" style="left:86px;top:50px;font-size:14px">Marketing · 2 min ago</div>
        <div class="st pend" id="b-pend"><span id="ic-clock"></span>Pending</div>
        <div class="st done" id="b-done"><span id="ic-check1"></span>Approved</div>
        <div class="amt">$2,400<small>.00</small></div>
        <div class="what">Brushwork · 12 design seats, annual</div>
        <div class="bl">Marketing budget</div>
        <div class="br" id="b-left">$6,180 left</div>
        <div class="track"><div class="fill" id="b-fill"></div></div>
        <div class="btn pri" id="b-btn" style="left:28px;width:300px">
          <span class="lab2" id="b-l1">Approve</span>
          <span class="lab2" id="b-l2" style="opacity:0"><span id="ic-check2"></span>Approved</span>
        </div>
        <div class="btn gho" id="b-dec" style="left:344px;width:148px">Decline</div>
      </div>

      <!-- plane 0: insight card, closest to camera -->
      <div id="ca" class="clip plane card" data-start="0" data-duration="10.6" data-track-index="5" data-layout-allow-overlap>
        <div class="ctile" id="a-tile" style="left:32px;top:26px"></div>
        <div class="chead" style="left:84px;top:34px">Corsa Insight</div>
        <div class="cmeta" style="right:32px;top:36px">Just now</div>
        <div class="num" id="a-num">12.9</div>
        <div class="unit">months of runway</div>
        <div class="chip"><span id="a-trend"></span>+1.3 mo this month</div>
        <svg class="spark" id="a-spark" width="636" height="90" viewBox="0 0 636 90" fill="none">
          <line x1="0" y1="89.5" x2="636" y2="89.5" stroke="rgba(255,255,255,0.08)" />
          <line x1="0" y1="45" x2="636" y2="45" stroke="rgba(255,255,255,0.05)" stroke-dasharray="3 6" />
          <defs><linearGradient id="sg" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#3fe0a5" stop-opacity="0.28" /><stop offset="1" stop-color="#3fe0a5" stop-opacity="0" /></linearGradient></defs>
          <path id="a-area" d="M0 74 C 60 72, 90 66, 130 62 S 210 54, 260 46 S 350 42, 400 36 S 500 30, 560 22 S 610 14, 636 12 L 636 90 L 0 90 Z" fill="url(#sg)" opacity="0" />
          <path id="a-line" pathLength="1" d="M0 74 C 60 72, 90 66, 130 62 S 210 54, 260 46 S 350 42, 400 36 S 500 30, 560 22 S 610 14, 636 12" stroke="#3fe0a5" stroke-width="3.2" stroke-linecap="butt" stroke-dasharray="1" stroke-dashoffset="1" />
          <circle id="a-dot" cx="632" cy="12.5" r="6" fill="#3fe0a5" opacity="0" />
        </svg>
        <div class="body">Software spend fell <b>18%</b> after you removed <b>6 unused seats</b>. Savings are already counted in runway.</div>
        <div class="btn pri" style="left:32px;top:386px;width:200px">Review savings</div>
        <div class="btn gho" style="left:248px;top:386px;width:130px">Dismiss</div>
      </div>

      <div id="lock" class="clip full" data-start="0" data-duration="10.6" data-track-index="6" data-layout-allow-overlap>
        <div class="lrow"><span id="lock-mark"></span><span class="wm">Corsa</span></div>
        <div class="tag">Team finance, made clear.</div>
      </div>

      <div id="grain" class="clip full" data-start="0" data-duration="10.6" data-track-index="7"></div>
      <div id="vig" class="clip full" data-start="0" data-duration="10.6" data-track-index="8"></div>
    </div>

    <script>
      const DUR = 10.6;
      const $ = (s) => document.querySelector(s);

      /* ---------- icons (lucide-style, 24 grid) ---------- */
      const G = {
        spark: '<path d="M12 3l1.9 5.1L19 10l-5.1 1.9L12 17l-1.9-5.1L5 10l5.1-1.9z"/><path d="M19 17v4M17 19h4"/>',
        check: '<path d="M20 6 9 17l-5-5"/>',
        trend: '<polyline points="22 7 13.5 15.5 8.5 10.5 2 17"/><polyline points="16 7 22 7 22 13"/>',
        card: '<rect width="20" height="14" x="2" y="5" rx="2"/><line x1="2" x2="22" y1="10" y2="10"/>',
        grid: '<rect width="7" height="9" x="3" y="3" rx="1"/><rect width="7" height="5" x="14" y="3" rx="1"/><rect width="7" height="9" x="14" y="12" rx="1"/><rect width="7" height="5" x="3" y="16" rx="1"/>',
        receipt: '<path d="M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"/><path d="M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8"/><path d="M12 17.5v-11"/>',
        circleCheck: '<circle cx="12" cy="12" r="10"/><path d="m9 12 2 2 4-4"/>',
        pie: '<path d="M21.21 15.89A10 10 0 1 1 8 2.83"/><path d="M22 12A10 10 0 0 0 12 2v10z"/>',
        report: '<path d="M3 3v16a2 2 0 0 0 2 2h16"/><path d="M18 17V9"/><path d="M13 17V5"/><path d="M8 17v-3"/>',
        clock: '<circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/>',
        cal: '<rect width="18" height="18" x="3" y="4" rx="2"/><path d="M16 2v4"/><path d="M8 2v4"/><path d="M3 10h18"/>',
      };
      const ic = (g, s, sw) =>
        '<svg width="' + s + '" height="' + s + '" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="' + (sw || 2) +
        '" stroke-linecap="round" stroke-linejoin="round">' + G[g] + "</svg>";
      const markSVG = (s) =>
        '<svg width="' + s + '" height="' + s + '" viewBox="0 0 32 32"><rect width="32" height="32" rx="9" fill="#3fe0a5"/>' +
        '<path d="M21.5 11.2A7.4 7.4 0 1 0 21.5 20.8" stroke="#04140d" stroke-width="3.2" fill="none" stroke-linecap="round"/>' +
        '<circle cx="22.2" cy="16" r="2.1" fill="#04140d"/></svg>';

      $("#a-tile").innerHTML = ic("spark", 20, 2);
      $("#a-trend").innerHTML = ic("trend", 17, 2.4);
      $("#ic-clock").innerHTML = ic("clock", 14, 2.2);
      $("#ic-check1").innerHTML = ic("check", 14, 3);
      $("#ic-check2").innerHTML = ic("check", 18, 3);
      $("#brandmark").innerHTML = markSVG(24) + "Corsa";
      $("#lock-mark").innerHTML = markSVG(120);
      $("#pill").innerHTML = ic("cal", 14, 2) + "Last 30 days";

      /* ---------- laptop screen content ---------- */
      const NAV = [["grid", "Overview", 1], ["card", "Cards"], ["receipt", "Transactions"], ["circleCheck", "Approvals"], ["pie", "Budgets"], ["report", "Reports"]];
      $("#navs").innerHTML = NAV.map((n, i) =>
        '<div class="nav' + (n[2] ? " on" : "") + '" style="top:' + (66 + i * 38) + 'px">' + ic(n[0], 17, 1.9) + n[1] + "</div>").join("");

      const MONTHS = ["Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov"];
      const SPEND = [38.4, 41.2, 39.8, 42.5, 40.1, 37.6, 35.2, 33.9];
      $("#bars").innerHTML = SPEND.map((v, i) => '<i class="' + (i === 7 ? "cur" : "") + '" style="height:' + Math.round((v / 45) * 96) + 'px"></i>').join("");
      $("#blab").innerHTML = MONTHS.map((m) => "<span>" + m + "</span>").join("");

      // five rows: the first is the live charge that slides in; row i sits at slot i, the fifth is clipped
      const TXN = [
        ["L", "Planwise", "Software · 12 seats", "Visa ·· 4021", "Just now", "-$1,240.00"],
        ["H", "Cloudbase", "Hosting", "Visa ·· 4021", "Today, 9:12 AM", "-$420.00"],
        ["S", "Stackly", "Software", "Visa ·· 7788", "Today, 8:40 AM", "-$96.00"],
        ["K", "Skyway", "Travel", "Visa ·· 7788", "Yesterday", "-$612.40"],
        ["P", "Paylane", "Payroll", "Bank transfer", "Nov 24", "-$18,450.00"],
      ];
      $("#rows").innerHTML = '<div class="tr" id="flash" style="top:0"></div>' + TXN.map((r, i) =>
        '<div class="tr" id="tr' + i + '" style="top:' + (i === 0 ? 0 : (i - 1) * 34) + 'px"><span class="lg">' + r[0] + '</span><span class="nm">' + r[1] +
        '</span><span class="ct">' + r[2] + '</span><span class="cd">' + r[3] + '</span><span class="tm">' + r[4] + '</span><span class="am">' + r[5] + "</span></div>").join("");

      /* ---------- bokeh lights: far background only, behind the laptop and every card ---------- */
      function mulberry32(a) {
        return function () {
          a |= 0; a = (a + 0x6d2b79f5) | 0;
          let t = Math.imul(a ^ (a >>> 15), 1 | a);
          t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t;
          return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
        };
      }
      const rnd = mulberry32(48211);
      // x, y, size (px at full defocus), tint
      const SPOTS = [
        [520, 235, 150, "255,238,205"], [330, 185, 95, "63,224,165"], [770, 150, 70, "255,238,205"],
        [1830, 320, 180, "63,224,165"], [1760, 135, 110, "255,238,205"], [1890, 640, 130, "63,224,165"], [1330, 170, 65, "255,238,205"],
      ];
      const BK = SPOTS.map((p) => {
        const el = document.createElement("div");
        el.className = "bk";
        const c = p[3];
        // faint fill, thin brighter rim, soft outer falloff
        el.style.background = "radial-gradient(circle closest-side, rgba(" + c + ",0.26) 0%, rgba(" + c + ",0.32) 62%, rgba(" + c + ",0.80) 82%, rgba(" + c + ",0.30) 92%, rgba(" + c + ",0) 100%)";
        $("#bokeh").appendChild(el);
        return { el, x: p[0], y: p[1], S: p[2], d: 2.0 + rnd() * 0.5, k: 0.75 + rnd() * 0.25, par: 3 + rnd() * 5 };
      });

      /* ---------- helpers ---------- */
      const ez = {};
      const E = (n) => ez[n] || (ez[n] = gsap.parseEase(n));
      const seg = (t, a, b, e) => E(e || "none")(Math.min(1, Math.max(0, (t - a) / (b - a))));
      const lerp = (a, b, p) => a + (b - a) * p;
      const fmt = (n) => Math.round(n).toLocaleString("en-US");

      /* ---------- focus pull: one shared focus distance, every plane blurs from its own depth ---------- */
      // [time, focus distance]; 0 = foreground cards, 0.8 = laptop, 1.5 = headline
      const FOCUS = [[0, 0], [2.5, 0], [3.4, 0.8], [4.9, 0.8], [5.8, 0], [7.1, 0], [8.1, 1.5]];
      function focusAt(t) {
        for (let i = 1; i < FOCUS.length; i++) {
          if (t < FOCUS[i][0]) {
            const a = FOCUS[i - 1], b = FOCUS[i];
            return lerp(a[1], b[1], seg(t, a[0], b[0], "power2.inOut"));
          }
        }
        return FOCUS[FOCUS.length - 1][1];
      }
      const NEAR = { k: 40, cap: 24 }; // plane nearer than the focus plane: strong blur
      const FAR = { k: 28, cap: 22 };  // plane behind the focus plane
      const blurOf = (d, f) => {
        const o = d < f ? NEAR : FAR;
        return Math.min(o.cap, Math.abs(d - f) * o.k) / o.cap; // 0..1 of that side's cap
      };

      // ent(t) -> { o: opacity, x, y: extra offset, s: extra scale }
      const rise = (t) => { const m = seg(t, 0, 1.2, "power2.out"); return { o: m, x: 0, y: 24 * (1 - m), s: 1 }; };
      const PL = [
        // headline: nothing on screen until the last rack
        { el: $("#hl"), d: 1.5, par: 10, base: 1, ent: (t) => ({ o: seg(t, 7.5, 8.3, "power2.out"), x: 0, y: 0, s: 0.96 + 0.04 * seg(t, 7.5, 8.5, "expo.out") }) },
        // laptop dims behind the headline
        { el: $("#lap"), d: 0.8, par: 22, base: 1.18, ent: (t) => { const r = rise(t); r.o *= 1 - 0.55 * seg(t, 7.2, 8.1, "power2.inOut"); return r; } },
        // approval card slides in from the right once the insight card has left, and leaves before the headline
        { el: $("#cb"), d: 0, par: 44, base: 1.2, ent: (t) => {
          const m = seg(t, 4.6, 5.6, "expo.out"), out = seg(t, 7.1, 7.8, "power2.in");
          return { o: seg(t, 4.6, 5.1, "power2.out") * (1 - out), x: 340 * (1 - m) + 300 * out, y: 0, s: 1 };
        } },
        // insight card: rises in, then drifts off to the left while it defocuses
        { el: $("#ca"), d: 0, par: 60, base: 1.2, ent: (t) => {
          const m = seg(t, 0.1, 0.9, "expo.out"), pe = seg(t, 3.0, 4.4, "power2.inOut");
          return { o: seg(t, 0.1, 0.6, "power2.out") * (1 - pe), x: -380 * pe, y: 50 * (1 - m), s: 0.94 + 0.06 * m };
        } },
      ];

      function renderPlanes(t, f) {
        const u = (t / DUR - 0.5) * 2; // camera drift, linear
        const sceneO = 1 - seg(t, 9.1, 9.6, "power2.inOut");
        PL.forEach((p) => {
          const side = p.d < f ? NEAR : FAR;
          const bn = blurOf(p.d, f);
          const blur = bn * side.cap;
          // focus breathing: a plane grows slightly as it defocuses
          const breathe = 1 + (p.d < 0.5 ? 0.05 : 0.014) * bn;
          const e = p.ent(t);
          const x = -u * p.par + e.x, y = -u * p.par * 0.25 + e.y;
          p.el.style.transform = "translate(" + x.toFixed(2) + "px," + y.toFixed(2) + "px) scale(" + (breathe * e.s * p.base).toFixed(4) + ")";
          p.el.style.opacity = (e.o * sceneO).toFixed(3);
          p.el.style.filter = blur > 0.05 ? "blur(" + blur.toFixed(2) + "px)" : "none";
        });
        return u;
      }

      function renderBokeh(t, f, u) {
        const fadeIn = seg(t, 0, 1.0, "power2.out");
        BK.forEach((b) => {
          const dn = Math.min(1, Math.abs(b.d - f) / 2.4);
          const D = b.S * (0.3 + 0.7 * dn);
          const a = (0.08 + 0.17 * (1 - dn)) * b.k * fadeIn;
          b.el.style.opacity = a.toFixed(3);
          b.el.style.transform = "translate(" + (b.x - u * b.par - 100).toFixed(1) + "px," + (b.y - u * b.par * 0.25 - 100).toFixed(1) + "px) scale(" + (D / 200).toFixed(4) + ")";
        });
      }

      const aNum = $("#a-num"), aLine = $("#a-line"), aArea = $("#a-area"), aDot = $("#a-dot");
      function renderA(t) {
        aNum.textContent = lerp(12.9, 14.2, seg(t, 1.0, 2.3, "expo.out")).toFixed(1);
        const p = seg(t, 0.9, 2.2, "power2.out");
        aLine.setAttribute("stroke-dashoffset", (1 - p).toFixed(4));
        aLine.setAttribute("opacity", p > 0.001 ? 1 : 0);
        aArea.setAttribute("opacity", (seg(t, 1.4, 2.4, "power2.out")).toFixed(3));
        aDot.setAttribute("opacity", seg(t, 2.0, 2.3, "power2.out").toFixed(3));
      }

      const lCash = $("#l-cash"), tip = $("#tip"), flash = $("#flash");
      function renderLaptop(t) {
        lCash.textContent = "$" + fmt(482310 - 1240 * seg(t, 3.85, 4.5, "power2.out"));
        const push = seg(t, 3.75, 4.3, "expo.out");
        const rowIn = seg(t, 3.75, 4.2, "power2.out");
        for (let i = 0; i < 5; i++) {
          const el = $("#tr" + i);
          if (i === 0) {
            el.style.opacity = rowIn.toFixed(3);
            el.style.transform = "translateY(" + (-14 * (1 - push)).toFixed(2) + "px)";
          } else {
            el.style.transform = "translateY(" + (34 * push).toFixed(2) + "px)";
          }
        }
        flash.style.opacity = (seg(t, 3.75, 4.2, "power2.out") * (1 - seg(t, 4.3, 5.2, "power2.out"))).toFixed(3);
        const tp = seg(t, 4.2, 4.55, "power2.out");
        tip.style.opacity = tp.toFixed(3);
        tip.style.transform = "translateY(" + (6 * (1 - tp)).toFixed(2) + "px)";
      }

      const bBtn = $("#b-btn"), bL1 = $("#b-l1"), bL2 = $("#b-l2"), bPend = $("#b-pend"), bDone = $("#b-done"), bFill = $("#b-fill"), bLeft = $("#b-left");
      function renderB(t) {
        const T = 6.2; // approve is pressed
        const press = seg(t, T, T + 0.1, "power2.out") * (1 - seg(t, T + 0.1, T + 0.34, "back.out(2)"));
        bBtn.style.transform = "scale(" + (1 - 0.05 * press).toFixed(4) + ")";
        const sw = seg(t, T + 0.1, T + 0.3, "power1.out");
        bL1.style.opacity = (1 - sw).toFixed(3);
        bL2.style.opacity = sw.toFixed(3);
        bPend.style.opacity = (1 - sw).toFixed(3);
        bDone.style.opacity = sw.toFixed(3);
        const p = seg(t, T + 0.2, T + 0.9, "power2.out");
        bFill.style.width = lerp(38.2, 62.2, p).toFixed(2) + "%";
        bFill.style.background = p > 0.02 ? "#3fe0a5" : "#6a6a74";
        bLeft.textContent = "$" + fmt(lerp(6180, 3780, p)) + " left";
      }

      const ul = $(".ul"), lockRow = $(".lrow"), lockTag = $(".tag");
      function renderFinish(t) {
        ul.style.transform = "scaleX(" + seg(t, 8.15, 8.85, "expo.out").toFixed(4) + ")";
        // lockup racks into focus as it rises
        const p = seg(t, 9.3, 10.4, "expo.out");
        const o = seg(t, 9.3, 9.9, "power2.out");
        const b = 14 * (1 - seg(t, 9.3, 10.1, "power2.out"));
        lockRow.style.opacity = o.toFixed(3);
        lockRow.style.transform = "translateY(" + (26 * (1 - p)).toFixed(2) + "px) scale(" + (0.94 + 0.06 * p).toFixed(4) + ")";
        lockRow.style.filter = b > 0.05 ? "blur(" + b.toFixed(2) + "px)" : "none";
        const p2 = seg(t, 9.55, 10.5, "expo.out");
        const b2 = 10 * (1 - seg(t, 9.55, 10.2, "power2.out"));
        lockTag.style.opacity = seg(t, 9.55, 10.1, "power2.out").toFixed(3);
        lockTag.style.transform = "translateY(" + (18 * (1 - p2)).toFixed(2) + "px)";
        lockTag.style.filter = b2 > 0.05 ? "blur(" + b2.toFixed(2) + "px)" : "none";
        // grain re-rolled every 3 frames
        const fr = Math.floor((t * 30) / 3) * 3;
        $("#grain").style.backgroundPosition = ((fr * 97) % 256) + "px " + ((fr * 61 + 37 * (fr % 5)) % 256) + "px";
      }

      function render(t) {
        const f = focusAt(t);
        const u = renderPlanes(t, f);
        renderBokeh(t, f, u);
        renderA(t);
        renderLaptop(t);
        renderB(t);
        renderFinish(t);
      }

      /* ---------- timeline: one proxy tween drives render(t) ---------- */
      const tl = gsap.timeline({ paused: true });
      const clock = { t: 0 };
      render(0);
      tl.to(clock, { t: DUR, duration: DUR, ease: "none", onUpdate: () => render(clock.t) }, 0);
      tl.set({}, {}, DUR);

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