:root {
  --ink: #173228;
  --muted: #5b6e65;
  --forest: #174a35;
  --leaf: #2f7652;
  --lime: #d8efaa;
  --cream: #f5f2e8;
  --paper: #fffdf7;
  --clay: #c66a45;
  --line: #ccd7cd;
  --blueprint: rgba(23, 74, 53, 0.07);
  --shadow: 0 18px 50px rgba(23, 50, 40, 0.11);
  --radius: 18px;
  --wrap: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--forest);
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--clay);
}

img,
svg {
  display: block;
  max-width: 100%;
}

.wrap {
  width: min(calc(100% - 2rem), var(--wrap));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 100;
  padding: 0.65rem 1rem;
  color: white;
  background: var(--forest);
  border-radius: 6px;
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(23, 74, 53, 0.16);
  background: rgba(255, 253, 247, 0.94);
  backdrop-filter: blur(14px);
}

.header-row {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  font-size: 1.18rem;
  letter-spacing: -0.025em;
  text-decoration: none;
  white-space: nowrap;
}

.brand strong {
  color: var(--leaf);
}

.brand-mark {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: var(--leaf);
  stroke-width: 2.3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.8rem);
  font-size: 0.9rem;
  font-weight: 650;
}

.primary-nav a {
  color: var(--ink);
  text-decoration: none;
}

.primary-nav a:hover {
  color: var(--leaf);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(3.5rem, 7vw, 6rem);
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--blueprint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint) 1px, transparent 1px);
  background-size: 32px 32px;
}

.hero::after {
  content: "";
  position: absolute;
  width: min(48vw, 620px);
  aspect-ratio: 1;
  right: -12%;
  bottom: -65%;
  border: 2px solid rgba(47, 118, 82, 0.2);
  border-radius: 50%;
  box-shadow: 0 0 0 52px rgba(47, 118, 82, 0.04), 0 0 0 104px rgba(47, 118, 82, 0.03);
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.7fr);
  align-items: end;
  gap: clamp(2rem, 6vw, 6rem);
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--leaf);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 900px;
  margin-bottom: 1.25rem;
  font-size: clamp(2.7rem, 7vw, 6.4rem);
}

h2 {
  margin-bottom: 1rem;
  font-size: clamp(2rem, 4vw, 3.5rem);
}

h3 {
  margin-bottom: 0.65rem;
  font-size: 1.45rem;
}

