It’s five minutes before the week’s big event in the Scottish parliament, and the scene suggests a kind of politics much more modern than the hoary Westminster version. The debating chamber is an airy space, all wood panels and bright lights, seemingly purpose-built for TV broadcasts. Members – known as MSPs, or members of the Scottish parliament – have their own little desks on which they can carefully arrange their paperwork. There is none of that “right honourable member” stuff, nor a speaker sitting on a throne and dressed in a gown; if something goes down well, it’s met with applause rather than a massed, “Hear, hear.” And, as if decisively to confirm that we are in the 21st century, each of the major party leaders, arranged in a semi-circle from right to left, is a woman: the Tories’ Ruth Davidson, first minister and SNP leader Nicola Sturgeon, and Labour’s new(ish) leader Kezia Dugdale.

Today is first minister’s questions, a half-hour ritual with a running order loosely based on what happens in the House of Commons. The big issue this week is an official report into a scandalous run of events back in July this year, when Scottish police – who were amalgamated into a single force by the SNP government in 2013 – failed for three days to respond to reports of a car crash on the M9 that killed 28-year-old John Yuill, and thereby contributed to the death of his 25-year-old partner Lamara Bell, who left behind two children.

At first, the impression of a gentler kind of politics just about holds. But less than 10 minutes in, as Dugdale talks about “systemic failings” and asks Sturgeon if she still has confidence in her justice minister, desks are being banged, while jeers erupt. The speaker – or, rather, presiding officer, who is also a woman – issues her fourth shout of “Order!”, which momentarily stills the noise; but within a minute or so, it all goes off again.

Sturgeon responds to Dugdale’s attacks with Olympic-level condescension: “Perhaps she was so busy reading her script for the next question, she forgot to listen to my answer,” she says, to more desk-banging. The first minister has a solid assurance that comes with experience and power, and somehow manages to give the suggestion of a swagger while standing stock-still; Dugdale, whose demeanour is a little cautious, capably holds the line, but there is still something of the rabbit in the headlights about her.

Twenty minutes later, I am in a meeting room done out with Labour party election posters when in comes Dugdale, her weekly test over and done with. Today is the day she comes into work early, and has an early-morning bowl of porridge as part of her preparation; this evening, by way of marking the fact that the pressure is off for another seven days, she will “eat pizza and drink beer” in a weekly ritual she says is non-negotiable.

I ask how it went, and she pulls a half-grimace. “It kind of puts to bed any suggestion that how we do politics in the Scottish parliament is vastly different from Westminster,” she says. “It’s still very combative – quite fiery exchanges.”

Is that to say that when things are like they were today, Dugdale doesn’t like it?

“Erm… I don’t enjoy it. I endure it. I recognise it’s part of my job, but that’s 10 minutes of my week.”

Does she think Sturgeon enjoys it?

“Erm… yeah, I think she probably does. She’s 16 years a politician. It’s taken her a long time to build up the skills and the credibility, and polish the talents that she clearly has. She’s at the top of her game, and this is a chance to show those skills off.”

And how long does Dugdale give herself before she gets to that point?

“Look, I’m acutely aware that I’ve just been an MSP for four and a bit years,” she says. “You know? I’m 34 years old. There’s a lot about life, a lot about politics, that I’m still learning. A lot of the things I’m doing as leader, I’m doing for the first time. But there are things I do know a lot about, and there are lots of things I’m incredibly passionate about: education, tackling poverty, female inequality. And on that stuff I’m 100% on my game. But I think it probably does take a wee bit of a while. She’s had 12 years more than I have.”

Kezia Dugdale on Nicola Sturgeon: ‘She’s at the top of her game, and this is a chance to show those skills off.’ Photograph: Murdo Macleod/The Guardian

There is another obvious difference between the two of them. Sturgeon is the leader of a party whose domination of Scottish politics sometimes defies belief. Dugdale, by contrast, has easily the most difficult job in British politics. Optimists in her party describe the task she faces using words such as “revival” and “renewal”; in the eyes of her opponents, she has the unenviable task of trying to resurrect a political corpse.

***

At May’s general election, over Britain as a whole, Labour got its second-lowest share of the vote since 1983. Some recent UK-wide opinion polls suggest that the supposedly white-hot excitement sparked by Jeremy Corbyn pushed up the party’s support by only a couple of percentage points.

