Everything is connected: Brexit, Trump, le Pen, Isis – even Ghostbusters. They're all part of the same story.

It's been nearly a month since the Brexit vote and Remainers are still in a daze. Most struggle to articulate why it's so emotional, why we feel so bereft and angry. Surely this isn't all for the EU itself, an institution no-one showed any real love for in the years leading up to the referendum, or even now as we hope to get back in. Surely it's not because Britain faces a problem with trade deals?

The details seem so much smaller than the strength of feeling in the country. Why can't we just do what the Brexiters loudly insist, and accept it? Move on. Get with the programme.

It's because this was never about the EU. This was the culture war. It is the single greatest question of our lifetime, the one which defines this moment for the West: do we accept globalisation? Do we share goods and people and culture across the world, or do we retreat into our closed identities? Nativism versus globalism.

Hope Not Hate's post-referendum survey of Leave and Remain voters suggests something remarkable is happening to us. Brexit appears to be redefining the British public politically. Everything is on its head. All the people who were typically the most pessimistic and grumpy about Britain – the people who complained that the country had gone to the dogs – were suddenly the happiest. And those who were typically the most upbeat about modern Britain are now furious.

The report splits the UK population into six camps. On one extreme are the two groups most open to immigration and multiculturalism – the Confident Multiculturalists and Mainstream Liberals. On the other extreme, the two groups most hostile to these ideas are Active Enmity and Latent Hostiles. In the middle are Immigrant Ambivalence and Culturally Concerned. As the names imply, they're worried about rapid social change and services, but they're open to being convinced.

Since Hope Not Hate's February report, the number of English people identifying themselves as being in the two most pro-immigration tribes has risen from 32% to 38%. There's been a drop in support for the two most anti-immigration tribes, from 24% in February to 20% now.

There is a remarkable shift taking place on the losing and winning side, and a reaffirming of core beliefs. Ideas about multiculturalism and diversity which were once implied are becoming explicit – they're becoming ways that we self-identify. Amid all the anger at the Brexit vote, there is also a sense of a generation finding its political voice and its solidarity.

This correlates to the chaotic changes we've seen in the two main Westminster parties. Labour is in a state of absolute disarray, but the clash of personalities just reflects a deeper ideological malaise. Immigration is a wound at the heart of the party, preventing it from bringing together traditional support in its northern working class heartlands with middle class liberalism in London and the cities.

The Tories would be in precisely the same state right now if it weren't for one little rule, a very sensible rule which has saved them as a functioning party: the three month window between membership and voting for the leader. Without it, Ukip supporters would have flooded the party to back Andrea Leadsom (and with that knowledge, she may well have stayed on). They would have been practising entryism of an almost identical sort to Momentum in Labour. That would have forced the party to go through the same civil war on Ukip's nativist lines. And even now, with May installed as prime minister, the specifics of EU negotiations mean the party is likely to find itself torn between those who believe in global capitalism and the more patriarchal Little Englander Tories for whom cultural identity takes precedence over the economy.

Look overseas and see our own problems mirrored a thousand times over. Donald Trump is a walking Brexit. Where the phrase 'take back control' dominated the referendum, he promises a wall against Mexico and a ban on Muslims entering the US. But it's not just the policy – the emotions are identical too. Take Trump's promise to make Mexico pay for the wall. That's the real kicker in the policy. Crowds at his rallies love the way it implies strength, total dominance, superiority. It is identical to the swaggering ignorance of Brexiters talking about how the EU will accept whatever trade deal we give it, or how Brussels doesn't get to call the shots anymore. It's the emotional frustration of those who feel powerless, disguised with bravado.

In France, Marine le Pen stands waiting for the stars to align for her to make a credible attempt for power. The constant stream of terrorist atrocities hitting the country only makes it more likely, just as the horrific glimmer of race war in the US makes it more likely Trump could secure the White House. Across Europe – in Germany, Switzerland, Austria, Hungary and more – the same trend plays out: angry forces of cultural purity harking back to an age of simplicity and political control. They offer easy solutions for manageable worlds. Post-truth politics is not a driver of this trend, it is a result of it. You can't propose such childlike solutions if people really understood the problem.

What are groups like Isis, except for particularly grotesque, murderous variants on this same theme? The violent drive towards cultural purity, the retreat – in this case bloody and unimaginably cruel – into old identities, the rejection, above all else, of mixing. They are the equivalent to our National Front, or BNP, or EDL, or whatever form the far-right takes in this country when it marches through immigrant areas and demands they all go home.

There is a cultural battlefront to this struggle on the internet, even though it seems absurd and maybe even a little dodgy to compare them. But strip out the murderousness and the mllennialism and you find the same political instincts on display with the alt-right online.

Right-wing commentator Milo Yiannopoulos was recently barred from Twitter for whipping up a hate mob against Ghostbusters actor Leslie Jones. The film was attacked throughout its production by weirdly entitled men online, angry at the fact the reboot features female characters rather than male ones. Even as it opened, Jones, who is black, was targeted, by a barrage of orchestrated racist and sexual abuse.

Yiannopoulos would very often whip up these hateful pile-ons against people on Twitter – nearly always women. The site he writes for, Breibart, which – and this is not a coincidence – is a big supporter of Trump in the US – typifies one side of the culture war. When the latest Star Wars film came out over Christmas, it branded it an "extended propaganda promo for women in the military" and said John Boyega's character should have been called 'Token'.

It sounds absurdly trivial to bring this up in this context. But if you scratch below the surface of that type of commentary you find political instincts similar to the other, more serious, instances on this list. These are two fully fleshed out characters – one a woman, one a black man – fronting the biggest film of the year. That was considered frightening, something which had to be shot down, something to be criticised. Just six months later, that cause has morphed into organised hate mobs directed at Jones, who seems to have now quit Twitter, just like countless women and ethnic minorities have had to quit it before her, because of the tide of hate and physical intimidation directed their way.

Here again we see the fear of diversity, of mixing. They don't want ethnic minorities or women on TV, or reviewing video games, or being represented in any way in the mainstream, which should in their view stay as white as it was in the 1960s. Anything else is 'tokenism' and anyone that supports it a 'social justice warrior'.

Of course, voting Brexit is not the same as abusing people online. And abusing people online is not the same as being a terrorist. But all these trends are products of the same fundamental political conflict.

Many on the left have, depressingly, adopted a similar posture. The fight against 'cultural appropriation', which reached a lunatic peak with the kickback against Justin Bieber getting dreadlocks, is made from the same stuff: a desire to retreat away from cultural sharing to a less complex innate identity, this time on race. The demands for racialised 'safe spaces' on campus imagine that there is a fundamental moral and empathetic barrier between people of different races which we will never be able to dismantle, no matter how good our intentions.

The mainstream political articulation of this trend on the left comes from the SNP, who transcribe the same phenomenon to national identity. Their progressive programme involves more borders, more division, more retreat. They play the same game.

Everywhere you look – the secular and the religious, the right and the left – are demanding their little cul-de-sacs of identity. They want them secured by putting up barriers to immigration, or by social rules against cultural mixture, or by Twitter hate mobs, or by the knife and the bomb. But these are all echoes of the same thing: the nativist dread of globalisation.

It's been a month since the referendum and we're still depressed because we know that the campaign we lost was about much more than the EU. It was about what kind of a country this is and what kind of role it has in the world. But the Brexiters demanding people quieten down and accept the result are being very naive if they think it's over. They won a battle, not the war.

We're witnessing a realignment of British political life along culture war lines. Brexit wasn't the end. It is the furnace in which the new politics will be made.

Ian Dunt is the editor of Politics.co.uk

The opinions in politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners