/* Mini-app opening screen: the OmniTrace radar mark (2026-10-19).
 *
 * COPIED from the public site (app/web/index.html `.mark-hero`, app/web/site.css `.ot-sweep`) —
 * never linked: app/web has its own release cycle and another session edits it.
 * No live feed here: the dots stay dim, only the sweep turns and the rose flag breathes, so the
 * screen claims no detection. Colours are the scan result's tokens (result.css). No orange.
 */
/* Sized to the part of the screen Telegram actually SHOWS. On iPhone the webview is full height
   while the sheet slides up, so a full-height box + vh centred the radar below the visible edge (iPhone 8,
   2026-10-19). Telegram's script keeps --tg-viewport-height current. */
#loader.ot-boot {
    position: fixed; top: 0; left: 0; right: 0; bottom: auto; z-index: 50;
    height: var(--tg-viewport-height, 100vh);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 16px; box-sizing: border-box;
    background: #07090D; color: #F1EBDE;
    font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    transition: opacity .8s ease;
    overflow: hidden;
}
#loader.ot-boot.is-leaving { opacity: 0; pointer-events: none; }
#loader .ot-boot-mark {
    width: min(62vw, calc(var(--tg-viewport-height, 100vh) * .42), 300px);
    height: min(62vw, calc(var(--tg-viewport-height, 100vh) * .42), 300px);
    flex: none;
}
#loader .ot-boot-mark svg { width: 100%; height: 100%; display: block; }
#loader .ot-boot-name { font-size: 20px; font-weight: 600; letter-spacing: .5px; margin: 0; }
#loader .ot-boot-status {
    font-family: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: #7E8C9A;
    margin: 0; min-height: 1.4em; text-align: center; padding: 0 16px;
}
#loader .ot-boot-status.is-error { color: #FF3D63; text-transform: none; letter-spacing: 0; }

/* `transform-box: view-box` BEFORE `transform-origin` — without it older WebKit pivots the sweep
   around the wrong point and the radar sits still (site gotcha, iPhone 8, 2026-09-07). */
#loader .ot-sweep {
    transform-box: view-box; -webkit-transform-box: view-box;
    transform-origin: 120px 150px; -webkit-transform-origin: 120px 150px;
    animation: ot-boot-sweep 7s linear infinite;
}
@keyframes ot-boot-sweep { to { transform: rotate(360deg); } }
#loader .ot-flag {
    animation: ot-boot-breathe 3.4s ease-in-out infinite;
}
@keyframes ot-boot-breathe { 0%, 100% { opacity: .75; } 50% { opacity: 1; } }

/* A still radar under reduced motion is correct, not a fault. */
@media (prefers-reduced-motion: reduce) {
    #loader .ot-sweep, #loader .ot-flag { animation: none; }
}
