:root {
    --bg-dark: #0F0F0F;
    --text-dark: #FFFFFF;
    --card-bg-dark: #1C1C1C;
    --input-bg-dark: #2D2D2D;
    --bg-light: #FAFAFA;
    --text-light: #1A1A1A;
    --card-bg-light: #FDFDFD;
    --button: #009688;
    --button-hover: #00796B;
    --dropdown-hover-dark: #424242;
    --dropdown-hover-light: #E0E0E0;
    --title-dark: #FFC107;
    --title-light: #D32F2F;
    --section-bg-dark-1: #181818;
    --section-bg-dark-2: #1D1D1D;
    --section-bg-dark-3: #242424;
    --section-bg-light-1: #F9F9F9;
    --section-bg-light-2: #F7F7F7;
    --section-bg-light-3: #F5F5F5;
    --accent-cyan: #00BCD4;
    --accent-gold: #FFCA28;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.3);
    --radius: 12px;
    --timing: 0.4s;
    --section-height: calc(100vh - 80px);
    --separator-color: rgba(0, 150, 136, 0.3);
    --fs-body: clamp(1rem, 2.5vw, 1.1rem);
    --fs-h2: clamp(1.8rem, 4vw, 2.5rem);
    --fs-h3: clamp(1.4rem, 3vw, 1.8rem);
    --fs-h4: clamp(1.1rem, 2.5vw, 1.4rem);
    
    /* New spacing variables */
    --container-padding: 0.5rem;
    --section-padding: 80px 0 1rem 0;
    --card-padding: 0.75rem;
    --nav-item-spacing: 1rem;
    --mobile-padding: 0.25rem;
    
    /* Menu-specific variables */
    --menu-bg-dark: #1a1a1a;
    --menu-bg-light: #ffffff;
    --menu-text-dark: #e0e0e0;
    --menu-text-light: #333333;
    --menu-border-dark: rgba(255, 255, 255, 0.1);
    --menu-border-light: rgba(0, 0, 0, 0.1);
    --menu-icon-size: 1.5rem;
    --menu-font-size: clamp(1.1rem, 3vw, 1.3rem);
}

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

body {
    font-family: 'Roboto', 'Montserrat', sans-serif;
    scroll-behavior: smooth;
    font-size: var(--fs-body);
    background-color: var(--bg-dark);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--timing) ease, color var(--timing) ease;
}

body.theme-light {
    background-color: var(--bg-light);
    color: var(--text-light);
}

/* Fixed: Darker text colors for light mode sections */
body.theme-light h1, body.theme-light h2, body.theme-light h3, body.theme-light h4, body.theme-light h5, body.theme-light h6 {
    color: #2c3e50; /* Darker blue-gray instead of bright red */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

body.theme-light p, 
body.theme-light .card-text, 
body.theme-light .lead {
    color: #34495e; /* Darker gray for better contrast */
    text-shadow: none;
}

body.theme-light .nav-link,
body.theme-light .nav-item a {
    color: #2c3e50 !important; /* Darker nav links */
}

body.theme-light .nav-link:hover,
body.theme-light .nav-item a:hover {
    color: #c0392b !important; /* Slightly darker red for hover */
}

body.theme-light .dropdown-item {
    color: #34495e;
}

body.theme-light .dropdown-item:hover {
    color: #c0392b;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    color: var(--title-dark);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    text-align: center;
}

h1 { font-size: clamp(2rem, 5vw, 3rem); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
p, .card-text, .lead {
    margin-bottom: 1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.lead { font-size: clamp(1.1rem, 2.5vw, 1.25rem); }

section {
    position: relative;
    min-height: var(--section-height);
    padding: var(--section-padding);
    background: linear-gradient(135deg, var(--section-bg-dark-1), var(--section-bg-dark-2));
    overflow: hidden;
    scroll-snap-align: start;
}

body.theme-light section {
    background: linear-gradient(135deg, var(--section-bg-light-1), var(--section-bg-light-2));
}

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

section::before {
    content: '';
    position: absolute;
    top: -40px;
    left: 0;
    right: 0;
    height: 40px;
    background: linear-gradient(to bottom, var(--bg-dark), transparent);
    clip-path: polygon(0 100%, 100% 100%, 50% 0);
    animation: wave 4s infinite ease-in-out;
    z-index: 0;
}

body.theme-light section::before {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), transparent);
    --separator-color: rgba(211, 47, 47, 0.3);
}

/* Fixed: Lighter overlay for home section in light mode */
#home .overlay {
    position: absolute;
    inset: 0;
    z-index: 3;
    background: rgba(0, 0, 0, 0.4); /* Darker for dark mode */
}

