/* Only this outer canvas responds to window size; its contents scale together. */
html { width: 100%; height: 100%; }
body {
    margin: 0;
    min-width: 100%;
    min-height: 100%;
    display: flex;
    background: #faf9f4 url('../img/BG.svg') center / cover fixed;
}
#verge-stage { position: relative; flex: none; margin: auto; }
#verge-page {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    transform-origin: top left;
    display: block;
}
/* Phones held upright: turn the landscape canvas a quarter turn to fill the screen. */
body.is-rotated { overflow: hidden; }
body.is-rotated #verge-stage {
    position: fixed;
    top: 50%;
    left: 50%;
    margin: 0;
    transform: translate(-50%, -50%) rotate(90deg);
}

/* Loading screen over the canvas (js/page-scale.js). Same background as the page, so a
   fast load looks like nothing happened; the logo and progress line appear after 0.35s. */
.verge-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 22px;
    background: #faf9f4 url('../img/BG.svg') center / cover fixed;
    transition: opacity .4s ease;
}
.verge-loading > * { opacity: 0; animation: verge-loading-in .4s ease .35s forwards; }
.verge-loading img { width: 132px; height: auto; }
.verge-loading span { display: flex; gap: 9px; }
.verge-loading i { width: 7px; height: 7px; border-radius: 50%; background: #a88c4a; opacity: .25; animation: verge-loading-dot 1.2s ease-in-out infinite; }
.verge-loading i:nth-child(2) { animation-delay: .2s; }
.verge-loading i:nth-child(3) { animation-delay: .4s; }
.verge-loading.is-done { opacity: 0; pointer-events: none; }
@keyframes verge-loading-in { to { opacity: 1; } }
@keyframes verge-loading-dot { 0%, 80%, 100% { opacity: .25; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .verge-loading { transition: none; } .verge-loading i { animation: none; opacity: .6; } }
