:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --text: #1c1f22;
  --muted: #5d646b;
  --rule: #dcd8cf;
  --accent: #b4461f;
  --accent-soft: #f3e3da;
  --link: #1f5f8b;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 42rem;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #15171a;
    --surface: #1d2024;
    --text: #e6e3dc;
    --muted: #9aa1a8;
    --rule: #33373c;
    --accent: #e57a4f;
    --accent-soft: #3a261d;
    --link: #7fb6dd;
  }
}
:root[data-theme="dark"] {
  --bg: #15171a;
  --surface: #1d2024;
  --text: #e6e3dc;
  --muted: #9aa1a8;
  --rule: #33373c;
  --accent: #e57a4f;
  --accent-soft: #3a261d;
  --link: #7fb6dd;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 var(--sans);
}
a { color: var(--link); text-underline-offset: 2px; }
a:hover { color: var(--accent); }
img { max-width: 100%; height: auto; }

.wrap { max-width: 52rem; margin: 0 auto; padding: 0 16px; }

/* Site header */
.site-head {
  border-bottom: 1px solid var(--rule);
  padding: 14px 0;
}
.site-head .wrap { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.wordmark {
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--text);
  text-decoration: none;
}
.wordmark span { color: var(--accent); }
.site-head nav { display: flex; gap: 18px; font-size: 15px; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--text); }

/* Landing */
.hero { padding: 56px 0 28px; }
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 2.8rem);
  line-height: 1.15;
  margin: 0 0 14px;
}
.hero p { color: var(--muted); max-width: 36rem; margin: 0; font-size: 1.08rem; }

section.block { padding: 28px 0; border-top: 1px solid var(--rule); }
section.block > h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 16px;
}

.feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
}
.feature:hover { border-color: var(--accent); color: inherit; }
.feature .body { padding: 22px 22px 24px; }
.feature h3 { font-family: var(--serif); font-size: 1.6rem; margin: 0 0 6px; font-weight: 600; }
.feature p { margin: 0 0 14px; color: var(--muted); }
.feature .go { color: var(--accent); font-weight: 600; font-size: 15px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 14px; }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 18px 18px 20px;
  text-decoration: none;
  color: inherit;
}
.card:hover { border-color: var(--accent); color: inherit; }
.card h3 { margin: 0 0 6px; font-size: 1.08rem; font-weight: 620; }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card .meta { display: block; margin-top: 10px; font-size: 13px; color: var(--muted); }
.note { font-size: 14px; color: var(--muted); margin: 14px 0 0; }

.site-foot { border-top: 1px solid var(--rule); margin-top: 32px; padding: 22px 0 40px; font-size: 14px; color: var(--muted); }

/* Article (mirrors) */
.article-head { padding: 44px 0 8px; }
.article-head .kicker { font-size: 13px; text-transform: uppercase; letter-spacing: 0.09em; color: var(--accent); font-weight: 600; }
.article-head h1 { font-family: var(--serif); font-size: clamp(1.8rem, 4.5vw, 2.5rem); line-height: 1.18; margin: 8px 0 12px; font-weight: 600; }
.article-head .byline { color: var(--muted); font-size: 15px; }
.origin {
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14.5px;
  margin: 18px 0 0;
}
.toc { font-size: 15px; margin: 22px 0 0; padding: 14px 18px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.toc strong { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.toc ol { margin: 6px 0 0; padding-left: 1.2em; }
.toc li { margin: 2px 0; }

.prose { max-width: var(--measure); font-family: var(--serif); font-size: 1.12rem; line-height: 1.7; padding-bottom: 20px; }
.prose h2 { font-family: var(--sans); font-size: 1.35rem; line-height: 1.3; margin: 2.2em 0 0.6em; scroll-margin-top: 16px; }
.prose h3 { font-family: var(--sans); font-size: 1.1rem; margin: 1.8em 0 0.5em; }
.prose h2 strong, .prose h3 strong { font-weight: inherit; }
.prose a u { text-decoration: none; }
.prose blockquote { margin: 1.2em 0; padding: 0 0 0 1em; border-left: 3px solid var(--rule); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--rule); margin: 2em 0; }
.prose figure { margin: 1.8em 0; }
.prose figure img { display: block; margin: 0 auto; border-radius: 4px; background: #fff; }
.prose figcaption { font-family: var(--sans); font-size: 14px; color: var(--muted); text-align: center; margin-top: 8px; }
.prose sup, .prose sub { line-height: 0; }
.prose li { margin: 0.3em 0; }
