When an element is rotated with rotate(), it goes beyond its initial size (see second rectangle).
To fix this, we will use cos() to update the element size.
Here, cos() is used within the calc() function to determine the width, height, and margin of the third rectangle element. We also need to also adjust the transform-origin and add translate() to correct the position.