/* 8all legal site. System fonts only, no external resources, no JavaScript. */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --fg: #1d1d1f;
  --muted: #55555c;
  --link: #0b57d0;
  --visited: #6a2fb0;
  --border: #8a8a94;
  --rule: #d6d6de;
  --surface: #f3f3f7;
  --todo-bg: #ffe27a;
  --todo-fg: #2a2000;
  --todo-edge: #8a6a00;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101114;
    --fg: #ececf1;
    --muted: #a9a9b4;
    --link: #8ab4ff;
    --visited: #c3a6ff;
    --border: #6b6c76;
    --rule: #33343c;
    --surface: #1a1b20;
    --todo-bg: #4d3d00;
    --todo-fg: #fff0b3;
    --todo-edge: #e0b400;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  font-size: max(17px, 1.0625rem);
  line-height: 1.6;
  overflow-wrap: break-word;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.wrap { max-width: 72ch; margin: 0 auto; padding: 0 16px; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.18em; overflow-wrap: anywhere; }
a:visited { color: var(--visited); }
a:hover { text-decoration-thickness: 0.14em; }
:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
main:focus { outline: none; }

.skip, .skip:visited { position: absolute; left: 16px; top: -200px; z-index: 10; padding: 0.5rem 1rem;
  background: var(--fg); color: var(--bg); border-radius: 0 0 6px 6px; }
.skip:focus { top: 0; }

.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 1.25rem;
  padding-top: 0.6rem; padding-bottom: 0.6rem; }
.brand, .brand:visited { font-size: 1.35rem; font-weight: 700; letter-spacing: 0.02em; color: var(--fg);
  text-decoration: none; }
nav ul { display: flex; flex-wrap: wrap; gap: 0 1rem; margin: 0; padding: 0; list-style: none; }
nav li { margin: 0; }
.lang { margin-left: auto; }
a[aria-current="page"], a[aria-current="page"]:visited { color: var(--fg); font-weight: 600; text-decoration: none;
  border-bottom: 2px solid currentColor; }
[aria-current="true"] { font-weight: 600; }

main { display: block; flex: 1 0 auto; padding-bottom: 2rem; }
h1 { margin: 1.6rem 0 0.4rem; font-size: 1.75rem; line-height: 1.25; }
h2 { margin: 2.2rem 0 0.6rem; font-size: 1.3rem; line-height: 1.3; scroll-margin-top: 1rem; }
h3, h4, h5, h6 { margin: 1.6rem 0 0.5rem; font-size: 1.1rem; line-height: 1.35; }
p, ul, ol, table, blockquote { margin: 0 0 1rem; }
ul, ol { padding-left: 1.5rem; }
main li + li { margin-top: 0.3rem; }
main li > ul, main li > ol { margin-top: 0.3rem; margin-bottom: 0; }
.meta { margin: 0 0 1rem; color: var(--muted); }
strong { font-weight: 650; }

.toc { margin: 1.25rem 0 1.5rem; padding: 0.8rem 1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; }
.toc-title { margin: 0 0 0.4rem; font-weight: 700; }
.toc ul { display: block; }
.toc li + li { margin-top: 0.15rem; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 0.5rem 0.7rem; border: 1px solid var(--border); text-align: left; vertical-align: top;
  hyphens: auto; -webkit-hyphens: auto; overflow-wrap: anywhere; }
@media (max-width: 30rem) { th, td { padding: 0.4rem 0.45rem; } }
th { background: var(--surface); }
.r { text-align: right; }
.c { text-align: center; }
blockquote { margin-left: 0; padding: 0.1rem 1rem; background: var(--surface); border-left: 4px solid var(--border); }
hr { margin: 2rem 0; border: 0; border-top: 1px solid var(--rule); }
code { padding: 0.1em 0.3em; background: var(--surface); border-radius: 4px; overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; }

mark.todo { padding: 0.05em 0.3em; background: var(--todo-bg); color: var(--todo-fg); border-radius: 4px;
  outline: 1px dashed var(--todo-edge); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.lang-grid { display: grid; gap: 1rem; margin: 1.5rem 0; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.card { padding: 0.25rem 1.25rem 0.75rem; border: 1px solid var(--border); border-radius: 8px; }
.card h2 { margin-top: 1rem; }
.card ul { margin-bottom: 0; }

.site-footer { padding: 1rem 0 1.5rem; background: var(--surface); border-top: 1px solid var(--rule); }
.site-footer p { margin: 0 0 0.5rem; }
.site-footer p:last-child { margin-bottom: 0; }

@page { margin: 16mm; }
@media print {
  :root {
    --bg: #ffffff; --fg: #000000; --muted: #000000; --link: #000000; --visited: #000000;
    --border: #000000; --rule: #000000; --surface: #ffffff;
    --todo-bg: #ffffff; --todo-fg: #000000; --todo-edge: #000000;
  }
  body { display: block; min-height: 0; font-size: 11pt; line-height: 1.45; }
  .skip, .site-header nav, .toc { display: none; }
  .wrap { padding: 0; }
  h1, h2, h3 { break-after: avoid; }
  table, tr, blockquote, li { break-inside: avoid; }
  mark.todo { outline: 1px solid #000000; }
  .site-footer, .site-header { background: none; }
}
