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

:root {
  --text: #1a1a1a;
  --muted: #666;
  --link: #1a1a1a;
  --bg: #fff;
  --max-width: 660px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

html {
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font);
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */

header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 2.5rem 0 1.5rem;
  border-bottom: 1px solid #e8e8e8;
  margin-bottom: 2.5rem;
}

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

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

nav a:hover,
nav a.active {
  color: var(--text);
}

/* Main */

main {
  min-height: 60vh;
}

h1 {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  line-height: 1.3;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

p {
  margin: 0 0 1.2rem;
}

a {
  color: var(--link);
}

hr {
  border: none;
  border-top: 1px solid #e8e8e8;
  margin: 2rem 0;
}

/* Index / essay list */

.intro {
  margin-bottom: 3rem;
}

.intro p {
  color: var(--muted);
}

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

.post-list li {
  padding: 1.4rem 0;
  border-bottom: 1px solid #e8e8e8;
}

.post-list li:first-child {
  border-top: 1px solid #e8e8e8;
}

.post-list a {
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
}

.post-list a:hover {
  text-decoration: underline;
}

.post-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.post-summary {
  font-size: 0.92rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* Tags */

.tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.78rem;
  background: #f3f3f3;
  color: var(--muted);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  letter-spacing: 0.01em;
}

/* Tag filter */

.tag-filter {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.tag-filter button {
  font-size: 0.82rem;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--muted);
  padding: 0.2rem 0.65rem;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--font);
}

.tag-filter button:hover,
.tag-filter button.active {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

/* Post */

.post-header {
  margin-bottom: 0.5rem;
}

.post-content {
  font-size: 1rem;
}

.post-content p {
  margin: 0 0 1.4rem;
}

.post-content h2 {
  margin-top: 2.5rem;
}

/* About */

.about h1 {
  margin-bottom: 1.5rem;
}

/* Footer */

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

footer p {
  margin: 0.5rem 0 0;
}

footer a {
  color: var(--muted);
}

/* Responsive */

@media (max-width: 480px) {
  header {
    flex-direction: column;
    gap: 0.75rem;
  }
  nav {
    gap: 1rem;
  }
}
