# Workflow Animation

Motionboard shot name: Node Pipeline

A thin line draws across a pale blue frame. A prompt pill types Rain on a tin roof, distant thunder, a coral pulse runs to a dark Echo v3 card, the Generate button presses, a second pulse reaches an output card whose waveform rises, and two more output cards branch off it before the Echo lockup.

- Position in a launch film: Transitions
- Slug: workflow-animation
- Preview video: https://media.motionboard.app/node-pipeline.mp4
- Recipe page: https://motionboard.app/recipes/workflow-animation/
- 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 `node-pipeline`. 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. Line draws 0–3.0s; prompt pill appears 0.05s; prompt types 1.0–2.3s; generator card appears 1.42s; Loop toggle flips 2.1s; output card appears 1.86s; pulse 1 from prompt to generator 2.5–3.15s; Generate pressed 3.4s, label Generating… until 4.6s; pulse 2 from generator to output 3.8–4.45s; output wakes 4.45s (bars rise 4.45–5.0s, time 4.8s, playhead sweep from 5.05s); branch connectors draw at 5.15s and 5.4s, branch cards scale in 5.43s and 5.68s; row holds to 7.6s and fades 7.6–8.15s; lockup rises 8.2s, settled by 8.7s and holds to the end |
| Easing | Line draw power1.inOut; node and card pop-ins expo.out; both pulses power2.inOut, with the dot fading out on power1.in; button press power2.out then back.out(3); waveform bars back.out(1.4) with 0.025s stagger; connectors power2.inOut; branch cards expo.out; row fade-out power2.in; lockup expo.out and mark back.out(2); typing and the background drift are driven by time (typing linear with a slight wobble, drift sine.out) |
| Camera | Locked camera, no zoom or pan. The background layer (2080x1200px) drifts 40px left and 18px up over the 11s, sine.out. The whole row scales to 0.97 as it fades out at 7.6–8.15s |
| Subject | Grey line 3px at y 540 across the full width; prompt pill 560x160px at x 70–630 with 44px text in two lines; generator card 440x320px at x 720–1160 with a 38px title, a Loop toggle (72x40px) and a coral Generate button 372x84px with a 36px label; output card 530x150px at x 1250–1780 with a 100px thumbnail, a 60px play button, 20 waveform bars 6px wide and a 30px time; two branch cards of the same size at x 1310–1840, centred at y 290 and 790, on elbow connectors 3px wide with a 22px corner; pulse dot 38px with a 16px white core; lockup mark 150px, wordmark Echo 148px, tagline 46px |
| Sync | The first pulse leaves 0.2s after the last letter is typed (2.3s to 2.5s); the button presses 0.25s after the pulse lands (3.15s to 3.4s); the second pulse leaves 0.4s after the press; the output bars and thumbnail change on the same frame the second pulse arrives (4.45s); branch cards follow their connectors by 0.28s and the two branches are 0.25s apart; the row clears before the lockup starts, with 0.05s between the end of the fade and the first lockup frame |
| Style | Pale blue-cream background (`#e8edf6` with light blue and cream blobs) and a 7% vignette; one accent coral `#ff5b3a`; ink `#14161d`, dark cards `#17181f` with a 1px border and a large soft shadow, line grey `#9ba3b6`; Inter throughout, weights 500–700; no grain |

## Why it works

A pipeline reads left to right, so the film puts it on one straight line and lets the line carry the story. The line draws across the frame and each node appears as the line reaches it, so the viewer sees the chain being built before anything runs. The three nodes look different on purpose: a white prompt pill for the input, a dark card with a button for the step that does the work, and a dark output card with a waveform for the result. A bright dot carries the cause from one node to the next. The first pulse leaves the prompt as soon as the last letter is typed, the button presses on the next beat, and the second pulse carries the result to the output card, so each step has a visible cause. The output card waits flat and dim until the pulse lands, and then its bars rise and its thumbnail lights on the same frames. The last beat shows the point of a generator: two more output cards branch off node 3 on short elbow connectors, 0.25s apart, so one prompt gives several results. Every node stays on screen for at least 1.4s fully drawn before the row clears. The film has one accent colour, coral #ff5b3a, on a pale blue-cream background, which keeps the dark cards the heaviest objects in the frame. The ring version, Process Animation, goes around four steps; this film is a straight row where the dot moves only between neighbouring nodes.

