This Oscar-nominated Brazil documentary is a warning for democracies around the world

Petra Costa, 'On the President's Orders' IDA film screening, Los Angeles on Oct 30, 2019.

Sao Paulo (CNN)Brazilian director Petra Costa says her Netflix documentary should serve as a cautionary tale for the United States and the world at large.

"It talks about the global phenomenon of how democracy dies today. Not with tanks, not with the military taking over," she said in an interview with CNN. "But with the erosion of institutions, the spread of fake news, huge social media campaigns perpetrated and maybe paid for by corporations interested in the demise of democracy."
Her Oscar-nominated film, "The Edge of Democracy," chronicles Brazil's recent political upheaval, and follows the impeachment of a president, the imprisonment of a historical leader and the rise of a right-wing populist.
    She documents Brazil's still-festering divisions through a personal rather than journalistic lens, narrating events in the first person and using the political battles within her own family as a backdrop.
    The idea first came to her in 2016, when protests erupted demanding the impeachment of then-President Dilma Rousseff, accused of illegally manipulating government accounts to hide a growing deficit in order to secure her re-election.
    "The level of hatred and intolerance was so high. I had never seen it before. The media was portraying these protests as great patriotic protests, not showing the level of hatred and not showing people asking for the return of the dictatorship," Costa said.
    "I had the feeling that something very scary was happening."

    A nation divided

    Rousseff's impeachment exposed a deep polarization in Brazil.
    When our own CNN crew joined hundreds of journalists covering the trial in Brasília in 2016, we found that a huge metal divider had been erected on the central esplanade to separate angry rival marches. At the end of the hours-long vote, Rousseff's detractors cheered and chanted "Ciao darling!" while her supporters drifted away in tears.
    Supporters of Rousseff and the Workers Party declared the trial a political coup to remove the left-wing party that had been in power for 13 years.
    But many Brazilians taking to the streets b