For many years Scotland just did not do gay. Homosexuality was dangerous and taboo, and it was actually against the law right up to the 1980s. So how did a country that seemed to take pride in its prejudices end up with the best gay rights in Europe?
Post-war Scotland was a deeply conservative place. In fact, half the country voted Tory in 1950 and most people attended the Kirk on a Sunday. Sex was rarely, if ever, mentioned.
If talking about the birds and bees in the 1950s was taboo then mention of the possibility of bees getting together with each other was totally forbidden.
Dr Jeff Meek, the author of Queer Voices in Post-War Scotland, says: "There was almost a bar on talking about same-sex desire."
He says homosexuality was something families, religious institutions, the medical profession and society at large all chose to ignore.
"Growing up queer in post-war Scotland is essentially occupying a social and sexual wilderness," Dr Meek says.
Acts of male homosexuality had been outlawed for centuries and were made stricter in the late 19th Century but same-sex contact between women had never been targeted in law and was not illegal.
Scottish society just chose to believe lassies did not do that kind of thing.
Author Val McDermid says: "When I was growing up the word lesbian was in our vocabulary but it was a kind of fabled beast like unicorns.
"You heard about them but you never met one. It was always someone's cousin knew a lassie that knew one."
Gay men were known to exist but they did not fit the Scottish image of robust masculinity.
Homosexual men were forced underground to public toilets or illicit parties.
Dr Meek says: "The consequences of being caught were significant.
"You knew being caught meant being excluded from your family. You could be sacked for a hint of homosexuality, never mind a prosecution."
People went to prison for sometimes two years or were locked up in psychiatric institutions.
In 1957, after a succession of well-known men were convicted of homosexual offences, the Wolfenden report recommended that "homosexual behaviour between consenting adults in private should no longer be a criminal offence".
However, the Scottish representative on the Wolfenden Panel was James Adair.
Dr Meek says: "Adair disagreed with almost all the recommendations the main committee had come up with.
"He saw homosexuality as the first step into moral turpitude.
"The Scotland he loved would be lost. This upstanding, moral, conservative, religious society would descend into decay and would be destroyed."
It took a decade for the recommendations of the Wolfenden report to be become law in England and Wales, decriminalising homosexuality for men over 21.
But because of James Adair, homosexuality in Scotland remained illegal, classified as criminally-depraved behaviour.
Many gay Scots had to resign themselves to a life in the closet.
In 1969, a brave group of gay Scots decided they could not change their sexuality so they set out to change Scotland.
The SMG (Scottish Minorities Group) arranged discos and get-togethers for gay men and for lesbian women.
They were very respectable events, usually held in a pub on a Monday or Tuesday night when there was little other business. They had rules about public displays of affection in order to keep within the law.
Although small at first, word spread and the numbers grew.
The SMG started to make money and leased property in Broughton Street in Edinburgh where it set up the Gay Information Centre and operated a telephone helpline.
Writer, historian and gay activist Bob Cant says: "I think the Scottish Minorities Group deserves an enormous amount of credit. Their achievement in changing public consciousness was enormous."
Thirteen years after the law was reformed in England, Labour MP Robin Cook lodged an amendment in the Scottish Criminal Justice Bill and homosexuality was finally decriminalised in Scotland in 1980.
That decade saw an explosion of gay culture into the mainstream. In Scotland, the newly legalised gay men had a fantastic time. In Glasgow, the gay mecca was Bennets.
Social commentator Damian Barr tells a BBC Scotland documentary: "I could not have imagined a place like this existed. I'd not even seen a gay club on film or on television. It felt like Xanadu.
"To walk into a room and see all these men dancing together and kissing, I actually thought something bad was going to happen. I thought these people can't be allowed to have this much fun."
But along with fun came a new threat in the form of HIV/Aids.
If Scotland was ignorant about Aids it was rudely awoken in 1985, when 60% of injecting drug addicts tested at an Edinburgh hospital were found to be HIV positive.
As a result, the Scottish capital was labelled the HIV capital of Europe.
David Taylor, who was at Lothian health board in the 80s, says: "It certainly stuck as a label but it was blatantly untrue."
Despite the study relating to drug addicts and the figures being debatable, homosexual sex was once again portrayed as something to fear.
In 1987 Margaret Thatcher's government went to war with the gay community.
The prime minister told the Tory conference: "Children who need to be taught the traditional moral values are being taught that they have an inalienable right to be gay."
Section 28 of the Local Government Act 1988 prohibited "the teaching of the acceptability of homosexuality as a pretended family relationship".
Historian Dr Amy Tooth Murray says: "Section 28 basically says 'you can not talk about non-heterosexual relationships at school'."
There was outrage and protests across the country at this rolling back of the rights of gay people but the law stayed in place until the re-establishment of the Scottish Parliament in 1999.
One of its first acts was to repeal Section 28 but it had a battle on its hands.
Billionaire businessman and born-again Christian Brian Souter did not support the move and used his money to back a strong Keep the Clause campaign, which had the backing of Scotland's best-selling newspaper The Daily Record and the Roman Catholic Church.
The Scottish Executive stood firm and abolished the clause. Westminster followed suit three years later.
Journalist David Torrance says that despite being very unpleasant at the time it was a "cathartic" experience that got Scotland talking about gay rights issues and finally swept away the old attitudes.
Since the Millennium, Scots attitudes to homosexuality have changed dramatically.
Surveys suggest that more than two thirds of Scots actively approve of gay marriage and it is now homophobia that is taboo.
In 2005, civil partnerships were made legal for gay couples and the following year same-sex couples were able to adopt.
Last year, as the Commonwealth Games was being shown around the world, Scotland declared its new openness with a kilted gay kiss as part of the opening ceremony.
The year ended with gay marriage becoming legal in Scotland and the leader of the Scottish Conservatives, a lesbian, passionately supporting the move.
Earlier this year, Scotland was rated the best country in Europe in terms of legal equality for LGBT people.
A remarkable transformation in just a generation. A queer tale indeed.
Coming Oot: The fabulous history of gay Scotland is on BBC One Scotland on Monday 30 November at 22:35.