Morning traffic makes its way along a freeway interchange in Los Angeles.Mike Blake / Reuters

LOS ANGELES—The president of the United States warns that California’s great cities are set to “destroy themselves” through unchecked homelessness and failed liberal policies. San Francisco is “in total violation” of unspecified pollution rules, and he will be “giving them a notice very soon.” Hollywood is “racist … really terrible.” The Golden State is guilty of “gross mismanagement” of its forests, its sanctuary cities are “ridiculous,” and its expansive approach to immigration has “put the entire nation at risk.”

Donald Trump’s relentless attacks on California—the latest delivered during a three-day swing through the state last week in which he announced he was revoking its ability to set its own tough auto-emissions standards—are nothing new for the 45th president. Indeed, they are nothing new in American politics, which has a venerable tradition of denouncing the nation’s left-most state as a haven for kooks, cranks, and crazy ideas.

“It’s a freebie for Trump” that energizes his base, says the veteran Republican pollster Whit Ayres. “It’s not like California’s going to turn around and vote Republican anytime in the future. This is part of the messaging that Republicans have used for years to send a signal to the rest of the country that I’m on your side, not on their side.”

But Trump’s rhetoric has its costs as well.

The truth is that much of the rest of the country is becoming more and more California-ized with each passing year, and that trend is only likely to accelerate as the national electorate grows younger and more diverse. Fifty years ago, Gladwin Hill, the longtime Los Angeles bureau chief of The New York Times, titled a subchapter in Dancing Bear, his book on the state’s politics, “California, the Laughed-at Leader.” But he went on to note that innovations born here and once mocked were soon imitated everywhere else: “swimming pools, drive-in banks, backyard barbecues, hot-rods, Capri pants, ‘ranch-style’ homes, Mexican food, the surfing craze …” Today one could easily add environmental regulation, robust state-university and community-college systems, alternative-energy production, consumer protection, and sweeping changes in social policy and public mores, including gay marriage. Republicans can condemn California all they want, but they’re risking a demographic backlash in the longer term, and perhaps even among the suburban voters Trump needs to hold on to in order to win reelection.

“I think it’s a short-term strategy, right?” says Mark Baldassare, a veteran pollster who is the president of the Public Policy Institute of California, based in San Francisco. “As so often happens in elections, Trump is thinking short-term—‘What do I need to win a year from now?’—and not what the long-term consequences might be for the party nationally for years to come, and that might affect the Republican Party here in the shorter term. It’s definitely a strategy that will resonate with lots of voters. It’s not one that will create the possibility for rebuilding a Republican Party here.”

Indeed, California—once the cradle of Richard Nixon and Ronald Reagan—is now the bluest of blue states. No Republican holds statewide office, and Democrats have supermajorities in both houses of the state legislature. That’s in no small part because Republicans here have adopted a harsh profile on immigration and social issues over the past 25 years, starting with then-Governor Pete Wilson’s support for Proposition 187, the 1994 ballot measure that withheld many state services—including public education and vaccinations—from undocumented immigrants. The GOP lost half its statewide congressional delegation in last fall’s midterm elections, and since then, once reliably red counties such as Orange and San Luis Obispo have turned blue. Voter registration is almost evenly divided between Republicans and Democrats in Kern County, home of the House Minority Leader Kevin McCarthy’s Trump-friendly district. Overall, the GOP’s share of the California electorate has shrunk from 35 percent in 1999 to barely one-quarter today.

“Trump’s attacking California on issues like clean air and auto emissions, climate change, or immigration is politically stupid,” says Bill Carrick, a longtime Democratic consultant here. “Remember, the Republicans lost a congressional seat in South Carolina in part because of Trump and offshore drilling, which is one of these California-bashing deals.” He was referring to the GOP’s loss last fall of the seat held by Mark Sanford, who is now challenging President Trump’s renomination.

“The bottom line is Trump doesn’t get that the California suburbs reflect the views of suburban voters all over the country,” Carrick says.

In fact, Baldassare notes, air quality and environmental safety have been bipartisan concerns in California for more than half a century; the reason the federal government has granted the state waivers from federal emissions rules—a tradition Trump wants to stop—is that it already had strict antipollution measures in place when the Clean Air Act was passed in 1970. “It’s not an issue that matters just to Democrats,” he says. “It’s very important to Republicans and to their quality of life and to the economy of the state. These moves by Trump are things that go against not just whatever the current Democratic leaders in Sacramento are doing, but against the way that Republicans and Democrats have been seeking to do things for years.”

