/* =========================================================
   VARIABLES / DESIGN TOKENS
   ---------------------------------------------------------
   What this section is:
   - A centralized "theme" layer using CSS Custom Properties.
   - Any value starting with -- is a reusable variable:
     Example: var(--accent) reads the value of --accent.
   Why:
   - Keeps design consistent and easy to tweak later.
   Symbols explained:
   - :root  => the document root element (<html>), best place for global variables.
   - --name => CSS custom property (variable).
   - var()  => reads a custom property.
   ========================================================= */
:root {
  /* Fonts (language-aware typography tokens) */
  --font-ar-base: "Cairo", sans-serif;
  --font-ar-title: "Amiri", serif;
  --font-en-base: "Bellefair", sans-serif;
  --font-en-title: "Oxanium", serif;

  /* Layout sizing tokens */
  --nav-h: 72px;
  /* Fixed navbar height (also used for anchor offset + section spacing) */
  --wrap: 1200px;
  /* Max content width used in many wrappers */

  /* Global section spacing tokens */
  --section-x: 2rem;
  /* Horizontal padding inside sections */
  --section-gap-under-nav: 3rem;
  /* Extra breathing space below navbar */
  --section-pad-top: calc(var(--nav-h) + var(--section-gap-under-nav));
  /* calc() allows math with CSS values/vars */
  --section-pad-bottom: 5rem;

  /* Brand */
  --accent: #b896f7;
  /* Main highlight color */

  /* Surfaces (glassmorphism background/border presets) */
  --glass-bg: rgba(15, 16, 18, 0.55);
  --glass-bg-2: rgba(15, 16, 18, 0.64);
  --glass-border: rgba(255, 255, 255, 0.08);

  /* Text opacity levels (keeps typography consistent) */
  --text-dim: rgba(255, 255, 255, 0.62);
  --text-dimmer: rgba(255, 255, 255, 0.55);
  --text-soft: rgba(255, 255, 255, 0.68);
}

/* =========================================================
   RESET + GLOBAL BASE
   ---------------------------------------------------------
   What this section is:
   - A lightweight reset to remove browser default spacing.
   - Base HTML/body behavior shared across the whole site.
   Symbols explained:
   - *      => universal selector (applies to all elements).
   - html   => the <html> element.
   - body   => the <body> element.
   ========================================================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

html {
  scroll-behavior: smooth;
  /* Smooth scrolling for anchor links */

  scroll-padding-top: calc(var(--nav-h) + 12px);
  /* Prevent anchor content from hiding behind fixed navbar */

  background: #0b0c10;
  /* Root fallback */

  position: relative;
  /* Needed so z-index layering behaves consistently */
}


html::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;

  background-image: url("/assets/images/background.png");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;

  transform: translateZ(0);
  will-change: transform;
}

body {
  min-height: 100vh;
  line-height: 1.6;
  color: #fff;
  overflow-x: hidden;
  background: transparent;
  position: relative;
  z-index: 1;
  transition: font-family 0.3s ease;
}

/* RTL (Arabic) */
html[dir="rtl"] body {
  direction: rtl;
  font-family: var(--font-ar-base);
}

/* LTR (English) */
html[dir="ltr"] body {
  direction: ltr;
  font-family: var(--font-en-base);
}


/* Media elements default safety:
   - max-width prevents overflow on smaller screens. */
img,
svg {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Disable any legacy overlays from older versions
   Symbols explained:
   - ::before / ::after are pseudo-elements (virtual elements).
   - content: none removes them (with !important to force override). */
body::before,
body::after {
  content: none !important;
}

/* =========================================================
   BACKGROUND LAYER (Stars Canvas)
   ---------------------------------------------------------
   What this section is:
   - A fixed, full-screen layer behind the site content.
   - Used for animated stars via <canvas id="stars-canvas">.
   Symbols explained:
   - position: fixed  => stays in place while scrolling.
   - inset: 0         => shorthand for top/right/bottom/left: 0.
   - z-index: -1      => behind normal content.
   - pointer-events:none => allows clicks through the layer.
   ========================================================= */
.bg-wrap {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden;
  background: transparent;
}

#stars-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* =========================================================
   DECOR: GLASS RECTANGLES (Floating)
   ---------------------------------------------------------
   What this section is:
   - Decorative glass shapes that float slightly up/down.
   Symbols explained:
   - transform: translate3d(...) uses GPU-friendly transforms.
   - will-change hints the browser to optimize upcoming changes.
   - animation: floaty ... uses @keyframes below.
   - --px/--py/--r are custom properties used per rectangle.
   ========================================================= */
.glass-rect {
  position: absolute;
  border: 1px solid rgba(184, 150, 247, 0.18);
  background: rgba(255, 255, 255, 0.015);
  border-radius: 18px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  opacity: 0.55;

  /* Default fallbacks for missing vars:
     var(--px, 0px) means: use --px if exists, else 0px */
  transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--r, 0deg));
  will-change: transform;
  animation: floaty 10s ease-in-out infinite;
}

