:root {
    --bg-color: #020617;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #6366f1;
}

html {
    scroll-behavior: smooth;
    font-family: 'Satoshi', sans-serif;
}

body {
    background-color: var(--bg-color);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #475569;
}

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

.animate-fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }

.glass-card {
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Utility for text gradient animation if needed later */
.animate-title {
    animation: fadeInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
}

/* Section transitions */
.section-fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.section-fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
  
/* Make email link wrap and shrink on small screens */
@media (max-width: 768px) {
    a[href^="mailto:"] {
        font-size: 1.5rem; /* smaller text on mobile */
        flex-wrap: wrap;   /* allow text to go to next line */
        justify-content: center;
        text-align: center;
    }
}

/* Center the website name on mobile */
@media (max-width: 768px) {
    nav #main-nav > div {
        justify-content: center; /* centers content horizontally */
    }

    nav #main-nav a.text-xl {
        position: absolute; /* keep it on top */
        left: 50%;
        transform: translateX(-50%);
    }

    /* Optional: hide extra space for mobile menu button */
    #mobile-menu-btn {
        position: absolute;
        right: 1rem; /* stays on the right */
    }
}

/* Center the website name on mobile */
@media (max-width: 768px) {
    /* Make the container relative for absolute positioning */
    #main-nav > div {
        position: relative;
        justify-content: flex-start; /* keep the menu button on the left/right */
    }

    /* Center the logo */
    #main-nav a.text-xl {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Ensure the burger menu stays on the right */
    #mobile-menu-btn {
        position: absolute;
        right: 1.5rem;
    }
}

/* Mobile nav adjustments */
@media (max-width: 768px) {
    /* Keep logo on the left */
    #main-nav a.text-xl {
        position: static; /* logo stays where it is in the flex container */
        transform: none;
    }

    /* Position the burger menu on the right */
    #mobile-menu-btn {
        position: absolute;
        right: 1.5rem;
        top: 50%;
        transform: translateY(-50%);
    }

    /* Optional: center mobile menu links vertically */
    #mobile-menu {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }
}

/* Mobile nav: TA left, name center, burger right */
@media (max-width: 768px) {
    #main-nav > div {
        position: relative;         /* allows absolute positioning inside */
        justify-content: flex-start; /* keep items naturally left/right */
        align-items: center;         /* vertical center */
    }

    /* Blue square (TA) stays on the left */
    #main-nav a.text-xl {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        z-index: 10; /* stays above other elements */
    }

    /* Center "Tounsi Ayoub" text */
    #main-nav a.text-xl span.opacity-90 {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        white-space: nowrap; /* prevent text wrapping */
    }

    /* Burger menu stays on the right */
    #mobile-menu-btn {
        position: absolute;
        right: 1.5rem;
        z-index: 10;
    }
}
