Brexit changed everything.

While the UK voted to leave by 52% to 48%, Scotland’s vote was 62% to 38% for Remain. This, in the SNP’s view, was a “material change” in circumstances mentioned in their manifesto as a trigger for a second independence referendum - or indyref2 as it was quickly dubbed.

Sturgeon sought and won the backing of Holyrood and fired off a formal request for the power to hold a referendum. A photograph of her writing that letter to Theresa May, feet up on the sofa, was no doubt intended to project a relaxed air of confidence. In truth she was under pressure.

May’s reply was simple. “Now is not the time” for indyref2, she said. And then, in April 2017, the prime minister surprised everyone by calling a snap general election.

The result changed the dynamics. The Scottish electorate, it seemed, had wearied of constitutional politics and the SNP lost a third of their seats, while the Tories doubled their share of the vote, surging from one to 13 seats north of the border.

“Jumping too far ahead of public opinion on this issue cost us a lot of votes,” was the judgement of former SNP minister Alex Neil, who voted for Brexit.

Since then, Sturgeon has been treading water on the subject of a second independence referendum to the irritation of many in the wider independence movement.

“Losing half a million votes and 21 seats has utterly scarred her,” one senior Holyrood insider told me.

Her party was changing, too. The SNP, which had numbered 25,000 before the referendum, now boasted more than 125,000 members. Their views about the direction of travel do not always match those of their leader.

The movement is restless, urgent and specific in its demands and Sturgeon’s leadership has been characterised by caution, compromise and, arguably, a certain amorphousness.

For example, the woman who once remarked, “I was in the CND before I was in the SNP,” now appears content to shelter under Nato's nuclear umbrella.

Far from seeking the socialist Scotland of which some independence supporters dream, she has expressed admiration for different flavours of capitalism, such as the Nordic model with its high quality of life (and taxation to match), and Rhine capitalism which combines competitive markets with a collegiate approach to labour relations and a strong social safety net.

How exactly Sturgeon would guide an independent Scotland to these destinations remains rather vague, as does her vision for balancing the nation’s books without tax hikes, more austerity or higher borrowing.

True, she has used the Scottish Parliament’s new fiscal powers to raise some taxes and has approved state intervention to save a shipyard and an airport, but she still insists that “pursuing greater equality and tackling social justice” is only possible with a “vibrant business base earning the wealth”, leaving some critics to wonder whether the SNP is really New Labour in a kilt.

Arguments among supporters of independence now range from that central topic to transgender rights and much in between, with some criticising what they perceive as a lack of radical ambition from the Sturgeon government.

Meanwhile, the attack line from her opponents is to “get back to the day job”.

On taking office, Sturgeon promised to prioritise education and, while schools have been refurbished and access to nursery extended, critics still describe a litany of problems.

In the Scottish NHS, meanwhile, the government watchdog Audit Scotland says more people are being seen and treated on time, and patient safety is improving. But just two out of eight key waiting time standards were met last year and the service is facing a funding crisis if it does not speed up the integration of health and social care. On top of that, flagship hospital projects in Glasgow and Edinburgh have run into serious trouble.

Famously disciplined in recent years, the SNP now seems more fractious with reports - denied - about divisions between the Westminster and Holyrood groups. Then there is the looming shadow of Sturgeon’s predecessor.

Alex Salmond is due to stand trial early in 2020 accused of serious sexual offences, which he denies. Separately, in January this year, Salmond won a civil case against Sturgeon’s government when it admitted acting unlawfully in investigating harassment claims against him. Legal restrictions mean there is not much that can be written at this stage. However, Scottish law and political circles are abuzz with talk about it. There is a feeling of anxiety among senior figures in the SNP about what the trial will mean for the SNP and for Nicola Sturgeon.

And, for the first time, some in the SNP are beginning to look beyond her leadership.

The case against Brexit has been fought in the courts by the SNP MP Joanna Cherry and in the Commons by the party’s Westminster leader Ian Blackford. At Holyrood, the name of Finance Secretary Derek Mackay is sometimes raised as a potential future leader. Some have demanded a “plan B” if there is no agreement from the UK on indyref2. Sturgeon, on the more careful wing of the independence movement, is having none of it, perhaps wary of the Catalonia example. Until very recently she had been notably absent from the large independence rallies which regularly take place in Scotland’s towns and cities.

“An impatient gradualist,” is how one well-informed insider describes her.

“I think she feels obliged to speak the language of the Yes movement,” adds the SNP source, but “I'm not sure that comes naturally from what she really thinks.”

Having said that, the insider argues that she is by some distance the “most experienced leader” in UK politics and “her remaining in post is, I think, crucial. It's necessary in order to take independence forward”.

Sturgeon’s hopes for independence now appear to rest on surviving as leader; gaining a renewed mandate at the Scottish parliamentary elections in May 2021 and persuading a UK government to agree to another independence referendum.

Not only that but she would probably then have to convince voters that the economic uncertainty of leaving a 46-year-old union would not be eclipsed by the economic uncertainty of leaving a 312-year-old one.

That is a very long list of ifs and buts without even mentioning the possibility of a second Brexit referendum removing the “material change” reason for holding another vote on Scotland’s future within the UK.

On 20 November 2019, it is exactly five years since Nicola Sturgeon became First Minister of Scotland. She is spending that day in the same way she began all those years ago in that Ayrshire street, knocking doors, meeting voters, campaigning for Scottish independence.

Her journey has taken many turns but it is hard to avoid the idea that time is no longer on her side. We are nearing a decisive stage in Nicola Sturgeon’s story, a story which could yet determine the future of the entire United Kingdom.