  Even though sub-Neptunes likely represent the most common outcome of planet
formation, their natures remain poorly understood. In particular, planets near
1.5-2.5$\,R_\oplus$ often have bulk densities that can be explained equally
well with widely different compositions and interior structures, resulting in
grossly divergent implications for their formation. Here, we present the full
0.6-5.2$\,\mu \mathrm{m}$ JWST NIRISS/SOSS+NIRSpec/G395H transmission spectrum
of the 2.2$\,R_\oplus$ TOI-270d ($4.78\,M_\oplus$, $T_\mathrm{eq}$=350-380 K),
delivering unprecedented sensitivity for atmospheric characterization in the
sub-Neptune regime. We detect five vibrational bands of CH$_4$ at 1.15, 1.4,
1.7, 2.3, and 3.3$\,\mu$m (9.4$\sigma$), the signature of CO$_2$ at 4.3$\,\mu$m
(4.8$\sigma$), water vapor (2.5$\sigma$), and potential signatures of SO$_2$ at
4.0$\,\mu \mathrm{m}$ and CS$_2$ at 4.6$\,\mu\mathrm{m}$. Intriguingly, we find
an overall highly metal-rich atmosphere, with a mean molecular weight of
$5.47_{-1.14}^{+1.25}$. We infer an atmospheric metal mass fraction of
$58_{-12}^{+8}\%$ and a C/O of $0.47_{-0.19}^{+0.16}$, indicating that
approximately half the mass of the outer envelope is in high-molecular-weight
volatiles (H$_2$O, CH$_4$, CO, CO$_2$) rather than H$_2$/He. We introduce a
sub-Neptune classification scheme and identify TOI-270d as a "miscible-envelope
sub-Neptune" in which H$_2$/He is well-mixed with the high-molecular-weight
volatiles in a miscible supercritical metal-rich envelope. For a fully miscible
envelope, we conclude that TOI-270d's interior is $90_{-4}^{+3}\,$wt$\,\%$
rock/iron, indicating that it formed as a rocky planet that accreted a few wt %
of H$_2$/He, with the overall envelope metal content explained by
magma-ocean/envelope reactions without the need for significant ice accretion.
TOI-270d may well be an archetype of the overall population of sub-Neptunes.
