/* ============================================================================
   SettlMe / SIMC Design System — token source of truth for the site.
   Consolidated from the handoff `_ds/` tokens (colors, typography, spacing,
   shape, motion). Eight named colours, cut corners never rounded, 8px grid.
   Display: Space Grotesk · Body: IBM Plex Sans · Arabic: Cairo.
   ============================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=Cairo:wght@300;400;500;700&display=swap');

:root {
  /* --- Colour · Primary --- */
  --navy-800: #0e223a; /* Deep Navy — primary surface, headlines */
  --blue-600: #253f8f; /* Electric Blue — CTAs, links, active states */
  --white: #ffffff;

  /* --- Colour · Accents --- */
  --orange-500: #ff5a1f; /* Neon Orange — action, energy. ONE per screen */
  --orange-700: #c9410f; /* shadowed face of the crate in the illustration */
  --purple-600: #7c3aed; /* Vibrant Purple — Premium / VIP only */
  --green-500: #22c55e; /* Fresh Green — success states only */

  /* --- Colour · Neutrals --- */
  --gray-100: #f3f4f6; /* Light Gray — surfaces, dividers */
  --gray-400: #9ca3af; /* Mid Gray — secondary text, captions */

  /* --- Illustration navy tones --- */
  --iso-mid: #1e3455;
  --iso-dark: #16304f;

  /* --- Semantic surfaces --- */
  --surface-page: var(--white);
  --surface-page-alt: var(--gray-100);
  --surface-dark: var(--navy-800);
  --surface-card: var(--white);

  /* --- Semantic text --- */
  --text-display: var(--navy-800);
  --text-body: var(--navy-800);
  --text-muted: var(--gray-400);
  --text-on-dark: var(--white);
  --text-on-dark-muted: rgba(255, 255, 255, 0.72);
  --text-link: var(--blue-600);
  --text-label: var(--blue-600);
  --text-label-on-dark: rgba(255, 255, 255, 0.6);

  /* --- Semantic action --- */
  --action-primary: var(--blue-600);
  --action-primary-hover: color-mix(in srgb, var(--blue-600) 86%, #000);
  --action-accent: var(--orange-500);
  --action-accent-hover: color-mix(in srgb, var(--orange-500) 88%, #000);
  --action-premium: var(--purple-600);
  --action-premium-hover: color-mix(in srgb, var(--purple-600) 88%, #000);

  /* --- Status --- */
  --status-success: var(--green-500);

  /* --- Lines and scrims --- */
  --line-hairline: color-mix(in srgb, var(--gray-400) 42%, var(--white));
  --line-strong: var(--navy-800);
  --line-on-dark: rgba(255, 255, 255, 0.14);
  --scrim: rgba(14, 34, 58, 0.78);
  --photo-scrim: linear-gradient(to top, rgba(14, 34, 58, 0.94) 32%, rgba(14, 34, 58, 0.15));

  /* --- Typography · families --- */
  --font-latin: 'IBM Plex Sans', system-ui, sans-serif;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-arabic: 'Cairo', 'Segoe UI', Tahoma, sans-serif;

  /* --- Typography · weights --- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* --- Latin display scale (fluid) --- */
  --size-display-1: clamp(40px, 5.4vw, 72px);
  --size-display-2: clamp(32px, 4vw, 56px);
  --size-display-3: clamp(28px, 3vw, 40px);
  --size-heading-1: clamp(24px, 2.4vw, 32px);
  --size-heading-2: 24px;
  --size-heading-3: 20px;
  --lh-display: 1.06;
  --ls-display: -0.03em;

  /* --- Latin body scale --- */
  --size-body-lg: 18px;
  --size-body: 16px;
  --size-body-sm: 14px;
  --size-caption: 12px;
  --lh-body: 1.6;

  /* --- Section eyebrow label: "03 · OUR SERVICES" --- */
  --size-label: 12px;
  --ls-label: 0.16em;

  /* --- Spacing · 8px grid --- */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 40px;
  --space-6: 48px;
  --space-8: 64px;
  --space-10: 80px;
  --space-12: 96px;
  --space-16: 128px;
  --gutter: 24px;
  --page-max: 1280px;
  --page-pad: 48px;
  --header-h: 80px;
  --section-y: clamp(96px, 8vw, 128px);
  --pattern-tile: 260px;

  /* --- Shape · cut corners, never rounded --- */
  --notch-card: 18px;
  --notch-band: 40px;
  --notch-sm: 10px;
  --radius-input: 2px;
  --border-width: 1px;
  /* Cut top-right corner (LTR default) */
  --crate-18: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
  --crate-40: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 0 100%);
  --crate-10: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%);
  /* Mirrored: cut top-left (RTL) */
  --crate-18-rtl: polygon(18px 0, 100% 0, 100% 100%, 0 100%, 0 18px);
  --crate-40-rtl: polygon(40px 0, 100% 0, 100% 100%, 0 100%, 0 40px);
  --crate-10-rtl: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);

  /* --- Motion --- */
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --dur-slow: 320ms;
  --transition-action: background-color var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-standard), box-shadow var(--dur-fast) var(--ease-standard);

  /* Arabic overrides */
  --ar-lh-display: 1.35;
  --ar-lh-body: 1.9;
  --ar-size-label: 13px;
}

