:root {
  --bg: #f5f1e8;
  --paper: #fffdf9;
  --text: #1d1b18;
  --muted: #6e675f;
  --line: #ddd3c7;
  --accent: #8f3b24;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #efe7d9 0%, var(--bg) 28%, #f7f4ee 100%);
  background-attachment: fixed;
  color: var(--text);
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  line-height: 1.7;
  min-height: 100vh;
}

a {
  color: inherit;
}

.site-header,
.site-footer,
.page {
  width: min(760px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header .inner,
.site-footer .inner {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  padding: 0.85rem 0 0.7rem;
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  margin-top: 1rem;
}

.brand,
.footer-mark,
nav a {
  text-decoration: none;
}

.brand,
.footer-mark {
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: 0;
}

.brand {
  color: #3a332d;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  justify-content: flex-end;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.3;
}

.nav-link.active {
  color: var(--accent);
}

.page {
  padding: 0.5rem 0 0.75rem;
}

.intro,
.post {
  background: rgba(255, 253, 249, 0.78);
  border: 1px solid rgba(221, 211, 199, 0.65);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 16px 40px rgba(36, 24, 14, 0.05);
  overflow-x: hidden;
}

.post-list {
  margin-top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.archive > .post-list:first-child {
  margin-top: 0;
}

.archive-header {
  margin-bottom: 1rem;
}

.post-header {
  margin-bottom: 1.15rem;
}

.archive-intro p {
  margin: 0.5rem 0 0;
  color: var(--muted);
}

.archive-header h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.1;
}

.post-card {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--line);
}

.post-card-anchor {
  display: block;
  text-decoration: none;
  transition: transform 140ms ease, color 140ms ease;
}

.post-card:last-child {
  border-bottom: 0;
}

.post-card h2,
.post-header h1,
.intro h1 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.post-header h1 {
  margin-bottom: 0;
}

.meta,
.summary,
.source-meta,
.source-block,
.source-block a,
.terms,
.site-footer {
  color: var(--muted);
}

.source-meta {
  margin: -0.1rem 0 0.5rem;
  font-style: italic;
}

.post-card-link .source-meta:last-child {
  margin-bottom: 0;
}

.post-card-link:hover .post-card-anchor,
.post-card-link:focus-within .post-card-anchor {
  color: var(--accent);
  transform: translateX(3px);
}

.post-card-link:hover .meta,
.post-card-link:focus-within .meta,
.post-card-link:hover .source-meta,
.post-card-link:focus-within .source-meta {
  color: var(--accent);
}

.source-block {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.98rem;
}

.source-block p {
  margin: 0.2rem 0;
}

.footer-mark {
  margin: 0;
  font-size: 0.98rem;
  text-align: right;
  width: 100%;
}

.prose p:first-child {
  margin-top: 0;
}

.prose a,
.source-block a,
.terms a {
  color: var(--accent);
  text-decoration: none;
}

.prose a:hover,
.prose a:focus-visible,
.source-block a:hover,
.source-block a:focus-visible,
.terms a:hover,
.terms a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.prose {
  min-width: 0;
  overflow-x: auto;
}

.prose blockquote {
  margin: 1.4rem 0;
  padding: 0.9rem 1.1rem 0.9rem 1.25rem;
  background: rgba(143, 59, 36, 0.06);
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  color: #3f3730;
}

.prose blockquote p {
  margin: 0;
}

.prose table {
  width: 100%;
  min-width: min(680px, 100%);
  margin: 1.4rem 0;
  border-collapse: collapse;
  font-size: 0.95rem;
  line-height: 1.55;
}

.prose th,
.prose td {
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(221, 211, 199, 0.9);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.prose th {
  background: rgba(143, 59, 36, 0.08);
  color: #312a24;
  font-weight: 700;
}

.prose tbody tr:nth-child(even) {
  background: rgba(255, 253, 249, 0.68);
}

.prose tbody tr:nth-child(odd) {
  background: rgba(245, 241, 232, 0.42);
}

.prose img {
  display: block;
  width: min(100%, 960px);
  max-width: 100%;
  height: auto;
  margin: 1.5rem auto;
  border-radius: 14px;
  border: 1px solid rgba(221, 211, 199, 0.9);
  box-shadow: 0 12px 30px rgba(36, 24, 14, 0.08);
}

.prose code {
  background: rgba(143, 59, 36, 0.08);
  border: 1px solid rgba(143, 59, 36, 0.14);
  border-radius: 6px;
  padding: 0.12rem 0.35rem;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.prose pre,
.prose pre.wp-block-code {
  background: #1f1b18;
  color: #f4eee6;
  border-radius: 14px;
  padding: 1.1rem 1.25rem;
  overflow-x: auto;
  border: 1px solid rgba(95, 74, 58, 0.9);
  margin: 1.5rem 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.prose pre code,
.prose pre.wp-block-code code {
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  color: inherit;
  font-size: 0.95rem;
  line-height: 1.65;
}

@media (max-width: 640px) {
  .site-footer .inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .site-header .inner {
    gap: 0.75rem;
  }

  .brand {
    flex: 0 1 auto;
    min-width: 0;
  }

  nav {
    flex: 0 0 auto;
    gap: 0.75rem;
  }

  .intro,
  .post {
    padding: 1.5rem;
  }
}
