/* Verso documentation. Logical properties only, system fonts, AA contrast. */
:root {
  --bg: #f7f3ec;
  --text: #1c1a17;
  --muted: #5b554c;
  --rule: #d9d1c3;
  --accent: #7a5a1e;
  --panel: #fffdf8;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.65 var(--font);
}

a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--text); }
:focus-visible { outline: 2px solid var(--text); outline-offset: 3px; }

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -3rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
}
.skip:focus { inset-block-start: 1rem; }

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  border-block-end: 1px solid var(--rule);
}

.brand {
  color: var(--text);
  font: 1.6rem/1 var(--serif);
  text-decoration: none;
}
.brand span { color: var(--muted); font: 0.9rem var(--font); margin-inline-start: 0.4rem; }

.masthead__support {
  padding: 0.5rem 1rem;
  border: 1px solid var(--text);
  color: var(--text);
  text-decoration: none;
}
.masthead__support:hover { background: var(--text); color: var(--bg); }

.layout {
  display: grid;
  grid-template-columns: minmax(13rem, 16rem) minmax(0, 46rem);
  gap: clamp(1.5rem, 4vw, 4rem);
  padding: 2rem clamp(1rem, 4vw, 3rem) 4rem;
}

.toc h2 {
  margin: 1.5rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.toc h2:first-child { margin-block-start: 0; }
.toc ul { margin: 0; padding: 0; list-style: none; }
.toc a { display: block; padding: 0.2rem 0; color: var(--text); text-decoration: none; }
.toc a:hover, .toc a[aria-current="page"] { text-decoration: underline; }
.toc a[aria-current="page"] { font-weight: 600; }

main { min-inline-size: 0; }
main:focus { outline: none; }

h1, h2, h3 { font-family: var(--serif); font-weight: 400; line-height: 1.2; }
h1 { margin: 0 0 1.5rem; font-size: clamp(2rem, 4vw, 2.75rem); }
h2 { margin: 2.5rem 0 0.75rem; padding-block-start: 1rem; border-block-start: 1px solid var(--rule); font-size: 1.6rem; }
h3 { margin: 1.75rem 0 0.5rem; font-size: 1.25rem; }

table {
  inline-size: 100%;
  margin: 0.75rem 0 1.5rem;
  border-collapse: collapse;
  background: var(--panel);
  font-size: 0.95rem;
}
th, td {
  padding: 0.6rem 0.75rem;
  border-block-end: 1px solid var(--rule);
  text-align: start;
  vertical-align: top;
}
thead th { color: var(--muted); font-size: 0.8rem; letter-spacing: 0.06em; text-transform: uppercase; }
tbody th { inline-size: 33%; font-weight: 600; }

code { padding: 0.1em 0.35em; background: var(--panel); border: 1px solid var(--rule); font-size: 0.9em; }
pre { overflow-x: auto; padding: 1rem; background: var(--panel); border: 1px solid var(--rule); }
pre code { padding: 0; border: 0; }

blockquote { margin: 1.5rem 0; padding: 0.75rem 1rem; border-inline-start: 3px solid var(--accent); background: var(--panel); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 0.75rem; margin: 1rem 0 2rem; padding: 0; list-style: none; }
.cards li { display: flex; flex-direction: column; gap: 0.25rem; padding: 1rem; background: var(--panel); border: 1px solid var(--rule); }
.cards a { font-weight: 600; }
.cards span { color: var(--muted); font-size: 0.9rem; }

form { display: grid; gap: 1rem; max-inline-size: 36rem; padding: 1.5rem; background: var(--panel); border: 1px solid var(--rule); }
label { display: block; margin-block-end: 0.3rem; font-weight: 600; }
input, select, textarea {
  inline-size: 100%;
  min-block-size: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--muted);
  background: #fff;
  color: var(--text);
  font: inherit;
}
textarea { min-block-size: 9rem; }
.hint { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.9rem; }
.form-error { margin: 0; color: #a3261a; font-weight: 600; }
button {
  justify-self: start;
  min-block-size: 2.75rem;
  padding: 0.6rem 1.5rem;
  border: 0;
  background: var(--text);
  color: var(--bg);
  font: inherit;
  cursor: pointer;
}
.visually-hidden { position: absolute !important; inline-size: 1px; block-size: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.foot { padding: 2rem clamp(1rem, 4vw, 3rem); border-block-start: 1px solid var(--rule); color: var(--muted); font-size: 0.9rem; }

@media (max-width: 800px) {
  .layout { grid-template-columns: 1fr; }
  .toc { order: 2; padding-block-start: 1.5rem; border-block-start: 1px solid var(--rule); }
  tbody th { inline-size: 40%; }
}

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; }
}
