Theory and design of spatiotemporal metasurfaces for comprehensive control of light