Months before he died in 1987, author James Baldwin showed up, unannounced, at Giovanni's Room, the gay bookstore named after his landmark homosexual love story from the mid-1950s.

"I was flabbergasted," owner Ed Hermance recalls. "He looked around, autographed some books. It was over in 10 minutes."

Ten minutes and 10 years, to be precise. That's how long Hermance and his former business partner, Arleen Olshan, had been after Baldwin to visit Giovanni's, a fixture at 12th and Pine Streets.

"We wrote, we called, we hounded him - just like we did everybody else," Olshan says.

That persistence is what has kept the lights on at Giovanni's in an era when independent bookstores everywhere are going dark. Opened in 1973, Giovanni's marked its 35th anniversary Wednesday with a nostalgic soiree.

Most Philadelphians are unaware that Giovanni's is the second-oldest gay-and-lesbian bookstore in the country, behind only New York's Oscar Wilde Bookshop, launched in 1967.

Through six owners, three locations and countless volunteers, Giovanni's has come to represent far more to the city's gay community than a bibliophilic rainbow flag.

"Growing up in the city, it was one of the first places where I found people like me and a sense of community," says Gloria Casarez, 36, the Mayor's Office liaison to the lesbian, gay, bisexual and transgender communities.

Giovanni's has 12,000 titles in its active inventory. It holds 50 readings a year. It serves as an information clearinghouse, a crisis center, even a research library. "We've graduated many Ph.D's," Olshan, 63, says proudly.

At its current site since 1979, the bookstore is carved out of an 1880 building designed as a mom-and-pop store with living quarters. Hermance and Olshan bought it for $50,000, borrowing the down payment from their customers.

"If ever a business was created by a community, this is it," Hermance says. "People made this place with their blood and guts. The first three years, we were 100 percent volunteers."

Ten years later, after Olshan had left the partnership, Hermance doubled Giovanni's space by buying the 1820 trinity next door for $85,000.

The airy first floor, featuring aisles of literature, magazines and gift items, is bathed in natural light from two large windows facing Pine Street. A photograph of Baldwin hangs behind the front counter.

Upstairs, the onetime living room is a cozy reading area, complete with couch, fireplace and philodendron. There are stacks of nonfiction, along with movies, music and oversize art books.

To Hermance, 68, the bookstore remains an important symbol to the public at large.

"From the very beginning, we sent the message that we are above ground and out of the closet. Homosexuals are not vermin seeking the shadows. We're not afraid. We bring people together."

Former owner Pat Hill, 73, an artist-activist, compares her tenure to "running away with the circus. It was exhilarating. It wasn't just a bookstore. It was the lesbian coffeehouse. It was my Quaker meeting."

Like bookstores everywhere, however, Giovanni's is struggling. Hermance has only three paid staffers, one of them part-time. He recently got rid of the water cooler to save $1,000 a year.

"Having paid off the mortgages is the only way the store has survived," says Hermance, a Texan with a twang. "We could never afford the rent today.

"Times are tough. It's a constant financial balancing act. But it's not about the money. It's about providing information for what used to be an unmentionable subject."

Many believe Hermance is the beating heart that keeps Giovanni's alive.

"Ed is an outstanding proprietor," says singer-composer Tom Wilson Weinberg, 63, part of the original troika of owners. "He's here all the time. He loves the business. He loves the community. He's the hero of the story."

The hero has simple needs. He still lives in the Powelton Village house he bought 32 years ago for $7,000. The furniture is all second hand, except for a 10-year-old dining room table.

He lives on Social Security and an inheritance from his mother, he says. He owns one suit, last worn in 1975 for a job interview.

"Ed may not be rich," says Wilson Weinberg, "but he's richer than Fannie Mae and Freddie Mac."

Wilson Weinberg and his partners, graphic designer Dan Sherbo and writer Bernie Boyle, opened Giovanni's in 1973 in a storefront at Second and South Streets.

The neighborhood "was a battle zone," he says, but the rent was $85 a month. For inventory, they had to borrow a car and drive to New York, where they bought 75 books from a wholesaler. Cash only.

With so few gay books out at the time, "we were really stretching it," Wilson Weinberg remembers. They scooped up everything by Baldwin, Tennessee Williams, Virginia Woolf, Truman Capote and Gertrude Stein.

All the books were displayed with their covers showing "because it was the only way we could fill the shelves," he says.

A year later, exhausted and broke, the trio sold the business to Hill for a whopping $500. In late 1976, also exhausted and broke, she sold it to Hermance and Olshan for the same princely sum.

They moved it to a building at Broad and Spruce. The owners were homophobic, Hermance says, and the gay entrepreneurs were forced out after three years. The space was rented to a palm reader, he says.

"The owners did us a favor," Hermance says.

Almost 30 years later, Giovanni's is an institution in the Washington Square West "gayborhood." Still, a question remains: Will there be a 40th anniversary?

"I've been looking for a successor for 20 years," Hermance says quietly. "I've come close a couple of times. I can't afford to just give away the store.

"I keep hoping that somehow it's going to come together."

That book, apparently, has yet to be written.