Spectroscopic and structural characterization of a genetically encoded direct sensor for protein-ligand interactions