Electronic and structural properties of amorphous carbon–nitrogen alloys