Airplanes measure all altitude by changes in air pressure when compared to sea level, and then can calculate out altitude above ground level (which is important for, say, landing). So a plane with an altimeter reading of 36k feet is 36k feet above sea level, even if the ground underneath the plane goes up to 7k feet. So over the ocean, a plane has to go the full 36k feet, however above a mountain with a height of 7k feet, the plane only has to go 29k feet before hitting.
At least we didn't have to get into ground speed vs air speed.