@auscera/cleoedits 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/README.md +62 -2
  2. package/cli.mjs +149 -0
  3. package/lib/dependencies.mjs +384 -0
  4. package/lib/run.mjs +114 -0
  5. package/lib/workspace.mjs +167 -0
  6. package/package.json +240 -3
  7. package/workspace/.agents/skills/cleoedits/SKILL.md +29 -0
  8. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/audiogram.json +41 -0
  9. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/facebook.json +48 -0
  10. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/linkedin.json +48 -0
  11. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/podcast.json +23 -0
  12. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/reels.json +48 -0
  13. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/shorts.json +48 -0
  14. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/tiktok.json +48 -0
  15. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/x.json +48 -0
  16. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube-shorts.json +48 -0
  17. package/workspace/.agents/skills/cleoedits/assets/ffmpeg_templates/youtube.json +48 -0
  18. package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/LICENSE-SimpleIcons +30 -0
  19. package/workspace/.agents/skills/cleoedits/assets/reel_effects/assets/logos.json +1 -0
  20. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Anton-Regular.ttf +0 -0
  21. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/ArchivoBlack-Regular.ttf +0 -0
  22. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/InstrumentSerif-Italic.ttf +0 -0
  23. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Inter.ttf +0 -0
  24. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/LICENSE-PermanentMarker.txt +202 -0
  25. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Montserrat.ttf +0 -0
  26. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Anton.txt +93 -0
  27. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-ArchivoBlack.txt +93 -0
  28. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-InstrumentSerif.txt +93 -0
  29. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Inter.txt +93 -0
  30. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Montserrat.txt +93 -0
  31. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-PlayfairDisplay.txt +93 -0
  32. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-Poppins.txt +93 -0
  33. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/OFL-SpaceMono.txt +93 -0
  34. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PermanentMarker-Regular.ttf +0 -0
  35. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay-Italic.ttf +0 -0
  36. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/PlayfairDisplay.ttf +0 -0
  37. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Black.ttf +0 -0
  38. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-Bold.ttf +0 -0
  39. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/Poppins-ExtraBold.ttf +0 -0
  40. package/workspace/.agents/skills/cleoedits/assets/reel_effects/fonts/SpaceMono-Bold.ttf +0 -0
  41. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-MediaPipe +218 -0
  42. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/LICENSE-YuNet +21 -0
  43. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/NOTICE.md +4 -0
  44. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/selfie_segmenter.tflite +0 -0
  45. package/workspace/.agents/skills/cleoedits/assets/reel_effects/models/yunet.onnx +0 -0
  46. package/workspace/.agents/skills/cleoedits/assets/video_styles/LICENSE +21 -0
  47. package/workspace/.agents/skills/cleoedits/assets/video_styles/audio-app-ui/STYLE.md +65 -0
  48. package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/STYLE.md +53 -0
  49. package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/index.html +328 -0
  50. package/workspace/.agents/skills/cleoedits/assets/video_styles/blueprint/studio.js +57 -0
  51. package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/STYLE.md +65 -0
  52. package/workspace/.agents/skills/cleoedits/assets/video_styles/data-story/index.html +575 -0
  53. package/workspace/.agents/skills/cleoedits/assets/video_styles/design-app-ui/STYLE.md +68 -0
  54. package/workspace/.agents/skills/cleoedits/assets/video_styles/editor-ui/STYLE.md +73 -0
  55. package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/STYLE.md +54 -0
  56. package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/index.html +189 -0
  57. package/workspace/.agents/skills/cleoedits/assets/video_styles/editorial-paper/studio.js +57 -0
  58. package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/STYLE.md +64 -0
  59. package/workspace/.agents/skills/cleoedits/assets/video_styles/explainer-diagram/index.html +620 -0
  60. package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/STYLE.md +55 -0
  61. package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/index.html +238 -0
  62. package/workspace/.agents/skills/cleoedits/assets/video_styles/graphite-ui/studio.js +57 -0
  63. package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/STYLE.md +66 -0
  64. package/workspace/.agents/skills/cleoedits/assets/video_styles/growing-city/index.html +602 -0
  65. package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/STYLE.md +66 -0
  66. package/workspace/.agents/skills/cleoedits/assets/video_styles/ink-line/index.html +777 -0
  67. package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/STYLE.md +56 -0
  68. package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/index.html +186 -0
  69. package/workspace/.agents/skills/cleoedits/assets/video_styles/midnight-grid/studio.js +57 -0
  70. package/workspace/.agents/skills/cleoedits/assets/video_styles/motion-app-ui/STYLE.md +68 -0
  71. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/STYLE.md +56 -0
  72. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/index.html +244 -0
  73. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-cut/studio.js +57 -0
  74. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/STYLE.md +67 -0
  75. package/workspace/.agents/skills/cleoedits/assets/video_styles/paper-world/index.html +663 -0
  76. package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/STYLE.md +59 -0
  77. package/workspace/.agents/skills/cleoedits/assets/video_styles/particle-field/index.html +395 -0
  78. package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/STYLE.md +52 -0
  79. package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/index.html +194 -0
  80. package/workspace/.agents/skills/cleoedits/assets/video_styles/poster-pop/studio.js +57 -0
  81. package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/STYLE.md +58 -0
  82. package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/index.html +242 -0
  83. package/workspace/.agents/skills/cleoedits/assets/video_styles/risograph/studio.js +57 -0
  84. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/STYLE.md +53 -0
  85. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/index.html +138 -0
  86. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-grid/studio.js +57 -0
  87. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/STYLE.md +63 -0
  88. package/workspace/.agents/skills/cleoedits/assets/video_styles/swiss-kinetic/index.html +599 -0
  89. package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/STYLE.md +65 -0
  90. package/workspace/.agents/skills/cleoedits/assets/video_styles/time-travel/index.html +1297 -0
  91. package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/STYLE.md +69 -0
  92. package/workspace/.agents/skills/cleoedits/assets/video_styles/weather-widget/index.html +674 -0
  93. package/workspace/.agents/skills/cleoedits/references/audio-clearervoice-elevenlabs.md +11 -0
  94. package/workspace/.agents/skills/cleoedits/references/ffmpeg-and-reels.md +15 -0
  95. package/workspace/.agents/skills/cleoedits/references/hyperframes-workflows.md +13 -0
  96. package/workspace/.agents/skills/cleoedits/references/kdenlive-cli-and-mcp.md +12 -0
  97. package/workspace/.agents/skills/cleoedits/references/motion-design-pipeline.md +7 -0
  98. package/workspace/.agents/skills/cleoedits/references/motion-taste-emil.md +5 -0
  99. package/workspace/.agents/skills/cleoedits/references/playwright-demo-capture.md +9 -0
  100. package/workspace/.agents/skills/cleoedits/references/remotion-workflows.md +13 -0
  101. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/LICENSE +21 -0
  102. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_ass_overlay.py +399 -0
  103. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/__init__.py +235 -0
  104. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/alpha.py +560 -0
  105. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/asr.py +1237 -0
  106. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/color.py +540 -0
  107. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/decision.py +2452 -0
  108. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/drawtext.py +290 -0
  109. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emit.py +1309 -0
  110. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/emoji.py +518 -0
  111. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/fonts.py +875 -0
  112. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing.py +263 -0
  113. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/pacing_edit.py +432 -0
  114. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/probe.py +1613 -0
  115. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/runner.py +3994 -0
  116. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/text.py +73 -0
  117. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/timeline.py +721 -0
  118. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_common/wrap.py +981 -0
  119. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_contract.py +2454 -0
  120. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_platforms.py +258 -0
  121. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.html +754 -0
  122. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_review.py +258 -0
  123. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/_smartcut.py +450 -0
  124. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/audio.py +867 -0
  125. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/background.py +136 -0
  126. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/batch.py +1409 -0
  127. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/broll.py +282 -0
  128. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/caption.py +2207 -0
  129. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/check.py +815 -0
  130. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/color.py +695 -0
  131. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/crop.py +91 -0
  132. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cropdetect.py +214 -0
  133. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/cut.py +2076 -0
  134. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/deinterlace.py +90 -0
  135. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/denoise.py +94 -0
  136. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/export.py +1033 -0
  137. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/fit.py +729 -0
  138. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/freeze.py +197 -0
  139. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/graphics.py +920 -0
  140. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/grid.py +235 -0
  141. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/insert.py +142 -0
  142. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/join.py +1083 -0
  143. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/look.py +475 -0
  144. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loop.py +395 -0
  145. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/loudness.py +397 -0
  146. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/metadata.py +416 -0
  147. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/multicam.py +414 -0
  148. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/overlay.py +766 -0
  149. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/pad.py +121 -0
  150. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/probe.py +145 -0
  151. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/proxy.py +93 -0
  152. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/redact.py +162 -0
  153. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/render.py +2424 -0
  154. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/report.py +354 -0
  155. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/reverse.py +114 -0
  156. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/scenes.py +439 -0
  157. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sequence.py +285 -0
  158. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/silence.py +945 -0
  159. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/speedramp.py +193 -0
  160. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sphere.py +137 -0
  161. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/stabilize.py +141 -0
  162. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/straighten.py +120 -0
  163. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/sync.py +500 -0
  164. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/verify.py +411 -0
  165. package/workspace/.agents/skills/cleoedits/scripts/ffmpeg/waveform.py +502 -0
  166. package/workspace/.agents/skills/cleoedits/scripts/kdenlive_builder.py +284 -0
  167. package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-claude-motion +21 -0
  168. package/workspace/.agents/skills/cleoedits/scripts/motion/LICENSE-motion-design +21 -0
  169. package/workspace/.agents/skills/cleoedits/scripts/motion/_media.py +43 -0
  170. package/workspace/.agents/skills/cleoedits/scripts/motion/pacing_check.py +90 -0
  171. package/workspace/.agents/skills/cleoedits/scripts/motion/storyboard.py +77 -0
  172. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/LICENSE +26 -0
  173. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/fx.py +2717 -0
  174. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/logos.py +194 -0
  175. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/sfx.py +105 -0
  176. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/trim.py +99 -0
  177. package/workspace/.agents/skills/cleoedits/scripts/reel_effects/words.py +60 -0
  178. package/workspace/.claude/commands/blender-3d.md +12 -0
  179. package/workspace/.claude/commands/business-short-form-reels.md +12 -0
  180. package/workspace/.claude/commands/color-grade.md +12 -0
  181. package/workspace/.claude/commands/cutout-grid-reel.md +12 -0
  182. package/workspace/.claude/commands/depth-ui-reel.md +12 -0
  183. package/workspace/.claude/commands/explainer-panel-reel.md +12 -0
  184. package/workspace/.claude/commands/freeze-frame.md +12 -0
  185. package/workspace/.claude/commands/glass-graph.md +12 -0
  186. package/workspace/.claude/commands/over-the-shoulder.md +12 -0
  187. package/workspace/.claude/commands/personal-short-form-reels.md +12 -0
  188. package/workspace/.claude/commands/ranking-format.md +12 -0
  189. package/workspace/.claude/commands/relight.md +12 -0
  190. package/workspace/.claude/commands/reverse-engineer.md +12 -0
  191. package/workspace/.claude/commands/text-behind.md +12 -0
  192. package/workspace/.claude/commands/tier-list.md +12 -0
  193. package/workspace/.claude-plugin/plugin.json +8 -0
  194. package/workspace/.npmignore +15 -0
  195. package/workspace/AGENTS.md +30 -0
  196. package/workspace/README.md +63 -0
  197. package/workspace/assets/fonts/TikTokSans-OFL.txt +93 -0
  198. package/workspace/assets/fonts/TikTokSans-Variable.ttf +0 -0
  199. package/workspace/assets/luts/clean_warm.cube +4917 -0
  200. package/workspace/assets/luts/golden_hour.cube +4917 -0
  201. package/workspace/assets/luts/moody_dark.cube +4917 -0
  202. package/workspace/assets/luts/teal_orange.cube +4917 -0
  203. package/workspace/assets/sfx/NOTICE.txt +1 -0
  204. package/workspace/assets/sfx/click.wav +0 -0
  205. package/workspace/assets/sfx/pop.wav +0 -0
  206. package/workspace/assets/sfx/riser.wav +0 -0
  207. package/workspace/assets/sfx/whoosh.wav +0 -0
  208. package/workspace/generators/hyperframes/index.html +39 -0
  209. package/workspace/generators/hyperframes/package.json +15 -0
  210. package/workspace/generators/hyperframes/pnpm-lock.yaml +1181 -0
  211. package/workspace/generators/hyperframes/pnpm-workspace.yaml +10 -0
  212. package/workspace/generators/remotion/eslint.config.mjs +3 -0
  213. package/workspace/generators/remotion/package.json +36 -0
  214. package/workspace/generators/remotion/pnpm-lock.yaml +4179 -0
  215. package/workspace/generators/remotion/pnpm-workspace.yaml +10 -0
  216. package/workspace/generators/remotion/remotion.config.ts +13 -0
  217. package/workspace/generators/remotion/src/Root.tsx +52 -0
  218. package/workspace/generators/remotion/src/index.css +1 -0
  219. package/workspace/generators/remotion/src/index.ts +4 -0
  220. package/workspace/generators/remotion/tsconfig.json +15 -0
  221. package/workspace/pipeline/scripts/_codec.py +28 -0
  222. package/workspace/pipeline/scripts/ai_media_api.py +109 -0
  223. package/workspace/pipeline/scripts/blender_render.py +166 -0
  224. package/workspace/pipeline/scripts/composite.py +49 -0
  225. package/workspace/pipeline/scripts/melt.sh +68 -0
  226. package/workspace/pipeline/scripts/normalize_audio.py +39 -0
  227. package/workspace/pipeline/scripts/person_matte.py +216 -0
  228. package/workspace/pipeline/scripts/record_demo.py +69 -0
  229. package/workspace/pipeline/scripts/whisper_cut.py +98 -0
  230. package/workspace-manifest.json +908 -0
