SO Jenni, I say to the writer sitting beside me in one of Edinburgh’s more percolated coffee houses, “are you the type to worry about the end of the world?”

Thursday afternoon. Dry, clear, the kind of day you can see Fife glowing greenly as you walk down Dublin Street. Jenni Fagan the novelist and poet is talking to me because she has a new book out. Two actually. A collection of poetry The Dead Queen Of Bohemia, full of desire and guitars and witches, and new novel The Sunlight Pilgrims, which is all about the difference between existing and living, a boy who identifies as a girl, wild landscape and Ballardian non-landscape (ie, there are mountains and there is an Ikea store in it). Oh, and the idea that winter is coming for all of us.

That’s where you join us. Because the new novel is, in the literary parlance of the moment, an example of cli-fi (climate-fiction if you’re not keeping up). Hence the question at the top of the page. Is Jenni Fagan one of those people who worry about the ice caps melting, the Gulf Stream being turned off? “Not particularly,” she tells me. She is dressed in black though, so, you know, mixed messages.

“I am fascinated by the fact that we live on a planet and people don’t talk about it very often,” she does say. “We seem to have sanitised life hugely.

“I’ve always had a fascination with that. Aged 15, I’d be in Tesco and I’d want to say to the woman serving, ‘We’re in the middle of the universe. And there are all those other universes out there. What do you think of that?’

She smiles. “They might have had an opinion or just have said, ‘Security, can you please take this lady out of the store?’”

She circles back around to the question we started with. “In this novel I wanted to explore what happens when the planet is making its presence felt in a way that we can’t ignore. I like the idea – it may be slightly naïve – that we have a contract. That humans agree that we’re only caretakers of the planet while we’re here. It’s very easy to say something like that but another part of me absolutely believes that. I don’t really see why we manage society in the way that we manage it and in writing this novel I am exploring that. Out of sheer frustration as much as anything else.”

Frustrated is not something you would say characterises Fagan herself these days. She seems focused and fulfilled. But there are issues. About the state of the world, yes, but also about the media’s obsession with her back story. In her much younger years, she was a child of the Scottish care system. It’s a subject she explored in her first novel The Panopticon. The first-person story of a 15-year-old in care, it was praised by the great and the good and is soon to be turned into a film by Jim (son of Ken) Loach. Fagan has written the screenplay.

She gets asked a lot about her childhood as a result, but frankly it’s not really something she wants to talk about or let define her.

“I have absolutely no interest in being a spokesperson for the care system in any way whatsoever because I left 22 years ago. What I had to say I said in that novel. It is not the most interesting thing about me and it is not the most interesting thing about my life.”

We will come back to this but I think it’s fair to say that Fagan, now 38, defines herself as a writer. She started writing poetry when she was seven years old. She is already working on novels three and four. “I’m hoping to do a body of work over the next 30 years. Hopefully you get a full chunk of decades to carve out your work.”

Maybe, she admits, there was a touch of the difficult second novel syndrome about The Sunlight Pilgrims. It wasn’t something she thought much about at first. There probably wasn’t time. After The Panopticon came out she started appearing on the front page of the New York Times and on the BBC’s News At Ten. She also had a baby – a boy – and there were bereavements and she was moving home and, basically, life was happening.

People did start saying to her, she says: “’You must be really nervous about your second one. People were so nice about the first one. They’re really going to pan your second one.’”

“I thought ‘Oh that’s really useful. Thank you so much.’ And then at some point I lost my way. I thought: ‘I have to go away and strip this completely back and work out what I want to do.’ So that’s what I did.”

It was worth the effort. The Sunlight Pilgrims is full of the music of life and language. She's achieved her long-term ambition to write a book that "sounded like a Sigur Ros album".

Fagan is not afraid of calling herself a literary novelist. But, if so, she’s one who is engaging with the world around her. This is a novel that, with its vision of climate crisis and mass migration, couldn’t feel more of the moment. “Nobody comes from where they come from,” Fagan points out. “Humans are migrants. We’ve always settled in different places.”

She is proof of that herself. She grew up in Edinburgh and has now just moved back to the city after living in Fife following years in London. Is the new home on high ground, by the way? “No. I did just move away from the coast though. I was literally on the beach for a year and a half.”

Of course, we might be in constant motion but we are always circling ourselves. That becomes clear when we start to talk about Stella, the novel’s transgender teenager. When Stella arrived in her head, Fagan worried if she had the right to write about a transgender character. “But part of the point of being a writer is you write the characters that come to you and I wasn’t going to turn Stella away because she wasn’t a cis-gender white girl with a mum and dad.

“Stella’s otherness – if you place it as otherness – makes absolute sense to me. I always felt other. I always felt like an outsider and that draws me to characters that I understand. I understand growing up in a way that is not ‘2.5 children’ and all those ordinary things. To me, someone who has to fight for their own identity makes sense to me. I’ve had to fight very hard for my own identity.”

