Design and performance of hafnium optical and near-IR kinetic inductance detectors