Skip to content

An AI skill that turns books into animated, narrated, interactive web experiences

feat(skill): shorts, upright films for a phone feed

yzrdc78463fa37a
diff --git a/.claude/skills/papermorph/SKILL.md b/.claude/skills/papermorph/SKILL.md
index ce1a7b3..b552b21 100644
--- a/.claude/skills/papermorph/SKILL.md
+++ b/.claude/skills/papermorph/SKILL.md
@@ -1,17 +1,18 @@
---
name: papermorph
-description: Make or edit animated, narrated, interactive web books from reference PDFs, animated picture books (paper-puppet films) from a story, a joke or a fairy tale, and narrated documentaries about a book or an idea, built from public-domain pictures. Use for book planning, storyboards, chapter animation and exercises, narration, and cover and contents pages, including "make the next chapter", "turn this story into a picture book", "make a documentary about this book" or "fix this animation". Deliver runnable static book files; bookshelf design, bookshelf registration and hosting are separate tasks.
+description: Make or edit animated, narrated, interactive web books from reference PDFs, animated picture books (paper-puppet films) from a story, a joke or a fairy tale, narrated documentaries about a book or an idea, built from public-domain pictures, and upright shorts for a phone feed that make one point in under three minutes. Use for book planning, storyboards, chapter animation and exercises, narration, and cover and contents pages, including "make the next chapter", "turn this story into a picture book", "make a documentary about this book", "make a short about this for YouTube Shorts" or "fix this animation". Deliver runnable static book files; bookshelf design, bookshelf registration and hosting are separate tasks.
---
# Papermorph
-Papermorph makes three kinds of book on one machine:
+Papermorph makes four kinds of book on one machine:
- **Lessons**, from a textbook PDF: each chapter is a short animated lesson film where the picture carries the explanation, the narration says it, and quick checks and practice happen inside the picture.
- **Picture books**, from a story, a joke or a fairy tale: short films of paper puppets in front of sets, drawn in code or painted by an image model, with voices, effects and music.
- **Documentaries**, from a book or an idea: narrated films of found public-domain pictures, words and maps moved in step with the voice, with music.
+- **Shorts**, from an argument the user outlines: upright films for a phone feed that make one point in under three minutes.
-All are a 1600×900 SVG stage plus a player; **beats** pair narration clips with timed actions. Good means **alive** (things act and change with weight and timing), **composed** (each moment reads as one picture, text beside what it names), **true** (motion, labels and numbers agree at every moment) and **smooth** (it plays without stutter, Firefox included).
+All are an SVG stage (1600×900, or 900×1600 for a short) plus a player; **beats** pair narration clips with timed actions. Good means **alive** (things act and change with weight and timing), **composed** (each moment reads as one picture, text beside what it names), **true** (motion, labels and numbers agree at every moment) and **smooth** (it plays without stutter, Firefox included).
What the picture should be depends on the book and on the user, so the work starts with a conversation that ends in `style.json`: the user's words, the look they chose, the voices, which model does which step, and later the approved chapters. Every chapter is made against it; how each beat is laid out and choreographed is yours to judge against it and the approved chapters. User requests override defaults. Re-create explanations, examples and drawings; keep source PDFs, page images and extracted text outside the static output folder and out of version control (`.gitignore`: `*.pdf`, `books/*/pages/`). Deliver a self-contained book folder with local preview instructions.
@@ -22,6 +23,7 @@ What the picture should be depends on the book and on the user, so the work star
| A textbook PDF | [Lessons](#lessons) | [intake.md](references/intake.md), then [diagrams.md](references/diagrams.md) (tier 1) or [scenes.md](references/scenes.md) (tier 2), [authoring.md](references/authoring.md), [assets.md](references/assets.md), [review.md](references/review.md) |
| A story, a joke, a fairy tale, or a story book's PDF | [Picture books](#picture-books) | [stories.md](references/stories.md), [puppets.md](references/puppets.md), [sound.md](references/sound.md), [painting.md](references/painting.md) for a painted look |
| A book, an idea or a stretch of history to explain as a narrated film | [Documentaries](#documentaries) | [documentary.md](references/documentary.md), [sound.md](references/sound.md) for music |
+| One point to make in under three minutes, upright, for a phone feed (YouTube Shorts, TikTok, Reels) | [Shorts](#shorts) | [shorts.md](references/shorts.md), [documentary.md](references/documentary.md) for voice, pictures and review |
| A course book (cites works, reviewed questions, an LMS) | Lessons plus options | [courses.md](references/courses.md), only when the book calls for them |
Every path shares [site.md](references/site.md) (the book folder, cover or series page, preview, video export), [engine.md](references/engine.md) (the player and drawing API), [team.md](references/team.md) (making chapters with subagents) and the models step of [intake.md](references/intake.md#5-models). Read only the reference the current step needs.
@@ -86,6 +88,10 @@ Start with the story intake in [stories.md](references/stories.md#intake-for-a-s
Start with the intake in [documentary.md](references/documentary.md#intake) whenever `books/<book>/style.json` does not exist yet. Then follow [the order of work](references/documentary.md#the-order-of-work): research, the script and storyboard shown to the user, the folder from `assets/templates/documentary/` ([site.md](references/site.md#a-documentary)), pictures found and treated, voice, music, the beats, [review rounds](references/documentary.md#review-rounds) and the user's viewing. *Madness and Civilization* on the shelf is the approved reference.
+## Shorts
+
+Start with the questions in [shorts.md](references/shorts.md#questions-for-the-user) whenever `books/<book>/style.json` does not exist yet; the user's outline comes before any script. Then follow [the order of work](references/shorts.md#the-order-of-work): the script written beat by beat with the user, the cast, the folder from `assets/templates/shorts/` on the upright stage, voice and music levels, the beats, a director pass and the user's viewing, then `export.py` for a 1080 × 1920 video. *Madness and Civilization* episode 1, *The Ship* (`site/madness-shorts/`), is the worked example.
+
## Scripts
All in `SKILL/scripts/`; each prints its usage with `--help` (run it with the `uv run --with …` its docstring names).
diff --git a/.claude/skills/papermorph/assets/templates/shorts/chapter.html b/.claude/skills/papermorph/assets/templates/shorts/chapter.html
new file mode 100644
index 0000000..5928f08
--- /dev/null
+++ b/.claude/skills/papermorph/assets/templates/shorts/chapter.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<html lang="en" data-stage="portrait">
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<title>SERIES · EPISODE TITLE</title>
+<link rel="stylesheet" href="../lib/engine.css">
+<link rel="expect" href="#bar" blocking="render">
+</head>
+<body>
+<!-- A short: one beat per line of the script. Run engine.py on site/<book> first, then copy lib/ (shorts.js, book.css,
+ icons.js and its licence) over it with the documentary kit's fonts.css and fonts/; this file goes to
+ site/<book>/chNN/index.html. The film's own pieces (its cast's sizes, its recurring cards) go in a second lib file,
+ loaded after shorts.js. -->
+<script src="../lib/engine.js"></script>
+<script src="audio/en/timings.js"></script>
+<script src="../lib/icons.js"></script>
+<script src="../lib/shorts.js"></script>
+<script>
+'use strict';
+const CHAPTER = { number: 1, title: 'EPISODE TITLE', minutes: 2, language: 'en' };
+
+/* ---------- beats ----------
+ [id, title, run, extra]: id names audio/en/<id>.mp3 and its TIMINGS entry; m('mark') is when the picture for that word
+ lands (shortsBeat puts it LEAD s before the word is heard). shot() starts a full-frame shot; a beat's first shot is
+ on screen from its first frame. */
+const OPEN_PRE = .3;
+const BEATS = [
+ // The hook: the first frame is already a picture in motion, and the first line is the hook itself
+ ['hook', 'The hook', (m, D) => {
+ const p = panel(0);
+ const s = shot(p, 0, undefined);
+ photo(s, 'hook-picture', 0, D, { s0: 1.0, s1: 1.15, dim: .2 });
+ word(s, 'Big word', CX, 640, m('big'), { size: 140, fill: '#fff', stroke: INK });
+ label(s, 'Series · part 1', CX, 1200, .3, { size: 44, fill: RED });
+ }, { pre: OPEN_PRE }],
+].map(shortsBeat);
+
+// One track for the whole film, cut to its timeline; ?bgm= sets its level by ear (gain under the ducking to 30 %)
+music('audio/bgm/ep1.mp3', undefined, +(new URLSearchParams(location.search).get('bgm') || .5), .05);
+startShorts();
+</script>
+</body>
+</html>
diff --git a/.claude/skills/papermorph/assets/templates/shorts/lib/book.css b/.claude/skills/papermorph/assets/templates/shorts/lib/book.css
new file mode 100644
index 0000000..61e6752
--- /dev/null
+++ b/.claude/skills/papermorph/assets/templates/shorts/lib/book.css
@@ -0,0 +1,13 @@
+/* The film's look (here warm paper, ink, one red). Imported by engine.css; engine.py never overwrites it.
+ Keep shorts.js's colours in step. Fonts: lib/fonts.css and lib/fonts/ from the documentary kit. */
+@import url("fonts.css");
+:root {
+ --page: #1b1916; --board: #ece4d3; --panel: #e2d8c4; --edge: #1b1916; /* --edge: the frame outline; the page colour, since every shot is full bleed */
+ --chalk: #1f1b16; --dim: #5d5448; --faint: #a89a82;
+ --task: #c8281e; --quiz: #c8281e; --good: #2f6f73; --bad: #c8281e;
+ --vignette: rgba(90, 70, 40, .22);
+ --rule: #c9bca2; --track: #d6cbb4; --track-ask: #d6cbb4;
+ --bar-edge: #c9bca2; --hover: #ddd2bc; --veil: #ece4d3;
+}
+/* Every shot is full bleed: square corners like a phone video, and nothing light behind the stage's edge. */
+#frame { border-radius: 0; background: var(--page); }
diff --git a/.claude/skills/papermorph/assets/templates/shorts/lib/icons-LICENSE.txt b/.claude/skills/papermorph/assets/templates/shorts/lib/icons-LICENSE.txt
new file mode 100644
index 0000000..cd036c9
--- /dev/null
+++ b/.claude/skills/papermorph/assets/templates/shorts/lib/icons-LICENSE.txt
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 Phosphor Icons
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/.claude/skills/papermorph/assets/templates/shorts/lib/icons.js b/.claude/skills/papermorph/assets/templates/shorts/lib/icons.js
new file mode 100644
index 0000000..bb7e2cb
--- /dev/null
+++ b/.claude/skills/papermorph/assets/templates/shorts/lib/icons.js
@@ -0,0 +1,2 @@
+// Phosphor Icons 2.1.1, fill weight (MIT, lib/icons-LICENSE.txt): inner SVG of a 256 x 256 viewBox. Add more from phosphoricons.com: the paths inside a fill-weight SVG.
+const ICONS = {"armchair": "<path d=\"M240,132a28,28,0,0,1-24,27.71V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V159.71A28,28,0,1,1,72,132v36a8,8,0,0,0,16,0V144h80v24a8,8,0,0,0,16,0V132a28,28,0,0,1,56,0ZM44,88a44.06,44.06,0,0,1,43.81,40h80.38A44.06,44.06,0,0,1,212,88a4,4,0,0,0,4-4V72a40,40,0,0,0-40-40H80A40,40,0,0,0,40,72V84A4,4,0,0,0,44,88Z\"/>", "boat": "<path d=\"M221.06,110.59,208,106.23V56a16,16,0,0,0-16-16H136V24a8,8,0,0,0-16,0V40H64A16,16,0,0,0,48,56v50.23l-13.06,4.36A16,16,0,0,0,24,125.77V152c0,61.54,97.89,86.72,102.06,87.76a8,8,0,0,0,3.88,0C134.11,238.72,232,213.54,232,152V125.77A16,16,0,0,0,221.06,110.59ZM136,168a8,8,0,0,1-16,0V104.87a8,8,0,0,1,16,0Zm56-67.1L130.53,80.41a8,8,0,0,0-5.06,0L64,100.9V56H192Z\"/>", "bowl-food": "<path d=\"M224,104h-8.37a88,88,0,0,0-175.26,0H32a8,8,0,0,0-8,8,104.35,104.35,0,0,0,56,92.28V208a16,16,0,0,0,16,16h64a16,16,0,0,0,16-16v-3.72A104.35,104.35,0,0,0,232,112,8,8,0,0,0,224,104ZM173.48,56.23q2.75,2.25,5.27,4.75a87.92,87.92,0,0,0-49.15,43H100.1A72.26,72.26,0,0,1,168,56C169.83,56,171.66,56.09,173.48,56.23ZM148.12,104a71.84,71.84,0,0,1,41.27-29.57A71.45,71.45,0,0,1,199.54,104ZM128,40a71.87,71.87,0,0,1,19,2.57A88.36,88.36,0,0,0,83.33,104H56.46A72.08,72.08,0,0,1,128,40Z\"/>", "briefcase": "<path d=\"M152,112a8,8,0,0,1-8,8H112a8,8,0,0,1,0-16h32A8,8,0,0,1,152,112Zm80-40V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V72A16,16,0,0,1,40,56H80V48a24,24,0,0,1,24-24h48a24,24,0,0,1,24,24v8h40A16,16,0,0,1,232,72ZM96,56h64V48a8,8,0,0,0-8-8H104a8,8,0,0,0-8,8Zm120,57.61V72H40v41.61A184,184,0,0,0,128,136,184,184,0,0,0,216,113.61Z\"/>", "car-profile": "<path d=\"M240,112H211.31L168,68.69A15.86,15.86,0,0,0,156.69,64H44.28A16,16,0,0,0,31,71.12L1.34,115.56A8.07,8.07,0,0,0,0,120v48a16,16,0,0,0,16,16H33a32,32,0,0,0,62,0h66a32,32,0,0,0,62,0h17a16,16,0,0,0,16-16V128A16,16,0,0,0,240,112ZM44.28,80H156.69l32,32H23ZM64,192a16,16,0,1,1,16-16A16,16,0,0,1,64,192Zm128,0a16,16,0,1,1,16-16A16,16,0,0,1,192,192Z\"/>", "chef-hat": "<path d=\"M240,112a56.06,56.06,0,0,0-56-56c-1.77,0-3.54.1-5.29.26a56,56,0,0,0-101.42,0C75.54,56.1,73.77,56,72,56A56,56,0,0,0,48,162.59V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V162.59A56.09,56.09,0,0,0,240,112Zm-87.76,30.06,8-32a8,8,0,0,1,15.52,3.88l-8,32A8,8,0,0,1,160,152a8.13,8.13,0,0,1-1.95-.24A8,8,0,0,1,152.24,142.06ZM120,112a8,8,0,0,1,16,0v32a8,8,0,0,1-16,0Zm-33.94-7.76a8,8,0,0,1,9.7,5.82l8,32a8,8,0,0,1-5.82,9.7,8.13,8.13,0,0,1-2,.24,8,8,0,0,1-7.75-6.06l-8-32A8,8,0,0,1,86.06,104.24ZM192,208H64V167.42a55.49,55.49,0,0,0,8,.58H184a55.49,55.49,0,0,0,8-.58Z\"/>", "cpu": "<path d=\"M104,104h48v48H104Zm136,48a8,8,0,0,1-8,8H216v40a16,16,0,0,1-16,16H160v16a8,8,0,0,1-16,0V216H112v16a8,8,0,0,1-16,0V216H56a16,16,0,0,1-16-16V160H24a8,8,0,0,1,0-16H40V112H24a8,8,0,0,1,0-16H40V56A16,16,0,0,1,56,40H96V24a8,8,0,0,1,16,0V40h32V24a8,8,0,0,1,16,0V40h40a16,16,0,0,1,16,16V96h16a8,8,0,0,1,0,16H216v32h16A8,8,0,0,1,240,152ZM168,96a8,8,0,0,0-8-8H96a8,8,0,0,0-8,8v64a8,8,0,0,0,8,8h64a8,8,0,0,0,8-8Z\"/>", "crown": "<path d=\"M248,80a28,28,0,1,0-51.12,15.77l-26.79,33L146,73.4a28,28,0,1,0-36.06,0L85.91,128.74l-26.79-33a28,28,0,1,0-26.6,12L47,194.63A16,16,0,0,0,62.78,208H193.22A16,16,0,0,0,209,194.63l14.47-86.85A28,28,0,0,0,248,80ZM128,40a12,12,0,1,1-12,12A12,12,0,0,1,128,40ZM24,80A12,12,0,1,1,36,92,12,12,0,0,1,24,80ZM220,92a12,12,0,1,1,12-12A12,12,0,0,1,220,92Z\"/>", "currency-cny": "<path d=\"M128,16A104,104,0,1,0,232,120,104.11,104.11,0,0,0,128,16ZM88,72h80a8,8,0,0,1,0,16H88a8,8,0,0,1,0-16Zm104,88a8,8,0,0,1-8,8H160a24,24,0,0,1-24-24V120H120a48.05,48.05,0,0,1-48,48,8,8,0,0,1,0-16,32,32,0,0,0,32-32H80a8,8,0,0,1,0-16h96a8,8,0,0,1,0,16H152v24a8,8,0,0,0,8,8h16v-8a8,8,0,0,1,16,0Z\"/>", "dna": "<path d=\"M200,204.5V232a8,8,0,0,1-16,0V204.5a63.67,63.67,0,0,0-35.38-57.25l-48.4-24.19A79.58,79.58,0,0,1,56,51.5V24a8,8,0,0,1,16,0V51.5a63.67,63.67,0,0,0,35.38,57.25l48.4,24.19A79.58,79.58,0,0,1,200,204.5ZM163.18,192H83.91a8,8,0,0,1-8-8.53A8.18,8.18,0,0,1,84.18,176H149.7a4,4,0,0,0,2.75-6.9,48.24,48.24,0,0,0-11-7.53L94.8,138.23a4,4,0,0,0-4.08.3A79.51,79.51,0,0,0,56,204.5v27.23A8.17,8.17,0,0,0,63.47,240,8,8,0,0,0,72,232V216h92a4,4,0,0,0,4-4v-7.5a48.76,48.76,0,0,0-.9-9.32A4,4,0,0,0,163.18,192ZM191.47,16A8.17,8.17,0,0,0,184,24.27V40H92a4,4,0,0,0-4,4v7.5a48.76,48.76,0,0,0,.9,9.32A4,4,0,0,0,92.82,64h79a8.18,8.18,0,0,1,8.25,7.47,8,8,0,0,1-8,8.53H106.3a4,4,0,0,0-2.75,6.9,48.24,48.24,0,0,0,11,7.53l46.67,23.34a4,4,0,0,0,4.08-.3A79.51,79.51,0,0,0,200,51.5V24A8,8,0,0,0,191.47,16Z\"/>", "factory": "<path d=\"M232,208h-8V136c0-.05,0-.09,0-.14s0-.29,0-.43,0-.28,0-.41a.76.76,0,0,0,0-.15l-15-105.13A16.08,16.08,0,0,0,193.06,16H174.94A16.08,16.08,0,0,0,159.1,29.74l-11.56,80.91L108.8,81.6A8,8,0,0,0,96,88v32L44.8,81.6A8,8,0,0,0,32,88V208H24a8,8,0,0,0,0,16H232a8,8,0,0,0,0-16ZM108,184H80a8,8,0,0,1,0-16h28a8,8,0,0,1,0,16Zm68,0H148a8,8,0,0,1,0-16h28a8,8,0,0,1,0,16Zm-5.33-56-8.53-6.4L174.94,32h18.12l13.72,96Z\"/>", "gavel": "<path d=\"M52.69,99.31a16,16,0,0,1,0-22.63l64-64a16,16,0,0,1,22.63,22.63l-64,64a16,16,0,0,1-22.63,0Zm190.63,17.37a16,16,0,0,0-22.63,0l-64,64a16,16,0,0,0,0,22.63h0a16,16,0,0,0,22.63,0l64-64A16,16,0,0,0,243.32,116.68Zm-35.11-15.8L155.12,47.79a4,4,0,0,0-5.66,0L87.8,109.45a4,4,0,0,0,0,5.66L103,130.34,28.69,204.69a16,16,0,0,0,22.62,22.62L125.66,153l15.23,15.23a4,4,0,0,0,5.66,0l61.66-61.66A4,4,0,0,0,208.21,100.88Z\"/>", "graduation-cap": "<path d=\"M176,207.24a119,119,0,0,0,16-7.73V240a8,8,0,0,1-16,0Zm11.76-88.43-56-29.87a8,8,0,0,0-7.52,14.12L171,128l17-9.06Zm64-29.87-120-64a8,8,0,0,0-7.52,0l-120,64a8,8,0,0,0,0,14.12L32,117.87v48.42a15.91,15.91,0,0,0,4.06,10.65C49.16,191.53,78.51,216,128,216a130,130,0,0,0,48-8.76V130.67L171,128l-43,22.93L43.83,106l0,0L25,96,128,41.07,231,96l-18.78,10-.06,0L188,118.94a8,8,0,0,1,4,6.93v73.64a115.63,115.63,0,0,0,27.94-22.57A15.91,15.91,0,0,0,224,166.29V117.87l27.76-14.81a8,8,0,0,0,0-14.12Z\"/>", "house-line": "<path d=\"M240,208H224V136l2.34,2.34A8,8,0,0,0,237.66,127L139.31,28.68a16,16,0,0,0-22.62,0L18.34,127a8,8,0,0,0,11.32,11.31L32,136v72H16a8,8,0,0,0,0,16H240a8,8,0,0,0,0-16Zm-88,0H104V160a4,4,0,0,1,4-4h40a4,4,0,0,1,4,4Z\"/>", "lightning": "<path d=\"M213.85,125.46l-112,120a8,8,0,0,1-13.69-7l14.66-73.33L45.19,143.49a8,8,0,0,1-3-13l112-120a8,8,0,0,1,13.69,7L153.18,90.9l57.63,21.61a8,8,0,0,1,3,12.95Z\"/>", "moped": "<path d=\"M216,128a39.3,39.3,0,0,0-6.27.5L175.49,37.19A8,8,0,0,0,168,32H136a8,8,0,0,0,0,16h26.46l32.3,86.13a40.13,40.13,0,0,0-18,25.87H136.54l-25-66.81A8,8,0,0,0,104,88H24a8,8,0,0,0,0,16h8v13.39A56.12,56.12,0,0,0,0,168a8,8,0,0,0,8,8h8.8a40,40,0,0,0,78.4,0h81.6A40,40,0,1,0,216,128ZM56,192a24,24,0,0,1-22.62-16H78.62A24,24,0,0,1,56,192Zm160,0a24,24,0,0,1-15.43-42.36l7.94,21.17a8,8,0,0,0,15-5.62L215.55,144H216a24,24,0,0,1,0,48Z\"/>", "package": "<path d=\"M223.68,66.15,135.68,18a15.88,15.88,0,0,0-15.36,0l-88,48.17a16,16,0,0,0-8.32,14v95.64a16,16,0,0,0,8.32,14l88,48.17a15.88,15.88,0,0,0,15.36,0l88-48.17a16,16,0,0,0,8.32-14V80.18A16,16,0,0,0,223.68,66.15ZM128,32l80.35,44L178.57,92.29l-80.35-44Zm0,88L47.65,76,81.56,57.43l80.35,44Zm88,55.85h0l-80,43.79V133.83l32-17.51V152a8,8,0,0,0,16,0V107.56l32-17.51v85.76Z\"/>", "paint-roller": "<path d=\"M248,104v50a16.07,16.07,0,0,1-11.6,15.38L136,198v34a8,8,0,0,1-16,0V198a16.07,16.07,0,0,1,11.6-15.38L232,154V104H216v24a16,16,0,0,1-16,16H48a16,16,0,0,1-16-16V104H16a8,8,0,0,1,0-16H32V64A16,16,0,0,1,48,48H200a16,16,0,0,1,16,16V88h16A16,16,0,0,1,248,104Z\"/>", "person": "<path d=\"M100,36a28,28,0,1,1,28,28A28,28,0,0,1,100,36ZM215.42,140.78l-45.25-51.3a28,28,0,0,0-21-9.48H106.83a28,28,0,0,0-21,9.48l-45.25,51.3a16,16,0,0,0,22.56,22.69L89,142.7l-19.7,74.88a16,16,0,0,0,29.08,13.35L128,180l29.58,51a16,16,0,0,0,29.08-13.35L167,142.7l25.9,20.77a16,16,0,0,0,22.56-22.69Z\"/>", "quotes": "<path d=\"M116,72v88a48.05,48.05,0,0,1-48,48,8,8,0,0,1,0-16,32,32,0,0,0,32-32v-8H40a16,16,0,0,1-16-16V72A16,16,0,0,1,40,56h60A16,16,0,0,1,116,72ZM216,56H156a16,16,0,0,0-16,16v64a16,16,0,0,0,16,16h60v8a32,32,0,0,1-32,32,8,8,0,0,0,0,16,48.05,48.05,0,0,0,48-48V72A16,16,0,0,0,216,56Z\"/>", "robot": "<path d=\"M200,48H136V16a8,8,0,0,0-16,0V48H56A32,32,0,0,0,24,80V192a32,32,0,0,0,32,32H200a32,32,0,0,0,32-32V80A32,32,0,0,0,200,48ZM172,96a12,12,0,1,1-12,12A12,12,0,0,1,172,96ZM96,184H80a16,16,0,0,1,0-32H96ZM84,120a12,12,0,1,1,12-12A12,12,0,0,1,84,120Zm60,64H112V152h32Zm32,0H160V152h16a16,16,0,0,1,0,32Z\"/>", "scroll": "<path d=\"M220.8,169.6A8,8,0,0,0,216,168h-8V64a32,32,0,0,0-32-32H40A32,32,0,0,0,8,64C8,77.61,18.05,85.54,19.2,86.4h0A7.89,7.89,0,0,0,24,88a8,8,0,0,0,4.87-14.33h0C28.83,73.62,24,69.74,24,64a16,16,0,0,1,32,0V192a32,32,0,0,0,32,32H200a32,32,0,0,0,32-32C232,178.39,222,170.46,220.8,169.6ZM104,96h64a8,8,0,0,1,0,16H104a8,8,0,0,1,0-16Zm-8,40a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H104A8,8,0,0,1,96,136Zm104,72H107.71A31.82,31.82,0,0,0,112,192a26.92,26.92,0,0,0-1.21-8h102a12.58,12.58,0,0,1,3.23,8A16,16,0,0,1,200,208Z\"/>", "shopping-bag": "<path d=\"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-88,96A48.05,48.05,0,0,1,80,88a8,8,0,0,1,16,0,32,32,0,0,0,64,0,8,8,0,0,1,16,0A48.05,48.05,0,0,1,128,136Z\"/>", "shopping-cart": "<path d=\"M230.14,58.87A8,8,0,0,0,224,56H62.68L56.6,22.57A8,8,0,0,0,48.73,16H24a8,8,0,0,0,0,16h18L67.56,172.29a24,24,0,0,0,5.33,11.27,28,28,0,1,0,44.4,8.44h45.42A27.75,27.75,0,0,0,160,204a28,28,0,1,0,28-28H91.17a8,8,0,0,1-7.87-6.57L80.13,152h116a24,24,0,0,0,23.61-19.71l12.16-66.86A8,8,0,0,0,230.14,58.87ZM104,204a12,12,0,1,1-12-12A12,12,0,0,1,104,204Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,200,204Z\"/>", "solar-panel": "<path d=\"M32,104a8,8,0,0,1,8-8H56a8,8,0,0,1,0,16H40A8,8,0,0,1,32,104ZM71.43,58.75A8,8,0,0,0,82.75,47.43L71.43,36.12A8,8,0,0,0,60.12,47.43ZM128,40a8,8,0,0,0,8-8V16a8,8,0,0,0-16,0V32A8,8,0,0,0,128,40Zm50.91,21.09a8,8,0,0,0,5.66-2.34l11.31-11.32a8,8,0,0,0-11.31-11.31L173.25,47.43a8,8,0,0,0,5.66,13.66ZM192,104a8,8,0,0,0,8,8h16a8,8,0,0,0,0-16H200A8,8,0,0,0,192,104ZM88,112a8,8,0,0,0,8-8,32,32,0,0,1,64,0,8,8,0,0,0,16,0,48,48,0,0,0-96,0A8,8,0,0,0,88,112Zm55.2,24H112.8a4,4,0,0,0-3.91,3.15L102.62,168h50.76l-6.27-28.85A4,4,0,0,0,143.2,136ZM31.75,186,17,212.06a8,8,0,0,0,1.16,9.45,8.22,8.22,0,0,0,6,2.49H70.85a4,4,0,0,0,3.91-3.15l8-36.85H35.23A4,4,0,0,0,31.75,186Zm207.21,26-14.71-26a4,4,0,0,0-3.48-2H173.23l8,36.85a4,4,0,0,0,3.91,3.15h46.62a8.22,8.22,0,0,0,6-2.49A8,8,0,0,0,239,212.06Zm-28.27-50-12.42-22a8,8,0,0,0-7-4.06H167.76a4,4,0,0,0-3.91,4.85l5.9,27.15H207.2A4,4,0,0,0,210.69,162ZM88.24,136H64.7a8,8,0,0,0-7,4.06L45.31,162a4,4,0,0,0,3.49,6H86.25l5.9-27.15A4,4,0,0,0,88.24,136Zm68.62,48H99.14L91.5,219.15A4,4,0,0,0,95.41,224h65.18a4,4,0,0,0,3.91-4.85Z\"/>", "sparkle": "<path d=\"M208,144a15.78,15.78,0,0,1-10.42,14.94L146,178l-19,51.62a15.92,15.92,0,0,1-29.88,0L78,178l-51.62-19a15.92,15.92,0,0,1,0-29.88L78,110l19-51.62a15.92,15.92,0,0,1,29.88,0L146,110l51.62,19A15.78,15.78,0,0,1,208,144ZM152,48h16V64a8,8,0,0,0,16,0V48h16a8,8,0,0,0,0-16H184V16a8,8,0,0,0-16,0V32H152a8,8,0,0,0,0,16Zm88,32h-8V72a8,8,0,0,0-16,0v8h-8a8,8,0,0,0,0,16h8v8a8,8,0,0,0,16,0V96h8a8,8,0,0,0,0-16Z\"/>", "storefront": "<path d=\"M231.69,93.81,217.35,43.6A16.07,16.07,0,0,0,202,32H54A16.07,16.07,0,0,0,38.65,43.6L24.31,93.81A7.94,7.94,0,0,0,24,96v16a40,40,0,0,0,16,32v72a8,8,0,0,0,8,8H208a8,8,0,0,0,8-8V144a40,40,0,0,0,16-32V96A7.94,7.94,0,0,0,231.69,93.81ZM88,112a24,24,0,0,1-35.12,21.26,7.88,7.88,0,0,0-1.82-1.06A24,24,0,0,1,40,112v-8H88Zm64,0a24,24,0,0,1-48,0v-8h48Zm64,0a24,24,0,0,1-11.07,20.2,8.08,8.08,0,0,0-1.8,1.05A24,24,0,0,1,168,112v-8h48Z\"/>", "t-shirt": "<path d=\"M247.59,61.22,195.83,33A8,8,0,0,0,192,32H160a8,8,0,0,0-8,8,24,24,0,0,1-48,0,8,8,0,0,0-8-8H64a8,8,0,0,0-3.84,1L8.41,61.22A15.76,15.76,0,0,0,1.82,82.48l19.27,36.81A16.37,16.37,0,0,0,35.67,128H56v80a16,16,0,0,0,16,16H184a16,16,0,0,0,16-16V128h20.34a16.37,16.37,0,0,0,14.58-8.71l19.27-36.81A15.76,15.76,0,0,0,247.59,61.22ZM35.67,112a.62.62,0,0,1-.41-.13L16.09,75.26,56,53.48V112Zm185.07-.14a.55.55,0,0,1-.41.14H200V53.48l39.92,21.78Z\"/>", "trend-down": "<path d=\"M240,128v64a8,8,0,0,1-8,8H168a8,8,0,0,1-5.66-13.66L188.69,160,136,107.31l-34.34,34.35a8,8,0,0,1-11.32,0l-72-72A8,8,0,0,1,29.66,58.34L96,124.69l34.34-34.35a8,8,0,0,1,11.32,0L200,148.69l26.34-26.35A8,8,0,0,1,240,128Z\"/>", "trend-up": "<path d=\"M240,56v64a8,8,0,0,1-13.66,5.66L200,99.31l-58.34,58.35a8,8,0,0,1-11.32,0L96,123.31,29.66,189.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0L136,140.69,188.69,88,162.34,61.66A8,8,0,0,1,168,48h64A8,8,0,0,1,240,56Z\"/>", "users-three": "<path d=\"M64.12,147.8a4,4,0,0,1-4,4.2H16a8,8,0,0,1-7.8-6.17,8.35,8.35,0,0,1,1.62-6.93A67.79,67.79,0,0,1,37,117.51a40,40,0,1,1,66.46-35.8,3.94,3.94,0,0,1-2.27,4.18A64.08,64.08,0,0,0,64,144C64,145.28,64,146.54,64.12,147.8Zm182-8.91A67.76,67.76,0,0,0,219,117.51a40,40,0,1,0-66.46-35.8,3.94,3.94,0,0,0,2.27,4.18A64.08,64.08,0,0,1,192,144c0,1.28,0,2.54-.12,3.8a4,4,0,0,0,4,4.2H240a8,8,0,0,0,7.8-6.17A8.33,8.33,0,0,0,246.17,138.89Zm-89,43.18a48,48,0,1,0-58.37,0A72.13,72.13,0,0,0,65.07,212,8,8,0,0,0,72,224H184a8,8,0,0,0,6.93-12A72.15,72.15,0,0,0,157.19,182.07Z\"/>", "wrench": "<path d=\"M232,96a72,72,0,0,1-100.94,66L79,222.22c-.12.14-.26.29-.39.42a32,32,0,0,1-45.26-45.26c.14-.13.28-.27.43-.39L94,124.94a72.07,72.07,0,0,1,83.54-98.78,8,8,0,0,1,3.93,13.19L144,80l5.66,26.35L176,112l40.65-37.52a8,8,0,0,1,13.19,3.93A72.6,72.6,0,0,1,232,96Z\"/>"};
diff --git a/.claude/skills/papermorph/assets/templates/shorts/lib/shorts.js b/.claude/skills/papermorph/assets/templates/shorts/lib/shorts.js
new file mode 100644
index 0000000..d7a5353
--- /dev/null
+++ b/.claude/skills/papermorph/assets/templates/shorts/lib/shorts.js
@@ -0,0 +1,198 @@
+/* shorts.js: the shorts kit, for an upright film (<html data-stage="portrait">, 900 x 1600) on a phone feed.
+ This is the book's own copy: set its look here (colours below, fonts in lib/fonts.css) and add the film's own pieces
+ (its cast's sizes, its recurring cards, a map) in a second file of the book, loaded after this one.
+ Loaded after engine.js, timings.js and icons.js; a chapter defines CHAPTER and BEATS (plain tuples mapped with
+ shortsBeat), calls the engine's music() and then startShorts(). Every helper is a pure function of the beat clock, so
+ pause, seek, ?beat=N&t=S and export.py agree. Sound effects are the engine's sfx(); BEAT_ID lets helpers call it. */
+'use strict';
+/* ---------- the look ----------
+ Full bleed, one idea per shot, 1–3 s a shot.
+ Platforms draw over the top 120 and the bottom 300 of the 900 x 1600 stage, and their buttons over the right 90
+ between y 700 and 1300: words stay in x 50..810, y 130..1290. Pictures may run under all of it. */
+const KEY = '"Oswald", "Arial Narrow", sans-serif', SER = '"EB Garamond", Georgia, serif';
+const INK = '#1f1b16', RED = '#c8281e', TEAL = '#2f6f73', PAPER = '#ece4d3', SOFT = '#8a7d68', MARK = '#ffd23f', SEA = '#123c44';
+const CX = 450, W = 900, H = 1600;
+const CTX = document.createElement('canvas').getContext('2d');
+const wid = (str, size, font = KEY, weight = 600) => { CTX.font = `${weight} ${size}px ${font}`; return CTX.measureText(str).width; };
+const rect = (p, x, y, w, h, attrs = {}) => mk('rect', { x, y, width: w, height: h, ...attrs }, p);
+const span01 = (t, a, b) => Math.min(1, Math.max(0, (t - a) / (b - a)));
+const smooth = q => q * q * (3 - 2 * q);
+function rng(seed) { return () => (seed = (seed * 16807) % 2147483647) / 2147483647; }
+// the cut-out figures' widths at 1000 tall, by file name: the book fills it, Object.assign(MEME, { 'meme-cook': 672 })
+const MEME = {};
+// one meme crossing the frame left to right, then a fast swarm of the same (smaller and higher is farther away):
+// first at t0 for `cross` s, h tall with its foot at y; then n more from t0 + after
+function swarm(g, name, t0, { h = 560, y = 1500, cross = 1.6, n = 16, after = 1.3, seed = 7, hmin = 300, ymin = 1180 } = {}) {
+ const w = MEME[name] * h / 1000;
+ const e = meme(g, name, -w / 2 - 40, y, h, t0, { rise: 0, dur: .01 });
+ tw(e, { x: W + w / 2 + 40 }, t0, cross, lin); sfx(BEAT_ID, t0 + .1, 'whoosh', .6);
+ const R = rng(seed);
+ for (let i = 0; i < n; i++) {
+ const t1 = t0 + after + i * .12 + R() * .08, far = R(), hh = hmin + (1 - far) * (h - hmin), ww = MEME[name] * hh / 1000;
+ const f = meme(g, name, -ww / 2 - 20, ymin + (1 - far) * (y - ymin), hh, t1, { rise: 0, dur: .01 });
+ tw(f, { x: W + ww / 2 + 20 }, t1, .55 + far * .35, lin);
+ if (i % 4 === 0) sfx(BEAT_ID, t1, 'whoosh', .35);
+ }
+}
+
+// A shot: a full-frame group on screen from t0 to t1, a hard cut in and out; `whip` slides it in with motion blur.
+let fxN = 0;
+function shot(p, t0, t1, { bg, whip = false, swipe = false } = {}) {
+ const g = G(p, { o: 0 });
+ if (bg) rect(g, -20, -20, W + 40, H + 40, { fill: bg });
+ if (t0 <= .01) put(g, { o: 1 }); else show(g, t0, .01, lin); // a beat's first shot is there on its first frame
+ // the old shot stays until the next one has finished sliding in (whip, swipe), so nothing shows through behind it
+ if (t1 !== undefined) hide(g, t1 + .28, .01, lin);
+ if (whip) {
+ const id = 'whip' + (++fxN), f = mk('filter', { id, x: '-30%', y: 0, width: '160%', height: '100%' }, mk('defs', {}, g));
+ const b = mk('feGaussianBlur', { stdDeviation: '0 0' }, f);
+ g.setAttribute('filter', `url(#${id})`);
+ prog(q => { put(g, { x: W * .6 * (1 - q) }); b.setAttribute('stdDeviation', `${(1 - q) * 60} 0`); }, t0, .26, out);
+ sfx(BEAT_ID, t0, 'whoosh', .5);
+ }
+ if (swipe) { // a feed scrolled up: the next clip rises from the bottom, blurred along its motion
+ const id = 'swp' + (++fxN), f = mk('filter', { id, x: 0, y: '-30%', width: '100%', height: '160%' }, mk('defs', {}, g));
+ const b = mk('feGaussianBlur', { stdDeviation: '0 0' }, f);
+ g.setAttribute('filter', `url(#${id})`);
+ prog(q => { put(g, { y: H * (1 - q) }); b.setAttribute('stdDeviation', `0 ${(1 - q) * 50}`); }, t0, .2, out);
+ sfx(BEAT_ID, t0, 'whoosh', swipe === 'quiet' ? .18 : .4);
+ }
+ return g;
+}
+let BEAT_ID = ''; // the beat being built, for sfx() calls made by helpers
+// a full-bleed picture with a slow push from scale s0 to s1 (and drift dx, dy) over t0..t1
+function photo(g, name, t0, t1, { s0 = 1.02, s1 = 1.1, dx = 0, dy = 0, dim = 0, ai = true } = {}) {
+ const im = G(g, { x: CX, y: H / 2, s: s0 });
+ mk('image', { href: `../img/${name}.webp`, x: -W / 2, y: -H / 2, width: W, height: H, preserveAspectRatio: 'xMidYMid slice' }, im);
+ tw(im, { s: s1, x: CX + dx, y: H / 2 + dy }, t0, t1 - t0, lin);
+ if (dim) rect(g, 0, 0, W, H, { fill: '#000', opacity: dim });
+ if (ai) tag(g, 'AI illustration', 50, 150, t0);
+ return im;
+}
+// a small grey label top left: a source or "AI illustration"; shown with ?tags (export.py --query tags), so a cut
+// being worked on stays clean while the calls stay in place
+const TAGS = new URLSearchParams(location.search).has('tags');
+function tag(g, str, x, y, t0) {
+ if (!TAGS) return G(g, { o: 0 });
+ const e = G(g, { x, y, o: 0 }), w = wid(str.toUpperCase(), 20, KEY, 500) + 20;
+ rect(e, 0, -22, w, 30, { fill: 'rgba(20,18,15,.55)', rx: 3 });
+ T(e, str.toUpperCase(), { x: 10, y: 0, size: 20, fill: '#f0ebe0', font: KEY, weight: 500 }).setAttribute('letter-spacing', '.06em');
+ show(e, t0, .2, lin);
+ return e;
+}
+// big condensed capitals popping in (a word or two); stroke: a dark edge to read over pictures
+function word(g, str, x, y, t0, { size = 120, fill = INK, anchor = 'middle', stroke, dur = .22, from = .82 } = {}) {
+ const e = G(g, { x, y, s: from, o: 0 });
+ const t = T(e, str.toUpperCase(), { x: 0, y: 0, size, fill, font: KEY, weight: 600, anchor });
+ if (stroke) { t.setAttribute('stroke', stroke); t.setAttribute('stroke-width', size / 14); t.setAttribute('paint-order', 'stroke'); t.setAttribute('stroke-linejoin', 'round'); }
+ if (t0 <= .01) put(e, { s: 1, o: 1 }); else tw(e, { s: 1, o: 1 }, t0, dur, out); // there on a beat's first frame
+ e._w = wid(str.toUpperCase(), size);
+ return e;
+}
+// a label: caps on a solid block (Vox's MARY / JESUS chips); not `chip`, which is the engine's own
+function label(g, str, x, y, t0, { size = 40, fill = INK, colour = PAPER, anchor = 'middle', pad = 18 } = {}) {
+ const w = wid(str.toUpperCase(), size, KEY, 600) + pad * 2, x0 = anchor === 'middle' ? -w / 2 : anchor === 'end' ? -w : 0;
+ const e = G(g, { x, y, s: .85, o: 0 });
+ rect(e, x0, -size * .95, w, size * 1.3, { fill, rx: 4 });
+ T(e, str.toUpperCase(), { x: x0 + pad, y: 0, size, fill: colour, font: KEY, weight: 600 });
+ tw(e, { s: 1, o: 1 }, t0, .18, out);
+ return e;
+}
+// lines of a sentence as stacked chips, each popping in turn
+function band(g, lines, y, t0, { size = 64, fill = INK, colour = PAPER, step = .25, lh = 1.3 } = {}) {
+ lines.forEach((l, i) => label(g, l, CX, y + i * size * lh, t0 + i * step, { size, fill, colour }));
+}
+// a yellow marker swept behind [x, y, w, h]
+function marker(g, x, y, w, h, t0, dur = .3) {
+ const r = rect(g, x, y, 0, h, { fill: MARK });
+ prog(q => r.setAttribute('width', w * q), t0, dur, out);
+ return r;
+}
+// a Phosphor icon (fill weight), size px square, centred on (x, y)
+function ico(g, name, x, y, size, fill, t0, { from = .5, dur = .25 } = {}) {
+ const e = G(g, { x, y, s: from, o: 0 });
+ const sv = mk('svg', { x: -size / 2, y: -size / 2, width: size, height: size, viewBox: '0 0 256 256', fill }, e);
+ sv.innerHTML = ICONS[name];
+ if (t0 === undefined) put(e, { s: 1, o: 1 }); else tw(e, { s: 1, o: 1 }, t0, dur, out);
+ return e;
+}
+// a meme cut-out, h tall, its foot at (x, y); rises in from below
+function meme(g, name, x, y, h, t0, { flip = false, rise = 260, dur = .35 } = {}) {
+ const w = MEME[name] * h / 1000, e = G(g, { x, y: y + rise, o: 0 });
+ const im = mk('image', { href: `../img/${name}.webp`, x: -w / 2, y: -h, width: w, height: h }, e);
+ if (flip) im.setAttribute('transform', 'scale(-1,1)');
+ if (t0 <= .01 && rise === 0) put(e, { y, o: 1 }); else tw(e, { y, o: 1 }, t0, dur, out); // already standing on a beat's first frame
+ e._y = y;
+ return e;
+}
+// a rubber stamp slammed on
+function stamp(g, str, x, y, t0, { size = 110, colour = RED, r = -9 } = {}) {
+ const w = wid(str, size) + 60, e = G(g, { x, y, r, s: 1.7, o: 0 });
+ rect(e, -w / 2, -size * .85, w, size * 1.2, { fill: 'none', stroke: colour, 'stroke-width': size / 11, rx: 10 });
+ T(e, str, { y: size * .3, size, fill: colour, font: KEY, weight: 600, anchor: 'middle' });
+ tw(e, { s: 1, o: 1 }, t0, .16, out);
+ sfx(BEAT_ID, t0, 'bang', 1.4);
+ return e;
+}
+// a number counting up to n over dur
+function counter(g, n, x, y, t0, { size = 90, fill = INK, anchor = 'middle', dur = 1.1, pre = '', ticks = true } = {}) {
+ const t = T(g, pre + '0', { x, y, size, fill, font: KEY, weight: 600, anchor, o: 0 });
+ show(t, t0, .1, lin);
+ prog(q => { t.textContent = pre + Math.round(n * q).toLocaleString('en-US'); }, t0, dur, out);
+ if (ticks) for (let k = 0; k < 6; k++) sfx(BEAT_ID, t0 + k * dur / 6, 'tick', .45);
+ return t;
+}
+// a phone-shaped card holding a picture (rounded, black rim)
+function phoneCard(g, x, y, w, h, img) {
+ const e = G(g, { x, y }), id = 'pc' + (++fxN);
+ rect(e, -w / 2 - 10, -h / 2 - 10, w + 20, h + 20, { rx: 34, fill: INK });
+ mk('rect', { x: -w / 2, y: -h / 2, width: w, height: h, rx: 26 }, mk('clipPath', { id }, mk('defs', {}, e)));
+ const im = mk('image', { href: `../img/${img}.webp`, x: -w / 2, y: -h / 2, width: w, height: h, preserveAspectRatio: 'xMidYMid slice' }, e);
+ im.setAttribute('clip-path', `url(#${id})`);
+ return e;
+}
+// white overlay text the way a travel vlog captions itself
+const vlog = (g, str, y, t0) => word(g, str, CX, y, t0, { size: 96, fill: '#fff', stroke: '#000' });
+// Pictures lead the voice: every cue lands LEAD s before its word, so a cut (and its 0.2 s swipe) is complete as the
+// word is heard. Cutting on the word itself reads as late.
+const LEAD = .22;
+
+/* ---------- charts and cards ---------- */
+// a grid of icons: n of them, cols across, from (x, y), cell size c, popping in over dur
+function icons(g, name, n, cols, x, y, c, colour, t0, dur = .8) {
+ const out = [];
+ for (let i = 0; i < Math.ceil(n); i++) {
+ const e = ico(g, name, x + (i % cols) * c + c / 2, y + Math.floor(i / cols) * c + c / 2, c * .86, colour, t0 + dur * i / Math.ceil(n), { from: .3, dur: .14 });
+ out.push(e);
+ }
+ return out;
+}
+// a bar growing from a base line: up (v > 0) or down (v < 0), k px per unit
+function bar(g, x, base, w, v, k, colour, t0, dur = .5) {
+ const b = rect(g, x, base, w, 0, { fill: colour });
+ prog(q => { const h = Math.abs(v) * k * q; b.setAttribute('y', v > 0 ? base - h : base); b.setAttribute('height', h); }, t0, dur, out);
+ return b;
+}
+// a picture cut to a rectangle
+function clipImg(g, name, x, y, w, h, rx = 0) {
+ const id = 'ci' + (++fxN);
+ mk('rect', { x, y, width: w, height: h, rx }, mk('clipPath', { id }, mk('defs', {}, g)));
+ mk('image', { href: `../img/${name}.webp`, x, y, width: w, height: h, preserveAspectRatio: 'xMidYMid slice' }, g).setAttribute('clip-path', `url(#${id})`);
+}
+/* an ink price tag */
+function priceTag(p, x, y, str, t0, colour = INK) {
+ const g = G(p, { x, y, o: 0, r: -4, s: 1.2 }), w = wid(str, 80, SER, 500) + 90;
+ path(g, `M0 0L40 -56H${w}V56H40Z`, { fill: '#f6f1e6', stroke: colour, 'stroke-width': 5 });
+ mk('circle', { cx: 36, cy: 0, r: 11, fill: 'none', stroke: colour, 'stroke-width': 5 }, g);
+ T(g, str, { x: 66, y: 26, size: 80, fill: colour, font: SER, weight: 500 });
+ tw(g, { o: 1, s: 1 }, t0, .2, out);
+ return g;
+}
+
+// A beat tuple to the engine's beat: BEAT_ID for the helpers' sound effects, and every cue LEAD s early.
+const shortsBeat = ([id, title, run, extra]) => ({ id, title, lead: false, ...extra,
+ run: (m, D) => { BEAT_ID = id; return run((k, off = 0) => Math.max(0, m(k, off) - LEAD), D); } });
+
+// the fonts must be in before words are measured
+const startShorts = () => Promise.all(['600 40px Oswald', '500 40px Oswald', 'italic 400 40px "EB Garamond"', '400 40px "EB Garamond"', '500 40px "EB Garamond"']
+ .map(f => document.fonts.load(f))).then(boot);
diff --git a/.claude/skills/papermorph/references/documentary.md b/.claude/skills/papermorph/references/documentary.md
index abaa377..ebce5f6 100644
--- a/.claude/skills/papermorph/references/documentary.md
+++ b/.claude/skills/papermorph/references/documentary.md
@@ -65,4 +65,4 @@ After the first cut, an independent director pass: a fresh agent on a strong mod
## Later
-Vertical shorts (a 9:16 stage, faster cuts, a single music track cut to the timeline) are being worked out on their own branch and are not yet part of this path.
+Upright shorts for a phone feed (a 9:16 stage, faster cuts, one music track for the whole film) have their own path: [shorts.md](shorts.md).
diff --git a/.claude/skills/papermorph/references/shorts.md b/.claude/skills/papermorph/references/shorts.md
new file mode 100644
index 0000000..12e1b96
--- /dev/null
+++ b/.claude/skills/papermorph/references/shorts.md
@@ -0,0 +1,56 @@
+# Shorts: one point, under three minutes, upright, for a phone feed
+
+A short is a narrated film on an upright 900 × 1600 stage (`<html data-stage="portrait">`), made for YouTube Shorts, TikTok, Reels or X. It makes one point in one to three minutes, with a new picture every one to three seconds: full-bleed photographs or generated pictures, big words, cut-out figures, a number counting up, a chart, a map. It is a cousin of the [documentary](documentary.md) and shares its voice, pictures, export and review; what differs is the pace, the grammar of the picture and where it ends up. The worked example is episode 1 of *Madness and Civilization* (`site/madness-shorts/ch01/`, *The Ship*), the ten-minute [documentary](documentary.md) on the shelf (`site/madness/`) recut as a series of shorts: watch it before making one, and treat it as a level to match, not a format to copy.
+
+What is its own: the kit `assets/templates/shorts/` (`chapter.html`; `lib/shorts.js`, `book.css`, `icons.js`; fonts from the documentary kit) and the order of work below. It needs an engine with the upright stage ([engine.md](engine.md#stage-and-state)); an upright chapter is a film without questions.
+
+## What the viewer is doing
+
+They are scrolling. They decide in the first second whether to stay, and on the platforms' numbers that second is most of the outcome: one of our episodes opened on a generated city picture already moving, under its first line, and 57.8 % stayed past the first chance to swipe; another opened on a still card of text and 12.8 % stayed. A text card reads as a text post, and a line in a script the viewer cannot read is a wall. So the first frame is a picture in motion with the hook spoken over it, and the hook is the point itself, not a preamble ("there's a line that went viral…" spends the second that matters).
+
+After that they stay as long as each moment gives them something new and the argument keeps moving. Background facts are where a short gets slow: compress them hardest and keep the steps of the argument.
+
+## Questions for the user
+
+The short is the user's argument; the Skill's work is to make it land. Ask, offering choices to click and skipping what the request already settles:
+
+1. **The point.** What should a viewer believe or wonder about at the end? Who is the viewer (an overseas feed, a home audience), and which platform?
+2. **The outline.** Ask for the user's outline before writing anything: the hook, the steps, the ending. If there is none, build the outline together; do not invent the argument. A series: its name, the episode's number, and how this episode hands on to the next.
+3. **People.** How real people appear: period pictures for the dead, cut-out figures or drawings for the living, never photographs of living people's faces.
+4. **Sources.** Which numbers and quotes need a source, and how strict to be about anonymous reports ("according to the Wall Street Journal…").
+5. **Voice and music.** The narrator (ElevenLabs v4 through OpenRouter was the accepted voice; Edge TTS is the free option): play short samples and let the user pick. Music: generated (Lyria) or a public-domain recording ([documentary.md](documentary.md#intake) has the licence traps).
+6. **Pictures and budget.** Generated pictures, found ones, or both; what each costs per episode (voice about $0.07 a minute; 94 generated pictures at low quality cost $0.84 for one three-episode series).
+
+Then agree the models ([intake.md](intake.md#5-models): writing the script with the user is strong-model work, building beats middle, checks small) and write `style.json` with `tier: "shorts"`, the user's words, the look, the voice, the series and the models.
+
+## The order of work
+
+1. **The script, beat by beat, with the user.** One beat per sentence or two, written into `content/<book>/chNN/narration.en.json` with `[[mark]]` before each word a picture lands on, and beside each beat one line of what we see. Show it to the user a few beats at a time and rewrite as they answer; list each number's source under the script as you go, so the script file reads: the user's outline, the beats, the sources.
+2. **The cast and the pictures**, planned from the script: who appears where, one figure per role, so that a figure coming back means something (a callback), not that the cast ran out. Note each picture's prompt or source and cost.
+3. **The folder.** `engine.py site/<book>` first (it starts `lib/` with the engine and a default `book.css`), then the kit's `lib/` over it, with the documentary kit's `fonts.css` and `fonts/`; `chNN/index.html` starts from the kit's `chapter.html` (the commands are in [site.md](site.md#a-short)). The film's own pieces (its cast's sizes in `MEME`, a series card, a map) go in a second file loaded after `shorts.js` (*Madness and Civilization*: `lib/madness.js`).
+4. **Voice.** `eleven.py` or `tts.py`, one clip per beat plus `timings.js`. Bring every clip to one level with `level.py --lufs -14 --peak -1.5` (one episode came out of the voice service at −23 LUFS and sank under its music). Check the marks on spoken numbers: a transcript that writes "1.4 billion" as digits misplaced two marks by 2.7 s.
+5. **Music.** One track for the whole episode under every beat, `music(file, undefined, gain, .05)`. It changes by easing, at a turn of the argument, never by stopping: a dead stop on a rhetorical question felt staged to the user. A track cut to the film's length can end on the last word; a looping one is fine for a first cut. Leave `?bgm=` on the page so the user can set the level by ear; start around 0.4, which with the engine's ducking put the music about 16 LU under a −14 LUFS voice and was the level the user chose. A measurement catches gross errors; the ear decides.
+6. **The beats**, built from the kit and timed to the marks; sound effects (`sfx.py whoosh bang tick thud`) under the cuts and the stamps.
+7. **Watch it yourself, then a director pass.** Contact sheets of every beat (`strip.py`), the first frame on its own, a phone-sized screenshot with the platform's buttons in mind. A fresh agent on a strong model reviews the sheets against an approved episode without knowing how the beats were built ([documentary.md](documentary.md#review-rounds)); half of what it finds is usually the picture saying something other than the voice.
+8. **The user watches**, you fix, and `export.py chNN --url …/<book>/` writes a 1080 × 1920 MP4 and an `.srt` (`--query tags` to show the source and AI-illustration tags). The user uploads it and ticks the platform's AI or synthetic-content box. A video over 25 MiB does not fit Cloudflare Pages; the web page itself is the light version.
+
+## The picture
+
+`shorts.js` holds the grammar, every helper a pure function of the beat clock:
+
+- `shot()` a full-frame shot with a hard cut, `whip` (a sideways slide with motion blur) or `swipe` (the next clip rising as in a feed); `photo()` a full-bleed picture with a slow push;
+- `word()` big condensed capitals, `label()` and `band()` caps on solid blocks, `marker()` a highlighter sweep, `vlog()` white outlined overlay text, `tag()` a source or "AI illustration";
+- `meme()` a cut-out figure rising in, `swarm()` one crossing then a crowd of them, `stamp()` a rubber stamp slammed on, `counter()` a number counting up, `priceTag()`, `phoneCard()`, `ico()` and `icons()` (Phosphor, MIT), `bar()`, `clipImg()`;
+- `shortsBeat` turns a beat tuple into the engine's beat with every cue `LEAD` (0.22 s) early: a cut that lands on the word itself reads as late.
+
+What made the first shorts work:
+
+- **One idea per shot, one to three seconds a shot**, full bleed; words inside x 50–810, y 130–1290, since the platform draws its title, caption and buttons over the rest.
+- **Say it literally.** When the narration describes a mechanism, draw each link as the voice names it. The "everyone is cheap" loop read as a vague circle until it became three people, each handing the next their product and its price, A to B, B to C, C back to A.
+- **Numbers move.** A count, a bar growing, a price tag swapped: a number on screen arrives the moment it is said.
+- **A series says where it is.** A few seconds after the hook: the series card with this episode lit ("1 · The Ship"), then the argument.
+- **The ending points on.** The last beat answers the hook and names the next episode.
+
+## Later
+
+Scripts to come: cutting one music track to an episode's timeline (beats on the music's own beat, the end on the last word), generating music with Lyria, and measuring voice against music the way `export.py` mixes them.
diff --git a/.claude/skills/papermorph/references/site.md b/.claude/skills/papermorph/references/site.md
index 53e2efe..ffc921f 100644
--- a/.claude/skills/papermorph/references/site.md
+++ b/.claude/skills/papermorph/references/site.md
@@ -75,6 +75,23 @@ cp "$DK/narration.en.json" "content/$BOOK_ID/ch01/"
echo 'window.ART = {};' > "$BOOK_SITE/img/art.js"
```
+### A short
+
+Like a documentary: `engine.py` first, then the shorts kit's `lib/` over it, with the documentary kit's fonts. Each episode is a chapter; its sound effects come from `sfx.py`. The commands for an empty book (a series page and shelf registration come later, as for any book):
+
+```sh
+BOOK_ID=short
+BOOK_SITE="site/$BOOK_ID"
+SK="$SKILL/assets/templates/shorts"
+DK="$SKILL/assets/templates/documentary"
+mkdir -p "$BOOK_SITE/lib" "$BOOK_SITE/img" "$BOOK_SITE/ch01/audio/sfx" "content/$BOOK_ID/ch01" "books/$BOOK_ID/art"
+python3 "$SKILL/scripts/engine.py" "$BOOK_SITE"
+cp -R "$SK"/lib/. "$BOOK_SITE/lib/"
+cp -R "$DK/lib/fonts.css" "$DK/lib/fonts" "$BOOK_SITE/lib/"
+cp "$SK/chapter.html" "$BOOK_SITE/ch01/index.html"
+uv run --with numpy python "$SKILL/scripts/sfx.py" "$BOOK_SITE/ch01/audio/sfx" whoosh bang tick thud
+```
+
The chapter loads `../img/art.js`, which `prep.py` fills as pictures are treated; until then the kit's sample beat needs one picture named `first-picture`. Voice the sample with `uv run --with edge-tts python "$SKILL/scripts/tts.py" "content/$BOOK_ID/ch01/narration.en.json" "$BOOK_SITE/ch01/audio/en"` to check the folder works, then replace the narration with the film's script ([documentary.md](documentary.md#the-order-of-work)).
### Every book