The world's coastlines provide an extensive archive to reconstruct past sea level, tectonic processes and environmental conditions. Traditional approaches often struggle to resolve these factors independently, limiting our ability to interpret the various processes that shaped a coastline. In this study, we present a novel Bayesian inversion method that utilizes the geomorphology of marine terraces to simultaneously infer past sea-level, uplift rates and hydrodynamic factors. After benchmarking the model, we test the power of our method on the particularly complex Gulf of Corinth, where tectonically uplifting and subsiding hydrological sills have periodically (dis-)connected the Gulf from the open sea over the past ~450 ka. Our results reveal how eustatic sea-level changes, tectonic uplift/subsidence, and local climatic fluctuations have governed the basin's transitions between marine, overfilled lacustrine, and underfiled lacustrine phases. This study demonstrates the potential of inverting coastlines to untangle the climatic and tectonic processes that dictated their formation.