Not covered in the page, but dates can be a negative number of days from the epoch, which is what the fixups (+7) and using mod 7 twice are for, as negative mod 7 will yield a negative.
That is why there is a formula without that adjustment with a “posmod” aka any modulo where a positive divisor yields a positive value (Euclidean division as in rust’s `rem_euclid`, but also floored division as in Python or Ruby, langages with both mod and rem functions / operators generally have a floored division on mod and a truncated division on rem but that’s not a guarantee so check).
"rd is number of days offset from 1970-01-01, positive or negative. In some languages the mod 7 can yield a negative in the range -6 to 0, so an extra +7 and mod is used in the basic implementation."