/* Self-contained on purpose: no web fonts, no scripts from other hosts, no
   cookies, no analytics. A privacy page should not be the thing that tracks you. */
:root {
  --bg: #fbfaf8;
  --surface: #ffffff;
  --surface-2: #f4f1ec;
  --text: #1c1a17;
  --muted: #5f5a52;
  --line: #e3ded5;
  --accent: #9a6b16;
  --accent-soft: #f6efe0;
  --radius: 14px;
  --maxw: 780px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #100e0b;
    --surface: #17140f;
    --surface-2: #1e1a14;
    --text: #efeae1;
    --muted: #a49c8f;
    --line: #2c261e;
    --accent: #e0b044;
    --accent-soft: #241d12;
  }
}
* {
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
[dir="rtl"] body,
[lang="ar"] {
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, system-ui, -apple-system, Arial,
    sans-serif;
}
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 96px;
}

/* Header */
.top {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}
.top-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand svg {
  display: block;
}
.switch {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  background: var(--surface-2);
}
.switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}
.switch button[aria-pressed="true"] {
  background: var(--accent);
  color: #14110c;
}
@media (prefers-color-scheme: dark) {
  .switch button[aria-pressed="true"] {
    color: #14110c;
  }
}
.switch button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Hero */
h1 {
  font-size: clamp(1.9rem, 5vw, 2.5rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 40px 0 10px;
}
.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 8px;
  max-width: 62ch;
}
.meta {
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 28px;
}
.meta b {
  color: var(--text);
  font-weight: 600;
}

/* At a glance */
.glance {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 36px;
}
.glance h2 {
  margin: 0 0 10px;
  font-size: 1rem;
}
.glance ul {
  margin: 0;
  padding-inline-start: 20px;
}
.glance li {
  margin: 6px 0;
}

/* TOC */
nav.toc {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 22px;
  margin: 0 0 44px;
  background: var(--surface);
}
nav.toc h2 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
nav.toc ol {
  margin: 0;
  padding-inline-start: 20px;
  columns: 2;
  column-gap: 28px;
  font-size: 0.95rem;
}
@media (max-width: 620px) {
  nav.toc ol {
    columns: 1;
  }
}
nav.toc li {
  margin: 3px 0;
  break-inside: avoid;
}

h2 {
  font-size: 1.32rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  scroll-margin-top: 80px;
}
h3 {
  font-size: 1.02rem;
  margin: 26px 0 8px;
}
p {
  margin: 0 0 14px;
  max-width: 68ch;
}
ul,
ol {
  max-width: 68ch;
}
li {
  margin: 5px 0;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 3px;
}
strong {
  font-weight: 700;
}
code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.86em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 1px 6px;
  border-radius: 6px;
  direction: ltr;
  unicode-bidi: embed;
  display: inline-block;
}

/* Tables */
.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: 18px 0 24px;
  background: var(--surface);
}
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 0.92rem;
}
caption {
  caption-side: top;
  text-align: start;
  color: var(--muted);
  font-size: 0.86rem;
  padding: 12px 16px 0;
}
th,
td {
  text-align: start;
  padding: 11px 16px;
  vertical-align: top;
}
thead th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
}
tbody tr + tr {
  border-top: 1px solid var(--line);
}
td code {
  white-space: nowrap;
}

.note {
  border-inline-start: 3px solid var(--accent);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 12px 18px;
  margin: 20px 0;
  color: var(--text);
}
[dir="rtl"] .note {
  border-radius: var(--radius) 0 0 var(--radius);
}
.note p:last-child {
  margin-bottom: 0;
}

.contact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  background: var(--surface);
  margin-top: 20px;
}
.contact p:last-child {
  margin-bottom: 0;
}

footer.page {
  border-top: 1px solid var(--line);
  margin-top: 56px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}
.lang-hidden {
  display: none;
}
.skip {
  position: absolute;
  inset-inline-start: -9999px;
}
.skip:focus {
  position: static;
  display: inline-block;
  padding: 8px 12px;
}

/* Print and save-as-PDF: the visible language prints as a plain document. Link
   targets are spelled out, since a printed hyperlink is otherwise a dead end. */
@media print {
  :root {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --text: #000000;
    --muted: #333333;
    --line: #999999;
    --accent: #000000;
    --accent-soft: #ffffff;
  }
  body {
    font-size: 11pt;
    line-height: 1.5;
  }
  .top,
  .switch,
  .skip,
  nav.toc {
    display: none;
  }
  .wrap {
    max-width: none;
    padding: 0;
  }
  h1 {
    margin-top: 0;
  }
  h2 {
    margin-top: 20pt;
    break-after: avoid;
  }
  p,
  li {
    orphans: 3;
    widows: 3;
  }
  .table-scroll,
  table {
    overflow: visible;
    min-width: 0;
    break-inside: auto;
  }
  tr {
    break-inside: avoid;
  }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #333;
    word-break: break-all;
  }
}
