Sometime in the early hours of Friday morning, a thought darted suddenly into my caffeinated semi-consciousness: 'What about the textbooks?'

They would all have to be pulped. Paul Cairney no more. Neil McGarvey no more. Michael Keating and Peter Lynch no more. I might stick my half shelf of James Mitchells on eBay as collector items.

From Scottish Office to Scottish Parliament, local government financing to local government reorganisation, the electoral behaviour underpinning Scottish politics long remained constant. Scotland was Labour, or at least the populous west and central belt were; the swathes of righteous red were interrupted only here and there by yellow slivers, liberal and nationalist, and diminishing blobs of Tory blue.

For those of us whose education coincided with the transition to devolution, this was both obvious and baffling. Scotland was Labour and had been for decades yet here was a political, constitutional and democratic upheaval after which things stayed pretty much the same. Political scientists could sketch out the new institutions, a semi-proportional voting system, and initial controversies over the building project and repeal of Section 2A.

What none could explain was how continuing political staticity could be the outcome of major change. When voting patterns eventually shifted, fresh tomes were penned outlining how the SNP had come to replace Labour. And yet a certain stability remained: Scots, although not differing significantly from their English counterparts in social attitudes, were more likely to vote for parties which identified as left-of-centre. 'Tory' was still a four-letter word in Scotland.

After Thursday, the literature is going to need another revision. The Tories, as improbable as it still seems four days later, are now the second party of Scotland. The "official opposition". A greater parliamentary force than Labour and the Liberal Democrats combined.

What William Hague could not do, what Iain Duncan Smith could not do, what Michael Howard and David McLetchie and Annabel Goldie could not do -- what David Cameron could not do -- Ruth Davidson has done. The decline in Conservative fortunes north of the border has not only been halted but reversed.

The Tories are back.

Thursday recorded their best ever performance in a Holyrood election, with more first votes, second votes, and seats than in 1999, 2003, 2007 and 2011. Davidson scored more than twice as many list votes as her predecessor five years ago. She put up the Tory constituency and regional vote shares (+8.1% and +10.6%, respectively) by more than any other second party since devolution began; in fact, the leap in Tory share of second ballots exceeded that achieved by the SNP in the 2007 poll that brought them to power.

In all, Davidson led the Tories to half a million first-past-the-post votes, more crosses beside the party's name than at any general election since 1992. And in an historical quirk which would have made the results all the sweeter for Davidson, she now heads a group of 31 MSPs - the same number of Scottish Tory MPs elected in the 1959 general election, the last in which the Conservatives secured more votes than Labour in Scotland.

Make no mistake: Ruth Davidson pulled off an electoral feat which will command entire textbooks of its own to document.

And yet while her achievement is breathtaking, it is also breathtakingly fragile. In truth, the Tories did not come second on Thursday -- Ruth Davidson did. That was the branding on their election leaflets, broadcasts, and campaigning materials: "Ruth Davidson for a strong opposition". No party has played down its identity so brazenly in a Holyrood election. Davidson is a doubly talented magician; she made the Tory Party disappear and then pulled 31 seats out of a hat.

Yes, she has a mandate to hold the Scottish Government to account but it is a personal mandate. Which begs the question: What happens when she starts talking like a Tory again? Labour voters who lent her their backing to rein in the Nats will not be keen on talk of tax cuts, contracting the public sector, and slashing red tape. It is in Davidson's interests to keep the SNP detained on the constitution because that is the issue on which her new coalition is united. Nicola Sturgeon's strategy should be obvious: Tie Davidson to everything the UK Government does and harry her into missteps and onto divisive territory. This might not prove terribly difficult. Davidson is headstrong and too often confuses volume for effectiveness, characteristics which provoked Scottish contempt towards an earlier Conservative leader.

That said, the First Minister ought not to expect an easy ride. There's steel in Davidson, and tenacity too. She's not really a Cameroon at all. She believes in things -- soppy things like the Queen; working class kids done well; a good Britain is a Great Britain; God bless Our Boys -- but she believes in them fiercely. She doesn't do backing down.

If Davidson is clever, and she is, she will present as leader of the opposition first and Tory chief a distant second. Instead of pushing the tenets of Toryism, she will offer herself as a humble vessel for non-Nationalist Scotland, dogging the Scottish Government on policy, delivery, and outcomes. The Tories didn't win the election but a conservative party did -- one that trades on its reputation as a safe pair of hands running the economy and public services. Undermine the public's confidence in the SNP's competence and you weaken the party and its case for independence.

Political roles have been reversed. Davidson, who knows fine well there will be no second referendum in this parliament, must talk up the threat of independence to shore up support from non-Tory unionists. Sturgeon, the nationalist who dreams of tearing the United Kingdom asunder, must downplay the constitution and focus on working within the devolution settlement. We will soon see what toll such games exact on good government and parliamentary scrutiny.

Something symbolic but of real practical importance happened on Thursday. The task of fending off separatism passed from the centre-left to the centre-right. Scotland's constitutional future ceased to be a competition between a national and a progressive vision and became a choice between nationalism and unionism. For Labour, the Union is a means to an end -- social solidarity and redistribution of wealth -- but for the Tories it is as bound up in pride and glory and shortbread tin history as the SNP's Bannockburn breakaway fantasy. The fate of the Union is now fastened tightly to the actions of the Tory Party down south, an organisation not overly sensitive to Scotland's concerns and interests.

Unionist voters have given the nationalists what they have always wanted -- a politics polarised along those very lines. My colleague Aidan Kerr describes this as "Ulsterisation", a term that stirs disquiet, some of it legitimate. Scotland is not simply Belfast with better whisky; the nationalist movement in Scotland has mainly been peaceful. Outside the diminished ranks of Bobby Sands enthusiasts and Michael Stone fanboys in small, hopeless pockets of Glasgow, we in Scotland tend not to celebrate terrorists as folk heroes. There are no murals here, no walls dividing communities, no still-raw memories of young men shot or homes burned down.

But the bitterness, the division, the flags, the rancid identity politics which now calls Scotland home bears echoes of Northern Ireland. Scotland is a question of loyalty: Are you Scottish or British? Does your heart stir with the flutter of the Saltire or the Union Jack? Are the people down south our countrymen and women or are they so alien to us that we must break our political ties with them? Nationalists opened this Pandora's box; they can't very well complain when others see unseemly parallels in the Scotland they've created.

No, Ruth Davidson cannot claim solo credit for her party's surge. In their quest to destroy Scottish Labour, the SNP breathed new life into the Tory Party, as sceptical Scots wary of the all-dominant SNP and the Nicola Sturgeon personality cult held their noses and threw in their lot with Davidson. The other side has a nationalist party, they seem to have reasoned; why don't we get ourselves one of those?

The Scottish Conservative Party has been reborn but it is a strange rebirth indeed.

Comment by Stephen Daisley, STV's digital politics and comment editor. You can contact him at stephen.daisley@stv.tv.