Terahertz metamaterials: Refractive index, sensing, and resonances