he certainly brought a stacked deck into the election: a resume deep in government service, a sophisticated campaign that used data analytics like never before, a huge fundraising advantage and a rival who routinely shot himself in the foot.