In the past few years, accounts of San Francisco’s unravelling—less like a tired sweater than a ball of yarn caught in a boat propeller—have spread with the authority of gossip or folklore. As the pandemic recedes, nearly a quarter of offices downtown are said to be vacant, the worst rate in the nation. Drug-overdose deaths are surging; reports of theft on downtown streets, including an almost two-hundred-per-cent increase in car break-ins in 2021, have crossed the national media to censorious response. “They took down the guardrails around personal responsibility,” the Wall Street Journal columnist Daniel Henninger declared on Fox News. In May, a local pet owner claimed that her Himalayan sheepdog began “wobbling” after eating feces possibly containing opioids and marijuana. Throughout the summer, Presidential hopefuls came to town to stand on grim street corners and record their horror for the cameras. (“It’s really collapsed because of leftist policies,” Ron DeSantis repined in his spot. Robert F. Kennedy, Jr., lamented the many Americans who “are on the precipice of ending up on a corner like this.”) Nine years ago, when HBO premièred the series “Silicon Valley,” a deadpan comedy lampooning the Bay Area’s life-style blandishments and hapless global power, the city seemed to exist in a helium balloon, floating ever upward. Now the same place is viewed as an emblem of American collapse.

The change has been unsettling because the city’s broad project is widely shared. Since the end of the industrial period, the main path of the U.S. metropolis has been what’s often called urban renewal: transforming old frameworks into beautiful, dynamic settings for prosperous middle-class life. No city excelled at the assignment more than San Francisco. It invested in lush, landscaped parks, tree-lined boulevards, and world-class museums where there had been none. It grew rich, and seemed to climb out of the Great Recession with both influence and a mandate. “There’s a lot of pent-up envy of San Francisco from a lot of other cities that think of themselves as more important,” one local told me recently. For a long time, that envy inspired mostly emulation. Universities spent millions to reorient themselves around the Bay Area’s style of thinking. Success across industries today is measured by virality, optimization, and unceasing growth. In San Francisco, the nation saw its dreams, and now it thinks it sees its nightmares. The question is what caused so swift a change.

A new story described widespread flight. Downtown San Francisco has seen its highest retail vacancy rate since 2006. In the past few months, Christian Louboutin, Lululemon, Nordstrom, Old Navy, and Williams-Sonoma all began an exodus from the area; so did Office Depot and Whole Foods. In late summer, the owner of Gump’s, an upscale shop that opened in the eighteen-sixties, released a testy open letter, threatening to close in response to “a litany of destructive San Francisco strategies, including allowing the homeless to occupy our sidewalks, to openly distribute and use illegal drugs, to harass the public and to defile the city’s streets.” Urbanists had already begun to circulate a paper by the economist Stijn Van Nieuwerburgh that traced a post-pandemic spiral of collapsing retail and declining safety leading to less public revenue and fewer public services—what he called an “urban doom loop.” The phrase became a shorthand around town, where many took it as Cassandra’s vision of their fate.

One afternoon in June, I went to see Sarah Dennis Phillips, the official charged with rehabilitating San Francisco’s businesses. “I’m confident,” she said. “It’s just a question of how long it takes.” A few weeks earlier, she had been appointed the executive director of San Francisco’s Office of Economic and Workforce Development—effectively, the trauma surgeon for downtown—after a career spent bringing the downtowns of small, quiet, boring Northern California suburbs to life. Of one city, Livermore, she explained, “We had to create a ‘Right to Live Downtown’ ordinance that everyone moving into a residential building would sign, acknowledging they would not get upset that things weren’t quiet at 7 p.m.” Now she faced the inverse problem: a city worried that its downtown was too quiet.

On her first day on the job, it was announced that the lender for the largest mall in the district, operated by the Westfield corporation, would retake possession of the property—a five-story retail center with spiral escalators, opposite the city’s most famous cable-car landing. “We knew Westfield would be a challenge to deal with,” Dennis Phillips told me, in a loud café near City Hall. People all around us were absorbed in their phones and laptops, poring over the day’s work. “We just didn’t know that it was going to happen this fast.”

The city’s downtown has experienced slumps before. In the seventies and eighties, San Francisco, undergoing what was then described as a wave of drug use and crime, saw a series of exits to the suburbs. Skyline disputes—sparked in part by the city’s tallest building, the Transamerica Pyramid, and drawing on fears of “Manhattanization”—produced an over-all square-footage cap, which constrained growth. In a new book, “Portal,” the urban-design critic John King recalls the bitter year of 1983, when the city’s mayor, Dianne Feinstein, faced a ballot recall instigated by a far-left group called the White Panther Party. (Feinstein sought to ban handguns; the White Panthers believed that poor residents needed them for self-protection.) Remarking on the city’s air of terminal insecurity in those years, King describes “a pessimism that was more than a match for detailed land-use plans.”

In the wake of a global lockdown, downtown pessimism had a different tone. Before the pandemic, thirty-eight per cent of San Francisco’s office space was occupied by the technology industry. “We no longer manufacture things in San Francisco to speak of,” Rodney Fong, the president of the city’s Chamber of Commerce, told me. “We’re the first to see our downtown as impacted as it is, because when we said ‘Work from home,’ everyone just grabbed a laptop, and boom!” That reliance on tech made downtown especially vulnerable.

