/* ==========================================================================
   Cottonera KSA — design system
   Deep Purple #3F2B7A · Royal Purple #6A4FC4 · Soft Gray #F8F9FB
   Display: Playfair Display · Body: Inter
   ========================================================================== */

:root {
  --purple-deep: #3F2B7A;
  --purple-royal: #6A4FC4;
  --purple-mist: #EEEAFA;
  --gray-soft: #F8F9FB;
  --gray-light: #E5E7EB;
  --white: #FFFFFF;
  --ink: #241B3E;
  --ink-soft: #625C77;
  --line: #E5E7EB;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(63,43,122,0.06);
  --shadow-md: 0 8px 28px rgba(63,43,122,0.10);
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 16px;
  text-wrap: balance;
}

h1 { font-size: clamp(34px, 5vw, 54px); }
h2 { font-size: clamp(26px, 3.4vw, 36px); }
h3 { font-size: 21px; }

p { margin: 0 0 16px; color: var(--ink-soft); }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.eyebrow {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--purple-royal);
  margin: 0 0 12px;
  display: block;
}

.section {
  padding: 88px 0;
}
.section--tight { padding: 56px 0; }
.section--soft { background: var(--gray-soft); }
.section--deep { background: var(--purple-deep); color: var(--white); }
.section--deep h2, .section--deep p, .section--deep .eyebrow { color: var(--white); }
.section--deep .eyebrow { color: rgba(255,255,255,0.75); }
.section--deep p { color: rgba(255,255,255,0.82); }

.section-head {
  max-width: 640px;
  margin: 0 0 48px;
}
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 100px;
  font-family: var(--font-body);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--purple-royal); outline-offset: 2px; }

.btn-primary { background: var(--purple-deep); color: var(--white); }
.btn-primary:hover { background: #34215F; box-shadow: var(--shadow-md); }

.btn-outline { background: transparent; color: var(--ink); border-color: var(--gray-light); }
.btn-outline:hover { border-color: var(--purple-deep); color: var(--purple-deep); }

.btn-outline-invert { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn-outline-invert:hover { border-color: var(--white); background: rgba(255,255,255,0.08); }

.btn-block { width: 100%; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.98);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.brand .mark { width: 34px; height: 34px; color: var(--purple-deep); }
.brand .wordmark-group { display: flex; flex-direction: column; line-height: 1; }
.brand .wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--purple-deep);
}
.brand .wordmark sup { font-size: 10px; }
.brand .tagline {
  font-family: var(--font-body);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 2px;
}
.footer-brand .brand .tagline { color: rgba(255,255,255,0.55); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 30px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 14.5px;
  font-weight: 500;
}
.nav-links a { color: var(--ink-soft); padding: 6px 0; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--purple-deep); border-bottom-color: var(--purple-royal); }

.nav-actions { display: flex; align-items: center; gap: 16px; flex-shrink: 0; }
.lang-toggle {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  border: 1px solid var(--gray-light);
  border-radius: 100px;
  padding: 6px 14px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.nav-toggle span { width: 22px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 900px) {
  .nav-links { position: fixed; inset: 68px 0 0 0; background: var(--white); flex-direction: column; align-items: flex-start; padding: 28px 24px; gap: 4px; transform: translateX(100%); transition: transform 0.25s ease; overflow-y: auto; }
  .nav-links a { width: 100%; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links.is-open { transform: translateX(0); }
  .nav-toggle { display: flex; }
  .nav-actions .lang-toggle { display: none; }
}

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 56px;
  overflow: hidden;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 56px;
  align-items: center;
}
.hero-copy .badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-mist);
  color: var(--purple-deep);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 7px 16px;
  border-radius: 100px;
  margin-bottom: 20px;
}
.hero-copy h1 span { color: var(--purple-royal); }
.hero-copy p.lede { font-size: 18px; max-width: 46ch; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 28px; }

.hero-art {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.hero-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-art .blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
}
.hero-art .mark { width: 62%; height: 62%; color: var(--purple-deep); position: relative; z-index: 1; }

.card-photo {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 18px;
  background: var(--gray-soft);
}

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-art { max-width: 320px; margin: 0 auto; order: -1; }
}

/* ---------- certification strip ---------- */
.cert-strip {
  background: var(--gray-soft);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 34px 0;
}
.cert-strip .strip-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 0 0 22px;
  letter-spacing: 0.02em;
}
.cert-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 36px;
}
.cert-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink);
  width: 118px;
}
.cert-badge .cert-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--purple-deep);
  flex-shrink: 0;
}
.cert-badge .cert-icon svg { width: 20px; height: 20px; }

