Plasma heating and kinetic instabilities in the terrestrial foreshock