By the time I reached the gate, where the cops formed a line three deep, I had been called a coward, a sell-out and a “f**ing fascist”. Apparently it was hard to see my press tags through the steel cage. The Bernie Sanders supporters outside the Democratic National Convention took me for a delegate, and shouted abuse as I passed them.

They wanted universal healthcare, free university education, a living wage and an end to imperialist wars. “Hell no, DNC, we won’t vote for Hillary,” they chanted. Their signs accused Clinton of stealing the Democratic nomination and betraying American workers. One showed her as the devil, with horns and a tail. There were only a few hundred people in the demonstration, but their righteous anger lit up Philadelphia.

Many had travelled across the United States to be there. Betty Burton, a nurse in her fifties, had come from Texas. “It may be a useless quest, but at least later on I can say ‘I did everything within my power’,” she said. Remembering that she could not say the same about the Vietnam War, she began to cry.

“There’s not a nickel’s difference between Trump and Hillary. They’re both corporatists. They’re both for the ruling class. Neither of them have any regard for us,” said Jerry Rooney, adding: “I’ve had to settle in every election since 1968.” When pressed, he admitted that he would settle again, if it looks like it’s going to be close in November. Burton said the same. “I think ‘I’m not going to participate. I’m going to write in Bernie.’ And then Trump says something and I think ‘oh my God, I’ve got to vote Democrat’.”

The Democratic party takes these people for granted at its peril. “There’s a lot of us that would like to see Bernie give them the finger and leave the party,” said Brian McCullough, a young father from Minnesota. “We feel like Trump and Clinton are two wings of the same bird,” added his wife, Gina. Asked if they were scared by the prospect of President Trump, they say: “I think the answer is ‘we really don’t care.’”

On the eve of the convention, a cache of Democratic National Committee emails showing party hacks scheming to get Clinton elected and discussing how to beat Sanders was released by Wikileaks. The server had apparently been hacked by Russian provocateurs.

The leak cost party chair Debbie Wasserman Schultz her job, but Sanders diehards hoped this was just the beginning. If they could convince enough ‘super-delegates’ to switch sides, they could overturn the result of the primaries. Although they hadn’t a chance in hell, the threat of a mutiny on prime time television lent a nervous energy to the choreographed presentations.

Sanders had angered Clinton loyalists with his refusal to concede, long after it was clear that he could not win a majority of delegates, but at the convention, he worked to unite the party. “I ask you as a personal courtesy to me to not engage in any kind of protest on the floor,” he wrote to his delegates.

At a breakfast meeting, he was booed for urging them to support Clinton. “It is easy to boo,” he said. “But it is harder to look your kids in the face who would be living under a Donald Trump presidency.” His speech to the convention closed on a note of unequivocal praise: “Hillary Clinton will make an outstanding President.”

Plenty of polls have asked Sanders supporters whether they will cast a ballot for Clinton. One survey found that given a straight choice between Clinton and Trump, nine out of ten would vote Democrat. Other polls that include Libertarian candidate Gary Johnson and the Green Party’s Jill Stein show that as many as a third could defect. There is no way of knowing how many will stay home on election day, repulsed by the whole charade.

The USA’s two major parties represent two different countries. That this is a truism does not make it any less startling to cross the border. At the Republican convention in Cleveland, there were eighteen black delegates. At the Democratic convention, there were eighteen African-American speakers on the first night.

According to the DNC’s figures, 1182 of the Democratic delegates were black, 747 were Latino, and 633 identified as LGBT. Women outnumbered men, and we were reminded time and again that Clinton is making history by accepting the nomination and that her presidency would be a huge step towards gender equality.

The calibre of the speakers highlighted how C-list Trump’s convention was in the absence of so many Republican heavy-hitters. President Obama delivered a moving valediction and Vice President Joe Biden offered a withering assessment of Trump: “He’s trying to tell us he cares about the middle class. Give me a break.”

Former New York Mayor Michael Bloomberg, a Republican turned Independent, made the case to moderate conservatives. “Trump says he wants to run the nation like he’s run his business. God help us!” he said. “Let’s elect a sane, competent person.” For light relief, there was Meryl Streep and Bradley Cooper, plus Lena Dunham and Katy Perry in an effort to enthuse millennials.

