Reactive deposition of hard coatings