Doug Jones's shocking upset of Roy Moore in the Alabama special Senate election was arguably a narrow victory. If the accusations that Moore preyed on teenaged girls hadn't surfaced a month before the election, if Moore hadn't already put some Republicans off by saying homosexuality should be illegal and Muslims shouldn't serve in Congress, if roughly 21,000 people (fewer than the number of write-in ballots) had voted differently, Moore might well have won. But the failure of a Republican to win in Alabama against a pro-choice Democrat should serve as a sign—the kind with big flashing lights you can see from miles away—that the Republican Party, as currently constructed, is flirting with disaster.

Single-party rule is not the norm in American politics; in particular, midterms are generally bad for whatever side controls the White House. It seems obvious that sooner or later, control of Congress and some statehouses will flip because that's just what tends to happen. But Trump and Trumpism looks increasingly likely to make this coming swing of the pendulum more disastrous for the GOP than it had to be.

Trump campaigned not as a traditional Republican but as a hell-raising populist who promised to work on behalf of "the forgotten men and women," to quote his inaugural address. In practice, he's promoted the most radical members of his party—including budget chief Mick Mulvaney and Attorney General Jeff Sessions—and pushed discriminatory measures like his "travel ban" targeting Muslims and his (so-far) failed effort to stop trans people from enlisting in the military. He's also continued his hell-raising, picking fights with whatever culture war target is closest to hand, especially women and especially black people and especially black athletes protesting police brutality.

In Alabama, Moore was the fringe figure, winning a primary against incumbent Luther Strange despite the latter candidate enjoying a (lukewarm) endorsement from Trump. Just as Gillespie embraced race-baiting, the national GOP embraced Moore despite lots of evidence that he was a sexual predator. Far-right Fox News host Sean Hannity declined to denounce Moore, the Republican National Committee started funding his campaign again after signaling it would cut him off, and Senate Majority Leader Mitch McConnell went from calling on Moore to drop out to saying the voters should decide.

Well, the voters did decide, and it turns out there is a limit to the amount of toxicity that Republicans will put up with. (Exit polls indicate that Moore won handily among conservatives, but got only 25 percent of the self-identified moderate group.) The Trumpist strategy of attacking and attacking and attacking in the wake of every controversy and stumble worked in 2016—barely. As Moore's case shows, it's far from a sure thing.

Then there's the problem of Trumpism's actual policies—when they exist at all. In large part, the president has pursued a regular Republican agenda of slashing regulations and working to reduce taxes on the wealthy and corporations while cutting the social safety net. People do not like this: The healthcare bill that failed to pass earlier this year was historically unpopular, and the GOP tax plan that appears headed to passage as soon as this week is disliked by 49 percent of people who know about it and backed by only 31 percent, according to one recent poll. The "populist" plans that were supposed to set Trump apart from his Republican primary opponents are AWOL; his infrastructure plan in particular appears to be vaporware.

Combine Trump's personal nastiness with his unpopular agenda and it's no surprise his approval rating is hovering around a historically bad 41 percent. But at the same time, many Republicans who oppose him, like Arizona Senator Jeff Flake, are declining to run for reelection, as are moderates frustrated by the far right's control of their party's agenda.

That is going to result in a GOP increasingly dominated by men like Moore, who naturally ape Trump's extremist style, or like Gillespie, who are willing to put it on for show. But Trumpism, with all its bluster, conflict-seeking behavior, and overt bigotry, is just not what many millions of Americans actually want. In every special election since 2016, the Democrats have outperformed the Republicans:

The GOP's highest-profile victory of the year, it's worth noting, was when Karen Handel beat Jon Ossoff in Georgia's Sixth Congressional District—and Handel was a mainstream Republican who appeared to identify with Trump as little as possible. Not all Republicans will be able to run that kind of campaign, especially when they've personally endorsed the president or voted for his policies.

It's impossible to say what will happen in the midterms, which are still nearly a year and a whole lot of news cycles away. And Republican candidates won't just dry up and blow away—a great deal depends on how effectively the Democrats can keep their base energized and convince swing voters to trust them. But it's obvious that Trump is remaking the GOP in his own image, and that's going to make winning elections a lot easier for his enemies.