For most of this campaign, the assumption was that Hillary Clinton was a sure winner. Donald Trump was not running a normal campaign. He had no ground game. His campaign was marked by constant turmoil. He was exposed describing himself in terms used by sexual predators. And, of course, there were the polls that kept settling into Clinton having a three- or four-point lead. We were also told that Trump was the candidate of white racial backlash, and that the only explanation of his candidacy's power was the malignant racial resentment of Republican voters.

Well, Donald Trump has proven all of us wrong. The contest turned for him in the Rust Belt and the Midwest, where he won many counties that Barack Obama won in 2012. The great problem for Republicans heading into 2016 was to find Obama states they could win. And the voters who really seemed to matter in 2016 were the white Midwesterners who voted for Obama, and who may approve of him now, but who broke for Trump. It leads one to suspect that voters have been persistently signaling their desire for populist economic change. Obama wore that mantle in 2008 and 2012. Trump wore it in 2016. Millions of American men have dropped out of the workforce in recent decades. All Clinton offered were more tweaks to health insurance and a maternity leave program. You may not believe Trump's policies will serve this class well — I don't — but they were articulated as if the problems were grave. Voters responded to him. Hillary Clinton lost Obama voters.

The political and media belt in Washington and New York was not prepared for this result. This was partly a problem of credulity; the media never really believed that Trump could be president. But there are deeper problems. The electoral result is straining against the margin of error in the polling. Were poll respondents lying? Were people afraid to tell pollsters they were voting for Trump? Is our culture making people fearful to say they support Trump? Those questions will linger for months.

But the pressing concern is that Trump is going to be president, and he is assuming the office at a difficult time.

He inherits a divided country. And he will be at loggerheads with the political class of his country when he takes office. The same political split that divided America in this election seems to be dividing every developed nation. And no political actor has found a model for mastering this divide. In so many Western nations, we see the rise of a populist party in rural areas and declining small cities. It aligns on the side of nationalist economics, nativist immigration policy, and the resentment of the elites. On the other side are the major global cities, populated by a cosmopolitan mandarin class who enjoy the material and cultural benefits of globalization. No one has mastered the political divide this creates. Even Angela Merkel, who benefits from the power to make broke Irish taxpayers, unemployed Spanish youth, and Greek peasants pay German creditors, could not master this difficulty. How will Donald Trump master it when he is the first true right-wing populist figure to seize control of a major government? The only other populist party to capture their nation and confront the neoliberal consensus directly was Syriza in Greece. They got hammered.

On the foreign policy front, Trump's presidency will face a half dozen serious risks. George W. Bush claimed a kind of exit with honor from Iraq. Barack Obama told his legacy-sniffers in the media that he had stepped back from the abyss of the Middle East. Neither was truthful with themselves or the public. And so Donald Trump is going to inherit U.S. involvement in six wars in the Islamic world: an air campaign in Iraq against ISIS; a years-long covert and overt attempt to help "moderate rebels" overthrow Bashar al-Assad in Syria; a never-ending mop-up operation against terrorist groups in Libya; a hopeless (and disgraceful) attempt to assist Saudi Arabia install a puppet regime in Yemen; an endless series of Special Forces raids in Somalia's civil war; and the drawdown of troops in Afghanistan, even though that government is ceding territory to the Taliban. Even the most brilliant foreign policy strategists would find these conflicts difficult to juggle.

Trump will have to manage all these while enduring stressful relationships with Turkey and Iran. If he wants to pursue a detente with Russia, it would mean cutting off our own proxies at the knees. If a group of American soldiers are killed in one of these hot spots that the public barely knows about, Trump's presidency will face the same awful decision that haunted Ronald Reagan and Bill Clinton: to withdraw in disgrace from a conflict that Americans don't understand. It would immediately put his supposed devotion to an "America First" foreign policy into conflict with his touchy ego and desire to be a winner. If I were betting, I'd say that the voices of realism, restraint, and retrenchment that have attached themselves to Trump will be pushed aside in favor of advisers like John Bolton and General Michael Flynn, bold Jacksonian hawks.

But for now we also have to contend with a new reality. The era of politics that existed after the Cold War is now in doubt. This was an era of good-hearted policy experts and wonks who would twist the knobs of government regulations and subsidies by a few microns, trying to nudge us to marginally higher heights of gross national satisfaction, defined in the most coldly utilitarian terms. What we see now is a reassertion of nationalism in the United States, as elsewhere. An insistence that elites must stop their moral, cultural, and financial secession from their host nations. Donald Trump is at the head of this movement, and there are real questions about whether he truly understands it. And there are real questions about whether the Republican Party that got re-elected to Congress are willing to adapt to it. There is no roadmap for Trump. And there are many dangers ahead.