:root {
  --bark: #4a3728;
  --bark-deep: #2f2218;
  --moss: #5f7f5a;
  --fern: #3d6b4f;
  --leaf: #8fbc6a;
  --leaf-bright: #b8d96e;
  --parchment: #f6f1e6;
  --parchment-dark: #e8dfd0;
  --sky: #d4e8e0;
  --ink: #2a2520;
  --muted: #5c5348;
  --radius: 18px;
  --shadow: 0 12px 40px rgba(47, 34, 24, 0.12);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 100;
  padding: 10px 16px;
  background: var(--bark-deep);
  color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  left: 12px;
  top: 0;
}

:focus-visible {
  outline: 2px solid var(--fern);
  outline-offset: 2px;
}

body {
  margin: 0;
  font-family: "Source Sans 3", system-ui, sans-serif;
  color: var(--ink);
  background: var(--parchment);
  line-height: 1.6;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(143, 188, 106, 0.35), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 20%, rgba(61, 107, 79, 0.15), transparent 50%),
    linear-gradient(180deg, var(--sky) 0%, var(--parchment) 42%, var(--parchment-dark) 100%);
}

h1,
h2,
h3,
.brand {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: var(--fern);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--bark);
}

.wrap {
  width: min(1080px, 92vw);
  margin: 0 auto;
}

/* Floating leaves canvas */
.leaf-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(246, 241, 230, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(74, 55, 40, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--bark-deep);
  text-decoration: none;
  font-size: 1.15rem;
}

.brand:hover {
  color: var(--fern);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 12%;
  background: linear-gradient(145deg, var(--leaf-bright), var(--fern));
  box-shadow: inset 0 -4px 8px rgba(47, 34, 24, 0.15);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 999px;
  transition: background 0.2s, color 0.2s;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--bark-deep);
  background: rgba(143, 188, 106, 0.25);
}

.trust-strip {
  background: rgba(61, 107, 79, 0.12);
  border-bottom: 1px solid rgba(61, 107, 79, 0.2);
  padding: 8px 0;
  font-size: 0.85rem;
  color: var(--muted);
  text-align: center;
}

.trust-strip p {
  margin: 0;
}

.hero {
  padding: 48px 0 32px;
  position: relative;
}

.hero-tree {
  position: absolute;
  right: 0;
  top: 20px;
  width: min(280px, 40vw);
  opacity: 0.9;
  pointer-events: none;
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 2.75rem);
  margin: 0 0 12px;
  color: var(--bark-deep);
  max-width: 16ch;
}

.lead {
  font-size: 1.12rem;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 20px;
}

.panel {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(74, 55, 40, 0.1);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.panel-branch {
  border-left: 4px solid var(--leaf);
}

.disclaimer {
  font-size: 0.92rem;
}

.section {
  padding: 28px 0;
}

.section h2 {
  margin: 0 0 14px;
  color: var(--bark-deep);
}

/* Interactive topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.topic-card {
  background: #fff;
  border: 1px solid rgba(74, 55, 40, 0.1);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
}

.topic-card:hover,
.topic-card.is-open {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.topic-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 16px 12px;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.topic-card__head h3 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--bark-deep);
}

.topic-card__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--leaf-bright);
  color: var(--bark-deep);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.topic-card.is-open .topic-card__icon {
  transform: rotate(45deg);
}

.topic-card__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.topic-card.is-open .topic-card__body {
  max-height: 180px;
}

.topic-card__body-inner {
  padding: 0 16px 16px;
  font-size: 0.92rem;
  color: var(--muted);
}

.topic-card__body-inner a {
  font-weight: 600;
}

.pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(95, 127, 90, 0.2);
  color: var(--fern);
  margin-bottom: 8px;
}

/* Resources lazy cards */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

@media (max-width: 820px) {
  .grid-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .grid-cards {
    grid-template-columns: 1fr;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    width: 100%;
    justify-content: flex-start;
  }
}

.card {
  border-radius: var(--radius);
  border: 1px solid rgba(74, 55, 40, 0.12);
  background: #fff;
  padding: 14px;
  min-height: 120px;
  position: relative;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.card.is-loaded {
  opacity: 1;
  transform: translateY(0);
}

.card .skeleton {
  position: absolute;
  inset: 14px;
  border-radius: 10px;
  background: linear-gradient(90deg, var(--parchment-dark), #fff, var(--parchment-dark));
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

.card.is-loaded .skeleton {
  display: none;
}

.card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

@keyframes shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: -100% 0;
  }
}

/* Article layout */
.article-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  padding: 32px 0 48px;
  align-items: start;
}

@media (max-width: 800px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

.toc {
  position: sticky;
  top: 88px;
  background: #fff;
  border: 1px solid rgba(74, 55, 40, 0.1);
  border-radius: var(--radius);
  padding: 14px;
}

.toc strong {
  display: block;
  margin-bottom: 10px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.toc a {
  display: block;
  padding: 6px 0;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.92rem;
}

.toc a:hover,
.toc a.is-active {
  color: var(--fern);
  font-weight: 600;
}

.article-back {
  margin: 0 0 10px;
  font-size: 0.92rem;
}

.article-back a {
  text-decoration: none;
  font-weight: 600;
}

.article-back a:hover {
  text-decoration: underline;
}

.static-page {
  padding-bottom: 48px;
  max-width: 68ch;
}

.static-page h2 {
  margin: 2rem 0 0.75rem;
  color: var(--bark-deep);
  font-size: 1.35rem;
}

.static-page h2:first-child {
  margin-top: 0;
}

.static-page p {
  margin: 0 0 1rem;
}

.static-page ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}

.static-page li + li {
  margin-top: 0.35rem;
}

.static-page .panel + .panel {
  margin-top: 14px;
}

.prose h1 {
  margin-top: 0;
  color: var(--bark-deep);
}

.prose h2 {
  margin-top: 1.6em;
  color: var(--fern);
}

.article-figure {
  margin: 1.25rem 0 1.75rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(74, 55, 40, 0.12);
  box-shadow: var(--shadow);
  background: #fff;
}

.article-figure img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
  background: var(--parchment-dark);
}

.article-figure figcaption {
  padding: 10px 14px;
  font-size: 0.88rem;
  color: var(--muted);
  border-top: 1px solid rgba(74, 55, 40, 0.08);
}

.prose .note-end {
  margin-top: 2rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.related {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 2px dashed rgba(95, 127, 90, 0.35);
}

.site-footer {
  border-top: 2px solid rgba(74, 55, 40, 0.1);
  padding: 24px 0 32px;
  font-size: 0.9rem;
  color: var(--muted);
}

.footer-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.to-top {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--fern);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.to-top.show {
  opacity: 1;
  pointer-events: auto;
}

.to-top:hover {
  transform: scale(1.06);
  background: var(--bark);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .leaf-canvas,
  .reveal,
  .card,
  .topic-card__body {
    transition: none !important;
    animation: none !important;
  }
}
