/* Professional Blue & White Theme - Enhanced UI/UX */
:root {
    /* Palette: Clean White & Corporate Blue */
    --bg-deep: #ffffff;
    /* Pure White */
    --bg-panel: #f8faff;
    /* Very Light Blue Tint */
    --primary: #0056b3;
    /* Corporate Strong Blue */
    --primary-hover: #004494;
    --secondary: #00a0dc;
    /* Bright Cyan/Blue */
    --accent: #e6f0ff;
    /* Light Blue Accent */
    --text-main: #0f172a;
    /* Dark Navy for Text - Improved Contrast */
    --text-muted: #64748b;
    /* Slate Blue-Grey */
    --border-light: #e2e8f0;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-glow: 0 0 20px rgba(0, 86, 179, 0.15);

    --font-header: 'Orbitron', sans-serif;
    --font-body: 'Inter', sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-deep);
    color: var(--text-main);
    line-height: 1.7;
    overflow-x: hidden;
    /* Subtle mesh pattern */
    background-image:
        radial-gradient(circle at 10% 20%, rgba(0, 86, 179, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(0, 160, 220, 0.03) 0%, transparent 20%);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-deep);
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 5px;
    border: 2px solid var(--bg-deep);
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

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

ul {
    list-style: none;
}

img {
    max-width: 100%;
    border-radius: var(--radius-md);
}

/* Layout */
section {
    padding: 5rem 0;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-family: var(--font-header);
    color: var(--text-main);
    letter-spacing: -0.02em;
    line-height: 1.2;
}

h1 {
    font-size: 3.75rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--primary);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    font-weight: 700;
}

h3 {
    font-size: 1.35rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

p {
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 2rem;
    max-width: 65ch;
}

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

/* Header */
header {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 90px;
}

.logo {
    font-family: var(--font-header);
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: -0.5px;
}

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

.nav-links {
    display: flex;
    gap: 2.5rem;
    align-items: center;
}

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-muted);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary);
}

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

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

/* Buttons */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--primary);
    color: #ffffff !important;
    padding: 0.875rem 2.25rem;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 86, 179, 0.2);
    font-size: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 86, 179, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-block {
    width: 100%;
    border-radius: var(--radius-md);
}

/* Hero Section */
.hero {
    padding-top: 160px;
    padding-bottom: 4rem;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(0, 160, 220, 0.05) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(0, 86, 179, 0.05) 0%, transparent 40%);
}

.hero .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6rem;
}

.hero-content {
    flex: 1.2;
}

.hero-content p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
    z-index: 1;
}

/* Canvas Container */
#canvas-container {
    width: 100%;
    height: 500px;
    max-width: 600px;
    position: relative;
}

canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* Services Cards */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    /* Flex layout for uniform height & alignment */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: rgba(0, 86, 179, 0.2);
}

/* Subtle gradient hover effect */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.service-icon {
    font-size: 1.25rem;
    color: var(--primary);
    margin-bottom: 1rem;
    background: var(--accent);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    /* Prevent shrinking */
}

.service-card:hover .service-icon {
    background: var(--primary);
    color: white;
    transform: rotate(5deg);
}

.service-card h3 {
    margin-bottom: 0.5rem;
    /* Compact heading */
    font-size: 1.1rem;
    line-height: 1.3;
}

.service-card p {
    flex-grow: 1;
    /* Pushes the link down */
    margin-bottom: 1rem;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.service-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: auto;
    /* Force to bottom */
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    transition: all 0.3s;
    width: fit-content;
}

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

.service-link:hover {
    color: var(--primary-hover);
}

.service-link:hover i {
    transform: translateX(4px);
}

/* Why Us */
#why-us {
    background: var(--bg-panel);
    position: relative;
}

#services {
    padding-top: 2rem;
}

/* Footer */
footer {
    background-color: var(--text-main);
    color: #94a3b8;
    padding-top: 4rem;
    padding-bottom: 2rem;
    font-size: 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 4rem;
    margin-bottom: 3rem;
}

.footer-col h4 {
    color: #ffffff;
    margin-bottom: 1.75rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-col ul li a {
    color: #94a3b8;
    transition: all 0.2s ease;
}

.footer-col ul li a:hover {
    color: #ffffff;
    padding-left: 4px;
}

.footer-logo {
    font-family: var(--font-header);
    font-size: 2rem;
    font-weight: 800;
    color: white;
    display: block;
    margin-bottom: 1rem;
}

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

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

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

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #64748b;
    font-size: 0.9rem;
}

.legal-links {
    display: flex;
    gap: 2rem;
}

.legal-links a:hover {
    color: white;
}

/* Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.reveal-active {
    opacity: 1;
    transform: translateY(0);
}

/* Media Queries */
@media (max-width: 1024px) {
    h1 {
        font-size: 3rem;
    }

    .hero .container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

    .hero-content p {
        margin-left: auto;
        margin-right: auto;
    }

    #canvas-container {
        height: 300px;
    }
}

@media (max-width: 900px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Mobile Menu & Responsive Styling */
.hamburger {
    display: none !important;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    z-index: 1001;
}

.mobile-menu-footer {
    display: none;
}

@media (max-width: 768px) {
    .hamburger {
        display: block !important;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        gap: 2rem;
        padding: 2rem;
    }

    .nav-links.nav-active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.25rem;
        font-weight: 600;
        opacity: 0;
        transform: translateX(20px);
        transition: all 0.4s ease;
    }

    /* Stagger animation for links when menu opens */
    .nav-links.nav-active a {
        opacity: 1;
        transform: translateX(0);
    }

    .nav-links.nav-active a:nth-child(1) {
        transition-delay: 0.1s;
    }

    .nav-links.nav-active a:nth-child(2) {
        transition-delay: 0.2s;
    }

    .nav-links.nav-active a:nth-child(3) {
        transition-delay: 0.3s;
    }

    .nav-links.nav-active a:nth-child(4) {
        transition-delay: 0.4s;
    }

    .mobile-menu-footer {
        display: flex;
        gap: 1.5rem;
        margin-top: 2rem;
    }

    .mobile-menu-footer a {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        background: var(--accent);
        color: var(--primary);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.1rem;
    }

    /* Prevent scrolling when menu is open */
    body.menu-open {
        overflow: hidden;
    }
}

@media (max-width: 600px) {
    section {
        padding: 2.5rem 0;
    }

    .container {
        padding: 0 1.5rem;
    }

    h1 {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    h2 {
        font-size: 1.75rem;
        margin-bottom: 2.5rem;
    }

    .hero {
        padding-top: 140px;
        gap: 2rem;
    }

    .hero-content p {
        font-size: 1rem;
        margin-bottom: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .service-card {
        padding: 1.25rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2.5rem;
    }

    .social-links {
        justify-content: center;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .legal-links {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
}