A unified theory of clean Josephson junctions