/* ---------- Reset ---------- */
* {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
/* Clip (not hidden) so horizontal overflow is contained WITHOUT turning the
   body into a scroll container — hidden here would break the sticky story. */
body {
  overflow-x: clip;
  max-width: 100%;
}
body {
  margin: 0;
  background: var(--navy-800);
  color: var(--text-body);
  font-family: var(--font-latin);
  font-size: var(--size-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  letter-spacing: var(--ls-display);
  line-height: var(--lh-display);
  margin: 0;
}
p {
  margin: 0;
}
a {
  color: inherit;
  text-decoration: none;
}
img,
svg {
  display: block;
  max-width: 100%;
}
button {
  font-family: inherit;
}

/* ---------- Arabic / RTL: full font + rhythm swap ---------- */
[dir='rtl'] body {
  font-family: var(--font-arabic);
  line-height: var(--ar-lh-body);
}
[dir='rtl'] h1,
[dir='rtl'] h2,
[dir='rtl'] h3 {
  font-family: var(--font-arabic);
  letter-spacing: 0;
  line-height: var(--ar-lh-display);
}

/* ---------- Reusable primitives ---------- */

/* Section eyebrow label — "01 · WHO WE ARE" */
.eyebrow {
  font-family: var(--font-latin);
  font-size: var(--size-label);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-label);
}
.eyebrow--on-dark {
  color: var(--text-label-on-dark);
}
[dir='rtl'] .eyebrow {
  font-family: var(--font-arabic);
  font-size: var(--ar-size-label);
  letter-spacing: 0;
  text-transform: none;
  font-weight: var(--weight-medium);
}

/* Crate: a cut-corner container. Notch mirrors in RTL. */
.crate {
  clip-path: var(--crate-18);
}
[dir='rtl'] .crate {
  clip-path: var(--crate-18-rtl);
}
.crate--band {
  clip-path: var(--crate-40);
}
[dir='rtl'] .crate--band {
  clip-path: var(--crate-40-rtl);
}
.crate--sm {
  clip-path: var(--crate-10);
}
[dir='rtl'] .crate--sm {
  clip-path: var(--crate-10-rtl);
}

/* Content width helper */
.wrap {
  max-width: var(--page-max);
  margin-inline: auto;
}

/* ---------- Buttons (cut-corner crate, 3px hover lift) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 24px;
  font-family: var(--font-latin);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  clip-path: var(--crate-10);
  transition: var(--transition-action);
}
[dir='rtl'] .btn {
  font-family: var(--font-arabic);
  clip-path: var(--crate-10-rtl);
}
.btn:hover {
  transform: translateY(-3px);
}
.btn--accent {
  background: var(--orange-500);
  color: var(--white);
}
.btn--accent:hover {
  background: var(--action-accent-hover);
  color: var(--white);
}
.btn--primary {
  background: var(--blue-600);
  color: var(--white);
}
.btn--primary:hover {
  background: var(--action-primary-hover);
  color: var(--white);
}
.btn--premium {
  background: var(--purple-600);
  color: var(--white);
}
.btn--premium:hover {
  background: var(--action-premium-hover);
  color: var(--white);
}
/* White crate that turns orange on hover — the nav / hero primary. */
.btn--onLight {
  background: var(--white);
  color: var(--navy-800);
}
.btn--onLight:hover {
  background: var(--orange-500);
  color: var(--white);
}
/* Outline / secondary on light surfaces. */
.btn--secondary {
  background: transparent;
  color: var(--navy-800);
  box-shadow: inset 0 0 0 1px var(--navy-800);
}
.btn--secondary:hover {
  background: var(--navy-800);
  color: var(--white);
}
/* Ghost on dark (About "See the services"). */
.btn--ghostDark {
  background: transparent;
  color: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}
.btn--ghostDark:hover {
  background: var(--white);
  color: var(--navy-800);
}

/* ---------- Section shell ---------- */
.section {
  padding: var(--section-y) var(--page-pad);
}
.section > .wrap {
  display: block;
}
@media (max-width: 900px) {
  :root {
    --page-pad: 32px;
  }
}
@media (max-width: 640px) {
  :root {
    --page-pad: 24px;
    --section-y: clamp(64px, 12vw, 88px);
  }
}
@media (max-width: 400px) {
  :root {
    --page-pad: 18px;
  }
}

/* Mobile hero: keep the metadata strip and caption inside the screen */
@media (max-width: 640px) {
  .story-meta span {
    font-size: 10px;
    letter-spacing: 0.08em;
    line-height: 1.4;
  }
  .story-caption p {
    max-width: 100% !important;
  }
}

/* Back-to-top control */
.to-top {
  position: fixed;
  inset-block-end: 24px;
  inset-inline-end: 24px;
  z-index: 60;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  background: var(--white);
  color: var(--navy-800);
  border: 0;
  cursor: pointer;
  clip-path: var(--crate-10);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 180ms var(--ease-standard), transform 180ms var(--ease-standard),
    background-color 120ms var(--ease-standard), color 120ms var(--ease-standard);
}
[dir='rtl'] .to-top {
  clip-path: var(--crate-10-rtl);
}
.to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.to-top:hover {
  background: var(--orange-500);
  color: var(--white);
  transform: translateY(-3px);
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------- Responsive: nav + footer (were React <style> blocks) ---------- */
.lift { transition: transform 120ms var(--ease-standard); }
.lift:hover { transform: translateY(-3px); }

@media (max-width: 900px) {
  .nav-links { display: none !important; }
}
@media (max-width: 820px) {
  .footer-grid { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr !important; gap: 28px !important; }
}
/* Keep the fixed header inside narrow screens */
@media (max-width: 480px) {
  #nav { gap: 12px !important; }
  #nav .btn--onLight { padding: 0 14px !important; font-size: 13px !important; }
}
/* Long links/emails must not force horizontal scroll */
footer a, footer span { word-break: break-word; overflow-wrap: anywhere; }

/* ---------- Mobile menu (hamburger) ---------- */
.menu-btn { display: none; background: none; border: 0; color: var(--white); cursor: pointer; padding: 0; width: 44px; height: 44px; align-items: center; justify-content: center; }
.menu-btn svg { width: 26px; height: 26px; }
.mobile-menu {
  position: fixed; inset: 0; z-index: 60; background: var(--navy-800); color: var(--white);
  display: flex; flex-direction: column; padding: 96px var(--page-pad) 40px;
  transform: translateY(-100%); opacity: 0; pointer-events: none;
  transition: transform 0.34s var(--ease-out), opacity 0.34s var(--ease-out);
}
.mobile-menu.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
.mm-close { position: absolute; top: 26px; inset-inline-end: var(--page-pad); background: none; border: 0; color: var(--white); cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; }
.mm-close svg { width: 26px; height: 26px; }
.mm-links { display: flex; flex-direction: column; }
.mm-links .mlink {
  font-family: var(--font-display); font-size: clamp(26px, 8vw, 34px); font-weight: 600;
  color: var(--white); text-decoration: none; padding: 18px 0;
  border-bottom: 1px solid var(--line-on-dark); letter-spacing: -0.02em;
}
[dir='rtl'] .mm-links .mlink { font-family: var(--font-arabic); }
.mm-foot { margin-top: auto; display: flex; flex-direction: column; gap: 22px; padding-top: 28px; }
.mm-cta { align-self: flex-start; height: 48px; padding: 0 28px; font-size: 15px; }

/* show hamburger, hide desktop nav bits, on mobile */
@media (max-width: 900px) {
  .menu-btn { display: inline-flex; }
  .nav-right { display: none !important; }
}
@media (min-width: 901px) {
  .mobile-menu { display: none !important; }
}

/* keep the menu above the back-to-top control, and hide that control while open */
.mobile-menu { z-index: 70; }
.mobile-menu.open ~ .to-top { display: none !important; }
