Google's HQ is in Mountain View. Why did you have to live or buy a house in SF?
Also, YouTube's head office is closer to the SF airport.
Which is also not in SF.
Of course, even if the office was in SF that wouldn't be justified. It's hardly unusual for people to commute into SF from places with lower living costs.
If the bubble continues I would expect that both places will get priced out in the next 2-3 years. At that point you'll have to look at the Tri-Valley area (Dublin, Pleasanton, Livermore) for the affordable price points.
tl;dr: 1300 sq. ft. new 2 bedroom townhome for 1.3 million.