Actress Krysten Ritter, who plays the title role in Marvel’s Jessica Jones, makes her fiction debut with Bonfire (Crown Archetype, Nov.), a dark legal thriller in which Chicago attorney Abby Williams returns home to Barrens, Ind., to investigate the small town’s largest company.

What do you have in common with Bonfire’s lead?

I think many of us can relate to Abby’s situation. Going home is hard and oddly claustrophobic. Like Abby, I’ve also left a tiny town for a big city to chase dreams and my independence. I felt like I didn’t belong, and I felt out of place. At times, I felt alone, and I wasn’t encouraged. I think we share a strength, and maybe even a loner quality. But Abby explores a darker corner of my brain. I do not live in that darkness day to day. But that’s what the art of writing is for.

Was there anything about your high school experience that you used in the book?

There’s nothing literal in the book that’s based on my own high school experiences. I sometimes felt like an outcast—we all know how teenage girls can be—but this book is fiction. I took inspiration from what girls are going through now with social media. I have a young sister, so I got to absorb and see things through her lens a little bit. I have strong feelings about girls and how they are treated, and how those things mold them.

Were you able to make use of your acting experience?

As far as the investigating Abby does, I’ve had a pretty great crash course in that exact thing, because I play a private investigator on television. It’s always interesting to me to see how a character can get information in new and clever ways—without just asking. Watching the writers craft Jessica’s scenes, seeing what works and what doesn’t, has been a great learning experience for me.

What was writing a novel like for you?

It totally occupied every second of my mind. But that’s also why I loved it so much. It was a thrill. The process was one of the most exciting creative experiences of my life. I had to protect my time while working on it. My agents would want me to go to meetings and auditions, but I couldn’t shift out of that mode. I had a certain amount of time between seasons of Jessica Jones and The Defenders to write this book, and stay on the schedule that Crown had mapped out for me—and the schedule was intense and not at all flexible. In order to stay on track, I had to really hunker down.