:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --text: #1b1d24;
  --muted: #5b6070;
  --border: #e3e4ec;
  --accent: #5b4cdb;
  --accent-text: #ffffff;
  --twitch: #9146ff;
  --youtube: #e62117;
  --kick: #2fa800;
  --radius: 14px;
  --max: 68rem;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111218;
    --surface: #1a1c24;
    --text: #eceef4;
    --muted: #a3a8b8;
    --border: #2b2e3a;
    --accent: #8b7fff;
    --accent-text: #111218;
    --kick: #53fc18;
    color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.65 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: 1.25rem; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; padding-block: 0.9rem; }
.brand { display: flex; align-items: center; gap: 0.6rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.brand img { width: 2rem; height: 2rem; flex: none; }
.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-nav a { color: var(--muted); text-decoration: none; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); margin-top: 4rem; padding-block: 2rem; color: var(--muted); font-size: 0.9rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.75rem 2rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.site-footer a { color: var(--muted); }

/* Home: plain dark page */
body.home {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #111218;
  color: #eceef4;
  color-scheme: dark;
}
.home-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem 1.25rem; }
.home-main h1 { font-size: clamp(2.2rem, 7vw, 3.4rem); line-height: 1.1; margin: 0 0 1rem; letter-spacing: -0.02em; font-weight: 700; }
.home-main p { margin: 0; max-width: 34rem; color: #a3a8b8; font-size: clamp(1rem, 2.6vw, 1.15rem); }
.home-footer { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.75rem; padding: 1.25rem; font-size: 0.875rem; }
.home-footer a { color: #a3a8b8; }
.home-footer a:hover { color: #eceef4; }

/* Legal pages */
.doc { max-width: 46rem; padding-block: 3rem 1rem; }
.doc h1 { font-size: clamp(2rem, 5vw, 2.6rem); line-height: 1.15; margin: 0 0 0.5rem; }
.doc .meta { color: var(--muted); margin: 0 0 2rem; }
.doc h2 { font-size: 1.35rem; margin: 2.5rem 0 0.75rem; padding-top: 0.5rem; }
.doc h3 { font-size: 1.1rem; margin: 1.75rem 0 0.5rem; }
.doc ul, .doc ol { padding-left: 1.4rem; }
.doc li { margin: 0.3rem 0; }
.doc code { font-size: 0.92em; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 0.05em 0.35em; overflow-wrap: anywhere; }
.doc .toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; }
.doc .toc ol { margin: 0; }
.table-wrap { overflow-x: auto; }
.doc table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.doc th, .doc td { text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); padding: 0.55rem 0.75rem 0.55rem 0; }
.doc th { font-weight: 600; }
.callout { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: 8px; padding: 0.9rem 1.1rem; margin: 1.25rem 0; }
.callout p { margin: 0.25rem 0; }

/* Privacy policy and terms: plain dark page, like the home page */
body.page {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #111218;
  color: #d9dce6;
  color-scheme: dark;
}
body.page a { color: #b3abff; }
.page-header { padding: 1.25rem; text-align: center; font-weight: 600; }
.page-header a { color: #eceef4; text-decoration: none; }
.page-main { flex: 1; width: 100%; max-width: 40rem; margin: 0 auto; padding: 1.5rem 1.25rem 2rem; }
.page-main h1 { font-size: clamp(1.8rem, 5vw, 2.2rem); line-height: 1.2; margin: 0 0 0.25rem; color: #eceef4; font-weight: 700; }
.page-main p { margin: 0 0 1.1rem; }
.page-main .page-date { color: #a3a8b8; font-size: 0.9rem; margin-bottom: 2rem; }
.page-main code { font-size: 0.9em; overflow-wrap: anywhere; }
body.page .home-footer a { color: #a3a8b8; }
body.page .home-footer a:hover { color: #eceef4; }