## Prompt

> Build an 11-second, 1920x1080, 30 fps light product film called Node Pipeline for a fictional product, Echo (an AI sound effects generator). Background: a pale blue-cream, a #e8edf6 base with soft radial blobs of light blue (rgb 190,208,240) at the top left and bottom right and cream (rgb 248,236,204) at the top and lower left, on a 2080x1200px layer that drifts 40px left and 18px up over the whole film (sine.out), plus a 7% vignette and no grain. One accent colour, coral #ff5b3a; ink #14161d; dark cards #17181f; line grey #9ba3b6; font Inter. A 3px grey line crosses the full width at y 540. It draws left to right from a 6% stub over 0–3.0s (power1.inOut, scaleX with a left origin). Three nodes sit on it, each with small white port circles (20px, 2px grey border) on its left and right edges. Node 1 is a white pill 560x160px at x 70–630 with a soft shadow; it fades in and scales 0.88→1 at 0.05s (expo.out, 0.5s). The prompt types in over 1.0–2.3s at 44px as two lines, Rain on a tin roof, then distant thunder, with a coral caret that blinks when idle (compute the character count and the caret from the timeline time in an onUpdate). Node 2 is a dark card 440x320px at x 720–1160 that appears at 1.42s: a small mark and the title Echo v3 at 38px, a Loop row with a toggle that flips to coral at 2.1s, and a coral Generate button 372x84px with a 36px label. Node 3 is a dark output card 530x150px at x 1250–1780 that appears at 1.86s: a 100px thumbnail drawn with gradients and dimmed, a 60px play button, 20 waveform bars (6px wide, seeded heights, flat at 7% height) and a 0:08 time. Pulse 1 runs 2.5–3.15s: a 38px coral dot with a white core travels along the line from node 1 to node 2 (90px, power2.inOut) while a coral segment grows behind it; the ports turn coral and a ring ripples at the arrival. At 3.4s the button presses (scale 0.94 in 0.08s, then back.out(3) over 0.3s) and its label becomes Generating… until 4.6s. Pulse 2 runs 3.8–4.45s from node 2 to node 3 the same way. At 4.45s the output thumbnail lights, the bars rise (0.5s, back.out(1.4), stagger 0.025), the time appears at 4.8s, and from 5.05s the play button and the bars turn coral one after another like a playhead. Then two more output cards of the same size branch off node 3, one up and one down. For each, an elbow connector (3px, rounded 22px corner, vertical at x 1280) draws in 0.34s at 5.15s and 5.4s, and the card scales 0.8→1 from its left edge 0.28s later (expo.out, 0.45s) at x 1310–1840, centred at y 290 and 790, with its own gradient thumbnail and rising bars. Hold everything until 7.6s, then fade the whole row out with a 0.97 scale over 0.55s (power2.in). The lockup starts at 8.2s: a 150px mark (a coral dot of radius 20 inside two dark rings of radius 44 and 67), the wordmark Echo at 148px and the tagline One prompt, every sound. at 46px, rising 22px with expo.out, settled by 8.7s and still until 11s. Drive every change from one paused GSAP timeline with a linear proxy tween that calls render(t); put hidden states in CSS, use no CSS animations and seed the waveforms with mulberry32.

## Often confused with

