How Earth's Magnetic Field Twists and Buckles During Solar Storms