:root {
  --ink: #2f241b;
  --muted: #6f5e4d;
  --cream: #fff9ea;
  --paper: rgba(255, 252, 238, 0.96);
  --fern: #315f43;
  --fern-dark: #214331;
  --ember: #ad4f2f;
  --gold: #d39b36;
  --line: rgba(70, 91, 56, 0.22);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: #dce8ca;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font:
    16px/1.65 system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  background:
    radial-gradient(
      circle at 10% 4%,
      rgba(255, 210, 112, 0.35),
      transparent 28rem
    ),
    radial-gradient(
      circle at 92% 8%,
      rgba(63, 112, 76, 0.25),
      transparent 26rem
    ),
    linear-gradient(180deg, #f6e7bd 0%, #dce8ca 45%, #bfd4b6 100%);
}

a {
  color: var(--ember);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.14em;
}

.wrap {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 249, 234, 0.92);
  backdrop-filter: blur(12px);
}

.site-header .wrap,
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  color: var(--fern-dark);
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50% 46% 52% 44%;
  color: #fff8e9;
  background: linear-gradient(145deg, var(--ember), #7c3928);
  box-shadow: 0 5px 14px rgba(80, 45, 24, 0.2);
  font-size: 0.82rem;
}

.nav,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 0.92rem;
  font-weight: 750;
}

.nav a,
.footer-links a {
  color: var(--fern-dark);
}

.nav a[aria-current="page"] {
  color: var(--ember);
  font-weight: 900;
}

main {
  padding: 42px 0 72px;
}

.doc,
.hero {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(52, 66, 42, 0.2);
  padding: clamp(24px, 5vw, 50px);
}

.hero {
  text-align: center;
}

h1,
h2,
h3 {
  color: var(--fern-dark);
  line-height: 1.18;
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

h2 {
  margin: 34px 0 10px;
  font-size: 1.42rem;
  scroll-margin-top: 88px;
}

h3 {
  margin: 22px 0 7px;
  font-size: 1.1rem;
}

.updated,
.note {
  color: var(--muted);
}

.updated {
  margin: 0 0 24px;
  font-weight: 700;
}

.lead {
  font-size: 1.08rem;
}

.actions,
.link-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin: 26px 0 0;
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border: 1px solid rgba(88, 68, 36, 0.28);
  border-radius: 999px;
  color: #fff9ea;
  background: linear-gradient(145deg, var(--fern), var(--fern-dark));
  font-weight: 850;
  text-decoration: none;
}

.btn.secondary {
  color: var(--fern-dark);
  background: #fff7dc;
}

.toc,
.callout {
  margin: 22px 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(225, 236, 207, 0.55);
}

.toc h2 {
  margin: 0 0 8px;
  color: var(--ember);
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding-left: 1.3em;
  columns: 2;
  column-gap: 30px;
}

.toc li {
  break-inside: avoid;
  margin-bottom: 5px;
}

table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
}

th,
td {
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

footer {
  padding: 26px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(255, 249, 234, 0.55);
}

@media (max-width: 680px) {
  .toc ol {
    columns: 1;
  }
}

@media print {
  .site-header,
  footer,
  .actions {
    display: none;
  }

  body,
  .doc {
    background: #fff;
    box-shadow: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
