*, *::before, *::after { box-sizing: border-box; }

:root {
  --text: #111;
  --secondary: #777;
  --bg: #faf9f7;
  --border: #e0ddd8;
  --crest-primary: #3c4e38;
  --crest-on-primary: #f0ebe2;
  --link: #3c4e38;
}

@media (prefers-color-scheme: dark) {
  :root {
    --text: #e8e8e8;
    --secondary: #999;
    --link: #7a9472;
    --bg: #141412;
    --border: #2e2c28;
    --crest-primary: #4a6045;
    --crest-on-primary: #f0ebe2;
  }
}

html {
  font-size: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 5vh auto 0;
  padding: 0 1.5rem 4rem;
  max-width: 640px;
}

/* Header & crest */

.site-header {
  text-align: center;
  margin-bottom: 3.5rem;
}

.site-logo {
  display: inline-block;
  color: var(--text);
  line-height: 0;
  transition: opacity 0.15s;
}

.site-logo:hover { opacity: 0.6; text-decoration: none; }

.crest { width: 180px; height: auto; }

@media (max-width: 480px) {
  .crest { width: 140px; }
}

/* Typography */

h1 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1.4rem;
  font-weight: normal;
  margin: 0 0 1.25rem;
  line-height: 1.3;
}

h2 {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 1rem;
  font-weight: normal;
  color: var(--secondary);
  margin: 3rem 0 0.75rem;
}

p { margin: 0 0 1rem; }

/* Links */

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--link) 35%, transparent);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { text-decoration-color: var(--link); }

.site-logo { text-decoration: none; }

/* Lists */

ul { margin: 0 0 1rem; padding-left: 0; list-style: none; }
li { margin-bottom: 0.6rem; }

/* Post */

.post-date {
  color: var(--secondary);
  font-size: 0.8rem;
  margin-left: 0.5rem;
}

.post-content { margin-top: 2rem; }

.post-content ul { padding-left: 1.25rem; list-style: disc; }

.post-content h2,
.post-content h3 {
  font-size: 1.1rem;
  color: var(--text);
  margin: 2rem 0 0.5rem;
}

.post-content p { margin-bottom: 1.25rem; }

.post-content code {
  font-size: 0.85em;
  background: var(--border);
  padding: 0.15em 0.35em;
  border-radius: 3px;
}

.post-content pre {
  background: var(--border);
  padding: 1rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85rem;
}

.post-content pre code { background: none; padding: 0; }

/* Footer */

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--secondary);
  font-size: 0.8rem;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.6rem;
}

.footer-links a {
  color: var(--secondary);
  text-decoration-color: color-mix(in srgb, var(--secondary) 35%, transparent);
}

.footer-links a:hover {
  color: var(--link);
  text-decoration-color: var(--link);
}
