:root {
  --ink: #16202b;
  --muted: #3e4e5c;
  --paper: #f3f0e8;
  --card: #fffcf8;
  --line: #e3d9c8;
  --green: #0b6246;
  --green-dark: #084433;
  --green-soft: #e5f3ec;
  --amber-bg: #fbf3e4;
  --amber-ink: #6a4710;
  --focus: #0b6246;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --sans: "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --max: 1120px;
  --header: 4.25rem;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.0625rem;
  color-scheme: light;
}

body.has-cookie { padding-bottom: 8rem; }

img, svg { max-width: 100%; }

a { color: var(--green-dark); }

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

::selection { background: #cfe5da; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--ink);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
  border-radius: 8px;
}

.skip-link:focus { top: 1rem; color: #fff; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.topbar {
  background: var(--green-dark);
  color: #f3f0e8;
  font-size: 0.9rem;
  text-align: center;
  padding: 0.55rem 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243, 240, 232, 0.96);
  border-bottom: 3px solid var(--green);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--header);
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}

.logo:hover { color: var(--green-dark); }

.logo-mark {
  width: 2rem;
  height: 2rem;
  flex: none;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--card);
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.9rem;
  border-radius: 999px;
  font: inherit;
  color: var(--ink);
  cursor: pointer;
}

.nav {
  display: flex;
  gap: 0.15rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  font-size: 0.98rem;
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--green-soft);
  color: var(--green-dark);
  text-decoration: underline;
  text-underline-offset: 0.22rem;
}

main { min-height: 52vh; }

.hero { padding: 3.2rem 0 1.4rem; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 2rem;
  align-items: end;
}

.kicker {
  color: var(--green);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  margin: 0 0 0.75rem;
}

h1, h2, h3 {
  font-family: var(--serif);
  line-height: 1.22;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.05rem, 4.2vw, 3.35rem);
  margin: 0 0 1rem;
}

h2 { font-size: clamp(1.55rem, 2.5vw, 2.05rem); }

.lead {
  font-size: 1.2rem;
  color: var(--muted);
  max-width: 42rem;
  margin: 0 0 1.5rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.7rem 1.15rem;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  border: 2px solid var(--green);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.button:hover {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.button.secondary {
  background: transparent;
  color: var(--green-dark);
}

.button.secondary:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}

.edition {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 1.15rem 1.25rem 1.25rem;
}

.edition ol {
  margin: 0;
  padding-left: 1.25rem;
}

.edition li { margin: 0.55rem 0; }

.edition a { color: var(--ink); }

.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.75rem;
  padding-bottom: 2.2rem;
}

.trust article,
.card,
.side,
.toc,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(22, 32, 43, 0.04);
}

.trust article { padding: 1rem 1.05rem; }

.trust h2,
.card h2,
.card h3 {
  font-family: var(--sans);
  font-size: 1.02rem;
  letter-spacing: 0;
  margin: 0 0 0.35rem;
}

.trust p,
.card p { margin: 0; color: var(--muted); }

.section { padding: 0.4rem 0 2.6rem; }

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.section-head h2,
.page-hero h1 { margin-bottom: 0.4rem; }

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.card { padding: 1.05rem 1.1rem 1.15rem; }

.card .tag,
.tag {
  color: var(--green);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.card h3 {
  font-family: var(--serif);
  font-size: 1.28rem;
  margin: 0.45rem 0;
  letter-spacing: -0.02em;
}

.card a.title {
  color: var(--ink);
  text-decoration: none;
}

.card a.title:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

.meta { color: var(--muted); font-size: 0.9rem; margin: 0.35rem 0 0; }

.page-hero { padding: 2.3rem 0 0.4rem; }

.crumbs {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 0 0 0.8rem;
}

.crumbs a { color: var(--muted); }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 44rem) minmax(15rem, 1fr);
  gap: 1.6rem;
  align-items: start;
  padding: 1.4rem 0 3rem;
}

.prose { max-width: 44rem; }

.prose h2 { margin: 2rem 0 0.55rem; font-size: 1.65rem; }

.prose h3 { margin: 1.35rem 0 0.4rem; font-size: 1.22rem; }

