Britain is now borderline crazy. So is America and parts of Europe. We have all become obsessed with the boundaries between one nation and another. And yet on both sides of the Atlantic much of the debate on everything from Brexit to Scottish independence still relies on an old image of frontier that is long gone: of customs posts, of passport checks, of uniformed men raising traffic gates to let motorists pass.

Take the current debate on how to control immigration. For Donald Trump in the United States this means building a wall with Mexico. For anti-EU campaigners in the UK the involves "taking back control of our borders". Yet Britain does not even monitor the exit of foreign nationals across its border, which rather than a line in the sand is now essentially a series of airport and ferry queues. And America's giant frontier with Canada is often unpoliced.

That is because immigration is so heavily regulated "in-country". Landlords and employers and public services are the real secret to ensuring newcomers obey migration rules - whatever they are.

Read more: Beyond Brexit - Scotland could be given a special status on immigration

Cue fresh thinking on whether Scotland - despite not having a hard border with England - could pursue a separate migration policy from the rest of the UK. Perhaps, even without independence, it could somehow retain at least one of the EU rights, freedom of movement, which Scots voted to keep back in June? Or, even if Brexit brought an end to free movement could Scotland and, say, Northern Ireland adopt different entrance criteria to England and Wales?

Policy wonks calls this a "differentiated migration policy". And it is not new. Under the old Labour-Liberal Democrat administration Scotland had its own "Fresh Talent" initiative, allowing graduates of Scottish universities a two-year work visa. This very modest scheme, begun in 2004, was scrapped by the UK in 2008.

Globally, migration policy is far from always the sole preserve of the governments of sovereign states. Several sub-states, or devolved regions in federal structures, have their own rules, including some very different from those of their "national" administrations. Quebec, the French-speaking nation within Canada, sets different criteria for those who wish to make their home there rather than in Anglophone provinces. It has no hard borders with other parts of Canada.

Read more: Beyond Brexit - Scotland could be given a special status on immigration

Scotland, of course, would have to identify its own needs for foreign labour, including perhaps a different points system for workers (including those from inside the EU if freedom of movement is lost in Brexit negotiations) or even a different tolerance to refugees. This would suddenly put one of the most contentious areas of politics right at the heart of Holyrood. An early tough call: Scotland might have to admit that it does not just need high value migrants to work in universities, engineering or financial services. We also need low-skills labour to pick our strawberries and gut our fish.

How will Scotland keep migrants? There may be bureaucratic restrictions that can be imposed on migrants when they first arrive in Scotland, such as National Insurance number that can only be used north of the border. But could they really be forced to live and work here - and not in, say, London - for the rest of their careers? Academics suggest a five-year minimum residency in Scotland.

After all, people are used to thinking of the UK as a single labour market, and one from which Scotland benefits: the English are by far our biggest and highest-value in-migrant group.

Read more: Beyond Brexit - Scotland could be given a special status on immigration

Experts stress that it is technically and legally plausible for migration policy to be devolved, and even for Scotland to retain EU freedom of movement. But it is politically realistic? UK ministers have already ruled it out. A separate Scottish migration policy would probably, after all, would the UK mean giving up on its already ambitious British-wide targets on net immigration, perhaps replacing them with England and Wales number. It would also involve Westminster surrendering powers which many in London see as inalienably belonging to the central state. That might be one psychological border UK leaders do not want to cross.