Bruce Cain, a political-science professor at Stanford University and a longtime student of the state, notes that Trump’s brand of anti-Californianism is different from, and starker than, that of 50 years ago. “Version one of California-bashing was against white, liberal, middle-class, hippie-dippie countercultural kids,” Cain told me. “Starting with Reagan and his picking on kids at the University of California.

“Trump’s attack is less humorous and, I think, darker and more sinister,” Cain adds. “He’s trying to talk about terrorists coming up with Central American refugees, and has really taken the fear of violence against persons and fear of terrorism to a new level.”

Cain says that’s dangerous for Trump: “Inside his own party, he’s continuing to put pressure on the well-educated suburban women who enjoy their tax cuts and regulatory relief and the fact that they don’t have a Democrat in the White House, but are really squirming more and more over the racialized aspect of his criticism. And they have the example, particularly here in California, that this is long-term harmful to the party.”

Trump’s broadsides also ignore the reality that however much he might try to paint California as an overregulated, antibusiness crucible of failed liberal economic policies, it has nevertheless managed to spawn Tesla, Uber, Apple, Facebook, Google, Intel, Netflix, and Oracle. It is still, as it has been for decades, the place where the future so often begins.

At the same time, there is no doubt that the state has grave problems. It has 12 percent of the country’s population, but half of its homeless people. A yawning gap between rich and poor—and, perversely, a generally robust economy—has produced skyrocketing housing prices and a resulting shortage of homes, and strict building, zoning, and environmental codes often impede the kind of quick construction that might ease the problem in the short term. The mayors of San Francisco and Los Angeles acknowledge that the sprawling tent cities of homeless people on their streets have produced an untenable situation that amounts, in some cases, to a public health emergency.

That issue may give Trump an opening, not only with California’s Republicans, as Politico has reported, but with Californians more broadly. “I think it’s not only smart of him for his base, but it’s also smart for him to be talking to Democrats and independents in these cities who are fed up,” says Paul Chabot, a Naval Reserve officer who grew up in inland San Bernardino County and ran unsuccessful Republican campaigns for a congressional seat there in 2014 and 2016. After Trump’s victory, he gave up on his political aspirations in California and moved to Texas. He now runs a business called Conservative Move, which helps relocate similarly disaffected blue-state residents to red ones with career counseling, real-estate advice, and discounted moving services.

“The stories that you hear from people are very disheartening,” Chabot told me, referring to complaints about homelessness, lax law enforcement, rising costs, and shrinking opportunities for many middle-class families. “Many of them are veterans, and they compare California to a third-world country. They’re used to living in tough places and environments, but they’re stunned to see the level of homelessness. If you’re living in L.A. or San Francisco, you can’t be happy with what you’re seeing every day. Politics aside, people want to live in good, clean, safe communities.”

Part of Trump’s beef with California appears to be deeply personal. He can’t forget that Hillary Clinton beat him by some 4 million votes here, and since taking office, he’s seemed determined to punish California and other blue states in ways large and small, as my colleague Ron Brownstein notes. At the same time, Trump’s efforts over the years to gain a foothold as a developer or entertainment mogul in L.A. largely came to naught, as Los Angeles magazine recently reported in a scathing cover story titled “The Biggest Loser.”

Rob Stutzman, a longtime California Republican strategist and top aide to former Governor Arnold Schwarzenegger, agrees that “Trump is an awful brand for the California GOP for a litany of reasons, but most prominently his demagoguery regarding immigrant communities,” he wrote me in an email. But, Stutzman adds, “I’m not so quick to say that his bashing of the progressives who are running California’s large cities is detrimental to Republicans. The homelessness issues and the housing crisis writ large are severely impacting societal norms, and none of these issues are being effectively mitigated. I think even liberals in California would begrudgingly admit he has a point on those issues.”

For better or worse, there is a sense that those daunting problems must be addressed here if the California experiment is to succeed. As Joan Didion wrote long ago, “California is a place in which a boom mentality and a sense of Chekhovian loss meet in uneasy suspension; in which the mind is troubled by some buried but ineradicable suspicion that things had better work here, because here, beneath this immense bleached sky, is where we run out of continent.”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.