one unit, real layout
four labs on this page stand a phone in the stage, and the frame under them is 390x844 with every dimension a count of one length, --k. the tempting shortcut is to draw it once at native size and scale it, and the reason not to is not sharpness, since a static transform rasterises at its own scale and stays crisp.
it is that a transform makes a coordinate space and not a layout box: the frame keeps reserving its full width, getBoundingClientRect stops agreeing with offsetWidth, and every gesture inside comes out wrong by exactly the scale factor with nothing anywhere reporting an error.
corners that stay concentric
the corners are the second part: the screen's corner is the shell's less the rim and the bezel, or the arcs stop being concentric and the gap around the corner opens and closes.
changing the device
the ipad is the same idea at 1000x710 with its own --k, and switching between them is the part to watch: the status bar and island blur out before the shell moves, width, height and every corner then share one spring curve, and the wallpaper is laid out in fractions of the screen, so it reshapes with the glass rather than being redrawn.
the frame this site uses
it moved out of the labs and into src/components when /projects started standing seven recordings in it, so the frame on this page is the one the site ships rather than one written to be looked at.