:root {
  color-scheme: light dark;
  --background: #f7f5ee;
  --text: #111111;
  --muted: #5d5a52;
  --rule: #b8b3a7;
  --link: #0000cc;
  --visited: #551a8b;
  --focus: #d66b00;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #151515;
  --text: #eeeeea;
  --muted: #aaa79f;
  --rule: #55534e;
  --link: #8cb4ff;
  --visited: #d7a7ff;
  --focus: #ffb55d;
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  max-width: 780px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 22px 30px;
  background: var(--background);
  color: var(--text);
  font-family: "Century Schoolbook", "Century Schoolbook L", Georgia, serif;
  font-size: 17px;
  line-height: 1.62;
}

header,
footer {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
}

.wordmark {
  color: var(--text);
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: flex-end;
  font-size: 0.88rem;
}

button {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--link);
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

main {
  padding: 58px 0 70px;
}

section {
  scroll-margin-top: 20px;
}

.intro {
  padding-bottom: 16px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.6rem, 8vw, 4.7rem);
  line-height: 1;
  letter-spacing: -0.045em;
}

h2 {
  margin-bottom: 12px;
  font-size: 1.35rem;
  line-height: 1.25;
}

h3 {
  margin: 0 0 5px;
  font-size: 1rem;
  line-height: 1.35;
}

p {
  margin-bottom: 1rem;
}

a,
button {
  color: var(--link);
  text-underline-offset: 0.15em;
}

a:visited {
  color: var(--visited);
}

a:hover,
button:hover {
  text-decoration-thickness: 2px;
}

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

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  align-items: baseline;
  margin: 26px 0 5px;
}

.primary-link {
  font-weight: bold;
}

.status {
  color: var(--muted);
  font-size: 0.88rem;
}

.section-intro {
  max-width: 68ch;
  font-size: 1.04rem;
}

.plain-english {
  margin: 18px 0 30px;
  padding: 15px 17px 14px;
  border: 1px solid var(--rule);
}

.plain-english h3 {
  margin-bottom: 6px;
}

.plain-english p {
  margin-bottom: 0;
}

.method {
  margin: 28px 0 26px;
  padding-left: 1.5rem;
}

.method li {
  margin-bottom: 24px;
  padding-left: 0.35rem;
}

.method li::marker {
  color: var(--muted);
  font-weight: bold;
}

.method p {
  margin-bottom: 0;
}

code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.86em;
}

.note {
  padding-left: 14px;
  border-left: 3px solid var(--rule);
  color: var(--muted);
  font-size: 0.92rem;
}

hr {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

footer {
  padding-top: 10px;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.82rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #151515;
    --text: #eeeeea;
    --muted: #aaa79f;
    --rule: #55534e;
    --link: #8cb4ff;
    --visited: #d7a7ff;
    --focus: #ffb55d;
  }
}

@media (max-width: 520px) {
  body {
    padding: 15px 16px 24px;
    font-size: 16px;
  }

  header {
    align-items: flex-start;
  }

  nav {
    gap: 5px 12px;
  }

  main {
    padding: 42px 0 54px;
  }
}

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