Give the parent `perspective` and the card `transform-style: preserve-3d`. Compute the cursor's relative position inside the card (0–1) and map the vertical axis to `rotateX` (tilts back as you move up) and the horizontal axis to `rotateY` — the center (0.5, 0.5) means no rotation.
Move a soft radial-gradient "shine" along with the cursor position on top, and the surface reads much more like glass catching light. Keep the transition short (0.05–0.1s) so it doesn't feel like it's lagging behind the cursor.
Push the rotation too far (past ~20°) and text inside the card distorts into unreadable territory. Most implementations cap it around ±15°.
When to use
Use it on product or profile cards where you want a tactile, physical feel. On touch devices there's no hover, so disable it there.