/* --- VARIABLES & RESET --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary: #2D3748; /* Professional Dark Blue-Gray */
    --secondary: #4A5568;
    --accent: #3182CE; /* Refined Blue */
    --accent-2: #805AD5; /* Elegant Purple */
    --bg-dark: #0F1419;
    --bg-card: rgba(26, 32, 44, 0.85);
    --text-light: #F7FAFC;
    --text-gray: #CBD5E0;
    --glow-primary: rgba(49, 130, 206, 0.3);
    --glow-accent: rgba(128, 90, 213, 0.25);
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-main);
    background-color: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- BACKGROUND CANVAS --- */
#bg-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
}

/* --- NAVIGATION --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 8%;
    background: rgba(15, 20, 25, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(49, 130, 206, 0.15);
    position: sticky; top: 0; z-index: 100;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4);
    animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.logo-container {
    display: flex; align-items: center; gap: 15px;
    text-decoration: none; color: white;
}

.logo-img { height: 50px; object-fit: contain; }

.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a {
    text-decoration: none; color: var(--text-light);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
    text-shadow: 0 0 10px var(--glow-primary);
}

/* --- SECTIONS GENERAL --- */
main { flex: 1; }
section { padding: 4rem 8%; }

.section-header {
    text-align: center; margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}
.section-header h2 {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(120deg, var(--text-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
    letter-spacing: -0.5px;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- HERO SECTION --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80vh;
    padding: 0 8%;
}

.hero-text { flex: 1; max-width: 600px; }
.hero-text h1 {
    font-size: 4rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    font-weight: 900;
    animation: slideInLeft 0.8s ease-out;
}
.hero-text span {
    background: linear-gradient(120deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-gray);
    margin-bottom: 2rem;
    animation: slideInLeft 0.8s ease-out 0.2s both;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-visual img {
    width: 100%;
    max-width: 450px;
    animation: floatRotate 8s ease-in-out infinite;
    filter: drop-shadow(0 10px 30px rgba(49, 130, 206, 0.3));
    transition: all 0.3s ease;
}

.hero-visual img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 15px 40px rgba(49, 130, 206, 0.4));
}

@keyframes floatRotate {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.btn {
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(49, 130, 206, 0.3);
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.4);
    background: var(--accent-2);
}

/* --- SERVICES GRID --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

@media (max-width: 1200px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
    }
}

.service-card {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 2.5rem;
    border-radius: 16px;
    border: 1px solid rgba(49, 130, 206, 0.15);
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.service-card::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(49, 130, 206, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.service-card:hover::after {
    opacity: 1;
}

.service-card i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: inline-block;
    transition: all 0.3s ease;
}

.service-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(49, 130, 206, 0.2);
}

.service-card:hover i {
    transform: scale(1.1);
    color: var(--accent-2);
}

/* --- TRUSTED PARTNERS --- */
.partners-section {
    background: rgba(0,0,0,0.3);
    text-align: center;
    padding: 3rem 8%;
    overflow: hidden;
}

.partners-carousel-wrapper {
    width: 100%;
    overflow: hidden;
    margin-top: 2rem;
    position: relative;
}

.partners-carousel {
    display: flex;
    gap: 5rem;
    align-items: center;
    animation: scroll-partners 30s linear infinite;
    width: max-content;
}

.partners-carousel:hover {
    animation-play-state: paused;
}

@keyframes scroll-partners {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}
.partner-logo {
    font-size: 3rem;
    color: var(--text-gray);
    opacity: 0.5;
    transition: 0.3s;
    cursor: pointer;
}
.partner-logo:hover {
    color: white;
    opacity: 1;
    transform: scale(1.1);
}

/* --- PARTNER LOGO IMAGES --- */
.partner-link {
    display: inline-block;
    transition: all 0.3s ease;
}

.partner-logo-img {
    height: 100px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    filter: grayscale(100%) brightness(0.7) opacity(0.6);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: 15px;
}

.partner-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.partner-link:hover .partner-logo-img {
    filter: grayscale(0%) brightness(1.1) opacity(1);
    transform: scale(1.15) translateY(-5px);
    box-shadow: 0 10px 30px rgba(124, 58, 237, 0.3);
}

/* --- CUSTOMER LOGOS --- */
.customer-logo {
    text-align: center;
    transition: all 0.3s ease;
}
.customer-logo:hover i {
    opacity: 1 !important;
    color: var(--primary) !important;
    transform: scale(1.1);
}
.customer-logo:hover p {
    color: white !important;
}

/* --- ABOUT PAGE --- */
.split-layout {
    display: flex;
    align-items: center;
    gap: 4rem;
    margin-bottom: 4rem;
}
.split-img {
    flex: 1;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.4);
}
.split-img img { width: 100%; height: auto; display: block; }
.split-text { flex: 1; }

/* --- PROJECTS PAGE --- */
.project-card {
    background: var(--bg-card);
    border-radius: 15px;
    overflow: hidden;
    transition: 0.3s;
}
.project-card:hover { transform: translateY(-10px); }
.project-img {
    height: 250px;
    width: 100%;
    object-fit: cover;
}
.project-content { padding: 1.5rem; }
.tags span {
    font-size: 0.8rem;
    background: rgba(108, 99, 255, 0.2);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 20px;
    margin-right: 5px;
}

