/* Thin bar at the very top */
.nav-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 4100; pointer-events: none; opacity: 0; transition: opacity .3s; }
.nav-progress.on { opacity: 1; }
.nav-progress > span { display: block; width: 0; height: 100%; background: var(--accent, #f06c1a); box-shadow: 0 0 10px var(--accent, #f06c1a); border-radius: 0 3px 3px 0; transition: width .3s cubic-bezier(.22, 1, .36, 1); }

/* Overlay */
.boot {
    position: fixed;
    inset: 0;
    z-index: 4000;
    display: grid;
    place-items: center;
    color: var(--ink, #20232b);
    background: color-mix(in srgb, var(--bg, #f3f4f6) 72%, transparent);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .3s ease, visibility 0s linear .3s;
}
html.loader-on .boot { opacity: 1; visibility: visible; pointer-events: auto; transition: opacity .25s ease, visibility 0s; }
html.loader-splash .boot { background: var(--bg, #f3f4f6); -webkit-backdrop-filter: none; backdrop-filter: none; transition-duration: .5s; }

.boot-inner { display: flex; flex-direction: column; align-items: center; gap: 22px; padding: 24px; text-align: center; }

/* Logo with two orbiting rings */
.boot-logo { position: relative; width: 96px; height: 96px; display: grid; place-items: center; }
.boot-mark {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    font: 800 32px/1 'Onest', system-ui, sans-serif;
    color: var(--on-accent, #fff);
    background: var(--accent, #f06c1a);
    border-radius: 20px;
    box-shadow: 0 16px 32px -10px rgba(240, 108, 26, .75);
    animation: bootBob 1.6s ease-in-out infinite;
}
.boot-ring { position: absolute; inset: 0; border: 3px solid transparent; border-top-color: var(--accent, #f06c1a); border-right-color: rgba(240, 108, 26, .35); border-radius: 50%; animation: bootSpin 1.1s linear infinite; }
.boot-ring.r2 { inset: -12px; border-top-color: transparent; border-right-color: transparent; border-bottom-color: rgba(240, 108, 26, .55); border-left-color: rgba(240, 108, 26, .2); animation-duration: 1.8s; animation-direction: reverse; }

/* Splash-only parts */
.boot-brand, .boot-scan, .boot-msg { display: none; }
html.loader-splash .boot-brand { display: block; }
html.loader-splash .boot-scan { display: flex; }
html.loader-splash .boot-msg { display: block; }

.boot-brand { font: 700 22px/1.1 'Onest', system-ui, sans-serif; letter-spacing: -.03em; }
.boot-brand small { display: block; margin-top: 4px; font-size: 12px; font-weight: 500; letter-spacing: .08em; color: var(--muted, #6f7684); }
.boot-msg { min-height: 20px; font-size: 14px; color: var(--muted, #6f7684); }

/* Barcode with a sweeping laser */
.boot-scan { position: relative; align-items: center; justify-content: center; gap: 4px; min-width: 150px; height: 44px; }
.boot-scan i { display: block; width: 3px; height: 100%; background: currentColor; border-radius: 1px; opacity: .85; }
.boot-scan i:nth-child(2n) { width: 2px; }
.boot-scan i:nth-child(3n) { width: 5px; }
.boot-scan i:nth-child(5n) { width: 4px; }
.boot-scan i:nth-child(4n) { height: 76%; }
.boot-scan i:nth-child(7n) { height: 60%; }
.boot-scan::after {
    content: "";
    position: absolute;
    top: -7px;
    bottom: -7px;
    left: 0;
    width: 3px;
    background: var(--accent, #f06c1a);
    border-radius: 3px;
    box-shadow: 0 0 14px 3px rgba(240, 108, 26, .7);
    animation: bootLaser 1.3s ease-in-out infinite alternate;
}

@keyframes bootSpin  { to { transform: rotate(360deg); } }
@keyframes bootBob   { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-5px) rotate(3deg); } }
@keyframes bootLaser { to { left: calc(100% - 3px); } }

/* The old page slides away a little while the next one loads */
html.is-leaving .stage { opacity: 0; transform: translateY(-10px); transition: opacity .25s ease, transform .25s ease; }

/* Reduced motion: keep a slow spin so people can still see something is happening */
@media (prefers-reduced-motion: reduce) {
    .boot-ring { animation: bootSpin 2.4s linear infinite !important; }
    .boot-ring.r2 { animation-duration: 3.6s !important; }
    .boot-mark, .boot-scan::after { animation: none !important; }
    html.is-leaving .stage { transition: none; }
}