But in Scotland, Labour’s position is truly awful. The party introduced Scottish devolution, and ran the country for the Scottish parliament’s first eight years, before the Scottish National party took power in 2007 and set off on the road to last year’s independence referendum. Labour led the no side to victory and briefly rejoiced, but it had been losing support to the Nationalists since the middle of the last decade; in the referendum’s aftermath, it soon became clear that the way Labour had conducted itself during the independence vote had made things even worse.

The crude version is that, by campaigning alongside the Tories for the survival of the UK, Labour decisively alienated a huge chunk of its Scottish support. Pro-independence voices were able to portray Labour as a kind of occupying force taking its orders from Westminster – something that reached its hilarious peak when party figures travelled up to Glasgow en masse from London and marched through the city’s streets accompanied by a quick-thinking rickshaw driver who blasted out the Imperial Death March from Star Wars on his in-vehicle speakers.

A slightly more sophisticated take might add that, when hundreds of thousands of them voted yes, once-loyal Labour voters suddenly realised they could defy the party and feel good about it. So it was that, in May, Labour lost 40 of its 41 Scottish MPs. To add to the pain, current polling for next year’s Scottish parliament elections puts the SNP on around 53%, suggesting that Labour could lose all of its constituency MSPs – leaving it reliant on the top-up “list” seats used to make the Scottish parliament more proportional.

When Dugdale was elected to her job with 72% of the vote, she became the Scottish party’s sixth leader in eight years. Her predecessor, the former cabinet minister Jim Murphy, under whom she served as deputy, lasted exactly six months. But she has made it clear that the revolving door approach is at an end, and she intends to see the party through at least two Scottish elections (and, by implication, the 2020 general election). In the last month, there have been signs of both the SNP’s lustre of invincibility at least occasionally fading, and of Dugdale scoring a few political hits on such issues as education and tax credit cuts. The basic intention is to portray the Nationalists as friends of the wealthy.

Before I meet Dugdale, I spend time talking to another serving MSP and a couple of former MPs who lost their seats in May’s deluge. Gemma Doyle, a former MP who lost the once-safe seat of West Dunbartonshire on a mind-boggling 35% swing to the SNP, traces Labour’s crisis to the 2007 Scottish elections. “That was a really key moment,” she says. “The SNP only beat us by one seat. But instead of saying, OK, that was a massive failure; we need to do something different and radical, it was business as usual. And we just slid farther and farther down. In 2007, the electorate sort of slapped us round the face and said, ‘We’re not happy with you.’ In 2011, they came back with a baseball bat and said, ‘You didn’t listen last time – now we’re going to beat the shit out of you.’”

This was the year of the Scottish elections, when the SNP won 69 seats in the Scottish parliament to Labour’s 37, and the extent of Labour’s woes was glaringly revealed.

“That year, there was one telling moment where I knew it was dire,” says Neil Findlay, a high-profile MSP who stood for the Scottish party’s leadership in 2015 and enthusiastically campaigned for Corbyn through the summer. “It was in my own village: a mining village where I was a councillor for nine years. I know almost everybody. We went to the door for the candidate, and I spoke to a relative of a guy who was a Labour councillor. Previously, he would have had posters up and all the rest of it. And he said, ‘I’m not sure this time, big man.’ And I thought, ‘Jesus Christ, if he’s not sure, we are fucked.’ That smacked me in the face.”

Findlay talks to me for over an hour, in an office that contains a bust of Karl Marx and a poster featuring that revered leftwing icon, Tony Benn. He puts his party’s decline in the context of deep changes that also apply south of the border: the decline of heavy industry and the waning influence of institutions that once glued swaths of Labour’s Scottish vote together, such as the trade unions and the church. He says the Scottish party suffered from the bad feeling sown during the Blair years. And he talks about the way that, from the 1990s onwards, the SNP got its act together. “They hired some of the most able strategists and media operators. The team they had was top-notch.”

Findlay also voices his pain about the referendum. “I think the Labour approach was disastrous. You can’t spend 30 years telling people that the Tories are the biggest bunch of bastards ever, and then be seen to campaign on the same platform as them. To me, that was just madness.”

Kezia Dugdale at the Women 50:50 conference. Photograph: Murdo Macleod/The Guardian

