History’s crisis detectives: how we’re using maths and data to reveal why societies collapse – and clues about the future