/*
 * Full-screen start-up overlay: a determinate bar while the wasm module and the
 * AI models download (js/core/assets.js reports real bytes), then a striped
 * indeterminate phase while the SDK starts its engine.
 */
.boot {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--offset);
    background-color: var(--color-gray-light);
    transition: opacity var(--transition);
}

.boot--hidden {
    opacity: 0;
    pointer-events: none;
}

.boot__panel {
    width: min(320px, 100%);
    text-align: center;
}

.boot__step {
    min-height: 1.2em;
    font-size: 14px;
    color: var(--color-gray-dark);
}

.boot__bar {
    position: relative;
    margin-top: 12px;
    height: 6px;
    border-radius: var(--radius-pill);
    background-color: var(--color-gray);
    overflow: hidden;
}

.boot__fill {
    position: relative;
    width: 0;
    height: 100%;
    border-radius: var(--radius-pill);
    background-color: var(--color-accent);
    transition: width 0.25s ease-out;
}

/* Shine sweeping across the filled part, so a stalled network still looks alive. */
.boot__fill::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        var(--color-white-transparent) 50%,
        transparent 100%
    );
    transform: translateX(-100%);
    animation: boot-shine 1.6s ease-in-out infinite;
}

/* Engine start-up reports no progress: stripes carry the motion instead. */
.boot[data-phase="engine"] .boot__fill {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.35) 0 10px,
        transparent 10px 20px
    );
    background-size: 28px 28px;
    animation: boot-stripes 0.8s linear infinite;
}

.boot[data-phase="error"] .boot__fill {
    background-color: var(--color-gray-dark);
}

.boot[data-phase="error"] .boot__fill::after {
    animation: none;
}

.boot__percent {
    margin-top: 8px;
    font-size: 12px;
    color: var(--color-gray-dark);
    font-variant-numeric: tabular-nums;
}

@keyframes boot-shine {
    to {
        transform: translateX(100%);
    }
}

@keyframes boot-stripes {
    to {
        background-position: 28px 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .boot__fill::after,
    .boot[data-phase="engine"] .boot__fill {
        animation: none;
    }
}
