You can’t specialize before you have a career. Just study what you want to study, this doesn’t make you specialized. You get specialized when you stop applying for jobs outside the specialty because you’re no longer interested in those jobs.
Apply for whatever job will have you. Once you have a job, stay there six months to a year, then start looking for the work you want to do. It’s called “paying your dues.”
You can’t front-load future-proofing. You can’t just learn one thing that will ensure you’ll be hireable for all time. You just stay on top of the trends. Certain skills are foundational and will remain useful throughout your career. Once a technology becomes mainstream, then you can generally make money with that tech for a long time. There are people still making tons of money maintaining Fortran codebases.
Know your foundational technology really well, and let the companies that hire you pay you to learn the fads.