Pakistan is not the kind of place that most people would associate with gay liberation. But some say the country is a great place to be gay - even describing the port city of Karachi as "a gay man's paradise".
Underground parties, group sex at shrines and "marriages of convenience" to members of the opposite sex are just some of the surprises that gay Pakistan has to offer. Under its veneer of strict social conformity, the country is bustling with same-sex activity.
Danyaal, as he's asked to be known, is a 50-something businessman who lives in an affluent part of Karachi, and uses his smartphone to organise Karachi's gay party scene.
"One of the first things I did online, maybe 12 years ago, was type in G - A - Y and hit search. Back then I found a group and made contact with 12 people in this city," he says.
"These days there are smartphone apps that use GPS to tell you how close you are to another gay person with an online profile. There are thousands of gay men online in Pakistan at any one time."
The party scene is big - so big, he jokes, that he rarely gets time to himself.
"If you want sex too, it's a gay man's paradise. If you want a relationship, that may be more difficult."
These invitation-only parties are a rare opportunity for gay men to be open about their sexuality.
Pakistani society is fiercely patriarchal. Pakistanis are expected to marry a member of the opposite sex, and the vast majority do.
The result is a culture of dishonesty and double lives, says researcher Qasim Iqbal.
"Gay men will make every effort to stop any investment in a same-sex relationship because they know that one day they will have to get married to a woman," he says.
"After getting married they will treat their wives well but they will continue to have sex with other men."
Sex between men occurs in some very public places - including, surprisingly, Karachi's busiest shrine.
Families go to the Abdullah Shah-Ghazi shrine to honour the holy man buried there and to ask for God's blessings, but it is also Karachi's biggest cruising ground.
Every Thursday evening, as the sun sets, men from across the city gather there. A tightly packed circle is formed and those in the centre of the circle are groped by those on the periphery.
To outsiders it looks like a writhing mass of men huddling around one another. Some even describe it as a "mysterious religious ceremony". For participants, it's anonymous group sex.
This kind of behaviour is, of course, not condoned by Pakistan's religious authorities.
Most Pakistanis view homosexuality as sinful. The vast majority of clerics interpret the Qoranic story of Lot as a clear indication that God condemns homosexual men. Some scholars go even further and recommend Sharia-based punishment for "men who have sex with men".
The shrine is far from the only place in Karachi where gay sex is freely available.
It is, for example, easy to buy from a malchi walah - a masseur who offers massage and "extras" for the equivalent of £5, or $7.80.
"We get important people - police, army officers and ministers too," says one masseur, Ahmed.
He claims to have slept with more than 3,000 men during his working life - despite having two wives and eight children.
One of his wives, Sumera, wears a burka and the niqab, but she has no objection to her husband's chosen profession and wishes more people would keep an open mind.
"I know he has sex. No problem. If he doesn't work how will the kids eat? I get angry when people call them names. People are stuck in their ways."
Sumera's position may appear surprising, but in fact it's not hard to understand, says Qasim Iqbal.
"In Pakistan men are discouraged from having girlfriends and so often, their first sexual experiences will be with male friends or cousins. This is often seen as a part of growing up and it can be overlooked by families - it's the idea that 'boys will be boys'," he says.
"Sex between men will be overlooked as long as no-one feels that tradition or religion are being challenged. At the end of it all, everyone gets married to a member of the opposite sex and nothing is spoken about."
Technically, homosexual acts are illegal in Pakistan. The British introduced laws criminalising what is described as sex "against the order of nature" in the colonial era. Sharia-based laws dating from the 1980s also lay down punishments for same-sex sexual activity.
In practice, though, these laws are rarely enforced, and the issue tends to be dealt with inside the family.
"There was an instance where two boys were caught having sex in a field," says Iqbal.
"The family tried to bribe the police with money because they didn't want the story going public. When the police wouldn't back down the family asked for one detail to be changed - they wanted their son to be presented as the active sexual partner. For them, their son being passive would be even more shameful."
In almost all cases charges will be dropped, Iqbal says, but the boys will be forced to get married by their families.
Just occasionally, though, Pakistani parents do reconcile themselves to children entering a long-term gay relationship.
Akbar and Ali are one such couple who have made things work, against the odds.
"Ali's family was run by a matriarch," recalls Akbar.
"His grandmother was the head of the house so I knew that winning her over would mean everything else would fall into place. I took the time to talk to her and convince her that I was a good person. That was first and foremost. It wasn't about 'coming out' in a formal sense. It's more important to convince Ali's family that I'm a good human being.
"She once gave me a hand-embroidered decorative cloth that she had made as a teenager. She said she was giving it to me because she knew I 'take care of things'. It was a kind gesture and a very personal kind of acceptance."
Akbar and Ali have now set up home together with the support of their families. Akbar has a good relationship with Ali's mother.
"She comes to stay with us and I love watching soaps with her. At the end of the night she goes to her room and Ali and I will retire to our room. Two men sleeping in the same bed? Sure she knows what is going on. We don't have to have a big discussion about it."
Stories like this are, however, exceptionally rare. For many gay men in Pakistan, a heterosexual marriage and a life of anonymous groping is the long-term reality.
But life can be even more difficult for gay women. Expressions of female sexuality are shunned in the public sphere, even among heterosexuals. So how do gay women make their lives work?
In Lahore, twenty-something lesbian couple Beena and Fatima have come up with an inventive way to stay together.
Beena, although not publicly "out", says she is optimistic about the future. "I think we'll have a marriage of convenience. I know some gay guys and maybe we'll do a deal so we put in money together and they have one portion of the house and we'll have another portion. We may as well do that."
Fatima, who contributes to an invitation-only online gay support group, believes it's only "a matter of time" before Pakistan begins to debate gay rights openly, and people declare their homosexuality with pride.
"You can't stay in the closet forever. You have to come out. It's inevitable," she says.
Beena is less hopeful.
"Gay rights in America came after women had basic rights. You don't see that in Pakistan. You are not allowed a difference of opinion here. My father is a gentleman but I wouldn't put it past him to put a bullet through my head. I'm all for being 'true to myself' but I don't want to die young," she says.
"I think it's selfish for me to come out and campaign for gay rights now. It's selfish to the women in my family who are fighting for education and the right to marry the man of their dreams, or not to marry at all."
It may take a generation for any real change to occur - even liberal Pakistanis tend to regard sectarian violence and economic instability as more pressing issues. But there will still be private spaces where gay Pakistanis can express their sexuality openly.
Some of the names of the contributors have been changed to protect their identities.
You can hear more on this story on BBC Radio 4's Crossing Continents, on Thursday 29 August at 11:00am or on Assignment on the World Service on the same day