/* ==========================================================================
   Margrow Website · Shared Design System
   Pulled from brand-guidelines v1.0
   ========================================================================== */

:root{
  /* Emerald direction (Marketplace · Growth) */
  --emerald: #047857; --emerald-mid: #34d399; --emerald-soft: #ecfdf5; --emerald-deep: #064e3b;
  --emerald-50: rgba(4,120,87,.5); --emerald-25: rgba(4,120,87,.25); --emerald-10: rgba(4,120,87,.1);

  /* Electric Violet (Product · AI) */
  --violet: #7c3aed; --violet-mid: #c4b5fd; --violet-soft: #f5f3ff; --violet-deep: #4c1d95;
  --violet-50: rgba(124,58,237,.5); --violet-25: rgba(124,58,237,.25); --violet-10: rgba(124,58,237,.1);

  /* Neutrals */
  --ink: #0f0e17; --ink-75: rgba(15,14,23,.75); --ink-50: rgba(15,14,23,.5);
  --ink-10: rgba(15,14,23,.1); --ink-05: rgba(15,14,23,.05);
  --near-black: #1a1825; --soft-bg: #f7f6f1; --page-bg: #f0efe9;
  --border: #e6e4dd; --label: #aaa9a2; --white: #ffffff;

  /* Status */
  --success: #10b981; --warning: #f59e0b; --danger: #ef4444;

  /* Type */
  --ff-en: 'Urbanist', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ff-ar: 'Almarai', 'Al Nile', 'Geeza Pro', 'Noto Sans Arabic', sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Layout */
  --container: 1240px;
  --container-narrow: 980px;
  --radius-sm: 6px; --radius-md: 10px; --radius-lg: 16px; --radius-xl: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(15,14,23,.05);
  --shadow-md: 0 8px 24px -8px rgba(15,14,23,.12);
  --shadow-lg: 0 20px 60px -20px rgba(15,14,23,.20);
}

*,*::before,*::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--page-bg); color: var(--ink);
  font-family: var(--ff-en); font-weight: 400; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
body[dir="rtl"] { font-family: var(--ff-ar); line-height: 1.7; }
h1, h2, h3, h4, h5 { margin: 0; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
body[dir="rtl"] h1, body[dir="rtl"] h2, body[dir="rtl"] h3, body[dir="rtl"] h4, body[dir="rtl"] h5 {
  letter-spacing: 0; line-height: 1.2;
}
p { margin: 0; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

/* ===== Wordmark (bare meem lockup · v2) ==================================== */
.wm {
  display: inline-flex; align-items: center; gap: 4px;
  text-decoration: none; line-height: 1;
  font-family: var(--ff-en); font-weight: 800; letter-spacing: -.03em;
  color: var(--ink);
  direction: ltr;
}
.wm .meem {
  font-family: var(--ff-ar); font-weight: 800;
  font-size: 1.6em; line-height: 1;
  display: inline-block;
  background: linear-gradient(135deg, var(--violet) 0%, var(--violet-deep) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.wm .word { color: inherit; line-height: 1; }
/* Dark backgrounds: wordmark turns white */
.footer .wm, .wm.on-dark { color: var(--white); }
.footer .wm .word, .wm.on-dark .word { color: var(--white); }
.meem-mark {
  font-family: var(--ff-ar); font-weight: 800; line-height: .85;
  direction: rtl; display: inline-block;
}

/* ===== Watermark motif ===================================================== */
.watermark {
  position: absolute; pointer-events: none; user-select: none;
  font-family: var(--ff-ar); font-weight: 800; line-height: .85;
  direction: rtl; white-space: nowrap; color: rgba(255,255,255,.08);
}

/* ===== Layout primitives =================================================== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 28px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 28px; }
.section { padding: 96px 0; }
.section-tight { padding: 56px 0; }

/* ===== Header (sticky nav) ================================================= */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(240,239,233,.86); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--ink-10);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px; max-width: var(--container); margin: 0 auto;
}
.nav { display: flex; gap: 28px; align-items: center; }
.nav a { font-size: 14px; font-weight: 600; color: var(--ink-75); transition: color .15s; }
.nav a:hover { color: var(--violet); }
.header-cta { display: flex; gap: 10px; align-items: center; }
.locale-switch {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-50); padding: 8px 12px; border-radius: 999px;
  border: 1px solid var(--ink-10); background: transparent; transition: all .15s;
}
.locale-switch:hover { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ===== Buttons ============================================================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius-md); border: 0;
  font-family: inherit; font-weight: 700; font-size: 14px; letter-spacing: -.01em;
  transition: transform .12s, box-shadow .15s, background .15s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-lg { padding: 16px 28px; font-size: 15px; }
.btn-violet { background: var(--violet); color: var(--white); }
.btn-violet:hover { background: var(--violet-deep); }
.btn-emerald { background: var(--emerald); color: var(--white); }
.btn-emerald:hover { background: var(--emerald-deep); }
.btn-ink { background: var(--ink); color: var(--white); }
.btn-ink:hover { background: var(--near-black); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink-10); }
.btn-outline:hover { border-color: var(--ink); background: var(--ink); color: var(--white); }
.btn-ghost { background: transparent; color: var(--ink-75); }
.btn-ghost:hover { color: var(--ink); }

