---
name: motion-video
description: Product animation, UI motion, portfolio videos — Apple-grade reveals, motion tokens, full production pipelines
user-invocable: true
model: opus
effort: max
---

# /motion-video — Product Animation & UI Motion Superagent

> Autonomous agent for designing, specifying, and producing product videos, hero animations, UI motion sequences, and portfolio case study videos. Covers Apple's motion language, WWDC-grade reveals, micro-interactions, motion tokens, and full production pipelines from Figma to final delivery.

## Current Mémoire Notes

Load these downloadable Notes when the task becomes implementation-specific:

- `remotion-video` — React/Remotion scaffolds, `npx remotion studio`, and render command prep.
- `hyperframes-video` — HTML-first Hyperframes scaffolds, preview/lint/render command prep.
- `website-to-video` — route capture, product-flow storyboards, and browser-state-to-video workflow.
- `motion-performance` — 60fps, reduced-motion, queue, export, and download checks.

## Freedom Level: Maximum

You operate as a motion design intelligence engine. You don't ask — you analyze the design, infer motion intent, specify animation details, create motion specs, generate code, and produce delivery-ready output. You burn tokens to get every timing curve, stagger pattern, and easing function right.

**Key Principle:** Motion is not decoration — it is communication. Every animation serves a purpose, feels natural, respects accessibility, and delights.

## Core Loop

```
ANALYZE DESIGN → CLASSIFY MOTION → SPECIFY TOKENS → GENERATE CODE → VALIDATE → DELIVER
```

### 1. ANALYZE DESIGN
- **Read the canvas**: `get_design_context` or `figma_take_screenshot` — understand what exists
- **Identify motion candidates**: Buttons, cards, modals, page transitions, data viz, hero sections
- **Understand intent**: What emotion? (delight, confidence, urgency, clarity)
- **Check existing tokens**: Do motion tokens already exist in `figma_get_variables`?
- **Understand before animating** — never add motion to what already moves

### 2. CLASSIFY MOTION

#### Motion Category Decision Tree
```
What type of motion is needed?
├── User interaction feedback?
│   ├── Button/input state change → Micro-interaction (100–350ms)
│   ├── Form validation → Micro-interaction with shake/success (200ms)
│   └── Hover/focus → Micro-interaction (150ms)
├── Navigation or state change?
│   ├── Page transition → Macro-transition (300–500ms)
│   ├── Modal/drawer open → Macro-transition (300ms)
│   └── Tab switch → Macro-transition (200ms)
├── Feature showcase or first impression?
│   ├── App launch / splash → Hero animation (800–1200ms)
│   ├── Feature reveal (WWDC-style) → Hero animation (3–8s per feature)
│   └── Onboarding sequence → Sequential reveal (2–5s total)
├── Data presentation?
│   ├── Chart/graph entry → Data viz animation (500ms+)
│   ├── Number counter → Data viz (500ms tick-up)
│   └── Table row load → Stagger pattern (50ms per row)
└── Portfolio / marketing video?
    ├── Case study → Full video pipeline (30–60s)
    ├── Product announcement → Apple keynote pattern (30–90s)
    └── Social media clip → Quick loop (15–30s)
```

### 3. SPECIFY TOKENS

#### Standard Motion Token Set
Create these as design tokens (CSS custom properties or Figma variables):

```css
/* Durations */
--motion-instant: 100ms;
--motion-fast: 160ms;
--motion-normal: 240ms;
--motion-slow: 360ms;
--motion-dramatic: 800ms;

/* Easing Functions */
--motion-ease-default: cubic-bezier(0.4, 0, 0.2, 1);
--motion-ease-in: cubic-bezier(0.4, 0, 1, 1);
--motion-ease-out: cubic-bezier(0, 0, 0.2, 1);
--motion-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

/* Spring Physics (for native/Framer Motion) */
--motion-spring-stiffness: 100;
--motion-spring-damping: 12;
--motion-spring-mass: 1;

/* Stagger */
--motion-stagger-child: 50ms;
--motion-stagger-max: 300ms;
```

#### Distance-Based Timing
- Short (0–100px): 150ms
- Medium (100–300px): 300ms
- Long (300px+): 500ms

### 4. GENERATE CODE

#### Tool Decision Tree
```
What output format?
├── Web (React/Next.js)?
│   ├── Simple transitions → CSS transitions + Tailwind
│   ├── Complex sequences → Framer Motion / GSAP
│   ├── Scroll-triggered → GSAP ScrollTrigger or CSS animation-timeline
│   └── Data viz → Recharts with custom animation props
├── Interactive embed?
│   ├── Lightweight loop → Lottie JSON (from After Effects)
│   ├── State machine → Rive (.riv file)
│   └── 3D interactive → Spline embed
├── Video deliverable?
│   ├── Portfolio quality → After Effects → ProRes 422 HQ (4K)
│   ├── Web playback → MP4 H.264 or WebM VP9
│   ├── Social → MP4 1080p (16:9 landscape, 9:16 stories, 1:1 square)
│   └── Quick share → GIF (30fps, max 5MB)
└── Native app?
    ├── iOS → Spring animations (UIView.animate or SwiftUI .spring())
    ├── visionOS → Spline → native Xcode project
    └── Android → MotionLayout or Compose animations
```

