How to recognize that a society is about to collapse