/* ===== Hero typography ===================================================== */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase;
  color: var(--violet); padding: 6px 14px; background: var(--violet-soft);
  border-radius: 999px;
}
.eyebrow.emerald { color: var(--emerald-deep); background: var(--emerald-soft); }
body[dir="rtl"] .eyebrow { letter-spacing: .08em; }

.hero-title { font-size: clamp(48px, 6.5vw, 84px); line-height: .98; }
body[dir="rtl"] .hero-title { line-height: 1.15; }
.hero-sub { font-size: 19px; color: var(--ink-75); line-height: 1.55; margin-top: 24px; max-width: 580px; }
body[dir="rtl"] .hero-sub { line-height: 1.8; }

/* ===== Cards =============================================================== */
.card {
  background: var(--white); border: 1px solid var(--ink-10); border-radius: var(--radius-lg);
  padding: 28px; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.card-soft { background: var(--soft-bg); border: 1px solid var(--ink-10); border-radius: var(--radius-lg); padding: 28px; }
.card-dark {
  background:
    radial-gradient(40% 60% at 100% 0%, rgba(124,58,237,.25), transparent 60%),
    radial-gradient(40% 50% at 0% 100%, rgba(4,120,87,.20), transparent 60%),
    var(--near-black);
  color: var(--white); border-radius: var(--radius-lg); padding: 32px;
}

/* ===== Pills =============================================================== */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 11px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .04em;
}
.pill-violet { background: var(--violet-soft); color: var(--violet-deep); }
.pill-emerald { background: var(--emerald-soft); color: var(--emerald-deep); }
.pill-ink { background: var(--ink); color: var(--white); }

