Does browser zoom change devicePixelRatio?
Yes: increasing page zoom raises the DPR the browser reports by the same proportion, because zoom redraws the content with more physical pixels per CSS pixel; that is why devicePixelRatio should be read again on every resize event, never cached at page load.
Why does `srcset` use descriptors like `2x` and `3x`?
Because those descriptors tell the browser which image to pick based on the device DPR without CSS having to change: on a DPR 2 screen, the browser downloads the version marked `2x`, which has double the physical pixels of the base version, keeping the result sharp without resizing the image at runtime.
Can screen.width and window.innerWidth be equal?
They can, when the browser window is maximized with no operating system side panel visible, but window.innerWidth is normally smaller, since it subtracts the scrollbar area and the browser own chrome; never assume the two values match in production.
What is matchMedia('(min-resolution: 2dppx)') for?
It applies conditional CSS to high-density screens without depending on runtime JavaScript: the `min-resolution` media query compares the device DPR directly against the given threshold, letting you swap a background-image for a higher-resolution version only when the panel actually has enough physical pixels to make use of it.