# Split Text Effect

Motionboard shot name: Split Word Collage

A huge black word, IMAGINE, fills a white frame, then splits in the middle. A fanned stack of five image cards rises into the gap, the top card lifts away four times, and the stack bursts into a ten-card collage above and below the word. The halves close, the word becomes Imagine anything., and the Tint lockup follows.

- Position in a launch film: Transitions
- Slug: split-text-effect
- Preview video: https://media.motionboard.app/split-word.mp4
- Recipe page: https://motionboard.app/recipes/split-text-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 `split-word`. 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. IMAGINE settles 0–1.0s; split 1.1–1.9s (0.8s); five cards rise 1.65–2.8s (0.9s each, 0.07s apart); four lifts at 2.8, 3.15, 3.5 and 3.85s (0.35s each); hold to 4.4s; burst from 4.4s (0.03s stagger, all ten cards placed by about 5.7s); halves close 4.85–5.55s (0.7s); the word fades 5.6–5.95s; Imagine anything. in 5.75–6.3s and held to 7.6s; collage drifts 5.75–7.65s; cards clear 7.55–8.17s; lockup 8.22–8.75s and held to the end (2.25s) |
| Easing | Split and close `power3.inOut`; scale settle, card rise, the vertical burst move, line and lockup entrances expo.out; lift up power2.out, drop behind the stack power3.out, stack shift power2.inOut; sideways burst move power2.out; drift sine.inOut; clear power2.in |
| Camera | Locked camera with no pan or zoom. The only camera-like move is the word's scale settle from 1.07 to 1 over 0–1.0s, so the first frame already shows the whole word. Flat frame: no depth of field, no grain, no vignette |
| Subject | IMAGINE at 310px, weight 800, letter-spacing −0.04em, cut into IMAG and INE at x 1101; each half moves 200px, so the gap is 400px wide. Five cards of 360x460px with 24px corners, drawn at scale 0.9 (about 324x414px) and centred at (1101, 540), fanned at rotations 1.5°, −4°, 4.5°, −6° and 6° with offsets up to 22px. The burst uses ten cards (the five plus five more) landing at scales 0.62–0.86 and rotations of 4–9° either way: the top five centred at y 110–175 and the bottom five at y 900–990, so no card enters the word's band (y 400–680). Replacement line Imagine anything. at 120px, weight 750. Lockup: 132px mark, Tint at 150px, tagline at 46px |
| Sync | The cards start rising at 1.65s while the halves are still moving, so the gap is filled the moment it exists. Every lift lands on a 0.35s beat. The burst starts 0.2s after the last lift settles; the halves close at 4.85s, after the first cards have left the band, and the word fades 0.05s after they finish closing. Imagine anything. starts at 5.75s while the word is still fading and lands in a centre that is already clear |
| Style | White background `#ffffff`, ink `#0b0b0f`, one accent violet `#5b3dff`; Inter throughout, 800 for the split word and 750 for the line; cards with 24px corners, a 1.5px hairline ring and a large soft shadow; the ten images are SVG scenes drawn in code with gradients (sunset, portrait silhouette, neon city, flower macro, sea, aurora, dunes, forest, gradient mesh, arch), no photos |

## Why it works

The word is cut in the middle, so the gap is the only place the eye has to look, and the cards rise into exactly that space. The two halves keep their baseline and move only along x by the same 200px, so the word still reads as one word with a hole in it. The cards are 360x460px with a hairline ring and a soft shadow, so the stack reads as physical objects on flat white, and each card is its own colour world (sunset, portrait, neon city, flower, sea), so every lift away shows something new. Four lifts of 0.35s each give a steady beat while the stack stays in place. The burst sends each card up or down out of the word's band first and only then sideways, so no card crosses the letters while the halves are still apart, and the halves close only after the cards are clear. The closed word is replaced by Imagine anything. once the collage is placed, so the headline has the centre of the frame to itself. There is one accent colour, violet #5b3dff, used on the word anything. and the mark; the images supply all the other colour.

## Prompt

