Friction mechanisms of amorphous carbon nitride films under variable environments: a triboscopic study