/* ═══════════════════════════════════════════════════════════
   BOOT.CSS — BOYPERSIA startup sequence
   Phase 1 : Boot screen  (auto ~2.8s)
   Phase 2 : Login screen (user click)
   Phase 3 : Welcome flash → site reveal
   ════════════════════════════════════════════════════════ */

/* ─── Shared overlay base ─── */
#boot-screen,
#login-screen,
#boot-welcome {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ══════════════════════════════════
   PHASE 1 — BOOT SCREEN
   ══════════════════════════════════ */
#boot-screen {
    background: #050912;
    z-index: 99992;
    transition: opacity 0.45s ease;
}
#boot-screen.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* BIOS lines — top-left corner */
.boot-bios {
    position: absolute;
    top: 24px;
    left: 28px;
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(7px, 0.9vw, 10px);
    color: rgba(255, 255, 255, 0.22);
    line-height: 1.8;
    pointer-events: none;
}
.boot-bios span {
    display: block;
    opacity: 0;
    animation: bios-appear 0.05s forwards;
}
.boot-bios span:nth-child(1) { animation-delay: 0.08s; }
.boot-bios span:nth-child(2) { animation-delay: 0.26s; }
.boot-bios span:nth-child(3) { animation-delay: 0.44s; }
.boot-bios span:nth-child(4) { animation-delay: 0.62s; }
.boot-bios span:nth-child(5) { animation-delay: 0.80s; }
.boot-bios span:nth-child(6) { animation-delay: 1.00s; }

/* Main logo — XP blue with a pink warmth */
.boot-logo {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(30px, 7vw, 72px);
    letter-spacing: 0.2em;
    color: #e8ecf8;
    text-shadow:
        0 0 18px rgba(45, 125, 224, 0.95),
        0 0 40px rgba(45, 125, 224, 0.5),
        0 0 80px rgba(255, 34, 204, 0.15);
    margin-bottom: 6px;
    animation: boot-flicker 0.06s linear 0.5s 3;
    will-change: opacity;
}

.boot-tagline {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(7px, 1.1vw, 11px);
    letter-spacing: 0.28em;
    color: rgba(45, 125, 224, 0.55);
    text-transform: uppercase;
    margin-bottom: 52px;
}

/* Loading bar — XP Luna blue */
.boot-bar-wrap {
    width: min(340px, 74vw);
    margin-bottom: 14px;
}
.boot-bar-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 8px;
    color: rgba(255, 255, 255, 0.28);
    letter-spacing: 0.16em;
    margin-bottom: 6px;
    text-transform: uppercase;
}
.boot-bar-track {
    width: 100%;
    height: 5px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(27, 100, 200, 0.3);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}
.boot-bar-fill {
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #0e3a9e, #1b64c8, #2d7de0, #4a9af0);
    border-radius: 2px;
    animation: bar-fill 2.2s cubic-bezier(0.42, 0, 0.6, 1) 0.35s forwards;
    position: relative;
}
/* Trailing sheen on fill */
.boot-bar-fill::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    background: linear-gradient(90deg, transparent, rgba(180, 220, 255, 0.8));
}

/* XP-style sweep blocks below bar — royal blue */
.boot-sweep-wrap {
    width: min(340px, 74vw);
    height: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(27, 100, 200, 0.15);
    background: rgba(27, 100, 200, 0.04);
    margin-bottom: 36px;
}
.boot-sweep-block {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 70px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(45, 125, 224, 0.45) 35%,
        rgba(74, 154, 240, 0.90) 50%,
        rgba(45, 125, 224, 0.45) 65%,
        transparent 100%
    );
    animation: sweep 0.88s linear infinite;
    animation-delay: calc(var(--d) * 0.29s);
}

/* Copyright footer */
.boot-copyright {
    position: absolute;
    bottom: 20px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 7px;
    color: rgba(255, 255, 255, 0.17);
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

/* ══════════════════════════════════
   PHASE 2 — LOGIN SCREEN (Windows XP faithful)
   ══════════════════════════════════ */
#login-screen {
    z-index: 99991;
    background: linear-gradient(180deg,
        #1e46b4 0%,
        #3468cc 12%,
        #3f74d4 50%,
        #3468cc 88%,
        #1e46b4 100%
    );
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    cursor: default;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.55s ease;
}
#login-screen.active {
    opacity: 1;
    pointer-events: auto;
}

