:root {
    --paper: #f5f0e7;
    --paper-warm: #efe7d8;
    --ink: #1f1d1a;
    --muted-ink: #5a564f;
    --olive: #70745f;
    --terracotta: #9d5b3f;
    --mustard: #b08a46;
    --line: rgba(31, 29, 26, 0.14);
    --line-strong: rgba(31, 29, 26, 0.24);
    --max-text: 68ch;
    --content-width: min(1100px, calc(100vw - 3rem));
}

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

html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
    background: linear-gradient(180deg, var(--paper) 0%, var(--paper-warm) 100%);
    color: var(--ink);
    line-height: 1.65;
    letter-spacing: 0.004em;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        radial-gradient(circle at 20% 12%, rgba(112, 116, 95, 0.07) 0, rgba(112, 116, 95, 0) 26%),
        radial-gradient(circle at 80% 18%, rgba(157, 91, 63, 0.06) 0, rgba(157, 91, 63, 0) 24%),
        radial-gradient(circle at 12% 85%, rgba(176, 138, 70, 0.06) 0, rgba(176, 138, 70, 0) 30%),
        repeating-linear-gradient(
            0deg,
            rgba(31, 29, 26, 0.015) 0,
            rgba(31, 29, 26, 0.015) 1px,
            transparent 1px,
            transparent 4px
        );
}

a {
    color: var(--ink);
    text-decoration-color: rgba(31, 29, 26, 0.4);
    text-underline-offset: 0.18em;
}

a:hover {
    text-decoration-color: var(--terracotta);
}

.site-shell {
    width: var(--content-width);
    margin: 2.2rem auto 4rem;
    position: relative;
}

.site-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid var(--line);
    transform: translate(0.7rem, 0.65rem);
    border-radius: 24px;
    pointer-events: none;
}

.frame {
    position: relative;
    background: rgba(245, 240, 231, 0.82);
    border: 1px solid var(--line-strong);
    border-radius: 22px;
    padding: clamp(1.1rem, 2vw, 2rem);
    backdrop-filter: blur(1.5px);
    box-shadow:
        0 8px 24px rgba(31, 29, 26, 0.05),
        0 1px 0 rgba(255, 255, 255, 0.4) inset;
}

.masthead {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: end;
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 0.75rem;
    margin-bottom: 1.1rem;
}

.brand {
    margin: 0;
    font-family: "SF Pro Display", "SF Pro Text", "Segoe UI", Arial, sans-serif;
    font-size: clamp(0.9rem, 1.4vw, 1.08rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--muted-ink);
}

.date-mark {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted-ink);
}

.home-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
    gap: clamp(1.4rem, 2.8vw, 3rem);
    align-items: start;
}

.article {
    max-width: var(--max-text);
}

.eyebrow {
    margin: 0 0 0.8rem;
    font-family: "SF Pro Text", "Segoe UI", Arial, sans-serif;
    font-size: 0.78rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--olive);
}

h1,
h2,
h3 {
    font-family: "SF Pro Display", "Avenir Next", "Segoe UI", Arial, sans-serif;
    line-height: 1.08;
    letter-spacing: -0.02em;
    margin: 0;
    color: #171613;
}

h1 {
    font-size: clamp(2rem, 5vw, 3.6rem);
    max-width: 16ch;
    text-wrap: balance;
}

.lede {
    margin: 1rem 0 0;
    font-size: clamp(1.05rem, 1.5vw, 1.2rem);
    color: #3a3833;
    max-width: 54ch;
}

.meta {
    margin-top: 1.2rem;
    padding-top: 0.9rem;
    border-top: 1px solid var(--line);
    font-size: 0.96rem;
    color: var(--muted-ink);
}

.cta-row {
    margin-top: 1.4rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
}

