Ok, so here is variation that contains zero JS and (ab)uses the "invisible_anchor:focus + sibling_anchor_pointing_to_previous_anchor" trick [0]. I'd prefer the original version, though. This is more or less a hack.
[0] https://myfonj.github.io/sandbox.html#%3C!doctype%20html%3E%...