/* CSS Variables - Modern Blue Palette & Themes */
:root {
    /* Brand Colors (Light Theme Default) */
    --primary: #0ea5e9;
    /* Sky Blue */
    --primary-light: #38bdf8;
    --primary-dark: #0284c7;
    --secondary: #1e293b;
    /* Slate Dark */
    --accent: #60a5fa;

    /* Backgrounds & Surfaces (Light) */
    --background: #f8fafc;
    /* Slate Lightest */
    --surface: #ffffff;
    --header-bg: rgba(255, 255, 255, 0.85);
    --card-border: rgba(226, 232, 240, 0.8);
    --service-img-bg: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    --icon-bg: rgba(14, 165, 233, 0.1);

    /* Typography (Light) */
    --text-main: #0f172a;
    --text-muted: #64748b;
    --logo-filter: none;

    /* Gradients */
    --hero-gradient: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    --card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%);

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 20px 25px -5px rgba(14, 165, 233, 0.2), 0 10px 10px -5px rgba(14, 165, 233, 0.1);

    /* Layout */
    --container-width: 1200px;
}

/* Dark Mode Preferences */
@media (prefers-color-scheme: dark) {
    :root {
        /* Backgrounds & Surfaces (Dark) */
        --background: #0f172a;
        /* Deep Slate */
        --surface: #1e293b;
        --secondary: #f8fafc;
        /* Make titles light */
        --header-bg: rgba(15, 23, 42, 0.85);
        --card-border: rgba(51, 65, 85, 0.8);
        --service-img-bg: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        --icon-bg: rgba(14, 165, 233, 0.15);

        /* Typography (Dark) */
        --text-main: #f1f5f9;
        --text-muted: #94a3b8;
        --logo-filter: invert(1) brightness(1.5);
        /* Try to invert dark logo to white */

        /* Gradients (Dark) */
        --card-gradient: linear-gradient(180deg, rgba(30, 41, 59, 0.8) 0%, rgba(30, 41, 59, 0.4) 100%);

        /* Adjust Shadows for Dark Mode */
        --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
        --shadow-hover: 0 20px 25px -5px rgba(14, 165, 233, 0.15), 0 10px 10px -5px rgba(14, 165, 233, 0.1);
    }
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--background);
    line-height: 1.6;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
    font-family: 'Outfit', sans-serif;
    color: var(--secondary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

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

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 2rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 9999px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-family: 'Inter', sans-serif;
}

.btn-primary {
    background: var(--hero-gradient);
    color: white;
    box-shadow: 0 4px 14px 0 rgba(14, 165, 233, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(14, 165, 233, 0.5);
    background: linear-gradient(135deg, #38bdf8 0%, #2563eb 100%);
    color: white;
    /* ensure text stays white */
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 50px;
    transition: transform 0.3s ease, filter 0.3s ease;
    filter: var(--logo-filter);
}

.logo:hover {
    transform: scale(1.05);
}

.nav-menu ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-menu a:not(.btn) {
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-menu a:not(.btn):hover {
    color: var(--primary);
}

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

.nav-menu a:not(.btn):hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    position: relative;
    padding: 160px 0 100px;
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: var(--background);
    overflow: hidden;
}

.hero-bg-shapes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* Animated gradient blobs */
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary-light);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: #818cf8;
    /* indigo tint */
    bottom: -50px;
    left: -100px;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 800px;
}

.hero-title {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--secondary);
    letter-spacing: -0.02em;
}

.hero-title span {
    background: var(--hero-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

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

.bg-light {
    background-color: var(--surface);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--secondary);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    width: 60px;
    height: 4px;
    background: var(--primary);
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 2px;
}

.section-desc {
    color: var(--text-muted);
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Grid Layouts */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

/* Cards Design System */
.card {
    background: var(--surface);
    border-radius: 20px;
    padding: 2.5rem;
    position: relative;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    z-index: 1;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--card-gradient);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(14, 165, 233, 0.3);
}

.card:hover::before {
    opacity: 1;
}

.card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--secondary);
}

.card p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.card-icon {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--icon-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover .card-icon {
    background: var(--hero-gradient);
    color: white;
    transform: scale(1.1) rotate(5deg);
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.card-link i {
    transition: transform 0.3s ease;
}

.card-link:hover i {
    transform: translateX(5px);
}

/* Service specific cards */
.service-card {
    padding: 0;
    display: flex;
    flex-direction: column;
}

.card-image-wrapper {
    height: 160px;
    background: var(--service-img-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary-light);
    border-bottom: 1px solid var(--card-border);
}

.service-card .card-content {
    padding: 2rem;
}

/* CTA Section */
.cta-section {
    background: #1e293b;
    /* Constantly dark for CTA */
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(14, 165, 233, 0.3) 0%, rgba(30, 41, 59, 0) 70%);
    border-radius: 50%;
}

.cta-section h2,
.cta-section p {
    color: white;
}

.cta-section p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 1rem auto 0;
}

/* Footer */
.footer {
    background: #090f19;
    /* Deepest dark, almost black */
    color: #cbd5e1;
    padding: 60px 0 20px;
    font-size: 0.95rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-logo .logo-small {
    height: 50px;
    margin-bottom: 1rem;
    /* In case logo needs to look good on dark bg, drop-shadow helps or invert */
    filter: invert(1) brightness(1.5) drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}

.footer-logo p {
    max-width: 300px;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: #94a3b8;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.footer-links a:hover {
    color: white;
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

/* Mobile Menu Button - Hidden Desktop */
.mobile-menu-btn {
    display: none;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--header-bg);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        box-shadow: var(--shadow-md);
        padding: 2rem;
        flex-direction: column;
        align-items: center;
        clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
        transition: clip-path 0.4s ease-in-out;
        opacity: 0;
        pointer-events: none;
    }

    .nav-menu.active {
        clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
        opacity: 1;
        pointer-events: all;
    }

    .nav-menu ul {
        flex-direction: column;
        gap: 1.5rem;
        width: 100%;
        text-align: center;
    }

    .nav-menu ul li {
        width: 100%;
    }

    .nav-menu a.btn {
        width: 100%;
        display: block;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero {
        padding: 120px 0 80px;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .section-title {
        font-size: 2rem;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-logo p {
        margin: 0 auto;
    }
}