*preprint*

**Inserted:** 2 dec 2023

**Last Updated:** 2 dec 2023

**Year:** 2023

**Abstract:**

For any maximal surface group representation into $\mathrm{SO}_0(2,n+1)$, we introduce a non-degenerate scalar product on the the first cohomology group of the surface with values in the associated flat bundle. In particular, it gives rise to a non-degenerate Riemannian metric on the smooth locus of the subset consisting of maximal representations inside the character variety. In the case $n=2$, we carefully study the properties of the Riemannian metric on the maximal connected components, proving that it is compatible with the orbifold structure and finding some totally geodesic sub-varieties. Then, in the general case, we explain when a representation with Zariski closure contained in $\mathrm{SO}_0(2,3)$ represents a smooth or orbifold point in the maximal $\mathrm{SO}_0(2,n+1)$-character variety and we show that the associated space is totally geodesic for any $n\ge 3$.