/* --- TEAM PAGE --- */
.team-img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    border: 4px solid var(--accent);
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 32px rgba(49, 130, 206, 0.3);
    transition: all 0.3s ease;
}

.team-img:hover {
    transform: scale(1.09);
    box-shadow: 0 12px 40px rgba(49, 130, 206, 0.4);
}

/* Specific adjustment for Jad's image */
img[src="jad.jpeg"] {
    object-position: center 30%;
}


/* --- FOOTER --- */
footer {
    background: #02040a;
    padding: 3rem 8%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    border-top: 1px solid #1e293b;
}
.footer-col h4 { color: white; margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 0.5rem; color: var(--text-gray); cursor: pointer; }
.footer-col ul li:hover { color: var(--primary); }

/* Single column footer (centered copyright) */
footer.simple-footer {
    display: block;
    text-align: center;
    padding: 2rem 8%;
}
footer.simple-footer p {
    color: var(--text-gray);
    font-size: 0.9rem;
}

/* --- FEATURES GRID --- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-item {
    text-align: center;
    padding: 2.5rem;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(49, 130, 206, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.feature-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(49, 130, 206, 0.08), transparent);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.feature-item:hover::before {
    width: 200%;
    height: 200%;
}

.feature-item:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(49, 130, 206, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.feature-item:hover .feature-icon {
    transform: scale(1.1);
}

.feature-item i {
    transition: all 0.3s ease;
}

.feature-item:hover i {
    color: var(--accent-2);
}

/* --- TECH STACK --- */
.tech-stack {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.tech-category {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s ease;
}

.tech-category:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.tech-category h3 {
    color: var(--primary);
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tech-tags span {
    background: rgba(108, 99, 255, 0.15);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid rgba(108, 99, 255, 0.3);
    transition: all 0.3s ease;
}

.tech-tags span:hover {
    background: rgba(108, 99, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(108, 99, 255, 0.4);
}

/* --- SMOOTH ANIMATIONS --- */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.7s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.7s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

.scale-in {
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.6s ease-out;
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* --- ENHANCED SERVICE CARDS --- */
.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(49, 130, 206, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 0;
}

.service-card:hover::before {
    left: 100%;
}

.service-card h3,
.service-card p {
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.service-card:hover h3 {
    color: var(--accent);
}

.service-card:hover p {
    color: var(--text-light);
}

/* --- ENHANCED PROJECT CARDS --- */
.project-card {
    position: relative;
    overflow: hidden;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    border: 1px solid rgba(49, 130, 206, 0.15);
    transition: all 0.3s ease;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.08), rgba(128, 90, 213, 0.08));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.project-card:hover::after {
    opacity: 1;
}

.project-img {
    width: 100%;
    height: 250px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    transition: all 0.5s ease;
    filter: brightness(0.85);
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: var(--accent);
    box-shadow: 0 12px 40px rgba(49, 130, 206, 0.25);
}

.project-card:hover .project-img {
    transform: scale(1.05);
    filter: brightness(1);
}

.project-content {
    position: relative;
    z-index: 2;
}

/* --- STATS SECTION --- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.stat-item {
    text-align: center;
    padding: 2rem;
    background: var(--bg-card);
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s ease;
}

.stat-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary);
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-gray);
    font-size: 1rem;
}

/* --- TESTIMONIALS --- */
.testimonial-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: 15px;
    border: 1px solid rgba(255,255,255,0.05);
    transition: all 0.4s ease;
    margin-bottom: 2rem;
}

.testimonial-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 30px rgba(108, 99, 255, 0.2);
}

.testimonial-text {
    font-style: italic;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
}

/* --- TEAM SOCIAL LINKS --- */
.service-card a {
    display: inline-block;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
    pointer-events: auto;
    cursor: pointer;
}

.service-card a:hover {
    transform: translateY(-3px);
    color: var(--accent-2) !important;
}

.service-card a i {
    transition: all 0.3s ease;
    pointer-events: none;
}

.service-card a:hover i {
    transform: scale(1.2);
    filter: drop-shadow(0 0 10px rgba(49, 130, 206, 0.5));
}

/* --- MOBILE MENU --- */
.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    z-index: 101;
    transition: all 0.3s ease;
}

.mobile-menu-toggle:hover {
    color: var(--accent);
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 70%;
        max-width: 300px;
        background: rgba(15, 20, 25, 0.98);
        backdrop-filter: blur(20px);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 2rem;
        transition: right 0.4s ease;
        border-left: 1px solid rgba(49, 130, 206, 0.15);
        box-shadow: -5px 0 30px rgba(0, 0, 0, 0.5);
        z-index: 100;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        opacity: 0;
        transform: translateX(50px);
    }

    .nav-links.active li {
        opacity: 1;
        transform: translateX(0);
        animation: slideInMobile 0.5s ease forwards;
    }

    .nav-links.active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links.active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-links.active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-links.active li:nth-child(4) { animation-delay: 0.4s; }

    @keyframes slideInMobile {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    .hero, .split-layout { flex-direction: column; text-align: center; }
    .hero-text { margin-bottom: 3rem; }
    .hero-text h1 { font-size: 2.5rem; }
    .features-grid { grid-template-columns: 1fr; }
    .tech-stack { grid-template-columns: 1fr; }
}