@@ -0,0 +1,620 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=1920, height=1080" />
6
+ <link rel="stylesheet" href="https://api.fontshare.com/v2/css?f[]=switzer@400,500,600,700,800&display=swap" />
7
+ <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
8
+ <style>
9
+ /* Switzer comes from the Fontshare link above (free, loaded at render time, never shipped).
10
+ This weight-100 local() face is never used; it only tells the linter the family is declared. */
11
+ @font-face { font-family: 'Switzer'; src: local('Switzer'); font-weight: 100; }
12
+ * { margin: 0; padding: 0; box-sizing: border-box; }
13
+ html, body { width: 1920px; height: 1080px; overflow: hidden; background: #FFFFFF; }
14
+ #root { position: relative; width: 1920px; height: 1080px; overflow: hidden; background: #FFFFFF;
15
+ font-family: 'Switzer', system-ui, sans-serif; font-weight: 700; letter-spacing: -0.03em; color: #14213D; }
16
+ .abs { position: absolute; }
17
+ #grid { position: absolute; left: -900px; top: -700px; width: 3720px; height: 2480px; background-image: radial-gradient(circle, rgb(226,226,232) 2.1px, transparent 2.6px); }
18
+ #wash { position: absolute; inset: 0; pointer-events: none;
19
+ background: radial-gradient(120% 90% at 50% 40%, rgba(255,255,255,0) 55%, rgba(20,33,61,0.06) 100%); }
20
+ #stage { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 960px 540px; }
21
+ #world { position: absolute; left: 0; top: 0; width: 3200px; height: 1800px; transform-origin: 0 0; }
22
+ #fog { position: absolute; inset: 0; pointer-events: none; opacity: 0; background: linear-gradient(180deg, #FFFFFF 0%, rgba(255,255,255,0.85) 14%, rgba(255,255,255,0) 46%); }
23
+ #grain { position: absolute; inset: 0; opacity: 0.05; mix-blend-mode: multiply; pointer-events: none; }
24
+
25
+ .ph { position: absolute; border: 3px dashed #E1E4EB; border-radius: 36px; }
26
+ .cast { position: absolute; border-radius: 40px; background: rgba(20,33,61,0.16); filter: blur(34px); }
27
+ .card { position: absolute; border-radius: 36px;
28
+ background: linear-gradient(180deg, #FFFFFF 0%, #FAFBFD 100%);
29
+ border: 2px solid #E3E6ED;
30
+ box-shadow: inset 0 2px 0 #FFFFFF, 0 1px 2px rgba(20,33,61,0.06), 0 10px 20px -6px rgba(20,33,61,0.10), 0 34px 70px -24px rgba(20,33,61,0.22); }
31
+ .ring { position: absolute; inset: -12px; border-radius: 46px; border: 5px solid #2B7EF9; opacity: 0; }
32
+ .hd { position: absolute; left: 32px; top: 30px; height: 68px; display: flex; align-items: center; gap: 20px; }
33
+ .chip { width: 68px; height: 68px; border-radius: 20px; background: #F1F3F8; color: #14213D;
34
+ display: flex; align-items: center; justify-content: center; box-shadow: inset 0 0 0 1.5px #E6E9F0; }
35
+ .chip svg { width: 36px; height: 36px; }
36
+ .lbl { font-size: 50px; font-weight: 800; letter-spacing: -0.035em; line-height: 1; white-space: nowrap; }
37
+ .spark svg { display: block; width: 100%; height: 100%; }
38
+
39
+ .scene { position: absolute; overflow: hidden; background: linear-gradient(180deg, #DCE8FD 0%, #F3F7FF 80%); }
40
+ .scene .sun { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(255,255,255,1) 0%, rgba(255,255,255,0.9) 55%, rgba(255,255,255,0) 100%); }
41
+ .scene .gr { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, #23345A 0%, #14213D 40%); }
42
+ .scene .sh { position: absolute; border-radius: 50%; background: radial-gradient(closest-side, rgba(90,155,255,0.75), rgba(43,126,249,0) 100%); }
43
+ .scene .ball { position: absolute; border-radius: 50%;
44
+ background: radial-gradient(circle at 34% 28%, #FFFFFF 0%, #A9CBFF 12%, #4F93FB 36%, #2B7EF9 58%, #1546A8 100%);
45
+ box-shadow: 0 2px 6px rgba(20,33,61,0.25); }
46
+ .scene .ball.bad { background: radial-gradient(circle at 34% 28%, #FFFFFF 0%, #D5DAE3 20%, #A3AABA 60%, #6F7891 100%); }
47
+ .x { position: absolute; border-radius: 50%; border: 3px dashed #2B7EF9; }
48
+ .wire { fill: none; stroke-linecap: round; stroke-linejoin: round; }
49
+ .pkt { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%;
50
+ background: radial-gradient(circle at 35% 30%, #9CC3FF 0%, #2B7EF9 55%, #1D63D8 100%);
51
+ border: 5px solid #FFFFFF; box-shadow: 0 4px 12px rgba(43,126,249,0.45), 0 0 0 2px rgba(43,126,249,0.18); opacity: 0; }
52
+ .pkt.sm { width: 22px; height: 22px; margin: -11px 0 0 -11px; border-width: 4px; }
53
+ </style>
54
+ </head>
55
+ <body>
56
+ <div id="root" data-composition-id="main" data-start="0" data-duration="14" data-width="1920" data-height="1080">
57
+ <div id="stage"><div id="grid"></div><div id="world"></div></div>
58
+ <div id="fog"></div>
59
+ <div id="wash"></div>
60
+ <canvas id="grain" width="960" height="540" style="width:1920px;height:1080px"></canvas>
61
+ </div>
62
+ <script>
63
+ /*
64
+ How an AI makes a video. 14 s, 1920x1080, does not loop.
65
+ A living system diagram: rounded cards, wires that draw themselves, blue packets that ride the wires,
66
+ and one camera that flies from card to card. Prompt -> AI -> Code -> Browser -> Frames -> Video.
67
+ Beat map:
68
+ 0.0 - 2.5 Prompt types and sends; the packet flies to the AI card, then on to Code
69
+ 2.5 - 6.5 Code types 7 lines; a long elbow wire drops to Browser; 6 captures ride into Frames (frame 4 is wrong)
70
+ 7.0 - 9.0 Video plays, stalls on the bad frame; a "Fix" note rides the loop wire back to Code
71
+ 9.0 - 11.0 line 4 retypes in blue; the packet re-runs; frame 4 swaps to the fixed frame; the plane tilts as the camera pulls out
72
+ 11.3 - 14.0 light sweeps the whole circuit, then the camera flies into the Video card and the mini film fills the frame
73
+ Change the words: the label fields in N (one word per card) and the 'Fix' note text.
74
+ Change the colours: NAVY, BLUE, TINT, G1 to G5 below, MARK (the AI mark colour), and the hex values in the <style> block.
75
+ Deterministic: seeded grain (mulberry32); camera and players are pure functions of time.
76
+ */
77
+ (function () {
78
+ const DUR = 14;
79
+ const MARK = '#D97757'; // the AI mark: a plain 8-ray asterisk
80
+ const NAVY = '#14213D', BLUE = '#2B7EF9', TINT = '#EAF2FE', G1 = '#5B6478', G2 = '#8A93A8', G3 = '#C9CED9', G4 = '#E4E7EE', G5 = '#F4F6FA';
81
+ const root = document.getElementById('root');
82
+ const world = document.getElementById('world');
83
+ const stage = document.getElementById('stage');
84
+ const grid = document.getElementById('grid');
85
+ const fog = document.getElementById('fog');
86
+ const tl = gsap.timeline({ paused: true });
87
+ window.__timelines = window.__timelines || {};
88
+ window.__timelines['main'] = tl;
89
+
90
+ // seeded PRNG
91
+ function mulberry32(a) { return function () { a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a);
92
+ t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
93
+ // static grain
94
+ (function () { const c = document.getElementById('grain'), x = c.getContext('2d'), r = mulberry32(8);
95
+ const im = x.createImageData(960, 540); for (let i = 0; i < im.data.length; i += 4) { const v = 120 + r() * 135 | 0;
96
+ im.data[i] = im.data[i + 1] = im.data[i + 2] = v; im.data[i + 3] = 255; } x.putImageData(im, 0, 0); })();
97
+
98
+ function el(parent, css, cls, html) { const e = document.createElement('div'); if (cls) e.className = cls;
99
+ e.style.position = 'absolute'; Object.assign(e.style, css || {}); if (html != null) e.innerHTML = html; parent.appendChild(e); return e; }
100
+ const px = v => v + 'px';
101
+
102
+ // ---------- icons ----------
103
+ const S = 'fill="none" stroke="currentColor" stroke-width="2.6" stroke-linecap="round" stroke-linejoin="round"';
104
+ const ICON = {
105
+ prompt: `<svg viewBox="0 0 32 32" ${S}><path d="M6 9a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v8a4 4 0 0 1-4 4h-7l-6 5v-5a3 3 0 0 1-3-3z"/><path d="M11 11.5h10M11 15.5h6"/></svg>`,
106
+ code: `<svg viewBox="0 0 32 32" ${S}><path d="M11 9.5 4.5 16 11 22.5M21 9.5l6.5 6.5-6.5 6.5M18 7l-4 18"/></svg>`,
107
+ browser: `<svg viewBox="0 0 32 32" ${S}><rect x="4" y="6" width="24" height="20" rx="4"/><path d="M4 12h24"/><path d="M8 9h.01M11 9h.01M14 9h.01" stroke-width="3"/></svg>`,
108
+ frames: `<svg viewBox="0 0 32 32" ${S}><rect x="5" y="4" width="22" height="24" rx="3.5"/><path d="M10.5 4v24M21.5 4v24M5 10.5h5.5M5 16h5.5M5 21.5h5.5M21.5 10.5H27M21.5 16H27M21.5 21.5H27"/></svg>`,
109
+ video: `<svg viewBox="0 0 32 32" ${S}><rect x="4" y="6" width="24" height="20" rx="5"/><path d="M13.5 11.5v9l7.5-4.5z" fill="currentColor"/></svg>`,
110
+ fix: `<svg viewBox="0 0 32 32" ${S}><path d="M20 6.5l5.5 5.5L12 25.5H6.5V20z"/><path d="M16.5 10l5.5 5.5"/></svg>`,
111
+ send: `<svg viewBox="0 0 32 32" fill="none" stroke="#fff" stroke-width="3.4" stroke-linecap="round" stroke-linejoin="round"><path d="M16 25V8M8.5 15 16 7.5l7.5 7.5"/></svg>`,
112
+ check: `<svg viewBox="0 0 32 32" fill="none" stroke="#fff" stroke-width="3.6" stroke-linecap="round" stroke-linejoin="round"><path d="M8 16.5l5.5 5.5L24.5 10"/></svg>`,
113
+ };
114
+
115
+ // AI mark: 8 rounded rays (a generic asterisk), drawn inline
116
+ const MARK_SVG = `<svg viewBox="0 0 100 100"><g stroke="${MARK}" stroke-width="11" stroke-linecap="round">${[0, 45, 90, 135].map(a => `<line x1="50" y1="9" x2="50" y2="91" transform="rotate(${a} 50 50)"/>`).join('')}</g></svg>`;
117
+
118
+ // ---------- layout (world px) ----------
119
+ const N = {
120
+ prompt: { cx: 500, cy: 560, w: 600, h: 380, icon: 'prompt', label: 'Prompt' },
121
+ ai: { cx: 1330, cy: 480, w: 420, h: 420, icon: 'mark', label: 'AI' },
122
+ code: { cx: 2280, cy: 560, w: 800, h: 520, icon: 'code', label: 'Code' },
123
+ browser: { cx: 580, cy: 1400, w: 640, h: 532, icon: 'browser', label: 'Browser' },
124
+ frames: { cx: 1620, cy: 1400, w: 1040, h: 328, icon: 'frames', label: 'Frames' },
125
+ video: { cx: 2580, cy: 1400, w: 600, h: 512, icon: 'video', label: 'Video' },
126
+ };
127
+ for (const k in N) { const n = N[k]; n.x = n.cx - n.w / 2; n.y = n.cy - n.h / 2; }
128
+
129
+ // light pool that follows the action (world space, under everything)
130
+ const pool = el(world, { left: '0px', top: '0px', width: '1400px', height: '1040px', borderRadius: '50%',
131
+ background: 'radial-gradient(closest-side, rgba(43,126,249,0.15), rgba(43,126,249,0.06) 55%, rgba(43,126,249,0) 100%)' });
132
+
133
+ gsap.set(pool, { x: N.prompt.cx - 700, y: N.prompt.cy - 520 });
134
+ // wires svg
135
+ const svgNS = 'http://www.w3.org/2000/svg';
136
+ const svg = document.createElementNS(svgNS, 'svg');
137
+ svg.setAttribute('width', 3200); svg.setAttribute('height', 1800); svg.setAttribute('viewBox', '0 0 3200 1800');
138
+ Object.assign(svg.style, { position: 'absolute', left: 0, top: 0, overflow: 'visible' });
139
+ world.appendChild(svg);
140
+
141
+ function rounded(pts, r) {
142
+ let d = `M${pts[0][0]} ${pts[0][1]}`;
143
+ for (let i = 1; i < pts.length - 1; i++) {
144
+ const [ax, ay] = pts[i - 1], [bx, by] = pts[i], [cx, cy] = pts[i + 1];
145
+ const l1 = Math.hypot(bx - ax, by - ay), l2 = Math.hypot(cx - bx, cy - by);
146
+ const rr = Math.min(r, l1 / 2, l2 / 2);
147
+ const p1 = [bx - (bx - ax) / l1 * rr, by - (by - ay) / l1 * rr], p2 = [bx + (cx - bx) / l2 * rr, by + (cy - by) / l2 * rr];
148
+ d += ` L${p1[0]} ${p1[1]} Q${bx} ${by} ${p2[0]} ${p2[1]}`;
149
+ }
150
+ const e = pts[pts.length - 1]; return d + ` L${e[0]} ${e[1]}`;
151
+ }
152
+ function mk(tag, attrs) { const e = document.createElementNS(svgNS, tag); for (const a in attrs) e.setAttribute(a, attrs[a]); return e; }
153
+
154
+ const WIRES = {};
155
+ function wire(id, pts, r) {
156
+ const d = rounded(pts, r);
157
+ const g = mk('g', {}); svg.appendChild(g);
158
+ const under = mk('path', { d, class: 'wire', stroke: '#FFFFFF', 'stroke-width': 16 });
159
+ const track = mk('path', { d, class: 'wire', stroke: '#CDD2DC', 'stroke-width': 6 });
160
+ const lit = mk('path', { d, class: 'wire', stroke: BLUE, 'stroke-width': 6 });
161
+ const trail = mk('path', { d, class: 'wire', stroke: BLUE, 'stroke-width': 10, opacity: 0.0 });
162
+ g.appendChild(under); g.appendChild(track); g.appendChild(lit); g.appendChild(trail);
163
+ const L = track.getTotalLength();
164
+ [under, track, lit].forEach(p => { p.setAttribute('stroke-dasharray', `${L} ${L}`); p.setAttribute('stroke-dashoffset', L); });
165
+ trail.setAttribute('stroke-dasharray', `0 ${L * 2}`);
166
+ const a = pts[0], b = pts[pts.length - 1];
167
+ const p0 = mk('circle', { cx: a[0], cy: a[1], r: 11, fill: '#fff', stroke: '#CDD2DC', 'stroke-width': 5, opacity: 0 });
168
+ const p1 = mk('circle', { cx: b[0], cy: b[1], r: 11, fill: '#fff', stroke: '#CDD2DC', 'stroke-width': 5, opacity: 0 });
169
+ g.appendChild(p0); g.appendChild(p1);
170
+ const NS = 600, pts2 = [];
171
+ for (let i = 0; i <= NS; i++) { const q = track.getPointAtLength(L * i / NS); pts2.push([q.x, q.y]); }
172
+ const at = l => { const f = Math.max(0, Math.min(NS, l / L * NS)), i = Math.min(NS - 1, Math.floor(f)), r = f - i;
173
+ return { x: pts2[i][0] + (pts2[i + 1][0] - pts2[i][0]) * r, y: pts2[i][1] + (pts2[i + 1][1] - pts2[i][1]) * r }; };
174
+ return WIRES[id] = { d, under, track, lit, trail, L, p0, p1, at };
175
+ }
176
+ const P = N;
177
+ wire('c1', [[P.prompt.x + P.prompt.w, 560], [960, 560], [960, 480], [P.ai.x, 480]], 40);
178
+ wire('c2', [[P.ai.x + P.ai.w, 480], [1710, 480], [1710, 560], [P.code.x, 560]], 40);
179
+ wire('c3', [[2100, P.code.y + P.code.h], [2100, 985], [580, 985], [580, P.browser.y]], 64);
180
+ wire('c4', [[P.browser.x + P.browser.w, 1400], [P.frames.x, 1400]], 0);
181
+ wire('c5', [[P.frames.x + P.frames.w, 1400], [P.video.x, 1400]], 0);
182
+ wire('loop', [[P.video.x + P.video.w, 1400], [2990, 1400], [2990, 560], [P.code.x + P.code.w, 560]], 72);
183
+
184
+ // ---------- nodes ----------
185
+ const NODES = {};
186
+ function node(id) {
187
+ const n = N[id];
188
+ const ph = el(world, { left: px(n.x), top: px(n.y), width: px(n.w), height: px(n.h) }, 'ph');
189
+ const cast = el(world, { left: px(n.x + 30), top: px(n.y + 50), width: px(n.w - 60), height: px(n.h - 40), opacity: 0 }, 'cast');
190
+ const card = el(world, { left: px(n.x), top: px(n.y), width: px(n.w), height: px(n.h) }, 'card');
191
+ const ring = el(card, {}, 'ring');
192
+ const hd = el(card, {}, 'hd');
193
+ hd.style.position = 'absolute';
194
+ const chip = el(hd, { position: 'relative' }, 'chip', n.icon === 'mark' ? '' : ICON[n.icon]);
195
+ if (n.icon === 'mark') { el(chip, { position: 'relative', width: '40px', height: '40px' }, 'spark', MARK_SVG); }
196
+ const lbl = el(hd, { position: 'relative' }, 'lbl', n.label);
197
+ gsap.set(card, { opacity: 0, y: 60, scale: 0.9, transformOrigin: '50% 60%' });
198
+ gsap.set([chip, lbl], { opacity: 0, x: -18 });
199
+ return NODES[id] = { n, ph, cast, card, ring, chip, lbl };
200
+ }
201
+ Object.keys(N).forEach(node);
202
+
203
+ // ----- prompt content -----
204
+ const PR = NODES.prompt.card;
205
+ const field = el(PR, { left: '32px', top: '128px', width: '536px', height: '212px', borderRadius: '24px', background: G5, boxShadow: 'inset 0 0 0 2px #E6E9F0' });
206
+ const pbars = [
207
+ el(field, { left: '32px', top: '40px', height: '22px', width: '0px', borderRadius: '11px', background: NAVY }),
208
+ el(field, { left: '32px', top: '84px', height: '22px', width: '0px', borderRadius: '11px', background: '#B4BBC9' }),
209
+ ];
210
+ const pcaret = el(field, { left: '32px', top: '34px', width: '5px', height: '34px', borderRadius: '3px', background: BLUE });
211
+ const send = el(field, { right: '20px', bottom: '20px', width: '80px', height: '80px', borderRadius: '50%', background: BLUE,
212
+ boxShadow: '0 10px 22px -6px rgba(43,126,249,0.6), inset 0 2px 0 rgba(255,255,255,0.35)', display: 'flex', alignItems: 'center', justifyContent: 'center' }, '', ICON.send);
213
+ send.firstChild.style.width = '38px'; send.firstChild.style.height = '38px';
214
+ const sendRing = el(field, { right: '20px', bottom: '20px', width: '80px', height: '80px', borderRadius: '50%', border: '4px solid ' + BLUE, opacity: 0 });
215
+
216
+ // ----- AI content -----
217
+ const CL = NODES.ai.card;
218
+ const orbit = el(CL, { left: '70px', top: '128px', width: '280px', height: '280px', borderRadius: '50%', border: '2.5px dashed #D8DCE5' });
219
+ const sat = el(orbit, { left: '130px', top: '-10px', width: '20px', height: '20px', borderRadius: '50%', background: BLUE, boxShadow: '0 0 0 5px #fff, 0 4px 10px rgba(43,126,249,0.5)', opacity: 0 });
220
+ const ripples = [0, 1, 2].map(() => el(CL, { left: '110px', top: '168px', width: '200px', height: '200px', borderRadius: '50%', border: '3px solid ' + BLUE, opacity: 0 }));
221
+ const sparkWrap = el(CL, { left: '110px', top: '168px', width: '200px', height: '200px' });
222
+ const spark = el(sparkWrap, { left: 0, top: 0, width: '200px', height: '200px' }, 'spark', MARK_SVG);
223
+ const sparkShadow = el(CL, { left: '130px', top: '378px', width: '160px', height: '14px', borderRadius: '50%', background: 'rgba(20,33,61,0.12)', filter: 'blur(6px)' });
224
+
225
+ // ----- code content -----
226
+ const CO = NODES.code.card;
227
+ const ed = el(CO, { left: '32px', top: '128px', width: '736px', height: '360px', borderRadius: '22px', overflow: 'hidden',
228
+ background: 'linear-gradient(180deg, #1B2A4A 0%, #14213D 100%)', boxShadow: 'inset 0 2px 0 rgba(255,255,255,0.08)' });
229
+ const LINES = [
230
+ [0, [[150, BLUE], [190, '#E6EAF2']]],
231
+ [1, [[110, '#5F6B85'], [230, '#E6EAF2']]],
232
+ [1, [[180, '#E6EAF2'], [120, BLUE]]],
233
+ [2, [[90, BLUE], [260, '#E6EAF2'], [70, '#5F6B85']]],
234
+ [2, [[200, '#E6EAF2'], [110, '#5F6B85']]],
235
+ [1, [[140, '#5F6B85']]],
236
+ [0, [[60, BLUE]]],
237
+ ];
238
+ const codeLines = []; const LH = 44, LT = 36;
239
+ LINES.forEach((ln, i) => {
240
+ el(ed, { left: '28px', top: px(LT + i * LH + 6), width: '22px', height: '10px', borderRadius: '5px', background: '#33415F' });
241
+ const row = el(ed, { left: px(80 + ln[0] * 44), top: px(LT + i * LH), height: '22px', display: 'flex', gap: '14px', clipPath: 'inset(0% 100% 0% 0%)' });
242
+ let w = 0; const segs = [];
243
+ ln[1].forEach(([sw, c]) => { const s = el(row, { position: 'relative', width: px(sw), height: '22px', borderRadius: '11px', background: c }); segs.push(s); w += sw + 14; });
244
+ codeLines.push({ row, segs, x: 80 + ln[0] * 44, w: w - 14, y: LT + i * LH });
245
+ });
246
+ const band = el(ed, { left: '12px', top: px(LT + 3 * LH - 11), width: '712px', height: '44px', borderRadius: '12px', background: 'rgba(43,126,249,0.22)', opacity: 0 });
247
+ ed.insertBefore(band, ed.firstChild);
248
+ const ccaret = el(ed, { left: 0, top: 0, width: '5px', height: '32px', borderRadius: '3px', background: BLUE, opacity: 0 });
249
+
250
+ // ----- mini scene -----
251
+ function scene(parent, x, y, w, h, rad) {
252
+ const s = el(parent, { left: px(x), top: px(y), width: px(w), height: px(h), borderRadius: rad || 0 }, 'scene');
253
+ const gy = Math.round(h * 0.8), r = Math.max(5, Math.round(h * 0.1));
254
+ el(s, { left: px(w * 0.72), top: px(h * 0.04), width: px(h * 0.42), height: px(h * 0.42) }, 'sun');
255
+ let dots = '';
256
+ const dr = Math.max(1.3, h * 0.011);
257
+ for (let k = 0; k <= 30; k++) { const u = k / 30, X = w * (0.15 + 0.7 * u), Y = gy - r - h * 0.52 * 4 * u * (1 - u);
258
+ dots += `<circle cx="${X.toFixed(1)}" cy="${Y.toFixed(1)}" r="${dr.toFixed(2)}" fill="#9EBEF6"/>`; }
259
+ el(s, { left: 0, top: 0, width: px(w), height: px(h) }, '', `<svg width="${w}" height="${h}">${dots}</svg>`);
260
+ el(s, { top: px(gy), height: px(h - gy) }, 'gr');
261
+ const sh = el(s, { width: px(r * 3.2), height: px(r * 0.9) }, 'sh');
262
+ const ball = el(s, { width: px(r * 2), height: px(r * 2) }, 'ball');
263
+ const o = { s, sh, ball, w, h, gy, r };
264
+ setScene(o, 0, false); return o;
265
+ }
266
+ function setBall(o, x, y, sx, sy) {
267
+ o.ball.style.transform = `translate(${x - o.r}px, ${y - o.r}px) scale(${sx}, ${sy})`;
268
+ o.ball.style.transformOrigin = '50% 100%';
269
+ o.ball.classList.remove('bad');
270
+ const lift = Math.max(0, (o.gy - o.r - y) / (o.h * 0.52));
271
+ o.sh.style.transform = `translate(${x - o.r * 1.6}px, ${o.gy - o.r * 0.45}px) scale(${1 - lift * 0.5})`;
272
+ o.sh.style.opacity = 1 - lift * 0.55;
273
+ }
274
+ function setScene(o, i, bad) {
275
+ o.ball.style.transformOrigin = '';
276
+ const u = i / 5; let x = o.w * (0.15 + 0.7 * u), y = o.gy - o.r - o.h * 0.52 * 4 * u * (1 - u), sy = 1;
277
+ if (bad) { x = o.w * (0.15 + 0.7 * 0.5); y = o.gy - o.r * 0.72; sy = 0.72; }
278
+ o.ball.style.transform = `translate(${x - o.r}px, ${y - o.r}px) scaleY(${sy})`;
279
+ o.ball.classList.toggle('bad', !!bad);
280
+ const lift = (o.gy - o.r - y) / (o.h * 0.52);
281
+ o.sh.style.transform = `translate(${x - o.r * 1.6}px, ${o.gy - o.r * 0.45}px) scale(${1 - lift * 0.5})`;
282
+ o.sh.style.opacity = bad ? 0 : 1 - lift * 0.55;
283
+ }
284
+
285
+ // ----- browser content -----
286
+ const BR = NODES.browser.card;
287
+ const bwin = el(BR, { left: '32px', top: '128px', width: '576px', height: '372px', borderRadius: '20px', overflow: 'hidden', background: '#fff', boxShadow: 'inset 0 0 0 2px #E6E9F0' });
288
+ const bbar = el(bwin, { left: 0, top: 0, width: '576px', height: '48px', background: G5, borderBottom: '2px solid #E6E9F0' });
289
+ ['#D3D8E2', '#D3D8E2', '#D3D8E2'].forEach((c, i) => el(bbar, { left: px(20 + i * 22), top: '18px', width: '12px', height: '12px', borderRadius: '50%', background: c }));
290
+ const url = el(bbar, { left: '150px', top: '12px', width: '300px', height: '24px', borderRadius: '12px', background: '#fff', boxShadow: 'inset 0 0 0 1.5px #E3E6ED' });
291
+ el(url, { left: '14px', top: '8px', width: '8px', height: '8px', borderRadius: '50%', background: BLUE });
292
+ el(url, { left: '32px', top: '9px', width: '120px', height: '6px', borderRadius: '3px', background: '#D3D8E2' });
293
+ const bscene = scene(bwin, 0, 48, 576, 324);
294
+ const flash = el(bwin, { left: 0, top: '48px', width: '576px', height: '324px', background: '#fff', opacity: 0 });
295
+ const brk = el(bwin, { left: '20px', top: '66px', width: '536px', height: '288px', opacity: 0 });
296
+ brk.innerHTML = `<svg width="536" height="288" fill="none" stroke="${BLUE}" stroke-width="6" stroke-linecap="round"><path d="M3 40V3h37M496 3h37v37M533 248v37h-37M40 285H3v-37"/></svg>`;
297
+
298
+ // ----- frames content -----
299
+ const FR = NODES.frames.card;
300
+ const strip = el(FR, { left: '32px', top: '124px', width: '976px', height: '172px', borderRadius: '18px', overflow: 'hidden',
301
+ background: 'linear-gradient(180deg, #1B2A4A 0%, #14213D 100%)', boxShadow: 'inset 0 2px 0 rgba(255,255,255,0.07)' });
302
+ for (let i = 0; i < 26; i++) { [16, 172 - 30].forEach(yy => el(strip, { left: px(14 + i * 37.5), top: px(yy), width: '18px', height: '14px', borderRadius: '4px', background: '#2C3A5B' })); }
303
+ const FW = 141, FH = 79, FX0 = 24, FG = 16, FY = 46;
304
+ const frames = [];
305
+ for (let i = 0; i < 6; i++) {
306
+ const fx = FX0 + i * (FW + FG);
307
+ el(strip, { left: px(fx), top: px(FY), width: px(FW), height: px(FH), borderRadius: '8px', border: '2px dashed #3A4868' });
308
+ const holder = el(strip, { left: px(fx), top: px(FY), width: px(FW), height: px(FH), borderRadius: '8px', overflow: 'hidden', opacity: 0 });
309
+ const good = scene(holder, 0, 0, FW, FH);
310
+ setScene(good, i, false);
311
+ let bad = null;
312
+ if (i === 3) { bad = scene(holder, 0, 0, FW, FH); setScene(bad, 3, true); }
313
+ gsap.set(holder, { scale: 0.8, y: -14 });
314
+ frames.push({ holder, good, bad, fx });
315
+ }
316
+ const fring = el(strip, { left: px(FX0 + 3 * (FW + FG) - 8), top: px(FY - 8), width: px(FW + 16), height: px(FH + 16), borderRadius: '12px', border: '4px solid ' + BLUE, opacity: 0 });
317
+
318
+ // ----- video content -----
319
+ const VI = NODES.video.card;
320
+ const player = el(VI, { left: '32px', top: '128px', width: '536px', height: '352px', borderRadius: '20px', overflow: 'hidden',
321
+ background: 'linear-gradient(180deg, #1B2A4A 0%, #14213D 100%)' });
322
+ const vscene = scene(player, 0, 0, 536, 302);
323
+ const vx = el(player, { left: px(268 - 56), top: px(214 - 56), width: '112px', height: '112px', opacity: 0, borderWidth: '4px' }, 'x');
324
+ gsap.set(vx, { scale: 0.7 });
325
+ const vtrack = el(player, { left: '24px', top: '324px', width: '488px', height: '8px', borderRadius: '4px', background: 'rgba(255,255,255,0.18)' });
326
+ const vfill = el(vtrack, { left: 0, top: 0, width: '0px', height: '8px', borderRadius: '4px', background: BLUE });
327
+ const vknob = el(vtrack, { left: '-9px', top: '-5px', width: '18px', height: '18px', borderRadius: '50%', background: '#fff', boxShadow: '0 2px 6px rgba(0,0,0,0.3)' });
328
+ const vmark = el(vtrack, { left: px(488 * 3.15 / 5.04 - 3), top: '-10px', width: '6px', height: '28px', borderRadius: '3px', background: '#fff', opacity: 0 });
329
+ const play = el(player, { left: px(268 - 60), top: px(151 - 60), width: '120px', height: '120px', borderRadius: '50%', background: BLUE,
330
+ boxShadow: '0 16px 36px -8px rgba(43,126,249,0.7), inset 0 3px 0 rgba(255,255,255,0.3)' },
331
+ '', `<svg width="120" height="120" viewBox="0 0 120 120"><path d="M50 40v40l32-20z" fill="#fff" stroke="#fff" stroke-width="6" stroke-linejoin="round"/></svg>`);
332
+ const check = el(VI, { right: '-26px', top: '-26px', width: '84px', height: '84px', borderRadius: '50%', background: BLUE,
333
+ boxShadow: '0 0 0 6px #fff, 0 12px 26px -6px rgba(43,126,249,0.65)', display: 'flex', alignItems: 'center', justifyContent: 'center', opacity: 0 }, '', ICON.check);
334
+ check.firstChild.style.width = '44px'; check.firstChild.style.height = '44px';
335
+ gsap.set(check, { scale: 0.6 });
336
+
337
+ // ----- fix note -----
338
+ const note = el(world, { left: 0, top: 0, width: '270px', height: '116px', marginLeft: '-135px', marginTop: '-58px', borderRadius: '30px', background: '#fff',
339
+ border: '3px solid ' + BLUE, boxShadow: '0 18px 40px -12px rgba(43,126,249,0.55), 0 4px 10px rgba(20,33,61,0.08)',
340
+ display: 'flex', alignItems: 'center', gap: '16px', paddingLeft: '18px', opacity: 0 });
341
+ const nchip = el(note, { position: 'relative', width: '76px', height: '76px', borderRadius: '22px', background: BLUE, color: '#fff', display: 'flex', alignItems: 'center', justifyContent: 'center' }, '', ICON.fix);
342
+ nchip.firstChild.style.width = '42px'; nchip.firstChild.style.height = '42px';
343
+ el(note, { position: 'relative' }, 'lbl', 'Fix').style.fontSize = '60px';
344
+
345
+ // ---------- timeline helpers ----------
346
+ function land(id, t) {
347
+ const o = NODES[id];
348
+ tl.to(o.card, { opacity: 1, y: 0, scale: 1, duration: 0.55, ease: 'power3.out' }, t);
349
+ tl.to(o.cast, { opacity: 1, duration: 0.6, ease: 'power2.out' }, t + 0.1);
350
+ tl.to(o.ph, { opacity: 0, duration: 0.3, ease: 'power1.in' }, t);
351
+ tl.to([o.chip, o.lbl], { opacity: 1, x: 0, duration: 0.45, ease: 'power3.out', stagger: 0.07 }, t + 0.12);
352
+ }
353
+ function pulse(id, t, keep) {
354
+ const o = NODES[id];
355
+ tl.set(o.ring, { opacity: 0.95, scale: 0.985 }, t);
356
+ tl.to(o.ring, { opacity: 0, scale: 1.05, duration: 0.7, ease: 'power2.out' }, t);
357
+ tl.to(o.card, { scale: 1.025, duration: 0.1, ease: 'power2.out' }, t);
358
+ tl.to(o.card, { scale: 1, duration: 0.5, ease: 'back.out(3)' }, t + 0.1);
359
+ tl.to(o.chip, { backgroundColor: BLUE, color: '#FFFFFF', duration: 0.12, ease: 'power2.out' }, t);
360
+ tl.to(o.cast, { backgroundColor: 'rgba(43,126,249,0.34)', duration: 0.15, ease: 'power2.out' }, t);
361
+ tl.to(o.cast, { backgroundColor: 'rgba(20,33,61,0.16)', duration: 1.0, ease: 'power2.inOut' }, t + 0.35);
362
+ tl.to(o.chip, { backgroundColor: TINT, color: BLUE, duration: 0.5, ease: 'power2.inOut' }, t + 0.4);
363
+ }
364
+ function drawWire(id, t, dur, ease) {
365
+ const w = WIRES[id];
366
+ tl.to([w.under, w.track], { attr: { 'stroke-dashoffset': 0 }, duration: dur, ease: ease || 'power2.inOut' }, t);
367
+ tl.to(w.p0, { attr: { opacity: 1 }, duration: 0.15 }, t);
368
+ tl.to(w.p1, { attr: { opacity: 1 }, duration: 0.15 }, t + dur * 0.8);
369
+ }
370
+ // packet with comet trail and lit wire
371
+ function packet(id, t, dur, opts) {
372
+ opts = opts || {};
373
+ const w = WIRES[id];
374
+ const dot = el(world, {}, 'pkt' + (opts.small ? ' sm' : ''));
375
+ const pr = { u: 0 };
376
+ const TR = opts.small ? 0 : 220;
377
+ tl.to(pr, { u: 1, duration: dur, ease: opts.ease || 'power2.inOut', onUpdate: () => {
378
+ const u = pr.u, on = u > 0 && u < 1;
379
+ const l = u * w.L, p = w.at(l);
380
+ dot.style.transform = `translate(${p.x}px, ${p.y}px)`;
381
+ dot.style.opacity = on ? (opts.small ? Math.min(1, u * 8, (1 - u) * 8) * 0.9 : 1) : 0;
382
+ if (TR) { const tlen = Math.min(TR, l); w.trail.setAttribute('stroke-dasharray', `${tlen} ${w.L * 2}`);
383
+ w.trail.setAttribute('stroke-dashoffset', -(l - tlen)); w.trail.setAttribute('opacity', on ? 0.35 : 0); }
384
+ if (opts.lit) w.lit.setAttribute('stroke-dashoffset', w.L - l);
385
+ } }, t);
386
+ if (opts.lit) { tl.to(w.lit, { attr: { opacity: 0.32 }, duration: 0.8, ease: 'power2.inOut' }, t + dur + 0.05); }
387
+ if (!opts.small) { tl.to(w.p1, { attr: { stroke: BLUE, fill: BLUE }, duration: 0.15 }, t + dur - 0.05); }
388
+ }
389
+ function moveNote(t, dur) {
390
+ const w = WIRES.loop, pr = { u: 0 };
391
+ tl.to(pr, { u: 1, duration: dur, ease: 'power2.inOut', onUpdate: () => {
392
+ const p = w.at(pr.u * w.L);
393
+ note.style.transform = `translate(${p.x}px, ${p.y}px) scale(${note._s || 1})`;
394
+ w.lit.setAttribute('stroke-dashoffset', w.L - pr.u * w.L);
395
+ } }, t);
396
+ }
397
+ function poolTo(id, t, dur) { const n = N[id]; tl.to(pool, { x: n.cx - 700, y: n.cy - 520, duration: dur, ease: 'power2.inOut' }, t); }
398
+
399
+ // ---------- BEATS ----------
400
+ // 0.0 prompt (already 30% landed on frame 0)
401
+ gsap.set(NODES.prompt.card, { opacity: 0.4, y: 34, scale: 0.94 });
402
+ land('prompt', 0.0);
403
+ tl.to(field, { opacity: 1, duration: 0.01 }, 0);
404
+ tl.to(pbars[0], { width: 360, duration: 0.42, ease: 'steps(9)' }, 0.42);
405
+ tl.to(pcaret, { x: 368, duration: 0.42, ease: 'steps(9)' }, 0.42);
406
+ tl.set(pcaret, { x: 0, y: 44 }, 0.86);
407
+ tl.to(pbars[1], { width: 230, duration: 0.3, ease: 'steps(6)' }, 0.88);
408
+ tl.to(pcaret, { x: 238, duration: 0.3, ease: 'steps(6)' }, 0.88);
409
+ tl.to(pcaret, { opacity: 0, duration: 0.1 }, 1.0);
410
+ tl.to(send, { scale: 0.86, duration: 0.08, ease: 'power2.in' }, 0.92);
411
+ tl.to(send, { scale: 1, duration: 0.45, ease: 'back.out(4)' }, 1.0);
412
+ tl.set(sendRing, { opacity: 0.9, scale: 1 }, 1.0);
413
+ tl.to(sendRing, { opacity: 0, scale: 1.6, duration: 0.5, ease: 'power2.out' }, 1.0);
414
+ pulse('prompt', 1.0);
415
+ // 1.0 -> AI
416
+ drawWire('c1', 0.98, 0.4);
417
+ packet('c1', 1.0, 0.5, { lit: true });
418
+ land('ai', 0.95);
419
+ poolTo('ai', 1.0, 0.6);
420
+ pulse('ai', 1.5);
421
+ tl.to(spark, { rotation: 135, scale: 1, duration: 1.0, ease: 'expo.out' }, 1.5);
422
+ tl.to(spark, { scale: 1.14, duration: 0.12, ease: 'power2.out' }, 1.5);
423
+ tl.to(spark, { scale: 1, duration: 0.6, ease: 'back.out(3)' }, 1.62);
424
+ tl.to(sat, { opacity: 1, duration: 0.2 }, 1.5);
425
+ ripples.forEach((r, i) => { tl.set(r, { opacity: 0.8, scale: 0.7 }, 1.5 + i * 0.12); tl.to(r, { opacity: 0, scale: 1.5, duration: 0.8, ease: 'power2.out' }, 1.5 + i * 0.12); });
426
+ tl.to(orbit, { rotation: 300, duration: 1.2, ease: 'power2.inOut' }, 1.45);
427
+ tl.to(sat, { opacity: 0, duration: 0.3 }, 2.45);
428
+ // 2.0 -> code
429
+ drawWire('c2', 1.98, 0.38);
430
+ packet('c2', 2.0, 0.5, { lit: true });
431
+ land('code', 1.9);
432
+ poolTo('code', 2.0, 0.6);
433
+ pulse('code', 2.5);
434
+ let tt = 2.55;
435
+ codeLines.forEach((c, i) => {
436
+ const d = 0.1 + c.w / 3600;
437
+ tl.set(ccaret, { x: c.x, y: c.y - 5, opacity: 1 }, tt);
438
+ tl.to(c.row, { clipPath: 'inset(0% 0% 0% 0%)', duration: d, ease: 'steps(6)' }, tt);
439
+ tl.to(ccaret, { x: c.x + c.w + 8, duration: d, ease: 'steps(6)' }, tt);
440
+ tt += d + 0.03;
441
+ });
442
+ tl.to(ccaret, { opacity: 0, duration: 0.1 }, tt);
443
+ // 3.5 -> browser (long elbow)
444
+ drawWire('c3', 3.45, 0.8, 'power2.inOut');
445
+ packet('c3', 3.5, 0.9, { lit: true, ease: 'power2.inOut' });
446
+ land('browser', 3.85);
447
+ poolTo('browser', 3.5, 0.9);
448
+ pulse('browser', 4.4);
449
+ // captures
450
+ const CAP = [4.5, 4.75, 5.0, 5.25, 5.5, 5.75];
451
+ drawWire('c4', 4.42, 0.25);
452
+ land('frames', 4.3);
453
+ CAP.forEach((t, i) => {
454
+ tl.set(flash, { opacity: 0.85 }, t); tl.to(flash, { opacity: 0, duration: 0.2, ease: 'power2.out' }, t);
455
+ tl.set(brk, { opacity: 1, scale: 1.04 }, t); tl.to(brk, { opacity: 0, scale: 1, duration: 0.24, ease: 'power2.in' }, t + 0.02);
456
+ packet('c4', t + 0.01, 0.26, { ease: 'power1.inOut', lit: i === 0 });
457
+ const f = frames[i].holder;
458
+ tl.to(f, { opacity: 1, scale: 1, y: 0, duration: 0.35, ease: 'back.out(2.2)' }, t + 0.25);
459
+ });
460
+ poolTo('frames', 4.8, 0.8);
461
+ pulse('frames', 5.0);
462
+ // 6.0 -> video
463
+ drawWire('c5', 5.98, 0.22);
464
+ packet('c5', 6.0, 0.45, { lit: true });
465
+ land('video', 5.95);
466
+ poolTo('video', 6.0, 0.6);
467
+ pulse('video', 6.5);
468
+ tl.to(play, { scale: 0.84, duration: 0.08, ease: 'power2.in' }, 6.94);
469
+ tl.to(play, { scale: 1.25, opacity: 0, duration: 0.25, ease: 'power2.in' }, 7.02);
470
+ tl.set(vmark, { opacity: 1 }, 7.55);
471
+ tl.to(vx, { opacity: 1, scale: 1, duration: 0.35, ease: 'back.out(2.5)' }, 7.62);
472
+ tl.to(vx, { rotation: 90, duration: 3.2, ease: 'none' }, 7.62);
473
+ tl.to(vx, { opacity: 0, scale: 0.85, duration: 0.25, ease: 'power2.in' }, 10.9);
474
+ // 8.0 fix note rides the loop back to code
475
+ drawWire('loop', 7.85, 0.95, 'power2.inOut');
476
+ tl.set(note, { opacity: 0 }, 0);
477
+ note._s = 0.8;
478
+ const ns = { s: 0.8 };
479
+ tl.to(note, { opacity: 1, duration: 0.2, ease: 'power2.out' }, 7.98);
480
+ tl.to(ns, { s: 1, duration: 0.45, ease: 'back.out(3)', onUpdate: () => { note._s = ns.s; } }, 7.98);
481
+ moveNote(8.0, 1.0);
482
+ tl.to(WIRES.loop.lit, { attr: { opacity: 0.32 }, duration: 0.8 }, 9.1);
483
+ tl.to(note, { opacity: 0, duration: 0.2, ease: 'power2.in' }, 9.0);
484
+ poolTo('code', 8.2, 0.8);
485
+ pulse('code', 9.0);
486
+ // line 4 retype in blue
487
+ const L4 = codeLines[3];
488
+ tl.to(band, { opacity: 1, duration: 0.2, ease: 'power2.out' }, 9.0);
489
+ tl.to(L4.row, { clipPath: 'inset(0% 100% 0% 0%)', duration: 0.14, ease: 'power2.in' }, 9.05);
490
+ tl.to(L4.segs, { backgroundColor: '#8DB6FC', duration: 0.01 }, 9.19);
491
+ tl.set(ccaret, { x: L4.x, y: L4.y - 5, opacity: 1 }, 9.2);
492
+ tl.to(L4.row, { clipPath: 'inset(0% 0% 0% 0%)', duration: 0.3, ease: 'steps(7)' }, 9.2);
493
+ tl.to(ccaret, { x: L4.x + L4.w + 8, duration: 0.3, ease: 'steps(7)' }, 9.2);
494
+ tl.to(ccaret, { opacity: 0, duration: 0.1 }, 9.55);
495
+ tl.to(band, { opacity: 0.45, duration: 0.6 }, 9.7);
496
+ // 9.5 re-run: code -> browser -> frames
497
+ packet('c3', 9.55, 0.7, { ease: 'power1.inOut' });
498
+ tl.set(flash, { opacity: 0.85 }, 10.25); tl.to(flash, { opacity: 0, duration: 0.22 }, 10.25);
499
+ tl.set(brk, { opacity: 1, scale: 1.04 }, 10.25); tl.to(brk, { opacity: 0, scale: 1, duration: 0.26, ease: 'power2.in' }, 10.27);
500
+ packet('c4', 10.26, 0.24, { ease: 'power1.inOut' });
501
+ tl.to(frames[3].bad.s, { opacity: 0, duration: 0.18 }, 10.5);
502
+ tl.to(frames[3].holder, { y: -10, duration: 0.12, ease: 'power2.out' }, 10.5);
503
+ tl.to(frames[3].holder, { y: 0, duration: 0.45, ease: 'back.out(3)' }, 10.62);
504
+ tl.set(fring, { opacity: 1, scale: 0.96 }, 10.5);
505
+ tl.to(fring, { opacity: 0, scale: 1.18, duration: 0.7, ease: 'power2.out' }, 10.5);
506
+ pulse('frames', 10.5);
507
+ packet('c5', 10.55, 0.4);
508
+ pulse('video', 10.95);
509
+ tl.to(vmark, { opacity: 0, duration: 0.2 }, 10.95);
510
+ // 12.0 finish
511
+
512
+ // full-circuit light sweep
513
+ ['c1', 'c2', 'c3', 'c4', 'c5', 'loop'].forEach((id, i) => { const w = WIRES[id];
514
+ tl.to(w.lit, { attr: { opacity: 1 }, duration: 0.15, ease: 'power2.out' }, 10.75 + i * 0.08);
515
+ tl.to(w.lit, { attr: { opacity: 0.4 }, duration: 0.7, ease: 'power2.inOut' }, 10.95 + i * 0.08); });
516
+ // ambient packets: the system keeps living
517
+ [['c1', 0], ['c2', 0.12], ['c3', 0.24], ['c4', 0.36], ['c5', 0.48], ['loop', 0.6]].forEach(([id, o]) => {
518
+ for (let k = 0; k < 4; k++) { const t = 10.9 + o + k * 0.55; if (t + 0.5 < DUR) packet(id, t, id === 'c3' || id === 'loop' ? 0.9 : 0.5, { small: true, ease: 'none' }); }
519
+ });
520
+
521
+ // ---------- camera: pure function of time ----------
522
+ const K = [
523
+ { t: 0.0, x: 660, y: 560, s: 1.80 },
524
+ { t: 0.95, x: 630, y: 560, s: 1.72, e: 'sine.out' },
525
+ { t: 1.6, x: 1330, y: 500, s: 1.70, e: 'power3.inOut' },
526
+ { t: 1.95, x: 1350, y: 500, s: 1.66, e: 'none' },
527
+ { t: 2.6, x: 2280, y: 560, s: 1.42, e: 'power3.inOut' },
528
+ { t: 3.45, x: 2262, y: 556, s: 1.38, e: 'none' },
529
+ { t: 4.45, x: 600, y: 1400, s: 1.42, e: 'power2.inOut', dip: 0.3 },
530
+ { t: 4.75, x: 610, y: 1400, s: 1.38, e: 'none' },
531
+ { t: 5.45, x: 1210, y: 1400, s: 0.94, e: 'power3.inOut' },
532
+ { t: 5.95, x: 1240, y: 1400, s: 0.91, e: 'none' },
533
+ { t: 6.6, x: 2580, y: 1400, s: 1.55, e: 'power3.inOut' },
534
+ { t: 7.95, x: 2588, y: 1396, s: 1.64, e: 'none' },
535
+ { t: 8.55, x: 2760, y: 1180, s: 1.02, e: 'power3.inOut' },
536
+ { t: 9.15, x: 2470, y: 640, s: 1.16, e: 'power2.inOut' },
537
+ { t: 9.6, x: 2455, y: 650, s: 1.18, e: 'none' },
538
+ { t: 10.7, x: 1600, y: 960, s: 0.625, e: 'expo.inOut' },
539
+ { t: 11.3, x: 1612, y: 962, s: 0.64, e: 'none' },
540
+ { t: 12.35, x: 2580, y: 1440, s: 2.95, e: 'expo.inOut' },
541
+ { t: 14.0, x: 2580, y: 1438, s: 3.12, e: 'none' },
542
+ ];
543
+ K.forEach(k => { if (k.e) k.ef = gsap.parseEase(k.e); });
544
+ function cam(t) {
545
+ if (t <= K[0].t) return K[0];
546
+ for (let i = 1; i < K.length; i++) {
547
+ const a = K[i - 1], b = K[i];
548
+ if (t <= b.t) {
549
+ const u = (t - a.t) / (b.t - a.t), e = b.ef(u);
550
+ let s = Math.exp(Math.log(a.s) + (Math.log(b.s) - Math.log(a.s)) * e);
551
+ if (b.dip) s *= 1 - b.dip * Math.sin(Math.PI * e);
552
+ return { x: a.x + (b.x - a.x) * e, y: a.y + (b.y - a.y) * e, s };
553
+ }
554
+ }
555
+ return K[K.length - 1];
556
+ }
557
+
558
+ // ---------- pure state for players ----------
559
+ function videoState(t) {
560
+ if (t < 7.05) return { i: 0, bad: false, p: 2.65 / 5.04, j: 0 };
561
+ if (t < 7.55) return { i: Math.min(2, Math.floor((t - 7.05) / 0.1667)), bad: false, p: (2.65 + (t - 7.05)) / 5.04, j: 0 };
562
+ if (t < 10.95) { const j = t < 7.9 ? Math.sin((t - 7.55) * 90) * 12 * (1 - (t - 7.55) / 0.35) : 0; return { i: 3, bad: true, p: 3.15 / 5.04, j }; }
563
+ return { clean: true, p: Math.min(1, (1.95 + (t - 10.95)) / 5.04), j: 0 };
564
+ }
565
+ // continuous clean play: arc 10.95 -> land 12.6, squash, hop, settle
566
+ function cleanBall(o, t) {
567
+ const X = u => o.w * (0.15 + 0.7 * u), G = o.gy - o.r;
568
+ if (t < 12.6) { const u = (t - 10.95) / 1.65; return setBall(o, X(u), G - o.h * 0.52 * 4 * u * (1 - u), 1, 1); }
569
+ const x = X(1);
570
+ if (t < 12.74) { const q = Math.sin(Math.PI * (t - 12.6) / 0.14); return setBall(o, x, G, 1 + 0.28 * q, 1 - 0.3 * q); }
571
+ if (t < 13.6) { const q = (t - 12.74) / 0.86; return setBall(o, x, G - o.h * 0.26 * 4 * q * (1 - q), 1, 1 + 0.05 * Math.sin(Math.PI * q)); }
572
+ if (t < 13.7) { const q = Math.sin(Math.PI * (t - 13.6) / 0.1); return setBall(o, x, G, 1 + 0.14 * q, 1 - 0.15 * q); }
573
+ const q = Math.min(1, (t - 13.7) / 0.3); return setBall(o, x, G - o.h * 0.07 * 4 * q * (1 - q), 1, 1);
574
+ }
575
+ function browserState(t) {
576
+ let i = 0; CAP.forEach((c, k) => { if (t >= c) i = k; });
577
+ if (t >= 10.25) return { i: 3, bad: false };
578
+ if (t < CAP[0]) return { i: 0, bad: false };
579
+ return { i, bad: i === 3 };
580
+ }
581
+
582
+ const clock = { t: 0 };
583
+ let lastKey = '';
584
+ function frame(t) {
585
+ const c = cam(t), c0 = cam(Math.max(0, t - 1 / 30));
586
+ const s = c.s;
587
+ world.style.transform = `translate(${960 - c.x * s}px, ${540 - c.y * s}px) scale(${s})`;
588
+ // tilt from camera velocity (secondary motion)
589
+ const vx = (c.x - c0.x) * s, vy = (c.y - c0.y) * s, vz = Math.log(c.s / c0.s);
590
+ const ry = Math.max(-6, Math.min(6, vx * 0.06)), rx = Math.max(-5, Math.min(5, -vy * 0.06));
591
+ const cl = (v) => Math.max(0, Math.min(1, v));
592
+ const uo = cl(t / 1.2), eo = Math.pow(1 - uo, 3);
593
+ const up = cl((t - 9.55) / 1.4), bp = Math.pow(Math.sin(Math.PI * up), 1.3) * (up > 0 && up < 1 ? 1 : 0);
594
+ const RX = 20 * eo + 24 * bp, RZ = -5 * eo - 4 * bp;
595
+ stage.style.transform = `perspective(2200px) rotateX(${rx + RX}deg) rotateY(${ry}deg) rotateZ(${RZ}deg)`;
596
+ fog.style.opacity = Math.min(0.55, RX / 40);
597
+ // grid sits behind the world: slower pan + softened zoom
598
+ const g = 38 * Math.pow(s / 1.0, 0.3);
599
+ grid.style.backgroundSize = `${g}px ${g}px`;
600
+ const gx = ((1860 - c.x * s * 0.8) % g + g) % g, gy = ((1240 - c.y * s * 0.8) % g + g) % g;
601
+ grid.style.backgroundPosition = `${gx}px ${gy}px`;
602
+ // the AI mark turns slowly
603
+ sparkWrap.style.transform = `rotate(${t * 14}deg)`;
604
+ const satA = t * 0; sat.style.transform = `rotate(${satA}deg)`;
605
+ // players
606
+ const v = videoState(t);
607
+ if (v.clean) cleanBall(vscene, t); else setScene(vscene, v.i, v.bad);
608
+ vscene.s.style.transform = `translateX(${v.j}px)`;
609
+ vfill.style.width = (488 * v.p) + 'px';
610
+ vknob.style.left = (488 * v.p - 9) + 'px';
611
+ const b = browserState(t);
612
+ setScene(bscene, b.i, b.bad);
613
+ }
614
+ tl.to(clock, { t: DUR, duration: DUR, ease: 'none', onUpdate: () => frame(clock.t) }, 0);
615
+ frame(0);
616
+ tl.seek(0);
617
+ })();
618
+ </script>
619
+ </body>
620
+ </html>