Episodic detachment of Martian crustal magnetic fields leading to bulk atmospheric plasma escape