> I would invest in learning Rails 7 and Hotwire
I'd definitely agree with Rails. IMHO it has been defining Web development for a long time. Even today patterns from Rails like are copied outside of the Rails context. Service Objects seem to be a recent example.
Hotwire seems definitely cool tech but after having been exposed to Ruby on Rails it's possible to go into various directions. (Classical server-side rendering, Hotwire or e.g. React-based SPAs)