body.theme-light #home .overlay {
    background: rgba(0, 0, 0, 0.15); /* Much lighter for light mode */
}

body.theme-light #home .dynamic-text {
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

#neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: rgba(0, 0, 0, 0.2); /* Slightly darker for better visibility */
}

body.theme-light #neural-canvas {
    background: rgba(255, 255, 255, 0.2); /* Lighter for light mode */
}

.grid-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background-image: linear-gradient(to right, rgba(0, 150, 136, 0.08) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(0, 150, 136, 0.08) 1px, transparent 1px);
    background-size: 50px 50px;
}

body.theme-light .grid-overlay {
    background-image: linear-gradient(to right, rgba(211, 47, 47, 0.08) 1px, transparent 1px),
                      linear-gradient(to bottom, rgba(211, 47, 47, 0.08) 1px, transparent 1px);
}

section:not(#home) .overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.2), rgba(0, 150, 136, 0.1));
    z-index: 0;
}

body.theme-light section:not(#home) .overlay {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15), rgba(211, 47, 47, 0.08));
}

/* Enhanced Navbar */
.navbar {
    min-height: 80px;
    transition: all var(--timing) ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: transparent;
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    background: rgba(15, 15, 15, 0.95);
    box-shadow: var(--shadow-soft);
}

body.theme-light .navbar {
    background: transparent;
}

body.theme-light .navbar.scrolled {
    background: rgba(250, 250, 250, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    color: var(--accent-cyan);
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--timing) ease;
}

.navbar-brand img {
    height: 32px;
    transition: transform var(--timing) ease;
}

.navbar-brand:hover {
    color: var(--accent-gold);
    transform: scale(1.05);
}

.navbar-brand:hover img {
    transform: rotate(5deg) scale(1.1);
}

/* Navigation links */
.nav-link {
    color: var(--text-dark) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    padding: 0.75rem 1rem !important;
    border-radius: var(--radius);
    transition: all var(--timing) ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

body.theme-light .nav-link {
    color: #2c3e50 !important;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s;
}

.nav-link:hover::before {
    left: 100%;
}

.nav-link:hover {
    color: var(--accent-cyan) !important;
    transform: translateY(-2px);
    background: rgba(0, 150, 136, 0.1);
}

body.theme-light .nav-link:hover {
    color: #c0392b !important;
    background: rgba(211, 47, 47, 0.1);
}

/* Enhanced Dropdown Menu */
.dropdown-menu {
    background: var(--menu-bg-dark);
    color: var(--menu-text-dark);
    border: 1px solid var(--menu-border-dark);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    min-width: 220px;
    backdrop-filter: blur(10px);
}

body.theme-light .dropdown-menu {
    background: var(--menu-bg-light);
    color: #34495e;
    border-color: var(--menu-border-light);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.dropdown-item {
    color: var(--menu-text-dark);
    padding: 0.75rem 1.5rem;
    transition: all var(--timing) ease;
    border-radius: calc(var(--radius) - 2px);
    margin: 0 0.25rem;
    font-weight: 500;
    position: relative;
}

body.theme-light .dropdown-item {
    color: #34495e;
}

.dropdown-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 3px;
    height: 0;
    background: var(--button);
    transform: translateY(-50%);
    transition: height var(--timing) ease;
}

.dropdown-item:hover::before {
    height: 100%;
}

.dropdown-item:hover {
    background: var(--dropdown-hover-dark);
    color: var(--accent-cyan);
    transform: translateX(8px);
    margin-left: 0.5rem;
    margin-right: -0.25rem;
}

body.theme-light .dropdown-item:hover {
    background: var(--dropdown-hover-light);
    color: #c0392b;
}

/* Enhanced Theme Toggle - Single instance */
.theme-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: 1rem;
}

.theme-toggle-label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-dark);
    transition: color var(--timing) ease;
    white-space: nowrap;
}

