:root {
  color-scheme: light dark;
  --fg: #111;
  --bg: #fff;
  --muted: #666;
  --max-width: 720px;
  --wide-max-width: 1180px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fg: #eee;
    --bg: #111;
    --muted: #999;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.6;
}

.site-header,
main,
.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
}

.wide .site-header,
.wide main,
.wide .site-footer {
  max-width: var(--wide-max-width);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 0 1rem;
}

.site-title {
  font-weight: 600;
  text-decoration: none;
  color: var(--fg);
  font-size: 1.1rem;
}

.site-header nav a {
  color: var(--fg);
  text-decoration: none;
}

.tagline {
  font-size: 2.5rem;
  font-weight: 300;
  margin: 1rem 0 2.5rem;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list-item {
  margin-bottom: 2.5rem;
}

.post-list-item h2 {
  margin: 0 0 0.25rem;
  font-size: 1.4rem;
}

.post-list-item h2 a,
article.post h1 {
  text-decoration: none;
  color: var(--fg);
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.post-meta a {
  color: var(--muted);
}

.post-excerpt {
  margin: 0;
}

.post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2.5rem 2rem;
  list-style: none;
  padding: 0;
  margin: 0 0 3rem;
}

.post-grid-item {
  min-width: 0;
}

@media (max-width: 900px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .post-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.post-grid-item h2 {
  margin: 0 0 0.4rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.post-grid-item h2 a {
  text-decoration: none;
  color: var(--fg);
}

.post-grid-item h2 a:hover {
  text-decoration: underline;
}

.post-grid-item .post-meta {
  font-size: 0.8rem;
  margin: 0 0 0.6rem;
}

.post-grid-item .post-excerpt {
  color: var(--muted);
  font-size: 0.95rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

article.post {
  max-width: var(--max-width);
  margin: 0 auto;
}

article.post img {
  max-width: 100%;
  height: auto;
}

.site-footer {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 3rem 0 2rem;
}
