:root {
    --paper: #f4f0e7;
    --paper-deep: #e7e0d2;
    --ink: #181a17;
    --ink-soft: #54584f;
    --line: #cbc3b4;
    --accent: #9b3f2c;
    --accent-soft: #dfc5b7;
    --selection: #d9c7a6;
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
    --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #1c1c19;
        --paper-deep: #282721;
        --ink: #f0ecdf;
        --ink-soft: #b8b4aa;
        --line: #44423a;
        --accent: #dd836d;
        --accent-soft: #6c3e34;
        --selection: #5e5040;
        color-scheme: dark;
    }
}

:root[data-theme="dark"] {
    --paper: #1c1c19;
    --paper-deep: #282721;
    --ink: #f0ecdf;
    --ink-soft: #b8b4aa;
    --line: #44423a;
    --accent: #dd836d;
    --accent-soft: #6c3e34;
    --selection: #5e5040;
    color-scheme: dark;
}

:root[data-theme="light"] {
    --paper: #f4f0e7;
    --paper-deep: #e7e0d2;
    --ink: #181a17;
    --ink-soft: #54584f;
    --line: #cbc3b4;
    --accent: #9b3f2c;
    --accent-soft: #dfc5b7;
    --selection: #d9c7a6;
    color-scheme: light;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 2rem;
    background: var(--paper);
}

body {
    margin: 0;
    background:
        radial-gradient(circle at 90% 5%, color-mix(in srgb, var(--accent-soft) 28%, transparent), transparent 22rem),
        var(--paper);
    color: var(--ink);
    font-family: var(--serif);
    font-size: clamp(1.05rem, 0.99rem + 0.24vw, 1.18rem);
    line-height: 1.65;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

::selection {
    background: var(--selection);
    color: var(--ink);
}

a {
    color: inherit;
    text-decoration-color: var(--accent);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--accent);
}

button,
input,
textarea,
select {
    font: inherit;
}

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 100;
    padding: 0.55rem 0.85rem;
    background: var(--ink);
    color: var(--paper);
    font-family: var(--sans);
    font-size: 0.85rem;
    transform: translateY(-180%);
    transition: transform 160ms ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-shell {
    width: min(100% - 2rem, 74rem);
    margin-inline: auto;
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 7.5rem;
    border-bottom: 1px solid var(--line);
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--ink);
    text-decoration: none;
}

.wordmark-name {
    font-size: 1.22rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.wordmark-mark {
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: clamp(0.8rem, 2.2vw, 1.7rem);
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 650;
    letter-spacing: 0.035em;
}

.site-nav > a {
    color: var(--ink-soft);
    text-decoration: none;
}

.site-nav > a:hover {
    color: var(--accent);
}

.theme-toggle {
    display: grid;
    min-width: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    place-items: center;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
}

.theme-toggle-track {
    position: relative;
    width: 2.15rem;
    height: 1.15rem;
    border: 1px solid var(--ink-soft);
    border-radius: 999px;
}

.theme-toggle-track span {
    position: absolute;
    top: 0.16rem;
    left: 0.18rem;
    width: 0.72rem;
    height: 0.72rem;
    border-radius: 50%;
    background: var(--ink);
    transition: transform 180ms ease, background 180ms ease;
}

.theme-toggle[aria-pressed="true"] .theme-toggle-track span {
    background: var(--accent);
    transform: translateX(0.93rem);
}

main {
    display: block;
}

.intro,
.featured-writing,
.writing,
.about,
.not-found {
    width: min(100%, 59rem);
    margin-inline: auto;
}

.intro {
    padding-block: clamp(5rem, 11vw, 10rem) clamp(5rem, 10vw, 8rem);
}

.eyebrow,
.section-label,
.post-meta,
.about-year,
.rss-link,
.back-link,
.elsewhere,
.site-footer {
    font-family: var(--sans);
}

.eyebrow,
.section-label {
    margin: 0 0 1.35rem;
    color: var(--accent);
    font-size: 0.72rem;
    font-weight: 750;
    letter-spacing: 0.13em;
    line-height: 1.4;
    text-transform: uppercase;
}

.eyebrow span {
    padding-inline: 0.35rem;
    color: var(--line);
}

h1,
h2,
h3,
h4,
p {
    overflow-wrap: break-word;
}

h1,
h2,
h3,
h4 {
    margin-top: 0;
    color: var(--ink);
    font-weight: 650;
    line-height: 1.08;
    letter-spacing: -0.035em;
}

.intro h1 {
    max-width: 21ch;
    margin-bottom: clamp(2.5rem, 5vw, 4rem);
    font-size: clamp(2.65rem, 5.2vw, 4.85rem);
    font-weight: 600;
    line-height: 1.04;
}

.intro-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 4.5rem);
    max-width: 52rem;
    margin-left: auto;
}

