/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal overflow */
html, body {
    overflow-x: hidden;
    width: 100%;
}

/* Ensure all containers respect viewport width */
.container,
.hero-container,
.nav-container,
.section-header,
.services-grid,
.about-content,
.portfolio-grid,
.contact-content,
.footer-content {
    max-width: 100vw;
    overflow-x: hidden;
}

:root {
    /* Purple Color Palette */
    --primary-purple: #8B5CF6;
    --secondary-purple: #A855F7;
    --light-purple: #C4B5FD;
    --dark-purple: #7C3AED;
    --purple-50: #FAF5FF;
    --purple-100: #F3E8FF;
    --purple-200: #E9D5FF;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    --gradient-light: linear-gradient(135deg, var(--purple-100), var(--purple-200));
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-purple: 0 10px 25px -5px rgba(139, 92, 246, 0.3);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* Spacing */
    --container-max-width: 1400px;
    --section-padding: 80px 0;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --white: #1F2937;
    --gray-50: #111827;
    --gray-100: #1F2937;
    --gray-200: #374151;
    --gray-300: #4B5563;
    --gray-400: #6B7280;
    --gray-500: #9CA3AF;
    --gray-600: #D1D5DB;
    --gray-700: #E5E7EB;
    --gray-800: #F3F4F6;
    --gray-900: #FFFFFF;
    --purple-50: #1F2937;
    --purple-100: #374151;
    --purple-200: #4B5563;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    background-color: var(--white);
}

/* Container */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure all main containers have proper spacing */
.hero-container,
.nav-container,
.section-header,
.services-grid,
.about-content,
.portfolio-grid,
.contact-content,
.footer-content {
    box-sizing: border-box;
}

/* Responsive container adjustments */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
        max-width: calc(100% - 32px);
    }
    
    /* Ensure grids don't overflow */
    .services-grid,
    .portfolio-grid {
        padding: 0 8px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
        max-width: calc(100% - 24px);
    }
    
    /* Extra protection for very small screens */
    .services-grid,
    .portfolio-grid {
        padding: 0 4px;
    }
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    z-index: 1000;
    transition: all 0.3s ease;
}

/* Dark mode navbar styling */
[data-theme="dark"] .navbar {
    background: rgba(139, 92, 246, 0.95);
    border-bottom: 1px solid rgba(168, 85, 247, 0.3);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .nav-link:hover {
    color: var(--white);
}

[data-theme="dark"] .logo-text {
    color: var(--white);
}

[data-theme="dark"] .language-switcher {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .lang-btn {
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .lang-btn.active {
    background: var(--white);
    color: var(--primary-purple);
}

[data-theme="dark"] .lang-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

[data-theme="dark"] .dark-mode-toggle {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
}

/* Mobile menu dark mode styling */
[data-theme="dark"] .nav-menu {
    background-color: var(--primary-purple);
}

[data-theme="dark"] .bar {
    background: var(--white);
}

.nav-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

/* Responsive nav container adjustments */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        max-width: calc(100% - 32px);
    }
}

@media (max-width: 480px) {
    .nav-container {
        padding: 0 12px;
        max-width: calc(100% - 24px);
    }
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    width: 32px;
    height: 32px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-purple);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-purple);
}

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

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

.nav-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.language-switcher {
    display: flex;
    background: var(--gray-100);
    border-radius: 8px;
    padding: 4px;
}

.lang-btn {
    background: none;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-600);
}

.lang-btn.active {
    background: var(--primary-purple);
    color: var(--white);
}

.lang-btn:hover:not(.active) {
    background: var(--gray-200);
    color: var(--gray-800);
}

