Most hover effects on hero headlines move the whole line: a gradient sweep, a tilt, a glow. This one works per letter. Each letter of the headline gets heavier and darker the closer your cursor is, so moving across the line feels like pressing into it.
It needs three things: a variable font, the pointer position as motion values, and one small calculation per letter.
Why a variable font
A variable font carries every weight between its lightest and heaviest in one file. That means font-weight can animate smoothly from 200 to 900 instead of jumping between a few static files. Geist, Inter, Roboto Flex and most modern system fonts support it.
Step 1: track the pointer without re-rendering
A minimal version: store the pointer in motion values, not React state.…