I didn’t know, I tell her, that we all start as female in the womb. “We’ve got a good 10 weeks where we all start as female and there are so many examples of how close male-female can be or how dual male-female can be. People have told me I write like a man. What does that even mean? I’ve always been independent. When I go into houses I’d be the painter and decorator. I don’t live in a ‘help me’ kind of idea of female. I suppose most people don’t.”

This is, I guess, a question of nature versus nurture. And I guess it’s part of the reason why the media is so fascinated by Fagan's background in care. I am as guilty as the next interviewer. At one point in our conversation I ask her about role models. I say I grew up copying and reacting against my father. How did she go about working out who she was when her own situation was constantly changing? How, in other words, do you locate the you in you?

“You don’t always locate yourself would be the answer. But I know people who grew up in families who were not able to find role models in their own families and they had to seek them out in art of culture or the people they hung out with, some of them good, some of them not so good. I wasn’t any different from that.

But as she points out, the fact that she had to be resilient from an early age did not seem unusual to her. “My life was entirely normal to me.”

Well yes, I mumble. Stupid question. I am being confronted by the conventionality of my own “2.5 children” thinking here.

“It’s not a stupid question. If you come from a family you’re told that to become a decent human being you have to have a decent family.

“I know, actually, that’s not true. So when people who have come from a more conventional background in life ask ‘how are you OK?’ I think, ‘Well, why wouldn’t I be OK?’ It’s not that you have to be necessarily doomed because you were brought up in circumstances that you didn’t choose to be brought up in. And there are lots of interesting people who come from dreadful backgrounds and lots of interesting people who come from not-so-dreadful backgrounds.”

She understands why people want to know about her years in care but it bothers her. She tells me she has had to turn down interviews and get paid kill fees for articles from commissioners who didn’t get the child-in-care story they wanted from her. She doesn’t get asked the same questions in Italy or Germany, she points out. But in the UK we have a “Dickensian” outlook on these matters. Plus, she says, things have to be black and white here. “Assign a box to this and a box to that. If there’s an easy identifier they’ll say ‘this is our lesbian writer; this is our black writer; this is our girl from care’. I think it’s a way of underselling how many fascinating people we’ve got in this country. We should focus on that rather than trying to fit them into a social box.”

This is the thing she struggles with. Our – in this case meaning my – obsession with her past and what she came from rather than who she is now. And the preconceptions – prejudices, you might say – we as a society have about the care system.

“I believe in individuals and when I started The Panopticon it started as a question. Is it possible to achieve autonomy? So, if a whole demographic of society is saying you come from a system that means you’ll probably go on to some awful future is it possible to reclaim yourself from those presumptions? Is it possible for an individual to go on to become what they want rather than what is supposedly preordained for them?”

Was being a writer the thing she wanted to become then? “I have no idea why I started writing other than I was always attracted to anyone who could tell me a story. That was usually the older people because they had the time and the patience. Usually a neighbour or someone at school. And also I was essentially voiceless.

“So for me the experience of being able to put a word on the page and see it and it be a real tangible solid thing – being able to see my voice on the page and see that it was mine rather than the opinions of other people who all have ideas of what a child in care is was hugely compelling.”

We talk about her poetry for a moment. In her poems, I suggest, you’re very present. That is, you’re writing about yourself. “In poetry I rarely lie,” she agrees. “You have to start from a position of absolute truth. If a poem doesn’t have an innate emotional truth to it there’s no point to it whereas in a novel you get time to spend riffing on ideas and characters. It’s like sculpting a huge piece of stone. And it takes ages and ages. There’s a real instant fix to poetry for me. Poetry just arrives. I don’t pursue it. I don’t hassle it. I don’t mess with it. If it wants to turn up then it does. If it wants to take a year off, take a year off.”

We start to talk about witches. They keep popping up in her poems. That’s because, she says, she loves the history of the witch and the way exploring that history is a reminder of how society will always find scapegoats.

Well, indeed. Scotland, of course, was very good at accusing women of being witches. “Oh my goodness, we went all out. And I’m fascinated by how we inherit structures from religion, from patriarchy. All these things inform how we teach our children …” She pauses, retrenches. “I do quite like witches,” she concludes, smiling.

That must be the Goth girl in you, Jenni. She’s mock-offended. “I played in punk bands! I joined my first punk band when I was about 15.”

What were they called? “The Necromantics.

That sounds pretty Goth to me. “We played at 220 beats per minute and we never had a song longer than three minutes. We were definitely punk.”

It’s time for her photograph. We wander outside talking about books and the weather. The sun is still up. Winter is leaving, it would seem. Maybe the end of the world isn’t quite due. Not that it matters. Jenni Fagan has remade her own world.

The Sunlight Pilgrims is published by William Heinemann, priced £12.99. Her book of poems The Dead Queen of Bohemia is published by Polygon, priced £9.99.