:root {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1b1b1b;
  --link: #0b3d91;
  --focus: #0b3d91;
  --control: #595959;
  --rule: #595959;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #121212;
    --text: #f3f3f3;
    --link: #9ec1ff;
    --focus: #9ec1ff;
    --control: #a3a3a3;
    --rule: #8d8d8d;
  }
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #1b1b1b;
  --link: #0b3d91;
  --focus: #0b3d91;
  --control: #595959;
  --rule: #595959;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121212;
  --text: #f3f3f3;
  --link: #9ec1ff;
  --focus: #9ec1ff;
  --control: #a3a3a3;
  --rule: #8d8d8d;
}

:root[data-theme="contrast"] {
  color-scheme: light;
  --bg: #ffffff;
  --text: #000000;
  --link: #000000;
  --focus: #000000;
  --control: #000000;
  --rule: #000000;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1.125rem;
  line-height: 1.65;
}

.skip {
  position: absolute;
  left: 1rem;
  top: 1rem;
  padding: 0.4rem 0.7rem;
  background: var(--bg);
  color: var(--text);
  transform: translateY(-200%);
}

.skip:focus {
  transform: none;
}

.page {
  max-width: 38rem;
  margin: 0 auto;
  padding: 3.5rem 1.5rem 6rem;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
  margin-bottom: 4.5rem;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.5rem;
}

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

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

nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration-thickness: 3px;
}

:root[data-theme="contrast"] a {
  text-decoration-thickness: 2px;
}

:root[data-theme="contrast"] nav a[aria-current="page"] {
  text-decoration-thickness: 3px;
}

button {
  font: inherit;
  color: inherit;
  background: transparent;
  border: 2px solid var(--control);
  border-radius: 0;
  min-height: 2.75rem;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}

button[aria-pressed="true"] {
  border-color: var(--text);
  font-weight: 700;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
}

h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

main h2:first-of-type {
  margin-top: 0;
}

p {
  margin: 0 0 1.25rem;
}

article {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--rule);
}

.pin {
  margin: 0 0 0.75rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 40rem) {
  .page {
    padding: 2rem 1.25rem 4rem;
  }

  header {
    margin-bottom: 2.5rem;
  }
}
