/* ==========================================
   1. VARIABLES & CORE RESET
   ========================================== */
:root {
    --primary-glow: radial-gradient(circle, rgba(56, 189, 248, 0.22) 0%, rgba(37, 99, 235, 0.12) 45%, transparent 70%);
    --navy-dark: #0B192C;
    --navy-surface: #132642;
    --slate-bg: #F1F5F9;
    --ice-bg: #F8FAFC;
    --glass-bg: rgba(248, 250, 252, 0.88);
    --glass-border: rgba(15, 23, 42, 0.08);
    --accent-blue: #2563EB;
    --accent-sky: #38BDF8;
    --text-main: #0F172A;
    --text-muted: #475569;
}

* {
    box-sizing: border-box;
    word-wrap: break-word;
}

html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

html {
    min-height: 100%;
    font-size: 16px;
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    background-color: var(--slate-bg);
    color: var(--text-main);
    font-family: 'Inter', -apple-system, sans-serif;
    margin-bottom: 60px;
}

/* ==========================================
   2. MODERN UI COMPONENTS & SECTION THEMES
   ========================================== */
.hero-polaris {
    background: linear-gradient(135deg, #071120 0%, #0B192C 55%, #162E52 100%);
    color: #F8FAFC;
}

.section-slate {
    background-color: var(--slate-bg);
}

.section-ice {
    background: linear-gradient(180deg, #EFF6FF 0%, #F8FAFC 100%);
}

.section-navy {
    background: linear-gradient(135deg, #0B192C 0%, #132642 100%);
    color: #F8FAFC;
}

.hero-glow {
    position: absolute;
    width: 650px;
    height: 650px;
    background: var(--primary-glow);
    filter: blur(80px);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
    animation: pulse 10s infinite alternate;
}

/* ==========================================
   NAVBAR: TRANSPARENT HERO & SCROLLED GLASS
   ========================================== */
.glass-nav {
    padding: 18px 0;
    width: 100%;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

    /* State 1: At top of page (blends into dark navy hero) */
    .glass-nav.nav-transparent {
        background: rgba(7, 17, 32, 0.45);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

        .glass-nav.nav-transparent .brand-title,
        .glass-nav.nav-transparent .brand-title span:last-child {
            color: #F8FAFC !important;
        }

        .glass-nav.nav-transparent .brand-accent {
            color: #38BDF8 !important;
        }

        .glass-nav.nav-transparent .nav-link {
            color: rgba(248, 250, 252, 0.9) !important;
        }

            .glass-nav.nav-transparent .nav-link:hover {
                color: #38BDF8 !important;
            }

        .glass-nav.nav-transparent .navbar-toggler-icon {
            filter: invert(1);
        }

    /* State 2: Scrolled down (frosted light bar with dark text) */
    .glass-nav.nav-scrolled {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(15, 23, 42, 0.1) !important;
        box-shadow: 0 4px 20px rgba(11, 25, 44, 0.08);
        padding: 12px 0;
    }

        .glass-nav.nav-scrolled .brand-title,
        .glass-nav.nav-scrolled .brand-title span:last-child {
            color: #0F172A !important;
        }

        .glass-nav.nav-scrolled .brand-accent {
            color: #2563EB !important;
        }

        .glass-nav.nav-scrolled .nav-link {
            color: #0F172A !important;
        }

            .glass-nav.nav-scrolled .nav-link:hover {
                color: #2563EB !important;
            }

.glass-card {
    background: #FFFFFF;
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 24px;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

    .glass-card:hover {
        transform: translateY(-8px);
        box-shadow: 0 20px 40px rgba(11, 25, 44, 0.12);
        border-color: var(--accent-blue);
    }

/* ==========================================
   3. BENTO GRID SYSTEM
   ========================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 20px;
}

.bento-item-large {
    grid-column: span 2;
    grid-row: span 2;
}

.bento-item-wide {
    grid-column: span 2;
}

/* ==========================================
   4. TYPOGRAPHY & INTERACTIVE ELEMENTS
   ========================================== */
.text-gradient {
    background: linear-gradient(90deg, #38BDF8 0%, #818CF8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-brand {
    font-size: 1.05rem;
    letter-spacing: -0.3px;
}

.nav-link {
    font-size: 0.95rem;
    padding: 0.5rem 1rem !important;
    transition: color 0.2s ease;
}

/* Back to Top Button */
#backToTop {
    z-index: 2000 !important;
    transition: bottom 0.3s ease, transform 0.3s ease, opacity 0.3s ease;
    animation: fadeIn 0.3s ease-out;
}

    #backToTop:hover {
        transform: translateY(-5px) scale(1.1);
        filter: brightness(90%);
    }

/* ==========================================
   5. FORM STYLING
   ========================================== */
.form-control {
    background: #f5f5f7;
    border: 1px solid transparent;
    color: var(--text-main);
    padding: 12px 18px;
    border-radius: 15px;
}

    .form-control:focus {
        background: #ffffff;
        border-color: var(--accent-blue);
        box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.1);
    }

/* Footer Minimalist Polish */
.hover-link {
    transition: color 0.2s ease;
}

    .hover-link:hover {
        color: var(--accent-blue) !important;
    }

.tracking-tight {
    letter-spacing: -0.02em;
}

@media (max-width: 768px) {
    footer {
        padding-top: 3rem !important;
        padding-bottom: 6rem !important;
    }
}

/* ==========================================
   6. RESPONSIVE QUERIES (Consolidated)
   ========================================== */
@media (max-width: 991.98px) {
    .glass-nav.nav-transparent .navbar-collapse {
        background: rgba(11, 25, 44, 0.96);
        border-radius: 16px;
        margin-top: 12px;
        padding: 12px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
}

@media (max-width: 767.98px) {
    body {
        padding-bottom: 90px;
    }

    .bento-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px;
    }

    .bento-item-large, .bento-item-wide {
        width: 100% !important;
    }

    .form-control, .form-label, .form-control::placeholder {
        font-size: 0.9rem !important;
    }

    .contact-form-row > div {
        margin-bottom: 15px;
    }

    .flex-grow-2 {
        flex-grow: 2;
    }

    .fixed-bottom {
        animation: slideUp 0.5s cubic-bezier(0, 0.55, 0.45, 1);
        box-shadow: 0 -10px 25px rgba(0,0,0,0.05) !important;
    }
}

@media (max-width: 575.98px) {
    .display-4 {
        font-size: 2.2rem !important;
        line-height: 1.2;
    }

    .small-mobile-text {
        font-size: 0.9rem !important;
    }

    .btn-lg {
        width: 100%;
        font-size: 1rem;
    }

    .badge {
        white-space: normal !important;
        max-width: 90vw;
    }
}

/* ==========================================
   7. ANIMATIONS
   ========================================== */
@keyframes pulse {
    from {
        transform: translate(-5%, -5%) scale(1);
    }

    to {
        transform: translate(5%, 5%) scale(1.1);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }

    to {
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}
