/* Shared base: text-size scale, resets and the display-settings controls.
   Every size on the site is in rem, so the size selector scales everything. */

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-font-size="sm"] { font-size: 100%; }
html[data-font-size="md"] { font-size: 112.5%; }
html[data-font-size="lg"] { font-size: 125%; }
html[data-font-size="xl"] { font-size: 137.5%; }

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
img, svg { max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { overflow-wrap: anywhere; }
p, li, dd, dt, h1, h2, h3, h4 { overflow-wrap: break-word; }

.skip-link {
  position: absolute; left: 0.75rem; top: -4rem; z-index: 100;
  padding: 0.6rem 1rem; border-radius: 0.5rem;
  background: var(--skip-bg); color: var(--skip-ink); text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 0.75rem; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Display settings: four "A" buttons that grow like a magnifying glass, then the theme toggle */
.prefs { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; justify-content: center; }
.sizes { display: inline-flex; align-items: center; gap: 0.15rem; padding: 0.2rem; border-radius: 999px;
  border: 1px solid var(--pref-line); background: var(--pref-bg); }
.size-btn {
  display: inline-grid; place-items: center; min-width: 2.25rem; height: 2.25rem; padding: 0 0.35rem;
  border: 0; border-radius: 999px; background: transparent; color: var(--pref-ink);
  font-weight: 700; line-height: 1; cursor: pointer;
}
.size-btn[data-size="sm"] { font-size: 0.8rem; }
.size-btn[data-size="md"] { font-size: 0.95rem; }
.size-btn[data-size="lg"] { font-size: 1.1rem; }
.size-btn[data-size="xl"] { font-size: 1.28rem; }
.size-btn[aria-pressed="true"] { background: var(--pref-on-bg); color: var(--pref-on-ink); }
.theme-btn {
  display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0;
  border-radius: 999px; border: 1px solid var(--pref-line); background: var(--pref-bg); color: var(--pref-ink); cursor: pointer;
}
.theme-btn svg { width: 1.15rem; height: 1.15rem; }
.theme-btn .icon-sun { display: none; }
html[data-theme="dark"] .theme-btn .icon-sun { display: block; }
html[data-theme="dark"] .theme-btn .icon-moon { display: none; }
.size-btn:focus-visible, .theme-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
