An S-matrix approach to gravitational-wave physics