One solution to this problem is to use the object-fit property on the image to control its size while maintaining its aspect ratio. Here's an example:
<div class="h-screen grid justify-items-center py-8">
<img class="m-auto h-full object-contain" src="/img.svg">
<div class="h-48 m-4 md:m-auto">
<div class="text-6xl font-semibold">Text 1</div>
<div class="text-4xl tracking-wide">Text 2</div>
</div>
</div>
In this example, we've added the "object-contain" class to the image, which tells it to scale down to fit within its container while maintaining its aspect ratio. We've also set the height of the image's container to "h-full", which tells it to fill the remaining vertical space in the grid. This should allow the image, menu, and text to all fit within the available vertical space without any of them overflowing.