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

:root {
    --bg: #181818;
    --panel: #1f1f1f;
    --text: wheat;
    --resume: rgb(220, 220, 107);
    --resume-hover: yellow;
    --serif-display: "Playfair Display", serif;
    --serif-body: "Merriweather", serif;
    --content-width: 980px;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100%;
    background-color: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

.container,
.navbar {
    width: min(calc(100% - 2rem), var(--content-width));
    margin: 0 auto;
}

/* Navbar */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
}

.navbar-brand img {
    display: block;
}

.navbar-nav {
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.navbar-toggler {
    display: none;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.navbar-toggler-icon {
    display: block;
    width: 30px;
    height: 30px;
    background-image: url('data:image/svg+xml;charset=utf8,%3Csvg viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg"%3E%3Cpath stroke="wheat" stroke-width="2" stroke-linecap="round" stroke-miterlimit="10" d="M4 7h22M4 15h22M4 23h22" /%3E%3C/svg%3E');
}

.nav-link {
    display: inline-flex;
    align-items: center;
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1.2;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.nav-link:hover,
.nav-link:focus-visible {
    opacity: 0.9;
}

#download-btn {
    color: var(--resume);
    font-family: var(--serif-display);
    font-style: italic;
    transition: color 0.3s ease, opacity 0.3s ease;
}

#download-btn:hover,
#download-btn:focus-visible {
    color: var(--resume-hover);
}

/* Content */
#home {
    display: flex;
    align-items: center;
    gap: 2rem;
    justify-content: space-between;
    margin-top: 6rem;
}

.intro-text {
    margin-left: 2rem;
}

.intro-text h5,
.list-item,
.project-description {
    font-family: var(--serif-body);
}

.intro-text h5 {
    font-size: 1.1rem;
    opacity: 0.7;
    word-spacing: 0.1rem;
}

.intro-text h5 #highlight {
    font-size: 1.3rem;
    font-weight: 700;
    opacity: 1;
}

.intro-text h1 {
    color: var(--text);
    font-family: var(--serif-display);
    font-size: clamp(4.5rem, 7.5vw, 6.5rem);
    font-weight: 600;
    letter-spacing: 0.1rem;
    white-space: nowrap;
}

.intro-image {
    width: clamp(12rem, 18vw, 15rem);
    max-width: 100%;
    height: auto;
    margin-right: 2rem;
}

section:not(#home) {
    margin-top: 5rem;
}

section h2 {
    margin-bottom: 2rem;
    font-family: var(--serif-body);
    font-size: 2rem;
}

#articles h2 {
    font-family: var(--serif-display);
    letter-spacing: 0.05rem;
}

.article-list,
.experience-list,
.project-list {
    padding: 0;
}

.list-item {
    border-bottom: 1px solid rgb(245 222 179 / 5%);
    padding-bottom: 0.7rem;
    margin-bottom: 0.7rem;
}

.list-item:last-child {
    border-bottom: 0;
    margin-bottom: 0;
}

.list-item a {
    color: var(--text);
    letter-spacing: 0.05rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.article-item:hover a,
.project-item:hover a,
.list-item a:focus-visible {
    opacity: 0.9;
}

.article-item {
    display: flex;
    justify-content: space-between;
}

.article-item a {
    font-size: 1.05rem;
}

.article-date,
.project-techstack {
    color: var(--text);
    font-family: var(--serif-body);
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.article-date {
    margin-left: 1rem;
}

.list-item:hover .article-date {
    opacity: 0.6;
}

.experience-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.3rem;
}

.experience-title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.experience-role,
.experience-item a {
    font-size: 1.1rem;
    letter-spacing: 0.04rem;
}

.experience-role {
    opacity: 0.8;
}

.experience-item a:hover,
.experience-item a:focus-visible {
    opacity: 0.9;
}

.experience-separator {
    opacity: 0.35;
}

.experience-date {
    flex-shrink: 0;
    color: var(--text);
    font-family: var(--serif-body);
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.4;
}

.experience-description {
    color: var(--text);
    font-size: 0.9rem;
    opacity: 0.3;
}

.project-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
}

.project-header a {
    font-size: 1.1rem;
    letter-spacing: 0.04rem;
}

.project-techstack {
    margin-left: 1rem;
}

.list-item:hover .project-header a {
    opacity: 0.84;
}

.list-item:hover .project-techstack {
    opacity: 0.48;
}

.project-description {
    color: var(--text);
    font-size: 0.9rem;
    opacity: 0.3;
    transition: opacity 0.3s ease;
}

