:root {
    --primary-color: #8b5cf6;
    --secondary-color: #6366f1;
    --text-color: #f8fafc;
    --text-color-secondary: #cbd5e1;
    --background-color: #0f1729;
    --card-background: #1e1b4b;
    --gradient-1: linear-gradient(135deg, #8b5cf6, #6366f1);
    --gradient-2: linear-gradient(45deg, #7c3aed, #4f46e5);
    --gradient-dark: linear-gradient(to bottom right, #2e1065, #1e1b4b);
    --border-color: rgba(255, 255, 255, 0.1);
    --animation-timing: 0.3s ease;
    --gradient-3: linear-gradient(90deg, #7c3aed, #6366f1);
    --gradient-4: linear-gradient(135deg, #2e1065, #1e1b4b);
    --gradient-glow: linear-gradient(rgba(139, 92, 246, 0.2), rgba(99, 102, 241, 0.2));
    --glow-color: rgba(139, 92, 246, 0.3);
    --hover-shadow: 0 0 20px var(--glow-color);
    --hover-transform: translateY(-3px);
}

body {
    background: var(--gradient-dark);
    background-attachment: fixed;
    color: var(--text-color);
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

/* ...existing code... */

section {
    padding: 4rem 2rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all var(--animation-timing);
    transition: all 0.3s ease;

}

section h2 {
    font-size: 2.5rem;
    margin-bottom: 2rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    position: relative;
}
section h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 1.5rem 0;
    text-shadow: 0 0 10px var(--glow-color);
}

section h2:hover {
    text-shadow: 0 0 15px var(--glow-color);
    transform: var(--hover-transform);
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--gradient-1);
    opacity: 0.5;
}


/* Make sure elements return smoothly to their original state */
nav a, button, .cta-button, .project-card, input, textarea, .skills ul li, .about-content img, .logo, footer a {
    transition: transform 0.3s ease, box-shadow 0.3s ease, color 0.3s ease, background 0.3s ease;
}

/* Text Styling */

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: floatAnimation 6s ease-in-out infinite;
}


.hero-content p {
    font-size: 1.4rem;
    color: var(--text-color-secondary);
    margin: 0.5rem 0;
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.2);
}

.subtitle {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.4rem;
    font-weight: 500;
}

.highlight {
    color: var(--primary-color);
    text-shadow: 0 0 15px var(--glow-color);
}

/* Navigation */


nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}


nav {
    position: fixed;
    width: 100%;
    height: 70px;
    padding: 0 2rem;
    background: linear-gradient(to right,
        rgba(46, 16, 101, 0.95),
        rgba(30, 27, 75, 0.95));
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    background: rgba(3, 7, 18, 0.95);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}


nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    position: relative;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--gradient-1);
    transition: width var(--animation-timing);
}

nav a:hover::after {
    width: 100%;
}

/* Logo hover effect */
/* Logo Animation */
.logo {
    position: relative;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    transition: all 0.4s ease;
    animation: logoGlow 3s infinite;
}

.logo::before {
    content: '';
    position: absolute;
    top: 100%;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.4s ease;
}

.logo:hover {
    color: var(--primary-color);
    transform: var(--hover-transform);
    text-shadow: 0 0 15px var(--glow-color);
}

.logo:hover::before {
    width: 100%;
}



/* Footer links */
footer a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
    transform: var(--hover-transform);
}

footer {
    text-align: center;
    padding: 2rem;
    background: var(--gradient-dark);
    color: var(--text-color-secondary);
    border-top: 1px solid var(--border-color);
}

footer p {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

/* Hero Section */
.hero {
    
    background: linear-gradient(
        rgba(46, 16, 101, 0.9), 
        rgba(30, 27, 75, 0.95)
    ), var(--gradient-2);
    
    
        height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: center;

}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-2);
    opacity: 0.1;
    animation: pulseGradient 8s ease-in-out infinite;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: floatAnimation 6s ease-in-out infinite;
    text-shadow: 0 0 20px var(--glow-color);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--gradient-3);
    box-shadow: 0 0 20px var(--glow-color);
    color: white;
    text-decoration: none;
    border-radius: 5px;
    margin-top: 2rem;
    background: var(--gradient-1);
    animation: glowPulse 3s infinite;
    position: relative;
    overflow: hidden;
}

/* About Section */
.about {
    padding: 5rem 2rem;
    background: var(--gradient-4);
    position: relative;
}

