MOSUL, Iraq (AP) — The three women tensed as their taxi approached the checkpoint manned by Islamic State group fighters. Everyone in Mosul dreaded checkpoints; you could never predict what these gunmen might do in their fanatic drive to crush the slightest hint of "sin." One of them peered at the girl in the back seat, Ferah.

The 14-year-old wore the required veil over her face, but she had forgotten to lower the flap that also hid her eyes. A fighter barked at her to close it. But Ferah was not wearing her gloves, which were also required. If she fixed her veil, they would see her bare hands, and things would only get worse.

Ferah studies for an exam in Irbil, Iraq, in this photo taken Nov. 11, 2017. (AP Photo/Felipe Dana)

She shrank in her seat, trying to disappear.

The gunmen exploded, screaming that they would take Ferah, her mom and her sister to the Hisba, the feared religious police who punished violators of IS's orders. They pulled the driver out and questioned him. How do you know these women?

Ferah felt the gunmen looming outside her window — frightening, huge and muscular, with beards down to their chests. Her mother went pale. A simple drive to a friend's house was spiraling into disaster.

And just as suddenly, it was over. Somehow, the driver talked the gunmen down.

Once safe at their friend's house, Ferah broke down. She wasn't just trembling, her entire body spasmed.

The Islamic State group turned the world outside into a horror, so Ferah created her own world, making her bedroom into a refuge where she wrote about her life. This is the story of how an Iraqi teen survived nearly 3 years under IS. (Dec. 4)

This was the new, nightmare world that the Iraqi teen had to live in.

Ferah had never even heard of the Islamic State before the militants took over. As the summer of 2014 began, her world had seemed wide open. She'd finished her first year at a new private school, the best in the city, which she'd loved. She'd made new friends. Her classes were in English, her favorite subject. She dreamed of one day becoming an interior designer.

But in June, IS militants overran Mosul. The city fell in a night of chaos.

Around midnight, the streets around Ferah's home lit up with headlights. Neighbors with suitcases piled into cars, soldiers threw bags into trucks, screeching away as artillery and gunfire echoed. Across the city, a panicked exodus erupted. Ferah's two eldest sisters, who were married and lived nearby, called to say they were fleeing to the nearby Kurdish zone. Her best friend from school messaged that her family was leaving to Turkey.

(AP Illustration/Peter Hamlin)

Ferah's family stayed.

The next morning, she woke up to a world ruled by the militants, sneeringly referred to by their Arabic acronym, Daesh.

As days turned to weeks and weeks to months, Ferah no longer wanted to go outside. It was too dangerous. She retreated into her bedroom, away from the horrors, from the stories of men being shot in public squares or women being stoned to death.

Her refuge would be in words. She put a candle into an old crystal, and by its faint glow, took out her IPad and wrote on her Facebook page. Just a few lines each day about a feeling or thought that had come to her, a fear or a hope.

She had no idea how long she would have to live like this, or whether she and her family would survive at all.

"What is the problem?" she asked in one of her imagined dialogues.

(AP Illustration/Peter Hamlin)

"The future is gone. It came crashing down."

"How can I understand your feelings?"

"Be among Daesh. ... Try being a dreamer while sitting among Daesh."

____

THE PLAGUE

Every day, there were more of the madmen. They were everywhere, with their long beards, their robes stopping above the ankle. They never smiled and seemed angry all the time.

When school started, it was under IS control too. Ferah's private school remained shut, so she went to a public one. She was certain some girls in her class were Daesh. Their faces hidden under veils, they hardly talked to others and when they did it was to harshly judge.

Ferah was afraid of them. She stopped going to school.

The son of her family's next-door neighbor emerged as an IS member. "How can you let him join them?" Ferah's mom asked his mother, who just shrugged. Soon the woman's husband too wore the militants' clothes. The whole family was Daesh. These were people Ferah's family had known for years; they visited each other's houses. Ferah's bedroom looked out on their home.

It was like a plague, spreading and transforming people.

Ferah says writing helped her endure during the rule of the Islamic State group over her home city of Mosul, giving her an outlet to explore her fears and hopes. (AP Photo/Felipe Dana)

One by one, Ferah's remaining friends said goodbye, packing up for Turkey or the Kurdish areas.

Relatives and family friends who stayed behind dropped by her house regularly and talked about the news. Ferah heard about the laws handed down. Daesh banned smoking. During Ramadan, they arrested people suspected of not fasting. Rule-breakers were flogged in public squares.

The atrocities began. Hundreds of Shiite prisoners in Mosul's main prison were killed. Policemen and soldiers were shot to death in the streets for all to see.

Ferah's father, a university professor, used an Arabic saying to explain that Daesh was exploiting religion: "Speaking righteousness while committing evil," he said. He and his wife had raised their four daughters to value education and faith. They were a religious Sunni Muslim family, and often prayed together. Ferah, her sisters and their mother wore headscarves, like almost all Muslim women in Mosul.

