If the designer impact of the overlapping sections creates problems for you, I use a different technique now, which is more like this;
/* Apply to all elements that have an ID */
<style>
*[id] {
scroll-margin-top: 100px; /* Adjust this value as needed */
}
</style>
If you drop this as a custom HTML embed in your page, it will set a top margin for the scroll-to position. It works in 90% of cases, so test it for yours, and use the other as a fallback.