WASHINGTON (AP) — For eight summer nights, there were two starkly different visions of America.

At Donald Trump’s Republican convention, America was a nation spiraling into chaos and economic ruin. Immigrants were cast as criminals, or in some cases, potential terrorists. The government is rigged for the wealthy and powerful, almost past the point of repair.

“I alone can fix it,” Trump said as he accepted the GOP nomination in Cleveland.

The Democratic convention in Philadelphia was a four-day rebuttal.

“America needs every one of us to lend our energy, our talents, our ambition to making our nation better and stronger,” Hillary Clinton said as she became the first woman to lead a major U.S. political party toward the White House.

Clinton acknowledged Americans’ economic and security anxieties, but she defended the country’s greatness. Immigrants were celebrated at the Democratic gathering, including those brought to the country illegally as children. Government may be gridlocked, but it was also framed as a tool for protecting and providing opportunity for the marginalized.

Amid a turbulent summer at home and abroad, Clinton is accusing Trump of trying to scare voters into taking a chance on a political novice. Trump says his Democratic rival was either ignoring or underestimating the scope of the problems.

In just over three months, voters will decide whose vision they believe is right.

The race is tight. That’s a surprise to some Democrats who see Trump as glaringly unprepared for the presidency. And it’s a relief to Republicans who believe Clinton is unacceptably corrupt and who feared Trump’s unorthodox candidacy might deprive them an excellent chance to regain White House and cost them seats in the House and Senate.

Vincent Fort, a Georgia state senator who attended the Democratic convention, hoped Clinton gave voters reasons to be optimistic about her ability to tackle the nation’s pressing problems.

“Just because you are optimistic doesn’t mean you are burying your head in the sand,” Fort said. “Being optimistic is saying we can solve these problems.”

But to Sam LeDoux, a 24-year-old Republican delegate from New Mexico, Trump’s dour assessment of America more accurately reflects that “we’re in a very dark time right now.”

That the nation is divided is hardly a revelation. Politics has become more polarized in recent years, with Democrats growing more liberal and Republicans growing more conservative. When President Barack Obama carried about 53 percent of the popular vote in 2008, his victory was seen as sweeping and decisive.

But the gulf between Clinton and Trump, and those who support them, feels deeper than in most elections. It’s reflected in the tone and temperament of their campaigns, the backgrounds of the voters they’re courting and the policies they’re promising to enact.

Clinton has pledged to introduce a comprehensive immigration overhaul during her first 100 days in office. Trump has said he would design a border wall with Mexico within that same stretch. She wants to expand restrictions for gun purchases. He has said he would prevent efforts to do just that.

Clinton has spent decades in the political arena, including as secretary of state and a senator from New York. Trump, a real estate mogul, never served in government. He needs white, working-class voters — particularly men — to rally around his candidacy in historic numbers. She needs to recreate Obama’s coalition of blacks, Hispanics and women.

The parade of speakers at each convention, as well as the delegates in the arenas, hammered home those differences.

Clinton was backed by every corner of the Democratic establishment she’s long been a part of, with rousing endorsements from the president and first lady Michelle Obama, Vice President Joe Biden, and Vermont Sen. Bernie Sanders, her primary rival. But some of Sanders’ most fervent backers refused to accept his endorsement of Clinton, and they said even after her acceptance speech that they would not to vote for her.

Neither of the living Republican presidents — George H.W. Bush and George W. Bush — attended the GOP gathering or endorsed Trump. Several Republican senators and governors skipped the Cleveland gathering, using an array of excuses to do so. Texas Sen. Ted Cruz, Trump’s toughest primary opponent, did speak at the convention, but stubbornly refused to endorse the businessman in a stunning display of party disunity.

The crowd in Cleveland was a sea of white voters, and the overwhelming number of speakers were white.

The Democratic delegates were more diverse, reflecting in particular the party’s strength with African-Americans. Several immigrants took the stage, including a Medal of Honor recipient, and Khizr Khan, an American Muslim who spoke movingly about his son, who died while serving in the military in Iraq.

It’s too soon to know whether — or how — the events of the past two week will shake the results of the election. Clinton’s convention was widely praised as the more polished and professional operation. After Khan’s address and speeches by military leaders, some Republicans fretted that Democrats had more successfully embraced the patriotic themes that have been hallmarks of Republican campaigns and conventions.

But Trump has hardly suffered during this campaign for struggling with political traditions. And if Clinton doesn’t get a boost after four days of validations from Democrats’ most popular stars, it could be a troubling sign for her presidential hopes.

_

Associated Press writers Christina A. Cassidy in Atlanta and Susan Montoya Bryan in Albuquerque, New Mexico, contributed to this report.

___

Follow Julie Pace at http://twitter.com/jpaceDC