Nanophotonics and metamaterials for optical and quantum technologies of the future