/* CSS Custom Properties */
:root {
    --navbar-bg: rgba(10, 10, 10, 0.95);
    --navbar-scrolled-bg: rgba(10, 10, 10, 0.98);
    --primary-black: #0a0a0a;
    --secondary-black: #1a1a1a;
    --primary-purple: #8b5cf6;
    --secondary-purple: #a855f7;
    --accent-purple: #c084fc;
    --text-white: #ffffff;
    --text-gray: #e5e7eb;
    --text-muted: #9ca3af;
    --border-color: #374151;
    --shadow-color: rgba(139, 92, 246, 0.3);
    --gradient-primary: linear-gradient(135deg, var(--primary-purple), var(--secondary-purple));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-purple), var(--accent-purple));
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--primary-black);
    color: var(--text-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

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

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 1rem 0;
    background: var(--navbar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: var(--transition-smooth);
    border-bottom: 1px solid var(--border-color);
}

.navbar.scrolled {
    background: var(--navbar-scrolled-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-white);
}

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

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

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

.nav-link {
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition-smooth);
}

.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: var(--transition-smooth);
}

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

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

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-white);
    margin: 3px 0;
    transition: var(--transition-smooth);
}

/* Hero Section */
.hero {
    height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.wave-animation {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(139, 92, 246, 0.1) 50%, 
        transparent 70%);
    animation: waveFlow 8s ease-in-out infinite;
}

@keyframes waveFlow {
    0%, 100% {
        transform: translateX(-100%) rotate(0deg);
        opacity: 0.3;
    }
    50% {
        transform: translateX(100%) rotate(180deg);
        opacity: 0.7;
    }
}

.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(2px 2px at 20px 30px, var(--primary-purple), transparent),
        radial-gradient(2px 2px at 40px 70px, var(--secondary-purple), transparent),
        radial-gradient(1px 1px at 90px 40px, var(--accent-purple), transparent),
        radial-gradient(1px 1px at 130px 80px, var(--primary-purple), transparent);
    background-repeat: repeat;
    background-size: 200px 100px;
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(-100px);
    }
}

.hero-content {
    text-align: center;
    z-index: 1;
    max-width: 800px;
    padding: 0 2rem;
}

.hero-title {
    font-size: clamp(3rem, 8vw, 6rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
}

.title-line {
    display: block;
    opacity: 0;
    transform: translateY(50px);
    animation: titleReveal 1s ease-out forwards;
}

.title-line:nth-child(2) {
    animation-delay: 0.3s;
}

@keyframes titleReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-gray);
    margin-bottom: 2.5rem;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.6s forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    opacity: 0;
    animation: fadeInUp 1s ease-out 0.9s forwards;
}

.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition-bounce);
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-white);
    box-shadow: 0 10px 30px var(--shadow-color);
    animation: pulse 2.5s infinite ease-in-out;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 15px 40px var(--shadow-color);
    animation-play-state: paused; /* Pause the pulse on hover to let the hover effect take over */
}

@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 10px 30px var(--shadow-color);
    }
    50% {
        transform: scale(1.03);
        box-shadow: 0 13px 35px var(--shadow-color);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 10px 30px var(--shadow-color);
    }
}

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

.btn-secondary:hover {
    background: var(--primary-purple);
    transform: translateY(-3px);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 2px solid var(--primary-purple);
    border-bottom: 2px solid var(--primary-purple);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

/* Section Styles */
section {
    padding: 5rem 0;
    position: relative;
}

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

.section-title {
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 1rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

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

/* About Section */
.about {
    background: var(--secondary-black);
}

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

.about-text h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-purple);
}

.about-text p {
    margin-bottom: 1.5rem;
    color: var(--text-gray);
    line-height: 1.8;
}

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

.stat-item {
    text-align: center;
}

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

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

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

.floating-card {
    background: linear-gradient(135deg, var(--secondary-black), var(--primary-black));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    animation: float 6s ease-in-out infinite;
}

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

.floating-card h4 {
    color: var(--primary-purple);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.floating-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Services Section */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.1), transparent);
    transition: var(--transition-smooth);
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-10px);
    border-color: var(--primary-purple);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.service-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    color: var(--primary-purple);
}

.service-icon svg {
    width: 100%;
    height: 100%;
}

.service-card h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-white);
}

.service-card p {
    color: var(--text-gray);
    line-height: 1.6;
}

/* Portfolio Section */
.portfolio {
    background: var(--secondary-black);
}

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

.portfolio-item {
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
}

.portfolio-item:hover {
    transform: translateY(-10px);
    border-color: var(--primary-purple);
    box-shadow: 0 20px 40px var(--shadow-color);
}

.portfolio-image {
    width: 100%;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.portfolio-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-image img {
    transform: scale(1.05);
}

.portfolio-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.portfolio-content h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-white);
}

.portfolio-content p {
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.portfolio-content .btn {
    align-self: flex-start;
}

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

.contact-info h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-purple);
}

.contact-info p {
    color: var(--text-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

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

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-gray);
}

.contact-item svg {
    width: 20px;
    height: 20px;
    color: var(--primary-purple);
}