.lede {
  max-width: 760px;
  margin: 0;
  color: #385247;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.hero-note {
  padding: 1.35rem;
  border: 1px solid rgba(23, 74, 53, 0.24);
  background: rgba(255, 253, 247, 0.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-note p {
  margin: 0;
}

.hero-note strong {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--forest);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
}

.section {
  padding: clamp(3.5rem, 7vw, 6.5rem) 0;
}

.section-soft {
  background: var(--cream);
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(280px, 1fr);
  align-items: end;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

.section-heading > * {
  margin-bottom: 0;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.topic-card {
  position: relative;
  min-height: 245px;
  padding: 1.5rem;
  color: var(--ink);
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.topic-card:hover {
  color: var(--ink);
  border-color: var(--leaf);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.topic-card::after {
  content: "→";
  position: absolute;
  right: 1.5rem;
  bottom: 1.25rem;
  color: var(--leaf);
  font-size: 1.5rem;
}

.topic-card .number {
  display: block;
  margin-bottom: 2.7rem;
  color: var(--leaf);
  font: 700 0.75rem/1 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.08em;
}

.topic-card p {
  margin: 0;
  color: var(--muted);
}

.principles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 2rem;
}

.principle {
  border-top: 3px solid var(--lime);
  padding-top: 1.25rem;
}

.principle p {
  color: var(--muted);
}

.page-hero {
  padding: clamp(3.5rem, 7vw, 6.2rem) 0 3.2rem;
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--blueprint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint) 1px, transparent 1px);
  background-size: 32px 32px;
}

.page-hero h1 {
  max-width: 820px;
  font-size: clamp(2.8rem, 6vw, 5.2rem);
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: clamp(2.5rem, 7vw, 6rem);
  align-items: start;
}

.prose {
  max-width: 760px;
}

.prose h2 {
  margin-top: 2.5rem;
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.prose h3 {
  margin-top: 2rem;
}

.prose p,
.prose li {
  color: #334b41;
}

.prose ul {
  padding-left: 1.25rem;
}

.prose li + li {
  margin-top: 0.55rem;
}

.side-note {
  position: sticky;
  top: 100px;
  padding: 1.35rem;
  border-left: 4px solid var(--lime);
  background: var(--cream);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.side-note h2 {
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.side-note p,
.side-note ul {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.link-list {
  display: grid;
  gap: 0.65rem;
  padding: 0;
  list-style: none;
}

.link-list a {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  font-weight: 700;
  text-decoration: none;
}

.callout {
  margin-top: 2.5rem;
  padding: 1.5rem;
  color: white;
  background: var(--forest);
  border-radius: var(--radius);
}

.callout h2,
.callout p {
  color: white;
}

.callout a {
  color: var(--lime);
}

.library-entry {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--line);
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.library-entry h2 {
  margin-top: 0;
}

.library-entry h2 a {
  color: var(--ink);
  text-decoration: none;
}

.library-entry-link {
  font-weight: 750;
}

.breadcrumbs {
  display: flex;
  gap: 0.55rem;
  padding-block: 1rem;
  color: var(--muted);
  font-size: 0.86rem;
}

.breadcrumbs a {
  color: var(--muted);
}

.reference-hero {
  padding: clamp(3rem, 7vw, 6rem) 0;
  border-block: 1px solid var(--line);
  background-color: var(--cream);
  background-image:
    linear-gradient(var(--blueprint) 1px, transparent 1px),
    linear-gradient(90deg, var(--blueprint) 1px, transparent 1px);
  background-size: 32px 32px;
}

.reference-hero h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(3rem, 7vw, 6rem);
}

.botanical-name {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0 0 1.5rem;
  color: var(--leaf);
  font-size: 1.05rem;
}

.botanical-name span {
  color: var(--muted);
}

.reference-review {
  margin: 1.25rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.reference-summary {
  padding: 2.5rem 0;
  border-bottom: 1px solid var(--line);
}

.reference-summary h2 {
  margin-bottom: 1.5rem;
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.reference-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
  border-radius: var(--radius);
}

.reference-fact {
  min-height: 118px;
  padding: 1.1rem;
  background: white;
}

.reference-fact dt {
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.reference-fact dd {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.18rem;
  line-height: 1.2;
}

.reference-fact dd span {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 0.78rem;
  line-height: 1.35;
}

.reference-layout {
  display: grid;
  grid-template-columns: minmax(0, 760px) minmax(240px, 300px);
  justify-content: space-between;
  gap: clamp(3rem, 8vw, 7rem);
  align-items: start;
}

.reference-prose {
  max-width: none;
}

.reference-prose h2,
.reference-prose h3 {
  scroll-margin-top: 105px;
}

.reference-prose > h2:first-child {
  margin-top: 0;
}

.reference-prose table {
  width: 100%;
  margin: 1.5rem 0 2rem;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.reference-prose th,
.reference-prose td {
  padding: 0.8rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.reference-prose th {
  color: var(--ink);
  background: var(--cream);
}

.reference-prose blockquote {
  margin: 2rem 0;
  padding: 0.2rem 0 0.2rem 1.25rem;
  border-left: 4px solid var(--lime);
}

.reference-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: 1rem;
}

.reference-sidebar-block {
  padding: 1.25rem;
  border: 1px solid var(--line);
  background: var(--cream);
  border-radius: var(--radius);
}

.reference-sidebar h2 {
  margin-bottom: 0.8rem;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.reference-sidebar p,
.reference-sidebar li,
.reference-sidebar a {
  font-size: 0.86rem;
}

.reference-sidebar p {
  color: var(--muted);
}

.reference-sidebar .toc > ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.reference-sidebar .toc ul ul {
  display: none;
}

.reference-sidebar .toc li + li {
  margin-top: 0.45rem;
}

.reference-sidebar .toc a {
  text-decoration: none;
}

.site-footer {
  padding: 3rem 0 1.5rem;
  color: #dbe8de;
  background: #102d21;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
}

.footer-grid p {
  max-width: 560px;
  margin: 0.4rem 0 0;
}

.footer-brand {
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
}

.footer-grid nav {
  display: flex;
  gap: 1.5rem;
}

.footer-grid a {
  color: white;
}

.copyright {
  width: min(calc(100% - 2rem), var(--wrap));
  margin: 2.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  color: #abc0b2;
  font-size: 0.82rem;
}

@media (max-width: 900px) {
  .header-row {
    min-height: auto;
    padding: 0.85rem 0;
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }

  .primary-nav {
    width: 100%;
    padding-bottom: 0.2rem;
    overflow-x: auto;
  }

  .hero-grid,
  .section-heading,
  .content-layout,
  .reference-layout {
    grid-template-columns: 1fr;
  }

  .hero-note {
    max-width: 520px;
  }

  .card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .side-note {
    position: static;
  }

  .reference-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reference-sidebar {
    position: static;
    grid-row: 1;
  }
}

@media (max-width: 620px) {
  .primary-nav {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 0.35rem 1.1rem;
    font-size: 0.82rem;
    overflow: visible;
  }

  .hero {
    padding-top: 3.2rem;
  }

  .card-grid,
  .principles,
  .footer-grid,
  .reference-facts {
    grid-template-columns: 1fr;
  }

  .reference-prose {
    overflow-wrap: anywhere;
  }

  .reference-prose table {
    display: block;
    overflow-x: auto;
  }

  .topic-card {
    min-height: 210px;
  }

  .footer-grid nav {
    flex-wrap: wrap;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
