Isabella Black had never heard the word transgender before she arrived in San Francisco. She just knew she didn’t fit in. Not with her family in North Dakota, who embarked on raging benders every weekend. Not with the folks in Bakersfield, where she stepped off a Greyhound alone when she was 15, thinking she had arrived at the California beach, and ended up staying six years. And especially not in her biologically male body. A Google search yielded results for the Larkin Street shelters in San Francisco, where she could get a bed and help going “from boy to girl,” as she put it back then, before she learned the lingo of transitioning. Isabella hopped a bus pointed north.

As computer science and MBA grads flock to the country’s tech capital, a parallel and decades older pilgrimage of gay and transgender youth continues apace. They’re attracted to the ideal of a city where the main thoroughfare is lined with rainbow flags come June, where City Hall started issuing marriage licenses to gay couples more than a decade ago, where Harvey Milk’s image dons something as banal as the foot-roller display at Whole Foods. Yet once here, they find the gay mecca has about as much room for poor gays as it does for poor straights, which is almost none. Milk’s Castro is the province of $12 Mai Tais and $3,500 one bedrooms. The mural reading GIVE ME YOUR TIRED, YOUR POOR, YOUR HUDDLED MASSES on the city’s largest homeless shelter down near SoMa’s drag clubs and gay bars is magical thinking in a neighborhood that also houses Pinterest and Airbnb.

Hear Isabella talk about transitioning, marriage, and finding a new name

The result is that 29 percent of San Francisco’s homeless identify as LGBTQ — and for homeless under 25 years old, that number creeps up to 48 percent. Statistically, gay homeless differ from the overall homeless population in hopeful ways: They are younger and more likely to be homeless for the first time; they’re less likely to have drug or alcohol addictions or mental-health problems. Mostly they need assistance from people who accept them and don’t threaten to send them back to the parents who kicked them out or the group homes they fled, says Matt Bartek, program manager at Larkin Street Youth Services, the city’s biggest youth shelter. Many of them carry the wounds of social rejection and say that their sexual identity contributed to them being homeless.

Larkin provides a haven for these youth, but like all city housing in San Francisco, it’s crunched for space. Larkin has just 72 shelter beds, in which people aged 18 to 25 can stay for 120 days. When Isabella arrived two years ago, the only space was a bunk in the male bunkroom. (Larkin usually houses people according to gender identity.) Isabella was one of the lucky ones: She quickly nabbed one of the 23 rooms in an LGBTQ-specific SRO in the Castro, a place that always has a waitlist. It’s one of the only LGBTQ-specific supportive housing programs for youth in the country, and unlike other housing programs, it’s a place where Isabella could start her gender transition with the help of a case manager who connected her to government programs that provide free hormones. The people under Larkin’s umbrella — including Spencer “SPULU” Pulu (24), Darneisha Love (23), and Jayson Dowker (22) — pay 30 percent of their income to “rent,” but Larkin holds it as a savings account, returning it to them when they leave the program after two years or on their 25th birthday.

In October, Isabella and her girlfriend, Angel, married at City Hall, surrounded by their Larkin friends, a surrogate family standing in for their absent biological ones. The newlyweds don’t live together: Couples aren’t allowed in Larkin housing’s SROs. But that’s just for the interim. In two years, after Isabella ages out of her current program, she figures she and her wife will probably have to skip town — this time not because of who they are, but because of how much they make.