body.theme-light .theme-toggle-label {
    color: #2c3e50;
}

.toggle-container {
    width: 56px;
    height: 28px;
    background: var(--input-bg-dark);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: all var(--timing) ease;
    border: 1px solid var(--menu-border-dark);
    box-shadow: none;
}

body.theme-light .toggle-container {
    background: #e0e0e0;
    border-color: var(--menu-border-light);
}

.toggle-ball {
    width: 24px;
    height: 24px;
    background: var(--button);
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all var(--timing) ease;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.theme-light .toggle-ball {
    transform: translateX(28px);
    background: var(--title-light);
}

.toggle-container::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2a10 10 0 0 0-10 10c0 5.52 4.48 10 10 10s10-4.48 10-10A10 10 0 0 0 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/></svg>') center/contain no-repeat;
    color: var(--text-dark);
    opacity: 0.6;
    transition: all var(--timing) ease;
    z-index: 1;
}

body.theme-light .toggle-container::before {
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zM2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1zm18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1zM11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1zm0 18v-2c0-.55-.45-1-1-1s-1 .45-1 1v2c0 .55.45 1 1 1s1-.45 1-1zM5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41L5.99 4.58zM18.36 16.95c-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41zM20.42 5.99c.39-.39 1.03-.39 1.41 0 .39.39.39 1.03 0 1.41l-1.06 1.06c-.39.39-1.03.39-1.41 0-.39-.39-.39-1.03 0-1.41l1.06-1.06zM5.99 19.42c-.39.39-1.03.39-1.41 0-.39-.39-.39-1.03 0-1.41l1.06-1.06c.39-.39 1.03-.39 1.41 0 .39.39.39 1.03 0 1.41l-1.06 1.06zM7.05 7.05c-.39-.39-1.03-.39-1.41 0L4.58 8.46c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41zM16.95 16.95c-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0l1.06-1.06c.39-.39.39-1.03 0-1.41z"/></svg>');
    color: #2c3e50;
}

/* Enhanced Mobile Navigation - FIXED */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--radius);
    transition: all var(--timing) ease;
    position: relative;
    z-index: 1001;
}

.nav-toggle:hover {
    background: rgba(0, 150, 136, 0.1);
    transform: scale(1.1);
}

.nav-toggle i {
    font-size: var(--menu-icon-size);
    color: var(--text-dark);
    transition: all var(--timing) ease;
    display: block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
}

body.theme-light .nav-toggle i {
    color: #2c3e50;
}

.nav-toggle.active i {
    color: var(--button);
}

body.theme-light .nav-toggle.active i {
    color: var(--title-light);
}

