css-tricks.com/re-implementing-nth-child-with-modern-css Re-Implementing :nth-child() With Modern CSS
The article demonstrates how modern CSS functions such as sibling-index(), style queries, if(), and mod() can reproduce :nth-child() patterns dynamically by setting variables. It walks through selectors like nth-child(n+B), An, and An+B, including a workaround for a zero divisor and notes on negative A.