/* Plain, readable, mobile-first. All colour pairs meet WCAG AA (most meet AAA). */
:root {
  --bg: #ffffff;
  --text: #1a1a1a;
  --muted: #4a4a4a;
  --link: #0b4f8a;
  --link-visited: #5a2d82;
  --border: #c8c8c8;
  --panel: #f4f4f4;
  --focus: #b35c00;
  --error-bg: #fdecea;
  --error-text: #8a1c11;
  --ok-bg: #e7f4ea;
  --ok-text: #1d5e2b;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #ececec;
    --muted: #bdbdbd;
    --link: #8cc4ff;
    --link-visited: #d0a8ff;
    --border: #555555;
    --panel: #1e1e1e;
    --focus: #ffb366;
    --error-bg: #3b1512;
    --error-text: #ffb4a9;
    --ok-bg: #12301a;
    --ok-text: #a6e3b4;
  }
}

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

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

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

.wrap { max-width: 42rem; margin: 0 auto; padding: 0 1rem; }

h1, h2, h3 { line-height: 1.25; }
h1 { font-size: 1.75rem; margin: 1.5rem 0 0.75rem; }
h2 { font-size: 1.3rem; margin: 2rem 0 0.5rem; }

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

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

.skip-link {
  position: absolute;
  left: 0.5rem;
  top: -3rem;
  padding: 0.5rem 1rem;
  background: var(--text);
  color: var(--bg);
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

/* Header and navigation: wraps on small screens, no JavaScript needed. */
.site-header { border-bottom: 1px solid var(--border); padding: 0.75rem 0; }
.site-name { font-weight: 700; font-size: 1.2rem; color: var(--text); text-decoration: none; }
.site-name:visited { color: var(--text); }
.site-header nav ul,
.site-footer ul {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
}
.site-header nav a { display: inline-block; padding: 0.4rem 0; min-height: 44px; line-height: 2; }
.site-header nav a[aria-current="page"] { font-weight: 700; text-decoration-thickness: 3px; }

main { padding-bottom: 3rem; }

.site-footer { border-top: 1px solid var(--border); padding: 1rem 0 2rem; color: var(--muted); font-size: 0.95rem; }
.site-footer a { display: inline-block; min-height: 44px; line-height: 2.6; }

.lead { font-size: 1.2rem; }
.eyebrow { margin: 1.5rem 0 0; color: var(--muted); font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.05em; }
.eyebrow + h1 { margin-top: 0.25rem; }
.subtitle { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.note, .optional { color: var(--muted); font-size: 0.95rem; }

.book-list { list-style: none; padding: 0; }
.book-list li { padding: 0.75rem 0; border-bottom: 1px solid var(--border); }
.book-list a { font-weight: 600; font-size: 1.1rem; }
.book-list p { margin: 0.25rem 0 0; }

.cover { display: block; max-width: 100%; height: auto; margin: 1rem 0; }

.materials li { margin-bottom: 0.5rem; }
.badge {
  display: inline-block;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0 0.4rem;
  font-size: 0.8rem;
  color: var(--muted);
  vertical-align: middle;
}

/* Forms */
.form { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; padding: 1rem; max-width: 30rem; }
.form label { display: block; font-weight: 600; margin-top: 0.75rem; }
.form label:first-child { margin-top: 0; }
.form input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.6rem;
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 2px solid var(--muted);
  border-radius: 4px;
}
.consent { font-size: 0.95rem; margin: 0.5rem 0 1rem; }
button {
  font: inherit;
  font-weight: 600;
  padding: 0.6rem 1.4rem;
  min-height: 44px;
  color: #ffffff;
  background: #0b4f8a;
  border: 2px solid #0b4f8a;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background: #083a66; }

.status { padding: 0.75rem 1rem; border-radius: 4px; background: var(--error-bg); color: var(--error-text); font-weight: 600; }
.status.ok { background: var(--ok-bg); color: var(--ok-text); }

@media (min-width: 40rem) {
  h1 { font-size: 2.1rem; }
  .site-header .wrap { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
  .site-header nav ul { margin-top: 0; }
}

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