The schedule of speakers had been drawn up with exquisite care: Hispanic women followed white men, gay rights activists followed Marine Corps veterans, and so on. Black former Attorney General Eric Holder was followed by Pittsburgh’s Chief of Police, Cam McClay, who is white. A group presentation by the mothers of unarmed African-American men killed by police was followed by white New York Police Department detective Joe Sweeney.

The rainbow coalition was impressive, but it may hurt Democrats in the crucial swing states of Ohio and Pennsylvania, where four in five voters are white. Clinton will need the help of Sanders, Warren and Biden, all of whom speak more effectively to the heartland than she does.

Michelle Obama’s speech promoted a diverse, inclusive, tolerant USA. “I wake up every morning in a house that was built by slaves. And I watch my daughters—two beautiful intelligent black young women—play with the dog on the White House lawn,” she said. “Don't let anyone ever tell you that this country is not great… Because this right now is the greatest country on Earth.”

Clinton can hardly run as a change candidate, but she must know that this optimism is shared by too few people at present. Acknowledging the depth of economic inequality and insecurity while simultaneously touting continuity and incremental progress is a feat of gymnastics, even for her.

Senator Elizabeth Warren, an icon of the left, undercut the relentlessly positive tone of the convention with a speech about “people who work their hearts out but are up against a hard truth—the game is rigged against them.” This is the language of Sanders and Trump, and it resonates in white working and middle class communities that have heard too many promises from the Clintons.

In real terms, the median wage for men without a university education has fallen 13% since 1990. The inactivity rate - neither employed nor looking for work - has doubled among men aged 25 to 54 since 1980. For the first time since the Vietnam War, life expectancy for whites is in decline, partly as a result of an epidemic of heroin and prescription opiate addiction. Polls consistently show that only one in four Americans thinks the country is on the up.

On Wednesday night, Trump tweeted: “Our country does not feel 'great already' to the millions of wonderful people living in poverty, violence and despair.” His campaign is powered by racial resentment, but it has come this far - a dead heat for the presidency - because his criticism of a corrupt political and economic system hits the mark.

His rhetoric on trade is often indistinguishable from left wing populism: “I have visited the laid-off factory workers, and the communities crushed by our horrible and unfair trade deals. These are the forgotten men and women of our country. People who work hard but no longer have a voice.”

Sanders discouraged the protests against Clinton in Philadelphia but could not stop them. In the square outside City Hall, a few hundred believers chanted “Bernie or Bust”.

“I’ve got a soul,” hollered one young man at the front. Some carried banners suggesting that Clinton should be locked up for storing classified emails on her personal server. “The fact that she did not go to prison for what she did: that’s scary,” said Jessica Spencer, a young woman from Indiana with a Bernie tattoo on her right shoulder.

When I mentioned that calling Clinton a criminal is a right wing talking point, she shrugged. “I feel like the Republican party embraces racism and the Democratic party embraces corruption. If Trump gets elected, maybe that’s what America needs to get their shit together.”

On Wednesday, Gallup released a poll showing that Clinton’s favourability rating has now fallen so far that she is as unpopular as Trump. Much of the criticism of her is gendered and manifestly unfair, but this is besides the point: the election will be a dogfight between two widely disliked candidates.

Clinton cannot win unless she can convince Sanders supporters to set aside their mistrust and vote for her. Trump pokes at the wound constantly. His fear that it may be healing was evident in a tweet on Friday: “Wow, my campaign is hearing from more and more Bernie supporters that they will NEVER support Crooked Hillary. She sold them out."

Clinton’s acceptance speech borrowed policies, language and themes from Sanders. She promised to invest in jobs, expand Social Security, oppose free trade deals, make university tuition free, support a $15 minimum wage and tax “Wall Street, corporations, and the super-rich.” As she spoke, scattered outbreaks of heckling were drowned out by chants of “Hill-A-Ry, Hill-A-Ry.”

“The younger Bernie Sanders delegates need to understand the lesson that those of us who are Vietnam War-era people understood and lived,” said North Carolina delegate Robert Hyman. He was wearing a blue t-shirt reading “Thank You, Bernie,” but is ready to give his all for Clinton. “I sat out the 1968 election. We got Richard Nixon, who was impeached for trying to become a dictator. Donald Trump will be a thousand times worse.”