:root {
    /* Color Palette */
    --bg-color: #050511;
    --text-primary: #f0f4f8;
    --text-secondary: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --secondary: #8b5cf6;
    --accent: #ec4899;
    
    /* Glassmorphism */
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    /* Typography */
    --font-main: 'Outfit', sans-serif;
    
    /* Layout Variables (Fluid) */
    --nav-height: 80px;
    --container-width: 1200px;
    --container-padding: 2rem;
    --section-padding: 100px;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    font-family: var(--font-main);
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

body.modal-open {
    overflow: hidden;
}

/* Background Gradients & Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}

.blob-1 {
    top: -10%;
    left: -10%;
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    background: radial-gradient(circle, rgba(139,92,246,0.3) 0%, rgba(59,130,246,0.1) 100%);
}

.blob-2 {
    bottom: 20%;
    right: -10%;
    width: 50vw;
    height: 50vw;
    max-width: 500px;
    max-height: 500px;
    background: radial-gradient(circle, rgba(236,72,153,0.2) 0%, rgba(139,92,246,0.1) 100%);
    animation-delay: -5s;
}

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

/* Typography & General */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

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

.section-padding {
    padding: var(--section-padding) 0;
}

.gradient-text {
    background: linear-gradient(to right, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* Glassmorphism Utility */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--glass-bg);
    border-color: var(--primary);
    transform: translateY(-2px);
}

[data-theme="light"] .btn-secondary:hover {
    background: rgba(59, 130, 246, 0.1);
}

/* Navbar Layer */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(5, 5, 17, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    height: 70px;
}

[data-theme="light"] .navbar.scrolled {
    background: rgba(255, 255, 255, 0.85);
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    z-index: 1001; /* Above mobile menu */
}

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

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

.nav-links a {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

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

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

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 1001; /* Above mobile menu */
}

/* Custom Select Dropdown UI */
.lang-selector select {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 6px 10px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    outline: none;
    font-size: 0.95rem;
}

[data-theme="light"] .lang-selector select option {
    background: #fff;
    color: #000;
}

[data-theme="dark"] .lang-selector select option, 
:root:not([data-theme="light"]) .lang-selector select option {
    background: #050511;
    color: #fff;
}

.theme-btn {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.theme-btn:hover {
    background: var(--glass-bg);
    color: var(--primary);
}

.hamburger {
    display: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-primary);
    flex-shrink: 0;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: var(--nav-height);
    position: relative;
}

.hero-content {
    display: flex;
    flex-direction: row;
    gap: 4rem;
    align-items: center;
    justify-content: space-between;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: clamp(2.5rem, 5vw, 4rem); /* Fluid Typography */
    margin-bottom: 1.5rem;
}

.hero-text p {
    font-size: clamp(1rem, 2vw, 1.1rem);
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 90%;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.hero-mockup {
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
    aspect-ratio: 4/3;
    position: relative;
    overflow: hidden;
}

.mockup-header {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}
.dot.red { background: #ff5f56; }
.dot.yellow { background: #ffbd2e; }
.dot.green { background: #27c93f; }

.mockup-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.code-line {
    height: 14px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
[data-theme="light"] .code-line { background: rgba(0,0,0,0.1); }

.w-30 { width: 30%; } .w-40 { width: 40%; }
.w-50 { width: 50%; } .w-60 { width: 60%; }
.w-70 { width: 70%; } .w-80 { width: 80%; }
.w-90 { width: 90%; } .w-100 { width: 100%; }

.code-line.function { background: rgba(59, 130, 246, 0.4); }
.code-line.string { background: rgba(236, 72, 153, 0.4); }

/* Services Section */
.section-header {
    text-align: center;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-header h2 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: clamp(1rem, 2vw, 1.1rem);
}

.services-grid {
    display: grid;
    /* Flawless responsive grid without strictly forcing 300px breakages */
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 2rem;
}

.service-card {
    padding: 2.5rem 2rem;
    transition: transform 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: rgba(139, 92, 246, 0.3);
    box-shadow: 0 15px 40px rgba(139, 92, 246, 0.1);
}

.icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(139, 92, 246, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(59, 130, 246, 0.2);
    flex-shrink: 0;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    flex-grow: 1;
}

/* Modal Engine (100% Mobile safe) */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 2rem var(--container-padding);
}

[data-theme="light"] .modal {
    background-color: rgba(255,255,255,0.4);
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background: var(--bg-color);
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 20px;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease, background-color 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal.show .modal-content {
    transform: scale(1);
}

/* Custom Scrollbar for Modal to look premium */
.modal-content::-webkit-scrollbar {
    width: 8px;
}
.modal-content::-webkit-scrollbar-track {
    background: var(--bg-color);
}
.modal-content::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    backdrop-filter: blur(4px);
}

.close-btn:hover {
    background: var(--primary);
}

.modal-image {
    width: 100%;
    height: 300px;
    background: #111;
    flex-shrink: 0;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-body {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.modal-body h2 {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.modal-body p {
    font-size: clamp(0.95rem, 2vw, 1.05rem);
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.modal-action {
    display: flex;
    justify-content: flex-end;
}

/* About Section */
.about-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

@media (min-width: 992px) {
    .about-wrapper {
        flex-direction: row;
        align-items: center;
    }
}

.about-image {
    flex: 1;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: clamp(1.5rem, 4vw, 3rem);
    text-align: center;
}

.stat-item h3 {
    font-size: clamp(2rem, 4vw, 2.8rem);
    margin-bottom: 0.5rem;
}

.stat-item p {
    color: var(--text-secondary);
    font-size: clamp(0.8rem, 1.5vw, 0.9rem);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.about-text {
    flex: 1;
}

.about-text h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.features-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.05rem;
    color: var(--text-primary);
}

.features-list i {
    color: var(--primary);
    font-size: 1.5rem;
    flex-shrink: 0;
}

/* Contact Section */
.contact-wrapper {
    display: flex;
    flex-direction: column;
    border-radius: 24px;
    overflow: hidden;
}

@media (min-width: 992px) {
    .contact-wrapper {
        flex-direction: row;
    }
}

.contact-info {
    flex: 1;
    padding: clamp(2rem, 5vw, 4rem);
    background: rgba(255,255,255,0.02);
    border-bottom: 1px solid var(--glass-border);
}

@media (min-width: 992px) {
    .contact-info {
        border-bottom: none;
        border-right: 1px solid var(--glass-border);
    }
}

[data-theme="light"] .contact-info { background: rgba(0,0,0,0.02); }

.contact-info h2 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
}

.contact-info > p {
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-wrapper.small {
    width: 45px;
    height: 45px;
    font-size: 1.5rem;
    border-radius: 12px;
    margin: 0;
}

.contact-item h4 {
    font-size: 1.05rem;
    margin-bottom: 0.2rem;
}

.contact-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.contact-form {
    flex: 1.5;
    padding: clamp(2rem, 5vw, 4rem);
}

.input-group {
    position: relative;
    margin-bottom: 2rem;
}

.input-group input, .input-group textarea {
    width: 100%;
    padding: 15px 0;
    background: transparent;
    border: none;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 16px; /* 16px prevents auto-zoom on iOS Safari */
    outline: none;
    transition: border-color 0.3s ease;
    border-radius: 0; /* Prevents rounded corners on iOS */
}

[data-theme="light"] .input-group input, 
[data-theme="light"] .input-group textarea {
    border-bottom-color: rgba(0,0,0,0.1);
}

.input-group textarea {
    resize: none;
}

.input-group label {
    position: absolute;
    top: 15px;
    left: 0;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    pointer-events: none;
    font-size: 1rem;
}

.input-group input:focus, .input-group textarea:focus {
    border-bottom-color: var(--primary);
}

.input-group input:focus ~ label,
.input-group textarea:focus ~ label,
.input-group input:not(:placeholder-shown) ~ label,
.input-group textarea:not(:placeholder-shown) ~ label {
    top: -12px;
    font-size: 0.8rem;
    color: var(--primary);
}

.w-100 { width: 100%; }

/* Footer */
.footer {
    border-top: 1px solid var(--glass-border);
    padding-top: 4rem;
    background: rgba(0,0,0,0.2);
}

[data-theme="light"] .footer {
    background: rgba(0,0,0,0.03);
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-brand {
    flex: 1 1 250px;
}

.footer-brand p {
    color: var(--text-secondary);
    margin: 1rem 0 2rem 0;
}

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

.social-links a {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

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

.footer-links {
    flex: 1 1 150px;
}

.footer-links h3 {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

.footer-links ul {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

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

.footer-bottom {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--glass-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in-up.active { opacity: 1; transform: translateY(0); }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* =========================================
   MEDIA QUERIES (10/10 RESPONSIVENESS)
========================================= */

@media (max-width: 992px) {
    :root {
        --container-padding: 1.5rem;
        --nav-height: 70px;
    }
    
    .hamburger { display: block; }
    
    /* Perfect Mobile Slide-in Menu Strategy */
    .nav-links {
        position: fixed;
        top: var(--nav-height);
        left: -100%;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(5, 5, 17, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: flex-start;
        padding: 2rem;
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    
    [data-theme="light"] .nav-links {
        background: rgba(255, 255, 255, 0.98);
    }
    
    .nav-links.active {
        left: 0; /* Slides in seamlessly */
    }
    
    .nav-links a {
        font-size: 1.25rem;
        width: 100%;
        text-align: center;
        padding: 1rem 0;
    }
    
    .hero-content {
        flex-direction: column;
        justify-content: center;
        padding-top: 2rem;
    }
    
    .hero-text {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-text p { max-width: 100%; }
    
    .hero-buttons { justify-content: center; }
}

@media (max-width: 576px) {
    :root {
        --container-padding: 1.2rem;
        --section-padding: 60px;
    }
    
    .logo { 
        font-size: 1.3rem; 
    }
    
    /* Prevent overcrowding on very narrow phones */
    .nav-controls { gap: 10px; }
    .theme-btn { width: 34px; height: 34px; font-size: 1.1rem; }
    .hamburger { font-size: 1.8rem; margin-left: 5px; }
    
    .hero {
        padding-top: 100px;
    }
    
    .hero-buttons { flex-direction: column; width: 100%; }
    .hero-buttons .btn { width: 100%; }
    
    .service-card { padding: 1.5rem; }
    
    .modal { padding: 1rem; }
    .modal-image { height: 200px; }
    
    /* Form specifics */
    .contact-info, .contact-form, .modal-body { padding: 1.5rem; }
    
    .footer-content { gap: 2rem; }
}

@media (max-width: 380px) {
    /* Safe catch for iPhone SE and extremely narrow screens */
    :root {
        --container-padding: 1rem;
    }
    
    .logo { font-size: 1.15rem; }
    .lang-selector select { padding: 4px 6px; font-size: 0.85rem; }
    .theme-btn { width: 30px; height: 30px; }
    .nav-controls { gap: 8px; }
    
    .hero-text h1 { font-size: 2rem; }
    .stats-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}
