On the last night of the Rio Olympics, I reported on a colourful, kinetic closing ceremony – one that went on long after your television coverage ended. Organizers in the Maracana Stadium eventually turned up the lights in the hope of herding a diehard crew of samba dancers and athletes out the door. Then they turned off the music. But the samba crew had their own drums. I left well after midnight, and they were still going. I took the last subway train across the city, and on the trip, I eavesdropped on an older couple beside me, whose accent told me they were Cariocas, born and bred residents of Rio.
"That was lovely," she said contentedly.
"We did fine," he said.
The last of the glitter has been swept up, the hoardings have come down; remarkably quickly, the physical traces of the Olympics have been tidied away. And it leaves residents of Rio trying to take the measure of the Games.
There is a certain sense of unreality here – did that just happen? – and an overall consensus that, yes, we did fine. But many are also discussing whether Rio could have done better, and what will endure.
There are real anxieties, particularly about security, and a sense of missed opportunity, but also satisfaction with some unexpected achievements, both tangible ones, and more abstract gains such as a reignited sense of possibility.
When I visited the vast favela called Complexo do Alemao a few weeks before the Olympics, I saw a daycare, a church, an elementary school and a movie theatre all pocked with bullet holes from recent exchanges of gunfire between gangs and police. Residents told me they were sure the "pacification" police deployed there in a rapidly failing experiment in public security would be pulled out altogether within days of the end of the Games.
I don't think anything that overt will happen, but everyone who lives here is braced for a slide in an already precarious security situation – and however bad it is in middle-class neighbourhoods like mine, it will be exponentially, fatally worse in places such as Alemao.
The federal government said last Tuesday that it intends to leave national guard and military troops stationed in Rio until after the Paralympics, which start on Sept 7. But the state of Rio remains utterly broke; it has been running on an emergency bailout that allowed it to mount the Games. Before that, it was months behind in paying its cops. Now what happens?
With the Games concluded, there is also an awareness that Rio no longer has that incentive, or the excuse, as it is sometimes called here, to tackle its big problems, and some of the biggest did not get fixed. The polluted waterways are no cleaner; basic sanitation networks were barely extended. Public transportation to the poorest areas did not get substantially better.
"We didn't embrace the chance to overcome the original sin of Rio," Jose Marcelo Zacchi, who works for the social-justice organization Casa Fluminense, told me. "We didn't integrate the divided city."
Because whether you liked the idea of holding the Games or not, the commitment created a new window of possibility here.
Rio has been steadily decaying since its role as the capital was taken away in 1960; crime shot upwards from the late 1980s, and little public investment was made here for decades. But with the Games coming, the usually adversarial municipal and state governments worked together, and the federal government kicked in cash and support. The private sector financed a range of public projects, and there was a burst of new civic engagement.
"Rio didn't have a 'project' for many years: People were looking backward, remembering when we were a capital, the golden years, the time of bossa nova, how great we were," said Marcelo Neri, a researcher on social inequalities in Brazil with the Getulio Vargas Foundation.
Mr. Neri published a study a few weeks before the Games that caught my attention. He and his team crunched a vast amount of data and concluded that, in all but a handful of ways, the Olympics were unquestionably good for this city (a conclusion, he said, that startled him).
Income inequality fell steadily after the Games were awarded in 2009, to its lowest level ever, the research found; education, public services, housing access and access to information and communications technology all improved. Rio had a 30-per-cent rise in average income, while the figure for the rest of Brazil was just 19.6 per cent – and even as the rest of Brazil slid into a disastrous recession, the Olympic effect insulated Rio, he said; income in the city kept rising until now.
While much of the planning for the Games was done to cater to the plans of the influential real estate development industry and wealthy neighbourhoods, the poor north and west zones, too, had considerable spending, Mr. Neri said.
And the revitalization of the derelict and impoverished neighbourhood around the old port is a huge boon for the city: More than a million people visited the new square and the "Olympic boulevard." Just months ago, most Cariocas would have been frightened to set foot there.
The boulevard opened only days before the Games began, just like the new metro; these Olympics did not do much to diminish Brazilians' reputation for doing things on the fly, a bit haphazard but papered over with a good party – and that is a missed opportunity too, Mr. Zacchi said. But now that the city has incontrovertibly demonstrated it can handle a really big challenge, it needs to apply the same approach to its enduring inequities.
Ten days into the Games, I came across a neighbour on our street corner, attempting, with exuberant hand gestures, to assist a group of lost Dutch tourists. And I had to stop and laugh: For the most part, in my experience, foreigners make Cariocas nervous.
Brazil is a continent-in-a-country, isolated by its language from its neighbours. A great many visitors come to Rio for Carnaval every year, but that doesn't seem to diminish the alarm or bafflement that the need to interact with a foreigner often seems to provoke; you can spend a lot of time in Rio marooned on a sidewalk with your map if you don't speak Portuguese.
When Cariocas edge past a foreigner who cannot decipher a bus schedule or a menu, avoiding eye contact, it feels to me like a physical manifestation of Brazil's determined inward focus.
The Olympics, though, seemed to change this. "For these few weeks, Rio had a chance to interact with the world, to soak in all these things, and I think it's left a new sense of competence – of self-esteem," the writer and filmmaker Felipe Pena, who chronicled Rio's preparations, told me.
Mr. Pena hopes the new openness and the shift in attitudes endures. "You know, it's a myth about the cordial Brazilian: Brazil doesn't show it, but we are super prejudiced, against blacks, gays and the poor," Mr. Pena said. So he was struck by a particular Olympic moment, one that electrified Rio in the first days of the Games – when the judoka Rafaela Silva, who is Afro-Brazilian, gay, and from the favela City of God, won gold.
"When she won the medal and took her girlfriend to the celebration and everyone applauded – it helps as an image of diversity. … It gives me hope for more tolerance at a moment when [divisions] are growing because of the political crisis. This could be the legacy."