/* Variables & Reset */
:root {
    --primary-gradient: linear-gradient(135deg, #2E3192 0%, #1BFFFF 100%);
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    /* Deep Blue Slate */
    --glass-bg: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(255, 255, 255, 0.2);
    --text-main: #FFFFFF;
    --text-secondary: #94a3b8;
    --white: #FFFFFF;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.3);
    --radius-sm: 16px;
    --radius-md: 32px;
    --radius-lg: 48px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: var(--font-main);
    background: radial-gradient(circle at top left, #1e3a8a, #0f172a, #000000);
    background-attachment: fixed;
    background-size: cover;
    /* Ensure it covers */
    min-height: 100vh;
    /* Ensure full height */
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
    position: relative;
}

/* Background Blobs - Refined for Blue Theme */
.blob-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
    animation: float 25s infinite alternate;
}

.blob-1 {
    top: -20%;
    left: -10%;
    width: min(800px, 150vw);
    height: min(800px, 150vw);
    background: #2563eb;
}

.blob-2 {
    bottom: -20%;
    right: -10%;
    width: min(700px, 140vw);
    height: min(700px, 140vw);
    background: #06b6d4;
    animation-delay: -5s;
}

.blob-3 {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(600px, 120vw);
    height: min(600px, 120vw);
    background: #3b82f6;
    opacity: 0.2;
    animation-delay: -10s;
}

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

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

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

ul {
    list-style: none;
}

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

/* Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
}

.section {
    padding: 160px 0;
    position: relative;
    overflow-x: hidden;
}

.section-title {
    font-size: 64px;
    font-weight: 800;
    text-align: center;
    margin-bottom: 100px;
    letter-spacing: -0.02em;
    background: linear-gradient(180deg, #FFFFFF 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 900px;
    height: 64px;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    z-index: 1000;
    display: flex;
    align-items: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    /* Smooth transition for responsive changes */
}

@media (max-width: 768px) {
    .navbar {
        width: 94%;
        /* Wider on mobile */
        top: 16px;
        /* Closer to top */
        height: 56px;
        /* Slightly smaller */
    }
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 24px;
}

.logo img {
    height: 36px;
    border-radius: 8px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-size: 15px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    transition: var(--transition);
}

.nav-links a:hover {
    color: #FFFFFF;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.btn-nav {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white) !important;
    padding: 10px 24px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.btn-nav:hover {
    background: var(--white);
    color: #000 !important;
    transform: translateY(-2px);
}

/* Language Selector */
.lang-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.lang-btn {
    padding: 6px 12px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    background: transparent;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lang-btn:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .lang-selector {
        gap: 4px;
        padding: 4px;
    }

    .lang-btn {
        padding: 4px 10px;
        font-size: 12px;
    }
}


/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 100px;
    /* Removed specific background to let body gradient show */
}

/* Hero background glow */
.hero::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(0, 114, 255, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    z-index: 0;
    pointer-events: none;
}

.hero-content {
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
}

.hero-logo {
    height: 200px;
    margin-bottom: 40px;
    filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.5));
    animation: pulse 4s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.5));
    }

    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 60px rgba(59, 130, 246, 0.7));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 40px rgba(59, 130, 246, 0.5));
    }
}

.hero-title {
    font-size: 96px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 32px;
    background: linear-gradient(180deg, #FFFFFF 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    max-width: 100%;
    word-wrap: break-word;
}

.hero-subtitle {
    font-size: 28px;
    color: #cbd5e1;
    margin-bottom: 60px;
    font-weight: 400;
    max-width: 700px;
    line-height: 1.4;
}

.btn {
    display: inline-block;
    padding: 20px 48px;
    border-radius: 100px;
    font-size: 18px;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--white);
    color: #0f172a;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 30px 60px rgba(255, 255, 255, 0.2);
}

/* About / Services */
.about {
    background: transparent;
    /* Let blobs show */
}

.hero-buttons {
    margin-top: 32px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-left: 0;
    /* Reset margin */
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px) scale(1.05);
    border-color: var(--white);
}

/* Stack Section */
.stack {
    padding: 60px 0;
    margin-top: 80px;
    /* Added spacing from hero */
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.stack-grid {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
}

.stack-item {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    letter-spacing: 0.02em;
}

.stack-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    border-color: #60a5fa;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.2);
}

/* Services */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    /* Reduced from 350px */
    gap: 40px;
}

.service-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 48px 32px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: var(--transition);
    text-align: left;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.service-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-8px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.service-card .icon {
    font-size: 48px;
    margin-bottom: 24px;
    display: inline-block;
    background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(34, 211, 238, 0.3));
}

.service-card h3 {
    font-size: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    color: var(--white);
    letter-spacing: -0.01em;
}

.service-card p {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 32px;
    line-height: 1.6;
    flex-grow: 1;
    /* Pushes list to bottom if needed, or keeps spacing */
}

.service-list {
    list-style: none;
    padding: 0;
    margin-top: auto;
    /* Ensures list is at bottom */
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 24px;
}

.service-list li {
    color: rgba(255, 255, 255, 0.9);
    font-size: 15px;
    margin-bottom: 12px;
    padding-left: 24px;
    position: relative;
    line-height: 1.4;
}

.service-list li:last-child {
    margin-bottom: 0;
}

.service-list li::before {
    content: "→";
    color: #60a5fa;
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
}

/* Process / Workflow Section */
.process {
    background: transparent;
    position: relative;
}

.process-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    counter-reset: step;
}

@media (max-width: 1024px) {
    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .process-steps {
        grid-template-columns: 1fr;
    }
}

