/* =============================================================================
   Landing page — shared stylesheet for both languages.

   Written with CSS logical properties throughout (margin-inline, padding-inline,
   inset-inline-start, text-align:start) so ONE stylesheet serves the Arabic RTL
   page and the English LTR page with no direction-specific override sheet.
   If you add a rule using `left`, `right`, `margin-left` or `text-align:left`,
   it is a bug — it will break the Arabic page.

   Tokens mirror admin-dashboard/src/styles.scss so the marketing page and the
   product look like one thing. Keep them in sync by hand; there are only a few.
   ============================================================================= */

:root {
  /* The brand green #5E9F3C is only 3.23:1 on white — fine for a dot or a fill,
     NOT legible enough to carry text at the sizes used here. So it is split:
       --primary      decorative fills only (dots, glows, icons, borders)
       --primary-cta  button background under white text  → 4.69:1  AA
       --primary-ink  green TEXT on white / --primary-soft → 5.98 / 5.26  AA
     Do not put text on --primary, and do not use --primary-ink as a large fill. */
  --primary: #5E9F3C;
  --primary-cta: #4A8130;
  --primary-cta-hover: #3F6F26;
  --primary-ink: #3F6F26;
  --primary-hover: #4E8A30;
  --primary-soft: #E9F4E1;
  --navy: #14142A;
  --bg: #F6F6FB;
  --surface: #FFFFFF;
  --border: #ECECF3;
  --border-strong: #E0E0EB;
  --ink: #1B1B2B;
  --ink-2: #5C5C73;
  --ink-3: #8C8CA3;

  --radius: 10px;
  --radius-lg: 18px;
  --radius-pill: 999px;
  --shadow: 0 1px 2px rgba(27, 27, 43, .06), 0 1px 3px rgba(27, 27, 43, .04);
  --shadow-md: 0 4px 14px rgba(27, 27, 43, .07), 0 2px 5px rgba(27, 27, 43, .04);
  --shadow-lg: 0 14px 40px rgba(27, 27, 43, .12), 0 6px 14px rgba(27, 27, 43, .06);

  --nav-h: 68px;
  --section-y: clamp(4rem, 9vw, 7rem);

  /* Latin default; the Arabic page overrides with Cairo via [lang="ar"] below. */
  --font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html[lang="ar"] {
  --font: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

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

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

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font);
  background: var(--surface);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* Belt and braces: nothing on this page may cause a sideways scroll, which is
     the classic way an RTL layout fails. */
  overflow-x: hidden;
}

h1, h2, h3 { line-height: 1.2; margin: 0; font-weight: 700; letter-spacing: -0.015em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

/* The Arabic script has no uppercase, and letter-spacing breaks its joins. */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3 { letter-spacing: 0; }

/* ---------- shared layout ---------- */

.container { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bg); }
.section--navy { background: var(--navy); color: #fff; }

.eyebrow {
  display: inline-block;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--primary-ink);
  margin-block-end: .75rem;
}
html[lang="ar"] .eyebrow { letter-spacing: 0; text-transform: none; font-size: .85rem; }

.section-title {
  font-size: clamp(1.6rem, 3.4vw, 2.4rem);
  max-width: 22ch;
}
.section-lead {
  margin-block-start: 1rem;
  font-size: 1.05rem;
  color: var(--ink-2);
  max-width: 62ch;
}

/* ---------- accessibility ---------- */

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  inset-block-start: -100%;
  z-index: 100;
  background: var(--primary-cta);
  color: #fff;
  padding: .7rem 1.1rem;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  transition: inset-block-start .15s;
}
.skip:focus { inset-block-start: 1rem; }

:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}
.section--navy :focus-visible { outline-color: #fff; }

/* ---------- nav ---------- */

.nav {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-block-end: 1px solid var(--border);
}
.nav .container { display: flex; align-items: center; gap: 1rem; }

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-weight: 800;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--ink);
  margin-inline-end: auto;
}
.brand svg { width: 30px; height: 30px; flex: none; }

