Earlier quoted context omitted.
If 51% and 49% cant come to agreement they should live separately. I am not advocating full secession but something like Hong Kong (HK handles everything except Defence and External Affairs). (I think) In democracy, voters are less likely to compromise. This is result of weak discussion between >1m.
Unfortunately ideology and geography have a correlation that, while positive, is less than one. There will always be a minority that gets overridden. And while it is a good thing for people to have freedom to move to a place that supports their values in extreme cases (some are even talking seriously about it this election), in most situations that isn't practical.
But likely technology (as always) will come to rescue before democracy. This is in reference to rise of renunciations, AirBnB etc.