/* Open Intelligence Agent (OIA) — public site styles.
   Mobile-first, RTL, no external fonts, no trackers, no JavaScript. */

:root {
  --bg: #f6f4ee;
  --surface: #ffffff;
  --ink: #15231f;
  --muted: #55645f;
  --line: #dfe3dc;
  --accent: #0f5132;
  --accent-ink: #ffffff;
  --accent-soft: #e7efe9;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(21, 35, 31, 0.06), 0 8px 24px rgba(21, 35, 31, 0.05);
  --max: 68rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10201b;
    --surface: #16281f;
    --ink: #eef4ef;
    --muted: #b3c4ba;
    --line: #2a3f34;
    --accent: #7fd1a8;
    --accent-ink: #0b1a14;
    --accent-soft: #1c3329;
    --shadow: none;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Naskh Arabic", "Geeza Pro", Tahoma, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 {
  line-height: 1.4;
  margin: 0 0 0.6rem;
  font-weight: 700;
  letter-spacing: 0;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.08rem; }

p { margin: 0 0 1rem; }

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

a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

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

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -3rem;
  background: var(--surface);
  color: var(--ink);
  padding: 0.5rem 0.9rem;
  border-radius: 0 0 8px 8px;
  z-index: 10;
  transition: top 0.15s ease;
}

.skip-link:focus { top: 0; }

/* Header */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem 1rem;
  padding-top: 0.8rem;
  padding-bottom: 0.8rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}

.brand-text strong { font-size: 1rem; }

.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.9rem;
  font-size: 0.92rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted);
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* Hero */

.hero {
  padding-top: 2.2rem;
  padding-bottom: 1.4rem;
}

.eyebrow {
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 0.7rem;
}

.hero h1 {
  font-size: 1.9rem;
  margin-bottom: 0.9rem;
}

.latin {
  display: block;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
  letter-spacing: 0.01em;
}

.h1-ar { display: block; }

.lead {
  font-size: 1.05rem;
  max-width: 46rem;
}

.lead-en {
  font-size: 0.9rem;
  color: var(--muted);
  max-width: 46rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin: 1.4rem 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.68rem 1.15rem;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.btn-primary:hover { filter: brightness(1.06); }

.btn-ghost {
  border-color: var(--line);
  color: var(--ink);
  background: transparent;
}

.btn-ghost:hover { background: var(--accent-soft); }

.note {
  font-size: 0.85rem;
  color: var(--muted);
  border-inline-start: 3px solid var(--line);
  padding-inline-start: 0.8rem;
  margin-top: 1.2rem;
}

/* Sections */

.section {
  padding-top: 1.9rem;
  padding-bottom: 1.2rem;
  border-top: 1px solid var(--line);
}

.section-sub {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: -0.35rem;
  margin-bottom: 1.1rem;
}

.cards {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.1rem 0.9rem;
  box-shadow: var(--shadow);
}

.card h3 { margin-bottom: 0.35rem; }

.card p { margin-bottom: 0.45rem; font-size: 0.96rem; }

.card-en {
  font-size: 0.76rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 0;
}

.plain-list {
  margin: 0 0 1.2rem;
  padding-inline-start: 1.15rem;
}

.plain-list li { margin-bottom: 0.55rem; }

.callout {
  background: var(--accent-soft);
  border-radius: var(--radius);
  padding: 1rem 1.1rem 0.6rem;
}

.callout h3 { margin-bottom: 0.3rem; }

.callout p { margin-bottom: 0.6rem; font-size: 0.95rem; }

.mail {
  font-weight: 600;
  word-break: break-word;
}

.small { font-size: 0.92rem; color: var(--muted); }

/* Policy pages */

.page-head {
  padding-top: 2rem;
  padding-bottom: 0.6rem;
}

.page-head h1 { font-size: 1.7rem; }

.page-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.policy {
  padding-top: 0.8rem;
  padding-bottom: 1.5rem;
  max-width: 52rem;
}

.policy h2 {
  margin-top: 1.9rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line);
}

.policy h2:first-of-type {
  margin-top: 1.1rem;
  border-top: 0;
  padding-top: 0;
}

.policy h3 { margin-top: 1.2rem; }

.policy ul,
.policy ol {
  padding-inline-start: 1.2rem;
  margin: 0 0 1rem;
}

.policy li { margin-bottom: 0.4rem; }

.policy .en-note {
  font-size: 0.88rem;
  color: var(--muted);
}

.quote {
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 0.9rem 1rem;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.table-scroll {
  overflow-x: auto;
  margin: 0 0 1.2rem;
  border: 1px solid var(--line);
  border-radius: 10px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
}

th, td {
  text-align: start;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  background: var(--accent-soft);
  font-weight: 700;
}

tr:last-child td { border-bottom: 0; }

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: var(--accent-soft);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

/* Footer */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 1.2rem 0;
  margin-top: 1.4rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.footer-inner p { margin: 0; }

.site-footer nav {
  display: flex;
  gap: 1rem;
}

.site-footer a { color: var(--muted); }

/* Larger screens */

@media (min-width: 720px) {
  body { font-size: 18px; }

  .hero { padding-top: 3.2rem; }

  .hero h1 { font-size: 2.5rem; }

  .latin { font-size: 1.2rem; }

  h2 { font-size: 1.55rem; }

  .cards { grid-template-columns: 1fr 1fr; }

  .section { padding-top: 2.6rem; padding-bottom: 1.6rem; }

  .page-head { padding-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip-link { transition: none; }
}

@media print {
  .site-header, .site-footer, .cta-row, .skip-link { display: none; }
  body { background: #fff; color: #000; }
  .card, .callout { border: 1px solid #ccc; box-shadow: none; }
}