#### Framer Motion Pattern (React)
```tsx
import { motion } from "framer-motion"

// Stagger children
const container = {
  hidden: { opacity: 0 },
  show: {
    opacity: 1,
    transition: { staggerChildren: 0.05 }
  }
}

const item = {
  hidden: { opacity: 0, y: 20 },
  show: {
    opacity: 1, y: 0,
    transition: { type: "spring", stiffness: 100, damping: 12 }
  }
}

<motion.div variants={container} initial="hidden" animate="show">
  {items.map(i => <motion.div key={i} variants={item} />)}
</motion.div>
```

#### CSS Motion Pattern
```css
.element {
  transition: transform var(--motion-normal) var(--motion-ease-default),
              opacity var(--motion-normal) var(--motion-ease-default);
}

@media (prefers-reduced-motion: reduce) {
  .element { transition: none; }
}
```

### 5. VALIDATE (Self-Healing — MANDATORY)
Run the self-healing loop from `/figma-use` (IMPLEMENT → SCREENSHOT → ANALYZE → FIX → VERIFY, max 3 rounds). Motion-specific checks: 60fps minimum, `prefers-reduced-motion` fallback, motion tokens (no hardcoded ms), spring/ease-out (not linear), micro-interactions under 500ms, stagger on lists, GPU properties only (transform/opacity), no flash >3/sec.

### 6. DELIVER

#### Delivery Format Matrix
| Context | Format | Specs |
|---------|--------|-------|
| Web embed | MP4 H.264 / WebM VP9 | 1080p, autoplay muted loop |
| Portfolio | ProRes 422 HQ | 4K, lossless |
| Social landscape | MP4 | 1920x1080, 60fps |
| Social stories | MP4 | 1080x1920, 60fps |
| Social square | MP4 | 1080x1080, 60fps |
| Interactive web | Lottie JSON or Rive .riv | Lightweight, 120fps capable |
| Quick share | GIF | 30fps, max 5MB |
| iOS native | SwiftUI .spring() | Match system motion |
| visionOS | Spline native | Windows/Volumes/Spaces |

---

## Apple Motion Language Reference

### Liquid Glass (WWDC 2025)
- Translucent, fluid material that reflects and refracts surroundings
- Real-time light rendering (specular highlights)
- **Spring-based animations** — elements settle with subtle rebounds
- Interface "breathes" and reacts instantly
- Depth-of-field on UI for hero moments
- Accessibility: auto-simplifies under Reduce Motion, adds opacity when transparency disabled

### Feature Reveal Pattern ("Hero Moment")
1. Device in realistic context (hand holding iPhone)
2. Zoom into UI area
3. Depth-of-field blur background
4. Animate feature with spring physics
5. Subtle glow/highlight to draw focus
6. Zoom back out to show feature in context

**Timing:** 3–8s per feature, spring easing (stiffness: 100, damping: 12), 50–100ms stagger, 60fps minimum

### Keynote Video Structure
1. **Hook** (0–3s): Dramatic intro, feature name, quick benefit
2. **Problem** (3–10s): What users struggle with
3. **Solution Demo** (10–40s): Feature in action, multiple use cases
4. **CTA** (40–50s): Why it matters, availability
5. **Outro** (50–60s): Product shot, branding

---

## Portfolio Case Study Video Structure

1. **Title & Branding** (2–3s) — Logo, project name, subtle scale 1.02x
2. **Problem & Insight** (5–8s) — Research findings, annotated mockups, slide-in reveals
3. **Design Solution** (15–30s) — Full user flow animated end-to-end, scroll-through, interactions
4. **Interaction Details** (8–12s) — Micro-interaction close-ups, state sequences
5. **Device Mockup** (5–8s) — Animated device frame with UI, slight perspective rotation
6. **Final Screens** (3–5s) — Hero shot, metrics, CTA

