I want an animated explainer made in the "ISOTYPE Pictograms" visual style (Data & Information), timed to my voiceover. Below is the complete source code of a reference animation in this exact style, plus a small sound-effects kit. Use them as your style guide and rebuild it around my content.

MY CONTENT:
[Describe your topic, or paste your script here. If this is left as is, ask me for it before building.]

MY VOICEOVER TIMING:
[Paste the SRT, or word-level timestamps, of your voiceover here. If this is left as is, ask me for them before building.]
(If I also attached the voiceover audio file, that's fine: take the timing from the text above, and if you can work with files, use that audio as the voiceover when rendering. If there is no timing above but you can transcribe the attached audio with word-level timestamps, do that instead of asking me.)


STORYBOARD FIRST: before building the animation, make a VISUAL storyboard and wait for my OK.
- One HTML page (show it as an artifact if you can) with a grid of panels, one per beat (about 6-10). Each panel is a canvas showing that beat's key frame drawn in this style: use the H library and the reference's own drawing, texture and finishing functions so the panels already look like the finished piece. Still frames only, no animation or sound yet.
- Under each panel: the beat number, its start and end time (taken from the voiceover timing), the exact on-screen text, how it gets there from the previous panel (continuous: which elements carry over and how they move or change; or a scene change: which transition, and why the story wants one), and its key sounds.
- Below the grid, list any facts or numbers you had to assume.
When I approve it (or after my changes), build the full animation exactly as storyboarded, reusing the storyboard's drawing code.

WHAT TO BUILD
One self-contained HTML file (show it as an artifact if you can):
- A 1280x720 canvas, scaled to fit the window with letterboxing, and a small control bar: play/pause, a scrub slider, the current time, a sound on/off toggle, and loop on by default.
- A "Load voiceover" button (a file input, and also accept drag-and-drop of an audio file). Once a file is loaded, the audio is the clock: play, pause and scrub control the audio element, and the canvas draws at audio.currentTime. Without a file, it runs on its own clock.
- A new `explainer(ctx, W, H_, t)` that tells MY CONTENT in this style. Set DURATION to the end of the last voiceover line plus about 1 second.
- A `scoreSound(k)` function that schedules the sound effects with the SOUND kit below (see SOUND). Play it in sync from the player: on play call `stopSound = SOUND.live(scoreSound, currentT, { voiceover: true })`, and call `stopSound()` on pause, on seek and when the sound toggle is turned off.
- Include the H helper library and the SOUND kit below unchanged, and keep the reference's own helper functions where they are useful.
- Load these Google Fonts before the first draw (await document.fonts.load for each spec you use): Space Grotesk
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;700&display=block">
- Expose `window.seek = (t) => { /* draw frame at time t */ }`, `window.DURATION` and `window.scoreSound`, so the animation can be rendered frame by frame to video later.

HOW TO STAY IN THE STYLE
- Reuse the reference's rendering techniques, palette, textures, lettering, line quality, arrows, labels, number treatment, transitions and timing feel. Change the story, the text and the things being drawn; do not change the medium.
- Draw every subject accurately for my topic. Don't carry over the reference's props and drawing recipes (its characters, robots, cats and dogs, rings, icons) unless they genuinely fit, and double-check that the science and facts shown in the visuals are right.
- The surface texture and finishing passes are what make the style read as the real medium (paper grain, ink pooling, misregistration, grain, glow, scanlines and so on). Copy those functions from the reference and run them on every frame at the same strength. Don't simplify or skip them to save effort.
- Every frame is a pure function of t: create all randomness from H.rng(seed) / H.makeNoise(seed) inside the draw (never Math.random), so the same t always gives the same frame. Caching static textures across frames is fine.
- It is video, often watched on a phone: at 1280x720 keep headlines >= 44px, every label or caption the story depends on >= 28px (including small annotations and the corner header), key numbers >= 64px, and frame each beat so it fills most of the screen. Keep frames fast (well under 100 ms each if you can).
- In the reference, `explainer()` is the explainer (it explains "How does AI learn?"), `draw()` is the single hero frame of the style, and `explainerSound(k)` is its sound design. Study them, but do not reuse that topic unless my content asks for it.

TIMING FROM THE VOICEOVER
- First turn my voiceover timing into a BEATS table: one entry per idea, with its start and end time, the words spoken, and what is on screen. Every animation reads its times from BEATS (and from word times when you need an exact reveal), never from numbers scattered through the code, so a new take only means editing the table.
- A visual lands on the word it illustrates: a number appears as it is spoken, a label as its name is said. It can lead the word by up to 0.2 s, but never lag it.
- Within a beat, keep building that one idea while the voice explains it, then hold the finished state until the sentence ends instead of rushing ahead. When the picture does need to change (see FLOW BETWEEN BEATS), use pauses in the speech for it.
- On-screen text is key words, labels and numbers only. Don't print the sentence being spoken, and no subtitles (captions get added in editing).
- Start the hook as the first line is spoken, and end about 1 second after the last word, on the takeaway.

FLOW BETWEEN BEATS
- Decide beat by beat what the story needs. A new beat does not automatically mean a new scene.
- When the next idea builds on the last, keep it continuous: elements that matter stay on screen and move, grow, re-arrange or transform into the next idea (a label becomes the next heading, a counter grows into a chart, the camera travels to a new part of the same scene, a shape morphs into the next one).
- When the story really moves on (a new topic, a jump in time or place, a before/after contrast, a reveal), a full scene change is the right call. Do it the medium's own way, as the reference does.
- Aim for a mix that fits the content, not a rule: avoid both a hard cut on every beat and forcing everything into one unbroken shot. The reference's own transitions show how this medium changes scene; its scene count is not a template to copy.

SOUND (voiceover mode: the narration stays on top, the effects keep the piece feeling alive underneath)
- Score it as fully as a standalone explainer: the events that land (pops, labels, arrows completing, transitions, a wrong/right moment, the key number, the takeaway), and the medium's drawing, typing or printing sounds while things draw on.
- Mark the small, frequent sounds { minor: true } (per-word strokes, ticks, taps, typing, small pops), or schedule custom ones inside k.withMinor(() => ...). In voiceover mode the kit plays those at about 60% volume, drops ambience beds and music, and sets everything a little lower, so call SOUND.kit / SOUND.live with { voiceover: true }.
- Keep the big hits (the key reveal, the wrong/right moment, the takeaway) full volume, and where you can, put them in pauses or on stressed words rather than on top of a sentence.
- Sync: a sound starts on the exact frame its event appears, using the same BEATS times as the picture.
- Medium-true sounds: pick from the kit what this medium would make (surface sounds for hand-made styles, presses and paper for print, chip sounds for retro games, clicks and hums for screens).


If you are Claude Code with a shell: render an MP4 by loading the file in headless Chrome (e.g. puppeteer), calling window.seek(i/30) for each frame, capturing the canvas and piping the frames into ffmpeg. Render the effects to a WAV with `SOUND.renderOffline(window.scoreSound, DURATION, 48000, { voiceover: true })` (it returns interleaved stereo floats) and mux it in. Mix in the voiceover with the effects ducked under it:
ffmpeg -i video.mp4 -i voice.wav -i effects.wav -filter_complex "[1:a]loudnorm=I=-17:TP=-2,asplit=2[v1][v2];[2:a]loudnorm=I=-26:TP=-4:LRA=20[fx0];[fx0][v1]sidechaincompress=threshold=0.05:ratio=3:attack=10:release=250[fx];[v2][fx]amix=inputs=2:normalize=0,loudnorm=I=-16:TP=-1.5:LRA=11[a]" -map 0:v -map "[a]" -c:v copy -c:a aac -b:a 160k out.mp4

STYLE CARD
Name: ISOTYPE Pictograms
Family: Data & Information
Look: Vienna Method pictorial statistics: rows of identical flat pictograms where each symbol is a fixed quantity, partial symbols for remainders, three muted litho inks on a strict grid with geometric sans lettering.
Motion: Title and key set first, the year column drops in, then symbols are stamped out row by row from the centre in stepped, rubber-stamp timing, the 2025 row of machines racing ahead; the litho paper breathes in the hold.
How it explains: A Vienna-Method picture-statistic told across one long chart sheet the camera pans along: symbols are stamped in stepped 12 fps timing, flat Isotype arrows show flow, numerals are stamped and re-stamped, and accuracy is counted in rows of tick symbols with partial symbols for fractions.

H HELPER LIBRARY (lib/harness.js; the registerStyle/H.render parts are only needed by the original gallery)
```js
// Shared helpers + style registry for the style-frame explorations.
// Every style is a pure function of time: draw(ctx, W, H, t). Same t => same pixels.
(function () {
  const STYLES = (window.STYLES = window.STYLES || []);
  window.registerStyle = (s) => STYLES.push(s);

  const H = (window.H = {});

  // ---------- seeded randomness ----------
  // H.rng(seed) -> r() in [0,1). Extras: r.range(a,b), r.int(a,b), r.pick(arr), r.gauss(), r.chance(p)
  H.rng = function (seed = 1) {
    let a = typeof seed === 'string' ? hashStr(seed) : (seed >>> 0) || 1;
    const r = 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;
    };
    r.range = (lo, hi) => lo + r() * (hi - lo);
    r.int = (lo, hi) => Math.floor(lo + r() * (hi - lo + 1));
    r.pick = (arr) => arr[Math.floor(r() * arr.length)];
    r.chance = (p) => r() < p;
    r.gauss = () => { let u = 0, v = 0; while (!u) u = r(); while (!v) v = r(); return Math.sqrt(-2 * Math.log(u)) * Math.cos(2 * Math.PI * v); };
    return r;
  };
  function hashStr(s) { let h = 2166136261; for (let i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 16777619); } return h >>> 0; }

  // ---------- gradient noise ----------
  // H.makeNoise(seed) -> { n2(x,y), n3(x,y,z), fbm2(x,y,oct), fbm3(x,y,z,oct) }  (outputs roughly -1..1)
  H.makeNoise = function (seed = 1) {
    const r = H.rng(seed), p = new Uint8Array(512), perm = [...Array(256).keys()];
    for (let i = 255; i > 0; i--) { const j = Math.floor(r() * (i + 1)); [perm[i], perm[j]] = [perm[j], perm[i]]; }
    for (let i = 0; i < 512; i++) p[i] = perm[i & 255];
    const fade = (t) => t * t * t * (t * (t * 6 - 15) + 10);
    const lerp = (a, b, t) => a + (b - a) * t;
    const g3 = (h, x, y, z) => { h &= 15; const u = h < 8 ? x : y, v = h < 4 ? y : h === 12 || h === 14 ? x : z; return ((h & 1) ? -u : u) + ((h & 2) ? -v : v); };
    function n3(x, y, z) {
      const X = Math.floor(x) & 255, Y = Math.floor(y) & 255, Z = Math.floor(z) & 255;
      x -= Math.floor(x); y -= Math.floor(y); z -= Math.floor(z);
      const u = fade(x), v = fade(y), w = fade(z);
      const A = p[X] + Y, AA = p[A] + Z, AB = p[A + 1] + Z, B = p[X + 1] + Y, BA = p[B] + Z, BB = p[B + 1] + Z;
      return lerp(lerp(lerp(g3(p[AA], x, y, z), g3(p[BA], x - 1, y, z), u), lerp(g3(p[AB], x, y - 1, z), g3(p[BB], x - 1, y - 1, z), u), v),
        lerp(lerp(g3(p[AA + 1], x, y, z - 1), g3(p[BA + 1], x - 1, y, z - 1), u), lerp(g3(p[AB + 1], x, y - 1, z - 1), g3(p[BB + 1], x - 1, y - 1, z - 1), u), v), w);
    }
    const n2 = (x, y) => n3(x, y, 0.5);
    const fbm3 = (x, y, z, oct = 4) => { let s = 0, a = 0.5, f = 1, norm = 0; for (let i = 0; i < oct; i++) { s += a * n3(x * f, y * f, z * f); norm += a; a *= 0.5; f *= 2; } return s / norm; };
    const fbm2 = (x, y, oct = 4) => fbm3(x, y, 0.5, oct);
    return { n2, n3, fbm2, fbm3 };
  };

  // ---------- math ----------
  H.lerp = (a, b, t) => a + (b - a) * t;
  H.clamp = (v, lo = 0, hi = 1) => Math.max(lo, Math.min(hi, v));
  H.map = (v, a, b, c, d) => c + ((v - a) / (b - a)) * (d - c);
  H.smooth = (e0, e1, x) => { const t = H.clamp((x - e0) / (e1 - e0)); return t * t * (3 - 2 * t); };
  H.ease = {
    inOut: (t) => (t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2),
    out: (t) => 1 - Math.pow(1 - t, 3),
    in: (t) => t * t * t,
    back: (t) => { const c = 1.70158; return 1 + (c + 1) * Math.pow(t - 1, 3) + c * Math.pow(t - 1, 2); },
  };

  // ---------- color ----------
  H.hex = (h) => { h = h.replace('#', ''); if (h.length === 3) h = h.split('').map((c) => c + c).join(''); const n = parseInt(h, 16); return [(n >> 16) & 255, (n >> 8) & 255, n & 255]; };
  H.rgba = (hexOrArr, a = 1) => { const [r, g, b] = Array.isArray(hexOrArr) ? hexOrArr : H.hex(hexOrArr); return `rgba(${r | 0},${g | 0},${b | 0},${a})`; };
  H.mix = (c1, c2, t) => { const a = Array.isArray(c1) ? c1 : H.hex(c1), b = Array.isArray(c2) ? c2 : H.hex(c2); return [0, 1, 2].map((i) => a[i] + (b[i] - a[i]) * t); };

  // ---------- canvas utilities ----------
  // Offscreen canvas of the same logical size (use for layers, masks, compositing).
  H.layer = (W, H_, ) => { const c = document.createElement('canvas'); c.width = W; c.height = H_; return c; };
  // Monochrome grain / film noise over the whole canvas. amount ~ 0.03-0.15
  H.grain = function (ctx, W, Hh, amount = 0.08, seed = 7, mono = true) {
    const img = ctx.getImageData(0, 0, ctx.canvas.width, ctx.canvas.height), d = img.data, r = H.rng(seed), k = amount * 255;
    for (let i = 0; i < d.length; i += 4) {
      const n = (r() - 0.5) * k;
      if (mono) { d[i] += n; d[i + 1] += n; d[i + 2] += n; }
      else { d[i] += (r() - 0.5) * k; d[i + 1] += (r() - 0.5) * k; d[i + 2] += (r() - 0.5) * k; }
    }
    ctx.putImageData(img, 0, 0);
  };
  // Paper-ish texture tile: fills with base color + fibrous noise (cheap; drawn into ctx).
  H.paper = function (ctx, W, Hh, base = '#f3ecdc', seed = 3, strength = 0.06) {
    ctx.save(); ctx.fillStyle = base; ctx.fillRect(0, 0, W, Hh);
    const nz = H.makeNoise(seed), cell = 4, [br, bg, bb] = H.hex(base);
    for (let y = 0; y < Hh; y += cell) for (let x = 0; x < W; x += cell) {
      const v = nz.fbm2(x * 0.01, y * 0.01, 3) * 0.6 + nz.n2(x * 0.15, y * 0.04) * 0.4;
      const s = 1 + v * strength * 2;
      ctx.fillStyle = `rgb(${br * s | 0},${bg * s | 0},${bb * s | 0})`; ctx.fillRect(x, y, cell, cell);
    }
    ctx.restore();
  };
  // Vignette
  H.vignette = function (ctx, W, Hh, strength = 0.5, color = '0,0,0') {
    const g = ctx.createRadialGradient(W / 2, Hh / 2, Math.min(W, Hh) * 0.3, W / 2, Hh / 2, Math.hypot(W, Hh) * 0.6);
    g.addColorStop(0, `rgba(${color},0)`); g.addColorStop(1, `rgba(${color},${strength})`);
    ctx.save(); ctx.fillStyle = g; ctx.fillRect(0, 0, W, Hh); ctx.restore();
  };

  // ---------- rendering entry ----------
  // Renders style into canvas at logical 1280x720 (canvas can be any pixel size; it is scaled).
  H.W = 1280; H.H = 720;
  H.loadFonts = async function (style) {
    const specs = style.fonts || [];
    try { const sample = 'AaZz09' + (window.FONT_SAMPLE || '');
      await Promise.all(specs.map((f) => document.fonts.load(f, sample))); await document.fonts.ready; } catch (e) { /* render anyway */ }
  };
  H.render = function (style, canvas, t) {
    const ctx = canvas.getContext('2d', { willReadFrequently: !!style.readsPixels });
    const sx = canvas.width / H.W, sy = canvas.height / H.H;
    ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.globalAlpha = 1; ctx.globalCompositeOperation = 'source-over'; ctx.filter = 'none';
    ctx.clearRect(0, 0, canvas.width, canvas.height);
    ctx.save(); ctx.scale(sx, sy);
    style.draw(ctx, H.W, H.H, t == null ? style.frameT || 0 : t);
    ctx.restore();
  };
})();
```

SOUND KIT (lib/sound.js)
```js
// sound.js: a small synthesized sound kit for the style explainers. Plain Web Audio, no audio files.
// Voiceover mode: SOUND.kit(ctx, { voiceover: true }) drops beds and music, plays anything marked minor
// (play(..., { minor: true }), tone/noise { minor: true }, or scheduled inside k.withMinor(() => ...)) at about 60%
// volume instead of full, and sits all effects a little lower, so the narration stays on top while the piece still
// sounds alive. In the full mix, minor sounds play at full volume. Scores can read k.vo to branch further.
// A style adds   explainerSound(k) { k.bed('room', 0, D); k.play('pop', 1.25); ... }   and the same
// call schedules into a live AudioContext (the player) or an OfflineAudioContext (the video render).
// Times are seconds on the explainer's own clock. Randomness is seeded, so every render is identical.
(function () {
  'use strict';
  const SOUND = (window.SOUND = {});
  const TINY = 1e-4;

  // seeded random in [0,1), keyed by any string
  function rand(key) {
    let h = 2166136261;
    for (let i = 0; i < key.length; i++) { h ^= key.charCodeAt(i); h = Math.imul(h, 16777619); }
    let a = h >>> 0 || 1;
    return () => { 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; };
  }

  // note names to Hz: 'A4' = 440, 'C#5', 'Eb3'
  const STEP = { C: 0, D: 2, E: 4, F: 5, G: 7, A: 9, B: 11 };
  function hz(n) {
    if (typeof n === 'number') return n;
    const m = /^([A-G])([#b]?)(-?\d)$/.exec(n);
    const semis = STEP[m[1]] + (m[2] === '#' ? 1 : m[2] === 'b' ? -1 : 0) + (Number(m[3]) - 4) * 12 - 9;
    return 440 * Math.pow(2, semis / 12);
  }
  SOUND.hz = hz;

  SOUND.kit = function (ctx, opts) {
    const o = opts || {};
    const VO = !!o.voiceover;
    const MINOR = 0.6; // voiceover-mode volume for minor sounds
    let inMinor = false;
    const gainOf = (p, d) => (p.gain == null ? d : p.gain) * (VO && (p.minor || inMinor) ? MINOR : 1);
    const T0 = (o.start || 0) - 0; // explainer time that maps to ctx time `base`
    const base = ctx.currentTime + (o.delay || 0);
    // Start times snap to the sample grid (+ a quarter sample): in Chrome a source started a hair off the grid can
    // spike to about twice its set level.
    const SR = ctx.sampleRate;
    const at = (t) => (Math.round((base + (t - T0)) * SR) + 0.25) / SR;

    // ---- buses: sfx, amb, music -> compressor -> master; one shared reverb send
    const master = ctx.createGain(); master.gain.value = o.master == null ? 0.9 : o.master;
    const comp = ctx.createDynamicsCompressor();
    comp.threshold.value = -16; comp.knee.value = 8; comp.ratio.value = 3; comp.attack.value = 0.004; comp.release.value = 0.18;
    comp.connect(master); master.connect(o.dest || ctx.destination);
    const bus = {};
    for (const [name, g] of Object.entries({ sfx: VO ? 0.7 : 0.85, amb: 0.5, music: 0.45 })) { bus[name] = ctx.createGain(); bus[name].gain.value = g; bus[name].connect(comp); }

    // generated room reverb: decaying stereo noise, darker toward the tail
    const verb = ctx.createConvolver();
    {
      const secs = 1.6, n = Math.floor(secs * ctx.sampleRate), ir = ctx.createBuffer(2, n, ctx.sampleRate);
      for (let c = 0; c < 2; c++) {
        const r = rand('verb' + c), d = ir.getChannelData(c); let lp = 0;
        for (let i = 0; i < n; i++) { const u = i / n; lp += (0.6 - 0.45 * u) * ((r() * 2 - 1) - lp); d[i] = lp * Math.pow(1 - u, 3); }
      }
      verb.buffer = ir;
    }
    const verbIn = ctx.createGain(); verbIn.gain.value = 0.9; verbIn.connect(verb); verb.connect(comp);

    // seeded noise buffers: white, pink-ish and brown
    const noiseBuf = {};
    {
      const n = Math.floor(2.5 * ctx.sampleRate);
      for (const kind of ['white', 'pink', 'brown']) {
        const b = ctx.createBuffer(1, n, ctx.sampleRate), d = b.getChannelData(0), r = rand('noise-' + kind);
        let p0 = 0, p1 = 0, p2 = 0, br = 0;
        for (let i = 0; i < n; i++) {
          const w = r() * 2 - 1;
          if (kind === 'white') d[i] = w;
          else if (kind === 'pink') { p0 = 0.997 * p0 + 0.029 * w; p1 = 0.985 * p1 + 0.032 * w; p2 = 0.95 * p2 + 0.048 * w; d[i] = (p0 + p1 + p2 + w * 0.05) * 2.2; }
          else { br = (br + 0.02 * w) / 1.02; d[i] = br * 3.2; }
        }
        noiseBuf[kind] = b;
      }
    }

    // ---- automation helpers
    // a value or [[dt, value], ...] from the voice start; ramps are exponential (frequencies)
    function sweep(param, v, t) {
      if (!Array.isArray(v)) { param.setValueAtTime(v, t); return; }
      param.setValueAtTime(v[0][1], t + v[0][0]);
      for (let i = 1; i < v.length; i++) param.exponentialRampToValueAtTime(Math.max(v[i][1], 1), t + v[i][0]);
    }
    // amplitude: linear attack to `gain`, optional hold, exponential release to silence by `dur`
    function shape(param, t, gain, dur, a, hold) {
      a = Math.min(a == null ? 0.004 : a, dur * 0.9);
      hold = Math.min(hold || 0, dur - a);
      param.setValueAtTime(0, t);
      param.linearRampToValueAtTime(gain, t + a);
      if (hold > 0) param.setValueAtTime(gain, t + a + hold);
      param.exponentialRampToValueAtTime(TINY, t + dur);
      param.setValueAtTime(0, t + dur + 0.001);
    }
    function out(node, p) {
      const pan = ctx.createStereoPanner(); pan.pan.value = Math.max(-1, Math.min(1, p.pan || 0));
      node.connect(pan); pan.connect(bus[p.bus || 'sfx']);
      if (p.verb) { const s = ctx.createGain(); s.gain.value = p.verb; pan.connect(s); s.connect(verbIn); }
    }
    function filterNode(p, t) {
      if (!p.filter) return null;
      const f = ctx.createBiquadFilter(); f.type = p.filter; f.Q.value = p.q == null ? 1 : p.q;
      sweep(f.frequency, p.f == null ? 1000 : p.f, t);
      return f;
    }

    // ---- primitives
    // tone(t, { f, type, dur, gain, a, hold, pan, verb, bus, filter, f2 (filter freq), q, detune })
    function tone(time, p) {
      const t = at(time), dur = p.dur || 0.2;
      if (t + dur < ctx.currentTime || (time < T0 - 0.001 && dur < 1.5)) return;
      const osc = ctx.createOscillator(); osc.type = p.type || 'sine';
      sweep(osc.frequency, Array.isArray(p.f) ? p.f.map(([d, v]) => [d, hz(v)]) : hz(p.f || 440), t);
      if (p.detune) osc.detune.value = p.detune;
      const g = ctx.createGain(); shape(g.gain, t, gainOf(p, 0.3), dur, p.a, p.hold);
      let node = osc;
      if (p.filter) { const f = ctx.createBiquadFilter(); f.type = p.filter; f.Q.value = p.q == null ? 0.8 : p.q; sweep(f.frequency, p.f2 || 2000, t); osc.connect(f); node = f; }
      node.connect(g); out(g, p);
      osc.start(t); osc.stop(t + dur + 0.02);
    }
    // noise(t, { dur, color, filter, f, q, gain, a, hold, pan, verb, bus, rate })
    function noise(time, p) {
      const t = at(time), dur = p.dur || 0.2;
      if (t + dur < ctx.currentTime || (time < T0 - 0.001 && dur < 1.5)) return;
      const src = ctx.createBufferSource(); src.buffer = noiseBuf[p.color || 'white']; src.loop = true;
      if (p.rate) src.playbackRate.value = p.rate;
      const g = ctx.createGain(); shape(g.gain, t, gainOf(p, 0.3), dur, p.a, p.hold);
      const f = filterNode(p, t);
      if (f) { src.connect(f); f.connect(g); } else src.connect(g);
      out(g, p);
      const off = rand('off' + time + (p.f || ''))() * 2;
      src.start(t, off); src.stop(t + dur + 0.02);
    }

    // ---- named sounds. play(name, t, opts): opts.gain scales the whole sound, opts.pan places it.
    const S = {
      // UI / motion graphics
      pop: (t, o) => { tone(t, { f: [[0, o.f || 620], [0.07, (o.f || 620) * 0.45]], dur: 0.1, gain: 0.32 * o.g, pan: o.pan }); noise(t, { dur: 0.012, filter: 'highpass', f: 3000, gain: 0.12 * o.g, pan: o.pan }); },
      tick: (t, o) => noise(t, { dur: 0.018, filter: 'bandpass', f: o.f || 4200, q: 2.5, gain: 0.3 * o.g, pan: o.pan }),
      click: (t, o) => { tone(t, { f: o.f || 1900, type: 'square', dur: 0.02, gain: 0.08 * o.g, filter: 'lowpass', f2: 3000, pan: o.pan }); noise(t, { dur: 0.01, filter: 'highpass', f: 2500, gain: 0.15 * o.g, pan: o.pan }); },
      tock: (t, o) => { tone(t, { f: o.f || 820, dur: 0.07, gain: 0.25 * o.g, pan: o.pan }); noise(t, { dur: 0.05, filter: 'bandpass', f: o.f || 820, q: 9, gain: 0.35 * o.g, pan: o.pan }); },
      blip: (t, o) => tone(t, { f: o.f || 'E6', type: o.type || 'square', dur: o.dur || 0.07, gain: 0.07 * o.g, a: 0.002, hold: (o.dur || 0.07) * 0.6, pan: o.pan }),
      whoosh: (t, o) => { const d = o.dur || 0.45; noise(t, { dur: d, color: 'pink', filter: 'bandpass', f: [[0, 350], [d * 0.55, o.top || 2600], [d, 700]], q: 0.9, gain: 0.32 * o.g, a: d * 0.5, pan: o.pan, verb: 0.15 }); },
      swish: (t, o) => { const d = o.dur || 0.18; noise(t, { dur: d, filter: 'highpass', f: [[0, 1800], [d, 5200]], q: 0.7, gain: 0.22 * o.g, a: d * 0.35, pan: o.pan }); },
      riser: (t, o) => { const d = o.dur || 0.8; noise(t, { dur: d, color: 'pink', filter: 'bandpass', f: [[0, 300], [d, 4000]], q: 1.2, gain: 0.25 * o.g, a: d * 0.95, pan: o.pan, verb: 0.2 }); tone(t, { f: [[0, 180], [d, 720]], type: 'triangle', dur: d, gain: 0.06 * o.g, a: d * 0.9 }); },
      thud: (t, o) => { tone(t, { f: [[0, o.f || 130], [0.16, 42]], dur: 0.26, gain: 0.55 * o.g, pan: o.pan }); noise(t, { dur: 0.09, color: 'brown', filter: 'lowpass', f: 500, gain: 0.35 * o.g, pan: o.pan }); },
      impact: (t, o) => { S.thud(t, o); noise(t, { dur: 0.7, color: 'pink', filter: 'lowpass', f: [[0, 2400], [0.6, 300]], gain: 0.3 * o.g, verb: 0.35, pan: o.pan }); },
      stamp: (t, o) => { S.thud(t, { ...o, f: 160 }); noise(t, { dur: 0.05, filter: 'bandpass', f: 1300, q: 1.2, gain: 0.4 * o.g, pan: o.pan }); noise(t + 0.004, { dur: 0.012, filter: 'highpass', f: 3500, gain: 0.25 * o.g, pan: o.pan }); },
      ding: (t, o) => { const f = hz(o.f || 'E6'); tone(t, { f, dur: 1.3, gain: 0.2 * o.g, verb: 0.3, pan: o.pan }); tone(t, { f: f * 2.76, dur: 0.5, gain: 0.05 * o.g, verb: 0.3, pan: o.pan }); },
      success: (t, o) => { S.ding(t, { ...o, f: o.f || 'C6' }); S.ding(t + 0.09, { ...o, f: hz(o.f || 'C6') * 1.5, g: o.g * 0.9 }); },
      error: (t, o) => { tone(t, { f: o.f || 'A3', type: 'square', dur: 0.13, gain: 0.09 * o.g, hold: 0.08, filter: 'lowpass', f2: 1400, pan: o.pan }); tone(t + 0.15, { f: hz(o.f || 'A3') * 0.8, type: 'square', dur: 0.22, gain: 0.09 * o.g, hold: 0.14, filter: 'lowpass', f2: 1200, pan: o.pan }); },
      buzz: (t, o) => { const d = o.dur || 0.3; tone(t, { f: o.f || 110, type: 'sawtooth', dur: d, gain: 0.12 * o.g, hold: d * 0.7, filter: 'lowpass', f2: 900, pan: o.pan }); tone(t, { f: (o.f || 110) * 1.01, type: 'sawtooth', dur: d, gain: 0.1 * o.g, hold: d * 0.7, filter: 'lowpass', f2: 900, pan: o.pan }); },
      sparkle: (t, o) => { const r = rand('sparkle' + t), notes = ['C6', 'D6', 'E6', 'G6', 'A6', 'C7']; for (let i = 0; i < (o.n || 6); i++) { const ti = t + i * 0.04 + r() * 0.01, f = hz(notes[Math.floor(r() * notes.length)]), pan = r() * 1.2 - 0.6; tone(ti, { f, dur: 0.6, gain: 0.04 * o.g, a: 0.002, verb: 0.35, pan }); tone(ti, { f: f * 2.76, dur: 0.2, gain: 0.012 * o.g, a: 0.002, pan }); } },
      glitch: (t, o) => { const r = rand('glitch' + t); for (let i = 0; i < 7; i++) tone(t + i * 0.022, { f: 200 + r() * 1800, type: 'square', dur: 0.02, gain: 0.07 * o.g, a: 0.001, hold: 0.015, pan: r() * 1.4 - 0.7 }); noise(t, { dur: 0.16, filter: 'bandpass', f: 2500, q: 0.6, gain: 0.12 * o.g }); },
      shutter: (t, o) => { S.click(t, o); noise(t + 0.06, { dur: 0.04, filter: 'bandpass', f: 2200, q: 1, gain: 0.2 * o.g, pan: o.pan }); },
      count: (t, o) => S.tick(t, { ...o, f: o.f || 5200, g: o.g * 0.7 }),

      // hand-made media
      // stroke: a pen/marker/chalk/pencil stroke over `dur` seconds. material sets the surface sound.
      stroke: (t, o) => {
        const d = o.dur || 0.4, m = o.material || 'marker', r = rand('stroke' + m + t);
        const M = {
          marker: { f: 2900, q: 2.2, g: 0.16, grain: 0.05 },
          chalk: { f: 1700, q: 0.6, g: 0.22, grain: 0.028 },
          pencil: { f: 4600, q: 0.8, g: 0.16, grain: 0.04, filter: 'highpass' },
          pen: { f: 4200, q: 1.6, g: 0.08, grain: 0.06 },
          brush: { f: 900, q: 0.5, g: 0.1, grain: 0.09, color: 'pink' },
          sharpie: { f: 2400, q: 1.4, g: 0.2, grain: 0.045 },
        }[m];
        for (let x = 0; x < d; x += M.grain * (0.7 + r() * 0.6)) {
          const gd = M.grain * (0.8 + r() * 0.9);
          noise(t + x, { dur: gd, color: M.color, filter: M.filter || 'bandpass', f: M.f * (0.8 + r() * 0.4), q: M.q, gain: M.g * o.g * (0.6 + r() * 0.5), a: gd * 0.3, pan: (o.pan || 0) + (r() - 0.5) * 0.2 });
        }
      },
      // paper: picking up / slapping down / turning a sheet
      paper: (t, o) => { const d = o.dur || 0.35, r = rand('paper' + t); for (let x = 0; x < d; x += 0.025 + r() * 0.03) noise(t + x, { dur: 0.05, filter: 'bandpass', f: 1200 + r() * 2600, q: 0.9, gain: 0.12 * o.g * (1 - x / d * 0.5), pan: o.pan }); },
      slap: (t, o) => { noise(t, { dur: 0.07, filter: 'highpass', f: 900, gain: 0.45 * o.g, a: 0.001, pan: o.pan }); tone(t, { f: [[0, 180], [0.06, 70]], dur: 0.1, gain: 0.25 * o.g, pan: o.pan }); },
      tape: (t, o) => { noise(t, { dur: o.dur || 0.5, filter: 'bandpass', f: [[0, 900], [o.dur || 0.5, 2200]], q: 1.8, gain: 0.18 * o.g, a: 0.02, pan: o.pan }); },
      press: (t, o) => { S.thud(t, { ...o, f: 95, g: o.g * 0.9 }); noise(t + 0.01, { dur: 0.25, color: 'brown', filter: 'lowpass', f: 700, gain: 0.25 * o.g, pan: o.pan }); },
      roller: (t, o) => { const d = o.dur || 0.6; noise(t, { dur: d, color: 'brown', filter: 'bandpass', f: 380, q: 1.5, gain: 0.3 * o.g, a: 0.05, hold: d * 0.6, pan: o.pan }); for (let x = 0; x < d; x += 0.07) S.tock(t + x, { f: 300, g: o.g * 0.15, pan: o.pan }); },
      erase: (t, o) => { const d = o.dur || 0.6, r = rand('erase' + t); for (let x = 0; x < d; x += 0.06 + r() * 0.04) noise(t + x, { dur: 0.08, color: 'pink', filter: 'bandpass', f: 700 + r() * 500, q: 0.8, gain: 0.22 * o.g, a: 0.03, pan: (r() - 0.5) * 0.5 }); },

      // machines and screens
      key: (t, o) => { const r = rand('key' + t); noise(t, { dur: 0.025, filter: 'bandpass', f: 2600 + r() * 1200, q: 2, gain: 0.25 * o.g, a: 0.001, pan: o.pan }); tone(t, { f: 160 + r() * 40, dur: 0.04, gain: 0.12 * o.g, pan: o.pan }); },
      typing: (t, o) => { const r = rand('typing' + t), n = o.n || 8, rate = o.rate || 0.09; for (let i = 0; i < n; i++) S.key(t + i * rate * (0.75 + r() * 0.5), { g: o.g * (0.7 + r() * 0.4), pan: o.pan }); },
      typebar: (t, o) => { S.key(t, o); noise(t + 0.008, { dur: 0.03, filter: 'bandpass', f: 1100, q: 4, gain: 0.35 * o.g, pan: o.pan }); },
      bell: (t, o) => S.ding(t, { ...o, f: o.f || 'A6' }),
      boot: (t, o) => { tone(t, { f: [[0, 80], [0.35, 1600]], type: 'sine', dur: 0.5, gain: 0.08 * o.g, a: 0.3 }); S.blip(t + 0.45, { ...o, f: 'C6', dur: 0.12 }); },
      crtOn: (t, o) => { noise(t, { dur: 0.25, filter: 'highpass', f: 2000, gain: 0.2 * o.g, a: 0.001 }); tone(t, { f: 15700, dur: 1.5, gain: 0.02 * o.g, a: 0.1, hold: 1 }); S.thud(t, { ...o, f: 90, g: o.g * 0.5 }); },
      neon: (t, o) => { const d = o.dur || 0.25, r = rand('neon' + t); for (let x = 0; x < d; x += 0.035 + r() * 0.04) tone(t + x, { f: 120, type: 'sawtooth', dur: 0.03, gain: 0.3 * o.g * (0.5 + r() * 0.5), filter: 'bandpass', f2: 1200, q: 1.2, pan: o.pan }); },
      // chip (8-bit console) sounds: raw square/triangle, no filtering
      coin: (t, o) => { tone(t, { f: 'B5', type: 'square', dur: 0.07, gain: 0.07 * o.g, a: 0.001, hold: 0.06 }); tone(t + 0.07, { f: 'E6', type: 'square', dur: 0.3, gain: 0.07 * o.g, a: 0.001, hold: 0.1 }); },
      jump: (t, o) => tone(t, { f: [[0, 260], [0.16, 820]], type: 'square', dur: 0.18, gain: 0.07 * o.g, a: 0.001, hold: 0.12 }),
      hurt: (t, o) => { tone(t, { f: [[0, 600], [0.25, 90]], type: 'square', dur: 0.28, gain: 0.08 * o.g, a: 0.001, hold: 0.2 }); noise(t, { dur: 0.2, filter: 'lowpass', f: 1800, gain: 0.15 * o.g, rate: 0.25 }); },
      powerup: (t, o) => ['C5', 'E5', 'G5', 'C6', 'E6', 'G6', 'C7'].forEach((n, i) => tone(t + i * 0.045, { f: n, type: 'square', dur: 0.06, gain: 0.06 * o.g, a: 0.001, hold: 0.05 })),
      select: (t, o) => { S.blip(t, { ...o, f: 'A5', dur: 0.04 }); S.blip(t + 0.05, { ...o, f: 'E6', dur: 0.05 }); },
      text: (t, o) => { const n = o.n || 10, rate = o.rate || 0.05; for (let i = 0; i < n; i++) tone(t + i * rate, { f: i % 2 ? 'C6' : 'G5', type: 'square', dur: 0.025, gain: 0.04 * o.g, a: 0.001, hold: 0.015 }); },
    };

    function play(name, t, opts) {
      const fn = S[name];
      if (!fn) throw new Error('unknown sound: ' + name);
      const o2 = Object.assign({}, opts); o2.g = o2.gain == null ? 1 : o2.gain;
      if (opts && opts.minor) withMinor(() => fn(t, o2)); else fn(t, o2);
    }

    // everything scheduled inside fn counts as minor (quieter in voiceover mode)
    function withMinor(fn) { const was = inMinor; inMinor = true; try { fn(); } finally { inMinor = was; } }

    // ---- beds: continuous sound under a stretch of time. bed(name, t0, t1, opts)
    function bed(name, t0, t1, p) {
      if (VO) return;
      p = p || {}; const g = p.gain == null ? 1 : p.gain, d = t1 - t0, fade = Math.min(0.4, d / 4);
      const long = (q) => Object.assign({ dur: d, a: fade, hold: d - fade * 2, bus: 'amb' }, q);
      if (name === 'room') noise(t0, long({ color: 'brown', filter: 'lowpass', f: 320, gain: 0.12 * g }));
      else if (name === 'hiss') noise(t0, long({ color: 'pink', filter: 'highpass', f: 5000, gain: 0.02 * g }));
      else if (name === 'hum') { tone(t0, long({ f: 60, gain: 0.05 * g })); tone(t0, long({ f: 120, gain: 0.025 * g })); tone(t0, long({ f: 180, type: 'triangle', gain: 0.012 * g })); }
      else if (name === 'rain') { noise(t0, long({ color: 'pink', filter: 'bandpass', f: 2500, q: 0.4, gain: 0.08 * g })); const r = rand('rain'); for (let x = 0; x < d; x += 0.04 + r() * 0.08) noise(t0 + x, { dur: 0.01, filter: 'highpass', f: 4000, gain: 0.04 * g * r(), bus: 'amb', pan: r() * 1.6 - 0.8 }); }
      else if (name === 'projector') { noise(t0, long({ color: 'pink', filter: 'highpass', f: 3000, gain: 0.03 * g })); for (let x = 0; x < d; x += 1 / 24) S.tock(t0 + x, { f: 700, g: 0.04 * g, pan: 0.3 }); }
      else if (name === 'vinyl') { noise(t0, long({ color: 'pink', filter: 'bandpass', f: 1500, q: 0.5, gain: 0.025 * g })); const r = rand('vinyl'); for (let x = 0; x < d; x += 0.08 + r() * 0.4) noise(t0 + x, { dur: 0.006, filter: 'highpass', f: 2500, gain: 0.08 * g * r(), bus: 'amb' }); }
      else throw new Error('unknown bed: ' + name);
    }

    // ---- music: optional light beds that sit under the effects. music(name, t0, t1, { bpm, chords, gain })
    // chords: list of note arrays, one per bar, cycled. e.g. [['C4','E4','G4','B4'], ['A3','C4','E4','G4']]
    function music(name, t0, t1, p) {
      if (VO) return;
      p = p || {}; const g = p.gain == null ? 1 : p.gain, bpm = p.bpm || 100, beat = 60 / bpm, bar = beat * 4;
      const chords = p.chords || [['C4', 'E4', 'G4', 'B4'], ['A3', 'C4', 'E4', 'G4'], ['F3', 'A3', 'C4', 'E4'], ['G3', 'B3', 'D4', 'F4']];
      let i = 0;
      for (let t = t0; t < t1 - 0.05; t += bar, i++) {
        const ch = chords[i % chords.length], len = Math.min(bar, t1 - t);
        if (name === 'pad' || name === 'pulse') ch.forEach((n, k) => { tone(t, { f: n, type: 'triangle', dur: len + 0.3, gain: 0.035 * g, a: 0.25, hold: len - 0.3, bus: 'music', filter: 'lowpass', f2: 1400, pan: (k - 1.5) * 0.25, verb: 0.25 }); tone(t, { f: hz(n) * 1.004, type: 'sine', dur: len + 0.3, gain: 0.03 * g, a: 0.3, hold: len - 0.3, bus: 'music' }); });
        if (name === 'pulse') for (let b = 0; b < 4 && t + b * beat < t1 - 0.05; b++) {
          const tb = t + b * beat;
          tone(tb, { f: [[0, 110], [0.1, 50]], dur: 0.18, gain: (b % 2 ? 0.16 : 0.26) * g, bus: 'music' });
          noise(tb + beat / 2, { dur: 0.04, filter: 'highpass', f: 7000, gain: 0.05 * g, bus: 'music' });
          tone(tb + beat / 2, { f: hz(ch[0]) / 2, type: 'triangle', dur: beat * 0.45, gain: 0.08 * g, bus: 'music' });
        }
        if (name === 'chip') for (let s = 0; s < 8 && t + s * beat / 2 < t1 - 0.05; s++) {
          const ts = t + s * beat / 2;
          tone(ts, { f: hz(ch[0]) / 2, type: 'triangle', dur: beat * 0.45, gain: 0.12 * g, a: 0.001, hold: beat * 0.35, bus: 'music' });
          tone(ts, { f: ch[[0, 1, 2, 3, 2, 1, 2, 3][s]], type: 'square', dur: beat * 0.4, gain: 0.03 * g, a: 0.001, hold: beat * 0.25, bus: 'music' });
        }
      }
    }

    return { play, bed, music, tone, noise, withMinor, hz, vo: VO, sounds: Object.keys(S) };
  };

  // Live playback for a player: SOUND.live(scoreFn, fromT, { voiceover, master }) starts the score from explainer time
  // fromT right now and returns stop(). Call stop() on pause or seek, and SOUND.live again on play.
  SOUND.live = function (fn, fromT, opts) {
    const ctx = new (window.AudioContext || window.webkitAudioContext)();
    fn(SOUND.kit(ctx, Object.assign({}, opts, { start: fromT || 0, delay: 0.03 })));
    return () => { try { ctx.close(); } catch (e) {} };
  };

  // Render a style's explainerSound into an OfflineAudioContext; returns interleaved float stereo.
  SOUND.renderOffline = async function (fn, duration, sampleRate, kitOpts) {
    const sr = sampleRate || 48000, len = Math.ceil(duration * sr);
    const ctx = new OfflineAudioContext(2, len, sr);
    fn(SOUND.kit(ctx, kitOpts || {}));
    const buf = await ctx.startRendering();
    const L = buf.getChannelData(0), R = buf.getChannelData(1), inter = new Float32Array(len * 2);
    let peak = 0;
    for (let i = 0; i < len; i++) { inter[2 * i] = L[i]; inter[2 * i + 1] = R[i]; peak = Math.max(peak, Math.abs(L[i]), Math.abs(R[i])); }
    return { inter, peak, frames: len, sr };
  };
})();
```

REFERENCE STYLE SOURCE (styles/isotype.js; W/H_ are always 1280x720)
```js
{
  // ISOTYPE (Neurath / Arntz, Vienna Method) pictorial statistics.
  const PAPER = '#EFE7D4', INK = '#26231F', BLUE = '#294C63', RED = '#C2432C', OCHRE = '#D49A33';

  // Arntz-style standing figure in a 26 x 44 box, origin top-left
  function person(ctx, x, y, s) {
    ctx.save(); ctx.translate(x, y); ctx.scale(s, s);
    ctx.beginPath();
    ctx.arc(13, 5.2, 5.2, 0, Math.PI * 2);
    // torso with arms (one silhouette), rounded shoulders
    ctx.moveTo(4.5, 12.5);
    ctx.quadraticCurveTo(13, 10.6, 21.5, 12.5);
    ctx.quadraticCurveTo(25.5, 13.4, 25.5, 17.5);
    ctx.lineTo(25.5, 28.5); ctx.lineTo(22.5, 28.5); ctx.lineTo(22.2, 19.5);
    ctx.lineTo(21.0, 19.5); ctx.lineTo(20.8, 28.5);
    // legs
    ctx.lineTo(20.8, 44); ctx.lineTo(14.2, 44); ctx.lineTo(13.6, 30.5); ctx.lineTo(12.4, 30.5); ctx.lineTo(11.8, 44); ctx.lineTo(5.2, 44);
    ctx.lineTo(5.2, 28.5); ctx.lineTo(5.0, 19.5); ctx.lineTo(3.8, 19.5); ctx.lineTo(3.5, 28.5); ctx.lineTo(0.5, 28.5);
    ctx.lineTo(0.5, 17.5); ctx.quadraticCurveTo(0.5, 13.4, 4.5, 12.5);
    ctx.closePath();
    ctx.fill();
    ctx.restore();
  }

  // compute unit: Arntz-style computer (monitor + keyboard) in a 32 x 44 box
  function chip(ctx, x, y, s, bg) {
    const ink = ctx.fillStyle;
    ctx.save(); ctx.translate(x, y); ctx.scale(s, s);
    // monitor body
    ctx.beginPath();
    ctx.moveTo(2, 4); ctx.lineTo(30, 4); ctx.quadraticCurveTo(32, 4, 32, 6); ctx.lineTo(32, 27);
    ctx.quadraticCurveTo(32, 29, 30, 29); ctx.lineTo(2, 29); ctx.quadraticCurveTo(0, 29, 0, 27); ctx.lineTo(0, 6);
    ctx.quadraticCurveTo(0, 4, 2, 4); ctx.closePath(); ctx.fill();
    // neck + foot
    ctx.fillRect(12.5, 29, 7, 5); ctx.fillRect(8, 33, 16, 2.5);
    // keyboard slab
    ctx.beginPath(); ctx.moveTo(3, 44); ctx.lineTo(6, 38.5); ctx.lineTo(26, 38.5); ctx.lineTo(29, 44); ctx.closePath(); ctx.fill();
    // screen (negative space) with a single bright prompt line
    ctx.fillStyle = bg; ctx.fillRect(4, 8, 24, 17);
    ctx.fillStyle = ink; ctx.fillRect(7, 11, 10, 2.6); ctx.fillRect(7, 16, 14, 2.6); ctx.fillRect(7, 21, 6, 2.6);
    ctx.restore();
  }

  // data-centre (factory-like silhouette) for the key
  function factory(ctx, x, y, s) {
    ctx.save(); ctx.translate(x, y); ctx.scale(s, s);
    ctx.beginPath();
    ctx.moveTo(0, 44); ctx.lineTo(0, 22); ctx.lineTo(9, 16); ctx.lineTo(9, 22); ctx.lineTo(18, 16); ctx.lineTo(18, 22);
    ctx.lineTo(27, 16); ctx.lineTo(27, 6); ctx.lineTo(33, 6); ctx.lineTo(33, 44); ctx.closePath();
    ctx.fill(); ctx.restore();
  }

  // ---- explainer pictograms (Arntz-style flat silhouettes) ----
  function catPic(ctx, x, y, s, bg) {
    ctx.save(); ctx.translate(x, y); ctx.scale(s, s);
    ctx.beginPath(); ctx.arc(14, 12, 7.5, 0, 7);
    ctx.moveTo(7.2, 9); ctx.lineTo(8, -0.5); ctx.lineTo(13, 5); ctx.closePath();
    ctx.moveTo(20.8, 9); ctx.lineTo(20, -0.5); ctx.lineTo(15, 5); ctx.closePath();
    ctx.moveTo(8.5, 19); ctx.bezierCurveTo(1, 28, 2, 44, 5, 44); ctx.lineTo(23, 44); ctx.bezierCurveTo(26, 44, 27, 28, 19.5, 19); ctx.closePath();
    ctx.fill();
    ctx.lineWidth = 3.4; ctx.lineCap = 'round'; ctx.strokeStyle = ctx.fillStyle;
    ctx.beginPath(); ctx.moveTo(22, 42); ctx.quadraticCurveTo(32, 40, 29, 28); ctx.stroke();
    ctx.fillStyle = bg; ctx.fillRect(13.3, 31, 1.4, 13);
    ctx.beginPath(); ctx.arc(11, 11.5, 1.3, 0, 7); ctx.arc(17, 11.5, 1.3, 0, 7); ctx.fill();
    ctx.restore();
  }
  function dogPic(ctx, x, y, s, bg) {
    ctx.save(); ctx.translate(x, y); ctx.scale(s, s);
    ctx.beginPath();
    ctx.moveTo(7, 6); ctx.quadraticCurveTo(7, 1, 13, 1); ctx.lineTo(19, 1); ctx.quadraticCurveTo(23, 1, 23, 6); ctx.lineTo(23, 9); ctx.lineTo(30, 10); ctx.quadraticCurveTo(32, 14, 29, 17); ctx.lineTo(21, 18);
    ctx.bezierCurveTo(27, 26, 27, 44, 24, 44); ctx.lineTo(5, 44); ctx.bezierCurveTo(2, 44, 1, 28, 8, 18); ctx.quadraticCurveTo(6, 12, 7, 6); ctx.closePath();
    ctx.fill();
    ctx.lineWidth = 3.4; ctx.lineCap = 'round'; ctx.strokeStyle = ctx.fillStyle;
    ctx.beginPath(); ctx.moveTo(5, 40); ctx.quadraticCurveTo(-3, 36, -1, 27); ctx.stroke();
    ctx.fillStyle = bg; ctx.fillRect(14.3, 31, 1.4, 13);
    ctx.beginPath(); ctx.arc(18, 7.5, 1.4, 0, 7); ctx.fill();
    ctx.beginPath(); ctx.moveTo(8, 4); ctx.quadraticCurveTo(4, 9, 7, 16); ctx.lineTo(9.5, 15); ctx.quadraticCurveTo(8.5, 9, 10.5, 5); ctx.closePath(); ctx.fill();
    ctx.restore();
  }
  // flat ISOTYPE arrow (shaft + head), optionally curved via a quadratic control point
  function flatArrow(ctx, x0, y0, x1, y1, w, p = 1, cx = null, cy = null) {
    if (p <= 0) return;
    const pts = [];
    const n = 30;
    for (let k = 0; k <= n * p; k++) {
      const u = k / n;
      if (cx === null) pts.push([H.lerp(x0, x1, u), H.lerp(y0, y1, u)]);
      else { const a = (1 - u) * (1 - u), b = 2 * u * (1 - u), c = u * u; pts.push([a * x0 + b * cx + c * x1, a * y0 + b * cy + c * y1]); }
    }
    if (pts.length < 2) return;
    const [ex, ey] = pts[pts.length - 1], [px, py] = pts[pts.length - 2];
    const an = Math.atan2(ey - py, ex - px);
    ctx.save(); ctx.lineWidth = w; ctx.lineCap = 'butt'; ctx.lineJoin = 'round'; ctx.strokeStyle = ctx.fillStyle;
    ctx.beginPath(); pts.slice(0, -1).forEach(([x, y], i) => (i ? ctx.lineTo(x, y) : ctx.moveTo(x, y)));
    ctx.lineTo(ex - Math.cos(an) * w * 0.9, ey - Math.sin(an) * w * 0.9); ctx.stroke();
    ctx.beginPath(); ctx.moveTo(ex + Math.cos(an) * w * 0.9, ey + Math.sin(an) * w * 0.9);
    ctx.lineTo(ex - Math.cos(an) * w * 0.9 + Math.cos(an + Math.PI / 2) * w * 1.25, ey - Math.sin(an) * w * 0.9 + Math.sin(an + Math.PI / 2) * w * 1.25);
    ctx.lineTo(ex - Math.cos(an) * w * 0.9 - Math.cos(an + Math.PI / 2) * w * 1.25, ey - Math.sin(an) * w * 0.9 - Math.sin(an + Math.PI / 2) * w * 1.25);
    ctx.closePath(); ctx.fill(); ctx.restore();
  }
  function checkPic(ctx, x, y, s) { ctx.save(); ctx.translate(x, y); ctx.scale(s, s); ctx.lineWidth = 7; ctx.lineCap = 'butt'; ctx.lineJoin = 'miter'; ctx.strokeStyle = ctx.fillStyle; ctx.beginPath(); ctx.moveTo(2, 22); ctx.lineTo(11, 31); ctx.lineTo(30, 6); ctx.stroke(); ctx.restore(); }
  function crossPic(ctx, x, y, s) { ctx.save(); ctx.translate(x, y); ctx.scale(s, s); ctx.lineWidth = 7; ctx.lineCap = 'butt'; ctx.strokeStyle = ctx.fillStyle; ctx.beginPath(); ctx.moveTo(3, 3); ctx.lineTo(29, 29); ctx.moveTo(29, 3); ctx.lineTo(3, 29); ctx.stroke(); ctx.restore(); }

  const ROWS = [
    { yr: '2000', p: 4.5, c: 0.25 },
    { yr: '2005', p: 5.25, c: 0.5 },
    { yr: '2010', p: 6.5, c: 1.5 },
    { yr: '2015', p: 7.75, c: 3.5 },
    { yr: '2020', p: 9.25, c: 7.25 },
    { yr: '2025', p: 10.5, c: 13.5 },
  ];

  // ---- litho finish, cached once per size ----
  // paper mottle: one fbm per 4x4 px, drawn upscaled with smoothing (no blocky squares, no per-frame noise)
  const MOTTLE = {};
  function mottle(W, H_, oct) {
    const key = W + 'x' + H_ + 'x' + oct;
    if (MOTTLE[key]) return MOTTLE[key];
    const w = Math.ceil(W / 4), h = Math.ceil(H_ / 4), L = H.layer(w, h), c = L.getContext('2d'), id = c.createImageData(w, h);
    const nz = H.makeNoise(4);
    for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) {
      const v = nz.fbm2((i * 4 + 2) * 0.006, (j * 4 + 2) * 0.006, oct), o = (j * w + i) * 4;
      id.data[o] = 150; id.data[o + 1] = 120; id.data[o + 2] = 80; id.data[o + 3] = v > 0.05 ? Math.min(255, (v - 0.05) * 0.06 * 255) : 0;
    }
    c.putImageData(id, 0, 0);
    return (MOTTLE[key] = L);
  }
  function lithoFinish(ctx, W, H_, oct) {
    ctx.save(); ctx.globalCompositeOperation = 'multiply'; ctx.imageSmoothingEnabled = true; ctx.imageSmoothingQuality = 'high';
    ctx.drawImage(mottle(W, H_, oct), 0, 0, W, H_); ctx.restore();
  }
  // ink film wear: where the litho ink did not fully take. Low-frequency density drift + fine pinholes and a few
  // dry streaks, removed from the ink layer with destination-out so paper shows through the flat fills.
  const WEAR = {};
  function wear(W, H_) {
    const key = W + 'x' + H_;
    if (WEAR[key]) return WEAR[key];
    const L = H.layer(W, H_), c = L.getContext('2d');
    const w = Math.ceil(W / 3), h = Math.ceil(H_ / 3), S = H.layer(w, h), sc = S.getContext('2d'), id = sc.createImageData(w, h);
    const nz = H.makeNoise(23), rf = H.rng(5);
    for (let j = 0; j < h; j++) for (let i = 0; i < w; i++) {
      const v = nz.fbm2(i * 0.05, j * 0.05, 3), f = nz.n2(i * 0.6 + 40, j * 0.6), o = (j * w + i) * 4;
      // coarse density drift + an 'orange-peel' fine stipple where the ink film is thin
      const a = Math.max(0, v * 0.5 + 0.5 - 0.4) * 0.34 + Math.max(0, f) * 0.07 + rf() * 0.035;
      id.data[o + 3] = Math.min(255, a * 255);
    }
    sc.putImageData(id, 0, 0);
    c.imageSmoothingEnabled = true; c.drawImage(S, 0, 0, W, H_);
    const r = H.rng(77);
    c.fillStyle = '#000';
    for (let n = 0; n < W * H_ * 0.0016; n++) {   // pinholes
      const x = r() * W, y = r() * H_, rr = 0.5 + r() * r() * 1.4;
      c.globalAlpha = 0.25 + r() * 0.55; c.beginPath(); c.arc(x, y, rr, 0, 7); c.fill();
    }
    c.globalAlpha = 0.09;
    for (let n = 0; n < 140; n++) {               // faint horizontal roller streaks
      const x = r() * W, y = r() * H_; c.fillRect(x, y, 20 + r() * 90, 0.8 + r() * 0.8);
    }
    c.globalAlpha = 1;
    return (WEAR[key] = L);
  }
  const INKL = {};
  function inkLayer(W, H_) {
    const key = W + 'x' + H_;
    const L = INKL[key] || (INKL[key] = H.layer(W, H_)), c = L.getContext('2d');
    c.setTransform(1, 0, 0, 1, 0, 0); c.globalAlpha = 1; c.globalCompositeOperation = 'source-over'; c.clearRect(0, 0, W, H_);
    return L;
  }
  function printInk(out, L, W, H_) {
    const c = L.getContext('2d');
    c.save(); c.setTransform(1, 0, 0, 1, 0, 0); c.globalAlpha = 1; c.globalCompositeOperation = 'destination-out'; c.drawImage(wear(W, H_), 0, 0); c.restore();
    out.save(); out.setTransform(1, 0, 0, 1, 0, 0); out.drawImage(L, 0, 0); out.restore();
  }

  function spaced(ctx, str, x, y, track, align) {
    let w = 0; for (const ch of str) w += ctx.measureText(ch).width + track; w -= track;
    let cx = align === 'center' ? x - w / 2 : align === 'right' ? x - w : x;
    ctx.textAlign = 'left';
    for (const ch of str) { ctx.fillText(ch, cx, y); cx += ctx.measureText(ch).width + track; }
  }

  registerStyle({
    id: 'isotype',
    name: 'ISOTYPE Pictograms',
    category: 'Data & Information',
    description: 'Vienna Method pictorial statistics: rows of identical flat pictograms where each symbol is a fixed quantity, partial symbols for remainders, three muted litho inks on a strict grid with geometric sans lettering.',
    motion: 'Title and key set first, the year column drops in, then symbols are stamped out row by row from the centre in stepped, rubber-stamp timing, the 2025 row of machines racing ahead; the litho paper breathes in the hold.',
    fonts: ['700 40px "Space Grotesk"', '400 18px "Space Grotesk"', '700 26px "Space Grotesk"', '400 14px "Space Grotesk"', '700 14px "Space Grotesk"', '700 96px "Space Grotesk"', '700 32px "Space Grotesk"', '400 24px "Space Grotesk"'],
    duration: 5.5,
    frameT: 5.4,
    readsPixels: true,
    draw(ctx, W, H_, t) {
      H.paper(ctx, W, H_, PAPER, 11, 0.02);
      const OUT = ctx, IL = inkLayer(W, H_); ctx = IL.getContext('2d');

      const CX = 640, colHalf = 56, pitch = 36, rowH = 66, top = 214;
      const s = 1.0;
      // stepped clock: the stamping runs "on twos" at 12 fps like a mechanical counter
      const ts = Math.floor(t * 12) / 12;
      const seg = (a, b) => H.clamp((ts - a) / (b - a));
      // per-icon stamp: invisible -> oversized impression (one step) -> settled
      const stampAt = (start) => (ts < start ? 0 : ts < start + 1 / 12 ? 0.5 : 1);

      // ---- title block ----
      ctx.fillStyle = INK; ctx.textBaseline = 'alphabetic';
      ctx.globalAlpha = seg(0, 0.34);
      ctx.font = '700 40px "Space Grotesk"'; spaced(ctx, 'PEOPLE AND MACHINES', CX, 86 - (1 - seg(0, 0.34)) * 8, 5, 'center');
      ctx.globalAlpha = seg(0.25, 0.6);
      ctx.font = '400 18px "Space Grotesk"';
      spaced(ctx, 'Workers and machines for AI in the computing industry, 2000–2025', CX, 120, 0.6, 'center');
      ctx.globalAlpha = 1;
      const rp = H.ease.out(seg(0.3, 0.75));
      ctx.fillStyle = INK; ctx.fillRect(CX - 300 * rp, 140, 600 * rp, 2);

      // ---- column heads with keys ----
      ctx.globalAlpha = seg(0.5, 0.84);
      ctx.font = '700 14px "Space Grotesk"';
      ctx.fillStyle = BLUE; person(ctx, CX - colHalf - 30, 156, 0.62);
      ctx.fillStyle = INK; spaced(ctx, 'WORKERS', CX - colHalf - 40, 176, 2.5, 'right');
      ctx.font = '400 14px "Space Grotesk"'; spaced(ctx, 'each figure = 1 million', CX - colHalf - 40, 194, 0.4, 'right');
      ctx.fillStyle = RED; chip(ctx, CX + colHalf + 6, 156, 0.62, PAPER);
      ctx.fillStyle = INK; ctx.font = '700 14px "Space Grotesk"'; spaced(ctx, 'AI COMPUTERS', CX + colHalf + 40, 176, 2.5, 'left');
      ctx.font = '400 14px "Space Grotesk"'; spaced(ctx, 'each machine = 100,000', CX + colHalf + 40, 194, 0.4, 'left');
      ctx.globalAlpha = 1;

      // ---- centre year column drops in ----
      const colP = H.ease.out(seg(0.6, 1.1));
      ctx.fillStyle = OCHRE;
      ctx.fillRect(CX - colHalf + 8, top - 6, (colHalf - 8) * 2, (ROWS.length * rowH - 2) * colP);

      // row timing: each row stamps outward from the column, rows in sequence
      const DT = 0.042;
      let rowStart = 1.15;
      ROWS.forEach((row, ri) => {
        const y = top + ri * rowH;
        const t0 = rowStart; rowStart += Math.max(Math.ceil(row.p), Math.ceil(row.c)) * DT + 0.05;
        // year
        if (ts >= 0.75 + ri * 0.06) { ctx.fillStyle = INK; ctx.font = '700 26px "Space Grotesk"'; spaced(ctx, row.yr, CX, y + 36, 1.5, 'center'); }
        // row hairline
        const hp = seg(t0 - 0.15, t0 + 0.35);
        if (ri && hp > 0) { ctx.fillStyle = 'rgba(38,35,31,0.18)'; const lw = (CX - colHalf - 70) * hp; ctx.fillRect(CX - colHalf - lw, y - 4, lw, 1); ctx.fillRect(CX + colHalf, y - 4, (W - 70 - CX - colHalf) * hp, 1); }

        // workers, growing leftward from the column; partial symbol on the outer end shows its inner part
        const pn = Math.ceil(row.p);
        for (let k = 0; k < pn; k++) {
          const frac = Math.min(1, row.p - k), a = stampAt(t0 + k * DT);
          if (a <= 0) continue;
          const x = CX - colHalf - 14 - (k + 1) * pitch + (pitch - 26 * s) / 2;
          ctx.save();
          if (frac < 1) { ctx.beginPath(); ctx.rect(x + 26 * s * (1 - frac), y, 26 * s * frac + 1, 60); ctx.clip(); }
          ctx.fillStyle = BLUE;
          if (a < 1) { ctx.translate(x + 13, y + 28); ctx.scale(1.14, 1.14); ctx.translate(-x - 13, -y - 28); ctx.globalAlpha = 0.8; }
          person(ctx, x, y + 6, s);
          ctx.restore();
        }
        // chips, growing rightward
        const cn = Math.ceil(row.c);
        for (let k = 0; k < cn; k++) {
          const frac = Math.min(1, row.c - k), a = stampAt(t0 + k * DT);
          if (a <= 0) continue;
          const cs = 0.88, x = CX + colHalf + 14 + k * pitch + (pitch - 32 * cs) / 2;
          ctx.save();
          if (frac < 1) { ctx.beginPath(); ctx.rect(x - 1, y, 32 * cs * frac + 1, 60); ctx.clip(); }
          ctx.fillStyle = RED;
          if (a < 1) { ctx.translate(x + 14, y + 30); ctx.scale(1.14, 1.14); ctx.translate(-x - 14, -y - 30); ctx.globalAlpha = 0.8; }
          chip(ctx, x, y + 6 + 44 * (1 - cs), cs, PAPER);
          ctx.restore();
        }
      });

      // ---- footer ----
      const fy = top + ROWS.length * rowH + 14;
      const fp = H.ease.out(seg(rowStart, rowStart + 0.4));
      ctx.fillStyle = INK; ctx.fillRect(70, fy, (W - 140) * fp, 2);
      ctx.globalAlpha = seg(rowStart + 0.2, rowStart + 0.6);
      ctx.font = '400 14px "Space Grotesk"'; ctx.fillStyle = INK;
      spaced(ctx, 'Partial symbols show fractions of a unit.  Figures are illustrative.', 70, fy + 28, 0.3, 'left');
      ctx.font = '700 14px "Space Grotesk"';
      spaced(ctx, 'AFTER THE VIENNA METHOD', W - 70, fy + 28, 2.2, 'right');
      ctx.globalAlpha = 1;

      // ---- litho finish: ink film printed onto the paper, slight mottling + grain ----
      printInk(OUT, IL, W, H_); ctx = OUT;
      lithoFinish(ctx, W, H_, 3);
      H.grain(ctx, W, H_, 0.05, 9 + Math.floor(t * 8));
    },
    // Sound: rubber stamps on a chart sheet laid on a wooden table. Every pictogram is a stamp landing on the
    // 12 fps frame it appears (stamp(st) shows at ceil(st*12)/12), numerals advance with a numbering-machine clack,
    // the camera pans are the long sheet sliding on the table. Times mirror explainer() below.
    explainerSound(k) {
      const D = 15;
      const sf = (st) => Math.ceil(st * 12 - 1e-6) / 12; // first frame a stamp(st) / ts >= st is visible
      const pan = (px) => H.clamp((px / 1280) * 2 - 1, -1, 1) * 0.6; // screen x
      // small rubber stamp: a soft pat of rubber on paper with a little table body
      const pat = (t, g = 1, p = 0) => k.withMinor(() => {
        k.noise(t, { dur: 0.04, filter: 'bandpass', f: 950, q: 0.9, gain: 0.3 * g, a: 0.002, pan: p });
        k.tone(t, { f: [[0, 150], [0.06, 70]], dur: 0.08, gain: 0.22 * g, pan: p });
      });
      // big rubber stamp (pictogram blocks, crosses, ticks): the kit stamp, a bit softer and woodier
      const thump = (t, g = 1, p = 0, minor = false) => k.play('stamp', t, { gain: 0.55 * g, pan: p, minor });
      // numbering machine advancing a digit wheel
      const numb = (t, g = 1, p = 0) => k.withMinor(() => {
        k.noise(t, { dur: 0.022, filter: 'bandpass', f: 2100, q: 1.8, gain: 0.26 * g, a: 0.001, pan: p });
        k.tone(t, { f: 410, type: 'triangle', dur: 0.03, gain: 0.06 * g, pan: p });
      });
      // the long sheet slides under the camera: smooth, low, no rustle
      const slide = (t0, t1) => k.noise(t0, { dur: t1 - t0 + 0.1, color: 'brown', filter: 'bandpass', f: [[0, 220], [(t1 - t0) * 0.5, 420], [t1 - t0 + 0.1, 200]], q: 0.6, gain: 0.22, a: (t1 - t0) * 0.45 });
      // flat arrow printed in steps: a short soft brayer pass
      const arrow = (t0, t1, p) => k.noise(sf(t0), { dur: t1 - t0, color: 'brown', filter: 'bandpass', f: 330, q: 1.4, gain: 0.25, a: 0.04, pan: p, minor: true });

      k.bed('room', 0, D, { gain: 0.4 });

      // ---- title stamps on, subtitle, rule; then the title slides to the corner (1.5 -> 2.3, smooth time)
      thump(0.0, 0.7);
      pat(sf(0.3), 0.6); // subtitle
      k.noise(1.5, { dur: 0.8, color: 'brown', filter: 'bandpass', f: [[0, 260], [0.8, 380]], q: 0.6, gain: 0.12, a: 0.3, minor: true });

      // ---- panel A: 20 symbols stamped in order (cats ochre top row, dogs blue bottom row)
      for (let i = 0; i < 20; i++) {
        const kk = Math.floor(i / 2), r = i % 2, t = sf(2.35 + i * 0.09);
        pat(t, 0.75 + 0.25 * ((i * 7) % 5) / 4, pan(150 + kk * 52));
      }
      // numeral re-stamped in 50,000 steps (val changes on the 12 fps grid)
      {
        let last = -1;
        for (let f = Math.ceil(2.5 * 12); f / 12 <= 4.9; f++) {
          const ts = f / 12, n = Math.round(1e6 * H.clamp((ts - 2.5) / 2.3) / 0.05) * 0.05, v = Math.min(1e6, Math.round(n / 50000) * 50000);
          if (v !== last) { if (v < 1e6) numb(ts, 0.8 + 0.3 * v / 1e6, pan(160)); else { k.play('tock', ts, { f: 300, gain: 0.55, pan: pan(160) }); thump(ts, 0.45, pan(160)); } last = v; }
        }
      }
      thump(sf(4.1), 1, pan(1000)); // THE MODEL chip
      arrow(4.4, 5.0, pan(775));
      slide(5.9, 6.6);

      // ---- panel B: guess, check, adjust
      thump(sf(6.8), 0.9, pan(130)); // GUESS block inks + the new picture
      arrow(7.0, 7.3, pan(260));
      arrow(7.4, 7.7, pan(575));
      thump(sf(7.7), 0.7, pan(800), true); // guess box "DOG?"
      thump(sf(7.9), 1.3, pan(1010)); // red cross: the wrong guess
      k.tone(sf(7.9), { f: 'D3', type: 'triangle', dur: 0.26, gain: 0.22, hold: 0.08, filter: 'lowpass', f2: 900, pan: pan(1010) });
      k.tone(sf(7.9) + 0.15, { f: 'A2', type: 'triangle', dur: 0.18, gain: 0.2, hold: 0.06, filter: 'lowpass', f2: 700, pan: pan(1010) });
      thump(sf(8.2), 1.0, pan(800)); // CHECK block + ANSWER: CAT
      k.noise(sf(8.4), { dur: 0.6, color: 'brown', filter: 'bandpass', f: [[0, 300], [0.6, 240]], q: 1.2, gain: 0.2, a: 0.05, pan: pan(640), minor: true }); // red error arrow curls back
      pat(sf(8.6), 0.8, pan(760)); // ERROR
      thump(sf(8.9), 0.7, pan(-0.2), true); // ADJUST block
      { // dials turn on the stepped clock: a ratchet click each frame they move
        for (let f = Math.ceil(8.9 * 12) + 1; f / 12 <= 9.6; f++) k.play('tock', f / 12, { f: 560 + (f % 3) * 40, gain: 0.32, pan: pan(410), minor: true });
      }
      thump(sf(9.6), 0.6, pan(130), true); // GUESS again
      thump(sf(9.7), 0.8, pan(800), true); // box re-stamped "CAT"
      thump(sf(9.8), 1.0, pan(1010)); // blue tick
      k.play('success', sf(9.8), { f: 'E5', gain: 0.45, pan: pan(1010) });
      slide(10.3, 10.9);

      // ---- panel C: rows of tick symbols stamp in while the sheet arrives
      pat(sf(10.4), 0.6, -0.4); // RIGHT ANSWERS OUT OF 10
      for (let r = 0; r < 4; r++) {
        const st0 = 10.5 + r * 0.45, frames = new Set();
        for (let q = 0; q < 10; q++) frames.add(sf(st0 + q * 0.03));
        [...frames].forEach((t, j) => pat(t, 0.9 - j * 0.1, -0.3 + j * 0.25));
        if (r > 0) numb(sf(st0), 1.1, 0.75); // hero accuracy re-stamped 61 -> 76 -> 89
      }
      // ROUND 1,000 row: hero numeral stamps 97%: the big hit
      thump(sf(11.85), 1.0, 0.75);
      k.play('impact', sf(11.85), { gain: 0.6, pan: 0.6 });
      k.play('ding', sf(11.85) + 0.02, { f: 'C5', gain: 0.45, pan: 0.6 });
      k.play('roller', sf(12.9), { dur: 0.3, gain: 0.35, minor: true }); // ochre band printed under the best row

      // ---- takeaway: full-width black block stamped (13.25 appears), then resolves
      thump(sf(13.2), 1.2);
      k.play('press', sf(13.2) + 0.08, { gain: 0.3 });
      ['F4', 'C5', 'A5'].forEach((f, i) => k.play('ding', 13.5 + i * 0.08, { f, gain: 0.38 - i * 0.06, pan: (i - 1) * 0.25 }));
    },
    explainerDuration: 15,
    explainerNote: 'A Vienna-Method picture-statistic told across one long chart sheet the camera pans along: symbols are stamped in stepped 12 fps timing, flat Isotype arrows show flow, numerals are stamped and re-stamped, and accuracy is counted in rows of tick symbols with partial symbols for fractions.',
    explainer(ctx, W, H_, t) {
      const ts = Math.floor(t * 12) / 12;           // stepped clock for stamping
      const S = (a, b) => H.clamp((ts - a) / (b - a));
      const stamp = (st) => (ts < st ? 0 : ts < st + 1 / 12 ? 0.5 : 1);
      const big = (a, fn, cx, cy) => { if (a <= 0) return; ctx.save(); if (a < 1) { ctx.translate(cx, cy); ctx.scale(1.15, 1.15); ctx.translate(-cx, -cy); ctx.globalAlpha = 0.8; } fn(); ctx.restore(); };
      const T = (str, x, y, size, align = 'left', col = INK, track = 2, weight = 700) => { ctx.fillStyle = col; ctx.font = `${weight} ${size}px "Space Grotesk"`; spaced(ctx, str, x, y, track, align); };
      H.paper(ctx, W, H_, PAPER, 11, 0.02);
      const OUT = ctx, IL = inkLayer(W, H_); ctx = IL.getContext('2d');

      // ---- camera: a smooth pan along one long sheet (3 panels) ----
      const PK = [[0, 0], [5.9, 0], [6.6, 1280], [10.3, 1280], [10.9, 2560], [15, 2560]];
      let px = 2560;
      for (let i = 0; i < PK.length - 1; i++) if (t >= PK[i][0] && t <= PK[i + 1][0]) { px = H.lerp(PK[i][1], PK[i + 1][1], H.ease.inOut((t - PK[i][0]) / (PK[i + 1][0] - PK[i][0]))); break; }
      ctx.save(); ctx.translate(-px, 0);
      ctx.textBaseline = 'alphabetic';

      // ===== panel A: data =====
      {
        const rowY = [150, 250], N = 10, pitch = 52, x0 = 150, sc = 1.4;
        if (ts >= 2.4) { T('CAT', 40, rowY[0] + 44, 30); T('DOG', 40, rowY[1] + 44, 30); }
        for (let r = 0; r < 2; r++) for (let k = 0; k < N; k++) {
          const st = 2.35 + (k * 2 + r) * 0.09, a = stamp(st);
          const x = x0 + k * pitch, y = rowY[r];
          ctx.fillStyle = r ? BLUE : OCHRE;
          big(a, () => (r ? dogPic(ctx, x + 2.5, y + 44 * sc * 0.12, sc * 0.88, PAPER) : catPic(ctx, x, y, sc, PAPER)), x + 20, y + 30);
        }
        if (ts >= 2.5) T('each symbol = 50,000 labelled pictures', 40, 370, 24, 'left', INK, 0.4, 400);
        if (ts >= 2.5) {
          const n = Math.round(1e6 * S(2.5, 4.8) / 0.05) * 0.05;
          const val = Math.min(1e6, Math.round(n / 50000) * 50000);
          T(val.toLocaleString('en-US'), 36, 486, 96, 'left', INK, 3);
          T('EXAMPLES', 40, 530, 28, 'left', INK, 4);
        }
        ctx.fillStyle = INK; flatArrow(ctx, 690, 250, 860, 250, 30, S(4.4, 5.0));
        const ma = stamp(4.1);
        ctx.fillStyle = RED; big(ma, () => chip(ctx, 880, 130, 7.6, PAPER), 1000, 300);
        if (ts >= 4.2) T('THE MODEL', 1002, 500, 34, 'center', INK, 4);
        if (ts > 5.0 && ts < 6.4) for (let k = 0; k < 3; k++) {
          const u = ((ts - 5.0) * 1.6 + k / 3) % 1, x = 700 + u * 140;
          ctx.fillStyle = k % 2 ? BLUE : OCHRE; ctx.globalAlpha = 0.9;
          (k % 2 ? dogPic : catPic)(ctx, x, 186, 0.85, INK);
          ctx.globalAlpha = 1;
        }
      }

      // ===== panel B: guess, check, adjust (x 1280..2560) =====
      {
        const X = 1280;
        const active = ts < 6.8 ? -1 : ts < 8.2 ? 0 : ts < 8.9 ? 1 : ts < 9.6 ? 2 : 0;
        ['GUESS', 'CHECK', 'ADJUST'].forEach((s, i) => {
          const bx = X + 300 + i * 300, by = 100;
          ctx.fillStyle = i === active ? INK : 'rgba(38,35,31,0.12)'; ctx.fillRect(bx, by, 240, 66);
          T(s, bx + 120, by + 45, 32, 'center', i === active ? PAPER : INK, 4);
          if (i < 2) { ctx.fillStyle = INK; flatArrow(ctx, bx + 246, by + 33, bx + 294, by + 33, 12, 1); }
        });
        ctx.fillStyle = OCHRE; big(stamp(6.8), () => catPic(ctx, X + 76, 230, 3.6, PAPER), X + 126, 310);
        if (ts >= 6.8) T('NEW PICTURE', X + 136, 432, 28, 'center', INK, 2.5);
        ctx.fillStyle = INK; flatArrow(ctx, X + 222, 320, X + 304, 320, 24, S(7.0, 7.3));
        ctx.fillStyle = RED; chip(ctx, X + 320, 196, 5.8, PAPER);
        const turn = H.ease.inOut(S(8.9, 9.6));
        for (let i = 0; i < 3; i++) {
          const dx = X + 352 + i * 62, dy = 490;
          ctx.fillStyle = INK; ctx.beginPath(); ctx.arc(dx, dy, 22, 0, 7); ctx.fill();
          const a0 = [-2.2, -0.6, -1.5][i], a1 = [-0.9, -2.0, -0.4][i], a = H.lerp(a0, a1, turn);
          ctx.strokeStyle = PAPER; ctx.lineWidth = 6; ctx.beginPath(); ctx.moveTo(dx, dy); ctx.lineTo(dx + Math.cos(a) * 16, dy + Math.sin(a) * 16); ctx.stroke();
        }
        if (ts >= 6.8) T('SETTINGS', X + 414, 554, 28, 'center', INK, 3);
        ctx.fillStyle = INK; flatArrow(ctx, X + 520, 320, X + 630, 320, 24, S(7.4, 7.7));
        const g2 = ts >= 9.7;
        if (ts >= 7.7) {
          const flash = ts < 8.2 && Math.floor(ts * 6) % 2 === 0;
          ctx.fillStyle = flash ? RED : INK; ctx.fillRect(X + 650, 262, 300, 120);
          T(g2 ? 'CAT' : 'DOG?', X + 800, 344, 64, 'center', PAPER, 4);
          T('ITS GUESS', X + 800, 250, 28, 'center', INK, 3);
          if (!g2) { ctx.fillStyle = RED; big(stamp(7.9), () => crossPic(ctx, X + 968, 282, 2.5), X + 1008, 322); }
          else { ctx.fillStyle = BLUE; big(stamp(9.8), () => checkPic(ctx, X + 968, 276, 2.6), X + 1010, 318); }
        }
        if (ts >= 8.2 && ts < 9.7) {
          ctx.fillStyle = OCHRE; ctx.fillRect(X + 650, 400, 300, 62);
          T('ANSWER: CAT', X + 800, 442, 30, 'center', INK, 3);
          ctx.fillStyle = RED; flatArrow(ctx, X + 760, 470, X + 520, 520, 18, S(8.4, 9.0), X + 700, 640);
          if (ts >= 8.6) T('ERROR', X + 760, 640, 32, 'center', RED, 4);
        }
        if (ts >= 8.9 && ts < 9.9) T('TURN THE DIALS', X + 414, 610, 28, 'center', INK, 3);
      }

      // ===== panel C: progress (x 2560..3840); rows start stamping while the sheet slides in =====
      {
        const X = 2560;
        const rows = [['ROUND 1', 6.1], ['ROUND 10', 7.6], ['ROUND 100', 8.9], ['ROUND 1,000', 9.7]];
        if (ts >= 10.4) T('RIGHT ANSWERS OUT OF 10', X + 40, 132, 26, 'left', INK, 2.5);
        rows.forEach(([lab, v], r) => {
          const y = 170 + r * 100, st0 = 10.5 + r * 0.45;
          if (ts < st0) return;
          if (r === 3 && ts >= 12.9) { ctx.fillStyle = 'rgba(212,154,51,0.35)'; ctx.fillRect(X + 30, y - 8, 1220, 94); }
          T(lab, X + 40, y + 52, 28, 'left', INK, 2);
          for (let k = 0; k < 10; k++) {
            const x = X + 290 + k * 70, frac = H.clamp(v - k), a = stamp(st0 + k * 0.03);
            if (a <= 0) continue;
            ctx.save();
            if (frac < 1) { ctx.save(); ctx.beginPath(); ctx.rect(x - 4 + 62 * frac, y, 62 * (1 - frac) + 4, 80); ctx.clip(); ctx.globalAlpha = 0.16; ctx.fillStyle = INK; checkPic(ctx, x, y + 10, 1.75); ctx.restore(); }
            if (frac > 0) { ctx.beginPath(); ctx.rect(x - 4, y, 62 * frac, 80); ctx.clip(); ctx.fillStyle = BLUE; checkPic(ctx, x, y + 10, 1.75); }
            ctx.restore();
          }
          T(Math.round(v * 10) + '%', X + 1010, y + 54, 38, 'left', INK, 1);
        });
        // hero accuracy counter, stamped step by step
        if (ts >= 10.5) {
          const steps = [61, 61, 76, 89, 97];
          const ci = Math.min(4, Math.floor((ts - 10.5) / 0.45) + 1);
          T('ACCURACY', X + 1240, 100, 28, 'right', RED, 3);
          T(steps[ci] + '%', X + 1240, 174, 72, 'right', RED, 2);
        }
      }
      ctx.restore();

      // ---- header: the question, big first, then set in the top corner ----
      {
        const d = H.ease.inOut(H.clamp((t - 1.5) / 0.8));
        const x = H.lerp(640, 40, d), y = H.lerp(340, 60, d), size = H.lerp(84, 30, d);
        ctx.globalAlpha = S(0, 0.25);
        T('HOW DOES AI LEARN?', x, y, size, d > 0.5 ? 'left' : 'center', INK, H.lerp(8, 3, d));
        if (d < 1) { ctx.globalAlpha = (1 - d) * S(0.3, 0.6); T('a picture statistic in three steps', 640, 400, 30, 'center', INK, 0.8, 400); }
        ctx.globalAlpha = 1;
        // header rule only in panel A (later panels use their own top rows)
        const rw = H.lerp(800, 560, d);
        ctx.fillStyle = INK; ctx.fillRect(H.lerp(240, 40, d), H.lerp(440, 76, d), rw * S(0.2, 0.6) * (1 - H.clamp((px - 300) / 300)), 3);
      }
      if (ts >= 13.2) {
        const a = stamp(13.2);
        big(a, () => {
          ctx.fillStyle = INK; ctx.fillRect(40, 600, 1200, 92);
          T('MORE EXAMPLES → BETTER GUESSES', 640, 662, 46, 'center', PAPER, 3);
        }, 640, 646);
      }
      printInk(OUT, IL, W, H_); ctx = OUT;
      lithoFinish(ctx, W, H_, 2);
      H.grain(ctx, W, H_, 0.05, 9 + Math.floor(t * 8));
    },
  });
}
```
