HOUSTON, A DRIVE-THRU megalopolis of nearly 7m people, is sometimes sneered at by residents of other big cities for being flat (true), hot (also true) and ugly (somewhat true). Yet if you are the sort of person who thinks human variety is appealing rather than threatening, then the city, which spreads over an area in east Texas the size of Massachusetts, is exceptionally beautiful. Even in a nation of immigrants, it is astonishingly diverse. The largest group, by a whisker, is Anglo (as non-Hispanic whites are known in Texas), followed by Hispanics, then African-Americans and Asians. No single group dominates. Houston elected an African-American Democrat as mayor and an Anglo Republican as the county judge. It is a welcoming, tolerant place which accepts more refugees for resettlement than any other city in the country. This is America as Democrats would like it to be.

The party is obsessed with Texas, and rightly so. Any Democratic presidential candidate who could pick up its 38 electoral college votes and add them to those of California, New York and Massachusetts would open up many possible paths to the White House. Texas, though, is not obsessed with Democrats. The state last chose one as governor in 1990, as senator in 1988 and as president in 1976. There have been false dawns in this long losing streak, and many declarations that this time will be different. Turning Texas blue is rather like nuclear fusion: a transformational idea in theory that in practice is always a few years away.

Democrats probably do have a better chance of changing this story in November than at any time in the past 25 years. The least bad set of results for the party in recent years came in 2006, also a mid-term year in which Republicans held both houses of Congress and the presidency, when the appeal of negative partisanship was strong. The result in 2006 came despite the fact that the president himself was a Texan. President Donald Trump’s approval rating in Texas (39% according to Gallup) is lower than in North Carolina or Florida, both perennial swing states.

A further cause for Democratic optimism comes in the form of a floppy-haired tech entrepreneur and former bass player from El Paso. Beto O’Rourke, a congressman running in November against Ted Cruz, one of the state’s senators, is considered by many politicos to be the best candidate the party has put up statewide in decades (the most recent poll still has him down by five points). “I watched Kennedy, Reagan, Clinton and Obama campaign,” says Richard Murray of the University of Houston. “Beto is in that kind of class.”

Then there is the downright weirdness of the state’s Republican leadership. Texas was once synonymous with the expansive version of Republicanism pursued by the Bushes and Rick Perry, a strand more concerned with taking care of business than with fighting culture wars or kicking out immigrants. Now the party’s leadership seems obsessed with the private lives of others, and the attorney-general, Ken Paxton, has been under indictment for securities fraud since 2015. “I think people want a return to normalcy,” says his Democratic opponent in November, Justin Nelson, munching on a rib of beef served by a man dressed like Johnny Cash who, in typical Houston fashion, speaks seven languages, including Armenian and Farsi.

So far, though, Texas has mainly been proof that demography is not destiny. According to projections by Robert Griffin, Ruy Teixeira and Bill Frey, a trio of eminent demographers, a majority of eligible voters in Texas will be non-white by next year. Since non-whites lean heavily Democratic this ought to be decisive, and yet it is not. Texas Democrats sometimes make themselves feel better about that by pointing to voter suppression or gerrymandering by Republicans. These things do not help, but the uncomfortable truth is that in low-turnout electoral politics, a smaller, cohesive, motivated group can go on outvoting a larger, disparate, apathetic group for a long time.

One reason so many Democrats go missing on polling day is that propensity to vote increases with income, and many would-be Democrats are poor. Another is that different bits of the coalition do not share interests. This is especially visible in the Democrat-on-Democrat fights in California. Golden State Democrats are mostly progressive, but since just 15,000 tax-filers already provide a quarter of income taxes, they often find it hard to pay for the pro-poor policies they advocate. How much taxes can go up without pushing the super-rich out of California is an oft-discussed topic. “There are diminishing returns to raising taxes after a certain point, we just don’t know where that point is,” says Anthony Rendon, the speaker of the state assembly.

On housing, too, wealthy Californian liberals compete with poorer, non-white Democrats, a competition that is particularly ferocious in cities like Los Angeles and San Francisco where planning laws make it hard to increase the housing supply. California’s example is extreme, but something like it has taken place across urban, Democratic America. Nathaniel Baum-Snow of the University of Toronto and Daniel Hartley of Chicago’s Federal Reserve looked at city centres between 1980 and 2010 and concluded that members of the Democratic Party’s affluent wing are taking over at the expense of poorer, often non-white Democrats.

