There's a lot to consider here, with many options that can make sense. The one option that is a clear mistake is to buy a cheap hardtail and then spend a bunch of money upgrading it. However, it might make sense to buy a "cheap" (<$1200) hardtail, ride it well, and then sell it to buy a more capable bike later (when your budget might be higher, and the bike market might be more reasonable). I personally put several thousand miles on a hardtail that cost under $1000 USD at the time (around 2014), riding it completely stock, and it served me well, including an 80 mile ride with >10,000 ft of climbing. I also had a FS bike at the time, so tended to take the hardtail for longer mixed terrain rides, but when I broke the frame on the FS bike I rode the hardtail exclusively for about three months, on all sorts of terrain (but not hardcore downhill runs, obviously). There are fairly cheap but good components available now (especially the new Deore series) that I think you could find on the bikes in your pricepoint. I personally don't think it's worth spending money on a more expensive hardtail. In the simplest engineering terms, a hardtail lacks an essential component of a well-engineered wheeled device, i.e. the rear suspension. It doesn't make sense spending money on the other parts of the machine without addressing the essential engineering weakness. Others may disagree. But in any case, this view leads me to the recommendation that if you're going to increase your budget, hold out and get a FS trail bike (new or used). Depending on how you plan to ride, you could even consider a newer XC bike--these have gotten slacker along with the rest of the industry, and other than suspension travel, these are pretty capable bikes. In more normal times, I would suggest to buy the lowest-level "good" FS trail bike you can find--this might be an aluminum frame model with Deore level components (I personally prefer Shimano over Sram). In 2016 you could do this for less than $2500 USD with end-of-season deals (when I bought my aluminum Orbea Occam). I think the industry actually introduced more decent lower-end FS bikes in the intervening years, but with the COVID supply chain shocks, reports are that it's hard to find these bikes. Whatever you buy, you want the frame, fork, shock, and wheels to be keepers, because these are expensive to replace. Everything else is changeable and much of it (drivetrain, even brakes and dropper post) can be considered wear items.
But let me ask: how bad is riding the current 2008 Specialized? What exactly is wrong with it? Have you ridden other bikes recently that clearly address the issues with your current bike? It would be good to do that if you haven't. It could focus your quest.