I think age-ism isn’t that relevant when you’re under 40. There will be limited positions for someone who wants staff+ compensation though.
As an aside, Staff Engineers have to ride this strange line of being tech leads, managers, architects, and ICs. In my experience, one part or all parts will suffer. Will Larson's book[1] dances well around the ambiguity, but basically when you take a Staff Engineer job, it'll be unclear what you're signing up for.