.list-item:hover .project-description {
    opacity: 0.38;
}

/* Movies */
.movie-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.media-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.8rem;
    overflow: hidden;
    border-radius: 8px;
    background-color: var(--panel);
}

.media-poster {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* Footer */
footer {
    width: 100%;
    margin-top: 4rem;
    padding: 1rem 0;
    background-color: var(--bg);
    text-align: center;
}

.icon-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.icons a {
    color: var(--text);
    transition: color 0.3s ease;
}

.icons a:hover,
.icons a:focus-visible {
    color: white;
}

/* Responsiveness */
@media (max-width: 760px) {
    .intro-text h1 {
        font-size: clamp(3.5rem, 10vw, 5rem);
        white-space: nowrap;
    }

    .intro-image {
        width: 12rem;
    }
}

@media (max-width: 576px) {
    .navbar {
        align-items: center;
        flex-wrap: wrap;
    }

    .navbar-toggler {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 2.35rem;
        height: 2.35rem;
        border: 1px solid rgb(245 222 179 / 14%);
        border-radius: 8px;
        transition: background-color 0.3s ease, border-color 0.3s ease;
    }

    .navbar-toggler:hover,
    .navbar-toggler:focus-visible,
    .navbar-toggler[aria-expanded="true"] {
        border-color: rgb(245 222 179 / 28%);
        background-color: rgb(245 222 179 / 6%);
    }

    .navbar-toggler-icon {
        position: relative;
        width: 1.15rem;
        height: 0.9rem;
        background-image: none;
    }

    .navbar-toggler-icon::before,
    .navbar-toggler-icon::after {
        position: absolute;
        left: 0;
        width: 100%;
        height: 2px;
        border-radius: 999px;
        background-color: var(--text);
        content: "";
        transition: top 0.28s ease, bottom 0.28s ease, box-shadow 0.28s ease, transform 0.28s ease;
    }

    .navbar-toggler-icon::before {
        top: 0;
        box-shadow: 0 0.4rem 0 var(--text);
    }

    .navbar-toggler-icon::after {
        bottom: 0;
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::before {
        top: 0.4rem;
        box-shadow: 0 0 0 transparent;
        transform: rotate(45deg);
    }

    .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon::after {
        bottom: 0.38rem;
        transform: rotate(-45deg);
    }

    .navbar-collapse {
        width: 100%;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        text-align: left;
        transform: translateY(-0.35rem);
        transition: max-height 0.32s ease, opacity 0.24s ease, padding-top 0.32s ease, transform 0.32s ease;
    }

    .navbar-collapse.is-open {
        max-height: 12rem;
        padding-top: 0.8rem;
        opacity: 1;
        transform: translateY(0);
    }

    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.6rem;
    }

    .nav-link {
        font-size: 1rem;
    }

    #home {
        flex-direction: column;
        align-items: flex-start;
        margin-top: 3.75rem;
    }

    .intro-text {
        margin-left: 2rem;
    }

    .intro-text h5 {
        font-size: 0.9rem;
        word-spacing: 0.1rem;
    }

    .intro-text h5 #highlight {
        font-size: 1.1rem;
    }

    .intro-text h1 {
        font-size: clamp(2rem, 10.5vw, 3.25rem);
        white-space: nowrap;
    }

    .intro-image {
        display: none;
    }

    section:not(#home) {
        margin-top: 3rem;
    }

    section h2 {
        margin-bottom: 1.5rem;
        text-align: left;
        font-size: 1.5rem;
    }

    #articles h2 {
        margin-bottom: 1.9rem;
    }

    .article-item,
    .experience-header,
    .project-header {
        display: block;
    }

    .article-item a {
        font-size: 0.8rem;
    }

    .article-date,
    .experience-date,
    .project-techstack {
        display: block;
        margin-left: 0;
        font-size: 0.7rem;
    }

    .experience-role,
    .experience-item a {
        font-size: 0.85rem;
    }

    .experience-date {
        margin-top: 0.25rem;
    }

    .experience-description {
        font-size: 0.8rem;
    }

    .project-techstack {
        margin-top: 0.3rem;
        margin-bottom: 0.3rem;
        text-align: left;
    }

    .project-header a {
        font-size: 0.85rem;
    }

    .project-description {
        font-size: 0.8rem;
    }

    .movie-list {
        grid-template-columns: repeat(4, 1fr);
        gap: 1rem;
    }

    .media-card {
        padding: 0.4rem;
    }

    .media-poster {
        max-width: 100px;
    }

    footer {
        margin-top: 2rem;
    }
}
