Mate, shadow figures on staircases are practically a genre at this point - you're not alone.
Had something similar in my old apartment in Osaka, always at the top of the stairs around 2-3am. Classic Hat Man silhouette, dead still, then gone the second you properly focused on it. Peripheral vision is apparently their favourite stage.
Few things worth considering:
Infrasound can cause visual disturbances - anything between 18-19Hz messes with your eyeballs. Old buildings with dodgy plumbing are notorious for this, Sleep paralysis hallucinations can bleed into waking states, especially if you were half-asleep when you saw it, Or, y'know, actual shadow entity doing shadow entity things
I've been running a FullSpectrum camera on my staircase for months now and caught some genuinely weird stuff - nothing conclusive, but enough to make you put the lights on. Pair that with an EMF reader and you start building a proper picture.
The staircase thing is weirdly universal across cultures though - Japanese folklore has entities that specifically inhabit transitions between floors. Liminal spaces and all that. Whatever these things are, they clearly didn't get the memo about personal boundaries.
What time did you see it, and did it have any distinguishable features?