:root {
  color-scheme: light;
  --paper: #f4f1ea;
  --ink: #1c1b19;
  --muted: #6d6a63;
  --rule: #c9c4b9;
  --accent: #c94d2e;
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #191918;
  --ink: #eeeae1;
  --muted: #aaa69d;
  --rule: #45433e;
  --accent: #ed7657;
}

* { box-sizing: border-box; }
html { background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--sans); }
a { color: inherit; }

.site-header, .site-footer, main { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.site-header { height: 92px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--rule); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-width: 0; text-decoration: none; }
.wordmark-mark { display: block; flex: 0 0 auto; width: 38px; height: 38px; }
.wordmark-dot { fill: var(--accent); }
.wordmark span { font-family: var(--serif); font-size: 18px; line-height: 1; white-space: nowrap; }
.theme-toggle { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; color: var(--ink); background: transparent; border: 1px solid var(--rule); cursor: pointer; font-size: 18px; }
.theme-toggle:hover { color: var(--paper); background: var(--ink); }

.intro { padding: 56px 0; }
.kicker { grid-column: 1 / -1; margin: 0 0 22px; color: var(--accent); font-size: 11px; font-weight: 700; text-transform: uppercase; }
.intro .kicker { font-size: 14px; text-transform: none; }
.intro h1 { margin: 0; font-family: var(--serif); font-size: clamp(42px, 4.6vw, 64px); font-weight: 400; line-height: .95; letter-spacing: 0; white-space: nowrap; }
.intro h1 em { color: var(--accent); font-weight: 400; }
.intro-copy { max-width: 58ch; margin: 24px 0 0; color: var(--muted); font-family: var(--serif); font-size: 20px; line-height: 1.0; }

.archive { padding: 48px 0 120px; }
.section-heading { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--ink); }
.section-heading h2 { margin: 0; font-size: 13px; }
.section-heading span { color: var(--muted); font-size: 11px; text-transform: uppercase; }
.post-row { position: relative; display: grid; grid-template-columns: 150px 1fr 48px; gap: 24px; padding: 38px 0; border-bottom: 1px solid var(--rule); }
.post-meta { padding-top: 7px; color: var(--muted); font-family: var(--serif); font-size: 14px; }
.post-summary h2 { margin: 0 0 12px; font-family: var(--serif); font-size: 36px; font-weight: 400; }
.post-summary h2 a { text-decoration: none; }
.post-summary h2 a:hover { color: var(--accent); }
.post-summary p { max-width: 680px; margin: 0; color: var(--muted); font-size: 15px; line-height: 1.65; }
.post-arrow { display: grid; place-items: center; width: 42px; height: 42px; border: 1px solid var(--rule); text-decoration: none; font-size: 19px; }
.post-arrow:hover { color: var(--paper); background: var(--accent); border-color: var(--accent); }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.tag-list li { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.tag-list li::before { content: "#"; color: var(--accent); }

.entry { max-width: 780px; margin: 0 auto; padding: 52px 0 120px; }
.back-link { display: inline-block; margin-bottom: 90px; color: var(--muted); font-size: 12px; text-decoration: none; text-transform: uppercase; }
.back-link:hover { color: var(--accent); }
.entry-header { padding-bottom: 48px; border-bottom: 1px solid var(--ink); }
.entry-header h1 { margin: 0; font-family: var(--serif); font-size: clamp(52px, 8vw, 88px); font-weight: 400; line-height: .98; letter-spacing: 0; }
.entry-description { max-width: 630px; margin: 28px 0 0; color: var(--muted); font-family: var(--serif); font-size: 21px; line-height: 1.55; }
.prose { padding: 52px 0; font-family: var(--serif); font-size: 19px; line-height: 1.8; }
.prose > *:first-child { margin-top: 0; }
.prose h2, .prose h3 { margin: 2.2em 0 .7em; font-family: var(--sans); line-height: 1.2; }
.prose h2 { font-size: 25px; }
.prose h3 { font-size: 19px; }
.prose a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.prose blockquote { margin: 2em 0; padding: 8px 0 8px 28px; color: var(--muted); border-left: 3px solid var(--accent); font-size: 23px; font-style: italic; }
.prose code { padding: 2px 5px; background: color-mix(in srgb, var(--ink) 8%, transparent); font-size: .85em; }
.prose pre { overflow-x: auto; padding: 22px; background: var(--ink); color: var(--paper); font-size: 14px; line-height: 1.6; }
.prose pre code { padding: 0; background: transparent; }
.prose img { max-width: 100%; height: auto; }
.entry-nav { padding-top: 28px; border-top: 1px solid var(--ink); }
.entry-nav a { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; text-decoration: none; text-transform: uppercase; }
.entry-nav a:hover { color: var(--accent); }

.site-footer { display: flex; justify-content: space-between; padding: 28px 0 42px; color: var(--muted); border-top: 1px solid var(--rule); font-size: 11px; }

@media (max-width: 720px) {
  .site-header, .site-footer, main { width: min(100% - 32px, 1180px); }
  .site-header { height: 72px; }
  .wordmark { gap: 8px; }
  .wordmark-mark { width: 34px; height: 34px; }
  .wordmark span { font-size: 16px; }
  .intro { padding: 40px 0; }
  .intro h1 { font-size: clamp(40px, 11vw, 52px); line-height: .94; white-space: normal; }
  .intro-copy { margin-top: 28px; font-size: 18px; }
  .archive { padding: 40px 0 88px; }
  .post-row { grid-template-columns: 1fr 42px; gap: 16px; padding: 30px 0; }
  .post-meta { grid-column: 1 / -1; }
  .post-summary h2 { font-size: 29px; }
  .post-arrow { grid-column: 2; grid-row: 2; }
  .entry { padding-top: 34px; }
  .back-link { margin-bottom: 64px; }
  .entry-header h1 { font-size: clamp(46px, 14vw, 70px); }
  .prose { font-size: 18px; }
  .site-footer { gap: 24px; line-height: 1.5; }
}

@media (prefers-reduced-motion: no-preference) {
  .theme-toggle, .post-arrow, .post-summary h2 a { transition: color 160ms, background-color 160ms, border-color 160ms; }
}
