/* Loading screen (S1, 2026-10-09). Colours are the app's dashboard band
   (AppGradients.primary, AppAccent.dashboard); sizes match the splash:
   an 88px tile, a ring 16px round it. */
html, body {
    margin: 0;
    height: 100%;
    background: #514044;
}

.boot {
    position: fixed;
    inset: 0;
    overflow: hidden;
    background: linear-gradient(to bottom right, #906B55, #375873, #514044);
    transition: opacity 0.2s;
}

@media (prefers-color-scheme: dark) {
    html, body { background: #2E252A; }
    .boot { background: linear-gradient(to bottom right, #6E5345, #263D52, #2E252A); }
}

/* Drifting light. */
.boot-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(8px);
    animation: boot-drift 24s ease-in-out infinite alternate;
}
.boot-orb.o1 { width: 60vmin; height: 60vmin; left: -10vmin; top: 0; background: radial-gradient(circle, rgba(94,168,255,.30), rgba(94,168,255,0) 70%); }
.boot-orb.o2 { width: 66vmin; height: 66vmin; right: -14vmin; bottom: -6vmin; background: radial-gradient(circle, rgba(155,123,255,.30), rgba(155,123,255,0) 70%); animation-duration: 18s; animation-direction: alternate-reverse; }
.boot-orb.o3 { width: 46vmin; height: 46vmin; left: 40%; bottom: -20vmin; background: radial-gradient(circle, rgba(61,214,198,.30), rgba(61,214,198,0) 70%); animation-duration: 30s; }
@keyframes boot-drift {
    from { transform: translate(0, 0); }
    to { transform: translate(12vmin, 8vmin); }
}

/* Waves at the top and, mirrored, at the bottom. */
.boot-waves {
    position: absolute;
    left: 0;
    width: 100%;
    height: 22vh;
    overflow: hidden;
}
.boot-waves.top { top: 0; }
.boot-waves.bottom { bottom: 0; transform: scaleY(-1); }
.boot-waves svg { width: 200%; height: 100%; }
.boot-waves path { animation: boot-flow linear infinite; }
.boot-waves .w0 { animation-duration: 24s; }
.boot-waves .w1 { animation-duration: 12s; }
.boot-waves .w2 { animation-duration: 8s; }
.boot-waves.bottom path { animation-direction: reverse; }
@keyframes boot-flow {
    from { transform: translateX(0); }
    to { transform: translateX(-1440px); }
}

/* Sparkles rising and fading. */
.boot-sparks i {
    position: absolute;
    bottom: -10px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    animation: boot-rise linear infinite;
}
@keyframes boot-rise {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: .7; }
    80% { opacity: .5; }
    100% { transform: translateY(-105vh); opacity: 0; }
}

/* The tile breathing in the middle and turning like a mirror, as on the
   splash: a turn in the first half of a breath, then a rest. */
.boot-mark {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 120px;
    height: 120px;
    transform: translate(-50%, -50%);
    perspective: 660px;
}
.boot-flip {
    position: absolute;
    inset: 0;
    animation: boot-turn 2.4s infinite;
}
.boot-tile {
    position: absolute;
    left: 16px;
    top: 16px;
    width: 88px;
    height: 88px;
    border-radius: 24.6px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
    animation: boot-breathe 2.4s infinite;
    /* The logo's margin inside the tile, as on the splash (14%). */
    box-sizing: border-box;
    padding: 12.3px;
}
.boot-tile img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
@keyframes boot-turn {
    0% { transform: rotateY(0); animation-timing-function: cubic-bezier(.65, 0, .35, 1); }
    /* Negative: CSS turns the other way round from Flutter's rotateY. */
    50%, 100% { transform: rotateY(-360deg); }
}
/* The tile swells while it turns and rests at its size. */
@keyframes boot-breathe {
    0% { transform: scale(1); animation-timing-function: ease-out; }
    25% { transform: scale(1.04); animation-timing-function: ease-in; }
    50%, 100% { transform: scale(1); }
}
/* The loading bar where the splash draws it, under the app's name. */
.boot-bar {
    position: absolute;
    left: 16px;
    top: 184px;
    width: 88px;
    height: 3px;
    border-radius: 1.5px;
    overflow: hidden;
    background: rgba(255, 255, 255, .18);
}
.boot-bar::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 40%;
    height: 100%;
    border-radius: 1.5px;
    background: rgba(255, 255, 255, .85);
    animation: boot-run 1.3s ease-in-out infinite;
}
@keyframes boot-run {
    from { transform: translateX(-100%); }
    to { transform: translateX(250%); }
}

@media (prefers-reduced-motion: reduce) {
    .boot *, .boot-waves path { animation: none !important; }
}
