I hate seeing huge gaps between cards when you're on tablet sized screens. Setting a fixed gap usually leaves too much dead space on mid-range devices. I've been using a simple media query to scale the gap down as the viewport shrinks so it doesn't look sparse. It keeps the layout tight without needing complex math.
@media (max-width: 768px) {.grid-container {gap: 1rem;}}don't forget to check your padding too, because a small gap with huge padding looks just as bad. It's much easier than trying to use calc() for every single margin.