.about::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-glow);
    opacity: 0.1;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.about-content img:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
}

/* Projects Section */
.projects {
    background: linear-gradient(to bottom right, 
        rgba(46, 16, 101, 0.8), 
        rgba(30, 27, 75, 0.9)
    );
    position: relative;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

/* Project Cards */

.project-card {
    background: linear-gradient(145deg, var(--card-background), rgba(30, 27, 75, 0.8));
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.project-card h3 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-color-secondary);
    line-height: 1.6;
    font-size: 1.1rem;
}

.project-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.project-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-1);
    transition: all 0.3s ease;
    z-index: -1;
}

.project-links a {
    color: var(--text-color);
    text-decoration: none;
    margin-right: 1rem;
    transition: all 0.3s ease;
}

.project-links a:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--gradient-3);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.project-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--hover-shadow);
}

.project-link:hover i {
    transform: translateX(3px);
}

.project-link:hover::before {
    left: 0;
}

.demo-link {
    background: var(--gradient-2);
}

.project-link i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: opacity 0.4s ease;
    z-index: 1;
}

.project-card:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
    background: linear-gradient(145deg, 
        var(--card-background), 
        rgba(30, 27, 75, 0.9)
    );
}

.project-card:hover::before {
    opacity: 0.1;
}

/* Contact Section */
.contact {
    background: linear-gradient(to bottom,
    rgba(46, 16, 101, 0.9),
    rgba(30, 27, 75, 1)
);
    position: relative;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-1);
}

input, textarea {
    background: linear-gradient(145deg, 
    rgba(30, 27, 75, 0.3),
    rgba(30, 27, 75, 0.5));
    border: 1px solid var(--border-color);
   
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    color: var(--text-color);
    padding: 1rem;
    border-radius: 8px;
}

input:hover, textarea:hover {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
    transform: translateY(-2px);
}

input:focus, textarea:focus {
    box-shadow: var(--hover-shadow);
    transform: var(--hover-transform);
    border-color: var(--primary-color);
    outline: none;
}

input::placeholder, textarea::placeholder {
    color: var(--text-color-secondary);
    opacity: 0.7;
}


#contact-form {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 500px;
    margin: 2rem auto;
}



button {
    padding: 1rem;
    background: var(--gradient-3);
    position: relative;
    overflow: hidden;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
button:hover {
    background: var(--gradient-1);
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--glow-color);
}

button:hover, .cta-button:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
    background: var(--gradient-1);
}



.resume-button {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}
.resume-button-large::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    transition: 0.5s;
}

.resume-button-large {
    
    
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    margin-top: 2rem;
    background: var(--gradient-1);
    color: var(--text-color);
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}
.resume-button-large:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
    background: var(--gradient-2);
}

.resume-button-large:hover::before {
    left: 100%;
}

.resume-button-large i {
    font-size: 1.2rem;
    animation: bounce 2s infinite;
}

