Adaptation of DNA to protein binding revealed by spectroscopy and molecular simulation