Imagine you’re one of the NFL’s brightest young offensive minds, but you’re a rookie head coach with an 0-8 record and no quality quarterback.

It’s the midway point of the 2017 season, so at least you’re neck-and-neck with Cleveland in the upcoming Baker Mayfield-Sam Darnold-Josh Rosen-Josh Allen-Lamar Jackson crapshoot atop the 2018 NFL draft.

Or …

You get lucky with one heck of a treat on Halloween. Your general manager picks up the phone at the trade deadline and it’s Bill Belichick offering Jimmy Garoppolo to you for a second-round pick.

The perfect Patriots storm has just blown in your favor. Garoppolo’s rookie contract was ending, Tom Brady was refusing to age and owner Bob Kraft wasn’t about to give cutthroat Bill a chance to head into the offseason with a choice between 41-year-old Tommy and 26-year-old groomed-and-ready-to-go Jimmy.

“It was out of nowhere, so it was surprising,” said Kyle Shanahan, whose 49ers open the 2018 season against the Vikings at noon Sunday at U.S. Bank Stadium. “It was surprising to all of us. But it took us about 10 minutes to figure it out.”

While every other quarterback-starved team had to wait until after the season to be fed, the 49ers got an 11-month head start on this season. Things went well, to say the least. Garoppolo turned a five-week starting audition into a 5-0 surge and the richest contract in NFL history.

With seven career starts, he signed a five-year contract on Feb. 8 for an average of $27.5 million per season. That record has been passed three times, by the Vikings’ Kirk Cousins ($28 million) on March 15, Atlanta’s Matt Ryan ($30 million) on May 4 and Green Bay’s Aaron Rodgers ($33.5 million) on Aug. 29.

But no one in San Francisco is complaining because everyone knows the fit is right.

“That would have been very tough to find out if we didn’t get Jimmy in for those five games,” Shanahan said. “We found out we had a pretty good one, and we were going to do everything we could to make sure we didn’t lose him.”

In those five games, Garoppolo posted two come-from-behind wins. He helped beat Jacksonville and Tennessee, two playoff teams not resting starters. With less than a month to learn Shanahan’s complex offense, Garoppolo showed poise, accuracy and a quick release while completing 67.4 percent of his passes and posting a 96.2 passer rating.

“You can bring up some Tom Brady film and watch Garoppolo, and they get the ball out of their hand quick,” Vikings defensive end Everson Griffen said. “They are reading, reacting. They are looking at the formations. They are seeing the motions of the safety. They are seeing the linebacker shifts. They know when the blitz is coming.”

Griffen isn’t the only person who has dared to draw the Brady comparison to a guy who has as many wins in San Francisco as Brady has Super Bowl titles in New England.

Shanahan dismissed the importance of comparisons.

“I’ve compared guys who have never even made NFL teams to some Hall of Famers because there’s always similarities to how people throw,” he said.

“And I think people are going to compare him to Tom because he came from there. It’s a small sample size, but he hasn’t lost a game yet. We know that’s not going to last.”

How Garoppolo reacts to adversity this season will be the key to whether the 49ers can join the loaded slugfest in the NFC. Instead of mopping up at the end of a lost season — and beating a Rams team resting its starters — Garoppolo and the 49ers open with four road games in six weeks.

That’s daunting for any team, let alone one in the early stages of transition under second-year GM John Lynch. But, either way, many believe the cornerstone is in place for another 49ers rise to relevance.

“Jimmy Garoppolo,” said Louis Riddick, ESPN analyst and former NFL player and personnel executive, “will be one of the best trades the San Francisco 49ers have ever made as an organization in their history.”


Mark Craig is an NFL and Vikings Insider. Twitter: @markcraigNFL E-mail: