The coffee rush. The lunch rush. The columns of headphone-equipped tech workers rushing in and out of train stations. The lanyard-wearing visitors who crowded the sidewalks when a big conference was in town.There was a time three years ago when a walk through downtown San Francisco was a picture of what it meant for a city to be economically successful. Take the five-minute jaunt from the office building at 140 New Montgomery Street to a line-out-the-door salad shop nearby.The 26-story building, an Art Deco landmark that was once the tallest in the city, began its life as the headquarters for the Pacific Telephone & Telegraph Company. Decades later, it served as the home of the local search company Yelp. The nearby salad store was part of a fast-growing chain called Mixt.Yelp and Mixt had little more than proximity in common, which at that time was enough. Yelp was an idea that became billions of dollars in value on the internet. Mixt was a booming business serving lunchtime salads to the workers who traveled on electrified trains and skateboards to their jobs in downtown cubicles.Their virtuous cycle of nearness, of new ideas becoming new companies, feeding other ideas that become other companies, was the template for urban growth.Businesses like Yelp took root in the high-energy, high-density city; chains like Mixt flourished alongside them as their workers ventured out for lunch. As downtowns have emptied out, their once-symbiotic relationship is coming undone.“This area was always packed with people,” recalled Maria Cerros-Mercado, a Mixt manager who built her career in food service downtown. “People would get off the BART, buy coffee, buy this, buy that. There was always just so much walking.”Today San Francisco has what is perhaps the most deserted major downtown in America. On any given week, office buildings are at about 40 percent of their prepandemic occupancy, while the vacancy rate has jumped to 24 percent from 5 percent since 2019. Occupancy of the city’s offices is roughly 7 percentage points below that of those in the average major American city, according to Kastle, the building security firm.Yelp had its offices in this 26-story building at 140 New Montgomery Street in San Francisco but left after the pandemic began.More ominous for the city is that its downtown business district — the bedrock of its economy and tax base — revolves around a technology industry that is uniquely equipped and enthusiastic about letting workers stay home indefinitely. In the space of a few months, Jeremy Stoppelman, the chief executive of Yelp, went from running a company that was rooted in the city to vacating Yelp’s longtime headquarters and allowing its roughly 4,400 employees to work from anywhere in their country.“I feel like I’ve seen the future,” he said.Decisions like that, played out across thousands of remote and hybrid work arrangements, have forced office owners and the businesses that rely on them to figure out what’s next. This has made the San Francisco area something of a test case in the multibillion-dollar question of what the nation’s central business districts will look like when an increased amount of business is done at home.“Imagine a forest where an entire species suddenly disappears,” said Tracy Hadden Loh, a fellow at the Brookings Institution who studies urban real estate. “It disrupts the whole ecosystem and produces a lot of chaos. The same thing is happening in downtowns.”The city’s chief economist, Ted Egan, has warned about a looming loss of tax revenue as vacancies pile up. Brokers have tried to counter that narrative by talking up a “flight to quality” in which companies upgrade to higher-end space. Business groups and city leaders hope to recast the urban core as a more residential neighborhood built around people as well as businesses but leave out that office rents would probably have to plunge for those plans to be viable.Below the surface of spin is a downtown that is trying to adapt to what amounts to a three-day workweek. During a recent lunch at a Mixt location in the financial district, the company’s chief executive, Leslie Silverglide, pointed to the line of badge-holding workers and competition for outdoor tables. It was also, she noted, a Wednesday — what passes for rush hour. On Wednesdays, offices in San Francisco are at roughly 50 percent of their prepandemic levels; on Fridays, they’re not even at 30 percent.A park in downtown San Francisco. On any given week, office buildings are at about 40 percent of their prepandemic occupancy.The lunchtime business downtown is not, and may never, be what it used to be. But if workers aren’t going to return to buying their $17 salads downtown, Mixt will follow them home.Which is why on a recent Wednesday morning, one of Mixt’s managers, Ms. Cerros-Mercado, 35, stood on a mostly empty sidewalk waiting for an Uber (another company that told most of its employees they can work half their time from home).More on CaliforniaBan on Flavored Tobacco: The Supreme Court refused to block a California law banning flavored tobacco, clearing the way for the ban to take effect.L.A.’s New Mayor: Vice President Kamala Harris swore in Karen Bass as the first female mayor of the nation’s second-largest city in a ceremony that celebrated her historic win but also underscored the obstacles ahead.Employee Strike: Postdoctoral students and academic researchers at the University of California said that they would return to work, partly ending a weekslong strike to demand higher pay. Some 36,000 workers remain on strike.A Piece of Black History Destroyed: Lincoln Heights — a historically Black community in a predominantly white, rural county in Northern California — endured for decades. Then came the Mill fire.Ms. Cerros-Mercado lives in San Francisco and used to walk downtown for work but now manages a Mixt branch in Mill Valley, a Marin County suburb that has 14,000 people and $2 million starter homes.Many of the former office workers who live there have yet to return downtown en masse, but their purchases over the past three years have shown that they still want downtown perks and services like a freshly prepared lunch. Mixt opened the Mill Valley location this year as part of a push to generate more business in residential neighborhoods and suburbs.Just before 7:30 a.m. on that recent Wednesday, Ms. Cerros-Mercado watched her Uber pull up outside a downtown Whole Foods so she could start her commute to the suburbs. It proceeded along the sleepy streets where she used to work — past coffee-shops and dim sum restaurants, past the glass towers and the boarded-up storefronts — and sped across the Golden Gate Bridge toward Marin.The Creative ClassAs it happens, Yelp was inspired by a flu.Mr. Stoppelman, 45, contracted the virus shortly after returning to the Bay Area from business school. This was in 2004, back when the internet had enough information that you could find something about anything, yet was also still new enough that the information was rarely more detailed than what you could find in the Yellow Pages. When Mr. Stoppelman went online to find a doctor and was confronted by a bunch of phone and suite numbers but little about the actual physicians, it gave him an idea.Jeremy Stoppelman, chief executive of Yelp, decided to allow its 4,400 employees to work from anywhere in the country.Aaron Wojack for The New York TimesYelp began as a word-of-mouth email service before morphing into the local review and directory site that is now worth about $2 billion. That he had a good idea was less important to the company’s success than the Bay Area’s tech ecosystem — the experience and social connections Mr. Stoppelman gained from his previous job at PayPal helped him procure $1 million in start-up funding.Another factor, Mr. Stoppelman said, was a crucial decision, unusual at the time, to locate the company in a San Francisco office building instead of a Silicon Valley office park.“I’m not sure that Yelp would have succeeded if we weren’t in the city,” he said. “When you’re in a city, there’s lots of places you might go, and an efficient way to sort through the possibilities is important. Yelp was a killer app for the city.”San Francisco is about 40 miles from the heart of Silicon Valley, which for the most part consists of low-slung suburban cities that sit along U.S. 101 and have sprawling office campuses surrounded by acres of parking. Until fairly recently, however, the city was considered a subpar place for start-ups.The downtown business district had historically revolved around banks and insurance companies. And the wave of tech companies that sprouted up in San Francisco during the dot-com boom of the late 1990s became symbols of that period’s delusions when they went out of business during the dot-com bust. Mr. Stoppelman said the surplus of fly-by-night companies gave credence to a joke that circulated around PayPal: Start-ups do better in the suburbs because their workers have less to do outside the office.But the bust provided an opportunity in the form of cheap office space that proliferated through the city’s South of Market neighborhood, which sits next to the financial district. Besides, for a new generation of start-up founders like Mr. Stoppelman, who was in his 20s and single when Yelp started, the city just seemed more fun.In San Francisco, and around the country, a growing preference for urban living was showing up in surveys, condo prices and pour-over coffee shops. Economists like Edward Glaeser at Harvard and Richard Florida at the University of Toronto distilled this movement into a sort of new urban theory that said cities were benefiting from several converging trends, including a more tech-driven economy, plunging crime rates and the bubble of young millennials entering the work force.Downtown San Francisco in December. Until 2020, the area was packed with people.In his 2002 book, “Rise of the Creative Class,” Mr. Florida posited that instead of seeking lower taxes and operating costs or locating near suburban enclaves with good schools, companies like Yelp were sprouting in cities rich with the design and engineering workers their businesses needed to grow. He parlayed the book’s success into a consulting firm, the Creative Class Group, which advises cities on strategies for attracting young workers.The advice — find educated workers, create dense fun neighborhoods and embrace social liberalism — could be reduced, effectively, to “become more like San Francisco.”An irony of San Francisco’s emerging status as an economic bellwether was that until the Great Recession, when a plunge in tax revenue prompted the local government to go scrambling for ways to stimulate growth, the city had made no special effort to attract tech companies. In the wake of the downturn, however, the city altered its tax code to be more welcoming to start-ups, while office owners started offering the shorter leases start-ups desire and open floor plans that allow companies to cram more people together.Less than a decade later, a city that was never more than a Silicon Valley satellite was the epicenter of a new boom, with companies like Twitter, Lyft, Uber, Dropbox, Reddit and Airbnb all setting up inside the city limits. And the employees who worked there needed lunch.Ms. Cerros-Mercado, who grew up in the city, watched this unfold while building her career at Specialty’s, a local cafe and sandwich chain known for its giant cookies. She started working there for about $10 an hour and regarded it as a stopping off point that would help support her children as she went through college, with the hopes that she would later go to nursing school.But she came to like it and rose from being a cashier to a kitchen manager and then general manager who made $80,000 with time off, along with dental and health benefits. The main location where she worked was downtown, next to a Mixt restaurant whose lines spilled onto the street.The Creative Class and Its DiscontentsEmpty seats at a restaurant in downtown San Francisco, perhaps the most deserted business district in America.For the optimized office worker looking for the trifecta of fast, healthy and filling, few meals are more efficient than a pile of veggies and some dressing swirled with tofu or grilled chicken. Unfortunately, the aspirations of a salad are often dashed by the difficulty of making one that is actually good. The ingredients come from every corner of the supermarket, and if they aren’t combined in the right proportions, or if they are made too far in advance, every bite is a drag.Ms. Silverglide, 42, the chief executive of Mixt, tried to solve this problem with a setup in which customers proceeded down a counter and called out ingredients like grilled chicken and roasted brussels sprouts while stipulating exactly how much dressing they wanted. She said the naysayers of the time told her that there weren’t enough salad eaters to sustain her company, or that only women would eat there.Instead, lines extended down the block, and Yelp’s users gave the business three and a half stars. People like Mike Ghaffary discovered a healthier kind of lunch in a restaurant where customization was encouraged.Mr. Ghaffary is a former Yelp executive and serial optimizer who went to Mixt in search of a vegan meal that was high in protein and low in sugar. The salad he came up with paired lentils, chickpeas and quinoa with greens and a cilantro jalapeño vinaigrette.Over the next several years, as Yelp grew and went public, Mixt thrived alongside it, adding a dozen locations through downtown and other city neighborhoods. Mr. Ghaffary became something of a Mixt evangelist (“He was very proud of the beany salad he came up with,” Mr. Stoppelman said) and ordered his vegetal concoction so frequently that the salad was added to the permanent menu and still sits on the board under the name “Be Well.”In the city, however, well-being was taking a hit.The tech companies that San Francisco had tried so hard to attract were now the target of regular protests, including some by demonstrators who at the end of 2013 began blocking commuter buses from Google and other companies to show their rage at rents that now sit at a median of $3,600. This was an opening gesture in what would become an ongoing debate about gentrification and the effect of tech companies on the city — a debate that played out in arguments over homeless camps, votes to stop development and countless more protests.All of this was rooted in the cost of housing, which had been expensive for decades but had morphed into a disaster. A local government that had all but begged tech companies to set up shop there was now pushing a raft of new taxes to deal with its spiraling affordable housing and homelessness problems. In 2017, the year the Salesforce Tower eclipsed the Transamerica Pyramid as the city’s tallest skyscraper, Mr. Florida published another book. It was called “The New Urban Crisis.”Ramps to the Salesforce Transit center in San Francisco. The vacancy rate for downtown offices has risen to 24 percent from 5 percent since 2019.An axiom of the post-Covid economy is that the pandemic didn’t create new trends so much as it accelerated trends already in place. Such is the case with Yelp, which long ago started moving employees in response to San Francisco’s rising cost of living, opening sales offices around the country and new engineering hubs in London and Toronto.Still, it was hard to see how that might pose any kind of threat to the city, whose greatest challenge seemed to be dealing with the too many jobs it already had.Expansions aside, Yelp was still ensconced in its headquarters at 140 New Montgomery, and by early 2020, it had every intention of signing a new lease. The company’s ties to San Francisco, the hold of the creative class and all that, were too strong to imagine anything in its place.Headquartered in the Cloud“Have you heard about Covid?”Ms. Cerros-Mercado remembers asking a regional manager at Specialty’s that question sometime in February or early March of 2020. The virus had been in the news for weeks, but it didn’t seem like more than a seasonal bug until her 19-year-old daughter’s school trip to Spain was canceled. The manager she asked wasn’t so sure.“He’s like, ‘Oh, it’s just a flulike virus; it will go away,” she said. “And I’m looking at him and telling him, ‘No, this is actually really serious.’”Ms. Cerros-Mercado described the following weeks as a blur of plunging sales and eerie moments like standing in a coffee shop with no customers or hearing from a janitor that the offices above them were clearing out. By May, Specialty’s had filed for Chapter 7 bankruptcy after a conference call in which she and other managers were thanked for their service and told they would be employed for three more days, during which they would deliver the news they had just received to the people who worked for them.“One of the hardest conversations was having to talk to my team,” she said. “I had some team members that were crying because they weren’t sure where their income was going to come from.”In that moment, the question was when life would return to how it was. But as Mr. Stoppelman discovered that he could run a publicly traded company from his home with no loss of business, he decided that for his company, anyway, the new normal was better. Yelp abandoned its headquarters when the lease at 140 New Montgomery lapsed, joining a growing list of tech companies that had replaced free cafeterias and Ping-Pong breakrooms — which for more than a decade had been rationalized by a belief that a social company was a more innovative company — with slogans like “headquartered in the cloud.”Yelp ended up adding back about 50,000 feet for employees who want an occasional desk, but for the city that figure is even smaller than it seems. The new offices are one-third of its former footprint; Yelp subleased the space from Salesforce — the city’s largest private employer, which is also cutting back on local offices.The emptying of American downtowns after Covid was followed by a boom in exurban housing and in cities like Austin and Spokane, trends reflected in where Yelp’s work force has landed. Cortney Ward, 41, a Yelp product designer, bought a home in Austin after leaving her one-bedroom apartment in San Francisco’s Nob Hill. Yelp workers also invented new habits and left holes in the businesses that relied on them. When Diego Waxemberg, 30, a software engineer, left the Bay Area for Charlotte, N.C., he started lunching on leftovers instead of sometimes buying a $17 Mixt salad with tri-tip steak. Mackenzie Bise, 30, who works in user operations, moved to the Sacramento area, and during a recent online search discovered that her favorite San Francisco lunch spot had gone out of business.Maria Cerros-Mercado preparing the Mixt salad shop in Mill Valley to open for the day.During the height of the pandemic, Ms. Cerros-Mercado went through a spell of unemployment before landing at another restaurant chain and later at Mixt. But downtown business was still somewhere between lagging and nonexistent. Mixt laid off hundreds of workers, closed most downtown stores for more than a year and subsisted on business from neighborhood and suburban stores.“If we didn’t have the neighborhood restaurants, we wouldn’t have survived — point blank,” Ms. Silverglide said.But for all the daily rhythms that were upended by home offices, the desire for a specially prepared lunch seems to have endured. Consider Mr. Ghaffary, creator of the Be Well salad, who used the pandemic as a challenge to recreate Mixt’s setup in the kitchen of his Marin County home. He started with fresh ingredients but got tired of his frequent trips to the grocery store and shifted to preparing them in bulk.“I’d make like four or five days of Tupperware,” he said. “First I tried making the whole salad, and then it would get soggy. Then I made half the salad and would finish the rest at the end.”“I was very proud of my streamlined production methods,” he continued. “And then I was kind of like, ‘I don’t want to be making these salads.’”Mr. Ghaffary told this story over salad at Mixt’s Mill Valley store, the one Ms. Cerros-Mercado manages, which opened in July and had lines of customers in athleisure. Operations are slightly more difficult because some employees commute an hour or more to get there, most relying on buses and one sometimes trying to catch a ride in Ms. Cerros-Mercado’s Uber. When a worker misses the bus, Ms. Cerros-Mercado spends her morning trying to cover for holes in the setup line.But the business was steady, and according to Ms. Silverglide it extends until 9 at night, catering to families and a growing salad-for-dinner segment that pairs plates of greens with the various wines and craft beers recently added to the menu. She is fairly confident that Mixt’s “neighborhood locations,” like the Mill Valley one, will drive the business’s expansion. Business in downtown San Francisco has been picking up — but it’s unclear how long that will last, or how close to prepandemic traffic it will ever reach. The offices, after all, haven’t even hit 50 percent.Better TogetherThe building at 140 New Montgomery Street is empty but still an Art Deco landmark.A wood reception desk that used to greet Yelp’s visitors sits empty in its former office. The mounted iPad where visitors once checked in is gone, along with the bright jars of candy and the rows of desks that sat beyond them. But there are still views.“You can see that you get good natural light all around,” said Stacey Spurr, a regional director for Pembroke, which owns 140 New Montgomery, during a recent tour of the quiet and empty but still quite gorgeous building.Ms. Spurr began the tour by pointing out the gold ceilings in the lobby before proceeding to the basement, where there are showers and bike racks. The empty floors upstairs are layered with boastful stickers like the one about the building’s A-plus air filtration system.The nearly 160,000 square feet that Yelp left empty is about half of the building’s space, and about half of that has been re-leased. The good news for Pembroke seems less good for the city. Some of the new tenants are finance and venture capital firms that have clung to the gravitas of a physical office for client meetings and the occasional conference but are unlikely to contribute regular foot traffic, according to building owners across the city.In a typical downturn, the turnaround is a fairly simple equation of rents falling far enough to attract new tenants and the economy improving fast enough to stimulate new demand. But now there’s a more existential question of what the point of a city’s downtown even is.Downtown San Francisco is trying to adapt to what amounts to a three-day workweek. On Wednesdays, offices are at 50 percent of their prepandemic levels; on Fridays, they’re not even at 30 percent.The city, and business groups like Advance SF, are trying to reframe the urban core as a more residential and entertainment district that draws from throughout the region and may in the future involve the conversion of office buildings to residential use. The motto is “Better Together,” and Advance SF recently hosted a forum with a guest economist to discuss new ideas for downtown. The guest was Richard Florida.“When I started with the creative class, places didn’t care about young people, they were only trying to attract a family with children to the lovely suburbs, and I’m saying, ‘No, no, no, no, no,’” Mr. Florida said in an interview. “Twenty years later, people forgot about the families. And now here’s a whole generation leaving cities again, for metropolitan or virtual suburbs.”The more businesses invest with that new reality in mind, the more likely that reality becomes self-fulfilling.A year after being consumed by bankruptcy, Specialty’s, the cafe chain where Ms. Cerros-Mercado began her career, was reincarnated. The first new store sits in the Silicon Valley town of Mountain View, and as the company plots its next expansion it is eschewing the office-adjacent locations on which the original company was built for a more delivery-centric business that has a world of half-empty buildings in mind.Back at 140 New Montgomery, the owners are experimenting with new ideas to get office workers to come in. The building has been hosting gatherings like an Oktoberfest celebration that included a raffle to win a beer stein with the building’s logo.On the afternoon of the Oktoberfest party, a cluster of workers from a software company stood around eating sausages and soft pretzels.“We hear a lot of buzz about this building,” said Veronica Arvizu, a senior property manager at the real estate company CBRE. “We hear it’s the busiest in the city.”A few feet away from her, another group of young workers was playing Jenga. One by one, they took blocks away from the structure, making way for the inevitable collapse. More