/* The legal pages (/legal/*.html, built by scripts/build_legal_pages.py) — the Light look of the
   app (web/src/index.css tokens) with the system fonts: no web font, no script, no inline style,
   so the pages render the same under the SPA's CSP (default-src 'self'). Hand-written, not
   generated; its bytes are not part of served_sha256 (that is the page's HTML only). */

:root {
  color-scheme: light;
  --ink: #111111;
  --surface: #ffffff;
  --canvas: #f4f4f4;
  --edge: #e6e6e6;
  --text: #242424;
  --text-secondary: #4b4b4b;
  --text-muted: #6b6b6b;
  --accent: #0f6e8c;
  --accent-hover: #0b5670;
  --accent-subtle: #e8f4f8;
  --radius: 0.75rem;
  --shadow-card: 0 1px 5px -4px rgb(36 36 36 / 0.7), 0 4px 8px 0 rgb(36 36 36 / 0.05);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 0.25rem;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: #ffffff;
  border-radius: 0.5rem;
  text-decoration: none;
}

.skip:focus {
  top: 0.75rem;
  color: #ffffff;
}

.site-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgb(244 244 244 / 0.94);
  border-bottom: 1px solid var(--edge);
}

.bar {
  max-width: 50rem;
  margin: 0 auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
}

.brand {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.langs,
.toc ol,
.docs ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.langs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.125rem;
}

.langs a {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0 0.625rem;
  line-height: 1.25;
  border-radius: 999px;
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
}

.langs a:hover {
  background: var(--accent-subtle);
  color: var(--accent-hover);
}

.doc {
  max-width: 50rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

article {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1.5rem 1.25rem 1.75rem;
  margin-top: 1.25rem;
}

article:focus {
  outline: none; /* focused by the skip and language links (tabindex -1), not a control */
}

@media (min-width: 40rem) {
  article {
    padding: 2rem 2.5rem 2.25rem;
  }
}

.doc-head {
  border-bottom: 1px solid var(--edge);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
}

h1 {
  margin: 0;
  color: var(--ink);
  font-size: 1.625rem;
  line-height: 1.25;
  letter-spacing: -0.015em;
}

.updated {
  margin: 0.5rem 0 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

h2 {
  margin: 1.75rem 0 0.5rem;
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.35;
}

h2.label {
  margin: 0 0 0.5rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

p,
ul {
  margin: 0.625rem 0;
}

ul {
  padding-left: 1.25rem;
}

li + li {
  margin-top: 0.375rem;
}

strong {
  color: var(--ink);
}

.toc,
.docs {
  background: var(--canvas);
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
}

.toc li + li,
.docs li + li {
  margin-top: 0.25rem;
}

.toc a,
.docs a {
  text-decoration: none;
}

.toc a:hover,
.docs a:hover {
  text-decoration: underline;
}

.docs {
  margin-top: 2rem;
}

.docs a[aria-current='page'] {
  color: var(--ink);
  font-weight: 600;
}

@media print {
  body {
    background: #ffffff;
  }
  .site-head,
  .skip,
  .toc,
  .docs {
    display: none;
  }
  article {
    border: 0;
    box-shadow: none;
    padding: 0;
    break-before: page;
  }
  article:first-of-type {
    break-before: auto;
  }
}