In Glasgow, I have coffee with Margaret Curran, Labour’s shadow Scottish secretary under Ed Miliband, who had an early taste of the SNP’s growing dominance when she lost a 2008 Westminster byelection in Glasgow East – the kind of place where the party once weighed the vote rather than counting it. She won back the constituency for Labour in 2010; but after the referendum, she knew everything had changed, something she traces not just to the vote on independence, but to the economic crash of 2008 and the MPs’ expenses scandal. “By February this year I was absolutely certain,” she says. “You could tell.” Curran lost her seat in May, thanks to a 31% swing to the SNP.

Some of the party’s plunge in Scotland, she says, was down to its failure to get to grips with the social media that SNP supporters use in their droves. “I would go on the doorstep and talk to people for 15 minutes,” she says. “Blah blah blah. And then they’d go and have an hour’s conversation on Facebook that would completely contradict everything I’d said, and we had no counterargument.”

When the general election came round, she thought Labour would hold four or five Scottish seats at most. On election night, she was at the vast count in a Glaswegian arena where it was announced that Labour had lost every seat in the city. “I was completely hyper: it was actually a good laugh at points,” she says. “One of our activists, who’s a nurse, found a packet of paracetamol and said, ‘Has somebody gone and topped themselves?’ By that point, it was just gallows humour. But it was hard.”

In the midst of an early evening downpour, I drive to Anniesland, an area of Glasgow five miles out of the city centre. In 2011, the SNP took the local Scottish parliament seat from Labour by a mere seven votes; four years later, at the general election, the swing here from Labour to the SNP was 31%. In the cafe of the giant local Morrisons, I meet Bill Butler, the area’s former MSP – who is standing again for the 2016 elections, and says he will “fight for every vote” – and a group of local Labour members, who range in age from 20 to 44.

They talk about what happened in May as “devastating” and trace it back as far as 1999; Butler says that by 2015 he was struck by the large number of ex-Labour supporters who “had completely switched off”. But they also say there are reasons to be cheerful: Labour membership, they say, actually went up after the referendum, and since Corbyn stood for the leadership the local party’s numbers have doubled, from around 250 to 500. But no one gets too carried away: Labour’s big aim now, says 23-year-old Paul Cruikshank, is simply “for people to listen to us”.

“People are still scared to declare that they’re a Labour supporter,” 20-year-old Eva Murray says. “That’s carried on since the referendum. They’ll tell you quietly they’re voting for Labour, but that’s it.” Among other things, she’s talking about the hostility to Labour that regularly bubbles up on Twitter and Facebook. “And the fact that the SNP didn’t condemn that until very late on didn’t help.”

This is another aspect of Scottish politics that sometimes gives it an unpleasantly macho, downright nasty flavour. One pro-independence blogger recently tweeted the hope that “an aeroplane delivering dirty needles” might crash into Labour’s solitary Westminster MP. You need only have a look at Kezia Dugdale’s Twitter feed, on which even her laying of flowers at the French consulate after the massacre in Paris was met with a political sneer (“Dugdale does not – and never will – speak for the Scottish people”) to get a sense that even if this behaviour is restricted to a tiny minority, it still sometimes sits on the edges of Scottish politics like an unwanted drunk at a party.

***

Dugdale didn’t vote until she was 23, and had joined the Labour party before she set foot in a polling booth. Photograph: Murdo Macleod/The Guardian

In the lead-up to the referendum, Dugdale says, she saw flashes of what was coming. “I was well aware that there would be a consequence for the Labour party,” she says. “I can remember speaking to a Times journalist at a lunch, saying that the rhythm of events I could see was: Scotland voting no, but then being almost angry with itself, despite feeling it was the right thing to do – and the way to articulate that anger being to kick out at the Labour party. That was before the referendum.”

She decided to run for the leadership, she says, a few days after Murphy resigned in response to the awfulness of the general election result. “I worked out that I did have a plan; I did know at least how to start to rebuild. And my whole political career had been on fast-forward, so why not take that step?”

Her CV was a mixture of standard-issue political stuff and a few details that set her apart. Dugdale studied law at Aberdeen University, but largely hated it. “I vividly remember going into my first class, on the Scottish legal system – 250 people in a lecture theatre, all banked up the stairs – and it just made me so conscious of all these privately educated kids. They all had their schools’ sporting gear on. I just felt hugely out of place. I knew within the first few weeks of starting that I didn’t want to be a lawyer.”