@media (max-width: 991px) {
    .navbar-toggler {
        display: block !important;
        order: 3;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: 0;
        width: 320px;
        max-width: 85vw;
        height: 100vh;
        background: var(--menu-bg-dark);
        z-index: 1002;
        padding: 0;
        transform: translateX(100%);
        transition: transform var(--timing) ease;
        overflow-y: auto;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
        border-left: 1px solid var(--menu-border-dark);
    }
    
    body.theme-light .navbar-collapse {
        background: var(--menu-bg-light);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        border-left-color: var(--menu-border-light);
    }
    
    .navbar-collapse.show {
        transform: translateX(0);
    }
    
    /* FIXED: Single mobile menu header */
    .mobile-menu-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--menu-border-dark);
        margin-bottom: 1rem;
        position: sticky;
        top: 0;
        background: inherit;
        z-index: 10;
    }
    
    body.theme-light .mobile-menu-header {
        border-bottom-color: var(--menu-border-light);
    }
    
    .mobile-menu-brand {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        color: var(--menu-text-dark);
        text-decoration: none;
        font-weight: 600;
        font-size: 1.1rem;
    }
    
    body.theme-light .mobile-menu-brand {
        color: #2c3e50;
    }
    
    .mobile-menu-brand img {
        height: 28px;
    }
    
    .mobile-menu-close {
        background: none;
        border: none;
        color: var(--menu-text-dark);
        font-size: var(--menu-icon-size);
        cursor: pointer;
        padding: 0.5rem;
        border-radius: 50%;
        transition: all var(--timing) ease;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
    }
    
    body.theme-light .mobile-menu-close {
        color: #2c3e50;
    }
    
    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--button);
        transform: rotate(90deg) scale(1.1);
    }
    
    body.theme-light .mobile-menu-close:hover {
        background: rgba(0, 0, 0, 0.05);
        color: var(--title-light);
    }
    
    /* FIXED: Single theme toggle - only desktop version */
    .mobile-theme-toggle {
        display: none !important; /* Hidden - only desktop toggle shows */
    }
    
    /* Mobile Menu Content */
    .navbar-nav {
        padding: 0 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .nav-item {
        width: 100%;
        margin: 0;
    }
    
    .nav-menu {
        flex-direction: column !important;
        gap: 0.25rem;
        width: 100%;
        padding: 0;
    }
    
    .nav-item a {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        padding: 1rem 1.25rem !important;
        font-size: var(--menu-font-size);
        font-weight: 500;
        color: var(--menu-text-dark) !important;
        text-decoration: none;
        border-radius: var(--radius);
        transition: all var(--timing) ease;
        position: relative;
        overflow: hidden;
        border-left: 3px solid transparent;
    }
    
    body.theme-light .nav-item a {
        color: #34495e !important;
    }
    
    .nav-item a::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 0;
        background: var(--button);
        transition: width var(--timing) ease;
        z-index: -1;
    }
    
    .nav-item a:hover::before {
        width: 4px;
    }
    
    .nav-item a:hover {
        color: var(--accent-cyan) !important;
        background: rgba(0, 150, 136, 0.1);
        border-left-color: var(--button);
        transform: translateX(8px);
        padding-left: 2rem;
    }
    
    body.theme-light .nav-item a:hover {
        color: #c0392b !important;
        background: rgba(211, 47, 47, 0.1);
        border-left-color: #c0392b;
    }
    
    /* Mobile Dropdown */
    .dropdown-menu {
        position: static !important;
        margin: 0.25rem 0 0 1rem !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
        width: auto !important;
        max-width: none !important;
        transform: none !important;
        opacity: 1 !important;
        padding: 0 !important;
        border-radius: 0 !important;
    }
    
    body.theme-light .dropdown-menu {
        background: transparent !important;
    }
    
    .dropdown-item {
        margin: 0 !important;
        border-radius: var(--radius) !important;
        background: transparent !important;
        color: var(--menu-text-dark) !important;
        padding: 0.875rem 1.5rem !important;
        font-size: 0.95em;
        border-left: 3px solid transparent;
    }
    
    body.theme-light .dropdown-item {
        color: #34495e !important;
    }
    
    .dropdown-item:hover {
        background: rgba(0, 150, 136, 0.08) !important;
        color: var(--accent-cyan) !important;
        border-left-color: var(--accent-cyan);
        margin-left: 0.5rem;
    }
    
    body.theme-light .dropdown-item:hover {
        background: rgba(211, 47, 47, 0.08) !important;
        color: #c0392b !important;
        border-left-color: #c0392b;
    }
    
    /* Language dropdown in mobile */
    .lang-dropdown {
        margin-left: 1rem !important;
        max-width: none !important;
    }
    
    .lang-option {
        font-size: 0.9em !important;
        padding: 0.75rem 1.25rem !important;
    }
    
    .fi {
        font-size: 1.1rem !important;
        width: 20px !important;
        height: 14px !important;
        margin-right: 0.75rem !important;
    }
}

@media (min-width: 992px) {
    .navbar-collapse {
        transform: none !important;
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: transparent !important;
        box-shadow: none !important;
        border: none !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    
    .navbar-nav {
        flex-direction: row !important;
        gap: 0 !important;
    }
    
    .nav-item {
        margin: 0 var(--nav-item-spacing) 0 0 !important;
    }
    
    .nav-menu {
        flex-direction: row !important;
        gap: var(--nav-item-spacing) !important;
    }
    
    .nav-item a {
        padding: 0.75rem 1rem !important;
        font-size: inherit !important;
        max-width: none !important;
        border-left: none !important;
        border-radius: var(--radius) !important;
        display: flex;
        align-items: center;
    }
    
    .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        margin: 0 !important;
        background: var(--menu-bg-dark) !important;
        border: 1px solid var(--menu-border-dark) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2) !important;
        width: auto !important;
        min-width: 220px !important;
        border-radius: var(--radius) !important;
        padding: 0.5rem 0 !important;
    }
    
    body.theme-light .dropdown-menu {
        background: var(--menu-bg-light) !important;
        border-color: var(--menu-border-light) !important;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1) !important;
    }
    
    .dropdown-item {
        margin: 0 0.25rem !important;
        border-left: none !important;
        padding: 0.75rem 1.5rem !important;
        font-size: inherit !important;
        display: flex;
        align-items: center;
    }
    
    .dropdown-item:hover {
        margin: 0 0.25rem !important;
        transform: translateX(4px) !important;
        border-left: none !important;
    }
    
    .mobile-menu-header,
    .mobile-theme-toggle {
        display: none !important;
    }
}

