:root {
    --bg: #fdfdfc;
    --fg: #1c1b19;
    --muted: #78746d;
    --rule: #e3e1dc;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #161614;
        --fg: #e8e6e1;
        --muted: #8f8b83;
        --rule: #2e2d2a;
    }
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 13vh 1.5rem 6rem;
    background: var(--bg);
    color: var(--fg);
    font: 400 1.0625rem/1.7 ui-serif, Charter, Georgia, "Times New Roman", serif;
    -webkit-font-smoothing: antialiased;
}

main {
    max-width: 33rem;
    margin: 0 auto;
}

h1 {
    margin: 0 0 1.5rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

p {
    margin: 0 0 1.1rem;
}

ul.links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2rem 0 0;
    padding: 0;
    list-style: none;
}

ul.links a {
    color: var(--fg);
    border-bottom-color: var(--fg);
}

.history {
    margin-top: 4rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--rule);
}

.history h2 {
    margin: 0 0 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}

.history ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.9375rem;
}

.history li {
    margin-bottom: 0.5rem;
}

.history li:last-child {
    margin-bottom: 0;
}

a {
    color: var(--fg);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 0.06em;
    transition: border-color 0.15s ease;
}

a:hover {
    border-bottom-color: currentColor;
}

a:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 2px;
}

/* Archive pages (projects/*) — a wider column and room for figures. */

.archive {
    padding-top: 6vh;
}

.archive main {
    max-width: 40rem;
}

.archive .back {
    margin-bottom: 3rem;
    font-size: 0.8125rem;
    letter-spacing: 0.02em;
}

.archive .back a {
    color: var(--muted);
    border-bottom: 0;
}

.archive .back a::before {
    content: "\2190\00a0";
}

.archive .back a:hover {
    color: var(--fg);
}

.archive h1 {
    margin-bottom: 0.6rem;
    font-size: 1.75rem;
}

.archive .byline {
    margin-bottom: 2.5rem;
    color: var(--muted);
    font-size: 0.875rem;
}

.archive h2 {
    margin: 2.75rem 0 0.9rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted);
}

.archive .lede {
    font-size: 1.1875rem;
    line-height: 1.6;
}

.archive figure {
    margin: 2.25rem 0;
}

.archive img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    background: #fff;
}

.archive .hero img {
    margin: 0 auto;
    max-height: 26rem;
    width: auto;
}

.archive .wide {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.archive .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.75rem;
}

.archive .grid img,
.archive .wide img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
}

.videos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

.videos figure {
    margin: 0;
}

.embed {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--rule);
    border-radius: 3px;
    overflow: hidden;
}

.embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.videos figcaption {
    margin-top: 0.5rem;
    color: var(--muted);
    font-size: 0.8125rem;
}

.archive .colophon {
    margin-top: 4rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    color: var(--muted);
    font-size: 0.8125rem;
}

.archive .colophon a {
    color: var(--muted);
}
