Add {position: sticky} to section headings. This requires a moderately distasteful change to the document structure, but it's worth it, in browsers that support this feature.