Panama shook in seconds, but the forces behind the powerful magnitude 7.7 earthquake had been building for years.