:root {
  color-scheme: light;
  --paper: #f5f4e9;
  --ink: #1e3431;
  --muted: #435a55;
  --teal: #174b45;
  --line: #ccd6c8;
  --gold: #f6d47a;
  font: 100%/1.6 "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }

body {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  min-height: 100vh;
  margin: 0;
}

body:has(#site-menu:not([open])) {
  grid-template-columns: 8.75rem minmax(0, 1fr);
}

.sidebar {
  background: var(--teal);
  color: #fff9ea;
  padding: 1rem 1rem 1.5rem;
}

.sidebar a { color: inherit; }

summary {
  width: fit-content;
  padding: 0.25rem 0.4rem;
  border: 1px solid #88aba2;
  border-radius: 0.35rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.sidebar summary img {
  width: 2rem;
  height: 2rem;
  margin-inline: 0.1rem 0.2rem;
  vertical-align: middle;
}

.brand {
  display: block;
  padding: 1.1rem 0.65rem 0.85rem;
  font-size: 1.16rem;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}

.brand small { color: #d2e6de; }

.sidebar nav {
  display: grid;
  gap: 0.18rem;
  padding-block: 0.75rem;
  border-block: 1px solid #648c83;
}

.sidebar nav a {
  display: block;
  padding: 0.35rem 0.65rem;
  border-radius: 0.25rem;
  text-decoration: none;
}

.sidebar nav a:hover { background: #265d56; }

.sidebar nav a[aria-current="page"] {
  color: var(--ink);
  background: var(--gold);
  font-weight: 700;
}

.language {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.3rem 0.65rem;
}

main {
  min-width: 0;
  width: 100%;
  max-width: 77rem;
  padding: clamp(1rem, 4vw, 4rem);
  hyphens: auto;
}

main header { padding-bottom: 0.75rem; }

h1, h2, h3 { line-height: 1.2; }

h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.035em;
  margin: 0 0 0.45em;
}

h2 { margin: 0 0 0.6rem; font-size: 1.35rem; }
h3 { margin: 0 0 0.5rem; font-size: 1.13rem; }
p { margin: 0.65rem 0; max-width: 76ch; }

.lead {
  max-width: 52ch;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

section {
  padding: 1.3rem 0;
  border-top: 1px solid var(--line);
}

section h2:not(:first-child) { margin-top: 1.55rem; }
li + li { margin-top: 0.45rem; }
ol, ul { padding-left: 1.5rem; }
a { color: #124f47; text-underline-offset: 0.15em; }

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: 0.85rem;
  max-width: 59rem;
}

.downloads article {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 1.15rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: #fcfbf1;
}

.downloads p { margin: 0 0 0.85rem; }

.button {
  display: inline-block;
  max-width: 100%;
  margin-top: auto;
  padding: 0.53rem 0.78rem;
  border: 1px solid var(--teal);
  border-radius: 0.3rem;
  background: var(--teal);
  color: #fff9ea;
  font-weight: 650;
  text-decoration: none;
}

.button:hover { background: #245f55; }
.button:focus-visible { outline-color: var(--teal); }
.button.secondary { background: #e4eee2; color: var(--teal); }
.button.secondary:hover { background: #d2e4ce; }

small { display: block; color: var(--muted); font-size: 0.86rem; }
.downloads small { margin-top: 0.5rem; }

dt { font-weight: 650; }
dd { margin: 0 0 0.8rem; max-width: 76ch; }
address { font-style: normal; }

pre {
  max-width: 76ch;
  padding: 0.65rem 0.85rem;
  border-radius: 0.25rem;
  border: 1px solid var(--line);
  background: #e9efe4;
  white-space: pre-wrap;
}

code {
  font-family: Consolas, "Courier New", monospace;
  hyphens: none;
}

.hashes code { overflow-wrap: anywhere; }
pre code, p code, dd code { overflow-wrap: anywhere; }

footer {
  margin-top: 0.6rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 44rem) {
  body, body:has(#site-menu:not([open])) { display: block; }
  .sidebar { padding: 0.75rem 1rem; }
  .sidebar:has(details[open]) { padding-bottom: 1rem; }
  h1 { font-size: clamp(1.75rem, 7vw, 2.3rem); }
}