/* ===== Footer ============================================================== */
.footer {
  background: var(--ink); color: rgba(255,255,255,.7); padding: 72px 0 32px;
  position: relative; overflow: hidden;
}
.footer::before {
  content: 'م'; position: absolute; font-family: var(--ff-ar); font-weight: 800;
  font-size: 540px; line-height: .85; color: rgba(255,255,255,.03);
  bottom: -120px; right: -30px; pointer-events: none;
}
.footer .container { position: relative; z-index: 1; }
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px;
  padding-bottom: 56px; border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-grid h5 { color: var(--white); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-bottom: 18px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.footer-grid a { font-size: 14px; transition: color .15s; }
.footer-grid a:hover { color: var(--violet-mid); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; font-size: 12px; color: rgba(255,255,255,.5); }

/* ===== Mesh gradient backgrounds =========================================== */
.bg-hero-violet {
  background:
    radial-gradient(60% 80% at 100% 0%, rgba(124,58,237,.10), transparent 55%),
    radial-gradient(50% 60% at 0% 100%, rgba(4,120,87,.06), transparent 60%),
    var(--page-bg);
}
.bg-hero-emerald {
  background:
    radial-gradient(60% 80% at 0% 0%, rgba(4,120,87,.10), transparent 55%),
    radial-gradient(50% 60% at 100% 100%, rgba(124,58,237,.06), transparent 60%),
    var(--page-bg);
}

/* ===== Logo strip ========================================================== */
.logo-strip {
  display: flex; align-items: center; justify-content: center; gap: 48px;
  flex-wrap: wrap; opacity: .55;
}
.logo-strip span {
  font-weight: 700; font-size: 18px; color: var(--ink-50); letter-spacing: -.01em;
}

/* ===== Tabular numerals ==================================================== */
.tabular { font-variant-numeric: tabular-nums; }

/* ===== Saudi Riyal symbol (official 2025 mark from SAMA) =================== */
/* Uses mask-image so the glyph picks up currentColor and scales with em-size. */
.riyal {
  display: inline-block;
  width: 0.92em;
  height: 1em;
  vertical-align: -0.12em;
  margin-inline-end: 0.14em;
  background-color: currentColor;
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1124.14 1256.39'><path d='M699.62 1113.02c-20.06 44.48-33.32 92.75-38.4 143.37l424.51-90.24c20.06-44.47 33.31-92.75 38.4-143.37l-424.51 90.24z M1085.03 895.45c20.06-44.47 33.31-92.74 38.39-143.36l-744 161.65-83.46-381.46c-2.36-10.81 4.51-21.54 15.32-23.92l552.05-119.99c20.06-44.47 33.31-92.74 38.39-143.36l-633.16 137.61L334.79 6c-1.92-7.81-9.84-12.7-17.7-10.93l-309.79 67.32c-7.99 1.74-13.09 9.71-11.39 17.65l298.16 1364.79c1.7 7.99 9.66 13.09 17.65 11.39l309.79-67.31c8.04-1.75 13.08-9.71 11.39-17.65L513.34 1056.45c-2.36-10.81 4.52-21.54 15.33-23.91l552.05-119.99c20.06-44.47 33.31-92.74 38.39-143.36l-633.16 137.61-82.52-377.19c-2.36-10.81 4.52-21.54 15.32-23.91l689.43-149.83z'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1124.14 1256.39'><path d='M699.62 1113.02c-20.06 44.48-33.32 92.75-38.4 143.37l424.51-90.24c20.06-44.47 33.31-92.75 38.4-143.37l-424.51 90.24z M1085.03 895.45c20.06-44.47 33.31-92.74 38.39-143.36l-744 161.65-83.46-381.46c-2.36-10.81 4.51-21.54 15.32-23.92l552.05-119.99c20.06-44.47 33.31-92.74 38.39-143.36l-633.16 137.61L334.79 6c-1.92-7.81-9.84-12.7-17.7-10.93l-309.79 67.32c-7.99 1.74-13.09 9.71-11.39 17.65l298.16 1364.79c1.7 7.99 9.66 13.09 17.65 11.39l309.79-67.31c8.04-1.75 13.08-9.71 11.39-17.65L513.34 1056.45c-2.36-10.81 4.52-21.54 15.33-23.91l552.05-119.99c20.06-44.47 33.31-92.74 38.39-143.36l-633.16 137.61-82.52-377.19c-2.36-10.81 4.52-21.54 15.32-23.91l689.43-149.83z'/></svg>") no-repeat center / contain;
}

/* ===== Anchors ============================================================= */
.anchor { color: var(--violet); font-weight: 600; }
.anchor:hover { text-decoration: underline; }

/* ===== Legal pages ========================================================= */
.legal-prose { max-width: 760px; margin: 0 auto; font-size: 15.5px; line-height: 1.85; color: var(--ink); }
.legal-prose h2 { font-size: 26px; margin-top: 48px; margin-bottom: 14px; color: var(--ink); }
.legal-prose h3 { font-size: 18px; margin-top: 28px; margin-bottom: 8px; color: var(--ink); font-weight: 700; }
.legal-prose p { margin-bottom: 16px; color: var(--ink-75); }
.legal-prose ul { padding-left: 24px; margin-bottom: 16px; color: var(--ink-75); }
body[dir="rtl"] .legal-prose ul { padding-left: 0; padding-right: 24px; }
.legal-prose li { margin-bottom: 8px; }
.legal-prose strong { color: var(--ink); font-weight: 700; }
.legal-prose code, .legal-prose .mono { font-family: var(--ff-mono); font-size: 13px; background: var(--soft-bg); padding: 2px 6px; border-radius: 4px; color: var(--ink); }
.legal-prose a.anchor { font-weight: 700; }
.legal-meta { display: flex; gap: 24px; flex-wrap: wrap; padding: 18px 24px; background: var(--soft-bg); border-radius: 12px; font-size: 13px; color: var(--ink-75); margin: 0 auto 40px; max-width: 760px; }
.legal-meta strong { color: var(--ink); }
.legal-toc { max-width: 760px; margin: 0 auto 48px; padding: 22px 24px; border: 1px solid var(--ink-10); border-radius: 12px; background: var(--white); }
.legal-toc h4 { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-50); font-weight: 700; margin-bottom: 12px; }
.legal-toc ol { padding-left: 22px; margin: 0; font-size: 14px; color: var(--ink); }
body[dir="rtl"] .legal-toc ol { padding-left: 0; padding-right: 22px; }
.legal-toc ol li { margin-bottom: 6px; }
.legal-toc ol li a { color: var(--violet); font-weight: 600; }

/* ===== Responsive ========================================================== */
@media (max-width: 900px) {
  .section { padding: 64px 0; }
  .nav { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; gap: 12px; }
}
