Geometry and analysis of surface group representations