/* Global navigation flicker prevention */
html {
    scroll-behavior: smooth;
    /* Enable hardware acceleration for smoother navigation */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
}

/* Prevent flicker during any page navigation */
* {
    /* Force hardware acceleration */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
    perspective: 1000;
}
body {

    font-family: 'Montserrat', Arial, sans-serif;

    margin: 0;

    background: linear-gradient(120deg, #f7f9fb 60%, #eebbc3 100%);

    color: #222;

    /* Prevent flash during page transitions */
    opacity: 1;
    transform: translateZ(0);
    will-change: opacity, transform;

}

header {

    background: #232946;

    color: #fff;

    padding: 1.5rem 0;

    box-shadow: 0 2px 8px rgba(35,41,70,0.07);
    
    position: relative;
    z-index: 1000;

}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.logo {

    font-size: 2rem;

    margin: 0;

    letter-spacing: 2px;

    display: flex;

    align-items: center;

    gap: 0.5rem;

}

/* Logo icon specific styling for proper alignment */
.logo i {

    font-size: 1.8rem;

    line-height: 1;

    vertical-align: middle;

    margin-right: 0.5rem;

}

/* Logo link styling */
.logo-link {

    color: white;

    text-decoration: none;

    display: flex;

    align-items: center;

}

nav a {

    color: #fff;

    text-decoration: none;

    margin-left: 2rem;

    font-weight: 700;

    transition: color 0.2s;

    position: relative;

}

nav a::after {

    content: '';

    display: block;

    width: 0;

    height: 2px;

    background: #eebbc3;

    transition: width 0.3s;

    position: absolute;

    left: 0;

    bottom: -4px;

}

nav a:hover {

    color: #eebbc3;

}

nav a:hover::after {

    width: 100%;

}

/* Current page navigation styling */
.nav-current {

    color: #eebbc3 !important;

}

/* Footer link styling */
.footer-link {

    color: #eebbc3;

}

/* GitHub link styling in portfolio */
.github-link {

    color: #eebbc3;

}

/* Navigation flash prevention */
nav {

    contain: layout style paint;

}

nav a {

    contain: layout style paint;

}

.hero.enhanced-hero {

    background: linear-gradient(120deg, #232946 60%, #eebbc3 100%);

    color: #fff;

    padding: 4rem 0 3rem 0;

    text-align: center;

    position: relative;

    overflow: hidden;

}

.hero-content {

    display: flex;

    align-items: center;

    justify-content: space-between;

    flex-wrap: wrap;

    gap: 1.5rem;

}

.hero-text {

    flex: 1 1 350px;

    min-width: 300px;

    text-align: left;

}

.hero-graphic {

    flex: 1 1 250px;

    display: flex;

    gap: 1.2rem;

    justify-content: center;

    align-items: center;

    flex-wrap: wrap;

}

.tech-icon {

    width: 48px;

    height: 48px;

    background: #fff;

    border-radius: 50%;

    padding: 8px;

    box-shadow: 0 2px 8px rgba(35,41,70,0.07);

    transition: transform 0.2s;

}

.tech-icon:hover {

    transform: scale(1.15) rotate(-8deg);

}

.cta {

    background: #eebbc3;

    color: #232946;

    padding: 0.8rem 2rem;

    border-radius: 30px;

    font-weight: 700;

    text-decoration: none;

    font-size: 1.1rem;

    transition: background 0.2s, color 0.2s;

    box-shadow: 0 2px 8px rgba(35,41,70,0.07);

    margin-top: 2rem;

    display: inline-block;

}

.cta:hover {

    background: #fff;

    color: #232946;

}

.container {

    width: 95%;

    max-width: 1400px;

    margin: 0 auto;

}

.services {

    padding: 3rem 0;

    background: #fff;

    /* Prevent flicker during navigation */
    contain: layout style paint;
    transform: translateZ(0);

}

.services h2 {

    text-align: center;

    margin-bottom: 2rem;

}

.service-list {

    display: flex;

    flex-wrap: wrap;

    gap: 1.5rem;

    justify-content: center;

}

.service {

    background: #f7f9fb;

    border-radius: 16px;

    box-shadow: 0 2px 16px rgba(35,41,70,0.10);

    padding: 2rem 1.5rem;

    width: 100%;
    max-width: 300px;

    text-align: center;

    transition: transform 0.15s ease, box-shadow 0.15s ease;

    position: relative;

    overflow: hidden;

    /* Disabled animation to prevent flash during navigation */
    backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform: translateZ(0);
    will-change: transform;

}

/* Service cards 3 per row on large screens */
@media (min-width: 900px) {
    .service-list {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 1000px;
        margin: 0 auto;
    }

    .service {
        width: auto;
        margin: 0;
    }
}

/* Portfolio styles moved to portfolio.css */

/* Flutter styles moved to portfolio.css */

/* Portfolio responsive design moved to portfolio.css */

/* Performance optimizations to prevent flash */
* {
    /* Prevent layout shift during animations */
    box-sizing: border-box;
}

/* Global flash prevention during navigation */
* {
    /* Disable animations that could cause flash */
    animation-duration: 0s !important;
    animation-delay: 0s !important;
}

/* Smooth navigation without flash */
body {
    /* Ensure consistent rendering */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Stack section optimizations */
.stack {

    contain: layout style paint;

}

.stack-list span {

    contain: layout style paint;
    will-change: transform, background-color;

}

/* Smooth page transitions */
.container {

    contain: layout;

}

/* Page load optimization - prevent flash */
body {
    opacity: 1;
    /* No transition to prevent flash during navigation */
}

/* Smooth transitions for all interactive elements */
.service,
.portfolio-item,
.tech-icon,
.stack-list span {
    will-change: transform;
}

.service:hover {

    transform: translateY(-8px) scale(1.03);
    
    box-shadow: 0 6px 24px rgba(35,41,70,0.13);

    /* Hardware acceleration to prevent flicker */
    -webkit-transform: translateZ(0) translateY(-8px) scale(1.03);
    backface-visibility: hidden;

}

.service-icon {

    font-size: 2.2rem;

    color: #eebbc3;

    margin-bottom: 1rem;

    display: block;

}

.stack {

    padding: 3rem 0;

    background: #eebbc3;

}

.stack h2 {

    text-align: center;

    margin-bottom: 1.5rem;

    color: #232946;

}

.stack-list {

    display: flex;

    flex-wrap: wrap;

    gap: 1.2rem;

    justify-content: center;

}

.stack-list span {

    background: #fff;

    color: #232946;

    padding: 0.7rem 1.5rem;

    border-radius: 20px;

    font-weight: 700;

    font-size: 1rem;

    box-shadow: 0 1px 4px rgba(35,41,70,0.07);

    display: flex;

    align-items: center;

    gap: 0.5rem;

    transition: background 0.2s, color 0.2s;

}

.stack-list span i {

    color: #eebbc3;

    font-size: 1.2rem;

}

.stack-list span:hover {

    background: #232946;

    color: #fff;

    /* Smooth transition without flash */
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 41, 70, 0.3);

}

.ai-projects {

    padding: 3rem 0;

    background: linear-gradient(120deg, #f7f9fb 60%, #eebbc3 100%);

    /* Prevent flicker during navigation */
    contain: layout style paint;
    transform: translateZ(0);

}

.ai-projects h2 {

    text-align: center;

    margin-bottom: 2rem;

}

.ai-list {

    display: flex;

    flex-wrap: wrap;

    gap: 1.5rem;

    justify-content: center;

}

.ai-item {

    background: #fff;

    border-radius: 16px;

    box-shadow: 0 2px 16px rgba(35,41,70,0.10);

    padding: 2rem 1.5rem;

    width: 100%;
    max-width: 350px;

    text-align: center;

    transition: transform 0.15s ease, box-shadow 0.15s ease;

    /* Disabled animation to prevent flash during navigation */
    backface-visibility: hidden;
    transform-style: preserve-3d;
    -webkit-transform: translateZ(0);
    will-change: transform;

}

.ai-item:hover {

    transform: translateY(-8px) scale(1.03);

    box-shadow: 0 6px 24px rgba(35,41,70,0.13);

    /* Hardware acceleration to prevent flicker */
    -webkit-transform: translateZ(0) translateY(-8px) scale(1.03);
    backface-visibility: hidden;

}

.ai-icon {

    font-size: 2.2rem;

    color: #232946;

    margin-bottom: 1rem;

    display: block;

}

.ai-item h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    line-height: 1.3;
    word-wrap: break-word;
    hyphens: auto;
    overflow-wrap: break-word;
}

.ai-item p {
    font-size: 1rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.contact {

    padding: 3rem 0 2rem 0;

    background: #fff;

}

.contact h2 {

    text-align: center;

    margin-bottom: 1.5rem;

}

.contact-email-text {

    text-align: center;

    font-size: 1.2rem;

    margin-top: 1rem;

}

.contact-email-text a {

    color: #232946;

    font-weight: 700;

    text-decoration: underline;

    transition: color 0.2s;

}

.contact-email-text a:hover {

    color: #eebbc3;

}

.cv-badge {

    display: inline-block;
    background: #eebbc3;
    color: #232946 !important;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-weight: 700;
    text-decoration: none !important;
    margin-left: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(238, 187, 195, 0.3);
    font-size: 1rem;

}

.cv-badge:hover {

    background: #232946;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(35, 41, 70, 0.3);

}

.cv-badge i {

    margin-right: 0.4rem;

}

footer {

    background: #232946;

    color: #fff;

    text-align: center;

    padding: 1.2rem 0;

    font-size: 1rem;

    margin-top: 0;

}

@media (max-width: 1000px) {

    .hero-content {

        flex-direction: column;

        text-align: center;

    }

    .hero-text {

        text-align: center;

    }

}

@media (max-width: 800px) {

    .service-list, .stack-list, .ai-list {

        flex-direction: column;

        align-items: center;

    }

    .hero-content {

        flex-direction: column;

        text-align: center;

    }

}

/* Mobile Menu Styles */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 0.4rem;
    z-index: 100000;
    position: relative;
    background: transparent;
    border: none;
    outline: none;
}

.mobile-menu-toggle .hamburger-line {
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 2.5px 0;
    transition: 0.3s;
    border-radius: 2px;
    display: block;
    /* Enhanced visibility */
    box-shadow: 0 0 1px rgba(0,0,0,0.3);
}

/* Alternative high-contrast version for better visibility */
@media (max-width: 768px) {
    .mobile-menu-toggle .hamburger-line {
        box-shadow: 0 0 2px rgba(0,0,0,0.5);
    }
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #232946;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mobile-nav.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    /* Ensure mobile menu overlay is always on top when active */
    z-index: 999999 !important;
}

/* Also ensure the toggle button stays on top when menu is active */
.mobile-menu-toggle.active {
    z-index: 1000000 !important;
    position: fixed;
    right: 1rem;
    top: 1.5rem;
}

.mobile-nav a {
    color: #fff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1rem 0;
    padding: 1rem 2rem;
    border-radius: 30px;
    transition: all 0.3s ease;
    text-align: center;
}

.mobile-nav a:hover {
    background: #eebbc3;
    color: #232946;
    transform: translateY(-2px);
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    /* Navigation */
    .desktop-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 100000;
        transition: all 0.3s ease;
    }
    
    /* Keep hamburger visible and in fixed position when menu is open */
    .mobile-menu-toggle.active {
        position: fixed !important;
        top: 1.5rem !important;
        transform: none !important;
    }
    
    /* Hero Section */
    .hero {
        padding: 2rem 0 1.5rem 0;
    }
    
    .hero-text h2 {
        font-size: 1.8rem;
        line-height: 1.3;
        margin-bottom: 1rem;
    }
    
    .hero-text p {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }
    
    .hero-graphic {
        gap: 0.8rem;
        margin-top: 1.5rem;
    }
    
    .tech-icon {
        width: 40px;
        height: 40px;
        padding: 6px;
    }
    
    /* Services */
    .services {
        padding: 2rem 0;
    }
    
    .services h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .service {
        width: 100%;
        max-width: 350px;
        padding: 1.5rem 1rem;
        margin: 0.5rem 0;
    }
    
    .service-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
    }
    
    .service h3 {
        font-size: 1.2rem;
        margin-bottom: 0.8rem;
    }
    
    .service p {
        font-size: 0.95rem;
        line-height: 1.5;
    }
    
    /* Tech Stack */
    .stack {
        padding: 2rem 0;
    }
    
    .stack h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .stack-list {
        gap: 0.8rem;
        padding: 0 1rem;
    }
    
    .stack-list span {
        font-size: 0.9rem;
        padding: 0.6rem 1.2rem;
    }
    
    .stack-list span i {
        font-size: 1rem;
    }
    
    /* AI Projects */
    .ai-projects {
        padding: 2rem 0;
    }
    
    .ai-projects h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
        line-height: 1.3;
    }
    
    .ai-list {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .ai-item {
        width: 100%;
        max-width: 350px;
        padding: 1.5rem 1rem;
        margin: 0;
        text-align: center;
    }
    
    .ai-icon {
        font-size: 2rem;
        margin-bottom: 0.8rem;
        display: block;
    }
    
    .ai-item h3 {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
        line-height: 1.3;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    .ai-item p {
        font-size: 0.9rem;
        line-height: 1.5;
        text-align: left;
    }
    
    /* Contact */
    .contact {
        padding: 2rem 0 1.5rem 0;
    }
    
    .contact h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .contact-email-text {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .cv-badge {
        display: block;
        margin: 1rem auto 0;
        width: fit-content;
        text-align: center;
    }
    
    /* Logo */
    .logo {
        font-size: 1.5rem;
        letter-spacing: 1px;
    }
    
    .logo i {
        font-size: 1.5rem;
        margin-right: 0.4rem;
    }
    
    /* Container */
    .container {
        width: 90%;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    /* Extra small screens */
    .hero-text h2 {
        font-size: 1.5rem;
    }
    
    .hero-text p {
        font-size: 0.9rem;
    }
    
    .tech-icon {
        width: 35px;
        height: 35px;
        padding: 5px;
    }
    
    .services h2,
    .stack h2,
    .ai-projects h2,
    .contact h2 {
        font-size: 1.5rem;
    }
    
    .service,
    .ai-item {
        padding: 1.2rem 0.8rem;
    }
    
    .ai-item {
        max-width: 320px;
    }
    
    .ai-item h3 {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .ai-item p {
        font-size: 0.85rem;
        line-height: 1.4;
    }
    
    .ai-icon {
        font-size: 1.8rem;
        margin-bottom: 0.6rem;
    }
    
    .stack-list span {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
    }
    
    .mobile-nav a {
        font-size: 1.3rem;
        padding: 0.8rem 1.5rem;
    }
    
    .logo {
        font-size: 1.3rem;
    }
    
    .logo i {
        font-size: 1.3rem;
    }
}

@keyframes fadeInUp {

    from {

        opacity: 0;

        transform: translateY(30px);

    }

    to {

        opacity: 1;

        transform: translateY(0);

    }

}

