:root {
  --header-bg: #0d0d0d;
  --header-fg: #e8e2d6;
  --accent: #b4551d;
  --text: #222;
  --muted: #666;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: #fff;
}

/* ---------- Header / menu ---------- */
.site-header {
  background: var(--header-bg);
  border-bottom: 3px solid var(--accent);
}

.header-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.site-name {
  color: var(--header-fg);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}

.menu a {
  color: var(--header-fg);
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 2px solid transparent;
}

.menu a:hover,
.menu a:focus-visible,
.menu a.active {
  color: #fff;
  border-bottom-color: var(--accent);
}

/* ---------- Main area (white) ---------- */
main {
  flex: 1;
  background: #fff;
}

.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

/* With JS, only the active page is shown; without JS, everything is visible. */
.js .page { display: none; }
.js .page.active { display: block; }

h1 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  line-height: 1.2;
  text-align: center;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.35rem;
  margin: 2.25rem 0 0.5rem;
}

.lead {
  text-align: center;
  font-size: 1.15rem;
  margin: 0 0 2rem;
}

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

/* ---------- Book cover: the star of the page ---------- */
.cover-link {
  display: block;
  text-align: center;
  margin-bottom: 2.5rem;
}

.cover {
  display: block;
  width: min(100%, 26rem);
  height: auto;
  margin: 0 auto;
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cover-link:hover .cover,
.cover-link:focus-visible .cover {
  transform: translateY(-4px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.45);
}

.note {
  color: var(--muted);
  font-style: italic;
  text-align: center;
}

/* ---------- Accordion (Preface headlines) ---------- */
.accordion-item {
  border-bottom: 1px solid #ddd;
}

.accordion-item h2 {
  margin: 0;
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  font: inherit;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 1.1rem 0;
}

.accordion-trigger:hover,
.accordion-trigger:focus-visible {
  color: var(--accent);
}

.accordion-trigger::after {
  content: "+";
  flex: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--accent);
  transition: transform 0.15s ease;
}

.accordion-trigger[aria-expanded="true"]::after {
  content: "\2212"; /* minus sign */
}

.accordion-panel {
  padding: 0 0 1.1rem;
}

.accordion-panel[hidden] {
  display: none;
}

.accordion-panel p:first-child {
  margin-top: 0;
}

.accordion-panel ol,
.accordion-panel ul {
  margin: 0.5rem 0 1rem;
  padding-left: 1.25rem;
}

.accordion-panel li + li {
  margin-top: 0.5rem;
}

.callout {
  background: #f2f2f2;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

.callout p {
  margin: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--header-bg);
  color: var(--header-fg);
  text-align: center;
  font-size: 0.85rem;
  padding: 1rem 1.25rem;
}

.site-footer p { margin: 0; }
.site-footer a { color: var(--header-fg); }

h3 {
  font-size: 1.1rem;
  margin: 1.5rem 0 0.25rem;
}

/* ---------- Consent banner ---------- */
.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--header-bg);
  color: var(--header-fg);
  border-top: 3px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.consent-banner[hidden] { display: none; }

.consent-inner {
  max-width: 60rem;
  margin: 0 auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.5rem;
}

.consent-text {
  flex: 1 1 22rem;
  margin: 0;
  font-size: 0.9rem;
}

.consent-text a { color: var(--header-fg); }

.consent-buttons {
  display: flex;
  gap: 0.75rem;
}

.consent-buttons button {
  font: inherit;
  cursor: pointer;
  padding: 0.5rem 1.25rem;
  border-radius: 3px;
  border: 2px solid var(--accent);
  background: transparent;
  color: var(--header-fg);
}

.consent-buttons button:hover,
.consent-buttons button:focus-visible { background: #2a2a2a; }

/* Accept and Decline are deliberately styled identically (equal prominence) */
