:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1d1d1f;
  --muted: #5f6368;
  --line: #e4e2dc;
  --accent: #2f5d8a;
  --accent-soft: #e8eef5;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141517;
    --surface: #1c1e21;
    --text: #e8e8ea;
    --muted: #9aa0a6;
    --line: #2e3034;
    --accent: #8fb6e0;
    --accent-soft: #23303d;
  }
}

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

body {
  background: var(--bg);
  color: var(--text);
  font: 17px/1.65 "Inter", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 16px 64px;
}

.lang {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  font-size: 14px;
  margin-bottom: 32px;
}
.lang a {
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
}
.lang a.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.lang a:hover { text-decoration: none; }

header h1 {
  font-size: clamp(32px, 6vw, 44px);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
header .tagline {
  color: var(--muted);
  font-size: 19px;
  margin-top: 8px;
}
header .links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 16px;
  font-size: 15px;
}

.lead {
  margin: 40px 0;
  padding: 24px 28px;
  background: var(--surface);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.6;
}

section { margin-top: 48px; }
section > h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
section > p { margin-bottom: 14px; }

.chapter {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 16px;
}
.chapter h3 { font-size: 18px; margin-bottom: 4px; }
.chapter .where { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.chapter p { margin-bottom: 8px; }
.chapter p:last-child { margin-bottom: 0; }

.notes { list-style: none; }
.notes li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.notes li:last-child { border-bottom: 0; }
.notes strong { display: block; margin-bottom: 2px; }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tags span {
  background: var(--accent-soft);
  color: var(--text);
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 999px;
}

footer {
  margin-top: 56px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

@media print {
  body { background: #fff; color: #000; }
  .lang { display: none; }
  .chapter, .lead { border-color: #ccc; background: #fff; }
}
