SAN FRANCISCO — Christine Johnson, a public-finance consultant with an engineering degree, was running for a seat on the San Francisco Board of Supervisors. She crisscrossed her downtown district talking about her plans to stimulate housing construction, improve public transit and deal with the litter of “needles and poop” that have become a common sight on the city’s sidewalks.

Today, a year after losing the race, Johnson, who had been in the Bay Area since 2004, lives in Denver with her husband and 4-year-old son. In a recent interview, she spoke for millions of Californians past and present when she described the cloud that high rent and child-care costs had cast over her family’s savings and future.

“I fully intended San Francisco to be my home and wanted to make the neighborhoods better,” she said. “But after the election we started tallying up what life could look like elsewhere, and we didn’t see friends in other parts of the country experiencing challenges the same way.”

California is at a crossroads. The state has a thriving $3 trillion economy with record low unemployment, a surplus of well-paying jobs, and several of the world’s most valuable corporations, including Apple, Google and Facebook. Its median household income has grown about 17% since 2011, compared with about 10% nationally, adjusted for inflation.

But California also has a pernicious housing and homeless problem and an increasingly destructive fire season that is merely a preview of climate change’s potential effects. Corporations like Charles Schwab are moving their headquarters elsewhere, while Oracle announced that it would no longer stage its annual software conference in San Francisco, in part because of the city’s dirty streets. “Shining example or third-world state?” a recent headline on a local news website asked.

“You get depressed if you listen to everything going on, but you can’t find a contractor and the state continues to create jobs,” said Ed Del Beccaro, an executive vice president with TRI Commercial Real Estate Services, a brokerage and property management company in the Bay Area.

Whether it’s by taming bays and mountains with roads, bridges and power lines or grappling with a lack of water and crippling earthquakes, California is perennially testing the limits of growth. Its population has swelled to 40 million and the state’s economy has grown more than previous generations had thought possible, cramming more cars and more people into cities that were supposed to be tapped out, while seeding new companies and new industries as old ones died or moved elsewhere.

But today it has a new problem. For all its forward-thinking companies and liberal social and environmental policies, the state has mostly put higher-value jobs and industries in expensive coastal enclaves, while pushing lower-paid workers and lower-cost housing to inland areas like the Central Valley.

This has made California the most expensive state — with a median home value of $550,000, about double that of the nation — and created a growing supply of three-hour “super commuters.” And while it has some of the highest wages in the country, it also has the highest poverty rate based on its cost of living, an average of 18.1% from 2016 to 2018.

That helps explain why the state has lost more than 1 million residents to other states since 2006, and why the population growth rate for the year that ended July 1 was the lowest since 1900.

“What’s happening in California right now is a warning shot to the rest of the country,” said Jim Newton, a journalist, historian and lecturer on public policy at the University of California, Los Angeles. “It’s a warning about income inequality and suburban sprawl, and how those intersect with quality of life and climate change.”

You can see this in California economic forecasts for 2020, which play down the threat of a global trade war and play up the challenge of continuing to add jobs without affordable places for middle- and lower-income workers to live. You can see it in the Legislature, which has raised the minimum wage, and next year is poised to debate a bill that could reshape the state by essentially forcing cities to allow multistory buildings near transit stops. You also can see it in the stories of people like Johnson and other highly educated workers who have gone elsewhere.

For Bryan Diffenderfer, leaving was about acquiring financial breathing room. Diffenderfer is a 36-year-old native Californian who until recently worked in sales and lived in a 1,200-square-foot townhouse in a Bay Area suburb with his wife and 2-year-old daughter. They had the means to buy a bigger home, but the mortgage payment would have been overwhelming. They bought a five-bedroom house outside Indianapolis for about $500,000, and Diffenderfer quit his job to work for his wife, who runs an ad-supported fashion blog and social media business.

“I love California, but you hear about people who are cash-poor because they have to invest so much in their house,” he said. “Moving gave me the flexibility to leave my job and go into our family’s business.”

MBA BY THE BAY: See how an MBA could change your life with SFGATE's interactive directory of Bay Area programs.

The Tech Crunch

A decade ago, California was mired in the Great Recession along with the rest of the nation. Unemployment was 12%, the state had a yawning budget gap and foreclosures were bad enough that skateboarders were rejoicing at the surplus of empty swimming pools. Far from lamenting the influence of tech companies, San Francisco extended tax breaks to get them to stay.

