How are quarks elementary when they can become leptons? From a recently reignited [casual] curiosity into particle physics thanks to the Fermilab YouTube channel, I read about the g-2 experiment, followed by muons, naturally. Muons, it turns out have short lives, and they decay into an electron (and antineutrino), for example. Reading on how muons are created, I learned about the role of the cosmic rays, and intuitively I understand how 3 quarks can end up as 3 quarks and a quark–antiquark pion. [Charged] pions decay to muons, so my curiosity was satisfied, but only momentarily . . .
Until I realized this muon creation and the subsequent electron originated from quarks.
Q: How are quarks elementary when they can become leptons?
I'm either misunderstanding the meaning of a particle being elementary, or I'm missing something. (I can't get my head around that point; I also casually understand that the weak interaction is involved.)
Does it work the opposite way as well (lepton → quark)? Or, given enough time, will all elementary particles eventually decay to leptons? (Thinking out loud; not necessarily extra questions.)

I could not find the answer to my question on Wikipedia or via Google. I checked the related topics, for example, Are quarks and leptons actually fundamental particles? But it's a different question about what makes up quarks/leptons (I'm content with the fact they're as small as they get according to the Standard Model).
Thanks to @AccidentalFourierTransform for the following links (and their links):


*

*Is the Higgs boson an elementary particle? If so, why does it decay?

*Decay of elementary particle?
As far as I can see those posts do not address the quark → lepton decay. All the examples given are quark → another quark (or lepton → another lepton), which I have no issue with (the muon → electron example I gave). The same for the decays of virtual/mediating particles, e.g., photons and Higgs bosons. My issue is (was) the class-changing decay of the non-virtual particles.
 A: We have a plethora of data on particle interactions since last century, and laboriously have come up with a mathematical model for particle physics that works, i.e. it gives the right numerically answers for these data and, important, is successful in predicting new data, as recently happened with the Higgs boson. It is called the standard model for this reason and has an elementary particle table.

These are what the successful model uses as elementary particles (together with their antiparticles), i.e. point particles carrying quantum numbers and masses that , when used to get the crossection of an interaction or the decay width or.. work beautifully and the model is continually validated.
In this model the elementary particles interact with the three interactions according to their quantum  numbers, and some such interactions and the energy supplied by their masses allow them to decay to other elementary particles. The Z and W and the Higgs also decay into lower mass elementary particles.
So the answer is that it is a model that defines what elementary particles are which is working very well.
If in the future a string theory model, for example, can embed the standard model into vibrations of a string, there will be only one elementary entity, the string.
It is all in the model.
A: Particles are called elementary if they are not made up of other particles. However, interactions can change an elementary particle into another kind of elementary particle.
Quarks and leptons are currently believed to be elementary. (This could change if we could observe particles interacting at higher energies than, say, the LHC can achieve.) However the weak interaction can, for example, turn an up quark into a down quark, and an electron into an electron neutrino. When they change, they either emit or absorb a W or Z boson, the particles that carry the weak force.
A quark can’t directly turn into a lepton, but two quarks can indirectly produce two leptons. For example, an up quark and a down antiquark can turn into a $W^+$ boson, which can then turn into a positron and an electron antineutrino.
When an elementary particle like a muon decays into other particles, it doesn’t mean that those particles were inside the muon before it decayed. It means that the muon changed into a muon neutrino, emitting a $W^-$ boson in the process, and then that $W^-$ boson changed into an electron and an electron antineutrino.
