About midway through “The Edge of Democracy,” Petra Costa tells the story of a picture, one that she once didn’t give much thought to before of the inauguration of Dilma Rousseff, Brazil’s first female president who was locked arm-in-arm with her predecessor Lula da Silva while standing at a slight remove is Michel Temer, her vice president whose presence is the result of a political compromise that happened before her time. Serving as the film’s narrator, Costa explains how, after three failed campaigns for president, the left-leaning Lula secured the office and found success in joining forces with the center-right PMDB party, whose support would give the president a majority in Congress that he could use to achieve his goals of lifting Brazilians out of poverty as long as he would protect the interests of big business, and that partnership was expected to extend through the next administration as a PMDB Vice President could help Rousseff guide her agenda into law. However, rather than appear by Rousseff’s side, Temer can be seen lying in wait for the moment to seize power, a moment that arrives when an investigation into deals between the government and contractors bidding on access to a newly found oil reserve known as Operation Car Wash creates an opportunity to sully Rousseff to the point of impeachment and eventually come after the still-popular Lula.

If Costa can extrapolate all that from the body language in just a single moment, you can imagine what she does with the wiretapped phone calls, the first-hand footage of protests on the streets and the access she has to Rousseff and Lula as they endure intense media and political scrutiny in her riveting and infuriating third feature, which lays out exactly how her native Brazil returned to its tortured past where its leaders could lock up political adversaries and normalize authoritarian rule. The filmmaker personalizes this history, interweaving her own family’s relationship to their country into the narrative in which the lower classes’ political will, which was amplified by revolutionaries like her parents, were stymied by the influence of oligarchs and big business, a class that included her grandparents – big contractors in the country.

Yet the circumstances that have led to a crisis in Brazil where strongmen, such as the recently elected Jair Bolsonaro, could once again thrive will unfortunately seem familiar to many places in the world today, observing a court system has become poisoned by partisanship, a congress more than willing to sacrifice their values to protect a president who will sign their legislation, and the media’s tacit support in drumming up scandals to keep viewers tuning in, that make it feel as if only a few names and faces have changed. (In what seems like an effort to make it as accessible as possible, Costa’s narration for the Portuguese-Language film is in English and surely in being distributed by Netflix, it will be streamed in a multitude of different languages.)

It’s a dense, complex undertaking Costa impressively wraps her arms – and our minds – around, made even more daunting by the dual purpose “The Edge of Democracy” serves as both an immediate witness to an extraordinarily precarious historical moment and a sophisticated study of how in an age where it’s become easier than ever to record, the ability to properly contextualize has become equally important, if not more, when so many seek to ignore the parts of the past that are inconvenient to their cause and increasingly have the ability to do so with shortened attention spans and the ability to pick and choose evidence from the sea of information that’s out there. Understanding how blinding that perfect storm can be, Costa’s clarity when it comes to presenting each incremental corrosion of democratic norms is powerful in its precision while her personal passion cuts through any intimidation that such serious and rigorous consideration of history may inherently have, creating something solid to hold onto when it feels like the world is falling apart.

“The Edge of Democracy” will be released by Netflix later this year.