Chose mid-position mathematically, rather than by offset
Less maths by hacking CSS
Use CSS transitions rather than js animations
CSS transitions for folding main steps up off screen