An atomic nucleus consists of protons and neutrons, held together by the strong nuclear force (i.e. gluons). The heavier a nucleus gets, the more neutrons have to be added to overcome the increasing repulsive electromagnetic force of the protons. In the end, the rest mass of the nucleus is less than the sum of the mass of its constituents. This difference is equivalent to the energy needed to break up (or free particles from) the nucleus.
So far so good.
A single proton, with a mass of about 1GeV, consists of three quarks (whose rest masses sum up to roughly 7MeV in total), and gluons (massless), which create virtual sea-quark pairs. The mass of the proton is thus significantly heavier than its real constituents, and the mediators of the strong force increase the proton mass (or more precisely, make up for most of it).
How are these two pictures naively compatible? Is this a consequence of asymptotic freedom? Or does the proton have an equivalent mass defect, i.e. a typical energy scale for inelastic scattering, so that the sum of the masses of constituent and sea quarks is larger than the mass of the proton (if one might for a second assume such a sum makes any sense)? And thus, are there sea quarks in a nucleus as a consequence of neutrons/protons exchanging gluons, which then make up for a (tiny) part of the mass of the atom?