Houston is unusual among big cities in which Democrats cluster because it is not subject to these constraints. The long oil boom that started at nearby Spindletop bequeathed Houston a freewheeling spirit and a pathological suspicion of zoning laws. Four votes to introduce them failed, undermined by property developers who considered such planning laws bad for business and voters convinced they were a step on the road to serfdom.

As more people arrived, more city was built. Migration to Houston has gone into overdrive in the past 15 years largely because the absence of zoning laws has kept housing comparatively cheap. Most American cities are surrounded by towns incorporated a century ago that cannot be gobbled up. Houston has authority to grab anything within five miles of its boundary, a point that has moved ever outwards. This is how its metropolitan area has come to spread over an area nearly the size of Belgium. The process has now slowed: the last annexation took place more than a decade ago and was controversial enough that city officials have since become more cautious. Houston is one of the fastest-growing cities in the country and has added more people since 2000 than either New York or Chicago have.

Mr Obama’s approval rating among black voters stayed high throughout his term but fell among Latinos and whites

Cheap housing attracted African-Americans from northern cities; it also attracted immigrants from Jamaica and Nigeria. Hispanic families who had been in Texas since before it was part of the Union came to Houston, as did recent arrivals from Central America. Vietnamese tailors mixed with Indian petrochemical engineers. Democrats need these disparate tribes to cohere into a single group—the non-whites—and ally with college-educated whites and then turn out in large numbers.

Yet even in Houston, which probably has less intense competition for housing and less racial tension than any other large American city, this is not a given. Because it is so sprawling the city’s different tribes tend to live apart. “Houston is segregated by income rather than ethnicity,” says Stephen Klineberg, who tracks the city’s changing demography. “We’re not threatened by each other, but we don’t get to know each other either.”

Fort Bend county, a suburb to the south-east, has a claim to be the most diverse place in the whole country, and therefore in the world: it is close to being a quarter Hispanic, a quarter Asian, a quarter Anglo and a quarter African-American. It offers a tantalising glimpse of what a prosperous, post-racial America might one day look like. Even here, though, racial categories persist. The public schools have self-sorted: Anglo and Asian children in one group, African-Americans and Hispanics in the other. Across Texas, Democratic primary results usually break down in predictable ways according to what can be inferred about a candidate’s ethnicity from their surname.

Anti-racism is the adhesive that keeps a coalition of upscale whites together with poor minorities. But anti-racism might not be a substitute for a kind of solidarity that costs money, such as paying higher taxes, or status, such as sharing out places at a city’s better schools. Nor is anti-racism the force in the party that college-educated liberals assume. About 30% of white Democrats told the American National Election Studies in 2016 that it is either “extremely” or “very” important for whites to work together to change laws that are unfair to whites, an attitude that many upscale Democrats would consider highly racist. Pitted against the passions and prejudices that the president can tap into when he talks about banning Muslims, or of Latino gangs destroying the country, anti-racism is overpowered.

Race to the bottom

One way of thinking about the Democrats’ conundrum on race is to picture a bucket. At the beginning of the 21st century when Mr Teixeira and John Judis wrote “The Emerging Demographic Majority”, the Democrats’ bucket was filling up with non-white voters in a way that looked sure to deliver electoral victory. At a certain point, though, around the time of Barack Obama’s victory in 2008 (and the timing is unlikely to be a coincidence), whites started to flow out of the bucket as fast as non-whites flowed in. In 2015 Mr Judis updated his prediction in an article for the National Journal called “The Emerging Republican Advantage”. To win elections, he wrote, Democrats still need 36-40% nationally of the white working-class vote—which, in practice, means totals in the teens or 20s in the south, and near-majorities in many northern and western states.

Pick a non-white candidate and non-whites may turn out in record numbers but these poorer whites may flow out. Pick a white candidate and non-whites may not flow in. Studies of mayoral elections, which throw off enough data to make general observations, suggest that Hispanic voters often fail to get behind African-American candidates and vice versa. Mr Obama’s approval rating among black voters stayed high throughout his term but fell among Latinos and whites. Racial categories are maddeningly stubborn. A multiracial coalition can easily become less than the sum of its parts.