/* The page around Avalonia's drawing surface. Colours come from brand.css (generated from the desktop tokens by tools\dev\Export-DesignTokens.ps1);
   no colour is written here. The body has the product's font, as Construction 1.5.6's portal (drift row 24: it was the browser's Times New Roman). */
html,
body {
  margin: 0; padding: 0; width: 100%; height: 100%; overflow: hidden; background: var(--nagi-page);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

/* The page the browser shows while the application downloads and starts, as Construction 1.5.6's (cms.nagisoftware.com, HR's look): the warm page
   with dark text, the small colour snake at the top left, the accent bar and "Starting up…". The loading screen is always the light warm page, like
   the start page: no dark variant before the app has loaded. Avalonia removes .avalonia-splash itself when it draws its first frame. */
.avalonia-splash { position: absolute; height: 100%; width: 100%; display: flex; justify-content: center; align-items: center;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--nagi-ink); text-align: center; background: var(--nagi-page); }

.avalonia-splash .splash-box { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 460px; padding: 0 24px; }
.avalonia-splash .splash-name { font-size: 28px; font-weight: 600; }
.avalonia-splash .splash-bar { width: 240px; height: 4px; border-radius: 2px; background: rgba(31, 31, 31, 0.12); overflow: hidden; }
.avalonia-splash .splash-bar > span { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--nagi-accent);
  animation: splash-slide 1.3s ease-in-out infinite; }
.avalonia-splash .splash-note { font-size: 14px; line-height: 1.4; color: var(--nagi-ink-muted); }
.avalonia-splash .splash-snake, .nagi-loading .splash-snake { position: absolute; top: 24px; left: 28px; height: 44px; width: auto; }

@keyframes splash-slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }

/* The overlay that covers the application's own opening view for the whole start: same look, always on top, its bar moves on the compositor. */
.nagi-loading { position: fixed; inset: 0; z-index: 2147483000; display: flex; justify-content: center; align-items: center;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif; color: var(--nagi-ink); text-align: center; background: var(--nagi-page);
  transition: opacity 250ms; }
.nagi-loading.nagi-loading-done { opacity: 0; pointer-events: none; }
.nagi-loading .splash-box { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 460px; padding: 0 24px; }
.nagi-loading .splash-name { font-size: 28px; font-weight: 600; }
.nagi-loading .splash-bar { width: 240px; height: 4px; border-radius: 2px; background: rgba(31, 31, 31, 0.12); overflow: hidden; }
.nagi-loading .splash-bar > span { display: block; width: 40%; height: 100%; border-radius: 2px; background: var(--nagi-accent); will-change: transform;
  animation: splash-slide 1.3s ease-in-out infinite; }
.nagi-loading .splash-note { font-size: 14px; line-height: 1.4; color: var(--nagi-ink-muted); }
/* The line under the note: "Still downloading about 16 MB..." after 60 s, or the retry button when the download failed. */
.nagi-loading .splash-slow[hidden] { display: none; }
.nagi-loading .splash-retry { font: inherit; font-size: 14px; padding: 6px 18px; border-radius: 6px; border: 1px solid var(--nagi-accent);
  background: var(--nagi-accent); color: #fff; cursor: pointer; }

.avalonia-splash.splash-close {
    transition: opacity 200ms, display 200ms;
    display: none;
    opacity: 0;
}

/* The page a phone-sized device gets instead of the portal (main.js, isPhone): the brand steel blue, the white mark at Construction's size (48 px). */
.phone-page { box-sizing: border-box; min-height: 100vh; padding: 40px 24px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 14px; text-align: center; color: var(--nagi-on-brand); font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, var(--nagi-brand-start) 0%, var(--nagi-brand-end) 100%); }
.phone-page .phone-logo { height: 48px; width: auto; }
.phone-page h1 { margin: 6px 0 4px; font-size: 24px; font-weight: 600; line-height: 1.25; }
.phone-page p { margin: 0; max-width: 420px; font-size: 16px; line-height: 1.5; color: rgba(255, 255, 255, 0.92); }
.phone-page .phone-link { margin-top: 8px; padding: 12px 22px; border-radius: 10px; border: 1px solid currentColor; color: var(--nagi-on-brand);
  font-size: 16px; font-weight: 600; text-decoration: none; background: rgba(255, 255, 255, 0.12); }

/* The bar nagi-browser.js shows for a failure nobody caught: token colours from brand.css. */
.nagi-top-bar { position: fixed; left: 0; right: 0; top: 0; padding: 10px 16px; color: var(--nagi-on-brand); font: 14px Selawik, "Segoe UI", sans-serif;
  display: flex; gap: 12px; align-items: center; justify-content: center; }
.nagi-top-bar.nagi-notice { z-index: 2147483646; background: var(--nagi-danger); }
.nagi-top-bar button { padding: 4px 12px; border: 0; border-radius: 4px; background: var(--nagi-on-brand); font: inherit; cursor: pointer; }
.nagi-top-bar.nagi-notice button { color: var(--nagi-danger); }
