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

body {
    font-family: system-ui, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #222;
    -webkit-font-smoothing: antialiased;
    padding: 2rem 1.25rem;
}

@media (min-width: 640px) {
    body {
        padding: 1.5rem 0;
    }
}

a {
    color: #1c64a8;
}

#menu {
    float: right;
    margin-top: 30px;
    margin-right: 20px;
    text-align: right;
    width: 150px;
}

#menu .title a {
    color: #222;
    text-decoration: none;
    font-weight: bold;
}

#menu ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

#left {
    height: 1px;
    float: left;
    display: block;
    min-width: 0;
    overflow: hidden;
    width: 200px;
    margin: 0;
    padding: 0;
}

#main-content {
    float: left;
    width: 500px;
    margin-top: 15px;
}

@media (max-width: 639px) {
    #menu {
        float: none;
        text-align: left;
        width: auto;
        margin: 0 0 1rem 0;
    }

    #menu ul {
        display: flex;
        flex-wrap: wrap;
        gap: 0 1em;
    }

    #left {
        display: none;
    }

    #main-content {
        float: none;
        width: auto;
    }
}

ul,
ol {
    padding-left: 1.25rem;
}

blockquote {
    margin-left: 1.25rem;
}

.content {
    line-height: 1.5;
}

.content figcaption {
    font-style: italic;
    font-size: 0.85rem;
    margin-top: 4px;
}

.content .footnotes {
    font-size: 0.85rem;
}

.content ul,
.content ol,
.content blockquote,
.content small {
    font-size: 0.9rem;
}

.content ul,
.content ol {
    padding-left: 1.75rem;
}

.content blockquote {
    margin-left: 1.75rem;
}

.content img,
.content figure {
    max-width: 100%;
    margin-left: 0;
    text-align: left;
}

sup {
    vertical-align: baseline;
    font-size: 0.75em;
    position: relative;
    top: -0.4em;
}

.post {
    margin-bottom: 0.4rem;
}

.essay h2 {
    margin-bottom: 0.2rem;
}

.essay {
    margin-bottom: 1.25rem;
}

.essay p {
    margin-top: 0;
}

div.bookshelf {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

div.bookshelf .book {
    position: relative;
    aspect-ratio: 226/346;
    box-shadow: 2px 4px 16px rgba(0, 0, 0, 0.12);
    border-radius: 0 3px 3px 0;
    overflow: hidden;
}

div.bookshelf img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

div.bookshelf .book::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        rgba(0, 0, 0, 0.02) 0%,
        rgba(0, 0, 0, 0.05) 0.75%,
        rgba(255, 255, 255, 0.5) 1%,
        rgba(255, 255, 255, 0.6) 1.3%,
        rgba(255, 255, 255, 0.5) 1.4%,
        rgba(255, 255, 255, 0.3) 1.5%,
        rgba(255, 255, 255, 0.3) 2.4%,
        rgba(0, 0, 0, 0.05) 2.7%,
        rgba(0, 0, 0, 0.05) 3.5%,
        rgba(255, 255, 255, 0.3) 4%,
        rgba(255, 255, 255, 0.3) 4.5%,
        rgba(244, 244, 244, 0.1) 5.4%,
        rgba(244, 244, 244, 0.1) 99%,
        rgba(144, 144, 144, 0.2) 100%
    );
    box-shadow: inset 0 -1px 4px rgba(0, 0, 0, 0.12);
    pointer-events: none;
}

.hero {
    display: block;
    width: 100%;
    height: 120px;
    object-fit: cover;
    object-position: center 60%;
    margin-bottom: 2rem;
}

.gallery {
    columns: 2;
    column-gap: 1.5rem;
    width: 800px;
}

.gallery-item {
    display: block;
    margin-bottom: 1.5rem;
    break-inside: avoid;
    border-radius: 3px;
    overflow: hidden;
    line-height: 0;
}

.gallery-item img {
    width: 100%;
    display: block;
    transition: opacity 0.2s;
}

.gallery-item:hover img {
    opacity: 0.85;
}

@media (max-width: 639px) {
    .gallery {
        columns: 2;
        width: auto;
    }
}

h1 {
    font-size: 1.3rem;
}
h2 {
    font-size: 1.1rem;
}
h3 {
    font-size: 1rem;
}
h4,
h5,
h6 {
    font-size: 0.9rem;
}
