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

:root {
  --bg: #FAFAF8;
  --text: #1a1a1a;
  --muted: #6b6b6b;
  --accent: #2a5a5a;
  --border: #e8e8e4;
  --card-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #131313;
  --text: #e8e6e2;
  --muted: #999;
  --accent: #6aaeae;
  --border: #2a2a2a;
  --card-bg: #1a1a1a;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, system-ui, sans-serif;
  font-weight: 300;
  font-size: 17px;
  line-height: 1.8;
  transition: background 0.3s, color 0.3s;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 28px;
}

nav {
  padding: 40px 0 0;
  font-size: 14px;
  font-weight: 400;
}

header {
  padding: 48px 0 40px;
  border-bottom: 1px solid var(--border);
}

header h1 {
  font-family: 'Instrument Serif', serif;
  font-size: 36px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

header .meta {
  font-size: 14px;
  color: var(--muted);
}

header .intro {
  font-size: 15px;
  color: var(--muted);
  margin-top: 4px;
}

/* Essay body */
article { padding: 40px 0 60px; }

article h2 {
  font-family: 'Instrument Serif', serif;
  font-size: 22px;
  font-weight: 400;
  margin: 40px 0 16px;
  letter-spacing: -0.01em;
}

article p {
  margin-bottom: 16px;
}

article ol, article ul {
  margin: 16px 0;
  padding-left: 24px;
}

article li {
  margin-bottom: 8px;
}

article em { font-style: italic; }
article strong { font-weight: 500; }

article .highlight {
  display: block;
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: var(--accent);
  margin: 32px 0;
  padding: 0;
}

article .consequences {
  margin: 16px 0;
}

article .consequences p {
  margin-bottom: 12px;
}

article .divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

article .endnote {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

/* Index page */
.essay-list {
  list-style: none;
  padding: 40px 0;
}

.essay-list li {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.essay-list li:last-child { border-bottom: none; }

.essay-list .meta {
  font-size: 13px;
  color: var(--muted);
}

.essay-list .desc {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}

.also {
  font-size: 14px;
  color: var(--muted);
  padding-bottom: 60px;
}

footer {
  padding: 32px 0;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

#theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 100;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  transition: border-color 0.3s, background 0.3s;
}
#theme-toggle:hover { border-color: var(--accent); }

.edit-link {
  margin-top: 48px;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  opacity: 0.3;
}
.edit-link:hover {
  opacity: 0.8;
}

@media (max-width: 540px) {
  .wrap { padding: 0 20px; }
  header h1 { font-size: 28px; }
}
