/* =========================
   Global Reset & Variables
   ========================= */
:root {
    --bg-color: #0f172a;
    --surface-color: #111827;
    --primary-color: #38bdf8;
    --text-color: #e5e7eb;
    --muted-text: #9ca3af;
    --border-color: #1f2933;
    --max-width: 1100px;
}

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

html {
    font-size: 16px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Ubuntu, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* =========================
   Navigation
   ========================= */
nav {
    width: 100%;
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 2rem;
    padding: 1rem;
}

nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    position: relative;
}

nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -4px;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.25s ease;
}

nav a:hover::after {
    width: 100%;
}

/* =========================
   Layout Container
   ========================= */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.25rem;
    flex: 1;
}

/* =========================
   Intro Section
   ========================= */
#intro {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4rem;
}

#intro img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
}

.intro-text h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.intro-text p {
    color: var(--muted-text);
    max-width: 40ch;
}

/* =========================
   Projects Section
   ========================= */
#projects h2 {
    font-size: 1.6rem;
    margin-bottom: 1.5rem;
}

#projects ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.5rem;
}

#projects li {
    background-color: var(--surface-color);
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

#projects li:hover {
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

#projects a {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
}

#projects p {
    margin-top: 0.5rem;
    color: var(--muted-text);
    font-size: 0.95rem;
}

/* =========================
   Footer
   ========================= */
footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    text-align: center;
    padding: 1rem;
    font-size: 0.85rem;
    color: var(--muted-text);
}

/* =========================
   Responsive Adjustments
   ========================= */
@media (max-width: 768px) {
    #intro {
        grid-template-columns: 1fr;
        text-align: center;
    }

    #intro img {
        margin: 0 auto;
    }

    .intro-text p {
        margin: 0 auto;
    }

    nav {
        flex-wrap: wrap;
        gap: 1.25rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    #intro img {
        width: 130px;
        height: 130px;
    }
}

/* =========================
   Hamburger Navigation
   ========================= */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 1rem 1.25rem;
}

.logo {
    font-weight: 700;
    text-decoration: none;
    color: var(--text-color);
}

.nav-menu {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
}

.nav-toggle {
    display: none;
    font-size: 1.6rem;
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
}

/* Mobile */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-menu {
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--surface-color);
        border-top: 1px solid var(--border-color);
        padding: 1rem;
        gap: 1rem;
        display: none;
    }

    .nav-menu.open {
        display: flex;
    }
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #000;
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 1000;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
}