/* ── Top band ── */
.xp-ls-topbar {
    flex-shrink: 0;
    height: 56px;
    background: linear-gradient(180deg, #0e1e78 0%, #1e3aa8 100%);
    border-bottom: 2px solid rgba(100, 150, 230, 0.6);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ── Main split layout ── */
.xp-ls-body {
    flex: 1;
    display: flex;
    align-items: stretch;
    min-height: 0;
}

/* ── Left branding panel ── */
.xp-ls-left {
    flex: 0 0 auto;
    width: min(280px, 36vw);
    padding: clamp(28px, 6vh, 70px) clamp(18px, 3vw, 44px);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    background: rgba(0, 0, 0, 0.12);
}

/* Windows XP flag logo */
.xp-flag-logo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    width: 52px;
    height: 52px;
    gap: 3px;
    margin-bottom: 4px;
}
.xp-flag-logo div { border-radius: 3px; }
.xf-r { background: linear-gradient(135deg, #ec3c1c, #c82010); }
.xf-g { background: linear-gradient(135deg, #2aba2a, #1a9a1a); }
.xf-b { background: linear-gradient(135deg, #1c58e0, #103cc8); }
.xf-y { background: linear-gradient(135deg, #f4c818, #d8a800); }

/* Wordmark */
.xp-wordmark {
    display: flex;
    flex-direction: column;
    line-height: 1;
    margin-bottom: 2px;
}
.xp-ms-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.62);
    font-style: italic;
    font-family: 'Times New Roman', serif;
    letter-spacing: 0.02em;
}
.xp-ms-label sup { font-size: 7px; }
.xp-win-label {
    font-size: clamp(24px, 3.6vw, 36px);
    color: #ffffff;
    font-weight: 200;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    letter-spacing: -0.01em;
    line-height: 1.05;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}
.xp-xp-label {
    font-size: clamp(17px, 2.6vw, 24px);
    color: #f2ca20;
    font-style: italic;
    font-weight: 700;
    font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
    line-height: 1;
    margin-top: -3px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Horizontal divider */
.xp-ls-hr {
    width: 100%;
    height: 1px;
    border: none;
    background: linear-gradient(90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.38) 20%,
        rgba(255, 255, 255, 0.38) 80%,
        transparent 100%
    );
    margin: 0;
}

/* Prompt text */
.xp-ls-prompt {
    font-size: clamp(11px, 1.2vw, 14px);
    color: rgba(255, 255, 255, 0.90);
    font-family: 'Tahoma', Arial, sans-serif;
    line-height: 1.45;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

/* ── Vertical separator ── */
.xp-ls-vsep {
    width: 1px;
    background: linear-gradient(180deg,
        transparent 0%,
        rgba(255, 255, 255, 0.20) 12%,
        rgba(255, 255, 255, 0.20) 88%,
        transparent 100%
    );
    flex-shrink: 0;
}

/* ── Right users panel ── */
.xp-ls-right {
    flex: 1;
    padding: clamp(20px, 5vh, 60px) clamp(20px, 4vw, 60px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

/* User row */
.xp-user-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 10px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.12s, outline 0.12s;
    max-width: 380px;
}
.xp-user-item:hover {
    background: rgba(255, 255, 255, 0.18);
    outline: 1px solid rgba(255, 255, 255, 0.28);
}

/* Avatar */
.xp-user-avatar {
    width: 74px;
    height: 74px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.38);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
    background: #b83018;
    position: relative;
}
.xp-user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
}
.xp-ua-fallback {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    font-family: 'Share Tech Mono', monospace;
    background: linear-gradient(135deg, #b83018, #7a1a08);
}

/* User text */
.xp-user-meta {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.xp-user-name {
    font-size: clamp(14px, 1.6vw, 18px);
    font-weight: 700;
    color: #ffffff;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.06em;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}
.xp-user-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.62);
    font-family: 'Tahoma', Arial, sans-serif;
}

/* ── Bottom band ── */
.xp-ls-bottombar {
    flex-shrink: 0;
    height: 56px;
    background: linear-gradient(180deg, #1e3aa8 0%, #0e1e78 100%);
    border-top: 2px solid rgba(100, 150, 230, 0.6);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 clamp(14px, 2vw, 28px);
}

/* Turn off computer button */
.xp-turnoff-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.80);
    font-size: 11px;
    font-family: 'Tahoma', Arial, sans-serif;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 3px;
    transition: background 0.12s;
}
.xp-turnoff-btn:hover {
    background: rgba(255, 255, 255, 0.10);
    outline: 1px solid rgba(255, 255, 255, 0.18);
}
.xp-power-orb {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 30%, #f05840, #b41010);
    border: 1px solid rgba(0, 0, 0, 0.35);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 140, 110, 0.45);
    flex-shrink: 0;
}

/* Bottom help text */
.xp-ls-help {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.48);
    font-family: 'Tahoma', Arial, sans-serif;
    text-align: right;
    max-width: 300px;
    line-height: 1.4;
}

/* ══════════════════════════════════
   PHASE 3 — WELCOME FLASH
   ══════════════════════════════════ */
#boot-welcome {
    z-index: 99993;
    background: #050912;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
}
#boot-welcome.show {
    opacity: 1;
}
.welcome-text {
    font-family: 'Share Tech Mono', monospace;
    font-size: clamp(22px, 6vw, 56px);
    letter-spacing: 0.5em;
    color: #fff;
    text-shadow:
        0 0 28px rgba(255, 0, 204, 1),
        0 0 60px rgba(255, 0, 204, 0.5),
        0 0 100px rgba(255, 0, 204, 0.2);
    animation: welcome-bloom 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* ══════════════════════════════════
   BODY HIDING DURING BOOT
   ══════════════════════════════════ */
body.booting > *:not(#boot-screen):not(#login-screen):not(#boot-welcome) {
    opacity: 0 !important;
    pointer-events: none !important;
}
body.boot-done > *:not(#boot-screen):not(#login-screen):not(#boot-welcome) {
    opacity: 1;
    transition: opacity 0.65s ease 0.05s;
}

/* ══════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════ */
@keyframes bios-appear {
    to { opacity: 1; }
}
@keyframes boot-flicker {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.2; }
}
@keyframes bar-fill {
    0%   { width:   0%; }
    14%  { width:  10%; }
    35%  { width:  30%; }
    55%  { width:  52%; }
    74%  { width:  73%; }
    90%  { width:  89%; }
    100% { width: 100%; }
}
@keyframes sweep {
    from { left: -80px; }
    to   { left: calc(100% + 10px); }
}
@keyframes panel-appear {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
@keyframes cta-blink {
    0%, 100% { opacity: 0.65; }
    50%       { opacity: 0.12; }
}
@keyframes welcome-bloom {
    from { transform: scale(0.88); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

/* ══════════════════════════════════
   ACCESSIBILITY — reduced motion
   ══════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
    #boot-screen,
    #login-screen,
    #boot-welcome {
        display: none !important;
    }
    body.booting > *:not(#boot-screen):not(#login-screen):not(#boot-welcome) {
        opacity: 1 !important;
        pointer-events: auto !important;
    }
}

/* ══════════════════════════════════
   MOBILE
   ══════════════════════════════════ */
@media (max-width: 480px) {
    .boot-bios      { font-size: 7px; left: 14px; top: 14px; }
    .boot-logo      { font-size: clamp(26px, 9vw, 42px); }
    .xp-ls-topbar, .xp-ls-bottombar { height: 44px; }
    .xp-ls-left     { width: 130px; padding: 20px 14px; }
    .xp-win-label   { font-size: 20px; }
    .xp-xp-label    { font-size: 14px; }
    .xp-flag-logo   { width: 38px; height: 38px; }
    .xp-user-avatar { width: 56px; height: 56px; }
    .xp-user-name   { font-size: 13px; }
    .xp-ls-help     { display: none; }
    .xp-ls-right    { padding: 16px 14px; }
}

/* Welcome text — keep XP blue glow */
.welcome-text {
    text-shadow:
        0 0 28px rgba(45, 125, 224, 1),
        0 0 60px rgba(45, 125, 224, 0.5),
        0 0 100px rgba(255, 34, 204, 0.15);
}