After graduation, and a spell on the dole followed by a run of waitressing jobs, she was eventually hired as the campaigns and welfare adviser at Edinburgh University’s Students Association, before getting a job as an aide to a Labour MSP.

Amazingly, Dugdale did not vote until she was 23; indeed, she had joined the Labour party before she set foot in a polling booth. Politics, she says, had “just passed me by, if you can believe that”. Looking back, though, there were early signs of what she calls her “value set”: before university, for instance, she wrote a sixth-form dissertation on the murder of Stephen Lawrence. She still keeps it in her office: “I’m desperate to meet Doreen Lawrence, to show her. I got the school prize for it, being a bit of a geek like that.”

Dugdale lives in the Duddingston area of Edinburgh, directly next to the greenery of Holyrood Park. One former political colleague I speak to describes her basic mindset as “Edinburgh Labour”: metropolitan and middle-class, as opposed to the kind of Scottish politics rooted in the trade unions. She has said she has “no life outside of politics, unless I orchestrate it”. The last film she liked was the Bond movie Spectre; somewhat alarmingly, she says her all-time favourite band are those merchants of innocuous plod-rock, Stereophonics.

Dugdale is not from a Labour family. An only child, she was brought up first in the 25,000-population town of Elgin and then in Dundee. Her parents, who divorced when she was 15, were both teachers and, she has said, “sometimes look at me like a zoo exhibit, wondering how I ended up here”. Her mother Gillian remains a floating voter, while her father Jeff is a Tory turned Nationalist who now loudly speaks his mind on Twitter. At least once, he has had a pop at his daughter: during her brief stint as deputy leader, she tweeted about false reports that Nicola Sturgeon had told the French ambassador she wanted David Cameron to remain prime minister; he rather grimly tweeted, “Check facts before opening mouth, Kezia.” Lately, he has called the constitutional bond between England and Scotland a “zombie union”, and elegantly described Westminster as “the motherf**ker of all parliaments”.

She reacts to this latter bon mot with uproarious laughter. “He’s a really interesting character. He’s a late convert to the SNP. He’s one of those people that kind of journeyed the whole referendum story – voting yes, being very angry at the result, being one of those 100,000 people that joined the SNP post-referendum, now becoming the kind of activist and voice that he is.”

Does she ever tell him to tone it down a bit?

“No! He’s entitled to say what he wants. I can’t ask him not to articulate that. In the same way, he sure as hell can’t tell me what to say or think.”

One of the other curious aspects of Dugdale’s recent history is the fact that, during the general election campaign, she helped Ed Miliband prepare for the so-called “challengers’ debate”, featuring all the UK party leaders apart from David Cameron and Nick Clegg, by repeatedly impersonating Nicola Sturgeon. One account, in fact, says she “almost developed Stockholm syndrome”.

“I did it a lot,” she says. “I did it lots of different ways, because there are lots of different Nicola Sturgeons. There’s the one you saw today, which is very fiery, very impassioned. There’s a more considerate, calm one. There’s one that’s motivated by the Scottish interest; there’s one that pretends to be the bastion of Labour’s heritage.

“Arguably, who’s better in the UK at thinking about how she operates, what she stands for and the language that she uses than me, the person who has to stand up every week against her?” When she came up with mock versions of Sturgeon’s opening statements in the debates, she says, “I absolutely nailed it. It was almost word for word what she ended up saying.”

Are there things she admires about Sturgeon?

“Of course. I’m on record saying this. She’s a strong woman in politics. Given that I’m so committed to gender equality, to a 50/50 parliament, it would be pretty poor taste if I said anything other than, ‘Here is a woman in politics at the top of her game, 16 years in the making.’ She’s a very strong figure in Scottish politics.”

Recently, though, Dugdale said that in politics, “We don’t just need women in positions of influence, but feminists in positions of power.” Was she questioning Sturgeon’s feminist credentials?

“Yes. Because I think she’s a bit of a late convert to feminism. I think it’s something she’s adopted at a late stage, having studied Labour history and heritage. What it actually means to be a feminist… well, affirmative action, for example, the SNP have a very poor record on.”

So does she think there’s a cynicism at work?