.btn {
    display: inline-block;
    border: 1px solid var(--line-strong);
    padding: 0.55rem 0.95rem;
    font-family: "SF Pro Text", "Segoe UI", Arial, sans-serif;
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.11em;
    text-decoration: none;
    border-radius: 999px;
    transition: background-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.btn-primary {
    background: rgba(157, 91, 63, 0.12);
}

.btn-secondary {
    background: rgba(112, 116, 95, 0.08);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(31, 29, 26, 0.08);
}

.panel {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.34);
    padding: 0.9rem 1rem;
    border-radius: 16px;
}

.panel + .panel {
    margin-top: 0.9rem;
}

.panel-title {
    margin: 0 0 0.6rem;
    font-family: "SF Pro Text", "Segoe UI", Arial, sans-serif;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--olive);
}

.work-item + .work-item {
    margin-top: 0.95rem;
    padding-top: 0.95rem;
    border-top: 1px solid var(--line);
}

.work-item h3 {
    font-size: 1.04rem;
}

.work-meta {
    margin: 0.2rem 0 0;
    font-size: 0.88rem;
    color: var(--muted-ink);
}

.work-copy {
    margin: 0.45rem 0 0;
    font-size: 0.94rem;
    color: #3e3c37;
}

.chip-row {
    list-style: none;
    margin: 0.8rem 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.chip {
    border: 1px solid var(--line);
    padding: 0.22rem 0.6rem;
    font-size: 0.74rem;
    color: #47433d;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
}

.page-title {
    margin-bottom: 0.45rem;
    font-size: clamp(1.8rem, 3.7vw, 2.9rem);
}

.subhead {
    margin: 0;
    color: var(--muted-ink);
    max-width: 56ch;
}

.list-header {
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line-strong);
    padding-bottom: 0.95rem;
}

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

.post-list li {
    border-top: 1px solid var(--line);
}

.post-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    text-decoration: none;
    padding: 0.8rem 0.15rem;
    border-radius: 12px;
    transition: background-color 140ms ease;
}

.post-list a:hover {
    background: rgba(176, 138, 70, 0.08);
}

.post-kicker {
    font-family: "SF Pro Text", "Segoe UI", Arial, sans-serif;
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--olive);
}

.post-title {
    font-family: "SF Pro Display", "Avenir Next", "Segoe UI", Arial, sans-serif;
    font-size: 1.2rem;
}

.byline {
    margin: 0.25rem 0 1.2rem;
    font-size: 0.9rem;
    color: var(--muted-ink);
}

.article-content p {
    margin: 0 0 1rem;
    max-width: var(--max-text);
}

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

.article-content h2,
.article-content h3 {
    margin: 1.35rem 0 0.55rem;
}

.article-content blockquote {
    margin: 1rem 0;
    padding: 0.55rem 0.95rem;
    border-left: 3px solid rgba(157, 91, 63, 0.45);
    background: rgba(157, 91, 63, 0.07);
    border-radius: 10px;
}

.article-content pre {
    margin: 1rem 0;
    padding: 0.75rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.45);
    overflow-x: auto;
}

.nav-row {
    margin-top: 1.4rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.post-template-note {
    margin-top: 1.1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed var(--line);
    font-size: 0.8rem;
    color: var(--muted-ink);
}

/*
New post skeleton:
<main class="site-shell">
  <div class="frame article">
    <header class="list-header">
      <p class="eyebrow">Journal</p>
      <h1 class="page-title">Post title</h1>
      <p class="byline">By John Detlefs · Month Day, Year</p>
    </header>
    <article class="article-content">
      <p>Lead paragraph...</p>
      <p>Additional paragraph...</p>
    </article>
    <nav class="nav-row"><a href="/posts">All posts</a><a href="/">Home</a></nav>
  </div>
</main>
*/

@media (max-width: 980px) {
    .home-grid {
        grid-template-columns: 1fr;
    }

    .site-shell::before {
        transform: translate(0.45rem, 0.42rem);
    }
}

@media (max-width: 640px) {
    .site-shell {
        width: min(100vw - 1.2rem, 1100px);
        margin-top: 1.1rem;
    }

    .frame {
        padding: 0.85rem;
    }

    .masthead {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .post-list a {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.2rem;
    }
}
