Brazil is preparing for the opening ceremony of the Olympic Games in Rio de Janeiro's Maracanã Stadium. The three-hour ceremony will present Brazil to hundreds of millions of viewers around the world, using music and dance to show how a mix of people contributed to the country's rich and syncretic culture. It promises to be a remarkable spectacle, as do the games themselves - but the whole thing seems doomed to be overshadowed by the most protracted and bitter political conflict in Brazil's recent history.
The games will be opened by Brazil's sombre interim president, Michel Temer, who came to power in May after the Senate voted to accept a charge of "creative" federal budgeting against President Dilma Rousseff, and to begin her impeachment trial.
Temer is unlikely to ever fully overcome the controversy surrounding his ascent to power; leaked recordings of conversations with one of his ministers suggested that the impeachment proceedings were motivated in part by a desire to curtail a major anti-corruption investigation, known as Operation Car Wash, which started in 2014 and which has ensnared a slew of senior politicians.
Temer stands accused of betrayal by two former allies: on the one hand Rousseff, his former running mate and the now suspended president, who is enduring an impeachment trial in the Senate; and on the other, the former president of the lower house of Congress, Eduardo Cunha, who initiated the impeachment proceedings against Rousseff and who has been formally charged with corruption.
The upshot is a conservative restoration after almost 14 years of rule by the left-wing Workers' Party (Partido dos Trabalhadores, or PT). Temer's professed mission is to preside over a government of "national salvation" after two consecutive years of recession by reducing the budget deficit and reviving investor and consumer confidence. And unlike Rousseff, he has a working majority in Congress to help him.
A decisive change of course seems to be in the offing. While reversing the recession is Temer's immediate goal, he and his coalition allies are also committed to thoroughly liberalising the economy. On foreign policy, he has signalled a turn away from the PT's south-south priorities (including BRICS summitry) in favour of renewed bilateral ties with the likes of Argentina (itself now led by a centre-right government), the US, Europe, and China.
Rousseff's supporters, meanwhile, hope that by some miracle she can survive the impeachment vote in the Senate, which will probably occur between August 29 and September 8. Rousseff herself has said that if she does, she'll seek to call a new presidential election. But she's unlikely to get the chance, and it's far more likely that Temer will become full president by the end of this year. That would give him a mandate until the end of December 2018.
Rousseff's last three years in office were politically and economically disastrous. She failed to build and maintain a majority in Congress, and did not do enough to reign in government spending; her attempts to reduce the deficit in 2015 were too little, too late. Her government's ramshackle interventions tarnished the image of the heterodox macroeconomics that have succeeded elsewhere, and set the stage for Temer's neoliberal backlash.
Rousseff's mismanagement has sullied the legacy of her predecessor and patron Luíz Inácio "Lula" da Silva, president from 2003 to 2010, who managed to combine robust economic growth with social inclusion. And to make things worse, she spent seven years as president of the administrative council of the state oil company Petrobras, which is now at the heart of the corruption saga.
For many of those opposed to Rousseff's impeachment, her removal was a "coup" similar to the one that installed a dictatorship in 1964, albeit with Congress and the mainstream media taking the place of the military. This is a rather misguided way of viewing the affair, and detracts from the strong argument that the budgetary manoeuvres of which Rousseff is accused do not justify impeachment. Nonetheless, the conditions that led to the impeachment are partly of the PT's own making.
Since 2003, the party has played the complicated game of coalition-building that any Brazilian government must take part in to survive. In doing so, it joined forces with a number of conservative partners, and none more important than Temer's party, the Brazilian Democratic Movement Party (PMDB). Temer himself became Rousseff's running mate.
His usurping of Rousseff looks like a parliamentary hijacking of a presidency, but the impeachment followed constitutional procedure and to call it a "coup" removes the distinction between a change of government within the confines of democratic institutions and the removal of an elected president by force of arms, as happened in 1964.
And yet, however institutionally "legitimate" the defenestration of Rousseff may have been, the conflict around it shows just how troubled Brazilian politics now is.
Brazil's politics is dramatically more polarised than it was, and its institutions are struggling. The presidency has been weakened; Temer isn't much more popular than Rousseff, and generally avoids appearing in public. The Supreme Court looks increasingly arbitrary and partial. The political stability and broad policy consensus that held from 1995-2012 seem to have evaporated.
There's also widespread scepticism about the electoral process. The Petrobras corruption scandal has tarnished all politicians and political parties, and in 2014, most members of the lower house of Congress were elected with contributions from ten major companies - many of which have since been caught up in Operation Car Wash.
It is unclear who will benefit most from the municipal elections set for October. These will be the first elections covered by the new ban on corporate donations to campaigns. Even though Rousseff will probably not return to the presidency, the PT has allowed its candidates to ally with candidates from the PMDB, perpetrators of the alleged "coup".
But once the municipal elections are over, political attention will turn to the elections of 2018, including those for the presidency. And at present, it's extremely difficult to foresee what might happen.
Hobbled by the recession, the corruption scandals, and the impeachment, the PT seems to be losing its grip on the left. Lula still has his supporters, but now he has been charged with obstruction of justice as part of the Petrobras investigation, and may not be allowed to run for his long-mooted third term. And even if he's eligible, it's hard to see him winning over a majority of the electorate again.
Meanwhile, a reinvigorated conservative movement led by Congress's religious, agribusiness, and law and order lobbies may yet produce some Donald Trump-like, authoritarian-nationalist candidates. A possible one is Jair Bolsonaro, a Rio-based congressman and former army captain noted for his reactionary views on gay rights and human rights in general.
So for now, Brazil can busy itself with pulling off an exuberant and secure Olympics. But once the games are over, the municipal elections will be in full swing, and Brazilians will get back to the task at hand: the battle to shape the future of their country.