WASHINGTON (AP) - It was his last stop of the day on a West Coast swing, a backyard fundraiser at a TV producer's home in Los Angeles, and President Joe Biden was telling the crowd how tough the past few years have been.
He ticked off challenges: Technology that's made it easier to corrupt the truth. Russia and China's efforts to upset the world order, surging inflation at home. The lingering pandemic. The after-effects of the Capitol riot. Election deniers and their impact on the upcoming nationwide voting.
Still, for all of that, Biden insisted, the nation's best days lie ahead.
The upbeat heart of the president's message is the same wherever he goes. In Detroit or Los Angeles. Syracuse, New York, or Hagerstown, Maryland. To throngs in an auditorium or a few dozen in a weathered union hall, the Democratic president declares he's never felt more hopeful.
"I truly believe we're just getting started," he told a crowd in Florida on Tuesday. "I've never been more optimistic about America's future than I am today."
Yet this refrain of Biden's presidency - this promise that things will get better - is butting up against his own dire political projections: A Congress potentially controlled by what he's labeled "ultra-MAGA" Republicans as he faces midterm elections that will define, and quite possibly stifle, the next two years of his term.
Biden always leans heavily on the positive. But he has to do so when many voters are feeling the pain of higher prices and harbor deep concerns about the fragility of democracy itself.
He is delivering his second speech on threats to the nation's system of government in as many months Wednesday night, including the prospect of key races across the country being won by candidates he believes would upset voting procedures and confidence.
Presidents "almost have to will themselves into a sense of optimism. If they can't project hope that we can surmount our difficulties, then they're sunk and we are, too," sad Jeff Shesol, a former speechwriter for President Bill Clinton who now runs a speechwriting and strategy firm in Washington.
And it's anything but clear that Biden's optimistic vision is breaking through. Just 25% of Americans said the country is headed in the right direction in an October AP-NORC survey.
Throughout history, leaders have tried to strike the right balance - leveling with people about the challenges at hand but also giving them cause to hope.
President Barack Obama tried during the 2010 midterm campaign when he was hopeful about the nascent economic recovery but mindful that so many voters were still hurting. His party saw a "shellacking" in the House.
Now, less than a week before Election Day, the nation is in an unprecedented, newly uncertain time, marked by the punishing pandemic economic fears, a mounting wave of hate crimes and political violence. Growing numbers question whether democracy can survive -- and whether their leaders can meet the moment.
That's a difficult line for any president to walk - too much Pollyanna talk can sound simply delusional.
"If you get carried away with it, as a politician or a president, you risk becoming detached from people's actual experience," Shesol said.
Biden's upbeat message is ridiculed by Republicans, whose midterm pitch is tied to a picture of a nation beset by rising crime and inflation. Even a basic metric like last week's report that the economy grew again after two quarters of contraction was subject to alternate interpretations: Biden said it was evidence the country's recovery was continuing to "power forward;" Republican Rep. Kevin Brady dismissed it as fleeting "ghost growth."
"Joe Biden is completely detached from reality," Republican National Committee Chairwoman Ronna McDaniel said last month. "Americans are living paycheck to paycheck, they can't afford rising gas and grocery prices, and real wages are down."
Those who know Biden best insist he's a realist: It's not that he believes things are great all the time; it's that he think there's always room - and a path - to get better.
Sen. Bob Casey, D-Pa., said Biden knows when to hold out hope and when to walk way. He gave the example of Biden's billion-dollar infrastructure plan. The deal fell apart in spectacularly public fashion a few times, but Biden wouldn't relent until it passed with bipartisan support. On other pieces of legislation, he has cut loose when it was clear he couldn't strike a deal.
"It's a terribly difficult balance, but I think he strikes it as well as anyone can," Casey said.
The president's outlook is shaped in part by personal tragedy: His first wife and young daughter died in a car crash in 1972 that also injured his two sons. Later, son Beau died of cancer at 45. There's nothing anyone can say to him that's worse than what he's already experienced, friends and staff often say.
Add to that his long experience in government and "he's not hit with surprises," said Ted Kaufman, Biden's longtime friend and a former Delaware senator. "He has the kind of force of his own personality, but it's leavened by the facts on the ground."
Despite Biden's efforts to convince the nation of its best self, doubts course through the electorate, particularly about the future of U.S. democracy.
Only about half of Americans have high confidence that votes in next week's midterm elections will be counted accurately, according to AP-NORC polling. Just 9% of adults think democracy is working "extremely" or "very well," while 52% say it's not working well.
Support of false election claims runs deep among Republicans running for office. Nearly 1 in 3 of those seeking election to posts that play a role in overseeing, certifying or defending elections have supported overturning the results of the 2020 presidential race, according to an Associated Press review.
White House senior adviser Mike Donilon says Biden has "never underestimated the moment we're in. But I think he has always believed that the overwhelming percentage of the country still holds what he believes to be the core values that have always defined America."
The president, Donilon added, knows there's push-pull between the country at its best and worst.
He added: "Part of moving the country forward to a better place is recognizing the reality you're facing, making the case of what should be rejected, what the country can rally around, and creating a picture of where the country can be."
Associated Press Writer Chris Megerian contributed to this report.
Follow AP's coverage of the elections at: https://apnews.com/hub/2022-midterm-elections
Check out https://apnews.com/hub/explaining-the-elections to learn more about the issues and factors at play in the 2022 midterm elections.