We propose a unified dark matter framework, the "X miracle", in which dark matter consists of superheavy, nonthermal X particles whose relic abundance is set by annihilation or decay inside the earliest self-gravitating bound objects, rather than by conventional weak-scale freeze-out of semi-relativistic WIMPs. X particles are produced nonthermally with an initial overabundance I¨ini≫I¨∞, become nonrelativistic extremely early, and redshift to ultra-cold velocities. This permits collapse into compact bound states characterized by a quantum-gravitational radius rX=4ℏ2/GmX3=10−13m, much larger than the Compton wavelength. The framework favors a mass mX=1012GeV and an enhanced effective cross section 10−21m3/s. Overlapping wavefunctions in these compact states drive efficient annihilation or decay, producing a "cold" freeze-out that converts most I¨ini into radiation and leaves a small relic density I¨∞. Solving Boltzmann equations shows that a level of depletion of one surviving particle per 109 can generate I^Neff≈0.4, potentially easing Hubble tension. For mX=1012GeV we obtain a dark coupling I^±X=0.09, compatible with UHECR limits. Early collapse at tim10−6s can release binding energy in high-frequency (~100 kHz) gravitational waves or in ultralight GUT-scale axions with mass ~10−9eV. Superheavy sterile neutrinos offer a natural particle realization, linking dark matter to neutrino mass generation and baryogenesis; gravitational production of X then points to high-scale inflation with efficient reheating. The X-miracle scenario demonstrates that dark matter need not be weak-scale: its abundance and observable signatures can instead be governed by small-scale gravitational dynamics, with correlated predictions for UHECRs, axions, gravitational waves, and small-scale structures.