.step-card {
    position: relative;
    padding: 50px 40px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.step-card:hover {
    transform: translateY(-8px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.3);
}

.step-card::before {
    counter-increment: step;
    content: "0" counter(step);
    font-size: 120px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    position: absolute;
    top: 10px;
    right: 20px;
    z-index: 0;
    line-height: 1;
}

.step-card h3 {
    font-size: 28px;
    margin-bottom: 12px;
    font-weight: 700;
    color: var(--white);
    position: relative;
    z-index: 1;
}

/* Number below title as requested */
.step-number-display {
    font-size: 40px;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 20px;
    display: block;
    position: relative;
    z-index: 1;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 17px;
    position: relative;
    z-index: 1;
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

@media (max-width: 1024px) {
    .portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.project-card {
    background: transparent;
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    aspect-ratio: 4/3;
    /* Taller/Larger cards */
}

.project-card:hover {
    transform: scale(0.98);
}

.project-image {
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
    border-radius: var(--radius-md);
}

.project-card:hover .project-image {
    transform: scale(1.1);
}

.project-info {
    padding: 40px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    transform: translateY(0);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-info {
    opacity: 1;
}

.project-info h3 {
    font-size: 32px;
    margin-bottom: 8px;
    color: var(--white);
}

.project-info p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 18px;
}

/* Contact */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    padding: 80px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.contact-text h2 {
    text-align: left;
    margin-bottom: 24px;
    background: none;
    -webkit-text-fill-color: var(--white);
    color: var(--white);
}

.contact-text p {
    font-size: 24px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.contact-emails {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.email-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.email-item span {
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.contact-email {
    font-size: 28px;
    font-weight: 700;
    color: #60a5fa;
    transition: var(--transition);
    text-decoration: none;
}

.contact-email:hover {
    color: #22d3ee;
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.4);
}

@media (max-width: 768px) {
    .contact-email {
        font-size: 22px;
    }
}

.contact-form {
    background: transparent;
    padding: 0;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    font-size: 16px;
    color: var(--white);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 16px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-family: var(--font-main);
    font-size: 18px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.05);
    color: var(--white);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.2);
}

/* Footer */
.footer {
    background: transparent;
    padding: 80px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-logo img {
    height: 40px;
    opacity: 0.6;
    filter: grayscale(100%) brightness(200%);
}

.footer p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Responsive */
@media (max-width: 1024px) {
    .section-title {
        font-size: 48px;
    }

    .hero-title {
        font-size: 72px;
    }

    .process-steps {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile UI Overrides */
@media (max-width: 768px) {

    /* 1. Mobile Navbar - Sticky Top (App-like) */
    .navbar {
        top: 0;
        left: 0;
        transform: none;
        width: 100%;
        max-width: 100%;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        background: rgba(15, 23, 42, 0.95);
        /* More solid */
        padding: 0 16px;
        height: 60px;
        justify-content: space-between;
    }

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

    /* Ensure logo is visible and properly sized */
    .logo img {
        height: 32px;
    }

    /* 2. Fix Background "Half White" Issue */
    body::before {
        content: "";
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: radial-gradient(circle at top left, #1e3a8a, #0f172a, #000000);
        z-index: -2;
        background-size: cover;
    }

    body {
        background: #0f172a;
        /* Fallback color */
        min-height: 100vh;
    }

    /* 3. Mobile Layout Adjustments */
    .section {
        padding: 80px 0;
        /* Less padding */
    }

    .container {
        padding: 0 20px;
    }

    /* Hero adjustments */
    .hero {
        min-height: auto;
        /* Allow content to dictate height if needed, or keeping 100vh might be okay */
        padding-top: 120px;
        /* Account for fixed navbar */
        padding-bottom: 60px;
    }

    .hero-title {
        font-size: 42px;
        line-height: 1.1;
    }

    .hero-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }

    /* Stack items smaller */
    .stack-item {
        font-size: 13px;
        padding: 8px 16px;
    }

    /* Cards full width */
    .service-card,
    .project-card,
    .step-card {
        width: 100%;
        margin-bottom: 20px;
    }

    .portfolio-grid,
    .services-grid,
    .process-steps {
        gap: 20px;
    }

    /* Contact form mobile */
    .contact-container {
        padding: 30px 20px;
    }

    .contact-text p {
        font-size: 18px;
    }

    .contact-email {
        font-size: 24px;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 100px 0;
    }

    .section-title {
        font-size: 36px;
        margin-bottom: 60px;
    }

    .hero-title {
        font-size: 48px;
    }

    .hero-subtitle {
        font-size: 18px;
    }

    .hero-logo {
        height: 120px;
    }

    .contact-container {
        grid-template-columns: 1fr;
        padding: 40px;
        gap: 40px;
    }

    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

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

    /* Hide desktop nav links in mobile */
    .nav-links {
        display: none;
    }

    /* Hide mobile contact button when language selector is visible */
    .mobile-nav-btn {
        display: none !important;
    }

    .stack-item {
        font-size: 14px;
        padding: 10px 20px;
    }

    /* Additional overflow prevention */
    * {
        max-width: 100%;
    }

    .hero-buttons {
        width: 100%;
        max-width: 100%;
    }

    .hero-content,
    .contact-container,
    .services-grid,
    .portfolio-grid,
    .process-steps {
        max-width: 100%;
    }

    /* Prevent form elements from overflowing */
    input,
    textarea,
    button {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 20px;
    }

    .hero-title {
        font-size: 40px;
    }

    .btn {
        width: 100%;
        padding: 16px 24px;
    }

    .btn-secondary {
        margin-left: 0;
        margin-top: 16px;
    }

    .service-card {
        padding: 32px 24px;
    }

    .process-steps {
        grid-template-columns: 1fr;
    }
}