:root {
  --text: #1a1a1a;
  --muted: #666;
  --bg: #fafaf8;
  --accent: #4a7c59;
  --max-width: 680px;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.85;
  color: var(--text);
  background: var(--bg);
  padding: 0 1.5rem;
}

header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 0 1.25rem;
  border-bottom: 1px solid #e0e0de;
}

.site-name {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-decoration: none;
}

.site-name:hover {
  color: var(--accent);
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3.5rem 0 4rem;
}

footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 0 3rem;
  border-top: 1px solid #e0e0de;
  font-family: var(--sans);
  font-size: 0.8rem;
  color: var(--muted);
}

/* Index page */
main > h1 {
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text);
}

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

.post-list li {
  border-bottom: 1px solid #ebebea;
}

.post-list a {
  display: block;
  padding: 1rem 0;
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s;
}

.post-list a:hover {
  color: var(--accent);
}

/* Article */
article h1 {
  font-family: var(--sans);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 2.5rem;
  color: var(--text);
}

article p {
  margin-bottom: 1.4em;
}

article p:last-of-type {
  margin-bottom: 0;
}

article h2 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 2.5rem 0 0.75rem;
}

article h3 {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.5rem;
}

article blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.25rem;
  margin: 2rem 0;
  color: var(--muted);
  font-style: italic;
}

article blockquote p {
  margin-bottom: 0.5em;
}

article ul,
article ol {
  margin: 1rem 0 1.5rem 1.5rem;
}

article li {
  margin-bottom: 0.4rem;
}

article a {
  color: var(--accent);
}

.back-link {
  display: inline-block;
  margin-top: 3.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent);
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 1.5rem;
}

.modal-backdrop[aria-hidden="true"] {
  display: none;
}

.modal {
  background: var(--bg);
  border-radius: 4px;
  padding: 2.5rem;
  max-width: 480px;
  width: 100%;
  position: relative;
}

.modal h2 {
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.modal p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.modal p:last-of-type {
  margin-bottom: 0;
}

.modal a {
  color: var(--accent);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  color: var(--muted);
}

.modal-close:hover {
  color: var(--text);
}
