What's the matter with my home state of Kansas? Not much, as it turns out.

On Tuesday night, Kris Kobach — known nationally for a combination of xenophobia and voter suppression — was roundly defeated in his campaign for governor by Democrat Laura Kelly. It's news that should resonate beyond the state's borders, providing a signal that even the deepest-red regions of the country have limits to the kinds of excesses they will tolerate from Republican extremists.

If Kansas can reject the leadership of Kris Kobach, it means that America — no matter President Trump's apparent ability to defy the laws of political gravity — can extract itself from the clutches of the current White House occupant.

Kobach, after all, represents just about everything ugly about today's Republican Party.

He was peddling nativism long before President Trump started fantasizing about a border wall.

He was a conspiracy theorist whose fever dreams about non-existent voter fraud provided a handy pretext to make voting more difficult.

And he was a rank incompetent who acted as his own lawyer in a lawsuit brought by the ACLU. He not only lost the case — he was ordered by the trial judge to undergo remedial legal training.

Kobach's career is the 21st century GOP in a nutshell: harmful policies wrapped up in incompetence.

Outsiders familiar with Kansas' deep Republican streak — LBJ was the last Democrat to receive our electoral votes — might've expected Kobach to roll to victory. But the state's reputation for conservatism has, for generations, been balanced by a penchant for moderation: We've elected three Democrats to the governorship since the late 1970s, and two of them were women. Even the Republicans who led our state have tended to be dovish. And the state has tended to be suspicious of extremists: Phill Kline, an anti-abortion crusader, barely won the attorney general's office against token opposition in 2002 — and was tossed out of office when Democrats put up a fight in the next election, four years later.

The exception to all of this: Sam Brownback.

After a long career in Congress, Brownback came home and was elected governor in 2010. He immediately set out on "a real live experiment" in bringing Republican policy fantasies to life, importing the famous Arthur Laffer as an adviser and slashing taxes to a bare minimum. Critics warned the cuts would destroy the state's finances. Brownback promised a new era of business and job growth.

The critics were right. Brownback was wrong. Kansas become synonymous with the failures of conservative governance. And it turns out that Kansans like their public schools enough to fund them.

So in 2017, a legislative coalition of Democrats and newly elected moderate Republicans reversed the tax cuts. Brownback soon after accepted an ambassadorship from the Trump administration. If any Kansans were sad to see him go, they kept it to themselves.

Still: How did a Democrat win the governorship on Tuesday?

Republicans outnumber Democrats here by a nearly two-to-one ratio, so it has to be admitted that Kelly didn't just win — Kobach lost. Voters who might have been inclined to support a Republican governor went shopping elsewhere after Kobach barely won the GOP primary.

Another factor: Kobach is known for his anti-immigrant stances, but the state itself has been a bit more welcoming. The meatpacking industry in western Kansas doesn't just rely largely on immigrant labor — the region itself needs those immigrants to survive: The influx of Latino immigrants, for example, is the reason some counties have grown in population in recent decades. Without those new residents, parts of the state would be withering away into ghost towns.

That cultural evolution hasn't been seamless: Earlier this year, three men were convicted of conspiring to bomb a Garden City apartment complex that is home to a number of Somali immigrants. But it's gone much better than the rhetoric of nativists, such as Kobach and Trump, would have you think.

Kelly couldn't have won without her own appeal, obviously. Like winning Kansas Democrats before her, she's a moderate — she voted, for example, in favor of allowing Kansans to carry concealed weapons without a permit, though she later backtracked from that particular stance. It's not the kind of record that would earn a Democrat support in more liberal states, but it is the kind of record that lets a Democrat win a statewide election in Kansas.

Then again, it may be that even Kansans are sick to death of Trumpism and everybody associated with it. On Tuesday night in the Kansas City suburbs, Sharice Davids — a gay Native American woman — beat the Republican incumbent for Congress. That's astounding.

The fight is not over. Trump is still going to serve at least two more years of his presidency. And Kobach has lost elections before, only to return to the public stage. But if two years of Trumpism have left you exhausted and in despair, never fear: Kansas offers hope the country can return to a better path.