Modal scale-in

A dialog fades and scales up from 96% with a slight rise while the backdrop fades in; closing reverses faster.

TransitionPress Pure CSS time-based Targets: Web · App Chrome 117+, Safari 17.5+, Firefox 129+ for @starting-style; class fallback included
Target
Implement the "Modal scale-in" effect in vanilla HTML/CSS/JS.

Context: A dialog fades and scales up from 96% with a slight rise while the backdrop fades in; closing reverses faster.
Trigger: the element is pressed (pointerdown → pointerup).
Timeline: time-based (duration + easing).

Motion tokens (normal):
- opacity (backdrop): 0 → 1
- opacity (dialog): 0 → 1
- scale (dialog): 0.96 → 1
- translateY (dialog): 8px → 0
- duration: 220ms open · 160ms close
- easing: cubic-bezier(0.16, 1, 0.3, 1) open · ease-in close

Motion tokens (prefers-reduced-motion):
- opacity (backdrop): 0 → 1
- opacity (dialog): 0 → 1
- duration: 150ms
- easing: ease-out

Technique: prefer pure CSS transitions/animations; use JS only to toggle classes.

Acceptance:
- animate only transform and opacity unless the spec lists other properties
- no layout shift; content is visible without the animation
- when prefers-reduced-motion is set, use the reduced tokens only
- close is faster than open
- focus moves into the dialog on open and returns to the trigger on close

Generated from the spec. Prompts differ by target name only; the tokens are the source of truth.