Megacycles in the evolution of the crust-mantle system