:root {
  --paper: #fbf7ee;
  --paper-deep: #f1eadc;
  --ink: #1f2523;
  --muted: #5f6762;
  --line: #d8cfbf;
  --green: #245c43;
  --green-soft: #dfece4;
  --blue: #274d67;
  --gold: #a36d25;
  --card: #fffdf7;
  --shadow: 0 18px 45px rgba(31, 37, 35, 0.10);
  --radius: 22px;
  --max: 1120px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(36, 92, 67, .12), transparent 32rem),
    linear-gradient(180deg, var(--paper), #f7f1e6 62%, var(--paper-deep));
  line-height: 1.65;
}

a { color: var(--green); text-decoration-thickness: 0.09em; text-underline-offset: 0.18em; }
a:hover { color: var(--blue); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 247, 238, 0.92);
  border-bottom: 1px solid rgba(216, 207, 191, 0.82);
  backdrop-filter: blur(14px);
}

.nav-wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--ink);
  text-decoration: none;
  font-weight: 850;
  letter-spacing: -0.03em;
}

.logo-mark {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--green);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 1.25rem;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  color: var(--ink);
  cursor: pointer;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 720;
  font-size: 0.92rem;
  padding: 0.55rem 0.72rem;
  border-radius: 999px;
}

.primary-nav a:hover,
.primary-nav a[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green);
}

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 4.7rem 1.2rem 2.6rem;
  display: grid;
  grid-template-columns: 1.18fr .82fr;
  gap: 2rem;
  align-items: center;
}

.eyebrow {
  margin: 0 0 0.7rem;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3 {
  line-height: 1.12;
  letter-spacing: -0.045em;
}

h1 {
  margin: 0;
  font-size: clamp(2.55rem, 7vw, 5.4rem);
  max-width: 12ch;
}

.hero p.lead,
.page-intro p.lead {
  color: var(--muted);
  font-size: clamp(1.08rem, 2.1vw, 1.35rem);
  max-width: 62ch;
}

.hero-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: var(--shadow);
}

.word-stack {
  display: grid;
  gap: .75rem;
  margin: 1rem 0;
}

.word-chip {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  background: #f6efe3;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.word-chip strong { font-size: 1.05rem; }
.word-chip span { color: var(--muted); }

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
  margin-top: 1.35rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: .82rem 1rem;
  font-weight: 800;
  text-decoration: none;
  border: 1px solid var(--green);
}

.button.primary { background: var(--green); color: #fff; }
.button.secondary { color: var(--green); background: transparent; }

main { max-width: var(--max); margin: 0 auto; padding: 0 1.2rem 4rem; }

.page-intro {
  padding: 4.2rem 0 1.5rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 2rem;
}

.page-intro h1 { max-width: 16ch; }

.section {
  margin: 2rem 0;
}

.grid {
  display: grid;
  gap: 1rem;
}

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

.card {
  background: rgba(255, 253, 247, .86);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 10px 25px rgba(31, 37, 35, 0.06);
}

.card h2, .card h3 { margin-top: 0; }

.kicker {
  display: inline-block;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}

.example {
  border-left: 5px solid var(--green);
  background: var(--green-soft);
  border-radius: 0 18px 18px 0;
  padding: 1rem 1.1rem;
  margin: 1.1rem 0;
}

.example code,
.inline-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: rgba(36, 92, 67, .10);
  border: 1px solid rgba(36, 92, 67, .18);
  border-radius: 8px;
  padding: .1rem .35rem;
}

.table-wrap { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

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

th { background: #efe5d4; }
tr:last-child td { border-bottom: 0; }

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

.source-card {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  padding: 1rem;
}

.source-card a { font-weight: 850; }
.source-card p { color: var(--muted); margin-bottom: 0; font-size: .93rem; }

.callout {
  background: #213d34;
  color: #fff;
  border-radius: var(--radius);
  padding: 1.45rem;
  margin: 2rem 0;
}

.callout a { color: #fff; }
.callout p { color: rgba(255,255,255,.86); }

.site-footer {
  background: #17231f;
  color: #fff;
  padding: 2.2rem 1.2rem;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .8rem;
}

.footer-links a { color: #fff; }

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  width: 2.85rem;
  height: 2.85rem;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: .2s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 3rem; }
  .grid.two, .grid.three, .source-list { grid-template-columns: 1fr; }
  .nav-toggle { display: inline-flex; }
  .primary-nav {
    display: none;
    position: absolute;
    left: 1rem;
    right: 1rem;
    top: 4.3rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: .75rem;
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
  }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: .72rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-links { justify-content: flex-start; }
}
