{
  "$schema": "../../schema.json",
  "type": "recipe",
  "version": "1.0.0",
  "license": "MIT",
  "id": "manifesto",
  "title": "Manifesto",
  "summary": "Words only: three statements in the brand's voice, each arriving its own way, a turn where one word becomes the name, then what it is and the action, in 18 s.",
  "tags": [
    "recipe",
    "manifesto",
    "words",
    "typographic",
    "statement",
    "16:9",
    "9:16"
  ],
  "params": [
    {
      "name": "statement1",
      "type": "string",
      "default": "Tools were made for hands.",
      "description": "statement one (under eight words)",
      "group": "main",
      "control": "text"
    },
    {
      "name": "statement2",
      "type": "string",
      "default": "Agents have none.",
      "description": "statement two",
      "group": "main",
      "control": "text"
    },
    {
      "name": "statement3",
      "type": "string",
      "default": "So we made the tool speak.",
      "description": "statement three",
      "group": "main",
      "control": "text"
    },
    {
      "name": "what",
      "type": "string",
      "default": "",
      "description": "what the brand is, in plain words; empty reads IDENTITY.md",
      "group": "main",
      "control": "text"
    },
    {
      "name": "action",
      "type": "string",
      "default": "your.site",
      "description": "the one action at the end",
      "group": "main",
      "control": "text"
    },
    {
      "name": "background",
      "type": "string",
      "default": "",
      "description": "a background id from the registry; empty uses the brand's first",
      "group": "main",
      "control": "select"
    },
    {
      "name": "format",
      "type": "enum",
      "default": "1920x1080",
      "options": [
        "1920x1080",
        "1080x1920",
        "1080x1080"
      ],
      "description": "output size",
      "group": "main",
      "control": "segmented"
    }
  ],
  "install": {
    "kind": "scene"
  },
  "files": [
    {
      "path": "pieces/manifesto/scene.html",
      "content": "<!doctype html>\n<html>\n<head>\n<meta charset=\"utf-8\">\n<title>manifesto</title>\n<!--\n  Recipe · manifesto (18 s). Words only: three statements, a turn, the name.\n  One idea: the statements stand in space at different depths and the camera walks toward them, through them. Each\n  sentence is large and close when it speaks, then slides past the lens, soft, as the next one sharpens ahead. The\n  path bends (a little yaw each step) so the words are seen from a slightly different angle every time; the turn is\n  the camera settling straight on the name.\n  Statement 1 0–4 s · Statement 2 4–8 s · Statement 3 8–12 s · Turn 12–15 s · Close 15–18 s.\n  Look, fonts, pace and sound come from /brand (serve from the project root). Edit CONFIG first: three statements\n  under eight words, in the brand's voice.\n-->\n<style>\n  #stage { overflow: hidden; }\n  .abs { position: absolute; box-sizing: border-box; }\n  .place { display: flex; flex-direction: column; align-items: flex-start; text-align: left; box-sizing: border-box; }\n  .place.center { align-items: center; text-align: center; }\n</style>\n</head>\n<body>\n<main id=\"stage\">\n  <div id=\"bg\" class=\"abs\" style=\"inset:0\"></div>\n  <div id=\"vig\" class=\"abs\" style=\"inset:0\"></div>\n  <div id=\"world\">\n    <div id=\"p1\" class=\"place\"><div id=\"s1\"></div></div>\n    <div id=\"p2\" class=\"place\"><div id=\"s2\"></div></div>\n    <div id=\"p3\" class=\"place\"><div id=\"s3\"></div></div>\n    <div id=\"p4\" class=\"place center\"><div id=\"turn\"></div><div id=\"what\"></div><div id=\"action\"></div></div>\n  </div>\n  <div id=\"index\" class=\"abs\"></div>\n</main>\n<script type=\"module\">\nimport { scene, progress, ease } from 'paper-motion';\nimport { wordRise, trackIn, popIn, scramble, blurIn } from 'paper-motion/moves';\nimport { camera } from 'paper-motion/kit';\nimport { loadBrand } from 'paper-motion/brand';\n\nconst CONFIG = {\n  background: null,                      // a shader-set id, or null for the brand's first entry\n  backgroundOpacity: 0.4,                // words carry this piece; the field stays behind them\n  statements: [\n    'Tools were made for hands.',\n    'Agents have none.',\n    'So we made the tool speak.',\n  ],\n  what: '',                              // what the brand is, in plain words; empty reads IDENTITY.md's \"In one line\"\n  action: 'your.site',\n  format: [1920, 1080],\n};\n\nconst B = await loadBrand();\nconst [W, H] = CONFIG.format, SHORT = Math.min(W, H), D = 18;\nconst s = scene({ width: W, height: H, fps: 30, duration: D, background: B.color('ground') });\nconst bgId = CONFIG.background ?? B.set.entries.find((e) => e.shader && !e.image)?.id;\nif (bgId) B.shader(s, '#bg', bgId);\nconst bg = document.querySelector('#bg'); bg.style.opacity = CONFIG.backgroundOpacity;\ndocument.querySelector('#vig').style.background = 'radial-gradient(ellipse at 50% 55%, rgba(0,0,0,0) 30%, rgba(0,0,0,0.55) 100%)';\nconst $ = (id) => document.getElementById(id);\n\n// the walk: a step of STEP per statement; the camera reads each from DIST in front\nconst STEP = SHORT * 1.2, DIST = SHORT * 0.6, K = 1 + DIST / (SHORT * 1.6);\nconst cam = camera($('stage'), $('world'), { perspective: SHORT * 1.6 });\nconst st = [B.style($('s1'), 'display', { short: SHORT * K }), B.style($('s2'), 'display', { short: SHORT * K }), B.style($('s3'), 'display', { short: SHORT * K })];\nst.forEach((el, i) => { el.textContent = CONFIG.statements[i] ?? ''; el.style.maxWidth = '13ch'; });\nconst turn = B.style($('turn'), 'display', { short: SHORT * K });\nconst what = B.style($('what'), 'title', { short: SHORT * K, color: 'muted' }), action = B.style($('action'), 'body', { short: SHORT * K, color: 'figure' });\nObject.assign(action.style, { fontFamily: B.font('mono'), fontSize: `${SHORT * K * 0.028}px`, letterSpacing: '0em', marginTop: `${SHORT * 0.03}px` });\nwhat.style.marginTop = `${SHORT * 0.03}px`;\nwhat.textContent = CONFIG.what || ((B.identity['In one line'] ?? '').split('\\n')[0] || '');\naction.textContent = CONFIG.action; turn.textContent = B.name;\nfor (const id of ['p1', 'p2', 'p3', 'p4']) $(id).style.width = `${W * 0.86}px`;\n// the statements step left, right, left of the path and face it; the name waits straight ahead\nconst Z = (i) => -i * STEP;\ncam.place($('p1'), { z: Z(0), x: -SHORT * 0.06, yaw: 6 });\ncam.place($('p2'), { z: Z(1), x: SHORT * 0.14, y: SHORT * 0.06, yaw: -9 });\ncam.place($('p3'), { z: Z(2), x: -SHORT * 0.1, y: -SHORT * 0.05, yaw: 7, pitch: 2 });\ncam.place($('p4'), { z: Z(3) });\nconst index = B.style($('index'), 'caption', { short: SHORT, color: 'muted' });\nObject.assign(index.style, { left: `${W * 0.07}px`, top: `${H * 0.08}px`, fontFamily: B.font('mono') });\nawait document.fonts.ready;\n\nconst T = { s2: 4, s3: 8, turn: 12, close: 15 };\nconst at = (i, extra = {}) => ({ z: Z(i) + DIST, ...extra });\nconst path = [\n  [0, at(0, { x: -SHORT * 0.04, y: 0, yaw: 4, pitch: -1 })],\n  [T.s2 - 0.7, at(0, { yaw: 5 })],\n  [T.s2 + 0.8, at(1, { x: SHORT * 0.1, y: SHORT * 0.04, yaw: -7, pitch: 1 }), ease.inOutCubic],\n  [T.s3 - 0.7, at(1, { yaw: -8 })],\n  [T.s3 + 0.8, at(2, { x: -SHORT * 0.07, y: -SHORT * 0.03, yaw: 6, pitch: 2 }), ease.inOutCubic],\n  [T.turn - 0.6, at(2, { yaw: 7 })],\n  [T.turn + 1.1, at(3, { x: 0, y: 0, yaw: 0, pitch: 0 }), ease.inOutQuart],   // the turn: the camera comes straight\n  [D, at(3, { z: Z(3) + DIST * 0.9 }), ease.inOutSine],\n];\nconst out = (el, t, at, dur = 0.5) => { const p = progress(t, at - dur, at, ease.inCubic); if (p > 0) el.style.opacity = String(Math.min(Number(el.style.opacity || 1), 1 - p)); };\ns.update((t) => {\n  cam.travel(t, path);\n  cam.focus(DIST, SHORT * 0.8, 10);\n  bg.style.transform = `scale(${1.06 + 0.1 * progress(t, 0, D)}) translateX(${SHORT * 0.03 * progress(t, 0, D)}px)`;\n  // three statements, three entrances (rise, track in, pop), each as the camera arrives\n  wordRise(st[0], t, { start: 0.3, each: B.pace.stagger * 1.4, duration: 0.9 });\n  trackIn(st[1], t, { start: T.s2 - 0.15, duration: 1.1 });\n  popIn(st[2], t, { start: T.s3 - 0.15, each: 0.06 });\n  // the turn: the name scrambles in once the camera has settled, then what it is and the action\n  scramble(turn, t, { start: T.turn + 0.05, duration: 1.3, seed: 3 });\n  blurIn(what, t, { start: T.close, duration: 0.8 });\n  blurIn(action, t, { start: T.close + 0.7, duration: 0.8 });\n  const n = t < T.s2 ? 1 : t < T.s3 ? 2 : t < T.turn ? 3 : 0;\n  index.textContent = n ? `${n} / 3` : '';\n});\nB.cue(s, 'land', 0.3); B.cue(s, 'transition', T.s2); B.cue(s, 'text', T.s2 + 0.5); B.cue(s, 'transition', T.s3); B.cue(s, 'text', T.s3 + 0.5);\nB.cue(s, 'transition', T.turn); B.cue(s, 'land', T.turn + 1.6); B.cue(s, 'text', T.close);\nB.sound(s);\nawait s.start();\n</script>\n</body>\n</html>\n"
    },
    {
      "path": "pieces/manifesto/brief.md",
      "content": "# Manifesto\n\nRecipe: manifesto (18 s), from paper-motion.app. The look, fonts, pace and sound come from `brand/`.\n\n## Before building\n- Agree the brief with the user: the three statements, in the brand's voice (IDENTITY.md's words), each under eight\n  words; the word that turns into the name; what the brand is in plain words; the one action.\n- Edit `CONFIG`: the statements, `turnWord`, `what`, `action`, the background id, the format.\n- Swap the entrances for the moves the user picked (`npx paper-motion add <id>`); keep them different from each other.\n\n## Check and render\n- `npx paper-motion still pieces/manifesto/scene.html --count 6` and read every statement at a glance.\n- `npx paper-motion render pieces/manifesto/scene.html --motion-blur 5`\n"
    }
  ],
  "requires": {
    "engine": ">=0.2.1"
  },
  "usage": "npx paper-motion add manifesto --name my-piece\n# edit CONFIG in pieces/my-piece/scene.html, then:\nnpx paper-motion render pieces/my-piece/scene.html --motion-blur 5",
  "notes": [
    "Wired to the brand folder: needs brand/tokens.json (a palette and a font pair work: pamo add sage-night instrument) and, for the background, a shader-set entry (pamo add mesh-sage).",
    "Three statements, three entrances: never the same treatment twice. Keep each under eight words.",
    "Uses these moves from the engine: word-rise, track-in, pop-in, scramble, blur-in."
  ],
  "related": [
    "word-rise",
    "scramble",
    "launch"
  ],
  "preview": {
    "video": "previews/manifesto.webm",
    "poster": "previews/manifesto.jpg",
    "at": 10.8,
    "values": {
      "statement1": "Tools were made for hands.",
      "statement2": "Agents have none.",
      "statement3": "So we gave them one.",
      "what": "Brand videos, made by your coding agent.",
      "action": "paper-motion.app"
    }
  },
  "mood": [
    "bold",
    "editorial",
    "minimal"
  ],
  "duration": 18,
  "formats": [
    "16:9",
    "9:16",
    "1:1"
  ],
  "beats": [
    {
      "name": "Statement 1",
      "from": 0,
      "to": 4,
      "what": "words rise, large"
    },
    {
      "name": "Statement 2",
      "from": 4,
      "to": 8,
      "what": "tracks in while the first blurs out"
    },
    {
      "name": "Statement 3",
      "from": 8,
      "to": 12,
      "what": "pops in word by word"
    },
    {
      "name": "Turn",
      "from": 12,
      "to": 15,
      "what": "the name scrambles in"
    },
    {
      "name": "Close",
      "from": 15,
      "to": 18,
      "what": "what it is, the action"
    }
  ],
  "when": [
    "the brand has a point of view to state",
    "there is no product to show yet, only words"
  ]
}