/* Individual rectangle presets (position + size + rotation + delay) */
.gr1 {
  --r: -9deg;
  left: 3.5%;
  top: 6%;
  width: 170px;
  height: 120px;
}

.gr2 {
  --r: 7deg;
  right: 3.5%;
  top: 8%;
  width: 200px;
  height: 135px;
  animation-delay: -2s;
}

.gr3 {
  --r: 11deg;
  left: 5%;
  bottom: 10%;
  width: 190px;
  height: 140px;
  animation-delay: -4s;
}

/* Animation timeline:
   - 0% and 100% => original position
   - 50% => move up by 12px (negative Y) */
@keyframes floaty {

  0%,
  100% {
    transform: translate3d(var(--px, 0px), var(--py, 0px), 0) rotate(var(--r, 0deg));
  }

  50% {
    transform: translate3d(var(--px, 0px), calc(var(--py, 0px) - 12px), 0) rotate(var(--r, 0deg));
  }
}

/* =========================================================
   TYPOGRAPHY (Global Defaults)
   ---------------------------------------------------------
   What this section is:
   - Default sizes and line heights for headings and paragraphs.
   Symbols explained:
   - clamp(min, preferred, max) => responsive size that never goes below min
     and never above max, while scaling between them.
   ========================================================= */
h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
  line-height: 1.2;
  color: #fff;
  max-width: 700px;
}

p {
  /* Clamp sanity note:
     clamp(1rem, 2vw, 1.15rem) ensures min <= max */
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 2;
  color: var(--text-soft);
  max-width: 650px;
}

/* Headings font by language */
html[dir="rtl"] .section h1,
html[dir="rtl"] .hero-title {
  font-family: var(--font-ar-title);
  font-weight: 700;
}

html[dir="ltr"] .section h1,
html[dir="ltr"] .hero-title {
  font-family: var(--font-en-title);
  font-weight: 700;
  text-transform: uppercase;
  /* visual style for English headings */
}

/* Paragraphs font by language */
html[dir="rtl"] .section p {
  font-family: var(--font-ar-base);
  font-weight: 400;
}

html[dir="ltr"] .section p {
  font-family: var(--font-en-base);
  font-weight: 400;
  letter-spacing: 0.03em;
}

/* =========================================================
   SECTION SPACING (Unified)
   ---------------------------------------------------------
   What this section is:
   - One rule that applies consistent top/bottom padding to all major sections.
   Symbols explained:
   - :is(A, B, C) => groups selectors without repeating the same declarations.
   - padding-inline => logical left/right padding (works with RTL/LTR).
   ========================================================= */
:is(.section, .projects, .fp2, #methodology, .impact-section, .faq-section, .contact-section) {
  padding-inline: var(--section-x);
  padding-top: var(--section-pad-top);
  padding-bottom: var(--section-pad-bottom);
}

/* Base section layout:
   - Centers the section content and keeps it aligned from the top */
.section {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
}

/* Hero section:
   - Only section that stays full viewport height */
#home {
  min-height: 100vh;
  justify-content: center;
  gap: 30px;
  padding-inline: 1.25rem;
  padding-top: calc(var(--nav-h) + 2.5rem);
}

/* =========================================================
   NAVBAR
   ---------------------------------------------------------
   What this section is:
   - Fixed glass navbar with centered desktop menu + actions area.
   Symbols explained:
   - @supports checks browser feature support (e.g., backdrop-filter).
   ========================================================= */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  height: var(--nav-h);
  z-index: 1000;

  background-color: rgba(21, 21, 24, 0.72);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fallback if blur is not supported */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .navbar {
    background-color: rgba(21, 21, 24, 0.92);
  }
}

/* Navbar content container */
.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  position: relative;
  /* needed because nav-menu is absolutely centered */
  min-width: 0;
}

/* Logo wrapper */
.nav-logo,
.nav-logo a {
  display: flex;
  align-items: center;
  min-width: 0;
}

.logo-img {
  display: block;
  height: 44px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
}

/* Right-side actions (language toggle, hamburger on mobile, etc.) */
.nav-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  min-width: 0;
}

