System Design and Prototyping for the CMS Level-1 Trigger at the High-Luminosity LHC