:root {
    font-size: 18px;
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --background-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --background-color: #121212;
    --text-color: #ffffff;
    --card-bg: #1e1e1e;
    --shadow: rgba(255, 255, 255, 0.1);
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
    transition: background-color 0.3s, color 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

section {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

section.visible {
    opacity: 1;
    transform: translateY(0);
}

header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: transparent;
    z-index: 1000;
    transition: background-color 0.3s, box-shadow 0.3s;
}

header.scrolled {
    background-color: var(--background-color);
    box-shadow: 0 2px 10px var(--shadow);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    transition: color 0.3s;
}

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

#theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

#theme-toggle:hover {
    transform: scale(1.1);
}

main {
    margin-top: 80px;
}

.hero {
    position: relative;
    text-align: center;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(0,123,255,0.8), rgba(108,117,125,0.8)), url('https://images.unsplash.com/photo-1504384308090-c894fdcc538d') center/cover no-repeat;
    color: white;
    overflow: hidden;
    animation: fadeIn 1s ease-out;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 0;
}

.hero h1 {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    position: relative;
    z-index: 1;
    display: inline-block;
    padding: 1rem 2rem;
    background-color: rgba(0,0,0,0.7);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
    font-size: 2rem;
    font-weight: bold;
    border: 2px solid white;
}

.cta-button:hover {
    background-color: rgba(0,0,0,0.9);
    color: white;
}

.services, .ai-services, .about, .portfolio, .testimonials {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.services h2, .ai-services h2, .about h2, .portfolio h2, .testimonials h2 {
    text-align: center;
    margin-bottom: 3rem;
    font-size: 2.5rem;
}

.service-grid, .portfolio-grid, .testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card, .portfolio-item, .testimonial {
    background: linear-gradient(145deg, var(--card-bg), rgba(255,255,255,0.1));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,0.18);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.service-card:hover, .portfolio-item:hover, .testimonial:hover,
.service-card:active, .portfolio-item:active, .testimonial:active {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 15px 40px rgba(0,0,0,0.2);
    background: linear-gradient(145deg, rgba(255,255,255,0.2), var(--card-bg));
}

.service-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.service-card h3, .portfolio-item h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.testimonial p {
    font-style: italic;
}

.testimonial cite {
    display: block;
    margin-top: 1rem;
    font-weight: bold;
}

.contact {
    text-align: center;
    padding: 4rem 2rem;
    background-color: var(--card-bg);
}

.contact h2 {
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

#contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 4px 6px var(--shadow);
}

#contact-form label {
    display: flex;
    flex-direction: column;
    text-align: left;
    font-weight: 600;
    color: var(--text-color);
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-row label {
    flex: 1;
}

#contact-form input, #contact-form textarea {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--secondary-color);
    border-radius: 6px;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: border-color 0.3s, box-shadow 0.3s;
    width: 100%;
}

#contact-form input:focus, #contact-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

#contact-form textarea {
    resize: vertical;
    min-height: 120px;
    width: 100%;
}

#contact-form button {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s, box-shadow 0.3s;
    align-self: flex-start;
}

#contact-form button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--primary-color);
    color: white;
}

.social-links {
    margin-top: 1rem;
}

.social-links a {
    margin: 0 1rem;
    text-decoration: none;
    color: white;
    transition: color 0.3s;
}

.social-links a:hover {
    color: var(--secondary-color);
}

.hamburger {
    display: none;
    cursor: pointer;
    background: none;
    border: none;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px 0;
    background-color: var(--text-color);
    transition: all 0.3s ease-in-out;
    border-radius: 2px;
}

.hamburger.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

@media (max-width: 768px) {
    nav {
        padding: 1rem;
    }

    .hamburger {
        display: block;
        position: absolute;
        top: 1rem;
        right: 1rem;
        z-index: 1001;
    }

    #theme-toggle {
        position: absolute;
        top: 1rem;
        right: 4rem;
        z-index: 1002;
    }

    .hamburger.active {
        transform: rotate(90deg);
    }

    #nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background: linear-gradient(145deg, var(--background-color), rgba(255,255,255,0.1));
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 8px 32px rgba(0,0,0,0.1);
        border: 1px solid rgba(255,255,255,0.18);
        animation: slideInRight 0.3s ease-out;
    }

    #nav-links.active {
        display: flex;
    }

    nav ul li {
        margin: 1rem 0;
        text-align: center;
        animation: slideInLeft 0.5s ease-out;
        animation-fill-mode: both;
    }

    nav ul li:nth-child(1) { animation-delay: 0.1s; }
    nav ul li:nth-child(2) { animation-delay: 0.2s; }
    nav ul li:nth-child(3) { animation-delay: 0.3s; }
    nav ul li:nth-child(4) { animation-delay: 0.4s; }
    nav ul li:nth-child(5) { animation-delay: 0.5s; }
    nav ul li:nth-child(6) { animation-delay: 0.6s; }

    .hero h1 {
        font-size: 2rem;
        animation: bounceIn 1s ease-out;
    }

    .hero p {
        animation: fadeIn 1s ease-out 0.5s;
        animation-fill-mode: both;
    }

    .cta-button {
        animation: slideInRight 1s ease-out 1s;
        animation-fill-mode: both;
    }

    .services, .ai-services, .about, .portfolio, .testimonials {
        padding: 2rem 1rem;
    }

    .service-grid, .portfolio-grid, .testimonial-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card, .portfolio-item, .testimonial {
        animation: slideInLeft 0.8s ease-out;
        animation-fill-mode: both;
    }

    .service-card:nth-child(odd), .portfolio-item:nth-child(odd), .testimonial:nth-child(odd) {
        animation-name: slideInLeft;
    }

    .service-card:nth-child(even), .portfolio-item:nth-child(even), .testimonial:nth-child(even) {
        animation-name: slideInRight;
    }

    .service-card:nth-child(1) { animation-delay: 0.1s; }
    .service-card:nth-child(2) { animation-delay: 0.2s; }
    .service-card:nth-child(3) { animation-delay: 0.3s; }
    .service-card:nth-child(4) { animation-delay: 0.4s; }
    .service-card:nth-child(5) { animation-delay: 0.5s; }
    .service-card:nth-child(6) { animation-delay: 0.6s; }
    .service-card:nth-child(7) { animation-delay: 0.7s; }
    .service-card:nth-child(8) { animation-delay: 0.8s; }

    .portfolio-item:nth-child(1) { animation-delay: 0.1s; }
    .portfolio-item:nth-child(2) { animation-delay: 0.2s; }
    .portfolio-item:nth-child(3) { animation-delay: 0.3s; }
    .portfolio-item:nth-child(4) { animation-delay: 0.4s; }
    .portfolio-item:nth-child(5) { animation-delay: 0.5s; }
    .portfolio-item:nth-child(6) { animation-delay: 0.6s; }
    .portfolio-item:nth-child(7) { animation-delay: 0.7s; }

    .testimonial:nth-child(1) { animation-delay: 0.1s; }
    .testimonial:nth-child(2) { animation-delay: 0.2s; }
    .testimonial:nth-child(3) { animation-delay: 0.3s; }
    .testimonial:nth-child(4) { animation-delay: 0.4s; }
    .testimonial:nth-child(5) { animation-delay: 0.5s; }
    .testimonial:nth-child(6) { animation-delay: 0.6s; }
    .testimonial:nth-child(7) { animation-delay: 0.7s; }
    .testimonial:nth-child(8) { animation-delay: 0.8s; }

    #contact-form {
        max-width: 100%;
        animation: fadeIn 1s ease-out;
    }

    footer {
        animation: slideInRight 1s ease-out;
    }
}