/* Language toggle */
.lang-toggle {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1.5px solid rgba(184, 150, 247, 0.65);
  color: #e7e7ea;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  font-family: "Inter", sans-serif;
  /* fixed UI font for toggle */
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  /* prevents EN | AR from wrapping */
  transition: background-color 0.25s ease, border-color 0.25s ease;
}

.lang-toggle:hover {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: rgba(184, 150, 247, 0.9);
}

.lang-option {
  opacity: 0.55;
  transition: opacity 0.25s ease, color 0.25s ease;
  color: #e7e7ea;
}

.lang-option.active {
  opacity: 1;
  font-weight: 700;
  color: var(--accent);
}

.lang-separator {
  opacity: 0.45;
  color: #cfcfe1;
}

/* Hamburger icon (mobile only)
   - hidden by default, enabled in the mobile nav media query */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  flex: 0 0 auto;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: #fff;
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* Hamburger -> X animation when active */
.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Desktop nav menu:
   - absolutely centered within nav-container */
.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  align-items: center;
  white-space: nowrap;
}

.nav-item {
  position: relative;
}

.nav-link {
  text-decoration: none;
  color: #929293;
  font-size: 1rem;
  font-weight: 500;
  transition: color 0.3s ease;
  padding: 0.5rem 0;
  position: relative;
  /* needed for ::after underline positioning */
  white-space: nowrap;
}

/* Underline animation that respects RTL/LTR:
   - In RTL, underline grows from the right edge.
   - In LTR, underline grows from the left edge. */
.nav-link::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  /* default RTL behavior */
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

html[dir="ltr"] .nav-link::after {
  right: auto;
  left: 0;
}

