Mechanistic principles and applications of resonance energy transfer