:root {
    --glass-bg: rgba(30, 30, 30, 0.65);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --accent: #5865F2; /* Discord Blurple */
    --accent-hover: #4752C4;
    --mac-accent: #007AFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-image: url('image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    overflow: hidden;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

/* macOS boot screen */
.boot-screen {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    background: #050505;
    opacity: 1;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

.boot-screen.is-done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.boot-logo {
    color: #f5f5f7;
    font-size: 86px;
    line-height: 1;
    filter: drop-shadow(0 0 18px rgba(255, 255, 255, 0.08));
}

.boot-progress {
    width: min(220px, 42vw);
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.24);
}

.boot-progress span {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: #f5f5f7;
    transform: scaleX(0);
    transform-origin: left;
    animation: bootProgress 2.5s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

body.is-booting .menubar,
body.is-booting .main-area,
body.is-booting .dock-container {
    pointer-events: none;
}

body.boot-ready .menubar,
body.boot-ready .main-area,
body.boot-ready .dock-container {
    animation: desktopReveal 0.65s ease both;
}

@keyframes bootProgress {
    0% { transform: scaleX(0); }
    45% { transform: scaleX(0.58); }
    72% { transform: scaleX(0.78); }
    100% { transform: scaleX(1); }
}

@keyframes desktopReveal {
    from {
        opacity: 0;
        filter: blur(10px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

/* Menu Bar */
.menubar {
    height: 28px;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    font-size: 13px;
    color: white;
    z-index: 1000;
}

.menubar-left, .menubar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.apple-icon {
    font-size: 16px;
}

.menu-item {
    cursor: default;
}
.menu-item.bold {
    font-weight: 600;
}

.main-area {
    flex: 1;
    min-height: calc(100vh - 28px);
    margin: 0 auto;
    padding: 36px 32px 118px;
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow-y: auto;
}

/* Profiles Grid */
.profiles-grid {
    width: 100%;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 32px;
}

.profile-card {
    flex: 1 1 320px;
    min-width: min(320px, 100%);
    max-width: 380px;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 2px solid transparent;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    outline: none;
    cursor: pointer;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
    border-color: rgba(255,255,255,0.2);
}

/* Arrow Navigation Focus State */
.profile-card.focused {
    border-color: var(--accent);
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.3), 0 10px 20px rgba(0,0,0,0.3);
    background: transparent;
}

.profile-banner {
    height: 92px;
    background-size: cover;
    background-position: center;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: -40px auto 0;
    border: none;
    position: relative;
    z-index: 1;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    padding: 18px;
    text-align: center;
}

.profile-info h2 {
    font-size: 20px;
    margin-bottom: 4px;
}

.profile-info .tag {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.badges {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.badge-img {
    height: 22px;
    object-fit: contain;
}

/* Dock */
.dock-container {
    position: absolute;
    bottom: 16px;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
}

.dock {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--glass-shadow);
}

.dock-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
}

.dock-icon img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    transition: transform 0.2s;
}

.dock-icon:hover {
    transform: scale(1.2) translateY(-10px);
    margin: 0 10px;
}

.dock-icon:hover img {
    transform: scale(1.1);
}

.dock-separator {
    width: 1px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    margin: 0 4px;
}

.dot {
    width: 4px;
    height: 4px;
    background: var(--text-secondary);
    border-radius: 50%;
    position: absolute;
    bottom: -6px;
    display: none;
}

@media (max-width: 720px) {
    body {
        height: 100svh;
        min-height: 100svh;
        overflow: hidden;
    }

    .menubar {
        overflow: hidden;
        padding: 0 max(12px, env(safe-area-inset-left)) 0 max(12px, env(safe-area-inset-left));
        white-space: nowrap;
    }

    .menubar-left {
        min-width: 0;
        width: 100%;
        justify-content: space-between;
        gap: 0;
    }

    .menubar-right {
        display: none;
    }

    .menu-item {
        font-size: 12px;
        flex: 0 0 auto;
    }

    .main-area {
        justify-content: flex-start;
        min-height: calc(100svh - 28px);
        overflow-y: auto;
        padding: calc(24px + env(safe-area-inset-top)) 18px calc(96px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(156px + env(safe-area-inset-bottom));
    }

    .profiles-grid {
        gap: 32px;
    }

    .profile-card {
        flex-basis: 100%;
        max-width: 100%;
    }

    .profile-card:last-child {
        scroll-margin-bottom: calc(156px + env(safe-area-inset-bottom));
    }

    .profile-banner {
        height: 64px;
    }

    .profile-avatar {
        width: 76px;
        height: 76px;
        margin-top: -32px;
    }

    .profile-info {
        padding: 14px;
    }

    .dock-container {
        position: fixed;
        display: flex;
        bottom: calc(24px + env(safe-area-inset-bottom));
        left: 0;
        margin: 0;
        pointer-events: auto;
    }

    .dock {
        transform: none;
        transform-origin: center bottom;
    }

    .profile-card:hover,
    .profile-card.focused {
        border-color: transparent;
        box-shadow: none;
        transform: none;
    }
}
