:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #14161f;
  --muted: #4a5068;
  --line: #d9dce8;
  --accent: #3d4bd6;
  --surface: #f5f6fb;
  --focus: #1a73e8;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d0f18;
    --fg: #eceef7;
    --muted: #a6abc3;
    --line: #272b3e;
    --accent: #8b90ff;
    --surface: #151826;
    --focus: #8ab4f8;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overflow-wrap: anywhere;
}
a { color: var(--accent); text-underline-offset: 3px; }
a:focus-visible, button:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip-link { position: absolute; left: 0.5rem; top: -4rem; background: var(--fg); color: var(--bg); padding: 0.6rem 0.9rem; border-radius: 0.5rem; z-index: 100; }
.skip-link:focus { top: 0.5rem; }
.site-header { display: flex; flex-wrap: wrap; gap: 0.75rem 1.5rem; align-items: center; justify-content: space-between; padding: 0.9rem max(1rem, env(safe-area-inset-right)) 0.9rem max(1rem, env(safe-area-inset-left)); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; color: var(--fg); text-decoration: none; font-size: 1.1rem; }
nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
nav a[aria-current="page"] { color: var(--fg); font-weight: 600; text-decoration: none; }
main { max-width: 52rem; margin: 0 auto; padding: 2rem max(1rem, env(safe-area-inset-right)) 3rem max(1rem, env(safe-area-inset-left)); }
h1 { font-size: clamp(1.8rem, 5vw, 2.4rem); line-height: 1.2; margin: 0 0 0.4rem; }
h2 { font-size: 1.35rem; margin: 2.2rem 0 0.6rem; line-height: 1.3; }
h3 { font-size: 1.1rem; margin: 1.4rem 0 0.4rem; }
.dates { color: var(--muted); margin: 0 0 1rem; font-size: 0.95rem; }
.intro { font-size: 1.15rem; color: var(--muted); }
.note { padding: 0.8rem 1rem; background: var(--surface); border-left: 4px solid var(--accent); border-radius: 0.3rem; }
.toc { background: var(--surface); border: 1px solid var(--line); border-radius: 0.6rem; padding: 0.4rem 1.2rem 0.8rem; margin: 1.5rem 0; }
.toc h2 { font-size: 1rem; margin: 0.8rem 0 0.3rem; }
.toc ol { margin: 0; padding-left: 1.2rem; columns: 2 14rem; }
ul, ol { padding-left: 1.4rem; }
li { margin: 0.25rem 0; }
.table-wrap { overflow-x: auto; margin: 1rem 0; border: 1px solid var(--line); border-radius: 0.5rem; }
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.95rem; }
th, td { text-align: left; vertical-align: top; padding: 0.6rem 0.8rem; border-bottom: 1px solid var(--line); }
th { background: var(--surface); }
tr:last-child td { border-bottom: 0; }
.site-footer { border-top: 1px solid var(--line); padding: 1.5rem max(1rem, env(safe-area-inset-right)) calc(2rem + env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); color: var(--muted); font-size: 0.95rem; }
.site-footer p { margin: 1rem 0 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.btn { font: inherit; font-weight: 600; padding: 0.7rem 1.1rem; min-height: 2.75rem; border-radius: 0.6rem; border: 2px solid var(--fg); background: var(--bg); color: var(--fg); cursor: pointer; }
.btn:hover { background: var(--surface); }

/* cookie consent: both choices share the same style so neither is favoured */
.consent-banner {
  position: fixed; inset: auto 0 0 0; z-index: 50;
  margin: 0 auto; max-width: 44rem; padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom));
  background: var(--bg); color: var(--fg); border: 2px solid var(--fg); border-bottom: 0; border-radius: 0.9rem 0.9rem 0 0;
  box-shadow: 0 -8px 30px rgb(0 0 0 / 0.25);
}
.consent-banner h2 { margin: 0 0 0.3rem; font-size: 1.1rem; }
.consent-banner p { margin: 0.3rem 0; }
.consent-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 0.8rem; }
.consent-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: rgb(0 0 0 / 0.55); padding: 1rem; }
.consent-box { background: var(--bg); color: var(--fg); border: 2px solid var(--fg); border-radius: 0.9rem; padding: 1.2rem 1.4rem; max-width: 32rem; max-height: 90vh; overflow: auto; width: 100%; }
.consent-box h2 { margin-top: 0; }
.consent-row { margin: 0.8rem 0; }
.consent-row p { margin: 0.2rem 0 0; color: var(--muted); font-size: 0.95rem; }
.consent-row input { width: 1.2rem; height: 1.2rem; vertical-align: middle; }
.consent-placeholder { padding: 1rem; border: 1px dashed var(--line); border-radius: 0.5rem; background: var(--surface); margin: 1rem 0; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
@media print { .site-header nav, .consent-banner, .consent-modal, .skip-link { display: none !important; } }