.dark-mode-toggle {
    background: var(--gray-100);
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark-mode-toggle:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

[data-theme="dark"] .dark-mode-toggle {
    background: var(--gray-200);
    color: var(--gray-700);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background: var(--gray-300);
}

.moon-icon {
    display: none;
}

[data-theme="dark"] .sun-icon {
    display: none;
}

[data-theme="dark"] .moon-icon {
    display: block;
}

/* Footer dark mode styling */
[data-theme="dark"] .footer {
    background: var(--gray-50);
    color: var(--gray-300);
}

[data-theme="dark"] .footer-description {
    color: var(--gray-400);
}

[data-theme="dark"] .footer-title {
    color: var(--gray-900);
}

[data-theme="dark"] .footer .logo-text {
    color: var(--gray-900);
}

[data-theme="dark"] .footer-links a {
    color: var(--gray-400);
}

[data-theme="dark"] .footer-links a:hover {
    color: var(--light-purple);
}

[data-theme="dark"] .social-link {
    color: var(--gray-400);
}

[data-theme="dark"] .social-link:hover {
    color: var(--light-purple);
}

[data-theme="dark"] .footer-bottom {
    border-top: 1px solid var(--gray-600);
    color: var(--gray-400);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--gray-700);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, var(--purple-50) 0%, var(--white) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 2;
}

/* Responsive hero container adjustments */
@media (max-width: 768px) {
    .hero-container {
        padding: 0 32px;
        max-width: calc(100% - 64px);
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-container {
        padding: 0 24px;
        max-width: calc(100% - 48px);
        text-align: center;
    }
}

/* Extra small screens - keep content nicely centered with good margins */
@media (max-width: 360px) {
    .hero-container {
        padding: 0 20px;
        max-width: calc(100% - 40px);
    }
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 3rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--white);
    box-shadow: var(--shadow-purple);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px -5px rgba(139, 92, 246, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--primary-purple);
    border: 2px solid var(--primary-purple);
}

.btn-outline:hover {
    background: var(--primary-purple);
    color: var(--white);
    transform: translateY(-2px);
}

.btn-full {
    width: 100%;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-purple);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray-600);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hero-image {
    position: relative;
    width: 400px;
    height: 400px;
}

.floating-card {
    position: absolute;
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    animation: float 6s ease-in-out infinite;
}

.floating-card.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 60%;
    right: 10%;
    animation-delay: 2s;
}

.floating-card.card-3 {
    bottom: 20%;
    left: 30%;
    animation-delay: 4s;
}

.card-icon {
    font-size: 2rem;
}

