/* Optimum Solution — حلول الأمثل
   One stylesheet for both languages. Logical properties only (margin-inline,
   padding-inline, inset-inline) so the Arabic page mirrors without overrides.
   Palette is sampled from the logo: navy ring + sand "S". */

:root {
  --navy: #1b2740;
  --navy-deep: #121a2c;
  --navy-soft: #3a4a66;
  --sand: #9c8b7d;
  --sand-dark: #7d6c5f;
  --sand-light: #c9bcb0;
  --sand-tint: #f4efe9;
  --ivory: #faf8f5;
  --white: #ffffff;
  --text: #1b2740;
  --text-soft: #4f5b70;
  --muted: #7c8595;
  --line: #e7e1d9;
  --radius: 18px;
  --shadow-sm: 0 1px 2px rgb(27 39 64 / 0.05);
  --shadow: 0 2px 4px rgb(27 39 64 / 0.04), 0 18px 40px -12px rgb(27 39 64 / 0.14);
  --max: 1180px;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-head: "Outfit", "DM Sans", system-ui, sans-serif;
}

[lang="ar"] {
  --font-body: "IBM Plex Sans Arabic", system-ui, sans-serif;
  --font-head: "Alexandria", "IBM Plex Sans Arabic", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.55em; font-weight: 500; color: var(--navy); }
h1 { font-size: clamp(2.2rem, 5vw, 3.7rem); letter-spacing: -0.025em; font-weight: 400; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); letter-spacing: -0.02em; font-weight: 400; }
h3 { font-size: 1.14rem; font-weight: 500; }
p { margin: 0 0 1em; }

