With four giant planets (mim5−10MJup, T_\rm{eff} im900-1200 K) orbiting between 15-70 au, HR 8799 provides an unparalleled testbed for studying giant planet formation and probing compositional trends across the protoplanetary disk. We present new JWST/NIRSpec IFU observations (2.85−5.3I^¼m, R≈2700) that now include the spectrum of HR 8799 b, and higher S/N spectra for HR 8799 c, d, and e compared to that in Ruffio & Xuan et al. We detect CO, CH4, H2O, H2S, CO2, and for planet b, NH3. We combine the NIRSpec spectra with 1−5I^¼m photometry to perform atmospheric retrievals that account for disequilibrium chemistry and clouds, and allow C/H, O/H, N/H, and S/H to scale independently. While the four planets are similarly enriched in carbon and oxygen, with C/H and O/H between 3−5× stellar, we observe a tentative trend of increasing S/H - a tracer of refractory solids - from 2−5× stellar with increasing orbital distance. From HR 8799 b's NH3 abundance, we estimate N/H=21.2−8.8+16.2× stellar, suggesting the outer planet accreted significant amounts of N-rich gas. Overall, the elemental abundance patterns we observe are consistent with a picture where planet b formed between the CO snowline and the more-distant N2 snowline, while the inner planets accreted 3× stellar CO-enriched disk gas within the CO snowline. The excess volatile mass from pebble drift and evaporation implies an integrated pebble flux of 750±200M⊕. The increase in the planets' S/H with orbital distance implies more solid accretion further out, which is quantitatively compatible with expectations from both pebble and planetesimal accretion (2× Minimum Mass Solar Nebula) paradigms.