:root {
  color-scheme: light dark;
  --paper: #f5f1e8;
  --ink: #1a1c17;
  --muted: #6c6c62;
  --line: #d5cfc2;
  --accent: #c84b31;
  --measure: 45rem;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.65;
}

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

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

.site-header,
.site-footer,
main {
  width: min(100% - 1.5rem, 76rem);
  margin-inline: auto;
}

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

.wordmark {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.08em;
  text-decoration: none;
}

.wordmark span { color: var(--accent); }
nav { display: flex; gap: 1.5rem; }

nav a {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.hero { padding: 4.5rem 0 4rem; }

.eyebrow,
.post-card-date,
.byline {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 750;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

span.eyebrow { display: block; }

h1,
h2 {
  font-family: Georgia, "Times New Roman", serif;
  line-height: 1.05;
  text-wrap: balance;
}

h1 {
  max-width: 14ch;
  margin: 0.2rem 0 1.25rem;
  font-size: clamp(3rem, 13vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.06em;
}

.lede {
  max-width: 43rem;
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.2rem, 5vw, 1.5rem);
  line-height: 1.45;
}

.writing { padding-bottom: 6rem; }

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

.section-heading h2 {
  margin: 0;
  font-family: inherit;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading span { color: var(--muted); font-family: ui-monospace, monospace; }

.post-card {
  display: grid;
  gap: 0.7rem;
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--line);
}

.post-card > * { margin: 0; }
.post-card h2 { font-size: clamp(1.7rem, 3vw, 2.5rem); font-weight: 500; }
.post-card h2 a { text-decoration: none; }
.post-card > p:not(.post-card-date) { color: var(--muted); }

.read-more {
  white-space: nowrap;
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.page,
.post,
main:has(time.post-date) {
  max-width: var(--measure);
  margin-inline: auto;
  padding: 4.5rem 0;
}

.page h1,
.post h1,
main:has(time.post-date) > h1 { font-size: clamp(3rem, 12vw, 4.5rem); }

main:has(time.post-date) > h1 + p {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1.45;
}

.post-header {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.post-summary { display: none; }
.byline { margin-top: 1.8rem; }
.byline span { padding-inline: 0.55rem; color: var(--accent); }

main:has(time.post-date) > .byline {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.prose > p,
.prose > ul,
.prose > ol,
main:has(time.post-date) > p,
main:has(time.post-date) > ul,
main:has(time.post-date) > ol { max-width: 40rem; }

.prose h2,
main:has(time.post-date) > h2 {
  margin: 3rem 0 1rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 500;
}

blockquote {
  margin: 3rem 0;
  padding: 1rem 0 1rem 2rem;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
}

blockquote p { margin: 0; }

code {
  padding: 0.12em 0.3em;
  border-radius: 0.2rem;
  background: var(--line);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
}

pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper) 70%, var(--ink) 4%);
  line-height: 1.5;
}

pre code { padding: 0; background: transparent; }

img {
  display: block;
  max-width: 100%;
  height: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

th,
td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th { border-bottom-color: var(--ink); }

.site-footer {
  display: flex;
  justify-content: space-between;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
}

.site-footer p { margin: 0; }

.post-card > p:not(.post-card-date) { max-width: 34rem; }
.read-more { margin-top: 0.6rem; }

@media (min-width: 52rem) {
  .site-header,
  .site-footer,
  main { width: min(100% - 4rem, 76rem); }

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(18rem, 0.85fr);
    grid-template-rows: auto auto;
    column-gap: clamp(3rem, 8vw, 8rem);
    align-items: end;
    padding: 6.5rem 0 5rem;
  }

  .hero .eyebrow {
    grid-column: 1;
    grid-row: 1;
    align-self: start;
    margin-top: 0;
  }

  .hero h1 {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
    font-size: clamp(4.5rem, 7vw, 6.25rem);
  }

  .hero .lede {
    grid-column: 2;
    grid-row: 1 / span 2;
    padding-bottom: 0.4rem;
    font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  }

  .post-card {
    grid-template-columns: 7rem minmax(13rem, 0.8fr) minmax(18rem, 1.2fr) auto;
    gap: clamp(1.25rem, 3vw, 2.5rem);
    align-items: baseline;
  }

  .post-card h2 { font-size: clamp(1.7rem, 2.5vw, 2.25rem); }
  .read-more { margin-top: 0; }

  .page,
  .post,
  main:has(time.post-date) { padding: 6.5rem 0; }

  .page h1,
  .post h1,
  main:has(time.post-date) > h1 { font-size: clamp(4rem, 6vw, 5rem); }
}

@media (max-width: 35rem) {
  .site-footer { flex-direction: column; gap: 0.6rem; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #151712;
    --ink: #eeeadf;
    --muted: #aaa99e;
    --line: #373a32;
    --accent: #f0795d;
  }
}

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