There is no city in the world that makes a better argument for the architecture of interiority than Marrakech. The medina, to the first-time visitor, is an assault: scooters threading the alleys at a velocity that should not be physically possible, merchants calling out in four languages, the smell of orange blossom and diesel and woodsmoke braided into a single, dizzying rope.

And then you push open a small wooden door—nail-studded, unpainted, easy to miss—and the city, instantly, becomes a rumor. You are in a riad. The noise is gone. There is a fountain. A pomegranate tree, heavy with fruit, leans over a square of sky. A man in a white djellaba brings you a glass of mint tea on a silver tray, sets it down on a small brass table, bows very slightly, and vanishes.

The genius of the riad is the genius of the Arab-Islamic tradition of sacred interior space: the world stays outside. The self, briefly, is allowed to come home.

I stayed last month at a nine-room riad in the Kasbah district, run by a French-Moroccan couple who took it over from the woman’s grandmother in 1998. They have not renovated it so much as lovingly stabilized it. The zellij tilework in the courtyard is still the original from the 1840s. The cedar doors still close with the satisfying thud of two hundred years of carpentry. My room had one small window, high up, onto a private light well. At night, the only sound was the occasional call of a nightjar and, very faintly, the bells of the ice-cream cart in the square eight walls away.

What the riad teaches you, if you stay long enough, is that the medina is not the chaos. The medina is the courtyard. The streets that connect the courtyards are the circulation between the rooms of a single, enormous house—the house that is the entire old city. Once you understand this, the alleys stop being hostile. They are hallways.

I spent my days on the rooftop terrace, in the shade of a bougainvillea the size of a small car. I read. I wrote. I drank tea that was too sweet and then, by the end of the week, tea that was exactly the right amount of sweet. I watched the light slide across the High Atlas, sixty kilometers to the south, and I understood, finally, why the grandmothers of this city have built their homes the way they have, with the beauty facing inward, for century after century.

If you travel to Marrakech to see it, you will see a great deal. If you travel to Marrakech to sit inside it, you will learn something that will take you the rest of your life to unpack.