When I presume that a css media query with max-width: 768px
can make my web page responsive to fit a mobile device. However, iPhone X and later still load the desktop version, because recent phones have even higher resolution than an old desktop.
How do I detect a mobile device not relying on the screen resolution, with Vanilla javascript, pure HTML and CSS?