:root {
    /* Futuristic Dark Theme Palette */
    --bg-dark: #050510;       /* Very deep blue/black */
    --bg-card: rgba(20, 20, 40, 0.6); /* Glassmorphism base */
    --primary-color: #3b82f6; /* Bright Blue */
    --accent-color: #00f0ff;  /* Cyan Neon */
    --secondary-color: #7b2cbf; /* Deep Purple */
    --text-main: #e2e8f0;     /* Off-white for text */
    --text-muted: #94a3b8;    /* Muted blue-grey */
    --gradient-main: linear-gradient(135deg, #3b82f6, #7b2cbf);
    --gradient-glow: linear-gradient(45deg, #00f0ff, #7b2cbf);

    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;

    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Page Loader */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
}

#page-loader .spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 240, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.08), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(0, 240, 255, 0.05), transparent 25%);
    background-attachment: fixed;
    color: var(--text-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden; /* Prevent horizontal scroll from animations */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
}

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

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* Background Animation & Tech Grid */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.1), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(123, 44, 191, 0.1), transparent 25%);
    background-size: 50px 50px, 50px 50px, 100% 100%, 100% 100%;
    z-index: -1;
    pointer-events: none;
    animation: pulseGrid 10s ease-in-out infinite alternate;
}

@keyframes pulseGrid {
    0% { opacity: 0.5; }
    100% { opacity: 0.8; }
}

/* Header */
.main-header {
    background: rgba(5, 5, 16, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

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

.logo a {
    display: flex;
    align-items: center;
}

.nav-logo {
    max-height: 150px;
    width: auto;
}

.main-nav ul {
    display: flex;
    gap: 30px;
}

.main-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    position: relative;
    padding: 5px 0;
}

.main-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--accent-color);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent-color);
}

.main-nav a:hover {
    color: var(--white);
}

.main-nav a:hover::after {
    width: 100%;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    position: relative;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
    padding: 100px 0;
}

/* Dynamic Gradient Background for Hero */
.hero-section::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(59,130,246,0.15) 0%, rgba(5,5,16,0) 70%);
    animation: rotateGradient 20s linear infinite;
    z-index: 1;
}

@keyframes rotateGradient {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.hero-content {
    z-index: 2;
    max-width: 800px;
}

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-content h2 {
    font-size: 1.5rem;
    font-weight: 400;
    margin-bottom: 30px;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 3px;
    animation: fadeInUp 1s ease-out 0.2s backwards;
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: 50px;
    color: var(--text-muted);
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
    animation: fadeInUp 1s ease-out 0.6s backwards;
}

.btn {
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-primary {
    background: transparent;
    color: var(--bg-dark);
    border: none;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-glow);
    z-index: -1;
    transition: all 0.3s ease;
    border-radius: 50px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
    color: #fff;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-main);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-color);
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Services Section */
.services-section {
    padding: 100px 0;
    background: var(--bg-dark);
    position: relative;
}

.section-title {
    text-align: center;
    margin-bottom: 70px;
    font-size: 2.5rem;
    color: var(--text-main);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--gradient-glow);
    margin: 15px auto 0;
    border-radius: 2px;
    box-shadow: 0 0 10px var(--accent-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 40px;
}

.service-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 40px;
    border-radius: 20px;
    border: var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.03) 0%, transparent 100%);
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: var(--accent-color);
    box-shadow: 0 10px 40px rgba(0, 240, 255, 0.2), 0 0 20px rgba(0, 240, 255, 0.1) inset;
    background: rgba(20, 20, 40, 0.8);
}

.service-card .icon {
    font-size: 3.5rem;
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    filter: drop-shadow(0 0 10px rgba(59, 130, 246, 0.5));
    color: var(--accent-color);
}

.service-card h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.service-card h3 a {
    color: var(--text-main);
}

.service-card:hover h3 a {
    color: var(--accent-color);
}

.service-card p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 1rem;
    flex-grow: 1;
}

.service-action {
    margin-top: auto;
}

/* References Section */
.references-section {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--bg-dark), #020205);
    position: relative;
}

.references-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.reference-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 30px;
    border-radius: 15px;
    transition: all 0.3s ease;
    position: relative;
}

.reference-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-main);
    border-radius: 3px 0 0 3px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

.reference-card:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.reference-card:hover::after {
    opacity: 1;
    box-shadow: 0 0 10px var(--secondary-color);
}

.reference-card h3 {
    color: var(--white);
    font-size: 1.3rem;
    margin-bottom: 10px;
}

