Geometric spectral optimization on surfaces