Sad but true: Krysty Wilson-Cairns is rare. She’s a young woman, she’s from a working-class background, she’s Scottish, and she works in movies. More than that: she works on movies like 1917, the extraordinary new First World War film directed by Sir Sam Mendes. “I always dreamed of writing a war movie,” she says, “but I never thought as a young female writer I’d be given the chance.”

The story of how the 32-year-old Glaswegian did get the chance is interesting, and unexpected, and features some strong supporting characters: a single mum putting herself through college, a Scottish granny obsessed with Global Video, and two guinea pigs intent on killing a human. The guinea pigs featured in Krysty’s first piece of writing and gives you an idea of what’s she about: she did her apprenticeship on the grand-guignol TV horror Penny Dreadful and now she’s writing about the horror of the Somme. She’s interested in the unconventional and the dark and the frightening. And the human.

All of it shows in the script she wrote with Mendes for 1917. It has some of what you’d expect from a First World War movie – the muddy trenches, the aloof officers, the hope that it will be over by Christmas – but mostly it doesn’t. The story follows two young soldiers on the Western Front tasked with delivering a message that will prevent a massacre and it unfolds in one, long, continuous shot through some of the landscapes of the Great War we see less often: in the air, in the water, under the ground.

But it’s the two central characters that we care about and there’s one moment in particular, in which one of the soldiers talks about his mother, that came straight from Krysty’s experiences. When she was preparing for the movie, she tells me, she and her mum went for a trip round the sites and cemeteries of the First World War in northern France and it was there that a lot of the story and the emotions fell into place for her.

“I was there with my mum and I was reminded often how many mothers came to France in 1919 onwards,” she says. “All those cemeteries were built for mothers and wives. All those beautiful memorials were built for the women really. I’m 32, I don’t feel particularly old, and I found that every cemetery I was in, I was older than every person buried there.”

All of that feeling and emotion, says Krysty, ended up in the experiences of her characters in the film. “It all came out of that and seeing my mum weeping at the graves,” she says. “We were both moved to tears constantly. My mum dissolved at the grave of a 15-year-old, completely dissolved. He would have lied about his age to go out there. And we know, with the benefit of history, what a waste of life that war was – you think the war is going to be over by Christmas and you are literally mowed down in the mud.”

Krysty says it’s no accident, given her experiences in France, that her film ended up being about two men trying to stop a battle. “This is an anti-war movie,” she says. “The very notion of war as a last resort – a war should be no resort. It’s nonsense that only involves the death of large numbers of usually poor men. It’s never justified and there’s no such thing as a winner. You can no more win a war than you can win an earthquake. The First World War was more than an earthquake – it was the apocalypse, it was cataclysm.”

This, says Krysty, is the message of the film, although message is far too unsubtle a word because there’s not a single moment of lecturing or moralising in it. Really, it’s the story of two men, comrades, soldiers, and what they do for each other in an extreme situation, and Krysty felt like she could tell their tale, partly because she’s obsessed with the First World War, but also because she’s always loved war films ever since her grandparents introduced her to them when she was growing up in Glasgow. She was aware, though, that as a young woman she was an unusual choice for the job.

“Men have traditionally told these stories,” she says, “but the notion that men, or women, are more qualified to tell each other’s stories, to be honest, is horseshit. I always dreamed of writing a big war movie but I never thought as a young female writer I would be given the chance, especially one on this scale. There’s so much in this that would’ve been a red flag but Sam Mendes being the man that he is, he always picks the best person for the job regardless of who they are. He doesn’t always hire people who are like him.”

And Krysty Wilson-Cairns is definitely not like Sam Mendes. She grew up in the Shawlands area of Glasgow in what she calls an un-ordinary family. Her mum was a single mother and when Krysty was growing up it was just the two of them.

“She was an incredible woman,” says Krysty. “She decided to go back to college; she didn’t have any qualifications when my father left. So she went back to college and I was watching my mum researching and studying when I was three years old. It always inspires me.”

Krysty’s grandparents were also a big influence on her. Her grandfather was from Govanhill and her gran, who was from the Gorbals, left school when she was nine. Every week, she and Krysty would go to the library and choose a book and you’d better have read it by the end of the week because there’d be questions.

A love of movies was also something passed down from her grandparents. They would go to Global Video in Shawlands, sometimes three or four times a week, and Krysty would pick a film and her grandparents would pick a film and they’d watch each other’s choices. Her grandfather loved war movies so Krysty saw a lot of them (her grandparents had no concept of age range).

Krysty’s grandparents were also a big influence in other ways. They spent every spare penny they had to help pay for her to go to a private school, Craigholme on the south side of Glasgow; they also encouraged her to have opinions and to have confidence in her abilities – confidence which led to her first becoming involved in film and television when she was 14 years old.

“They used to film Taggart at Govan,” she says, “and I went down to the set and said ‘can I watch?’ and they let me. I went every day in the summer holidays and I kept hanging around and eventually they gave me odd jobs and that slowly built into every holiday and I worked on commercials as a runner when I was 16.”

At home, Krysty’s mother – the matriarch of a family that saw education as the top priority – wasn’t entirely happy when her daughter said she wanted to make a career in television, but the compromise was that she would at least get a degree. So she joined a film and television course at the RSAMD, which is where she wrote her first piece of fiction – the story about the guinea pigs out to kill a human. Her tutors said: this is great, give us more.

Gradually, at RSAMD and later at the National Film School in London (paid for with a bar job), Krysty began to get a sense of what she wanted to write about and – perhaps surprisingly, given the struggles of her own family – it wasn’t dirt-real kitchen sink dramas.

“I have a huge respect for the people that write them,” she says, “and they’re often very profound but it was never going to be me.” She’s also resistant to the idea that she is a working-class writer. “To be honest, I find myself not really defining myself by class. I sound working class, but because I went to a private school, and because my grandparents and parents worked so hard, I’m incredibly privileged. I’ve had so many legs-up that proper working-class writers do not have. I don’t think there’s enough working-class female writers out there, but I wouldn’t want to steal from their valour and say I was one.”

One of the leg-ups she’s talking about is meeting Sam Mendes, who gave her a job five years ago on the television series Penny Dreadful, on which he was executive producer. The horror thriller was exactly the kind of thing Krysty wanted to be writing, and she thinks the Scottish film and television industry should be doing much more of the same.

“Scotland doesn’t make enough films and the sort of stuff we do tends to be the kitchen sink dramas as if Scotland is doom and gloom and this is our export,” says Krysty. “But if you look at things like Game of Thrones and Outlander, our export should be how amazing the world is – our rich history, our amazing culture. You never get anything about Kelpies or the amazing mythical creatures. It’s a waste.”

She also thinks it’s a bit sad that she had to go to London to find the kind of magical, mystical work she wanted to do. “I left to go to London for that reason because they would never make a big budget sci-fi thriller up there, so I thought, well I need to go where it’s going to be.” She wouldn’t let her mum, or her grandparents, catch her complaining though, because she’s been lucky, and she’s happy, and she’s excited. She’s talking to me from a fancy loft apartment in New York. Last night, she met Sarah Jessica Parker. She’s just written a film about the First World War directed by Sam Mendes. And here’s one of the best bits: “I get to make up stories in my pyjamas and get paid a lot of money for them,” she says. “It’s my dream.”

1917 is released on January 10