The default display for a pseudo element is inline, so the width will not apply. Also, it’s content is inserted after the text and would expand the span.
If the after element had an inline-block display, the 100% width would equal to the nearest parent that has a formatting context, here the H1.
So also the span would need a inline-block display to set a new formatting context.
So far answering the specific question.
To really solve the problem with the pseudo element, you need to follow the method @RyanReese already posted.