:root {
  --bg: #f8f7f3;
  --surface: #ffffff;
  --ink: #24211d;
  --muted: #6d675f;
  --line: #ded9cf;
  --accent: #55723a;
  --accent-dark: #3f552c;
  --warm: #55723a;
  --max: 1120px;
}

:root[data-theme="dark"] {
  --bg: #171818;
  --surface: #222424;
  --ink: #f2eee7;
  --muted: #b8b0a6;
  --line: #373a38;
  --accent: #a8c17c;
  --accent-dark: #bed89b;
  --warm: #a8c17c;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

html[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  transition: background-color 180ms ease, color 180ms ease;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.site-header, .site-footer {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 850;
}

.brand img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.brand.small img {
  width: 30px;
  height: 30px;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
}

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

.theme-toggle-icon {
  display: none;
  font-size: 1.25rem;
  line-height: 1;
}

.theme-toggle-moon {
  display: block;
}

:root[data-theme="dark"] .theme-toggle-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle-sun {
  display: block;
  color: var(--warm);
}

main {
  width: min(var(--max), calc(100% - 40px));
  margin: 0 auto;
}

.hero, .page-hero, .split, .section-head {
  padding: 80px 0;
}

.hero {
  max-width: 920px;
  padding: 52px 0 32px;
}

.page-hero h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(1.5rem, 4vw, 3.4rem);
  line-height: 1;
  letter-spacing: 0;
}

/* Keep the hero tagline on a single line on desktop. */
@media (min-width: 761px) {
  .hero-copy h1 {
    max-width: none;
    white-space: nowrap;
    font-size: clamp(1.6rem, 3.05vw, 2.45rem);
  }
}

.article h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.35rem, 5vw, 4.25rem);
  line-height: 1.04;
  letter-spacing: 0;
}

.hero-copy p, .page-hero p, .article header p {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.18rem;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.hero-copy .button {
  align-self: flex-start;
  margin-top: 18px;
}

.eyebrow, time {
  margin: 0 0 14px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

blockquote {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.35;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 750;
}

.button.secondary {
  background: transparent;
  color: var(--accent-dark);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 0 0 84px;
}

.feature-grid > * {
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.feature-grid span {
  display: block;
  margin-bottom: 18px;
  color: var(--warm);
  font-weight: 800;
}

.feature-grid strong {
  display: block;
  font-size: 1.45rem;
  line-height: 1.22;
}

.split {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 48px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.split h2, .section-head h2 {
  margin: 0;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 36px 0 28px;
  border-top: 1px solid var(--line);
}

.writing-anchor {
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.text-link {
  color: var(--accent-dark);
  font-weight: 800;
}

.post-list {
  display: grid;
  gap: 22px;
  margin-bottom: 56px;
}

.post-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.post-list.compact .post-card:nth-child(n+3) { display: none; }

.post-card img {
  width: 100%;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}

.post-card h2 {
  margin: 2px 0 10px;
  font-size: clamp(1.45rem, 3vw, 2.2rem);
  line-height: 1.08;
}

.post-card h2 a {
  text-decoration: none;
}

.post-card p {
  margin: 0 0 18px;
  color: var(--muted);
}

.page-hero.narrow {
  max-width: 760px;
}

.essay, .article {
  max-width: 780px;
  margin: 0 auto 96px;
}

.essay h2 {
  margin: 52px 0 8px;
  color: var(--accent-dark);
}

.article header {
  padding: 56px 0 28px;
}

.article header time {
  display: block;
  margin-top: 28px;
}

.article-image {
  width: 100%;
  aspect-ratio: 768 / 461;
  object-fit: cover;
  margin: 32px 0;
}

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

.article-body h2, .article-body h3 {
  margin-top: 42px;
  line-height: 1.18;
}

.article-body blockquote {
  padding-left: 24px;
  border-left: 4px solid var(--warm);
  color: var(--muted);
}

.article-body a {
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
}

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

.article-disclaimer {
  margin: 48px 0 0;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 64px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

.post-nav-link {
  display: grid;
  gap: 6px;
  min-height: 136px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  text-decoration: none;
}

.post-nav-link.older {
  text-align: right;
}

.post-nav-link span {
  color: var(--accent);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.post-nav-link em {
  color: var(--ink);
  font-size: 1.18rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.post-nav-spacer {
  min-height: 1px;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 0 0 84px;
}

.pagination button {
  min-width: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: center;
}

.pagination button[aria-current="page"] {
  background: var(--ink);
  color: var(--bg);
}

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

[hidden] {
  display: none !important;
}

.site-footer {
  display: block;
  padding: 44px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer p {
  max-width: 1040px;
  margin: 0 auto;
  font-size: clamp(0.88rem, 1.25vw, 1rem);
  line-height: 1.5;
}

@media (max-width: 760px) {
  .site-header, .site-footer, main {
    width: min(100% - 28px, var(--max));
  }

  .hero, .split, .post-card, .site-footer {
    grid-template-columns: 1fr;
  }

  .hero, .page-hero, .split, .section-head {
    padding: 52px 0;
  }

  .section-head {
    align-items: start;
    padding: 42px 0 24px;
  }

  .feature-grid {
    grid-template-columns: 1fr;
    margin-bottom: 56px;
  }

  .post-card {
    padding: 14px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-spacer {
    display: none;
  }

  .site-footer p {
    max-width: 36rem;
  }
}
