This is a great analysis. There’s a lot of evidence that a vastly greater issue is the chose-one Plurality Voting method. Trump won because several more popular primary challengers split the “moderate” Republican vote. A simple fix would have been Approval Voting, Score Voting, or STAR Voting.
Approval Voting was recently adopted in Fargo, North Dakota, so Fargo now has the world’s best democracy.