Time-harmonic waves in continuously layered media