We compute the leptonic decay constants $f_{D^+}$, $f_{D_s}$, and $f_{K^+}$, and the quark-mass ratios $m_c/m_s$ and $m_s/m_l$ in unquenched lattice QCD using the experimentally determined value of $f_{pi^+}$ for normalization. We use the MILC highly improved staggered quark (HISQ) ensembles with four dynamical quark flavors---up, down, strange, and charm---and with both physical and unphysical values of the light sea-quark masses. The use of physical pions removes the need for a chiral extrapolation, thereby eliminating a significant source of uncertainty in previous calculations. Four different lattice spacings ranging from $aapprox 0.06$ fm to $0.15$ fm are included in the analysis to control the extrapolation to the continuum limit. Our primary results are $f_{D^+} = 212.6(0.4)({}^{+1.0}_{-1.2}) mathrm{MeV}$, $f_{D_s} = 249.0(0.3)({}^{+1.1}_{-1.5}) mathrm{MeV}$, and $f_{D_s}/f_{D^+} = 1.1712(10)({}^{+29}_{-32})$, where the errors are statistical and total systematic, respectively. The errors on our results for the charm decay constants and their ratio are approximately two to four times smaller than those of the most precise previous lattice calculations. We also obtain $f_{K^+}/f_{pi^+} = 1.1956(10)({}^{+26}_{-18})$, updating our previous result, and determine the quark-mass ratios $m_s/m_l = 27.35(5)({}^{+10}_{-7})$ and $m_c/m_s = 11.747(19)({}^{+59}_{-43})$. When combined with experimental measurements of the decay rates, our results lead to precise determinations of the CKM matrix elements $|V_{us}| = 0.22487(51) (29)(20)(5)$, $|V_{cd}|=0.217(1) (5)(1)$ and $|V_{cs}|= 1.010(5)(18)(6)$, where the errors are from this calculation of the decay constants, the uncertainty in the experimental decay rates, structure-dependent electromagnetic corrections, and, in the case of $|V_{us}|$, the uncertainty in $|V_{ud}|$, respectively.