Dennis Phillips’s mode is crisp and cheery, and, as we sat in the din of the café, she mentioned that she had been reading “Survival of the City,” by the economists Edward Glaeser and David Cutler, and “The New Urban Crisis,” by Richard Florida, a book about displacement and inequality. More than anything, she was trying to balance San Francisco’s grand narrative of its downtown as a techno-futurist Atlantis against a new story of downtown as a great, fun spot to open a small, quirky retail business. “If downtowns aren’t a place you have to be, then they have to become places you want to be,” Dennis Phillips told me. She had been studying communities that turned their stories around—formerly depressed cities like Nashville and Detroit that had shown an aptitude for “constructing that narrative that makes people want to come.” “It’s a new muscle for San Francisco,” she said. “We’ve never had to do that before.”

San Francisco is the capital of social media, streaming media, app tech, the sharing economy, the gig economy, and other building blocks of modern life. It can measure its influence in dollars: the city, whose early industry harvested outlying gold, silver, and timber as the heart of what the architectural historian Gray Brechin has called the “imperial” West Coast, remains the fifth-largest metropolitan economy in the global Organization for Economic Cooperation and Development.

But the city’s influence can also be measured by its long shadow in Democratic politics. San Francisco, it’s easy to forget, is a small city, approximately seven miles long and wide—the distance from the World Trade Center to the top of Central Park. Its social sphere is startlingly compressed. One day, I stopped in a coffee shop to send an e-mail asking for an interview and, seconds later, heard a guy reading his phone across the room exclaim, “The New Yorker magazine wants to talk to me!” From this tiny ecosystem the political careers of the nation’s Vice-President, the governor of its most populous state, the recent longtime Speaker of the House, and (until last month) the most senior Democratic member of the Senate emerged. The city’s politics can seem preternaturally charged.

“You might have heard of a book called ‘Fifty Shades of Grey,’ ” Joel Engardio, a slender, balding, bearded man in his early fifties and a supervisor for San Francisco’s Sunset District, told a crowd a few weeks ago. He wore a blue blazer, with a Board of Supervisors pin on his lapel. “The story of San Francisco politics could have a similar title: ‘A Million Shades of Blue.’ You see, Democrats in San Francisco like to inflict sadistic pain on each other.”

Engardio, who was elected last year to the Board of Supervisors, an eleven-member legislative body that governs both the city and the county, teaches a monthly public class that he calls S.F. Politics 101. His slide-filled lecture surveys the city’s history—gold, jazz, gay rights—and lands on what he considers the partisan conflict at the heart of San Francisco politics today.

“We have two dominant shades of blue—progressives and moderates,” he said, pointing at a slide. “Now, a San Francisco moderate would be considered liberal anywhere else, and a San Francisco progressive would be considered super far left anywhere else. In San Francisco, they’re both Democrats. But they spar as if they were opposing political parties.”

Engardio identifies as a moderate—he believes that “we need to roll out the red carpet and cut the red tape” for tech and small-business development—but he began teaching the class, he explained, to help voters contextualize their choices. “I see it as a fun and joyful thing on the surface, but underneath it’s addressing some actual issues,” he told me.

One major actual issue at play in town right now is public safety. As downtown emptied out with the lockdown—“not a single fucking person on our streets!” another supervisor told me—certain genres of crime flourished. Smash-and-grab operations, in which car windows are shattered and valuable goods are extracted in seconds, usually alongside a running getaway vehicle, had been the bane of parked cars in San Francisco for several years. During the pandemic, the same practice was used to rob storefronts, spiking property-crime levels to forty-one per cent above the national average. Meanwhile, fentanyl, cheap and lethal, exploded in street sales. According to an eighteen-month investigation by the San Francisco Chronicle, that surge was tied to well-run Honduran cartels, some of which sold meals to dealers out of car trunks so that they didn’t have to leave their posts. (In the spring, Representative Nancy Pelosi, whose district encompasses most of the city, requested special funds from the Justice Department to investigate; no major federal arrests have yet been made.)

“The pandemic and fentanyl collided,” Lydia Bransten, the executive director of the Gubbio Project, which offers coffee, health services, and a safe place to nap to a hundred homeless people a day, told me. Congregate shelters were at severely reduced capacity. “People in the throes of addiction were hanging out with other people in the throes of addiction without the rest of the community. Then the city reopened, and housed people coming out of their homes were confronted with this scene of absolute devastation. And they’re flabbergasted: ‘How could this happen? We’ve spent all this money!’ ” From 2021 to 2022, San Francisco spent seventy-six million dollars on drug-treatment programs; its homelessness budget was nearly seven hundred million dollars. (New York City’s was $1.4 billion, for about ten times the urban population.) From Bransten’s perspective, the lockdown was an experience of absolute damage control, with winnowed ranks of care workers, like her, scrambling to protect a poor and unhoused population from the worst of a deadly pandemic. But after living through their own pandemic challenges, people had what Bransten calls “compassion fatigue.”

“It was a feeling of ‘Look at these people. Clearly nothing’s working,’ ” she told me. “So we’ll police them, arrest them, detain them, and charge them.” The proper role of law enforcement on the street has long been a debate across the moderate-progressive divide, but in recent years—first with the Black Lives Matter movement, then amid pandemic-era concern about crime—the topic has engulfed the city’s politics.