:root {
  --paper: #faf7f1;
  --ink: #181410;
  --muted: #6f675e;
  --line: #ddd4c7;
  --accent: #a45c37;
  --surface: rgba(255, 255, 255, 0.42);
  --code-paper: #1c1712;
  --code-ink: #f5efe5;
  --inline-code: rgba(24, 20, 16, 0.06);
  --serif: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", "URW Palladio L", Georgia, serif;
  --sans: "Avenir Next", "Gill Sans", "Segoe UI", "Helvetica Neue", sans-serif;
  --content-width: min(70rem, calc(100vw - 3rem));
  --reading-width: 42rem;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #12100d;
  --ink: #f2eadf;
  --muted: #b8aa98;
  --line: #322a22;
  --accent: #d88a62;
  --surface: rgba(255, 255, 255, 0.04);
  --code-paper: #1a1612;
  --code-ink: #f7ecde;
  --inline-code: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
  text-decoration-color: rgba(164, 92, 55, 0.45);
  text-underline-offset: 0.18em;
}

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

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

code,
pre {
  font-family: "SFMono-Regular", "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

code {
  font-size: 0.92em;
  background: var(--inline-code);
  border-radius: 0.3rem;
  padding: 0.12rem 0.32rem;
}

pre {
  background: var(--code-paper);
  color: var(--code-ink);
  padding: 1.2rem 1.3rem;
  border-radius: 0.7rem;
  overflow-x: auto;
}

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

.page-shell {
  width: var(--content-width);
  margin: 0 auto;
  padding: 1.5rem 0 4rem;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.brand-mark {
  width: 0.56rem;
  height: 0.56rem;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 35%, #d7a286 0%, var(--accent) 72%);
  box-shadow: 0 0 0 0.12rem rgba(164, 92, 55, 0.12);
}

.site-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-nav a,
.brand,
.inline-link,
.entry-link,
.breadcrumb a {
  text-decoration: none;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.share-button,
.theme-toggle {
  transition: border-color 140ms ease, color 140ms ease, background-color 140ms ease;
}

.theme-toggle:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.theme-toggle-mark {
  width: 0.68rem;
  height: 0.68rem;
  border-radius: 999px;
  background: currentColor;
  box-shadow: inset 0 0 0 0.14rem var(--paper);
}

.content {
  padding-top: 2rem;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.home-intro h1,
.archive-hero h1,
.essay-header h1,
.not-found h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.035em;
  line-height: 0.94;
}

.home-intro {
  max-width: 44rem;
  padding: 0.65rem 0 3.4rem;
}

.home-intro h1 {
  font-size: clamp(3rem, 8vw, 4.8rem);
  margin-bottom: 1.15rem;
}

.tagline,
.dek {
  font-family: var(--serif);
}

.tagline {
  max-width: 14ch;
  margin: 1rem 0 1.1rem;
  font-size: clamp(1.55rem, 3vw, 2.15rem);
  line-height: 1.2;
}

.intro {
  max-width: 38rem;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
  font-size: 1.05rem;
  line-height: 1.82;
}

.archive-content {
  display: grid;
  gap: 1rem;
}

.inline-link {
  color: var(--muted);
}

.entry-meta,
.meta,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.78rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.entry-meta span:not(:last-child)::after,
.meta span:not(:last-child)::after {
  content: "•";
  margin-left: 0.78rem;
  color: color-mix(in srgb, var(--ink) 26%, transparent);
}

.home-intro-copy {
  max-width: 35rem;
  margin: 0 0 0.95rem;
  color: color-mix(in srgb, var(--ink) 88%, transparent);
  font-size: 1.02rem;
  line-height: 1.84;
}

.home-label {
  margin: 0 0 0.95rem;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.home-writing {
  max-width: 44rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.home-featured-entry {
  padding-bottom: 0.4rem;
}

.home-featured-title {
  max-width: 13ch;
  margin: 0.45rem 0 0.75rem;
  font-family: var(--serif);
  font-size: clamp(2.5rem, 5vw, 3.9rem);
  font-weight: 500;
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.home-featured-title a,
.home-archive-row h3 a {
  text-decoration: none;
}

.home-featured-title em {
  font-style: italic;
}

.home-featured-description {
  max-width: 32rem;
  margin: 0;
  color: color-mix(in srgb, var(--ink) 84%, transparent);
  font-size: 1.02rem;
  line-height: 1.8;
}

.home-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}

.home-archive-list {
  display: grid;
  margin-top: 1.85rem;
}

.home-archive-row {
  display: grid;
  grid-template-columns: 10rem minmax(0, 1fr);
  gap: 1.2rem;
  align-items: start;
  padding: 1.15rem 0;
  border-top: 1px solid var(--line);
}

.home-archive-date {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.home-archive-row h3 {
  margin: 0 0 0.35rem;
  font-family: var(--serif);
  font-size: 1.38rem;
  font-weight: 500;
  line-height: 1.18;
}

.home-archive-row p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 78%, transparent);
  font-size: 0.98rem;
  line-height: 1.7;
}

.site-footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 4.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer p {
  margin: 0;
  font-size: 0.92rem;
}

.footer-note {
  text-align: right;
  letter-spacing: 0.02em;
}

.archive-hero {
  max-width: 38rem;
  padding-bottom: 1.4rem;
}

.archive-hero h1 {
  font-size: clamp(2.8rem, 6vw, 4.4rem);
}

.year-group {
  display: grid;
  grid-template-columns: 5rem minmax(0, 1fr);
  gap: 1.4rem;
  align-items: start;
}

.year-heading {
  padding-top: 1.7rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.essay {
  max-width: 72rem;
}

.essay::after {
  content: "";
  display: block;
  clear: both;
}

.breadcrumb {
  margin-bottom: 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--line);
}

.essay-header {
  max-width: 44rem;
}

.essay-header h1 {
  max-width: 11ch;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 7vw, 5.15rem);
}

.essay-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
}

.share-button:hover {
  color: var(--ink);
  border-color: var(--muted);
}

.dek {
  max-width: 28rem;
  margin: 0 0 1rem;
  color: rgba(24, 20, 16, 0.82);
  font-size: 1.28rem;
  line-height: 1.45;
}

.essay-summary {
  max-width: 38rem;
  margin: 1.6rem 0 1.6rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  background: var(--surface);
}

.essay-summary-label {
  margin: 0 0 0.55rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.essay-summary ul {
  margin: 0;
  padding-left: 1.15rem;
}

.essay-summary li {
  margin: 0 0 0.45rem;
  line-height: 1.6;
}

.essay-summary li:last-child {
  margin-bottom: 0;
}

.essay-layout {
  display: grid;
  grid-template-columns: 14rem minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
  margin-top: 1.5rem;
}

.essay-main {
  min-width: 0;
}

.essay-toc {
  position: sticky;
  top: 1.75rem;
  padding-top: 0.1rem;
}

.essay-toc-label {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.essay-toc-item {
  margin: 0 0 0.55rem;
  line-height: 1.45;
}

.essay-toc-item a {
  color: color-mix(in srgb, var(--ink) 68%, transparent);
  font-size: 0.95rem;
  text-decoration: none;
  transition: color 140ms ease;
}

.essay-toc-item a:hover {
  color: var(--ink);
}

.essay-toc-item a.is-active {
  color: var(--ink);
}

.essay-toc-level-3 {
  padding-left: 0.8rem;
}

.article-visual {
  max-width: min(100%, 52rem);
  margin: 0 0 2rem;
  border-radius: 0.8rem;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 78%, var(--ink) 22%);
  border: 1px solid var(--line);
}

.article-visual img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
}

.article-body {
  max-width: var(--reading-width);
  margin-top: 1.25rem;
  font-family: var(--serif);
  font-size: 1.22rem;
  line-height: 1.9;
}

.article-body p,
.article-body ul,
.article-body ol,
.article-body blockquote,
.article-body pre {
  margin: 0 0 1.45rem;
}

.article-body h2,
.article-body h3 {
  margin: 2.6rem 0 0.9rem;
  font-family: var(--sans);
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.article-body ul,
.article-body ol {
  padding-left: 1.3rem;
}

.article-body blockquote {
  margin-left: 0;
  padding-left: 1rem;
  border-left: 2px solid var(--line);
  color: color-mix(in srgb, var(--ink) 78%, transparent);
}

.not-found {
  max-width: 40rem;
  padding-top: 1rem;
}

.not-found h1 {
  font-size: clamp(2.6rem, 6vw, 4.5rem);
  margin-bottom: 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.5rem;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  padding: 0.7rem 1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
}

.button-link.button-link-muted {
  color: var(--muted);
  border-color: var(--line);
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100vw - 1.5rem, 100%);
  }

  .site-header,
  .home-section-head,
  .site-footer,
  .year-group,
  .home-archive-row {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header-actions {
    width: 100%;
    justify-content: space-between;
  }

  .essay-meta-row {
    align-items: flex-start;
  }

  .year-heading {
    padding-top: 0;
  }

  .footer-note {
    text-align: left;
  }

  .article-body {
    max-width: none;
    font-size: 1.16rem;
  }

  .essay-layout {
    grid-template-columns: 1fr;
    gap: 1.2rem;
  }

  .essay-toc {
    position: static;
    padding-top: 0;
  }

}

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 1.25rem, 100%);
    padding-top: 1rem;
  }

  .content {
    padding-top: 1.5rem;
  }

  .home-intro {
    padding-bottom: 2.35rem;
  }

  .home-intro h1 {
    font-size: clamp(2.8rem, 16vw, 4.2rem);
  }

  .home-featured-title {
    font-size: clamp(2.2rem, 12vw, 3rem);
  }

  .site-header-actions {
    gap: 0.8rem;
  }

  .theme-toggle {
    padding-inline: 0.65rem;
  }

  .share-button {
    padding-inline: 0.72rem;
  }

  .essay-header h1 {
    font-size: clamp(2.5rem, 13vw, 3.7rem);
  }

  .essay-toc {
    display: none;
  }

  .dek {
    font-size: 1.12rem;
  }

  .essay-summary {
    padding: 0.9rem 0.95rem;
  }

  .article-body {
    font-size: 1.08rem;
    line-height: 1.84;
  }

}
