“I OPERATE under the principle of justified optimism,” says Deep Sran, as he shows off the school he founded—based, he says, on his reading of Plato’s “Republic”. If voters elected representatives based on their CVs, Mr Sran would cakewalk into Congress. A lawyer with a doctorate in human development-turned teacher and entrepreneur, Mr Sran is the son of immigrants, raised in the suburbs of Washington, DC. He is one of 11 Democrats champing at the bit to replace Barbara Comstock, a Republican who has represented Virginia’s diverse, wealthy 10th congressional district for two terms. She is one of 23 Republicans representing districts that Hillary Clinton won in 2016. Democrats think they can flip them all, and more: the Democratic Congressional Campaign Committee (DCCC) has 91 districts in its sights, the lion’s share of them in states that Mrs Clinton won or barely lost.

They are, of course, unlikely to win them all. But an upset election, as this year’s midterms in November could easily be, will break first and hardest in those states—which would leave the Republican congressional caucus smaller and more strident, and risks making Congress even more dysfunctional.

Republicans from liberal states were not always on the endangered list. Rockefeller Republicans, the party’s fiscally conservative, socially liberal wing, took their name from New York’s Republican governor. But as the party grew more uniformly conservative, its centre has moved steadily westward and southward. Just as Barack Obama’s unpopularity in the South hastened, but did not cause, the near extinction of white southern Democrats, so President Donald Trump’s unpopularity looks likely to sharply reduce the number of Republicans from liberal states.

Before attempting to predict the outcome of this year’s mid-terms, a couple of caveats apply. First, the elections are still ten months away. Much can change in that time. Second, the mid-terms are not a single contest, but hundreds, each with its own unique set of candidates and circumstances. Challengers who look good on paper will have feet of clay; incumbents deemed all but dead will find reserves of strength and cunning.

That said, Democrats are not wrong to feel confident. More than two dozen Republican congressmen, many from competitive districts, have announced their retirements. Democrats hold a nearly 13-point lead on a generic ballot. They won only two of seven special federal elections last year, but they outperformed expectations in most of them. Victories in Alabama and Virginia’s gubernatorial election showed that Democrats are energised, while Republicans are not. They also showed Democrats performing strongly in the suburbs, home to many moderate Republicans, particularly in liberal states.

Going back to 1934, a new president’s party has lost an average of 23 House seats in the mid-terms after his election (Democrats need 24 to win back the House). The Republican gerrymanders of 2010 may make it harder for Democrats to translate votes efficiently into seats, but strong Democratic turnout could dampen the gerrymanders’ effect.

And Mr Trump is uniquely unpopular. Around 56% of voters disapprove of his performance—more by far than any president dating back to Harry Truman at this point in their tenure. Republicans hope that a booming economy, low unemployment and the extra money voters will see from tax reform will provide favourable headwinds. But the president’s unpopularity makes that less likely. “When you dislike someone, you’re unlikely to think they’re responsible for anything good that happens, while you blame them for everything bad,” says Larry Sabato, a political scientist at the University of Virginia.

Blue-state Republicans have the added albatross of the tax bill signed into law late last year. Previously, taxpayers could deduct many state and local taxes (SALT) from their federal income taxes. The new bill caps that deduction at $10,000—much less than many residents of high-tax, high-cost-of-living states such as California, New York and New Jersey pay. Their voters may conclude that Republicans weaponised the tax code to punish states that did not vote for Mr Trump. Some blue-state Republicans voted against the bill; how much that will matter to voters eager for revenge will be tested in November.

Republicans counter Democratic optimism by pointing out that their members who have hung on in liberal districts have done so for a reason: competitive districts tend to produce battle-tested candidates used to tough contests. And the time for Democratic surprises is over: “If a Republican incumbent is caught off-guard” after last year’s elections, says Nathan Gonzales, a campaign analyst, “it’s their own foolishness.” Even comfortable Republican incumbents—such as Rodney Frelinghuysen, who has represented New Jersey’s rich 11th district since 1995 and has never won less than 58% of the vote—have raised their campaign game.

Democratic enthusiasm has a downside: big, messy primaries that either pull candidates too far to the left for swing districts or reproduce the 2016 Republican primaries, in which a bunch of indistinguishable moderates split most of the vote, thus empowering an extreme candidate with a small but devoted fan base. And even a Democratic thumping will not eliminate every liberal-state Republican. Chris Smith in New Jersey, Chris Collins in New York, Devin Nunes and Kevin McCarthy in California and Cathy McMorris Rodgers in Washington, for instance, all come from districts that Mr Trump won handily. But last year’s elections showed that Democrats excel at boosting turnout in Democratic-leaning areas, which will improve their chances in swing districts.

That is why, even with all the caveats in place, a thinning out of Republican ranks in Democratic states looks likely. That would leave Republicans from safe seats—notably the hard-right members of the Freedom Caucus—proportionately more powerful. The 12 highest-scoring Republicans on the Lugar Bipartisan Index—which measures how well legislators work with members of the opposite party—all come from Democratic-leaning or swing states; the top three are all New Yorkers.

If a significant number of them were to lose their seats as part of a wave big enough to give Democrats a majority in the House, that would not much matter: Democrats will presumably be as unlikely to reach across the aisle for Republican votes as Republicans have been to seek Democratic ones.

But if Democrats fall just short of a majority, Paul Ryan’s days as Speaker could be numbered: a more hard-right caucus would want harder-right leadership. Democrats will find it difficult to retake the Senate: they would have to successfully defend all 26 of their seats, including ten in states that Mr Trump won, and also steal two from Republicans. In that scenario, finding something that could pass both the House, with a more powerful Freedom Caucus and less of a counterweight, and the more moderate Senate would become even harder than it is already.