The presidential biographer on tech titans, what Trump could learn from Lincoln and why she remains optimistic about America