We study the phase stability, mechanical properties, and electronic structure of two quasi-binary ceramic systems, Ti1-xScxN and Ti1-xYxN (0 ≤ x ≤ 1), using first principles methods based on density functional theory, cluster expansion formalism, and Monte Carlo techniques. Owing to the similarity in ionic radii and electronegativities of their respective transition metals, strong exothermic mixing of TiN and ScN is predicted, with four ordered intermetallic phases lying on the convex hull: TiScN2, TiSc8N9, TiSc9N10, and Ti3Sc2N5. These structures form layered rocksalt-type configurations to minimize strain energy while maximizing occupation of bonding states. The fully-detailed phase diagram including these predicted ground states and known end members is constructed, revealing an upper consolute temperature of 660 K. In contrast to Ti1-xScxN, the mismatched properties of TiN and YN lead to large structural distortions and positive strain energies. As a result, endothermic mixing with significant upward bowing in the formation energy is observed at intermediate concentrations, with the consolute temperature of 7225 K being predicted from the phase diagram of Ti1-xYxN. TiN, ScN, and YN are found to display hardness values of 23.4, 25.1, and 20.6 GPa respectively, in good agreement with experimental data. The intermetallic phase Ti3Sc2N5 is predicted to exhibit an exceptionally high hardness of 27.3 GPa. From analysis of projected electronic density of states and Crystal Orbital Hamiltonian Populations, we attribute enhanced hardness to strong nitrogen p and metal d hybridization, being related to 3d eg occupation, and decreased tendency towards shearing, being related to minimal 3d t2g occupation. These features extend to the case of random solutions, which we model using special quasirandom structures, showing a maximum hardness at a valence electron concentration of 8.4. Based on these findings, we suggest Ti1-xScxN alloys for implementation in hard coating applications.