/* Rest of your existing styles... */
.footer-custom {
    background: linear-gradient(135deg, var(--section-bg-dark-1), var(--section-bg-dark-2));
    border-top: 2px solid var(--button);
    box-shadow: 0 -2px 10px rgba(0, 150, 136, 0.2);
    color: var(--text-dark);
    padding: 1rem 0;
    transition: background var(--timing) ease, color var(--timing) ease;
}

body.theme-light .footer-custom {
    background: linear-gradient(135deg, var(--section-bg-light-1), var(--section-bg-light-2));
    border-top-color: var(--title-light);
    box-shadow: 0 -2px 10px rgba(211, 47, 47, 0.1);
    color: #2c3e50;
}

.footer-custom .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--container-padding);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-custom .copyright {
    font-size: 0.9rem;
    color: var(--text-dark);
}

body.theme-light .footer-custom .copyright {
    color: #34495e;
}

.footer-custom .social-links {
    display: flex;
    gap: 1rem;
}

.footer-custom .social-links a {
    color: var(--text-dark);
    font-size: 1.5rem;
    text-decoration: none;
    transition: all var(--timing) ease;
    display: flex;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--radius);
}

.footer-custom .social-links a i {
    margin-right: 5px;
}

body.theme-light .footer-custom .social-links a {
    color: #2c3e50;
}

.footer-custom .social-links a:hover {
    color: var(--button-hover);
    transform: translateY(-2px) scale(1.1);
    background: rgba(0, 150, 136, 0.1);
}

body.theme-light .footer-custom .social-links a:hover {
    color: var(--title-light);
    background: rgba(211, 47, 47, 0.1);
}

.footer-custom .open-positions {
    font-size: 0.9rem;
    display: flex;
    gap: 0.75rem;
}

.footer-custom .open-positions a {
    color: var(--text-dark);
    text-decoration: none;
    transition: all var(--timing) ease;
    padding: 0.5rem;
    border-radius: var(--radius);
}

body.theme-light .footer-custom .open-positions a {
    color: #2c3e50;
}

.footer-custom .open-positions a:hover {
    color: var(--button-hover);
    transform: translateY(-2px);
    background: rgba(0, 150, 136, 0.1);
}

body.theme-light .footer-custom .open-positions a:hover {
    color: var(--title-light);
    background: rgba(211, 47, 47, 0.1);
}

#home {
    position: relative;
    min-height: var(--section-height);
}

body.theme-light #home h1 {
  color: var(--title-dark);
}

body.theme-light #home p {
  color: var(--text-dark);
}

