:root {
    /* BACKGROUND: Deepened base with enhanced vibrant pink and brilliant white punch */
    --bg-gradient: 
        radial-gradient(at 0% 0%, rgba(200, 220, 255, 1) 0px, transparent 55%),
        radial-gradient(at 100% 0%, rgba(255, 255, 255, 1) 0px, transparent 55%),
        radial-gradient(at 100% 100%, rgba(210, 235, 255, 1) 0px, transparent 55%),
        radial-gradient(at 0% 100%, rgba(255, 205, 230, 1) 0px, transparent 65%), 
        #e2e6f0; /* Deepened the base silver so the pure whites actually pop */
        
    /* BOXES: Ultra-transparent glass to let the vibrant background do the heavy lifting */
    --glass-bg: rgba(255, 255, 255, 0.15); /* Dropped from 0.25 to 0.15 */
    --glass-border: rgba(255, 255, 255, 0.6); /* Softened the rim slightly */
    --glass-shadow: 
        0 15px 40px rgba(31, 38, 135, 0.15), /* Slightly richer shadow for lift */
        inset 0 0 20px rgba(255, 255, 255, 0.6); /* Stronger inner frost to keep the shape defined */
    
    --text-main: #1d1d1f; 
    --text-muted: #86868b;
    --nav-hover: rgba(255, 255, 255, 0.6); 
    --nav-active: rgba(0, 0, 0, 0.04);
    --pop-shadow: 0 15px 30px rgba(31, 38, 135, 0.25);
    --btn-text: #ffffff;
}

body.dark-mode {
    /* BACKGROUND: Deep Space Aurora */
    /* Richer, more vibrant nebula orbs against a pure void */
    --bg-gradient: 
        radial-gradient(circle at 15% 20%, rgba(60, 30, 110, 0.45) 0%, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(20, 70, 120, 0.45) 0%, transparent 40%),
        radial-gradient(circle at 50% 100%, rgba(45, 20, 70, 0.3) 0%, transparent 40%),
        #030305; 
        
    /* BOXES: Untouched perfect dark frosted grey */
    --glass-bg: rgba(30, 30, 35, 0.45);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
    
    --text-main: #f5f5f7; 
    --text-muted: #a1a1a6;
    --nav-hover: rgba(70, 70, 75, 0.8); 
    --nav-active: rgba(255, 255, 255, 0.1);
    --pop-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    --btn-text: #000000;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-main);
    min-height: 150vh; 
    padding: 120px 20px 50px 20px; 
    display: flex;
    justify-content: center;
    align-items: flex-start;
    transition: background 0.4s ease, color 0.4s ease;
}

.app-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* === DYNAMIC FIXED NAVIGATION DOCK === */
.glass-nav {
    position: fixed;
    top: 20px;
    left: 0;
    right: 0;
    margin: 0 auto;
    
    /* Smaller Nav Bar width */
    max-width: 800px; 
    width: calc(100% - 40px);
    
    z-index: 1000;
    padding: 8px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between; 
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px); 
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    
    /* Less round corners */
    border-radius: 20px; 
    
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.glass-nav:hover { padding: 15px 30px; }

.glass-nav.scrolled { opacity: 0.15; transform: scale(0.98); }
.glass-nav.scrolled:hover { opacity: 1; transform: scale(1); }

.nav-brand {
    font-weight: 600;
    padding: 10px;
    z-index: 2; /* Keeps it above the centered links */
}

/* Forces the center links and right actions onto the same row */
.nav-bottom-row {
    display: contents; /* Allows children to participate in the main flexbox */
}

/* Absolutely centering the main icons */
.nav-links {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 5px;
}

.nav-actions {
    display: flex;
    gap: 5px;
    z-index: 2;
}

/* === ICON & TEXT HOVER LOGIC === */
.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 16px; 
    border-radius: 30px;
    cursor: pointer;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Phosphor Icon Sizing */
.ph, .ph-fill { font-size: 1.25rem; }

.icon-dark { display: none; }
.icon-light { display: inline-block; }

.nav-item.active .icon-dark, .nav-item:hover .icon-dark { display: inline-block; }
.nav-item.active .icon-light, .nav-item:hover .icon-light { display: none; }

.nav-text {
    max-width: 0;
    opacity: 0;
    margin-left: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.95rem;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.nav-item:hover .nav-text {
    max-width: 120px;
    opacity: 1;
    margin-left: 10px;
}

/* Pop Effect */
.nav-item.active { background: var(--nav-active); font-weight: 500; }
.nav-bottom-row:hover .nav-item.active { background: transparent; font-weight: 400; }

.nav-item:hover {
    background: var(--nav-hover) !important;
    transform: scale(1.15); 
    box-shadow: var(--pop-shadow);
    font-weight: 500;
    z-index: 10; 
}

/* === GLASS CONTENT BOX === */
.glass-content {
    flex-grow: 1;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    
    /* Less round corners */
    border-radius: 20px; 
    
    min-height: 65vh;
    position: relative;
    overflow: hidden;
    padding: 50px;
    transition: all 0.4s ease;
}

.content-section {
    position: absolute;
    top: 50px; left: 50px; right: 50px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.content-section.active-content { opacity: 1; visibility: visible; transform: translateY(0); }

h1 { font-size: 2.5rem; font-weight: 600; letter-spacing: -0.5px; margin-bottom: 15px; }
p { font-size: 1.1rem; color: var(--text-muted); }
.action-btn {
    display: inline-block; background: var(--text-main); color: var(--btn-text);
    padding: 12px 24px; border-radius: 20px; text-decoration: none; font-weight: 500;
    transition: transform 0.3s ease; margin-top: 15px;
}
.action-btn:hover { transform: scale(1.05); }

/* === MOBILE REWRITE === */
@media (max-width: 850px) {
    /* Adjusted to account for the shorter nav bar */
    body { padding-top: 150px; } 

    .glass-nav {
        flex-direction: column; 
        align-items: center;
        
        /* Decreased padding and gap to reduce nav height */
        padding: 10px;
        gap: 5px;
        
        /* Sharper corners */
        border-radius: 15px;
    }
    
    .glass-nav:hover { padding: 10px; } 
    
    .nav-brand { margin-bottom: 2px; }

    .nav-bottom-row {
        display: flex;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        position: static;
        transform: none;
        justify-content: flex-start;
    }

    .nav-actions {
        justify-content: flex-end;
    }

    .nav-item { padding: 8px 10px; }

    .nav-item:hover .nav-text { max-width: 0; opacity: 0; margin-left: 0; }

    .glass-content { 
        /* Sharper corners and tighter padding for mobile */
        border-radius: 15px; 
        padding: 25px; 
    }
    
    .content-section { top: 25px; left: 25px; right: 25px; }
}