.intro-copy p {
    margin: 0;
}

.intro-copy p:first-child::first-letter {
    float: left;
    margin: 0.11em 0.12em 0 0;
    color: var(--accent);
    font-size: 3.45em;
    font-weight: 500;
    line-height: 0.76;
}

.featured-writing {
    position: relative;
    padding: clamp(2.25rem, 5vw, 4rem);
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    background: color-mix(in srgb, var(--paper-deep) 58%, transparent);
}

.featured-link {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    color: var(--ink);
    text-decoration: none;
}

.featured-link h2 {
    max-width: 18ch;
    margin-bottom: 0.85rem;
    font-size: clamp(2.1rem, 5vw, 4.3rem);
    font-weight: 590;
}

.featured-link p {
    max-width: 42rem;
    margin: 0;
    color: var(--ink-soft);
}

.featured-link .arrow {
    align-self: start;
    color: var(--accent);
    font-family: var(--sans);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    transition: transform 180ms ease;
}

.featured-link:hover .arrow {
    transform: translate(0.2rem, -0.2rem);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.42rem;
    margin: 1.35rem 0 0;
    color: var(--ink-soft);
    font-size: 0.71rem;
    font-weight: 650;
    letter-spacing: 0.06em;
    line-height: 1.45;
    text-transform: uppercase;
}

.writing,
.about {
    padding-block: clamp(6rem, 13vw, 11rem);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 2rem;
    padding-bottom: 1.45rem;
    border-bottom: 1px solid var(--ink);
}

.section-heading .section-label {
    margin-bottom: 0.65rem;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
    font-weight: 590;
}

.rss-link,
.back-link,
.text-link {
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.writing-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.writing-list li {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    padding-block: 2rem;
    border-bottom: 1px solid var(--line);
}

.writing-list li::before {
    position: absolute;
    top: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--accent);
    content: "";
    transition: width 220ms ease;
}

.writing-list li:hover::before {
    width: 100%;
}

.writing-list a {
    display: block;
    max-width: 42rem;
    color: var(--ink);
    text-decoration: none;
}