[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3 { letter-spacing: 0; line-height: 1.45; }
[lang="ar"] h1 { font-weight: 500; }
[lang="ar"] h2 { font-weight: 500; }
[lang="ar"] body { line-height: 1.85; }

.container { width: min(var(--max), 100% - 32px); margin-inline: auto; }

.skip {
  position: absolute; inset-inline-start: 16px; top: -60px;
  background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100;
}
.skip:focus { top: 12px; }

:focus-visible { outline: 2px solid var(--sand); outline-offset: 3px; border-radius: 6px; }

.i { width: 24px; height: 24px; flex: none; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.scrolled { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav { display: flex; align-items: center; gap: 28px; height: 80px; }

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand img { width: 52px; height: auto; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text strong { font-family: var(--font-head); font-weight: 500; font-size: 1.12rem; color: var(--navy); }
.brand-text span {
  font-family: "Outfit", sans-serif; font-size: 0.66rem; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--sand-dark); margin-top: 4px;
}
[lang="ar"] .brand-text span { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 0.78rem; }

.nav-links { display: flex; gap: 2px; margin-inline-start: auto; list-style: none; padding: 0; margin-block: 0; }
.nav-links a {
  display: block; padding: 8px 14px; border-radius: 999px;
  text-decoration: none; color: var(--text-soft); font-size: 0.95rem; font-weight: 500;
  transition: color 0.15s ease, background 0.15s ease;
}
.nav-links a:hover { color: var(--navy); background: var(--sand-tint); }

.nav-actions { display: flex; align-items: center; gap: 10px; }
.lang-switch {
  text-decoration: none; font-weight: 500; font-size: 0.92rem;
  padding: 8px 14px; border-radius: 999px; color: var(--navy);
  border: 1px solid var(--line); transition: border-color 0.15s ease;
}
.lang-switch:hover { border-color: var(--sand); }

.menu-btn {
  display: none; background: none; border: 1px solid var(--line); border-radius: 999px;
  width: 44px; height: 44px; cursor: pointer; color: var(--navy);
  align-items: center; justify-content: center;
}
.menu-btn .i { width: 22px; height: 22px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px; border: 1px solid transparent;
  font: inherit; font-weight: 500; font-size: 0.98rem; text-decoration: none; cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.btn .i { width: 18px; height: 18px; }
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-deep); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--sand-light); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-sand { background: var(--sand-light); color: var(--navy-deep); }
.btn-sand:hover { background: #d8cdc3; }
.nav-actions .btn { padding: 10px 20px; font-size: 0.92rem; }

/* Direction-aware arrows */
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Eyebrow with rules (echoes "— TRAINING INSTITUTE —") ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 14px;
  font-family: "Outfit", sans-serif; font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.3em; text-transform: uppercase; color: var(--sand-dark);
  margin-bottom: 20px;
}
.eyebrow::before, .eyebrow::after { content: ""; width: 34px; height: 1px; background: var(--sand-light); }
.eyebrow.start::before { display: none; }
[lang="ar"] .eyebrow { font-family: var(--font-body); letter-spacing: 0; text-transform: none; font-size: 0.95rem; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden;
  padding-block: clamp(56px, 9vw, 112px) clamp(64px, 9vw, 120px);
  background: linear-gradient(180deg, var(--white) 0%, var(--ivory) 100%);
}
.hero-grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 64px; align-items: center; }
.hero h1 em { font-style: normal; color: var(--sand-dark); }
.lead { font-size: 1.16rem; color: var(--text-soft); max-width: 56ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.hero-facts {
  display: flex; flex-wrap: wrap; gap: 28px; margin-top: 44px; padding-top: 28px;
  border-top: 1px solid var(--line); list-style: none; padding-inline: 0; margin-bottom: 0;
}
.hero-facts li { display: flex; align-items: center; gap: 10px; color: var(--text-soft); font-size: 0.95rem; }
.hero-facts .i { width: 22px; height: 22px; color: var(--sand); }

/* Visual: the logo mark inside rings that echo the "O" */
.hero-visual { position: relative; aspect-ratio: 1; max-width: 480px; width: 100%; margin-inline: auto; }
.ring { position: absolute; border-radius: 50%; inset: 0; }
.ring-1 { border: 1px solid var(--line); }
.ring-2 { inset: 11%; border: 1px solid var(--sand-light); opacity: 0.7; }
.ring-3 { inset: 22%; background: var(--white); box-shadow: var(--shadow); }
.hero-visual img {
  position: absolute; inset: 0; margin: auto; width: 40%; height: auto;
}
.orbit-dot { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: var(--sand-light); }
.orbit-dot.a { top: 6%; inset-inline-end: 22%; }
.orbit-dot.b { bottom: 14%; inset-inline-start: 8%; width: 9px; height: 9px; background: var(--navy-soft); opacity: 0.5; }

.chip {
  position: absolute; display: flex; align-items: center; gap: 10px;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 16px 10px 12px; box-shadow: var(--shadow); font-size: 0.9rem; font-weight: 500; white-space: nowrap;
}
[dir="rtl"] .chip { padding: 10px 12px 10px 16px; }
.chip .dot { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--sand-tint); color: var(--sand-dark); }
.chip .i { width: 18px; height: 18px; }
.chip.c1 { top: 16%; inset-inline-start: -4%; }
.chip.c2 { bottom: 20%; inset-inline-end: -6%; }
.chip.c3 { bottom: 2%; inset-inline-start: 18%; }

/* ---------- Sections ---------- */
section { padding-block: clamp(72px, 9vw, 120px); }
.bg-ivory { background: var(--ivory); }
.section-head { max-width: 700px; margin-bottom: 56px; }
.section-head.center { margin-inline: auto; text-align: center; }
.section-head.center .eyebrow { justify-content: center; }
.section-head p { color: var(--text-soft); font-size: 1.1rem; margin: 0; }

/* About */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 72px; align-items: center; }
.about-text p { color: var(--text-soft); font-size: 1.06rem; }
.quote {
  margin: 30px 0 0; padding-inline-start: 22px; border-inline-start: 2px solid var(--sand-light);
  font-family: var(--font-head); font-size: 1.2rem; color: var(--navy); font-weight: 400;
}
.values { display: grid; gap: 14px; }
.value {
  display: flex; gap: 18px; align-items: flex-start; padding: 24px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.value:hover { border-color: var(--sand-light); box-shadow: var(--shadow); }
.value h3 { margin-bottom: 4px; }
.value p { margin: 0; color: var(--text-soft); font-size: 0.97rem; }

.badge {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; background: var(--sand-tint); color: var(--navy);
}
.badge .i { width: 26px; height: 26px; }

/* Programmes */
.programs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.program {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 26px 26px; overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.program::after {
  content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--navy), var(--sand-light));
  transform: scaleX(0); transform-origin: left; transition: transform 0.35s ease;
}
[dir="rtl"] .program::after { transform-origin: right; background: linear-gradient(270deg, var(--navy), var(--sand-light)); }
.program:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.program:hover::after { transform: scaleX(1); }
.program-top { display: flex; align-items: center; justify-content: space-between; }
.program .num { font-family: "Outfit", sans-serif; font-size: 0.85rem; color: var(--sand); letter-spacing: 0.1em; }
[lang="ar"] .program .num { font-family: var(--font-body); font-size: 1.05rem; letter-spacing: 0.05em; }
.program .badge { width: 56px; height: 56px; transition: background 0.25s ease, color 0.25s ease; }
.program .badge .i { width: 28px; height: 28px; }
.program:hover .badge { background: var(--navy); color: #fff; }
.program h3 { margin: 6px 0 0; font-size: 1.16rem; }
.program p { margin: 0; color: var(--text-soft); font-size: 0.95rem; flex: 1; }
.program .tag {
  align-self: flex-start; font-size: 0.8rem; font-weight: 500; color: var(--sand-dark);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px;
}

/* Approach — dark navy band */
.dark { background: var(--navy); color: #d9dee8; position: relative; overflow: hidden; }
.dark::before {
  content: ""; position: absolute; width: 640px; height: 640px; border-radius: 50%;
  border: 80px solid rgb(255 255 255 / 0.03); top: -260px; inset-inline-end: -220px;
}
.dark h2, .dark h3 { color: #fff; }
.dark .section-head p { color: #b6bfcf; }
.dark .eyebrow { color: var(--sand-light); }
.dark .eyebrow::before, .dark .eyebrow::after { background: rgb(201 188 176 / 0.5); }

.steps { position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step {
  padding: 32px 26px; border-radius: var(--radius);
  background: rgb(255 255 255 / 0.04); border: 1px solid rgb(255 255 255 / 0.09);
}
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--sand); color: var(--sand-light);
  font-family: "Outfit", sans-serif; font-size: 0.95rem; margin-bottom: 22px;
}
[lang="ar"] .step::before { content: counter(step, arabic-indic); font-family: var(--font-body); font-size: 1.1rem; }
.step p { margin: 0; color: #b6bfcf; font-size: 0.96rem; }

/* Formats + audiences */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 22px; padding: 36px; }
.panel > h3 { font-size: 1.35rem; margin-bottom: 26px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.feature-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 22px; }
.feature-list li { display: flex; gap: 16px; align-items: flex-start; }
.feature-list .badge { width: 46px; height: 46px; }
.feature-list .badge .i { width: 23px; height: 23px; }
.feature-list strong { display: block; font-weight: 500; font-family: var(--font-head); color: var(--navy); }
.feature-list span { color: var(--text-soft); font-size: 0.95rem; }

/* CTA / Contact */
.cta {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-soft) 100%);
  color: #fff; border-radius: 30px; padding: clamp(40px, 6vw, 72px);
  display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 48px; align-items: center;
}
.cta::before {
  content: ""; position: absolute; width: 420px; height: 420px; border-radius: 50%;
  border: 56px solid rgb(201 188 176 / 0.08); bottom: -200px; inset-inline-start: -120px;
}
.cta > * { position: relative; }
.cta h2 { color: #fff; }
.cta .eyebrow { color: var(--sand-light); }
.cta .eyebrow::before, .cta .eyebrow::after { background: rgb(201 188 176 / 0.5); }
.cta p { color: #c3cbd8; font-size: 1.08rem; margin: 0; max-width: 48ch; }
.contact-box {
  background: rgb(255 255 255 / 0.06); border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: 22px; padding: 26px; display: grid; gap: 16px;
}
.contact-row { display: flex; gap: 14px; align-items: center; color: #fff; text-decoration: none; }
.contact-row .i { width: 22px; height: 22px; color: var(--sand-light); }
.contact-row .ltr { direction: ltr; unicode-bidi: isolate; }
a.contact-row:hover span { text-decoration: underline; text-underline-offset: 4px; }
.contact-box .btn { justify-content: center; margin-top: 6px; }

/* Footer */
.site-footer { background: var(--ivory); border-top: 1px solid var(--line); padding-block: 56px 32px; color: var(--muted); font-size: 0.93rem; }
.footer-top { display: grid; grid-template-columns: auto 1fr auto; gap: 40px; align-items: center; padding-bottom: 32px; border-bottom: 1px solid var(--line); }
.footer-logo { width: 190px; height: auto; }
.footer-tag { color: var(--text-soft); max-width: 44ch; margin: 0; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; padding: 0; margin: 0; }
.footer-nav a { text-decoration: none; color: var(--text-soft); }
.footer-nav a:hover { color: var(--navy); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; padding-top: 24px; }
.footer-bottom a { color: var(--text-soft); text-decoration: none; }
.footer-bottom a:hover { color: var(--navy); }

/* Reveal on scroll (only when JS is running) */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .program, .program::after, .value { transition: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .programs { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .hero-grid, .about-grid, .cta { grid-template-columns: 1fr; }
  .hero-grid { gap: 56px; }
  .hero-visual { max-width: 420px; }
  .footer-top { grid-template-columns: 1fr; gap: 20px; }
}

@media (max-width: 880px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; inset-inline: 0; top: 80px;
    flex-direction: column; gap: 0; padding: 10px 16px 18px;
    background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow);
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 14px; border-radius: 12px; }
  .nav-actions { margin-inline-start: auto; }
  .nav-actions .btn { display: none; }
  .split { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .nav { height: 70px; }
  .nav-links { top: 70px; }
  .brand img { width: 44px; }
  .brand-text strong { font-size: 1rem; }
  .brand-text span { letter-spacing: 0.18em; font-size: 0.6rem; white-space: nowrap; }
  .programs, .steps { grid-template-columns: 1fr; }
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { justify-content: center; white-space: nowrap; }
  .hero-visual { max-width: 330px; }
  .hero-facts { gap: 14px 22px; }
  .panel { padding: 26px; }
  .chip { font-size: 0.8rem; padding: 7px 12px 7px 8px; }
  [dir="rtl"] .chip { padding: 7px 8px 7px 12px; }
  .chip .dot { width: 26px; height: 26px; }
  .chip.c1 { inset-inline-start: 0; }
  .chip.c2 { inset-inline-end: 0; }
  .chip.c3 { inset-inline-start: 12%; }
}
