.heading {
  font-size: clamp(2rem, 5vw + 1rem, 5rem);
}

The size is adjusted as flexibly as possible, between the minimum, the preferable taking the viewport into account and the maximum.