On the partition function of the Riemann zeta function, and the Fyodorov--Hiary--Keating conjecture