:root {
  --bg: #F4F5F7;
  --surface: #FFFFFF;
  --surface-2: #EBEDF1;
  --ink: #12141A;
  --ink-soft: #4B5160;
  --ink-faint: #7B8291;
  --line: rgba(18,20,26,0.11);
  --line-strong: rgba(18,20,26,0.18);
  --accent: #A80F23;
  --accent-strong: #7E0B1A;
  --accent-soft: rgba(168,15,35,0.08);
  --accent-soft-2: rgba(168,15,35,0.14);
  --accent-ink: #FFFFFF;
  --shadow: 0 24px 60px -32px rgba(18,20,26,0.28);
  --radius: 18px;
  --header-h: 76px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0B0D10;
    --surface: #151922;
    --surface-2: #1B212C;
    --ink: #E6E8EB;
    --ink-soft: #97A0AF;
    --ink-faint: #626B7C;
    --line: rgba(230,232,235,0.09);
    --line-strong: rgba(230,232,235,0.16);
    --accent: #C81830;
    --accent-strong: #E0304A;
    --accent-soft: rgba(200,24,48,0.14);
    --accent-soft-2: rgba(200,24,48,0.22);
    --accent-ink: #F5F0F1;
    --shadow: 0 28px 64px -28px rgba(0,0,0,0.55);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

html[dir="rtl"] body { font-family: 'Tajawal', 'Segoe UI', sans-serif; }
html[dir="ltr"] body { font-family: 'Inter', 'Segoe UI', sans-serif; }

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

html[dir="rtl"] .disp { font-family: 'Tajawal', sans-serif; font-weight: 800; }
html[dir="ltr"] .disp { font-family: 'Space Grotesk', 'Inter', sans-serif; font-weight: 700; }
.disp { text-wrap: balance; line-height: 1.15; }

.mono { font-family: 'JetBrains Mono', ui-monospace, monospace; }

html[data-lang="ar"] .t-en { display: none !important; }
html[data-lang="en"] .t-ar { display: none !important; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }

a { color: inherit; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent);
}
.eyebrow::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -60px;
  inset-inline-start: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  border-radius: 10px;
  z-index: 200;
  font-size: 13px;
  font-weight: 700;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Site header / nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; width: 100%; }
.brandmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; flex-shrink: 0; }
.brandmark img { height: 34px; width: auto; display: block; }
.brandmark .wordmark {
  font-family: 'Space Grotesk', 'Tajawal', sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.06em;
}

.main-nav { display: flex; align-items: center; gap: 6px; }
.main-nav a {
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 9px 14px;
  border-radius: 9px;
}
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }
.main-nav a[aria-current="page"] { color: var(--accent); }

.header-actions { display: flex; align-items: center; gap: 10px; }

.lang-btn {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 500;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 100px;
  padding: 9px 16px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.lang-btn:hover { background: var(--surface-2); }

.btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 11px; font-size: 14px; font-weight: 700; text-decoration: none; border: 1px solid transparent; cursor: pointer; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-strong)); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { padding: 9px 16px; font-size: 13px; }

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  align-items: center; justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.nav-toggle span, .nav-toggle::before, .nav-toggle::after {
  content: ''; display: block; width: 17px; height: 2px; background: var(--ink); border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle::before { transform: translateY(-5px); }
.nav-toggle::after { transform: translateY(5px); }
.nav-toggle[aria-expanded="true"] span { opacity: 0; }
.nav-toggle[aria-expanded="true"]::before { transform: translateY(0) rotate(45deg); }
.nav-toggle[aria-expanded="true"]::after { transform: translateY(0) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: fixed;
  inset: var(--header-h) 0 0 0;
  background: var(--bg);
  z-index: 99;
  padding: 10px 28px 28px;
  overflow-y: auto;
}
.mobile-nav.open { display: block; }
.mobile-nav a {
  display: block;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}
.mobile-nav .btn { margin-top: 20px; width: 100%; justify-content: center; }

@media (max-width: 860px) {
  .main-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-actions .btn-primary.desktop-only { display: none; }
}

/* ---------- Cover (home hero) ---------- */
.cover {
  padding: 56px 0 64px;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
.cover::before {
  content: '';
  position: absolute;
  top: -220px;
  inset-inline-end: -160px;
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft-2), transparent 68%);
  pointer-events: none;
}
.cover h1 {
  font-size: clamp(38px, 6.2vw, 64px);
  font-weight: 800;
  margin: 0 0 20px;
  line-height: 1.28;
  position: relative;
  z-index: 1;
}
html[dir="ltr"] .cover h1 { font-weight: 700; }
.cover h1 em { font-style: normal; color: var(--accent); }
.cover .lede {
  max-width: 640px;
  font-size: 18.5px;
  color: var(--ink-soft);
  margin: 0 0 36px;
  position: relative;
  z-index: 1;
}
.cover .cta-row { position: relative; z-index: 1; margin-bottom: 44px; }

