Why does the ground feel warmer underfoot than the air?
The short answer
Stone and clay surfaces absorb solar radiation all day and re-radiate it upward. In the medina, narrow streets trap this ground-level heat. Air temperature measured at head height can be several degrees cooler than temperature at foot level.
You're walking barefoot across the riad terrace and the tiles are warm. Not hot — warm. It's 10pm and the air has cooled, but the ground hasn't.
Thermal lag. Dense materials — stone, brick, rammed earth, concrete — absorb solar energy all day and release it slowly over hours. The air temperature drops as soon as the sun goes down. The ground temperature follows six to eight hours later. At midnight, the terrace tiles are still releasing heat they absorbed at noon.
In the medina, the effect compounds. Streets are paved with packed earth or stone. Building walls radiate stored heat from both sides. You're walking through a canyon of warm surfaces — heated from below by the ground, from both sides by the walls, and from above by the terrace of the building you just passed under. The air temperature might read 30°C. Your body, absorbing radiant heat from every surface, feels 38.
Bare feet register this most honestly. Shoes insulate. Bare skin conducts. The Marrakech ground at sunset is a low-grade heating element, and your feet are telling you what the thermometer won't.