/* Shared by the static pages AND the SPA (the SPA bundles it at build time). */
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Literata:opsz,wght@7..72,400;7..72,600&display=swap');

:root {
  --ink: #1d2b4f;         /* text, primary buttons */
  --ink-soft: #52608a;    /* secondary text */
  --paper: #ffffff;
  --page: #f3f6fb;        /* cool page background */
  --rule: #cfdcee;        /* ruled-line blue */
  --margin: #d8434e;      /* exercise-book margin red */
  --highlight: #ffe45c;   /* highlighter */

  --sans: 'Atkinson Hyperlegible', 'Segoe UI', system-ui, sans-serif;
  --serif: 'Literata', Georgia, 'Times New Roman', serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.7rem;
  --step-3: 2.4rem;
  --step-4: clamp(2.4rem, 6vw, 3.6rem);

  --measure: 42rem;
}

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--margin);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ---------- Site header ---------- */

.site-header {
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  max-width: 64rem;
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.brand {
  font: 600 var(--step-1)/1 var(--serif);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.brand__mark {
  width: 1.4rem;
  height: 1.4rem;
  border: 2px solid var(--ink);
  border-radius: 3px;
  background:
    linear-gradient(90deg, transparent 0.3rem, var(--margin) 0.3rem, var(--margin) calc(0.3rem + 2px), transparent 0),
    repeating-linear-gradient(transparent 0 0.3rem, var(--rule) 0.3rem calc(0.3rem + 1px));
}

.site-nav { display: flex; gap: 1.4rem; }

.site-nav a {
  text-decoration: none;
  font-weight: 700;
  padding: 0.25rem 0;
  border-bottom: 3px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current='page'] { border-bottom-color: var(--highlight); }

/* ---------- Page body: exercise-book sheet with a red margin ---------- */

.sheet {
  max-width: 64rem;
  margin: 1.25rem 0.75rem 2.5rem;
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 4px;
  position: relative;
  padding: 2.5rem 1.5rem 3rem 1.5rem;
}

@media (min-width: 48rem) {
  .sheet {
    padding-left: 6rem;
    padding-right: 3rem;
    margin: 2rem 1.25rem 3rem;
  }
  .sheet::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 4.25rem;
    border-left: 2px solid var(--margin);
    opacity: 0.55;
  }
}

@media (min-width: 66.5rem) {
  .sheet { margin-inline: auto; }
}

.sheet > * { max-width: var(--measure); }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

h1 { font-size: var(--step-4); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); margin-top: 2.5rem; }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1rem; }

.lede { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.5; }

/* ---------- Buttons ---------- */

.button {
  display: inline-block;
  font: 700 var(--step-0)/1 var(--sans);
  padding: 0.85rem 1.3rem;
  border-radius: 4px;
  border: 2px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
}

.button:hover { background: #2a3d6d; border-color: #2a3d6d; }

.button--quiet { background: transparent; color: var(--ink); }
.button--quiet:hover { background: var(--page); color: var(--ink); }

.button:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---------- Landing hero ---------- */

.hero {
  display: grid;
  gap: 2rem;
  align-items: center;
}

@media (min-width: 48rem) {
  .sheet .hero { max-width: none; grid-template-columns: 1.3fr 1fr; }
}

.hero__actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.5rem; }

.hero__art { max-width: 20rem; justify-self: center; }

/* Highlighter swipe: the one bold element, reused when answers are revealed */
.marked {
  background: linear-gradient(transparent 55%, var(--highlight) 55%, var(--highlight) 92%, transparent 92%);
  padding: 0 0.1em;
}

.topics-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topics-list li {
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  font-size: var(--step--1);
}

/* ---------- FAQ ---------- */

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 1rem 0;
}

.faq details:first-of-type { border-top: 1px solid var(--rule); }

.faq summary {
  font: 600 var(--step-1)/1.35 var(--serif);
  cursor: pointer;
  list-style: none;
  display: grid;
  grid-template-columns: 1.5rem 1fr;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: '+'; color: var(--margin); }
.faq details[open] summary::before { content: '\2212'; }
.faq details p { padding-left: 1.5rem; }

.faq details p { margin: 0.75rem 0 0; }

/* ---------- Footer: tells you where this page came from ---------- */

.site-footer {
  max-width: 64rem;
  margin: 0 auto 2rem;
  padding: 0 1.25rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.served-from {
  display: inline-block;
  border-left: 3px solid var(--rule);
  padding-left: 0.6rem;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