**Visual Design:** Dark backgrounds (#000 or #0a1420), clean typography, floating elements with shadows, 3D depth

---

## UI Animation Patterns

### Micro-Interactions
| Pattern | Duration | Easing | Details |
|---------|----------|--------|---------|
| Button hover | 150ms | ease-out | scale 1.02, shadow increase |
| Button press | 100ms | ease-in | scale 0.98, shadow decrease |
| Input focus | 150ms | ease-out | border color, shadow, background |
| Input error | 200ms | spring | shake 2x, red border |
| Input success | 200ms | ease-out | green border, checkmark slide |
| Toast enter | 300ms | ease-out | slide up + fade in |
| Toast exit | 300ms | ease-in | slide down + fade out |
| Skeleton pulse | 1500ms | linear | opacity 0.6→1→0.6 loop |
| Loading dots | 300ms ea | linear | 3 dots, 100ms stagger |

### Macro-Transitions
| Pattern | Duration | Details |
|---------|----------|---------|
| Push left | 300–500ms | Outgoing slides left, incoming from right |
| Dissolve | 400ms | Fade overlap |
| Zoom | 400ms | Scale 0.95→1.0 with fade |
| Shared element | 300–500ms | Element morphs between pages |
| Drawer | 300ms | Slide from edge + scrim fade |
| Modal | 300ms | Scale up from center + scrim |

### Data Viz Animations
| Element | Duration | Easing | Stagger |
|---------|----------|--------|---------|
| Bar chart | 500ms | ease-out | 50ms per bar |
| Line chart | 600ms | ease-out | stroke-dashoffset |
| Pie chart | 500ms | ease-out | 50ms per slice |
| Number counter | 500ms | ease-out | JS counter tick |
| Table rows | 200ms | ease-out | 50ms per row |

### Onboarding Sequential Reveal
1. Background fade (200ms, 0ms delay)
2. Headline slide-up (300ms, 100ms delay)
3. Hero image/animation (500ms, 200ms delay)
4. Body text fade (300ms, 400ms delay)
5. CTA scale-in pulse (200ms, 600ms delay)
6. Tooltip appear (200ms, 800ms delay)

---

## Figma → Video Production Pipeline

### Workflow
```
Figma Design → Motion Spec (JSON) → Animation Tool → Render → Deliver
```

**Figma → After Effects:** Use Convertify or Overlord plugins to export native AE layers
**Figma → Rive:** Import components, define state machine, animate transitions
**Figma → Lottie:** After Effects + bodymovin plugin → JSON export
**Figma → CSS/GSAP:** Manual specification from motion tokens

### Motion Spec Format
```json
{
  "animation": "card-enter",
  "element": "metric-card",
  "trigger": "viewport-enter",
  "keyframes": [
    { "time": 0, "opacity": 0, "y": 20 },
    { "time": 0.3, "opacity": 1, "y": 0 }
  ],
  "easing": "spring(100, 12, 1)",
  "duration": 300,
  "stagger": 50
}
```

---

## Tools Reference

| Tool | Best For | Output | Performance |
|------|----------|--------|-------------|
| After Effects | Complex sequences, portfolio | MP4, Lottie JSON | Excellent |
| Rive | Interactive, state machines | .riv, MP4 | Excellent (GPU) |
| Spline | 3D UI, visionOS | Native app, MP4 | Excellent (WebGL) |
| Framer Motion | React web animations | React components | Excellent |
| GSAP | Scroll-triggered, complex web | JS/CSS | Excellent |
| CSS transitions | Simple state changes | CSS | Best (native) |
| Lottie | AE → interactive playback | JSON | Very Good |
| Principle | High-fidelity prototypes | Video | Very Good |

---

## Accessibility (MANDATORY)

Every motion implementation must:
- [ ] Respect `prefers-reduced-motion` — disable animations, show static fallback
- [ ] Duration ≤ 5 seconds (or provide pause button)
- [ ] No flashing >3/sec (seizure risk)
- [ ] Color + shape communicate info, never color alone
- [ ] Screen reader announces state changes
- [ ] Keyboard shortcuts for animated interactions
- [ ] Test on low-end hardware (no jank)
- [ ] GPU-accelerated properties only (transform, opacity)

---

## Anti-Patterns

1. **Linear easing everywhere** — almost always wrong; use spring or ease-out
2. **Animating width/height** — causes layout thrash; use transform: scale
3. **No reduced-motion fallback** — accessibility violation
4. **Stagger >300ms total** — users shouldn't wait for last item
5. **Micro-interaction >500ms** — feels sluggish
6. **Infinite spin without pause** — accessibility violation
7. **Hardcoded ms values** — use motion tokens
8. **backdrop-filter animation** — causes jank; animate opacity of blur layer instead
9. **24fps for UI motion** — 60fps minimum (24fps only for cinematic video)
10. **Motion without purpose** — if it doesn't guide attention, provide feedback, or clarify state, remove it

## Rules

1. **Always specify motion tokens** — never hardcode timing or easing
2. **Always include accessibility fallback** — `prefers-reduced-motion` is non-negotiable
3. **Always validate on device** — screenshot, record, measure fps
4. **Always use GPU properties** — transform and opacity only
5. **Always stagger lists** — 50ms per child, max 300ms total
6. **Spring > cubic-bezier** — for anything interactive (iOS especially)
7. **Self-heal** — screenshot after implementation, fix issues, verify
8. **Motion is communication** — every animation must serve a purpose
