ARTICLE AD BOX
It's been a markedly turbulent year on Scotland's frequently bonkers political scene, and for none more than John Swinney.
As recently as April this year, the SNP veteran was a humble backbencher at Holyrood, beginning to contemplate whether he might stand down in 2026.
But then came Humza Yousaf's self-inflicted downfall, which thrust Mr Swinney back into government.
He was back on the campaign trail as his party suffered one of the worst electoral reverses in its history - a result he says could have easily been a wipeout.
And now he insists the SNP is back on the front foot and striding towards a Holyrood vote - where he says he'll seek a full term, to be first minister until 2031.
The first minister spoke to BBC Scotland's Podlitical podcast to go behind the scenes on the big moments of 2024.
The SNP was not in a happy place at the turn of the year.
Humza Yousaf came into office after a fractious leadership contest, and it felt like events were against him at every turn.
Every time he planned a big announcement, Police Scotland seemed to scoop him with a fresh twist in Operation Branchform, the inquiry into the SNP's funding and finances.
Mr Yousaf was also keen to allow more debate around the direction of the SNP, in a break from the very tight circle run by his predecessor Nicola Sturgeon.
But it led to constant questions and rebellions over policy, with some contentious proposals being dropped, and particular debate about the party's partnership in government with the Greens.
Mr Yousaf ultimately showed them the door in unceremonious fashion, and within days the Greens made clear they could help return the favour via a confidence vote in Holyrood.
The first minister had to go. And with the SNP teetering on the brink, it turned to John Swinney.
He was seen as taking the job - one he had decided not to run for a year earlier - out of loyalty to his party, rather than personal ambition.
He accepts that his "sense of duty prevailed" - "I felt I had to come back in and strengthen and rebuild my party and its reputation with the public".
The scale of the problem was immediately clear when a general election was called just weeks later.
Mr Swinney described watching the exit poll come in - delivering the news that the SNP was to lose most of its seats - and thinking "this could actually have been worse".
"The conditions that I inherited, we could quite easily have been wiped out," he said. "I don't think it would have taken much for that to have happened, when you look at the vote shares and all that went on."
This isn't to escape the gravity of the result - being slashed from 48 seats to nine was "an absolutely colossal setback".
But Mr Swinney always felt he could pick up the pieces.
"That's why my party turned to me," he said. "They knew if there was one person on the planet who could turn things around for the SNP, it was John Swinney."
That kind of bullishness might seem more in the vein of Alex Salmond than John Swinney.
Mr Swinney served as his right-hand man before having a similar role under Nicola Sturgeon.
But he says his plans for his own leadership were inspired more by conversations with backbenchers - including Lib Dem Willie Rennie.
The two spoke for "quite a while" on the fringes of a gender reform debate at Holyrood which went on deep into the night, and Mr Swinney says he had a vivid realisation that he had got out of the habit of even talking to opposition MSPs.
He had more time for such chats during his period on the back benches, and on returning to government was "determined I wasn't going to lose that important understanding of the need to connect".
Running a minority administration, Mr Swinney knows he needs to build bridges and find common ground with opponents in order to get anything done.
But that doesn't mean there's no time for politics.
The draft budget was the culmination of a period of furious manoeuvring between the SNP and Labour, two parties fighting for a very similar voter base and which view each other as their key electoral rival.
It marked a major shift in tone from the government, and potentially of momentum in parliament.
In September, Finance Secretary Shona Robison set out huge in-year cuts to balance the books, talking gloomily about austerity.
Two months later she was announcing eye-catching new initiatives, and pitching a message of "hope".
An injection of cash from the Treasury was doubtless pivotal, but Mr Swinney says the "really tough stuff" that had to be done in September got the government to a position of sustainability from which they could make more policy choices.
The most striking choice was a promise to mitigate the two-child cap on benefit payments, something ministers had long bemoaned while insisting they had neither the power nor the funding to reverse it.
The announcement was added to the budget so late in the day that the Scottish Fiscal Commission didn't have time to cost it; the watchdog termed it a "fiscal risk".
Mr Swinney rejected the notion that the plan had been drafted in at the last moment because the original "rabbit out of the hat" - a reinstatement of a winter fuel payment for pensioner households - had to be released a week early.
He said the team drawing up the budget, with himself and his deputy Kate Forbes "very close to the construction" along with the finance secretary Shona Robison, were looking for steps that would make the "maximum impact" on child poverty.
"We kept on feeling there wasn't enough there," he said, and "we came to the conclusion that we had to add that into the programme".
The announcement left Labour in a spin.
It ended a period of several years where the SNP seemed to be in the bunker; ditching controversial policies, desperately trying to scrape together the funds to keep expensive existing pledges afloat, and pitching very little that was new or notable.
Nicola Sturgeon's former chief of staff, Liz Lloyd, said there had been a "clear statement that the SNP has remembered that being in government enables it to drive the political agenda in Scotland".
Mr Swinney insists that the SNP is "back on the front foot, and intend to stay there".
That will not be straightforward, because many of the pressures facing the party have not gone away.
Operation Branchform will wrap up at some point, one way or another.
The SNP is still short on cash, even more so following the general election catastrophe, and is gutting its HQ of staff.
Mr Swinney still heads a minority administration, one short on goodwill in parliament.
Former flagship policies have run aground - it is only a matter of time until the National Care Service is scrapped, once an excuse to blame the opposition presents itself.
The first test of Mr Swinney's outreach programme will be the votes on the budget in February.
He intends to hit the road in January to "communicate the advantages of the budget to the public, to make sure the public exert pressure on parliament" and vote for it.
Appealing to the public is of course a handy thing to do in advance of an election campaign.
Mr Swinney accepts that he might have stood down in 2026, had he remained on the back benches.
Humza Yousaf has announced he is doing just that, making way for a "new generation" at the age of 39.
His successor meanwhile will now be pitching himself to serve a full term as first minister, until 2031 - the year he will turn 67.
Mr Swinney says he has been re-energised by what he terms a "sabbatical year" - saying that "the best thing that happened to me was standing down and having a year out of the front line".
It provided time for parkruns in Perth, walks in the hills and standing on the side of pitches watching his son play hockey.
He says this was a chance to "totally recharge physically and mentally", and insists that even after 27 years at Westminster and Holyrood he is absolutely up for another seven years in high office.
That will require the support of voters - and it will need to be overwhelming support if Mr Swinney is to achieve his ultimate political goal, of Scottish independence.
The constitutional question, so vital for the past decade, seems becalmed after the general election result.
That defeat followed one in the Supreme Court, which meant the levers which could trigger independence seem largely outwith the first minister's hands.
After years of head-scratching about ways to force the issue, Mr Swinney insists he doesn't want to get "bogged down in process".
But some within the movement remain concerned that means there is no plan, no route map to follow through to independence.
After years of talk of "de facto referendums" and complex solutions, Mr Swinney says there is a "hard reality" - "independence will not come about unless enough folk in Scotland want it to happen".
He says he is focused on delivering good government, to make the case that Holyrood is capable of running its own affairs.
And that is a task that Mr Swinney insists he is not just enjoying, but "loving" every moment of.