:root {
  color-scheme: light dark;
  --page: #ffffff;
  --surface: #f1f5f9;
  --line: #cbd5e1;
  --text: #1e293b;
  --link: #1d4ed8;
  font-family: system-ui, sans-serif;
  line-height: 1.65;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #111827;
    --surface: #253247;
    --line: #53627a;
    --text: #f1f5f9;
    --link: #a8c7ff;
  }
}

body {
  margin: 0;
  color: var(--text);
  background: var(--page);
  overflow-wrap: anywhere;
}

.layout {
  box-sizing: border-box;
  max-width: 46rem;
  margin-inline: auto;
  padding-inline: clamp(1rem, 5vw, 2rem);
}

.site-header {
  border-bottom: 1px solid var(--line);
}

.documents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.documents a {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 48px;
  padding: 0 0.75rem;
  border-bottom: 3px solid transparent;
  color: var(--text);
  text-decoration: none;
}

.documents a[aria-current="page"] {
  border-bottom-color: var(--link);
  font-weight: 700;
}

.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  margin-block: 1.75rem 1.25rem;
}

.languages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: 0.75rem;
  background: var(--surface);
}

.languages a,
.languages span {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  min-height: 44px;
  min-width: 44px;
  padding-inline: 0.65rem;
  border-radius: 0.5rem;
}

.languages [aria-current] {
  background: var(--page);
  font-weight: 700;
}

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

a:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.documents a:hover,
.languages a:hover {
  text-decoration: underline;
}

h1,
h2 {
  line-height: 1.2;
}

h1 {
  margin: 0;
  font-size: clamp(1.875rem, 5vw, 2.5rem);
}

h2 {
  margin-block-start: 1.75rem;
}

.content {
  max-width: 66ch;
  padding-bottom: 2.5rem;
}

[id] {
  scroll-margin-top: 1rem;
}

li + li {
  margin-top: 0.5rem;
}