.contact-form {
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 2rem;
}

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    background: var(--primary-black);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-white);
    font-family: inherit;
    transition: var(--transition-smooth);
}

.form-group input: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 input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

/* Footer */
.footer {
    background: var(--primary-black);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0 1rem;
}

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

.footer-section h3,
.footer-section h4 {
    margin-bottom: 1rem;
    color: var(--text-white);
}

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

.footer-section p {
    color: var(--text-gray);
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
}

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

.footer-section ul li a {
    color: var(--text-gray);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.footer-section ul li a:hover {
    color: var(--primary-purple);
}

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

.social-link {
    width: 40px;
    height: 40px;
    background: var(--secondary-black);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-white);
    text-decoration: none;
    transition: var(--transition-smooth);
}

.social-link:hover {
    background: var(--primary-purple);
    border-color: var(--primary-purple);
    transform: translateY(-3px);
}

.social-link svg {
    width: 20px;
    height: 20px;
}

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

@keyframes float-particle {
    0% { transform: translateY(0) translateX(0); opacity: 1; }
    100% { transform: translateY(-150px) translateX(20px); opacity: 0; }
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation-name: float-particle;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
}

/* Custom Cursor */
body {
    cursor: none;
}

.custom-cursor {
    position: fixed;
    width: 24px;
    height: 24px;
    border: 2px solid var(--primary-purple);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease-out, opacity 0.2s;
    animation: cursor-hum 2s infinite ease-in-out;
}

.custom-cursor.pointer {
    transform: translate(-50%, -50%) scale(0.5);
    background-color: var(--primary-purple);
    animation: none; /* Turn off humming when it's a pointer */
}

.custom-cursor.clicked {
    transform: translate(-50%, -50%) scale(0.3) !important;
}

@keyframes cursor-hum {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px var(--primary-purple), inset 0 0 5px var(--primary-purple);
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        box-shadow: 0 0 20px var(--primary-purple), inset 0 0 10px var(--primary-purple);
    }
}

/* Theme Switcher */
.theme-switcher {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 1rem;
}

.theme-switcher svg {
    width: 22px;
    height: 22px;
    color: var(--text-gray);
    transition: var(--transition-smooth);
}

.theme-switcher:hover svg {
    color: var(--primary-purple);
}

.moon-icon {
    display: none;
}

/* Light Theme */
body.light-theme .moon-icon {
    display: block;
}

body.light-theme .sun-icon {
    display: none;
}

body.light-theme {
    --navbar-bg: rgba(255, 255, 255, 0.95);
    --navbar-scrolled-bg: rgba(255, 255, 255, 0.98);
    --primary-black: #FFFFFF;
    --secondary-black: #F5F5F7;
    --primary-purple: #6D28D9;
    --secondary-purple: #8B5CF6;
    --text-white: #1D1D1F;
    --text-gray: #515154;
    --text-muted: #86868B;
    --border-color: #D2D2D7;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --gradient-primary: linear-gradient(90deg, var(--primary-purple), var(--secondary-purple));
}

/* Adjustments for Light Theme */


body.light-theme .nav-logo {
    color: var(--text-white);
}

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

body.light-theme .nav-link {
    color: var(--text-gray);
}

body.light-theme .nav-link:hover, body.light-theme .nav-link.active {
    color: var(--primary-purple);
}

body.light-theme .hamburger .bar {
    background-color: var(--text-white);
}

body.light-theme .hero-background {
    background: #F5F5F7;
}

body.light-theme .wave-animation {
    opacity: 0.1;
}

body.light-theme .particle {
    background: rgba(0, 0, 0, 0.2);
}

body.light-theme .btn-primary {
    background: var(--primary-purple);
    color: #FFFFFF;
}

body.light-theme .btn-secondary {
    background: transparent;
    color: var(--primary-purple);
    border-color: var(--primary-purple);
}

body.light-theme .floating-card {
    background: linear-gradient(135deg, #FFFFFF, #F5F5F7);
}

body.light-theme .contact-form {
    background: #FFFFFF;
}

body.light-theme .form-group input, body.light-theme .form-group textarea {
    background: #FFFFFF;
}

body.light-theme .footer {
    background: #FFFFFF;
}

body.light-theme .footer-section h3 {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-theme .social-link {
    background: #F5F5F7;
    color: var(--text-gray);
}

body.light-theme .social-link:hover {
    background: var(--primary-purple);
    color: #FFFFFF;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: var(--secondary-black);
        width: 100%;
        text-align: center;
        transition: var(--transition-smooth);
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-menu li {
        margin: 1rem 0;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .stats {
        justify-content: center;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
    }
    
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Scroll 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.6s ease-out;
}

.slide-in-left.visible {
    opacity: 1;
    transform: translateX(0);
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.6s ease-out;
}

.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Performance Optimizations */
* {
    will-change: auto;
}

.hero-background,
.wave-animation,
.particles {
    will-change: transform;
}

.btn,
.service-card,
.portfolio-item {
    will-change: transform;
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .wave-animation,
    .particles,
    .floating-card {
        animation: none;
    }
}