section:not(#home) .card,
section:not(#home) .stylish-card {
    background: var(--card-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

body.theme-light section:not(#home) .card,
body.theme-light section:not(#home) .stylish-card {
    background: var(--card-bg-light);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.card, .stylish-card {
    border: none;
    border-radius: var(--radius);
    transition: all var(--timing) ease;
    color: var(--text-dark);
    position: relative;
    overflow: visible;
    min-height: 250px;
    padding: 0;
    margin: 0;
}

.card:hover, .stylish-card:hover {
    transform: translateY(-8px) scale(1.02);
    border: 2px solid var(--button);
    box-shadow: var(--shadow-soft);
}

.card-body {
    text-align: left;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas: 
        "image"
        "text";
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    width: 100%;
    height: 100%;
}

.card-body .img-fluid {
    grid-area: image;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.card-body .text-content {
    grid-area: text;
    padding: 0;
    margin: 0;
}

.card .details, .stylish-card .details {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg-dark);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 0.75rem;
    opacity: 0;
    transform: translateY(12px);
    transition: all var(--timing) ease;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-light .card .details, 
body.theme-light .stylish-card .details {
    background: var(--card-bg-light);
    border-top-color: rgba(0, 0, 0, 0.1);
}

.card .details:not(.hidden), .stylish-card .details:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    z-index: 100;
}

.card .details.hidden, .stylish-card .details.hidden {
    display: none;
    visibility: hidden;
    height: 0;
}

.accordion { --bs-accordion-active-color: var(--text-dark); --bs-accordion-active-bg: transparent; }
.accordion-button {
    color: var(--text-dark);
    background-color: transparent;
    border: none;
    font-size: var(--fs-h2);
    border-radius: var(--radius);
    padding: 0.75rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

body.theme-light .accordion-button {
    color: #2c3e50;
}

.accordion-button:not(.collapsed) {
    color: var(--text-dark);
    background-color: rgba(0, 150, 136, 0.1);
    border: none;
}

.accordion-button:focus { box-shadow: none; border: none; }
.accordion-body {
    color: var(--text-dark);
    background-color: transparent;
    padding: 1rem;
}

body.theme-light .accordion-body {
    color: #34495e;
}

.accordion-item {
    background-color: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

body.theme-light .accordion-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) { 
    #help .container { 
        max-width: 1000px; 
    } 
}

.smart-nav .btn-custom {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    bottom: 25px;
    right: 25px;
    opacity: 0;
    transition: all var(--timing) ease;
    z-index: 200;
    background-color: var(--button);
    border: none;
    box-shadow: var(--shadow-soft);
}

.smart-nav.scrolled .btn-custom {
    opacity: 1;
    transform: scale(1.1);
}

.smart-nav .btn-custom::before {
    content: '↑';
    font-size: 28px;
    color: var(--text-dark);
}

body.theme-light .smart-nav .btn-custom {
    background-color: var(--title-light);
}

body.theme-light .smart-nav .btn-custom::before {
    color: #2c3e50;
}

.text-accent, .text-cyan { color: var(--button) !important; }
.border-accent, .border-cyan { border-color: var(--button) !important; }
.text-accent-hover:hover { color: var(--button-hover) !important; }

.btn-custom {
    background-color: var(--button);
    color: var(--text-dark);
    border-radius: var(--radius);
    padding: 0.75rem 1.25rem;
    font-weight: 700;
    transition: all var(--timing) ease;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-custom:hover {
    background-color: var(--button-hover);
    transform: translateY(-2px) scale(1.05);
}

.btn-custom:active { transform: translateY(0) scale(0.98); }

.btn-custom::after {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transform: translate(-50%, -50%);
    top: 50%;
    left: 50%;
    transition: width 0.6s ease, height 0.6s ease, opacity 0.7s ease;
    pointer-events: none;
}

.btn-custom:active::after { width: 250px; height: 250px; opacity: 0; }

body.theme-light .btn-custom {
    color: #2c3e50;
    border-color: rgba(0, 0, 0, 0.1);
}

body.theme-light .btn-custom:hover {
    background-color: var(--title-light);
}

.btn-custom:focus-visible,
.navbar .nav-link:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid var(--accent-cyan);
    outline-offset: 3px;
}

.form-control, .form-select {
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
    background-color: var(--input-bg-dark);
    color: var(--text-dark);
    transition: all var(--timing) ease;
    border: 2px solid var(--button);
}

body.theme-light .form-control,
body.theme-light .form-select {
    background-color: var(--card-bg-light);
    color: #2c3e50;
    border-color: var(--title-light);
}

.form-control:focus, .form-select:focus {
    border-color: var(--button);
    box-shadow: 0 0 10px rgba(0, 150, 136, 0.5);
    transform: scale(1.02);
}

input::placeholder, textarea::placeholder {
    color: var(--text-dark);
    opacity: 0.8;
    font-style: italic;
}

body.theme-light input::placeholder, 
body.theme-light textarea::placeholder {
    color: #7f8c8d;
    opacity: 0.8;
    font-style: italic;
}

input[type="file"].form-control {
    padding: 0.5rem 0.75rem;
}

.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    transition: all var(--timing) ease;
}

.img-fluid:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-soft);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(60px) rotate(2deg); }
    to { opacity: 1; transform: translateY(0) rotate(0); }
}

@keyframes wave {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(60px) rotate(2deg);
    transition: all 0.7s ease-out;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0) rotate(0);
}