This was nothing like the Islam they knew.

Patrols by the Hisba religious police proliferated, enforcing ever-increasing regulations. Women were ordered to wear the niqab: the black robes, gloves and veil that hide any hint of their shapes and keep them sequestered from men's gaze even in public.

(AP Illustration/Peter Hamlin)

Ferah hated wearing the niqab. She hated Daesh.

And she hated her life.

On the morning of Oct. 16, 2014, she had breakfast as usual, helped her mother with housework, showered, did her noon prayers.

Then she went into her room, locked the door and cried.

Her friends were gone. Her two eldest sisters were gone. One was pregnant when she fled, and now Ferah had a newborn niece she'd only seen in photos. She was isolated and lonely, afraid of going outside.

Dinnertime came and she didn't emerge. Her parents became worried.

"You can get through this, Ferah," they told her through the door.

"I need to be alone," she sobbed back.

She wrote her thoughts in English on pieces of paper. Why is nothing going how I hoped? Why is this happening? She liked to write her deepest thoughts, ones she didn't want anyone to know, in English, not Arabic. She would then cut up the papers, just like she wished she could cut up her reality, and store the pieces in a box in her wardrobe.

But late in the night after hours sitting on her bed, she tried something different. She wrote in Arabic.

"Suddenly life robs you of what you love, as if it's punishing you for a crime that hasn't been committed yet," she wrote. "I'm afraid to care about the scattered remains of my soul, only to then lose it. Sometimes I'm afraid of happiness!"

She posted it on her Facebook page and felt, curiously, better— "like a light at the end of a mysterious path."

___

THE 7 HABITS OF HIGHLY EFFECTIVE TEENS

Ferah had never thought of herself as a writer. But she started a separate Facebook page and posted every few days. Soon she had hundreds of followers, then several thousand.

She created a new world in her bedroom. She cut butterflies out of blue and red and green paper and hung them around her mirror. Butterflies are shining, optimistic. She draped strings of white fairy lights from the ceiling. She taped English letters on the wall: "Be yourself."

And she lit her candle, to set the mood.

In her writing, she faced her greatest fear: Her life might never begin. Daesh might be here forever.

(AP Illustration/Peter Hamlin)

"When you close your eyes, you'll feel how horrible it is to have your hands chained and be unable to picture your future. You'll curl up on the ground crying."

She knew she was emotional. She might cry for hours or burst from her room shouting, "What am I doing here? Everyone abandoned me." Ferah's sister just shrugged off the stress or slept. But the slightest provocation set Ferah off.

Her mom worried. She found excuses to drift into Ferah's bedroom and check on her.

It was not easy to raise a teenager in a city run by fanatics. One wrong word could get you killed.

In the summer of 2015, news spread that a man was arrested after he pinpointed the house of Ferah's Daesh neighbors to the U.S.-led coalition. Ferah's family and others nearby decided to leave for a few days, convinced an airstrike was coming.

As they left, they saw the wife from the Daesh family, also fleeing.

Ferah flew into a rage. "Why are you leaving? Don't you want martyrdom?" she screamed. "Go back in your house and let them strike it. You'll go right to Paradise!"

Terrified, Ferah's mother pulled her daughter away.

The neighbor's house was never hit. The militants shot the alleged informant in the head in a public square, and the neighbor's husband proudly showed the video, boasting, "This is the one who tried to target us."

Soon after, on July 19, 2015, Ferah's 15th birthday rolled around. Her mother tried to organize a party, but Ferah put a stop to that. She didn't want to blow out candles and act like it was a happy birthday.

What was happy about it?

It wasn't just the fear. The boredom was crippling.

Month after month, Ferah and her sister rattled around the house, trying to fill the agonizingly slow hours.

Night brought the closest thing to freedom: the internet. During the day, the provider put limits on usage that made it hard to even watch a video. But after midnight, the megabytes were unlimited.

Across Mosul, society rolled up behind closed doors, living nocturnal, virtual lives, and sleeping late into the long day. Even Ferah's father was trapped. He had no job to go to because IS closed the universities. Also, his beard simply wouldn't grow. So going outside risked harassment by the Hisba, which demanded men wear beards in imitation of the Prophet Muhammad. He spent his days largely in his study, writing a book.

Ferah read. She downloaded Arabic translations of self-help books. "Succeed for Yourself: Unlock Your Potential for Success and Happiness", "You Will See It When You Believe It," ''The Power of Intention."

She liked "The 7 Habits of Highly Effective Teens" so much she read it twice. Habit #1: "Be proactive." That meant saying, "I am the force. I am the captain of my life. I can choose my attitude."

