:root {
    --bg-color: #f0f4f8;
    --text-color: #0f172a;
    /* Deep Navy/Slate 900 for Contrast */
    --text-muted: #334155;
    /* Slate 700 - Darker for readability */
    --primary-color: #2563eb;
    /* Strong Blue */
    --primary-hover: #1d4ed8;

    /* Improved Glass Vars for Readability */
    --glass-bg: rgba(255, 255, 255, 0.65);
    /* More Opaque */
    --glass-border: 1px solid rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.08);
    /* Softer */
    --glass-blur: blur(20px);

    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (prefers-color-scheme: dark) {
    :root {
        --text-color: #f8fafc;
        --text-muted: #cbd5e1;
        --glass-bg: rgba(15, 23, 42, 0.6);
        /* Dark Blue Glass */
        --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    border: 2px solid transparent;
    background-clip: content-box;
    backdrop-filter: blur(5px);
}

::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.5);
}


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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--text-color);
    background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
    background-attachment: fixed;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    /* CRITICAL: Prevent horizontal scroll */
    line-height: 1.6;
}

/* Ensure images never overflow */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ... existing code ... */

/* Nav Logo - Confident & Academic */
.nav-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    /* Heavier weight */
    font-size: 1.3rem;
    color: #1e3a8a;
    text-decoration: none;
    margin-right: 2rem;
    margin-left: 1rem;
    letter-spacing: -0.02em;
    /* Clean tight spacing */
    white-space: nowrap;
}

/* ... existing code ... */

/* Mobile Active State - STABILITY FIX */
@media (max-width: 768px) {
    .nav-links a {
        display: block;
        padding: 0.8rem 0;
        border-radius: 0;
        border-bottom: 1px solid #f1f5f9;
        color: #334155;
        font-size: 1.1rem;
        font-weight: 500;
        /* Fixed weight */
        text-align: left;
        transition: color 0.1s ease, background-color 0.1s ease;
        /* No font transition */
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: transparent;
        color: #1e3a8a;
        padding-left: 10px;
        /* This is padding, safe if box-sizing is border-box */
        font-weight: 500;
        /* STRICT: No weight change */
    }
}

/* Floating Clean Animation */
@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* Glass Components */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--radius-lg);
}

.glass-card {
    background: rgba(255, 255, 255, 0.7);
    /* Much higher opacity for text readability */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: var(--radius-md);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    color: var(--text-color);
}

.glass-card h3,
.glass-card h2 {
    color: #1e3a8a;
    /* Dark Blue for headings inside cards */
}

.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.85);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

/* Input Fields */
input,
textarea,
select {
    width: 100%;
    padding: 1rem 1.2rem;
    border-radius: var(--radius-sm);
    border: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
    /* Higher contrast */
    margin-bottom: 1rem;
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
    color: #0f172a;
    /* Dark Text */
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* --- Apple-style Liquid Glass Navbar --- */
.navbar {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 1000;
    transition: top 0.3s ease;
    height: 80px;
    /* Fixed height to prevent jumps */
}

.nav-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.65);
    /* Frosted Glass Base */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 100px;
    padding: 0.4rem 0.6rem;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.1);
    /* Soft floating shadow */
    transition: transform 0.4s ease;
    /* Transform only, no height/width transition */
}

/* Nav Logo */
.nav-logo {
    font-weight: 700;
    font-size: 1.2rem;
    color: #1e3a8a;
    text-decoration: none;
    margin-right: 2rem;
    margin-left: 1rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
    /* Prevent wrap */
}

/* Nav Links Container */
.nav-links {
    position: relative;
    display: flex;
    gap: 0;
    /* Gap handled by padding for pill calculation stability */
    list-style: none;
    align-items: center;
    background: rgba(200, 200, 200, 0.1);
    /* Subtle track background */
    border-radius: 100px;
    padding: 0.3rem;
    /* Fixed padding */
    margin: 0;
}

/* Base Link Style */
.nav-links a {
    display: block;
    padding: 0.6rem 1.4rem;
    text-decoration: none;
    color: #64748b;
    /* Muted default */
    font-weight: 500;
    font-size: 0.95rem;
    border-radius: 100px;
    transition: color 0.2s ease;
    /* Only color transitions */
    position: relative;
    z-index: 2;
    text-align: center;
}

.nav-links li {
    position: relative;
    z-index: 2;
    /* Text above pill */
}

/* Hover State */
.nav-links a:hover {
    color: #1e3a8a;
}

/* Active State (Desktop): Text Shadow Trick for Boldness without Reflow */
.nav-links a.active {
    color: #0f172a;
    /* Strong Contrast Active */
    /* font-weight: 600; REMOVED to prevent jitter */
    text-shadow: 0 0 0.7px #0f172a;
    /* Simulates bold */
}

/* Sliding Pill (Desktop Only) */
@media (min-width: 769px) {
    .nav-highlight {
        position: absolute;
        top: 0.3rem;
        /* Match padding of .nav-links */
        left: 0;
        height: calc(100% - 0.6rem);
        background: rgba(255, 255, 255, 0.85);
        /* Proper brighter glass */
        border-radius: 100px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.8);
        backdrop-filter: blur(10px);
        transition: transform 0.4s cubic-bezier(0.25, 1, 0.3, 1), width 0.4s cubic-bezier(0.25, 1, 0.3, 1);
        /* Elastic smooth movement */
        z-index: 1;
        pointer-events: none;
        /* Let clicks pass through */
        will-change: transform, width;
        /* Performance optimization */
    }
}

