By Angeliki Kastanis, Josh Boak and Dario Lopez-Mills

PHOENIX — When Katherine Rutigliano and her husband moved away from San Francisco in 2013, they figured they would never meet a fellow Democrat again.

But housing was affordable around Phoenix. No more cramped condo. No more suffocating mortgage payments. No more tech-boom exhaustion. Everything would be easier for them and their kids in the suburbs — everything, that is, except talking politics with neighbors.

Then came an unexpected visitor at the door. It was a Democratic volunteer rounding up votes ahead of the 2018 Senate election. Rutigliano invited her in and inspected the map on her iPad. She was elated to see all the flashing lights that marked where Democrats lived in her stucco neighborhood on the northern edge of Phoenix.

These San Francisco transplants were not alone.

“It was like Christmas,” said Rutigliano, 37, a mother of three and trained chef who is now sending out mailers for local Democrats.

Rutigliano didn’t realize it, but she had moved her family to what is now the front lines in American politics. Once firmly in Republican control, suburbs like hers are increasingly politically divided — a rare common ground shared by Republicans and Democrats.

As such, they are poised to decide not just who wins the White House this year but also who controls the Senate and the contours of the debate over guns, immigration, work, schools, housing and health care for years to come.

The reasons for the shift are many. Suburbs have grown more racially diverse, more educated, more economically prosperous and more liberal — all factors making them more likely to vote Democratic. But demographers and political scientists are just as likely to point to another trend: density. Suburbs have grown more crowded, looking more and more like cities and voting like them, too.

For decades, an area’s population per square mile has been a reliable indicator of its political tilt. Denser areas vote Democratic, less dense areas vote Republican. The correlation between density and voting has been getting stronger, as people began to sort themselves by ethnicity, education, personality, income and lifestyle.

The pattern is so reliable it can be quantified, averaged and applied to most American cities. At around 800 households per square mile, the blue of Democratic areas starts to bleed into red Republican neighborhoods.