TITLE: Metamorphosis — The Closing Note PROMPT: Build the finale of the collection as a single-file full-viewport canvas particle piece with a five-state machine: scatter, assemble, flap, dissolve, fin. Use ~1100 particles, each holding a butterfly target in normalised space (nx, ny), a seed, an alpha, a size, a base sprite and a bright sprite, plus a random switch threshold. The butterfly silhouette comes from two hand-authored closed polygons - a forewing and a rounder hindwing - sampled by rejection with a point-in-polygon test, mirrored to both sides; add an elliptical body and two quadratic-bezier antennae. Colour the forewing by |x| interpolated from violet #a78bfa to pink #f472b6, the hindwing deeper violet, the polygon-boundary particles gold #fde68a, the body white, and a ring of 110 dust particles orbiting outside the wings. Render every particle as an additive drawImage of a 48px radial-gradient sprite with globalCompositeOperation 'lighter', using a small colour LUT (9 violet-to-pink steps plus gold, body and dust sprites) so only ~16 sprites exist. Flap by scaling each target's x by 0.24 + 0.76*|cos(phase)| and shearing y with sin(phase)*|nx|. Dissolve to a wide starfield, then resolve the word "fin" by rendering the text into a 900x320 offscreen canvas with Georgia, reading its pixels with getImageData, and assigning 66% of the particles to sampled glyph points while the rest scatter as stars. Motion is a spring toward the target (k 0.9 scatter, 3.4 assemble, 4.4 elsewhere) with damping, per-particle sine noise and pointer repulsion. Palette: #05060d, #a78bfa, #f472b6, #fde68a, #f8fafc. DESCRIPTION: The last page of the gallery: a swarm of over a thousand glowing motes converges into a butterfly, holds and flaps while a violet bloom pulses behind it, then bursts apart into a starfield that re-forms as the word "fin". The wings are built from two sampled polygons so the silhouette reads immediately - big sweeping forewings, rounder hindwings, a bright white body, gold antennae and a slowly orbiting halo of dust. Colour runs from violet at the body to hot pink at the wingtips, with gold along the wing edges. The interface is three lines of monospace text and one replay button, all visible from the first frame. TECHNIQUES: Per-particle target assignment from parametric wing polygons via rejection sampling; spring-damper integration with per-particle sine noise; state machine scatter - assemble - flap - dissolve - fin with cross-faded colour mixing; additive sprite blitting with a small pre-rendered sprite LUT instead of per-particle gradients; wing flap as an x-axis compression of the target set plus a vertical shear; offscreen canvas text rasterisation and getImageData sampling to turn "fin" into particle targets; DPR-aware canvas sizing; halo particles on an independent rotating orbit. INTERACTION: Clicking anywhere scatters the swarm outward and restarts the sequence from the scatter state. Holding and dragging swirls the particles tangentially around the pointer at up to 260px radius. Simply moving the pointer repels particles within 140px, so the butterfly dents around the cursor and springs back. The Replay button resets every particle to a random position and restarts the state machine from scatter. The phase readout names the current state and the title turns gold when the sequence reaches "fin". With prefers-reduced-motion the piece boots directly into the resolved "fin" state with minimal drift instead of running the full animation.