.nav-links { display: flex; align-items: center; gap: .35rem; }

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem .85rem;
  border-radius: var(--radius-pill);
  font-size: .9rem;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.lang-switch:hover { background: var(--bg); color: var(--ink); }
.lang-switch svg { width: 17px; height: 17px; flex: none; opacity: .65; }

/* Small phones: brand + language + sign-in do not fit at 320px, and the button
   was wrapping onto two lines and clipping. Tighten everything and drop the
   globe icon — the language NAME is the meaningful affordance, so the label
   stays and the decoration goes. */
@media (max-width: 430px) {
  .nav .container { gap: .35rem; }
  .brand { font-size: 1rem; gap: .45rem; }
  .brand svg { width: 26px; height: 26px; }
  .lang-switch { padding: .45rem .55rem; font-size: .85rem; }
  .lang-switch svg { display: none; }
  .nav .btn { padding: .6rem 1rem; font-size: .87rem; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .72rem 1.4rem;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: .95rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s, box-shadow .15s;
}
.btn--primary { background: var(--primary-cta); color: #fff; box-shadow: 0 1px 2px rgba(27, 27, 43, .18); }
.btn--primary:hover { background: var(--primary-cta-hover); }
.btn--ghost { border-color: rgba(255, 255, 255, .28); color: #fff; }
.btn--ghost:hover { border-color: rgba(255, 255, 255, .55); background: rgba(255, 255, 255, .06); }
.btn:active { transform: translateY(1px); }

/* The arrow must point the way the reader is going. */
.btn svg { width: 16px; height: 16px; flex: none; }
html[dir="rtl"] .btn svg.dir-arrow { transform: scaleX(-1); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  background: var(--navy);
  color: #fff;
  padding-block: clamp(3.5rem, 8vw, 6.5rem);
  overflow: hidden;
  isolation: isolate;
}
/* Two soft green washes; purely decorative. */
.hero::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-start: -30%;
  inset-inline-end: -10%;
  width: 60rem;
  height: 60rem;
  background: radial-gradient(circle, rgba(94, 159, 60, .28) 0%, rgba(94, 159, 60, 0) 62%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset-block-end: -45%;
  inset-inline-start: -18%;
  width: 46rem;
  height: 46rem;
  background: radial-gradient(circle, rgba(94, 159, 60, .14) 0%, rgba(94, 159, 60, 0) 60%);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}
@media (min-width: 940px) {
  .hero-grid { grid-template-columns: 1.05fr .95fr; }
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  padding: .4rem .9rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .14);
  font-size: .85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .9);
}
.hero-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px rgba(94, 159, 60, .25);
  flex: none;
}

.hero h1 {
  margin-block-start: 1.5rem;
  font-size: clamp(2.1rem, 5.2vw, 3.45rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.12;
  max-width: 17ch;
}
html[lang="ar"] .hero h1 { letter-spacing: 0; line-height: 1.35; }

.hero-sub {
  margin-block-start: 1.35rem;
  font-size: clamp(1rem, 1.5vw, 1.15rem);
  color: rgba(255, 255, 255, .74);
  max-width: 48ch;
}

.hero-actions {
  margin-block-start: 2.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: .8rem;
}

/* Pipeline illustration. NOT a screenshot and never to be dressed up as one:
   it shows the real configurable stage list, with no invented numbers. */
.pipeline {
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.9rem);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.pipeline-head {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .62);
  margin-block-end: 1.1rem;
}
html[lang="ar"] .pipeline-head { letter-spacing: 0; text-transform: none; font-size: .88rem; }

.pipeline-list { display: flex; flex-direction: column; gap: .55rem; }
.pipeline-step {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding: .7rem .95rem;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .08);
  font-size: .93rem;
  font-weight: 600;
  color: rgba(255, 255, 255, .88);
}
.pipeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: none;
  background: var(--dot, var(--primary));
}
.pipeline-step--won { background: rgba(94, 159, 60, .18); border-color: rgba(94, 159, 60, .4); }
.pipeline-step--lost { opacity: .72; }

/* ---------- problem ---------- */

