A conformational switch of intramolecular electron transfer