.nav-link:hover {
  color: var(--accent);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

.nav-link.active {
  color: var(--accent);
}

/* =========================================================
   HERO
   ---------------------------------------------------------
   What this section is:
   - Hero button styling + gradient brand text utility.
   Symbols explained:
   - -webkit-background-clip / -webkit-text-fill-color are needed
     for gradient text on WebKit browsers.
   ========================================================= */
.brand-gradient {
  background: linear-gradient(90deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  color: transparent;
}

.hero-buttons {
  display: flex;
  gap: 20px;
  margin-top: 24px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Shared base styles for both buttons */
.main-btn,
.secondary-btn {
  border-radius: 14px;
  padding: 12px 40px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease,
    background 0.25s ease, border-color 0.25s ease;
}

/* Primary CTA button */
.main-btn {
  background: linear-gradient(90deg, var(--accent) 0%, #ffffff 100%);
  color: #1a1a1a;
  border: 1px solid var(--accent);
}

.main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5px 15px rgba(159, 140, 255, 0.47);
  filter: brightness(1.02);
}

/* Secondary button (glass) */
.secondary-btn {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.secondary-btn:hover {
  border-color: rgba(159, 140, 255, 0.47);
  transform: translateY(-2px);
  box-shadow: 0 0.5px 15px rgba(159, 140, 255, 0.47);
  filter: brightness(1.02);
}

/* Language-specific button typography */
html[dir="rtl"] .main-btn,
html[dir="rtl"] .secondary-btn {
  font-family: var(--font-ar-title);
  font-weight: 700;
}

html[dir="ltr"] .main-btn,
html[dir="ltr"] .secondary-btn {
  font-family: var(--font-en-base);
  font-weight: 600;
  letter-spacing: 0.06em;
}

/* =========================================================
   PARTNERS MARQUEE (Always LTR + seamless via JS-measured shift)
   ---------------------------------------------------------
   What this section is:
   - A looping logo marquee.
   - It stays LTR even if the page is RTL.
   Symbols explained:
   - --fade  => edge fade width used in mask gradients.
   - --gap   => spacing between group1 and group2.
   - --speed => animation duration for a full loop.
   - --shift => distance moved per loop; JS updates it dynamically.
   - mask-image => fades edges without extra elements.
   - unicode-bidi: isolate => isolates bidi rendering, preventing RTL interference.
   ========================================================= */

.partners-section {
  text-align: center;
  direction: ltr !important;
  unicode-bidi: isolate;
}

.partners-label {
  color: rgba(255, 255, 255, .65);
  font-size: 18px;
  letter-spacing: .2px;
}

.partners-marquee {
  --fade: 70px;
  --gap: 28px;
  /* Space between group #1 and group #2 */
  --speed: 90s;
  /* Loop duration (lower = faster, higher = slower) */
  --shift: 600px;
  /* Loop distance in px (JS will overwrite this for perfect seamless loop) */

  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 14px 0 18px;
  display: block;

  /* Edge fade using a mask:
     - The center is fully visible (#000).
     - Edges become transparent, creating a smooth fade out. */
  -webkit-mask-image: linear-gradient(to right,
      transparent 0,
      #000 var(--fade),
      #000 calc(100% - var(--fade)),
      transparent 100%);
  mask-image: linear-gradient(to right,
      transparent 0,
      #000 var(--fade),
      #000 calc(100% - var(--fade)),
      transparent 100%);
}

.partners-marquee::before,
.partners-marquee::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: var(--fade);
  pointer-events: none;
  z-index: 2;
}

/* Extra subtle darkening on edges (visual depth) */
.partners-marquee::before {
  left: 0;
  background: linear-gradient(to right, rgba(0, 0, 0, .475), rgba(0, 0, 0, 0));
}

.partners-marquee::after {
  right: 0;
  background: linear-gradient(to left, rgba(0, 0, 0, .475), rgba(0, 0, 0, 0));
}

/* The moving track must not be affected by RTL */
.partners-track {
  direction: ltr !important;
  unicode-bidi: isolate !important;

  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: max-content;

  will-change: transform;
  animation: partners-loop var(--speed) linear infinite;
}

/* Two groups (duplicated content) to allow seamless looping */
.partners-group {
  display: flex;
  align-items: center;
  gap: 72px;
  /* Inner gap between logos within the same group */
  flex-shrink: 0;
}

/* Gap only between group #1 and group #2 */
.partners-group+.partners-group {
  margin-left: var(--gap);
}

/* Animation travels a measured distance in pixels */
@keyframes partners-loop {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(calc(-1 * var(--shift)), 0, 0);
  }
}

.partner-logo {
  height: 44px;
  width: auto;
  display: block;
  opacity: .85;
  filter: grayscale(.3) contrast(1.05) brightness(2.5);
  transition: opacity .2s ease, filter .2s ease, transform .2s ease;
}

.partners-marquee:hover .partner-logo {
  opacity: .65;
}

.partner-logo:hover {
  opacity: 1 !important;
  filter: grayscale(0) contrast(1) brightness(1);
  transform: translateY(-1px);
}

/* Mobile tuning: faster + tighter + smaller strip */
@media (max-width: 560px) {

  .partners-marquee {
    --fade: 46px;      /* Reduce edge fade width to save space */
    --gap: 18px;       /* Space between group #1 and group #2 */
    --speed: 18s;      /* Lower duration = faster scrolling */
    padding: 8px 0 10px; /* Make the strip vertically smaller */
  }

  .partners-group {
    gap: 26px;         /* Reduce spacing between individual logos */
  }

  .partner-logo {
    height: 32px;      /* Make logos smaller for mobile */
  }
}


/* Extra small phones */
@media (max-width: 420px) {

  .partners-marquee {
    --fade: 38px;      /* Even smaller edge fade */
    --gap: 14px;       /* Tighter gap between duplicated groups */
    --speed: 14s;      /* Faster animation on very small screens */
    padding: 7px 0 9px; /* Slightly reduce vertical padding */
  }

  .partners-group {
    gap: 20px;         /* Further reduce logo spacing */
  }

  .partner-logo {
    height: 28px;      /* Smaller logos for compact layout */
  }
}


/* Accessibility:
   - If the user prefers reduced motion, disable the marquee animation. */
@media (prefers-reduced-motion: reduce) {
  .partners-track {
    animation: none;
    transform: none;
  }

  .partners-marquee::before,
  .partners-marquee::after {
    display: none;
  }
}

/* =========================================================
   PROJECTS (Simple Rows – no controls)
   ---------------------------------------------------------
   What this section is:
   - A clean “rows” layout: each project is a two-column grid (text + media),
     and rows can alternate using .is-reverse.
   ========================================================= */
.projects {
  position: relative;
  padding: 70px 0;
}

.projects-row {
  width: min(var(--wrap), 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(22px, 4vw, 64px);
  align-items: center;
  padding: clamp(18px, 2.2vw, 26px) 0;
}

.project-media {
  display: grid;
  place-items: center;
  width: 100%;
  padding: clamp(8px, 2vw, 16px);
}

.project-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Alternating layout (swap sides) */
.projects-row.is-reverse .project-media {
  order: 2;
}

.projects-row.is-reverse .project-info {
  order: 1;
}

/* Keep RTL/LTR layout consistent */
html[dir="rtl"] .projects-row {
  direction: rtl;
}

html[dir="ltr"] .projects-row {
  direction: ltr;
}

/* Divider line between project rows */
.projects-row+.projects-row {
  /* border-top: 1px solid rgba(255,255,255,0.08); */
  margin-top: clamp(24px, 4vw, 56px);
}

/* Media wrapper:
   NOTE: margin: 100px 0 is intentionally large; it creates big vertical space. */
.projects-row .media {
  display: grid;
  place-items: center;
  margin: 0;
}

.project-card {
  position: relative;
  width: min(520px, 100%);
  max-width: 520px;
  aspect-ratio: 1 / 1;
  border-radius: clamp(18px, 4vw, 32px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  display: grid;
  place-items: center;
  overflow: hidden;
}

.project-card::after {
  content: "";
  position: absolute;
  inset: -18px;
  border-radius: 42px;
  background: radial-gradient(
    circle at 50% 55%,
    color-mix(in srgb, var(--accent), transparent 60%),
    transparent 65%
  );
  opacity: 0.95;
  z-index: -1;
}

.project-card img {
  width: clamp(58%, 9vw, 70%);
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, 0.35));
  opacity: 0.98;
}

/* Project text */
.project-title {
  margin: 0 0 12px;
  font-size: clamp(2rem, 3.8vw, 3.2rem);
  line-height: 1.15;
  color: #fff;
}

.project-desc {
  margin: 0 0 18px;
  max-width: 60ch;
  color: var(--text-soft);
  line-height: 2;
}

.project-btn {
  width: 100%;
  text-decoration: none;
}

/* Responsive: stack columns into one */

@media (max-width: 980px) {
  .projects-row {
    grid-template-columns: 1fr;
    gap: clamp(16px, 4vw, 28px);
  }

  .projects-row.is-reverse .project-media,
  .projects-row.is-reverse .project-info {
    order: initial;
  }

  .project-card {
    max-width: 520px;
    margin-inline: auto;
  }
}

@media (max-width: 560px) {
  .project-media {
    padding: 10px;
  }

  .project-card {
    width: 100%;
    max-width: 460px;
    aspect-ratio: 4 / 3;
    border-radius: 18px;
  }

  .project-card img {
    width: 64%;
    aspect-ratio: auto;
  }
}

@media (max-width: 420px) {
  .project-card {
    max-width: 100%;
    aspect-ratio: 16 / 13;
  }
}

/* =========================================================
   HOW WE WORK
   ---------------------------------------------------------
   What this section is:
   - A 4-card grid that becomes 2 columns then 1 column on smaller screens.
   ========================================================= */
.how-wrap {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
  text-align: center;
}

.how-title {
  margin: 0 0 10px;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1.08;
  color: #fff;
}

.how-subtitle {
  margin: 0 auto 44px;
  max-width: 720px;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.9;
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 28px);
  align-items: stretch;
}

.how-card {
  border-radius: 22px;
  padding: 34px 26px 28px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.how-card:hover {
  transform: translateY(-6px);
  border-color: rgba(184, 150, 247, 0.28);
  background: rgba(15, 16, 18, 0.62);
}

.how-icon {
  width: 78px;
  height: 78px;
  margin: 0 auto 18px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(184, 150, 247, 0.18);
  border: 1px solid rgba(184, 150, 247, 0.22);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.how-icon img {
  width: 30px;
  height: 30px;
  opacity: 0.9;
  object-fit: cover;
}

.how-card.is-highlight .how-icon {
  background: rgba(184, 150, 247, 0.26);
  border-color: rgba(184, 150, 247, 0.38);
  box-shadow: 0 18px 60px rgba(184, 150, 247, 0.18), 0 0 40px rgba(184, 150, 247, 0.18);
}

.how-card-title {
  margin: 0 0 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: rgba(255, 255, 255, 0.92);
}

.how-card-text {
  margin: 0 auto;
  max-width: 260px;
  color: var(--text-dimmer);
  line-height: 1.8;
  font-size: 0.98rem;
}

/* Fonts by language */
html[dir="rtl"] .how-title,
html[dir="rtl"] .how-card-title {
  font-family: var(--font-ar-title);
}

html[dir="ltr"] .how-title,
html[dir="ltr"] .how-card-title {
  font-family: var(--font-en-title);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

html[dir="rtl"] .how-subtitle,
html[dir="rtl"] .how-card-text {
  font-family: var(--font-ar-base);
}

html[dir="ltr"] .how-subtitle,
html[dir="ltr"] .how-card-text {
  font-family: var(--font-en-base);
  letter-spacing: 0.02em;
}

/* =========================================================
   IMPACT SECTION (Fixed-size cards)
   ---------------------------------------------------------
   What this section is:
   - Impact stats in equal-height cards.
   - Text is clamped to keep card height stable.
   Symbols explained:
   - -webkit-line-clamp is a WebKit-based multiline clamp method.
   ========================================================= */

.impact-section {
  text-align: center;
}

.impact-wrap {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
}

.impact-title {
  margin: 0 0 10px;
  font-size: clamp(2.6rem, 5vw, 4.2rem);
  line-height: 1.1;
  color: #fff;
}

.impact-subtitle {
  margin: 0 auto 44px;
  max-width: 720px;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.9;
}

.impact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(18px, 2.5vw, 28px);
  align-items: stretch;
  /* ensures equal row height behavior */
  justify-items: center;
}

.impact-card {
  width: 100%;
  max-width: 320px;

  /* Fixed size: prevents cards from growing with text */
  height: 230px;
  min-height: 230px;

  border-radius: 22px;
  padding: 42px 26px 36px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);

  /* Center content consistently inside fixed cards */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;

  transition: transform 0.25s ease, border-color 0.25s ease;
}

.impact-card:hover {
  transform: translateY(-6px);
  border-color: rgba(184, 150, 247, 0.35);
}

.impact-card.is-highlight {
  box-shadow: 0 25px 80px rgba(184, 150, 247, 0.25), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.impact-number {
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  font-weight: 800;
  color: var(--accent);
  margin: 0;
  line-height: 1;
}

.impact-text {
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1rem;
  line-height: 1.7;
  text-align: center;
  max-width: 22ch;

  /* Clamp text to keep card height stable (remove if you want full text) */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* Fonts by language */
html[dir="rtl"] .impact-title {
  font-family: var(--font-ar-title);
}

html[dir="ltr"] .impact-title {
  font-family: var(--font-en-title);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

html[dir="rtl"] .impact-text {
  font-family: var(--font-ar-base);
}

html[dir="ltr"] .impact-text {
  font-family: var(--font-en-base);
  letter-spacing: 0.02em;
}

/* =========================================================
   FAQ (clean and RTL-safe)
   ========================================================= */
.faq-section {
  text-align: center;

}

.faq-head {
  width: min(900px, 92%);
  margin: 0 auto 26px;
}

.faq-title {
  margin: 0 0 10px;
  font-size: clamp(34px, 4vw, 56px);
  font-weight: 800;
  letter-spacing: 0.2px;
  width: 100%;
  margin-inline: auto;
}

.faq-sub {
  margin: 0;
  color: var(--text-dimmer);
  font-size: 16px;
  width: 100%;
  margin-inline: auto;

}

.faq-list {
  width: min(980px, 92%);
  margin: 34px auto 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.faq-item {
  position: relative;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 20, 0.45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.30);
  overflow: hidden;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.faq-q {
  list-style: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;

  padding: 18px 22px;
  font-size: 16px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.92);
}

.faq-q::-webkit-details-marker {
  display: none;
}

.faq-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: transform 0.25s ease;
}

.faq-icon::before {
  content: "";
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
}

/* Smooth expand/collapse (RTL safe with text-align:start) */
.faq-a {
  padding: 0 22px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.8;
  font-size: 15px;
  text-align: start;

  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.35s ease, padding 0.25s ease, opacity 0.25s ease;
}

.faq-a>* {
  overflow: hidden;
}

.faq-item[open] .faq-a {
  grid-template-rows: 1fr;
  padding: 14px 22px 18px;
  opacity: 1;
}

.faq-item[open] .faq-q {
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-item:hover {
  border-color: color-mix(in srgb, var(--accent) 28%, rgba(255, 255, 255, 0.08));
}

html[dir="rtl"] .faq-q {
  flex-direction: row-reverse;
}

html[dir="rtl"] .faq-q>span:first-child {
  text-align: right;
}

@media (prefers-reduced-motion: reduce) {
  .faq-icon {
    transition: none;
  }

  .faq-a {
    transition: none;
  }
}

/* =========================================================
   CONTACT
   ========================================================= */
.contact-section {
  min-height: auto;
}

.contact-wrap {
  width: min(var(--wrap), 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(28px, 4vw, 56px);
  align-items: center;
}

html[dir="ltr"] .contact-wrap {
  direction: ltr;
}

html[dir="rtl"] .contact-wrap {
  direction: rtl;
}

.contact-info {
  text-align: start;
}

.contact-title {
  margin: 0 0 10px;
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  line-height: 1.08;
  color: #fff;
  letter-spacing: 0.2px;
}

.contact-subtitle {
  margin: 0 0 26px;
  color: var(--text-dim);
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.9;
  max-width: 520px;
}

.contact-items {
  display: grid;
  gap: 18px;
  margin-top: 12px;
}

.contact-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 16px;
  align-items: center;
}

.contact-icon {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: rgba(184, 150, 247, 0.1);
  border: 1px solid rgba(184, 150, 247, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 30px rgba(0, 0, 0, 0.25);
}

.contact-icon svg {
  width: 24px;
  height: 24px;
  color: rgba(184, 150, 247, 0.95);
}

.contact-text h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.contact-text p {
  margin: 0;
  color: var(--text-dimmer);
  font-size: 0.98rem;
  line-height: 1.65;
  max-width: none;
}

.contact-card {
  width: 100%;
  border-radius: 22px;
  padding: 28px;
  background: var(--glass-bg-2);
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.45), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
}

.field {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.field label {
  font-size: 0.95rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.64);
  text-align: start;
}

.contact-card input,
.contact-card textarea {
  width: 100%;
  border-radius: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.88);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.contact-card textarea {
  resize: none;
  min-height: 140px;
}

.contact-card input::placeholder,
.contact-card textarea::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.contact-card input:focus,
.contact-card textarea:focus {
  border-color: rgba(184, 150, 247, 0.55);
  box-shadow: 0 0 0 4px rgba(184, 150, 247, 0.1);
  background: rgba(255, 255, 255, 0.06);
}

html[dir="rtl"] .contact-card input,
html[dir="rtl"] .contact-card textarea {
  font-family: var(--font-ar-base);
}

html[dir="ltr"] .contact-card input,
html[dir="ltr"] .contact-card textarea {
  font-family: var(--font-en-title);
  letter-spacing: 0.02em;
}

html[dir="rtl"] .contact-card input::placeholder,
html[dir="rtl"] .contact-card textarea::placeholder {
  font-family: var(--font-ar-base);
}

html[dir="ltr"] .contact-card input::placeholder,
html[dir="ltr"] .contact-card textarea::placeholder {
  font-family: var(--font-en-title);
  letter-spacing: 0.02em;
}


.contact-btn {
  width: 100%;
  margin-top: 8px;
  height: 56px;
  border-radius: 14px;
  border: 0;
  cursor: pointer;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  background: linear-gradient(90deg, rgba(184, 150, 247, 1) 0%, rgba(255, 255, 255, 1) 100%);
  color: #1a1a1a;
  font-family: var(--font-ar-title);
  font-weight: 700;
  font-size: 1.05rem;
  box-shadow: 0 18px 45px rgba(184, 150, 247, 0.18);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.contact-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.02);
}

.btn-icon svg {
  width: 18px;
  height: 18px;
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  margin-top: 4rem;
  padding: 72px 0 28px;
  position: relative;
}

.footer-inner {
  width: min(var(--wrap), 92%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 0.9fr;
  gap: clamp(22px, 4vw, 64px);
  align-items: start;
}

.footer-brand {
  display: grid;
  gap: 16px;
}

.footer-logo-img {
  width: 160px;
  height: auto;
}

.footer-desc {
  margin: 0;
  max-width: 360px;
  color: var(--text-dimmer);
  line-height: 1.8;
  font-size: 0.98rem;
}

.footer-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 12px;
}

.footer-link {
  color: var(--text-dimmer);
  text-decoration: none;
  font-size: 0.98rem;
  transition: color 0.2s ease, transform 0.2s ease;
  display: inline-block;
}

.footer-link:hover {
  color: rgba(255, 255, 255, 0.85);
  transform: translateX(2px);
}

html[dir="rtl"] .footer-link:hover {
  transform: translateX(-2px);
}

.footer-social {
  display: flex;
  gap: 14px;
  align-items: center;
}

.social-btn {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.social-btn:hover {
  transform: translateY(-2px);
  background: rgba(184, 150, 247, 0.1);
  border-color: rgba(184, 150, 247, 0.35);
}

.social-btn img {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  filter: grayscale(1);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.social-btn:hover img {
  opacity: 1;
  filter: none;
}

.footer-bottom {
  width: min(var(--wrap), 92%);
  margin: 40px auto 0;
  padding-top: 18px;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.92rem;
}


/* ===== CR row (Saudi Business Center) — RTL-safe + mobile-safe ===== */
.cr-number {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: nowrap;

  /* Isolate this row from page direction */
  unicode-bidi: isolate;
}

.sbc-logo {
  width: 26px;
  height: 26px;
  object-fit: contain;
  flex: 0 0 auto;
}

/* Force the number to stay LTR even inside RTL layout */
.cr-number .footer-link {
  direction: ltr;
  unicode-bidi: plaintext;
  white-space: nowrap;
  line-height: 1.2;
}

/* Control icon position based on language direction */
html[dir="rtl"] .cr-number {
  flex-direction: row-reverse;
  /* Icon on the right in Arabic */
}

html[dir="ltr"] .cr-number {
  flex-direction: row;
  /* Icon on the left in English */
}

/* Mobile adjustments */
@media (max-width:560px) {
  .cr-number {
    flex-wrap: wrap;
    /* Prevent overflow on small screens */
  }
}


/* =========================================================
   RESPONSIVE (Unified)
   ========================================================= */
@media (max-width: 980px) {

  .how-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .impact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-wrap {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .partners-marquee {
    --fade: 84px;
  }

  .partners-track {
    --gap: 46px;
    --speed: 250s;
  }

  .partner-logo {
    height: 38px;
  }

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

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

  /* Adjust fixed card size for small screens */
  .impact-card {
    height: 210px;
    min-height: 210px;
    padding: 34px 22px 28px;
  }

  .site-footer {
    padding: 56px 0 22px;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .footer-logo-img {
    width: 150px;
    margin-inline: auto;
  }

  .footer-brand {
    text-align: center;
    justify-items: center;
  }

  .footer-col {
    text-align: center;
  }

  .footer-social {
    justify-content: center;
  }
}

@media (max-width: 520px) {
  .fp2-stack {
    height: 340px;
  }

  .fp2-card.is-active {
    width: 220px;
    height: 220px;
    top: 50%;
  }

  .fp2-card.is-p1 {
    width: 90px;
    height: 90px;
    left: 10%;
    top: 62%;
  }

  .fp2-card.is-p2 {
    width: 85px;
    height: 85px;
    left: 20%;
    top: 24%;
  }

  .fp2-card.is-p3 {
    width: 85px;
    height: 85px;
    left: 68%;
    top: 50%;
  }

  .fp2-card img {
    width: 72%;
  }
}

@media (max-width: 480px) {
  :root {
    --nav-h: 64px;
    --section-x: 1.25rem;
    --section-gap-under-nav: 2.25rem;
    --section-pad-top: calc(var(--nav-h) + var(--section-gap-under-nav));
  }

  .logo-img {
    height: 34px;
    max-width: 160px;
  }

  .lang-toggle {
    padding: 0.42rem 0.9rem;
    font-size: 0.85rem;
  }

  .contact-card {
    padding: 20px;
  }

  .contact-title {
    font-size: 2.3rem;
  }
}

/* =========================================================
   MOBILE NAV (Menu overlay)
   ========================================================= */
@media (max-width: 1100px) {
  .nav-container {
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 44px 1fr auto;
    align-items: center;
    gap: 10px;
  }

  .hamburger {
    display: flex;
    justify-self: start;
  }

  .nav-actions {
    justify-self: end;
  }

  .nav-menu {
    position: fixed;
    top: var(--nav-h);
    width: 100%;
    transform: none;
    flex-direction: column;
    gap: 0;
    padding: 0.75rem 0;
    text-align: center;
    background-color: rgba(21, 21, 24, 0.78);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: left 0.3s ease, right 0.3s ease;
    left: auto;
  }

  html[dir="rtl"] .nav-menu {
    right: -100%;
    left: auto;
  }

  html[dir="ltr"] .nav-menu {
    left: -100%;
    right: auto;
  }

  html[dir="rtl"] .nav-menu.active {
    right: 0;
  }

  html[dir="ltr"] .nav-menu.active {
    left: 0;
  }

  .nav-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-item:last-child {
    border-bottom: none;
  }

  .nav-link {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.78);
  }

  .nav-link:hover,
  .nav-link.active {
    color: #fff;
  }

  .nav-link::after {
    display: none;
  }
}

/* =========================================================
   CENTER FIX (Titles in Methodology/Impact/Partners)
   ========================================================= */
/* This prevents headings from inheriting text-align:start from internal wrappers */
#methodology,
.impact-section,
.partners-section {
  text-align: center;
}

#methodology .how-title,
#methodology .how-subtitle,
.impact-title,
.impact-subtitle,
.partners-section .partners-label,
.partners-section h2,
.partners-section h3 {
  width: 100%;
  text-align: center !important;
  margin-inline: auto !important;
}

#methodology h1,
#methodology h2,
#methodology h3,
.impact-section h1,
.impact-section h2,
.impact-section h3,
.partners-section h1,
.partners-section h2,
.partners-section h3 {
  width: 100%;
  text-align: center !important;
  margin-inline: auto !important;
}