/* Rewire — one stylesheet for every page, in both languages.
   The tokens are the app's own (lib/theme/app_colors.dart, onb_tokens.dart),
   so the site and the app read as one thing. Direction is handled with
   logical properties (margin-inline, text-align: start) rather than left and
   right, so the Arabic pages need no rules of their own. */

:root {
  --ink: #0e0e0e;
  --page: #fafafb;
  --surface: #ffffff;
  --border: #ecedef;
  --muted-surface: #f1f2f4;
  --text-secondary: #5b606b;
  --text-muted: #9aa0aa;
  --green: #1f8a5b;
  --green-deep: #14603f;
  --green-soft: #e1f1e8;
  --coral: #ef7a57;
  --radius: 22px;
  --radius-sm: 14px;
  --display: 'Sora', system-ui, -apple-system, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, sans-serif;
  --page-width: 1040px;
}

html[lang='ar'] {
  --display: 'Tajawal', system-ui, -apple-system, sans-serif;
  --body: 'Tajawal', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: 20px;
}

/* ── Header ──────────────────────────────────────────────────────────── */

header.site {
  padding-block: 18px;
  border-bottom: 1px solid var(--border);
  background: var(--page);
  position: sticky;
  top: 0;
  z-index: 10;
}

header.site .wrap {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.4px;
  color: var(--ink);
  text-decoration: none;
}

html[lang='ar'] .brand {
  letter-spacing: 0;
}

.brand img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

nav.site {
  margin-inline-start: auto;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

nav.site a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
}

nav.site a:hover {
  color: var(--ink);
}

.lang {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink) !important;
}

/* ── Type ────────────────────────────────────────────────────────────── */

h1,
h2,
h3 {
  font-family: var(--display);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.5px;
  line-height: 1.22;
  margin: 0 0 14px;
}

html[lang='ar'] h1,
html[lang='ar'] h2,
html[lang='ar'] h3 {
  letter-spacing: 0;
  line-height: 1.4;
}

h1 {
  font-size: clamp(34px, 6vw, 52px);
}

h2 {
  font-size: clamp(25px, 4vw, 33px);
  margin-top: 8px;
}

h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

p {
  margin: 0 0 16px;
  color: var(--text-secondary);
}

.lead {
  font-size: 19px;
  max-width: 60ch;
}

a {
  color: var(--green-deep);
}

strong {
  color: var(--ink);
}

/* ── Sections and cards ──────────────────────────────────────────────── */

section {
  padding-block: 58px;
  border-bottom: 1px solid var(--border);
}

section:last-of-type {
  border-bottom: 0;
}

.kicker {
  font-family: var(--display);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}

html[lang='ar'] .kicker {
  letter-spacing: 0;
}

.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 26px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}

.card p:last-child {
  margin-bottom: 0;
}

.step {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-family: var(--display);
  font-weight: 800;
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}

/* ── Hero ────────────────────────────────────────────────────────────── */

.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  padding-block: 56px 64px;
}

.hero img {
  width: 100%;
  max-width: 380px;
  margin-inline: auto;
  display: block;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
    padding-block: 34px 44px;
  }

  .hero img {
    max-width: 260px;
    order: -1;
  }
}

.badges {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 26px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 15px;
  padding: 13px 22px;
  border-radius: 999px;
}

.badge.ghost {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

/* A store button before the app is listed: still a button, plainly not
   yet a link. */
.badge-soon,
.badge-soon.ghost {
  background: var(--muted-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: default;
}

.note {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ── Prose (legal and help pages) ────────────────────────────────────── */

.prose {
  max-width: 72ch;
  padding-block: 46px 70px;
}

.prose h2 {
  margin-top: 38px;
  font-size: 23px;
}

.prose h3 {
  margin-top: 26px;
}

.prose ul,
.prose ol {
  color: var(--text-secondary);
  padding-inline-start: 22px;
  margin: 0 0 16px;
}

.prose li {
  margin-bottom: 9px;
}

.prose .updated {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 26px;
}

.callout {
  background: var(--green-soft);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 0 0 22px;
}

.callout p:last-child,
.card p:last-child {
  margin-bottom: 0;
}

.callout.warn {
  background: #fbf0ee;
}

details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 10px;
}

details summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  color: var(--ink);
}

details[open] summary {
  margin-bottom: 10px;
}

/* ── Footer ──────────────────────────────────────────────────────────── */

footer.site {
  border-top: 1px solid var(--border);
  padding-block: 34px 48px;
  background: var(--surface);
}

footer.site .links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

footer.site a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 15px;
}

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

footer.site .fine {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* Anything the config in site.js has not filled in yet. Loud on purpose,
   and readable: a dark badge turning yellow kept its white text and could
   not be read at all. */
.todo {
  background: #fff6d6;
  color: #6b5200;
  border: 1px dashed #e0c65a;
}
