Gravar-mail: A unified theory for the energy cost of legged locomotion