.reference-card .badge {
    display: inline-block;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.reference-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.reference-card p strong {
    color: var(--text-main);
}

/* Footer */
.main-footer {
    background: #020205;
    color: var(--text-muted);
    padding: 80px 0 30px;
    border-top: var(--glass-border);
}

.footer-col h3 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col a:hover {
    color: var(--accent-color);
    text-decoration: none;
    padding-left: 5px;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    margin-top: 50px;
    padding-top: 30px;
    font-size: 0.85rem;
}

/* Social Links in Footer */
.social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}

.social-links a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-color);
    color: var(--bg-dark);
    box-shadow: 0 0 15px var(--accent-color);
    transform: translateY(-3px);
    border-color: var(--accent-color);
}

.social-links a.x-twitter:hover {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.5);
}

.social-links a.instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    color: #ffffff;
    border-color: transparent; /* Gradient handles the border feel */
    box-shadow: 0 0 15px rgba(225, 48, 108, 0.5);
}

.social-links a.linkedin:hover {
    background: #0077b5;
    color: #ffffff;
    border-color: #0077b5;
    box-shadow: 0 0 15px rgba(0, 119, 181, 0.5);
}

/* Animations JS Trigger Classes */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px; /* Reduce container padding slightly */
    }

    .header-container {
        padding: 0 15px;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        height: calc(100vh - 80px); /* Explicit height to avoid containing block issues with backdrop-filter */
        background: #050510; /* Solid color to ensure opacity */
        backdrop-filter: blur(15px);
        padding: 40px 20px;
        overflow-y: auto;
        z-index: 2000; /* Ensure it is above other content */
    }

    .main-nav.active {
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* Better for scrolling if content is long */
        padding-top: 60px; /* Spacing from top */
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from { opacity: 0; transform: translateY(-10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    .main-nav ul {
        flex-direction: column;
        align-items: center;
        gap: 20px;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }

    .hero-section {
        padding: 60px 0;
    }

    .services-section,
    .references-section,
    .legal-section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 40px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: center;
        width: 100%;
    }

    .btn {
        width: 100%;
        max-width: 300px;
    }

    .legal-content {
        padding: 25px;
    }

    .legal-section h1 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 1.8rem;
    }

    .services-grid {
        grid-template-columns: 1fr; /* Stack cards on very small screens */
        gap: 30px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* Legal & Content Pages */
.legal-section {
    padding: 120px 0 60px; /* Top padding clears fixed header */
    min-height: 80vh;
}

.legal-content {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 50px;
    border-radius: 20px;
    border: var(--glass-border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.legal-section h1 {
    margin-bottom: 40px;
    font-size: 2.8rem;
    text-align: center;
    background: var(--gradient-glow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 30px rgba(59, 130, 246, 0.3);
}

.legal-content h2 {
    color: var(--accent-color);
    margin-top: 40px;
    margin-bottom: 20px;
    font-size: 1.4rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 10px;
}

.legal-content p, .legal-content li {
    color: var(--text-muted);
    margin-bottom: 15px;
    font-size: 1rem;
}

.legal-content strong {
    color: var(--text-main);
}

.legal-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-decoration-color: rgba(59, 130, 246, 0.3);
}

.legal-content a:hover {
    color: var(--accent-color);
    text-decoration-color: var(--accent-color);
}

/* Footer Grid Correction */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 50px;
    padding-bottom: 40px;
}

.footer-col h3 {
    position: relative;
    padding-bottom: 15px;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

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

.footer-col ul li a {
    color: var(--text-muted);
    display: inline-block;
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-col ul li a:hover {
    color: var(--accent-color);
    transform: translateX(5px);
}

/* Technology & Transparency Section */
.techno-section {
    padding: 100px 0;
    background: var(--bg-dark);
    position: relative;
    overflow: hidden;
}

.techno-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 60px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.techno-intro strong {
    color: var(--text-main);
}

.techno-carousel {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin-top: 40px;
}

.techno-carousel::before,
.techno-carousel::after {
    content: "";
    position: absolute;
    top: 0;
    width: 150px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.techno-carousel::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-dark), transparent);
}

.techno-carousel::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-dark), transparent);
}

.techno-track {
    display: flex;
    gap: 40px;
    width: max-content;
    animation: scroll 40s linear infinite;
}

.techno-track:hover {
    animation-play-state: paused;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 20px)); /* Assuming doubled content, move half - half gap */
    }
}

.techno-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    width: 180px;
    height: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s ease;
    backdrop-filter: blur(5px);
    flex-shrink: 0; /* Prevent shrinking in flex container */
}

.techno-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 240, 255, 0.1);
}

.techno-item img {
    max-width: 80%;
    max-height: 60px;
    filter: grayscale(100%) opacity(0.7);
    transition: all 0.4s ease;
}

.techno-item:hover img {
    filter: grayscale(0%) opacity(1);
}
