It gets cold near the surface and stays warm above.
This is a temperature inversion.