Joshua Wong was 17 when he was first arrested for his political views. But by then he had been taking part in pro-democracy protests for more than three years. In 2011, aged 14, he founded a student activist group in Hong Kong to campaign against the government's introduction of a compulsory school curriculum that was favourable to the Communist Party of China: the new curriculum ignored events such as the 1989 Tiananmen Square protests in Beijing, in which several hundred students were shot and killed, and was critical of democracy.
In 2012, Wong organised large-scale demonstrations: a handful of students went on hunger strike and tens of thousands of people flooded the plazas outside Hong Kong's government headquarters. By 2014 - the year of his first arrest - Wong was a leading figure in the so-called Umbrella Revolution, a series of protests that swept across Hong Kong after China announced it would be screening candidates in the territory's own coming elections. Now 20, Wong is the secretary general of Demosisto, a pro-democracy political party he co-founded last year.
The problem is in the heart of the most mature democracies in the West - Joan Hoey, Economist Intelligence Unit
Wong is championed by democratic countries in the West. Time magazine nominated him for Person of the Year in 2014 and Fortune named him one of their "world's greatest leaders" in 2015. But as Wong - and others like him - fight for democracy, many countries that applaud his activism appear to be letting it slip. By more than one measure, democracy around the world is declining.
Trust in political institutions - including the electoral process itself – are at an all-time low. New converts to democracy in Europe and the Middle East are sliding back into authoritarian rule. And populist leaders who are expected to curb certain civil liberties are winning votes. Societies the world over are experiencing a strong backlash to a system of government that has largely been the hallmark of developed nations for generations.
"A lot of focus gets put on places like Russia, the Middle East or China," says Joan Hoey at the Economist Intelligence Unit (EIU) in London. "But the problem is here, in the heart of the most mature democracies in the West."
Hoey's stark assessment is shared by many others. Western states are worrying about the health of democracy for the first time since perhaps the end of World War Two, says Larry Diamond, a political sociologist at Stanford University in California and senior fellow at the Hoover Institution, a think tank that 'promotes political and economic freedom'. "We've not seen anything like this in decades, and we don't know where it's heading," he says. "We don't know how serious it is."
Diamond has been watching democracy around the world go through what he calls "a mild but protracted recession" for about a decade. Parts of the world new to the democratic system - such as former Soviet countries in Eastern Europe or states working through the aftermath of the Arab Spring - are slowly slipping back into authoritarianism.
We've not seen anything like this in decades, and we don't know where it's heading. We don't know how serious it is
But last year, everything changed. Democracy is now in trouble in some of the most mature democracies in the world, he says. "We can now talk of a crisis."
In fact, the decline of democracy has been measured. Every year since 2006, Hoey and her colleagues at the EIU have produced a report called the Democracy Index, which provides a comprehensive ranking of nearly every country in the world on a 10-point scale. It combines regional data and multiple surveys conducted in 167 countries to measure the quality of political processes, civil liberties, the functioning of government, public participation and political culture. Each country is then classed as a full democracy, flawed democracy, hybrid regime or authoritarian regime.
The results of last year's report are sobering. Overall, the global average score fell with 72 countries dropping in the ranking compared to 2015, and just 38 moving up. The number of "full democracies" dropped from 20 to 19, with the US now classed as "flawed". According to the EIU's measure, around half the world's population (49.3%) live in a democracy of some kind. But only 4.5% of people live in a "full democracy" – half as many as in 2015.
And the EIU's measure is not the only one that suggests a rapid, fundamental shift in global politics. Andrew Reynolds, a political scientist at the University of North Carolina and founder of the Electoral Integrity Project, which assesses the quality of democracies around the world, has argued that the US state of North Carolina should no longer be considered a democracy after it brought in voting restrictions that reportedly disenfranchised black voters.
So, what's going on? What's behind the erosion of a political system that's guided the world's most developed economies for decades?
A common explanation is that the world is still reacting to the global financial crisis and the austerity policies that followed. This had a major corrosive effect on democracy, changing the way people viewed their political leaders. According to this view, the effect will be short-term - when economies start to pick up again, politics will return to normal. But what we're seeing is not a temporary blip, says Hoey.
Take the US. Its relegation to "flawed democracy" in the EIU's ratings is not because of the 2016 presidential election. "The US has been teetering on the brink for many years," says Hoey. "Donald Trump is a beneficiary of a deep-seated and long-standing problem."
The level of public trust in democratic institutions in the US has been plummeting for decades. According to a survey carried out in 2015 by the Pew Research Center, a nonpartisan organisation in Washington DC that investigates demographic trends, only 19% of people trust the government to do the right thing "always or most of the time". In 1958, when the American National Election Study asked the same question, 73% of people did.
Some may argue that this is because governments no longer feel like they are "of the people, by the people, for the people", as Abraham Lincoln put it in his Gettysburg Address. Over the last half century, the business of governing has arguably become more technocratic, with positions of power populated by larger numbers of professional politicians and policy wonks. Many long-established political parties once had closer ties with specific groups of people. Left-wing or social democratic parties in particular were set up to represent the will of the working class. Those ties have stretched to breaking point, however.
More generally, old divisions between left and right that once gave voters clear alternatives have fallen, especially since the 1990s and the end of the Cold War. Parties that represented two competing visions of how society should be run throughout the 20th Century have suffered a body blow, says Hoey. As parties on both sides moved to the centre, the gulf between political elites and the electorate opened up even more. "Politics is no longer about the big questions and big issues," says Hoey. "It has become soulless."
Cue populists like Donald Trump and Nigel Farage, the former leader of UK party Ukip. Such politicians have been able to win support by talking about issues that established parties have been unwilling to address candidly. Ukip wields no hard political power - its only elected member of Parliament defected last week - but its outspoken views on immigration and criticism of EU technocrats shaped the Brexit debate. Similarly, Trump also crafted his campaign around immigration and a pledge to "drain the swamp" of political elites that no longer shared the values of millions of voters.
Many are suddenly talking about the need to defend democracy. 'But defend democracy against what? Against the people?'
The resulting political shocks were a wake-up call, says Hoey. But in failing to talk about the things that mattered to people, the mainstream parties had it coming. People want their voices heard and when they had an opportunity to make a difference with a direct vote - one that promised to make a bigger difference than the usual box-ticking every four years – they grabbed it. "The chickens have come home to roost," she says.
As a result of the populist backlash, political elites - which includes many in the media - are suddenly talking about the need to defend democracy. "But defend democracy against what? Against the people?" asks Hoey. By getting the public involved in the biggest political debate in decades, Brexit was phenomenal, she says. "People who hadn't voted for years came out."
Yet many still identify the populist backlash itself as the problem, rather than an expression of a deeper issue. Brexit and Trump voters are stigmatised for being bigots - "deplorables" - or for being misled by misinformation or lying politicians. But to dismiss millions of people like that will get us nowhere, says Hoey.
"Our political parties have run away from talking about the issues that matter to people," she says. "If you're not asking the really big questions about what kind of society you want to live in, what's left?" If people care about something, it needs to be discussed - no matter how difficult a topic.
"You need to have clashes of opinion," she argues. "If you want to revise democracy that's the only way to do it. There are no other fixes."
For Hoey, Brexit and the election of Trump are electoral shocks that could be good for democracy in the long-run. "All these years, nobody's really cared about democracy," she says. "Suddenly everyone's talking about it and that's great." But Diamond sees a darker side. "Many deep thinkers about politics, from Plato to the authors of the US constitution, have worried about the vulnerability of pure democracy to the tyranny of the majority."
Future Now asked 50 experts - scientists, technologists, business leaders and entrepreneurs - to name what they saw as the most important issues of the 21st Century.
Inspired by these responses, we're publishing a series of feature articles and videos that take an in-depth look at the biggest challenges we face today.
The reason that many countries have representative democracies - in which people elect representatives to make decisions on their behalf - or other structures, such as second chambers of government, is that the will of the people needs to be balanced with things like equality and civil liberty. Some states have constitutions that set out their citizens' incontrovertible rights explicitly. Most have independent judicial systems. "You need brakes, like in a car," says Diamond. "If all you have is the accelerator pedal it's not a very safe vehicle."
Many deep thinkers about politics have worried about the vulnerability of pure democracy to the tyranny of the majority
The danger inherent in the democratic process is that a leader can be elected who removes those brakes. When people feel threatened, either physically - by terrorism, say - or economically, they tend to be more receptive to authoritarian populist appeals and more willing to give up certain freedoms.
Trump has support for banning immigration from certain Muslim-majority countries, for example. And last year, the UK government was able to pass the most sweeping internet-surveillance legislation of any democracy. "In the US and most of Western Europe, the checks and balances are very likely to be strong enough to prevent severe damage to democratic freedoms and constitutional safeguards," says Diamond. "But 'very likely' is not 'certain'."
Diamond is struck by how quickly democratic processes and institutions are being dismantled in European countries like Hungary and Poland - states that have long been absorbed into the European Union. "Maybe we are going to have some shocking lessons about the durability of democracy," he says.
Diamond agrees with Hoey about the underlying causes of the populist surge across the West. "When people are saying they can't stomach any more immigration, when they don't know if they're going to be able to retire or what kind of jobs their kids are going to get, the political elite needs to listen and adapt or things are going to unravel," he says.
But simply talking about these issues may not be enough. To compete with more authoritarian rivals, Diamond thinks mainstream politicians will need to concede ground, stepping back from liberal social and economic policies - on equality, immigration or global trade - that have been advanced in recent years. For example, Geert Wilders' nationalist party in the Netherlands did worse than expected in this month's elections. This was because the Dutch prime minister saw what was happening and made some significant policy adjustments, says Diamond.
Despite being on the back foot, many people believe democracy is the best system of government humans have come up with, an end point to political evolution. In non-democratic countries around the world - in parts of Asia, in sub-Saharan Africa - survey data shows that people want it. As China has become richer and its economy more modern, you can see a growing aspiration for democracy from the middle classes, says Hoey. "It's human nature to want to be free."
The political elite needs to listen and adapt or things are going to unravel
Which is why people like Joshua Wong devote themselves to fighting for it. Feelings are strong on both sides, however. When Wong travelled to Taiwan in January, he was met by around 200 pro-China protestors at the airport. One broke through police lines and tried to punch him. Wong ended up being placed under police protection for his visit. Is democracy really the only morally legitimate system for choosing a society's leaders?
"I don't see any stable authoritarian states out there," says Diamond. He believes governments in places like China, Russia and Iran will eventually collapse. "The only well-functioning authoritarian regime in the world is Singapore and I'm not sure even that is going to last," he says. "In any case, you can't build a theory on a city state of just a few million people."
Not everyone thinks things are so clear cut, however. Daniel Bell at Tsinghua University in Beijing argues that a lot of Western ideas about democracy verge on dogma. A Canadian political scientist trained in the UK, Bell has spent many years living and working in China. "In the West we tend to divide the world into good democratic regimes that set the path for all the others, and bad authoritarian regimes that are on the wrong side of history," he says.
Bell points out that non-democratic states can take many forms. There are family-run dictatorships like in North Korea, military dictatorships like in Egypt, monarchies like in Saudi Arabia. Each is quite different. And some, like China's meritocratic system - in which government officials are not elected by the public, but appointed and promoted according to their competence and performance - should not be dismissed outright. "To put them all in the same camp is ridiculous," says Bell. "It's not a good way of trying to understand what's going on in China."
The Communist Party of China has 88 million members. Its membership is managed by the Department of Organisation, which is essentially a huge human resources department. To be a member of the party, candidates must pass a set of examinations. Government officials are thus selected from across the country and from various sectors of society according to merit. Promotion from low-ranking official to the very top of government is then - in principle - simply a matter of performance.
One obvious issue is a lack of transparency in how merit is measured. At the lower levels of government, the system is becoming more open to public scrutiny. Some Chinese cities are now experimenting with putting budgets online and allowing people to comment on the budgets, which lets citizens see how their local officials are performing. But how the party selects its top-tier leaders is not generally known, says Bell. "If they were a bit more open, it would help to legitimise the system abroad."
If [China] say they're going to do something by 2030, we can be pretty sure they're going to do it
The biggest challenge to Chinese politics is corruption. A democratic system can live with corruption because corrupt leaders can be voted out of power, at least in theory. But in a meritocratic system, corruption is an existential threat. If political leaders are seen to be corrupt, they cannot claim superior merit and thus lose the one quality that justifies their position. Because of this, China needs more mechanisms to keep its politicians accountable. Chinese officials have studied the British civil service to learn how to deal with corruption, for example. "Elections are a safety valve that isn't available in China," says Bell. "But they know this. It's why they're having the longest and most systematic anti-corruption drive in recent history."
There are obvious flaws in China's system, says Bell. But he also ticks off several advantages. Political officials at the top all have substantial experience at running a country - "unlike in the US with the current president". The government is also not subject to the electoral cycle and can focus on its policies. "If they say they're going to do something by 2030, we can be pretty sure they're going to do it," he says.
This has allowed China to pull millions out of poverty in just a few decades, build a vast amount of new infrastructure in the biggest construction drive the world has ever seen, and begin to tackle its substantial urban pollution and greenhouse emissions. Officials used to be judged mainly on how well they did at reducing poverty, says Bell. Now they are expected to make environmental improvements too.
The West has tried to export democracy not only at the point of a gun, but also by imposing legislation
Bell says lots of surveys show that the Chinese system has strong support within the country at most levels of society, where the government is viewed as providing a form of guardianship. He agrees with Hoey that as China gets richer and its middle class grows, more people will want to have a say in how the country is run. But that need not necessarily mean a call for democracy. Instead, perhaps more people will sign up to join the ruling party. Everybody now has equal rights to take the examinations that put you on the road to becoming a public official, he says. "There are different ways of participating in politics."
Whatever happens, democracy is much more likely to flourish when it is homegrown. The attempts in the last few decades to export democracy around the world have proved to be an absolute disaster, says Hoey. "The whole idea is wrong in principle because democracy is not ours to dispense," she says. "It has to come from the people to have any meaning. It needs to have roots deep in the values and culture of the country."
Yet the West has tried to export democracy not only at the point of a gun - such as in the many military interventions in the Middle East - but also by imposing legislation. The EU pushes its Western values and body of laws on new members, for example. This can be quite intrusive, says Hoey. As a result, rather than being seen as a universal human aspiration, democracy can sometimes come across as a specifically Western product - and rejected as such.
With the political climate around the world shifting and many countries adopting a more nationalist outlook, the US and Western Europe have abandoned most of their ambitions for regime change around the world. But looking inwards may be no bad thing. "If the West wants to promote democracy then they should do it by example," says Hoey.
If you liked this story, sign up for the weekly bbc.com features newsletter, called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital, and Travel, delivered to your inbox every Friday.