People protest against presidential candidate Jair Bolsonaro on September 29, 2018, in São Paulo, Brazil. Photo: Victor Moriyama/Getty Images

Over the last few years, Brazil went from being a confident nation led by one of the world’s most successful social democratic movements to watching the leader of that movement imprisoned, and then living through the dizzying return of the far-right ideology behind the country’s 20th-century military dictatorship — with all its explicitly violent and anti-democratic elements fully intact. These bewildering, disorienting developments have been hard for Brazilians themselves, let alone foreigners, to keep up with, but they have serious consequences for the environment, the lives of citizens there (especially poor and black Brazilians), and for the political balance in the Western Hemisphere.

The acclaimed documentary The Edge of Democracy, released last week on Netflix, offers an impressively intimate look at how exactly all of this happened and what it felt like, both for the those making major decisions behind the scenes and for regular people. It’s a moving lesson in recent American history, a crucial story whose end is still very much in question.

But it’s also a lesson in the nature of history itself; in what it’s like to live through profound changes that until recently seemed ridiculously implausible. One by one, these events change your understanding of what is possible almost imperceptibly. Then, before you know it, you are in a different world entirely, looking back and trying to understand what has happened.

At the beginning of 2015, Brazil had basically no political right to speak of, at least not in the spotlight of the political mainstream. Dilma Rousseff, Brazil’s first female president, had just been reelected in the fourth straight victory for the left-leaning Workers Party, founded by the incredibly popular Luiz Inácio “Lula” da Silva. The major politicians more conservative than Rousseff insisted that they were centrist, or at most center-right. The dark legacy of the murderous dictatorship that ruled the country from 1964 to 1985 had been so widely rejected that no one wanted to admit to being right wing. Sure, if you listened, you could often hear taxi drivers or drunk uncles at Sunday churrasco barbecues voicing plainly fascist ideas, but it seemed no one was listening.

Then an endless series of improbable things occurred, all moving the world’s fifth-most-populous country in the same direction. Pro-market youth activists capitalized on a previously leftist street-protest movement and took advantage of social media to spread their new anti-left gospel; protesters started calling for Rousseff’s impeachment as the economy began to really nosedive. This seemed ridiculous, until a notoriously corrupt congressional leader moved the process forward, in an act of obviously self-interested retaliation against the president. But everyone thought the measure probably wouldn’t pass —then it did. During the proceedings in Congress, a far-right congressman whose provocative antics had been ignored for decades shocked his way into the political conversation by dedicating his vote to the dictatorship-era general who oversaw the torture of Rousseff when she was a young left-wing guerrilla. Her former ally and vice-president, Michel Temer, shocked the world a bit more when he stepped into office in 2016 and immediately installed a deeply conservative Cabinet composed entirely of white men (in a white-minority country). As Temer’s bumbling and deeply unpopular government badly damaged the credibility of the center and center-right parties that had made the impeachment happen, the most important figure on the left was in the sights of a massive investigation that had seemingly uncovered corruption in every corner of the political system. While campaigning for reelection and leading in the polls, Lula was imprisoned in a strange case related to a beach apartment he had never occupied. Without facing any adversary in one-on-one debates during his campaign, that far-right provocateur, Jair Bolsonaro, breezed to the presidency last year with the support of much of the economic elite. He immediately made the judge who convicted Lula a powerful minister in the new government, perhaps the most right-wing elected administration on the planet.

The Netflix documentary is expertly produced in both its English- and Portuguese-narrated versions, and The Edge of Democracy is a characteristically excellent translation of the title. But the original, Democracia em Vertigem, or very literally “Democracy in Vertigo,” carries a second meaning which is just as apt. It’s not just that democracy seems to be in free fall; it’s that the events themselves throw you badly off balance. Watching certain scenes, I felt lightheaded, reeling as I experienced a profound sense of dissonance. I was covering much of these events up close, and many times the filmmaker, Petra Costa, trains the camera on spaces that I was also in, just a few feet away, whether in the halls of Congress as lawmakers voted to impeach Rousseff, or at press conferences where her attorney called the proceedings a “coup,” or at street rallies where her opponent celebrated. It was deeply unsettling to be transported back to a mental state in which, just a few years ago, we never thought Brazil could be where it is now. Were we all living through a turning point in history in those moments but failing to see what was happening?

The film dropped at another crucial juncture for Brazil. Bolsonaro has proved a worse president than he was a fire-breather. As his government falters, the Intercept Brazil has begun publishing leaked messages providing a shocking look behind the scenes of the corruption investigation that imprisoned Lula. The judge — now “Super Justice Minister” Sérgio Moro — appears to have actively and repeatedly assisted the prosecution, rather than acting as impartial official. Few doubt that there was plenty of corruption in the Brazilian government when the Workers Party was in charge, but there are now increasingly serious suspicions of political motivation behind the punishments meted out, and to whom. The Intercept recently formed a partnership with one Brazil’s most respected publications, Folha de S.Paulo, to continue to analyze and publish more of the explosive material.

Petra Costa does not pretend to be objective. It’s a deeply personal movie, and she is honest about the fact that she is from a privileged left-wing family, and was a Lula voter who saw his movement as Brazil’s best chance for the kind of progressive democracy they dreamed possible. She’s clearly confused, distraught, and emotional about the outcome, so she takes a big step back, illuminating things enormously by placing the events within the long history of Brazil.

As a result, the film also offers a lesson about the violent return of the past. She — and Lula himself in one of the film’s many revealing interviews — note that Brazil had been an explicitly racist and oligarchical nation for hundreds of years. Why did they ever think that a 10- or 20-year excursion into democracy and left-wing ideals would be permanent? The film suggests that the men who really run things had never left, and they had the tools to step in and take control again when an opportunity arose. Perhaps the most intimate understanding of this dynamic is expressed by two women who clean at the Presidential Palace, as they try to explain to the camera why their boss Rousseff had been removed. Grappling with the fact that a body of largely corrupt men impeached the president, rather than calling new elections or facing justice themselves, they wonder if democracy may have always been a sham. Maybe the people with real power just cancel it when it stops working out for them.