> Build an 11-second, 1920x1080, 30 fps light product film called Split Text Effect for a fictional product, Tint (an AI image tool). Background #ffffff, ink #0b0b0f, one accent violet #5b3dff, font Inter. Use HTML and one paused GSAP timeline, with no CSS animations and no random numbers. Centre the word IMAGINE at 310px, weight 800, letter-spacing -0.04em, as two absolutely positioned halves: IMAG right-aligned so it ends at x 1101, and INE left-aligned so it starts at x 1101, both in a 310px line box centred on y 540. The whole word is visible at frame 0 and settles its scale from 1.07 to 1 over 0–1.0s with expo.out. At 1.1s split it: IMAG moves -200px and INE +200px over 0.8s with power3.inOut, which opens a 400px gap centred at x 1101. Draw 10 image cards in code as inline SVG scenes, each 360x460px with 24px corners, a 1.5px hairline ring and a soft shadow: sunset, portrait silhouette, neon city, flower macro and sea (these five form the stack), then aurora, dunes, forest, gradient mesh and arch (these five wait hidden under the stack). Place the five stack cards at scale 0.9 centred at (1101, 540) in five slots from top to bottom: rotation 1.5°, -4°, 4.5°, -6°, 6° and offsets (0, 0), (14, 7), (-16, 12), (22, 17), (-22, 22). From 1.65s each card rises from 780px below with expo.out over 0.9s, bottom card first, 0.07s apart. Then shuffle four times at 2.8, 3.15, 3.5 and 3.85s: the top card lifts 300px, 36px to the right and +9° over 0.15s (power2.out), drops behind the stack by switching z-index, and lands in the bottom slot over 0.2s (power3.out); every other card moves up one slot over 0.3s (power2.inOut), starting 0.04s after the lift begins. At 4.4s burst: show the five hidden cards, then send all ten to collage spots with a 0.03s stagger. Each card first moves in y and takes its final rotation and scale over 0.7s (expo.out), and starts its x move 0.25s later over 0.8s (power2.out), so it leaves the word's band while still inside the gap. Spots (centre y, scale): the top row at y 110–175 across the width with scales 0.68–0.86, the bottom row at y 900–990 with scales 0.62–0.84, rotations between -9° and 9°. Keep every card out of y 400–680 until the word has been replaced. At 4.85s close the halves back to x 0 over 0.7s (power3.inOut). At 5.6s fade IMAGINE out with a 26px lift (0.35s, power2.in). At 5.75s bring in Imagine anything. at 120px, weight 750, centred on y 540, with the word anything. in violet, rising 30px over 0.55s with expo.out. Let the cards drift by up to 16px, 12px and 2° with sine.inOut over 5.75–7.65s. At 7.55s clear the cards (0.42s, power2.in, scale x0.75, opacity 0, 0.02s apart) and fade the line at 7.6s. Lockup from 8.22s: a 132px violet droplet mark (0.5s, expo.out), Tint at 150px, weight 800 (8.3s, 0.45s) and Words in, colour out. at 46px in grey (8.38s, 0.35s). Hold the lockup completely still to 11s.

## Often confused with

