:root {
    /* Dark Mode (Default) */
    --text-primary-color: #EEEEEE;
    --text-secondary-color: lightgray;
    --text-accent-color: cyan;

    --background-primary: #222831;
    --background-secondary1: hsl(217, 10%, 25%);
    --background-secondary2: hsl(217, 12%, 27%);

    --accent-color: cyan;
    --button-color: #EEEEEE;
    --negate-color: #ff5050;
}

[data-theme="light"] {
    /* Light Mode */
    --text-primary-color: black;
    --text-secondary-color: #222831;
    --text-accent-color: #00B8D4;

    --background-primary: #F5F7FA;
    --background-secondary1: #e7ebee;
    --background-secondary2: #dfe4e7;

    --accent-color: #ff0077;
    --button-color: #222831;
    --negate-color: #E63946;
}

*{
    margin: 0;
    padding: 0;
    font-family: Inter, sans-serif;
    font-feature-settings: 'liga' 1, 'calt' 1;
    box-sizing: border-box;

    /* Smooth theme transition */
    transition: background-color 0.25s,
                color 0.25s,
                border-color 0.25s,
                background 0.25s;
}
@supports (font-variation-settings: normal) {
    :root {
        font-family: InterVariable, sans-serif;
    }
}

body {
    background: var(--background-secondary1);
    color: white;
    overflow-x: hidden;
}

.fade-in {
    opacity: 0;
    filter: blur(10px);
    letter-spacing: 0em;
    transition: opacity 0.8s, filter 0.8s;
}
.fade-in.visible {
    opacity: 1;
    filter: blur(0);
}

.nav-container {
    display: flex;
    align-items: center;

    padding: 0px 5%;
    height: 80px;
    background-color: var(--background-primary);
    backdrop-filter: blur(8px);

    top: 0;
    width: 100%;
    z-index: 1;

    position: fixed;
}
.nav-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0,0,0,0.5);
    z-index: 2;

    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s, visibility 0.25s;
}
.nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}
nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    
    width: 100%;
}

.logo {
    height: 56px;
    cursor: pointer;
    justify-content: center;
    align-items: center;
    
    transition: scale 0.25s;
    scale: 1;

}
@media (hover: hover) and (pointer: fine) {
    .logo:hover {
        scale: 1.05;
    }
}
.hamburger {
    display: none;
    cursor: pointer;
    font-size: 24px;
    padding: 12px 0 12px 12px;
    align-items: center;
    justify-content: end;
    text-decoration: none;
    color: var(--text-primary-color);
}

.hamburger i {
    transition: scale 0.25s;
}
@media (hover: hover) and (pointer: fine) {
    .hamburger:hover {
        color: var(--accent-color);
    }

    .hamburger:hover i {
        scale: 1.1;
    }
}
nav ul li {
    display: inline-block;
    list-style: none;
    padding: 24px 24px;
    display: inline;

    position: relative;
    color: var(--text-primary-color);
    text-decoration: none;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}
@media (hover: hover) and (pointer: fine) {
    nav ul li:hover {
        color: var(--accent-color);
        cursor: pointer;
    }
}

/* ========================================
   Theme Toggle Button & Animations
   ======================================== */

.theme-toggle {
    cursor: pointer;
    padding: 24px;

    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--text-primary-color);
    background-color: var(--background-secondary1);
    
    font-size: 24px;
    border-radius: 6px;
}

.theme-toggle i {
    position: absolute;
    display: none;
    transition: scale 0.25s, color 0.25s;
}

/* Show sun icon in light mode (to switch to dark) */
[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

/* Show moon icon in dark mode (to switch to light) */
:root:not([data-theme="light"]) .theme-toggle .moon-icon,
[data-theme="dark"] .theme-toggle .moon-icon {
    display: block;
}

@media (hover: hover) and (pointer: fine) {
    .theme-toggle:hover i {
        color: var(--accent-color);
        scale: 1.1;
    }
}

/* ========================================
   Theme Toggle Animation: Scale Bounce
   ======================================== */

@keyframes scaleOut {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0); opacity: 0; }
}

@keyframes scaleIn {
    0% { transform: scale(0); opacity: 0; }
    40% { transform: scale(0); opacity: 0; }
    70% { transform: scale(1.3); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* ========================================
   Apply Scale Bounce Animation
   ======================================== */

.theme-toggle.scale-out i {
    animation: scaleOut 0.2s ease-in-out;
}

.theme-toggle.scale-in i {
    animation: scaleIn 0.35s ease-in-out;
}

@media screen and (max-width: 700px) {
    .hamburger {
        display: flex;
        z-index: 4;
    }
    .theme-toggle {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }
    .nav-menu {
        position: fixed;
        top: 0;
        right: -40%;
        width: 40%;
        height: 100vh;
        background-color: var(--background-primary);
        flex-direction: column;
        justify-content: flex-start;
        align-items: center;
        padding-top: 80px;
        z-index: 3;

        transition: transform 0.25s;
        transform: translateX(0);
    }
    .nav-menu.active {
        transform: translateX(-100%);
    }
    .nav-menu li {
        margin: 0;
        display: block;
        text-align: right;
        padding: 32px 0;
        border-bottom: 1px solid var(--background-secondary1);

        font-size: 16px;
        width: 100%;
        display: block;
        padding-right: 24px;
    }
}