How carbon dioxide cools the upper atmosphere—and warms earth below