/* ─── Custom Properties ─────────────────────────────────── */
:root {
  --blue:       #2c5aa0;
  --blue-light: #dde4f0;
  --blue-pale:  #f6f8fc;
  --divider:    #eef0f4;
  --text-dark:  #111;
  --text-mid:   #444;
  --text-soft:  #555;
  --text-muted: #999;
  --text-faint: #bbb;
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans:  'Outfit', system-ui, sans-serif;
}

/* ─── Reset ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { background: #dddbd6; }
body { font-family: var(--font-sans); background: #faf9f6; color: var(--text-dark); max-width: 1080px; margin: 0 auto; box-shadow: 0 0 40px rgba(0,0,0,0.10); }
button { cursor: pointer; font: inherit; border: none; background: none; }
a { text-decoration: none; }

/* ─── Nav ────────────────────────────────────────────────── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  height: 52px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-wordmark {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--blue);
  letter-spacing: 0.5px;
}

.lang-switcher {
  display: flex;
  border: 1px solid #d8e4f4;
  border-radius: 4px;
  overflow: hidden;
}

.lang-btn {
  padding: 5px 11px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-soft);
  border-right: 1px solid #d8e4f4;
  letter-spacing: 0.5px;
  background: #fff;
  transition: background 0.15s, color 0.15s;
}

.lang-btn:last-child { border-right: none; }

.lang-btn.active,
.lang-btn:hover { background: var(--blue); color: #fff; }

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  background: var(--blue);
  padding: 52px 40px 48px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(40px, 5vw, 60px);
  font-weight: 700;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-bottom: 20px;
}

.hero-tagline {
  font-size: 17px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.82);
  max-width: 520px;
  line-height: 1.75;
}

/* ─── Mission ────────────────────────────────────────────── */
.mission {
  padding: 52px 40px;
  border-bottom: 1px solid var(--divider);
  max-width: 760px;
}

.section-label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 16px;
}

.mission-text {
  font-family: var(--font-serif);
  font-size: 25px;
  font-weight: 400;
  font-style: italic;
  color: var(--text-mid);
  line-height: 1.6;
}

/* ─── Core Functions ─────────────────────────────────────── */
.functions {
  padding: 52px 40px;
  border-bottom: 1px solid var(--divider);
}

.functions-title {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 28px;
}

.functions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--blue-light);
}

.fn-cell {
  background: #fff;
  padding: 30px 28px 26px;
}

.fn-number {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  color: var(--blue);
  margin-bottom: 10px;
}

.fn-title {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  line-height: 1.2;
}

.fn-desc {
  font-size: 14px;
  font-weight: 300;
  color: var(--text-soft);
  line-height: 1.7;
  margin-bottom: 18px;
}

.fn-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  border: 1px solid #c8d8f0;
  padding: 3px 9px;
}

/* ─── Vision ─────────────────────────────────────────────── */
.vision {
  background: var(--blue-pale);
  padding: 52px 40px;
  border-bottom: 1px solid var(--divider);
}

.vision-text {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-mid);
  line-height: 1.85;
  max-width: 640px;
}

.vision-text strong {
  font-weight: 500;
  color: var(--text-dark);
}

/* ─── Social ─────────────────────────────────────────────── */
.social {
  padding: 52px 40px;
  border-bottom: 1px solid var(--divider);
}

.social-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.social-text {
  font-size: 15px;
  font-weight: 300;
  color: var(--text-soft);
  line-height: 1.75;
  max-width: 500px;
  margin-bottom: 24px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--blue);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.3px;
  padding: 11px 22px;
  transition: opacity 0.15s;
}

.social-link:hover { opacity: 0.88; }

.x-icon {
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* ─── Footer ─────────────────────────────────────────────── */
.site-footer {
  padding: 18px 40px;
  display: flex;
  justify-content: flex-end;
}

.footer-text {
  font-size: 11px;
  font-weight: 300;
  color: var(--text-faint);
  letter-spacing: 0.3px;
}

/* ─── Responsive — ≤640px ────────────────────────────────── */
@media (max-width: 640px) {
  .site-nav {
    padding: 0 20px;
    height: 48px;
  }

  .lang-switcher {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .lang-switcher::-webkit-scrollbar { display: none; }

  .hero      { padding: 36px 20px 32px; }
  .mission   { padding: 36px 20px; }
  .functions { padding: 36px 20px; }
  .vision    { padding: 36px 20px; }
  .social    { padding: 36px 20px; }

  .site-footer { padding: 16px 20px; }

  .functions-grid { grid-template-columns: 1fr; }

  .hero-title  { font-size: 36px; }
  .mission-text { font-size: 20px; }
}

/* ─── RTL overrides ──────────────────────────────────────── */
/* Nav always stays LTR regardless of page direction */
.site-nav { direction: ltr; }

/* Vazirmatn for Arabic/Persian/Kurdish script */
html[dir="rtl"] body {
  font-family: 'Vazirmatn', system-ui, sans-serif;
}

html[dir="rtl"] .hero-title,
html[dir="rtl"] .mission-text,
html[dir="rtl"] .functions-title,
html[dir="rtl"] .fn-title,
html[dir="rtl"] .social-title {
  font-family: 'Vazirmatn', system-ui, sans-serif;
  font-style: normal;
}

html[dir="rtl"] .mission,
html[dir="rtl"] .functions,
html[dir="rtl"] .vision,
html[dir="rtl"] .social,
html[dir="rtl"] .site-footer {
  text-align: right;
}

html[dir="rtl"] .site-footer {
  justify-content: flex-start;
}

/* Disable letter-spacing for Arabic/Persian/Kurdish script */
html[dir="rtl"] .section-label,
html[dir="rtl"] .fn-number,
html[dir="rtl"] .fn-badge,
html[dir="rtl"] .lang-btn {
  letter-spacing: 0;
}

/* Social link RTL — reverse icon/text order */
html[dir="rtl"] .social-link {
  flex-direction: row-reverse;
}
