The problem is not the z-index, but the background color. It's transparent so it appears to be behind other text. You should set the variables you use in your code:
:root { --bg-dark: #000; --main-color: #fff; }