SAN FRANCISCO – Social media influencer Sarah Tripp and her husband, Robbie Tripp, moved to San Francisco in 2016 brimming with optimism.

“We thought, here’s a city full of opportunities and connections where you go to work hard and succeed,” says Tripp, 27, founder of the lifestyle blog Sassy Red Lipstick.

But after a year-long hunt for suitable housing in San Francisco only turned up “places for $1 million that looked like rundown shacks and needed a remodel,” the couple packed up and moved to Phoenix.

They went from paying San Francisco rents of $2,500 for a one-bedroom, one-bath apartment that was far from shopping and other amenities, to purchasing a newly constructed 3,000-square-foot, four-bedroom, four-bathroom home where they’ll raise their newly arrived baby boy.

“It was cool to be living near all those high-tech startups,” Tripp says of her time in the Bay Area. “But you quickly saw that if you weren’t part of that, you’d be pushed out. It’s just sad.”

For the better part of two decades, the Bay Area has been a magnet for newcomers lured by a modern-day technology Gold Rush. But increasingly only those who have struck it rich can afford to stay.

Once a bohemian mecca that welcomed the Beat poets and '60s hippies, San Francisco now lays claim to the most expensive housing in the West, with a median home price of $1.4 million. There's also $5 a gallon gas, private schools priced like universities and chic restaurants that cost nearly double the national average.

Earlier this year, the San Francisco Bay Area was second only to New York – and ahead of Los Angeles, Washington and Chicago – when it came to people leaving major U.S. cities. More than 28,190 departed in the second quarter of 2019, almost double 2017's rate, according to a regular Migration Report from real estate brokerage Redfin.

The most popular in-state option for San Franciscans fleeing high costs is Sacramento, where the median home price is $350,000. Out of state, Seattle, at a $580,000 median, offers the biggest draw, Redfin data shows.

Yet another popular destination is even farther afield: Austin, a capital city with no state taxes and a booming tech scene that is home to Apple's latest HQ. The most recent quarter, which ended July 30, saw Austin receive 5,403 newcomers, the majority of whom came from San Francisco, Redfin says.

California overall also is losing residents. In 2018, 38,000 more people left the Golden State than entered, the second year in a row for this negative trend, according to the U.S. census. A recent Edelman Trust Barometer survey found 53% of residents and 63% of millennials were considering leaving because of the high cost of living.

“The great tragedy is this place was a middle-class paradise, and now you’ve got the flight of the middle class with all their aspirations, leaving the poor, the rich and a transient population,” says Joel Kotkin, presidential fellow in Urban Futures at Chapman University in Orange, California.

In the Bay Area, median household income is around $100,000, a tidy sum in most cities. But after federal and state taxes, residents have to cover rents that range from $3,600 a month in San Francisco to $4,600 in Silicon Valley, according to rental site Rent Cafe. That economic reality has left many of the city's low-income residents living in their cars or on the streets.

"I don't recognize my city, to be honest," says Shannon Way, executive director of HomeownershipSF, a nonprofit umbrella group that helps residents secure housing. "When you only have people at the extremes, it tears at the very fiber of what it means to live in a community."

Way says her organization does what it can to steer locals toward the city's few below market rate housing options, as well as a city down payment assistance loan program. "We focus on those who really want to stay," she says. "But it's getting harder and harder to survive here."

That desire to leave also hits the wealthiest of San Francisco residents, some of whom are perched in Pacific Heights mansions that fetch as much as $39 million.

Over the past year, a wave of initial public offerings have involved San Francisco-based tech companies such as Lyft, Uber and Slack (and, coming soon, Airbnb). Some of those newly minted millionaires aren't keen to lose "a lot of their windfalls to state taxes, so they start looking elsewhere,” says Daryl Fairweather, chief economist at Redfin. Typical tax-free landing spots include Jackson Hole, Wyoming, and Incline Village, Nevada.

California's biggest challenge

Business and political leaders – from Salesforce billionaire Marc Benioff to Gov. Gavin Newsom – have sounded the alarm over the growing housing crisis.

Last year, Benioff lobbied to pass a controversial San Francisco corporate tax to fund homelessness initiatives. And Newsom, who in his State of the State address early this year called housing “our most overwhelming challenge,” has committed $1.75 billion to fund new building projects.

During a statewide tour in October, Newsom signed various housing bills, including one that puts an annual cap on rent increases at 5% plus inflation, and another that aims to block predatory evictions.

“We’re living in the wealthiest as well as the poorest state in America,” Newsom said as he signed the bills at a ceremony in Oakland. “Cost of living. It is the issue that defines more issues than any other issue in this state."

