Earth's perilous journey through the Milky Way's spiral may shape the planet's geology