Give every page a solid background
The window is a clip-path on the new page. A page without a background shows the old one through it and the window disappears.
Keep the nav outside the pages
The nav bar is a sibling of the pages, so it never scales or clips. Put anything else that should hold still (a logo, a header) next to it, with a z-index above 2.
One title per page
The script lifts the element marked data-wgr-title. Leave it out on a page and that page just opens.