.prose p,
.prose li { color: #243140; }

.prose ul,
.prose ol { padding-left: 1.25rem; }

.prose li { margin: 0.35rem 0; }

.prose a { text-underline-offset: 0.15rem; }

.notice,
.example {
  border-radius: 14px;
  padding: 0.95rem 1.05rem;
  margin: 1.15rem 0;
}

.notice {
  background: var(--amber-bg);
  border: 1px solid #ead7b0;
}

.notice p { margin: 0; color: var(--amber-ink); }

.example {
  background: var(--green-soft);
  border: 1px solid #cfe5da;
}

.example p:first-child { margin-top: 0; }

.example p:last-child { margin-bottom: 0; }

.toc { padding: 0.9rem 1.1rem; margin: 1rem 0 0.2rem; }

.toc strong { display: block; margin-bottom: 0.25rem; }

.toc ol { margin: 0.35rem 0 0; padding-left: 1.2rem; }

.side {
  position: sticky;
  top: calc(var(--header) + 1rem);
  padding: 1rem 1.05rem;
}

.side h2 {
  font-family: var(--sans);
  font-size: 1rem;
  letter-spacing: 0;
  margin: 0 0 0.45rem;
}

.side ul { margin: 0; padding-left: 1.1rem; }

.side li { margin: 0.35rem 0; }

blockquote {
  margin: 1.1rem 0;
  padding-left: 1rem;
  border-left: 3px solid var(--green);
  color: var(--muted);
}

.table-wrap { overflow-x: auto; margin: 1rem 0 1.2rem; }

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.98rem;
}

th, td {
  border: 1px solid var(--line);
  text-align: left;
  padding: 0.65rem 0.75rem;
  vertical-align: top;
}

th { background: #f6f1e6; }

.list-check {
  list-style: none;
  padding: 0;
  margin: 0.4rem 0 0;
}

.list-check li {
  position: relative;
  padding-left: 1.7rem;
  margin: 0.5rem 0;
}

.list-check li::before {
  content: "";
  position: absolute;
  left: 0.15rem;
  top: 0.55rem;
  width: 0.7rem;
  height: 0.38rem;
  border-left: 2px solid var(--green);
  border-bottom: 2px solid var(--green);
  transform: rotate(-45deg);
}

.panel { padding: 1rem 1.1rem; }

.form {
  display: grid;
  gap: 0.9rem;
  max-width: 36rem;
}

label { font-weight: 650; display: grid; gap: 0.35rem; }

input, textarea {
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc3ae;
  border-radius: 12px;
  padding: 0.75rem 0.85rem;
  width: 100%;
}

textarea { min-height: 9rem; resize: vertical; }

.search { max-width: 32rem; margin: 0.4rem 0 1rem; }

dl { margin: 0; }

.glossary dt {
  font-family: var(--serif);
  font-size: 1.35rem;
  margin-top: 1.3rem;
}

.glossary dd { margin: 0.3rem 0 0; }

.site-footer {
  background: #12202b;
  color: #e7e1d6;
  margin-top: 1rem;
  padding: 2.5rem 0 1.4rem;
}

.site-footer a { color: #d7f3e6; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 1.5rem;
}

.footer-brand {
  font-family: var(--serif);
  font-size: 1.45rem;
  margin: 0 0 0.45rem;
  color: #fff;
}

.footer-title { font-weight: 700; margin: 0 0 0.4rem; color: #fff; }

.site-footer ul { list-style: none; margin: 0; padding: 0; }

.site-footer li { margin: 0.32rem 0; }

.footer-note {
  margin-top: 1.6rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 1rem;
  font-size: 0.95rem;
  color: #d9d1c4;
}

.footer-meta { color: #b7c3cc; }

.cookie-banner {
  position: fixed;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  background: #12202b;
  color: #f3f0e8;
  border-radius: 16px;
  padding: 1rem 1.1rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  max-width: 920px;
  margin-inline: auto;
}

.cookie-banner[hidden] { display: none; }

.cookie-banner p { margin: 0; font-size: 0.95rem; }

.cookie-actions {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  flex: none;
}

.cookie-banner button {
  min-height: 44px;
  border-radius: 999px;
  border: 0;
  background: #f3f0e8;
  color: #12202b;
  font: inherit;
  font-weight: 700;
  padding: 0.4rem 1rem;
  cursor: pointer;
}

@media (max-width: 980px) {
  .hero-grid,
  .trust,
  .grid,
  .footer-grid,
  .layout { grid-template-columns: 1fr; }

  .side { position: static; }

  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 3px solid var(--green);
    flex-direction: column;
    align-items: stretch;
    padding: 0.4rem 1rem 0.9rem;
  }

  .nav.is-open { display: flex; }

  .nav a { padding: 0.8rem 0.4rem; }

  .cookie-banner {
    flex-direction: column;
    align-items: stretch;
  }

  .section-head { flex-direction: column; align-items: start; }
}

@media (min-width: 700px) and (max-width: 980px) {
  .trust,
  .grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  .topbar,
  .site-header,
  .cookie-banner,
  .site-footer,
  .actions,
  .side { display: none !important; }

  body { background: #fff; color: #000; }

  a { color: #000; }
}