.card-title {
    font-weight: 600;
    color: var(--gray-700);
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Sections */
section {
    padding: var(--section-padding);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: var(--gray-600);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Section */
.services {
    background: var(--gray-50);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.service-card {
    background: var(--white);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--light-purple);
}

.service-icon {
    width: 56px;
    height: 56px;
    background: var(--gradient-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--primary-purple);
}

.service-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.service-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.service-features {
    list-style: none;
}

.service-features li {
    padding: 0.5rem 0;
    color: var(--gray-700);
    position: relative;
    padding-left: 1.5rem;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-purple);
    font-weight: bold;
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.about-features {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.feature-icon {
    width: 24px;
    height: 24px;
    background: var(--primary-purple);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    flex-shrink: 0;
    margin-top: 2px;
}

.feature-text h4 {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.feature-text p {
    color: var(--gray-600);
    font-size: 0.95rem;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.image-placeholder {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

/* Portfolio Section */
.portfolio {
    background: var(--gray-50);
}

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

.portfolio-item {
    background: var(--white);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.portfolio-image {
    height: 200px;
    overflow: hidden;
}

.portfolio-content {
    padding: 2rem;
}

.portfolio-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

.portfolio-description {
    color: var(--gray-600);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.portfolio-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--purple-100);
    color: var(--primary-purple);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Contact Section */
.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
}

.contact-description {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 2rem;
    line-height: 1.7;
}

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

.contact-method {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 12px;
}

.method-icon {
    width: 48px;
    height: 48px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    flex-shrink: 0;
}

.method-details h4 {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.method-details p {
    color: var(--gray-600);
}

/* Contact Form */
.contact-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.footer-description {
    color: var(--gray-400);
    line-height: 1.6;
}

.footer-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--gray-200);
}

.footer .logo-text {
    color: var(--gray-200);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

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

.social-link {
    color: var(--gray-400);
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-link:hover {
    color: var(--light-purple);
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    padding-top: 1rem;
    text-align: center;
    color: var(--gray-400);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--white);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: var(--shadow-lg);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-controls {
        order: -1;
        gap: 0.5rem;
    }

    .language-switcher {
        padding: 2px;
    }

    .lang-btn {
        padding: 6px 8px;
        font-size: 0.8rem;
    }

    .dark-mode-toggle {
        padding: 8px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-toggle.active .bar:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .nav-toggle.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
        padding: 0 32px;
        max-width: calc(100% - 64px);
    }

    .hero-title {
        font-size: 2.5rem;
        max-width: 90%;
        margin: 0 auto 1.5rem auto;
    }

    .hero-subtitle {
        max-width: 85%;
        margin: 0 auto 2rem auto;
    }

    .hero-stats {
        justify-content: center;
        max-width: 80%;
        margin: 0 auto;
    }

    .hero-buttons {
        justify-content: center;
        flex-wrap: wrap;
        max-width: 90%;
        margin: 0 auto 3rem auto;
    }

    .hero-visual {
        max-width: 90%;
        margin: 0 auto;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

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

    .floating-card {
        position: static;
        margin: 0.75rem;
        animation: none;
        max-width: 140px;
        padding: 1rem;
    }

    .hero-image {
        width: 100%;
        height: auto;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.75rem;
        max-width: 90%;
        margin: 0 auto;
    }

    /* Better spacing for sections on mobile */
    section {
        padding: 60px 0;
    }

    .section-header {
        margin-bottom: 3rem;
        padding: 0 16px;
    }

    /* Improve service cards on mobile */
    .service-card {
        padding: 1.25rem;
        margin: 0 8px;
    }

    /* Better contact form spacing */
    .contact-form {
        padding: 1.5rem;
        margin: 0 8px;
    }

    /* Footer improvements */
    .footer-content {
        gap: 1.5rem;
        padding: 0 16px;
    }
}

/* Medium screens - tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .hero-container {
        padding: 0 24px;
        gap: 3rem;
    }
    
    .section-header {
        padding: 0 24px;
    }
    
    .service-card {
        padding: 1.75rem;
    }
    
    .contact-form {
        padding: 1.75rem;
    }
    
    .footer-content {
        padding: 0 24px;
    }
}

/* Small tablets and large phones */
@media (max-width: 768px) and (min-width: 481px) {
    .hero-container {
        padding: 0 20px;
        max-width: calc(100% - 40px);
    }
    
    .section-header {
        padding: 0 20px;
    }
    
    .service-card {
        padding: 1.5rem;
        margin: 0 10px;
    }
    
    .contact-form {
        padding: 1.75rem;
        margin: 0 10px;
    }
    
    .footer-content {
        padding: 0 20px;
    }
}

@media (max-width: 480px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .contact-form {
        padding: 1.25rem;
        margin: 0 4px;
    }

    /* Extra small screen adjustments */
    .hero-container {
        padding: 0 24px;
        max-width: calc(100% - 48px);
    }

    .hero-title {
        font-size: 2rem;
        max-width: 95%;
        margin: 0 auto 1.5rem auto;
        line-height: 1.3;
    }

    .hero-subtitle {
        font-size: 1.1rem;
        line-height: 1.6;
        max-width: 90%;
        margin: 0 auto 2rem auto;
    }

    .section-title {
        font-size: 2rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
        max-width: 70%;
        margin: 0 auto;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        max-width: 85%;
        margin: 0 auto 3rem auto;
    }

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

    /* Better spacing for portfolio items */
    .portfolio-item {
        margin: 0 4px 1rem 4px;
    }

    .portfolio-content {
        padding: 1.5rem;
    }

    .hero-visual {
        max-width: 85%;
        margin: 0 auto;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Custom Animations */

/* Typewriter Effect */
.hero-title.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-purple);
    white-space: nowrap;
    animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
    width: 0;
    animation-fill-mode: forwards;
}

.hero-title.typewriter.typing-complete {
    border-right: none;
    animation: typing 3.5s steps(40, end) forwards;
}

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary-purple); }
}

/* Magnetic Cursor Effect */
.magnetic {
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    cursor: pointer;
}

.magnetic:hover {
    transform: scale(1.02);
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

[data-theme="dark"] .skeleton {
    background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
    background-size: 200% 100%;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Scroll-in Animations */
.scroll-reveal {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

.scroll-reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.scroll-reveal-scale {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scroll-reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Staggered animations for multiple elements */
.scroll-reveal.delay-1 { transition-delay: 0.1s; }
.scroll-reveal.delay-2 { transition-delay: 0.2s; }
.scroll-reveal.delay-3 { transition-delay: 0.3s; }
.scroll-reveal.delay-4 { transition-delay: 0.4s; }

/* Enhanced floating cards with network connections */
.hero-visual {
    position: relative;
}

/* Animated Network Map Background */
.network-map-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.03) 0%, transparent 70%);
}

.network-node {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--primary-purple);
    border-radius: 50%;
    animation: pulse-node 3s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
    opacity: 0.9;
}

.network-node::after {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    width: 26px;
    height: 26px;
    border: 2px solid var(--primary-purple);
    border-radius: 50%;
    opacity: 0;
    animation: ripple 3s ease-in-out infinite;
}

@keyframes pulse-node {
    0%, 100% { 
        transform: scale(1);
        opacity: 0.8;
    }
    50% { 
        transform: scale(1.4);
        opacity: 1;
    }
}

@keyframes ripple {
    0% {
        transform: scale(0.5);
        opacity: 1;
    }
    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

.network-connection {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-purple), transparent);
    opacity: 0.8;
    animation: flow-connection 4s ease-in-out infinite;
    transform-origin: 0 50%;
    box-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
    border-radius: 1px;
    min-width: 20px;
}

/* Enhanced flow animation with better scaling */
@keyframes flow-connection {
    0%, 100% { 
        opacity: 0.4;
        transform: scaleX(0.8);
        box-shadow: 0 0 4px rgba(139, 92, 246, 0.3);
    }
    50% { 
        opacity: 1;
        transform: scaleX(1.2);
        box-shadow: 0 0 12px rgba(139, 92, 246, 0.6);
    }
}

/* Improved connection variations with different animation delays */
.network-connection:nth-child(odd) {
    animation-duration: 5s;
}

.network-connection:nth-child(even) {
    animation-duration: 3.5s;
}

.network-connection:nth-child(3n) {
    animation-duration: 4.5s;
    opacity: 0.9;
}

.network-connection:nth-child(4n) {
    animation-duration: 6s;
    opacity: 0.7;
}

/* Data flow particles */
.data-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--light-purple);
    border-radius: 50%;
    opacity: 0;
    animation: data-flow 6s linear infinite;
    box-shadow: 0 0 6px rgba(168, 85, 247, 0.8);
}

@keyframes data-flow {
    0% { opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { opacity: 0; }
}

/* Dark mode adjustments */
[data-theme="dark"] .network-map-bg {
    opacity: 0.8;
    background: radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.05) 0%, transparent 70%);
}

