I want to invest the next years learning a few carefully selected languages / frameworks in more depth, without worrying too much about breaking changes in the underlying software, so that (optionally) I can easily pick up other languages / frameworks on-demand, since I understand the underlying concepts better.
Do you have any go-to web dev languages / tools / frameworks that you feel will be a good investment of your time in the long-term?
Here's some stuff I like: Python / Flask, PostgreSQL, AWS (incl. ElasticBeanstalk) / Netlify, Mithril.js, npm / Makefile / Parcel.js. (Currently I use a lot of PHP / Laravel / Symfony, Vue / Angular in addition to the previously mentioned.) Still undecided on Docker, but I do use it quite regularly, but also still use Vagrant as well.
(Re: My background: Freelance web developer / software architect in Western Europe, mostly working with agencies and SMEs; I've been doing this for about 10 years, 6 of them full-time, but have been developing websites or doing IT admin work on the side for about 20 years.)
I suggest a backend language (Python, Rails, etc), then Linux system administration & networking skills (play around with some bare metal servers & hardware, see if you can turn an old desktop into a router, etc - that's how I got started) and then potentially a native mobile language like Swift or Java or Kotlin. These few solid basics will last you for decades without having to "keep up with the Joneses" learning every day's new Javascript framework.
The main marketable thing is your portfolio/resume and client testimonials, if any. Approaching it from a language/stack perspective instead of a solution perspective is IMO wrong unless you want to limit yourself to being a "code monkey" for hire.