# Photo Collage Animation

Motionboard shot name: Collage Disperse

Eleven tilted photo cards sit in a tight stack, turn slowly and shuffle. They then fly out to the edges of the frame, partly cropped, and the headline One prompt, a whole scene. settles in the empty centre before the Foley lockup.

- Position in a launch film: Transitions
- Slug: photo-collage-animation
- Preview video: https://media.motionboard.app/collage-disperse.mp4
- Recipe page: https://motionboard.app/recipes/photo-collage-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 `collage-disperse`. 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. 11 cards drop into one cluster 0–1.3s (0.85s each, 0.05s stagger); the cluster turns −8° to 0° over 0–3.0s and breathes 1 → 1.05 → 0.94 over 0–3.0s; shuffle 1 at 1.5–2.25s and shuffle 2 at 2.1–2.85s; dispersal starts at 3.0s, 1.15s per card with a 0.04s stagger, and the last card lands at 4.55s; headline words rise from 3.75s (0.8s each, 0.09s stagger) and hold to 7.0s; headline and cards leave 7.0–7.9s; mark at 7.95s, wordmark at 8.05s, tagline at 8.15s, all settled by 8.7s and held to the end (2.3s) |
| Easing | Card drop-in, headline words and lockup `cubic-bezier(0.16,1,0.3,1)` (expo.out); cluster turn power1.inOut; breathing sine.inOut; return to scale 1 power2.out; shuffle lift power2.out and drop power2.inOut; dispersal power3.out; drift linear (none); exit power2.in |
| Camera | Locked frame, no camera move. The motion comes from the cluster layer: it turns from −8° to 0° and breathes between scale 1.05 and 0.94 before the burst, then returns to 1 over 3.0–3.6s while the cards fly out. The background colour blobs drift 46px left and 24px down over the 11s (sine.inOut) |
| Subject | 11 photo cards drawn as SVG scenes: hallway, kitchen, street at night, forest, beach, mountain lake, cafe bokeh, desert road, harbor, portrait silhouette, snowy cabin. 6 landscape cards 420x310px and 5 portrait cards 310x400px, each with a 6px white border, an 18px outer radius (12px inside) and a faint diagonal highlight. Cluster offsets within ±90px, rotations −12° to +11°. Edge targets (card centres, px): top (110,130), (500,40), (900,100), (1300,60), (1770,150); sides (70,560), (1860,500); bottom (260,960), (690,1030), (1180,985), (1660,940); scale 0.58–0.78, rotation −10° to +10°; after landing each card drifts 12–22px in x, 14–22px in y and 2–2.5° over the hold. Headline One prompt, a whole scene. at 88px on one line centred at y 540 with 24px between words. Lockup: mark 112px, wordmark 128px, tagline 40px |
| Sync | The cluster squeezes to 0.94 just before the burst at 3.0s, then the dispersal starts at the top card and moves down the pile in 0.04s steps; the first headline word appears at 3.75s while the last cards are still landing (4.55s); the headline and the cards leave together at 7.0s; the lockup starts at 7.95s, 0.05s after the last card is gone (7.9s) |
| Style | Pale blue-cream gradient `#e4ebf6` → `#edf0f5` → `#f5f1e7` with five soft colour blobs and a vignette reaching rgba(60,78,115,0.13); ink `#12151c`, grey `#9aa3b3` for the first two words, one accent blue `#3f5bff` on the mark only; Inter 700; cards with a white border and a two-layer soft shadow (0 2px 6px and 0 22px 46px); no grain |

## Why it works

A dispersal lets one film show many images and still end on one clear sentence: the cards are the evidence and the headline is the claim. The tight stack first reads as a pile of examples. The slow turn, the breathing and two shuffles keep it alive before anything moves outward, and a small squeeze to 0.94 just before the burst gives the dispersal a wind-up. Cards leave top card first in 0.04s steps, so the burst travels through the pile as a wave, and power3.out makes it fast at the start and soft on landing. Each card lands along the frame edge, partly cropped, so the set reads as a wall that continues past the frame while the centre band stays empty. The headline starts at 3.75s while the last cards are still landing, so the eye follows the clearing as it fills. The first two words are grey and the rest are ink, which puts the weight on the end of the sentence. A very slow linear drift keeps the edge cards alive during the 2.1s hold. The 11 scenes differ in colour and light (a warm hallway, a dark street, a green forest, a blue beach), so the edges read as varied. Cards and headline leave together before the lockup begins, so the logo never shares the frame with them. One accent colour, blue #3f5bff, appears only on the mark.

## Prompt

> Build an 11-second, 1920x1080, 30 fps light product film called Collage Disperse for a fictional product, Foley (an AI sound designer for video). Background: linear-gradient 165deg #e4ebf6, #edf0f5 at 48%, #f5f1e7, with five soft radial colour blobs on a 2140x1220 layer that drifts 46px left and 24px down over the whole film (sine.inOut), and a vignette reaching rgba(60,78,115,0.13). No grain. Ink #12151c, grey #9aa3b3, one accent blue #3f5bff. Font Inter. Draw 11 photo cards in code as SVG scenes: hallway, kitchen, street at night, forest, beach, mountain lake, cafe bokeh, desert road, harbor, portrait silhouette, snowy cabin. Landscape cards 420x310px (6) and portrait cards 310x400px (5), each with a 6px white border, an 18px outer radius, a 12px inner radius, a faint diagonal highlight and a shadow of 0 2px 6px rgba(40,55,95,0.14) plus 0 22px 46px rgba(40,55,95,0.22). Put all cards in one cluster layer centred on the frame and drive everything from one GSAP timeline with initial states set before it. 0–1.3s: the cards drop in at the centre in a tight stack, offsets within ±90px and rotations from −12° to +11°, each from 44px lower, 9° more rotated and scale 0.84, opacity 0 to 1, 0.85s expo.out, 0.05s stagger. The cluster layer turns from −8° to 0° over 0–3.0s (power1.inOut) and breathes: scale 1 to 1.05 over 0–1.4s, down to 0.94 over 1.4–3.0s (sine.inOut), then back to 1 over 3.0–3.6s (power2.out). Shuffle: at 1.5s the cafe card lifts out (0.3s power2.out, 70px right, 120px up, +8°, scale 1.05), jumps to the top of the stack at 1.8s and drops back over 0.45s (power2.inOut); at 2.1s the night-street card does the same (90px left, 96px up) and finishes at 2.85s. Dispersal at 3.0s: every card flies to its own spot along the frame edges over 1.15s with power3.out, top card first, stagger 0.04s, so the last card lands at 4.55s; scale 0.58 to 0.78 and rotation −10° to +10°. Card centres in px: top (110,130), (500,40), (900,100), (1300,60), (1770,150); sides (70,560) and (1860,500); bottom (260,960), (690,1030), (1180,985), (1660,940). Edge cards are partly cropped by the frame and the centre band stays clear. After landing each card drifts linearly to 7.0s by 12–22px in x, 14–22px in y and 2–2.5° of rotation. Headline One prompt, a whole scene.: Inter 700, 88px, letter-spacing −0.03em, one line centred at y 540, 24px between words; One prompt, in grey, the rest in ink; each word rises 30px and fades in over 0.8s expo.out with a 0.09s stagger from 3.75s, and holds to 7.0s. At 7.0s the words lift 22px and fade (0.45s power2.in, 0.03s stagger) while every card flies 760px straight away from the centre, rotates 8° and fades over 0.65s power2.in, 0.025s stagger starting with the bottom-right card; the frame is clear by 7.9s. Lockup: the Foley mark (112px rounded square #3f5bff, five white bars of different heights, soft blue drop shadow) scales from 0.6 and fades in at 7.95s (0.7s expo.out); its bars grow from 10% to full height from 8.2s (0.5s, 0.05s stagger); the word Foley (Inter 700, 128px, −0.045em) rises at 8.05s (0.65s expo.out); the tagline Sound for every frame. (40px, weight 500, #6b7385) at 8.15s (0.55s). Everything is settled by 8.7s and holds still to 11.0s.