.writing-title {
    display: block;
    margin-bottom: 0.4rem;
    font-size: clamp(1.45rem, 2.6vw, 2.15rem);
    font-weight: 650;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.writing-description {
    display: block;
    color: var(--ink-soft);
    font-size: 0.95em;
    line-height: 1.55;
}

.writing-list .post-meta {
    align-self: start;
    justify-content: end;
    margin-top: 0.35rem;
    white-space: nowrap;
}

.empty-state {
    padding-block: 2rem;
    border-bottom: 1px solid var(--line);
    color: var(--ink-soft);
}

.about {
    border-top: 1px solid var(--line);
}

.about-heading {
    border-bottom-color: var(--ink);
}

.about-year {
    margin: 0 0 0.45rem;
    color: var(--ink-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.about-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(15rem, 0.75fr);
    gap: clamp(2rem, 7vw, 6rem);
    padding-block: clamp(2.5rem, 6vw, 5rem);
}

.about-copy p {
    margin: 0 0 1.4em;
}

.about-copy p:first-child {
    font-size: 1.12em;
}

.about-facts {
    border-top: 1px solid var(--line);
}

.about-facts dl {
    margin: 0;
}

.about-facts dl > div {
    padding-block: 1rem;
    border-bottom: 1px solid var(--line);
}

.about-facts dt {
    margin-bottom: 0.3rem;
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.about-facts dd {
    margin: 0;
    color: var(--ink-soft);
    font-size: 0.9em;
    line-height: 1.5;
}

.elsewhere {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem 1.5rem;
    margin: 0;
    padding-top: 1.25rem;
    border-top: 1px solid var(--line);
    font-size: 0.78rem;
    font-weight: 650;
}

.elsewhere span {
    color: var(--ink-soft);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.site-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2rem;
    padding-block: 3.5rem 2rem;
    border-top: 1px solid var(--ink);
    color: var(--ink-soft);
    font-size: 0.78rem;
    line-height: 1.55;
}

.site-footer p {
    max-width: 34rem;
    margin: 0.25rem 0;
}

.site-footer .footer-name {
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.15rem;
    font-weight: 700;
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    justify-content: end;
    gap: 1rem;
}

.site-footer nav a {
    color: var(--ink-soft);
}

.site-footer .footer-small {
    grid-column: 1 / -1;
    padding-top: 2rem;
    color: var(--ink-soft);
    font-size: 0.68rem;
}

.article-main {
    padding-block: clamp(4rem, 9vw, 7rem) clamp(6rem, 12vw, 10rem);
}

.article {
    width: min(100%, 48rem);
    margin-inline: auto;
}

.article-header {
    padding-bottom: clamp(3rem, 7vw, 5rem);
    border-bottom: 1px solid var(--line);
}

.back-link {
    display: inline-block;
    margin-bottom: clamp(3rem, 8vw, 6rem);
}

.article-header .section-label {
    margin-bottom: 1rem;
}

.article-header h1 {
    max-width: 16ch;
    margin-bottom: 1.35rem;
    font-size: clamp(3rem, 7.2vw, 6rem);
    font-weight: 590;
}

.article-deck {
    max-width: 38rem;
    margin: 0;
    color: var(--ink-soft);
    font-size: clamp(1.2rem, 2.3vw, 1.55rem);
    line-height: 1.45;
}

.article-meta {
    margin-top: 2rem;
}

.article-body {
    padding-block: clamp(3rem, 7vw, 5rem);
    font-size: clamp(1.08rem, 1.01rem + 0.28vw, 1.24rem);
    line-height: 1.75;
}

.article-body > * {
    max-width: 42rem;
    margin-inline: auto;
}

.article-body > p:first-child {
    font-size: 1.15em;
}

.article-body > p:first-child::first-letter {
    float: left;
    margin: 0.16em 0.12em 0 0;
    color: var(--accent);
    font-size: 3.4em;
    line-height: 0.72;
}

.article-body h2,
.article-body h3,
.article-body h4 {
    margin-top: 2.25em;
    margin-bottom: 0.65em;
}

.article-body h2 {
    font-size: clamp(1.9rem, 4vw, 2.8rem);
}

.article-body h3 {
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.article-body h4 {
    color: var(--accent);
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre,
.article-body figure {
    margin-top: 0;
    margin-bottom: 1.5em;
}

.article-body ul,
.article-body ol {
    padding-left: 1.35em;
}

.article-body li {
    padding-left: 0.25em;
    margin-bottom: 0.55em;
}

.article-body li::marker {
    color: var(--accent);
    font-family: var(--sans);
    font-weight: 700;
}

.article-body blockquote {
    max-width: 46rem;
    padding: 1.2rem 0 1.2rem clamp(1.2rem, 4vw, 2.5rem);
    border-left: 3px solid var(--accent);
    color: var(--ink-soft);
    font-size: 1.15em;
    font-style: italic;
}

.article-body blockquote p {
    margin: 0;
}

.article-body hr {
    width: 4rem;
    margin: 3.5rem auto;
    border: 0;
    border-top: 1px solid var(--accent);
}

.article-body code {
    padding: 0.12em 0.28em;
    border-radius: 0.15rem;
    background: var(--paper-deep);
    font-family: var(--mono);
    font-size: 0.86em;
}

.article-body pre {
    max-width: 48rem;
    overflow-x: auto;
    padding: 1.25rem;
    border: 1px solid var(--line);
    background: var(--paper-deep);
    font-size: 0.85rem;
    line-height: 1.6;
}

.article-body pre code {
    padding: 0;
    background: transparent;
}

.article-body figure {
    max-width: 48rem;
}

.article-body img {
    display: block;
    width: 100%;
    height: auto;
}

.article-body figcaption {
    margin-top: 0.65rem;
    color: var(--ink-soft);
    font-family: var(--sans);
    font-size: 0.72rem;
    line-height: 1.5;
}

.article-footer {
    padding-top: 3rem;
    border-top: 1px solid var(--line);
    color: var(--ink-soft);
    font-size: 0.9em;
}

.article-footer p {
    max-width: 34rem;
    margin-inline: auto;
}

.article-end {
    color: var(--accent);
    font-size: 0.72rem;
    text-align: center;
}

.not-found {
    min-height: 60vh;
    padding-block: clamp(6rem, 14vw, 12rem);
}

.not-found h1 {
    max-width: 13ch;
    margin-bottom: 1.25rem;
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 590;
}

.not-found > p:not(.section-label) {
    max-width: 33rem;
    color: var(--ink-soft);
}

.not-found .text-link {
    display: inline-block;
    margin-top: 1.5rem;
}

@media (max-width: 720px) {
    .site-shell {
        width: min(100% - 1.35rem, 74rem);
    }

    .site-header {
        min-height: 5.75rem;
    }

    .wordmark-mark {
        display: none;
    }

    .site-nav {
        gap: 0.75rem;
        font-size: 0.72rem;
    }

    .intro {
        padding-top: 4.5rem;
    }

    .intro h1 {
        max-width: 18ch;
        font-size: clamp(2.45rem, 10.5vw, 3.75rem);
    }

    .intro-copy,
    .about-grid {
        grid-template-columns: 1fr;
    }

    .intro-copy {
        gap: 1.4rem;
    }

    .featured-writing {
        margin-inline: -0.25rem;
        padding-inline: 1rem;
    }

    .featured-link {
        gap: 0.75rem;
    }

    .writing-list li {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .writing-list .post-meta {
        justify-content: start;
        margin-top: 0.85rem;
    }

    .site-footer {
        grid-template-columns: 1fr;
    }

    .site-footer nav {
        justify-content: start;
    }

    .site-footer .footer-small {
        grid-column: auto;
        padding-top: 0.5rem;
    }

    .article-header h1 {
        font-size: clamp(2.8rem, 13vw, 4.7rem);
    }
}

@media (max-width: 430px) {
    .site-nav > a[href="/#about"] {
        display: none;
    }

    .eyebrow span,
    .eyebrow span + * {
        display: none;
    }

    .section-heading {
        align-items: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}

@media print {
    :root,
    :root[data-theme="dark"] {
        --paper: #ffffff;
        --paper-deep: #f4f4f4;
        --ink: #000000;
        --ink-soft: #333333;
        --line: #bbbbbb;
        --accent: #000000;
        color-scheme: light;
    }

    body {
        background: #ffffff;
        font-size: 11pt;
    }

    .site-header,
    .site-footer,
    .back-link,
    .article-footer {
        display: none;
    }

    .article-main,
    .article-body {
        padding-block: 0;
    }

    .article-header h1 {
        font-size: 36pt;
    }

    a {
        color: #000000;
    }
}
