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

html {
    scroll-behavior: smooth;
}

body {
    background: #ffffff;
    color: #111111;
    font-family: -apple-system, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

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

/* Thin bar in the top right corner */
.corner {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 2;
}

.corner a {
    display: block;
    padding: 4px 10px;
    border: 1px solid #dddddd;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #555555;
}

.corner a:hover {
    border-color: #111111;
    color: #111111;
}

/* Left column, stays in place while the works scroll */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    padding: 64px 40px;
    overflow-y: auto;
    border-right: 1px solid #eeeeee;
}

.sidebar h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.intro {
    margin-top: 8px;
    font-size: 14px;
    color: #777777;
}

.index {
    margin-top: 48px;
}

.index h2 {
    margin: 28px 0 10px;
}

.index h2:first-child {
    margin-top: 0;
}

.index a {
    display: block;
    padding: 4px 0;
    font-size: 15px;
    color: #555555;
}

.index a:hover {
    color: #111111;
}

/* Section labels, in the sidebar and above each group */
h2 {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #999999;
}

main {
    max-width: 1180px;
    margin-left: 280px;
    padding: 64px 56px 120px;
}

section + section {
    margin-top: 80px;
}

main h2 {
    padding-bottom: 12px;
    margin-bottom: 24px;
    border-bottom: 1px solid #eeeeee;
}

.grid {
    display: grid;
    gap: 40px 28px;
}

.grid.two {
    grid-template-columns: repeat(2, 1fr);
}

.grid.three {
    grid-template-columns: repeat(3, 1fr);
}

/* Room above a work when the sidebar scrolls to it */
.work {
    scroll-margin-top: 32px;
}

.work img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    object-position: top;
    border: 1px solid #eeeeee;
    border-radius: 8px;
    background: #f6f6f6;
    transition: border-color 0.2s;
}

/* Sketches are mostly upright, so their pictures are half as tall again, and keep their middle */
.grid.three .work img {
    aspect-ratio: 16 / 15;
    object-position: center;
}

.work img.chart {
    object-fit: contain;
    padding: 24px;
    background: #ffffff;
}

.work a:hover img {
    border-color: #111111;
}

/* Title on the left, month on the right */
.head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-top: 14px;
}

.work h3 {
    font-size: 18px;
    font-weight: 600;
}

.head time {
    flex-shrink: 0;
    font-size: 13px;
    color: #999999;
    font-variant-numeric: tabular-nums;
}

.work h3 a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.work p {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.45;
    color: #555555;
}

.meta {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #999999;
}

.more {
    display: inline-block;
    margin-top: 32px;
    font-size: 15px;
    color: #555555;
}

.more:hover {
    color: #111111;
}

/* Narrow screens: sidebar becomes a header at the top, the list is not needed */
@media (max-width: 900px) {
    .sidebar {
        position: static;
        width: auto;
        height: auto;
        padding: 72px 20px 0;
        border-right: none;
    }

    .index {
        display: none;
    }

    main {
        margin-left: 0;
        padding: 48px 20px 80px;
    }

    .grid.two,
    .grid.three {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 901px) and (max-width: 1200px) {
    .grid.three {
        grid-template-columns: repeat(2, 1fr);
    }
}
