/* ── ساوم — site system ─────────────────────────────────────────────────────
   The app's own "Emerald & Sand" tokens (lib/theme/tokens.dart), worn in
   daylight the way the app wears them: warm ivory ground, white cards,
   emerald for the one action and the live state, gold only for trust marks,
   red only for the final minute. Type is the app's: IBM Plex Sans Arabic for
   words, IBM Plex Mono for every number that moves.
   Shared by index, support, terms and privacy; page-only rules stay inline. */

@font-face {
  font-family: 'SaudiRiyal';
  src: url('fonts/SaudiRiyal.ttf') format('truetype');
  unicode-range: U+20C1;
  font-display: block;
}

:root {
  color-scheme: light;
  --bg: #F5F2EB;
  --bg-deep: #EFEBE2;
  --paper: #FBF9F4;
  --surface: #FFFFFF;
  --ink: #121A16;
  --text2: #384440;
  --muted: #5C6964;
  --muted2: #6B7873;
  --muted3: #8B958F;
  --line: #E5E0D5;
  --hair: #ECE8DF;
  --border: #D8D2C5;

  --accent: #0B5E45;
  --accent-deep: #06432F;
  --accent-night: #04291D;
  --accent-soft: #2F7D63;
  --accent-tint: #E3F0E9;
  --accent-mint: #7FD4B0;
  --accent-pale: #A9D6C5;
  --live: #5FD3A6;

  --gold: #B8903B;
  --gold-deep: #8F6B22;
  --gold-glow: #E3C27A;
  --gold-tint: #F8F0DC;
  --gold-line: #E8D8B0;

  --warn: #8F6412;
  --warn-tint: #FBF2DF;
  --warn-line: #EFDDB4;

  --urgent: #B9331F;
  --urgent-btn: #D9432F;
  --urgent-tint: #FBEBE8;
  --urgent-line: #F0D9D4;
  --urgent-dot: #FF6B5E;
  --urgent-glow: #FF9C90;
  --final-bg: #160A08;

  --night: #0B1511;
  --ivory-dim: #A9BBB1;
  --ivory-mute: #7E8F86;

  --ar: 'IBM Plex Sans Arabic', 'Segoe UI', Tahoma, sans-serif;
  --mono: 'IBM Plex Mono', 'IBM Plex Sans Arabic', ui-monospace, monospace;
  --sar: 'SaudiRiyal', 'IBM Plex Sans Arabic', sans-serif;

  --r-sm: 10px; --r-md: 14px; --r-lg: 18px; --r-xl: 22px; --r-2xl: 32px;
  --card-shadow: 0 1px 2px rgba(18,26,22,.035), 0 10px 28px -6px rgba(18,26,22,.06);
  --lift-shadow: 0 2px 4px rgba(18,26,22,.04), 0 26px 50px -18px rgba(18,26,22,.22);
  --ease: cubic-bezier(.2,.7,.2,1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ar);
  font-size: 16px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px;
}
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 32px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Numbers — every figure is fixed-width so a ticking price never jitters */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.sar { font-family: var(--sar); font-weight: 400; font-size: .82em; margin-inline-start: .22em; color: inherit; opacity: .8; }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--ar); font-size: 16px; font-weight: 700; line-height: 1.4;
  padding: 15px 28px; border-radius: 16px; border: 1px solid transparent; cursor: pointer;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background-color .18s, color .18s, border-color .18s;
}
.btn svg { flex: none; }
.btn-primary {
  background: linear-gradient(180deg, #12735A, var(--accent-deep));
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 12px 26px -10px rgba(6,67,47,.55);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.18) inset, 0 18px 32px -12px rgba(6,67,47,.6); }
.btn-quiet { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-quiet:hover { border-color: var(--accent-pale); color: var(--accent); transform: translateY(-2px); }
.btn-light { background: #fff; color: var(--accent-deep); box-shadow: 0 14px 30px -14px rgba(0,0,0,.45); }
.btn-light:hover { transform: translateY(-2px); }
.btn-outline-light { color: #EAF4EF; border-color: rgba(234,244,239,.28); }
.btn-outline-light:hover { border-color: #EAF4EF; transform: translateY(-2px); }
.btn-sm { font-size: 14.5px; padding: 10px 18px; border-radius: 12px; }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; line-height: 1.4;
  padding: 6px 12px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text2);
}
.chip svg { flex: none; }
.chip-live { background: var(--accent-tint); border-color: transparent; color: var(--accent); }
.chip-gold { background: var(--gold-tint); border-color: var(--gold-line); color: var(--gold-deep); }
.chip-warn { background: var(--warn-tint); border-color: var(--warn-line); color: var(--warn); }
.chip-urgent { background: var(--urgent-tint); border-color: var(--urgent-line); color: var(--urgent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex: none; }
.dot.pulse { animation: pulse 2.2s ease-out infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(95,211,166,.5); }
  70% { box-shadow: 0 0 0 9px rgba(95,211,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(95,211,166,0); }
}

/* ── Header ────────────────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: rgba(245,242,235,.84);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, box-shadow .25s;
}
.site-head.scrolled { border-bottom-color: var(--line); box-shadow: 0 8px 24px -18px rgba(18,26,22,.25); }
.head-row { display: flex; align-items: center; gap: 28px; height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-size: 23px; font-weight: 700; line-height: 1; }
.brand img { width: 38px; height: 38px; border-radius: 11px; box-shadow: 0 6px 14px -6px rgba(6,67,47,.5); }
.site-nav { display: flex; align-items: center; gap: 4px; margin-inline-start: auto; }
.site-nav a {
  color: var(--text2); font-size: 15px; font-weight: 500;
  padding: 8px 13px; border-radius: 10px; transition: background-color .15s, color .15s;
}
.site-nav a:hover { background: var(--bg-deep); color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-tint); }
.head-cta { flex: none; }
@media (max-width: 900px) {
  .site-nav .opt { display: none; }
}
@media (max-width: 560px) {
  .head-row { gap: 12px; height: 64px; }
  .brand { font-size: 21px; }
  .brand img { width: 34px; height: 34px; }
  .site-nav a { padding: 7px 9px; font-size: 14px; }
}

/* ── Section scaffolding ───────────────────────────────────────────────── */
.kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 14px; font-weight: 600; color: var(--accent); line-height: 1.5;
}
.kicker::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
.h2 {
  font-size: clamp(30px, 4.4vw, 50px); font-weight: 700; line-height: 1.3;
  margin: 12px 0 14px; text-wrap: balance; letter-spacing: 0;
}
.intro { font-size: 17.5px; color: var(--text2); max-width: 36em; margin: 0; text-wrap: pretty; }

/* Scroll reveal — armed only when JS runs and motion is welcome */
.rv { transition: opacity .8s var(--ease), transform .8s var(--ease); }
.rv-armed .rv { opacity: 0; transform: translateY(22px); }
.rv-armed .rv.in { opacity: 1; transform: none; }

/* ── Footer ────────────────────────────────────────────────────────────── */
.site-foot { background: var(--night); color: var(--ivory-dim); padding: 72px 0 36px; }
.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 40px; }
@media (max-width: 900px) { .foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .foot-grid { grid-template-columns: 1fr; gap: 30px; } }
.foot-brand { display: inline-flex; align-items: center; gap: 11px; color: #F5F2EB; font-size: 24px; font-weight: 700; line-height: 1; }
.foot-brand img { width: 40px; height: 40px; border-radius: 12px; }
.foot-grid p { font-size: 14px; margin: 14px 0 0; max-width: 28em; line-height: 1.9; }
.foot-grid h3 { font-size: 13px; font-weight: 600; color: var(--ivory-mute); margin: 4px 0 14px; letter-spacing: 0; }
.foot-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.foot-grid a { color: #DCE6E0; font-size: 14.5px; }
.foot-grid a:hover { color: var(--accent-mint); }
.foot-base {
  margin-top: 56px; padding-top: 22px; border-top: 1px solid rgba(245,242,235,.09);
  display: flex; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  font-size: 13px; color: var(--ivory-mute);
}
.foot-base .ltr { font-size: 12.5px; }

/* ── Document pages (support, terms, privacy) ──────────────────────────── */
.page-hero { padding: 64px 0 44px; position: relative; overflow: hidden; }
.page-hero::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(560px 300px at 12% 10%, rgba(127,212,176,.2), transparent 70%),
    radial-gradient(460px 280px at 95% 0%, rgba(227,194,122,.14), transparent 70%);
}
.page-hero .wrap { position: relative; }
.page-hero h1 { font-size: clamp(36px, 5.4vw, 60px); font-weight: 700; line-height: 1.25; margin: 14px 0 14px; text-wrap: balance; }
.page-hero .lede { font-size: 18px; color: var(--text2); max-width: 36em; margin: 0; text-wrap: pretty; }
.doc-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 48px; align-items: start; padding-bottom: 104px; }
.doc-layout.solo { grid-template-columns: minmax(0, 1fr); }
.doc-layout.solo .doc > p, .doc-layout.solo .doc > h2, .doc-layout.solo .faq { max-width: 52em; }
@media (max-width: 960px) { .doc-layout { grid-template-columns: minmax(0, 1fr); gap: 0; } }
.doc-side { position: sticky; top: 96px; max-height: calc(100vh - 120px); overflow: auto; padding-bottom: 12px; }
@media (max-width: 960px) { .doc-side { display: none; } }
.doc-side h2 { font-size: 13px; font-weight: 600; color: var(--muted2); margin: 4px 0 10px; }
.doc-side .toc { list-style: none; margin: 0; padding: 0; columns: 1; font-size: 14px; }
.doc-side .toc li { margin: 0; }
.doc-side .toc a {
  display: flex; gap: 8px; color: var(--text2); line-height: 1.55;
  padding: 7px 12px; border-radius: 10px; border-inline-start: 2px solid transparent;
}
.doc-side .toc a:hover { background: var(--bg-deep); color: var(--ink); }
.doc-side .toc a.on { background: var(--surface); color: var(--accent); border-inline-start-color: var(--accent); box-shadow: var(--card-shadow); }
.doc {
  background: var(--surface); border-radius: var(--r-xl);
  border: 1px solid var(--hair); box-shadow: var(--card-shadow);
  padding: 40px 48px 48px; min-width: 0;
}
@media (max-width: 560px) { .doc { padding: 26px 20px 32px; border-radius: var(--r-lg); } }
.doc-meta {
  display: flex; gap: 8px; flex-wrap: wrap; align-items: center;
  padding-bottom: 20px; border-bottom: 1px solid var(--hair); margin-bottom: 8px;
}
.doc-meta span { font-size: 13px; font-weight: 500; color: var(--muted); background: var(--paper); border: 1px solid var(--hair); padding: 4px 12px; border-radius: 999px; }
.doc-meta .num { direction: ltr; unicode-bidi: isolate; }
.doc .toc { margin: 20px 0 8px; padding: 0; list-style: none; columns: 2; column-gap: 28px; font-size: 14.5px; }
@media (min-width: 961px) { .doc .toc.inline { display: none; } }
@media (max-width: 560px) { .doc .toc { columns: 1; } }
.doc .toc li { break-inside: avoid; margin: 0 0 5px; }
.doc .toc a { color: var(--text2); }
.doc .toc a:hover { color: var(--accent); }
.toc .n, .doc h2 .n {
  font-family: var(--mono); font-size: 12.5px; font-weight: 500; color: var(--accent);
  margin-inline-end: 8px; flex: none; min-width: 1.6em;
}
.doc h2 {
  font-size: 23px; font-weight: 700; line-height: 1.5;
  margin: 40px 0 10px; padding-top: 28px; border-top: 1px solid var(--hair);
  display: flex; align-items: baseline; gap: 4px;
}
.doc h2 .n {
  display: inline-grid; place-items: center; min-width: 32px; height: 28px; padding: 0 6px;
  background: var(--accent-tint); border-radius: 8px; font-size: 13px; margin-inline-end: 10px;
  transform: translateY(-2px);
}
.doc p { margin: 0 0 12px; color: var(--text2); font-size: 16px; }
.doc ul, .doc ol { margin: 0 0 14px; padding: 0 22px 0 0; color: var(--text2); font-size: 16px; }
.doc li { margin: 0 0 7px; padding-inline-start: 4px; }
.doc li::marker { color: var(--accent-soft); }
.doc p:last-child, .doc ul:last-child { margin-bottom: 0; }
.doc strong { color: var(--ink); font-weight: 600; }
.doc a:not(.btn) { border-bottom: 1px solid var(--accent-pale); }
.doc a:not(.btn):hover { border-bottom-color: var(--accent); }
.doc .toc a, .doc .toc a:hover { border-bottom: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .dot.pulse { animation: none; }
  .btn, .btn:hover { transition: none; transform: none; }
  .rv, .rv-armed .rv { transition: none; opacity: 1; transform: none; }
}