She turned to books on adolescence because she wanted to understand the developmental stage she was living through. She learned these were her formative years when her personality becomes defined.

Ferah realized: I can't go on like this. If I am depressed and terrified, that way of thinking will stay with me forever.

It was no use complaining, she told herself. She must use this time to achieve something that would stay with her. She would be a dreamer among Daesh, she would be the captain of her life.

This would be her project.

Her Facebook journal grew. Her followers, more than 6,000 now, praised her writing, strengthening her.

One evening she noticed a new follow from an Iraqi girl. Ferah messaged asking why she'd friended her. "Because I looked at your profile and saw you were a good person," the girl said.

This was Rania. She was from Mosul too, but her family had fled to Dahuk, in Kurdish territory. Ferah and Rania started chatting often, superficial things at first, then a friendship bloomed.

Still, all these steps seemed too small to keep out the reality of Daesh. "I know after all this time I was living in my dream world," Ferah wrote. "A single word can turn all the pain back toward me."

___

THE SCENT OF PARADISE

Nowhere in Mosul was there an escape from Daesh's terror.

Once, Ferah drove with her parents to make one of their occasional checks on the house of Ferah's eldest sister. They didn't dare stop the car, they just rolled by slowly. The house had been confiscated, and now pro-IS families lived there. Ferah watched them in their short robes and beards and veils going in and out as if the house was their own.

The streets were a danger.

The Hisba's prowling, obsessed eyes caught "errors" by women that the women themselves didn't realize. Outside Ferah's uncle's house, they dragged away a passing girl. Her robes had swished open, and they spotted something red underneath, a forbidden dash of color in what was supposed to be an all-black garb.

“No matter how hard you summon your strength ... you won’t be able to get over it. You’ll feel how horrible it is to have your hands chained and be unable to picture your future.” (AP Photo/Felipe Dana)

Ferah's own rooftop was a danger.

The roof was a place to catch a breeze on sweltering summer nights. But her family's house was exposed, clearly visible from three directions. Who knew what they might accuse you of doing if they saw you there?

In a nearby neighborhood, a young girl, around 12, had gone up on her roof. By coincidence, a boy next door was on his roof at the same time. They were seen. Suspicions were raised.

Daesh arrested them and killed them both. The girl was stoned to death on the street in front of her house, the punishment for adultery. Everyone in the neighborhood talked about it. They said when the stoning was over and the girl's body was taken away, there lingered the warm smell of musk, one of the aromas of Paradise, a sure sign that she was innocent and God had taken her in.

Definitely never go on the roof.

The only safe place was inside four walls.

"Isn't there a right to the freedom to dream, the freedom to have the best years of my life?" Ferah wrote. "I'd just like to know when I will really live."

___

HER LITTLE WORKS

Inside her room, Ferah went deeper in a world becoming ever more elaborate.

From Instagram and Tumblr, she printed photos of faces or fashion she liked and taped them above her bed. "Everything you imagine is real," read one poster. Another showed a girl wearing fairy wings. "What if I fall?" the picture asked — and then replied, "Oh, but my darling, what if you fly?"

Her paper cut-outs multiplied, not just butterflies but flowers, hearts, a nest of baby birds. She called them "her little works."

The light of her candle encouraged her. "Speak to me often," it said. "I am here to muse and ponder with you."

At night, she explored online. She discovered a whole microculture of interior design enthusiasts on YouTube. Her favorite: Anything IKEA. She practiced her English watching cartoons. She watched "White House Down" with Channing Tatum over and over until she understood almost all the dialogue.

Most wonderful was her friendship with Rania.

They had similar tastes. Rania sent a picture of herself, and her dress was just like something Ferah would wear. They decorated rooms together online, trading pictures of furniture.

Ferah had never seen Rania in person, yet their friendship grew deeper than any she'd had as a child. Maybe because it was born out of difficulty. At her worst moments, Ferah would hear the chime of a message from Rania, and she knew she just had to open it and she would laugh.

"I'm sad that one sky looks over both of us, yet we don't meet, that digital photos bring us together and yet we don't meet," Ferah wrote. Yet she thanked God: Breaking through the distance "is absolutely the most beautiful thing I have ever experienced."

At least within the world she created in her room she could find comfort and wander far online with her friends, her writings and her readers.

Then that too was gone.

On her 16th birthday, July 19, 2016, Daesh shut the internet down.

IS was sealing off Mosul's population. It feared spies guiding American airstrikes as Iraqi forces further south started their long march toward the city, aiming to take back Daesh's greatest stronghold.

Ferah was alone.

She began to sew, taking lessons from a family friend. She loved it. She worked at the machine sometimes until 3 a.m. and eventually made nearly 20 outfits, giving some away as gifts.

And she wrote — for herself now not her followers. She composed long ruminations, challenging herself and facing her doubts.

