Four years ago a seemingly invincible US senator came within a percentage point of losing his seat in an unexpectedly close election. Mark Warner was pretty moderate as far as Democrats go, a good fit for a state, Virginia, that had drifted out of the Republican column in the last two presidential elections and just elected a full slate of Democratic statewide officials a year before. But midterms are when presidents and their parties get rebuked, and Warner, a telecom millionaire who had once been tipped as presidential contender, took his support for granted. The Republican, lobbyist Ed Gillespie, was supposed to be hopeless, but he nearly claimed what was supposed to be a safe Democratic seat for the GOP.Texas has been solidly Republican for a lot longer than Virginia has been Democratic, and by a wider margin. But that makes the fact that Ted Cruz has only a single-digit lead over his Democratic opponent, Beto O’Rourke, all the more remarkable. Polls suggest Senator Cruz is in trouble, and if the overwhelmingly Republican character of the Lone Star State counts against that, the likelihood that 2018 will be as bad for the GOP as 2014 was for the Democrats throws the contest up in the air again.Democrats will vote against Cruz in full force, but that’s a given. No matter how motivated Texas Democrats may be, they’re outnumbered by Lone Star Republicans. Cruz wouldn’t normally have anything to worry about, even allowing that he is not a very personally likeable politician. His unlikability didn’t prevent him from becoming a senator in the first place, after all, on the way to which he had to win a hotly contested Republican primary in 2012. Cruz won his party’s Senate nomination that year by running as the more conservative candidate — the Tea Party candidate. He then won in November simply by virtue of the fact that he was the Republican. In a presidential year like 2012, states tend to be true to political type.But in a midterm year, voters seem to be more open to experimentation. The question before them in a presidential year — which party and leader do you prefer, or rather, which party and leader do you want to stop the most? — doesn’t apply. Instead the most important question is ‘what do you think about the person who’s already president?’ Two years into an administration, most presidents have lost some degree of popularity, as Trump certainly has. And some voters may simply be bored, ready for some change for the sake of change. So why not give the other team a chance?In O’Rourke, the Democrats have found a candidate who maximises the possibility that voters will take the chance: he’s a marked contrast to Cruz in personality and likeability, for one thing. Cruz’s success has depended, and still depends, on his complete identification with ideological conservatism. The more the race turns on personality rather than ideology, the worse Cruz will do. In Republican presidential caucuses, where party orthodoxy matters most, Cruz was Donald Trump’s last and most serious challenger of 2016. But he struggled to compete with Trump in primaries, where popularity matters more: Cruz only won four of those, including his home state of Texas and adjacent Oklahoma. Cruz was a sore loser: given a speaking slot by Trump at the Republican National Convention, he pointedly refused to endorse the man who had beaten him for the nomination, instead telling the delegates, ‘Vote your conscience.’ They booed him. Cruz had miscalculated: he thought of himself as conservatism’s Martin Luther, free to challenge the deviations of Pope Donald. But as far as the congregation was concerned, he was just another heretic. Cruz speedily changed course, and was soon doing everything he could to establish himself as a loyal Trump Republican, right up to phonebanking in November. Trump rewards such loyalty. He’s heading to Texas next month to campaign with Cruz. But Trump’s voters have been less forgiving than the president himself, and Cruz’s plunge in the polls gives any Republican who has doubts about the senator a psychological opportunity to express them. In politics, you have to pretend your candidate is popular, even when he’s not. And you have to pretend you like him, even when you don’t. Now that Cruz’s popularity is punctured, it may be a lot easier for Republicans to stop pretending. The stench of prospective defeat is upon him, and who wants to hold their nose to vote for a loser?Trump voters may not deliberately elect a Democrat to punish an insufficiently pro-Trump Republican, but it’s easy to imagine some of them feeling unmotivated to go out of their way to help Cruz. The senator has a Trump problem from the other direction as well. NeverTrump Republicans may be a tiny constituency in Texas, as they are in most other places, but suburban Dallas Republican professional women who want to make their displeasure at the party’s direction under Trump known can readily do so by abandoning Cruz. The senator’s recent remarks about ‘silicon’ and ‘dyed hair,’ intended to draw a contrast between Democratic California and Republican Texas, give them all the more reason. (Presumably Cruz meant ‘silicone,’ not ‘silicon,’ unless he’s worried about tech companies moving to Texas.)Vengeful Trump voters and dissident Republican women are not going to defect in large numbers. But in an election as close as Cruz’s has become, even a few could make a difference. Cruz is not a Trump Republican’s ideal senator, nor a NeverTrump Republican’s ideal. For a time, he was the closest thing to an ideal Republican that true believers in conservative orthodoxy could ask for, but Cruz himself knows how mutable that orthodoxy can be in practice. He was a Bush Republican when George W. Bush was in the White House. He was a Tea Party Republican when the Tea Party was on top. He became an outspoken critic of the Federal Reserve when he was competing with Rand Paul to be the candidate of the libertarian populist right in 2016, and after he defied Donald Trump right up to the Republican convention that year, he changed course once he saw just how unpopular that stance was with the party faithful. Cruz has a general-purpose conservative core of belief, no doubt. But he’s understood his path to power to lie in being the most conservative guy in the room, and that means trims his sails as the starboard winds blow. The risk is that voters start to find this mixture of opportunism and dogmatism as unlikable as Cruz himself.But it’s too soon to count him out. If Mark Warner could survive the Republican tide in a purple state four years ago, Cruz should prevail in deep red Texas at the time of the Democrats’ high tide. If he can’t, it’s a sign that ideological orthodoxy as a political strategy has almost reached its limits.