Oh, the hills of San Francisco! Trolley bells ring out as passengers hang from oak-panelled cable cars ascending to canted heights, the slopes flecked by colourful hues of Victorian clapboards, while the distant ochre suspension towers of the Golden Gate Bridge, shrouded in fog, rise above the city's rooftops. Alas, it's not quite like that today, as I'm not in some vintage postcard, but rather straining to push the gears of a borrowed bicycle back up 17th Street to my friends' apartment atop Cole Valley, the base for my Bay Area sojourn. It's rough going. The route home is a 1km uphill climb - not just any hill, mind you, but one of those San Francisco slopes that makes the roofs resemble a polychrome staircase stretching clear across the peninsula. In this perennially rejuvenating city, I'm returning from a foot-powered excursion to explore one of San Francisco's lesser-known neighbourhoods, the curiously named historical district of Dogpatch. Despite being pegged as an emerging arts hub, the former industrial area on the eastern waterfront retains some salubrious undertones. I'd scoped out the local headquarters of the Hells Angels, for instance, the hog riders that are either, depending on whom you ask, a club of motorcycle enthusiasts or an organised crime syndicate. It was a brown clapboard house with the shades all down, and parked out front was another symbol of 1970s American true grit: an El Camino. The hubcaps gleamed on the bastard offspring of a muscle car and a pick-up. From its intersection with Market Street, I look up the 17th Street corridor with dread. I've made a mistake only an out-of-towner would make, planning my route using a two-dimensional map. In San Francisco, if you're planning a bicycle ride, you have to take into account the gradient of the roads, for the shortest distance between two points is rarely a straight line. It hardly helps that I'm woefully out of shape. I'm trying to catch a glimpse of the hidden side of San Francisco, the elusive element that has long made it one of America's most enticing destinations. Bear in mind that despite its fame, it hasa population of only 800,000, not counting the outlying Bay Area, and is roughly the size of, say, Jacksonville, Florida, and Indianapolis, Indiana. Nothing against those two places, but San Francisco has set itself apart, and not only because it gave birth to the hippie movement. Its peculiar essence pre-dates the 20th century. A lingering air of intrigue hovers over the port city, an odour still detectable beneath its well-groomed veneer of organic food co-ops, sushi restaurants, taquerias and cocktail bars. Born during the California Gold Rush of the 1850s, San Francisco has always had an edge - such an edge, in fact, that it's often thought it could slide into the sea at any moment. There's a line in Alfred Hitchcock's Vertigo - a film in which San Francisco is almost a character unto itself, hiding a dreadful secret from its past - that's always stuck in my head. Against postcard backdrops, the protagonist, the detective Scottie (played by James Stewart), follows a bizarre sequence of events in broad daylight: his quarry, a woman named Madeleine - at least we think she's named Madeleine - spends her days staring at a mysterious painting at the California Palace of the Legion of Honour, the museum in Lincoln Park at the peninsula's north-west tip; she then tries to commit suicide by jumping into the bay at Fort Point near the Golden Gate Bridge. And, of course, there's a haunted Victorian mansion involved. Trying to get to the bottom of things, Scottie asks Midge, his friend and confidante, if she knows an authority on local history. "Not the book stuff," he adds. "I mean the small stuff, people you never heard of." Midge suggests he's looking for "juicy stories, like who shot who in the Embarcadero in August 1879". Yes, that's it, says Scottie. When Midge asks him what exactly he's after, he can only deadpan: "I want to know who shot who in the Embarcadero in August 1879." Perhaps hoping for a whiff of gun smoke - like Scottie, I'm not really sure what I'm looking for - I make my way down Market Street, San Francisco's main downtown thoroughfare, one brisk San Francisco evening to see what remains of the old Embarcadero. Ostensibly, I'm going to shop for a home-cooked dinner I'd promised my hosts. The focal point of waterfront life until the 1950s, the storied Embarcadero was a lively port district that fell into a state of neglect during the latter half of the last century, when an elevated coastal highway cut it off from the rest of the city. The Embarcadero Freeway even obscured the view of the Ferry Building at the end of Market Street, with its landmark clock tower modelled on what was once a Moorish minaret, the Giralda bell tower of the Seville Cathedral in Spain. Nature didn't take kindly to the eyesore, and the 1989 Loma Prieta earthquake caused extensive damage to the elevated highway. The city elders deemed it wise to tear the whole thing down, and access to the waterfront was thankfully restored. Today, the port district teems once again, though there aren't many gunslingers about. In lieu of the old skyway, a ground-level corniche lined with pedestrian zebra stripes connects the Ferry Building to Market Street. Between the lanes, a pedestrian plaza is dotted with stalls selling woollen hats, turquoise jewellery and the usual array of trinkets found anywhere tourists roam. The kiddies' T-shirts with peace signs add a suitably hippie-cum-yuppie touch. The once neglected Ferry Building, meanwhile, received more than just a facelift, reopening in 2003 as a foodie's paradise - an enclosed market with vaulted iron rafters selling everything from gourmet teas to Tuscan olive oils to chantarelles. In other words, quintessentially San Francisco. I manage to find most, though not all, of the ingredients for a proper Indian curry. If anybody shot anybody here in 1879, there's no trace of it today. The cosmopolitan bustle of the new Embarcadero reveals what San Franciscans are best at: constant rebuilding and renewal. They have enough practice. Photographs of the aftermath of the 1906 earthquake, which ruptured gas lines and caused fires that were impossible to fight because of broken water mains, resemble Dresden in 1945. The city, for all intents and purposes, was completely destroyed, with only a few outlying districts - Dogpatch among them - remaining untouched. Yet it was quickly rebuilt, starting off a century in which San Francisco would play host to some of America's most iconic cultural moments: the Beat poets, the flower children of the Haight-Ashbury district, and the gay pride movement. Still, that fictional question remains - just who shot who? - hinting at something buried and unanswerable, perhaps lost in the fire. The hanging question is an essential part of San Francisco. You can't always see them under the latest coat of paint, but you can often sense the layers of the past - early Spanish settlers, architectural traces of Al Andalus, Gold Rush pioneers, the Beats and the Grateful Dead - all stacked on top of one another to dizzying heights. Whether one explores richer neighbourhoods such as Pacific Heights, low-lying hipster hangouts like the Mission, or relatively undiscovered turf like Dogpatch, one is likely, at some point, to be captivated by the mix of rough and genteel. Yet even on the most rapturous California evening, the source of the mystique is only as clear as the fog rolling in from the Pacific Ocean. I later discover I didn't have to ride up 17th Street after all. Fittingly for the original dotcommers' city, there's a website that calculates the easiest bicycle route from one point to another anywhere in San Francisco. In fact, the most bike-friendly path from Dogpatch to Cole Valley is about a 10km ride through some of the best parts of the city: head north to 7th Street, cut a diagonal across Mission and Market (with a detour up to the Embarcadero, if you like), then bear left near the Asian Arts Museum towards the Haight-Ashbury district. Wind your way through Panhandle Park, turn left up Clayton, and you're there. If only Hitchcock's troubled detective, who went mad chasing ghosts through these hills, had had it so easy.