SF is a unique and amazing town. Keep in mind one thing that's little-understood outside of California: San Francisco is not the same thing as the Bay Area. And when you say "San Francisco" you probably really mean the Bay Area. "The valley", proper, is around San Jose and the lower peninsula, for instance.
You should explore SF first, though. It's more condensed, and easier to understand on a short trip.