/* ================== Header ================== */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--header-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 5000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    transition: all 0.4s ease;
}

header h1 {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.01em;
    color: var(--text-color);
    margin: 0;
}

nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: fixed;
    top: 1.2rem;
    right: 2rem;
    z-index: 6000;
}

nav a {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--muted);
    transition: color 0.3s ease;
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
}

nav a:hover {
    color: var(--link-color);
    background: var(--glass-bg);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#menuToggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
}

#toggleTheme {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--link-color);
    transition: all 0.3s ease;
}

#toggleTheme:hover {
    background: var(--link-color);
    color: white;
    transform: scale(1.05);
}

#toggleTheme svg {
    width: 20px;
    height: 20px;
}

/* ================== Footer ================== */
footer {
    padding: 3rem 4rem 2rem;
    background: var(--footer-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
    margin-top: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-col h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-color);
}

.footer-logo {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--link-color), var(--accent));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.footer-col.brand p {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
    max-width: 320px;
    text-align: left !important;
}

.footer-col.links ul {
    list-style: none;
    padding: 0;
}

.footer-col.links li {
    margin-bottom: 0.8rem;
}

.footer-col.links a {
    color: var(--muted);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.footer-col.links a:hover {
    color: var(--link-color);
    padding-left: 5px;
}

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

.social-links-wrap a {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.social-links-wrap a img {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
    filter: brightness(0) invert(1);
}

body.light .social-links-wrap a img {
    filter: brightness(0);
}

.social-links-wrap a:hover {
    background: var(--link-color);
    border-color: var(--link-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
}

.social-links-wrap a:hover img {
    transform: scale(1.1);
}

.footer-bottom {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

/* Responsive MQs */
@media (max-width: 1024px) {
    footer {
        padding: 2rem 1.5rem 1.5rem;
        margin-top: 1rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .footer-col.brand {
        grid-column: span 2;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    nav {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 80%; /* Takes up 80% on very small screens */
        max-width: 300px; /* But no more than 300px */
        background: var(--bg-color);
        box-shadow: -10px 0 50px rgba(0, 0, 0, 0.4);
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding: 6rem 2rem 2rem;
        gap: 1rem;
        transform: translateX(100%);
        transition: transform 0.4s var(--ease-out-expo);
        z-index: 9000;
        overflow-y: auto;
        visibility: hidden; /* Prevent focus on hidden menu links */
    }

    nav.open {
        transform: translateX(0);
        visibility: visible;
    }

    nav a {
        font-size: 1.1rem;
        font-weight: 500;
        color: var(--text-color);
        width: 100%;
        padding: 1rem;
        text-align: center;
        border-bottom: 1px solid var(--glass-border);
    }

    /* Adjust header for mobile */
    header {
        padding: 1rem 1.5rem;
        z-index: 10000;
    }

    #menuToggle {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1.8rem;
        background: var(--glass-bg);
        border: 1px solid var(--glass-border);
        border-radius: 12px;
        width: 44px;
        height: 44px;
        cursor: pointer;
        color: var(--link-color);
        box-shadow: var(--project-card-shadow);
        z-index: 11000;
    }

    #toggleTheme {
        margin-top: 1.5rem;
    }
}

@media (max-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-col.brand {
        grid-column: span 1;
    }
}
