Amorphous carbon nitride films have been grown by ion beam assisted deposition (IBAD) under different process conditions. The films were found to be graphitic, with π bonds between C and N atoms and a [N]/[C] ratio below 0.3. There is a relationship between the contribution of electrons from C and N atoms to the π bonds and the mechanical properties of the films. This is consistent with the arrangement of the basal planes, the softer films consisting in the pileup of weakly interacting graphitic planes and the harder films consisting in a superstructure of interconnected and corrugated basal planes. Aiming toward the synthesis of nongraphitic hard phases, we have studied the bombardment with mixtures of nitrogen/argon ions to enhance momentum transfer in the collisions. The hardest films are obtained when using a single type of ions. The hardness is reduced in the case of the N$_2$/Ar mixture, indicating competitive mechanisms of cross-linking of basal planes.