/* Mobile styles - Optimized for iPhone SE (375x667) and similar devices */
@media screen and (max-width: 768px) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #00ffff;
        --accent-cyan: #00ffff;
        --title-gradient: linear-gradient(45deg, #00ffff 10%, #ffffff 30%, #00ffff 50%, #ffffff 70%, #00ffff 90%);
        --z-footer: 10;
        --z-nav: 1000;
        --z-menu: 999;
        --z-overlay: 998;
        --header-height: calc(80 * 100vh / 667);
        --section-spacing: calc(40 * 100vh / 667);
    }

    /* Base styles */
    body, section {
        background-color: #000913;
        color: #ffffff;
        line-height: 1.6;
        background-image: linear-gradient(to bottom right, #0a192f, #112240);
        position: relative;
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    section {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: relative;
        background: rgba(17, 34, 64, 0.95);
        overflow: hidden;
        font-family: 'Rajdhani', sans-serif;
        width: 100%;
    }

    /* Only hero section should be full height and centered */
    section.hero {
        height: 667px;
        justify-content: center;
    }

    section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: 
            radial-gradient(2px 2px at 40px 60px, #00ffff 50%, rgba(0,0,0,0)),
            radial-gradient(2px 2px at 20px 50px, rgba(0,255,255,0.4) 50%, rgba(0,0,0,0)),
            radial-gradient(2px 2px at 30px 100px, #00ffff 50%, rgba(0,0,0,0)),
            radial-gradient(2px 2px at 40px 60px, rgba(0,255,255,0.4) 50%, rgba(0,0,0,0)),
            radial-gradient(2px 2px at 110px 90px, #00ffff 50%, rgba(0,0,0,0)),
            radial-gradient(2px 2px at 190px 150px, rgba(0,255,255,0.4) 50%, rgba(0,0,0,0));
        background-size: 200px 200px;
        animation: stars 4s linear infinite;
        opacity: 0.1;
        z-index: 0;
    }

    section::after {
        content: '';
        position: absolute;
        inset: 0;
        background: 
            linear-gradient(90deg, transparent 0%, rgba(0,255,255,0.05) 45%, transparent 55%),
            linear-gradient(0deg, transparent 0%, rgba(0,255,255,0.05) 45%, transparent 55%);
        background-size: 200% 200%, 200% 200%;
        animation: crosshair 15s linear infinite;
        z-index: 1;
    }

    section:nth-child(odd) {
        background: rgba(10, 25, 47, 0.95);
    }

    section > * {
        position: relative;
        z-index: 2;
    }

    /* Hero base layout only */
    .hero {
        min-height: clamp(20svh, 30svh, 40svh);
        width: 100%;
        padding-inline: clamp(1rem, 3vw, 2rem);
        padding-top: clamp(2rem, 6vh, 5rem);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero .hero-content {
        width: clamp(85%, 90%, 95%);
        max-width: 90vw;
        gap: clamp(0.15rem, 0.5vh, 0.35rem);
        margin: 0 auto;
        padding: clamp(0.5rem, 2vh, 1rem) 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero .hero-title {
        min-height: 60px;
        width: 100%;
        max-width: 95%;
        margin: 1rem auto;
        padding: 2rem 1rem 0;
        display: flex;
        align-items: center;
        justify-content: center;
        opacity: 0;
        animation: fadeInUp 0.8s ease forwards;
    }

    .typed-text {
        font-size: clamp(2.2rem, 3vw, 2.5rem);
        width: 95vw;
        min-height: 1.2em;
        line-height: 1.2;
        text-align: center;
        font-weight: 900;
        display: block;
        margin: 0;
        padding: 0;
        white-space: normal;
        letter-spacing: 0.05em;
        transform: scaleY(1.3);
        background: linear-gradient(
            45deg,
            #00ffff 0%,
            #ffffff 25%,
            #00ffff 45%,
            #ffffff 55%,
            #00ffff 75%,
            #ffffff 85%,
            #00ffff 100%
        );
        background-size: 300% 300%;
        -webkit-background-clip: text;
        -moz-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        -moz-text-fill-color: transparent;
        filter: drop-shadow(0 2px 1px rgba(0, 0, 0, 1));
    }


   

    .scroll-indicator {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        transform: scale(0.8);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    /* Remove/comment out #background-video styles */
    /* #background-video { ... } */

    #background-video {
        display: none;
    }

    .hero .hero-content {
        width: 95vw;
        margin-inline: auto;
        justify-content: center;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4vh;
        text-align: center;
        padding: 0;
        margin-top: 25vh;
    }

    /* Contact form base styles */
    .contact-form {
        background: rgba(1, 17, 29, 0.9);
        border-radius: 12px;
        padding: 40px;
        border: 3px solid #00ffff;
        max-width: 800px;
        margin: 0 auto;
        text-align: center;
    }

    .contact-form input,
    .contact-form textarea {
        width: 80%;
        padding: 15px;
        margin: 10px 0;
        border: 2px solid #00ffff;
        border-radius: 8px;
        font-size: 18px;
        font-weight: 700;
        background: rgba(255, 255, 255, 0.1);
        color: #ffffff;
    }

    .contact-form button {
        background: #00ffff;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 15px 25px;
        cursor: pointer;
        font-size: 20px;
        font-weight: 700;
        margin-top: 15px;
        width: 80%;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

    /* Mobile-specific overrides */
    body .hero {
        min-height: clamp(20svh, 30svh, 40svh);
        width: 100%;
        overflow: hidden;
        padding-inline: clamp(1rem, 3vw, 2rem);
        margin-top: clamp(0.25rem, 1vh, 0.75rem);
        padding-top: clamp(2rem, 6vh, 5rem);
    }

    body .hero .hero-content {
        width: clamp(85%, 90%, 95%);
        gap: clamp(0.15rem, 0.5vh, 0.35rem);
        max-width: 90vw;
        margin: 0 auto;
        padding: clamp(0.5rem, 2vh, 1rem) 0;
    }

    body .hero .hero-content p {
        font-size: clamp(0.875rem, 2.5vw, 1.25rem);
        margin: clamp(0.25rem, 1vh, 0.5rem) 0;
        line-height: clamp(1.1, 1.2, 1.3);
      
    }

    .scroll-indicator {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        transform: scale(clamp(0.7, 0.8, 0.9));
        animation: fadeInUp 0.8s ease forwards 1.5s;
    }

    /* Remove ALL section padding first */
    section {
        padding: 0;
        margin: 0;
        min-height: unset;
    }

    /* Add specific padding for content sections */
    section:not(.hero) {
        padding-top: 80px;
        padding-bottom: 2rem;
        padding-inline: 1rem;
    }

    /* Section headers - consistent spacing */
    section h2,
    .services-title,
    .work-with-me-title {
        margin: calc(40 * 100vh / 667) 0 calc(30 * 100vh / 667) 0; /* Match spacing of other sections */
        padding: 0;
        font-size: calc(40 * 100vw / 375);
        text-align: center;
        color: #00ffff;
        text-transform: uppercase;
        letter-spacing: calc(2 * 100vw / 375);
    }

    /* About section */
    section.about {
        width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Override any conflicting styles */
    section.about h2,
    .about h2 {
        margin: calc(40 * 100vh / 667) 0 calc(30 * 100vh / 667) 0; /* Same as other headers */
    }

    .about-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        width: 92%;
        padding: 0;
        margin: 0.75rem auto;
    }

    section.about .about h2,
    .about h2:not(:first-of-type) {
        display: none;
    }

    /* Services section adjustments */
    .services-grid {
        width: 100%;
        max-width: 90%;
        padding: 0 calc(15 * 100vw / 375);
        margin: 0 auto;
        display: grid;
        gap: calc(20 * 100vw / 375);
        grid-template-columns: 1fr;
    }

    .service-card {
        background: rgba(0, 20, 40, 0.98);
        padding: 2rem 1.5rem;
        border-radius: 8px;
        text-align: center;
        border: 3px solid rgba(0, 255, 255, 0.5);
        position: relative;
        overflow: hidden;
        height: 100%;
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
        margin: 0 auto;
        width: 100%;
    }

    .service-card i {
        font-size: 3rem;
        color: #00ffff;
        margin-bottom: 1.25rem;
    }

    .service-card h3 {
        margin-bottom: 0.75rem;
        font-size: 2rem;
        color: #ffffff;
        font-weight: 700;
        letter-spacing: 0.5px;
        text-shadow: none;
    }

    .service-card p {
        color: #7aa8d8;
        font-size: 1.1rem;
        line-height: 1.4;
        margin-top: auto;
        margin-bottom: 0;
        padding: 0 0.5rem;
        font-weight: 500;
    }

    #services.features {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding-bottom: 2rem; /* 2rem = 2 times the font size of the root element, which is typically 16px. So 2rem = 32px. */
    }

    /* About section adjustments */
    .about {
        width: 100%;
        padding: 0;
    }

    section.about .about h2 {
        font-size: clamp(3rem, 8vw, 4rem);
        text-align: center;
        margin-bottom: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-weight: 700;
        position: relative;
    }

    section.about .about h2::after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 100%;
        height: 2px;
        background: white;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        animation: glowPulse 2s ease-in-out infinite;
    }

    section.about .about-content .service-section {
        background: #000000;
        border-radius: 4px;
        border: 2px solid #ffffff;
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        padding: 0.75rem;
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
        min-height: 180px;
        position: relative;
        overflow: hidden;
    }

    section.about .about-content .service-section .section-title {
        font-size: clamp(2.5rem, 7vw, 3.5rem);
        font-weight: 800;
        text-transform: uppercase;
        margin: 0;
        padding: 0.2rem 0;
        line-height: 1.1;
        text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
        position: relative;
    }

    section.about .about-content .service-section .section-title::after {
        content: '';
        position: absolute;
        bottom: -3px;
        left: 0;
        width: 100%;
        height: 2px;
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
        animation: glowPulse 2s ease-in-out infinite;
    }

    section.about .about-content .bullet-point {
        font-size: clamp(1.1rem, 3.5vw, 1.3rem);
        line-height: 1.3;
        margin: 0.25rem 0;
        padding-left: 0.75rem;
        color: #ffffff;
    }

    /* What Can I Do section adjustments */
    .what-can-i-do-section {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 2rem 1rem;
        margin-bottom: 4rem;
    }

    .what-can-i-do-section .service-card {
        width: 90%;
        max-width: 400px;
        margin: 1rem auto;
        text-align: center;
    }

    #top > div > h1 > span {
        white-space: nowrap; overflow: visible;
    }

    .what-can-i-do-section .service-card img {
        width: 60px;
        height: 60px;
        margin: 0 auto;
        display: block;
    }

    .what-can-i-do-section .service-card h3 {
            text-align: center;
            width: fit-content;
            margin: 1rem 0;
        }

    .what-can-i-do-section .service-card p {
        text-align: center;
        width: 100%;
        margin: 0;
    }

    /* Work with me section adjustments */
    #contact.work-with-me.work-with-me-section {
        height: fit-content;
        min-height: unset;
        padding: 0;
        margin: 0;
        position: relative;
        background-size: 100px 100px;
    }

    #contact.work-with-me.work-with-me-section h2.work-with-me-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
        padding: 2rem 1rem;
        margin: 0;
        line-height: 1;
    }

    #contact.work-with-me.work-with-me-section .contact-form {
        width: 85%;
        margin: 0 auto 2rem auto;
        padding: 1.5rem;
    }

    /* Contact form adjustments */
    #contact.work-with-me.work-with-me-section {
        min-height: auto;
        padding: 0;
        margin: 0;
    }

    #contact.work-with-me.work-with-me-section h2 {
        background-color: rgba(0, 0, 0, 0.5);
        padding: 0.5rem 2rem;
        margin: 0 0 2rem 0;
        border-radius: 10px;
    }

    .contact-form {
        width: 85%;
        margin: 0 auto;
        padding: 0.75rem;
    }

    .contact-form form {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
    }

    .contact-form input,
    .contact-form textarea {
        padding: 0.75rem;
        margin: 0;
        width: 100%;
        font-size: 1rem;
    }

    .contact-form button {
        width: 100%;
        padding: 0.75rem;
        margin-top: 0.5rem;
        font-size: 1rem;
    }

    /* Hide extra dividers on mobile */
    .work-with-me-section {
        position: relative;
        padding: 2rem 1rem;
    }

    .work-with-me-section h2 {
        padding: 0.5rem 2rem;
        margin-bottom: 2rem;
    }

    .work-with-me-section + .section-divider,
    .work-with-me-section ~ .section-divider {
        display: none;
    }

    /* Hide pre-footer divider since we'll use footer's own divider */
    .pre-footer-divider {
        display: none;
    }

    /* Services section styles */
    #services {
        scroll-margin-top: 80px;
        min-height: 80vh;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 1rem 0;
    }

    .section-title {
        margin-bottom: 1.5rem;
        text-align: center;
        padding: 0;
    }

    .service-card {
        background: rgba(0, 20, 40, 0.98);
        padding: 1.5rem 1rem;
        border-radius: 8px;
        text-align: center;
        border: 2px solid rgba(0, 255, 255, 0.5);
        position: relative;
        overflow: hidden;
        height: 100%;
    }

    /* Hero section additional styles */
    .cursor {
        position: absolute;
        height: 100%;
        margin-left: 0.2em;
    }

    .hero-content p::before {
        display: none;
    }

    /* Header and section title styles */
    section h2 {
        font-size: clamp(2.5rem, 8vw, 4rem);
        text-align: center;
        margin-bottom: 1rem;
        position: relative;
        text-transform: uppercase;
        letter-spacing: 2px;
        white-space: normal;
        color: transparent;
        background: linear-gradient(
            45deg,
            #00ffff 0%,
            #ffffff 25%,
            #00ffff 45%,
            #ffffff 55%,
            #00ffff 75%,
            #ffffff 85%,
            #00ffff 100%
        );
        background-size: 300% 300%;
        -webkit-background-clip: text;
        -moz-background-clip: text;
        background-clip: text;
        -webkit-text-fill-color: transparent;
        -moz-text-fill-color: transparent;
        animation: logoFlow 8s ease infinite;
        text-shadow: none;
        font-weight: 700;
    }

    section p {
        font-size: clamp(1.2rem, 4vw, 1.8rem);
        margin-bottom: 1rem;
        padding: 0 1rem;
    }

    /* Scroll indicator mobile styles */
    .scroll-indicator {
        position: relative;
        flex-direction: column;
        align-items: center;
        display: flex;
        gap: 1rem;
        cursor: pointer;
        
        transform: scale(0.8);
        opacity: 0;
    }

    .scroll-indicator .mouse {
        width: 40px;
        height: 65px;
        border: 2px solid #fff;
        border-radius: 20px;
        position: relative;
        animation: glowBorder 2s ease-in-out infinite;
        box-shadow: 0 0 15px rgba(0, 255, 255, 0.2),
                    inset 0 0 15px rgba(0, 255, 255, 0.2);
        background: rgba(0, 255, 255, 0.05);
    }

    .scroll-indicator .mouse::before {
        content: '';
        position: absolute;
        width: 8px;
        height: 8px;
        background: #fff;
        left: 50%;
        transform: translateX(-50%);
        top: 8px;
        border-radius: 50%;
        animation: scrollDotMobile 2s ease-in-out infinite;
        -webkit-animation: scrollDotMobile 2s ease-in-out infinite;
        box-shadow: 0 0 10px #00ffff,
                    0 0 20px #00ffff;
    }

    .scroll-indicator span {
        font-size: clamp(1rem, 2vw, 1.2rem);
        letter-spacing: 2px;
        color: #fff;
        text-transform: uppercase;
        animation: glowText 2s ease-in-out infinite;
        text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
        font-weight: 500;
    }

    @keyframes glowBorder {
        0%, 100% {
            box-shadow: 0 0 15px rgba(0, 255, 255, 0.2),
                        inset 0 0 15px rgba(0, 255, 255, 0.2);
        }
        50% {
            box-shadow: 0 0 25px rgba(0, 255, 255, 0.4),
                        inset 0 0 25px rgba(0, 255, 255, 0.4);
        }
    }

    @keyframes glowText {
        0%, 100% {
            text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
        }
        50% {
            text-shadow: 0 0 20px rgba(0, 255, 255, 0.8);
        }
    }

    /* Animations */
    @keyframes gradientFlow {
        0% {
            background-position: 0% 0%;
        }
        100% {
            background-position: 100% 100%;
        }
    }

    @keyframes logoFlow {
        0% {
            background-position: 0% 50%;
        }
        50% {
            background-position: 100% 50%;
        }
        100% {
            background-position: 0% 50%;
        }
    }

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

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

    @keyframes glowPulse {
        0% {
            box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
            opacity: 0.8;
        }
        50% {
            box-shadow: 0 0 15px rgba(255, 255, 255, 0.8);
            opacity: 1;
        }
        100% {
            box-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
            opacity: 0.8;
        }
    }

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

    @keyframes rotateColors {
        0% { color: #00ffff; }    /* Cyan */
        12.5% { color: #ff0000; } /* Bright Red */
        25% { color: #00ff00; }   /* Bright Green */
        37.5% { color: #ff00ff; } /* Magenta */
        50% { color: #ffff00; }   /* Yellow */
        62.5% { color: #ff8c00; } /* Orange */
        75% { color: #9932ff; }   /* Purple */
        87.5% { color: #00bfff; } /* Deep Sky Blue */
        100% { color: #00ffff; }  /* Back to Cyan */
    }

    @keyframes scrollDotMobile {
        0% {
            top: 8px;
            box-shadow: 0 0 10px #00ffff,
                        0 0 20px #00ffff;
        }
        50% {
            top: 43px;
            box-shadow: 0 0 15px #00ffff,
                        0 0 25px #00ffff;
        }
        100% {
            top: 8px;
            box-shadow: 0 0 10px #00ffff,
                        0 0 20px #00ffff;
        }
    }

    .typing-text {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
        font-weight: 600;
    }

    .typing-text::after {
        content: "|";
        animation: blink 1s infinite step-end;
    }

    .work-with-me {
        padding: calc(40 * 100vh / 667) 0;
    }

    .work-with-me-title {
        font-size: calc(32 * 100vw / 375);
        margin-bottom: calc(20 * 100vh / 667);
    }

    .work-with-me p {
        font-size: calc(16 * 100vw / 375);
        margin-bottom: calc(15 * 100vh / 667);
        padding: 0 calc(20 * 100vw / 375);
        max-width: calc(340 * 100vw / 375);
    }

    .services-grid {
        padding: 0 calc(15 * 100vw / 375);
        gap: calc(20 * 100vw / 375);
    }

    .service-card {
        padding: calc(20 * 100vw / 375);
        border-radius: calc(8 * 100vw / 375);
        border-width: calc(2 * 100vw / 375);
    }

    /* Mobile Hero Layout */
    .hero {
        min-height: clamp(20svh, 30svh, 40svh);
        width: 100%;
        padding-inline: clamp(1rem, 3vw, 2rem);
        margin-top: clamp(0.25rem, 1vh, 0.75rem);
        padding-top: clamp(2rem, 6vh, 5rem);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .hero .hero-content {
        width: clamp(85%, 90%, 95%);
        max-width: 90vw;
        gap: clamp(0.15rem, 0.5vh, 0.35rem);
        margin: 0 auto;
        padding: clamp(0.5rem, 2vh, 1rem) 0;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .scroll-indicator {
        margin-top: 1.5rem;
        margin-bottom: 1rem;
        transform: scale(0.8);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    /* Mobile Video Background Positioning */
    #background-video {
        display: none;
    }

    .cta-button {
        width: 240px;         /* smaller width for mobile */
        height: 70px;         /* reduced height */
        padding: 0 12px;      /* reduced padding */
        border-radius: 15px;  /* slightly smaller radius */
    }

    .cta-container {
        padding: 20px 0;
        gap: 15px;           /* reduced gap between buttons */
    }

    .cta-button i {
        font-size: 2em;      /* smaller icon */
        width: 30px;         /* reduced icon width */
        margin-right: 8px;   /* reduced margin */
    }

    .cta-button span {
        font-size: 1.2em;    /* smaller text */
        line-height: 1.1;    /* tighter line height */
        padding-right: 3px;
        margin-left: 3px;
    }

    .hero .hero-title {
        opacity: 0;
        animation: fadeInUp 0.8s ease forwards;
    }

    .hero .hero-content p {
        opacity: 0;
        animation: fadeInUp 0.8s ease forwards 0.5s;
    }

    .hero .cta-container {
        opacity: 0;
        animation: fadeInUp 0.8s ease forwards 1s;
    }

    .mobile-scroll-indicator {
        opacity: 0;
        animation: fadeInUp 0.8s ease forwards 1.5s;
    }

    .hero * {
        animation-play-state: running !important;
    }
}
