Just wanted to add that when I was applying, my professors really tended to emphasize the "produce excellent work" part over the rankings. (Although, to be clear, they still thought it was important to take rank into account.) If you want to land a position that involves research, a killer dissertation in a hot area from a top-100 school can trump a more boring one from the top 10.