.animate-text {
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    transition: all 0.6s ease-in-out;
}

.animate-text.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.expertise-grid {
    list-style: none;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.expertise-item {
    padding: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.expertise-icon {
    color: var(--button);
    font-size: 1.1rem;
}

body.theme-light .expertise-icon {
    color: var(--title-light);
}

body.theme-light .expertise-item {
    color: var(--text-light);
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    section::before { animation: none; }
}

@media (max-width: 992px) {
    .service-section .container {
        grid-template-columns: 1fr;
    }
    .service-section:nth-child(even) .card-wrapper {
        order: initial;
    }
    .service-section .bg-image {
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    body {
        scroll-snap-type: y mandatory;
    }

    section {
        height: 100vh;
        height: -webkit-fill-available;
        min-height: unset;
        padding: 80px var(--mobile-padding) 0.5rem var(--mobile-padding);
        overflow: hidden;
        scroll-snap-align: start;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 var(--mobile-padding);
        margin: 0;
        height: calc(100% - 80px);
        overflow: hidden;
    }
    
    .section-header {
        padding: 0.5rem 0;
        margin-bottom: 0.5rem;
    }
    
    .card-wrapper {
        width: 100%;
        height: calc(100% - 1rem);
        padding: 0;
        margin: 0;
        justify-content: flex-start;
        overflow: hidden;
    }
    
    .card, .stylish-card {
        width: 100%;
        min-height: unset;
        padding: 0.5rem;
        background: var(--card-bg-dark);
    }
    
    body.theme-light .card, 
    body.theme-light .stylish-card {
        background: var(--card-bg-light);
    }
    
    .card-body {
        width: 100%;
        padding: 0.25rem;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas: 
            "image"
            "text";
        gap: 0.25rem;
        height: 100%;
        overflow: hidden;
    }
    
    .card-body .img-fluid {
        grid-area: image;
        width: 100%;
        max-height: 40vh;
        object-fit: cover;
        margin: 0;
        display: block;
        padding: 0;
    }
    
    .card-body .text-content {
        grid-area: text;
        width: 100%;
        padding: 0;
        margin: 0;
        flex-grow: 1;
        overflow-y: auto;
    }
    
    :root {
        --fs-body: clamp(0.9rem, 2.5vw, 1rem);
        --fs-h2: clamp(1.2rem, 3vw, 1.4rem);
        --fs-h3: clamp(1rem, 2.5vw, 1.1rem);
        --fs-h4: clamp(0.8rem, 2vw, 0.9rem);
    }
    
    h1 { font-size: clamp(1.4rem, 3.5vw, 1.6rem); }
    h2 { font-size: var(--fs-h2); }
    h3 { font-size: var(--fs-h3); }
    h4 { font-size: var(--fs-h4); }
    
    .lead, .card-text, p {
        font-size: var(--fs-body);
        line-height: 1.4;
    }
    
    .text-opacity-75 {
        opacity: 0.8;
    }
    
    .card-body.d-flex {
        display: grid;
        grid-template-columns: 1fr;
        grid-template-areas: 
            "image"
            "text";
        gap: 0.25rem;
    }
    
    .me-md-4 {
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
    }
    
    #newsletter-form {
        flex-direction: column;
        gap: 0.5rem;
        justify-content: flex-start;
    }
    
    .me-3 {
        margin-right: 0 !important;
        margin-bottom: 0.5rem !important;
    }
    
    .form-control {
        padding: 0.5rem;
        font-size: var(--fs-body);
    }
    
    .expertise-grid {
        gap: 0.5rem;
        padding: 0;
        grid-template-columns: 1fr;
    }
    
    .expertise-item {
        padding: 0.25rem;
        margin: 0;
        justify-content: flex-start;
    }
    
    .animate-on-scroll, .animate-text {
        opacity: 1;
        transform: none;
        transition: none;
    }
    
    #neural-canvas {
        display: none;
    }
    
    section::before {
        display: none;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    section:not(#home) .card-body {
        background-size: cover;
        background-position: center;
    }
    
    section:not(#home) .img-fluid {
        display: none;
    }
    
    .card-body .text-content {
        max-height: calc(100vh - 80px - 1rem);
        overflow-y: auto;
    }
}

/* Desktop-specific horizontal card layout */
@media (min-width: 769px) {
    .card-body {
        padding: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 1.5rem !important;
        height: 100% !important;
        min-height: 300px !important;
    }
    
    .card-body .img-fluid {
        flex: 0 0 35% !important;
        width: 35% !important;
        max-width: 350px !important;
        height: auto !important;
        min-height: 200px !important;
        object-fit: cover !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: var(--radius) !important;
    }
    
    .card-body .text-content {
        flex: 1 !important;
        padding: 0.5rem !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        max-width: 60% !important;
    }
    
    .card-body .text-content h5 {
        margin-bottom: 0.5rem !important;
        font-size: var(--fs-h3) !important;
    }
    
    .card-body .text-content .lead {
        margin-bottom: 0 !important;
        font-size: clamp(1rem, 2vw, 1.1rem) !important;
        line-height: 1.5 !important;
    }
    
    .card, .stylish-card {
        padding: 0 !important;
        margin: 0 !important;
        max-width: 900px !important;
        margin: 0 auto !important;
    }
    
    /* Expertise section specific adjustments */
    #expertise .card-body {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
    }
    
    #expertise .card-body .text-content {
        max-width: 100% !important;
        text-align: center !important;
        padding: 0 !important;
    }
    
    #expertise .expertise-grid {
        display: grid !important;
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
        gap: 0.5rem !important;
        max-width: 600px !important;
    }
    
    /* Newsletter section adjustments */
    #newsletter .card-body {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
        padding: 1rem !important;
        text-align: center !important;
    }
    
    #newsletter .card-body .text-content {
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    #newsletter-form {
        max-width: 500px !important;
        width: 100% !important;
    }
    
    /* Ensure section titles remain centered */
    .section-header h2 {
        text-align: center !important;
        margin-bottom: 2rem !important;
    }
    
    .section-header {
        padding: 2rem 0 !important;
        margin-bottom: 0 !important;
    }
}

