* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: #f4f1ec;
    color: #111;
}

a {
    color: inherit;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: #f4f1ec;
    border-bottom: 1px solid #111;
}

.logo {
    text-decoration: none;
    font-weight: bold;
}

nav {
    display: flex;
    gap: 1rem;
}

nav a {
    text-decoration: none;
}

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

.intro,
.page-title {
    padding: 2rem 1rem;
}

.narrow-page {
    max-width: 680px;
    margin: 0 auto;
    padding: 3rem 1rem;
    line-height: 1.5;
}

.link-list {
    padding-left: 1.2rem;
    line-height: 2;
}

/* Masonry-style layout */
.masonry {
    column-count: 4;
    column-gap: 0.75rem;
    padding: 0.75rem;
}

.work-card {
    display: block;
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    break-inside: avoid;
    text-align: left;
}

.work-card img {
    display: block;
    width: 100%;
    height: auto;
}

.work-card:hover img {
    opacity: 0.75;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.35);
    z-index: 20;
}

.modal.is-open {
    display: flex;
}

.modal-window {
    position: relative;
    width: min(520px, 100%);
    max-height: 80vh;
    overflow: auto;
    background: #f4f1ec;
    border: 1px solid #111;
    padding: 1.5rem;
    box-shadow: 8px 8px 0 #111;
}

.modal-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    border: 0;
    background: none;
    font-size: 2rem;
    cursor: pointer;
}

.modal-meta {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 1000px) {
    .masonry {
        column-count: 3;
    }
}

@media (max-width: 700px) {
    .site-header {
        flex-direction: column;
    }

    .masonry {
        column-count: 2;
    }
}

@media (max-width: 450px) {
    .masonry {
        column-count: 1;
    }
}