I like decorative shapes behind a card’s text, done with a pseudo element and z-index: -1. Without one extra line, that shape disappears behind the card’s own background or even the page.
.card {
position: relative;
isolation: isolate;
background: #ffffff;
}
.card::before {
content: "";
position: absolute;
inset: auto 1rem -0.5rem auto;
width: 4rem; height: 4rem;
background: #ffe08a;
border-radius: 50%;
z-index: -1;
}
A negative z-index means “behind the content of my stacking context”. If the card does not form its own stacking context, that context is somewhere higher up, maybe the root, and the circle ends up behind the card’s white background where you cannot see it.
isolation: isolate creates a new stacking context and does nothing else. No transform hack, no extra z-index on the card that might fight with a sticky header. The circle now sits behind the card’s text but in front of its background.
It also limits mix-blend-mode to the element, which was its original purpose. It is worth reaching for whenever z-index behaves strangely, because many z-index puzzles are really stacking context puzzles. Every current browser supports it.
Further reading: MDN: isolation, MDN: Stacking context