.meta-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  column-gap: 32px;
  border-top: 1px solid var(--line);
  position: relative;
  z-index: 1;
}
.meta-strip div { padding-top: 18px; }
.meta-strip .k { font-size: 11px; letter-spacing: 0.02em; color: var(--ink-faint); margin-bottom: 6px; }
.meta-strip .v { font-size: 15px; font-weight: 700; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { padding: 48px 0 56px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.page-hero::before {
  content: '';
  position: absolute;
  top: -180px;
  inset-inline-end: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-soft-2), transparent 68%);
  pointer-events: none;
}
.breadcrumb { position: relative; z-index: 1; font-size: 12.5px; color: var(--ink-faint); margin-bottom: 18px; }
.breadcrumb a { text-decoration: none; color: var(--ink-faint); }
.breadcrumb a:hover { color: var(--accent); }
.page-hero h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; margin: 10px 0 16px; position: relative; z-index: 1; }
html[dir="ltr"] .page-hero h1 { font-weight: 700; }
.page-hero .lede { max-width: 620px; font-size: 17px; color: var(--ink-soft); margin: 0; position: relative; z-index: 1; }

/* ---------- Section shell ---------- */
section.block { padding: 72px 0; border-bottom: 1px solid var(--line); }
section.block:last-of-type { border-bottom: none; }
.block-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 40px; flex-wrap: wrap; }
.block-head h2 { font-size: clamp(25px, 3.2vw, 34px); font-weight: 800; margin: 10px 0 0; }
html[dir="ltr"] .block-head h2 { font-weight: 700; }
.block-head p { max-width: 480px; color: var(--ink-soft); font-size: 15px; margin: 10px 0 0; }

/* ---------- About ---------- */
.about-body { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.about-body p { font-size: 16.5px; color: var(--ink-soft); margin: 0 0 18px; }
.about-body p:last-child { margin-bottom: 0; }
.about-body strong { color: var(--ink); font-weight: 800; }

.pillars { display: flex; flex-direction: column; gap: 0; }
.pillar { padding: 16px 0; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; }
.pillar:last-child { border-bottom: 1px solid var(--line); }
.pillar .t { font-weight: 700; font-size: 14.5px; }
.pillar .d { color: var(--ink-faint); font-size: 13px; text-align: end; max-width: 230px; }

/* ---------- Services ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.svc-card { background: var(--surface); padding: 28px 26px; transition: background 0.25s ease; }
.svc-card:hover { background: var(--surface-2); }
.svc-card.link-card { text-decoration: none; color: inherit; display: block; }
.svc-num { font-family: 'JetBrains Mono', monospace; font-size: 12px; color: var(--accent); margin-bottom: 18px; display: block; }
.svc-card h3 { font-size: 16.5px; font-weight: 800; margin: 0 0 10px; }
.svc-card p { font-size: 13.8px; color: var(--ink-soft); margin: 0 0 14px; }
.svc-card p:last-child { margin-bottom: 0; }
.svc-card ul { margin: 12px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 7px; }
.svc-card ul li { font-size: 13px; color: var(--ink-soft); padding-inline-start: 18px; position: relative; }
.svc-card ul li::before { content: '\2013'; position: absolute; inset-inline-start: 0; color: var(--accent); }
.svc-more { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); text-decoration: none; margin-top: 4px; }

/* ---------- Approach ---------- */
.approach-wrap { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 56px; align-items: center; }
.step { display: flex; gap: 18px; padding: 20px 0; border-top: 1px solid var(--line); }
.steps .step:last-child { border-bottom: 1px solid var(--line); }
.step .idx { font-family: 'JetBrains Mono', monospace; font-size: 13px; color: var(--accent); flex-shrink: 0; width: 28px; padding-top: 2px; }
.step h4 { margin: 0 0 6px; font-size: 15.5px; font-weight: 800; }
.step p { margin: 0; font-size: 13.8px; color: var(--ink-soft); }

.diagram { aspect-ratio: 1 / 1; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; position: relative; box-shadow: var(--shadow); }
.diagram svg { width: 84%; height: 84%; }
.diagram .corner { position: absolute; font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--ink-faint); letter-spacing: 0.03em; }
.diagram .corner.tl { top: 18px; inset-inline-start: 20px; }
.diagram .corner.br { bottom: 18px; inset-inline-end: 20px; }

