Design, construction, and performance of a high-resolution π0 spectrometer for nuclear physics experiments