/* Responsive Design */
@media (max-width: 768px) {
    .about-content {
        grid-template-columns: 1fr;
    }
    .resume-button {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
    
    .resume-button-large {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes backgroundMove {
    0% { transform: translateX(0) translateY(0); }
    100% { transform: translateX(-50%) translateY(-50%); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
}

.animate-on-scroll.show {
    animation: fadeInUp 1s ease-out forwards;
    animation: fadeInUp 1s ease-out forwards, glowPulse 3s infinite;

}

/* Enhanced Animations */
@keyframes pulseGradient {
    0%, 100% { opacity: 0.1; }
    50% { opacity: 0.2; }
}

@keyframes floatAnimation {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 0 20px var(--glow-color); }
    50% { box-shadow: 0 0 30px var(--glow-color); }
}

@keyframes logoGlow {
    0%, 100% {
        text-shadow: 0 0 10px var(--glow-color);
    }
    50% {
        text-shadow: 0 0 20px var(--glow-color),
                     0 0 30px var(--primary-color);
    }
}

/* Media query for mobile devices */
@media (max-width: 768px) {
    .cursor-glow {
        width: 100px;  /* Even smaller on mobile */
        height: 100px;
        filter: blur(5px); /* Less blur on mobile */
    }
    .cursor-glow {
        /* Reduce visual effects and remove delay for position changes */
        transition: opacity 0.05s ease; 
    }
}


/* Apply animations to elements */




.cta-button::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(45deg);
    transition: all 0.6s ease;
}

.cta-button:hover {
    background: var(--gradient-1);
} 
.cta-button:hover::after {
    transform: rotate(45deg) translateX(100%);
}


/* Navigation Update */


nav a:hover {
   color: var(--primary-color);
    text-shadow: 0 0 10px var(--glow-color);
    transform: var(--hover-transform);
}

.cursor-glow {
    width: 150px;  /* Smaller size for mobile */
    height: 150px;
    background: radial-gradient(circle, 
        rgba(139, 92, 246, 0.4) 0%,
        rgba(99, 102, 241, 0.3) 35%,
        rgba(99, 102, 241, 0.2) 60%,
        transparent 80%
    );
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: opacity 0.2s ease; /* Faster transition for touch */
    opacity: 0;
    mix-blend-mode: screen;
    filter: blur(8px);
}

body:hover .cursor-glow {
    opacity: 1;
}
/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--background-color);
    border-left: 1px solid var(--border-color);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(
        to bottom,
        var(--primary-color),
        var(--secondary-color)
    );
    border-radius: 5px;
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-1);
    box-shadow: 0 0 15px var(--glow-color);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--background-color);
}
/* Social Icons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
}

.social-icon {
    font-size: 1.8rem;
    color: var(--text-color);
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 50%;
    background: linear-gradient(145deg, 
        var(--card-background),
        rgba(30, 27, 75, 0.8)
    );
    border: 1px solid var(--border-color);
}

.social-icon:hover {
    transform: var(--hover-transform);
    box-shadow: var(--hover-shadow);
    background: var(--gradient-1);
    color: white;
}

/* Add animation for icons */
@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.social-icon i {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover i {
    animation: iconPulse 0.3s ease;
}

/* Education Section */
.education {
    margin: 2rem 0;
}

.education-item {
    padding: 1rem;
    border-left: 2px solid var(--primary-color);
    margin: 1rem 0;
    background: linear-gradient(145deg, 
        var(--card-background),
        rgba(30, 27, 75, 0.8)
    );
    border-radius: 8px;
}

.education-item h4 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.education-item p {
    color: var(--text-color-secondary);
    font-size: 1.1rem;
}

/* Skills Grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.skill-category {
    background: linear-gradient(145deg, 
        var(--card-background),
        rgba(30, 27, 75, 0.8)
    );
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.skill-category h4 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

/* Skills list items */
.skills ul li:hover {
    transform: var(--hover-transform);
    text-shadow: 0 0 10px var(--glow-color);
    cursor: default;
}
.skills ul li {
    color: var(--text-color-secondary);
    font-size: 1.1rem;
    margin: 0.8rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.skills ul li::before {
    content: '▹';
    position: absolute;
    left: 0;
    color: var(--primary-color);
}

/* Project Tech Tags */
.project-tech {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.project-tech span {
    background: var(--gradient-1);
    padding: 0.2rem 0.8rem;
    border-radius: 15px;
    font-size: 0.9rem;
}

/* Academic Projects */
.timeline-item {
    background: linear-gradient(145deg, 
        var(--card-background),
        rgba(30, 27, 75, 0.8)
    );
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border: 1px solid var(--border-color);
}

.timeline-item h3 {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
}

.timeline-item p {
    color: var(--text-color-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

/* About Text */
.about-text p {
    color: var(--text-color-secondary);
    line-height: 1.8;
    font-size: 1.1rem;
    text-shadow: 0 0 5px rgba(99, 102, 241, 0.1);
}

/* Animated Text Elements */
.animate-text {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease-out forwards;
}

/* Add animation classes to text elements */
.hero-content p,
.about-text p,
.education-item,
.skill-category,
.project-card,
.timeline-item {
    opacity: 0;
    transform: translateY(20px);
}

.show {
    animation: fadeInUp 1s ease-out forwards;
}

@media (max-width: 768px) {
    /* Reduce overall padding in nav bar */
    nav {
        padding: 0 1rem;
    }
    
    /* Adjust logo size */
    .logo {
        font-size: 1.3rem;
    }

    /* Make nav items wrap and reduce font size */
    nav ul {
        flex-wrap: wrap;
        justify-content: center;
        font-size: 0.9rem;
    }
    
    /* Space out each nav item for clarity */
    nav ul li {
        margin: 0.5rem;
    }
    
    /* Optional: If the nav looks too cluttered, adjust anchor padding */
    nav a {
        padding: 0.3rem 0.5rem;
    }
    
    /* Adjust the nav bar layout */
    nav {
        display: flex;
        justify-content: center;
        align-items: center;
        position: relative;
    }

    /* Center the logo */
    .logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        font-size: 1.3rem;
    }

    /* Hide the nav-menu by default */
    .nav-menu {
        display: none;
        flex-direction: column;
        background: rgba(3, 7, 18, 0.95);
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 1rem 0;
        z-index: 1001;
    }

    /* Show the menu items vertically */
    .nav-menu li {
        margin: 0.5rem 0;
        text-align: center;
    }

    /* Adjust links padding if needed */
    nav a {
        padding: 0.5rem 1rem;
    }

    /* Style the hamburger menu toggle button */
    .menu-toggle {
        position: absolute;
        right: 1rem;
        cursor: pointer;
        font-size: 1.5rem;
        z-index: 1002;
        display: block; /* Only visible on mobile */
        color: var(--text-color);
    }
    
    /* When active, show the menu */
    .nav-menu.active {
        display: flex;
    }

    /* Style the mobile dropdown menu (.nav-menu) */
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; /* Below the fixed nav bar */
        left: 0;   /* Aligned to the left */
        width: 100%;
        background: rgba(3, 7, 18, 0.95);
        padding: 1rem 0;
        z-index: 1001;
        text-align: left;
    }

    /* Style each menu item as a box */
    .nav-menu li {
        margin: 0.5rem 1rem;
        padding: 0.5rem;
        border: 1px solid var(--primary-color);
        border-radius: 4px;
        background: var(--card-background);
        text-align: left;
    }

    /* Adjust link padding if needed */
    .nav-menu li a {
        padding: 0.5rem 1rem;
        display: block;
    }

    /* When active, show the menu */
    .nav-menu.active {
        display: flex;
    }

    /* Ensure hamburger button is visible */
    .menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        color: var(--text-color);
        z-index: 1002;
    }
}

/* Desktop View – Default (logo on left, menu on right, no hamburger) */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
}
.nav-menu {
    display: flex;
    gap: 2rem;
}
.menu-toggle {
    display: none; /* Hide hamburger on desktop */
}

/* Mobile View (max-width: 768px) */
@media (max-width: 768px) {
    nav {
        /* Keep logo on left */
        justify-content: flex-start;
        position: relative;
        padding: 0 1rem;
    }
    .logo {
        font-size: 1.3rem; /* Adjust if needed */
    }
    /* Display hamburger toggle on the right */
    .menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        color: var(--text-color);
        z-index: 1002;
    }
    /* Hide menu by default */
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; /* Below the fixed nav bar */
        left: 0;   /* Aligned to the left */
        width: 100%;
        background: rgba(3, 7, 18, 0.95);
        padding: 1rem 0;
        z-index: 1001;
        text-align: left;
    }
    /* Center the menu items */
    .nav-menu li {
        margin: 0.5rem 1rem;
        text-align: left;
    }
    /* Display dropdown when active */
    .nav-menu.active {
        display: flex;
    }
}

/* Mobile View (max-width: 768px) */
@media (max-width: 768px) {
    nav {
        /* Keep logo on left */
        justify-content: flex-start;
        position: relative;
        padding: 0 1rem;
    }
    .logo {
        font-size: 1.3rem;
    }
    /* Hamburger toggle stays on the right */
    .menu-toggle {
        display: block;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.5rem;
        color: var(--text-color);
        z-index: 1002;
    }
    /* Hide main menu by default */
    .nav-menu {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 70px; /* Below the fixed nav bar */
        left: 0;
        width: 100%;
        background: rgba(3, 7, 18, 0.95);
        padding: 0.5rem 0; /* Slight top and bottom padding */
        z-index: 1001;
        text-align: left;
    }
    /* Menu items as boxes with minimal spacing */
    .nav-menu li {
        margin: 0;  /* Remove spacing between menu boxes */
        padding: 0.3rem; /* Minimal internal spacing */
        border: 1px solid var(--primary-color);
        border-radius: 4px;
        background: var(--card-background);
        text-align: left;
    }
    .nav-menu li a {
        padding: 0.5rem 0.8rem; /* Reduce link padding accordingly */
        display: block;
    }
    /* When active, show the dropdown menu */
    .nav-menu.active {
        display: flex;
    }
}