# Motion

Motion uses five `φ`-derived durations (`100 · 162 · 262 · 424 · 686` ms) and three restrained cubic-bezier curves (`standard`, `enter`, `exit`). Bounce, elastic easing, and auto-playing loops longer than `5s` without a pause control are left out.

## Durations and easings

| Token | Tailwind | Duration | Use |
| --- | --- | --- | --- |
| --duration-100 | duration-100 | 100ms | Micro feedback: hover, focus ring, small icon swap |
| --duration-162 | duration-162 | 162ms | Default control transition: buttons, inputs, switches |
| --duration-262 | duration-262 | 262ms | Medium reveal: dropdowns, tooltips, popovers |
| --duration-424 | duration-424 | 424ms | Panel movement: sheets, accordions, drawers |
| --duration-686 | duration-686 | 686ms | Expressive entrance: homepage reveals only |

| Token | Tailwind | Curve | Use |
| --- | --- | --- | --- |
| --ease-standard | ease-standard | cubic-bezier(0.2, 0, 0, 1) | Default state and layout transitions |
| --ease-enter | ease-enter | cubic-bezier(0, 0, 0.2, 1) | Elements entering the viewport or opening |
| --ease-exit | ease-exit | cubic-bezier(0.4, 0, 1, 1) | Elements leaving the viewport or closing |

Use `100–262ms` for docs and UI state transitions. Reserve `424–686ms` for panel movement and homepage entrances.

Click **Play** on any row to preview the duration or easing curve. When `prefers-reduced-motion: reduce` is active, demos swap translation for opacity.

## Usage

Apply duration and easing utilities in Tailwind CSS or custom properties in CSS:

```tsx
<button
  type="button"
  className="rounded-md bg-primary px-4 py-2 text-primary-foreground transition-colors duration-162 ease-standard"
>
  Hover transition
</button>
```

```css
.drawer-panel {
  transition: transform var(--duration-424) var(--ease-enter);
}

@media (prefers-reduced-motion: reduce) {
  .drawer-panel {
    transition: opacity var(--duration-162) var(--ease-standard);
  }
}
```

## Do and don't

- **Do: Swap movement for opacity under reduced motion** — Use duration-100 through duration-686 with ease-standard, ease-enter, or ease-exit, and remove spatial translation when prefers-reduced-motion: reduce is set.
- **Don't: Use bounce easing or auto-looping motion** — Do not use ease-linear, spring overshoot curves, or unpaused animations longer than 5 seconds (WCAG 2.2.2).

## Accessibility

- Respect `prefers-reduced-motion: reduce` by removing translation and keeping opacity transitions at most.
- Never autoplay decorative loops longer than `5s` without a visible pause control (WCAG 2.2.2).

## Rationale

`φ`-scaled durations create proportional timing steps from micro-hover (`100ms`) to panel motion (`424ms`), while locked easing tokens prevent jarring linear or bouncy motion.
