On a summer night in January, Sofia's family took her to a restaurant in Iraja, a suburb of Rio, where she could use the play area outdoors. It had a big, colourful slide, where children could climb up some stairs and come out through a tunnel to the ground.
From inside the restaurant, Sofia's parents watched their two-year-old daughter. The play area was protected from the street by a gate so, in a city with shocking levels of crime, families felt the children were relatively safe there.
Being safe in Rio is always a top concern. Iraja, a busy middle and lower middle-class neighbourhood of around 100,000 people in northern Rio, is surrounded by some of the city's most violent areas, and criminals are quite active there.
Like on that Saturday night. Police were sent to the streets next to the restaurant to investigate a car robbery, something frequent in that area: an average of four cars a day were robbed there in 2016.
Police officers had set up a barricade after identifying a suspect, but the man did not obey calls to stop and, according to reports, tried to escape.
A chase began.
Sofia's father, Felipe Amaral Fernandes, said she was especially happy on that night. "She had told my wife: 'Mummy, I'm very happy today'. She didn't even want to eat."
Herica, the mother, was proud of her daughter, who could already count from one to 10 in English. Sofia also enjoyed dancing to music clips in front of the television, and was in love with the pink, purple and blue scooter "Papai Noel", or Santa Claus, had given her last Christmas.
"She was smart, intense. Sometimes she didn't even want to sleep because she only wanted to enjoy herself," Ms Fernandes said. One time, she said, Sofia was asked about what she loved the most in her life. Sofia replied: "Enjoy myself".
Sofia was playing on the slide when the police chase neared the restaurant. At around 22:00, a shooting started.
The sound of gunfire was loud and close, and the families who were in the restaurant went to the play area to pick up their children. Sofia's parents, now also outside, waited for her to come through the slide. "I screamed 'Sofia, Sofia!'," Ms Fernandes said. But her daughter did not answer.
Sofia's father looked inside the tunnel, but she was not there. He went to the other side of the slide, and climbed it. "That's when I saw my daughter up there, motionless, bloodied. I broke into the toy, took her from there and ran."
Sofia had been shot in the face.
"I got desperate seeing my little daughter there. I felt impotent," said Mr Fernandes, a police officer. "I'm used to violence around me but I never thought this was going to happen to my daughter. When it happened I thought: 'My goodness, not with me'."
He carried Sofia in his arms. People in the restaurant stopped a police car that was passing nearby, and it took father and daughter to the hospital. The crowd watched in disbelief.
Shootouts are part of life in Rio.
Despite Brazil's tight gun laws, rights groups say millions of weapons are in the hands of criminals. Tougher regulations were approved in 2004, banning the carrying of guns in public and controlling illegal ownership. But activists say they are incapable of curbing illegal gun trade and that bandits have been largely unaffected.
The reasons for shootouts vary. Some are the result of clashes between rival criminals; others, of armed robberies, like the one in Iraja. But rights advocates say they mainly occur during police operations against heavily armed drug gangs in impoverished neighbourhoods, where some groups are the de-facto rulers.
And civilians often find themselves in the crossfire. "These police operations are badly planned. In many times they happen at daylight, in densely populated areas, with war weaponry being used," said Antonio Carlos Costa, president of Rio de Paz, or Rio of peace, a local human rights group.
Last year, researcher Cecilia Oliveira, who works with rights group Amnesty International, was looking for reliable data about shootouts in Rio. But numbers were hard to come by as there were no official statistics.
So last July, she helped create Fogo Cruzado, Portuguese for "crossfire", an app for people to report gunfire in their neighbourhoods. Between its launch and January this year, according to Amnesty, 50,000 people downloaded it.
The numbers gave a sense of the fear that millions of people live in: there were 2,517 notifications, an average of almost 14 a day. The reports included 539 deaths and 570 injured.
Most alerts came from poor neighbourhoods and shantytowns, or favelas, places notorious for their violence. "I was shocked by the numbers. This level of violence is alarming for a city that is not in a war zone. And civilians are the most affected, their freedom and human rights are systematically violated," Ms Oliveira said.
She too blamed poor police operations against criminals for most of the shootouts. Interestingly, the data showed that the hardest-hit areas shared a common profile, she said. "It's very clear that the people being affected by this violence are young and black. You don't see this type of police operation in neighbourhoods that are not favelas."
Rio's military police rejected the criticism towards its operations, saying they are all "meticulously planned" to avoid casualties among civilians.
"In order to prevent criminal actions, systematic operations are needed in places where the criminal wave is more recurrent. And shootings against policemen when they enter these areas, in many cases, result in victims on both sides," they said in a statement to the BBC.
Lives are often put on hold, as basic services such as electricity, water and transport are frequently interrupted by shootings.
Rio's train operator said last year it was planning to stop services on one line indefinitely because of gun violence next to the tracks.
Shops and hospitals are also forced to shut. In 2011, a suspected drug trafficker who was exchanging fire with police stormed a public health clinic in an attempt to hide himself, terrifying patients inside - he was later arrested and nobody was hurt. The clinic then temporarily suspended works due to insecurity.
Schools and universities in dangerous neighbourhoods have often cancelled classes, sometimes for days, affecting thousands of students. In some areas, teachers and children were being taught at school how to look for cover in the case of gun fights.
Two years ago, shootings around some schools in Mare, one of Rio's most violent areas, were so frequent that teachers decided to cut the classes short: they would start later, at 08:00, and finish one hour earlier, at 15:30. That, they said, was because shootouts often occurred at 07:00, when police officers changed shifts.
"Civilians in Rio's favelas end up in the crossfire, being victims in their own houses. They are forced to live under these circumstances, which is absurd," said Ivan Marques, executive director of human rights group Instituto Sou da Paz.
"The anti-drug policy in Brazil chose this wrong option, of militarising the issue. You have an enemy, not a criminal. And this is the collateral effect of this war between police and the organised crime."
And then there are the stray bullets.
In 2003, Luciana Novaes was in the canteen at her university in a neighbourhood in northern Rio next to a favela, when a shootout erupted between drug traffickers and police. Shops nearby had closed because of the violence, but the university had not.
It was around 09:00. Ms Novaes, who was 19 at the time, was in a break between exams when a stray bullet hit her in the jaw. She said she could not miss the exam because of the scholarship she had from the university.
The bullet went on to injure her vertebrae, leaving her quadriplegic. "It's a very difficult situation. There is no day, no time, no place. I was inside the university when it happened. People usually avoid getting out at night, but it's risky at anytime," Ms Novaes said.
She spent a year and a half in the intensive care unit of a hospital, where doctors had put her chance of recovery at 1%. If Ms Novaes managed to survive, they said, she would be in a vegetative state for the rest of her life.
That did not quite happen. She slowly recovered her speech and the ability to eat. She is still dependent on mechanical ventilation and on two nurses, day and night. She also undergoes two physiotherapy sessions every day and two speech therapies a week - the university was forced by the Brazilian justice system to pay for her treatment.
And last year, at 33, she was elected the first ever paraplegic councilwoman for Rio - it was such a novelty that the historic building had to be adapted to her needs.
"What we're living in is calamity," Ms Novaes said. "People are crying out for help."
Hers is a remarkable case of overcoming the odds, but it is an exception. Brazil was the country with the largest number of deaths by stray bullets in Latin America and the Caribbean between 2014 and 2015, according to a United Nations report.
The study, which looked into online media reports, said there were 197 incidents, 98 dead and 115 injured - someone is considered a victim when they had no involvement or influence in the shooting.
Nothing new to the people of Rio. In the 1990s, incidents with stray bullets were so frequent that then-Mayor Cezar Maia famously said in a newspaper interview that the city had become a "tropical Bosnia".
Rio's geography, as Ms Novaes' case shows, is an unexpected contributing factor. Numerous favelas have been built on the hills that overlook the city, meaning that the violence up there, where many of the shootings take place, is felt by those sometimes in neighbourhoods metres away.
The most recent official statistics about stray bullets publicly available are from 2011, when five people died and 41 others were injured. But Rio de Paz, the NGO, has documented incidents involving children: in the past ten years, 31 died in the city, 18 of them between 2015 and 2017 alone.
"The shootings have a devastating impact. This is a generation that lives under threat, under fear of seeing themselves in the crossfire," Mr Costa, from Rio de Paz, said.
"And this tragedy has colour and a social component: it often affects the poorest. The society ignores it because it happens, by and large, away from the richest regions."
Sofia arrived at the hospital already dead.
The senselessness of her death caused an outcry even in Rio, where residents have become so used to crime that they rarely react to violence.
"But this is not an isolated case," said Mr Costa. "We live in an environment of fear. Families live in constant mourning, looking at the picture of the victim hanging on the wall, with the face of a child that will never be seen again."
His group organised a demonstration remembering the victims of stray bullets, and signs with the names of the 31 children killed were put on Copacabana beach in January.
The car being chased by police that night in Iraja stopped only when it flipped on the street. The suspect was arrested and officials seized a gun.
Police said they were investigating how the shootout unfolded and, almost two months on, it was still unclear where the shot that killed Sofia came from.
But activists say many cases end up unsolved, with those responsible for the deaths rarely identified or punished.
Sofia's parents are now trying to resume their lives. "We live surrounded by violence. We see it in newspapers, on television. It's a calamity," her father said.
"We don't want this to happen with anyone else, a child or an adult."
"But we're sure that our daughter is in a place better than ours. She was too good to be in this world."
All pictures copyrighted.