As Democrats debate why they lost the 2016 elections, Hillary Clinton must feel like the star-crossed heroine in a Greek tragedy. She beat Donald Trump handily, by a margin of at least 2.6 million votes. Yet even in winning, the fates (and the Electoral College) have cruelly decreed that she lose.

Compounding the sense of tragedy is Trump’s all-too-characteristic reaction to the embarrassment of not being America’s first choice. He told the nation he’d been cheated, an outright lie lifted from the febrile realm of fake news. That the President-elect is willing to undermine public confidence in the integrity of U.S. elections to salve his wounded vanity reinforces Clinton’s argument that he’s unfit for the job he now holds.

She also won that argument, with plenty of assists from her opponent. Exit polls showed 63% of voters agreed Trump lacked the temperament to be President—but a fifth of them voted for him anyway. Evidently, their desire to shake up Washington outweighed their qualms about Trump’s sociopathic personality and total lack of political experience.

His upset win leaves a bitter taste in the mouths of Democrats and the many principled Republicans who put country before party and refused to back Trump. What’s most disconcerting isn’t losing an election, but the feeling that our political system itself has failed. The success of an interloper like Trump signifies a severe disturbance in the force that has up until now protected American democracy against populist demagogues.

As the populist tide rolls across the transatlantic world, it’s hard to feel anything but sympathy for Clinton. She’s an infinitely better person than Trump, who falsely and maliciously branded her a criminal. But she did not run a better campaign, and now progressives must come to grips with how she lost to the most unpopular nominee in modern times.

There’s no point in whining about the Electoral College. Team Clinton knew the terrain on which the race would be decided. The question is why Trump was able to solve the Electoral College puzzle, and they weren’t.

The answer lies in two strategic miscalculations. The first was the decision to devote more resources to making Trump anathema to voters than to articulating a compelling rationale for Clinton’s candidacy. She fell back on “experience,” while he at least offered restive voters a theory of big change, however implausible the details. And while she succeeded in deepening public doubts about Trump, she failed to engage anxious white working class voters in a conversation about their economic and cultural discontents.

Even in this era of extreme polarization, presidential elections are two-sided affairs. Candidates must energize their core supporters and get them to the polls. But they also have to frame appeals to a growing cohort of independents and to soft partisans of the other party. No Democrat was going to convert blue-collar whites en masse, but they didn’t need to. Empathetic but straight talk to these voters could have tempered their enthusiasm for Trump and hostility toward Democrats on the margins. In a contest decided by 100,000 votes in a few swing states, that might have been enough.

Unfortunately, the Clinton camp ignored the prescient warnings last summer of Agriculture Secretary Tom Vilsack. “Democrats need to talk to rural voters,” said Vilsack, a former governor of Iowa. “They can’t write them off. They actually have to spend a little time talking to them.”

Given the reservations many independents and suburban Republicans had about Trump, Clinton had a reasonable shot at being the first Democrat to win a majority of college-educated whites. She fell short, likely because little of what she had to say appealed to their economic aspirations.

Rather than offering economically anxious voters (with or without college degrees) a hopeful blueprint for enlarging economic opportunity, Clinton’s basic message hewed closely to the Democratic establishment’s preferred script: heavy on government redistribution, light on economic innovation, growth and competitiveness.

Unlike Trump, Clinton offered a richly detailed policy agenda in her 250-page policy book, Stronger Together. Lacking overarching themes or vision, however, the book is a prosaic collection of programmatic promises to Democrats’ target constituencies. For labor, a hike in the minimum wage and opposition to the Transpacific Trade Agreement; pay equity for women; for young voters, free tuition at state colleges for middle class families and caps on student loan payments; criminal justice reform for African Americans; for Hispanics, a humane path to legalization for illegal immigrants; strong anti-discrimination measures for the LGTB community, and so on.

Which brings us to Team Clinton’s second and related strategic failure: A message and electoral strategy tailored narrowly to the demands of identity politics. The Clinton campaign bet heavily on recreating Obama’s huge advantages with groups that are growing in the U.S. electorate: minorities, millenials, single women and secular voters. Obama’s success had convinced many Democrats they could count on this “Rising American majority” to maintain their lock on the Electoral College.

Such demographic determinism, however, proved unavailing as Clinton won smaller margins among these groups than Obama. That was not a problem in overwhelmingly Democratic states on the two coasts but it was devastating in the more thinly blue rustbelt states of Wisconsin, Michigan and Pennsylvania. And Clinton’s enthusiasm gap even extended to white voters, with whom she also underperformed Obama.

Despite these errors, Clinton won the popular vote comfortably. But while Trump won fewer votes, he won them in the right places. What lessons should progressives learn from such a tragic loss?

One is that America’s changing demography doesn’t guarantee a progressive majority. Each nominee has to chart a unique course to the White House and build their own majority. This means that the art of political persuasion is still more important to winning presidential elections than the mechanics of mobilization. And if you want to play identity politics, it’s probably a bad idea to ignore whites, who still comprise nearly 70 percent of U.S. voters.