It would seem to be a difficult time to challenge a resurgent House Speaker Nancy Pelosi, but San Francisco attorney Shahid Buttar is hoping to catch the same lightning that vaulted Rep. Alexandria Ocasio-Cortez over a top Democrat last year in New York.

Buttar, a 44-year-old attorney with the Electronic Frontier Foundation, has launched his second campaign as a Democrat to dislodge Pelosi from the House seat she has held since 1987. He argues that Pelosi isn’t progressive enough to represent San Francisco — something that many Republican voters might find hard to imagine after being fed a steady diet of TV commercials featuring Pelosi as the embodiment of “San Francisco values.”

Pelosi has said that even though she represents a liberal city, “you have to govern mainstream.” That’s not the philosophy voiced by Buttar, the son of Pakistani immigrants who described himself to The Chronicle’s “It’s All Political” podcast this way: “If you were able to remix Bernie Sanders, the ACLU and the movement for Black Lives, I’d be what you’d get.”

Buttar said his first goal is to convince voters that Pelosi’s resistance to the Trump administration is “theatrical” and that the speaker is “actively emboldening the Trump administration.”

Count the ways, Buttar says:

• Pelosi won’t fight for a system under which government would pay for health care for all and do away with private insurers. She says she has long preferred such a system, known as single-payer or Medicare for All, but would prefer to strengthen the Affordable Care Act that she pushed through the House in 2010.

“Medicare is not as good a health benefit as the Affordable Care Act,” Pelosi told the Washington Post. “So, if you are to do Medicare for All, you have to improve the package — and when you improve the package, you have to have more money.”

Buttar said Pelosi could use her self-described power as a “master legislator” to do more to support Rep. Pramila Jayapal’s Medicare for All bill. Jayapal, D-Wash., has not revealed how the plan would be funded.

“There is a bill that Nancy Pelosi could whip votes for,” Buttar said. “Until she deploys her vaunted tactical skill and acumen to get that bill passed, it seems to me that’s just a bunch of empty words.”

• Pelosi hasn’t pushed hard for the Green New Deal, the nonbinding proposal backed by Ocasio-Cortez and Sen. Ed Markey, D-Mass., that calls for the U.S. to run on 100 percent renewable energy within 10 years. Pelosi has described it as “a list of aspirations” and has no plans to bring it to the floor for a vote.

• And Pelosi isn’t on board with impeaching President Trump, saying he’s “just not worth it.”

Pelosi campaign spokesman Jorge Aguilar declined to comment for this story.

Buttar knows his candidacy is a long shot, and not just because he finished 60 points behind Pelosi in the primary when he ran against her last year. Pelosi’s approval ratings ticked up after Democrats took the House and she outmaneuvered Trump on the partial government shutdown over the president’s border-wall-funding proposal. She remains the Democratic Party’s champion fundraiser and would have a bottomless money well if she ever faced a tough challenge.

It seemed that Pelosi’s renaissance was complete when she snagged a spot on a Rolling Stone magazine cover last month headlined, “Women Shaping the Future” — with Ocasio-Cortez.

But it’s Ocasio-Cortez’s stunning upset last year of 10-term New York Rep. Joe Crowley — the No. 4-ranked House Democrat — that gives Buttar “glimmers of hope” that a demographic “earthquake” is about to take out the 79-year-old Pelosi’s generation of political leaders.

“The magnitude of the earthquake isn’t clear, and it has barely gotten started. But clearly what we are witnessing ultimately is generational change,” Buttar said.

“The way I’m going to win this seat is simply by surfing demographic shifts as the Boomers are no longer the majority of the election system and the Millennials, who got shafted (during the recession), are going to put us in office.”

Many of the several dozen people who jammed into the Smoking Nun, a South of Market gallery, for Buttar’s launch last week were poets, artists and activists of that generation who have worked with him over the years. Claire Lau, a San Francisco activist, praised Buttar for advocating a cross section of issues, from immigration rights to tech privacy concerns to LGBTQ causes.

“He really exemplifies what’s really important on the left but isn’t always there — and that’s solidarity across communities,” Lau said.

“With Shahid, I know the personal is political,” said Val Ibarra, a teacher and host on Mutiny Radio, a San Francisco online radio station. “He is challenging the corporate-captured two-party system that fails to meet the basic needs of everyday Americans.”

Despite the long odds, Buttar already has one advantage over Pelosi: He’s an accomplished political rapper. He closed his launch speech with this rap about Medicare for All:

“If you need to see a doctor / It should be free / Health care is a right / Not a commodity.”

Joe Garofoli is The San Francisco Chronicle’s senior political writer. Email: jgarofoli@sfchronicle.com Twitter: @joegarofoli