/* ORBGRID legal site.
   Deliberately dependency-free: no external fonts, no CDN, no scripts, no
   cookies, no analytics. A privacy site should not make third-party requests
   just to render itself. System font stacks keep it fast and offline-friendly.
   Logical CSS properties (inline-start/end) make the Arabic RTL layout work
   from the same rules as LTR. */

:root {
  --bg: #08090f;
  --surface: #0f1220;
  --surface-2: #12162a;
  --line: #242b3a;
  --line-soft: #1b2130;
  --text: #e8ecf6;
  --muted: #9aa5bf;
  --faint: #6e7790;
  --accent: #f5a623;
  --focus: #6ea8ff;
  --maxw: 46rem;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", "Noto Kufi Arabic", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  overflow-wrap: break-word;
}

/* Arabic renders small in most system faces — nudge it up for comfort. */
html[dir="rtl"] body { font-size: 1.06rem; line-height: 1.9; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.15rem; }

/* ── Skip link (keyboard + screen-reader users) ───────────────────────────── */
.skip {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  z-index: 10;
  background: var(--accent);
  color: #08090f;
  padding: 0.6rem 1rem;
  border-radius: 0 0 8px 8px;
  font-weight: 700;
}
.skip:focus { inset-inline-start: 0; }

/* ── Header ───────────────────────────────────────────────────────────────── */
header.site {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0e1a, var(--bg));
}
.bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.15rem;
  padding-bottom: 0.5rem;
}
.brand { text-decoration: none; color: inherit; display: block; }
.brand-name {
  display: block;
  font-weight: 800;
  font-size: 1.16rem;
  letter-spacing: 0.14em;
  color: var(--text);
}
.brand-tag {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-top: 0.15rem;
}

.langs { display: flex; gap: 0.4rem; flex-wrap: wrap; }
.langs a {
  font-size: 0.82rem;
  padding: 0.28rem 0.62rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  background: var(--surface);
}
.langs a:hover { color: var(--text); border-color: #33415c; }
.langs a[aria-current="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #08090f;
  font-weight: 700;
}

.tabs {
  display: flex;
  gap: 0.35rem 1.1rem;
  flex-wrap: wrap;
  padding-bottom: 0.9rem;
}
.tabs a {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.tabs a:hover { color: var(--text); border-bottom-color: var(--accent); }

/* ── Content ──────────────────────────────────────────────────────────────── */
main { padding: 2rem 0 3rem; }

h1 {
  font-size: clamp(1.6rem, 5vw, 2.1rem);
  line-height: 1.25;
  margin: 0 0 0.6rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: 1.12rem;
  margin: 2.3rem 0 0.6rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line-soft);
  scroll-margin-top: 1rem;
}
h2:first-of-type { border-top: 0; padding-top: 0; }

p { margin: 0.75rem 0; }
.meta { color: var(--faint); font-size: 0.88rem; margin-top: 0; }

a { color: var(--focus); text-underline-offset: 0.18em; }
a:hover { color: #a7c8ff; }

ul { margin: 0.75rem 0; padding-inline-start: 1.35rem; }
li { margin: 0.42rem 0; }

code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 0.08em 0.36em;
}
strong { color: #f3f6fd; }
.muted { color: var(--faint); font-size: 0.86em; }

/* Callout for summaries and status notes. */
.note {
  margin: 1.15rem 0;
  padding: 0.85rem 1rem;
  background: rgba(245, 166, 35, 0.06);
  border: 1px solid rgba(245, 166, 35, 0.32);
  border-inline-start: 3px solid var(--accent);
  border-radius: 10px;
}
.note p { margin: 0; color: #f0e6d2; }

/* ── ORBGRIDplus wordmark (mirrors the in-game mark) ──────────────────────── */
.ogp { font-weight: 800; letter-spacing: 0.045em; white-space: nowrap; color: var(--text); }
.ogp > span {
  font-size: 0.64em;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--accent);
}

/* ── Table of contents ────────────────────────────────────────────────────── */
.toc {
  margin: 1.3rem 0 1.9rem;
  padding: 0.9rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
.toc-h {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 0 0 0.5rem;
  border: 0;
  padding: 0;
}
.toc ol { margin: 0; padding-inline-start: 1.3rem; color: var(--muted); }
.toc li { margin: 0.22rem 0; }
.toc a { color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); text-decoration: underline; }

/* ── Third-party table ────────────────────────────────────────────────────── */
.tablewrap {
  overflow-x: auto;
  margin: 1.1rem 0;
  border: 1px solid var(--line);
  border-radius: 10px;
}
table { border-collapse: collapse; width: 100%; min-width: 34rem; font-size: 0.9rem; }
th, td {
  text-align: start;
  vertical-align: top;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--line-soft);
}
thead th {
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}
tbody tr:last-child td { border-bottom: 0; }

.top { margin-top: 2.4rem; font-size: 0.88rem; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
footer.site {
  border-top: 1px solid var(--line);
  padding: 1.5rem 0 2.4rem;
  color: var(--faint);
  font-size: 0.86rem;
}
footer.site p { margin: 0.35rem 0; }
footer.site a { color: var(--muted); }
.fine a { text-decoration: none; }
.fine a:hover { text-decoration: underline; }

/* ── Accessibility & preferences ──────────────────────────────────────────── */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* The site is dark by design (it matches the game). Light-preference users get
   a slightly lifted surface set rather than a different identity. */
@media (prefers-color-scheme: light) {
  :root {
    --bg: #f4f6fc;
    --surface: #ffffff;
    --surface-2: #eef1f9;
    --line: #d8deec;
    --line-soft: #e6eaf4;
    --text: #12162a;
    --muted: #4a5272;
    --faint: #6b7391;
    --focus: #1a56c4;
  }
  header.site { background: linear-gradient(180deg, #ffffff, var(--bg)); }
  .note p { color: #4a3a13; }
  .ogp { color: var(--text); }
}

@media print {
  header.site, footer.site, .toc, .skip, .top { display: none; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a { color: #000; text-decoration: underline; }
}