“In the name of sisterly solidarity, I’m not going to have another pop at that. I’m pleased that she has converted to a convincing case for why women in politics matter.”

Dugdale voted for Yvette Cooper in this year’s Labour leadership election. Before he triumphed, she expressed serious reservations about the prospect of a win for Corbyn, in a quote I read aloud to her: “There are loads of people who are quite prepared to say, ‘Och, it doesn’t matter if he doesn’t look like a prime minister – there’s someone who’s authentic and says what they believe’… You have to convince me that he can be [prime minister]. Here’s a guy that’s broken the whip 500 times. So how can the leader of the party enforce discipline with that record?”

“That’s often been written up as a disparaging comment,” she says.

Probably because it looks pretty disparaging?

“I really, genuinely don’t think it was,” she says. “And I’ve spoken to Jeremy about it, and I don’t think he saw it that way, either.”

But she questioned whether he could be the prime minister.

“Yeah. Because it’s a serious matter, who the leader of the Labour party is… I just posed that question.”

And what does she think now?

“Well, look, Jeremy Corbyn is a man of deep principle, he is an utter gentleman, he’s a pleasure to spend time with. I’m getting to know him. He’s been in Scotland a lot. He’s supported me a lot…”

But can he be the prime minister?

“I very much hope so, yes.”

When it comes to next year’s Scottish elections, she says her own aim is a bit more modest. “I’ve described it before, using a rare football analogy for me, as being clapped off the pitch at the end of the season.” Her immediate plan is simply to get across “a sense that the Labour party is changing, that it’s beginning to represent, once again, that sense of hope, of things being radically different from how they are now”. It all sounds level-headed and potentially achievable. But, like all Labour politicians, Dugdale faces a future that could be very choppy indeed, thanks not just to the UK and Scottish elections, but also to the looming national vote on the EU. There’s also the possibility that, if the SNP’s support remains at its current titanic level, Sturgeon may yet push for another independence referendum.

After we talk, I watch Dugdale do her stuff at a day-long conference put on by Women 50:50, the pressure group she set up a year ago, in collaboration with a Green MSP, aimed at achieving equal gender representation across Scottish public life. It says something about both Sturgeon’s lofty position and Dugdale’s humility that, while the first minister gets a half-hour session to herself, Dugdale is limited to a place on a four-woman panel. In front of an audience of 100 or so women, she speaks with urgency, and infectious conviction, once again talking about her political career being on fast-forward.

At one point, a woman reads out a poem, saluting Dugdale, Sturgeon and Davidson, and the difference they’ve made to Scottish politics. “Wow, look at them now,” goes its closing line. “They’ve broken the mould.”

Her name, I later discover, is Anne Milne; she’s a retired primary schoolteacher from just outside Livingstone who, like so many Scots, used to vote Labour but now supports the SNP. “I prefer Nicola’s style,” she tells me. “She works with people. She’s – what’s the word? – conciliatory. Labour are too negative all the time, criticising the SNP. And I’m fond of Kezia, but she’s not got…” she pauses, “the knack.”

To that, Dugdale and her supporters would presumably respond that everything about the newly humble Scottish Labour party is a work in progress, including Dugdale herself. “She’ll be here for the long haul,” Neil Findlay says. “Please quote me on this: she has my 101% support, and she’s made an excellent start.”

“She’s sophisticated and she’s an operator,” Margaret Curran says. “Don’t underestimate her. She comes across as this nice young woman, but she’s a tough old cookie.”

Just how much steeliness and determination Dugdale will need in the face of Labour’s deep problems remains to be seen, but Curran says she has both those qualities in spades: “Kezia gets things done. She gets her way.”

Dugdale knows full well the people she needs to win back, against steep odds. “There are two types of people who voted yes in the referendum,” she says. “There are kind of diehard emotional nationalists, like my dad, who believe fundamentally that Scotland is oppressed, and it’s oppressed by England. There’s very little politics in that. That’s emotional nationalism: a feeling. Then there’s a whole other school of people who are pragmatic nationalists, who desperately want their country to change. They see unfairness and injustice every day. They believe it could only be better with independence. Now, I think those people could be persuaded to vote Labour again. I think they’re still open to us. But it’s down to…” She hesitates.

“I’ll point to myself here,” she says. “It’s me: I’m the leader right now.”