/* ============================================================
   BODY FONT — play with this. Set --font-body to ONE stack.
   The default (Source Serif 4) is self-hosted in fonts/.
   The presets below are system fonts: no download needed —
   just move the line you want up to --font-body and reload.
   (To use a brand-new web font, add a woff2 + @font-face in
    fonts.css first, then name it here.)
   ============================================================ */
:root {
  --font-body: "Source Serif 4", Georgia, Cambria, "Times New Roman", Times, serif;

  /* --font-body: Georgia, "Times New Roman", Times, serif;            classic serif */
  /* --font-body: "Iowan Old Style", "Palatino Linotype", Palatino, serif;  warm serif */
  /* --font-body: ui-serif, "New York", Charter, serif;               system serif */
  /* --font-body: system-ui, -apple-system, "Segoe UI", sans-serif;   clean sans  */
  /* --font-body: "Helvetica Neue", Helvetica, Arial, sans-serif;     neutral sans */
  /* --font-body: ui-monospace, "SF Mono", Menlo, Consolas, monospace; mono       */

  --font-size:   16px;   /* base text size      */
  --line-height: 1.6;    /* line spacing        */

  --paper:  oklch(97.5% 0.006 95);
  --ink:    oklch(22%   0.008 110);
  --muted:  oklch(52%   0.008 110);
  --accent: oklch(54%   0.085 150);
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper:  oklch(17% 0.006 110);
    --ink:    oklch(93% 0.006 95);
    --muted:  oklch(64% 0.008 110);
    --accent: oklch(80% 0.08 150);
  }
}

* { box-sizing: border-box; }

/* Paint the paper colour on the very first frame — no white flash */
html { background: var(--paper); }

body {
  margin: 0;
  min-height: 100svh;
  /* Top < bottom so the block rests a touch above true centre */
  padding: clamp(3rem, 14vh, 7rem) clamp(1.5rem, 6vw, 4rem) 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--font-size);
  line-height: var(--line-height);
  letter-spacing: 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main {
  width: 100%;
  max-width: 35rem;
  margin-block: auto;
  text-align: left;
  /* Hidden until fonts are ready, then revealed — no content pop-in */
  opacity: 0;
}
html.ready main {
  opacity: 1;
  transition: opacity 0.5s ease;
}

/* Even spacing: no top margin on the first block, no trailing margin */
main :first-child { margin-top: 0; }
main :last-child  { margin-bottom: 0; }

/* Small, quiet brand mark — not a headline */
.wordmark {
  font-family: "EB Garamond", Garamond, Georgia, serif;
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: 0.005em;
  color: var(--ink);
  margin: 0 0 1.6rem;
}

/* Headings kept modest in case they're used — no oversized title */
h1, h2 {
  font-family: "EB Garamond", Garamond, Georgia, serif;
  font-weight: 500;
  letter-spacing: 0.005em;
  line-height: 1.2;
  text-wrap: balance;
  margin: 1.4rem 0 0.5rem;
}
h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }

/* The message: readable, comfortable measure */
p {
  margin: 1.1rem 0 0;
  color: var(--ink);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-wrap: pretty;
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 0.5px;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in oklch, currentColor 30%, transparent);
  transition: color 0.18s ease, text-decoration-color 0.18s ease;
}
a:hover { color: var(--accent); text-decoration-color: var(--accent); }
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: 2px;
}

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

/* Footer follows the message on small screens and rests at the page bottom. */
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.25rem 2rem;
  padding-top: clamp(3.5rem, 12vh, 7rem);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
}
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.5rem; }
.site-footer a { display: inline-flex; align-items: center; min-height: 44px; }

/* Support uses the homepage layout without requiring JavaScript to reveal it. */
.support-page main { opacity: 1; }
.support-page h1 { font-size: 1.6rem; margin-bottom: 1.6rem; }
.support-page p a { overflow-wrap: anywhere; }

/* Legal pages are static HTML, readable without JavaScript. */
body.legal-page { padding-top: clamp(2rem, 7vh, 4rem); }
.legal-page main { max-width: 46rem; margin-block: 0; opacity: 1; }
.home-link { display: inline-flex; align-items: center; min-height: 44px; margin-bottom: 2rem; }
.legal-page h1 { font-size: clamp(2rem, 6vw, 2.6rem); margin-bottom: 0.5rem; }
.legal-page h2 { font-size: 1.4rem; line-height: 1.35; margin-top: 2.5rem; }
.legal-page h3 { font-size: 1.0625rem; line-height: 1.5; margin: 1.75rem 0 0.5rem; }
.legal-page .updated { color: var(--muted); font-size: 0.875rem; margin-bottom: 2rem; }
.legal-page p, .legal-page li { font-size: 1rem; line-height: 1.75; }
.legal-page li { margin-top: 0.75rem; }
.legal-page ul { padding-left: 1.5rem; }
.legal-page a { overflow-wrap: anywhere; }
.legal-page h2, .legal-page h3 { scroll-margin-top: 2rem; }
.legal-toc { margin-block: 2rem; }
.legal-toc ol { padding-left: 1.5rem; }
.legal-toc a { display: inline-block; padding-block: 0.35rem; }
.legal-toc li { margin: 0; }
.subclause { padding-left: 1.5rem; }

@media (max-width: 600px) {
  .site-footer { flex-direction: column; align-items: flex-start; gap: 0; }
}
