How do basin margins record long-term tectonic and climatic changes?