:root {
  --paper: #faf7f2;
  --ink: #2b2723;
  --muted: #6f665c;
  --rule: #e4ddd2;
  --accent: #7a3b2e;
  --accent-soft: #f1e6df;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1c1a18;
    --ink: #ebe5dc;
    --muted: #a69c90;
    --rule: #3a3530;
    --accent: #d99a85;
    --accent-soft: #2e2622;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.7;
}

a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 42rem; margin: 0 auto; padding: 0 1.5rem; }

/* Header */
.site-header { border-bottom: 1px solid var(--rule); }
.site-header .wrap {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 0.5rem 1.5rem; padding-top: 1.75rem; padding-bottom: 1.25rem;
}
.site-title {
  font-size: 1.5rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
}
.site-nav { font-family: var(--sans); font-size: 0.9rem; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"], .site-nav a.active { color: var(--ink); }

/* Blog dropdown in the top nav */
.nav-item { position: relative; }
.nav-item > a::after {
  content: ""; display: inline-block; margin-left: 0.35em; vertical-align: 0.2em;
  border: 0.28em solid transparent; border-top-color: currentColor; border-bottom: 0;
}
.sub-menu {
  position: absolute; top: 100%; left: -0.9rem; z-index: 10; min-width: 11rem;
  padding: 0.5rem 0; margin-top: 0.4rem;
  background: var(--paper); border: 1px solid var(--rule); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  visibility: hidden; opacity: 0; transform: translateY(-4px);
  transition: opacity 0.12s, transform 0.12s, visibility 0.12s;
}
.sub-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -0.6rem; height: 0.6rem; }
.sub-menu a { display: block; padding: 0.4rem 0.9rem; }
.sub-menu a:hover { background: var(--accent-soft); color: var(--accent); }
.nav-item:hover .sub-menu, .nav-item:focus-within .sub-menu { visibility: visible; opacity: 1; transform: none; }

/* Sub-tabs on Blog pages */
.subnav {
  display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 2rem 0 0;
  font-family: var(--sans); font-size: 0.85rem;
}
.subnav a {
  padding: 0.35rem 0.9rem; border: 1px solid var(--rule); border-radius: 999px;
  color: var(--muted); text-decoration: none;
}
.subnav a:hover { border-color: var(--accent); color: var(--accent); }
.subnav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--paper); }

main { padding: 3rem 0 4rem; }

/* Intro */
.intro h1 { font-size: 2.25rem; line-height: 1.2; margin: 0 0 1rem; font-weight: 600; }
.intro p { color: var(--muted); margin: 0; }

.section-label {
  font-family: var(--sans); font-size: 0.75rem; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  margin: 3.5rem 0 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--rule);
}

/* Post list */
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.post-list h2 { font-size: 1.35rem; line-height: 1.3; margin: 0 0 0.35rem; font-weight: 600; }
.post-list h2 a { color: var(--ink); text-decoration: none; }
.post-list h2 a:hover { color: var(--accent); }
.post-list p { margin: 0.35rem 0 0; color: var(--muted); font-size: 1.05rem; }
.empty { color: var(--muted); font-style: italic; }

.meta {
  font-family: var(--sans); font-size: 0.8rem; color: var(--muted);
  display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap;
}
.tag {
  background: var(--accent-soft); color: var(--accent);
  padding: 0.1rem 0.55rem; border-radius: 999px; text-decoration: none; font-weight: 500;
}

/* Topics */
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.topic {
  display: block; padding: 1.1rem 1.2rem; border: 1px solid var(--rule); border-radius: 8px;
  text-decoration: none; color: var(--ink);
}
.topic:hover { border-color: var(--accent); }
.topic strong { display: block; font-size: 1.1rem; }
.topic span { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); line-height: 1.45; display: block; margin-top: 0.25rem; }

/* Article */
article header { margin-bottom: 2.25rem; }
article h1 { font-size: 2.25rem; line-height: 1.2; margin: 0 0 0.75rem; font-weight: 600; }
article h2 { font-size: 1.45rem; margin: 2.5rem 0 0.75rem; line-height: 1.3; }
article blockquote {
  margin: 1.75rem 0; padding: 0.25rem 0 0.25rem 1.25rem;
  border-left: 3px solid var(--accent); color: var(--muted); font-style: italic;
}
article blockquote cite { display: block; font-style: normal; font-family: var(--sans); font-size: 0.85rem; margin-top: 0.5rem; }
.back { font-family: var(--sans); font-size: 0.9rem; margin-top: 3rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--rule); font-family: var(--sans); font-size: 0.85rem; color: var(--muted); }
.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 2rem; }

@media (max-width: 34rem) {
  body { font-size: 1.0625rem; }
  .intro h1, article h1 { font-size: 1.85rem; }
  main { padding-top: 2rem; }
  .topics { grid-template-columns: 1fr; }
}