## Often confused with

- [Flipbook Animation](https://motionboard.app/r/flipbook-animation.md): Flipbook Burst turns stacked pages like a book, faster and faster, and bursts into a 3D collage behind a wordmark; here the cards stay flat, the stack opens once toward the frame edges and a headline settles in the cleared centre.
- [Showcase Wall](https://motionboard.app/r/showcase-wall.md): Showcase Wall drifts a full-screen wall of cards at constant speed and accelerates into one card; here a tight cluster opens outward and leaves the centre empty for a line of text.

## Source files

Runnable HyperFrames project, 3 files.

- https://motionboard.app/source/collage-disperse/hyperframes.json (318 B)
- https://motionboard.app/source/collage-disperse/index.html (35.3 KB)
- https://motionboard.app/source/collage-disperse/package.json (305 B)

Download all of them:

```sh
curl -fsSL --create-dirs -o "collage-disperse/hyperframes.json" "https://motionboard.app/source/collage-disperse/hyperframes.json"
curl -fsSL --create-dirs -o "collage-disperse/index.html" "https://motionboard.app/source/collage-disperse/index.html"
curl -fsSL --create-dirs -o "collage-disperse/package.json" "https://motionboard.app/source/collage-disperse/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: #12151c;
        --sub: #6b7385;
        --grey: #9aa3b3;
        --acc: #3f5bff;
        --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: #e9eef5; }
      #root {
        position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #e9eef5;
        font-family: var(--font-ui); color: var(--ink); -webkit-font-smoothing: antialiased;
      }
      .full { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      svg { display: block; flex: none; }

      /* ---------- background ---------- */
      #bg { z-index: 1; background: linear-gradient(165deg, #e4ebf6 0%, #edf0f5 48%, #f5f1e7 100%); overflow: hidden; }
      #blobs {
        position: absolute; left: -110px; top: -70px; width: 2140px; height: 1220px;
        background:
          radial-gradient(ellipse 34% 52% at 10% 32%, rgba(168, 193, 238, 0.78) 0%, rgba(168, 193, 238, 0) 100%),
          radial-gradient(ellipse 30% 42% at 90% 14%, rgba(212, 203, 244, 0.7) 0%, rgba(212, 203, 244, 0) 100%),
          radial-gradient(ellipse 36% 40% at 72% 98%, rgba(247, 230, 190, 0.9) 0%, rgba(247, 230, 190, 0) 100%),
          radial-gradient(ellipse 28% 38% at 22% 96%, rgba(190, 224, 236, 0.7) 0%, rgba(190, 224, 236, 0) 100%),
          radial-gradient(ellipse 22% 30% at 52% 4%, rgba(250, 240, 214, 0.65) 0%, rgba(250, 240, 214, 0) 100%);
      }

      /* ---------- cards ---------- */
      #cards { z-index: 2; }
      #cluster { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; }
      .card {
        position: absolute; padding: 6px; border-radius: 18px; background: #ffffff; opacity: 0;
        box-shadow: 0 2px 6px rgba(40, 55, 95, 0.14), 0 22px 46px rgba(40, 55, 95, 0.22);
      }
      .cin { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: #cfd8e6; }
      .cin::after {
        content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 100%;
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0) 38%);
      }

      /* ---------- headline ---------- */
      #head { z-index: 3; }
      #headrow {
        position: absolute; left: 0; top: 486px; width: 1920px; height: 108px;
        display: flex; align-items: center; justify-content: center; gap: 24px;
        font-size: 88px; font-weight: 700; letter-spacing: -0.03em; line-height: 108px; white-space: nowrap;
      }
      .w { display: block; opacity: 0; }
      .g { color: var(--grey); }
      .k { color: var(--ink); }

      /* ---------- lockup ---------- */
      #lock { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; z-index: 4; pointer-events: none; }
      #lockrow { position: absolute; left: 0; top: 396px; width: 1920px; height: 136px; display: flex; align-items: center; justify-content: center; gap: 30px; }
      #mark { width: 112px; height: 112px; opacity: 0; filter: drop-shadow(0 12px 20px rgba(63, 91, 255, 0.28)); }
      #word { font-size: 128px; font-weight: 700; letter-spacing: -0.045em; line-height: 136px; color: var(--ink); opacity: 0; }
      #tag { position: absolute; left: 0; top: 566px; width: 1920px; text-align: center; font-size: 40px; font-weight: 500; color: var(--sub); letter-spacing: -0.01em; opacity: 0; }

      #vig { z-index: 5; pointer-events: none; background: radial-gradient(ellipse at center, rgba(60, 78, 115, 0) 58%, rgba(60, 78, 115, 0.13) 100%); }
    </style>
  </head>
  <body>
    <div id="root" data-composition-id="main" data-start="0" data-duration="11" data-width="1920" data-height="1080">
      <div id="bg" class="clip full" data-start="0" data-duration="11" data-track-index="0">
        <div id="blobs"></div>
      </div>
      <div id="cards" class="clip full" data-start="0" data-duration="11" data-track-index="1">
        <div id="cluster" data-layout-allow-overlap></div>
      </div>
      <div id="head" class="clip full" data-start="0" data-duration="11" data-track-index="2">
        <div id="headrow" data-layout-allow-overlap>
          <span class="w g">One</span><span class="w g">prompt,</span><span class="w k">a</span><span class="w k">whole</span><span class="w k">scene.</span>
        </div>
      </div>
      <div id="lock" class="clip" data-start="0" data-duration="11" data-track-index="3">
        <div id="lockrow">
          <svg id="mark" viewBox="0 0 64 64">
            <rect x="0" y="0" width="64" height="64" rx="17" fill="#3f5bff"/>
            <g id="bars" fill="#ffffff">
              <rect class="bar" x="12" y="24" width="6" height="16" rx="3"/>
              <rect class="bar" x="21" y="15" width="6" height="34" rx="3"/>
              <rect class="bar" x="30" y="8" width="6" height="48" rx="3"/>
              <rect class="bar" x="39" y="18" width="6" height="28" rx="3"/>
              <rect class="bar" x="48" y="25" width="6" height="14" rx="3"/>
            </g>
          </svg>
          <div id="word">Foley</div>
        </div>
        <div id="tag">Sound for every frame.</div>
      </div>
      <div id="vig" class="clip full" data-start="0" data-duration="11" data-track-index="4"></div>
    </div>

    <script>
      /* ---------- seeded random ---------- */
      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(98);

      /* ---------- svg helpers ---------- */
      const svg = (w, h, body) => '<svg viewBox="0 0 ' + w + " " + h + '" preserveAspectRatio="xMidYMid slice" width="100%" height="100%">' + body + "</svg>";
      const lg = (id, stops, x1, y1, x2, y2) =>
        '<linearGradient id="' + id + '" x1="' + (x1 || 0) + '" y1="' + (y1 || 0) + '" x2="' + (x2 || 0) + '" y2="' + (y2 === undefined ? 1 : y2) + '">' +
        stops.map((s) => '<stop offset="' + s[0] + '" stop-color="' + s[1] + '"' + (s[2] !== undefined ? ' stop-opacity="' + s[2] + '"' : "") + "/>").join("") + "</linearGradient>";
      const rg = (id, stops) =>
        '<radialGradient id="' + id + '" cx=".5" cy=".5" r=".5">' +
        stops.map((s) => '<stop offset="' + s[0] + '" stop-color="' + s[1] + '"' + (s[2] !== undefined ? ' stop-opacity="' + s[2] + '"' : "") + "/>").join("") + "</radialGradient>";
      const pine = (x, y, h, w, c) => {
        let s = "";
        for (let i = 0; i < 3; i++) {
          const ty = y - h + i * h * 0.27, bw = w * (0.52 + i * 0.24), th = h * 0.5;
          s += '<path d="M' + x + " " + ty + " L" + (x + bw / 2) + " " + (ty + th) + " L" + (x - bw / 2) + " " + (ty + th) + 'Z" fill="' + c + '"/>';
        }
        return s + '<rect x="' + (x - w * 0.04) + '" y="' + (y - h * 0.1) + '" width="' + w * 0.08 + '" height="' + h * 0.1 + '" fill="#3a2a1e"/>';
      };

      /* ---------- 11 photo scenes ---------- */
      const SC = {};

      // hallway, portrait 300x380
      SC.hallway = () => svg(300, 380,
        "<defs>" + lg("hwl", [[0, "#6d4d34"], [1, "#8a6845"]], 0, 0, 1, 0) + lg("hwr", [[0, "#9a7650"], [1, "#7a5a3c"]], 0, 0, 1, 0) +
        lg("hwc", [[0, "#e9d8b8"], [1, "#c9ae86"]]) + lg("hwf", [[0, "#5c3f2a"], [1, "#8a6140"]]) +
        rg("hwg", [[0, "#fff4d2", 0.95], [1, "#fff4d2", 0]]) + rg("hws", [[0, "#ffd27a", 0.85], [1, "#ffd27a", 0]]) + "</defs>" +
        '<rect width="300" height="380" fill="#c9a77c"/>' +
        '<polygon points="0,0 105,140 105,250 0,380" fill="url(#hwl)"/>' +
        '<polygon points="300,0 195,140 195,250 300,380" fill="url(#hwr)"/>' +
        '<polygon points="0,0 300,0 195,140 105,140" fill="url(#hwc)"/>' +
        '<polygon points="0,380 300,380 195,250 105,250" fill="url(#hwf)"/>' +
        '<rect x="105" y="140" width="90" height="110" fill="#d6b88c"/>' +
        '<rect x="128" y="165" width="44" height="85" rx="2" fill="#4a3324"/>' +
        '<rect x="133" y="171" width="34" height="30" fill="#ffe7b0"/>' +
        '<circle cx="165" cy="218" r="2.6" fill="#e0bd70"/>' +
        '<ellipse cx="150" cy="205" rx="96" ry="104" fill="url(#hwg)"/>' +
        '<polygon points="110,380 190,380 164,250 136,250" fill="#a8483a"/>' +
        '<polygon points="110,380 118,380 138,250 136,250" fill="#e4c07a" opacity=".75"/>' +
        '<polygon points="190,380 182,380 162,250 164,250" fill="#e4c07a" opacity=".75"/>' +
        '<polygon points="22,110 62,134 62,198 22,232" fill="#f2e8d4"/><polygon points="28,122 56,140 56,192 28,218" fill="#7fb0c9"/><polygon points="28,170 56,176 56,192 28,218" fill="#4f8a6a"/>' +
        '<polygon points="72,140 96,152 96,192 72,206" fill="#f2e8d4"/><polygon points="76,147 92,155 92,188 76,199" fill="#e08a5a"/>' +
        '<polygon points="278,110 238,134 238,198 278,232" fill="#f2e8d4"/><polygon points="272,122 244,140 244,192 272,218" fill="#c9b27a"/><polygon points="272,160 244,166 244,192 272,218" fill="#6b5a3c"/>' +
        '<polygon points="228,140 204,152 204,192 228,206" fill="#f2e8d4"/><polygon points="224,147 208,155 208,188 224,199" fill="#8aa0c9"/>' +
        '<ellipse cx="256" cy="168" rx="46" ry="42" fill="url(#hws)"/><path d="M247 160 L265 160 L262 176 L250 176Z" fill="#fff0c4"/>' +
        '<rect x="30" y="318" width="52" height="8" rx="2" fill="#3b271a"/><rect x="36" y="326" width="4" height="40" fill="#3b271a"/><rect x="72" y="326" width="4" height="40" fill="#3b271a"/>' +
        '<path d="M44 318 L68 318 L64 296 L48 296Z" fill="#f3d9a0"/><rect x="55" y="318" width="2" height="0" fill="#000"/>');

      // kitchen, landscape 400x300
      SC.kitchen = () => {
        let t = "";
        for (let y = 100; y < 184; y += 14) t += '<line x1="0" x2="400" y1="' + y + '" y2="' + y + '" stroke="#d9c4a0" stroke-width="1"/>';
        for (let y = 100, r = 0; y < 184; y += 14, r++) for (let x = (r % 2) * 14; x < 400; x += 28) t += '<line x1="' + x + '" x2="' + x + '" y1="' + y + '" y2="' + (y + 14) + '" stroke="#d9c4a0" stroke-width="1"/>';
        return svg(400, 300,
          "<defs>" + lg("kw", [[0, "#f6e8cf"], [1, "#e8cfa8"]]) + lg("ksk", [[0, "#8fcbf3"], [1, "#eaf7ff"]]) + rg("klp", [[0, "#ffd27a", 0.85], [1, "#ffd27a", 0]]) + lg("kcb", [[0, "#6f917b"], [1, "#4f6f5b"]]) + "</defs>" +
          '<rect width="400" height="300" fill="url(#kw)"/>' + t +
          '<rect x="250" y="34" width="116" height="122" rx="4" fill="#fff6e6"/><rect x="258" y="42" width="100" height="106" fill="url(#ksk)"/>' +
          '<rect x="306" y="42" width="4" height="106" fill="#fff6e6"/><rect x="258" y="92" width="100" height="4" fill="#fff6e6"/>' +
          '<path d="M262 148 Q290 118 318 148Z" fill="#8cc08a" opacity=".8"/><path d="M300 148 Q330 108 356 148Z" fill="#6aa86e" opacity=".8"/>' +
          '<rect x="14" y="24" width="206" height="72" rx="3" fill="url(#kcb)"/>' +
          '<line x1="82" x2="82" y1="26" y2="94" stroke="#3f5b49" stroke-width="2"/><line x1="150" x2="150" y1="26" y2="94" stroke="#3f5b49" stroke-width="2"/>' +
          '<rect x="26" y="38" width="44" height="46" rx="2" fill="none" stroke="#86a692" stroke-width="1.5"/><rect x="94" y="38" width="44" height="46" rx="2" fill="none" stroke="#86a692" stroke-width="1.5"/><rect x="162" y="38" width="44" height="46" rx="2" fill="none" stroke="#86a692" stroke-width="1.5"/>' +
          '<rect x="0" y="186" width="400" height="114" fill="#587a64"/><rect x="0" y="186" width="400" height="12" fill="#f1ebe0"/><rect x="0" y="198" width="400" height="3" fill="#00000026"/>' +
          '<line x1="100" x2="100" y1="204" y2="300" stroke="#3f5b49" stroke-width="2"/><line x1="200" x2="200" y1="204" y2="300" stroke="#3f5b49" stroke-width="2"/><line x1="300" x2="300" y1="204" y2="300" stroke="#3f5b49" stroke-width="2"/>' +
          '<circle cx="82" cy="236" r="4" fill="#e9d9b0"/><circle cx="118" cy="236" r="4" fill="#e9d9b0"/>' +
          '<line x1="150" x2="150" y1="0" y2="52" stroke="#3a3a3a" stroke-width="2"/><ellipse cx="150" cy="104" rx="80" ry="60" fill="url(#klp)"/>' +
          '<path d="M128 70 Q150 44 172 70Z" fill="#ff9f43"/><ellipse cx="150" cy="71" rx="22" ry="3" fill="#ffe7b0"/>' +
          '<ellipse cx="296" cy="184" rx="32" ry="5" fill="#00000022"/><path d="M270 182 Q268 150 296 148 Q324 150 322 182Z" fill="#d94f4f"/><path d="M322 164 Q342 154 346 142" stroke="#d94f4f" stroke-width="6" fill="none" stroke-linecap="round"/><path d="M270 164 Q252 170 256 186" stroke="#2f2f2f" stroke-width="5" fill="none" stroke-linecap="round"/><rect x="288" y="142" width="16" height="6" rx="3" fill="#2f2f2f"/>' +
          '<ellipse cx="86" cy="182" rx="38" ry="8" fill="#e9dbc2"/><circle cx="70" cy="172" r="10" fill="#f08a3c"/><circle cx="88" cy="170" r="10" fill="#e8574a"/><circle cx="104" cy="173" r="9" fill="#f6c244"/>');
      };

      // night street, landscape
      SC.night = () => {
        let b = "", x = -10;
        const cols = ["#10122c", "#181b3d", "#0d0f26", "#1d1f47"];
        while (x < 400) {
          const w = 34 + Math.floor(rnd() * 28), h = 60 + Math.floor(rnd() * 95), y = 172 - h;
          b += '<rect x="' + x + '" y="' + y + '" width="' + w + '" height="' + (h + 2) + '" fill="' + cols[Math.floor(rnd() * 4)] + '"/>';
          for (let wy = y + 8; wy < 164; wy += 13) for (let wx = x + 6; wx < x + w - 8; wx += 11) {
            if (rnd() < 0.4) b += '<rect x="' + wx + '" y="' + wy + '" width="5" height="7" fill="' + (rnd() < 0.7 ? "#ffd36b" : "#ffa86b") + '" opacity="' + (0.6 + rnd() * 0.4).toFixed(2) + '"/>';
          }
          x += w + (rnd() < 0.3 ? 4 : 0);
        }
        let lamps = "";
        [70, 200, 330].forEach((lx) => {
          lamps += '<rect x="' + (lx - 1.5) + '" y="118" width="3" height="58" fill="#07081a"/><circle cx="' + lx + '" cy="116" r="40" fill="url(#nlg)"/><circle cx="' + lx + '" cy="116" r="4.5" fill="#fff4cf"/>' +
            '<rect x="' + (lx - 5) + '" y="180" width="10" height="110" fill="url(#nrf)"/>';
        });
        return svg(400, 300,
          "<defs>" + lg("nsk", [[0, "#0a0d2c"], [0.55, "#2b2b6e"], [1, "#8a4a82"]]) + lg("nrd", [[0, "#1d2044"], [1, "#0b0c21"]]) + rg("nlg", [[0, "#ffd88a", 0.75], [1, "#ffd88a", 0]]) + lg("nrf", [[0, "#ffd88a", 0.45], [1, "#ffd88a", 0]]) + rg("nrl", [[0, "#ff4a4a", 0.8], [1, "#ff4a4a", 0]]) + "</defs>" +
          '<rect width="400" height="172" fill="url(#nsk)"/>' + b +
          '<rect y="172" width="400" height="128" fill="url(#nrd)"/>' +
          '<path d="M200 172 L0 300 M200 172 L400 300 M200 172 L120 300 M200 172 L280 300" stroke="#3a3d72" stroke-width="1.2" fill="none" opacity=".7"/>' + lamps +
          '<circle cx="190" cy="206" r="22" fill="url(#nrl)"/><circle cx="190" cy="206" r="4.5" fill="#ff6a6a"/><circle cx="216" cy="206" r="22" fill="url(#nrl)"/><circle cx="216" cy="206" r="4.5" fill="#ff6a6a"/>' +
          '<rect x="186" y="200" width="34" height="12" rx="3" fill="#07081a" opacity=".85"/>' +
          '<circle cx="304" cy="236" r="6" fill="#fffbe6"/><circle cx="330" cy="236" r="6" fill="#fffbe6"/><ellipse cx="318" cy="258" rx="40" ry="10" fill="#fffbe6" opacity=".18"/>');
      };

      // forest, portrait
      SC.forest = () => {
        let rays = "", back = "", mid = "", front = "";
        for (let i = 0; i < 6; i++) rays += '<polygon points="210,80 ' + (-60 + i * 62) + ',300 ' + (-30 + i * 62) + ',300" fill="#fff3c0" opacity="' + (0.1 + (i % 2) * 0.06) + '"/>';
        for (let i = 0; i < 9; i++) back += pine(18 + i * 34 + (i % 2) * 8, 262, 82 + (i % 3) * 12, 44, "#a4c8a4");
        for (let i = 0; i < 6; i++) mid += pine(30 + i * 52 + (i % 2) * 10, 318, 150 + (i % 3) * 18, 78, "#4e8d66");
        [[40, 410, 250, 120], [250, 412, 280, 130], [150, 392, 200, 96]].forEach((p) => { front += pine(p[0], p[1], p[2], p[3], "#1f5a3f"); });
        return svg(300, 380,
          "<defs>" + lg("fsk", [[0, "#f8f2cc"], [1, "#cfe8c6"]]) + rg("fsn", [[0, "#fff1b8", 0.9], [1, "#fff1b8", 0]]) + lg("fms", [[0, "#ffffff", 0], [0.5, "#ffffff", 0.55], [1, "#ffffff", 0]]) + "</defs>" +
          '<rect width="300" height="380" fill="url(#fsk)"/><circle cx="210" cy="80" r="120" fill="url(#fsn)"/>' + rays + back +
          '<rect y="206" width="300" height="70" fill="url(#fms)"/>' + mid +
          '<rect y="270" width="300" height="60" fill="url(#fms)" opacity=".7"/>' +
          '<rect y="350" width="300" height="30" fill="#153a2b"/>' + front +
          '<rect y="352" width="300" height="28" fill="#153a2b"/>');
      };

      // beach, landscape
      SC.beach = () => svg(400, 300,
        "<defs>" + lg("bsk", [[0, "#62b8ee"], [1, "#d4effb"]]) + lg("bsea", [[0, "#1c97bf"], [1, "#6fd3de"]]) + lg("bsd", [[0, "#f3deb0"], [1, "#e4c18a"]]) + rg("bsn", [[0, "#ffffff", 0.9], [1, "#ffffff", 0]]) +
        '<clipPath id="bcl"><path d="M54 172 Q110 110 166 172Z"/></clipPath></defs>' +
        '<rect width="400" height="150" fill="url(#bsk)"/><circle cx="318" cy="56" r="80" fill="url(#bsn)"/><circle cx="318" cy="56" r="24" fill="#fffdf2"/>' +
        '<ellipse cx="90" cy="48" rx="46" ry="11" fill="#fff" opacity=".85"/><ellipse cx="122" cy="40" rx="30" ry="10" fill="#fff" opacity=".85"/><ellipse cx="220" cy="84" rx="38" ry="8" fill="#fff" opacity=".7"/>' +
        '<rect y="140" width="400" height="72" fill="url(#bsea)"/>' +
        '<path d="M0 156 Q50 150 100 156 T200 156 T300 156 T400 156" stroke="#fff" stroke-width="1.6" fill="none" opacity=".55"/><path d="M0 172 Q60 164 120 172 T240 172 T360 172 T480 172" stroke="#fff" stroke-width="2" fill="none" opacity=".55"/><path d="M0 190 Q70 180 140 190 T280 190 T420 190" stroke="#fff" stroke-width="2.4" fill="none" opacity=".6"/>' +
        '<path d="M300 144 L316 126 L316 144Z" fill="#fff"/><path d="M296 144 L332 144 L326 150 L300 150Z" fill="#c9534a"/>' +
        '<path d="M0 214 C100 194 250 232 400 202 V300 H0Z" fill="url(#bsd)"/><path d="M0 214 C100 194 250 232 400 202" stroke="#fff" stroke-width="6" fill="none" opacity=".75"/>' +
        '<line x1="110" y1="168" x2="110" y2="256" stroke="#7a5a3c" stroke-width="4"/>' +
        '<path d="M54 172 Q110 110 166 172Z" fill="#ff5d5d"/><g clip-path="url(#bcl)"><polygon points="110,100 82,180 102,180" fill="#fff"/><polygon points="110,100 122,180 142,180" fill="#fff"/></g>' +
        '<ellipse cx="116" cy="258" rx="40" ry="5" fill="#00000018"/>' +
        '<g transform="rotate(-8 280 262)"><rect x="236" y="244" width="90" height="36" rx="3" fill="#2aa6b8"/><rect x="246" y="244" width="8" height="36" fill="#fff" opacity=".9"/><rect x="266" y="244" width="8" height="36" fill="#fff" opacity=".9"/><rect x="286" y="244" width="8" height="36" fill="#fff" opacity=".9"/></g>');

      // lake at sunrise, landscape
      SC.lake = () => {
        const M1 = "M0 150 L0 112 L46 84 L88 114 L138 72 L190 112 L240 86 L296 120 L350 92 L400 114 L400 150Z";
        const M2 = "M0 150 L0 126 L60 104 L112 130 L170 100 L232 132 L300 108 L360 130 L400 118 L400 150Z";
        const M3 = "M0 150 L0 138 L80 122 L150 140 L230 126 L320 142 L400 130 L400 150Z";
        let rip = "";
        for (let i = 0; i < 9; i++) rip += '<rect x="' + (170 + (i % 3) * 8 - i * 1.5) + '" y="' + (158 + i * 11) + '" width="' + (60 - i * 3) + '" height="2.4" rx="1.2" fill="#fff3c8" opacity="' + (0.7 - i * 0.05).toFixed(2) + '"/>';
        return svg(400, 300,
          "<defs>" + lg("lsk", [[0, "#2f3a7a"], [0.55, "#e8708a"], [1, "#ffcf8e"]]) + lg("llk", [[0, "#ffb48a"], [1, "#4f4286"]]) + rg("lsn", [[0, "#fff1c9", 0.8], [1, "#fff1c9", 0]]) + "</defs>" +
          '<rect width="400" height="150" fill="url(#lsk)"/><circle cx="200" cy="150" r="80" fill="url(#lsn)"/><circle cx="200" cy="148" r="30" fill="#fff1c9"/>' +
          '<path d="' + M1 + '" fill="#6a5a9a"/><path d="' + M2 + '" fill="#4a447f"/><path d="' + M3 + '" fill="#2a2d63"/>' +
          '<rect y="150" width="400" height="150" fill="url(#llk)"/>' +
          '<g transform="translate(0,300) scale(1,-1)" opacity=".34"><path d="' + M1 + '" fill="#6a5a9a"/><path d="' + M2 + '" fill="#4a447f"/><path d="' + M3 + '" fill="#2a2d63"/></g>' +
          '<rect y="150" width="400" height="6" fill="#ffd9a8" opacity=".5"/>' + rip +
          '<path d="M0 220 Q100 214 200 220 T400 220" stroke="#fff" stroke-width="1.2" fill="none" opacity=".25"/><path d="M0 248 Q100 242 200 248 T400 248" stroke="#fff" stroke-width="1.2" fill="none" opacity=".2"/>');
      };

      // cafe bokeh, portrait
      SC.cafe = () => {
        const cols = ["#ffb454", "#ff8a3d", "#ffd98a", "#ff6f6f", "#ffe7b0"];
        let g = "", bk = "";
        cols.forEach((c, i) => { g += rg("bk" + i, [[0, c, 0.8], [0.8, c, 0.5], [1, c, 0.05]]); });
        for (let i = 0; i < 28; i++) {
          const r = 10 + rnd() * 28, cx = rnd() * 300, cy = rnd() * 250, ci = Math.floor(rnd() * 5), op = (0.3 + rnd() * 0.5).toFixed(2);
          bk += '<circle cx="' + cx.toFixed(1) + '" cy="' + cy.toFixed(1) + '" r="' + r.toFixed(1) + '" fill="url(#bk' + ci + ')" opacity="' + op + '"/><circle cx="' + cx.toFixed(1) + '" cy="' + cy.toFixed(1) + '" r="' + r.toFixed(1) + '" fill="none" stroke="' + cols[ci] + '" stroke-width="1.4" opacity="' + (op * 0.7).toFixed(2) + '"/>';
        }
        return svg(300, 380,
          "<defs>" + lg("cbg", [[0, "#1a0f0c"], [0.6, "#3b2216"], [1, "#5a331d"]]) + lg("ctb", [[0, "#4a2d1a"], [1, "#1a0e08"]]) + g + "</defs>" +
          '<rect width="300" height="380" fill="url(#cbg)"/>' + bk +
          '<rect y="272" width="300" height="108" fill="url(#ctb)"/><rect y="272" width="300" height="3" fill="#8a5a36" opacity=".6"/>' +
          '<ellipse cx="150" cy="322" rx="92" ry="17" fill="#e7dccb"/><ellipse cx="150" cy="320" rx="62" ry="10" fill="#f6efe3"/>' +
          '<path d="M96 264 L204 264 Q200 318 150 322 Q100 318 96 264Z" fill="#f6efe3"/><ellipse cx="150" cy="264" rx="54" ry="10" fill="#5a2f1b"/><ellipse cx="150" cy="264" rx="54" ry="10" fill="none" stroke="#fffaf0" stroke-width="2"/>' +
          '<path d="M204 276 C240 268 240 308 202 306" stroke="#f6efe3" stroke-width="9" fill="none" stroke-linecap="round"/>' +
          '<path d="M130 250 C120 232 142 220 132 200 C124 184 144 174 136 156" stroke="#fff" stroke-width="4" fill="none" opacity=".45" stroke-linecap="round"/><path d="M158 250 C148 234 170 222 160 204 C152 190 170 180 164 164" stroke="#fff" stroke-width="4" fill="none" opacity=".4" stroke-linecap="round"/>');
      };

      // desert road, landscape
      SC.desert = () => {
        let dash = "", poles = "";
        for (let i = 0; i < 6; i++) {
          const y1 = 170 + 130 * Math.pow(i / 6, 1.8), y2 = 170 + 130 * Math.pow((i + 0.55) / 6, 1.8);
          const h1 = 0.6 + ((y1 - 170) / 130) * 3.4, h2 = 0.6 + ((y2 - 170) / 130) * 3.4;
          dash += '<polygon points="' + (200 - h1) + "," + y1 + " " + (200 + h1) + "," + y1 + " " + (200 + h2) + "," + y2 + " " + (200 - h2) + "," + y2 + '" fill="#ffe9b0"/>';
        }
        for (let i = 0; i < 5; i++) {
          const y = 172 + 126 * Math.pow((i + 0.4) / 5.4, 1.8), k = (y - 170) / 130;
          const x = 200 - (6 + k * 124) - 8 - k * 30, h = 8 + k * 62;
          poles += '<line x1="' + x.toFixed(1) + '" x2="' + x.toFixed(1) + '" y1="' + y.toFixed(1) + '" y2="' + (y - h).toFixed(1) + '" stroke="#3a1f2c" stroke-width="' + (1 + k * 3).toFixed(1) + '"/><line x1="' + (x - 3 - k * 8).toFixed(1) + '" x2="' + (x + 3 + k * 8).toFixed(1) + '" y1="' + (y - h + 2 + k * 3).toFixed(1) + '" y2="' + (y - h + 2 + k * 3).toFixed(1) + '" stroke="#3a1f2c" stroke-width="' + (1 + k * 2).toFixed(1) + '"/>';
        }
        return svg(400, 300,
          "<defs>" + lg("dsk", [[0, "#3d2a6b"], [0.55, "#ff7a59"], [1, "#ffc27a"]]) + lg("dgr", [[0, "#d9694a"], [1, "#8a3a3a"]]) + rg("dsn", [[0, "#fff0b8", 0.85], [1, "#fff0b8", 0]]) + "</defs>" +
          '<rect width="400" height="172" fill="url(#dsk)"/><circle cx="200" cy="172" r="110" fill="url(#dsn)"/><circle cx="200" cy="170" r="42" fill="#fff0b8"/>' +
          '<path d="M0 172 L0 142 L38 140 L46 122 L98 122 L106 140 L146 142 L158 172Z" fill="#8a3a4a"/><path d="M250 172 L262 150 L300 148 L308 130 L352 130 L360 150 L400 146 L400 172Z" fill="#8a3a4a"/>' +
          '<rect y="170" width="400" height="130" fill="url(#dgr)"/>' +
          '<polygon points="194,170 206,170 330,300 70,300" fill="#2a2430"/><path d="M194 170 L70 300" stroke="#ffe9b0" stroke-width="1.4" opacity=".6"/><path d="M206 170 L330 300" stroke="#ffe9b0" stroke-width="1.4" opacity=".6"/>' +
          dash + poles);
      };

      // harbor at dusk, landscape
      SC.harbor = () => svg(400, 300,
        "<defs>" + lg("hsk", [[0, "#ffd8e6"], [0.6, "#ffb69a"], [1, "#ffe3a8"]]) + lg("hsea", [[0, "#ffb08f"], [0.4, "#c07aa0"], [1, "#3f4f94"]]) + rg("hsn", [[0, "#fff3c8", 0.9], [1, "#fff3c8", 0]]) + "</defs>" +
        '<rect width="400" height="150" fill="url(#hsk)"/><circle cx="230" cy="150" r="90" fill="url(#hsn)"/><circle cx="230" cy="148" r="22" fill="#fff6d8"/>' +
        '<path d="M-20 52 Q80 38 180 54 T400 46" stroke="#fff" stroke-width="10" fill="none" opacity=".55" stroke-linecap="round"/><path d="M40 88 Q140 76 240 90 T420 84" stroke="#ffe0e8" stroke-width="8" fill="none" opacity=".5" stroke-linecap="round"/>' +
        '<path d="M0 150 L0 138 L40 130 L84 142 L130 134 L180 148 L180 150Z" fill="#7a5a8c" opacity=".8"/><path d="M290 150 L318 136 L360 142 L400 130 L400 150Z" fill="#7a5a8c" opacity=".8"/>' +
        '<rect y="150" width="400" height="150" fill="url(#hsea)"/>' +
        '<rect x="218" y="154" width="24" height="3" rx="1.5" fill="#fff3c8" opacity=".8"/><rect x="206" y="164" width="48" height="3" rx="1.5" fill="#fff3c8" opacity=".6"/><rect x="196" y="176" width="68" height="3" rx="1.5" fill="#fff3c8" opacity=".45"/><rect x="188" y="190" width="84" height="3" rx="1.5" fill="#fff3c8" opacity=".3"/>' +
        '<path d="M0 214 Q100 208 200 214 T400 214" stroke="#fff" stroke-width="1.2" fill="none" opacity=".25"/><path d="M0 246 Q100 240 200 246 T400 246" stroke="#fff" stroke-width="1.2" fill="none" opacity=".2"/>' +
        '<path d="M96 172 L190 172 L180 190 L106 190Z" fill="#2b2e55"/><line x1="140" y1="172" x2="140" y2="106" stroke="#2b2e55" stroke-width="3"/><path d="M140 110 L140 168 L98 168Z" fill="#fff"/><path d="M144 120 L144 168 L178 168Z" fill="#ffd1c0"/>' +
        '<path d="M262 200 L330 200 L322 214 L270 214Z" fill="#3a2f58"/><line x1="296" y1="200" x2="296" y2="158" stroke="#3a2f58" stroke-width="2.4"/><path d="M296 162 L296 198 L268 198Z" fill="#fff6f0"/>' +
        '<rect x="0" y="236" width="170" height="10" fill="#4a3a52"/><rect x="14" y="246" width="6" height="54" fill="#33283f"/><rect x="62" y="246" width="6" height="54" fill="#33283f"/><rect x="110" y="246" width="6" height="54" fill="#33283f"/><rect x="154" y="246" width="6" height="54" fill="#33283f"/>' +
        '<path d="M296 70 q6 -8 12 0 q6 -8 12 0" stroke="#4a3a52" stroke-width="2" fill="none"/><path d="M330 92 q5 -7 10 0 q5 -7 10 0" stroke="#4a3a52" stroke-width="2" fill="none"/>');

      // portrait silhouette, portrait
      SC.silhouette = () => svg(300, 380,
        "<defs>" + lg("sbg", [[0, "#19d3c5"], [0.55, "#6a4cff"], [1, "#ff5fa2"]], 0, 0, 1, 1) + rg("sfl", [[0, "#ffffff", 0.7], [1, "#ffffff", 0]]) + "</defs>" +
        '<rect width="300" height="380" fill="url(#sbg)"/><circle cx="70" cy="90" r="110" fill="url(#sfl)"/>' +
        '<circle cx="150" cy="206" r="108" fill="none" stroke="#ffffff" stroke-width="3" opacity=".45"/><circle cx="150" cy="206" r="128" fill="none" stroke="#ffffff" stroke-width="1.5" opacity=".28"/>' +
        '<path d="M20 380 C30 312 80 292 122 278 L178 278 C220 292 270 312 280 380Z" fill="#150f2e"/>' +
        '<path d="M130 248 L170 248 L172 286 L128 286Z" fill="#150f2e"/>' +
        '<ellipse cx="150" cy="204" rx="47" ry="58" fill="#150f2e"/>' +
        '<path d="M102 196 C98 150 124 128 156 130 C190 132 206 160 198 200 C192 168 170 156 140 158 C120 160 108 176 102 196Z" fill="#150f2e"/><circle cx="150" cy="128" r="22" fill="#150f2e"/>' +
        '<path d="M198 190 C204 232 192 262 174 272" stroke="#ff9bd0" stroke-width="3" fill="none" opacity=".85" stroke-linecap="round"/><path d="M262 318 C250 300 232 292 216 286" stroke="#ff9bd0" stroke-width="3" fill="none" opacity=".7" stroke-linecap="round"/>');

      // snowy cabin, portrait
      SC.cabin = () => {
        let st = "";
        for (let i = 0; i < 38; i++) st += '<circle cx="' + (rnd() * 300).toFixed(1) + '" cy="' + (rnd() * 180).toFixed(1) + '" r="' + (0.6 + rnd() * 1.3).toFixed(1) + '" fill="#fff" opacity="' + (0.4 + rnd() * 0.6).toFixed(2) + '"/>';
        return svg(300, 380,
          "<defs>" + lg("csk", [[0, "#0f1c4a"], [0.7, "#3a5bb0"], [1, "#8fb0e8"]]) + lg("csn", [[0, "#dfe9ff"], [1, "#a4b9e6"]]) + rg("cmn", [[0, "#ffffff", 0.7], [1, "#ffffff", 0]]) + rg("cwn", [[0, "#ffc766", 0.8], [1, "#ffc766", 0]]) + "</defs>" +
          '<rect width="300" height="380" fill="url(#csk)"/>' + st + '<circle cx="222" cy="72" r="62" fill="url(#cmn)"/><circle cx="222" cy="72" r="26" fill="#fffbea"/>' +
          '<path d="M0 262 C60 222 140 242 200 252 S280 236 300 244 V380 H0Z" fill="url(#csn)"/>' +
          pine(30, 276, 96, 50, "#1c3d4f") + pine(266, 270, 110, 56, "#1c3d4f") + pine(66, 290, 70, 38, "#244c5e") +
          '<rect x="104" y="250" width="100" height="62" fill="#6b3f2a"/><polygon points="94,254 154,208 214,254" fill="#2a2a44"/><path d="M94 254 L154 208 L214 254 L204 254 L154 218 L104 254Z" fill="#fff"/>' +
          '<rect x="190" y="214" width="12" height="26" fill="#4a2c20"/><rect x="188" y="210" width="16" height="6" fill="#fff"/>' +
          '<ellipse cx="132" cy="276" rx="34" ry="26" fill="url(#cwn)"/><rect x="120" y="266" width="24" height="22" fill="#ffc766"/><line x1="132" x2="132" y1="266" y2="288" stroke="#6b3f2a" stroke-width="2"/>' +
          '<rect x="168" y="270" width="22" height="42" fill="#3d2418"/>' +
          '<path d="M0 316 C80 296 190 322 300 304 V380 H0Z" fill="#f2f6ff"/>' + pine(236, 352, 120, 62, "#173544"));
      };

      /* ---------- card layout ---------- */
      // L = 420x310, P = 310x400. o = cluster offset/rotation, t = edge target (centre px), s = target scale, tr = target rotation, d = burst delay, dr = drift
      const CARDS = [
        { k: "kitchen", o: "L", ox: -60, oy: -34, r: -12, tx: 110, ty: 130, s: 0.72, tr: -10, d: 0.40, dx: 22, dy: 14, dr: 2 },
        { k: "night", o: "L", ox: 60, oy: -44, r: 9, tx: 1860, ty: 500, s: 0.75, tr: -7, d: 0.36, dx: -20, dy: 16, dr: -2 },
        { k: "beach", o: "L", ox: -74, oy: 24, r: -6, tx: 260, ty: 960, s: 0.74, tr: -9, d: 0.32, dx: 18, dy: -16, dr: 2.5 },
        { k: "desert", o: "L", ox: 72, oy: 36, r: 11, tx: 1180, ty: 985, s: 0.7, tr: -5, d: 0.28, dx: -22, dy: -14, dr: -2 },
        { k: "lake", o: "L", ox: -20, oy: -70, r: 5, tx: 500, ty: 40, s: 0.6, tr: 7, d: 0.24, dx: -16, dy: 18, dr: -2 },
        { k: "harbor", o: "L", ox: 24, oy: 70, r: -9, tx: 1300, ty: 60, s: 0.65, tr: 9, d: 0.2, dx: 20, dy: 14, dr: 2 },
        { k: "forest", o: "P", ox: -90, oy: -10, r: 10, tx: 1770, ty: 150, s: 0.72, tr: -8, d: 0.16, dx: -14, dy: 20, dr: -2.5 },
        { k: "cafe", o: "P", ox: 84, oy: -4, r: -4, tx: 690, ty: 1030, s: 0.6, tr: 6, d: 0.12, dx: 16, dy: -18, dr: 2 },
        { k: "silhouette", o: "P", ox: -30, oy: 40, r: -11, tx: 70, ty: 560, s: 0.7, tr: 6, d: 0.08, dx: 12, dy: -22, dr: -2 },
        { k: "cabin", o: "P", ox: 40, oy: -30, r: 7, tx: 900, ty: 100, s: 0.58, tr: -6, d: 0.04, dx: 18, dy: 16, dr: 2 },
        { k: "hallway", o: "P", ox: 0, oy: 0, r: -2, tx: 1660, ty: 940, s: 0.78, tr: 10, d: 0, dx: -20, dy: -16, dr: -2 },
      ];

      const cluster = document.getElementById("cluster");
      CARDS.forEach((c, i) => {
        const w = c.o === "L" ? 420 : 310, h = c.o === "L" ? 310 : 400;
        const el = document.createElement("div");
        el.className = "card";
        el.id = "c" + i;
        el.setAttribute("data-layout-allow-overlap", "");
        el.style.cssText = "left:" + (960 - w / 2) + "px;top:" + (540 - h / 2) + "px;width:" + w + "px;height:" + h + "px;z-index:" + (i + 1);
        el.innerHTML = '<div class="cin">' + SC[c.k]() + "</div>";
        cluster.appendChild(el);
      });

      /* ---------- timeline ---------- */
      const tl = gsap.timeline({ paused: true });
      const EXPO = "expo.out";
      const T_BURST = 3.0, BURST_DUR = 1.15, T_EXIT = 7.0;

      // baseline states
      gsap.set("#cluster", { rotation: -8, scale: 1 });
      CARDS.forEach((c, i) => gsap.set("#c" + i, { x: c.ox, y: c.oy + 44, rotation: c.r + 9, scale: 0.84 }));
      gsap.set(".w", { y: 30 });
      gsap.set("#mark", { scale: 0.6 });
      gsap.set(".bar", { scaleY: 0.1, svgOrigin: "32 32" });
      gsap.set("#word", { y: 24 });
      gsap.set("#tag", { y: 12 });

      // slow background drift
      tl.to("#blobs", { x: -46, y: 24, duration: 11, ease: "sine.inOut" }, 0);

      // beat 1: the cluster builds, turns slowly, breathes, and shuffles
      CARDS.forEach((c, i) => {
        tl.to("#c" + i, { opacity: 1, x: c.ox, y: c.oy, rotation: c.r, scale: 1, duration: 0.85, ease: EXPO }, i * 0.05);
      });
      tl.to("#cluster", { rotation: 0, duration: T_BURST, ease: "power1.inOut" }, 0);
      tl.to("#cluster", { scale: 1.05, duration: 1.4, ease: "sine.inOut" }, 0);
      tl.to("#cluster", { scale: 0.94, duration: 1.6, ease: "sine.inOut" }, 1.4);
      tl.to("#cluster", { scale: 1, duration: 0.6, ease: "power2.out" }, T_BURST);

      // shuffle 1: the cafe card lifts out and drops back on top
      const c7 = CARDS[7];
      tl.to("#c7", { x: c7.ox + 70, y: c7.oy - 120, rotation: c7.r + 8, scale: 1.05, duration: 0.3, ease: "power2.out" }, 1.5);
      tl.set("#c7", { zIndex: 60 }, 1.8);
      tl.to("#c7", { x: 10, y: 6, rotation: 3, scale: 1, duration: 0.45, ease: "power2.inOut" }, 1.8);
      // shuffle 2: the night street card
      const c1 = CARDS[1];
      tl.to("#c1", { x: c1.ox - 90, y: c1.oy - 96, rotation: c1.r - 8, scale: 1.05, duration: 0.3, ease: "power2.out" }, 2.1);
      tl.set("#c1", { zIndex: 61 }, 2.4);
      tl.to("#c1", { x: -6, y: -4, rotation: -4, scale: 1, duration: 0.45, ease: "power2.inOut" }, 2.4);

      // beat 2: dispersal to the frame edges, then a slow drift; beat 4 exit
      CARDS.forEach((c, i) => {
        const id = "#c" + i;
        const t0 = T_BURST + c.d, tEnd = t0 + BURST_DUR;
        tl.to(id, { x: c.tx - 960, y: c.ty - 540, rotation: c.tr, scale: c.s, duration: BURST_DUR, ease: "power3.out" }, t0);
        tl.to(id, { x: "+=" + c.dx, y: "+=" + c.dy, rotation: "+=" + c.dr, duration: T_EXIT - tEnd, ease: "none" }, tEnd);
        const vx = c.tx - 960, vy = c.ty - 540, len = Math.sqrt(vx * vx + vy * vy);
        const ex = (vx / len) * 760, ey = (vy / len) * 760;
        tl.to(id, { x: "+=" + ex.toFixed(1), y: "+=" + ey.toFixed(1), rotation: "+=" + (c.dr > 0 ? 8 : -8), opacity: 0, duration: 0.65, ease: "power2.in" }, T_EXIT + (CARDS.length - 1 - i) * 0.025);
      });

      // beat 3: headline settles in the cleared centre
      tl.to(".w", { opacity: 1, y: 0, duration: 0.8, ease: EXPO, stagger: 0.09 }, 3.75);
      tl.to(".w", { opacity: 0, y: -22, duration: 0.45, ease: "power2.in", stagger: 0.03 }, T_EXIT);

      // lockup
      tl.to("#mark", { opacity: 1, scale: 1, duration: 0.7, ease: EXPO }, 7.95);
      tl.to(".bar", { scaleY: 1, duration: 0.5, ease: EXPO, stagger: 0.05 }, 8.2);
      tl.to("#word", { opacity: 1, y: 0, duration: 0.65, ease: EXPO }, 8.05);
      tl.to("#tag", { opacity: 1, y: 0, duration: 0.55, ease: EXPO }, 8.15);

      tl.set({}, {}, 11);

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