  Cosmic baryon evolution during the Cosmic Dawn and Reionization results in
redshifted 21-cm spectral distortions in the cosmic microwave background (CMB).
These encode information about the nature and timing of first sources over
redshifts 30-6 and appear at meter wavelengths as a tiny CMB distortion along
with the Galactic and extragalactic radio sky, which is orders of magnitude
brighter. Therefore, detection requires precise methods to model foregrounds.
We present a method of foreground fitting using maximally smooth (MS)
functions. We demonstrate the usefulness of MS functions over traditionally
used polynomials to separate foregrounds from the Epoch of Reionization (EoR)
signal. We also examine the level of spectral complexity in plausible
foregrounds using GMOSS, a physically motivated model of the radio sky, and
find that they are indeed smooth and can be modeled by MS functions to levels
sufficient to discern the vanilla model of the EoR signal. We show that MS
functions are loss resistant and robustly preserve EoR signal strength and
turning points in the residuals. Finally, we demonstrate that in using a
well-calibrated spectral radiometer and modeling foregrounds with MS functions,
the global EoR signal can be detected with a Bayesian approach with 90\%
confidence in 10 minutes' integration.
