A decision underlies phototaxis in an insect