/* Sun icon color in dark theme */
body.dark-theme .sun-icon {
    color: #fde047; /* light yellow */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Prevent horizontal scroll globally */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: "JetBrains Mono", monospace;
    line-height: 1.6;
    color: #000000;
    background-color: #f5f5f5;
}

/* ---------------- HEADER ---------------- */
header {
    background-color: #e0e0e0;
    padding: 1rem;
    border-bottom: 1px solid #d0d0d0;
    position: relative;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-weight: bold;
    margin-left: 2rem; /* smaller default margin */
    font-size: 1.2rem;
    text-decoration: none;
}

@media (min-width: 1024px) {
    .logo {
        margin-left: 10rem; /* add more space on large screens */
    }
}

.logo-img {
    width: 2.5rem;
    height: 2.5rem;
    transition: border-radius 0.3s ease;
}

/* Round logo for day theme */
body:not(.dark-theme) .logo-img {
    border-radius: 50%;
}

.logo a:hover {
    text-decoration: underline;
}

/* ---------------- NAVIGATION ---------------- */
.nav-links {
    margin-right: 2rem;
    display: flex;
    list-style: none;
    gap: 2rem;
    max-width: 100%;
}

.nav-links a {
    color: #000000;
    text-decoration: none;
    font-weight: 500;
}

.nav-links a:hover {
    text-decoration: underline;
}

.theme-toggle {
    margin-right: 2rem;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.1rem;
    border-radius: 50%;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.sun-icon, .moon-icon {
    transition: all 0.3s ease;
}

/* ---------------- DARK THEME ---------------- */
body.dark-theme {
    background-color: #1a1a1a;
    color: #ffffff;
}

body.dark-theme header {
    background-color: #2d2d2d;
    border-bottom-color: #404040;
}

body.dark-theme .nav-links a {
    color: #ffffff;
}

body.dark-theme .introduction p {
    color: #cccccc;
}

body.dark-theme .achievements li::before,
body.dark-theme .languages li::before {
    color: #ffffff;
}

body.dark-theme .theme-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .menu-toggle .bar {
    background-color: #ffffff;
}

/* ---------------- CONTENT ---------------- */
main {
    padding: 2rem;
    transition: filter 0.3s ease;
}

.content {
    max-width: 800px;
    margin: 0 auto;
}

.introduction h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.animate-caret-blink {
    animation: caret-blink 1.25s ease-out infinite;
}

@keyframes caret-blink {
    0% { opacity: 1; }
    50% { opacity: 0; }
    100% { opacity: 1; }
}

.introduction p,
.introduction-text {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.achievements, .languages, .projects {
    margin-top: 2rem;
}

.achievements h2, .languages h2, .projects h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.achievements ul, .languages ul, .projects ul {
    list-style: none;
    padding-left: 0;
}

.achievements li, .languages li, .projects li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

.achievements li::before, .languages li::before, .projects li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #cccccc;
}

.languages li strong, .projects li strong {
    font-weight: 600;
}

.projects li a {
    color: #4fc3f7;
    text-decoration: none;
    transition: color 0.3s ease;
}

.projects li a:hover {
    color: #29b6f6;
    text-decoration: underline;
} 

/* ---------------- MENU TOGGLE ---------------- */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
}

.menu-toggle .bar {
    display: block;
    width: 22px;
    height: 2px;
    background-color: currentColor;
    margin: 5px 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 0.5rem;
        position: sticky;
        top: 0;
        width: 100%;
        z-index: 100;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -80%;
        height: 100vh;
        /* width: 80%; */
        max-width: 320px;
        background-color: inherit;
        border-left: 1px solid #d0d0d0;
        padding: 5rem 1.5rem 2rem 1.5rem;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        z-index: 1000;
        transition: right 0.3s ease;
    }

    body.dark-theme .nav-links {
        border-color: #404040;
    }

    .nav-links.open {
        right: 0;
    }

    .menu-toggle {
        display: block;
    }

    .theme-toggle {
        margin-right: 0.5rem;
    }
}

/* ---------------- OVERLAY ---------------- */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(1px);
    z-index: 900;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none; /* Initially not clickable */
}

.nav-overlay.visible {
    opacity: 1;
    pointer-events: auto; /* Becomes clickable when visible */
}

/* ---------------- BLUR WHEN MENU OPEN ---------------- */
main.blurred {
    filter: blur(5px);
    pointer-events: none;
}
