:root {
  --paper: #E6F0E3;
  --panel: #F7FAF5;
  --ink: #17261D;
  --muted: #44584B;
  --rule: #B5CDB9;
  --mint: #CFE3CF;
  --green: #0F5A3C;
  --green-dark: #0A4029;
  --red: #B3261E;
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background-color: var(--paper);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(96, 140, 106, 0.22) 35px, rgba(96, 140, 106, 0.22) 36px);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--green); color: var(--panel); }

body::before {
  content: "";
  position: fixed;
  top: 0;
  bottom: 0;
  left: clamp(10px, 3vw, 40px);
  width: 5px;
  border-left: 1px solid rgba(179, 38, 30, 0.5);
  border-right: 1px solid rgba(179, 38, 30, 0.5);
  pointer-events: none;
}

.wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding-left: clamp(30px, 6vw, 80px);
  padding-right: clamp(20px, 5vw, 64px);
}

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--ink);
  color: var(--panel);
  padding: 10px 16px;
  z-index: 40;
}
.skip:focus { left: 16px; }

a { color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(230, 240, 227, 0.86);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--rule);
}
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.mark {
  font-family: var(--serif);
  font-size: 1.6rem;
  text-decoration: none;
  letter-spacing: -0.01em;
}
.bar nav {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 32px);
  font-size: 1rem;
}
.bar nav a { text-decoration: none; }
.bar nav a:not(.btn):hover { text-decoration: underline; text-underline-offset: 4px; }

.btn {
  display: inline-block;
  background: var(--green);
  color: var(--panel);
  font-weight: 700;
  text-decoration: none;
  padding: 14px 24px;
  border: 1.5px solid var(--green);
  border-radius: 2px;
  transition: background-color 0.15s ease, transform 0.2s var(--ease);
}
.btn:hover { background: var(--green-dark); border-color: var(--green-dark); }
.btn.btn-small { padding: 9px 16px; font-size: 1rem; }
.textlink {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
}

/* Page frame */
.article-wrap {
  max-width: 880px;
  padding-top: 28px;
  padding-bottom: 72px;
}
.crumbs {
  font-size: 0.95rem;
  color: var(--muted);
  margin-bottom: 28px;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.crumbs span { margin: 0 6px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.1rem, 5vw, 3.2rem); line-height: 1.1; }
.byline {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1rem;
}
.byline a { text-underline-offset: 3px; }

/* The short answer box */
.takeaways {
  margin: 32px 0 0;
  padding: clamp(18px, 3vw, 28px);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.takeaways h2 { font-size: 1.3rem; margin-bottom: 10px; }
.takeaways .answer { margin: 0 0 14px; font-size: 1.15rem; line-height: 1.6; }
.takeaways ul { margin: 0; padding-left: 1.2em; }
.takeaways li { margin: 6px 0; }

.toc {
  margin: 28px 0 0;
  padding: 18px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.toc-title { margin: 0 0 8px; font-weight: 700; font-size: 1rem; }
.toc ol { margin: 0; padding-left: 1.3em; font-size: 1rem; line-height: 1.7; }
.toc a { text-underline-offset: 3px; }

/* Prose */
.prose h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.15;
  margin: 2.4em 0 0.5em;
}
.prose h3 { font-size: 1.3rem; line-height: 1.25; margin: 1.8em 0 0.4em; }
.prose p { margin: 0 0 1.1em; max-width: 42rem; }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; max-width: 42rem; }
.prose li { margin: 0.4em 0; }
.prose a { text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--green); }
.prose blockquote {
  margin: 1.4em 0;
  padding: 14px 20px;
  max-width: 42rem;
  background: var(--panel);
  border-left: 4px solid var(--green);
  font-style: normal;
}
.prose blockquote p { margin: 0; }
.prose strong { font-weight: 700; }

.table-wrap {
  margin: 1.4em 0 1.6em;
  overflow-x: auto;
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.prose table {
  width: 100%;
  min-width: 540px;
  border-collapse: collapse;
  font-size: 1rem;
  line-height: 1.5;
}
.prose th, .prose td {
  text-align: left;
  vertical-align: top;
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
}
.prose th { font-weight: 700; background: var(--mint); border-bottom: 1.5px solid var(--ink); }
.prose tr:last-child td { border-bottom: 0; }

.note {
  margin: 28px 0 0;
  padding: 14px 18px;
  background: var(--panel);
  border: 1px solid var(--rule);
  font-size: 1rem;
  color: var(--muted);
}

/* FAQ */
.faq h2, .sources h2, .related h2, .author h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.1rem);
  line-height: 1.15;
}
.faq { margin-top: 3em; }
.faq h3 { font-size: 1.2rem; line-height: 1.3; margin: 1.6em 0 0.35em; }
.faq p { margin: 0 0 1em; max-width: 42rem; }

.sources { margin-top: 3em; }
.sources ul { padding-left: 1.2em; font-size: 1rem; max-width: 42rem; }
.sources li { margin: 0.5em 0; }

/* Call to action */
.cta {
  margin: 3em 0 0;
  padding: clamp(20px, 4vw, 36px);
  background: var(--panel);
  border: 1.5px solid var(--ink);
  border-radius: 2px;
}
.cta h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); line-height: 1.15; }
.cta p { margin: 12px 0 22px; max-width: 36rem; }
.cta .row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }

.author { margin-top: 3em; padding-top: 24px; border-top: 1.5px solid var(--ink); }
.author p { margin: 10px 0 0; max-width: 42rem; color: var(--muted); }

.related { margin-top: 3em; }
.related ul { list-style: none; margin: 18px 0 0; padding: 0; }
.related li { border-top: 1px solid var(--rule); }
.related li:last-child { border-bottom: 1px solid var(--rule); }
.related a {
  display: block;
  padding: 16px 0;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.3;
}
.related a:hover { color: var(--green); }

/* Guides index */
.index-head { padding-top: 12px; }
.index-head p { margin: 18px 0 0; max-width: 40rem; color: var(--muted); font-size: 1.2rem; }
.cards { list-style: none; margin: 40px 0 0; padding: 0; }
.cards li { border-top: 1px solid var(--rule); }
.cards li:last-child { border-bottom: 1px solid var(--rule); }
.cards a { display: block; padding: 24px 0; text-decoration: none; }
.cards h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); line-height: 1.2; transition: transform 0.3s var(--ease); }
.cards p { margin: 8px 0 0; color: var(--muted); max-width: 42rem; }
.cards .meta { font-size: 0.95rem; margin-top: 10px; }
@media (hover: hover) {
  .cards a:hover h2 { transform: translateX(8px); color: var(--green); }
}

footer {
  border-top: 1.5px solid var(--ink);
  padding-top: 20px;
  padding-bottom: 40px;
  font-size: 0.95rem;
  color: var(--muted);
}
footer a { text-underline-offset: 3px; }

@media (max-width: 560px) {
  body { font-size: 1.0625rem; }
  .bar nav a:not(.btn) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .cards h2 { transition: none; }
}
