The mechanical properties of carbonitrides — materials containing carbon or nitrogen, together with a transition metal — can be tested empirically, revealing that carbonitrides are nearly as hard as diamonds. Computer simulations have now linked these experimental observations to the underlying electronic structure of the material.