/* ---------- cards / grids ---------- */
.grid {
  display: grid;
  gap: 28px;
}
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 26px;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .icon {
  width: 48px; height: 48px;
  color: var(--purple-deep);
  background: var(--purple-mist);
  border-radius: 12px;
  padding: 11px;
  margin-bottom: 18px;
}
.card h3 { margin-bottom: 8px; }
.card p { font-size: 14.5px; margin-bottom: 14px; }
.card .learn { font-size: 13.5px; font-weight: 600; color: var(--purple-deep); }
.card .spec {
  font-size: 12.5px;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

/* ---------- global reach ---------- */
.reach-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 44px;
}
.reach-stat {
  text-align: center;
  padding: 24px 12px;
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
}
.reach-stat .num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  display: block;
}
.reach-stat .label {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.7);
}

.continent-block { margin-bottom: 26px; }
.continent-block:last-child { margin-bottom: 0; }
.continent-block h4 {
  font-family: var(--font-body);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.65);
  margin-bottom: 12px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  font-size: 13.5px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 100px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.16);
  color: var(--white);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.7);
  padding: 64px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 40px;
  margin-bottom: 48px;
}
.footer-brand .brand .wordmark, .footer-brand .brand .mark { color: var(--white); }
.footer-brand p { color: rgba(255,255,255,0.6); font-size: 14px; margin-top: 16px; max-width: 32ch; }
.footer-col h4 {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col li { font-size: 14.5px; color: rgba(255,255,255,0.62); }
.footer-col a:hover { color: var(--white); }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}

@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .reach-stats { grid-template-columns: 1fr; }
}

/* ---------- page header (interior pages) ---------- */
.page-header {
  padding: 64px 0 48px;
  background: var(--gray-soft);
  border-bottom: 1px solid var(--line);
}
.page-header .breadcrumb {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 14px;
}
.page-header .breadcrumb a:hover { color: var(--purple-deep); }

/* ---------- forms ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-field { display: flex; flex-direction: column; gap: 8px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.form-field input, .form-field select, .form-field textarea {
  font-family: var(--font-body);
  font-size: 14.5px;
  padding: 12px 14px;
  border: 1px solid var(--gray-light);
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus {
  outline: none; border-color: var(--purple-royal); box-shadow: 0 0 0 3px var(--purple-mist);
}
.form-note { font-size: 13px; color: var(--ink-soft); margin-top: 10px; }
@media (max-width: 620px) { .form-grid { grid-template-columns: 1fr; } }

/* ---------- misc content blocks ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
}
@media (max-width: 900px) { .split { grid-template-columns: 1fr; gap: 32px; } }

.stat-row { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 12px; }
.stat { display: flex; flex-direction: column; }
.stat .num { font-family: var(--font-display); font-size: 34px; font-weight: 700; color: var(--purple-deep); }
.stat .label { font-size: 13px; color: var(--ink-soft); }

.doc-list { display: flex; flex-direction: column; gap: 14px; }
.doc-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px;
}
.doc-row .doc-info { display: flex; align-items: center; gap: 14px; }
.doc-row .doc-icon { width: 34px; height: 34px; color: var(--purple-deep); flex-shrink: 0; }
.doc-row .doc-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.doc-row .doc-meta { font-size: 12.5px; color: var(--ink-soft); }
.doc-row .btn { padding: 9px 18px; font-size: 13px; }

.timeline-note {
  background: var(--purple-mist);
  border-radius: var(--radius);
  padding: 18px 22px;
  font-size: 14px;
  color: var(--purple-deep);
  font-weight: 500;
}

/* ---------- Arabic / RTL ---------- */
:root[dir="rtl"] {
  --font-display: 'Amiri', Georgia, serif;
  --font-body: 'Tajawal', 'Cairo', system-ui, sans-serif;
}
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .eyebrow,
[dir="rtl"] .badge,
[dir="rtl"] .cert-badge,
[dir="rtl"] .chip,
[dir="rtl"] .continent-block h4,
[dir="rtl"] .footer-col h4,
[dir="rtl"] .doc-meta,
[dir="rtl"] .reach-stat .label,
[dir="rtl"] .lang-toggle,
[dir="rtl"] .form-field label,
[dir="rtl"] .brand .tagline,
[dir="rtl"] .variant-tag,
[dir="rtl"] .section-label {
  letter-spacing: 0;
  text-transform: none;
}
[dir="rtl"] .hero-copy p.lede,
[dir="rtl"] .section-head { max-width: none; }
[dir="rtl"] .doc-row, [dir="rtl"] .nav, [dir="rtl"] .brand,
[dir="rtl"] .footer-bottom, [dir="rtl"] .cert-badge,
[dir="rtl"] .doc-info, [dir="rtl"] .stat-row, [dir="rtl"] .chip-row,
[dir="rtl"] .hero-actions, [dir="rtl"] .nav-actions, [dir="rtl"] .nav-links {
  direction: rtl;
}
