/* Container */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 24px;
}

/* Sections */
.section {
    padding: 96px 0;
    position: relative;
}

.section-sm {
    padding: 64px 0;
}

.section-navy {
    background-color: var(--primary);
    color: var(--white);
}

.section-navy h1, .section-navy h2, .section-navy h3, .section-navy h4, .section-navy h5, .section-navy h6 {
    color: var(--white);
}

.section-navy p {
    color: var(--gray-300);
}

.section-white {
    background-color: var(--white);
}

.section-gray {
    background-color: var(--off-white);
}

/* Header */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
}

.site-header.transparent {
    background: transparent;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.site-header.transparent .nav-link,
.site-header.transparent .logo-text {
    color: var(--white);
}

.site-header.transparent .btn-outline {
    color: var(--white);
    border-color: rgba(255, 255, 255, 0.3);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    letter-spacing: -0.03em;
}

.logo-accent {
    color: var(--secondary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: clamp(16px, 2.5vw, 32px);
}

.nav-link {
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.02em;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Footer */
.site-footer {
    background-color: #000000;
    color: var(--white);
    padding: 80px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
    gap: 48px;
    margin-bottom: 64px;
}

.footer-brand {
    margin-bottom: 24px;
}

.footer-brand .logo-text {
    color: var(--white);
}

.footer-text {
    color: var(--gray-300);
    margin-top: 16px;
    margin-bottom: 24px;
}

.footer-social {
    display: flex;
    gap: 16px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    color: var(--white);
    border-radius: 50%;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--primary);
    transform: translateY(-2px);
}

.footer-col h4 {
    color: var(--white);
    font-size: 1.125rem;
    margin-bottom: 24px;
    font-weight: 600;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul a {
    color: var(--gray-300);
    transition: var(--transition);
}

.footer-col ul a:hover {
    color: var(--white);
    padding-left: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.footer-bottom-links {
    display: flex;
    gap: 24px;
}

.footer-bottom-links a {
    color: var(--gray-400);
}

.footer-bottom-links a:hover {
    color: var(--white);
}

/* Grids */
.grid {
    display: grid;
}

.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid-cols-6 { grid-template-columns: repeat(6, 1fr); }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Flex */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }

/* Split Layouts */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.connection-model-grid {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

@media (max-width: 991px) {
    .split-layout {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    .nav-menu {
        display: flex;
        position: fixed;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        opacity: 0;
        transition: transform 0.3s ease, opacity 0.3s ease;
        z-index: 9999;
        pointer-events: none;
        align-items: flex-start;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .nav-menu.is-open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

    .nav-menu .nav-link {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid var(--gray-200);
        white-space: normal;
    }
    
    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    .header-actions {
        display: none; /* Hide header actions on mobile unless opened */
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .section {
        padding: 60px 0;
    }

    .grid-cols-4, .grid-cols-3, .grid-cols-6 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 0 8px;
    }

    /* Force specific grid behaviors on mobile */
    .grid-mobile-1 { grid-template-columns: 1fr !important; }
    .grid-mobile-2 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
    
    /* Default to 1 col for anything that wasn't explicitly set to grid-mobile-2 */
    .grid-cols-2, .grid-cols-3, .grid-cols-4, .grid-cols-6 {
        grid-template-columns: 1fr;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .connection-model-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .section {
        padding: 40px 0;
    }
    
    .section-sm {
        padding: 30px 0;
    }
    
    /* Global Typography adjustments for mobile */
    h1 { font-size: clamp(2rem, 8vw, 3rem); line-height: 1.2; }
    h2 { font-size: clamp(1.8rem, 6vw, 2.5rem); line-height: 1.2; }
    h3 { font-size: clamp(1.4rem, 5vw, 1.8rem); line-height: 1.3; }
    p { font-size: 1rem; line-height: 1.6; }
    
    input, select, textarea, .btn {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .grid-cols-responsive-mobile-1 {
        grid-template-columns: 1fr !important;
    }
    
    /* For extremely small screens, reduce padding/gaps but try to keep 2 cols if not overridden */
    .gap-6 { gap: 12px; }
    .gap-8 { gap: 16px; }
}

/* Display Utilities */
.d-none { display: none !important; }
@media (min-width: 768px) {
    .d-md-block { display: block !important; }
    .d-md-flex { display: flex !important; }
    .d-md-none { display: none !important; }
}
