Energy landscapes and urban trajectories towards sustainability