.problem-grid {
  margin-block-start: 2.75rem;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
.problem-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  font-size: 1rem;
  color: var(--ink-2);
  position: relative;
  padding-block-start: 2.9rem;
}
.problem-card::before {
  content: "";
  position: absolute;
  inset-block-start: 1.4rem;
  inset-inline-start: 1.5rem;
  width: 22px;
  height: 22px;
  background: currentColor;
  color: var(--ink-3);
  opacity: .45;
  -webkit-mask: var(--icon-alert) center / contain no-repeat;
  mask: var(--icon-alert) center / contain no-repeat;
}
:root {
  --icon-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 8v5M12 16.5v.01'/%3E%3C/svg%3E");
  --icon-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235E9F3C' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 10.5l4 4 8-9'/%3E%3C/svg%3E");
}

/* ---------- features ---------- */

.feature {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
  grid-template-columns: 1fr;
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
}
.feature + .feature { border-block-start: 1px solid var(--border); }
.section--alt .feature + .feature { border-block-start-color: var(--border-strong); }

@media (min-width: 880px) {
  .feature { grid-template-columns: 1fr 1fr; }
  /* Alternate which column leads, without ever using left/right. */
  .feature:nth-child(even) .feature-text { order: 2; }
}

.feature-title { font-size: clamp(1.35rem, 2.6vw, 1.85rem); max-width: 20ch; }
.feature-body {
  margin-block-start: 1rem;
  color: var(--ink-2);
  font-size: 1.02rem;
  max-width: 54ch;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: .85rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow-md);
}
.section--alt .checklist { background: var(--surface); }
.checklist li {
  position: relative;
  padding-inline-start: 2rem;
  font-size: .97rem;
  color: var(--ink);
}
.checklist li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  inset-block-start: .3em;
  width: 20px;
  height: 20px;
  background: var(--icon-check) center / contain no-repeat;
}

/* ---------- built for Iraq ---------- */

.local-grid {
  display: grid;
  gap: clamp(1.75rem, 4vw, 3.5rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 880px) { .local-grid { grid-template-columns: 1fr 1fr; } }

.section--navy .section-title { color: #fff; }
.section--navy .section-lead { color: rgba(255, 255, 255, .74); }
.section--navy .eyebrow { color: #8FC96F; }
.section--navy .checklist {
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .12);
  box-shadow: none;
}
.section--navy .checklist li { color: rgba(255, 255, 255, .9); }

/* ---------- roadmap ---------- */

.roadmap-grid {
  margin-block-start: 2.5rem;
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}
.roadmap-card {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 1.6rem;
}
.tag {
  display: inline-block;
  padding: .22rem .7rem;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary-ink);
  font-size: .78rem;
  font-weight: 700;
  margin-block-end: .85rem;
}
.roadmap-card h3 { font-size: 1.15rem; }
.roadmap-card p { margin-block-start: .6rem; color: var(--ink-2); font-size: .97rem; }

.roadmap-note {
  margin-block-start: 1.75rem;
  font-size: .92rem;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.roadmap-note::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: none;
  background: currentColor;
  -webkit-mask: var(--icon-alert) center / contain no-repeat;
  mask: var(--icon-alert) center / contain no-repeat;
}

/* ---------- footer ---------- */

.footer {
  background: var(--navy);
  color: rgba(255, 255, 255, .62);
  padding-block: 3rem;
  font-size: .92rem;
}
.footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}
.footer .brand { color: #fff; }
.footer-tagline { margin-inline-end: auto; }
.footer a { color: rgba(255, 255, 255, .85); text-decoration: none; }
.footer a:hover { color: #fff; text-decoration: underline; }
.footer-legal { width: 100%; color: rgba(255, 255, 255, .55); font-size: .85rem; }

/* ---------- scroll reveal ----------
   Applied only by JS (see the inline script), so with JS disabled or before it
   runs, every section is fully visible. Progressive enhancement, not a gate. */

.js-reveal .reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .55s ease, transform .55s ease;
}
.js-reveal .reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
}

@media print {
  .nav, .hero::before, .hero::after { display: none; }
  body { color: #000; }
}