- [Process Animation](https://motionboard.app/r/process-animation.md): Process Animation goes around a ring of four labelled steps with a dot that circles back to the start; Workflow Animation is one straight line where a dot moves between neighbouring nodes from input to output, and the output branches into more outputs.
- [Branching Growth](https://motionboard.app/r/branching-growth.md): Branching Growth splits a single dot into a network of many nodes that fills the frame; Workflow Animation keeps three real UI nodes on one line, shows a prompt being typed and a button pressed, and branches only once at the end.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/node-pipeline/hyperframes.json (318 B)
- https://motionboard.app/source/node-pipeline/index.html (19.4 KB)
- https://motionboard.app/source/node-pipeline/package.json (302 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "node-pipeline/hyperframes.json" "https://motionboard.app/source/node-pipeline/hyperframes.json"
curl -fsSL --create-dirs -o "node-pipeline/index.html" "https://motionboard.app/source/node-pipeline/index.html"
curl -fsSL --create-dirs -o "node-pipeline/package.json" "https://motionboard.app/source/node-pipeline/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 {
        --ink: #14161d;
        --sub: #4b5164;
        --mut: #a3a8b8;
        --line: #9ba3b6;
        --acc: #ff5b3a;
        --acc-d: #e8472a;
        --card: #17181f;
        --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: #e9eef6; }
      #root {
        position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #e9eef6;
        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; }

      /* background: pale blue-cream blobs, drifting slowly */
      #bg { z-index: 0; overflow: hidden; }
      #bgb {
        position: absolute; left: -80px; top: -60px; width: 2080px; height: 1200px;
        background:
          radial-gradient(ellipse 34% 46% at 10% 16%, rgba(190, 208, 240, 0.95) 0%, rgba(190, 208, 240, 0) 100%),
          radial-gradient(ellipse 36% 44% at 90% 86%, rgba(186, 206, 238, 0.9) 0%, rgba(186, 206, 238, 0) 100%),
          radial-gradient(ellipse 30% 36% at 66% 10%, rgba(248, 236, 204, 0.95) 0%, rgba(248, 236, 204, 0) 100%),
          radial-gradient(ellipse 30% 34% at 26% 92%, rgba(246, 236, 210, 0.9) 0%, rgba(246, 236, 210, 0) 100%),
          radial-gradient(ellipse 26% 30% at 52% 54%, rgba(240, 244, 252, 0.8) 0%, rgba(240, 244, 252, 0) 100%),
          #e8edf6;
      }
      #fx { z-index: 6; pointer-events: none; }
      #vig { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; background: radial-gradient(ellipse at center, rgba(20, 28, 60, 0) 60%, rgba(20, 28, 60, 0.07) 100%); }

      #stage { z-index: 2; transform-origin: 960px 540px; }
      #line { position: absolute; left: 0; top: 538px; width: 1920px; height: 3px; background: var(--line); transform-origin: 0% 50%; }
      #conn { position: absolute; left: 0; top: 0; }
      .cn { fill: none; stroke: var(--line); stroke-width: 3; stroke-linecap: round; opacity: 0; stroke-dasharray: 1; stroke-dashoffset: 1; }

      /* ports */
      .port { position: absolute; width: 20px; height: 20px; top: 530px; border-radius: 50%; background: #fff; border: 2px solid var(--line); opacity: 0; z-index: 5; }
      .rip { position: absolute; width: 20px; height: 20px; top: 530px; border-radius: 50%; border: 3px solid var(--acc); opacity: 0; z-index: 4; }

      /* pulse */
      .hl { position: absolute; top: 538px; height: 5px; width: 0; background: var(--acc); border-radius: 3px; opacity: 0; z-index: 3; }
      .dot { position: absolute; left: 0; top: 521px; width: 38px; height: 38px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 8px rgba(255, 91, 58, 0.2); opacity: 0; z-index: 6; }
      .dot i { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; border-radius: 50%; background: #fff; }

      /* node 1: prompt pill */
      #n1 { position: absolute; left: 70px; top: 460px; width: 560px; height: 160px; border-radius: 80px; background: #ffffff; border: 1px solid rgba(20, 30, 60, 0.06); box-shadow: 0 28px 56px -16px rgba(40, 60, 110, 0.28), 0 3px 10px rgba(40, 60, 110, 0.08); opacity: 0; display: flex; align-items: center; padding: 0 48px; z-index: 3; }
      #ptext { font-size: 44px; line-height: 56px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); white-space: pre; display: flex; align-items: flex-end; }
      #ptxt { display: block; }
      #caret { display: inline-block; width: 4px; height: 50px; margin-left: 4px; margin-bottom: 3px; background: var(--acc); opacity: 0; }

      /* node 2: generator card */
      #n2 { position: absolute; left: 720px; top: 380px; width: 440px; height: 320px; border-radius: 38px; background: var(--card); border: 1px solid #2c2e39; box-shadow: 0 34px 64px -16px rgba(30, 40, 80, 0.45), 0 4px 14px rgba(30, 40, 80, 0.15); opacity: 0; padding: 34px; z-index: 3; }
      #n2 .hd { display: flex; align-items: center; gap: 16px; height: 50px; color: #fff; font-size: 38px; font-weight: 700; letter-spacing: -0.02em; }
      #n2 .tr { display: flex; align-items: center; justify-content: space-between; height: 50px; margin-top: 26px; color: var(--mut); font-size: 32px; font-weight: 500; }
      #tg { position: relative; width: 72px; height: 40px; border-radius: 20px; background: #3a3d4b; }
      #tgk { position: absolute; left: 4px; top: 4px; width: 32px; height: 32px; border-radius: 50%; background: #fff; }
      #gbtn { position: relative; width: 372px; height: 84px; margin-top: 30px; }
      #gbtn .face { position: absolute; left: 0; top: 0; width: 100%; height: 100%; border-radius: 24px; display: flex; align-items: center; justify-content: center; gap: 12px; color: #fff; font-size: 36px; font-weight: 700; letter-spacing: -0.01em; }
      #g1 { background: var(--acc); }
      #g2 { background: var(--acc-d); opacity: 0; }

      /* output cards */
      .out { position: absolute; width: 530px; height: 150px; border-radius: 40px; background: var(--card); border: 1px solid #2c2e39; box-shadow: 0 30px 56px -16px rgba(30, 40, 80, 0.42), 0 4px 12px rgba(30, 40, 80, 0.14); opacity: 0; z-index: 3; }
      #o1 { left: 1250px; top: 465px; }
      #o2 { left: 1310px; top: 215px; }
      #o3 { left: 1310px; top: 715px; }
      .th { position: absolute; left: 26px; top: 25px; width: 100px; height: 100px; border-radius: 24px; overflow: hidden; }
      .th .sc { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
      .th .dm { position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #17181f; opacity: 0.82; }
      #t1 .sc { background: repeating-linear-gradient(105deg, rgba(255, 255, 255, 0.3) 0 2px, rgba(255, 255, 255, 0) 2px 9px), linear-gradient(160deg, #35566e, #8fb1c3 52%, #243746); }
      #t2 .sc { background: radial-gradient(circle at 68% 26%, #fff6d6 0 7%, #f2c96b 16%, rgba(242, 201, 107, 0) 44%), linear-gradient(180deg, #3d3274, #1b1740); }
      #t3 .sc { background: radial-gradient(circle at 30% 74%, rgba(255, 214, 160, 0.9) 0 10%, rgba(255, 214, 160, 0) 40%), linear-gradient(180deg, #f0a96a, #a85b7a 58%, #3a2c52); }
      .pl { position: absolute; left: 144px; top: 45px; width: 60px; height: 60px; border-radius: 50%; background: #3a3c47; display: flex; align-items: center; justify-content: center; }
      .pl svg { margin-left: 3px; }
      .wv { position: absolute; left: 226px; top: 35px; width: 196px; height: 80px; display: flex; align-items: center; gap: 4px; }
      .bar { width: 6px; border-radius: 3px; background: #7d8396; flex: none; }
      .tm { position: absolute; left: 434px; top: 0; height: 150px; display: flex; align-items: center; color: var(--mut); font-size: 30px; font-weight: 600; opacity: 0; }

      /* lockup */
      #lock { z-index: 4; }
      #lk { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; display: flex; flex-direction: column; align-items: center; justify-content: center; opacity: 0; }
      #lkrow { display: flex; align-items: center; gap: 30px; }
      #wm { font-size: 148px; line-height: 150px; font-weight: 700; letter-spacing: -0.045em; color: var(--ink); }
      #tag { margin-top: 26px; font-size: 46px; font-weight: 500; letter-spacing: -0.015em; color: var(--sub); }
      #mkd, #mkr1, #mkr2 { opacity: 0; }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="11" data-width="1920" data-height="1080">
      <div id="bg" class="clip full" data-start="0" data-duration="11" data-track-index="0" data-layout-ignore>
        <div id="bgb"></div>
      </div>

      <div id="stage" class="clip full" data-start="0" data-duration="11" data-track-index="1" data-layout-ignore>
        <div id="line"></div>
        <svg id="conn" width="1920" height="1080" viewBox="0 0 1920 1080">
          <path id="cu" class="cn" pathLength="1" d="M1280 465 V312 Q1280 290 1302 290 H1310" />
          <path id="cd" class="cn" pathLength="1" d="M1280 615 V768 Q1280 790 1302 790 H1310" />
        </svg>

        <div id="p1l" class="port" style="left: 60px" data-layout-allow-overlap></div>
        <div id="p1r" class="port" style="left: 620px" data-layout-allow-overlap></div>
        <div id="p2l" class="port" style="left: 710px" data-layout-allow-overlap></div>
        <div id="p2r" class="port" style="left: 1150px" data-layout-allow-overlap></div>
        <div id="p3l" class="port" style="left: 1240px" data-layout-allow-overlap></div>
        <div id="p3r" class="port" style="left: 1770px" data-layout-allow-overlap></div>
        <div id="r2l" class="rip" style="left: 710px" data-layout-allow-overlap></div>
        <div id="r3l" class="rip" style="left: 1240px" data-layout-allow-overlap></div>
        <div id="jt" class="port" style="left: 1270px; top: 455px" data-layout-allow-overlap></div>
        <div id="jb" class="port" style="left: 1270px; top: 605px" data-layout-allow-overlap></div>

        <div id="hl1" class="hl" style="left: 630px" data-layout-allow-overlap></div>
        <div id="hl2" class="hl" style="left: 1160px" data-layout-allow-overlap></div>

        <!-- node 1: prompt -->
        <div id="n1" data-layout-allow-overlap>
          <div id="ptext"><span id="ptxt"></span><span id="caret"></span></div>
        </div>

        <!-- node 2: generator -->
        <div id="n2" data-layout-allow-overlap>
          <div class="hd">
            <svg width="40" height="40" viewBox="0 0 32 32"><circle cx="16" cy="16" r="5" fill="#ff5b3a"/><circle cx="16" cy="16" r="11" fill="none" stroke="#ffffff" stroke-width="3"/></svg>
            <span>Echo v3</span>
          </div>
          <div class="tr"><span>Loop</span><div id="tg"><div id="tgk"></div></div></div>
          <div id="gbtn">
            <div id="g1" class="face">Generate</div>
            <div id="g2" class="face">Generating…</div>
          </div>
        </div>

        <!-- node 3 and branches: output cards -->
        <div id="o1" class="out" data-layout-allow-overlap>
          <div class="th" id="t1"><div class="sc"></div><div class="dm"></div></div>
          <div class="pl"><svg width="26" height="26" viewBox="0 0 24 24"><path d="M7 4.5v15l13-7.5z" fill="#ffffff"/></svg></div>
          <div class="wv"></div>
          <div class="tm">0:08</div>
        </div>
        <div id="o2" class="out" data-layout-allow-overlap>
          <div class="th" id="t2"><div class="sc"></div></div>
          <div class="pl"><svg width="26" height="26" viewBox="0 0 24 24"><path d="M7 4.5v15l13-7.5z" fill="#ffffff"/></svg></div>
          <div class="wv"></div>
          <div class="tm">0:11</div>
        </div>
        <div id="o3" class="out" data-layout-allow-overlap>
          <div class="th" id="t3"><div class="sc"></div></div>
          <div class="pl"><svg width="26" height="26" viewBox="0 0 24 24"><path d="M7 4.5v15l13-7.5z" fill="#ffffff"/></svg></div>
          <div class="wv"></div>
          <div class="tm">0:06</div>
        </div>

        <div id="d1" class="dot" data-layout-allow-overlap><i></i></div>
        <div id="d2" class="dot" data-layout-allow-overlap><i></i></div>
      </div>

      <div id="lock" class="clip full" data-start="0" data-duration="11" data-track-index="2" data-layout-ignore>
        <div id="lk">
          <div id="lkrow">
            <svg width="150" height="150" viewBox="0 0 150 150">
              <circle id="mkr2" cx="75" cy="75" r="67" fill="none" stroke="#14161d" stroke-opacity="0.32" stroke-width="10" />
              <circle id="mkr1" cx="75" cy="75" r="44" fill="none" stroke="#14161d" stroke-width="11" />
              <circle id="mkd" cx="75" cy="75" r="20" fill="#ff5b3a" />
            </svg>
            <div id="wm">Echo</div>
          </div>
          <div id="tag">One prompt, every sound.</div>
        </div>
      </div>

      <div id="fx" class="clip full" data-start="0" data-duration="11" data-track-index="3" data-layout-ignore>
        <div id="vig"></div>
      </div>
    </div>

    <script>
      const ACC = "#ff5b3a";
      const LINE = "#9ba3b6";

      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;
        };
      }
      // waveform bars: 20 per card, seeded heights
      document.querySelectorAll(".out").forEach((card, k) => {
        const r = mulberry32(11 + k * 7);
        const wv = card.querySelector(".wv");
        for (let i = 0; i < 20; i++) {
          const env = 0.5 + 0.5 * Math.sin((Math.PI * (i + 0.5)) / 20);
          const h = Math.round(14 + 62 * Math.pow(r(), 0.75) * (0.45 + 0.55 * env));
          const b = document.createElement("div");
          b.className = "bar";
          b.style.height = h + "px";
          wv.appendChild(b);
        }
      });

      const PROMPT = "Rain on a tin roof,\ndistant thunder";
      const T0 = 1.0, T1 = 2.3;
      const clamp = (x) => Math.max(0, Math.min(1, x));
      const elTxt = document.getElementById("ptxt");
      const elCaret = document.getElementById("caret");
      let lastN = -1, lastC = -1;

      function render(t) {
        const p = clamp((t - T0) / (T1 - T0));
        const q = clamp(p + 0.02 * Math.sin(p * 20));
        const n = Math.round(PROMPT.length * (p >= 1 ? 1 : q));
        if (n !== lastN) { elTxt.textContent = PROMPT.slice(0, n); lastN = n; }
        let c = 0;
        if (t >= 0.9 && t < 2.75) c = p > 0 && p < 1 ? 1 : Math.floor(t * 2.2) % 2 === 0 ? 1 : 0;
        if (c !== lastC) { elCaret.style.opacity = c; lastC = c; }
      }

      // ---------- baselines (hidden states live in CSS) ----------
      gsap.set("#line", { scaleX: 0.06 });
      gsap.set("#n1, #n2, #o1", { scale: 0.88, transformOrigin: "50% 50%" });
      gsap.set("#o2, #o3", { scale: 0.8, transformOrigin: "0% 50%" });
      gsap.set(".bar", { scaleY: 0.07 });
      gsap.set(".rip", { scale: 1 });
      gsap.set("#lk", { y: 22 });
      gsap.set("#mkd, #mkr1, #mkr2", { scale: 0.6, svgOrigin: "75 75" });
      render(0);

      const tl = gsap.timeline({ paused: true });
      tl.to({ v: 0 }, { v: 1, duration: 11, ease: "none", onUpdate: () => render(tl.time()) }, 0);
      window.addEventListener("hf-seek", (e) => render(e.detail.time));

      // background drift
      tl.to("#bgb", { x: -40, y: -18, duration: 11, ease: "sine.out" }, 0);

      // ---------- the line draws across, nodes appear as it reaches them ----------
      tl.to("#line", { scaleX: 1, duration: 3.0, ease: "power1.inOut" }, 0);

      const showPort = (id, at) => tl.to(id, { opacity: 1, duration: 0.2, ease: "power1.out" }, at);
      const litPort = (id, at) => tl.to(id, { backgroundColor: ACC, borderColor: ACC, duration: 0.15, ease: "power2.out" }, at);
      const ripple = (id, at) => {
        tl.set(id, { opacity: 0.6, scale: 1 }, at);
        tl.to(id, { scale: 3.4, opacity: 0, duration: 0.6, ease: "power2.out" }, at);
      };

      // node 1: prompt pill
      tl.to("#n1", { opacity: 1, scale: 1, duration: 0.5, ease: "expo.out" }, 0.05);
      showPort("#p1l", 0.05);
      showPort("#p1r", 0.15);

      // node 2: generator card
      tl.to("#n2", { opacity: 1, scale: 1, duration: 0.5, ease: "expo.out" }, 1.42);
      showPort("#p2l", 1.42);
      showPort("#p2r", 1.5);
      // loop toggle flips on
      tl.to("#tgk", { x: 32, duration: 0.22, ease: "power2.out" }, 2.1);
      tl.to("#tg", { backgroundColor: ACC, duration: 0.22, ease: "power2.out" }, 2.1);

      // node 3: output card, flat and dim until generation lands
      tl.to("#o1", { opacity: 1, scale: 1, duration: 0.5, ease: "expo.out" }, 1.86);
      showPort("#p3l", 1.86);
      showPort("#p3r", 1.95);

      // ---------- pulse 1: prompt -> generator ----------
      litPort("#p1r", 2.45);
      tl.set("#d1", { x: 611, opacity: 1 }, 2.5);
      tl.to("#d1", { x: 701, duration: 0.65, ease: "power2.inOut" }, 2.5);
      tl.set("#hl1", { opacity: 1 }, 2.5);
      tl.to("#hl1", { width: 90, duration: 0.65, ease: "power2.inOut" }, 2.5);
      tl.to("#d1", { opacity: 0, duration: 0.18, ease: "power1.in" }, 3.1);
      tl.to("#hl1", { opacity: 0.35, duration: 0.5, ease: "power1.out" }, 3.15);
      litPort("#p2l", 3.12);
      ripple("#r2l", 3.14);

      // button press
      const tP = 3.4;
      tl.to("#gbtn", { scale: 0.94, duration: 0.08, ease: "power2.out" }, tP);
      tl.to("#gbtn", { scale: 1, duration: 0.3, ease: "back.out(3)" }, tP + 0.08);
      tl.to("#g1", { opacity: 0, duration: 0.1, ease: "none" }, tP + 0.04);
      tl.to("#g2", { opacity: 1, duration: 0.1, ease: "none" }, tP + 0.04);

      // ---------- pulse 2: generator -> output ----------
      litPort("#p2r", 3.75);
      tl.set("#d2", { x: 1141, opacity: 1 }, 3.8);
      tl.to("#d2", { x: 1231, duration: 0.65, ease: "power2.inOut" }, 3.8);
      tl.set("#hl2", { opacity: 1 }, 3.8);
      tl.to("#hl2", { width: 90, duration: 0.65, ease: "power2.inOut" }, 3.8);
      tl.to("#d2", { opacity: 0, duration: 0.18, ease: "power1.in" }, 4.4);
      tl.to("#hl2", { opacity: 0.35, duration: 0.5, ease: "power1.out" }, 4.45);
      litPort("#p3l", 4.42);
      ripple("#r3l", 4.44);
      // button returns
      tl.to("#g2", { opacity: 0, duration: 0.1, ease: "none" }, 4.6);
      tl.to("#g1", { opacity: 1, duration: 0.1, ease: "none" }, 4.6);

      // output 1 comes alive: thumbnail lights, bars rise, time appears, then plays
      tl.to("#t1 .dm", { opacity: 0, duration: 0.4, ease: "power2.out" }, 4.45);
      tl.to("#o1 .bar", { scaleY: 1, duration: 0.5, ease: "back.out(1.4)", stagger: 0.025 }, 4.45);
      tl.to("#o1 .tm", { opacity: 1, duration: 0.3, ease: "power1.out" }, 4.8);
      tl.to("#o1 .pl", { backgroundColor: ACC, duration: 0.25, ease: "power2.out" }, 5.05);
      tl.to("#o1 .bar", { backgroundColor: ACC, duration: 0.12, ease: "none", stagger: 0.05 }, 5.05);

      // ---------- branches: elbow connectors, then cards (stagger 0.25 s) ----------
      const branch = (cn, jn, card, at) => {
        tl.set(cn, { opacity: 1 }, at);
        tl.to(cn, { strokeDashoffset: 0, duration: 0.34, ease: "power2.inOut" }, at);
        tl.to(jn, { opacity: 1, duration: 0.2, ease: "power1.out" }, at);
        tl.to(card, { opacity: 1, scale: 1, duration: 0.45, ease: "expo.out" }, at + 0.28);
        tl.to(card + " .bar", { scaleY: 1, duration: 0.5, ease: "back.out(1.4)", stagger: 0.025 }, at + 0.4);
        tl.to(card + " .tm", { opacity: 1, duration: 0.3, ease: "power1.out" }, at + 0.55);
      };
      branch("#cu", "#jt", "#o2", 5.15);
      branch("#cd", "#jb", "#o3", 5.4);

      // ---------- clear the row ----------
      tl.to("#stage", { opacity: 0, scale: 0.97, duration: 0.55, ease: "power2.in" }, 7.6);

      // ---------- lockup ----------
      tl.to("#lk", { opacity: 1, y: 0, duration: 0.5, ease: "expo.out" }, 8.2);
      tl.to("#mkd", { opacity: 1, scale: 1, duration: 0.4, ease: "back.out(2)" }, 8.2);
      tl.to("#mkr1", { opacity: 1, scale: 1, duration: 0.45, ease: "expo.out" }, 8.32);
      tl.to("#mkr2", { opacity: 1, scale: 1, duration: 0.45, ease: "expo.out" }, 8.44);

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