/* ---------- Tokens ---------- */
:root {
  --bg: #f6f3ee;
  --surface: #fffdf9;
  --ink: #1d1b18;
  --muted: #6b655c;
  --rule: #e2dcd2;
  --accent: #b3471d;     /* burnt orange */
  --accent-ink: #fff;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --max: 46rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161513;
    --surface: #1e1c19;
    --ink: #ece7df;
    --muted: #9d968b;
    --rule: #34312c;
    --accent: #e8794a;
    --accent-ink: #161513;
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--accent); text-decoration-color: currentColor; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
.hero em, .thesis em { font-style: italic; color: var(--accent); }

/* ---------- Header / footer ---------- */
.site-header { padding: 1.5rem 0; }
.header-inner { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.wordmark { font-family: var(--serif); font-size: 1.25rem; text-decoration: none; }
nav { display: flex; gap: 1.5rem; font-size: 0.95rem; }
nav a { text-decoration: none; color: var(--muted); }
nav a:hover, nav a[aria-current] { color: var(--ink); }

.site-footer { border-top: 1px solid var(--rule); margin-top: 5rem; padding: 2rem 0 3rem; color: var(--muted); font-size: 0.875rem; }
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.footer-inner a { margin-left: 1.25rem; text-decoration: none; }
.footer-inner a:first-child { margin-left: 0; }

/* ---------- Shared bits ---------- */
.eyebrow { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin: 0 0 1.25rem; }
.cta { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; margin-top: 2rem; }
.btn {
  display: inline-block; background: var(--ink); color: var(--bg);
  padding: 0.75rem 1.25rem; border-radius: 999px; text-decoration: none; font-weight: 500; font-size: 0.95rem;
}
.btn:hover { background: var(--accent); color: var(--accent-ink); }
.link { font-weight: 500; text-decoration: none; font-size: 0.95rem; }
.section { margin-top: 5rem; }
.section-label { font-family: var(--sans); font-size: 0.8rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 1.5rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; }

/* ---------- Home ---------- */
.hero { padding: 4rem 0 1rem; }
.hero h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 38rem; margin: 1.5rem 0 0; }

.thesis { margin-top: 4.5rem; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 2.5rem 0; }
.thesis blockquote { margin: 0; font-family: var(--serif); font-size: clamp(1.5rem, 3.6vw, 2rem); line-height: 1.3; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.card { background: var(--surface); border: 1px solid var(--rule); border-radius: 14px; padding: 1.5rem; }
.card .num { font-size: 0.8rem; color: var(--accent); font-weight: 600; }
.card h3 { font-size: 1.35rem; margin: 0.5rem 0 0.6rem; }
.card p { margin: 0; color: var(--muted); font-size: 0.975rem; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li {
  display: grid; grid-template-columns: 1fr auto; column-gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--rule);
}
.timeline li:first-child { border-top: 1px solid var(--rule); }
.timeline .role { font-weight: 500; }
.timeline .org { color: var(--muted); grid-row: 2; }
.timeline .when { color: var(--muted); font-size: 0.9rem; grid-row: 1 / span 2; grid-column: 2; align-self: center; }

.contact { background: var(--surface); border: 1px solid var(--rule); border-radius: 18px; padding: 2.5rem; }
.contact h2 { font-size: 2.2rem; }
.contact p { color: var(--muted); margin: 0.75rem 0 0; }

.principles { list-style: none; margin: 0; padding: 0; counter-reset: p; }
.principles li { counter-increment: p; display: grid; grid-template-columns: 3rem 1fr; padding: 1.25rem 0; border-bottom: 1px solid var(--rule); }
.principles li:first-child { border-top: 1px solid var(--rule); }
.principles li::before { content: "0" counter(p); grid-row: span 2; color: var(--accent); font-weight: 600; font-size: 0.8rem; padding-top: 0.45rem; }
.principles h3 { font-size: 1.35rem; }
.principles p { margin: 0.35rem 0 0; color: var(--muted); }

/* ---------- Blog list ---------- */
.page-head { padding: 4rem 0 2.5rem; }
.page-head h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
.post-list { list-style: none; margin: 0; padding: 0; }
.post-list li { border-bottom: 1px solid var(--rule); }
.post-list li:first-child { border-top: 1px solid var(--rule); }
.post-list a { display: grid; grid-template-columns: 7.5rem 1fr; column-gap: 1.5rem; padding: 1.25rem 0; text-decoration: none; }
.post-list time { color: var(--muted); font-size: 0.875rem; padding-top: 0.3rem; }
.post-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.25; }
.post-desc { grid-column: 2; color: var(--muted); font-size: 0.95rem; margin-top: 0.25rem; }
.post-list a:hover .post-title { color: var(--accent); }

/* ---------- Post ---------- */
.post-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--rule); margin-bottom: 2.5rem; }
.back { font-size: 0.9rem; color: var(--muted); text-decoration: none; }
.post-header h1 { font-size: clamp(2.1rem, 5.5vw, 3rem); margin-top: 1.5rem; }
.dek { font-size: 1.2rem; color: var(--muted); margin: 1rem 0 0; }
.meta { font-size: 0.875rem; color: var(--muted); margin: 1.25rem 0 0; }

.prose { font-family: var(--serif); font-size: 1.2rem; line-height: 1.7; }
.prose h2 { font-size: 1.6rem; margin: 2.5rem 0 0.75rem; }
.prose h3 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.25rem; }
.prose a { text-decoration-color: var(--accent); }
.prose blockquote { margin: 2rem 0; padding-left: 1.25rem; border-left: 3px solid var(--accent); font-style: italic; }
.prose code { font-size: 0.85em; background: var(--surface); border: 1px solid var(--rule); padding: 0.1em 0.35em; border-radius: 5px; }
.prose pre { background: var(--surface); border: 1px solid var(--rule); padding: 1rem; border-radius: 10px; overflow-x: auto; font-size: 0.85rem; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose img { max-width: 100%; border-radius: 10px; }
.about .prose { font-size: 1.15rem; }
.post-footer { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: 0.95rem; }

/* ---------- Small screens ---------- */
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .post-list a { grid-template-columns: 1fr; }
  .post-desc { grid-column: 1; }
  .contact { padding: 1.75rem; }
  nav { gap: 1rem; }
}
