/* Keep projection edges black while the existing sky remains visible in the centre. */
:root{background:#000;color-scheme:dark}
body{background-color:#000}
/* Fill the system safe area when an installed Apple web app draws edge to edge. */
body::before{content:"";position:fixed;inset:0 0 auto;height:env(safe-area-inset-top,0px);background:#000;z-index:10000;pointer-events:none}
:root{--projection-inset:clamp(32px,10svh,120px);--projection-shade:linear-gradient(to bottom,#000 0%,rgba(0,0,0,.85) 3%,rgba(0,0,0,.35) 8%,transparent 20%,transparent 80%,rgba(0,0,0,.35) 92%,rgba(0,0,0,.85) 97%,#000 100%)}
body::after{content:"";position:fixed;inset:0;z-index:9999;pointer-events:none;background:var(--projection-shade)}
.app,.cover{padding-top:max(var(--projection-inset),env(safe-area-inset-top));padding-bottom:max(var(--projection-inset),env(safe-area-inset-bottom))}
#save-dialog{max-height:calc(100svh - 2*var(--projection-inset))}
#save-dialog::backdrop{background:var(--projection-shade),#102a2966}
body:has(> #work){box-sizing:border-box;min-height:100svh;padding-block:var(--projection-inset)}
body> #work{max-height:68svh;object-fit:contain}
@media(max-height:600px){:root{--projection-inset:clamp(20px,6svh,36px)}}

.fullscreen-toggle svg{width:18px;height:18px;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
.fullscreen-toggle[hidden]{display:none}
:root:fullscreen{background:#000}
:root:-webkit-full-screen{background:#000}

/* A fine monochrome film layer sits above the scene and below its black edge mask. */
html::after{content:"";position:fixed;inset:0;z-index:9998;pointer-events:none;background-image:url("/assets/film-grain.svg?v=20261022-strong");background-size:150px 150px;opacity:.32;mix-blend-mode:soft-light}
html:has(body.gallery-projection)::after{z-index:1}

/* Slow local light blooms stay beneath film grain and the black projection mask. */
.atmosphere-glow{position:fixed;inset:0;z-index:9997;pointer-events:none;opacity:0;mix-blend-mode:screen;background:radial-gradient(ellipse 28vw 30vh at var(--glow-x,50%) var(--glow-y,50%),rgba(255,235,190,.58),rgba(255,240,213,.17) 42%,transparent 80%),radial-gradient(ellipse 40vw 35vh at 60% 58%,rgba(165,222,218,.23),transparent 75%)}
body.gallery-projection>.atmosphere-glow{z-index:1}
@media(prefers-reduced-motion:reduce){.atmosphere-glow{display:none}}

/* Prevent page zoom without disabling custom canvas pinch or dialog scrolling. */
html,body{touch-action:pan-x pan-y}
