:root {
  --bg: #f4efe4;
  --paper: #fffdf8;
  --ink: #1b2430;
  --muted: #5a6573;
  --line: #e2d6c4;
  --teal: #0c6b6b;
  --teal-dark: #084848;
  --gold: #b8893a;
  --navy: #13202e;
  --shadow: 0 18px 50px rgba(19, 32, 46, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(12, 107, 107, 0.08), transparent 50%),
    radial-gradient(900px 400px at 100% 0%, rgba(184, 137, 58, 0.08), transparent 45%),
    var(--bg);
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  line-height: 1.65;
}

img { max-width: 100%; display: block; }

a { color: var(--teal); }

.wrap {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 239, 228, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal), #163a4a);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.15);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.nav a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.95rem;
}

.nav a:hover,
.nav a.active { color: var(--teal-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 600;
}

.btn-primary {
  background: var(--teal);
  color: #fff;
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 40px;
  align-items: center;
  padding: 56px 0 28px;
}

.kicker {
  margin: 0 0 10px;
  color: var(--teal);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1, h2, h3, .serif {
  font-family: "Source Serif 4", Georgia, serif;
  letter-spacing: -0.03em;
}

h1 {
  margin: 0 0 16px;
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  line-height: 1.12;
}

h2 {
  margin: 0 0 12px;
  font-size: 1.85rem;
}

h3 { margin: 28px 0 8px; font-size: 1.28rem; }

.lead {
  font-size: 1.15rem;
  color: var(--muted);
  max-width: 62ch;
}

.hero-art {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.hero-art img { width: 100%; height: 100%; object-fit: cover; }

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.chip {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.88rem;
  color: var(--muted);
}

.section { padding: 42px 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: block;
}

.card:hover { transform: translateY(-2px); }

.num {
  color: var(--gold);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
}

.card p, .prose p { color: #334155; }

.figure {
  margin: 22px 0;
  background: #101923;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #243041;
}

.figure img { width: 100%; }
.figure figcaption,
.caption {
  padding: 12px 16px 16px;
  color: #c9d2dc;
  font-size: 0.92rem;
}

.prose {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px 30px 36px;
  box-shadow: var(--shadow);
}

.formula {
  overflow-x: auto;
  background: #f8f3ea;
  border: 1px dashed #d8c9af;
  border-radius: 14px;
  padding: 8px 16px;
  margin: 16px 0 22px;
}

.note, .warn {
  border-left: 4px solid var(--teal);
  background: #eef7f5;
  padding: 12px 16px;
  border-radius: 0 12px 12px 0;
  margin: 18px 0;
}

.warn {
  border-left-color: var(--gold);
  background: #fff6e6;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 28px;
}

.site-footer {
  margin-top: 40px;
  padding: 28px 0 36px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.toc { columns: 2; padding-left: 18px; }
.toc li { margin: 0 0 6px; }

svg.diagram {
  width: 100%;
  height: auto;
  background: #12202c;
  border-radius: 16px;
}

@media (max-width: 860px) {
  .hero, .cards, .two-col { grid-template-columns: 1fr; }
  .toc { columns: 1; }
  .header-inner { flex-wrap: wrap; padding: 10px 0; }
  .nav { width: 100%; }
}
