Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

SAN FRANCISCO — Nick Nguyen noticed that, for once, the traffic didn’t seem so bad in Southern California. Then he got closer to the entrance of his local Costco store in San Diego.

“It was over a mile long,” said Nguyen, 25, who shared a video of the grocery line on Reddit. “It was insane.”

Though it was Friday and the weekend was approaching, not many other cars were on the road.

“It’s a ghost town everywhere except grocery stores right now,” he said. “It doesn’t feel like Friday at all.”

Californians, uncertain but generally calm, were hurrying to prepare for a month-long period of near-isolation after Gov. Gavin Newsom declared a statewide stay-at-home order was needed to slow the spread of the coronavirus and save lives.

Full coverage of the coronavirus outbreak

Under the order, people are generally required to stay home and not leave unless they need to go out for an essential reason, such as getting food, caring for a relative or friend or working a job deemed essential.

The nation’s largest state, with 40 million people, is serving as a laboratory for how Americans may be asked to live in the months ahead. Illinois quickly followed with its own stay-at-home order, while New York has steadily tightened restrictions on businesses and other activity.

San Francisco and surrounding counties had already begun limiting non-essential activities earlier in the week, but Newsom’s order announced late Thursday expanded the strategy to the rest of California — with a cascading effect even on Yosemite National Park, which closed.

A dire situation in hospitals around the state illustrated the thinking behind the restrictions. ICU beds at Los Angeles emergency rooms were at or near capacity, even after doubling the number available for COVID-19 patients, the Los Angeles Times reported.

But up and down the state, authorities made clear they wanted Californians to comply voluntarily, and although a violation may technically be a misdemeanor, they had no desire to turn a bastion of liberal politics into a police state.

The California Highway Patrol said it had not received orders from the governor to enforce the new restrictions, although the agency is encouraging people to follow them.

“We’re obviously not stopping people for just being on the freeways,” said Officer Amber Wright, a spokeswoman for the patrol. “Things change day by day or hour by hour, but until we get any direction, we’re standing by.”

Police in San Francisco, where restrictions began Tuesday, said they had not issued any citations related to the public health order and were focused on education.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

It wasn’t necessarily a given that Californians would comply so readily with a sweeping public health order. During the emergence of the AIDS epidemic in the 1980s, some gay activists opposed for years a move by San Francisco health officials to close bathhouses.

The new restrictions are unlike anything most Californians can remember happening in their lifetimes.

“A few weeks ago, a lot of people thought it just wouldn’t work in the U.S. to take the strong steps that seemed to work elsewhere to slow down the virus. The people won’t stand for it, the argument ran,” said Orin Kerr, a law professor and expert on police authority at the University of California, Berkeley.

“But we’ve seen an enormous shift in views. The public recognizes the threat, and most are voluntarily complying with extremely strict limits,” he added.

Kerr said that although a California police officer could stop people based on a reasonable suspicion they were violating the rules, he said he expected the power would be used mostly to intervene when there are clear violations, like people throwing a party.

The American Civil Liberties Union of Northern California called Newsom’s order “an enormous and almost unprecedented curtailment of our individual civil liberties” but noted that it had wide support among public health experts. The organization said it was monitoring the effects of court closures and watching for possible discrimination.

“While implementation will likely be spotty at first, we are paying close attention to see if some patterns emerge in a week or so,” it said in a statement. “At that time, we will assess the appropriate way to intervene.”

Lindsay Ward, 34, of San Diego, said she began her first day under California’s new rules with her usual routine, but instead of going for a run, she donated blood. (The American Red Cross said there’s a dire blood shortage.)

“There’s this fog in the air of just stress,” she said. “You can feel it in every conversation you have, in every interaction you have. People are just really stressed and panicked.”

She said it’s been hard to communicate what’s happening to the people she sees at her workplace, a residential substance-abuse treatment program where she’s a mental health counselor.

“I spent my entire day yesterday just talking about what was going on in the outside world,” Ward said. People are supposed to get jobs after they leave treatment, she said, but “they don’t understand that they can’t go and get jobs. They’re like, ‘I can go work in a restaurant' and I’m like, ‘There are no restaurants open right now’ and just explaining everybody is at home.”

Though Yosemite closed Friday afternoon, some other federal lands were open and state parks were even staffed in some cases, visitors said.

In Southern California’s Angeles National Forest, about 30 minutes from downtown Los Angeles, the vibe was chill and people did not seem to gather in big groups. Mountain bikers, hikers and outdoor enthusiasts flocked to trails and picnic areas still open to the public, while others ate lunch outside or climbed to see dramatic vistas of the city some 3,000 feet below.

A new kind of sign popped up in San Francisco parks: “Stay 6 feet apart,” written in four languages for the city’s diverse population. They were installed by public works employees who “usually work on our asphalt crew repaving,” the city said on Twitter.

Download the NBC News app for full coverage of the coronavirus outbreak

People braced themselves for an evolving definition of what’s “essential” under the new way of living. Earlier this week, San Francisco at first closed marijuana dispensaries before later reopening them, saying that cannabis products were essential medicine.

Bars may sell beer, wine and spirits in to-go containers, even as drinking in bars is banned, according to a notice of “regulatory relief” posted by California’s Department of Alcoholic Beverage Control.

“My guess is a lot of this is just telling people to be reasonable and do the right thing, and most people will,” said Mark Lemley, a Stanford University law professor.

Newsom’s order could be interpreted as very strict, Lemley said, as the wording did not provide an explicit exception for outdoor exercise, as some local health orders had done. Newsom, though, has given more leeway in his public comments, saying, “You can still walk your dog.”

Luxury sports cars, though, may not make the cut. A club for Lamborghini owners decided to scrap its plan for a Saturday morning drive in Northern California wine country.

“With today’s statewide announcement regarding the shelter in place mandates, we have heard that the CHP would hassle us if we proceed,” the organizers wrote Friday on the club’s Facebook event page, referring to the California Highway Patrol. They said they would aim for a date in April, instead, to “start the driving season.”

Of course, this is California and surf cams showed surfers were still making it out to the waves in places like Manhattan Beach.