- [Text–Object Interleave](https://motionboard.app/r/text-object-interleave.md): Text–Object Interleave puts an object inside a sentence or passes a word through an object; here one word splits to make room for a stack of cards, and the same word closes again before the line changes.
- [Flipbook Animation](https://motionboard.app/r/flipbook-animation.md): Flipbook Animation collapses a board of cards into a book and flips the pages into a 3D collage; here the cards sit in a flat stack in a gap in the type, lift away one by one and scatter in 2D around the headline.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/split-word/hyperframes.json (318 B)
- https://motionboard.app/source/split-word/index.html (25.6 KB)
- https://motionboard.app/source/split-word/package.json (299 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "split-word/hyperframes.json" "https://motionboard.app/source/split-word/hyperframes.json"
curl -fsSL --create-dirs -o "split-word/index.html" "https://motionboard.app/source/split-word/index.html"
curl -fsSL --create-dirs -o "split-word/package.json" "https://motionboard.app/source/split-word/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: #0b0b0f;
        --mut: #5f6070;
        --accent: #5b3dff;
        --font-ui: "Inter", -apple-system, "SF Pro Display", "Helvetica Neue", sans-serif;
      }
      * { margin: 0; padding: 0; box-sizing: border-box; }
      html, body { width: 1920px; height: 1080px; overflow: hidden; background: #ffffff; }
      #root {
        position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #ffffff;
        font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased;
      }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      .a { position: absolute; }
      svg { display: block; flex: none; }

      /* ---------- the word ---------- */
      #rise { opacity: 1; }
      .half {
        position: absolute; top: 385px; height: 310px; line-height: 310px; font-size: 310px;
        font-weight: 800; letter-spacing: -0.04em; white-space: nowrap; color: var(--ink);
      }
      #wl { left: 201px; width: 900px; text-align: right; }
      #wr { left: 1101px; width: 700px; text-align: left; }

      /* ---------- image cards ---------- */
      #cards { z-index: 2; pointer-events: none; }
      .card {
        position: absolute; left: 0; top: 0; width: 360px; height: 460px; border-radius: 24px; overflow: hidden;
        opacity: 0; background: #ffffff;
        box-shadow: 0 0 0 1.5px rgba(20, 20, 32, 0.14), 0 26px 50px -12px rgba(40, 24, 90, 0.32), 0 4px 12px rgba(0, 0, 0, 0.1);
      }

      /* ---------- replacement line ---------- */
      #tag1 {
        left: 0; top: 462px; width: 1920px; height: 140px; line-height: 140px; text-align: center; white-space: nowrap;
        font-size: 120px; font-weight: 750; letter-spacing: -0.035em; color: var(--ink); opacity: 0; z-index: 3;
      }
      #tag1 .acc { color: var(--accent); }

      /* ---------- lockup ---------- */
      #lrow { left: 0; top: 392px; width: 1920px; height: 140px; display: flex; justify-content: center; align-items: center; gap: 30px; }
      #lmark { width: 132px; height: 132px; opacity: 0; }
      #lword { font-size: 150px; line-height: 150px; font-weight: 800; letter-spacing: -0.04em; color: var(--ink); opacity: 0; }
      #ltag { left: 0; top: 574px; width: 1920px; text-align: center; font-size: 46px; line-height: 56px; font-weight: 500; letter-spacing: -0.015em; color: var(--mut); 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="paper" class="clip full" data-start="0" data-duration="11" data-track-index="0" data-layout-ignore></div>

      <div id="scene" class="clip full" data-start="0" data-duration="8.4" data-track-index="1" data-layout-allow-overlap>
        <div id="word" class="full" data-layout-allow-overlap>
          <div id="rise" class="full" data-layout-allow-overlap>
            <div id="wl" class="half" data-layout-allow-overflow data-layout-allow-occlusion>IMAG</div>
            <div id="wr" class="half" data-layout-allow-overflow data-layout-allow-occlusion>INE</div>
          </div>
        </div>
        <div id="cards" class="full" data-layout-allow-overlap data-layout-ignore></div>
        <div id="tag1" class="a" data-layout-allow-overflow>Imagine <span class="acc">anything.</span></div>
      </div>

      <div id="lockc" class="clip full" data-start="8.1" data-duration="2.9" data-track-index="2" data-layout-allow-overlap>
        <div id="lrow" class="a" data-layout-allow-overlap>
          <div id="lmark">
            <svg width="132" height="132" viewBox="0 0 100 100">
              <defs><linearGradient id="lg" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#7b61ff"/><stop offset="1" stop-color="#4328e0"/></linearGradient></defs>
              <rect width="100" height="100" rx="26" fill="url(#lg)"/>
              <path d="M50 20 C50 20 27 46 27 61 a23 23 0 0 0 46 0 C73 46 50 20 50 20 Z" fill="#ffffff"/>
              <path d="M38 62 a12 12 0 0 0 12 12" fill="none" stroke="#5b3dff" stroke-width="4" stroke-linecap="round" opacity="0.55"/>
            </svg>
          </div>
          <div id="lword">Tint</div>
        </div>
        <div id="ltag" class="a">Words in, colour out.</div>
      </div>
    </div>

    <script>
      const EIO = "power3.inOut";
      const EXPO = "expo.out";
      const tl = gsap.timeline({ paused: true });

      /* ---------- seeded PRNG ---------- */
      function mulberry(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;
        };
      }

      /* ---------- images drawn in code (360 x 460 scenes) ---------- */
      const ART = {
        sunset(p) {
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#2b1d73"/><stop offset=".38" stop-color="#b8428f"/><stop offset=".68" stop-color="#ff7a5c"/><stop offset="1" stop-color="#ffc66e"/></linearGradient>' +
            '<radialGradient id="' + p + 'b"><stop offset="0" stop-color="#fff1c2" stop-opacity="1"/><stop offset=".35" stop-color="#ffc98a" stop-opacity=".6"/><stop offset="1" stop-color="#ff9a5a" stop-opacity="0"/></radialGradient>' +
            '<linearGradient id="' + p + 'c" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ff9a6a"/><stop offset=".35" stop-color="#7a3a8e"/><stop offset="1" stop-color="#1c1346"/></linearGradient></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/>';
          s += '<ellipse cx="90" cy="140" rx="96" ry="9" fill="#ffb3a0" opacity=".35"/><ellipse cx="270" cy="198" rx="110" ry="8" fill="#ffd0a8" opacity=".4"/><ellipse cx="60" cy="236" rx="80" ry="6" fill="#ffe0b8" opacity=".35"/>';
          s += '<circle cx="180" cy="300" r="175" fill="url(#' + p + 'b)"/><circle cx="180" cy="297" r="48" fill="#fff4cf"/>';
          s += '<rect y="300" width="360" height="160" fill="url(#' + p + 'c)"/>';
          for (let i = 0; i < 10; i++) {
            const w = 96 - i * 7;
            s += '<rect x="' + (180 - w / 2) + '" y="' + (308 + i * 15) + '" width="' + w + '" height="5" rx="2.5" fill="#ffe2a6" opacity="' + (0.8 - i * 0.07).toFixed(2) + '"/>';
          }
          s += '<path d="M0 300 C46 262 92 282 140 300 Z" fill="#2a1450"/><path d="M226 300 C276 256 326 276 360 294 L360 300 Z" fill="#241046"/>';
          s += '<path d="M240 118 q8 -8 16 0 q8 -8 16 0" fill="none" stroke="#2a1450" stroke-width="3" stroke-linecap="round"/><path d="M286 92 q6 -6 12 0 q6 -6 12 0" fill="none" stroke="#2a1450" stroke-width="2.6" stroke-linecap="round"/>';
          return s;
        },
        portrait(p) {
          const r = mulberry(21);
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="1" y2="1"><stop offset="0" stop-color="#19b5c8"/><stop offset=".55" stop-color="#c63fb0"/><stop offset="1" stop-color="#2a1a6b"/></linearGradient>' +
            '<radialGradient id="' + p + 'b"><stop offset="0" stop-color="#ffffff" stop-opacity=".5"/><stop offset="1" stop-color="#ffffff" stop-opacity="0"/></radialGradient></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/><circle cx="180" cy="190" r="200" fill="url(#' + p + 'b)"/>';
          for (let i = 0; i < 9; i++) s += '<circle cx="' + (r() * 360).toFixed(0) + '" cy="' + (r() * 300).toFixed(0) + '" r="' + (10 + r() * 24).toFixed(0) + '" fill="#ffffff" opacity="' + (0.08 + r() * 0.1).toFixed(2) + '"/>';
          s += '<g fill="#130a2a"><path d="M10 460 C22 384 86 342 140 330 L220 330 C274 342 338 384 350 460 Z"/><rect x="155" y="268" width="50" height="74" rx="20"/><ellipse cx="181" cy="208" rx="56" ry="70"/>' +
            '<path d="M120 212 C108 126 152 94 188 96 C238 98 258 150 242 216 C236 168 210 146 176 150 C150 152 128 172 120 212 Z"/></g>';
          s += '<path d="M244 216 C258 150 236 100 188 96" fill="none" stroke="#ffd0f0" stroke-width="3.5" stroke-linecap="round" opacity=".85"/>';
          s += '<path d="M350 460 C338 384 274 342 220 330" fill="none" stroke="#6ff0ff" stroke-width="3.5" stroke-linecap="round" opacity=".8"/>';
          s += '<path d="M236 262 C228 292 208 308 190 312" fill="none" stroke="#ffd0f0" stroke-width="3" stroke-linecap="round" opacity=".6"/>';
          return s;
        },
        neon(p) {
          const r = mulberry(11);
          const cols = ["#ffd36e", "#6ee7ff", "#ff7ac8"];
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#07041a"/><stop offset=".55" stop-color="#2d0f63"/><stop offset="1" stop-color="#ff3d8a"/></linearGradient>' +
            '<linearGradient id="' + p + 'g" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#1d0c3f"/><stop offset="1" stop-color="#05020d"/></linearGradient>' +
            '<filter id="' + p + 'f" x="-40%" y="-40%" width="180%" height="180%"><feGaussianBlur stdDeviation="5"/></filter></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/><circle cx="268" cy="168" r="34" fill="#ffd0e8" opacity=".9"/>';
          let x = -12;
          while (x < 370) {
            const w = 28 + r() * 32, h = 120 + r() * 170, y = 340 - h;
            s += '<rect x="' + x.toFixed(1) + '" y="' + y.toFixed(1) + '" width="' + w.toFixed(1) + '" height="' + (h + 2).toFixed(1) + '" fill="' + (r() < 0.5 ? "#0c0824" : "#140b34") + '"/>';
            for (let wy = y + 10; wy < 328; wy += 15) for (let wx = x + 6; wx < x + w - 8; wx += 11) if (r() < 0.32) s += '<rect x="' + wx.toFixed(1) + '" y="' + wy.toFixed(1) + '" width="5" height="7" fill="' + cols[Math.floor(r() * 3)] + '" opacity=".9"/>';
            x += w + r() * 4;
          }
          s += '<g filter="url(#' + p + 'f)"><rect x="206" y="208" width="76" height="30" rx="4" fill="none" stroke="#38f2ff" stroke-width="7"/><rect x="118" y="176" width="7" height="96" fill="#ff3d9a"/></g>';
          s += '<rect x="206" y="208" width="76" height="30" rx="4" fill="none" stroke="#a8fbff" stroke-width="3"/><rect x="119" y="176" width="5" height="96" fill="#ffc2e6"/>';
          s += '<rect y="340" width="360" height="120" fill="url(#' + p + 'g)"/><g filter="url(#' + p + 'f)">';
          for (let i = 0; i < 14; i++) s += '<rect x="' + (r() * 350).toFixed(0) + '" y="346" width="' + (3 + r() * 6).toFixed(0) + '" height="' + (28 + r() * 70).toFixed(0) + '" fill="' + (r() < 0.5 ? "#ff3d9a" : "#38f2ff") + '" opacity=".55"/>';
          s += '</g>';
          return s;
        },
        flower(p) {
          const r = mulberry(33);
          let s = '<defs>' +
            '<radialGradient id="' + p + 'a" cx=".5" cy=".5" r=".75"><stop offset="0" stop-color="#1b5a46"/><stop offset="1" stop-color="#04150f"/></radialGradient>' +
            '<linearGradient id="' + p + 'b" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffa6d2"/><stop offset="1" stop-color="#d81b7a"/></linearGradient>' +
            '<linearGradient id="' + p + 'c" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffe0ef"/><stop offset="1" stop-color="#ff7ab8"/></linearGradient>' +
            '<radialGradient id="' + p + 'd"><stop offset="0" stop-color="#fff3a0"/><stop offset=".55" stop-color="#ffb300"/><stop offset="1" stop-color="#d84a00"/></radialGradient>' +
            '<filter id="' + p + 'f" x="-40%" y="-40%" width="180%" height="180%"><feGaussianBlur stdDeviation="9"/></filter></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/><g filter="url(#' + p + 'f)">';
          for (let i = 0; i < 9; i++) s += '<circle cx="' + (r() * 360).toFixed(0) + '" cy="' + (r() * 460).toFixed(0) + '" r="' + (14 + r() * 26).toFixed(0) + '" fill="' + (r() < 0.5 ? "#7bd88f" : "#f3e56b") + '" opacity=".35"/>';
          s += '</g>';
          for (let i = 0; i < 14; i++) s += '<ellipse cx="180" cy="142" rx="30" ry="76" transform="rotate(' + (i * 360 / 14) + ' 180 230)" fill="url(#' + p + 'b)" stroke="#a3105e" stroke-width="1.5" stroke-opacity=".5"/>';
          for (let i = 0; i < 14; i++) s += '<ellipse cx="180" cy="168" rx="20" ry="54" transform="rotate(' + (i * 360 / 14 + 360 / 28) + ' 180 230)" fill="url(#' + p + 'c)" opacity=".92"/>';
          s += '<circle cx="180" cy="230" r="34" fill="url(#' + p + 'd)"/>';
          for (let i = 0; i < 16; i++) { const a = i * 2 * Math.PI / 16; s += '<circle cx="' + (180 + Math.cos(a) * 44).toFixed(1) + '" cy="' + (230 + Math.sin(a) * 44).toFixed(1) + '" r="4.5" fill="#ffe066"/>'; }
          return s;
        },
        sea(p) {
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#8fdcff"/><stop offset="1" stop-color="#f4fbff"/></linearGradient>' +
            '<radialGradient id="' + p + 'b"><stop offset="0" stop-color="#ffffff" stop-opacity=".95"/><stop offset="1" stop-color="#ffffff" stop-opacity="0"/></radialGradient></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/><circle cx="250" cy="120" r="90" fill="url(#' + p + 'b)"/><circle cx="250" cy="120" r="26" fill="#ffffff"/>';
          const cols = ["#5fd6e8", "#34b8dc", "#1f93cf", "#1a6fb8", "#154f9c", "#0f3a82", "#0a2a6a"];
          for (let i = 0; i < 7; i++) {
            const y0 = 176 + i * 40, A = 7 + i * 2.2, k = 0.03 - i * 0.002, ph = i * 1.3;
            let d = "M0 " + (y0 + A * Math.sin(ph)).toFixed(1), top = "";
            for (let x = 12; x <= 372; x += 12) d += " L" + x + " " + (y0 + A * Math.sin(x * k * 2 + ph)).toFixed(1);
            top = d;
            d += " L372 470 L0 470 Z";
            s += '<path d="' + d + '" fill="' + cols[i] + '"/><path d="' + top + '" fill="none" stroke="#ffffff" stroke-width="' + (3.2 - i * 0.25).toFixed(2) + '" stroke-opacity="' + (0.7 - i * 0.07).toFixed(2) + '" stroke-linecap="round"/>';
          }
          return s;
        },
        aurora(p) {
          const r = mulberry(44);
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#020b1a"/><stop offset="1" stop-color="#0a4540"/></linearGradient>' +
            '<linearGradient id="' + p + 'b" x1="0" y1="0" x2="1" y2="0"><stop offset="0" stop-color="#3dffa8"/><stop offset=".6" stop-color="#3de0ff"/><stop offset="1" stop-color="#9d6bff"/></linearGradient>' +
            '<filter id="' + p + 'f" x="-30%" y="-30%" width="160%" height="160%"><feGaussianBlur stdDeviation="13"/></filter></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/>';
          for (let i = 0; i < 44; i++) s += '<circle cx="' + (r() * 360).toFixed(0) + '" cy="' + (r() * 260).toFixed(0) + '" r="' + (0.6 + r() * 1.1).toFixed(1) + '" fill="#ffffff" opacity="' + (0.5 + r() * 0.5).toFixed(2) + '"/>';
          s += '<g filter="url(#' + p + 'f)" fill="none" stroke="url(#' + p + 'b)" stroke-linecap="round"><path d="M-20 200 C70 80 150 260 230 130 S340 90 390 160" stroke-width="46" opacity=".75"/><path d="M-20 250 C90 150 170 300 260 190 S350 170 390 220" stroke-width="30" opacity=".6"/></g>';
          s += '<path d="M0 330 L50 270 L84 300 L136 226 L190 306 L232 262 L288 318 L330 276 L360 306 L360 460 L0 460 Z" fill="#06202a"/>';
          s += '<path d="M136 226 L120 250 L136 244 L150 252 Z M50 270 L40 282 L52 278 L62 284 Z" fill="#cfeff2" opacity=".75"/>';
          s += '<path d="M0 372 L40 340 L92 366 L150 330 L214 372 L276 338 L360 376 L360 460 L0 460 Z" fill="#031016"/>';
          return s;
        },
        dunes(p) {
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#ffd9a8"/><stop offset="1" stop-color="#ff9a6b"/></linearGradient>' +
            '<radialGradient id="' + p + 'b"><stop offset="0" stop-color="#fff3d6" stop-opacity=".9"/><stop offset="1" stop-color="#fff3d6" stop-opacity="0"/></radialGradient></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/><circle cx="252" cy="140" r="110" fill="url(#' + p + 'b)"/><circle cx="252" cy="140" r="42" fill="#fff1d2"/>';
          s += '<path d="M0 300 C70 250 150 270 230 300 S330 290 360 280 L360 460 L0 460 Z" fill="#f4a05a"/>';
          s += '<path d="M0 360 C80 300 170 340 250 350 S330 330 360 320 L360 460 L0 460 Z" fill="#d86a32"/>';
          s += '<path d="M0 420 C90 370 180 410 270 405 S340 392 360 388 L360 460 L0 460 Z" fill="#9e4420"/>';
          s += '<path d="M0 300 C70 250 150 270 230 300 S330 290 360 280" fill="none" stroke="#ffd9a8" stroke-width="2.5" opacity=".8"/><path d="M0 360 C80 300 170 340 250 350 S330 330 360 320" fill="none" stroke="#ffc58a" stroke-width="2.5" opacity=".7"/>';
          return s;
        },
        forest(p) {
          const r = mulberry(55);
          let s = '<defs>' +
            '<linearGradient id="' + p + 'a" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="#e7f7d3"/><stop offset=".5" stop-color="#8fd0a0"/><stop offset="1" stop-color="#1f6b4f"/></linearGradient></defs>';
          s += '<rect width="360" height="460" fill="url(#' + p + 'a)"/>';
          const cols = ["#5fb98a", "#2f8f66", "#14563f"];
          for (let l = 0; l < 3; l++) {
            const base = 300 + l * 62, n = 6 - l, sc = 0.8 + l * 0.45;
            for (let i = 0; i < n; i++) {
              const cx = (i + 0.3 + r() * 0.4) * (380 / n) - 10, h = (110 + r() * 40) * sc, w = 50 * sc;
              let pts = "";
              for (let t = 0; t < 3; t++) { const y = base - h + t * h * 0.28, ww = w * (0.45 + t * 0.28); pts += "M" + (cx - ww) + " " + (y + h * 0.36).toFixed(1) + " L" + cx + " " + y.toFixed(1) + " L" + (cx + ww) + " " + (y + h * 0.36).toFixed(1) + " Z "; }
              s += '<path d="' + pts + '" fill="' + cols[l] + '"/><rect x="' + (cx - 4) + '" y="' + (base - 6) + '" width="8" height="' + (24 * sc).toFixed(0) + '" fill="' + cols[2] + '"/>';
            }
            if (l < 2) s += '<ellipse cx="180" cy="' + (base + 40) + '" rx="260" ry="34" fill="#ffffff" opacity="' + (0.32 - l * 0.08).toFixed(2) + '"/>';
          }
          return s;
        },
        mesh(p) {
          let s = '<defs><filter id="' + p + 'f" x="-30%" y="-30%" width="160%" height="160%"><feGaussianBlur stdDeviation="30"/></filter></defs>';
          s += '<rect width="360" height="460" fill="#ffe6f1"/><g filter="url(#' + p + 'f)">' +
            '<circle cx="80" cy="100" r="120" fill="#7c5cff"/><circle cx="300" cy="140" r="104" fill="#33d6ff"/><circle cx="150" cy="330" r="124" fill="#ff7ab8"/><circle cx="296" cy="410" r="112" fill="#ffc44d"/><circle cx="50" cy="430" r="96" fill="#8affd1"/></g>';
          s += '<circle cx="180" cy="228" r="92" fill="none" stroke="#ffffff" stroke-width="3" opacity=".6"/><circle cx="180" cy="228" r="58" fill="#ffffff" opacity=".22"/><circle cx="180" cy="228" r="6" fill="#ffffff" opacity=".9"/>';
          return s;
        },
        arch(p) {
          let s = '<rect width="360" height="460" fill="#ffe2cf"/><rect y="340" width="360" height="120" fill="#f4b9a0"/>';
          s += '<path d="M70 340 V212 A110 110 0 0 1 290 212 V340 Z" fill="#ff8a6e"/><path d="M116 340 V218 A64 64 0 0 1 244 218 V340 Z" fill="#ffb89c"/>';
          s += '<circle cx="180" cy="226" r="34" fill="#fff2d2"/><ellipse cx="210" cy="372" rx="120" ry="14" fill="#c97c63" opacity=".45"/>';
          s += '<path d="M40 400 C34 360 52 340 70 330 C66 356 70 380 82 400 Z" fill="#3fa67a"/><path d="M66 404 C70 364 92 346 112 342 C104 368 100 388 104 404 Z" fill="#2c8a63"/>';
          return s;
        }
      };
      const ART_ORDER = ["sunset", "portrait", "neon", "flower", "sea", "aurora", "dunes", "forest", "mesh", "arch"];

      /* ---------- build the ten cards ---------- */
      const cardsEl = document.getElementById("cards");
      const cards = ART_ORDER.map((name, i) => {
        const el = document.createElement("div");
        el.className = "card";
        el.id = "c" + i;
        el.setAttribute("data-layout-allow-overflow", "");
        el.innerHTML = '<svg width="360" height="460" viewBox="0 0 360 460" xmlns="http://www.w3.org/2000/svg">' + ART[name]("k" + i) + "</svg>";
        cardsEl.appendChild(el);
        return el;
      });

      /* ---------- stack geometry (gap centre at x 1101) ---------- */
      const CX = 1101, CY = 540, S0 = 0.9;
      const SLOT = [
        { dx: 0, dy: 0, r: 1.5 },
        { dx: 14, dy: 7, r: -4 },
        { dx: -16, dy: 12, r: 4.5 },
        { dx: 22, dy: 17, r: -6 },
        { dx: -22, dy: 22, r: 6 }
      ];
      const sx = (k) => CX - 180 + SLOT[k].dx;
      const sy = (k) => CY - 230 + SLOT[k].dy;
      const sr = (k) => SLOT[k].r;

      /* collage landing spots: centre x, centre y, scale, rotation */
      const TG0 = [
        { cx: 200, cy: 160, s: 0.86, r: -8 },
        { cx: 560, cy: 110, s: 0.7, r: 6 },
        { cx: 940, cy: 175, s: 0.8, r: -4 },
        { cx: 1320, cy: 110, s: 0.68, r: 9 },
        { cx: 1720, cy: 170, s: 0.84, r: -7 },
        { cx: 110, cy: 900, s: 0.64, r: 7 },
        { cx: 1810, cy: 900, s: 0.62, r: -9 },
        { cx: 420, cy: 950, s: 0.84, r: 6 },
        { cx: 900, cy: 990, s: 0.72, r: -7 },
        { cx: 1380, cy: 960, s: 0.8, r: 5 }
      ];
      /* card index -> landing spot; every spot sits above or below the word band (y 400-680) */
      const SPOT = [0, 5, 2, 6, 4, 7, 1, 8, 3, 9];
      const TG = SPOT.map((i) => TG0[i]);

      /* ================= baselines ================= */
      tl.set("#rise", { scale: 1.07, transformOrigin: "50% 50%" }, 0);
      tl.set("#tag1", { y: 30 }, 0);
      tl.set("#lmark", { y: 20, scale: 0.82, transformOrigin: "50% 50%" }, 0);
      tl.set("#lword", { y: 24 }, 0);
      tl.set("#ltag", { y: 16 }, 0);
      for (let k = 0; k < 5; k++) {
        tl.set(cards[k], { x: sx(k), y: sy(k) + 780, rotation: sr(k) + (k % 2 ? 12 : -12), scale: S0, zIndex: 10 - k }, 0);
      }
      for (let c = 5; c < 10; c++) {
        tl.set(cards[c], { x: sx(4), y: sy(4), rotation: sr(4), scale: S0, zIndex: 1 }, 0);
      }

      /* ================= 1. the word settles in scale (0 - 1.0) ================= */
      tl.to("#rise", { scale: 1, duration: 1.0, ease: EXPO }, 0);

      /* ================= 2. split (1.1 - 1.9) ================= */
      tl.to("#wl", { x: -200, duration: 0.8, ease: EIO }, 1.1);
      tl.to("#wr", { x: 200, duration: 0.8, ease: EIO }, 1.1);

      /* ================= 3. the stack rises into the gap (1.65 - 2.8) ================= */
      for (let k = 4; k >= 0; k--) {
        tl.to(cards[k], { opacity: 1, x: sx(k), y: sy(k), rotation: sr(k), duration: 0.9, ease: EXPO }, 1.65 + (4 - k) * 0.07);
      }

      /* ================= 4. the top card lifts away, four times (2.8 - 4.2) ================= */
      for (let n = 0; n < 4; n++) {
        const T = 2.8 + n * 0.35;
        const L = cards[n];
        tl.set(L, { zIndex: 20 }, T);
        tl.to(L, { x: sx(0) + 36, y: sy(0) - 300, rotation: sr(0) + 9, duration: 0.15, ease: "power2.out" }, T);
        tl.set(L, { zIndex: 6 }, T + 0.15);
        tl.to(L, { x: sx(4), y: sy(4), rotation: sr(4), duration: 0.2, ease: "power3.out" }, T + 0.15);
        for (let k = 1; k <= 4; k++) {
          const c = (n + k) % 5;
          tl.set(cards[c], { zIndex: 10 - (k - 1) }, T);
          tl.to(cards[c], { x: sx(k - 1), y: sy(k - 1), rotation: sr(k - 1), duration: 0.3, ease: "power2.inOut" }, T + 0.04);
        }
      }

      /* ================= 5. burst above and below the word band, halves close (4.4 - 5.55) ================= */
      const B = 4.4;
      for (let c = 5; c < 10; c++) tl.set(cards[c], { opacity: 1 }, B - 0.02);
      const ORDER = [4, 0, 1, 2, 3, 5, 6, 7, 8, 9];
      ORDER.forEach((c, j) => {
        const t = TG[c];
        /* leave the band vertically inside the gap first, then spread sideways */
        tl.to(cards[c], { y: t.cy - 230, rotation: t.r, scale: t.s, duration: 0.7, ease: EXPO }, B + j * 0.03);
        tl.to(cards[c], { x: t.cx - 180, duration: 0.8, ease: "power2.out" }, B + j * 0.03 + 0.25);
      });
      tl.to("#wl", { x: 0, duration: 0.7, ease: EIO }, 4.85);
      tl.to("#wr", { x: 0, duration: 0.7, ease: EIO }, 4.85);

      /* slow drift while the collage hangs around the word */
      const rd = mulberry(7);
      const DR = TG.map(() => ({ dx: (rd() - 0.5) * 32, dy: (rd() - 0.5) * 24, dr: (rd() - 0.5) * 4 }));
      cards.forEach((el, c) => {
        const t = TG[c], d = DR[c];
        tl.to(el, { x: t.cx - 180 + d.dx, y: t.cy - 230 + d.dy, rotation: t.r + d.dr, duration: 1.9, ease: "sine.inOut" }, 5.75);
      });

      /* ================= 6. the word is replaced (5.55 - 6.1) ================= */
      tl.to("#rise", { opacity: 0, y: -26, duration: 0.35, ease: "power2.in" }, 5.6);
      tl.to("#tag1", { opacity: 1, y: 0, duration: 0.55, ease: EXPO }, 5.75);

      /* ================= 7. clear (7.55 - 8.15) ================= */
      tl.to("#tag1", { opacity: 0, y: -18, duration: 0.35, ease: "power2.in" }, 7.6);
      cards.forEach((el, c) => {
        const t = TG[c], d = DR[c];
        tl.to(el, {
          opacity: 0, scale: t.s * 0.75,
          x: t.cx - 180 + d.dx + (t.cx - 960) * 0.1, y: t.cy - 230 + d.dy + (t.cy - 540) * 0.15,
          duration: 0.42, ease: "power2.in"
        }, 7.55 + c * 0.02);
      });

      /* ================= 8. lockup (8.22 - 8.75) ================= */
      tl.to("#lmark", { opacity: 1, y: 0, scale: 1, duration: 0.5, ease: EXPO }, 8.22);
      tl.to("#lword", { opacity: 1, y: 0, duration: 0.45, ease: EXPO }, 8.3);
      tl.to("#ltag", { opacity: 1, y: 0, duration: 0.35, ease: EXPO }, 8.38);

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