:root {
  --bg: #ffffff;
  --text: #141414;
  --muted: #5e5e5e;
  --line: #e6e6e6;
  --soft: #f6f6f6;
  --gold: #f8be12;
  --link: #141414;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #f2f2f2;
    --muted: #a3a3a3;
    --line: #2c2c2c;
    --soft: #1c1c1c;
    --link: #f2f2f2;
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Naskh Arabic", Tahoma, Arial, sans-serif;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration-color: var(--gold); text-underline-offset: 3px; }

/* top bar */
.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.bar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; text-decoration: none; color: var(--text); }
.brand span { color: var(--gold); }
.nav { display: flex; align-items: center; gap: 20px; font-size: 15px; font-weight: 600; }
.nav a { text-decoration: none; color: var(--text); }
.lang {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

/* landing */
.hero { max-width: 1180px; margin: 0 auto; padding: 96px 24px 72px; }
.hero h1 { font-size: clamp(40px, 7vw, 76px); line-height: 1.05; letter-spacing: -2px; margin: 0 0 20px; font-weight: 800; }
.hero h1 mark { background: var(--gold); color: #141414; padding: 0 12px; border-radius: 12px; }
.hero p { font-size: 20px; color: var(--muted); max-width: 640px; margin: 0 0 32px; }
.pills { display: flex; flex-wrap: wrap; gap: 12px; }
.pill {
  display: inline-block;
  padding: 14px 24px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
}
.pill.alt { background: var(--soft); color: var(--text); border: 1px solid var(--line); }

/* legal pages */
.legal { max-width: 1180px; margin: 0 auto; padding: 48px 24px 96px; display: grid; grid-template-columns: 280px 1fr; gap: 56px; }
.toc { position: sticky; top: 90px; align-self: start; max-height: calc(100vh - 120px); overflow: auto; font-size: 15px; }
.toc h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--muted); margin: 0 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.toc li { counter-increment: toc; margin: 0; }
.toc a {
  display: block;
  padding: 7px 0 7px 14px;
  border-left: 2px solid var(--line);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}
.toc a::before { content: counter(toc) ". "; }
.toc a:hover, .toc a.on { color: var(--text); border-left-color: var(--gold); }
[dir="rtl"] .toc a { padding: 7px 14px 7px 0; border-left: 0; border-right: 2px solid var(--line); }
[dir="rtl"] .toc a:hover, [dir="rtl"] .toc a.on { border-right-color: var(--gold); }

.doc h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.1; letter-spacing: -1.2px; margin: 0 0 12px; font-weight: 800; }
.doc .updated { color: var(--muted); font-weight: 600; margin: 0 0 32px; }
.doc .lead { font-size: 19px; margin: 0 0 40px; }
.doc section { padding-top: 12px; margin-bottom: 8px; scroll-margin-top: 90px; }
.doc h2 { font-size: 26px; line-height: 1.25; margin: 32px 0 12px; letter-spacing: -0.4px; }
.doc p { margin: 0 0 14px; }
.doc ul { margin: 0 0 16px; padding-inline-start: 22px; }
.doc li { margin-bottom: 8px; }
.doc strong { font-weight: 700; }
.note { background: var(--soft); border-inline-start: 4px solid var(--gold); padding: 14px 18px; border-radius: 8px; margin: 0 0 20px; }

footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
footer .in { max-width: 1180px; margin: 0 auto; padding: 28px 24px; display: flex; flex-wrap: wrap; gap: 16px 28px; justify-content: space-between; }
footer a { color: var(--muted); }

[lang="ar"] .doc h1, [lang="ar"] .hero h1 { letter-spacing: 0; }
[lang="ar"] .doc h2 { letter-spacing: 0; }

@media (max-width: 860px) {
  .legal { grid-template-columns: 1fr; gap: 24px; padding-top: 28px; }
  .toc { position: static; max-height: none; }
  .hero { padding: 56px 24px 48px; }
}
