Cosmic rays and ancient catastrophes