/* ---------- Case studies ---------- */
.case-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.case-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 30px 28px; background: var(--surface); display: flex; flex-direction: column; gap: 16px; }
.case-kicker { font-size: 11.5px; letter-spacing: 0.01em; color: var(--ink-faint); }
.case-card h3 { font-weight: 800; font-size: 20px; margin: 0; }
.case-card p { color: var(--ink-soft); font-size: 14.3px; margin: 0; }
.case-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.case-facts .k { font-size: 10.5px; letter-spacing: 0.01em; color: var(--ink-faint); margin-bottom: 3px; }
.case-facts .v { font-size: 13px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-family: 'JetBrains Mono', monospace; font-size: 11px; padding: 5px 10px; border-radius: 100px; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-soft-2); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.stat { background: var(--surface); padding: 30px 20px; text-align: center; }
.stat .num { font-family: 'JetBrains Mono', monospace; font-size: clamp(27px, 3.8vw, 36px); font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat .lbl { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

/* ---------- Engagement / Industries ---------- */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.eng-item { display: flex; gap: 14px; margin-bottom: 22px; }
.eng-item:last-child { margin-bottom: 0; }
.eng-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 8px; flex-shrink: 0; }
.eng-item h4 { margin: 0 0 4px; font-size: 15px; font-weight: 800; }
.eng-item p { margin: 0; font-size: 13.6px; color: var(--ink-soft); }

.industries { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.ind-chip { padding: 10px 16px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; font-weight: 600; background: var(--surface); }

.values-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 36px; }
.value h4 { font-weight: 800; font-size: 17px; margin: 0 0 8px; }
.value p { font-size: 13.8px; color: var(--ink-soft); margin: 0; }
.value .vnum { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-size: 12px; display: block; margin-bottom: 10px; }

/* ---------- Contact page ---------- */
.contact-grid { display: grid; grid-template-columns: 1.2fr 0.8fr; gap: 48px; align-items: start; }
.form-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.field .req { color: var(--accent); }
.field input, .field textarea, .field select {
  width: 100%;
  font-family: inherit;
  font-size: 14.5px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--bg);
  color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field textarea { resize: vertical; min-height: 120px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-status { font-size: 13.5px; margin-top: 14px; display: none; padding: 12px 14px; border-radius: 10px; }
.form-status.show { display: block; }
.form-status.ok { background: rgba(30,160,90,0.12); color: #1b8f52; }
.form-status.err { background: rgba(200,24,48,0.1); color: var(--accent-strong); }
.form-hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

.contact-side { display: flex; flex-direction: column; gap: 22px; }
.contact-block { border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; background: var(--surface); }
.contact-block .k { font-size: 11.5px; color: var(--ink-faint); margin-bottom: 6px; }
.contact-block .v { font-size: 15px; font-weight: 700; }
.contact-block a.v { text-decoration: none; color: var(--ink); }
.contact-block a.v:hover { color: var(--accent); }
.hp-field { position: absolute; inset-inline-start: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* honeypot required attr must never actually be required for humans */

/* ---------- Contact band ---------- */
.contact-band { padding: 80px 0 90px; text-align: center; position: relative; overflow: hidden; }
.contact-band::before {
  content: '';
  position: absolute;
  inset-inline-start: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 700px;
  height: 260px;
  background: radial-gradient(ellipse at center, var(--accent-soft-2), transparent 70%);
  pointer-events: none;
}
.contact-band h2 { font-weight: 800; font-size: clamp(27px, 4.2vw, 40px); margin: 0 0 16px; line-height: 1.3; position: relative; }
.contact-band p { color: var(--ink-soft); max-width: 480px; margin: 0 auto 32px; position: relative; }
.contact-band .cta-row { display: flex; gap: 14px; justify-content: center; position: relative; flex-wrap: wrap; }

.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- 404 ---------- */
.error-page { padding: 120px 0; text-align: center; }
.error-page .code { font-family: 'JetBrains Mono', monospace; font-size: 15px; color: var(--accent); margin-bottom: 14px; }
.error-page h1 { font-size: clamp(30px, 5vw, 44px); font-weight: 800; margin: 0 0 16px; }
.error-page p { color: var(--ink-soft); margin: 0 0 32px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 56px 0 30px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.footer-col h5 { font-size: 12px; letter-spacing: 0.02em; color: var(--ink-faint); margin: 0 0 16px; }
.footer-col p { font-size: 13.5px; color: var(--ink-soft); margin: 0; max-width: 260px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 11px; }
.footer-col a { font-size: 13.5px; text-decoration: none; color: var(--ink-soft); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom { padding-top: 26px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; color: var(--ink-faint); font-size: 12.5px; flex-wrap: wrap; gap: 10px; }

@media (max-width: 860px) {
  .about-body, .approach-wrap, .two-col, .case-grid, .contact-grid { grid-template-columns: 1fr; }
  .svc-grid, .values-row { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .meta-strip { grid-template-columns: repeat(2, 1fr); row-gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

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

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
