The screen is expanding in a bad way.
This seems to be caused by a few different problems:
1) Images end up being too large.
2) The display flex is used incorrectly in some places.
3) The pre tag is just useless, it breaks everything.
Tweak the images to have a max width that results in it being no larger than the screen.
Fix the display flex structure.
Replace pre tags with sample tags and assign better formatting using white-space "pre-line".
The use of the samp tag (sample tag) is more accurate because this is a sample terminal.
Replace the existing code tag that is for terminal output with samp tag.