Three nested wrappers, each with one job. Strip any of them out and the whole illusion collapses back into a flat rectangle on a page.
The whole effect rides on CSS's perspective property. The outer wrapper defines the 3D space, the middle one preserves it, and only the inner card actually rotates. Three transforms standing on each other's shoulders.
The card tilts toward wherever your cursor goes. Move closer and it leans in; pull away and it settles flat. As it turns, the highlights drift forward, a translate going one direction and a shadow going the other, fooling your eye into reading depth.
Syed Mohammad Ammar