[data-theme="dark"] .network-node {
    background: var(--light-purple);
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.8);
}

[data-theme="dark"] .network-node::after {
    border-color: var(--light-purple);
}

[data-theme="dark"] .network-connection {
    background: linear-gradient(90deg, transparent, var(--light-purple), transparent);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

[data-theme="dark"] .network-connection:nth-child(odd) {
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.6);
}

[data-theme="dark"] .network-connection:nth-child(even) {
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
}

[data-theme="dark"] .network-connection:nth-child(3n) {
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.7);
}

[data-theme="dark"] .data-particle {
    background: var(--primary-purple);
    box-shadow: 0 0 8px rgba(139, 92, 246, 1);
}

/* Responsive animations */
@media (max-width: 768px) {
    .hero-title.typewriter {
        white-space: normal;
        animation: none;
        border-right: none;
        width: auto;
    }
    
    .magnetic {
        transform: none !important;
    }
    
    /* Simplify network map on mobile */
    .network-map-bg {
        opacity: 0.4;
    }
    
    .network-node {
        width: 8px;
        height: 8px;
        animation-duration: 4s;
    }
    
    .network-node::after {
        width: 20px;
        height: 20px;
        top: -6px;
        left: -6px;
    }
    
    .network-connection {
        height: 1.5px;
        animation-duration: 5s;
    }
    
    .data-particle {
        width: 3px;
        height: 3px;
        animation-duration: 8s;
    }
    
    /* Faster scroll animations on mobile */
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        transition-duration: 0.6s;
    }
    
    /* Reduce transform distance on mobile */
    .scroll-reveal {
        transform: translateY(30px);
    }
    
    .scroll-reveal-left {
        transform: translateX(-30px);
    }
    
    .scroll-reveal-right {
        transform: translateX(30px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .network-node,
    .network-connection {
        animation: none;
    }
    
    .scroll-reveal,
    .scroll-reveal-left,
    .scroll-reveal-right,
    .scroll-reveal-scale {
        transition: none;
        opacity: 1;
        transform: none;
    }
}

/* Large screens (1440px and up) */
@media (min-width: 1440px) {
    :root {
        --container-max-width: 1600px;
    }
    
    .nav-link {
        font-size: 1.1rem;
    }
    
    .hero-title {
        font-size: 4rem;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
    }
    
    .section-title {
        font-size: 3rem;
    }
    
    .btn {
        padding: 14px 28px;
        font-size: 1.1rem;
    }
    
    .service-card {
        padding: 2.5rem;
    }
    
    .floating-card {
        width: 140px;
        height: 140px;
    }
    
    .network-node {
        width: 12px;
        height: 12px;
    }
    
    .network-connection {
        height: 2.5px;
    }
}

/* Extra large screens (1920px and up) */
@media (min-width: 1920px) {
    :root {
        --container-max-width: 1800px;
    }
    
    .nav-link {
        font-size: 1.2rem;
    }
    
    .hero-title {
        font-size: 4.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.5rem;
    }
    
    .section-title {
        font-size: 3.5rem;
    }
    
    .btn {
        padding: 16px 32px;
        font-size: 1.2rem;
    }
    
    .hero-container {
        gap: 6rem;
    }
    
    .service-card {
        padding: 3rem;
    }
    
    .floating-card {
        width: 160px;
        height: 160px;
        font-size: 1.1rem;
    }
    
    .network-node {
        width: 14px;
        height: 14px;
    }
    
    .network-connection {
        height: 3px;
    }
}

/* Ultra-wide and 4K screens (2560px and up) */
@media (min-width: 2560px) {
    :root {
        --container-max-width: 2200px;
    }
    
    .nav-link {
        font-size: 1.3rem;
    }
    
    .hero-title {
        font-size: 5rem;
    }
    
    .hero-subtitle {
        font-size: 1.6rem;
    }
    
    .section-title {
        font-size: 4rem;
    }
    
    .btn {
        padding: 18px 36px;
        font-size: 1.3rem;
        border-radius: 10px;
    }
    
    .hero-container {
        gap: 8rem;
    }
    
    .service-card {
        padding: 3.5rem;
    }
    
    .service-card h3 {
        font-size: 1.8rem;
    }
    
    .service-description {
        font-size: 1.1rem;
    }
    
    .floating-card {
        width: 180px;
        height: 180px;
        font-size: 1.2rem;
    }
    
    .portfolio-item {
        padding: 2rem;
    }
    
    .network-node {
        width: 16px;
        height: 16px;
    }
    
    .network-connection {
        height: 3.5px;
    }
    
    .data-particle {
        width: 5px;
        height: 5px;
    }
}

/* Focus styles for accessibility */
.btn:focus,
input:focus,
select:focus,
textarea:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-purple);
    outline-offset: 2px;
}

/* Smooth animations */
.service-card,
.portfolio-item,
.btn {
    will-change: transform;
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
/* Very small screens (360px and smaller) */
@media (max-width: 360px) {
    .hero-container {
        padding: 0 20px;
        max-width: calc(100% - 40px);
    }
    
    .hero-title {
        font-size: 1.8rem;
        max-width: 100%;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        max-width: 95%;
    }
    
    .hero-buttons {
        max-width: 90%;
    }
    
    .hero-buttons .btn {
        max-width: 240px;
        padding: 12px 20px;
    }
    
    .hero-stats {
        max-width: 80%;
    }
    
    .hero-visual {
        max-width: 90%;
    }
    
    .floating-card {
        max-width: 120px;
        padding: 0.75rem;
        margin: 0.5rem;
    }
    
    .hero-image {
        gap: 0.5rem;
    }
    
    .section-header {
        padding: 0 20px;
    }
    
    .service-card {
        padding: 1rem;
        margin: 0 8px;
    }
    
    .contact-form {
        padding: 1.25rem;
        margin: 0 8px;
    }
    
    .footer-content {
        padding: 0 20px;
    }
}