/* Utility classes for fine control */
.no-horizontal-padding {
    padding-left: 0;
    padding-right: 0;
}

.minimal-horizontal-padding {
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.no-horizontal-margin {
    margin-left: 0;
    margin-right: 0;
}

.compact-container {
    max-width: 100%;
    padding: 0 0.5rem;
}

/* Scroll to top button enhancements */
.smart-nav .btn-custom:hover {
    transform: translateY(-2px) scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 150, 136, 0.4);
}

body.theme-light .smart-nav .btn-custom:hover {
    box-shadow: 0 8px 25px rgba(211, 47, 47, 0.3);
}

/* FIXED: Mobile menu backdrop */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    visibility: hidden;
    transition: all var(--timing) ease;
}

.mobile-menu-backdrop.show {
    opacity: 1;
    visibility: visible;
}

body.theme-light .mobile-menu-backdrop {
    background: rgba(0, 0, 0, 0.3);
}



/* Newsletter Form Row - Inline Layout */
.newsletter-form-row {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    max-width: 500px;
    align-items: stretch;
    position: relative;
    z-index: 10;
}

.newsletter-form-row .newsletter-input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border-radius: var(--radius) !important;
}

.newsletter-form-row .newsletter-btn {
    flex-shrink: 0;
    white-space: nowrap;
    min-width: 120px;
    padding: 0.875rem 1.5rem !important;
    border-radius: var(--radius) !important;
}

/* Ensure the button doesn't get too wide */
.newsletter-btn .btn-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100px;
}

/* Mobile responsive - stack vertically */
@media (max-width: 768px) {
    .newsletter-form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .newsletter-form-row .newsletter-btn {
        width: 100%;
        min-width: unset;
    }
    
    .newsletter-input {
        border-radius: var(--radius) !important;
    }
    
    .newsletter-btn {
        border-radius: var(--radius) !important;
    }
}

/* Form row interaction fix */
.newsletter-form-row {
    pointer-events: auto !important;
}

.newsletter-form-row * {
    pointer-events: auto !important;
}