SOUTH AFRICA’S Constitutional Court may be the world’s most emotionally powerful building. The courtroom is built with the bricks of the Old Fort prison, where both Nelson Mandela and Mahatma Gandhi were held. A glass strip around the courtroom, allowing passers-by to see in, represents transparency. Above the entrance, the values of the constitution are set in concrete in the handwriting of the first constitutional judges after apartheid—including the childlike script of Albie Sachs, who had to learn to write with his left hand after the white regime’s security services blew off his right arm. In painful contrast with its uplifting setting, a recent conversation between an Economist journalist and an official working in the building was, at the official’s request, conducted outside and, as a further precaution against surveillance by today’s security services, the journalist was asked to leave her phone inside. It is a measure of how far South Africa has fallen from the ideals it embraced when it was reborn after apartheid.

Under President Jacob Zuma, the state is failing. Contracts are awarded through bribes and connections; ruling-party members murder each other over lucrative government jobs; crooks operate with impunity.

Next week comes a moment that may determine whether South Africa slides further into this mire or starts to recover. At a conference that starts on December 16th the ruling African National Congress (ANC) is due to choose the successor to Mr Zuma as its leader, and thus its candidate for presidency of the country. The front-runners are Mr Zuma’s ex-wife and preferred candidate, Nkosazana Dlamini-Zuma, and the deputy president, Cyril Ramaphosa. For South Africa and for the whole African continent, Mr Ramaphosa needs to win.

Mandela weeps

South Africa is no longer in the forefront of the world’s consciousness, as it was in the 1990s when it made its miraculously peaceful transition from a racist regime to a modern democracy. But it still matters, and not just to its 57m people. With its superior financial and physical infrastructure, it is Africa’s economic hub. Its diplomatic and moral authority shapes southern Africa, for worse as well as better: without its support, Robert Mugabe would have lost power in Zimbabwe long ago. And, at the moment, it is the site of the most visible battle in the world between good and bad government.

Alarmed South Africans have watched the progress of “state capture”, whereby private actors subvert the state to steal public money (see article). In a report in 2016 the former public protector detailed allegations that the Guptas, business associates of Mr Zuma’s family, offered the finance ministry to a politician they hoped would be pliable and used political influence to loot state-owned enterprises. She called for a judicial inquiry. Mr Zuma says he has no knowledge of the job offer, and will establish an inquiry, but he claims that the public protector’s demand that the judge in charge must be appointed by the chief justice is unconstitutional. He did not comment on the matter of looting from state-owned enterprises.

What is unusual about South Africa is not that corruption thrives, but that it does so in plain sight. Thanks to a history of civic activism, a free press and a robust judiciary, South Africans are aware of the wholesale theft. Investigative journalists have catalogued corruption at all levels of government. Week after week, activists and opposition parties challenge the government in court. A former finance minister estimates that 150bn-200bn ($11bn-15bn) rand, 5% of GDP, has been filched.

The ANC leadership election offers what ought to be an easy choice. Ms Dlamini-Zuma is expected to protect her ex-husband, who faces 783 counts of corruption. She, like him, espouses “radical economic transformation”, which involves fiscal indiscipline and expropriation. She, like him, employs racially charged rhetoric to deflect criticism. A victory for her would undermine the economy, jeopardise social harmony—fragile, in a country with the fifth highest murder rate in the world—and entrench state capture.

Cyril v cynicism

Mr Ramaphosa’s election would not on its own ensure a swift return to clean government. Corruption runs deep, at all levels of the party. It did not help that a pre-Zuma ANC policy of “empowering ” black tycoons by encouraging the transfer of large stakes in white-owned firms to them made a handful of ANC bigwigs effortlessly rich. This set a precedent that politics in the new South Africa can be a shortcut to vast wealth. One of the biggest beneficiaries was Mr Ramaphosa himself, which complicates his campaign to purge the party of rent-seeking. Nonetheless, there is no suggestion that he broke the law, and he is outspoken in his condemnation of those who now brazenly do so. He is also pragmatic in his plans to boost economic growth and provide South Africans with jobs and education.

The numbers suggest Mr Ramaphosa is in the lead, yet he is not a shoo-in. The stakes are high for Mr Zuma and his political skills are consummate. Those who bet against him tend to lose. His compatriots await the result nervously.

Some well-intentioned South Africans think it would be better if Ms Dlamini-Zuma won, because the country has become too much like a one-party state, and an ANC run by her would be more likely to lose the election in 2019. That is a dangerous argument. The multiracial, centrist Democratic Alliance would indeed be better than the ANC, and is gaining in popularity: it now governs the country’s three most important cities. But the hard-left Economic Freedom Fighters, who might be worse than the ANC, are gaining ground, too. And the ANC, with its liberationist credentials, might win in 2019 even under Ms Dlamini-Zuma, who as president would cement the Zuma clan’s grip on the levers of power. South Africa would start to look uncomfortably like a hereditary kleptocracy.

Its people deserve better. The rainbow nation still has the potential to be a beacon of prosperity and good governance in Africa, but memories of its hopeful birth are a melancholy counterpoint to its dark present. The best chance for recovering that optimism is a victory for Mr Ramaphosa.