1 pixel gap between window top and menu bar MacOS Mojave 10.14.6 MacBook Pro (13-inch, 2017, Two Thunderbolt 3 ports)

I have a 1 pixel gap between the top of the window and menu bar and I can't move the window close to the menu bar.



Is there any way to solve this problem?
This appears to be the design of the Safari window.  Safari (and other Apple apps) have a grey shadow border in dark theme and black in light theme :




It seems the color of the border is unaffected by the background - here is dark mode with colorful wallpaper and the border is still grey.



Whereas Firefox keeps a black border for both themes and so it doesn't show in dark mode.





Looking at other apps there seems to be a mix.  Word acts like Safari while ITerm2 acts like Firefox.  

There doesn't seem to be any way to remove this in Mojave - see this question.  Older fixes/tweaks (like Toggle OSX shadows) don't work any more.