Phase formation and phase separation in multiphase thin film hard coatings