@media (max-width: 768px) {
    .nav-highlight {
        display: none !important;
        /* STRICTLY REMOVE ON MOBILE */
    }

    .nav-links a.active {
        text-shadow: none;
        font-weight: 600;
        /* Safe on mobile vertical list */
        background: #f1f5f9;
        /* Simple background pill */
        color: #1e3a8a;
    }
}

/* --- Mobile Navigation Icons --- */
.nav-toggle {
    display: none;
    /* Hidden on Desktop */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    z-index: 1003;
}

.nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background-color: #1e3a8a;
    /* Deep Blue High Contrast */
    margin: 6px 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Close Button in Sidebar */
.nav-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2.5rem;
    color: #1e3a8a;
    cursor: pointer;
    display: none;
    /* Hidden on Desktop */
    line-height: 1;
    z-index: 1004;
}

/* Base Mobile Adjustments */
@media (max-width: 768px) {

    /* 1. Navbar - Mobile Compact Mode */
    .navbar {
        top: 0;
        padding: 0;
        height: 70px;
        /* Reduced fixed height */
    }

    .nav-container {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.5);
        background: rgba(255, 255, 255, 0.98);
        /* Solid background */
        padding: 0.8rem 1.5rem;
        justify-content: space-between;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        /* Stable shadow */
    }

    .nav-logo {
        margin: 0;
        font-size: 1.1rem;
    }

    .nav-toggle {
        display: block;
    }

    /* 2. Slide-in Drawer (Sidebar) */
    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 280px;
        /* Fixed sidebar width */
        background: white;
        flex-direction: column;
        justify-content: flex-start;
        /* Top align */
        padding: 5rem 1.5rem 2rem 1.5rem;
        /* Top padding for logo/close area */
        gap: 1.5rem;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        transform: translateX(-100%);
        /* Hidden by default */
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        /* Smooth eased animation */
        z-index: 1002;
        /* Above everything */
        border-radius: 0;
        border: none;
        opacity: 1;
        /* Always opaque, use transform to hide */
    }

    /* Open State */
    .nav-links.active {
        transform: translateX(0);
        display: flex;
    }

    /* Overlay Background */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        backdrop-filter: blur(4px);
        z-index: 1001;
        /* Behind sidebar, above nav */
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .nav-overlay.active {
        display: block;
        opacity: 1;
    }

    /* Active Link Styles (Mobile) */
    .nav-links img {
        /* Logo inside sidebar if needed */
        display: none;
    }

    .nav-links li {
        width: 100%;
        text-align: left;
        /* Align left */
    }

    .nav-links a {
        display: block;
        padding: 0.8rem 0;
        border-radius: 0;
        border-bottom: 1px solid #f1f5f9;
        color: #334155;
        font-size: 1.1rem;
        font-weight: 500;
        text-align: left;
    }

    .nav-links a:hover,
    .nav-links a.active {
        background: transparent;
        color: #1e3a8a;
        padding-left: 10px;
        /* Slight movement to indicate active */
    }

    .nav-highlight {
        display: none !important;
    }

    /* Close Button (X) */
    .nav-close {
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        background: none;
        border: none;
        font-size: 2rem;
        color: #64748b;
        cursor: pointer;
        display: block;
        /* Visible in sidebar */
    }

    /* Mobile CTA at Bottom */
    .mobile-cta-container {
        margin-top: auto;
        /* Push to bottom */
        width: 100%;
    }

    .mobile-only {
        display: block;
    }

    .nav-cta.desktop-only {
        display: none;
    }


    /* 3. Mobile Hero Styles */
    .hero {
        padding-top: 100px !important;
        /* Less padding */
        min-height: auto !important;
        padding-bottom: 3rem;
    }

    .hero h1 {
        font-size: 2.5rem !important;
        /* Smaller Heading */
        margin-bottom: 1rem !important;
    }

    .hero p {
        font-size: 1.1rem !important;
        line-height: 1.4 !important;
        padding: 0 1rem;
    }

    /* Stack Buttons */
    .hero .nav-btn,
    .hero .glass-btn-outline {
        width: 100%;
        display: block;
        text-align: center;
        margin: 0 !important;
    }

    .hero div[style*="flex"] {
        flex-direction: column;
        gap: 1rem !important;
        padding: 0 1rem;
    }

    /* 4. General Layout */
    .section {
        padding: 3rem 0;
        /* Reduced padding */
    }

    .glass-card,
    .glass-panel {
        backdrop-filter: none;
        /* Remove heavy blur */
        background: rgba(255, 255, 255, 0.98);
        /* Solid background */
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
        /* Lighter shadow */
        margin-bottom: 1.5rem;
    }

    .grid-3 {
        grid-template-columns: 1fr !important;
        /* Force single column */
        gap: 1.5rem;
    }

    .desktop-only {
        display: none;
    }
}

@media (min-width: 769px) {

    .mobile-only,
    .nav-close,
    .nav-overlay {
        display: none;
    }
}

.nav-cta {
    margin-left: 2rem;
    margin-right: 0.5rem;
}

.nav-btn {
    padding: 0.7rem 1.5rem;
    border-radius: 100px;
    background: #2563eb;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nav-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}


.glass-btn-outline {
    background: rgba(255, 255, 255, 0.3) !important;
    border: 2px solid rgba(255, 255, 255, 0.8) !important;
    color: #1e3a8a !important;
    /* Dark Blue Text */
    font-weight: 600 !important;
}

.glass-btn-outline:hover {
    background: white !important;
    transform: translateY(-2px);
}


/* Layout */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.section {
    padding: 4rem 0;
    /* Reduced from 6rem for tighter rhythm */
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4rem;
    color: #1e3a8a;
    /* Dark Blue Heading */
    text-shadow: none;
    /* Removed shadow for cleanliness */
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 2rem;
    color: #475569;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}