San Jose natives Halie and Jim Casey assumed that by getting into the housing market they could keep costs under control. They had purchased a small house well suited to the two of them and were happy. But then Halie got pregnant.

“We quickly saw we couldn’t afford anything bigger,” she says.

Their appreciating asset served as a ticket out. The couple had purchased their home for $700,000, and two years later it was worth $1 million thanks in part to Google buying up land in San Jose.

Jim, 40, decided to become a stay at home dad for a spell, while Halie, 32, arranged to transfer in May 2018 with her employer, Apple, to the company’s new Austin offices.

“We got a great house with a nice yard, have great schools, and all for less money which allowed us to pay off our debts,” she says. “There’s also a flexible, family-friendly nature to life here that doesn’t exist in the intense, pressurized world of Bay Area tech.”

Housing threatens booming economy

For some experts, families opting to leave the state foreshadows larger problems. They worry a lack of affordable housing could jeopardize a state growth rate – one fueled in large part by Bay Area tech giants – that typically outpaces the national average. That could mean fewer jobs for those who stay.

“The Bay Area’s strength is also its greatest weakness,” says Jordan Levine, deputy chief economist of the California Association of Realtors. “The area has a strong economy and some of the most innovative companies in the nation, but it’s also a poster child for housing supply issues that haven’t kept up with growth.”

Chapman University's Kotkin says he’s alarmed by the growing number of California companies moving to states where cheap housing and sometimes no state taxes make it easier to pay middle-managers a living wage. These include automakers (Mitsubishi leaving L.A. for Tennessee), defense contractors (Parsons leaving Pasadena for Washington, D.C.), and technology enterprises (Apple building in Austin).

“In the end, you want a middle class in your state,” Kotkin says. “Because a society without one is unstable.”

Solutions will have to come from public officials and citizens alike, says Dowell Myers, professor of policy, planning and demography at the University of Southern California’s Sol Price School of Public Policy.

“I’m not despondent, but it requires many people to see how their interests are negatively impacted,” he says. “If you own a house, you benefit as your value goes up in a housing shortage. But your children and grandchildren will be impacted, they may not be able to live and work here. So that’ll be the way things will change.”

The alternative is bleak, says state Sen. Scott Wiener, D-San Francisco.

"We're headed to a future where the middle class won't be able to raise families here, where restaurants increasingly will close because they can't hire workers, where teachers and police officers can't live anywhere near where they work," he says. "We need a much greater sense of urgency."

Wiener, who has been criticized by housing activists who claim his various housing bills haven't been accommodating enough to low-income residents, says, "it's easy to just blame someone else when we need to look in the mirror."

He notes that tech companies such as Facebook and Google have put forth plans to build housing near their headquarters, only to be stopped by local zoning laws.

"Tech companies didn't cause our housing problems or create bad housing laws," Wiener says. "This whole thing won't be easy politically or financially, and it won't happen fast."

West Seattle = New California

But time is of the essence. Many young, educated, upwardly mobile workers in San Francisco say they can't afford to wait around for government officials and business leader to come up with solutions.

Deborah Neisuler, 42, never really thought she would leave her beloved San Francisco.

In 2006, she and her husband Justin, 44 – he’s in banking, she’s a curriculum developer – bought a small house south of town that had easy access to local freeways leading to Silicon Valley.

As the years passed, two children arrived, and suddenly the house started to feel cramped. What’s more, the prospect of private school tuition loomed given the city’s lottery system doesn't guarantee a first-choice public school.

That’s when a real estate agent friend offered to quietly test the waters for a sale, given their house had gone up in value 66%. Although “no one had heard of our neighborhood when we bought there, it was close to the freeway and offered a good commute to Silicon Valley,” Deborah Neisuler says.

The house sold quickly. Since both worked largely from home, their options were wide open. The couple didn’t want to move back East, where they are both from, and Bay Area suburbs did not appeal.

"We are city people," she says.

Instead, lured by a body of water and a sense of community, the family chose West Seattle. The area has become so popular with newcomers from down south “people call it New California, because it seems people from there are taking over,” Neisuler says with a laugh. “And I’m like, ‘Yup, that’s us.’”

Although over the past few years she has longed for San Francisco’s hip urban culture and sometimes struggles with Seattle’s dark winters, Neisuler is thrilled with the change.

“I do really miss San Francisco, it holds a special place in my heart and we were there 13 years,” Neisuler says. “But I know it’s not the best place for my family.”

Follow USA TODAY national correspondent Marco della Cava: @marcodellcava