There are some more CSS values to handle the difference between the layout viewport and the visual viewport better:
https://www.w3.org/TR/css-values-4/#viewport-variants
Media queries need to have a matching update. E.g. large-width/small-width/dynamic-width.