The final presidential debate, thankfully the last set piece in a wretched campaign, revealed what is admirable and loathsome in American politics. Hillary Clinton displayed a razor-sharp intelligence and a quick wit. Her facility with facts trumped Donald Trump’s lack of them. Americans finally saw on Wednesday why Secretary Clinton had got rich from giving lectures after leaving office. Her fluency with words, which has earned her $22m in speaking fees, appeared to silence her opponent. Mr Trump, a boastful, thin-skinned billionaire who trades in racism and misogyny, was left squawking on the sidelines of the debate. His jibes revealed a man out of his depth. His answer was to plunge down deeper. By disgracefully refusing to rule out calling this a rigged election he gave up a fight he had by then lost.

Americans should vote for Secretary Clinton as an able and proven politician. A Trump presidency would be bad for America and dangerous for the world, so a vote for Secretary Clinton is the most effective way of preventing it. Mr Trump has been exposed for questionable tax arrangements, outrageous business practices and irregularities at his charity. The billionaire is a grabber and kisser of women who he presumed gave consent because he was famous. There are numerous allegations of sexual assault by Mr Trump. He has demonstrated that he has neither the conscience, training nor sense of history – and the desire to be judged well by it – to occupy the White House. Secretary Clinton possesses such attributes. She has a serious and sustained commitment on issues like education, healthcare and equality, and she has stood consistently for the rights of women, ethnic minorities, children and the disabled through her long career.

However, there are fewer reasons to vote for Secretary Clinton than one would have hoped. For more than two decades she has been part of a political establishment that shaped a dysfunctional country. She has been unable to escape being tarnished by the most damaging policies – notably around criminal justice – of her husband’s administration. There are well-founded concerns, highlighted by transcripts of her speeches, that she is too close to Wall Street to be an effective check on its excesses if elected.

The mood for change

Even so, as the first female president she would represent a symbolic transformative change in American politics. In some ways what Secretary Clinton has had to deal with are ingrained cultural attitudes about what success and leadership look like. These were exposed by the finding that Mr Trump would win if only men voted and Secretary Clinton would win if only women voted. That most men favor Mr Trump over Secretary Clinton demonstrates at some level a more insidious sexism than the one Mr Trump peddles: that centred on the mind, not the body. It is a hostility – deeply embedded but rarely conceded – against seeing women as genuinely equal.

There is little doubt that the 2016 presidential campaign has been one of the most confrontational contests of the modern era. The mood for change has been more pervasive and volatile, and has been supercharged by Mr Trump, a braggart with tyrannical instincts. The backdrop to this election has been genuine and understandable public anger about economic insecurity, growing inequality and frustration with elites. Mr Trump on the right and Bernie Sanders on the left have reflected that mood in their very different ways. That is not going to disappear after 8 November. The election has also raised real questions about the crisis of American democracy. Mr Trump encouraged violence against opponents and threatened to jail Secretary Clinton if he took office.

The civility that has marked out US democracy as ordered and restrained appears dead. The next president will have to resurrect it. The political topography of a polarized and resentful nation has been obscured by the preternatural equanimity of Barack Obama. Mr Trump has in some ways skilfully exploited these divisions. On social security he has moved to the left on the campaign trail, telling jobless Americans that he would not touch their benefits. Mr Trump also wants to repeal the Affordable Care Act, the landmark measure that increases health coverage for low-wage workers and benefits large numbers of immigrants and minorities. This contrasts with the real estate magnate’s offer to expand the US health programme for the elderly – Medicare – which benefits overwhelmingly older, whiter voters.

These dog whistles have been part of American politics for decades. But they come at a time when there is a sense that there are too many losers from economic growth in the country. Driving discontent in the US is a system that no longer defuses high levels of inequality with opportunities for all. The middle classes are poorer today than in 2000. Since the Great Recession the top 1% of families in the US have captured 52% of the income growth. There’s understandable anger that the wealthy were bailed out while ordinary Americans were hollowed out. Voters rage that, in the current incarnation of globalization, jobs that disappeared when the US decided to import rather than manufacture did not come back – they simply popped up elsewhere, usually in China.

The Sanders effect

Nowhere has this fury been more keenly felt than in the country’s former manufacturing heartlands, tapping into America’s long history of resistance to free trade and making protectionism a potent political force once again. The politician who has shaped the politics of the country and accounted for populist anger is Senator Sanders. The man from Vermont understood, earlier than most, that voters see the economy as rigged against them by a political system that has been corrupted by big money. His campaign was backed three to one by millennials in the Democratic primaries. This month his favorability ratings in opinion polls are only bettered by Michelle Obama.

Senator Sanders’ insurgent campaign has transformed Democratic politics – forcing Secretary Clinton to adopt, albeit sotto voce, key planks of his program such as a federal minimum wage of $15 an hour, tuition-free public college and opposition to the Trans-Pacific Partnership – President Obama’s big trade deal. Until this week, Secretary Clinton failed to outline enough of a bold reform program. Tellingly, she offered signs of one in the final televised debate, making unprompted promises to push immigration reforms, a key Sanders point, within the first 100 days of her presidency.

Although domestic politics has framed the campaign, Secretary Clinton’s election would be greeted with relief and optimism in most world capitals other than Moscow and Damascus. Despite her hawkish outlook, she will have no alternative but to recognize that the 21st century no longer always looks to the United States as an indispensable hegemon, whether benign or threatening. Secretary Clinton should focus on US soft, not hard, power – dealing with climate change and working out fairer global trade arrangements.

If Secretary Clinton is elected she must recognize the mood without pandering to its demons. She needs to bring the bold ambition about the role of government to this era that Theodore and Franklin Roosevelt each did in earlier times. She has the intelligence, the seriousness and the experience to do this. The US presidency is hugely powerful: 10% of all posts in federal government are allocated on the basis of political patronage. Secretary Clinton offers the best chance of ensuring those jobs go to competent people. Her choice of Treasury secretary in the aftermath of the banking crisis will be watched with special care, as will an olive branch appointment to Senator Sanders of the kind that president Obama made to her in 2008. She offers the greatest hope that the supreme court defends abortion rights and looks again at issues like campaign finance as well as background checks on gun owners. Yet America will soon find itself weakened at home and abroad if the new president is as badly served by congress as Mr Obama has been for most of his tenure.

There is a danger, if Mrs Clinton wins, that the Republicans will relapse into the Hillary-hatred that has marked them for a quarter century. The tragedy of this election is that, to become president, Secretary Clinton has had to talk more radically than she actually felt; to be an effective president she may be compelled to act more conservatively than she now says she wants to do.