When growth picked up, driven by a once-in-a-generation tech boom that accompanied the proliferation of social media and the widespread adoption of smartphones, California became the foremost example of an innovation economy. Startups pitched themselves as the Uber of X, while cities promoted themselves as the Silicon Valley of Y.

But the underlying fault lines were still there. Rents and home prices stayed high, especially in the coastal areas where job and income growth was strongest. As the economy picked up and housing costs resumed their rise, lower-paid service and professional workers moved to distant exurbs, while homelessness spiraled to the point that local political leaders are all but declaring they are out of solutions.

Elected officials in Los Angeles have urged the governor, Gavin Newsom, to declare a state of emergency over homelessness, while the governor is in turn telling the federal government that a state with a $215 billion annual budget cannot solve this on its own. But President Donald Trump has belittled California’s homelessness problem and repeatedly sought to punish the state, whose 55 electoral votes went to Hillary Clinton in 2016. With their traffic and trash, California’s biggest cities have gone from the places other regions tried to emulate to the places they’re terrified of becoming.

There are increasing complaints in Oregon, Nevada and Idaho that rents and home prices there are being pushed up by new arrivals fleeing California. A recent election in Boise, Idaho, was seen as a referendum on California-style growth. And Oregon’s decision to essentially ban single-family house neighborhoods has been billed by lawmakers as a bold intervention to pull the state away from a California-like trajectory.

People have short memories, of course, and as soon as there is another recession, the focus of Californians and their leaders is bound to turn from the strains of growth to creating jobs. From 2009 to 2011, in the aftermath of the last recession, the poverty rate reached 23.5%.

“A decade ago they were cutting school funding and social services,” said Stephen Levy, director of the Center for Continuing Study of the California Economy. “There are people injured by prosperity, but obviously a recession is more damaging to most people.”

Embrace of the Robot Arms

For now, voters and businesses are less concerned about where growth will come from and more concerned with figuring out how to address its discontents. In a recent poll, by the Public Policy Institute of California, homelessness was tied with the economy as voters’ top concern, the first time it has been a top issue in the 20-year life of the survey. Another survey by the institute showed that almost half of Californians have considered leaving because of high housing costs.

Restaurants and other businesses are hiring fewer workers than they might because they cannot find enough people who can afford local housing costs. It’s also an issue for giant technology companies like Apple, Google and Facebook, which have pledged a total of $4.5 billion to build subsidized housing.

Greg Biggs is adding more machines and moving jobs to cheaper locations. Biggs is the chief executive of Vander-Bend Manufacturing, a company in San Jose that makes metal products including surgical components and racks where data centers store computer servers. Vander-Bend has doubled its head count over the past five years, to about 900 employees, and pays $17 to $40 an hour for skilled technicians who need training but not a college degree.

This is precisely the sort of middle-income job needed in the Bay Area, which like many urban areas is bifurcating into an economy of high-wage knowledge jobs and low-wage service jobs.

The problem is he cannot find enough workers. The unemployment rate in San Jose is around 2%, and many of Vander-Bend’s employees already commute two or more hours to work. To compensate, Biggs has bought several van-size robot arms that pull metal panels from a pile then stamp them flush, bend their edges and assemble them into racks. He has opened a second location 75 miles away in Stockton, where labor and housing costs are a lot lower.

This is in most ways a success story. Vander-Bend is raising wages and training workers. The machines are not replacing jobs but instead make them more efficient, and the company is bringing higher-wage positions to a region that needs more of them. But for workers, even substantial income gains are being offset by rising costs.

A decade ago Manuel Curiel made $22 an hour as a production worker at Vander-Bend. Today he is 37 and, after several promotions, makes a six-figure salary. Almost anywhere else, that would be a shining example of how the longest economic expansion on record is reaching more workers, including those, like Curiel, who dropped out of high school.

But this good-news story comes with a catch. In the decade that Curiel’s salary tripled, the rent on his family’s small two-bedroom apartment in Santa Clara more than tripled, from a little over $600 to more than $2,200, including a 35% increase one year. He has since joined Vander-Bend in moving about 80 miles east to Manteca, near the factory in Stockton, where he lives in a house offering more space for about the same rent.

This article originally appeared in The New York Times.