:root {
  --bg: #f7f5ef;
  --surface: #ffffff;
  --ink: #1f2a2e;
  --muted: #647174;
  --line: #d8dedb;
  --accent: #267365;
  --accent-strong: #17594f;
  --accent-soft: #e5f1ed;
  --warn: #8a5a18;
  --shadow: 0 16px 40px rgba(31, 42, 46, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

a:hover {
  text-decoration: underline;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 245, 239, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: white;
}

.top-nav {
  display: flex;
  gap: 20px;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: var(--ink);
}

.side-nav {
  position: fixed;
  top: 96px;
  left: 24px;
  width: 260px;
  max-height: calc(100vh - 120px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.side-nav p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.side-nav a {
  display: block;
  padding: 8px 0;
  border-top: 1px solid #eef1ef;
  color: var(--ink);
  font-size: 0.92rem;
}

.page-shell {
  width: auto;
  margin: 0 32px 0 320px;
}

.home-shell {
  width: min(100% - 64px, 1360px);
  margin: 0 auto;
}

.hero {
  display: block;
  min-height: calc(100vh - 72px);
  padding: 48px 0 56px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 640px;
  padding: 64px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(23, 89, 79, 0.82), rgba(23, 89, 79, 0.82)),
    url("https://images.unsplash.com/photo-1551836022-d5d88e9218df?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: white;
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #d9f2ea;
}

h1,
h2,
h3 {
  line-height: 1.15;
}

h1 {
  max-width: 850px;
  margin: 0;
  font-size: clamp(2.4rem, 5vw, 5.2rem);
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.8rem, 3vw, 3rem);
}

h3 {
  margin: 26px 0 10px;
  font-size: 1.12rem;
}

.hero p {
  max-width: 760px;
  font-size: 1.15rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-weight: 800;
}

.button.primary {
  background: white;
  color: var(--accent-strong);
}

.button.secondary {
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: white;
}

.section,
.wiki-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section,
.wiki-section {
  margin: 28px 0;
  padding: 42px;
  scroll-margin-top: 96px;
}

.intro {
  margin-top: 0;
}

.topic-grid,
.resource-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 24px;
}

.topic-card,
.resource-grid div {
  min-height: 150px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
}

.topic-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: var(--ink);
}

.topic-card span {
  color: var(--accent-strong);
  font-size: 1.12rem;
  font-weight: 900;
}

.topic-card small {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 16px;
  color: var(--muted);
  font-weight: 700;
}

.topic-page {
  padding-bottom: 20px;
}

.topic-hero {
  margin-bottom: 22px;
  padding: 42px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(23, 89, 79, 0.86), rgba(23, 89, 79, 0.86)),
    url("https://images.unsplash.com/photo-1497366754035-f200968a6e72?auto=format&fit=crop&w=1600&q=80") center/cover;
  color: white;
  box-shadow: var(--shadow);
}

.topic-hero .eyebrow {
  color: #d9f2ea;
}

.topic-hero h1 {
  font-size: clamp(2rem, 4vw, 4rem);
}

.topic-hero p {
  max-width: 820px;
  font-size: 1.08rem;
}

.article-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.article-toc a {
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.92rem;
  font-weight: 800;
}

.article-section {
  margin: 22px 0;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  scroll-margin-top: 96px;
}

.article-section h2 {
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: clamp(1.45rem, 2.5vw, 2.2rem);
}

.article-section p,
.article-section li,
.bibliography li,
.bibliography a {
  overflow-wrap: anywhere;
}

.article-section ul {
  padding-left: 22px;
}

.resource-link {
  display: block;
  margin: 10px 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  font-weight: 800;
}

.section-heading {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: 32px;
  align-items: start;
}

article ul,
.bibliography ul {
  padding-left: 20px;
}

.resources {
  position: sticky;
  top: 96px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfb;
}

.resources a {
  display: block;
  margin: 10px 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.pending {
  color: var(--warn);
  font-weight: 700;
}

.video-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.video-link {
  position: relative;
  display: block;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 800;
}

.video-link::before {
  content: "▶";
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--accent);
  font-size: 0.9rem;
}

footer {
  display: flex;
  justify-content: space-between;
  width: min(100% - 64px, 1360px);
  margin: 32px auto 0;
  padding: 26px 0 42px;
  color: var(--muted);
}

.page-shell + footer,
body:has(.page-shell) footer {
  width: auto;
  margin: 32px 32px 0 320px;
}

@media (max-width: 1120px) {
  .side-nav {
    display: none;
  }

  .page-shell,
  footer {
    width: min(100% - 40px, 1100px);
    margin-inline: auto;
  }

  .home-shell {
    width: min(100% - 40px, 1100px);
  }

  .page-shell + footer,
  body:has(.page-shell) footer {
    width: min(100% - 40px, 1100px);
    margin-inline: auto;
  }
}

@media (max-width: 820px) {
  .site-header {
    padding: 0 18px;
  }

  .menu-toggle {
    display: flex;
  }

  .top-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    padding: 18px;
    border-bottom: 1px solid var(--line);
    background: var(--surface);
  }

  .top-nav.open {
    display: flex;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 28px 0;
  }

  .hero-content,
  .section,
  .wiki-section {
    padding: 24px;
  }

  .hero-content {
    min-height: 520px;
  }

  .content-layout,
  .topic-grid,
  .resource-grid {
    grid-template-columns: 1fr;
  }

  .topic-hero,
  .article-section {
    padding: 24px;
  }

  .resources {
    position: static;
  }

  footer {
    flex-direction: column;
    gap: 8px;
  }
}
