:root {
  color-scheme: light;
  --paper: #f7f4ee;
  --ink: #1f2225;
  --muted: #6c6f73;
  --line: #d8d2c7;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas,
    "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--mono);
  letter-spacing: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 1rem;
  border: 1px solid var(--line);
  pointer-events: none;
}

.page {
  display: flex;
  min-height: 100svh;
  width: min(100% - 3rem, 980px);
  margin: 0 auto;
  padding: 10rem 0 4rem;
  flex-direction: column;
  justify-content: center;
}

.label,
h1 {
  margin: 0;
}

.label {
  color: var(--muted);
  font-size: 0.875rem;
}

h1 {
  margin-top: 0.75rem;
  font-size: clamp(3.25rem, 11vw, 8rem);
  line-height: 0.95;
  font-weight: 700;
}

a {
  width: fit-content;
  max-width: 100%;
  margin-top: 2rem;
  color: var(--ink);
  font-size: clamp(0.875rem, 4vw, 1rem);
  overflow-wrap: anywhere;
  text-underline-offset: 0.35rem;
}

a:hover,
a:focus-visible {
  color: var(--muted);
}

@media (max-width: 640px) {
  body::before {
    inset: 0.75rem;
  }

  .page {
    width: min(100% - 2rem, 980px);
    padding: 6rem 0 3rem;
  }
}

.document-page {
  display: block;
  min-height: 100svh;
  width: min(100% - 3rem, 760px);
  margin: 0 auto;
  padding: 5rem 0;
}

.document-page header {
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--line);
}

.document-page h1 {
  max-width: 12ch;
  margin-top: 0.75rem;
  font-size: clamp(2.5rem, 8vw, 5rem);
  line-height: 1;
}

.document-page h2 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.1rem;
  line-height: 1.4;
}

.document-page p,
.document-page li {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

.document-page p {
  margin: 0.75rem 0;
}

.document-page ul {
  margin: 0.75rem 0;
  padding-left: 1.4rem;
}

.document-page a {
  margin-top: 0;
  font-family: inherit;
  font-size: inherit;
}

.document-page .meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.875rem;
}

.document-page nav,
.document-page footer {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.document-page nav {
  margin-top: 3rem;
}

.document-page footer {
  margin-top: 2rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .document-page {
    width: min(100% - 2rem, 760px);
    padding: 3.5rem 0;
  }
}
