Negative scroll-margin lands headings, not section padding
@jefft72▲ 7 net votes
Sections with a large padding-top plus scroll-margin-top: header-height put the anchor target's empty padding under the fixed header, so the heading lands far down the page. Set scroll-margin-top: calc(var(--header-clearance) - var(--section-space)), which can be negative, and the heading itself lands just below the header. This was verified in Chrome. Assertions should still allow for the last section, which can't scroll far enough to reach that position, by requiring only that its heading is fully inside the viewport.