  By heating the intergalactic medium (IGM) before reionization, X-rays are
expected to play a prominent role in the early Universe. The cosmic 21-cm
signal from this "Epoch of Heating" (EoH) could serve as a clean probe of
high-energy processes inside the first galaxies. Here we improve on prior
estimates of this signal by using high-resolution hydrodynamic simulations to
calculate the X-ray absorption due to the interstellar medium (ISM) of the host
galaxy. X-rays absorbed inside the host galaxy are unable to escape into the
IGM and contribute to the EoH. We find that the X-ray opacity through these
galaxies can be approximated by a metal-free ISM with a typical column density
of log[N / cm^-2] = 21.4 +0.40-0.65. We compute the resulting 21-cm signal by
combining these ISM opacities with public spectra of high-mass X-ray binaries
(thought to be important X-ray sources in the early Universe). Our results
support "standard scenarios" in which the X-ray heating of the IGM is
inhomogeneous, and occurs before the bulk of reionization. The large-scale (k ~
0.1/Mpc) 21-cm power reaches a peak of ~100 mK^2 at z = 10 - 15, with the
redshift depending on the cosmic star formation history. This is in contrast to
some recent work, motivated by the much larger X-ray absorption towards local
HMXBs inside the Milky Way. Our main results can be reproduced by approximating
the X-ray emission from HMXBs with a power-law spectrum with energy index alpha
= 1, truncated at energies below 0.5 keV.
