Summer is warm because you are closer to the sun.
It’s actually warmer in the summer because Earth is tilted. During the year-long orbit, our planet’s tilt is what allows the sun’s energy to reach us more directly.