Dynamic interplay between viral adaptation and immune recognition during HIV-1 infection