It holds at the top of the screen while the next one climbs over it. Nothing is pinned and nothing is measured in JavaScript — the card is simply sticky.
The one below tilts away
As a card is covered it rotates back and shrinks, so the edge you can still see reads as distance rather than as a card that happens to be behind.
Scroll drives all of it
Every frame is a position, not a moment. Scroll back up and the stack takes itself apart in the same order it was built.
Depth is a shadow, not a shape
The tilt alone is not enough to sit a card behind another one. What sells it is the darkening that arrives with it.
The last one keeps its colour
Nothing comes over it, so nothing tilts it. In the original that is one line — the last card is excluded from the animation.