/* ============================================================
   Minimal Typeset Stylesheet
   frankniu.com
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500&family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&display=swap');

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

:root {
    --paper: #F8F5EE;
    --ink: #1A1814;
    --ink-light: #4A4640;
    --ink-faint: #8A857E;
    --accent: #8B2500;
    --rule: #C8C3B8;
    --body-font: 'EB Garamond', 'Garamond', 'Georgia', serif;
    --display-font: 'Libre Baskerville', 'Georgia', serif;
}

html {
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: var(--body-font);
    font-size: 1.1rem;
    line-height: 1.7;
    color: var(--ink);
    background: var(--paper);
    animation: fadeIn 200ms ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* --- Paper Container --- */
.paper {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* --- Title Block --- */
.title-block {
    margin-top: 5rem;
    text-align: center;
}

.paper-title {
    font-family: var(--display-font);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--ink);
}

.author-line {
    margin-top: 0.75rem;
    font-size: 1rem;
    color: var(--ink-light);
}

.title-block .featured-pubs {
    margin-top: 0.6rem;
    font-size: 0.8rem;
    color: var(--ink-faint);
    letter-spacing: 0.02em;
}

/* --- Rules --- */
.paper hr {
    border: none;
    border-top: 0.5px solid var(--rule);
    margin: 2.5rem 0;
}

/* --- Sections --- */
.section {
    margin-bottom: 2rem;
}

.section-heading {
    font-family: var(--display-font);
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

/* --- Paragraphs --- */
.body-content p {
    margin-bottom: 0.65rem;
}

.body-content p:last-child {
    margin-bottom: 0;
}

/* --- Links --- */
a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-thickness: 0.5px;
}

a:hover {
    text-decoration-thickness: 1px;
}

/* --- Link List --- */
.link-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 1.5rem;
}

/* --- Footer --- */
.footer {
    text-align: center;
    line-height: 1.6;
}

.footer-cta {
    font-size: 1rem;
    color: var(--ink);
}

/* --- Extras Page --- */
.appendix-heading {
    font-family: var(--display-font);
    font-size: 1.1rem;
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.resource-list {
    list-style: none;
    padding: 0;
}

.resource-list > li {
    margin-bottom: 0.65rem;
}

.resource-list a {
    font-weight: 500;
}

.resource-list .desc {
    display: block;
    font-size: 0.95rem;
    color: var(--ink-light);
    margin-top: 0.1rem;
}

.remark {
    border: 0.5px solid var(--ink);
    padding: 1em 1.25em;
    margin: 1.25rem 0;
}

.remark-label {
    font-variant: small-caps;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 0.35rem;
}

.remark ul {
    list-style: none;
    padding: 0;
    margin: 0.4rem 0;
}

.remark li {
    padding-left: 1.25em;
    text-indent: -1.25em;
    margin-bottom: 0.15rem;
}

.remark li::before {
    content: "\2013\00a0";
    color: var(--accent);
}

.bibliography {
    list-style: none;
    padding: 0;
}

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

.bibliography .book-title {
    font-style: italic;
}

.bibliography .book-author {
    font-variant: small-caps;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    html {
        font-size: 17px;
    }

    .paper {
        padding: 0 1.5rem 3rem;
    }

    .paper-title {
        font-size: 1.65rem;
    }

    .title-block {
        margin-top: 3.5rem;
    }

    .link-list {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* --- Print --- */
@media print {
    @page {
        size: letter;
        margin: 1in;
    }

    body {
        background: white;
        font-size: 12pt;
    }

    .paper {
        max-width: 100%;
        padding: 0;
    }

    a {
        color: var(--ink);
    }

    a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: var(--ink-faint);
    }
}
