Mayer will draw her own Yahoo road map

Shock. Awe. Wow. Huh? All valid reactions to the last-minute plot twist in Yahoo’s search for its third CEO in the past 10 months: the hiring of Google star Marissa Mayer as president and CEO effective immediately.

Some people aren’t thrilled, particularly those who see Yahoo as a media-tech company and/or are supporters of interim CEO Ross Levinsohn. But the overwhelming first response is a mix of surprise that a Yahoo board could make such a bold choice and that Mayer could be wooed way from her longtime home at Google for something as uncool as a portal.

While attention was being directed through a series of leaks around other candidates, including Hulu CEO Jason Kilar — and the discussion was being framed rightly as a choice between product and media — Yahoo was already deep in talks with Mayer. In the end, it was kept so far under wraps that I don’t think even Levinsohn knew she was his chief competition until shortly before the news broke.

The other day I suggested that about the only hire Yahoo(s yhoo) could make at this point instead of Levinsohn for CEO and get away with it would be Facebook(s fb) COO Sheryl Sandberg. I forgot to look under the Gs, as in Google, where Mayer, employee #20 and the company’s first woman engineer, was a veteran exec with rock-star status and a fair amount of power but no visible path up. When Larry Page put his imprint on Google as CEO, Mayer wound up a layer down as the head of local, maps and location services, although she was on the operating committee.

Sandberg, too, left Google, where she was VP of global online sales and operations, applying her operating skills to help Facebook grow up and carving out a role as a corporate leader. Already a Disney board member, she was just elected to the Facebook board. As CEO, Mayer will be on the Yahoo board from the beginning.

I also underestimated how very much this board wanted to make its own statement about Yahoo and its future. Promoting someone hired by former CEO Carol Bartz wouldn’t cut it — although that probably could have been overcome if the board was convinced that Yahoo was a media tech company and not a product company.

But the board went for product with a capital P. What about media? In this view of Yahoo, it’s important but not the heart of the company. “Most of the company is search and mail and the home page,” one person familiar with the board’s thinking told me. Mayer, the person said, “built” mail, search and maps at Google. (Her work in mobile products wasn’t mentioned but it should be a big plus.) More important, she “created” engineers who are now throughout the Valley.

The thinking: having the best technology equals win — and it’s a lot harder to bring in people on the product side than it is to hire for media. It’s particularly difficult when a company has gained a rep for wrecking products or failing to deliver on ideas or overcrowding to the point that nothing comes through the clutter. Yahoo hopes hiring Mayer will start the engineer hiring equivalent of “follow the leader” — which, in turn, would help Yahoo.

“It’s going to be a totally new day,” the source mentioned above told me. And a new road map, as I suspected after the annual meeting. The board let Levinsohn go out and pitch his version of the company, a vision where content and technology were equally important but in different ways. “We have really put our energy against being this tech-powered media company;” he told dissatisfied shareholders. “If you want to be in the tech and media business you need to be in both very aggressively.” That includes products like Yahoo Genome, the big data tool for advertisers that rolled out earlier this month.

In the end, it wasn’t about CEO experience, which some suggested might keep Levinsohn from getting the job. Mayer has managed large areas at Google but she hasn’t been a CEO and Google is the only company where she’s worked. (Mayer is a new member of the Wal-Mart board.) Levinsohn got credit for his performance as interim CEO and I don’t get the sense there were qualms about him personally in that role.

It came down to a sense that Yahoo needed a product person. Mayer has deep product management experience and longevity at a Yahoo competitor. She has a high profile but also an intense work ethic and knows how to deliver. That’s mighty tempting for a company that often has failed to execute.

But it also means a new learning curve. Unlike Levinsohn, who started a Yahoo immersion course when he joined in late 2010, Mayer faces the same kind of corporate learning curve as Scott Thompson, who succeeded Carol Bartz as CEO after a four-month search. Thompson spent a couple of months learning the company, than started major layoffs and a reorganization. His ouster for claiming a computer science degree he didn’t have set off the two-month search for Mayer.

As for Levinsohn himself, I’m told they would like him to stay. Whether that can work is a little hard to see. What it bodes for media is unclear — or for Michael Barrett, the just-hired chief revenue officer or any of the other people who were hired or took on new roles while Levinsohn was in charge.

What is clear is a company that has been through the wringer, and then some, is facing more change. And it will take place in an even more glaring spotlight as the Mayer era at Yahoo begins.

Sidenote: I’ve seen some people react with surprise to Yahoo hiring a woman for CEO. Hello? It’s not like this is Google, Facebook, Microsoft or Apple. Yahoo’s already had a woman CEO and before that Sue Decker was president. But it does put her on two very short lists of women CEOs: tech and public. She’s also under 40, 37 to be precise.

Update: Add one more list: expectant CEOS. Mayer and her husband Zachary Bogue are expecting a boy on Oct. 7, Fortune reported late Monday. She didn’t mention it when she was first contacted June 18 by the search firm but told Michael Wolf, a member of the search committee, about the pregnancy when they met in person in late June. She met with the entire board last Wednesday and, Mayer told Fortune, none showed any concern about hiring a pregnant CEO. Mayer went public with the personal news through the exclusive to Fortune and by tweeting a link to it. (Someone suggested my initial description of this sounded like Mayer had done something wrong by not mentioning her pregnancy to the search firm. Not at all. I thought the way she approached it was more of a sign of her interest in the job as matters progressed.)

Mayer was offered the job by phone the day of the annual meeting. She told Fortune‘s Patricia Sellers that she wasn’t commenting on her discussions with Levinsohn, who she calls a “phenomenal executive.”