As months passed, she found that her little works — her crafts, her clothes, her writings — were her secret successes. They had given her confidence to stand on her own.

"No one can stop you when trust in what's inside you, when survival is in your heart even as your body is drowning, when light is inside you even as darkness is around you," she wrote. "I'll ... force my reality to submit to my desires and reach my goals. Even when difficulties grow, I will not break. Go on, war, get worse."

There was just one person outside she yearned for. For Rania's birthday, she wrote her a message.

"I'm building an eternal place for you within me," she told her. "Whenever I think I'll declare my surrender, you pass by and I become certain that, with you there, I can never surrender ... Thank you for your heart, my friend, my flower, my galaxy, my butterfly. I love you very, very much."

On the top floor of her house, she could get a faint signal on her SIM card. She stood in just the right place, held her phone up and, hitting send, prayed her message, byte by byte, would make its way to the friend she had never met.

___

ASHES

In January 2017, Daesh burst into Ferah's world.

Iraqi forces battled their way into eastern Mosul in tough urban warfare. The militants took over homes, dug in to fight and bloody the advancing forces, then fell back to the next neighborhood. The city shook with gunfire, car bombs and airstrikes.

One evening, there came a banging at the front gate. They didn't answer; they were inside praying. So the Daesh gunmen shot through the gate.

"Everyone out, the gunmen ordered. They wanted the house; the roof would give their snipers good views. Ferah was outraged seeing these boys with guns, no older than 17 and clearly from villages outside Mosul, shouting at her father, a respectable man in his 50s. Even in this critical moment before battle, they berated him for not growing his beard.

Ferah's family took refuge with a neighbor. Huddling in a single room, they could hear the fighters next door, clunking up and down stairs. They waited hours for the storm of battle to descend.

Just before dawn, it struck. The rocket fire burst, the guns hammered. The "wzzzzzzzzzzz!" that always preceded an airstrike grew closer and closer.

Then a giant blast. The room went black. Part of the ceiling collapsed. They struggled to breathe, and the neighbor's young children screamed in the darkness. Ferah and her sister screamed too.. Ferah's father was silent, stunned.

As suddenly as the storm came, it moved on. Daesh retreated, and troops from the Iraqi 8th Army were fanning out in the streets around Ferah's home. After nearly three years, their neighborhood was out of the fanatics' control and in government hands.

(AP Illustration/Peter Hamlin)

Ferah, her parents and sister emerged from their refuge, unsure of what was happening.

"The family of the burning house is coming out. Don't shoot them," an army officer said into his walkie-talkie.

Ferah stood in front of her home. Flames gushed from its windows in shapes she could hardly bear to look at. The flames were in her room.

The Daesh fighters had set off explosives in the kitchen before fleeing.

When the fire died down, the family went in. Ferah's room had melted. The walls were black, the paint peeled back in painful, obscene shreds. The ceiling had fallen onto her bed.

Her little works were ash — the butterflies, the lights, the paper hearts and birds, the clothes, even the box in her wardrobe filled with cut-up papers bearing her deepest thoughts in English.

"I saw my dreams ... as they turned to nothing," she wrote. "My trust in tomorrow slipped away ... My heart has burned up."

___

EPILOGUE

But it was not the end.

After the fire, her family stayed with Ferah's eldest sister in Irbil. From there, her father oversaw the rebuilding of their home. Ferah took a high school refresher course and passed. When classes finally resumed, she would be only a grade behind.

They visited Ferah's sister, in Dahuk, and met her daughter, now nearly 3.

One morning, Ferah dropped by a school in Dahuk and found a group of schoolgirls gathered in the halls before class. She looked for one in particular.

Rania didn't realize it was her until Ferah stood right in front of her.

"For real? You came?" Rania cried.

"This is the Ferah you've been talking to all these years!" the other girls laughed.

The two girls held each other for 10 long minutes. Rania showed Ferah her phone: She'd kept screenshots of their best chats. Among them was Ferah's birthday message that had found its way to her.

Back home in Mosul now, Ferah's room is repainted, but it's not the sanctuary it once was. Her mother hauled out of storage an old bedroom set from her childhood that Ferah hates. She misses her butterflies, but she won't put any up until she buys new furniture, hopefully from IKEA.

Nothing is normal. But she has her freedom. She is still a dreamer, but not among Daesh.

Sometimes, she looks back at one of her favorite texts. A love song to herself. She wrote it amid her hopelessness, praising the good she discovered in herself.

"Good morning to everyone who feels the beauty within — no matter who it angers," she reads to herself. "Glory to the fading light of endings and the burst of new beginnings. Everything else won't last long."

__

Ferah and her family spoke to The Associated Press on condition that their full names not be used and that some identifying details not be mentioned out of fear for their safety in Mosul. Keath reported from Cairo.