CSS Container Queries have length units that can be used to adjust the font size relative to the size of the container. See this post: